@visactor/lark-vchart 2.0.12 → 2.0.13-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +1 -1
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -22,4 +22,4 @@ function r(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n
22
22
  *
23
23
  * Copyright 2011 - 2019 Tim Guan-tin Chien and contributors.
24
24
  * Released under the MIT license
25
- */GG.defaultOptions={gridSize:8,ellipticity:1,maxSingleWordTryCount:1};var YG=function(t){function e(t){var r;return n(this,e),(r=i(this,e,[et({},e.defaultOptions,t)])).random=r.options.random?Math.random:function(){return 0},r.aspectRatio=1,r}return c(e,t),a(e,[{key:"fit",value:function(t){for(var e=0,i=this.result.length;e<i;e++)if(XG(t,this.result[e]))return!1;return!0}},{key:"getTextInfo",value:function(t,e){var 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]},n=this.options.getTextBounds(i);return i.width=n.width(),i.height=n.height(),i.top=this.center[1]-i.height+.21*i.height,i.left=this.center[0]-i.width/2,i}},{key:"layoutWord",value:function(t){for(var e=this.getTextInfo(this.data[t],t),i=2*Math.PI,n=0,r=e.left,a=e.top,o=e.width,s=e.height,l=1,u=this.fit(e);!u&&n<this.maxRadius;)n+=.5,l=this.shape(n/this.maxRadius*2*Math.PI),i+=.5*(this.options.random?this.random()>.5?1:-1:t%2==0?1:-1),r=this.center[0]-o/2+n*l*Math.cos(i)*this.aspectRatio,a=this.center[1]-s/2+n*l*Math.sin(i),e.left=r,e.top=a,e.x=r+o/2,e.y=a+s/2,u=this.fit(e);return!!u&&!!(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)}},{key:"layout",value:function(t,e){var i=this;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((function(t,e){return i.getTextFontSize(e)-i.getTextFontSize(t)}));for(var n=0;n<t.length&&(this.layoutWord(n),n++,this.progressiveIndex=n,!this.exceedTime()););return this.result}}])}(LG);function XG(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)}YG.defaultOptions={enlarge:!1};var KG={x:"x",y:"y",z:"z",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",angle:"angle"},qG=function(t,e){var i,n,r,a,o,s;if(t.size&&(t.size[0]<=0||t.size[1]<=0))return xt.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];var l=e,u=(null!==(i=t.size)&&void 0!==i?i:[500,500]).slice();u[0]=Math.floor(u[0]),u[1]=Math.floor(u[1]);var c=t.fontFamily?ZG(t.fontFamily):"sans-serif",h=t.fontStyle?ZG(t.fontStyle):"normal",d=t.fontWeight?ZG(t.fontWeight):"normal",v=t.rotate?ZG(t.rotate):0,f=ZG(t.text),p=null!==(n=t.spiral)&&void 0!==n?n:"archimedean",g=t.padding?ZG(t.padding):1,y=null!==(r=t.shape)&&void 0!==r?r:"square",m=null!==(a=t.shrink)&&void 0!==a&&a,_=null!==(o=t.enlarge)&&void 0!==o&&o,b=null!==(s=t.clip)&&void 0!==s&&s,k=t.minFontSize,x=t.randomVisible,S=t.as?Object.assign(Object.assign({},KG),t.as):KG,A=t.depth_3d,M=t.postProjection,w=t.fontSize?ZG(t.fontSize):14,T=t.fontSizeRange;if(T&&!F(w)){var C=w,E=QG($G(C,l),T);w=function(t){return E(C(t))}}var B=IG;"fast"===t.layoutType?B=YG:"grid"===t.layoutType&&(B=GG);var P=new B(Object.assign(Object.assign({},t),{text:f,padding:g,spiral:p,shape:y,rotate:v,fontFamily:c,fontStyle:h,fontWeight:d,fontSize:w,shrink:m,clip:b,enlarge:_,minFontSize:k,random:x,outputCallback:function(e){for(var i,n,r=[],a=0,o=e.length;a<o;a++)(i=(n=e[a]).datum)[S.x]=n.x,i[S.y]=n.y,i[S.fontFamily]=n.fontFamily,i[S.fontSize]=n.fontSize,i[S.fontStyle]=n.fontStyle,i[S.fontWeight]=n.fontWeight,i[S.angle]=n.angle,"StereographicProjection"===M&&tY(u,n,i,S,A),t.dataIndexKey&&(i[t.dataIndexKey]="".concat(a)),r.push(i);return r}}));return P.layout(l,{width:u[0],height:u[1]}),t.progressiveStep>0||t.progressiveTime>0?{progressive:P}:P.output()},ZG=function(t){return L(t)||F(t)||w(t)||O(t)?t:function(e){return e[t.field]}},JG=function(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)},QG=function(t,e,i){if(t[0]===t[1])return function(t){return e[0]};var n=JG(t[0]),r=JG(t[1]),a=Math.min(n,r),o=Math.max(n,r);return function(t){return(JG(t)-a)/(o-a)*(e[1]-e[0])+e[0]}},$G=function(t,e){for(var i,n=1/0,r=-1/0,a=e.length,o=0;o<a;++o)(i=yt(t(e[o])))<n&&(n=i),i>r&&(r=i);return 1===e.length&&n===r&&(n-=1e4),[n,r]};function tY(t,e,i,n,r){var a=Math.max(t[0],t[1])/2,o=function(t,e,i,n,r){var a=r.x,o=r.y,s=a/t*Math.PI*2,l=Math.PI-o/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(s)+n.x,y:i*Math.cos(l)+n.y,z:i*Math.sin(l)*Math.sin(s)+n.z}}(t[0],t[1],a,{x:a,y:a,z:null!=r?r:a},e);i[n.x]=o.x,i[n.y]=o.y,i[n.z]=o.z}var eY=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=_L.wordCloud,t}return c(e,t),a(e)}(PW);eY.type=_L.wordCloud;var iY=function(){rO.registerGrammarTransform("wordcloud",{transform:qG}),GV(),rO.registerAnimation("wordCloud",(function(t,e){return{appear:RW(t,e),enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{duration:KD.disappear.duration}}})),rO.registerSeries(eY.type,eY)},nY=function(t,e){var i,n,r=t.map((function(t){return Object.assign({},t)}));if(!r||0===r.length)return r;var a=e.valueField,o=e.asTransformRatio,s=e.asReachRatio,l=e.asHeightRatio,u=e.asValueRatio,c=e.asNextValueRatio,h=e.asLastValueRatio,d=e.asLastValue,v=e.asCurrentValue,f=e.asNextValue,p=e.heightVisual,g=void 0!==p&&p,y=e.isCone,m=void 0===y||y,_=e.range,b=r.reduce((function(t,e){return Math.max(t,Number.parseFloat(e[a])||-1/0)}),-1/0),k=r.reduce((function(t,e){return Math.min(t,Number.parseFloat(e[a])||1/0)}),1/0),x=[null!==(i=null==_?void 0:_.min)&&void 0!==i?i:k,null!==(n=null==_?void 0:_.max)&&void 0!==n?n:b];return r.forEach((function(t,e){var i,n,p=Number.parseFloat(t[a]),y=Number.parseFloat(null===(i=r[e-1])||void 0===i?void 0:i[a]),_=Number.parseFloat(null===(n=r[e+1])||void 0===n?void 0:n[a]),b=z(_*p)&&0!==p?_/p:0,k=z(p*y)&&0!==y?p/y:0;d&&(t[d]=y),f&&(t[f]=_),o&&(t[o]=b),s&&(t[s]=0===e?1:k),l&&(t[l]=!0===g?b:1/r.length),u&&(t[u]=p/x[1]),c&&(t[c]=e===r.length-1?m?0:t[u]:_/x[1]),h&&(t[h]=0===e?1:y/x[1]),v&&(t[v]=p)})),r},rY=function(t,e){var i,n,r=null===(n=null===(i=t[0])||void 0===i?void 0:i.latestData)||void 0===n?void 0:n.map((function(t){return Object.assign({},t)}));return r&&0!==r.length?(r.shift(),r.forEach((function(t){t[e.asIsTransformLevel]=!0})),r):r},aY="".concat(TO,"_FUNNEL_TRANSFORM_RATIO"),oY="".concat(TO,"_FUNNEL_REACH_RATIO"),sY="".concat(TO,"_FUNNEL_HEIGHT_RATIO"),lY="".concat(TO,"_FUNNEL_VALUE_RATIO"),uY="".concat(TO,"_FUNNEL_LAST_VALUE_RATIO"),cY="".concat(TO,"_FUNNEL_NEXT_VALUE_RATIO"),hY="".concat(TO,"_FUNNEL_LAST_VALUE"),dY="".concat(TO,"_FUNNEL_CURRENT_VALUE"),vY="".concat(TO,"_FUNNEL_NEXT_VALUE"),fY="".concat(TO,"_FUNNEL_TRANSFORM_LEVEL"),pY=function(t){function e(t){var r,a,o;return n(this,e),(r=i(this,e,[t])).dimensionTooltipTitleCallback=function(t,e){var i,n,a,o=r.series;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?r._transformRatioText:null!==(n=r._getDimensionData(t))&&void 0!==n?n:null===(a=t.properties)||void 0===a?void 0:a["".concat(o.getCategoryField())]},r.markTooltipValueCallback=function(t,e){var i;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?"".concat((100*(null==t?void 0:t[oY])).toFixed(1),"%"):r._getMeasureData(t)},r.markTooltipKeyCallback=function(t,e){var i;if("transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name))return r._transformRatioText;var n=r._seriesCacheInfo,a=n.dimensionFields,o=n.seriesFields,s=a[a.length-1];return C(o[0])?null==t?void 0:t[o[0]]:null==t?void 0:t[s]},r._transformRatioText=null!==(o=null===(a=t.getSpec())||void 0===a?void 0:a.transformRatioText)&&void 0!==o?o:"转化率",r}return c(e,t),a(e)}(wF),gY=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{points:[]})}}])}(HD),yY=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t}return c(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{lineWidth:0})}}])}(gY);yY.type="polygon";var mY=function(){rO.registerMark(yY.type,yY),vM(),sM(),RT.registerBuiltInAnimate("growPointsOut",EC),rO.registerGraphicComponent("polygon",Mp)},_Y=Object.assign(Object.assign({},jF),{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"}}),bY=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"funnel"),t.isTransform&&this._addMarkLabelSpec(t,"transform","transformLabel")}}])}(tj),kY=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=_L.funnel,t._funnelMarkName="funnel",t._funnelMarkType="polygon",t._transformMarkName="transform",t._transformMarkType="polygon",t.transformerConstructor=bY,t._funnelMark=null,t._funnelTransformMark=null,t._labelMark=null,t._transformLabelMark=null,t._funnelOuterLabelMark={},t}return c(r,e),a(r,[{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"setAttrFromSpec",value:function(){var t,e,i,n,a;_(r,"setAttrFromSpec",this,3)([]),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!==(a=null===(n=null===(i=this._spec.outerLabel)||void 0===i?void 0:i.line)||void 0===n?void 0:n.minLength)&&void 0!==a?a: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)}},{key:"initData",value:function(){if(_(r,"initData",this,3)([]),this._data){EI(this._dataSet,"funnel",nY),EI(this._dataSet,"funnelTransform",rY);var t=new Xo(this._dataSet,{name:"".concat(TO,"_series_").concat(this.id,"_viewDataTransform")});t.parse([this.getViewData()],{type:"dataview"}),this._viewDataTransform=new ID(this._option,t)}}},{key:"compile",value:function(){var t,e;_(r,"compile",this,3)([]),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()}))}},{key:"compileData",value:function(){var t;_(r,"compileData",this,3)([]),null===(t=this._viewDataTransform)||void 0===t||t.compile()}},{key:"getStatisticFields",value:function(){var t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}},{key:"_statisticViewData",value:function(){var t,e,i,n,a,o,s,l,u;_(r,"_statisticViewData",this,3)([]),this._data.getDataView().transform({type:"funnel",options:{valueField:this.getValueField(),isCone:this._spec.isCone,asCurrentValue:dY,asTransformRatio:aY,asReachRatio:oY,asHeightRatio:sY,asValueRatio:lY,asNextValueRatio:cY,asLastValueRatio:uY,asLastValue:hY,asNextValue:vY,range:{min:null!==(e=null===(t=this._spec.range)||void 0===t?void 0:t.min)&&void 0!==e?e:null===(n=null===(i=this.getViewDataStatistics().latestData)||void 0===i?void 0:i[this.getValueField()])||void 0===n?void 0:n.min,max:null!==(o=null===(a=this._spec.range)||void 0===a?void 0:a.max)&&void 0!==o?o:null===(l=null===(s=this.getViewDataStatistics().latestData)||void 0===s?void 0:s[this.getValueField()])||void 0===l?void 0:l.max}}}),null===(u=this._viewDataTransform.getDataView())||void 0===u||u.transform({type:"funnelTransform",options:{asIsTransformLevel:fY}})}},{key:"initMark",value:function(){var t,e,i,n,a,o,s,l;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},r.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:ZF(this._spec,this._funnelMarkName),morphElementKey:this._seriesField}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},r.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===(n=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===n?void 0:n.visible){var u=(null!==(a=this._spec.outerLabel)&&void 0!==a?a:{}).line,c=(null!==(s=null===(o=this._theme)||void 0===o?void 0:o.outerLabel)&&void 0!==s?s:{}).line;this._funnelOuterLabelMark.label=this._createMark(r.mark.outerLabel,{themeSpec:null===(l=this._theme)||void 0===l?void 0:l.outerLabel,markSpec:this._spec.outerLabel,noSeparateStyle:!0,parent:!1}),this._funnelOuterLabelMark.line=this._createMark(r.mark.outerLabelLine,{themeSpec:c,markSpec:u,noSeparateStyle:!0,parent:!1})}}},{key:"initTooltip",value:function(){this._tooltipHelper=new pY(this),this._funnelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelMark),this._funnelTransformMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelTransformMark)}},{key:"getDimensionField",value:function(){return this._seriesField?[this._seriesField]:[]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"getGroupFields",value:function(){return null}},{key:"initMarkStyle",value:function(){var e,i,n,r,a=this,o=this._funnelMark;o&&this.setMarkStyle(o,{points:function(t){return a.getPoints(t)},visible:function(t){return C(t[a._valueField])},fill:this.getColorAttribute()},"normal",t.AttributeLevel.Series);var s=this._funnelTransformMark;s&&this.setMarkStyle(s,{points:function(t){return a.getPoints(t)}},"normal",t.AttributeLevel.Series);var l=this._funnelOuterLabelMark.label;l&&(this.setMarkStyle(l,{text:function(t){return"".concat(t[a.getCategoryField()])},x:function(t){return a._computeOuterLabelPosition(t).x},y:function(t){return a._computeOuterLabelPosition(t).y},textAlign:function(t){return a._computeOuterLabelPosition(t).align},textBaseline:function(t){return a._computeOuterLabelPosition(t).textBaseline},maxLineWidth:function(t){return a._computeOuterLabelLimit(t)},width:0,height:0},"normal",t.AttributeLevel.Series),w(this._spec.outerLabel.formatMethod)&&this.setMarkStyle(l,{text:function(t){return a._spec.outerLabel.formatMethod("".concat(t[a.getCategoryField()]),t)}},"normal",t.AttributeLevel.User_Mark));var u=this._funnelOuterLabelMark.line;if(u&&l){this.setMarkStyle(u,{x:function(t){return a._computeOuterLabelLinePosition(t).x1},y:function(t){return a._computeOuterLabelLinePosition(t).y1},x1:function(t){return a._computeOuterLabelLinePosition(t).x2},y1:function(t){return a._computeOuterLabelLinePosition(t).y2}},"normal",t.AttributeLevel.Series);var c=null!==(n=null===(i=null===(e=this._spec.outerLabel)||void 0===e?void 0:e.line)||void 0===i?void 0:i.visible)&&void 0!==n?n:null===(r=this._spec.outerLabel)||void 0===r?void 0:r.visible;C(c)&&u.setVisible(c)}}},{key:"initLabelMarkStyle",value:function(e){var i,n=this;if(e){var r=e.getTarget(),a=e.getComponent();if(r===this._funnelMark){this._labelMark=e,this.setMarkStyle(e,{text:function(t){return"".concat(t[n.getCategoryField()]," ").concat(t[n.getValueField()])},x:function(t){return n._computeLabelPosition(t).x},y:function(t){return n._computeLabelPosition(t).y},maxLineWidth:function(t){return n._computeLabelLimit(t,n._spec.label)},stroke:this.getColorAttribute()},"normal",t.AttributeLevel.Series);var o=this.getCompiler().getRootMarks();this._funnelOuterLabelMark.label&&tb(o,this._funnelOuterLabelMark.label,a),this._funnelOuterLabelMark.line&&tb(o,this._funnelOuterLabelMark.line,null!==(i=this._funnelOuterLabelMark.label)&&void 0!==i?i:a)}else this._funnelTransformMark&&r===this._funnelTransformMark&&(this._transformLabelMark=e,this.setMarkStyle(e,{text:function(t){return"".concat((100*xL(oY).bind(n)(t)).toFixed(1),"%")},x:function(t){return n._computeLabelPosition(t).x},y:function(t){return n._computeLabelPosition(t).y},maxLineWidth:function(t){return n._computeLabelLimit(t,n._spec.transformLabel)}},"normal",t.AttributeLevel.Series))}}},{key:"initAnimation",value:function(){var t,e,i,n,r,a,o,s=this,l=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"===l&&this._rootMark&&this._rootMark.setAnimationConfig(YF(null===(n=rO.getAnimationInKey("cartesianGroupClip"))||void 0===n?void 0:n({direction:function(){return s._isHorizontal()?"x":"y"},width:function(){var t=s.getRootMark().getProduct();if(t){var e=t.AABBBounds,i=e.x1,n=e.x2;return Math.max(i,n)}return s.getLayoutRect().width},height:function(){var t=s.getRootMark().getProduct();if(t){var e=t.AABBBounds,i=e.y1,n=e.y2;return Math.max(i,n)}return s.getLayoutRect().height},orient:function(){return s._isReverse()?"negative":"positive"}},l),XF("group",this._spec,this._markAttributeContext))),[null===(r=this._funnelOuterLabelMark)||void 0===r?void 0:r.label].forEach((function(t){t&&t.setAnimationConfig(YF(rO.getAnimationInKey("fadeInOut")(),XF(t.name,s._spec,s._markAttributeContext)))})),[this._funnelMark,this._funnelTransformMark].forEach((function(t){t&&t.setAnimationConfig(YF(rO.getAnimationInKey("funnel")({},l),XF(t.name,s._spec,s._markAttributeContext)))})),(null===(a=this._funnelOuterLabelMark)||void 0===a?void 0:a.line)&&this._funnelOuterLabelMark.line.setAnimationConfig(YF(null===(o=rO.getAnimationInKey("fadeInOut"))||void 0===o?void 0:o(),XF("outerLabelLine",this._spec,this._markAttributeContext)))}},{key:"initGroups",value:function(){}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return null}},{key:"initEvent",value:function(){var t,e=this;_(r,"initEvent",this,3)([]),null===(t=this._viewDataTransform.getDataView())||void 0===t||t.target.addListener("change",(function(t){e._viewDataTransform.updateData()}))}},{key:"getPoints",value:function(t){var e,i,n=this.isTransformLevel(t),r=this._getMainAxisLength(n)/2;n?(e="rect"===this._shape?this._getSecondaryAxisLength(t[uY])/2:this._getSecondaryAxisLength(t[lY])/2,i=this._getSecondaryAxisLength(t[lY])/2):(e=this._getSecondaryAxisLength(t[lY])/2,i="rect"===this._shape?e:this._getSecondaryAxisLength(t[cY])/2);var a=this._getPositionByData(t),o=a.x,s=a.y,l=this._getPolygonPoints([o,s],e,i,e,i,r);return"center"!==this._funnelAlign&&this._adjustPoints(l),l}},{key:"isTransformLevel",value:function(t){return!!(null==t?void 0:t[fY])}},{key:"_buildMarkAttributeContext",value:function(){_(r,"_buildMarkAttributeContext",this,3)([]),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getPoints=this.getPoints.bind(this),this._markAttributeContext.isTransformLevel=this.isTransformLevel.bind(this)}},{key:"valueToPosition",value:function(t){var e,i,n,r=this,a=null===(n=null===(i=null===(e=this.getViewData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.find)||void 0===n?void 0:n.call(i,(function(e){return e[r._categoryField]===t}));return C(a)?this._getPolygonCenter(this.getPoints(a)):null}},{key:"dataToPosition",value:function(t,e){return e&&!this.isDatumInViewData(t)?null:this.valueToPosition(t[this._categoryField])}},{key:"dataToPositionX",value:function(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}},{key:"dataToPositionY",value:function(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}},{key:"dataToPositionZ",value:function(t){return 0}},{key:"_getMainAxisLength",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.getViewData().latestData.length,n=this._isHorizontal()?this.getLayoutRect().width:this.getLayoutRect().height,r=!!this._spec.isTransform,a=r?0:null!==(t=this._spec.gap)&&void 0!==t?t:0,o=r?Math.max(0,i-1):0,s=this._spec.heightRatio||.5,l=(n-a*Math.max(0,i-1))/(i+s*o);return e?r?l*s:0:l}},{key:"_getSecondaryAxisLength",value:function(t){var e=Number.isNaN(t)||!Number.isFinite(t)?0:t,i=this._computeMaxSize(),n=this._computeMinSize();return n+(i-n)*e}},{key:"_getPositionByData",value:function(t){var e,i=this,n=null===(e=this.getViewData().latestData)||void 0===e?void 0:e.findIndex((function(e){return e[i._categoryField]===t[i._categoryField]&&e[RO]===t[RO]}));if(!C(n)||n<0)return{};var r=this.isTransformLevel(t),a=this._isHorizontal(),o=a?this.getLayoutRect().height:this.getLayoutRect().width,s=a?this.getLayoutRect().width:this.getLayoutRect().height,l=o/2,u=0,c=this._getMainAxisLength(),h=this._getMainAxisLength(!0);return u+=n*(c+h),u+=r?-h/2:c/2,!this._spec.isTransform&&this._spec.gap&&(u+=this._spec.gap*n),this._isReverse()&&(u=s-u),this._isHorizontal()?{x:u,y:l}:{x:l,y:u}}},{key:"_getPolygonPoints",value:function(t,e,i,n,r,a){var o=t[0],s=t[1];switch(this._funnelOrient){case"left":return[{x:o-a,y:s+e},{x:o-a,y:s-n},{x:o+a,y:s-r},{x:o+a,y:s+i}];case"right":return[{x:o+a,y:s-n},{x:o+a,y:s+n},{x:o-a,y:s+i},{x:o-a,y:s-i}];case"bottom":return[{x:o+e,y:s+a},{x:o-n,y:s+a},{x:o-r,y:s-a},{x:o+i,y:s-a}];default:return[{x:o-e,y:s-a},{x:o+n,y:s-a},{x:o+r,y:s+a},{x:o-i,y:s+a}]}}},{key:"_getPolygonCenter",value:function(t){if(this._isHorizontal()){var 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}}var n=(t[0].x+t[3].x)/2,r=(t[0].y+t[3].y)/2;return{x:(n+(t[1].x+t[2].x)/2)/2,y:(r+(t[1].y+t[2].y)/2)/2}}},{key:"_adjustPoints",value:function(t){var e,i,n;return this._isHorizontal()?(n="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)):(n="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][n]-=e,t[1][n]-=e,t[2][n]-=i,t[3][n]-=i,t}},{key:"_computeLabelPosition",value:function(t){var e=this.getPoints(t);return this._getPolygonCenter(e)}},{key:"_computeLabelLimit",value:function(t,e){var i=null==e?void 0:e.limit;if(F(i))return i;var n=this.getPoints(t);return"shapeSize"===i?this._isHorizontal()?Math.abs(n[3].x-n[0].x):(Math.abs(n[0].x-n[1].x)+Math.abs(n[2].x-n[3].x))/2:this._isHorizontal()?Math.abs(n[3].x-n[0].x):void 0}},{key:"_computeOuterLabelPosition",value:function(t){var e,i,n,r,a,o=null===(i=this._spec.outerLabel)||void 0===i?void 0:i.position,s="center",l="middle";if(o=this._isHorizontal()?["top","bottom"].includes(o)?o:"bottom"===this._funnelAlign?"top":"bottom":["left","right"].includes(o)?o:"left"===this._funnelAlign?"right":"left",!1!==(null===(n=this._spec.outerLabel)||void 0===n?void 0:n.alignLabel))r=(e=this._getPositionByData(t)).x,a=e.y,"left"===o?(r=0,s="left"):"right"===o?(r=this.getLayoutRect().width,s="right"):"top"===o?(a=0,l="top"):"bottom"===o&&(a=this.getLayoutRect().height,l="bottom");else{var u=this._computeOuterLabelLinePosition(t);r=u.x2,a=u.y2,"left"===o?(r-=5,s="right"):"right"===o?(r+=5,s="left"):"top"===o?(a-=5,l="bottom"):"bottom"===o&&(a+=5,l="top")}return{x:r,y:a,align:s,textBaseline:l}}},{key:"_computeOuterLabelLimit",value:function(t){var e,i,n,r,a,o;if(this._isHorizontal())return this._getMainAxisLength(this.isTransformLevel(t));var s=this.getPoints(t),l=(Math.abs(s[0].x-s[1].x)+Math.abs(s[2].x-s[3].x))/2,u=this.getCategoryField(),c=null===(r=null===(n=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getComponent())||void 0===n?void 0:n.find((function(e){var i,n=e.attribute;return"text"===e.type&&(null===(i=n.data)||void 0===i?void 0:i[u])===t[u]}),!0))||void 0===r?void 0:r.AABBBounds,h=c?c.x2-c.x1:0,d=this._funnelOuterLabelMark.line?this._minLabelLineWidth:0,v=this.getLayoutRect().width-Math.max(l,h);return"center"===this._funnelAlign&&(v/=2),v-d-(null!==(o=null===(a=this._spec.outerLabel)||void 0===a?void 0:a.spaceWidth)&&void 0!==o?o:5)}},{key:"_computeOuterLabelLinePosition",value:function(t){var e,i,n,r,a,o,s,l,u,c,h,d,v,f,p=this.getCategoryField(),g=null===(r=null===(n=null===(i=null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)||void 0===i?void 0:i.getGraphics())||void 0===n?void 0:n.find((function(e){var i;return(null===(i=e.context.data[0])||void 0===i?void 0:i[p])===t[p]})))||void 0===r?void 0:r.AABBBounds,y=null===(o=null===(a=this._labelMark)||void 0===a?void 0:a.getComponent())||void 0===o?void 0:o.getComponent(),m=null===(s=null==y?void 0:y.find((function(e){var i,n=e.attribute;return"text"===e.type&&(null===(i=n.data)||void 0===i?void 0:i[p])===t[p]}),!0))||void 0===s?void 0:s.AABBBounds,_=null!==(l=this._spec.outerLabel)&&void 0!==l?l:{};if(this._isHorizontal()){var b=null!==(u=_.spaceWidth)&&void 0!==u?u:5,k=this.getPoints(t),x=(Math.abs(k[0].y-k[1].y)+Math.abs(k[2].y-k[3].y))/2;return"top"===this._spec.outerLabel.position||"bottom"===this._funnelAlign?(v=this._getPolygonCenter(k).y-x/2-b,f=!1!==_.alignLabel?(null==g?void 0:g.y2)+b:v-b,h=this._getPolygonCenter(k).x,v-f<this._minLabelLineWidth&&(f=v-this._minLabelLineWidth),d=h):(v=this._getPolygonCenter(k).y+x/2+b,f=!1!==_.alignLabel?(null==g?void 0:g.y1)-b:v+b,h=this._getPolygonCenter(k).x,f-v<this._minLabelLineWidth&&(f=v+this._minLabelLineWidth),d=h),{x1:h,x2:d,y1:v,y2:f}}var S=this.getPoints(t),A=(Math.abs(S[0].x-S[1].x)+Math.abs(S[2].x-S[3].x))/2,M=(null==m?void 0:m.x2)-(null==m?void 0:m.x1)||0,w=null!==(c=_.spaceWidth)&&void 0!==c?c:5;return"right"===this._spec.outerLabel.position||"left"===this._funnelAlign?(h=this._getPolygonCenter(S).x+Math.max(M/2,A/2)+w,d=!1!==_.alignLabel?(null==g?void 0:g.x1)-w:h+w,v=this._getPolygonCenter(S).y,d-h<this._minLabelLineWidth&&(d=h+this._minLabelLineWidth),f=v):(h=this._getPolygonCenter(S).x-Math.max(M/2,A/2)-w,d=!1!==_.alignLabel?(null==g?void 0:g.x2)+w:h-w,v=this._getPolygonCenter(S).y,h-d<this._minLabelLineWidth&&(d=h-this._minLabelLineWidth),f=v),{x1:h,x2:d,y1:v,y2:f}}},{key:"_computeMaxSize",value:function(){var t,e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return WL(null!==(t=this._spec.maxSize)&&void 0!==t?t:"80%",e)}},{key:"_computeMinSize",value:function(){var t,e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return WL(null!==(t=this._spec.minSize)&&void 0!==t?t:0,e)}},{key:"_isHorizontal",value:function(){return"left"===this._funnelOrient||"right"===this._funnelOrient}},{key:"_isReverse",value:function(){return"bottom"===this._funnelOrient||"right"===this._funnelOrient}},{key:"getDefaultShapeType",value:function(){return"square"}},{key:"getActiveMarks",value:function(){return[this._funnelMark]}}])}(ej);kY.type=_L.funnel,kY.mark=_Y,kY.builtInTheme={funnel:lO},kY.transformerConstructor=bY;var xY,SY=function(){mY(),GV(),iV(),rO.registerSeries(kY.type,kY),rO.registerAnimation("funnel",(function(t,e){return Object.assign({appear:"clipIn"===e?void 0:{type:"fadeIn"}},ZD)})),rO.registerAnimation("cartesianGroupClip",(function(t){return{appear:{custom:hC,customParameters:function(e,i){return{animationType:"in",group:i,direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()}}}}})),QD()},AY=function(t,e){var i=(t-e[0])/(e[1]-e[0]||1);return Math.max(0,Math.min(1,i))},MY=function(t){var e=t.filter((function(t){return t.context.diffState===iD.update})),i=ht(e.map((function(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((function(t){var e,n;return(null===(n=null===(e=null==t?void 0:t.context)||void 0===e?void 0:e.data)||void 0===n?void 0:n[0].depth)===i}))},wY=function(t,e,i){if(Y(t))return[e,i];var n=ht(t.map((function(t){return 1*t.getFinalAttribute().startAngle}))),r=ct(t.map((function(t){return 1*t.getFinalAttribute().endAngle})));return[n,r]},TY=function(t){return{channel:{startAngle:{from:function(e,i){var n=t.animationInfo(),r=n.startAngle,a=n.endAngle,o=MY(i.parent.children),s=wY(o,r,a);return AY(i.getFinalAttribute().startAngle,s)*(a-r)+r},to:function(t,e){return e.getFinalAttribute().startAngle}},endAngle:{from:function(e,i){var n=t.animationInfo(),r=n.startAngle,a=n.endAngle,o=MY(i.parent.children),s=wY(o,r,a);return AY(i.getFinalAttribute().endAngle,s)*(a-r)+r},to:function(t,e){return e.getFinalAttribute().endAngle}},outerRadius:{from:function(t,e){return e.getFinalAttribute().innerRadius},to:function(t,e){return e.getFinalAttribute().outerRadius}},innerRadius:{from:function(t,e){return e.getFinalAttribute().innerRadius},to:function(t,e){return e.getFinalAttribute().innerRadius}}}}},CY=function(t){var e=ht(t.map((function(t){return 1*t.getFinalAttribute().startAngle}))),i=ct(t.map((function(t){return 1*t.getFinalAttribute().endAngle})));return[e,i]},EY=function(t){return{channel:{startAngle:{from:function(t,e){return e.getFinalAttribute().startAngle},to:function(e,i){var n=t.animationInfo(),r=n.startAngle,a=n.endAngle,o=MY(i.parent.children),s=CY(o);return AY(i.getFinalAttribute().startAngle,s)*(a-r)+r}},endAngle:{from:function(t,e){return e.getFinalAttribute().endAngle},to:function(e,i){var n=t.animationInfo(),r=n.startAngle,a=n.endAngle,o=MY(i.parent.children),s=CY(o);return AY(i.getFinalAttribute().endAngle,s)*(a-r)+r}},outerRadius:{from:function(t,e){return e.getFinalAttribute().outerRadius},to:function(){return t.animationInfo().innerRadius}},innerRadius:{from:function(t,e){return e.getFinalAttribute().innerRadius},to:function(){return t.animationInfo().innerRadius}}}}},BY=function(t,e){switch(e){case"fadeIn":return{type:"fadeIn"};case"growAngle":return{type:"growAngleIn"};default:return{type:"growRadiusIn"}}},PY=function(t){if(!t)return[];var e=[];return DW(t,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),e},RY=function(t,e){if(!t)return t;var i=e(),n=i.width,r=i.height;return new cG(i).layout(t,{width:n,height:r})},LY=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).markTooltipKeyCallback=function(e){return null==e?void 0:e[t.series.getDimensionField()[0]]},t}return c(e,t),a(e)}(wF);!function(t){t.DrillDown="drillDown",t.DrillUp="drillUp"}(xY||(xY={}));var OY=function(t,e){var i=e.info(),n=e.keyField(),r=null==i?void 0:i.key;if(T(r))return t;if(i.type===xY.DrillDown)return lt(uI(t,r,n,"children"));if(i.type===xY.DrillUp){var a=cI(t,r,n,"children");if(a)return lt(a)}return t},IY=function(){function e(){n(this,e)}return a(e,[{key:"_getDrillTriggerEvent",value:function(t){var e;return null===(e=zN(this._drillParams.mode))||void 0===e?void 0:e[t]}},{key:"_hideTooltip",value:function(){var t=this.getChart().getComponentsByType(d.tooltip)[0];t&&t.hideTooltip()}},{key:"initDrillable",value:function(t){this._drillParams=t}},{key:"initDrillableData",value:function(t){var e=this,i=this._drillParams.getRawData;EI(t,"drillFilter",OY),i().transform({type:"drillFilter",options:{info:function(){return e._drillInfo},keyField:function(){return e._drillParams.drillField()}}})}},{key:"bindDrillEvent",value:function(){var t=this,e=this._drillParams,i=e.event,n=e.getRawData,r=(0,e.drillField)();this._getDrillTriggerEvent("start")&&i.on(this._getDrillTriggerEvent("start"),(function(e){var i,a,s;if(T(e.datum)||T(null===(i=e.datum)||void 0===i?void 0:i[r]))t.drillUp();else{t._hideTooltip();var l=e.datum[r],u=null!==(s=null===(a=t._drillInfo)||void 0===a?void 0:a.path)&&void 0!==s?s:[],c=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"key",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children",r=[],a=function(t,s){var l,u=o(t);try{for(u.s();!(l=u.n()).done;){var c=l.value;if(c[i]===e)return r.push.apply(r,b(s).concat([c[i].toString()])),!0;if(c[n]){var h=a(c[n],[].concat(b(s),[c[i]]));if(!0===h)return h}}}catch(t){u.e(t)}finally{u.f()}return!1};return a(t,[]),r}(n().rawData,l,r,"children");u[u.length-1]===c[c.length-1]?t.drillUp():t.drillDown(c)}}))}},{key:"drillDown",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this._drillParams,n=i.getRawData,r=i.event;if(!O(e)||Y(e))return e;var a=e[e.length-1];return this._drillInfo={key:a,path:e,type:xY.DrillDown},n().reRunAllTransform(),r.emit(t.ChartEvent.drill,{value:{path:e,type:xY.DrillDown},model:this}),e}},{key:"drillUp",value:function(){var e,i,n=this._drillParams,r=n.getRawData,a=n.event,o=null!==(i=null===(e=this._drillInfo)||void 0===e?void 0:e.path)&&void 0!==i?i:[];if(!O(o)||Y(o))return o;var s=o.pop();return this._drillInfo={key:s,path:o,type:xY.DrillUp},r().reRunAllTransform(),a.emit(t.ChartEvent.drill,{value:{path:o,type:xY.DrillUp},model:this}),o}}])}(),DY=Object.assign(Object.assign({},jF),{sunburst:{name:"sunburst",type:"arc"}}),FY=function(t,e,i){return t.push({key:e,operations:["values"]}),t.push({key:i,operations:["max","min"]}),t.push({key:PF,operations:["max","min","values"]}),t.push({key:RF,operations:["values"]}),t},jY={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"}}}},zY=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=_L.sunburst,t}return c(r,e),a(r,[{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"getValueField",value:function(){return this._valueField}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"setAttrFromSpec",value:function(){var t,e=this;_(r,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:RF),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:function(){var t;return null!==(t=e._spec.drillField)&&void 0!==t?t:RO},getRawData:function(){return e.getRawData()}}),this._startAngle=xe(this._spec.startAngle),this._endAngle=xe(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}},{key:"initData",value:function(){var t=this;_(r,"initData",this,3)([]);var e=this.getRawData();e&&(this._spec.drill&&this.initDrillableData(this._dataSet),EI(this._dataSet,"sunburstLayout",RY),EI(this._dataSet,"flatten",PY),e.transform({type:"sunburstLayout",options:function(){var e=t._computeLevel(),i=e.innerRadius,n=e.outerRadius,r=e.gap,a=e.label;return{nodeKey:t._categoryField,width:t.getLayoutRect().width,height:t.getLayoutRect().height,center:[C(t._centerX)?t._centerX:t.getLayoutRect().width/2,C(t._centerY)?t._centerY:t.getLayoutRect().height/2],startAngle:t._startAngle,endAngle:t._endAngle,innerRadius:i,outerRadius:n,gapRadius:r,label:a}}}),e.transform({type:"flatten",options:{callback:function(t){if(t.datum){var e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}},{key:"getStatisticFields",value:function(){return FY(_(r,"getStatisticFields",this,3)([]),this._categoryField,this._valueField)}},{key:"_addDataIndexAndKey",value:function(){var t=this.getRawData();T(null==t?void 0:t.dataSet)||(EI(t.dataSet,"addVChartProperty",_F),t.transform({type:"addVChartProperty",options:{beforeCall:DF.bind(this),call:FF}}))}},{key:"initMark",value:function(){this._initArcMark(),this._initLabelMark()}},{key:"initMarkStyle",value:function(){this._initArcMarkStyle(),this._initLabelMarkStyle()}},{key:"_initArcMark",value:function(){if(!1!==this._sunburst.visible){var t=this._createMark(r.mark.sunburst,{isSeriesMark:!0});this._sunburstMark=t}}},{key:"_initArcMarkStyle",value:function(){var e=this;T(this._sunburstMark)||this.setMarkStyle(this._sunburstMark,{x:function(t){return t.x+(C(e._offsetX)?e._offsetX:0)},y:function(t){return t.y+(C(e._offsetY)?e._offsetY:0)},outerRadius:function(t){return t.outerRadius},innerRadius:function(t){return t.innerRadius},startAngle:function(t){return t.startAngle},endAngle:function(t){return t.endAngle},fill:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initLabelMark",value:function(){if(!0===this._label.visible){var t=this._createMark(r.mark.label,{isSeriesMark:!1});this._labelMark=t}}},{key:"_initLabelMarkStyle",value:function(){var e=this;T(this._labelMark)||this.setMarkStyle(this._labelMark,{visible:function(t){var i,n=e._labelAutoVisible;return E(n)&&!0===n.enable?(t.endAngle-t.startAngle)*(t.outerRadius-t.innerRadius)>(null!==(i=null==n?void 0:n.circumference)&&void 0!==i?i:10):e._spec.label.visible},x:function(t){var i;return(null===(i=t.label)||void 0===i?void 0:i.x)+(C(e._offsetX)?e._offsetX:0)},y:function(t){var i;return(null===(i=t.label)||void 0===i?void 0:i.y)+(C(e._offsetY)?e._offsetY:0)},textBaseline:function(t){var e;return null===(e=t.label)||void 0===e?void 0:e.textBaseline},textAlign:function(t){var e;return null===(e=t.label)||void 0===e?void 0:e.textAlign},angle:function(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:function(t){return t.name}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"initTooltip",value:function(){this._tooltipHelper=new LY(this),this._sunburstMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._sunburstMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}},{key:"initAnimation",value:function(){var t,e,i=this,n={animationInfo:function(){return{innerRadius:i._computeRadius(lt(i.__innerRadius))[0],outerRadius:i._computeRadius(lt(i.__outerRadius))[0],startAngle:lt(i._startAngle)[0],endAngle:lt(i._endAngle)[0]}}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this.getMarksInType("arc").forEach((function(t){var e;t.setAnimationConfig(YF(null===(e=rO.getAnimationInKey("sunburst"))||void 0===e?void 0:e(n,r),XF(t.name,i._spec,i._markAttributeContext)))})),this.getMarksInType("text").forEach((function(t){var e;t.setAnimationConfig(YF(null===(e=rO.getAnimationInKey("fadeInOut"))||void 0===e?void 0:e(),XF(t.name,i._spec,i._markAttributeContext)))}))}},{key:"initEvent",value:function(){_(r,"initEvent",this,3)([]),this._spec.drill&&this.bindDrillEvent()}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._rawData.reRunAllTransform()}},{key:"_computeRadius",value:function(t){var e=this;return O(t)?t.map((function(t){return e._computeLayoutRadius()*t})):this._computeLayoutRadius()*t}},{key:"_computeLevel",value:function(){return{innerRadius:this._computeRadius(this.__innerRadius),outerRadius:this._computeRadius(this.__outerRadius),gap:this._gap,label:this._labelLayout}}},{key:"getGroupFields",value:function(){return[]}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return""}},{key:"_noAnimationDataKey",value:function(t,e){}},{key:"getActiveMarks",value:function(){return[this._sunburstMark]}},{key:"getMarkData",value:function(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}])}(oU);zY.type=_L.sunburst,zY.mark=DY,zY.builtInTheme={sunburst:jY},st(zY,IY);var HY=function(){rO.registerSeries(zY.type,zY),mU(),GV(),QD(),rO.registerAnimation("sunburst",(function(t,e){return{appear:BY(0,e),enter:TY(t),exit:EY(t),disappear:{duration:KD.disappear.duration}}}))},NY=function(t,e){if(!t)return t;var i=e(),n=i.width,r=i.height;return 0===n||0===r?t:new QW(i).layout(t,{width:n,height:r})},VY=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).markTooltipKeyCallback=function(e){return null==e?void 0:e[t.series.getDimensionField()[0]]},t}return c(e,t),a(e)}(wF),UY=function(t){return"fadeIn"===t?{type:"fadeIn"}:{type:"growRadiusIn"}},WY=Object.assign(Object.assign({},jF),{circlePacking:{name:"circlePacking",type:"arc"}}),GY=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=_L.circlePacking,t}return c(r,e),a(r,[{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"getValueField",value:function(){return this._valueField}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"setAttrFromSpec",value:function(){var t,e=this;_(r,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:RF),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:function(){var t;return null!==(t=e._spec.drillField)&&void 0!==t?t:RO},getRawData:function(){return e.getRawData()}}),this._circlePacking=this._spec.circlePacking,this._label=this._spec.label,this._layoutPadding=this._spec.layoutPadding}},{key:"initData",value:function(){var t=this;_(r,"initData",this,3)([]);var e=this.getRawData();T(e)||(this._spec.drill&&this.initDrillableData(this._dataSet),EI(this._dataSet,"circlePackingLayout",NY),EI(this._dataSet,"flatten",PY),e.transform({type:"circlePackingLayout",options:function(){return{nodeKey:t._categoryField,padding:t._layoutPadding,includeRoot:!1,width:t.getLayoutRect().width||1,height:t.getLayoutRect().height||1}}}),e.transform({type:"flatten",options:{callback:function(t){if(t.datum){var e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}},{key:"_addDataIndexAndKey",value:function(){var t=this.getRawData();T(null==t?void 0:t.dataSet)||(EI(t.dataSet,"addVChartProperty",_F),t.transform({type:"addVChartProperty",options:{beforeCall:DF.bind(this),call:FF}}))}},{key:"initMark",value:function(){this._initCirclePackingMark(),this._initLabelMark()}},{key:"initMarkStyle",value:function(){this._initCirclePackingMarkStyle(),this._initLabelMarkStyle()}},{key:"_initCirclePackingMark",value:function(){var t;if(!1!==(null===(t=this._circlePacking)||void 0===t?void 0:t.visible)){var e=this._createMark(r.mark.circlePacking,{isSeriesMark:!0});this._circlePackingMark=e}}},{key:"_initCirclePackingMarkStyle",value:function(){T(this._circlePackingMark)||this.setMarkStyle(this._circlePackingMark,{x:function(t){return t.x},y:function(t){return t.y},outerRadius:function(t){return t.radius},innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),zIndex:function(t){return t.depth}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initLabelMark",value:function(){var t;if(!1!==(null===(t=this._label)||void 0===t?void 0:t.visible)){var e=this._createMark(r.mark.label,{isSeriesMark:!1});this._labelMark=e}}},{key:"_initLabelMarkStyle",value:function(){T(this._labelMark)||this.setMarkStyle(this._labelMark,{x:function(t){return t.x},y:function(t){return t.y},text:function(t){return t.key},cursor:"pointer"},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"getStatisticFields",value:function(){return FY(_(r,"getStatisticFields",this,3)([]),this._categoryField,this._valueField)}},{key:"initTooltip",value:function(){this._tooltipHelper=new VY(this),this._circlePackingMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circlePackingMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}},{key:"initAnimation",value:function(){var t,e=this,i=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this.getMarksInType("arc").forEach((function(t){var n;t.setAnimationConfig(YF(null===(n=rO.getAnimationInKey("circlePacking"))||void 0===n?void 0:n(void 0,i),XF(t.name,e._spec,e._markAttributeContext)))})),this.getMarksInType("text").forEach((function(t){var i;t.setAnimationConfig(YF(null===(i=rO.getAnimationInKey("scaleInOut"))||void 0===i?void 0:i(),XF(t.name,e._spec,e._markAttributeContext)))}))}},{key:"initEvent",value:function(){_(r,"initEvent",this,3)([]),this._spec.drill&&this.bindDrillEvent()}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._rawData.reRunAllTransform()}},{key:"_noAnimationDataKey",value:function(t,e){}},{key:"getActiveMarks",value:function(){return[this._circlePackingMark]}},{key:"getMarkData",value:function(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}])}(rj);GY.type=_L.circlePacking,GY.mark=WY,GY.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"}}}}},st(GY,IY);var YY=function(){rO.registerSeries(GY.type,GY),mU(),GV(),JD(),rO.registerAnimation("circlePacking",(function(t,e){return{appear:UY(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{duration:KD.disappear.duration}}}))},XY=function(t,e,i){e.forEach((function(e){T(e[i])||t.add(e[i]),e.children&&e.children.length>0&&XY(t,e.children,i)}))},KY=function(t){var e;if(!t||!O(t))return[];if(t.length>1){var i={links:[],nodes:[]};return t.forEach((function(t){"links"!==t.id&&"nodes"!==t.id||(i[t.id]=t.values)})),[i]}return(null===(e=t[0])||void 0===e?void 0:e.latestData)?t[0].latestData:t},qY=function(t,e){if(!t||!(null==e?void 0:e.view)||!t.length)return[];var 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[];var n=t[0];if(("source"!==e.sourceField||"target"!==e.targetField||"value"!==e.valueField)&&n.links){var r=[];n.links.forEach((function(t){var i={};for(var n in t)n===e.sourceField?i.source=t[e.sourceField]:n===e.targetField?i.target=t[e.targetField]:n===e.valueField?i.value=t[e.valueField]:i[n]=t[n];r.push(i)})),n.links=r}var a=new sG(e),o=[];return o.push(a.layout(n,i)),o},ZY=function(t){var e,i;return t&&O(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:[]},JY=function(t){var e,i;return t&&O(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:[]},QY=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments))._getDimensionData=function(e){if(e.source){if(F(e.source)){var i=t.series.getSeriesKeys();return i[e.source]+" => "+i[e.target]}return e.source+" => "+e.target}return e.datum?e.datum[t.series.getSpec().categoryField]:e.key},t.markTooltipValueCallback=function(t){return t.value},t}return c(e,t),a(e)}(wF),$Y=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:{overall:e?t.growFrom():e,orient:"positive"}}},tX=function(t,e){return"fadeIn"===e?{type:"fadeIn"}:$Y(t)},eX=function(t){return"fadeIn"===t?{type:"fadeIn"}:{type:"linkPathGrowIn"}},iX=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"onBind",value:function(){var t,i,n;_(e,"onBind",this,3)([]),(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);var r=function(t,e,i){var n={x0:t.getFinalAttribute().x0,x1:t.getFinalAttribute().x1,y0:t.getFinalAttribute().y0,y1:t.getFinalAttribute().y1,thickness:t.getFinalAttribute().thickness};return{from:Object.assign({},n,{x1:n.x0,y1:n.y0}),to:n}}(this.target,this.params.options,this.params),a=r.from,o=r.to,s=null!==(n=null===(i=this.target.context)||void 0===i?void 0:i.lastAttrs)&&void 0!==n?n:a,l=this.target.getFinalAttribute();l&&Object.assign(this.target.attribute,l),this.props=o,this.propKeys=Object.keys(o).filter((function(t){return null!=o[t]})),this.animate.reSyncProps(),this.from=s,this.to=o,this.target.setAttributes(s)}},{key:"onUpdate",value:function(t,e,i){var n=this,r=this.target.attribute;this.propKeys.forEach((function(t){r[t]=n.from[t]+(n.to[t]-n.from[t])*e})),this.target.setAttributes(r)}}])}(UT),nX=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"onBind",value:function(){var t,i,n;_(e,"onBind",this,3)([]),(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);var r=function(t,e,i){var n={x0:t.getFinalAttribute().x0,x1:t.getFinalAttribute().x1,y0:t.getFinalAttribute().y0,y1:t.getFinalAttribute().y1,thickness:t.getFinalAttribute().thickness};return{from:n,to:Object.assign({},n,{x1:n.x0,y1:n.y0})}}(this.target,this.params.options,this.params),a=r.from,o=r.to,s=null!==(n=null===(i=this.target.context)||void 0===i?void 0:i.lastAttrs)&&void 0!==n?n:a;this.props=o,this.propKeys=Object.keys(o).filter((function(t){return null!=o[t]})),this.animate.reSyncProps(),this.from=s,this.to=o,this.target.setAttributes(s)}},{key:"onUpdate",value:function(t,e,i){var n=this,r=this.target.attribute;this.propKeys.forEach((function(t){r[t]=n.from[t]+(n.to[t]-n.from[t])*e})),this.target.setAttributes(r)}}])}(UT),rX=function(t,e){var i,n=null!==(i=t.curvature)&&void 0!==i?i:.5,r="number"==typeof e?t.thickness*e:t.thickness,a=t.x0,o=t.x1,s=t.y0,l=t.y1,u=a+n*(o-a),c=o+n*(a-o),h=function(t){return t};!1!==t.round&&(a=Math.round(a),o=Math.round(o),s=Math.round(s),l=Math.round(l),u=Math.round(u),c=Math.round(c),h=Math.round),"line"===t.pathType||t.pathType,"center"===t.align?(s=h(t.y0-r/2),l=h(t.y1-r/2)):"end"===t.align?(s=h(t.y0+t.thickness/2-r),l=h(t.y1+t.thickness/2-r)):(s=h(t.y0-t.thickness/2),l=h(t.y1-t.thickness/2));var d=h(s+r),v=h(l+r),f=Math.abs(o-a)>1e-6,p=t.endArrow&&f?"L".concat(o,",").concat(h(l-r/2),"L").concat(h(o+r),",").concat(h((l+v)/2),"L").concat(o,",").concat(h(v+r/2)):"",g=t.startArrow&&f?"L".concat(a,",").concat(h(d+r/2),"L").concat(h(a-r),",").concat(h((s+d)/2),"L").concat(a,",").concat(h(s-r/2)):"";return"line"===t.pathType?"M".concat(a,",").concat(s,"L").concat(o,",").concat(l).concat(p,"L").concat(o,",").concat(v,"L").concat(a,",").concat(d).concat(g,"Z"):"polyline"===t.pathType?"M".concat(a,",").concat(s,"L").concat(u,",").concat(s,"L").concat(u,",").concat(l,"L").concat(o,",").concat(l,"\n ").concat(p,"L").concat(o,",").concat(v,"L").concat(u,",").concat(v,"L").concat(u,",").concat(d,"L").concat(a,",").concat(d).concat(g,"Z"):"M".concat(a,",").concat(s,"C").concat(u,",").concat(s,",").concat(c,",").concat(l,",").concat(o,",").concat(l,"\n ").concat(p,"L").concat(o,",").concat(v,"C").concat(c,",").concat(v,",").concat(u,",").concat(d,",").concat(a,",").concat(d).concat(g,"Z")},aX=function(t,e){var i,n=null!==(i=t.curvature)&&void 0!==i?i:.5,r="number"==typeof e?t.thickness*e:t.thickness,a=t.y0,o=t.y1,s=t.x0,l=t.x1,u=a+n*(o-a),c=o+n*(a-o),h=function(t){return t};!1!==t.round&&(h=Math.round,a=Math.round(a),o=Math.round(o),s=Math.round(s),l=Math.round(l),u=Math.round(u),c=Math.round(c)),"line"===t.pathType||t.pathType,"center"===t.align?(s=h(t.x0-r/2),l=h(t.x1-r/2)):"end"===t.align?(s=h(t.x0+t.thickness/2-r),l=h(t.x1+t.thickness/2-r)):(s=h(t.x0-t.thickness/2),l=h(t.x1-t.thickness/2));var d=h(s+r),v=h(l+r),f=Math.abs(o-a)>1e-6,p=t.endArrow&&f?"L".concat(h(l-r/2),",").concat(o,"L").concat(h((l+v)/2),",").concat(h(o+r),"L").concat(h(v+r/2),",").concat(o):"",g=t.startArrow&&f?"L".concat(h(d+r/2),",").concat(a,"L").concat(h((d+s)/2),",").concat(h(a-r),"L").concat(h(s-r/2),",").concat(a):"";return"line"===t.pathType?"M".concat(s,",").concat(a,"L").concat(l,",").concat(o).concat(p,"L").concat(v,",").concat(o,"L").concat(d,",").concat(a).concat(g,"Z"):"polyline"===t.pathType?"M".concat(s,",").concat(a,"L").concat(s,",").concat(u,"L").concat(l,",").concat(u,"L").concat(l,",").concat(o,"\n ").concat(p,"L").concat(v,",").concat(o,"L").concat(v,",").concat(u,"L").concat(d,",").concat(u,"L").concat(d,",").concat(a).concat(g,"Z"):"M".concat(s,",").concat(a,"C").concat(s,",").concat(u,",").concat(l,",").concat(c,",").concat(l,",").concat(o,"\n ").concat(p,"L").concat(v,",").concat(o,"C").concat(v,",").concat(c,",").concat(d,",").concat(u,",").concat(d,",").concat(a).concat(g,"Z")},oX=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t._subMarks={back:{type:"path",defaultAttributes:{zIndex:0}},front:{type:"path",defaultAttributes:{zIndex:1}}},t._positionChannels=["x0","y0","x1","y1","thickness","round","curvature","ratio","pathType","align","endArrow","startArrow","ratio"],t._channelEncoder={backgroundStyle:function(t){return{back:t}}},t._positionEncoder=function(e,i,n){var r,a,o=Object.assign(Object.assign({},n.attribute),e),s=null!==(r=o.direction)&&void 0!==r?r:null===(a=t._glyphConfig)||void 0===a?void 0:a.direction,l=["vertical","TB","BT"].includes(s)?aX:rX,u="number"==typeof o.ratio&&o.ratio>=0&&o.ratio<=1;return{back:{path:u?l(o,1):""},front:{path:l(o,u?o.ratio:1)}}},t}return c(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{x:0,y:0,x0:0,y0:0,x1:100,y1:100,thickness:1,round:!0})}}])}(wV);oX.type="linkPath";var sX=Object.assign(Object.assign({},jF),{node:{name:"node",type:"rect"},link:{name:"link",type:"linkPath"}}),lX=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"node")}}])}(tj),uX=function(t,e,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4?arguments[4]:void 0;t.runtimeStateCache||(t.runtimeStateCache={}),t.runtimeStateCache[e]=i,t.hasState(e)&&t.removeState(e),t.addState(e,n,r)},cX=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).type=_L.sankey,e.transformerConstructor=lX,e._nodeLayoutZIndex=t.LayoutZIndex.Node,e._labelLayoutZIndex=t.LayoutZIndex.Label,e._viewBox=new ii,e._fillByNode=function(t){var i,n,r,a,o;if(t&&t.sourceRect&&t.targetRect)return e._fillByLink(t);var s=null===(n=null===(i=e._spec.node)||void 0===i?void 0:i.style)||void 0===n?void 0:n.fill;if(C(s))return s;if(C(e._spec.seriesField)){var l=null===(a=null===(r=e._option)||void 0===r?void 0:r.globalScale)||void 0===a?void 0:a.getScale("color"),u=(null==t?void 0:t.datum)?t.datum:t;return null==l?void 0:l.scale(null==u?void 0:u[e._spec.seriesField])}return null===(o=e._colorScale)||void 0===o?void 0:o.scale(e._getNodeNameFromData(t))},e._fillByLink=function(t){var i,n,r,a,o,s,l=null===(n=null===(i=e._spec.link)||void 0===i?void 0:i.style)||void 0===n?void 0:n.fill;if(l)return l;if(C(e._spec.seriesField)){var u=null===(r=e._nodesSeriesData.latestData)||void 0===r?void 0:r.find((function(e){return t.source===e.key})),c=null==u?void 0:u.datum,h=null===(o=null===(a=e._option)||void 0===a?void 0:a.globalScale)||void 0===o?void 0:o.getScale("color");return null==h?void 0:h.scale(null==c?void 0:c[e._spec.seriesField])}var d=F(t.source)?e.getNodeList()[t.source]:t.source;return null===(s=e._colorScale)||void 0===s?void 0:s.scale(d)},e._handleEmphasisElement=function(t){var i,n=null!==(i=e._spec.emphasis)&&void 0!==i?i:{},r=t.item;"adjacency"===n.effect?r&&t.mark===e._nodeMark?e._handleNodeAdjacencyClick(r):r&&t.mark===e._linkMark?e._handleLinkAdjacencyClick(r):e._handleClearEmpty():"related"===n.effect&&(r&&t.mark===e._nodeMark?e._handleNodeRelatedClick(r):r&&t.mark===e._linkMark?e._handleLinkRelatedClick(r):e._handleClearEmpty())},e._handleClearEmpty=function(){var i,n;if(e._needClear){var r=null===(i=e._nodeMark)||void 0===i?void 0:i.getGraphics();if(r&&r.length){var a=null===(n=e._linkMark)||void 0===n?void 0:n.getGraphics();a&&a.length&&(r.forEach((function(e){e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE)})),a.forEach((function(e){e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE)})),e._needClear=!1)}}},e._handleNodeAdjacencyClick=function(i){var n=mI(i),r=[n.key];if(e._linkMark){var a=e._linkMark.getGraphics();if(!a||!a.length)return;a.forEach((function(e,i){var a=mI(e);a.source===n.key?(r.includes(a.target)||r.push(a.target),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0)):a.target===n.key?(r.includes(a.source)||r.push(a.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))}))}e._nodeMark&&e._highLightElements(e._nodeMark.getGraphics(),r),e._needClear=!0},e._handleLinkAdjacencyClick=function(i){var n=mI(i),r=[n.source,n.target];if(e._linkMark){var a=e._linkMark.getGraphics();if(!a||!a.length)return;a.forEach((function(e){e===i?(e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),uX(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:1})):(e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}e._nodeMark&&e._highLightElements(e._nodeMark.getGraphics(),r),e._needClear=!0},e._handleNodeRelatedClick=function(i){var n,r=mI(i),a=e._nodeMark.getGraphics();if(a&&a.length){var o=e._linkMark.getGraphics();if(o&&o.length){var s=(null===(n=mI(o[0]))||void 0===n?void 0:n.parents)?"parents":"source";if("source"===s){var l=[r.key],u=[];if(o.forEach((function(t,e){var i,n,o,s,c=mI(t),h=(null==c?void 0:c.parents)?"parents":"source";if(lt(c[h]).includes(r.key)){if(u.includes(null!==(i=c.key)&&void 0!==i?i:c.index)||u.push(null!==(n=c.key)&&void 0!==n?n:c.index),l.includes(c.source)||l.push(c.source),!l.includes(c.target)){l.push(c.target);for(var d,v=a.find((function(t){return t.data[0].key===c.target})).data[0].sourceLinks,f=function(){var t=[];return{v:(v.forEach((function(e){var i,n;if(!u.includes(null!==(i=e.key)&&void 0!==i?i:e.index)&&(u.push(null!==(n=e.key)&&void 0!==n?n:e.index),!l.includes(e.target))){l.push(e.target);var r=a.find((function(t){return t.data[0].key===e.target}));t.push(r.data[0].targetLinks)}})),void(v=t))}};(null==v?void 0:v.length)>0;)if(d=f())return d.v}}else if(c.target===r.key&&(u.includes(null!==(o=c.key)&&void 0!==o?o:c.index)||u.push(null!==(s=c.key)&&void 0!==s?s:c.index),!l.includes(c.source))){l.push(c.source);for(var p,g=a.find((function(t){return t.data[0].key===c.source})).data[0].targetLinks,y=function(){var t=[];return{v:(g.forEach((function(e){var i,n;if(!u.includes(null!==(i=e.key)&&void 0!==i?i:e.index)&&(u.push(null!==(n=e.key)&&void 0!==n?n:e.index),!l.includes(e.source))){l.push(e.source);var r=a.find((function(t){return t.data[0].key===e.source}));t.push(r.data[0].targetLinks)}})),void(g=t))}};(null==g?void 0:g.length)>0;)if(p=y())return p.v}})),e._linkMark){var c=e._linkMark.getGraphics();if(!c||!c.length)return;c.forEach((function(e,i){var n,r=mI(e);u.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))}))}e._nodeMark&&e._highLightElements(e._nodeMark.getGraphics(),l)}else{var h=[r.key],d=r.targetLinks.reduce((function(t,e){return lt(e.datum).forEach((function(e){for(var i=e.parents,n=i.length,a=function(){var n=i[o].key,a=i[o+1]?i[o+1].key:r.key,s=e.value,l=t.find((function(t){return t.source===n&&t.target===a}));l?l.value+=s:t.push({source:n,target:a,value:s})},o=0;o<n;o++)a()})),t}),[]);o.forEach((function(e,i){var n=mI(e),a=n.datum,o=a?a.filter((function(t){return t[s].some((function(t){return t.key===r.key}))})):null,l=d.find((function(t){return t.source===n.source&&t.target===n.target}));if(o&&o.length){h.includes(n.source)||h.push(n.source),h.includes(n.target)||h.push(n.target);var u=o.reduce((function(t,e){return t+e.value}),0),c=u/n.value;return e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void uX(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:c})}if(l)return h.includes(n.source)||h.push(n.source),h.includes(n.target)||h.push(n.target),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void uX(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:l.value/n.value});e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)})),e._nodeMark&&e._highLightElements(e._nodeMark.getGraphics(),h)}e._needClear=!0}}},e._handleLinkRelatedClick=function(i){var n=e._nodeMark.getGraphics();if(n&&n.length){var r=e._linkMark.getGraphics();if(r&&r.length){if("source"==(mI(i)?"parents":"source"))e._linkMark&&r.forEach((function(e){e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE)})),e._nodeMark&&n.forEach((function(e){e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE)}));else{var a=mI(i),o=[a.source,a.target],s=[];lt(a.datum).forEach((function(t){for(var e=t.parents,i=e.length,n=function(){var i=e[r].key,n=e[r+1].key,a=t.value,o=s.find((function(t){return t.source===i&&t.target===n}));s.push({source:e[r].key,target:e[r+1].key,value:t.value}),o?o.value+=a:s.push({source:i,target:n,value:a})},r=0;r<i-1;r++)n()})),r.forEach((function(e){var i=mI(e),n=i.datum;if(i.source===a.source&&i.target===a.target)return e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void uX(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:1});var r=n?n.filter((function(t){var e=t.parents.map((function(t){return t.key}));return e.includes(a.source)&&e.includes(a.target)})):null;if(r&&r.length){o.includes(i.source)||o.push(i.source),o.includes(i.target)||o.push(i.target);var l=r.filter((function(t){return t.parents.some((function(e,i){var n;return e.key===a.source&&(null===(n=t.parents[i+1])||void 0===n?void 0:n.key)===a.target}))})).reduce((function(t,e){return t+e.value}),0),u=l/i.value;return e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void uX(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:u})}var c=s.find((function(t){return t.source===i.source&&t.target===i.target}));if(c)return o.includes(i.source)||o.push(i.source),o.includes(i.target)||o.push(i.target),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void uX(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:c.value/i.value});e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)})),e._highLightElements(n,o)}e._needClear=!0}}},e}return c(r,e),a(r,[{key:"direction",get:function(){var t;return null!==(t=this._spec.direction)&&void 0!==t?t:"horizontal"}},{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"setAttrFromSpec",value:function(){var t;_(r,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:this._spec.categoryField)}},{key:"initData",value:function(){var e,i,n,a,o=this;_(r,"initData",this,3)([]);var s=this.getViewData(),l=this.getRawData();if(l&&s){EI(this._dataSet,"sankeyLayout",qY),EI(this._dataSet,"sankeyFormat",KY),l.transform({type:"sankeyFormat"},!1),s.transform({type:"sankeyLayout",options:{view:function(){return{x0:o._viewBox.x1,x1:o._viewBox.x2,y0:o._viewBox.y1,y1:o._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!==(n=this._spec.nodeWidth)&&void 0!==n?n:10,linkWidth:this._spec.linkWidth,minStepWidth:this._spec.minStepWidth,minNodeHeight:null!==(a=this._spec.minNodeHeight)&&void 0!==a?a: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});var u=this._option.dataSet;EI(u,"sankeyNodes",ZY),EI(u,"flatten",PY);var c=new Xo(u,{name:"sankey-node-".concat(this.id,"-data")});c.parse([this.getViewData()],{type:"dataview"}),c.transform({type:"sankeyNodes"}),c.transform({type:"flatten",options:{callback:function(t){if(t.datum){var e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}},!1),c.transform({type:"addVChartProperty",options:{beforeCall:OF.bind(this),call:IF}},!1),this._nodesSeriesData=c,EI(u,"sankeyLinks",JY);var h=new Xo(u,{name:"sankey-link-".concat(this.id,"-data")});h.parse([this.getViewData()],{type:"dataview"}),h.transform({type:"sankeyLinks"}),h.transform({type:"addVChartProperty",options:{beforeCall:OF.bind(this),call:IF}},!1),this._linksSeriesData=h}}},{key:"compileData",value:function(){var t,e;_(r,"compileData",this,3)([]),null===(t=this._linkMark)||void 0===t||t.compileData(),null===(e=this._nodeMark)||void 0===e||e.compileData()}},{key:"initMark",value:function(){this._rootMark.setMarkConfig({overflow:this._spec.overflow,interactive:!!this._spec.overflow});var t=this._createMark(r.mark.node,{isSeriesMark:!0,dataView:this._nodesSeriesData});t&&(t.setMarkConfig({zIndex:this._nodeLayoutZIndex}),this._nodeMark=t);var e=this._createMark(r.mark.link,{dataView:this._linksSeriesData});e&&(this._linkMark=e)}},{key:"_buildMarkAttributeContext",value:function(){_(r,"_buildMarkAttributeContext",this,3)([]),this._markAttributeContext.valueToNode=this.valueToNode.bind(this),this._markAttributeContext.valueToLink=this.valueToLink.bind(this)}},{key:"valueToNode",value:function(t){var e=this._nodesSeriesData.latestData,i=lt(t)[0];return e&&e.find((function(t){return t.key===i}))}},{key:"valueToLink",value:function(t){var e=this._linksSeriesData.latestData,i=lt(t);return e&&e.find((function(t){return t&&t.source===i[0]&&t.target===i[1]}))}},{key:"valueToPositionX",value:function(t){var e=this.valueToNode(t);return null==e?void 0:e.x0}},{key:"valueToPositionY",value:function(t){var e=this.valueToNode(t);return null==e?void 0:e.y0}},{key:"initMarkStyle",value:function(){this._initNodeMarkStyle(),this._initLinkMarkStyle()}},{key:"_initNodeMarkStyle",value:function(){var e,i,n=this._nodeMark;n&&(this.setMarkStyle(n,{x:function(t){return t.x0},x1:function(t){return t.x1},y:function(t){return t.y0},y1:function(t){return t.y1}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Mark),this.setMarkStyle(n,{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))}},{key:"_initLinkMarkStyle",value:function(){var e,i,n=this._linkMark;n&&(n.setGlyphConfig({direction:this.direction}),this.setMarkStyle(n,{x0:function(t){return t.x0},x1:function(t){return t.x1},y0:function(t){return t.y0},y1:function(t){return t.y1},thickness:function(t){return t.thickness}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this.setMarkStyle(n,{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))}},{key:"initLabelMarkStyle",value:function(t,e){var i=this;if(t){var n=e.position;n&&n.includes("inside")?this.setMarkStyle(t,{fill:"#ffffff",text:function(t){return i._createText(t,e)},maxLineWidth:function(t){var i;return null!==(i=e.limit)&&void 0!==i?i:t.x1-t.x0}}):this.setMarkStyle(t,{fill:this._fillByNode,text:function(t){return i._createText(t,e)},maxLineWidth:e.limit}),t.setMarkConfig({zIndex:this._labelLayoutZIndex})}}},{key:"_createText",value:function(t,e){if(T(t)||T(t.datum))return"";var i=t.datum[this._spec.categoryField]||"",n=e||{},r=gF(n.formatMethod,n.formatter,i,t.datum),a=r.formatFunc,o=r.args;return a&&(i=a.apply(void 0,b(o).concat([{series:this}]))),i}},{key:"initAnimation",value:function(){var t,e,i,n,r=this,a={direction:this.direction,growFrom:function(){var t,e;return"horizontal"===r.direction?null===(t=r._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=r._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},o=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(YF(null===(i=rO.getAnimationInKey("sankeyNode"))||void 0===i?void 0:i(a,o),XF("node",this._spec,this._markAttributeContext))),this._linkMark&&this._linkMark.setAnimationConfig(YF(null===(n=rO.getAnimationInKey("sankeyLinkPath"))||void 0===n?void 0:n(a,o),XF("link",this._spec,this._markAttributeContext)))}},{key:"initEvent",value:function(){var t,e,i;_(r,"initEvent",this,3)([]),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));var n=null!==(i=this._spec.emphasis)&&void 0!==i?i:{};if(!0!==this._option.disableTriggerEvent&&n.enable&&("adjacency"===n.effect||"related"===n.effect)){var a="hover"===n.trigger?"pointerover":"pointerdown";this.event.on(a,{level:SI.chart},this._handleEmphasisElement)}}},{key:"nodesSeriesDataUpdate",value:function(){this._nodeMark.getData().updateData(),this._nodeList=null,this._setNodeOrdinalColorScale()}},{key:"linksSeriesDataUpdate",value:function(){this._linkMark.getData().updateData()}},{key:"_highLightElements",value:function(e,i){e&&e.length&&e.forEach((function(e){e.removeState([t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS]),i.includes(mI(e).key)?e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0):e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)}))}},{key:"initTooltip",value:function(){this._tooltipHelper=new QY(this),this._nodeMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodeMark),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark)}},{key:"_setNodeOrdinalColorScale",value:function(){var t,e,i,n,r,a=null===(e=null===(t=this._option)||void 0===t?void 0:t.globalScale)||void 0===e?void 0:e.getScale("color");if(null==a?void 0:a._specified)this._colorScale=a;else{var o,s;a&&(o=a.domain(),s=a.range()),s||(s=this._getDataScheme()),o&&!T(o[0])||(o=this.getNodeList())&&o.length>10&&(s=null===(i=this._getDataScheme()[1])||void 0===i?void 0:i.scheme);var l=new IL;null===(r=(n=l.domain(o)).range)||void 0===r||r.call(n,s),this._colorScale=l}}},{key:"getNodeList",value:function(){var t,e,i=this;if(this._nodeList)return this._nodeList;var n=this._rawData.latestData[0],r=(null==n?void 0:n.nodes)?(null===(t=n.nodes[0])||void 0===t?void 0:t.children)?Array.from(this.extractNamesFromTree(n.nodes,this._spec.categoryField)):n.nodes.map((function(t,e){return t[i._spec.categoryField]})):(null==n?void 0:n.links)?Array.from(this.extractNamesFromLink(n.links)):null===(e=null==n?void 0:n.values)||void 0===e?void 0:e.map((function(t,e){return t[i._spec.categoryField]}));return this._nodeList=r,r}},{key:"_getNodeNameFromData",value:function(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]}},{key:"extractNamesFromTree",value:function(t,e){var i=this,n=new Set;return t.forEach((function(t){n.add(t[e]),t.children&&i.extractNamesFromTree(t.children,e).forEach((function(t){return n.add(t)}))})),n}},{key:"extractNamesFromLink",value:function(t){var e=new Set,i=this._spec,n=i.sourceField,r=i.targetField;return t.forEach((function(t){C(t[n])&&e.add(t[n]),C(t[r])&&e.add(t[r])})),e}},{key:"getDimensionField",value:function(){return[this._spec.categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"getRawDataStatisticsByField",value:function(t,e){var i;return this._rawStatisticsCache||(this._rawStatisticsCache={}),this._rawStatisticsCache[t]||(this._viewDataStatistics&&this.getViewData().transformsArr.length<=1&&(null===(i=this._viewDataStatistics.latestData)||void 0===i?void 0:i[t])?this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t]:this._rawData&&(this._rawStatisticsCache[t]={values:this._collectByField(t)})),this._rawStatisticsCache[t]}},{key:"_collectByField",value:function(t){var e,i,n,r=this,a=[],o=null===(i=null===(e=this.getRawData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i[0];if(!o)return[];if(o.links)(null===(n=o.nodes)||void 0===n?void 0:n.length)&&o.nodes.forEach((function(t){t[r._seriesField]&&a.push(t[r._seriesField])}));else if(o.nodes){var s=new Set;return XY(s,o.nodes,this._seriesField),Array.from(s)}return a}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this.getViewData().reRunAllTransform()}},{key:"getDefaultShapeType",value:function(){return"square"}},{key:"_noAnimationDataKey",value:function(t,e){}},{key:"getActiveMarks",value:function(){return[this._nodeMark,this._linkMark]}},{key:"getMarkData",value:function(t){return t.datum?O(t.datum)?t.datum[t.datum.length-1]:t.datum:t}}])}(rj);cX.type=_L.sankey,cX.transformerConstructor=lX,cX.mark=sX,cX.builtInTheme={sankey:{link:{style:{fillOpacity:.15,round:!0}}}};var hX=function(){uN(),TV(),aM(),rO.registerGraphicComponent("path",(function(t){return gp(t)})),rO.registerMark(oX.type,oX),GV(),rO.registerAnimation("sankeyNode",(function(t,e){return Object.assign({appear:tX(t,e)},ZD)})),rO.registerAnimation("sankeyLinkPath",(function(t,e){return{appear:eX(e),enter:{type:"linkPathGrowIn"},exit:{type:"linkPathGrowOut"},disappear:{duration:KD.disappear.duration}}})),RT.registerBuiltInAnimate("linkPathGrowOut",nX),RT.registerBuiltInAnimate("linkPathGrowIn",iX),QD(),rO.registerSeries(cX.type,cX)},dX=function(t,e){var i={},n=e.fields;if(w(n)&&(n=n()),!(null==n?void 0:n.length)||!(null==t?void 0:t.length))return i;if(!t[0].latestData)return i;var r=t[0].latestData,a=PY(r);return i=CF([{latestData:a}],e)},vX=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).markTooltipKeyCallback=function(e){var i,n;return null===(n=null===(i=t.series)||void 0===i?void 0:i.getMarkData(e))||void 0===n?void 0:n[t.series.getDimensionField()[0]]},t.markTooltipValueCallback=function(e){var i,n,r=t._seriesCacheInfo.measureFields,a=null===(i=t.series)||void 0===i?void 0:i.getMarkData(e);if(r[0]&&a)return null!==(n=a[r[0]])&&void 0!==n?n:e.value},t.dimensionTooltipTitleCallback=function(e){var i,n=t._seriesCacheInfo.dimensionFields,r=null===(i=t.series)||void 0===i?void 0:i.getMarkData(e);if(n[0]&&r)return r[n[0]]},t}return c(e,t),a(e,[{key:"defaultShapeType",get:function(){return"square"}}])}(wF),fX=Object.assign(Object.assign({},jF),{nonLeaf:{name:"nonLeaf",type:"rect"},leaf:{name:"leaf",type:"rect"},nonLeafLabel:{name:"nonLeafLabel",type:"text"}}),pX=function(t){return"fadeIn"===t?{type:"fadeIn"}:{type:"growCenterIn"}},gX=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"nonLeaf","nonLeafLabel","initNonLeafLabelMarkStyle"),this._addMarkLabelSpec(t,"leaf")}}])}(tj),yX=function(t,e){if(e.getViewBox()){var i=new fG(e).layout(t,e.getViewBox()),n=[];return DW(i,n,{maxDepth:null==e?void 0:e.maxDepth}),n.forEach((function(t,i){t&&[RF,"name"].forEach((function(i){t[i]=t.datum[t.depth][e.nameField]}))})),n}return[]},mX=function(r){function o(){var t;return n(this,o),(t=i(this,o,arguments)).type=_L.treemap,t.transformerConstructor=gX,t._categoryField="name",t._valueField="value",t._viewBox=new ii,t._enableAnimationHook=t.enableMarkAnimation.bind(e(t)),t.isHierarchyData=function(){return!0},t}return c(o,r),a(o,[{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"setAttrFromSpec",value:function(){var t,e=this;_(o,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:RF),this._spec.roam&&(this.initZoomable(this.event,this._option.mode),this._matrix=new ai),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:function(){var t,i;return null!==(i=null!==(t=e._spec.drillField)&&void 0!==t?t:e._categoryField)&&void 0!==i?i:RO},getRawData:function(){return e.getRawData()}}),z(this._spec.maxDepth)&&(this._maxDepth=this._spec.maxDepth-1)}},{key:"initData",value:function(){var t,e,i,n,r,a=this;_(o,"initData",this,3)([]),EI(this._dataSet,"treemap",yX),null===(t=this._data.getDataView())||void 0===t||t.transform({type:"treemap",options:{nameField:this._categoryField,valueField:this._valueField,getViewBox:function(){return a._viewBox.empty()?null:{x0:a._viewBox.x1,x1:a._viewBox.x2,y0:a._viewBox.y1,y1:a._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===(n=this._spec.nonLeafLabel)||void 0===n?void 0:n.position,minVisibleArea:null!==(r=this._spec.minVisibleArea)&&void 0!==r?r:10,minChildrenVisibleArea:this._spec.minChildrenVisibleArea,minChildrenVisibleSize:this._spec.minChildrenVisibleSize}}),this.getViewData()&&this._spec.drill&&this.initDrillableData(this._dataSet)}},{key:"_runTreemapTransform",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._data.getDataView().reRunAllTransform(),t&&this.getCompiler().renderNextTick()}},{key:"_addDataIndexAndKey",value:function(){var t;(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(EI(this._rawData.dataSet,"addVChartProperty",_F),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:DF.bind(this),call:FF}}))}},{key:"getRawDataStatisticsByField",value:function(t,e){var i;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]&&this._rawData){var n=dX([this._rawData],{fields:[{key:t,operations:e?["min","max"]:["values"]}]})[t];this._rawStatisticsCache[t]=et(null!==(i=this._rawStatisticsCache[t])&&void 0!==i?i:{},n)}return this._rawStatisticsCache[t]}},{key:"_createHierarchyDataStatistics",value:function(t,e){var i=this;EI(this._dataSet,"hierarchyDimensionStatistics",dX),EI(this._dataSet,"flatten",PY);var n=new Xo(this._dataSet,{name:t});return n.parse(e,{type:"dataview"}),n.transform({type:"hierarchyDimensionStatistics",options:{fields:function(){var t=i.getStatisticFields();return i._seriesField&&i._seriesField!==i._categoryField&&t.push({key:i._seriesField,operations:["values"]}),t}}},!1),n}},{key:"getStatisticFields",value:function(){return FY(_(o,"getStatisticFields",this,3)([]),this._categoryField,this._valueField)}},{key:"initMark",value:function(){var t=this,e=this._createMark(o.mark.nonLeaf,{isSeriesMark:!0});e&&(e.setTransform([{type:"filter",callback:function(e){return!t._shouldFilterElement(e,"nonLeaf")}}]),this._nonLeafMark=e);var i=this._createMark(o.mark.leaf,{isSeriesMark:!0});i&&(i.setTransform([{type:"filter",callback:function(e){return!t._shouldFilterElement(e,"leaf")}}]),this._leafMark=i)}},{key:"initMarkStyle",value:function(){this._initLeafMarkStyle(),this._initNonLeafMarkStyle()}},{key:"_initLeafMarkStyle",value:function(){this._leafMark&&this.setMarkStyle(this._leafMark,{x:function(t){return t.x0},y:function(t){return t.y0},x1:function(t){return t.x1},y1:function(t){return t.y1},fill:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initNonLeafMarkStyle",value:function(){this._nonLeafMark&&this.setMarkStyle(this._nonLeafMark,{x:function(t){return t.x0},y:function(t){return t.y0},x1:function(t){return t.x1},y1:function(t){return t.y1},fill:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initRichStyleOfLabelMark",value:function(e){"rich"===e.getTextType()&&this.setMarkStyle(e,{maxWidth:function(t){return Math.abs(t.x0-t.x1)},maxHeight:function(t){return Math.abs(t.y0-t.y1)},ellipsis:!0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"initLabelMarkStyle",value:function(e){var i=this;e&&(this._labelMark=e,e.setRule("treemap"),this.setMarkStyle(e,{x:function(t){return(t.x0+t.x1)/2},y:function(t){return(t.y0+t.y1)/2},text:function(t){var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[i.getDimensionField()[0]]},maxLineWidth:function(t){return t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._initRichStyleOfLabelMark(e))}},{key:"initNonLeafLabelMarkStyle",value:function(e){var i=this;e&&(this._nonLeafLabelMark=e,e.setRule("treemap"),this.setMarkStyle(e,{x:function(t){return t.labelRect?(t.labelRect.x0+t.labelRect.x1)/2:(t.x0+t.x1)/2},y:function(t){return t.labelRect?(t.labelRect.y0+t.labelRect.y1)/2:(t.y0+t.y1)/2},text:function(t){var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[i.getDimensionField()[0]]},maxLineWidth:function(t){return t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._initRichStyleOfLabelMark(e))}},{key:"initAnimation",value:function(){var t=this;this.getMarksInType("rect").forEach((function(e){var i;e.setAnimationConfig(YF(null===(i=rO.getAnimationInKey("treemap"))||void 0===i?void 0:i(),XF(e.name,t._spec,t._markAttributeContext)))}))}},{key:"initEvent",value:function(){var t=this;_(o,"initEvent",this,3)([]),this._spec.roam&&(this.initDragEventOfSeries(this),this.event.on("panmove",(function(e){t.handlePan(e)})),this.initZoomEventOfSeries(this),this.event.on("zoom",(function(e){t.handleZoom(e)}))),this._spec.drill&&this.bindDrillEvent()}},{key:"_getDataIdKey",value:function(){return"key"}},{key:"initTooltip",value:function(){this._tooltipHelper=new vX(this),this._leafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._leafMark),this._nonLeafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nonLeafMark)}},{key:"_shouldFilterElement",value:function(t,e){var i=t.isLeaf;return"leaf"===e?!i:i}},{key:"handlePan",value:function(t){var e=t.delta;if(0!==e[0]||0!==e[1]){this._matrix.reset(),this._matrix.translate(e[0],e[1]);var i=this._matrix,n=i.a,r=i.b,a=i.c,o=i.d,s=i.e,l=i.f;this._matrix.multiply(n,r,a,o,s,l),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}}},{key:"handleZoom",value:function(t){var e=t.scale,i=t.scaleCenter;if(1!==e){this._matrix.reset();var n=i.x,r=i.y;this._matrix.translate(n,r),this._matrix.scale(e,e),this._matrix.translate(-n,-r);var a=this._matrix,o=a.a,s=a.b,l=a.c,u=a.d,c=a.e,h=a.f;this._matrix.multiply(o,s,l,u,c,h),this.disableMarkAnimation(),this.event.on(gI.AFTER_DO_RENDER,this._enableAnimationHook),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"onLayoutEnd",value:function(){_(o,"onLayoutEnd",this,3)([]),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runTreemapTransform()}},{key:"enableMarkAnimation",value:function(){this.getMarks().forEach((function(t){})),[this._labelMark,this._nonLeafLabelMark].forEach((function(t){t&&t.getComponent()&&t.getComponent().getProduct().enableAnimation()})),this.event.off(gI.AFTER_DO_RENDER,this._enableAnimationHook)}},{key:"disableMarkAnimation",value:function(){this.getMarks().forEach((function(t){})),[this._labelMark,this._nonLeafLabelMark].forEach((function(t){t&&t.getComponent()&&t.getComponent().getProduct().disableAnimation()}))}},{key:"getDefaultShapeType",value:function(){return"square"}},{key:"getActiveMarks",value:function(){return[this._nonLeafMark,this._leafMark]}},{key:"getMarkData",value:function(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}])}(rj);mX.type=_L.treemap,mX.mark=fX,mX.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"}}}},mX.transformerConstructor=gX,st(mX,IY),st(mX,NN);var _X=function(){rO.registerGrammarTransform("filter",{transform:function(t,e){return null==e?void 0:e.filter(t.callback)}}),rO.registerGrammarTransform("map",{transform:function(t,e){return null==e||e.forEach((function(e,i){t.callback(e)})),e}}),uN(),GV(),rO.registerAnimation("treemap",(function(t,e){return{appear:pX(e),enter:{type:"growCenterIn"},exit:{type:"growCenterOut"},disappear:{duration:KD.disappear.duration}}})),QD(),rO.registerSeries(mX.type,mX)},bX=Object.assign(Object.assign({},sW),{segment:{name:"segment",type:"arc"},track:{name:"track",type:"arc"}}),kX=Object.assign(Object.assign({},jF),{pin:{name:"pin",type:"path"},pinBackground:{name:"pinBackground",type:"path"},pointer:{name:"pointer",type:["path","rect"]}}),xX={type:"fadeIn"};function SX(t,e){return"fadeIn"===e?xX:function(t){return{channel:{angle:{from:t.startAngle+Math.PI/2}}}}(t)}var AX=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments))._supportStack=!1,t}return c(e,t),a(e)}(tj),MX=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"enableByType",value:function(t){return"dimension"!==t}}])}(wF),wX="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",TX={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:wX,fill:"#888"}},pinBackground:{width:.06,height:.06,style:{path:wX,fill:"#ddd"}}},CX=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=_L.gaugePointer,t.transformerConstructor=AX,t._pinMark=null,t._pointerMark=null,t._pinBackgroundMark=null,t}return c(e,t),a(e,[{key:"setAttrFromSpec",value:function(){var t;_(e,"setAttrFromSpec",this,3)([]),this.setRadiusField(this._spec.radiusField),this._pointerType="rect"===(null===(t=this._spec.pointer)||void 0===t?void 0:t.type)?"rect":"path"}},{key:"initMark",value:function(){this._pinBackgroundMark=this._createMark(e.mark.pinBackground),this._pointerMark=this._createMark(Object.assign(Object.assign({},e.mark.pointer),{type:this._pointerType}),{isSeriesMark:!0}),this._pinMark=this._createMark(e.mark.pin)}},{key:"initMarkStyle",value:function(){this.initPinBackgroundMarkStyle(),this.initPointerMarkStyle(),this.initPinMarkStyle()}},{key:"initGroups",value:function(){}},{key:"initPointerMarkStyle",value:function(){var t=this,e=this._pointerMark,i=this._spec.pointer;e&&(this.setMarkStyle(e,{x:function(e){var n,r;return t._getPointerAnchor(e,i).x-t._getPointerWidth()*(null!==(r=null===(n=null==i?void 0:i.center)||void 0===n?void 0:n[0])&&void 0!==r?r:0)},y:function(e){var n,r;return t._getPointerAnchor(e,i).y-t._getPointerHeight(e)*(null!==(r=null===(n=null==i?void 0:i.center)||void 0===n?void 0:n[1])&&void 0!==r?r:0)},anchor:function(e){var n=t._getPointerAnchor(e,i);return[n.x,n.y]},fill:this.getColorAttribute(),zIndex:200}),"path"===this._pointerType?this.setMarkStyle(e,{scaleX:this._getPointerWidth.bind(this),scaleY:this._getPointerHeight.bind(this),angle:function(e){return t._getPointerAngle(e)+Math.PI/2}}):this.setMarkStyle(e,{width:this._getPointerWidth.bind(this),height:this._getPointerHeight.bind(this),angle:function(e){return t._getPointerAngle(e)-Math.PI/2}}))}},{key:"initTooltip",value:function(){this._tooltipHelper=new MX(this),this._pointerMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pointerMark)}},{key:"_getPointerAnchor",value:function(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]]])})}},{key:"_getPointerWidth",value:function(){return this._spec.pointer.width*this._computeLayoutRadius()}},{key:"_getPointerHeight",value:function(t){var e,i,n=this._spec.pointer,r=this._radiusField[0];return C(this.radiusAxisHelper)&&C(r)?this.radiusAxisHelper.dataToPosition([t[r]])-(null!==(e=null==n?void 0:n.innerPadding)&&void 0!==e?e:0)-(null!==(i=null==n?void 0:n.outerPadding)&&void 0!==i?i:10):n.height*this._computeLayoutRadius()}},{key:"_getPointerAngle",value:function(t){var e=this.angleAxisHelper.getScale().domain(),i=ct(e),n=ht(e),r=Lt(t[this._angleField[0]],n,i);return this.angleAxisHelper.dataToPosition([r])}},{key:"_getRotatedPointerCenterOffset",value:function(t){var e,i,n,r,a=this._spec.pointer,o=this._getPointerWidth()*(null!==(i=null===(e=null==a?void 0:a.center)||void 0===e?void 0:e[0])&&void 0!==i?i:0),s=-this._getPointerHeight(t)*(null!==(r=null===(n=null==a?void 0:a.center)||void 0===n?void 0:n[1])&&void 0!==r?r:0),l=this._getPointerAngle(t)-Math.PI/2,u=Math.cos(l),c=Math.sin(l);return{x:o*u+s*c,y:-(s*u-o*c)}}},{key:"initPinBackgroundMarkStyle",value:function(){var t=this,e=this._pinBackgroundMark,i=this._spec.pinBackground;e&&this.setMarkStyle(e,{x:function(e){return t._getPointerAnchor(e,i).x},y:function(e){return t._getPointerAnchor(e,i).y},scaleX:function(){return i.width*t._computeLayoutRadius()},scaleY:function(){return i.height*t._computeLayoutRadius()},fill:this.getColorAttribute(),zIndex:100})}},{key:"initPinMarkStyle",value:function(){var t=this,e=this._pinMark,i=this._spec.pin;e&&this.setMarkStyle(e,{x:function(e){return t._getPointerAnchor(e,i).x},y:function(e){return t._getPointerAnchor(e,i).y},scaleX:function(){return i.width*t._computeLayoutRadius()},scaleY:function(){return i.height*t._computeLayoutRadius()},fill:this.getColorAttribute(),zIndex:300})}},{key:"getInteractionTriggers",value:function(){return this._parseInteractionConfig(this._pointerMark?[this._pointerMark]:[])}},{key:"initAnimation",value:function(){var t,e,i,n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._pointerMark.setAnimationConfig(YF(null===(i=rO.getAnimationInKey("gaugePointer"))||void 0===i?void 0:i({startAngle:this._startAngle},n),XF("pointer",this._spec,this._markAttributeContext)))}},{key:"getDefaultShapeType",value:function(){return"circle"}},{key:"getActiveMarks",value:function(){return[]}}])}(lW);CX.type=_L.gaugePointer,CX.mark=kX,CX.builtInTheme={gaugePointer:TX},CX.transformerConstructor=AX;var EX=function(){rO.registerSeries(CX.type,CX),ON(),uN(),rO.registerAnimation("gaugePointer",(function(t,e){var i=SX(t,e);return{appear:i,enter:i,disappear:{duration:KD.disappear.duration}}})),HU(),jU()},BX=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments))._supportStack=!1,t}return c(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"segment")}}])}(tj),PX=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=_L.gauge,t.transformerConstructor=BX,t._segmentMark=null,t._trackMark=null,t._padAngle=0,t}return c(r,e),a(r,[{key:"setAttrFromSpec",value:function(){var t;_(r,"setAttrFromSpec",this,3)([]),this._padAngle=xe(null!==(t=this._spec.padAngle)&&void 0!==t?t:0)}},{key:"initData",value:function(){var t,e=this;_(r,"initData",this,3)([]),EI(this._option.dataSet,"spiltSegment",(function(t,i){var n=t.slice();return n.sort((function(t,i){return t[e._angleField[0]]-i[e._angleField[0]]})),n.forEach((function(t,i){t[JO]=t[e._angleField[0]],t[ZO]=i>0?n[i-1][JO]:void 0})),n})),null===(t=this.getViewData())||void 0===t||t.transform({type:"spiltSegment"},!1)}},{key:"initMark",value:function(){_(r,"initMark",this,3)([]),this._trackMark=this._createMark(r.mark.track,{parent:this._arcGroupMark,dataView:!1}),this._segmentMark=this._createMark(r.mark.segment,{parent:this._arcGroupMark,isSeriesMark:!0})}},{key:"initMarkStyle",value:function(){_(r,"initMarkStyle",this,3)([]),this.initTrackMarkStyle(),this.initSegmentMarkStyle()}},{key:"initSegmentMarkStyle",value:function(){var t,e=this,i=this._segmentMark;i&&this.setMarkStyle(i,{x:function(){return e.angleAxisHelper.center().x},y:function(){return e.angleAxisHelper.center().y},startAngle:this._getAngleValueStart.bind(this),endAngle:this._getAngleValueEnd.bind(this),innerRadius:function(){var t;return e._computeLayoutRadius()*(null!==(t=e._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:function(){var t,i;return e._computeLayoutRadius()*(null!==(i=null!==(t=e._spec.radius)&&void 0!==t?t:e._spec.outerRadius)&&void 0!==i?i:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0})}},{key:"generateRadiusStyle",value:function(t){var e=this;if(t){var i={};return t.outerRadius&&(i.outerRadius=function(){return e._computeLayoutRadius()*t.outerRadius}),t.innerRadius&&(i.innerRadius=function(){return e._computeLayoutRadius()*t.innerRadius}),i}}},{key:"initMarkStyleWithSpec",value:function(e,i){if(_(r,"initMarkStyleWithSpec",this,3)([e,i]),e&&"segment"===e.name){var n=this.getSpec().segment;if(n)for(var a in n.state||{})this.setMarkStyle(e,this.generateRadiusStyle(n.state[a]),a,t.AttributeLevel.User_Mark)}}},{key:"initTooltip",value:function(){_(r,"initTooltip",this,3)([]),this._segmentMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._segmentMark)}},{key:"initTrackMarkStyle",value:function(){var t,e=this,i=this._trackMark;i&&this.setMarkStyle(i,{x:function(){return e.angleAxisHelper.center().x},y:function(){return e.angleAxisHelper.center().y},startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:function(){var t;return e._computeLayoutRadius()*(null!==(t=e._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:function(){var t,i;return e._computeLayoutRadius()*(null!==(i=null!==(t=e._spec.radius)&&void 0!==t?t:e._spec.outerRadius)&&void 0!==i?i:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,zIndex:100})}},{key:"_getAngleValueStartWithoutMask",value:function(t){var e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),n=It(e,(e+i)/2)(e+(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?jL(n,this.angleAxisHelper.getScale(0)):n}},{key:"_getAngleValueEndWithoutMask",value:function(t){var e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),n=It(i,(e+i)/2)(i-(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?jL(n,this.angleAxisHelper.getScale(0)):n}},{key:"_getAngleValueStartWithoutPadAngle",value:function(t){return C(t[ZO])?this.angleAxisHelper.dataToPosition([t[ZO]]):this._startAngle}},{key:"_getAngleValueEndWithoutPadAngle",value:function(t){return this.angleAxisHelper.dataToPosition([t[JO]])}},{key:"initAnimation",value:function(){var t,e,i,n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._segmentMark.setAnimationConfig(YF(null===(i=rO.getAnimationInKey("circularProgress"))||void 0===i?void 0:i({startAngle:this._startAngle},n),XF("segment",this._spec,this._markAttributeContext)))}},{key:"getDefaultShapeType",value:function(){return"circle"}},{key:"getActiveMarks",value:function(){return[]}}])}(lW);PX.type=_L.gauge,PX.mark=bX,PX.builtInTheme={gauge:{outerRadius:.8,innerRadius:.6,padAngle:1.146,segment:{style:{fillOpacity:1}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}}},PX.transformerConstructor=BX;var RX=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t}return c(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{fill:void 0,lineWidth:0,padding:0})}},{key:"_createGraphic",value:function(){return Gf(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}},{key:"_transformGraphicAttributes",value:function(t,i,n){var r,a,o,s=_(e,"_transformGraphicAttributes",this,3)([t,i,n]),l=null!==(a=null!==(r=s.shape)&&void 0!==r?r:s.symbolType)&&void 0!==a?a:null===(o=t.attribute)||void 0===o?void 0:o.symbolType;return T(l)?s.symbolType="rect":s.symbolType=l,s}}])}(HD);function LX(t){return!1===t?{}:{type:"fadeIn"}}RX.type="cell";var OX=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"enableByType",value:function(t){return"dimension"!==t}}])}(wF),IX=Object.assign(Object.assign({},jF),{cell:{name:"cell",type:"cell"},cellBackground:{name:"cellBackground",type:"cell"}}),DX=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"cell")}}])}(tj),FX=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=_L.heatmap,t.transformerConstructor=DX,t}return c(r,e),a(r,[{key:"getFieldValue",value:function(){return this._fieldValue}},{key:"setFieldValue",value:function(t){this._fieldValue=lt(t)}},{key:"setAttrFromSpec",value:function(){_(r,"setAttrFromSpec",this,3)([]),this.setFieldValue(this._spec.valueField)}},{key:"initMark",value:function(){this._cellMark=this._createMark(r.mark.cell,{isSeriesMark:!0},{morph:ZF(this._spec,r.mark.cell.name),morphElementKey:this.getDimensionField()[0]}),this._backgroundMark=this._createMark(r.mark.cellBackground)}},{key:"initMarkStyle",value:function(){this.initCellMarkStyle(),this.initCellBackgroundMarkStyle()}},{key:"initLabelMarkStyle",value:function(t){var e=this;t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:function(t){return t[e.getMeasureField()[0]]}})}},{key:"initCellMarkStyle",value:function(){var e=this;this.setMarkStyle(this._cellMark,{x:function(t){return e.dataToPositionX(t)},y:function(t){return e.dataToPositionY(t)},size:function(){return[e.getCellSize(e._xAxisHelper),e.getCellSize(e._yAxisHelper)]},fill:this.getColorAttribute()},"normal",t.AttributeLevel.Series)}},{key:"initCellBackgroundMarkStyle",value:function(){var e,i,n,r=this,a=ki(null!==(n=null===(i=null===(e=this._spec.cellBackground)||void 0===e?void 0:e.style)||void 0===i?void 0:i.padding)&&void 0!==n?n:0);this.setMarkStyle(this._backgroundMark,{x:function(t){var e=r.getCellSize(r._xAxisHelper);return r.dataToPositionX(t)-e/2+a[3]},y:function(t){var e=r.getCellSize(r._yAxisHelper);return r.dataToPositionY(t)-e/2+a[0]},width:function(){return r.getCellSize(r._xAxisHelper)-a[1]-a[3]},height:function(){return r.getCellSize(r._yAxisHelper)-a[0]-a[2]}},"normal",t.AttributeLevel.Series)}},{key:"getColorAttribute",value:function(){var t;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:this.getFieldValue()[0]}}},{key:"getInteractionTriggers",value:function(){return this._parseInteractionConfig(this._cellMark?[this._cellMark]:[])}},{key:"initAnimation",value:function(){var t,e,i,n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset,r=nj(this);this._cellMark.setAnimationConfig(YF(null===(i=rO.getAnimationInKey("heatmap"))||void 0===i?void 0:i(n),XF("cell",this._spec,this._markAttributeContext),r))}},{key:"getCellSize",value:function(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}},{key:"initTooltip",value:function(){this._tooltipHelper=new OX(this),this._cellMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._cellMark)}},{key:"getDefaultShapeType",value:function(){return"rect"}},{key:"getDimensionField",value:function(){return[].concat(this.fieldX,this.fieldY)}},{key:"getMeasureField",value:function(){return this.getFieldValue()}},{key:"getActiveMarks",value:function(){return[this._cellMark]}}])}(rj);FX.type=_L.heatmap,FX.mark=IX,FX.builtInTheme={heatmap:{cell:{style:{shape:"rect",fillOpacity:1}},cellBackground:{visible:!1}}},FX.transformerConstructor=DX;var jX=function(){GV(),rO.registerMark(RX.type,RX),rO.registerGraphicComponent("symbol",Gf),vM(),pM(),WB(),rO.registerAnimation("heatmap",(function(t,e){return Object.assign(Object.assign({},ZD),{appear:LX(e)})})),zz(),Iz(),rO.registerSeries(FX.type,FX)},zX=Object.assign(Object.assign({},jF),{nodePoint:{name:"nodePoint",type:"symbol"},ripplePoint:{name:"ripplePoint",type:"ripple"},centerPoint:{name:"centerPoint",type:"symbol"},centerLabel:{name:"centerLabel",type:"text"}}),HX="".concat(TO,"_CORRELATION_X"),NX="".concat(TO,"_CORRELATION_Y"),VX="".concat(TO,"_CORRELATION_SIZE"),UX=function(t,e){var i,n,r,a,o,l,u,c,h,d,v,f,p,g,y;if(!t||!(null==e?void 0:e.view)||!O(t))return t;var _=e.view();if(_.x1-_.x0==0||_.y1-_.y0==0||_.x1-_.x0==-1/0||_.x1-_.x0==1/0||_.y1-_.y0==-1/0||_.y1-_.y0==1/0)return t;var b=xe(null!==(i=e.startAngle)&&void 0!==i?i:-90),k=xe(null!==(n=e.endAngle)&&void 0!==n?n:270),x=Math.max((_.x1-_.x0)/2,(_.y1-_.y0)/2),S=Xt(null!==(r=e.innerRadius)&&void 0!==r?r:0,x),A=Xt(e.outerRadius,x),M=[F(null===(a=e.center)||void 0===a?void 0:a[0])?e.center[0]:_.x0+Xt(null!==(l=null===(o=e.center)||void 0===o?void 0:o[0])&&void 0!==l?l:"50%",_.x1-_.x0),F(null===(u=e.center)||void 0===u?void 0:u[1])?e.center[1]:_.y0+Xt(null!==(h=null===(c=e.center)||void 0===c?void 0:c[1])&&void 0!==h?h:"50%",_.y1-_.y0)],w=Yt(e.field),C=t.map(w),E=m(qt(C),2),B=E[0],P=E[1],R=B===P?function(t){return(S+A)/2}:function(t){return S+(A-S)*(t-B)/(P-B)},L=T(e.radiusField)?w:Yt(e.radiusField),I=null!==(v=null===(d=null==e?void 0:e.radiusRange)||void 0===d?void 0:d[1])&&void 0!==v?v:5,D=function(t){return I};if(L){var j=m(L!==w?qt(t.map(L)):[B,P],2),z=j[0],H=j[1],N=null!==(p=null===(f=e.radiusRange)||void 0===f?void 0:f[0])&&void 0!==p?p:5,V=null!==(y=null===(g=e.radiusRange)||void 0===g?void 0:g[1])&&void 0!==y?y:5;z!==H&&(D=function(t){return N+(V-N)*(L(t)-z)/(H-z)})}var U=Math.min(b,k),W=Math.max(b,k),G=WX(U,W,t.length),Y=[],X=(W-U)/60;return t.forEach((function(t,e){for(var i,n,r=R(C[e]),a=D(t),o=G[e],l=0;l<60&&(i=M[0]+r*Math.cos(o),n=M[1]+r*Math.sin(o),GX({x:i,y:n,size:a},Y)||i-a<_.x0||i+a>_.x1||n-a<_.y0||n+a>_.y1);l++)l<59&&((o+=X)>W?o=U:o<U&&(o=W));Y.push(Object.assign(s(s(s({},HX,i),NX,n),VX,a),t))})),Y},WX=function(t,e,i){for(var n=0,r=Math.max(Math.ceil(2*(e-t)/Math.PI),2),a=(e-t)/r,o=0,s=1,l=0,u=0,c=[],h=t;l<i;)u<r&&(c.push(h+(u%2?Math.floor(u/2)+Math.floor(r/2):u/2)*a*s),u++),l++,u===r&&(u=0,0===n?n=a/2:n/=2,h=-1==(s*=-1)?e-n:t+n,(o+=1)>=2&&(a/=2,r*=2));return c},GX=function(t,e){return!(!e||!e.length)&&e.some((function(e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<Math.pow(t.size+e.size,2)}))},YX=function(t,e){if(!t||!O(t))return[];var i=e.keyword,n=e.categoryField,r=t[0].latestData[0];return s(s(s({},n,i),PO,null==r?void 0:r[PO]),LO,null==r?void 0:r[LO])},XX=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t._subMarks={ripple0:{type:"symbol",defaultAttributes:{fillOpacity:.75}},ripple1:{type:"symbol",defaultAttributes:{fillOpacity:.5}},ripple2:{type:"symbol",defaultAttributes:{fillOpacity:.25}}},t._positionChannels=["ripple","size"],t._positionEncoder=function(t,e,i){var n=t.ripple,r=void 0===n?i.attribute.ripple:n,a=t.size,o=void 0===a?i.attribute.size:a,s=Lt(r,0,1),l=.5*o;return{ripple0:{size:o+l*s,fillOpacity:.75-.25*s},ripple1:{size:o+l*(1+s),fillOpacity:.5-.25*s},ripple2:{size:o+l*(2+s),fillOpacity:.25-.25*s}}},t}return c(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{x:0,y:0,ripple:0})}}])}(wV);XX.type="ripple";var KX=function(t,e){return"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"}},qX=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"nodePoint"),this._addMarkLabelSpec(t,"centerPoint","centerLabel")}}])}(tj),ZX=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=_L.correlation,t.transformerConstructor=qX,t._viewBox=new ii,t}return c(r,e),a(r,[{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"getSeriesField",value:function(){return this._seriesField}},{key:"setSeriesField",value:function(t){C(t)&&(this._seriesField=t)}},{key:"getSizeField",value:function(){return this._sizeField}},{key:"setSizeField",value:function(t){C(t)&&(this._sizeField=t)}},{key:"getSizeRange",value:function(){return this._sizeRange}},{key:"setSizeRange",value:function(t){C(t)&&(this._sizeRange=t)}},{key:"setAttrFromSpec",value:function(){_(r,"setAttrFromSpec",this,3)([]),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)}},{key:"initData",value:function(){var t,e,i;if(_(r,"initData",this,3)([]),this._data){EI(this._dataSet,"correlation",UX);var n=new Yo;BI(n,"dataview",Uo),EI(n,"correlationCenter",YX);var a=new Xo(n,{name:"".concat(this.type,"_").concat(this.id,"_center")});a.parse([this.getViewData()],{type:"dataview"}),a.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 ID(this._option,a)}}},{key:"compileData",value:function(){var t;_(r,"compileData",this,3)([]),null===(t=this._centerSeriesData)||void 0===t||t.compile()}},{key:"_statisticViewData",value:function(){var t=this;_(r,"_statisticViewData",this,3)([]),this._data.getDataView().transform({type:"correlation",options:{view:function(){return{x0:t._viewBox.x1,x1:t._viewBox.x2,y0:t._viewBox.y1,y1:t._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}})}},{key:"initMark",value:function(){var e=this._createMark(r.mark.nodePoint,{groupKey:this._seriesField,isSeriesMark:!0,key:PO});e&&(e.setMarkConfig({zIndex:t.LayoutZIndex.Node}),this._nodePointMark=e);var i=this._createMark(r.mark.ripplePoint,{key:PO,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});i&&(this._ripplePointMark=i);var n=this._createMark(r.mark.centerPoint,{key:PO,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});n&&(n.setMarkConfig({zIndex:t.LayoutZIndex.Node}),this._centerPointMark=n)}},{key:"initMarkStyle",value:function(){this._initNodePointMarkStyle(),this._initRipplePointMarkStyle(),this._initCenterPointMarkStyle()}},{key:"_initNodePointMarkStyle",value:function(){var e,i,n,r,a=this._nodePointMark;if(a){var o=null!==(i=null===(e=this._spec.nodePoint)||void 0===e?void 0:e.style)&&void 0!==i?i:{};this.setMarkStyle(a,{x:function(t){return t[HX]},y:function(t){return t[NX]},size:function(t){return t[VX]},fill:null!==(n=o.fill)&&void 0!==n?n:this.getColorAttribute(),fillOpacity:null!==(r=o.fillOpacity)&&void 0!==r?r:1,lineWidth:0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}}},{key:"_initRipplePointMarkStyle",value:function(){var e,i,n,r,a,o=this,s=this._ripplePointMark;if(s){var l=null!==(i=null===(e=this._spec.ripplePoint)||void 0===e?void 0:e.style)&&void 0!==i?i:{};this.setMarkStyle(s,{x:function(){var t;return null!==(t=o._spec.centerX)&&void 0!==t?t:(o._viewBox.x1+o._viewBox.x2)/2},y:function(){var t;return null!==(t=o._spec.centerY)&&void 0!==t?t:(o._viewBox.y1+o._viewBox.y2)/2},size:function(){return Math.max(o._viewBox.x2-o._viewBox.x1,o._viewBox.y2-o._viewBox.y1)/2},fill:null!==(n=l.fill)&&void 0!==n?n:this.getColorAttribute(),opacity:null!==(r=l.fillOpacity)&&void 0!==r?r:.2,ripple:null!==(a=l.ripple)&&void 0!==a?a:0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}}},{key:"_initCenterPointMarkStyle",value:function(){var e,i,n,r,a,o,s=this,l=this._centerPointMark;l&&this.setMarkStyle(l,{x:function(){var t;return null!==(t=s._spec.centerX)&&void 0!==t?t:(s._viewBox.x1+s._viewBox.x2)/2},y:function(){var t;return null!==(t=s._spec.centerY)&&void 0!==t?t:(s._viewBox.y1+s._viewBox.y2)/2},size:function(){return.2*Math.max(s._viewBox.x2-s._viewBox.x1,s._viewBox.y2-s._viewBox.y1)/2},fill:null!==(n=null===(i=null===(e=this._spec.centerPoint)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill)&&void 0!==n?n:this.getColorAttribute(),fillOpacity:null!==(o=null===(a=null===(r=this._spec.centerPoint)||void 0===r?void 0:r.style)||void 0===a?void 0:a.fillOpacity)&&void 0!==o?o:1},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"initTooltip",value:function(){_(r,"initTooltip",this,3)([]),this._nodePointMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodePointMark)}},{key:"initLabelMarkStyle",value:function(e){var i=this;e&&this.setMarkStyle(e,{fill:this.getColorAttribute(),text:function(t){return t[i._categoryField]},z:this.dataToPositionZ.bind(this)},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"initAnimation",value:function(){var t,e,i=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this._nodePointMark.setAnimationConfig(YF(null===(e=rO.getAnimationInKey("correlation"))||void 0===e?void 0:e({},i),XF("nodePoint",this._spec,this._markAttributeContext)))}},{key:"getGroupFields",value:function(){return[]}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return""}},{key:"getActiveMarks",value:function(){return[this._nodePointMark,this._centerPointMark]}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this._rawData.reRunAllTransform(),this.getViewData().reRunAllTransform()}}])}(oU);ZX.type=_L.correlation,ZX.mark=zX,ZX.builtInTheme={correlation:{centerLabel:{visible:!0,position:"center",style:{fill:"#fff",text:""}},label:{visible:!0,position:"bottom",style:{fill:"#000"}}}},ZX.transformerConstructor=qX;var JX=function(){Bj(),TV(),pM(),rO.registerMark(XX.type,XX),rO.registerGraphicComponent("symbol",(function(t){return Gf(t)})),rO.registerSeries(ZX.type,ZX),rO.registerAnimation("correlation",(function(t,e){return Object.assign({appear:KX(0,e)},qD)}))},QX=Object.assign(Object.assign({},jF),{liquidGroup:{name:"liquidGroup",type:"group"},liquid:{name:"liquid",type:"liquid"},liquidBackground:{name:"liquidBackground",type:"group"},liquidOutline:{name:"liquidOutline",type:"group"}}),$X=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t._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}}},t._positionChannels=["wave","y","height"],t._positionEncoder=function(t,e,i){for(var n=t.wave,r=void 0===n?i.attribute.wave:n,a=t.y,o=void 0===a?i.attribute.y:a,s=t.height,l=void 0===s?i.attribute.height:s,u=[],c=[],h=[],d=0;d<21;d++){var v=50*d-500,f=o+(d%2==0?20:0),p=o+l;u.push({x:v+100*r,y:f,y1:p}),c.push({x:v+200*r-40,y:f,y1:p}),h.push({x:v+300*r-20,y:f,y1:p})}return{wave0:{x:0,y:0,points:u},wave1:{x:0,y:0,points:c},wave2:{x:0,y:0,points:h}}},t}return c(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{wave:0})}}])}(wV);$X.type="liquid";var tK=function(t,e){return"drop"===t?function(t,e,i){var n=4*i/3,r=Math.max(n,2*i),a=n/2,o=t,s=a+e-r/2,l=Math.asin(a/(.85*(r-a))),u=Math.sin(l)*a,c=Math.cos(l)*a,h=o-c,d=s+u,v=t,f=s+a/Math.sin(l);return"\n M ".concat(h," ").concat(d,"\n A ").concat(a," ").concat(a," 0 1 1 ").concat(h+2*c," ").concat(d,"\n Q ").concat(v," ").concat(f," ").concat(t," ").concat(e+r/2,"\n Q ").concat(v," ").concat(f," ").concat(h," ").concat(d,"\n Z \n ")}(0,0,e):t},eK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).markTooltipKeyCallback=function(e){return t.series.getValueField()},t.markTooltipValueCallback=function(e){return e[t.series.getValueField()]},t.shapeStrokeCallback=function(e){return t.series.getMarkInName("liquid").getAttribute("fill",e)},t}return c(e,t),a(e)}(wF),iK=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=_L.liquid,t.transformerConstructor=Pj,t._liquidBackgroundMark=null,t._liquidOutlineMark=null,t._getLiquidPosY=function(){var e=t._getLiquidBackPosAndSize(),i=e.height,n=e.startY;return(t._reverse?i*t._heightRatio:i*(1-t._heightRatio))+n},t._getLiquidHeight=function(){return t._getLiquidBackPosAndSize().height*t._heightRatio},t._getLiquidBackPosAndSize=function(){var e,i,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=t._marginSpec,a=r.top,o=void 0===a?0:a,s=r.bottom,l=void 0===s?0:s,u=r.left,c=void 0===u?0:u,h=r.right,d=void 0===h?0:h,v=n?{}:t._paddingSpec,f=v.top,p=void 0===f?0:f,g=v.bottom,y=void 0===g?0:g,m=v.left,_=void 0===m?0:m,b=v.right,k=void 0===b?0:b;"triangle"===t._maskShape&&(l/=Math.sqrt(3),o=o/Math.sqrt(3)*2,y/=Math.sqrt(3),p=p/Math.sqrt(3)*2);var x=null!==(i=null===(e=t._region)||void 0===e?void 0:e.getLayoutRect())&&void 0!==i?i:{width:0,height:0},S=x.width,A=x.height,M=S/2+(c+_-(d+k))/2,w=A/2+(o+p-(l+y))/2,T=S-(c+d+_+k),C=A-(o+l+p+y),E=Math.min(T,C);return"rect"!==t._maskShape&&(T=E,C=E),{x:M,y:w,size:E,width:T,height:C,startX:M-T/2,startY:w-C/2,endX:M+T/2,endY:w+C/2}},t._getLiquidBackPath=function(){var e,i,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("rect"===t._maskShape){var r=t._getLiquidBackPosAndSize(n),a=r.x,o=r.y,s=r.width,l=r.height;i=Qf({x:a-s/2,y:o-l/2,width:s,height:l,fill:!0})}else{var u=t._getLiquidBackPosAndSize(n),c=u.x,h=u.y,d=u.size;i=Gf({x:c,y:h,size:d,symbolType:tK(null!==(e=t._spec.maskShape)&&void 0!==e?e:"circle",d),fill:!0})}return[i]},t}return c(r,e),a(r,[{key:"setValueField",value:function(t){C(t)&&(this._valueField=t)}},{key:"getValueField",value:function(){return this._valueField}},{key:"setAttrFromSpec",value:function(){var t,e;_(r,"setAttrFromSpec",this,3)([]),this._marginSpec=XL(this._spec.outlineMargin),this._paddingSpec=XL(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"}},{key:"viewDataUpdate",value:function(t){var e=this;_(r,"viewDataUpdate",this,3)([t]),this._heightRatio=se.apply(void 0,b(this._data.getLatestData().map((function(t){return t[e._valueField]}))))}},{key:"initMark",value:function(){this._initLiquidOutlineMark(),this._initLiquidBackgroundMark(),this._initLiquidMark()}},{key:"initMarkStyle",value:function(){this._initLiquidOutlineMarkStyle(),this._initLiquidBackgroundMarkStyle(),this._initLiquidMarkStyle()}},{key:"_initLiquidOutlineMark",value:function(){return this._liquidOutlineMark=this._createMark(r.mark.liquidOutline,{isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidOutlineMark}},{key:"_initLiquidBackgroundMark",value:function(){return this._liquidBackgroundMark=this._createMark(r.mark.liquidBackground,{isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidBackgroundMark}},{key:"_initLiquidMark",value:function(){return this._liquidGroupMark=this._createMark(r.mark.liquidGroup,{parent:this._liquidBackgroundMark,isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidMark=this._createMark(r.mark.liquid,{parent:this._liquidGroupMark,isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidMark}},{key:"_buildMarkAttributeContext",value:function(){_(r,"_buildMarkAttributeContext",this,3)([]),this._markAttributeContext.getLiquidBackPosAndSize=this._getLiquidBackPosAndSize,this._markAttributeContext.getLiquidPosY=this._getLiquidPosY,this._markAttributeContext.getLiquidHeight=this._getLiquidHeight}},{key:"_initLiquidOutlineMarkStyle",value:function(){var e=this,i=this._liquidOutlineMark;i.created(),this.setMarkStyle(i,{stroke:this.getColorAttribute(),width:function(){return e._region.getLayoutRect().width},height:function(){return e._region.getLayoutRect().height},path:function(){return e._getLiquidBackPath(!0)}},"normal",t.AttributeLevel.Series),this._liquidOutlineMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex})}},{key:"_initLiquidBackgroundMarkStyle",value:function(){var e=this,i=this._liquidBackgroundMark;i.created(),this.setMarkStyle(i,{width:function(){return e._region.getLayoutRect().width},height:function(){return e._region.getLayoutRect().height},path:function(){return e._getLiquidBackPath()}},"normal",t.AttributeLevel.Series),this._liquidBackgroundMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex,clip:!0})}},{key:"_initLiquidMarkStyle",value:function(){var e=this,i=this._liquidMark,n=this._liquidGroupMark;n&&this.setMarkStyle(n,{x:function(){return e._region.getLayoutStartPoint().x+e._region.getLayoutRect().width/2},angle:this._reverse?-Math.PI:0,y:0,dy:this._getLiquidPosY}),i&&this.setMarkStyle(i,{y:0,dy:0,height:this._getLiquidHeight,fill:this.getColorAttribute(),wave:0},"normal",t.AttributeLevel.Series)}},{key:"initTooltip",value:function(){this._tooltipHelper=new eK(this),this._liquidMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._liquidMark)}},{key:"getInteractionTriggers",value:function(){return this._parseInteractionConfig(this._liquidMark?[this._liquidMark]:[])}},{key:"initAnimation",value:function(){var t,e,i,n,r=this,a={height:{from:0,to:function(){return r._getLiquidHeight()}},dy:{from:function(){var t=r._getLiquidBackPosAndSize(),e=t.height,i=t.startY;return(r._reverse?0:e)+i}}},o=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._liquidMark.setAnimationConfig(YF(null===(i=rO.getAnimationInKey("liquid"))||void 0===i?void 0:i(a,o),XF("liquid",this._spec,this._markAttributeContext))),this._liquidGroupMark.setAnimationConfig(YF(null===(n=rO.getAnimationInKey("liquidGroup"))||void 0===n?void 0:n(a,o),XF("liquidGroup",this._spec,this._markAttributeContext)))}},{key:"initEvent",value:function(){var e=this;_(r,"initEvent",this,3)([]),this._spec.indicatorSmartInvert&&this._option.getChart().getComponentsByKey("indicator")&&this.event.on(t.ChartEvent.renderFinished,(function(){e._option.getChart().getComponentsByKey("indicator").forEach((function(t){var i,n,r,a=null===(i=e._liquidMark.getGraphics()[0].getSubGraphic())||void 0===i?void 0:i[0],o=a.globalAABBBounds,s=o.y1,l=o.y2;s+=e._region.getLayoutStartPoint().y,l+=e._region.getLayoutStartPoint().y,null===(r=null===(n=null==t?void 0:t.getIndicatorComponent())||void 0===n?void 0:n.getChildren()[0])||void 0===r||r.getChildren().forEach((function(t){var e=t.globalAABBBounds,i=e.y1,n=e.y2;if(s<i&&l>n){var r=zM(t.attribute.fill,a.attribute.fill);t.setAttribute("fill",r)}}))}))}))}},{key:"dataToPosition",value:function(t){return null}},{key:"dataToPositionX",value:function(t){return null}},{key:"dataToPositionY",value:function(t){return null}},{key:"valueToPosition",value:function(t,e){return null}},{key:"getStatisticFields",value:function(){return[]}},{key:"getGroupFields",value:function(){return[]}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return""}},{key:"getActiveMarks",value:function(){return[this._liquidMark]}}])}(ej);iK.type=_L.liquid,iK.mark=QX,iK.builtInTheme={liquid:{outlinePadding:10,liquidBackground:{style:{lineWidth:0,fillOpacity:.2}},liquidOutline:{style:{lineWidth:2}}}},iK.transformerConstructor=Pj;var nK=function(t){return lt(t).join(",")},rK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).dimensionTooltipTitleCallback=function(e){return nK(null==e?void 0:e[t.series.getDimensionField()[0]])},t.markTooltipKeyCallback=function(e){return nK(null==e?void 0:e[t.series.getDimensionField()[0]])},t}return c(e,t),a(e)}(wF),aK=Object.assign(Object.assign({},jF),{circle:{name:"circle",type:"arc"},overlap:{name:"overlap",type:"path"},overlapLabel:{name:"overlapLabel",type:"text"}}),oK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"circle"),this._addMarkLabelSpec(t,"overlap","overlapLabel","initOverlapLabelMarkStyle")}}])}(tj),sK=function(t,e){var i=e.getViewBox();return i&&(null==t?void 0:t.length)?wG(Object.assign({setField:e.setField,valueField:e.valueField},i),t):[]},lK=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=_L.venn,t.transformerConstructor=oK,t._viewBox=new ii,t}return c(r,e),a(r,[{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"setAttrFromSpec",value:function(){var t,e,i;_(r,"setAttrFromSpec",this,3)([]),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:RO)}},{key:"initData",value:function(){var t,e=this;_(r,"initData",this,3)([]),EI(this._dataSet,"venn",sK),null===(t=this._data.getDataView())||void 0===t||t.transform({type:"venn",options:{getViewBox:function(){return e._viewBox.empty()?null:{x0:e._viewBox.x1,x1:e._viewBox.x2,y0:e._viewBox.y1,y1:e._viewBox.y2}},setField:this._categoryField,valueField:this._valueField}})}},{key:"compile",value:function(){_(r,"compile",this,3)([]),this._runVennTransform()}},{key:"_runVennTransform",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._data.getDataView().reRunAllTransform(),t&&this.getCompiler().renderNextTick()}},{key:"initMark",value:function(){var t=this._createMark(r.mark.circle,{isSeriesMark:!0});t&&(t.setTransform([{type:"vennMark",datumType:"circle"}]),this._circleMark=t);var e=this._createMark(r.mark.overlap,{isSeriesMark:!0});e&&(e.setTransform([{type:"vennMark",datumType:"overlap"}]),this._overlapMark=e)}},{key:"initMarkStyle",value:function(){this._initCircleMarkStyle(),this._initOverlapMarkStyle()}},{key:"_initCircleMarkStyle",value:function(){this._circleMark&&this.setMarkStyle(this._circleMark,{x:function(t){return t.x},y:function(t){return t.y},innerRadius:0,outerRadius:function(t){return t.radius},startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),stroke:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initOverlapMarkStyle",value:function(){this._overlapMark&&(this.setMarkStyle(this._overlapMark,{x:function(t){return t.x},y:function(t){return t.y},path:function(t){return t.path},arcs:function(t){return t.arcs},fill:this.getColorAttribute(),stroke:this.getColorAttribute(),zIndex:function(t){return 100*t.sets.length}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this.setMarkStyle(this._overlapMark,{zIndex:function(t){return 100*t.sets.length+1}},t.STATE_VALUE_ENUM.STATE_HOVER,t.AttributeLevel.Series))}},{key:"initLabelMarkStyle",value:function(e){e&&(this._labelMark=e,e.setRule("venn"),this.setMarkStyle(e,{x:function(t){return t.labelX},y:function(t){return t.labelY},text:function(t){return nK(t.sets)},maxLineWidth:function(t){var e=t.x,i=t.radius,n=t.labelX,r=e-i,a=e+i;return Math.min(n-r,a-n)}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series))}},{key:"initOverlapLabelMarkStyle",value:function(e){e&&(this._labelMark=e,e.setRule("venn"),this.setMarkStyle(e,{x:function(t){return t.labelX},y:function(t){return t.labelY},text:function(t){return nK(t.sets)}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series))}},{key:"initTooltip",value:function(){this._tooltipHelper=new rK(this),this._circleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circleMark),this._overlapMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._overlapMark)}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runVennTransform()}},{key:"getDefaultShapeType",value:function(){return"circle"}},{key:"getActiveMarks",value:function(){return[this._circleMark,this._overlapMark]}},{key:"getStatisticFields",value:function(){var t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}},{key:"getGroupFields",value:function(){return null}},{key:"dataToPosition",value:function(t,e){return{x:t.x,y:t.y}}},{key:"dataToPositionX",value:function(t){return t.x}},{key:"dataToPositionY",value:function(t){return t.y}},{key:"valueToPosition",value:function(t,e){throw new Error("Method not implemented.")}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return null}},{key:"_getSeriesInfo",value:function(t,e){var i=this,n=this.getDefaultShapeType();return e.map((function(e){return{key:nK(e),originalKey:e,style:i.getSeriesStyle(s({},t,e)),shapeType:n}}))}},{key:"getSeriesFieldValue",value:function(t,e){var i=_(r,"getSeriesFieldValue",this,3)([t,e]);return nK(i)}},{key:"legendSelectedFilter",value:function(t,e){if(t.type===d.discreteLegend){var i=t.getLegendDefaultData(!0);if(0===e.length&&i.length)return[];if(e.length===i.length)return e;var n={};e.forEach((function(t){n[t]=!0}));var r=i.filter((function(t){return!n[nK(t)]})),a=i.filter((function(t){return!r.includes(t)&&r.some((function(e){return lt(e).every((function(e){return t.includes(e)}))}))}));e=e.slice(),a.forEach((function(t){e.splice(e.indexOf(nK(t)),1)}))}return e}},{key:"initAnimation",value:function(){var t=this;this.getMarksInType("arc").forEach((function(e){var i;e.setAnimationConfig(YF(null===(i=rO.getAnimationInKey("vennCircle"))||void 0===i?void 0:i(),XF(e.name,t._spec,t._markAttributeContext)))})),this.getMarksInType("path").forEach((function(e){var i;e.setAnimationConfig(YF(null===(i=rO.getAnimationInKey("vennOverlap"))||void 0===i?void 0:i(),XF(e.name,t._spec,t._markAttributeContext)))}))}}])}(ej);lK.type=_L.venn,lK.mark=aK,lK.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"}}}}},lK.transformerConstructor=oK;var uK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=_L.mosaic,t.transformerConstructor=vN,t}return c(e,t),a(e,[{key:"bandWidthField",get:function(){return this._bandWidthField}},{key:"getStack",value:function(){return!0}},{key:"getPercent",value:function(){return this._spec.percent}},{key:"getGroupFields",value:function(){return"vertical"===this.direction?this._specXField:this._specYField}},{key:"setAttrFromSpec",value:function(){_(e,"setAttrFromSpec",this,3)([]);var t=this.getPercent();"horizontal"===this.direction?(t&&(this.setFieldX(XO),this.setFieldX2(YO)),this.setFieldY(qO),this.setFieldY2(KO)):(t&&(this.setFieldY(XO),this.setFieldY2(YO)),this.setFieldX(qO),this.setFieldX2(KO)),this._spec.bandWidthField&&(this._bandWidthField=this._spec.bandWidthField)}},{key:"parseLabelStyle",value:function(t,e){if((null==e?void 0:e.filterByGroup)&&T(t.dataFilter)){var i=this.getGroupFields(),n=e.filterByGroup,r=n.field,a=n.type,o=void 0===a?"max":a,s=n.filter;delete t.filterField;var l=i.indexOf(r);if(l<0)return;var u=l%2?"min"===o?"horizontal"===this.direction?this._fieldY2:this._fieldX2:"horizontal"===this.direction?this._fieldY:this._fieldX:"min"===o?"horizontal"===this.direction?this._fieldX2:this._fieldY2:"horizontal"===this.direction?this._fieldX:this._fieldY,c="min"===o?function(t,e){var i,n;return(null===(i=t.data)||void 0===i?void 0:i[u])<(null===(n=e.data)||void 0===n?void 0:n[u])}:function(t,e){var i,n;return(null===(i=t.data)||void 0===i?void 0:i[u])>(null===(n=e.data)||void 0===n?void 0:n[u])};t.dataFilter=function(t){var e={};return t.forEach((function(t){var i=t.data,n=null==i?void 0:i[r];T(n)||s&&!s(t)||e[n]&&!c(t,e[n])||(e[n]=t)})),t.filter((function(t){var i,n=null===(i=t.data)||void 0===i?void 0:i[r];return e[n]&&e[n]===t}))}}return t}}])}(fN);uK.type=_L.mosaic,uK.builtInTheme={mosaic:{label:{visible:!1,position:"center",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},bar:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}}}},uK.transformerConstructor=vN;var cK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_isValidSeries",value:function(t){return t===_L.map}},{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["type","nameField","valueField","map","nameProperty","centroidProperty","nameMap","area","defaultFillColor","showDefaultName"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),t.region.forEach((function(t){t.coordinate="geo"})),_(e,"transformSeriesSpec",this,3)([t])}}])}(lH),hK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=cK,t.type="map",t.seriesType=_L.map,t}return c(e,t),a(e)}(oH);hK.type="map",hK.seriesType=_L.map,hK.transformerConstructor=cK;var dK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_isValidSeries",value:function(t){return!this.seriesType||t===this.seriesType}},{key:"getIndicatorSpec",value:function(t){var e,i,n,r=lt(t.indicator),a=null!==(e=t.innerRadius)&&void 0!==e?e:null===(n=null===(i=t.series)||void 0===i?void 0:i[0])||void 0===n?void 0:n.innerRadius;return C(a)&&r.forEach((function(t){T(t.limitRatio)&&(t.limitRatio=a)})),r}},{key:"_getDefaultSeriesSpec",value:function(t,i){return _(e,"_getDefaultSeriesSpec",this,3)([t,["radius","outerRadius","innerRadius","startAngle","endAngle","sortDataByAxis"],i])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),O(t.dataZoom)&&t.dataZoom.length>0&&t.dataZoom.forEach((function(t){"axis"===t.filterMode&&(t.filterMode="filter")})),this.transformSeriesSpec(t),C(t.indicator)&&(t.indicator=this.getIndicatorSpec(t))}}])}(lH),vK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"needAxes",value:function(){return!1}},{key:"_getDefaultSeriesSpec",value:function(t){var i=_(e,"_getDefaultSeriesSpec",this,3)([t,["startAngle","endAngle","centerX","centerY"]]);return i.categoryField=t.categoryField||t.radiusField,i.valueField=t.valueField||t.angleField,i}},{key:"_transformProgressAxisSpec",value:function(t,e,i,n,r){var a,o;t.axes||(t.axes=[]);var s=(null!==(a=t.axes)&&void 0!==a?a:[]).find((function(t){return"radius"===t.orient})),l=(null!==(o=t.axes)&&void 0!==o?o:[]).find((function(t){return"angle"===t.orient}));l||(l=e,t.axes.push(l)),s||(s=i,t.axes.push(s)),T(l.type)&&(l.type="linear"),T(s.type)&&(s.type="band");var u=Uj(l,{min:0,max:1});T(l.min)&&(l.min=u.min),T(l.max)&&(l.max=u.max),n&&Object.assign(l,nO({},n,l)),r&&Object.assign(s,nO({},r,s))}}])}(dK),fK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"needAxes",value:function(){return!0}},{key:"_getDefaultSeriesSpec",value:function(t){var i=_(e,"_getDefaultSeriesSpec",this,3)([t]);return i.categoryField=t.categoryField||t.angleField,i.valueField=t.valueField||t.radiusField,i}},{key:"transformSpec",value:function(t){var i;if(_(e,"transformSpec",this,3)([t]),this.needAxes()){t.axes||(t.axes=[]);var n={radius:!1,angle:!1};(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((function(t){var e=t.orient;"radius"===e&&(n.radius=!0),"angle"===e&&(n.angle=!0)})),n.angle||t.axes.push({orient:"angle"}),n.radius||t.axes.push({orient:"radius"})}}}])}(dK),pK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"needAxes",value:function(){return!1}},{key:"_getDefaultSeriesSpec",value:function(t){var i,n=_(e,"_getDefaultSeriesSpec",this,3)([t,["center","centerOffset","cornerRadius","padAngle","minAngle","emptyPlaceholder","showAllZero","supportNegative","useSequentialAnimation","layoutRadius"]]);return n.categoryField=t.categoryField||t.seriesField,n.valueField=t.valueField||t.angleField,n.emptyCircle=null===(i=t.emptyPlaceholder)||void 0===i?void 0:i.emptyCircle,n}}])}(dK),gK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=pK,t}return c(e,t),a(e)}(oH);gK.transformerConstructor=pK;var yK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=pK,t.type="pie",t.seriesType=_L.pie,t}return c(e,t),a(e)}(gK);yK.type="pie",yK.seriesType=_L.pie,yK.transformerConstructor=pK;var mK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r,a=_(e,"_getDefaultSeriesSpec",this,3)([t]);return a.radius=null!==(i=t.radius)&&void 0!==i?i:az,a.outerRadius=null!==(n=t.outerRadius)&&void 0!==n?n:az,a.innerRadius=null!==(r=t.innerRadius)&&void 0!==r?r:0,a.stack=t.stack,a.percent=t.percent,a}},{key:"transformSpec",value:function(t){var i;_(e,"transformSpec",this,3)([t]),(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((function(t){["domainLine","grid","label","tick"].forEach((function(e){t[e]||(t[e]={visible:!1})})),"angle"===t.orient&&T(t.bandPosition)&&(t.bandPosition=.5)})),t.crosshair=lt(t.crosshair||{}).map((function(t){return nO({categoryField:{visible:!0,line:{visible:!0,type:"rect"}}},t)}))}}])}(fK),_K=function(t,e){if(!t)return null;var i=_j(t,(function(t){return"angle"===t.getOrient()}),e),n=_j(t,(function(t){return"radius"===t.getOrient()}),e);if(!(i&&i.length||n&&n.length))return null;var r=[],a=function(t){return t.getDimensionField()[0]},o=e.x,s=e.y;return i&&i.forEach((function(t){var e,i=t.getScale();if(i&&lE(i.type)){var l=i.domain(),u=i.range(),c=t.getCenter(),h={x:o-t.getLayoutStartPoint().x-c.x,y:s-t.getLayoutStartPoint().y-c.y},d=vL({x:1,y:0},h);d=function(t,e){var i=2*Math.PI,n=ht(e),r=ct(e);return t<n?t+=Math.ceil((n-t)/i)*i:t>r&&(t-=Math.ceil((t-r)/i)*i),t}(d,u);var v=fL(h),f=null===(e=n[0])||void 0===e?void 0:e.getScale(),p=null==f?void 0:f.range();if((d-(null==u?void 0:u[0]))*(d-(null==u?void 0:u[1]))>0||(v-(null==p?void 0:p[0]))*(v-(null==p?void 0:p[1]))>0)return;var g=t.invert(d);if(T(g))return;var y=l.findIndex((function(t){return(null==t?void 0:t.toString())===g.toString()}));y<0&&(y=void 0);var m=yj(g,t,"polar",a);r.push({index:y,value:g,position:i.scale(g),axis:t,data:m})}})),n&&n.forEach((function(t){var e,n=t.getScale(),l=null==n?void 0:n.range();if(n&&lE(n.type)){var u=t.getCenter(),c={x:o-t.getLayoutStartPoint().x-u.x,y:s-t.getLayoutStartPoint().y-u.y},h=vL({x:1,y:0},c);h<-Math.PI/2&&(h=2*Math.PI+h);var d=fL(c),v=null===(e=i[0])||void 0===e?void 0:e.getScale(),f=null==v?void 0:v.range();if((h-(null==f?void 0:f[0]))*(h-(null==f?void 0:f[1]))>0||(d-(null==l?void 0:l[0]))*(d-(null==l?void 0:l[1]))>0)return;var p=n.invert(d);if(T(p))return;var g=n.domain().findIndex((function(t){return(null==t?void 0:t.toString())===p.toString()}));g<0&&(g=void 0);var y=yj(p,t,"polar",a);r.push({index:g,value:p,position:n.scale(p),axis:t,data:y})}})),r.length?r:null},bK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=mK,t.type="rose",t.seriesType=_L.rose,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=_K}}])}(oH);bK.type="rose",bK.seriesType=_L.rose,bK.transformerConstructor=mK,st(bK,vH);var kK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n=_(e,"_getDefaultSeriesSpec",this,3)([t]);return n.line=t.line,n.point=t.point,n.stack=t.stack,n.percent=t.percent,n.area=nO({visible:!1},t.area),n.seriesMark=null!==(i=t.seriesMark)&&void 0!==i?i:"area",n.activePoint=t.activePoint,n.pointDis=t.pointDis,n.pointDisMul=t.pointDisMul,n.markOverlap=t.markOverlap,n}},{key:"transformSpec",value:function(t){var i;_(e,"transformSpec",this,3)([t]),(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((function(t){"radius"===t.orient&&(["domainLine","label","tick"].forEach((function(e){t[e]||(t[e]={visible:!1})})),t.grid||(t.grid={visible:!0}))})),t.crosshair=lt(t.crosshair||{}).map((function(t){return nO({categoryField:{visible:!0,line:{visible:!0,type:"line"}}},t)}))}}])}(fK),xK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=kK,t.type="radar",t.seriesType=_L.radar,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=_K}}])}(oH);xK.type="radar",xK.seriesType=_L.radar,xK.transformerConstructor=kK,st(xK,vH);var SK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i=_(e,"_getDefaultSeriesSpec",this,3)([t]);return delete i.data,i}},{key:"_transformAxisSpec",value:function(t){var e=this;t.axes&&t.autoBandSize&&t.series.forEach((function(i,n){var r;if("bar"===i.type){var a=e._findBandAxisBySeries(i,n,t.axes);if(a&&!a.bandSize&&!a.maxBandSize&&!a.minBandSize){var o=E(i.autoBandSize)&&null!==(r=i.autoBandSize.extend)&&void 0!==r?r:0,s=i.barMaxWidth,l=i.barMinWidth,u=i.barWidth,c=i.barGapInGroup;e._applyAxisBandSize(a,o,{barMaxWidth:s,barMinWidth:l,barWidth:u,barGapInGroup:c})}}}))}},{key:"transformSpec",value:function(t){var i=this;if(_(e,"transformSpec",this,3)([t]),t.series&&t.series.length){var n=this._getDefaultSeriesSpec(t);t.series.forEach((function(t){i._isValidSeries(t.type)&&Object.keys(n).forEach((function(e){e in t||(t[e]=n[e])}))}))}t.axes&&t.axes.length&&t.axes.forEach((function(e){X(e,"trimPadding")&&nO(e,cD(i.type,t))})),this._transformAxisSpec(t)}}])}(lH),AK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=SK,t.type="common",t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=function(t,e,i){var n,r;return[].concat(b(null!==(n=AH(t,e,i))&&void 0!==n?n:[]),b(null!==(r=_K(t,e))&&void 0!==r?r:[]))},this._modelOption.getDimensionInfoByValue=wH,this._modelOption.getRectByDimensionData=RH}}])}(oH);AK.type="common",AK.transformerConstructor=SK,st(AK,vH);var MK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),t.axes.forEach((function(t){return t.type="linear"}))}},{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["x2Field","y2Field","barMinHeight","barBackground","barGap"]])}}])}(uH),wK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=MK,t}return c(e,t),a(e)}(oH);wK.transformerConstructor=MK,st(wK,vH);var TK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),sD(t)}}])}(MK),CK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=TK,t.type="histogram",t.seriesType=_L.bar,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=AH,this._modelOption.getDimensionInfoByValue=wH,this._modelOption.getRectByDimensionData=RH}}])}(wK);CK.type="histogram",CK.seriesType=_L.bar,CK.transformerConstructor=TK;var EK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r=_(e,"_getDefaultSeriesSpec",this,3)([t]);return r.progress=t.progress,r.track=t.track,r.tickMask=t.tickMask,r.cornerRadius=null!==(i=t.cornerRadius)&&void 0!==i?i:0,r.roundCap=null!==(n=t.roundCap)&&void 0!==n&&n,r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this._transformProgressAxisSpec(t,{orient:"angle",visible:!1},{orient:"radius",visible:!1},{forceInitTick:t.tickMask&&!1!==t.tickMask.visible})}}])}(vK),BK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=EK,t.type="circularProgress",t.seriesType=_L.circularProgress,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=_K}}])}(oH);BK.type="circularProgress",BK.seriesType=_L.circularProgress,BK.transformerConstructor=EK,st(BK,vH);var PK=function(e){function r(){return n(this,r),i(this,r,arguments)}return c(r,e),a(r,[{key:"_getDefaultSeriesSpec",value:function(t){var e=_(r,"_getDefaultSeriesSpec",this,3)([t]);return e.radiusField=t.radiusField,e.pin=t.pin,e.pinBackground=t.pinBackground,e.pointer=t.pointer,e}},{key:"_getDefaultCircularProgressSeriesSpec",value:function(t){var e=_(r,"_getDefaultSeriesSpec",this,3)([t]);return e.type=_L.circularProgress,e}},{key:"transformSpec",value:function(e){var i,n,a,o,s;_(r,"transformSpec",this,3)([e]);var l=null===(i=e.series)||void 0===i?void 0:i.find((function(t){return t.type===_L.gauge||t.type===_L.circularProgress}));T(l)&&("circularProgress"===(l=null!==(n=e.gauge)&&void 0!==n?n:this._getDefaultCircularProgressSeriesSpec(e)).type&&(T(l.radiusField)&&T(l.categoryField)&&(l.radiusField=null!==(o=null!==(a=e.radiusField)&&void 0!==a?a:e.categoryField)&&void 0!==o?o:e.seriesField),T(l.valueField)&&T(l.angleField)&&(l.valueField=null!==(s=e.valueField)&&void 0!==s?s:e.angleField)),1===e.series.length?e.series.push(l):e.series.forEach((function(t){t.type===l.type&&Object.keys(l).forEach((function(e){e in t||(t[e]=l[e])}))}))),l.type===_L.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)}},{key:"_transformGaugeAxisSpec",value:function(e){var i;e.axes||(e.axes=[]);var n={radius:null,angle:null};(null!==(i=e.axes)&&void 0!==i?i:[]).forEach((function(t){var e=t.orient;"radius"===e&&(n.radius=t),"angle"===e&&(n.angle=t)})),n.angle||(n.angle={orient:"angle",visible:!0},e.axes.push(n.angle)),n.radius||(n.radius={orient:"radius",visible:!1},e.axes.push(n.radius)),T(n.angle.type)&&(n.angle.type="linear"),T(n.radius.type)&&(n.radius.type="linear"),T(n.angle.zIndex)&&(n.angle.zIndex=t.LayoutZIndex.Region+50)}}])}(vK),RK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=PK,t.type="gauge",t.seriesType=_L.gaugePointer,t}return c(e,t),a(e)}(oH);RK.type="gauge",RK.seriesType=_L.gaugePointer,RK.transformerConstructor=PK;var LK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}},{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["nameField","valueField","fontFamilyField","fontWeightField","fontStyleField","colorHexField","colorMode","colorList","rotateAngles","fontWeightRange","fontSizeRange","maskShape","keepAspect","random","wordCloudConfig","wordCloudShapeConfig","word","fillingWord","wordMask"]])}}])}(lH),OK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=LK,t.type="wordCloud",t.seriesType=_L.wordCloud,t}return c(e,t),a(e)}(oH);OK.transformerConstructor=LK;var IK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=LK,t.type="wordCloud",t.seriesType=_L.wordCloud,t}return c(e,t),a(e)}(OK);IK.type="wordCloud",IK.seriesType=_L.wordCloud,IK.transformerConstructor=LK;var DK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"needAxes",value:function(){return!1}},{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","funnelAlign","funnelOrient","heightRatio","shape","funnel","transform","outerLabel","transformLabel","isTransform","maxSize","minSize","gap","isCone","range","transformRatioText"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),_(e,"transformSeriesSpec",this,3)([t])}}])}(lH),FK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=DK,t.type="funnel",t.seriesType=_L.funnel,t}return c(e,t),a(e)}(oH);FK.type="funnel",FK.seriesType=_L.funnel,FK.transformerConstructor=DK;var jK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"needAxes",value:function(){return!1}},{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r=_(e,"_getDefaultSeriesSpec",this,3)([t,["bandWidth","progress","track","clamp"]]);return r.direction=null!==(i=t.direction)&&void 0!==i?i:"horizontal",r.cornerRadius=null!==(n=t.cornerRadius)&&void 0!==n?n:0,r}},{key:"transformSpec",value:function(t){var i,n;if(_(e,"transformSpec",this,3)([t]),t.axes||(t.axes=[]),"vertical"===t.direction){var r=null,a=null;(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((function(t){var e=t.orient;"left"===e&&(r=t),"bottom"===e&&(a=t)})),r||(r={orient:"left",visible:!1},t.axes.push(r)),a||(a={orient:"bottom",visible:!1},t.axes.push(a)),T(a.type)&&(a.type="band"),T(r.type)&&(r.type="linear");var o=Uj(r,{min:0,max:1});T(r.min)&&(r.min=o.min),T(r.max)&&(r.max=o.max)}else{var s=null,l=null;(null!==(n=t.axes)&&void 0!==n?n:[]).forEach((function(t){var e=t.orient;"left"===e&&(s=t),"bottom"===e&&(l=t)})),s||(s={type:"band",orient:"left",visible:!1},t.axes.push(s)),l||(l={orient:"bottom",visible:!1},t.axes.push(l)),T(l.type)&&(l.type="linear"),T(s.type)&&(s.type="band");var u=Uj(l,{min:0,max:1});T(l.min)&&(l.min=u.min),T(l.max)&&(l.max=u.max)}}}])}(uH),zK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=jK,t.type="linearProgress",t.seriesType=_L.linearProgress,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=AH,this._modelOption.getDimensionInfoByValue=wH,this._modelOption.getRectByDimensionData=RH}}])}(oH);zK.type="linearProgress",zK.seriesType=_L.linearProgress,zK.transformerConstructor=jK,st(zK,vH);var HK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r=_(e,"_getDefaultSeriesSpec",this,3)([t,["barWidth","barMaxWidth","barMinWidth","barGapInGroup","barBackground","barMinHeight","stackCornerRadius","bar"]]);return"horizontal"===t.direction?r.xField=null!==(i=t.xField)&&void 0!==i?i:[t.minField,t.maxField]:r.yField=null!==(n=t.yField)&&void 0!==n?n:[t.minField,t.maxField],r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),sD(t)}}])}(uH),NK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=HK,t.type="rangeColumn",t.seriesType=_L.rangeColumn,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=AH,this._modelOption.getDimensionInfoByValue=wH,this._modelOption.getRectByDimensionData=RH}}])}(oH);NK.type="rangeColumn",NK.seriesType=_L.rangeColumn,NK.transformerConstructor=HK;var VK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i=C(t.startAngle)?t.startAngle:-90,n=C(t.endAngle)?t.endAngle:i+Se(2*Math.PI),r=_(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","centerX","centerY","offsetX","offsetY","innerRadius","outerRadius","gap","labelLayout","label","labelAutoVisible","drill","drillField"]]);return r.startAngle=i,r.endAngle=n,r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(lH),UK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=VK,t.type="sunburst",t.seriesType=_L.sunburst,t}return c(e,t),a(e)}(oH);UK.type="sunburst",UK.seriesType=_L.sunburst,UK.transformerConstructor=VK;var WK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","layoutPadding","circlePacking","drill","drillField"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(lH),GK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=WK,t.type="circlePacking",t.seriesType=_L.circlePacking,t}return c(e,t),a(e)}(oH);GK.type="circlePacking",GK.seriesType=_L.circlePacking,GK.transformerConstructor=WK;var YK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","aspectRatio","splitType","maxDepth","gapWidth","nodePadding","minVisibleArea","minChildrenVisibleArea","minChildrenVisibleSize","roam","drill","drillField","leaf","nonLeaf","nonLeafLabel"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(lH),XK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=YK,t.type="treemap",t.seriesType=_L.treemap,t}return c(e,t),a(e)}(oH);XK.type="treemap",XK.seriesType=_L.treemap,XK.transformerConstructor=YK;var KK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),t.legends&&lt(t.legends).forEach((function(t){t.select=!1,t.hover=!1,t.filter=!1})),sD(t)}},{key:"_getDefaultSeriesSpec",value:function(t){var i=_(e,"_getDefaultSeriesSpec",this,3)([t]);return i.bar=t.bar,i.stackLabel=t.stackLabel,i.leaderLine=t.leaderLine,i.total=t.total,i.calculationMode=t.calculationMode,i}}])}(gN),qK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=KK,t.type="waterfall",t.seriesType=_L.waterfall,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=AH,this._modelOption.getDimensionInfoByValue=wH,this._modelOption.getRectByDimensionData=RH}}])}(yN);qK.type="waterfall",qK.seriesType=_L.waterfall,qK.transformerConstructor=KK;var ZK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n=[t.maxField,t.medianField,t.q1Field,t.q3Field,t.minField,t.outliersField],r=_(e,"_getDefaultSeriesSpec",this,3)([t,["boxPlot","outlier","minField","maxField","q1Field","medianField","q3Field","outliersField","outliersStyle","boxWidth","boxMaxWidth","boxMinWidth","boxGapInGroup"]]);return r.direction=null!==(i=t.direction)&&void 0!==i?i:"vertical",r["horizontal"===r.direction?"xField":"yField"]=n,r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),sD(t)}}])}(uH),JK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=ZK,t.type="boxPlot",t.seriesType=_L.boxPlot,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=AH,this._modelOption.getDimensionInfoByValue=wH,this._modelOption.getRectByDimensionData=RH}}])}(oH);JK.type="boxPlot",JK.seriesType=_L.boxPlot,JK.transformerConstructor=ZK;var QK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([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"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(lH),$K=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=QK,t.type="sankey",t.seriesType=_L.sankey,t}return c(e,t),a(e,[{key:"_setStateInDatum",value:function(t,e,i,n){var r=O(e)?e[0]:e;if(r){var a=null;this.filterGraphicsByDatum(r,{filter:function(t,e){return"text"!==e.type&&e.getProduct()&&(!i||i(t,e))},region:n,getDatum:function(t){var e,i=null===(e=mI(t))||void 0===e?void 0:e.datum;return O(i)&&(i=i[0]),i},callback:function(t,e,i,n){var r,a,o=e.getProductId();o&&(o.includes("node")||o.includes("link"))&&(null===(a=(r=i)._handleEmphasisElement)||void 0===a||a.call(r,{item:t,mark:e}))},regionCallback:function(t,e){r&&t.length&&(a=t[0])}}),a&&this._interaction.updateStateOfGraphics(t,[a])}else this._interaction.clearByState(t)}}])}(oH);$K.type="sankey",$K.seriesType=_L.sankey,$K.transformerConstructor=QK;var tq=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r=_(e,"_getDefaultSeriesSpec",this,3)([t]);return r.area=t.area,r.point=t.point,r.line=t.line,"horizontal"===t.direction?r.xField=null!==(i=t.xField)&&void 0!==i?i:[t.minField,t.maxField]:r.yField=null!==(n=t.yField)&&void 0!==n?n:[t.minField,t.maxField],r.stack=!1,r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),sD(t)}}])}(uH),eq=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=tq,t.type="rangeArea",t.seriesType=_L.rangeArea,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=AH,this._modelOption.getDimensionInfoByValue=wH,this._modelOption.getRectByDimensionData=RH}}])}(oH);eq.type="rangeArea",eq.seriesType=_L.rangeArea,eq.transformerConstructor=tq;var iq=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["valueField","cell"]])}}])}(uH),nq=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=iq,t.type="heatmap",t.seriesType=_L.heatmap,t}return c(e,t),a(e)}(oH);nq.type="heatmap",nq.seriesType=_L.heatmap,nq.transformerConstructor=iq;var rq=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","sizeField","sizeRange","centerX","centerY","innerRadius","outerRadius","startAngle","endAngle","ripplePoint","centerPoint","centerLabel","nodePoint"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(lH),aq=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=rq,t.type="correlation",t.seriesType=_L.correlation,t}return c(e,t),a(e)}(oH);function oq(t){var e,i,n=Object.assign({},t);return Y(t.style)||(n.textStyle=pI(t.style)),Y(t.textStyle)||nO(n.textStyle,pI(t.textStyle)),(null===(e=t.shape)||void 0===e?void 0:e.style)&&pI(n.shape.style),(null===(i=t.background)||void 0===i?void 0:i.style)&&pI(n.background.style),n}aq.type="correlation",aq.seriesType=_L.correlation,aq.transformerConstructor=rq;var sq=function(t,e){var i=[],n={},r=e.series,a=e.seriesField;return r().forEach((function(t){var e=a(t);(e===t.getSeriesField()?t.getSeriesInfoList():t.getSeriesInfoInField(e)).forEach((function(t){n[t.key]||(n[t.key]=!0,i.push(t))}))})),i},lq=function(t,e){var i,n,r,a=e.series,o=e.selected,s=e.field,l=e.data,u=e.customFilter,c=o(),h=l();if(0===c.length&&h.length)return[];if(c.length===h.length)return t;var d={};c.forEach((function(t){d[t]=!0}));var v=null!==(i=s())&&void 0!==i?i:LO;return u?u(t,c,v):(O(t)&&(null===(n=t[0])||void 0===n?void 0:n.nodes)?(t[0].nodes=t[0].nodes.filter((function(t){return!0===d[t.key]})),(null===(r=t[0])||void 0===r?void 0:r.links)&&(t[0].links=t[0].links.filter((function(t){return!0===d[t.source]&&!0===d[t.target]})))):C(v)&&(t=t.filter((function(t){return!0===d[a.getSeriesFieldValue(t,v)]}))),t)},uq=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).layoutType="normal",e.layoutZIndex=t.LayoutZIndex.Legend,e.layoutLevel=t.LayoutLevel.Legend,e.specKey="legends",e._orient="left",e._visible=!0,e._position="middle",e._preSelectedData=[],e._selectedData=[],e.effect={onSelectedDataChange:function(){gL(e._regions,(function(t){var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:e._seriesUserId,specIndex:e._seriesIndex}),gL(e._regions,(function(t){t.reFilterViewData()}),{userId:e._seriesUserId,specIndex:e._seriesIndex})}},e}return c(r,e),a(r,[{key:"orient",get:function(){return this._orient}},{key:"visible",get:function(){return this._visible}},{key:"position",get:function(){return this._position}},{key:"getLegendData",value:function(){return this._legendData.getLatestData()}},{key:"getSelectedData",value:function(){return this._selectedData}},{key:"setAttrFromSpec",value:function(){var t;_(r,"setAttrFromSpec",this,3)([]),this._orient=NL(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;var e=this._spec,i=e.regionId,n=e.regionIndex,a=e.seriesId,o=e.seriesIndex;C(a)&&(this._seriesUserId=lt(a)),C(i)&&(this._regionUserId=lt(i)),C(o)&&(this._seriesIndex=lt(o)),C(n)&&(this._regionUserIndex=lt(n)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionUserIndex)}},{key:"created",value:function(){_(r,"created",this,3)([]),this.initData()}},{key:"_compareSpec",value:function(t,e){var i=_(r,"_compareSpec",this,3)([t,e]);return i.reRender=!0,(null==t?void 0:t.orient)!==(null==e?void 0:e.orient)?(i.reMake=!0,i):(at(e,t)||(i.reCompile=!0),i)}},{key:"_bindLegendDataChange",value:function(){this._preSelectedData=this._selectedData.slice(),this._initSelectedData(),this._forceLayout()}},{key:"initData",value:function(){var e=this,i=this._initLegendData();i.target.addListener("change",this._bindLegendDataChange.bind(this)),this._legendData=new ID(this._option,i),this._initSelectedData(),gL(this._regions,(function(i){i.event.on(t.ChartEvent.rawDataUpdate,{filter:function(t){var e=t.model;return(null==e?void 0:e.id)===i.id}},(function(){e._legendData.getDataView().reRunAllTransform({skipEqual:!0})}))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},{key:"setSelectedData",value:function(e){var i,n,r,a=this,o=this._selectedData;T(e)||JSON.stringify(o)===JSON.stringify(e)||(gL(this._regions,(function(t){t.legendSelectedFilter&&(e=t.legendSelectedFilter(a,e))}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._selectedData=b(e),null===(n=(i=this.effect).onSelectedDataChange)||void 0===n||n.call(i),this.event.emit(t.ChartEvent.legendSelectedDataChange,{model:this}),null===(r=this._legendComponent)||void 0===r||r.setSelected(this._selectedData))}},{key:"afterSetLayoutStartPoint",value:function(t){if(_(r,"afterSetLayoutStartPoint",this,3)([t]),this._legendComponent){var e=t.x,i=t.y;z(e*i)&&this._legendComponent.setAttributes({x:e,y:i})}}},{key:"getBoundsInRect",value:function(t,e){var i=this;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};var n={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},r=this._getLegendAttributes(t);if(r.disableTriggerEvent=this._option.disableTriggerEvent,this._legendComponent)at(r,this._cacheAttrs)||this._legendComponent.setAttributes(nO({},r,{defaultSelected:this._selectedData}));else{var a=new(this._getLegendConstructor())(nO({},r,{defaultSelected:this._selectedData}));a.name="legend",this._legendComponent=a,this.getContainer().add(a),this._option.disableTriggerEvent||this._initEvent(),a.on("*",(function(t,e){return i._delegateEvent(i._legendComponent,t,e)}))}this._cacheAttrs=r;var o=isFinite(this._legendComponent.AABBBounds.width())?this._legendComponent.AABBBounds.width():0,s=isFinite(this._legendComponent.AABBBounds.height())?this._legendComponent.AABBBounds.height():0;if("normal-inline"!==this.layoutType){var l="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",u=this._position,c=e.width,h=e.height,d=0,v=0;"horizontal"===l?"middle"===u?d=(c-o)/2:"end"===u&&(d=c-o):"middle"===u?v=(h-s)/2:"end"===u&&(v=h-s),this._legendComponent.setAttributes({dx:d,dy:v})}return n.x2=n.x1+o,n.y2=n.y1+s,n}},{key:"onDataUpdate",value:function(){var e,i;if(JSON.stringify(this._preSelectedData)!==JSON.stringify(this._selectedData)){if(this._legendComponent){var n=this._getLegendAttributes(this.getLayoutRect());at(n,this._cacheAttrs)||this._legendComponent.setAttributes(nO({},n,{defaultSelected:this._selectedData}))}null===(i=(e=this.effect).onSelectedDataChange)||void 0===i||i.call(e),this.event.emit(t.ChartEvent.legendSelectedDataChange,{model:this})}}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._legendComponent]}},{key:"clear",value:function(){_(r,"clear",this,3)([]),this._cacheAttrs=null,this._preSelectedData=null}}])}(vz);uq.specKey="legends";var cq=function(e){function o(){var t;return n(this,o),(t=i(this,o,arguments)).type=d.discreteLegend,t.name=d.discreteLegend,t}return c(o,e),a(o,[{key:"init",value:function(e){var i=this;_(o,"init",this,3)([e]),gL(this._regions,(function(e){e.addViewDataFilter({type:"discreteLegendFilter",options:{series:e,selected:function(){return i._selectedData},field:function(){return i._getSeriesLegendField(e)},data:function(){return i.getLegendDefaultData()},customFilter:i._spec.customFilter},level:t.TransformLevel.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},{key:"_initLegendData",value:function(){var t=this;EI(this._option.dataSet,"discreteLegendFilter",lq),EI(this._option.dataSet,"discreteLegendDataMake",sq);var e=new Xo(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")});return e.transform({type:"discreteLegendDataMake",options:{series:function(){var e=[];return gL(t._regions,(function(t){e.push(t)}),{specIndex:t._spec.seriesIndex,userId:t._spec.seriesId}),e},seriesField:function(e){return t._getSeriesLegendField(e)}}}),e}},{key:"_getSeriesLegendField",value:function(t){var e,i,n,r=t.getSeriesField(),a=null!==(e=this._spec.scaleName)&&void 0!==e?e:this._spec.scale;if(T(a))return r;if(!t.getRawData())return r;var o=this._option.globalScale.getScaleSpec(a);if(!o)return r;if(this._spec.field)return this._spec.field;if(!vb(o.domain))return r;var s=o.domain.find((function(e){return e.dataId===t.getRawData().name}));return s&&null!==(n=null===(i=s.fields)||void 0===i?void 0:i[0])&&void 0!==n?n:r}},{key:"_initSelectedData",value:function(){var t=this,e=this.getLegendDefaultData();if(this._unselectedData){var i=[],n=[];e.forEach((function(e){t._unselectedData.includes(e)?n.push(e):i.push(e)})),this._selectedData=i,this._unselectedData=n}else this._spec.defaultSelected?this._selectedData=b(this._spec.defaultSelected):this._selectedData=e}},{key:"getLegendDefaultData",value:function(t){return w(this._spec.data)?this._getLegendItems().map((function(t){return t.label})):this._legendData.getLatestData().map(t?function(t){return t.originalKey}:function(t){return t.key})}},{key:"_addDefaultTitleText",value:function(t){var e,i,n,r;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&T(t.title.text)&&T(null===(i=t.title.style)||void 0===i?void 0:i.text)){var a=null===(r=null===(n=this._regions)||void 0===n?void 0:n[0])||void 0===r?void 0:r.getSeries()[0];if(!a)return;t.title.text=iI(a.getRawData(),a.getSeriesField())}}},{key:"_getLegendAttributes",value:function(t){var e="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=Object.assign(Object.assign({layout:e,items:this._getLegendItems(),zIndex:this.layoutZIndex},function(t,e){var i=r(t,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]),n=t.title,a=void 0===n?{}:n,o=t.item,s=void 0===o?{}:o,l=t.pager,u=void 0===l?{}:l,c=t.background,h=void 0===c?{}:c;a=Z(a),s=Z(s),u=Z(u),h=Z(h);var d=i;return a.visible?d.title=oq(a):d.title={visible:!1},Y(s.focusIconStyle)||pI(s.focusIconStyle),s.shape&&(s.shape=dI(s.shape)),s.label&&(s.label=dI(s.label)),s.value&&(s.value=dI(s.value)),s.background&&(s.background=dI(s.background)),VL(s.maxWidth)&&(s.maxWidth=Number(s.maxWidth.substring(0,s.maxWidth.length-1))*e.width/100),VL(s.width)&&(s.width=Number(s.width.substring(0,s.width.length-1))*e.width/100),VL(s.height)&&(s.height=Number(s.height.substring(0,s.height.length-1))*e.width/100),d.item=s,"scrollbar"===u.type?(Y(u.railStyle)||pI(u.railStyle),Y(u.sliderStyle)||pI(u.sliderStyle)):(Y(u.textStyle)||pI(u.textStyle),u.handler&&dI(u.handler)),d.pager=u,h.visible&&!Y(h.style)&&(nO(d,h.style),C(h.padding)&&(d.padding=h.padding)),d}(this._spec,t)),{maxWidth:t.width,maxHeight:t.height});return this._addDefaultTitleText(i),this._addLegendItemFormatMethods(i),i}},{key:"_getLegendConstructor",value:function(){return MR}},{key:"setSelectedData",value:function(t){t&&(this._unselectedData=this.getLegendDefaultData().filter((function(e){return!t.includes(e)}))),_(o,"setSelectedData",this,3)([t])}},{key:"_initEvent",value:function(){var e=this;if(this._legendComponent){var i=!1!==this._spec.filter;this._legendComponent.addEventListener(fR.legendItemClick,(function(n){var r=X(n,"detail.currentSelected");i&&e.setSelectedData(r),e.event.emit(t.ChartEvent.legendItemClick,{model:e,value:r,event:n})})),this._legendComponent.addEventListener(fR.legendItemHover,(function(i){var n=X(i,"detail");e.event.emit(t.ChartEvent.legendItemHover,{model:e,value:n,event:i})})),this._legendComponent.addEventListener(fR.legendItemUnHover,(function(i){var n=X(i,"detail");e.event.emit(t.ChartEvent.legendItemUnHover,{model:e,value:n,event:i})}))}}},{key:"_getLegendItems",value:function(){var t=(this._legendData.getLatestData()||[]).map((function(t){var e,i,n=t.style("fillOpacity"),r=t.style("strokeOpacity"),a=t.style("opacity"),o=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:z(n)?n:1,strokeOpacity:z(r)?r:1,opacity:z(a)?a:1,texturePadding:o?1:null,textureSize:o?4:null,texture:o,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 w(this._spec.data)?this._spec.data(t,this._option.globalScale.getScale("color"),this._option.globalScale):t}},{key:"_addLegendItemFormatMethods",value:function(t){var e,i,n,r,a=null!==(i=null===(e=this._spec.item)||void 0===e?void 0:e.label)&&void 0!==i?i:{},o=a.formatMethod,s=a.formatter,l=null!==(r=null===(n=this._spec.item)||void 0===n?void 0:n.value)&&void 0!==r?r:{},u=l.formatMethod,c=l.formatter,h=gF(o,s).formatFunc;s&&!o&&h&&(t.item.label.formatMethod=function(t,e){return h(t,e,s)});var d=gF(u,c).formatFunc;c&&!u&&d&&(t.item.value.formatMethod=function(t,e){return d(c,t,e,s)})}}],[{key:"getSpecInfo",value:function(t){return yF(t,this.specKey,this.type,(function(t){return!t.type||"discrete"===t.type}))}}])}(uq);cq.specKey="legends",cq.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}},cq.type=d.discreteLegend;var hq=function(t,e){var i=e.series,n=e.field,r=e.scale,a=n();if(n&&a){var o=1/0,s=-1/0;return i().forEach((function(t){var e=t.getRawDataStatisticsByField(a,!0),i=null==e?void 0:e.min,n=null==e?void 0:e.max;z(i)&&(o=Math.min(i,o)),z(n)&&(s=Math.max(n,s))})),[o,s]}if(r){var l=r();return l?l.domain():[]}return[]},dq=function(t,e){var i=e.selected,n=e.field,r=e.data,a=e.isHierarchyData,o=e.customFilter,s=i(),l=n(),u=a||function(t){return t&&t.some((function(t){return t&&function(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children";return!!E(t)&&!!t.hasOwnProperty(e)&&Array.isArray(t[e])}(t)}))};if(s===r())return t;if(l&&!Y(s)){var c=m(s,2),h=c[0],d=c[1];return o?o(t,s,l):u(t)?hI(t,+h,+d,l):t.filter((function(t){return t[l]>=h&&t[l]<=d}))}return t},vq={color:ER,size:PR},fq={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}},pq=function(t){var 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({},fq),{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"}}}})},gq={horizontal:pq(!0),vertical:pq(!1)},yq=function(t){var 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({},fq),{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"}}}})},mq={horizontal:yq(!0),vertical:yq(!1)},_q=["#C4E7FF","#98CAFF","#75ACFF","#518FF9","#2775DC","#005CBE","#00429F","#00287E"],bq=[2,10],kq=function(e){function o(t,e){var r;n(this,o),(r=i(this,o,[t,e])).type=d.colorLegend,r.name=d.colorLegend;var a="color"===r._spec.type?d.colorLegend:d.sizeLegend;return r.type=a,r.name=a,r}return c(o,e),a(o,[{key:"setAttrFromSpec",value:function(){_(o,"setAttrFromSpec",this,3)([]),this._field=this._spec.field,this._legendType=this._spec.type}},{key:"init",value:function(e){var i=this;_(o,"init",this,3)([e]),gL(this._regions,(function(e){e.addViewDataFilter({type:"continuousLegendFilter",options:{selected:function(){return i._selectedData},field:function(){return i._field},data:function(){return i._legendData.getLatestData()},isHierarchyData:e.isHierarchyData,customFilter:i._spec.customFilter},level:t.TransformLevel.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},{key:"_getScaleInGlobal",value:function(){var t=this._option.globalScale,e=this._spec.scale;return e||(e=this._legendType),t.getScale(e)}},{key:"_initLegendData",value:function(){var t=this;EI(this._option.dataSet,"continuousLegendFilter",dq),EI(this._option.dataSet,"continuousLegendDataMake",hq);var e=new Xo(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")});return e.transform({type:"continuousLegendDataMake",options:{series:function(){return yL(t._regions,{userId:t._seriesUserId,specIndex:t._seriesIndex})},field:function(){return t._field},scale:this._getScaleInGlobal.bind(this)}}),e}},{key:"_initSelectedData",value:function(){this._spec.defaultSelected?this._selectedData=this._spec.defaultSelected.slice():this._selectedData=this._legendData.getLatestData()}},{key:"_addDefaultTitleText",value:function(t){var e,i,n,r;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&T(t.title.text)&&T(null===(i=t.title.style)||void 0===i?void 0:i.text)){var a=this._field;if(a){var o=null===(r=null===(n=this._regions)||void 0===n?void 0:n[0])||void 0===r?void 0:r.getSeries()[0];if(!o)return;return void(t.title.text=iI(o.getRawData(),a))}var s=this._spec.scale;s||(s=this._legendType);var l=this._option.globalScale.getScaleSpec(s);if(!vb(null==l?void 0:l.domain))return;var u=l.domain[0];if(0===u.fields.length)return;t.title.text=iI(this._option.dataSet.getDataView(u.dataId),u.fields[0])}}},{key:"_getLegendAttributes",value:function(t){var e,i,n="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",a="horizontal"===n?"bottom":this.layoutOrient,o=[],l=this._getScaleInGlobal();l&&"linear"===l.type&&(o=l.range()),Y(o)&&(o="color"===this._legendType?_q:bq);var u=null!==(e=this._legendData.getLatestData()[0])&&void 0!==e?e:0,c=null!==(i=this._legendData.getLatestData()[1])&&void 0!==i?i:1;this._legendData.getLatestData()[0]===this._legendData.getLatestData()[1]&&(u=Math.min(0,this._legendData.getLatestData()[0]),c=0===this._legendData.getLatestData()[0]?1:Math.max(0,this._legendData.getLatestData()[0]));var h=Object.assign(s({layout:n,align:a,zIndex:this.layoutZIndex,min:u,max:c,value:this._spec.defaultSelected},"color"===this._legendType?"colors":"sizeRange",o),function(t){var e=nO({},t),i=e.title,n=void 0===i?{}:i,a=e.handler,o=void 0===a?{}:a,s=e.rail,l=void 0===s?{}:s,u=e.track,c=void 0===u?{}:u,h=e.startText,d=e.endText,v=e.handlerText,f=e.sizeBackground,p=e.background,g=void 0===p?{}:p;e.type,e.id,e.visible,e.orient,e.position,e.data,e.defaultSelected,e.field,e.filter,e.regionId,e.regionIndex,e.seriesIndex,e.seriesId,e.padding;var y=r(e,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return n.visible?y.title=oq(n):y.title={visible:!1},y.showHandler=!1!==o.visible,Y(o.style)||(y.handlerStyle=pI(o.style)),C(l.width)&&(y.railWidth=l.width),C(l.height)&&(y.railHeight=l.height),Y(l.style)||(y.railStyle=pI(l.style)),Y(c.style)||(y.trackStyle=pI(c.style)),y.startText=dI(h),y.endText=dI(d),y.handlerText=dI(v),Y(f)||(y.sizeBackground=pI(f)),g.visible&&!Y(g.style)&&(nO(y,g.style),C(g.padding)&&(y.padding=g.padding)),y}(this._spec));return this._addDefaultTitleText(h),h}},{key:"_getLegendConstructor",value:function(){return vq[this._legendType]}},{key:"_initEvent",value:function(){var e=this;if(this._legendComponent){var i=!1!==this._spec.filter;this._legendComponent.addEventListener("change",Ft((function(n){var r=X(n,"detail.value");i&&e.setSelectedData(r),e.event.emit(t.ChartEvent.legendFilter,{model:e,value:r,event:n})}),30))}}}],[{key:"getSpecInfo",value:function(t){var e=yF(t,this.specKey,this.type,(function(t){return"color"===(e=t.type)||"size"===e;var e}));return e&&e.forEach((function(t){t.type="color"===t.spec.type?d.colorLegend:d.sizeLegend})),e}}])}(uq);kq.specKey="legends",kq.builtInTheme={colorLegend:gq,sizeLegend:mq},kq.type=d.continuousLegend;var xq=function(t,e){return C(e)?t.map((function(t){return e[t]})):void 0},Sq=function(t,e){return function(i){return t.every((function(t,n){return i[t]===(null==e?void 0:e[n])}))}},Aq=function(t){return!T(t)&&(O(t)?t.length>0&&t.every(C):Object.keys(t).length>0)};function Mq(t,e,i){var n,r,a,o,s,l,u=Object.assign({regionIndex:0},e),c=i.getOption(),h=c.getRegionsInUserIdOrIndex(C(u.regionId)?[u.regionId]:void 0,C(u.regionIndex)?[u.regionIndex]:void 0)[0];if(!h)return"none";var d=Cq(t,h),v=null!==(n=u.activeType)&&void 0!==n?n:d.length>1?"dimension":"mark",f=h.getLayoutStartPoint(),p=h.getLayoutRect(),g=c.globalInstance.getContainer(),y=Object.assign({x:0,y:0},g?function(t){var e=t.getBoundingClientRect();return{x:e.x,y:e.y}}(g):{}),m=function(t){var e,i=t.data,n=i.dimensionFields,r=i.dimensionData,a=i.measureFields,o=i.measureData,s=i.groupField,l=i.groupData;return null===(e=t.series.getViewData())||void 0===e?void 0:e.latestData.find((function(t){return Sq(n,r)(t)&&Sq(a,o)(t)&&(T(s)||Sq([s],[l])(t))}))},_=function(t){var e,i,n=function(t){return{x:Math.min(Math.max(t.x,0),p.width),y:Math.min(Math.max(t.y,0),p.height)}}(t),r=null!==(e=u.x)&&void 0!==e?e:f.x+n.x,a=null!==(i=u.y)&&void 0!==i?i:f.y+n.y;return{canvasX:r,canvasY:a,clientX:y.x+r,clientY:y.y+a}};if("dimension"===v){var k=d[0];if(!k)return"none";var x=new Map;d.forEach((function(t){var e;x.has(t.series)||x.set(t.series,[]),null===(e=x.get(t.series))||void 0===e||e.push(t)}));var S=[{value:t[k.data.dimensionFields[0]],data:b(x.keys()).map((function(t){var e,i;return{series:t,datum:null!==(i=null===(e=x.get(t))||void 0===e?void 0:e.map((function(t){return m(t)})))&&void 0!==i?i:[]}}))}];C(k.dimType)&&(S[0].position=k.pos[k.dimType],S[0].dimType=k.dimType);var A={changePositionOnly:!1,action:"enter",tooltip:null,dimensionInfo:S,chart:null!==(r=c.globalInstance.getChart())&&void 0!==r?r:void 0,datum:void 0,model:void 0,source:xI.chart,event:_({x:d.reduce((function(t,e){return t+e.pos.x}),0)/d.length,y:d.reduce((function(t,e){return t+e.pos.y}),0)/d.length}),item:void 0};null===(s=null===(o=null===(a=i.processor)||void 0===a?void 0:a.dimension)||void 0===o?void 0:o.showTooltip)||void 0===s||s.call(o,S,A,!1);var M=c.globalInstance;return hF.globalConfig.uniqueTooltip&&hF.hideTooltip(M.id),v}if("mark"===v){var w=d[0];if(!w)return"none";var E=Object.assign(Object.assign({},m(w)),t),B=[{datum:[E],series:w.series}],P={changePositionOnly:!1,tooltip:null,dimensionInfo:[{value:E[w.data.dimensionFields[0]],data:B}],chart:null!==(l=c.globalInstance.getChart())&&void 0!==l?l:void 0,datum:E,model:w.series,source:xI.chart,event:_(w.pos),item:void 0};i.processor.mark.showTooltip({datum:E,mark:null,series:w.series},P,!1);var R=c.globalInstance;return hF.globalConfig.uniqueTooltip&&hF.hideTooltip(R.id),v}return"none"}var wq,Tq,Cq=function(t,e){var i=e.getSeries(),n=[];return i.forEach((function(e){var i,r,a,o,s,l,u,c=e.getDimensionField(),h=e.getMeasureField(),d=e.getSeriesField(),v=C(d)?t[d]:void 0,f=C(d)&&null!==(o=null===(a=null===(r=null===(i=e.getViewDataStatistics)||void 0===i?void 0:i.call(e))||void 0===r?void 0:r.latestData[d])||void 0===a?void 0:a.values)&&void 0!==o?o:[],p=xq(c,t),g=xq(h,t),y=Aq(g),_=!y&&C(d)&&T(v)&&f.length>0,b=function(){var t,i=null===(t=e.getViewData())||void 0===t?void 0:t.latestData.find(Sq(c,p));if(y||(g=xq(h,i),Aq(g))){var r=e.type===_L.pie?e.dataToCentralPosition(i):e.dataToPosition(i);T(r)||isNaN(r.x)||isNaN(r.y)||n.push({pos:r,data:{dimensionFields:c,dimensionData:p,measureFields:h,measureData:g,hasMeasureData:y,groupField:d,groupData:v},series:e})}};if("cartesian"===e.coordinate){var k=e,x=lE(null===(l=null===(s=e.getYAxisHelper())||void 0===s?void 0:s.getScale(0))||void 0===l?void 0:l.type)?"y":"x",S=c.map((function(t,e){return[t,e]})).filter((function(t){var e=m(t,2)[1];return T(null==p?void 0:p[e])})),A=[null!=p?p:[]];S.length>0&&S.forEach((function(t){var i,n,r,a,o=m(t,2),s=o[0],l=o[1],u=null!==(a=null===(r=null===(n=null===(i=e.getViewDataStatistics)||void 0===i?void 0:i.call(e))||void 0===n?void 0:n.latestData[s])||void 0===r?void 0:r.values)&&void 0!==a?a:[],c=[];A.forEach((function(t){u.forEach((function(e){var i,n=null!==(i=null==t?void 0:t.slice())&&void 0!==i?i:[];n[l]=e,c.push(n)}))})),A=c})),A.forEach((function(t){var i,r;if(_){var a=null===(i=k.getViewData())||void 0===i?void 0:i.latestData.filter(Sq(c,t));f.forEach((function(i){var r=a.find((function(t){return t[d]===i}));if(g=xq(h,r),Aq(g)){var o=k.dataToPosition(r);T(o)||isNaN(o.x)||isNaN(o.y)||n.push({pos:o,data:{dimensionFields:c,dimensionData:t,measureFields:h,measureData:g,hasMeasureData:y,groupField:d,groupData:i},series:e,dimType:x})}}))}else{var o=null===(r=k.getViewData())||void 0===r?void 0:r.latestData.find(Sq(c,t));if(!y&&(g=xq(h,o),!Aq(g)))return;var s=k.dataToPosition(o);if(T(s)||isNaN(s.x)||isNaN(s.y))return;n.push({pos:s,data:{dimensionFields:c,dimensionData:t,measureFields:h,measureData:g,hasMeasureData:y,groupField:d,groupData:v},dimType:x,series:e})}}))}else if("polar"===e.coordinate)if(e.type===_L.pie)b();else{var M=e;if(_){var w=(null===(u=M.getViewData())||void 0===u?void 0:u.latestData.filter(Sq(c,p))).find((function(t){return t[d]===v}));f.forEach((function(t){if(g=xq(h,w),Aq(g)){var i=M.dataToPosition(w);T(i)||isNaN(i.x)||isNaN(i.y)||n.push({pos:i,data:{dimensionFields:c,dimensionData:p,measureFields:h,measureData:g,hasMeasureData:y,groupField:d,groupData:t},series:e})}}))}else b()}else"geo"===e.coordinate&&b()})),n},Eq=function(t){return C(t)&&!O(t)},Bq=function(t){return C(t)&&O(t)},Pq=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_shouldMergeThemeToSpec",value:function(){return!1}},{key:"_initTheme",value:function(t,i){var n,r,a,o=_(e,"_initTheme",this,3)([t,i]),s=o.spec,l=o.theme;return s.style=nO({},this._theme,s.style),s.offset=nO({},l.offset,t.offset),s.transitionDuration=null!==(n=t.transitionDuration)&&void 0!==n?n:l.transitionDuration,s.trigger=null!==(r=t.trigger)&&void 0!==r?r:l.trigger,s.triggerOff=null!==(a=t.triggerOff)&&void 0!==a?a:l.triggerOff,{spec:s,theme:l}}},{key:"_transformSpecAfterMergingTheme",value:function(t,i,n){var r,a,o,s,l,u,c;_(e,"_transformSpecAfterMergingTheme",this,3)([t,i,n]),t.visible=null===(r=t.visible)||void 0===r||r,t.activeType=function(t){var e,i,n;if(!1===(null==t?void 0:t.visible))return[];var r={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===(n=null==t?void 0:t.group)||void 0===n?void 0:n.visible)};return C(null==t?void 0:t.activeType)&&Object.keys(r).forEach((function(e){var i;r[e]=null===(i=null==t?void 0:t.activeType)||void 0===i?void 0:i.includes(e)})),Object.keys(r).filter((function(t){return r[t]}))}(t),t.renderMode=null!==(a=t.renderMode)&&void 0!==a?a:ub(this._option.mode)||!sb(this._option.mode)?"canvas":"html",t.trigger=null!==(o=t.trigger)&&void 0!==o?o:"hover",t.className=null!==(s=t.className)&&void 0!==s?s:"vchart-tooltip-element",t.enterable=null!==(l=t.enterable)&&void 0!==l&&l,t.transitionDuration=null!==(u=t.transitionDuration)&&void 0!==u?u:150,t.confine=null!==(c=t.confine)&&void 0!==c?c:"canvas"===t.renderMode,C(t.parentElement)?L(t.parentElement)&&(t.parentElement=zm.getElementById(t.parentElement)):sb(this._option.mode)&&(t.parentElement=null==ob?void 0:ob.body)}}])}(dz),Rq={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}},Lq=function(r){function o(){var r;return n(this,o),(r=i(this,o,arguments)).layoutZIndex=1,r.type=d.tooltip,r.name=d.tooltip,r.transformerConstructor=Pq,r.specKey="tooltip",r.layoutType="none",r._isReleased=!1,r._alwaysShow=!1,r._eventList=[],r._isTooltipShown=!1,r._clickLock=!1,r._mountEvent=function(t,e,i){r.event.on(t,e,i),r._eventList.push({eventType:t,handler:i})},r._handleClickToLock=function(t){var e,i;if(r._clickLock)r._handleChartMouseOut(t),r._clickLock=!1;else{if(!r._isTooltipShown&&!(null===(i=null===(e=r.tooltipHandler)||void 0===e?void 0:e.isTooltipShown)||void 0===i?void 0:i.call(e)))return;r._clickLock=!0}},r._getMouseOutHandler=function(t){return function(e){var i,n,a,o,s;if(!r._isReleased&&!r._alwaysShow&&!r._clickLock&&(r._isTooltipShown||(null===(n=null===(i=r.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===n?void 0:n.call(i)))){var l=sb(null===(a=r._option)||void 0===a?void 0:a.mode),u=e.event,c=u.clientX,h=u.clientY;l&&t&&r._isPointerInChart({x:c,y:h})||(r._enterable?r._outTimer=setTimeout((function(){r._handleChartMouseOut(e)}),null!==(s=null===(o=r._spec)||void 0===o?void 0:o.showDelay)&&void 0!==s?s:50):r._handleChartMouseOut(e))}}},r._handleChartMouseOut=function(t){var i;r._cacheActiveType&&(null===(i=r._option)||void 0===i?void 0:i.componentShowContent)&&(!1===r._option.componentShowContent.tooltip||E(r._option.componentShowContent.tooltip)&&!1===r._option.componentShowContent.tooltip[r._cacheActiveType])||r._alwaysShow||r._isReleased||r._isEnterTooltip||"none"!==r._spec.triggerOff&&(r._hideTooltipByHandler(Object.assign(Object.assign({},t),{tooltip:e(r)})),r._handleMouseMove&&r._handleMouseMove.cancel&&r._handleMouseMove.cancel(),r._cacheEnterableRect=null,r._cacheInfo=void 0,r._cacheParams=void 0,r._cacheActiveType=void 0)},r._getMouseMoveHandler=function(t){return function(e){var i,n,a,o;r._isReleased||r._isEnterTooltip||(r._outTimer&&(clearTimeout(r._outTimer),r._outTimer=null),r.tooltipHandler||r._initHandler(),r.processor||r._initProcessor(),r._alwaysShow||(r._clickLock?t&&(r._handleChartMouseOut(e),r._clickLock=!1):!t&&r._enterable&&(null===(n=null===(i=r.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===n?void 0:n.call(i))?(r._showTimer&&clearTimeout(r._showTimer),r._showTimer=setTimeout((function(){r._handleChartMouseMove(e,t)}),null!==(o=null===(a=r._spec)||void 0===a?void 0:a.showDelay)&&void 0!==o?o:50)):r._handleChartMouseMove(e,t)))}},r._handleChartMouseMove=function(t,e){if(!r._isReleased){for(var i=r._getMouseEventData(t),n=i.tooltipInfo.dimension,a=i.ignore.mark,o={mark:!1,dimension:!1,group:!1},s=["group","mark","dimension"],l=0,u=s.length;l<u;l++){var c=s[l],h=!!r.processor[c]&&r._showTooltipByMouseEvent(c,i,t,e);if("unShowByOption"===h)o[c]="unShowByOption";else if(h){o[c]=!0;break}}Object.values(o).every((function(t){return!t}))&&!function(t){return T(t.mark)&&T(t.model)&&T(t.datum)}(t)&&(a&&Eq(r._cacheInfo)?o.mark=r._showTooltipByMouseEvent("mark",i,t,e,!0):C(n)&&(o.dimension=r._showTooltipByMouseEvent("dimension",i,t,e))),!0===o.mark||!0===o.group||!0===o.dimension&&!T(n)?r._initEventOfTooltipContent():r._cacheActiveType&&"unShowByOption"===o[r._cacheActiveType]||r._handleChartMouseOut(t)}},r._showTooltipByMouseEvent=function(t,e,i,n,a){var o;if(!r._showContentByEvent(t))return"unShowByOption";var s,l=r.processor[t];if(!l.shouldHandleTooltip(i,e.tooltipInfo[t]))return!1;if(r._hideTimer&&clearTimeout(r._hideTimer),a)s=!l.showTooltip(r._cacheInfo,i,!0);else{var u=e.tooltipInfo[t],c=r._isSameAsCache(u,i,t);(s=!l.showTooltip(u,i,c))&&(r._cacheInfo=u,r._cacheParams=i,r._cacheActiveType=t)}s&&(r._isTooltipShown=!0,n&&r._spec.lockAfterClick&&!r._clickLock?r._clickLock=!0:Number.isFinite(r._spec.hideTimer)&&(r._hideTimer=setTimeout((function(){r._handleChartMouseOut()}),r._spec.hideTimer)));var h=null===(o=r._option)||void 0===o?void 0:o.globalInstance;return s&&hF.globalConfig.uniqueTooltip&&h&&hF.hideTooltip(h.id),s},r._getMouseEventData=function(t){var e={tooltipInfo:{},ignore:{}};return Object.keys(r.processor).forEach((function(i){var n=r.processor[i].getMouseEventData(t),a=n.tooltipInfo,o=n.ignore;e.tooltipInfo[i]=a,e.ignore[i]=o})),e},r._hideTooltipByHandler=function(i){var n,a,o;if(!r._isTooltipShown&&!(null===(a=null===(n=r.tooltipHandler)||void 0===n?void 0:n.isTooltipShown)||void 0===a?void 0:a.call(n)))return 0;r.event.emit(t.ChartEvent.tooltipHide,Object.assign(Object.assign({},i),{source:xI.chart,tooltip:e(r)})),Object.values(r.processor).forEach((function(t){t.clearCache()}));var s=null!==(o=r._spec.handler)&&void 0!==o?o:r.tooltipHandler;if(s.hideTooltip){var l=s.hideTooltip.call(s,i);return l||(r._isTooltipShown=!1),l}return 1},r.hideTooltip=function(){if(r._isReleased)return!1;var t={changePositionOnly:!1,tooltip:e(r),item:void 0,datum:void 0,source:xI.chart};return r._alwaysShow=!1,!r._hideTooltipByHandler(t)},r}return c(o,r),a(o,[{key:"isTooltipShown",value:function(){return this._isTooltipShown}},{key:"_registerEvent",value:function(){}},{key:"_releaseEvent",value:function(){}},{key:"onLayoutEnd",value:function(){}},{key:"created",value:function(){_(o,"created",this,3)([]),this._regions=this._option.getAllRegions(),this._initEvent()}},{key:"release",value:function(){var t,e,i=this;_(o,"release",this,3)([]),this._isReleased=!0,this._hideTimer&&clearTimeout(this._hideTimer),this._eventList.forEach((function(t){var e=t.eventType,n=t.handler;i.event.off(e,n)})),this._eventList=[],null===(e=null===(t=this.tooltipHandler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),this._isTooltipShown=!1}},{key:"beforeRelease",value:function(){this.event.emit(t.ChartEvent.tooltipHide,{tooltip:this,chart:this.getChart()}),this.event.emit(t.ChartEvent.tooltipRelease,{tooltip:this,chart:this.getChart()})}},{key:"_initHandler",value:function(){var t,e,i,n=null!==(t=this._spec.renderMode)&&void 0!==t?t:"html",r=this._option.globalInstance.getTooltipHandlerByUser();if(r)this.tooltipHandler=r,this._enterable=!1;else{var a="canvas"===n?DH.canvas:DH.dom,o=rO.getComponentPluginInType(a);o||nb("Can not find tooltip handler: "+a);var s=new o;s.name="".concat(this._spec.className,"-").concat(null!==(e=this._option.globalInstance.id)&&void 0!==e?e:0,"-").concat(this.getSpecIndex()),null===(i=this.pluginService)||void 0===i||i.load([s]),this.tooltipHandler=s,this._spec.enterable&&"html"===n&&this.tooltipHandler?(this._enterable=!0,this._needInitEventOfTooltip=!0):this._enterable=!1}}},{key:"_initEventOfTooltipContent",value:function(){var t,e,i=this;if(this._needInitEventOfTooltip){var n=null===(e=(t=this.tooltipHandler).getRootDom)||void 0===e?void 0:e.call(t);n&&(n.addEventListener("pointerenter",(function(){var t;if(i._enterable){i._isEnterTooltip=!0;var e=null===(t=n.getBoundingClientRect)||void 0===t?void 0:t.call(n);e&&(i._cacheEnterableRect={width:e.width,height:e.height}),i._outTimer&&(clearTimeout(i._outTimer),i._outTimer=null),i._showTimer&&(clearTimeout(i._showTimer),i._showTimer=null)}})),n.addEventListener("pointerleave",(function(){var t,e,r;if(i._enterable&&(i._isEnterTooltip=!1,"none"!==i._spec.triggerOff&&i._cacheEnterableRect)){var a=null===(t=n.getBoundingClientRect)||void 0===t?void 0:t.call(n);a&&Object.keys(i._cacheEnterableRect).every((function(t){return i._cacheEnterableRect[t]===a[t]}))&&(i._cacheEnterableRect=null,i._outTimer=setTimeout(i.hideTooltip,null!==(r=null===(e=i._spec)||void 0===e?void 0:e.showDelay)&&void 0!==r?r:50))}})),this._needInitEventOfTooltip=!1)}}},{key:"_initProcessor",value:function(){var t=this,e=this._spec.activeType;this.processor={},e.forEach((function(e){var i=rO.createTooltipProcessor(e,t);i&&(t.processor[e]=i)}))}},{key:"_initEvent",value:function(){var t,e=this;if(!this._option.disableTriggerEvent){var i=lt(null!==(t=this._spec.trigger)&&void 0!==t?t:"hover"),n=lt(this._spec.triggerOff),r=this._option.mode;i.forEach((function(t){var i;"hover"===t?(e._handleMouseMove=e._throttle(e._getMouseMoveHandler(!1)),e._mountEvent("pointermove",{source:"chart"},e._handleMouseMove),(lb(r)||ub(r))&&(e._mountEvent("pointerdown",{source:"chart"},e._getMouseMoveHandler(!1)),e._mountEvent("pointerup",{source:"window"},e._getMouseOutHandler(!0))),e._mountEvent("pointerleave",{source:"chart"},e._getMouseOutHandler(!1))):"click"===t?(e._mountEvent("pointertap",{source:"chart"},e._getMouseMoveHandler(!0)),e._mountEvent("pointerup",{source:"window"},e._getMouseOutHandler(!0))):E(t)&&e._mountEvent(t.eventType,{source:null!==(i=t.source)&&void 0!==i?i:"chart",consume:t.consume},e._getMouseMoveHandler(!0))})),n.filter((function(t){return E(t)})).forEach((function(t){var i,n;e._mountEvent(t.eventType,{source:null!==(i=t.source)&&void 0!==i?i:"chart",consume:t.consume},e._getMouseOutHandler(null!==(n=t.checkOutside)&&void 0!==n&&n))})),!i.includes("click")&&this._spec.lockAfterClick&&this._mountEvent("pointertap",{source:"chart"},this._handleClickToLock)}}},{key:"_throttle",value:function(t){return jt(t,F(this._spec.throttleInterval)?this._spec.throttleInterval:"html"===this._spec.renderMode&&this._spec.transitionDuration?50:10)}},{key:"_showContentByEvent",value:function(t){var e;if(null===(e=this._option)||void 0===e?void 0:e.componentShowContent){if(!1===this._option.componentShowContent.tooltip)return!1;if(E(this._option.componentShowContent.tooltip)&&!1===this._option.componentShowContent.tooltip[t])return!1}return!0}},{key:"reInit",value:function(t){var e,i,n;if(_(o,"reInit",this,3)([t]),this.tooltipHandler){var r=null!==(e=this._spec.renderMode)&&void 0!==e?e:"html",a=this._spec.enterable&&"html"===r;a&&!this._enterable&&(this._needInitEventOfTooltip=!0),this._enterable=a,null===(n=(i=this.tooltipHandler).reInit)||void 0===n||n.call(i)}else this._initHandler()}},{key:"showTooltip",value:function(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;var n=Mq(t,e,this);return"none"!==n&&(this._alwaysShow=!!(null==e?void 0:e.alwaysShow),this._cacheActiveType=n),n}},{key:"_isSameAsCache",value:function(t,e,i){if(i!==this._cacheActiveType)return!1;if(t===this._cacheInfo)return!0;if(T(this._cacheInfo)||T(t))return!1;if(Bq(t)){if(Eq(this._cacheInfo))return!1;var n=this._cacheInfo;return n.length===t.length&&t.every((function(t,e){return pj(t,n[e])}))}if(Bq(this._cacheInfo))return!1;var r=this._cacheInfo;if((null==t?void 0:t.datum)!==r.datum||(null==t?void 0:t.mark)!==r.mark||(null==t?void 0:t.series)!==r.series)return!1;var a=this._cacheParams;return!T(a)&&!T(e)&&a.mark===e.mark&&a.model===e.model&&a.datum===e.datum}},{key:"_isPointerInChart",value:function(t){var e,i=null===(e=this._option)||void 0===e?void 0:e.globalInstance;if(!i)return!1;if(!i.getChart())return!1;var n=t.x,r=t.y,a=i.getCanvas().getBoundingClientRect(),o=a.x,s=a.y,l=a.width,u=a.height;return n>=o&&n<=o+l&&r>=s&&r<=s+u}},{key:"getVisible",value:function(){return!1!==this._spec.visible}}])}(vz);Lq.type=d.tooltip,Lq.transformerConstructor=Pq,Lq.builtInTheme={tooltip:Rq},Lq.specKey="tooltip",function(t){t[t.success=0]="success",t[t.failed=1]="failed"}(wq||(wq={})),function(t){t[t.ALL=3]="ALL",t[t.HORIZONTAL=2]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Tq||(Tq={}));var Oq={x:["top","bottom"],y:["left","right"],category:["angle"],value:["radius"]},Iq=function(e){function o(e,r){var a;return n(this,o),(a=i(this,o,[e,r])).specKey="crosshair",a.layoutType="none",a.gridZIndex=t.LayoutZIndex.CrossHair_Grid,a.labelZIndex=t.LayoutZIndex.CrossHair,a.trigger="hover",a._handleIn=function(t){if(a._option){var e=a.calculateTriggerPoint(t),i=e.x,n=e.y;a.showDefault=!1,a._layoutCrosshair(i,n);var r=a._getNeedClearVRenderComponents();a._hasActive=r.some((function(t){return t&&!1!==t.attribute.visible}))}},a._handleClickInEvent=function(t){if(!a._hasActive||!a._spec.lockAfterClick||a._clickLock)return a._clickLock?(a._clickLock=!1,void a._handleOutEvent()):void(a._onlyLockClick||(a._handleIn(t),F(a.triggerOff)&&(a._timer&&clearTimeout(a._timer),a._timer=setTimeout((function(){a._handleOutEvent()}),a.triggerOff))));a._clickLock=!0},a._handleHoverInEvent=jt((function(t){a._clickLock||a._handleIn(t)}),10),a._handleOutEvent=function(){a.enableRemain||a._clickLock||!a._hasActive||(a.clearOutEvent(),a.hideCrosshair())},a._handleTooltipShow=function(t){var e=t.tooltipData;if(!t.isEmptyTooltip&&e&&e.length)if(E(a._spec.followTooltip)&&!1===a._spec.followTooltip[t.activeType])a._handleTooltipHideOrRelease();else{var i=a.calculateTriggerPoint(t),n=i.x,r=i.y;a.showDefault=!1,a._layoutCrosshair(n,r,e,t.activeType);var o=a._getNeedClearVRenderComponents();a._hasActive=o.some((function(t){return t&&!1!==t.attribute.visible}))}else a._handleTooltipHideOrRelease()},a._handleTooltipHideOrRelease=function(){a.clearOutEvent(),a.hideCrosshair()},a.enable=!0,a.showDefault=!0,a}return c(o,e),a(o,[{key:"enableRemain",get:function(){return"none"===this.triggerOff}},{key:"_setAllAxisValues",value:function(t,e,i){var n=this,r=!1;if(t.forEach((function(t){lE(t.axis.getScale().type)&&(r?n.enable=!1:r=!0)})),!this.enable)return!1;var a=this._stateByField[i].currentValue;return t.forEach((function(t,i){var r=t.axis;a.set(i,{datum:n._getDatumAtPoint(r,e),axis:r})})),!0}},{key:"clearAxisValue",value:function(){var t=this;Object.keys(this._stateByField).forEach((function(e){t._stateByField[e].currentValue.clear()}))}},{key:"hideCrosshair",value:function(){this.clearAxisValue(),this.hide()}},{key:"showCrosshair",value:function(t){var e=this;t&&t.length&&(this.showDefault=!1,this.clearAxisValue(),t.forEach((function(t){var i=t.axis,n=t.value;e.setAxisValue(n,i)})),this.layoutByValue(!1))}},{key:"_getLimitBounds",value:function(){var t,e;if(!this._limitBounds){var i=null!==(e=null===(t=this._option.globalInstance.getChart())||void 0===t?void 0:t.getViewRect())&&void 0!==e?e:{width:0,height:0},n=i.width,r=i.height;this._limitBounds={x1:0,y1:0,x2:n,y2:r}}return this._limitBounds}},{key:"_showDefaultCrosshairBySpec",value:function(){var t=this,e=!1;return Object.keys(this._stateByField).forEach((function(i){var n=t._spec[i];if(n&&n.visible&&n.defaultSelect){var r=n.defaultSelect,a=r.axisIndex,o=void 0===a?0:a,s=r.datum,l=t._option.getComponentsByKey("axes").find((function(t){return t.getSpecIndex()===o}));l&&(e=!0,t._stateByField[i].currentValue.clear(),t._stateByField[i].currentValue.set(o,{axis:l,datum:s}))}})),e}},{key:"_updateVisibleCrosshair",value:function(){var t=this,e=!1;Object.keys(this._stateByField).forEach((function(i){var n=t._spec[i];n&&n.visible&&t._stateByField[i].currentValue.size?e=!0:t._hideByField(i)})),e&&this.layoutByValue(!1)}},{key:"_showDefaultCrosshair",value:function(){this.showDefault?this._showDefaultCrosshairBySpec()&&this.layoutByValue(!1):this._updateVisibleCrosshair()}},{key:"setAttrFromSpec",value:function(){_(o,"setAttrFromSpec",this,3)([]),this._parseCrosshairSpec()}},{key:"created",value:function(){_(o,"created",this,3)([]),this._initEvent()}},{key:"_compareSpec",value:function(t,e){var i=_(o,"_compareSpec",this,3)([t,e]);return i.reMake||at(e,t)||(i.reRender=!0,i.reMake=!0),i}},{key:"_initEvent",value:function(){var t=this;if(!this._option.disableTriggerEvent)if(this._spec.followTooltip)this._registerTooltipEvent();else{var e=this._getTriggerEvent();e&&e.forEach((function(e){t._registerEvent(e.in,!1,e.click),e.out&&t._registerEvent(e.out,!0)}))}}},{key:"_registerEvent",value:function(t,e,i){var n,r=this;if(!1!==(null===(n=this._option.componentShowContent)||void 0===n?void 0:n.crosshair)){var a=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent,o=e?{level:SI.chart}:{source:xI.chart};O(t)?t.forEach((function(t){r.event.on(t,o,a)})):this.event.on(t,o,a)}}},{key:"_eventOff",value:function(t,e,i){var n=this,r=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent;O(t)?t.forEach((function(t){n.event.off(t,r)})):this.event.off(t,r)}},{key:"onBeforeRender",value:function(){this._limitBounds=null,this._showDefaultCrosshair()}},{key:"calculateTriggerPoint",value:function(t){var e=t.event,i=this._option.getCompiler().getStage().getLayer(void 0),n={x:e.viewX,y:e.viewY};return i.globalTransMatrix.transformPoint({x:e.viewX,y:e.viewY},n),{x:n.x-this.getLayoutStartPoint().x,y:n.y-this.getLayoutStartPoint().y}}},{key:"_getTriggerEvent",value:function(){var e=this,i=this._option.mode,n=function(e){return e===t.RenderModeEnum["desktop-browser"]||e===t.RenderModeEnum["desktop-miniApp"]?{click:"pointertap",hover:"pointermove",hoverOut:"pointerleave",clickOut:"pointerleave"}:lb(e)||ub(e)?{click:"tap",hover:["pointerdown","pointermove"],hoverOut:"pointerleave",clickOut:"pointerleave"}:null}(void 0===i?t.RenderModeEnum["desktop-browser"]:i);if(n){var r=lt(this.trigger||"hover"),a=function(t){return"click"===t?"none"===e.triggerOff?null:n.clickOut:n.hoverOut};this._spec.lockAfterClick&&!r.includes("click")?(r.push("click"),this._onlyLockClick=!0):this._onlyLockClick=!1;var o=[];return r.forEach((function(t){o.push({click:"click"===t,in:n[t],out:a(t)})})),o}return null}},{key:"_registerTooltipEvent",value:function(){this.event.on(t.ChartEvent.tooltipHide,{source:xI.chart},this._handleTooltipHideOrRelease),this.event.on(t.ChartEvent.tooltipShow,{source:xI.chart},this._handleTooltipShow),this.event.on(t.ChartEvent.tooltipRelease,{source:xI.chart},this._handleTooltipHideOrRelease)}},{key:"_getAxisInfoByField",value:function(t){var e,i,n=null===(i=(e=this._option).getComponentsByKey)||void 0===i?void 0:i.call(e,"axes");if(!(null==n?void 0:n.length))return null;var r=X(this._spec,"".concat(t,"Field.bindingAxesIndex"));if(r||(r=[],n.forEach((function(e,i){Oq[t].includes(e.getOrient())&&r.push(i)}))),!r.length)return null;var a=new Map,o=1/0,s=1/0,l=-1/0,u=-1/0,c=this.getLayoutStartPoint(),h=c.x,d=c.y;return r.forEach((function(t){var e,i;o=1/0,s=1/0,l=-1/0,u=-1/0;var r=n.find((function(e){return e.getSpecIndex()===t}));if(r){var c=(null===(i=(e=r).getInnerOffset)||void 0===i?void 0:i.call(e))||{left:0,right:0,top:0,bottom:0};r.getRegions().forEach((function(t){var e=t.getLayoutStartPoint(),i=e.x,n=e.y;o=Math.min(o,i-h+c.left),s=Math.min(s,n-d+c.top),l=Math.max(l,i+t.getLayoutRect().width-h-c.right),u=Math.max(u,n+t.getLayoutRect().height-d-c.bottom)})),a.set(t,{x1:o,y1:s,x2:l,y2:u,axis:r})}})),a}},{key:"onLayoutEnd",value:function(){var t=this._regions[0];this.setLayoutRect(t.getLayoutRect()),this.setLayoutStartPosition(t.getLayoutStartPoint()),_(o,"onLayoutEnd",this,3)([])}},{key:"_releaseEvent",value:function(){var t=this;this.clearOutEvent();var e=this._getTriggerEvent();e&&e.forEach((function(e){t._eventOff(e.in,!1,e.click),e.out&&t._eventOff(e.out,!0)}))}},{key:"_parseFieldInfo",value:function(){var t=this;Object.keys(this._stateByField).forEach((function(e){var i=t._spec[e],n=t._stateByField[e].crosshairComp;if(i&&i.visible){if(t._stateByField[e].attributes=t._parseField(i,e),n){var r=t._stateByField[e].attributes,a=r.style,o="rect"===r.type?"rectStyle":"lineStyle";n.setAttributes(s({},o,a))}}else n&&n.parent&&n.parent.removeChild(n)}))}},{key:"_parseCrosshairSpec",value:function(){this._parseFieldInfo();var t=this._spec,e=t.trigger,i=t.triggerOff,n=t.labelZIndex,r=t.gridZIndex;e&&(this.trigger=e),("none"===i||F(i)&&i>0)&&(this.triggerOff=i),void 0!==n&&(this.labelZIndex=n),void 0!==r&&(this.gridZIndex=r)}},{key:"_parseField",value:function(t,e){var i,n,a,o={},s=t.line,l=void 0===s?{}:s,u=t.label,c=void 0===u?{}:u,h=t.visible;if(o.visible=h,o.type=l.type||"line",!1===l.visible)o.style={visible:!1};else{var d=l.style||{},v=d.stroke,f=d.fill,p=d.lineWidth,g=d,y=g.strokeOpacity,m=g.fillOpacity,_=g.opacity,b=r(g,["strokeOpacity","fillOpacity","opacity"]),k="line"===o.type,x=k?y:m;if(F(_)&&(x=(null!=x?x:1)*_),o.style=Object.assign({opacity:x,pickable:!1,visible:!0},b),k)o.style.stroke=v||f,o.style.lineWidth=X(l,"width",p||2);else{o.style.fill=f||v,(null===(n=null===(i=null==t?void 0:t.line)||void 0===i?void 0:i.style)||void 0===n?void 0:n.stroke)&&(o.style.stroke=t.line.style.stroke);var S=X(l,"width");if("string"==typeof S){var A=parseInt(S.substring(0,S.length-1),10)/100;o.style.sizePercent=A}else"number"!=typeof S&&"function"!=typeof S||(o.style.size=S)}}if(c.visible){var w=c.labelBackground||{},T=null!==(a=c.syncAxisLabelAngle)&&void 0!==a&&a,C=c.style||{},E=w.style||{},B=E.fill,P=void 0===B?"rgba(47, 59, 82, 0.9)":B,R=E.stroke,L=E.outerBorder,O=r(E,["fill","stroke","outerBorder"]);o.label={visible:!0,formatMethod:c.formatMethod,formatter:c.formatter,minWidth:w.minWidth,maxWidth:w.maxWidth,padding:w.padding,syncAxisLabelAngle:T,textStyle:Object.assign(Object.assign({fontSize:14,pickable:!1},C),{fill:C.fill||"#fff",stroke:X(C,"stroke")}),panel:(M(w.visible)?w.visible:w)?Object.assign({visible:!0,pickable:!1,fill:P,stroke:R,outerBorder:Object.assign({stroke:P,distance:0,lineWidth:3},L)},O):{visible:!1},zIndex:this.labelZIndex,childrenPickable:!1,pickable:!1}}else o.label={visible:!1};return o}},{key:"_filterAxisByPoint",value:function(t,e,i){return t&&t.forEach((function(n){var r,a,o,s=n.axis;if(a=e,o=i,((r=n).x1>a||r.x2<a||r.y1>o||r.y2<o)&&t.delete(s.getSpecIndex()),s.type.startsWith("polarAxis")){var l=s.getCenter(),u=s.getInnerRadius(),c=s.getOuterRadius(),h=ke.distancePP({x:e,y:i},l);(h>c||h<u)&&t.delete(s.getSpecIndex())}})),t}},{key:"_updateCrosshairLabel",value:function(t,e,i){var n=this.getContainer();t?t.setAttributes(e):(t=new rw(e),null==n||n.add(t),i(t)),function(t,e){var i=e.x1,n=e.y1,r=e.x2,a=e.y2,o=t.AABBBounds,s=o.x1,l=o.y1,u=o.x2,c=o.y2,h=t.attribute,d=h.dx,v=void 0===d?0:d,f=h.dy,p=void 0===f?0:f,g=0,y=0;s<i&&(g=i-s),l<n&&(y=n-l),u>r&&(g=r-u),c>a&&(y=a-c),g&&t.setAttribute("dx",g+v),y&&t.setAttribute("dy",y+p)}(t,this._getLimitBounds())}},{key:"clearOutEvent",value:function(){this._timer&&(clearTimeout(this._timer),this._timer=null),this._clickLock&&(this._clickLock=null),this._hasActive&&(this._hasActive=null)}},{key:"_hideByField",value:function(t){var e=this._stateByField[t],i=e.crosshairComp,n=e.labelsComp;i&&i.hideAll(),n&&Object.keys(n).forEach((function(t){n[t]&&n[t].hideAll()}))}},{key:"hide",value:function(){var t=this;Object.keys(this._stateByField).forEach((function(e){t._hideByField(e)}))}},{key:"_getNeedClearVRenderComponents",value:function(){var t=this;return Object.keys(this._stateByField).reduce((function(e,i){var n=t._stateByField[i],r=n.crosshairComp,a=n.labelsComp;return r&&e.push(r),a&&Object.keys(a).forEach((function(t){a[t]&&e.push(a[t])})),e}),[])}}])}(vz);Iq.specKey="crosshair";var Dq={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}}}}},Fq=function(t){function e(t,r){var a;return n(this,e),(a=i(this,e,[t,r])).type=d.cartesianCrosshair,a.name=d.cartesianCrosshair,a._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}}},a}return c(e,t),a(e,[{key:"_findAllAxisContains",value:function(t,e){var i=this._getAxisInfoByField("x"),n=this._getAxisInfoByField("y");return{xAxisMap:this._filterAxisByPoint(i,t,e),yAxisMap:this._filterAxisByPoint(n,t,e)}}},{key:"_getDatumAtPoint",value:function(t,e){var i=aj(t.getOrient())?"x":"y",n=e[i]-(t.getLayoutStartPoint()[i]-this.getLayoutStartPoint()[i]);return t.getScale().invert(n)}},{key:"setAxisValue",value:function(t,e){aj(e.getOrient())?this._stateByField.xField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e}):this._stateByField.yField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e})}},{key:"_layoutCrosshair",value:function(t,e,i,n){var r,a=t,o=e;if(i&&i.length)if("dimension"===n){var s,l=i[0],u=l.data.findIndex((function(t){return t.datum.length>0}));if(u>-1){var c=l.data[u];s=c.series.dataToPosition(c.datum[0])}(C(l.dimType)?"y"===l.dimType:oj(null===(r=null==l?void 0:l.axis)||void 0===r?void 0:r.getOrient()))?o=null==s?void 0:s.y:a=null==s?void 0:s.x}else if("mark"===n){var h=i[0],d=h.series.dataToPosition(h.datum[0]);a=null==d?void 0:d.x,o=null==d?void 0:d.y}this.clearAxisValue();var v=this._findAllAxisContains(a,o),f=v.xAxisMap,p=v.yAxisMap;if(f&&0===f.size||p&&0===p.size){if(this.enableRemain)return;this.hide()}else f&&f.size&&this._setAllAxisValues(f,{x:a,y:o},"xField"),p&&p.size&&this._setAllAxisValues(p,{x:a,y:o},"yField"),this.layoutByValue()}},{key:"layoutByValue",value:function(t){var e=this;if(this.enable){var i=kL(this._regions,"cartesian");i&&(TH(this._stateByField,i,this.getLayoutStartPoint(),null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach((function(t){e._layoutByField(t)})))}}},{key:"_layoutByField",value:function(t){var e=this,i=this._stateByField[t],n=i.cacheInfo,r=i.attributes,a=i.labelsComp,o=i.bandSize,l=i.coordKey;if(r&&n&&(!n._isCache||!this.enableRemain)){var u=n.coord,c=n.labels,h=n.visible,d=n.labelsTextStyle;if(h){var v=BH(this._stateByField[t]);this._updateCrosshairByField(t,v),Object.keys(c).forEach((function(i){var h,v,f;if(c[i].visible){var p=Object.assign(Object.assign(Object.assign(s({},l,u+o/2),c[i]),r.label),{angle:r.label.syncAxisLabelAngle&&null!==(v=null===(h=n.axisLabel)||void 0===h?void 0:h.attribute.angle)&&void 0!==v?v:0,textStyle:Object.assign(Object.assign({},null===(f=r.label)||void 0===f?void 0:f.textStyle),d[i]),zIndex:e.labelZIndex,visible:!0});e._updateCrosshairLabel(a[i],p,(function(e){e.name="crosshair-".concat(t.replace("Field",""),"-").concat(i,"-label"),a[i]=e}))}else a[i]&&a[i].hideAll()}))}else this._hideByField(t)}}},{key:"_updateCrosshairByField",value:function(t,e){var i=this.getContainer(),n=this._stateByField[t].attributes,r=this._stateByField[t].crosshairComp;if(r)r.setAttributes(e);else{var a=n.style;"line"===n.type?r=new Sw(Object.assign(Object.assign({},e),{lineStyle:a,zIndex:this.gridZIndex+1,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1})):"rect"===n.type&&(r=new Aw(Object.assign(Object.assign({},e),{rectStyle:a,zIndex:this.gridZIndex,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1}))),null==i||i.add(r),this._stateByField[t].crosshairComp=r}}}],[{key:"getSpecInfo",value:function(t){return yF(t,this.specKey,this.type,(function(t){return t.xField&&!1!==t.xField.visible||t.yField&&!1!==t.yField.visible}))}}])}(Iq);Fq.specKey="crosshair",Fq.builtInTheme={crosshair:Dq},Fq.type=d.cartesianCrosshair;var jq=function(t){function e(t,r){var a;return n(this,e),(a=i(this,e,[t,r])).type=d.polarCrosshair,a.name=d.polarCrosshair,a._stateByField={categoryField:{coordKey:"angle",anotherAxisKey:"radius",currentValue:new Map,labelsComp:{all:null}},valueField:{coordKey:"radius",anotherAxisKey:"angle",currentValue:new Map,labelsComp:{all:null}}},a}return c(e,t),a(e,[{key:"setAxisValue",value:function(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})}},{key:"_findAllAxisContains",value:function(t,e){var i=this._getAxisInfoByField("category"),n=this._getAxisInfoByField("value");return{angleAxisMap:this._filterAxisByPoint(i,t,e),radiusAxisMap:this._filterAxisByPoint(n,t,e)}}},{key:"_getDatumAtPoint",value:function(t,e){var i=t.getLayoutStartPoint(),n=i.x,r=i.y,a=this.getLayoutStartPoint(),o=a.x,s=a.y;return t.positionToData({x:e.x-(n-o),y:e.y-(r-s)})}},{key:"_layoutCrosshair",value:function(t,e,i,n){var r=t,a=e;if(i&&i.length)if("dimension"===n){var o=i[0];if(o.axis){var s=o.axis.pointToCoord({x:r,y:a}),l="radius"===o.axis.getOrient()?{radius:o.position,angle:s.angle}:{radius:s.radius,angle:o.position},u=o.axis.coordToPoint(l);r=u.x,a=u.y}}else if("mark"===n){var c=i[0],h=c.series.dataToPosition(c.datum[0]);r=h.x,a=h.y}this.clearAxisValue();var d=this._findAllAxisContains(r,a),v=d.angleAxisMap,f=d.radiusAxisMap;if(0!==v.size||0!==f.size)v&&this._setAllAxisValues(v,{x:r,y:a},"categoryField"),f&&this._setAllAxisValues(f,{x:r,y:a},"valueField"),this.layoutByValue();else{if(this.enableRemain)return;this.hide()}}},{key:"layoutByValue",value:function(t){var e=this;if(this.enable){var i=kL(this._regions,"polar");i&&(function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object.keys(t).forEach((function(n){var r=t[n],a=r.attributes,o=r.currentValue,s=r.cacheInfo,l=r.coordKey;if(a){var u=!!o.size,c=i&&!u&&C(s),h=c?s:{coord:0,axis:null,visible:u,coordRange:[0,0],sizeRange:[0,0],labels:{all:{visible:!1,text:"",offset:0}}};if(s&&(s._isCache=c),"valueField"===n&&(h.sides=e.angleAxisHelper.getScale(0).domain().length),o.forEach((function(t){var i,r=t.axis,o=t.datum,s=void 0===o?"":o,l=r.niceLabelFormatter;if((null===(i=a.label)||void 0===i?void 0:i.visible)&&(h.labels.all.visible=!0,h.labels.all.defaultFormatter=l,h.labels.all.text=s,h.labels.all.offset=Vj(r.getSpec())),"categoryField"===n){var u=e.angleAxisHelper.dataToPosition([s]),c=e.angleAxisHelper.getBandwidth(0),d=r.getOuterRadius();h.coord=u,h.coordRange=[u-c/2,u+c/2],h.sizeRange=[d,d]}else{var v=r.startAngle,f=e.radiusAxisHelper.dataToPosition([s]);h.coord=f,h.coordRange=[f,f],h.sizeRange=[v,v]}h.axis=r})),h&&!c&&h.labels.all.visible&&a&&a.label){var d=h.labels.all,v=a.label,f=gF(v.formatMethod,v.formatter,d.text,{label:d.text,orient:l}),p=f.formatFunc,g=f.args;p?d.text=p.apply(void 0,b(g)):d.defaultFormatter&&(d.text=d.defaultFormatter(d.text))}t[n].cacheInfo=h}}))}(this._stateByField,i,null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach((function(t){e._layoutByField(t)})))}}},{key:"_layoutByField",value:function(t){var e,i,n,r=this._stateByField[t],a=r.cacheInfo,o=r.attributes,s=r.crosshairComp,l=r.labelsComp,u=r.coordKey;if(!(!a||a._isCache&&this.enableRemain)){var c=this.getContainer(),h=a.visible,d=a.labels,v=a.coord,f=a.sizeRange,p=a.axis;if(h){var g=this.getLayoutStartPoint(),y=null===(i=null===(e=this._spec.valueField)||void 0===e?void 0:e.line)||void 0===i?void 0:i.smooth,m=function(t,e,i){var n=t.cacheInfo,r=t.coordKey,a=t.attributes,o=n.axis,s=n.coord,l=n.sizeRange,u=n.coordRange,c=o.getCenter(),h={x:c.x+e.x,y:c.y+e.y};if("angle"===r)return"sector"==("rect"===a.type?"sector":"line")?{center:h,innerRadius:o.getInnerRadius(),radius:o.getOuterRadius(),startAngle:u[0],endAngle:u[1]}:{start:we(h,o.getInnerRadius(),s),end:we(h,o.getOuterRadius(),s)};var d=o.startAngle,v=o.endAngle,f=n.sides,p=s;if(!i){var g=o.getCenter(),y=o.coordToPoint({angle:l[0],radius:s}),m=Ce(g,y),_=(v-d)/f,b=Math.floor((m-d)/_),k=b*_+d,x=Math.min((b+1)*_+d,v),S=we(g,s,k),A=we(g,s,x),M=Oe([A.x,A.y],[S.x,S.y],[g.x,g.y],[y.x,y.y]);M&&(p=Lt(ke.distancePN(y,M[0],M[1])+s,o.getInnerRadius(),o.getOuterRadius()))}return{center:h,startAngle:d,endAngle:v,radius:p,sides:f}}(this._stateByField[t],g,y);if(s)s.setAttributes(m);else{var _;if("angle"===u){var b="rect"===o.type?"sector":"line";"line"===b?_=new Sw(Object.assign(Object.assign({},m),{lineStyle:o.style,zIndex:this.gridZIndex,pickable:!1})):"sector"===b&&(_=new ww(Object.assign(Object.assign({},m),{sectorStyle:o.style,zIndex:this.gridZIndex,pickable:!1})))}else _="polygon"==(y?"circle":"polygon")?new Tw(Object.assign(Object.assign({},m),{lineStyle:o.style,zIndex:this.gridZIndex+1})):new Mw(Object.assign(Object.assign({},m),{lineStyle:o.style,zIndex:this.gridZIndex}));this._stateByField[t].crosshairComp=_,c.add(_)}var k=d.all;if(k.visible){var x=p.getCenter(),S={x:x.x+g.x,y:x.y+g.y},A="angle"===u?function(t){return{align:(t=Ee(t))>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"left":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"right":"center",baseline:t>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"bottom":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"top":"middle"}}(v):function(t){return{align:(t=Ee(t))>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"right":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"left":"center",baseline:t>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"bottom":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"top":"middle"}}(p.startAngle),M="angle"===u?we(S,f[1]+k.offset,v):we(S,m.radius,p.startAngle),w=Object.assign(Object.assign(Object.assign(Object.assign({},M),o.label),k),{textStyle:Object.assign(Object.assign({},null===(n=o.label)||void 0===n?void 0:n.textStyle),{textAlign:A.align,textBaseline:A.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(l.all,w,(function(t){t.name="crosshair-".concat(u,"-label"),l.all=t}))}else l.all&&l.all.hideAll()}}}}],[{key:"getSpecInfo",value:function(t){return yF(t,this.specKey,this.type,(function(t){return t.categoryField&&!1!==t.categoryField.visible||t.valueField&&!1!==t.valueField.visible}))}}])}(Iq);jq.specKey="crosshair",jq.builtInTheme={crosshair:Dq},jq.type=d.polarCrosshair;var zq=function(t,e){var i=e.getNewDomain,n=e.isContinuous,r=e.field,a=e.originalFields,o=r(),s=i();if(T(s)||T(o))return t;var l=a(),u=O(o)?o[0]:o;return t[u]&&l&&l[u]&&l[u].lockStatisticsByDomain&&!n()&&(t[u].values=s),t},Hq=function(t,e){var i=e.getNewDomain,n=e.isContinuous,r=(0,e.field)(),a=i();if(T(a)||T(r))return t;if(0===a.length)return[];var o={};a.forEach((function(t){o[t]||(o[t]=1)}));var s=null;return s=n()?function(t){var e=!1;return lt(r).every((function(i){t[i]>=a[0]&&t[i]<=ut(a)&&(e=!0)})),e}:function(t){var e=!1;return lt(r).every((function(i){(o[t[i]+""]||o[t[i]])&&(e=!0)})),e},t.filter(s)},Nq=function(t,e){var i=e.input,n=i.stateFields,r=i.valueFields,a=i.dataCollection,o=i.isCategoryState,l=i.seriesCollection,u=e.output,c=u.stateField,h=u.valueField,d={},v=[],f=[],p=[],g=!1,y=!1;a.forEach((function(t,e){var i;if(!T(n[e])){var a=l[e];if(a){var o=a.getRawDataStatisticsByField(n[e]);C(null==o?void 0:o.max)&&C(null==o?void 0:o.min)&&(y=!0)}var s=null===(i=t.getFields())||void 0===i?void 0:i[n[e]];s&&s.lockStatisticsByDomain&&(g=!0,s.domain.forEach((function(t){T(d[t])&&(p.push(t),d[t]=0,v.push(t))}))),t.latestData.forEach((function(t){lt(n[e]).forEach((function(i){T(t[i])||(T(d[t[i]])&&(p.push(t[i]),d[t[i]]=0,v.push(t[i])),T(r[e])||(d[t[i]]+=isNaN(parseFloat(t[r[e]]))?1:parseFloat(t[r[e]])))}))}))}}));var m=g?p:!1===o||y?p.sort((function(t,e){return t-e})):v;return m.forEach((function(t){var e=s({},c,t);h&&(e[h]=d[t]),f.push(e)})),f},Vq=function(t,e,i){var n=e.domain();if(oE(e.type))return i?n[0]+(ut(n)-n[0])*(1-t):n[0]+(ut(n)-n[0])*t;var r=e.range();i&&(r=r.slice().reverse());var a=r[0]+(ut(r)-r[0])*t;return e.invert(a)},Uq=function(t,e,i){var n=e.scale(t),r=e.range();return!i&&oE(e.type)&&(r=r.slice().reverse()),Math.max(0,Math.min(1,(n-r[0])/(ut(r)-r[0])))},Wq=function(t,e){var i=t;if(!i)return!1;var n=i.getScale();return n.range()[0]>n.range()[1]&&(!i.getInverse()||e)},Gq=function(t){var e=null==t?void 0:t.bandSize,i=null==t?void 0:t.maxBandSize,n=null==t?void 0:t.minBandSize;if(e||n||i)return{bandSize:e,maxBandSize:i,minBandSize:n}},Yq=function(t,e,i){return"start"===t?"percent"===e&&C(i.start)||"value"===e&&C(i.startValue):"percent"===e&&C(i.end)||"value"===e&&C(i.endValue)},Xq=function(t,e,i){if(oE(i.type))return[Math.min(e,t),Math.max(e,t)];var n=i.domain(),r=n.indexOf(t),a=n.indexOf(e);return n.slice(Math.min(r,a),Math.max(r,a)+1)},Kq=function(){function t(e,i,r,a,o,s,l,u){var c=this;n(this,t),this._activeRoam=!0,this._zoomAttr={enable:!0,rate:1,focus:!0},this._dragAttr={enable:!0,rate:1,reverse:!0},this._scrollAttr={enable:!0,rate:1,reverse:!0},this.initZoomEvent=function(){var t,e,i,n,r,a,o,s={delayType:null!==(e=null===(t=c._spec)||void 0===t?void 0:t.delayType)&&void 0!==e?e:"throttle",delayTime:C(null===(i=c._spec)||void 0===i?void 0:i.delayType)?null!==(r=null===(n=c._spec)||void 0===n?void 0:n.delayTime)&&void 0!==r?r:30:0,realTime:null===(o=null===(a=c._spec)||void 0===a?void 0:a.realTime)||void 0===o||o,allowComponentZoom:!0};c._zoomAttr.enable&&c.initZoomEventOfRegions(c.getRegions(),null,c.handleChartZoom,s),c._scrollAttr.enable&&c.initScrollEventOfRegions(c.getRegions(),null,c.handleChartScroll,s),c._dragAttr.enable&&c.initDragEventOfRegions(c.getRegions(),null,c.handleChartDrag,s)},this.handleChartZoom=function(t,e){var i,n;if(c._activeRoam&&(!c._zoomAttr.filter||c._zoomAttr.filter(t,e))){var r=t.zoomDelta,a=t.zoomX,o=t.zoomY,s=c.getRegions()[0].getLayoutStartPoint(),l=s.x,u=s.y,h=c.getRegions()[0].getLayoutRect(),d=h.width,v=h.height,f=Math.abs(c.getState().start-c.getState().end),p=null!==(n=null===(i=c._spec.roamZoom)||void 0===i?void 0:i.rate)&&void 0!==n?n:1;if(!(f>=1&&r<1||f<=.01&&r>1)){var g=c._isHorizontal?a:o,y=f*(r-1)*p,m=y/2,_=y/2;if(g){var b=c._isHorizontal?l:u,k=c._isHorizontal?d:v;m=Math.abs(b-g)/Math.abs(k-b)*y,_=Math.abs(k-g)/Math.abs(k-b)*y}var x=Lt(c.getState().start+m,0,1),S=Lt(c.getState().end-_,0,1);c._handleChange(Math.min(x,S),Math.max(x,S),!0)}}},this.handleChartScroll=function(t,e){var i;if(!c._activeRoam||c._scrollAttr.filter&&!c._scrollAttr.filter(t,e))return!1;var n=t.scrollX,r=t.scrollY,a=c._isHorizontal?n:r,o=c._isHorizontal?re(n/r)>=.5:re(r/n)>=.5;c._scrollAttr.reverse||(a=-a),o&&c.handleChartMove(a,null!==(i=c._scrollAttr.rate)&&void 0!==i?i:1);var s=0!==c.getState().start&&1!==c.getState().end;return o&&s},this.handleChartDrag=function(t,e){var i;if(c._activeRoam&&(!c._dragAttr.filter||c._dragAttr.filter(t,e))){var n=m(t,2),r=n[0],a=n[1],o=c._isHorizontal?r:a;c._dragAttr.reverse&&(o=-o),c.handleChartMove(o,null!==(i=c._dragAttr.rate)&&void 0!==i?i:1)}},this.handleChartMove=function(t,e){var i=c._isHorizontal?c.getLayoutRect().width:c.getLayoutRect().height;if(Math.abs(t)>=1e-6)if(t>0&&c.getState().end<1){var n=Math.min(1-c.getState().end,t/i)*e;c._handleChange(c.getState().start+n,c.getState().end+n,!0)}else if(t<0&&c.getState().start>0){var r=Math.max(-c.getState().start,t/i)*e;c._handleChange(c.getState().start+r,c.getState().end+r,!0)}return!1},this._type=e,this._spec=i,this._handleChange=r,this.getLayoutRect=a,this.getState=o,this.getRegions=s,this._regions=s(),this.getOption=l,this._option=l(),this.getEvent=u,this._isHorizontal="horizontal"===uj(lj(i))}return a(t,[{key:"enableInteraction",value:function(){this._activeRoam=!0}},{key:"disableInteraction",value:function(){this._activeRoam=!1}},{key:"zoomIn",value:function(t){this.handleChartZoom({zoomDelta:1.2,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}},{key:"zoomOut",value:function(t){this.handleChartZoom({zoomDelta:.8,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}},{key:"setEventAttrFromSpec",value:function(){!0===this._spec.roamZoom||this._spec.roamZoom?this._zoomAttr=et({},this._zoomAttr,this._spec.roamZoom):this._zoomAttr.enable=!1,!0===this._spec.roamDrag||this._spec.roamDrag?this._dragAttr=et({},this._dragAttr,this._spec.roamDrag):this._dragAttr.enable=!1,!0===this._spec.roamScroll||this._spec.roamScroll?this._scrollAttr=et({},this._scrollAttr,this._spec.roamScroll):this._scrollAttr.enable=!1,M(this._spec.roam)&&(this._zoomAttr.enable="scrollBar"!==this._type&&this._spec.roam,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.getEvent(),this._option.mode)}}])}();st(Kq,NN);var qq=function(r){function o(t,r){var a;return n(this,o),(a=i(this,o,[t,r])).layoutType="none",a._orient="left",a._cacheVisibility=void 0,a._dataUpdating=!1,a._hasInitStateScale=!1,a._shouldChange=!0,a._stateField="x",a._handleStateChange=function(t,e,i){var n,r;return a._startValue=t,a._endValue=e,a._newDomain=Xq(a._startValue,a._endValue,a._stateScale),null===(r=(n=a.effect).onZoomChange)||void 0===r||r.call(n,i),!0},a.effect={onZoomChange:function(t){var e,i,n=a._relatedAxisComponent;if(n&&"axis"===a._filterMode){var r=n.getScale(),o=n.getSpec();a._auto&&Gq(o)&&a._spec.ignoreBandSize&&(r.bandwidth("auto"),r.maxBandwidth("auto"),r.minBandwidth("auto")),a._updateRangeFactor(t),a._auto&&(null===(i=null===(e=a._component)||void 0===e?void 0:e.setStartAndEnd)||void 0===i||i.call(e,a._start,a._end)),n.effect.scaleUpdate({value:"force"})}else gL(a._regions,(function(t){var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:a._seriesUserId,specIndex:a._seriesIndex}),gL(a._regions,(function(t){t.reFilterViewData()}),{userId:a._seriesUserId,specIndex:a._seriesIndex})}},a._visible=!0,a._orient=lj(t),a._isHorizontal="horizontal"===uj(a._orient),a._dataFilterEvent=new Kq(a.type,a._spec,a._handleChange.bind(e(a)),a.getLayoutRect.bind(e(a)),(function(){return{start:a._start,end:a._end}}),(function(){return a._regions}),function(){return a._option}.bind(e(a)),(function(){return a.event})),a}return c(o,r),a(o,[{key:"isHorizontal",get:function(){return this._isHorizontal}},{key:"stateScale",get:function(){return this._stateScale}},{key:"relatedAxisComponent",get:function(){return this._relatedAxisComponent}},{key:"setStartAndEnd",value:function(t,e){var i=m(arguments.length>2&&void 0!==arguments[2]?arguments[2]:["percent","percent"],2),n=i[0],r=void 0===n?"percent":n,a=i[1],o=void 0===a?"percent":a,s="percent"===r?t:Uq(t,this._stateScale,this._isHorizontal),l="percent"===o?e:Uq(e,this._stateScale,this._isHorizontal);this._handleChange(s,l,!0)}},{key:"enableInteraction",value:function(){this._dataFilterEvent.enableInteraction()}},{key:"disableInteraction",value:function(){this._dataFilterEvent.disableInteraction()}},{key:"zoomIn",value:function(t){this._dataFilterEvent.zoomIn(t)}},{key:"zoomOut",value:function(t){this._dataFilterEvent.zoomOut(t)}},{key:"_initEvent",value:function(){var e;this._dataFilterEvent.initZoomEvent(),null===(e=this._relatedAxisComponent)||void 0===e||e.event.on(t.ChartEvent.scaleRawDomainUpdate,(function(t){var e=t.model;console.log("scaleRawDomainUpdate",e.getRawDomain())}))}},{key:"_handleChange",value:function(t,e,i){var n,r;null!==(r=null===(n=this._spec)||void 0===n?void 0:n.zoomLock)&&void 0!==r&&r||e-t!==this._spanCache&&(e-t<this._minSpan||e-t>this._maxSpan)?this._shouldChange=!1:(this._shouldChange=!0,this._spanCache=e-t)}},{key:"_updateRangeFactor",value:function(t){var e=this._relatedAxisComponent,i=e.getScale(),n=Wq(e,this._isHorizontal),r=n?[1-this._end,1-this._start]:[this._start,this._end];if(n)switch(t){case"startHandler":e.scaleRangeFactorEnd(r[1]);break;case"endHandler":e.scaleRangeFactorStart(r[0]);break;default:e.scaleRangeFactorStart(r[0],!0),e.scaleRangeFactorEnd(r[1])}else switch(t){case"startHandler":e.scaleRangeFactorStart(r[0]);break;case"endHandler":e.scaleRangeFactorEnd(r[1]);break;default:e.scaleRangeFactorEnd(r[1],!0),e.scaleRangeFactorStart(r[0])}var a=i.rangeFactor();a?(this._start=n?1-a[1]:a[0],this._end=n?1-a[0]:a[1]):(this._start=0,this._end=1)}},{key:"visible",get:function(){return this._visible}},{key:"created",value:function(){_(o,"created",this,3)([]),this._setAxisFromSpec(),this._setRegionsFromSpec(),this._initEvent(),this._initData(),this._initStateScale(),this._setStateFromSpec()}},{key:"initLayout",value:function(){_(o,"initLayout",this,3)([]),this._layout&&(this._layout.layoutOrient=this._orient)}},{key:"init",value:function(t){_(o,"init",this,3)([t]),this._addTransformToSeries(),0===this._start&&1===this._end||this.effect.onZoomChange()}},{key:"_compareSpec",value:function(t,e){var i=_(o,"_compareSpec",this,3)([t,e]);return i.reMake||at(e,t)||(i.reRender=!0,i.reMake=!0),i}},{key:"reInit",value:function(t){var e=this;_(o,"reInit",this,3)([t]),this._marks.forEach((function(t){t.getMarks().forEach((function(t){e.initMarkStyleWithSpec(t,e._spec[t.name])}))}))}},{key:"onLayoutStart",value:function(t,e){_(o,"onLayoutStart",this,3)([t,e]);var i=this._autoUpdate(t);this._autoVisible(i),this._dataUpdating=!1}},{key:"updateLayoutAttribute",value:function(){this._visible&&this._createOrUpdateComponent(),this._hasInitStateScale||(0===this._start&&1===this._end||(this._newDomain=function(t,e,i,n,r){if(oE(r.type)){var a=r.domain(),o=a[0],s=ut(a)-o,l=C(t)?o+s*t:+e,u=C(i)?o+s*i:+n;return[Math.min(u,l),Math.max(u,l)]}var c=r.domain(),h=r.range(),d=h[h.length-1]-h[0],v=C(t)?c.indexOf(r.invert(d*t+h[0])):c.indexOf(e),f=C(i)?c.indexOf(r.invert(d*i+h[0])):c.indexOf(n);return c.slice(Math.min(v,f),Math.max(v,f)+1)}(this._spec.start,this._startValue,this._spec.end,this._endValue,this._stateScale),this.effect.onZoomChange()),this._hasInitStateScale=!0)}},{key:"_initAfterLayout",value:function(){this._stateScale=null,this._initStateScale(),this._updateScaleRange(),this._setStateFromAxis()}},{key:"_beforeLayoutEnd",value:function(){this._hasInitStateScale?this._updateScaleRange():this._initAfterLayout()}},{key:"onLayoutEnd",value:function(){var t;this._beforeLayoutEnd();var e=!(0===this._start&&1===this._end);this._autoVisible(e),_(o,"onLayoutEnd",this,3)([]),null===(t=this._relatedAxisComponent)||void 0===t||t.updateScaleRange()}},{key:"getBoundsInRect",value:function(t){var 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}},{key:"setAttrFromSpec",value:function(){var t;_(o,"setAttrFromSpec",this,3)([]),this._dataFilterEvent.setEventAttrFromSpec(),this._field=this._spec.field,this._width=this._computeWidth(),this._height=this._computeHeight(),this._visible=null===(t=this._spec.visible)||void 0===t||t}},{key:"_setAxisFromSpec",value:function(){var t=this;if(C(this._spec.axisId)?this._relatedAxisComponent=this._option.getComponentByUserId(this._spec.axisId):C(this._spec.axisIndex)&&(this._relatedAxisComponent=this._option.getComponentByIndex("axes",this._spec.axisIndex)),T(this._spec.field)&&!this._relatedAxisComponent){var e=this._option.getComponentsByKey("axes"),i=e.find((function(e){return uj(e._orient)===uj(t._orient)}));if(i)this._relatedAxisComponent=i;else{var n=e.find((function(t){return!oE(t.getScale().type)}));this._relatedAxisComponent=n}}this._relatedAxisComponent&&"axis"===this._filterMode&&(this._relatedAxisComponent.autoIndentOnce=!0)}},{key:"_setRegionsFromSpec",value:function(){var t,e;this._regions=this._relatedAxisComponent?this._relatedAxisComponent.getRegions():this._option.getAllRegions();var i=this._relatedAxisComponent?null===(e=(t=this._relatedAxisComponent).getBindSeriesFilter)||void 0===e?void 0:e.call(t):null;if(C(i)&&(C(i.userId)&&(this._seriesUserId=lt(i.userId)),C(i.specIndex)&&(this._seriesIndex=lt(i.specIndex))),C(this._spec.seriesId)){var n=lt(this._spec.seriesId);this._seriesUserId?this._seriesUserId=this._seriesUserId.filter((function(t){return n.includes(t)})):this._seriesUserId=n}if(C(this._spec.seriesIndex)){var r=lt(this._spec.seriesIndex);this._seriesIndex?this._seriesIndex=this._seriesIndex.filter((function(t){return r.includes(t)})):this._seriesIndex=r}if(C(this._spec.regionIndex)){var a=this._option.getRegionsInIndex(lt(this._spec.regionIndex));this._regions=this._regions.filter((function(t){return a.includes(t)}))}else if(C(this._spec.regionId)){var o=lt(this._spec.regionId);this._regions=o.length?this._regions.filter((function(t){return o.includes(t.id)})):[]}}},{key:"_initData",value:function(){var t,e=this,i=[],n=[],r=[],a=[];if(this._relatedAxisComponent){var o={};gL(this._regions,(function(n){var s,l,u="cartesian"===n.coordinate?n.getXAxisHelper():"polar"===n.coordinate?n.angleAxisHelper:null,c="cartesian"===n.coordinate?n.getYAxisHelper():"polar"===n.coordinate?n.radiusAxisHelper:null;if(u&&c){var h=u.getAxisId()===e._relatedAxisComponent.id?u:c.getAxisId()===e._relatedAxisComponent.id?c:e._isHorizontal?u:c,d=h===u?c:u,v=oE(d.getScale(0).type),f=oE(h.getScale(0).type);i.push(n.getRawData());var p=n.getSpec(),g="cartesian"===n.coordinate?lt(p.xField):lt(null!==(s=p.angleField)&&void 0!==s?s:p.categoryField),y="cartesian"===n.coordinate?lt(p.yField):lt(null!==(l=p.radiusField)&&void 0!==l?l:p.valueField);if(o[n.id]="link"===n.type?["from_xField"]:h===u?g:y,f?(t=!1,r.push(o[n.id])):(t=!0,r.push(o[n.id][0])),e._valueField){var m="link"===n.type?["from_yField"]:d===u?g:y;v&&a.push.apply(a,b(m))}}}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._originalStateFields=o}else gL(this._regions,(function(t){i.push(t.getRawData()),n.push(t),r.push(e._field),e._valueField&&a.push(e._spec.valueField)}),{userId:this._seriesUserId,specIndex:this._seriesIndex});var s=this._option.dataSet;BI(s,"dataview",Uo),EI(s,"dataFilterComputeDomain",Nq);var l=new Xo(s,{name:"".concat(this.type,"_").concat(this.id,"_data")});l.transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:i,seriesCollection:n,stateFields:r,valueFields:a,isCategoryState:t},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data=new ID(this._option,l),l.reRunAllTransform(),s.multipleDataViewAddListener(i,"change",this._handleDataCollectionChange.bind(this))}},{key:"_addTransformToSeries",value:function(){var e=this;this._relatedAxisComponent&&"axis"===this._filterMode||(EI(this._option.dataSet,"dataFilterWithNewDomain",Hq),EI(this._option.dataSet,"lockStatisticsFilter",zq),gL(this._regions,(function(i){i.getViewDataStatistics().transform({type:"lockStatisticsFilter",options:{originalFields:function(){return i.getViewDataStatistics().getFields()},getNewDomain:function(){return e._newDomain},field:function(){var t;return null!==(t=e._field)&&void 0!==t?t:e._parseFieldOfSeries(i)},isContinuous:function(){return oE(e._stateScale.type)}},level:1},!1),i.addViewDataFilter({type:"dataFilterWithNewDomain",options:{getNewDomain:function(){return e._newDomain},field:function(){var t;return null!==(t=e._field)&&void 0!==t?t:e._parseFieldOfSeries(i)},isContinuous:function(){return oE(e._stateScale.type)}},level:t.TransformLevel.dataZoomFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex}))}},{key:"onDataUpdate",value:function(){var t,e=this._computeDomainOfStateScale(oE(this._stateScale.type));this._stateScale.domain(e,!1),this._handleChange(this._start,this._end,!0),this._spec.auto&&!at(this._domainCache,e)&&(this._domainCache=e,this._dataUpdating=!0,null===(t=this.getChart())||void 0===t||t.setLayoutTag(!0,null,!1))}},{key:"_parseFieldOfSeries",value:function(t){var e;return null===(e=this._originalStateFields)||void 0===e?void 0:e[t.id]}},{key:"_setStateFromSpec",value:function(){var t,e;if(this._auto=!!this._spec.auto,this._spec.rangeMode){var i=m(this._spec.rangeMode,2),n=i[0],r=i[1];Yq("start",n,this._spec)&&Yq("end",r,this._spec)&&(t="percent"===n?this._spec.start:Uq(this._spec.startValue,this._stateScale,this._isHorizontal),e="percent"===r?this._spec.end:Uq(this._spec.endValue,this._stateScale,this._isHorizontal))}else t=this._spec.start?this._spec.start:this._spec.startValue?Uq(this._spec.startValue,this._stateScale,this._isHorizontal):0,e=this._spec.end?this._spec.end:this._spec.endValue?Uq(this._spec.endValue,this._stateScale,this._isHorizontal):1;this._start=Math.max(0,Math.min(1,t)),this._end=Math.max(0,Math.min(1,e))}},{key:"_setStateFromAxis",value:function(){var t,e;this._setStateFromSpec();var i=this._relatedAxisComponent;this._startValue=Vq(this._start,this._stateScale,Wq(i,this._isHorizontal)),this._endValue=Vq(this._end,this._stateScale,Wq(i,this._isHorizontal)),this._minSpan=null!==(t=this._spec.minSpan)&&void 0!==t?t:0,this._maxSpan=null!==(e=this._spec.maxSpan)&&void 0!==e?e:1,oE(this._stateScale.type)&&this._stateScale.domain()[0]!==ut(this._stateScale.domain())&&(this._spec.minValueSpan&&(this._minSpan=this._spec.minValueSpan/(ut(this._stateScale.domain())-this._stateScale.domain()[0])),this._spec.maxValueSpan&&(this._maxSpan=this._spec.maxValueSpan/(ut(this._stateScale.domain())-this._stateScale.domain()[0]))),this._minSpan=Math.max(0,this._minSpan),this._maxSpan=Math.min(this._maxSpan,1),i&&(i&&"axis"===this._filterMode||0===this._start&&1===this._end||(this._newDomain=Xq(this._startValue,this._endValue,this._stateScale)))}},{key:"_initStateScale",value:function(){var t,e,i,n,r,a,o=this,s=[0,1];if(this._relatedAxisComponent){var l=this._relatedAxisComponent.getScale().clone();this._stateScale=l,null===(e=(t=l).maxBandwidth)||void 0===e||e.call(t,"auto",!0),null===(n=(i=l).minBandwidth)||void 0===n||n.call(i,"auto",!0),null===(a=(r=l).bandwidth)||void 0===a||a.call(r,"auto",!0),l.rangeFactor(s,!0).range(s)}else{var u=!0;this._field&&gL(this._regions,(function(t){var e=t.getRawDataStatisticsByField(o._field);z(null==e?void 0:e.min)&&z(null==e?void 0:e.max)||(u=!1)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._stateScale=u?new ZE:new EE,this._stateScale.domain(this._computeDomainOfStateScale(u),!0).range(s)}}},{key:"_computeDomainOfStateScale",value:function(t){var e=this;if(this._spec.customDomain)return this._spec.customDomain;var i=this._data.getLatestData().map((function(t){return t[e._stateField]}));if(t){var n=i.map((function(t){return 1*t}));return i.length?[ht(n),ct(n)]:[-1/0,1/0]}return i}},{key:"_autoVisible",value:function(e){if(this._auto){e?this.show():this.hide();var i=this._isHorizontal?"height":"width";this.layout.setLayoutRect(s({},i,e?this["_".concat(i)]:0),s({},i,t.AttributeLevel.Built_In))}}},{key:"hide",value:function(){var t;null===(t=this._component)||void 0===t||t.hideAll()}},{key:"show",value:function(){var t;null===(t=this._component)||void 0===t||t.showAll()}},{key:"_autoUpdate",value:function(t){var e,i,n,r,a,o;if(!this._auto)return this._cacheVisibility=void 0,!0;var s=this._relatedAxisComponent,l=null==s?void 0:s.getSpec(),u=null==s?void 0:s.getScale(),c=Gq(l);if(!this._dataUpdating&&lE(u.type)&&(null==t?void 0:t.height)===(null===(e=this._cacheRect)||void 0===e?void 0:e.height)&&(null==t?void 0:t.width)===(null===(i=this._cacheRect)||void 0===i?void 0:i.width)&&this._fixedBandSize===(null==c?void 0:c.bandSize))return this._cacheVisibility;var h=!0;if(this._isHorizontal&&(null==t?void 0:t.width)!==(null===(n=this._cacheRect)||void 0===n?void 0:n.width)?u.range(s.getInverse()?[t.width,0]:[0,t.width]):(null==t?void 0:t.height)!==(null===(r=this._cacheRect)||void 0===r?void 0:r.height)&&u.range(s.getInverse()?[0,t.height]:[t.height,0]),this._cacheRect={width:null==t?void 0:t.width,height:null==t?void 0:t.height},this._fixedBandSize=null==c?void 0:c.bandSize,lE(u.type)){c&&(this._start||this._end)&&(this.type===d.scrollBar&&(this._start=0,this._end=1),this._updateRangeFactor());var v=m(null!==(a=u.rangeFactor())&&void 0!==a?a:[],2),f=v[0],p=v[1];h=!(T(f)&&T(p)||0===f&&1===p)}else{var g=m(null!==(o=u.rangeFactor())&&void 0!==o?o:[this._start,this._end],2),y=g[0],_=g[1];h=!(0===y&&1===_)}return this.setStartAndEnd(this._start,this._end),this._cacheVisibility=h,h}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._component]}}])}(vz);st(qq,NN);var Zq=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_mergeThemeToSpec",value:function(t,e){var i=this,n=this._theme,r=t;if(this._shouldMergeThemeToSpec()){var a=function(t){var e=nO({selectedBackgroundChart:{line:{},area:{}}},i._theme,t),n=t.selectedBackgroundChart,r=void 0===n?{}:n,a=r.line,o=r.area;return a&&!1!==a.visible&&(e.selectedBackgroundChart.line.style=Object.assign(Object.assign({},e.selectedBackgroundChart.line.style),{visible:!0})),o&&!1!==o.visible&&(e.selectedBackgroundChart.area.style=Object.assign(Object.assign({},e.selectedBackgroundChart.area.style),{visible:!0})),e},o=t;r=O(o)?o.map((function(t){return a(t)})):a(o)}return this._adjustPadding(r),{spec:r,theme:n}}}])}(dz),Jq=function(t){return{area:{style:{visible:t,stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{visible:t,stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}}},Qq={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:Jq(!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:Jq(!0)},$q=function(e){function r(e,a){var o,s;return n(this,r),(o=i(this,r,[e,a])).type=d.dataZoom,o.name=d.dataZoom,o.transformerConstructor=Zq,o.specKey="dataZoom",o.layoutZIndex=t.LayoutZIndex.DataZoom,o.layoutLevel=t.LayoutLevel.DataZoom,o.layoutType="region-relative",o._isReverseCache=!1,o._dataToPositionX=function(t){var e=o._isHorizontal?0:o._middleHandlerSize,i=o._isHorizontal?o._startHandlerSize/2:0,n=o._isHorizontal?o._stateScale:o._valueScale,r=o._isHorizontal?o._stateField:o._valueField;return n.scale(t[r])+o.getLayoutStartPoint().x+e+i},o._dataToPositionX2=function(t){var e=o._isHorizontal?0:o._middleHandlerSize,i=o._isHorizontal?o._startHandlerSize/2:0,n=o._isHorizontal?o._stateScale:o._valueScale,r=n.domain()[0];return n.scale(r)+o.getLayoutStartPoint().x+e+i},o._dataToPositionY=function(t){var e=o._isHorizontal?o._middleHandlerSize:0,i=o._isHorizontal?0:o._startHandlerSize/2,n=o._isHorizontal?o._valueScale:o._getPreviewStateScale(),r=o._isHorizontal?o._valueField:o._stateField;return n.scale(t[r])+o.getLayoutStartPoint().y+e+i},o._dataToPositionY2=function(t){var e=o._isHorizontal?o._middleHandlerSize:0,i=o._isHorizontal?0:o._startHandlerSize/2,n=o._isHorizontal?o._valueScale:o._getPreviewStateScale(),r=n.domain()[0];return n.scale(r)+o.getLayoutStartPoint().y+e+i},o._valueField="y",o._filterMode=null!==(s=e.filterMode)&&void 0!==s?s:"filter",o}return c(r,e),a(r,[{key:"_handleChange",value:function(e,i,n,a){if(_(r,"_handleChange",this,3)([e,i,n]),this._shouldChange)if(n&&this._component)this._component.setStartAndEnd(e,i);else{var o=this._relatedAxisComponent,s=Vq(e,this._stateScale,Wq(o,this._isHorizontal)),l=Vq(i,this._stateScale,Wq(o,this._isHorizontal));if(!C(s)||!C(l))return;this._start=e,this._end=i,(w(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(e,i,s,l):this._handleStateChange(s,l,a))&&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}})}}},{key:"_handleDataCollectionChange",value:function(){this._data.getDataView().reRunAllTransform();var t=this._computeDomainOfValueScale();t&&(this._valueScale||(this._valueScale=new ZE),this._valueScale.domain(t),this._updateValueScaleRange(),this._component&&this._createOrUpdateComponent(!0))}},{key:"created",value:function(){_(r,"created",this,3)([]),this._initValueScale()}},{key:"updateLayoutAttribute",value:function(){!1!==this._cacheVisibility&&_(r,"updateLayoutAttribute",this,3)([])}},{key:"_beforeLayoutEnd",value:function(){_(r,"_beforeLayoutEnd",this,3)([]);var t=this._relatedAxisComponent;(Wq(t,this._isHorizontal)&&!this._isReverseCache||this._auto)&&(this._isReverseCache=Wq(t,this._isHorizontal),this.effect.onZoomChange())}},{key:"clear",value:function(){if(this._component){var t=this.getContainer();this._component.removeAllChild(),t&&t.removeChild(this._component),this._component=null}_(r,"clear",this,3)([])}},{key:"getBoundsInRect",value:function(t){var e,i,n,r,a={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},o=this._startHandlerSize*(null!==(e=this._spec.startHandler.style.scaleX)&&void 0!==e?e:1),s=this._startHandlerSize*(null!==(i=this._spec.startHandler.style.scaleY)&&void 0!==i?i:1),l=this._endHandlerSize*(null!==(n=this._spec.endHandler.style.scaleX)&&void 0!==n?n:1),u=this._endHandlerSize*(null!==(r=this._spec.endHandler.style.scaleY)&&void 0!==r?r:1),c=this._visible?this._isHorizontal?(o-this._startHandlerSize)/2+(l-this._endHandlerSize)/2:(Math.max(o,l)-this._width)/2:0,h=this._visible?this._isHorizontal?(Math.max(s,u)-this._height)/2:(s-this._startHandlerSize)/2+(u-this._endHandlerSize)/2:0;return this._isHorizontal?(a.y2=a.y1+this._height+h,a.x2=a.x1+t.width+c):(a.x2=a.x1+this._width+c,a.y2=a.y1+t.height+h),a}},{key:"setAttrFromSpec",value:function(){var t,e,i,n,a,o,s,l,u,c;_(r,"setAttrFromSpec",this,3)([]);var h=this._isHorizontal?Number(this._spec.height):Number(this._spec.width);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(),T(null===(a=null===(n=null===(i=this._spec)||void 0===i?void 0:i.startHandler)||void 0===n?void 0:n.style)||void 0===a?void 0:a.size)&&(this._spec.startHandler.style.size=isNaN(h)?this._backgroundSize:h-this._middleHandlerSize),T(null===(l=null===(s=null===(o=this._spec)||void 0===o?void 0:o.endHandler)||void 0===s?void 0:s.style)||void 0===l?void 0:l.size)&&(this._spec.endHandler.style.size=isNaN(h)?this._backgroundSize:h-this._middleHandlerSize);var d=null===(u=this._spec.startHandler.style.visible)||void 0===u||u,v=null===(c=this._spec.endHandler.style.visible)||void 0===c||c;this._startHandlerSize=d?this._spec.startHandler.style.size:0,this._endHandlerSize=v?this._spec.endHandler.style.size:0,this._width=this._computeWidth(),this._height=this._computeHeight()}},{key:"_initValueScale",value:function(){var t=this._computeDomainOfValueScale();if(t){var e=new ZE;e.domain(t),this._valueScale=e}}},{key:"_updateScaleRange",value:function(){this._updateStateScaleRange(),this._updateValueScaleRange()}},{key:"_updateStateScaleRange",value:function(){var t,e,i,n=this._startHandlerSize+this._endHandlerSize;if(this._stateScale){var r,a=this._isHorizontal?this.getLayoutRect().width-n:this.getLayoutRect().height-n,o=null!==(e=null===(t=this._relatedAxisComponent)||void 0===t?void 0:t.getScale().range())&&void 0!==e?e:[this._startHandlerSize/2,a+this._startHandlerSize/2],s=this._computeWidth(),l=this._computeHeight();r=this._isHorizontal?this._visible?[this._startHandlerSize/2,s-n+this._startHandlerSize/2]:o:this._visible?[this._startHandlerSize/2,l-n+this._startHandlerSize/2]:o,this._stateScale.range(r),null===(i=this._previewStateScale)||void 0===i||i.range(Wq(this._relatedAxisComponent,this._isHorizontal)?r.reverse():r)}}},{key:"_updateValueScaleRange",value:function(){if(this._valueScale){var t=this._computeWidth(),e=this._computeHeight();this._isHorizontal?this._valueScale.range([e-this._middleHandlerSize,0]):"left"===this.layoutOrient?this._valueScale.range([t-this._middleHandlerSize,0]):this._valueScale.range([0,t-this._middleHandlerSize])}}},{key:"_computeDomainOfValueScale",value:function(){var t=this,e=this._data.getLatestData().map((function(e){return e[t._valueField]})),i=e.map((function(t){return 1*t}));return e.length?[ht(i),ct(i)]:null}},{key:"_isScaleValid",value:function(t){if(!t||!t.domain())return!1;var e,i=t.domain();return!(oE(t.type)&&i[0]===ut(i)||lE(t.type)&&1===(e=i,e&&O(e)?Array.from(new Set(lt(e))):e).length)}},{key:"_getXScale",value:function(){return this._relatedAxisComponent.getScale().type===this.stateScale.type&&this._isHorizontal?this.stateScale:this._isHorizontal?this._stateScale:this._valueScale}},{key:"_getYScale",value:function(){return this._isHorizontal?this._valueScale:this._stateScale}},{key:"_computeMiddleHandlerSize",value:function(){var t,e,i,n,r=0;if(null===(e=null===(t=this._spec)||void 0===t?void 0:t.middleHandler)||void 0===e?void 0:e.visible){var a=null!==(i=this._spec.middleHandler.icon.style.size)&&void 0!==i?i:8,o=null!==(n=this._spec.middleHandler.background.size)&&void 0!==n?n:40;r+=Math.max(a,o)}return r}},{key:"_computeWidth",value:function(){return!1===this._visible?0:F(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:Math.max(this._startHandlerSize||0,this._endHandlerSize||0,this._backgroundSize||0)+this._middleHandlerSize}},{key:"_computeHeight",value:function(){return!1===this._visible?0:F(this._spec.height)?this._spec.height:this._isHorizontal?Math.max(this._startHandlerSize||0,this._endHandlerSize||0,this._backgroundSize||0)+this._middleHandlerSize:this.getLayoutRect().height}},{key:"_getAttrs",value:function(t){var e,i,n,r,a,o=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:o.showDetail,brushSelect:null!==(i=o.brushSelect)&&void 0!==i&&i,zoomLock:null!==(n=o.zoomLock)&&void 0!==n&&n,minSpan:this._minSpan,maxSpan:this._maxSpan,delayType:o.delayType,delayTime:C(o.delayType)?null!==(r=o.delayTime)&&void 0!==r?r:30:0,realTime:null===(a=o.realTime)||void 0===a||a,previewData:t&&this._data.getLatestData(),previewPointsX:t&&this._dataToPositionX,previewPointsY:t&&this._dataToPositionY,tolerance:this._spec.tolerance,isReverse:Wq(this._relatedAxisComponent,this._isHorizontal)},this._getComponentAttrs(t))}},{key:"_getLayoutAttrs",value:function(){return{position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y},size:{width:this._computeWidth(),height:this._computeHeight()}}}},{key:"_createOrUpdateComponent",value:function(t){var e=this;if(this._visible){var i=this._isHorizontal?this._stateScale:this._valueScale,n=this._isHorizontal?this._valueScale:this._stateScale,r=this._isScaleValid(i)&&this._isScaleValid(n)&&!1!==this._spec.showBackgroundChart,a=this._getAttrs(r),o=this._relatedAxisComponent;if(this._component)this._component.setAttributes(a),t&&(this._component.setPreviewData(this._data.getDataView().latestData),r&&(this._isHorizontal?this._component.setPreviewPointsY1(this._dataToPositionY2):this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((function(t){return Vq(t,e._stateScale,Wq(o,e._isHorizontal))}))));else{var s=this.getContainer();this._component=new xP(a),this._component.setPreviewData(this._data.getDataView().latestData),this._isHorizontal?r&&this._component.setPreviewPointsY1(this._dataToPositionY2):r&&this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((function(t){return Vq(t,e._stateScale,Wq(o,e._isHorizontal))})),this._component.addEventListener("dataZoomChange",(function(t){var i=t.detail,n=i.start,r=i.end,a=i.tag;e._handleChange(n,r,void 0,a)})),s.add(this._component)}}}},{key:"_getComponentAttrs",value:function(t){var e,i,n,r,a,o,s,l,u,c,h,d=this._spec,v=d.middleHandler,f=void 0===v?{}:v,p=d.startText,g=void 0===p?{}:p,y=d.endText,m=void 0===y?{}:y,_=d.backgroundChart,b=void 0===_?{}:_,k=d.selectedBackgroundChart,x=void 0===k?{}:k;return{backgroundStyle:pI(null===(e=this._spec.background)||void 0===e?void 0:e.style),startHandlerStyle:pI(null===(i=this._spec.startHandler)||void 0===i?void 0:i.style),middleHandlerStyle:f.visible?{visible:!0,icon:pI(null===(n=f.icon)||void 0===n?void 0:n.style),background:{size:null===(r=f.background)||void 0===r?void 0:r.size,style:pI(null===(a=f.background)||void 0===a?void 0:a.style)}}:{visible:!1},endHandlerStyle:pI(null===(o=this._spec.endHandler)||void 0===o?void 0:o.style),startTextStyle:{padding:g.padding,formatMethod:this._getHandlerTextFormatMethod(g),textStyle:pI(g.style)},endTextStyle:{padding:m.padding,formatMethod:this._getHandlerTextFormatMethod(m),textStyle:pI(m.style)},selectedBackgroundStyle:pI(this._spec.selectedBackground.style),dragMaskStyle:pI(null===(s=this._spec.dragMask)||void 0===s?void 0:s.style),backgroundChartStyle:t?{line:nO(pI(null===(l=b.line)||void 0===l?void 0:l.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},pI(null===(u=b.area)||void 0===u?void 0:u.style))}:{line:{visible:!1},area:{visible:!1}},selectedBackgroundChartStyle:t?{line:nO(pI(null===(c=x.line)||void 0===c?void 0:c.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},pI(null===(h=x.area)||void 0===h?void 0:h.style))}:{line:{visible:!1},area:{visible:!1}},disableTriggerEvent:this._option.disableTriggerEvent}}},{key:"_getHandlerTextFormatMethod",value:function(t){var e=t.formatMethod,i=t.formatter,n=gF(e,i).formatFunc;return n?function(t){return n(t,{label:t},i)}:void 0}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._component]}},{key:"onDataUpdate",value:function(){_(r,"onDataUpdate",this,3)([]),this._previewStateScale!==this._stateScale&&(this._previewStateScale=null)}},{key:"_getPreviewStateScale",value:function(){return this._previewStateScale||(Wq(this._relatedAxisComponent,this._isHorizontal)?(this._previewStateScale=this._stateScale.clone(),this._previewStateScale.range(this._stateScale.range().reverse())):this._previewStateScale=this._stateScale),this._previewStateScale}}])}(qq);$q.type=d.dataZoom,$q.transformerConstructor=Zq,$q.builtInTheme={dataZoom:Qq},$q.specKey="dataZoom";var tZ={horizontal:{height:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}},vertical:{width:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}}},eZ=function(e){function r(e,a){var o,s;return n(this,r),(o=i(this,r,[e,a])).type=d.scrollBar,o.name=d.scrollBar,o.specKey="scrollBar",o.layoutZIndex=t.LayoutZIndex.DataZoom,o.layoutLevel=t.LayoutLevel.DataZoom,o.layoutType="region-relative",o._filterMode=null!==(s=e.filterMode)&&void 0!==s?s:"axis",o}return c(r,e),a(r,[{key:"_handleChange",value:function(e,i,n){_(r,"_handleChange",this,3)([e,i,n]);var a=sL(this._start,e)&&sL(this._end,i);if(this._shouldChange&&(!a||!1===this._spec.realTime)){n&&this._component&&this._component.setAttribute("range",[e,i]),this._start=e,this._end=i;var o=Vq(e,this._stateScale,!1),s=Vq(i,this._stateScale,!1);(w(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(e,i,o,s):this._handleStateChange(o,s))&&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}})}}},{key:"_handleDataCollectionChange",value:function(){this._spec.auto&&this._data.getDataView().reRunAllTransform()}},{key:"_beforeLayoutEnd",value:function(){var t,e;_(r,"_beforeLayoutEnd",this,3)([]),null===(e=(t=this.effect).onZoomChange)||void 0===e||e.call(t)}},{key:"onLayoutEnd",value:function(){this._updateComponentBounds(),_(r,"onLayoutEnd",this,3)([])}},{key:"_updateScaleRange",value:function(){}},{key:"_updateComponentBounds",value:function(){this._component&&this._component.setAttributes({x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height})}},{key:"_computeWidth",value:function(){return!1===this._visible?0:F(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:12}},{key:"_computeHeight",value:function(){return!1===this._visible?0:F(this._spec.height)?this._spec.height:this._isHorizontal?12:this.getLayoutRect().height}},{key:"_getAttrs",value:function(){var t,e,i,n,r,a;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:C(null===(e=this._spec)||void 0===e?void 0:e.delayType)?null!==(n=null===(i=this._spec)||void 0===i?void 0:i.delayTime)&&void 0!==n?n:30:0,realTime:null===(a=null===(r=this._spec)||void 0===r?void 0:r.realTime)||void 0===a||a},this._getComponentAttrs())}},{key:"_createOrUpdateComponent",value:function(){var t=this,e=this._getAttrs();if(this._component)this._component.setAttributes(e);else{var i=this.getContainer();this._component=new CM(e),this._component.addEventListener("scrollDrag",(function(e){var i=e.detail.value;t._handleChange(i[0],i[1])})),this._component.addEventListener("scrollUp",(function(e){var i=e.detail.value;t._handleChange(i[0],i[1])})),i.add(this._component)}}},{key:"_getComponentAttrs",value:function(){var t=this._spec,e=t.rail,i=t.slider,n=t.innerPadding,r={};return T(n)||(r.padding=n),Y(null==e?void 0:e.style)||(r.railStyle=pI(e.style)),Y(null==i?void 0:i.style)||(r.sliderStyle=pI(i.style)),r.disableTriggerEvent=this._option.disableTriggerEvent,r}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._component]}}])}(qq);eZ.type=d.scrollBar,eZ.builtInTheme={scrollBar:tZ},eZ.specKey="scrollBar";var iZ=function(t,e){var i=e.datum,n=e.title,r=e.content,a=[],o=i.call(null);return n.visible&&a.push({type:"title",index:0,datum:o,spec:n}),lt(r).forEach((function(t,e){t.visible&&a.push({type:"content",index:e,datum:o,spec:t})})),a},nZ=function(t,e){return{fontSize:{type:"token",key:t},fill:{type:"palette",key:e},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},rZ={title:{visible:!0,autoLimit:!1,autoFit:!1,style:nZ("l1FontSize","primaryFontColor")},content:{visible:!0,style:nZ("l2FontSize","tertiaryFontColor")}},aZ=function(e){function o(){var e;return n(this,o),(e=i(this,o,arguments)).type=d.indicator,e.name=d.indicator,e.specKey="indicator",e.layoutType="none",e.layoutZIndex=t.LayoutZIndex.Indicator,e.layoutLevel=t.LayoutLevel.Indicator,e._gap=0,e._activeDatum=null,e}return c(o,e),a(o,[{key:"created",value:function(){_(o,"created",this,3)([]),this.initData(),this.initEvent()}},{key:"setAttrFromSpec",value:function(){_(o,"setAttrFromSpec",this,3)([]),this._gap=this._spec.gap||0,this._title=this._spec.title,this._content=lt(this._spec.content),this._regions=this._option.getRegionsInUserIdOrIndex(lt(this._spec.regionId),lt(this._spec.regionIndex))}},{key:"initEvent",value:function(){var t=this;this._option.disableTriggerEvent||"none"!==this._spec.trigger&&("hover"===this._spec.trigger?(this.event.on("element-highlight:start",(function(e){var i=e.graphics[0];t.isRelativeModel(i)&&t.updateDatum(mI(i))})),this.event.on("element-highlight:reset",(function(e){t._activeDatum&&t.updateDatum(null)}))):(this.event.on("element-select:start",(function(e){var i=e.graphics[0];t.isRelativeModel(i)&&t.updateDatum(mI(i))})),this.event.on("element-select:reset",(function(e){t._activeDatum&&t.updateDatum(null)}))))}},{key:"updateDatum",value:function(t){this._activeDatum=t,this._displayData.updateData();var e=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(e)}},{key:"initData",value:function(){var t=this;EI(this._option.dataSet,"indicatorFilter",iZ);var e=new Xo(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")});e.transform({type:"indicatorFilter",options:{title:this._title,content:this._content,datum:function(){return t._activeDatum}}}),e.target.addListener("change",this.updateDatum.bind(this)),this._displayData=new ID(this._option,e)}},{key:"updateLayoutAttribute",value:function(){var t=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(t),_(o,"updateLayoutAttribute",this,3)([])}},{key:"_getIndicatorAttrs",value:function(){var t=this;if(!1===this._spec.visible||!1===this._spec.fixed&&null===this._activeDatum)return{visible:!1};var e=this._regions[0],i=e.getLayoutRect(),n=i.width,a=i.height,o=e.getLayoutStartPoint(),s=o.x,l=o.y,u=this._spec,c=u.content,h=u.offsetX,d=u.offsetY,v=u.limitRatio,f=u.title,p=r(u,["content","offsetX","offsetY","limitRatio","title"]),g=[];return lt(c).forEach((function(e){var i=nO({},t._theme.content,e);g.push({visible:!1!==i.visible&&(!i.field||null!==t._activeDatum),space:i.space||t._gap,autoLimit:i.autoLimit,autoFit:i.autoFit,fitPercent:i.fitPercent,fitStrategy:i.fitStrategy,style:Object.assign(Object.assign({},fI(it(i.style,["text"]),t._activeDatum)),{text:t._createText(i.field,i.style.text)})})})),Object.assign({visible:!0,size:{width:n,height:a},zIndex:this.layoutZIndex,x:s,y:l,dx:h?qL(h,this._computeLayoutRadius()):0,dy:d?qL(d,this._computeLayoutRadius()):0,limitRatio:v||1/0,title:{visible:!1!==f.visible&&(!C(f.field)||null!==this._activeDatum),space:f.space||this._gap,autoLimit:f.autoLimit,autoFit:f.autoFit,fitPercent:f.fitPercent,fitStrategy:f.fitStrategy,style:Object.assign(Object.assign({},fI(it(f.style,["text"]),this._activeDatum)),{text:this._createText(f.field,f.style.text)})},content:g},p)}},{key:"_createOrUpdateIndicatorComponent",value:function(t){var e=this;if(!1===t.visible)return this._indicatorComponent&&this._indicatorComponent.parent&&this._indicatorComponent.parent.removeChild(this._indicatorComponent),void(this._indicatorComponent=null);if(this._indicatorComponent)at(t,this._cacheAttrs)||this._indicatorComponent.setAttributes(t);else{var i=this.getContainer(),n=new DR(t);n.name="indicator",i.add(n),this._indicatorComponent=n,this._indicatorComponent.on("*",(function(t,i){return e._delegateEvent(e._indicatorComponent,t,i)}))}this._cacheAttrs=t}},{key:"_createText",value:function(t,e){var i;return t?this._activeDatum?this._activeDatum[t]:"":w(e)?null!==(i=e(this._activeDatum,void 0))&&void 0!==i?i:"":null!=e?e:""}},{key:"_computeLayoutRadius",value:function(){var t=this._regions[0].getLayoutRect(),e=t.width,i=t.height;return Math.min(e/2,i/2)}},{key:"isRelativeModel",value:function(t){return this._regions.some((function(e){return!!e.getSeriesInId(t.context.modelId)}))}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._indicatorComponent]}},{key:"clear",value:function(){this._cacheAttrs=null,_(o,"clear",this,3)([])}},{key:"getIndicatorComponent",value:function(){return this._indicatorComponent}}],[{key:"getSpecInfo",value:function(t){return yF(t,this.specKey,this.type,(function(t){return t&&!1!==t.visible}))}}])}(vz);aZ.type=d.indicator,aZ.builtInTheme={indicator:rZ},aZ.specKey="indicator";var oZ=["sum","average","min","max","variance","standardDeviation","median"];function sZ(t,e,i){if(!i)return!1;var n=t.map((function(t){return 1*t})),r=ht(n),a=ct(n);return e<r||e>a}function lZ(t,e,i,n,r,a){var o,s,l=n.relativeSeries;return F(t.x)&&sZ(e,t.x,i)&&(null===(s=null==l?void 0:(o=l.getXAxisHelper()).setExtendDomain)||void 0===s||s.call(o,"marker_xAxis_extend",t.x)),VL(t.x)?dZ(t.x,r)+a.x:vZ(l.getXAxisHelper(),[t.x])+a.x}function uZ(t,e,i,n,r,a){var o,s,l=n.relativeSeries;return F(t.y)&&sZ(e,t.y,i)&&(null===(s=null===(o=l.getYAxisHelper())||void 0===o?void 0:o.setExtendDomain)||void 0===s||s.call(o,"marker_yAxis_extend",t.y)),VL(t.y)?dZ(t.y,r)+a.y:vZ(l.getYAxisHelper(),[t.y])+a.y}function cZ(t,e,i,n){var r,a,o=n.relativeSeries;return F(t.angle)&&sZ(e,t.angle,i)&&(null===(a=null===(r=o.angleAxisHelper)||void 0===r?void 0:r.setExtendDomain)||void 0===a||a.call(r,"marker_angleAxis_extend",t.angle)),vZ(o.angleAxisHelper,[t.angle])}function hZ(t,e,i,n){var r,a,o=n.relativeSeries;return F(t.radius)&&sZ(e,t.radius,i)&&(null===(a=null===(r=o.radiusAxisHelper)||void 0===r?void 0:r.setExtendDomain)||void 0===a||a.call(r,"marker_radiusAxis_extend",t.radius)),vZ(o.radiusAxisHelper,[t.radius])}function dZ(t,e){return Number(t.substring(0,t.length-1))*e/100}function vZ(t,e){var i=t.getScale(0);return oE(i.type)&&i.domain()[0]===i.domain()[1]&&e[0]!==i.domain()[0]?NaN:t.dataToPosition(e)}function fZ(t){return oZ.includes(t)}function pZ(t,e,i,n,r){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=e.getRegion(),s=o.getLayoutStartPoint(),l=i.getRegion(),u=l.getLayoutStartPoint(),c=Math.abs(Math.min(s.x,u.x)-Math.max(s.x+o.getLayoutRect().width,u.x+l.getLayoutRect().width)),h=Math.abs(Math.min(s.y,u.y)-Math.max(s.y+o.getLayoutRect().height,u.y+l.getLayoutRect().height)),d={relativeSeries:n,startRelativeSeries:e,endRelativeSeries:i},v=[],f=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,p=n.getXAxisHelper(),g=n.getYAxisHelper(),y=p.getScale(0).domain(),m=g.getScale(0).domain(),_=a&&!p.isContinuous&&!!p.getBandwidth,b=a&&!g.isContinuous&&!!g.getBandwidth,k={min:null,max:null},x={min:null,max:null};return f.forEach((function(t){var e,i,n=C(t.x),a=C(t.y);if(n&&a)e=lZ(t,y,r,d,c,s),i=uZ(t,m,r,d,h,s),gZ(e,_,k,v.length),gZ(i,b,x,v.length),v.push([{x:e,y:i}]);else if(n){e=lZ(t,y,r,d,c,s),i=Math.max(s.y+o.getLayoutRect().height,u.y+l.getLayoutRect().height);var f=Math.min(s.y,u.y);gZ(e,_,k,v.length),v.push([{x:e,y:i},{x:e,y:f}])}else if(a){e=Math.min(s.x,u.x),i=uZ(t,m,r,d,h,s);var p=Math.max(s.x+o.getLayoutRect().width,u.x+l.getLayoutRect().width);gZ(i,b,x,v.length),v.push([{x:e,y:i},{x:p,y:i}])}})),function(t,e,i,n,r){if(n.min||n.max){var a=e.getBandwidth(0)*(1+e.getScale(0).paddingInner());n.min&&t[n.min.index].forEach((function(t){return t.x-=a/2})),n.max&&t[n.max.index].forEach((function(t){return t.x+=a/2}))}if(r.min||r.max){var o=i.getBandwidth(0)*(1+i.getScale(0).paddingInner());r.min&&t[r.min.index].forEach((function(t){return t.y-=o/2})),r.max&&t[r.max.index].forEach((function(t){return t.y+=o/2}))}}(v,p,g,k,x),v}function gZ(t,e,i,n){return e&&((null===i.min||i.min.value>t)&&(i.min={value:t,index:n}),(null===i.max||i.max.value<t)&&(i.max={value:t,index:n})),t}function yZ(t,e,i,n,r){var a={relativeSeries:n,startRelativeSeries:e,endRelativeSeries:i},o=[],s=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,l=n.angleAxisHelper.getScale(0).domain(),u=n.radiusAxisHelper.getScale(0).domain(),c=Math.min(n.getRegion().getLayoutRect().width/2,n.getRegion().getLayoutRect().height/2);return s.forEach((function(t){var e=C(t.angle),i=C(t.radius);if(e&&i){var n=cZ(t,l,r,a),s=hZ(t,u,r,a);o.push([{angle:n,radius:s}])}else if(e){var h=cZ(t,l,r,a);o.push([{angle:h,radius:-c},{angle:h,radius:c}])}else if(i){var d=hZ(t,u,r,a);o.push([{radius:d,angle:0},{radius:d,angle:2*Math.PI}])}})),o}function mZ(t,e,i,n){var r=[],a=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,o=O(n);return a.forEach((function(t,a){var s,l,u,c,h=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,d=h.getRegion(),v=d.getLayoutStartPoint(),f=d.getLayoutRect(),p=f.width,g=f.height,y=0,m=0;if(n){var _=o?n[a]:n,b=_.x,k=_.y;b&&(y=VL(b)?Number(b.substring(0,b.length-1))*p/100:b),k&&(m=VL(k)?Number(k.substring(0,k.length-1))*g/100:k)}var x=h.getXAxisHelper().getScale(0).domain(),S=h.getYAxisHelper().getScale(0).domain(),A=lt(t.x),M=lt(t.y);1===A.length&&F(A[0])&&sZ(x,A[0],i)&&(null===(l=null===(s=h.getXAxisHelper())||void 0===s?void 0:s.setExtendDomain)||void 0===l||l.call(s,"marker_xAxis_extend",A[0])),1===M.length&&F(M[0])&&sZ(S,M[0],i)&&(null===(c=null===(u=h.getYAxisHelper())||void 0===u?void 0:u.setExtendDomain)||void 0===c||c.call(u,"marker_yAxis_extend",M[0])),r.push({x:vZ(h.getXAxisHelper(),A)+v.x+y,y:vZ(h.getYAxisHelper(),M)+v.y+m})})),r}function _Z(t,e,i){var n=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((function(t){var r,a,o,s,l=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,u=l.angleAxisHelper.getScale(0).domain(),c=l.radiusAxisHelper.getScale(0).domain(),h=lt(t.angle),d=lt(t.radius);1===h.length&&F(h[0])&&sZ(u,h[0],i)&&(null===(a=null===(r=l.angleAxisHelper)||void 0===r?void 0:r.setExtendDomain)||void 0===a||a.call(r,"marker_xAxis_extend",h[0])),1===d.length&&F(d[0])&&sZ(c,d[0],i)&&(null===(s=null===(o=l.radiusAxisHelper)||void 0===o?void 0:o.setExtendDomain)||void 0===s||s.call(o,"marker_yAxis_extend",d[0])),n.push({angle:vZ(l.angleAxisHelper,h),radius:vZ(l.radiusAxisHelper,d)})})),n}function bZ(t,e,i){var n=t.x,r=t.y;return VL(n)&&(n=dZ(n,e)),VL(r)&&(r=dZ(r,i)),{x:n,y:r}}function kZ(t,e,i){var n;if(n=w(t)?lt(t(e.getData().getLatestData(),e)):lt(t),i){var r=e.getRegion(),a=r.getLayoutStartPoint(),o=a.x,s=a.y,l=r.getLayoutRect(),u=l.width,c=l.height;return n.map((function(t){var e=bZ(t,u,c),i=e.x,n=e.y;return{x:i+=o,y:n+=s}}))}var h=e.getOption().getChart().getViewRect(),d=h.width,v=h.height;return n.map((function(t){return bZ(t,d,v)}))}function xZ(t){var e=1/0,i=-1/0,n=1/0,r=-1/0;return t.forEach((function(t){var a=t.getLayoutStartPoint(),o=t.getLayoutRect();a.x<e&&(e=a.x),a.x+o.width>i&&(i=a.x+o.width),a.y<n&&(n=a.y),a.y+o.height>r&&(r=a.y+o.height)})),{minX:e,maxX:i,minY:n,maxY:r}}function SZ(t,e,i){var n=t.labelBackground,a=void 0===n?{}:n,o=t.style,s=t.shape,l=r(t,["labelBackground","style","shape"]);if(!1!==t.visible){var u=l;return(null==s?void 0:s.visible)?u.shape=Object.assign({visible:!0},pI(s.style)):u.shape={visible:!1},!1!==a.visible?(u.panel=Object.assign({visible:!0,customShape:a.customShape},MZ(pI(a.style),e,i)),C(a.padding)&&(u.padding=ki(a.padding))):(u.panel={visible:!1},u.padding=0),o&&(u.textStyle=MZ(pI(o),e,i)),u}return{visible:!1}}function AZ(t,e,i){for(var n in t)w(t[n])&&(t[n]=t[n](e,i));return t}function MZ(t,e,i){return w(t)?t(e,i):t}function wZ(t,e){return w(t)?t(e):t}function TZ(t,e,i){return C(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 CZ(t){return{isXProcess:C(t.x),isYProcess:C(t.y),isX1Process:C(t.x1),isY1Process:C(t.y1),isAngleProcess:C(t.angle),isRadiusProcess:C(t.radius),isAngle1Process:C(t.angle1),isRadius1Process:C(t.radius1),isCoordinatesProcess:C(t.coordinates),isValidProcess:C(t.process)}}function EZ(t){var e=CZ(t),i=e.isXProcess,n=e.isYProcess,r=e.isX1Process,a=e.isY1Process,o=e.isAngleProcess,s=e.isRadiusProcess,l=e.isAngle1Process,u=e.isRadius1Process,c=e.isCoordinatesProcess,h=e.isValidProcess;return{doXProcess:i&&!n&&!a,doXYY1Process:i&&n&&a,doYProcess:n&&!i&&!r,doYXX1Process:n&&i&&r,doXYProcess:i&&n&&r&&a,doAngleProcess:o&&!l&&!s&&!u,doRadiusProcess:s&&!u&&!o&&!l,doAngRadRad1Process:o&&!l&&s&&u,doRadAngAng1Process:s&&o&&l&&!u,doRadAngProcess:o&&s&&l&&u,doCoordinatesProcess:c&&(!h||"process"in t&&"xy"in t.process)}}function BZ(t){var e=CZ(t),i=e.isXProcess,n=e.isYProcess,r=e.isX1Process,a=e.isY1Process,o=e.isAngleProcess,s=e.isRadiusProcess,l=e.isAngle1Process,u=e.isRadius1Process;return{doXProcess:i&&r&&!n&&!a,doYProcess:n&&a&&!i&&!r,doXYProcess:i&&r&&n&&a,doAngleProcess:o&&l&&!s&&!u,doRadiusProcess:s&&u&&!o&&!l,doRadAngProcess:o&&s&&l&&u,doCoordinatesProcess:e.isCoordinatesProcess}}function PZ(t){return{doXYProcess:C(t.x)&&C(t.y),doPolarProcess:C(t.angle)&&C(t.radius),doGeoProcess:C(t.areaName)}}function RZ(t,e){var i;if(e.coordinates){var n,a,o=e,s=o.coordinates,l=o.coordinateType,u=o.getSeriesByIdOrIndex,c=r(o,["coordinates","coordinateType","getSeriesByIdOrIndex"]);if(w(s)){var h=e.getRelativeSeries();n=s(h.getData().getLatestData(),h)}else n=s;i=(n=lt(n)).map((function(t){var e=u(t.refRelativeSeriesId,t.refRelativeSeriesIndex);if("cartesian"===l){var i=e.getSpec(),n=i.xField,r=i.yField,o=t.xFieldDim,s=t.xFieldIndex,h=t.yFieldDim,d=t.yFieldIndex,v=n;C(s)&&(v=lt(n)[s]),o&&lt(n).includes(o)&&(v=o);var f=r;C(d)&&(f=lt(r)[d]),h&&lt(r).includes(h)&&(f=h),a=Object.assign({x:void 0,y:void 0},c),L(t[v])&&fZ(t[v])?a.x={field:v,aggrType:t[v]}:a.x=lt(v).map((function(e){return t[e]})),L(t[f])&&fZ(t[f])?a.y={field:f,aggrType:t[f]}:a.y=lt(f).map((function(e){return t[e]}))}else if("polar"===l){var p=e.getSpec(),g=p.valueField,y=p.categoryField,m=t.angleFieldDim,_=t.angleFieldIndex,b=y;C(_)&&(b=lt(y)[_]),m&&lt(y).includes(m)&&(b=m);var k=g;a=Object.assign({angle:void 0,radius:void 0},c),L(t[b])&&fZ(t[b])?a.angle={field:b,aggrType:t[b]}:a.angle=lt(b).map((function(e){return t[e]})),L(t[k])&&fZ(t[k])?a.radius={field:k,aggrType:t[k]}:a.radius=lt(k).map((function(e){return t[e]}))}return a.getRefRelativeSeries=function(){return e},a}))}else i=e;var d=[];return i.forEach((function(e){var i={x:null,y:null,angle:null,radius:null,areaName:null};if(C(e.x)){var n=e.x;O(n)?i.x=n.map((function(i){return OZ(i,t,e)})):i.x=OZ(n,t,e)}if(C(e.y)){var r=e.y;O(r)?i.y=r.map((function(i){return OZ(i,t,e)})):i.y=OZ(r,t,e)}if(C(e.angle)){var a=e.angle;O(a)?i.angle=a.map((function(i){return OZ(i,t,e)})):i.angle=OZ(a,t,e)}if(C(e.radius)){var o=e.radius;O(o)?i.radius=o.map((function(i){return OZ(i,t,e)})):i.radius=OZ(o,t,e)}if(C(e.areaName)){var s=e.areaName;i.areaName=OZ(s,t,e)}e.getRefRelativeSeries&&(i.getRefRelativeSeries=e.getRefRelativeSeries),d.push(i)})),d}var LZ={min:function(t,e){return lL(t[0].latestData,e.field)},max:function(t,e){return uL(t[0].latestData,e.field)},sum:function(t,e){return cL(t[0].latestData,e.field)},average:function(t,e){return hL(t[0].latestData,e.field)},variance:function(t,e){return dL(t[0].latestData,e.field)},standardDeviation:function(t,e){return function(t,e){return Math.sqrt(dL(t,e))}(t[0].latestData,e.field)},median:function(t,e){return function(t,e){return wt(t.map((function(t){return t[e]})))}(t[0].latestData,e.field)}};function OZ(t,e,i){var n=i.getRelativeSeries(),r=i.getStartRelativeSeries(),a=i.getEndRelativeSeries(),o=n.getData().getLatestData(),s=r.getData().getLatestData(),l=a.getData().getLatestData();if(w(t))return t(o,s,l,n,r,a);if(P(t)){var u=t.aggrType,c=t.field;return LZ[u](e,{field:c})}return t}function IZ(t,e){if(e&&e.getRelativeSeries){var i=e.getRelativeSeries();if(i){var n=i.getViewData();return n&&n.latestData&&n.latestData.length?t:[]}}return t}var DZ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).layoutType="none",t._layoutOffsetX=0,t._layoutOffsetY=0,t}return c(e,t),a(e,[{key:"getRelativeSeries",value:function(){return this._relativeSeries}},{key:"getMarkerData",value:function(){return this._markerData}},{key:"getMarkAttributeContext",value:function(){return this._markAttributeContext}},{key:"_buildMarkerAttributeContext",value:function(){this._markAttributeContext={relativeSeries:this._relativeSeries,startRelativeSeries:this._startRelativeSeries,endRelativeSeries:this._endRelativeSeries,vchart:this._option.globalInstance}}},{key:"created",value:function(){_(e,"created",this,3)([]),this._bindSeries(),this._initDataView(),this.initEvent(),this._buildMarkerAttributeContext()}},{key:"_getAllRelativeSeries",value:function(){var t=this;return{getRelativeSeries:function(){return t._relativeSeries},getStartRelativeSeries:function(){return t._startRelativeSeries},getEndRelativeSeries:function(){return t._endRelativeSeries}}}},{key:"_getFieldInfoFromSpec",value:function(t,e,i){var n={x:"xField",y:"yField",radius:"valueField",angle:"categoryField",areaName:"nameField"};return L(e)&&fZ(e)?{field:i.getSpec()[n[t]],aggrType:e}:e}},{key:"_processSpecByDims",value:function(t){var e=this,i=this._relativeSeries,n={};return t.forEach((function(t){return n[t.dim]=e._getFieldInfoFromSpec(t.dim,t.specValue,i)})),Object.assign(Object.assign({},n),this._getAllRelativeSeries())}},{key:"_processSpecCoo",value:function(t){var e=this;return Object.assign(Object.assign({coordinates:t.coordinates||t.coordinate},this._getAllRelativeSeries()),{getSeriesByIdOrIndex:function(t,i){return e._getSeriesByIdOrIndex(t,i)},coordinateType:this.coordinateType})}},{key:"_getRelativeDataView",value:function(){if(this._specifiedDataSeries){var t=[];lt(this._specifiedDataSeries).forEach((function(e){t=t.concat(e.getViewData().latestData)}));var e=new Yo;return e.registerParser("array",v),new Xo(e).parse(t,{type:"array"})}return this._relativeSeries.getViewData()}},{key:"updateLayoutAttribute",value:function(){var t,i,n,r=this;if(null===(t=this._spec.visible)||void 0===t||t){if(!this._markerComponent){var a=this._createMarkerComponent();a.name=null!==(i=this._spec.name)&&void 0!==i?i:this.type,a.id=null!==(n=this._spec.id)&&void 0!==n?n:"".concat(this.type,"-").concat(this.id),this._markerComponent=a,this.getContainer().add(this._markerComponent),this._markerComponent.on("*",(function(t,e){r._delegateEvent(r._markerComponent,t,e,null,r.getMarkerData.bind(r))}))}this._markerLayout()}_(e,"updateLayoutAttribute",this,3)([])}},{key:"_getSeriesByIdOrIndex",value:function(t,e){var i,n,r;return(r=null===(i=this._option.getSeriesInUserIdOrIndex(C(t)?[t]:[],[e]))||void 0===i?void 0:i[0])||(r=null!==(n=this._relativeSeries)&&void 0!==n?n:this._getFirstSeries()),r}},{key:"_bindSeries",value:function(){var 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))}},{key:"initEvent",value:function(){"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)))}},{key:"clear",value:function(){_(e,"clear",this,3)([]),this._firstSeries=null}},{key:"_getFirstSeries",value:function(){var t;if(this._firstSeries)return this._firstSeries;var e=kL(this._regions);return e?(this._firstSeries=e,e):(null===(t=this._option)||void 0===t||t.onError("need at least one series"),null)}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._markerComponent]}},{key:"onLayoutStart",value:function(t,i){T(this._spec.offsetX)||(this._layoutOffsetX=WL(this._spec.offsetX,i.width,i)),T(this._spec.offsetY)||(this._layoutOffsetY=WL(this._spec.offsetY,i.height,i)),_(e,"onLayoutStart",this,3)([t,i])}},{key:"_compareSpec",value:function(t,i){var n=_(e,"_compareSpec",this,3)([t,i]);return at(i,t)||(n.reRender=!0,n.reMake=!0,n.change=!0),n}},{key:"_initCommonDataView",value:function(){var t=this,e=this._computeOptions().options,i=this._getRelativeDataView();EI(this._option.dataSet,"markerAggregation",RZ),EI(this._option.dataSet,"markerFilter",IZ);var n=new Xo(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")});n.parse([i],{type:"dataview"}),n.transform({type:"markerAggregation",options:e}),n.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),n.target.on("change",(function(){t._markerLayout()})),this._markerData=n}}],[{key:"_getMarkerCoordinateType",value:function(t){return"cartesian"}},{key:"getSpecInfo",value:function(t){var e=this;return yF(t,this.specKey,this.type,(function(t){return!1!==t.visible&&e._getMarkerCoordinateType(t)===e.coordinateType}))}}])}(vz);function FZ(t,e){return function(t,e,i){var n=Qt(t,(function(t){return t[e]}),(function(t){return t[i]})),r=n.predict,a=lL(t,e),o=uL(t,e),l=r(a),u=r(o);return[s(s({},e,a),i,l),s(s({},e,o),i,u)]}(t[0].latestData,e.fieldX,e.fieldY)}var jZ=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).specKey="markLine",e.layoutZIndex=t.LayoutZIndex.MarkLine,e}return c(r,e),a(r,[{key:"_createMarkerComponent",value:function(){var t,e,i,n,r,a,o,s,l,u,c,h,d,v=this,f=this._spec,p=f.startSymbol,g=void 0===p?{}:p,y=f.endSymbol,m=void 0===y?{}:y,_=lt(null!==(t=this._spec.label)&&void 0!==t?t:{}),b={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===(n=this._spec.interactive)||void 0===n||n,points:[{x:0,y:0},{x:0,y:0}],center:{x:0,y:0},radius:0,startAngle:0,endAngle:0,lineStyle:MZ(pI(null===(r=this._spec.line)||void 0===r?void 0:r.style),this._markerData,this._markAttributeContext),clipInRange:null!==(a=this._spec.clip)&&void 0!==a&&a,label:_.map((function(t){return SZ(t,v._markerData,v._markAttributeContext)})),state:{line:AZ(null!==(s=null===(o=this._spec.line)||void 0===o?void 0:o.state)&&void 0!==s?s:{},this._markerData,this._markAttributeContext),lineStartSymbol:AZ(null!==(u=null===(l=this._spec.startSymbol)||void 0===l?void 0:l.state)&&void 0!==u?u:{},this._markerData,this._markAttributeContext),lineEndSymbol:AZ(null!==(h=null===(c=this._spec.endSymbol)||void 0===c?void 0:c.state)&&void 0!==h?h:{},this._markerData,this._markAttributeContext),label:_.map((function(t){var e;return AZ(null!==(e=t.state)&&void 0!==e?e:{},v._markerData,v._markAttributeContext)})),labelBackground:_.map((function(t){var e,i;return AZ(null!==(i=null===(e=t.labelBackground)||void 0===e?void 0:e.state)&&void 0!==i?i:{},v._markerData,v._markAttributeContext)}))},animation:null!==(d=this._spec.animation)&&void 0!==d&&d,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return g.visible?b.startSymbol=Object.assign(Object.assign({},g),{visible:!0,style:MZ(pI(g.style),this._markerData,this._markAttributeContext)}):b.startSymbol={visible:!1},m.visible?b.endSymbol=Object.assign(Object.assign({},m),{visible:!0,style:MZ(pI(m.style),this._markerData,this._markAttributeContext)}):b.endSymbol={visible:!1},this._newMarkLineComponent(b)}},{key:"_getUpdateMarkerAttrs",value:function(){var t,e,i,n=this._spec,r=this._markerData,a=this._startRelativeSeries,o=this._endRelativeSeries,s=this._relativeSeries,l=this._computePointsAttr(),u=s.getViewData().latestData,c=r.latestData[0]&&r.latestData[0].latestData?r.latestData[0].latestData:r.latestData;if(n.clip||lt(n.label).some((function(t){return null==t?void 0:t.confine}))){var h=xZ([a.getRegion(),o.getRegion(),s.getRegion()]),d=h.minX,v=h.maxX,f=h.minY;i={x:d,y:f,width:v-d,height:h.maxY-f}}var p=lt((null!==(e=null===(t=this._markerComponent)||void 0===t?void 0:t.attribute)&&void 0!==e?e:{}).label),g=lt(this._spec.label),y=p.map((function(t,e){var i=g[e]||{};return Object.assign(Object.assign({},t),{text:i.formatMethod?i.formatMethod(c,u):null==t?void 0:t.text})}));return Object.assign(Object.assign({},l),{label:y,limitRect:i,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}},{key:"_markerLayout",value:function(){var t,e=this._getUpdateMarkerAttrs();null===(t=this._markerComponent)||void 0===t||t.setAttributes(e)}},{key:"_initDataView",value:function(){var t=this,e=this._spec,i="coordinates"in e,n=EZ(e),r=n.doXProcess,a=n.doYProcess,o=n.doXYY1Process,s=n.doYXX1Process,l=n.doXYProcess,u=n.doAngleProcess,c=n.doRadiusProcess,h=n.doAngRadRad1Process,d=n.doRadAngAng1Process,v=n.doRadAngProcess;if(this._markerData=this._getRelativeDataView(),r||a||o||s||l||u||c||h||d||v||i){EI(this._option.dataSet,"markerAggregation",RZ),EI(this._option.dataSet,"markerRegression",FZ),EI(this._option.dataSet,"markerFilter",IZ);var f=this._computeOptions(),p=f.options,g=f.needAggr,y=f.needRegr,m=f.processData,_=new Xo(this._option.dataSet);_.parse([m],{type:"dataview"}),g&&_.transform({type:"markerAggregation",options:p}),y&&_.transform({type:"markerRegression",options:p}),_.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),_.target.on("change",(function(){t._markerLayout()})),this._markerData=_}}}],[{key:"_getMarkerCoordinateType",value:function(t){var e=EZ(t),i=e.doAngleProcess,n=e.doRadiusProcess,r=e.doAngRadRad1Process,a=e.doRadAngAng1Process,o=e.doRadAngProcess;return"polar"===t.coordinateType||i||n||r||a||o?"polar":"cartesian"}}])}(DZ);jZ.specKey="markLine";var zZ=function(t){return{visible:t,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}}},HZ={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},NZ={line:{style:{lineDash:[3,3],stroke:{type:"palette",key:"markLineStrokeColor"}}},startSymbol:zZ(!1),endSymbol:zZ(!0),label:HZ},VZ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=d.markLine,t.name=d.markLine,t.coordinateType="cartesian",t}return c(e,t),a(e,[{key:"_newMarkLineComponent",value:function(t){return new nR(t)}},{key:"_computePointsAttr",value:function(){var t,e=this._spec,i=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,o=C(e.coordinates),s=C(e.process),l=s&&C(e.process.x),u=s&&C(e.process.y),c=C(e.positions),h=null!==(t=e.autoRange)&&void 0!==t&&t,d=EZ(e),v=d.doXProcess,f=d.doYProcess,p=d.doXYY1Process,g=d.doYXX1Process,y=d.doXYProcess,m=d.doCoordinatesProcess,_=[];if(v||p||f||g||y||o&&l||o&&u){var b=pZ(i,n,r,a,h);_=1===b.length?b[0]:b.map((function(t){return t[0]}))}else m?_=mZ(i,a,h,e.coordinatesOffset):c&&(_=kZ(e.positions,a,e.regionRelative));return{points:_}}},{key:"_markerLayout",value:function(){var t,e,i,n,r,a=this._getUpdateMarkerAttrs();if("type-step"===this._spec.type){var o,s=this._startRelativeSeries,l=this._endRelativeSeries,u=this._spec.line||{},c=u.multiSegment,h=u.mainSegmentIndex,d=this._spec,v=d.connectDirection,f=d.expandDistance,p=void 0===f?0:f;if(VL(p)){var g=s.getRegion(),y=g.getLayoutStartPoint(),m=l.getRegion(),_=m.getLayoutStartPoint();if("bottom"===v||"top"===v){var b=Math.abs(Math.min(y.y,_.y)-Math.max(y.y+g.getLayoutRect().height,_.y+m.getLayoutRect().height));o=Number(p.substring(0,p.length-1))*b/100}else{var k=Math.abs(Math.min(y.x,_.x)-Math.max(y.x+g.getLayoutRect().width,_.x+m.getLayoutRect().width));o=Number(p.substring(0,p.length-1))*k/100}}else o=p;var x=a.points,S=a.limitRect;if(!x||x.length<2)return void(null===(t=this._markerComponent)||void 0===t||t.setAttributes(a));var A,M=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=[],a=t.y-e.y,o=t.x-e.x;switch(i){case"top":r.push(t),r.push({x:t.x,y:a>0?t.y-n-Math.abs(a):t.y-n}),r.push({x:e.x,y:a>0?e.y-n:e.y-n-Math.abs(a)}),r.push(e);break;case"bottom":r.push(t),r.push({x:t.x,y:a<0?t.y+n+Math.abs(a):t.y+n}),r.push({x:e.x,y:a<0?e.y+n:e.y+n+Math.abs(a)}),r.push(e);break;case"left":r.push(t),r.push({x:o>0?t.x-n-Math.abs(o):t.x-n,y:t.y}),r.push({x:o>0?e.x-n:e.x-n-Math.abs(o),y:e.y}),r.push(e);break;case"right":r.push(t),r.push({x:o>0?t.x+n:t.x+n+Math.abs(o),y:t.y}),r.push({x:o>0?e.x+n+Math.abs(o):e.x+n,y:e.y}),r.push(e)}return r}(x[0],x[1],v,o);A=c&&C(h)?{position:"middle",autoRotate:!1}:Object.assign({position:"start",autoRotate:!1},function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=t.y-e.y,a=t.x-e.x;return"bottom"===i?{dx:a>0?-a/2:Math.abs(a/2),dy:r>0?n:Math.abs(r)+n}:"top"===i?{dx:a>0?-Math.abs(a/2):+Math.abs(a/2),dy:r>0?-(Math.abs(r)+n):-n}:"left"===i?{dx:a>0?-a-n:-n,dy:r>0?-r/2:Math.abs(r/2)}:"right"===i?{dx:a>0?n:Math.abs(a)+n,dy:r>0?-r/2:Math.abs(r/2)}:{}}(x[0],x[1],v,o));var w=lt((null!==(i=null===(e=this._markerComponent)||void 0===e?void 0:e.attribute)&&void 0!==i?i:{}).label),T=lt(a.label),E=lt(this._spec.label);null===(n=this._markerComponent)||void 0===n||n.setAttributes({points:c?[[M[0],M[1]],[M[1],M[2]],[M[2],M[3]]]:M,label:T.map((function(t,e){var i,n,r,a,o=0,s=0,l=null!==(i=A.dx)&&void 0!==i?i:0,u=null!==(n=A.dy)&&void 0!==n?n:0,c=null!==(r=E[e])&&void 0!==r?r:E[0];return z(null==c?void 0:c.refX)&&(o+=c.refX),z(null==c?void 0:c.refY)&&(s+=c.refY),z(null==c?void 0:c.dx)&&(l+=c.dx),z(null==c?void 0:c.dy)&&(u+=c.dy),Object.assign(Object.assign(Object.assign({},t),A),{refX:o,refY:s,dx:l,dy:u,textStyle:Object.assign(Object.assign({},null===(a=w[e])||void 0===a?void 0:a.textStyle),{textAlign:"center",textBaseline:"middle"})})})),limitRect:S,multiSegment:c,mainSegmentIndex:h,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}else null===(r=this._markerComponent)||void 0===r||r.setAttributes(a)}},{key:"_computeOptions",value:function(){var t,e=this._getRelativeDataView(),i=!0,n=!1,r=this._spec,a=this._relativeSeries,o=EZ(r),s=o.doXProcess,l=o.doYProcess,u=o.doXYY1Process,c=o.doYXX1Process,h=o.doXYProcess,d=o.doCoordinatesProcess;if(h)t=[this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y}]),this._processSpecByDims([{dim:"x",specValue:r.x1},{dim:"y",specValue:r.y1}])];else if(s)t=[this._processSpecByDims([{dim:"x",specValue:r.x}])];else if(l)t=[this._processSpecByDims([{dim:"y",specValue:r.y}])];else if(u)t=[this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y}]),this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y1}])];else if(c)t=[this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y}]),this._processSpecByDims([{dim:"x",specValue:r.x1},{dim:"y",specValue:r.y}])];else if(d){if(t=this._processSpecCoo(r),i=!1,e=new Xo(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")}).parse([a.getViewData()],{type:"dataview"}).transform({type:"markerAggregation",options:t}),r.process&&C(r.process.x)&&(t=[this._processSpecByDims([{dim:"x",specValue:r.process.x}])],i=!0),r.process&&C(r.process.y)&&(t=t=[this._processSpecByDims([{dim:"y",specValue:r.process.y}])],i=!0),r.process&&C(r.process.xy)){var v=a.getSpec();t={fieldX:v.xField,fieldY:v.yField},n=!0}}else i=!1;return{options:t,needAggr:i,needRegr:n,processData:e}}}])}(jZ);VZ.type=d.markLine,VZ.coordinateType="cartesian",VZ.builtInTheme={markLine:NZ};var UZ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=d.polarMarkLine,t.name=d.polarMarkLine,t.coordinateType="polar",t}return c(e,t),a(e,[{key:"_newMarkLineComponent",value:function(t){var e=EZ(this._spec),i=e.doRadiusProcess,n=e.doRadAngAng1Process;return i||n?new oR(t):new nR(t)}},{key:"_computePointsAttr",value:function(){var t,e=this._spec,i=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,o=null!==(t=e.autoRange)&&void 0!==t&&t,s=EZ(e),l=s.doAngleProcess,u=s.doRadiusProcess,c=s.doAngRadRad1Process,h=s.doRadAngAng1Process,d=s.doRadAngProcess,v=s.doCoordinatesProcess,f=[],p={},g={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(l||u||c||h||d){var y=yZ(i,n,r,a,o);f=1===y.length?y[0]:y.map((function(t){return t[0]})),p=f[0].radius===f[1].radius?{radius:f[0].radius,startAngle:f[0].angle,endAngle:f[1].angle,center:g}:{points:f.map((function(t){return we(g,t.radius,t.angle)}))}}else v&&(p={points:(f=_Z(i,a,o)).map((function(t){return we(g,t.radius,t.angle)}))});return p}},{key:"_computeOptions",value:function(){var t,e=this._spec,i=EZ(e),n=i.doAngleProcess,r=i.doRadiusProcess,a=i.doAngRadRad1Process,o=i.doRadAngAng1Process,s=i.doRadAngProcess,l=i.doCoordinatesProcess,u=this._getRelativeDataView();return s?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius1}])]:n?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle}])]:r?t=[this._processSpecByDims([{dim:"radius",specValue:e.radius}])]:a?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius1}])]:o?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius}])]:l&&(t=this._processSpecCoo(e)),{options:t,needAggr:!0,needRegr:!1,processData:u}}}])}(jZ);UZ.type=d.polarMarkLine,UZ.coordinateType="polar",UZ.builtInTheme={polarMarkLine:NZ};var WZ=function(e){function r(e,a){var o;return n(this,r),(o=i(this,r,[e,a])).type=d.title,o.specKey=d.title,o.layoutType="normal",o.layoutZIndex=t.LayoutZIndex.Title,o.layoutLevel=t.LayoutLevel.Title,o._orient="top",o._orient=NL(e.orient)?e.orient:"top",o}return c(r,e),a(r,[{key:"orient",get:function(){return this._orient}},{key:"initLayout",value:function(){_(r,"initLayout",this,3)([]),this._layout&&(this._layout.layoutOrient=this._orient)}},{key:"_compareSpec",value:function(t,e){var i=_(r,"_compareSpec",this,3)([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}},{key:"afterSetLayoutStartPoint",value:function(t){z(t.x)&&this._titleComponent&&this._titleComponent.setAttribute("x",t.x),z(t.y)&&this._titleComponent&&this._titleComponent.setAttribute("y",t.y),_(r,"afterSetLayoutStartPoint",this,3)([t])}},{key:"getBoundsInRect",value:function(t){var e={};this.setLayoutRect(t);var i=this._getTitleAttrs();this._createOrUpdateTitleComponent(i),e=this._getTitleLayoutRect();var n=this.getLayoutStartPoint(),r=n.x,a=n.y;return{x1:r,y1:a,x2:r+e.width,y2:a+e.height}}},{key:"_getTitleLayoutRect",value:function(){var t=this._titleComponent.AABBBounds;return{width:this._spec.width?this._spec.width:z(t.width())?t.width():0,height:this._spec.height?this._spec.height:z(t.height())?t.height():0}}},{key:"_getTitleAttrs",value:function(){var t,e,i,n,r,a,o,s;if(!1===this._spec.visible)return{visible:!1};var l=this.getLayoutRect(),u=WL(this._spec.width,l.width,null,l.width),c=WL(this._spec.maxWidth,l.width,null,l.width),h=Math.max(Math.min(u,c,l.width),0),d=Object.assign(Object.assign({},it(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!==(n=this._spec.subtext)&&void 0!==n?n:"",x:null!==(r=this._spec.x)&&void 0!==r?r:0,y:null!==(a=this._spec.y)&&void 0!==a?a:0,height:this._spec.height,minWidth:this._spec.minWidth,maxWidth:h,minHeight:this._spec.minHeight,maxHeight:this._spec.maxHeight,padding:this._spec.innerPadding,align:null!==(o=this._spec.align)&&void 0!==o?o:"left",verticalAlign:null!==(s=this._spec.verticalAlign)&&void 0!==s?s:"top",textStyle:Object.assign({width:h,maxLineWidth:h},this._spec.textStyle),subtextStyle:Object.assign({maxLineWidth:h},this._spec.subtextStyle)});return C(this._spec.width)&&(d.textStyle.width=Math.max(u,l.width),d.subtextStyle.width=d.textStyle.width),d}},{key:"_createOrUpdateTitleComponent",value:function(t){var e=this;if(this._titleComponent)at(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{var i=this.getContainer(),n=new RR(t);n.name="title",i.add(n),this._titleComponent=n,n.on("*",(function(t,i){return e._delegateEvent(n,t,i)}))}return this._cacheAttrs=t,this._titleComponent}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._titleComponent]}},{key:"clear",value:function(){_(r,"clear",this,3)([]),this._cacheAttrs=null}}],[{key:"getSpecInfo",value:function(t){return yF(t,this.specKey,d.title,(function(t){return!1!==t.visible}))}}])}(vz);WZ.type=d.title,WZ.specKey=d.title,WZ.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"}}}};var GZ=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).specKey="markArea",e.layoutZIndex=t.LayoutZIndex.MarkArea,e}return c(r,e),a(r,[{key:"_createMarkerComponent",value:function(){var t,e,i,n,r,a,o,s,l=this,u=lt(null!==(t=this._spec.label)&&void 0!==t?t:{}),c={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===(n=this._spec.interactive)||void 0===n||n,points:[{x:0,y:0}],center:{x:0,y:0},innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,areaStyle:MZ(pI(null===(r=this._spec.area)||void 0===r?void 0:r.style),this._markerData,this._markAttributeContext),clipInRange:null!==(a=this._spec.clip)&&void 0!==a&&a,label:u.map((function(t){return SZ(t,l._markerData,l._markAttributeContext)})),state:{area:AZ(null===(o=this._spec.area)||void 0===o?void 0:o.state,this._markerData,this._markAttributeContext),label:u.map((function(t){return AZ(t.state,l._markerData,l._markAttributeContext)})),labelBackground:u.map((function(t){var e;return AZ(null===(e=t.labelBackground)||void 0===e?void 0:e.state,l._markerData,l._markAttributeContext)}))},animation:null!==(s=this._spec.animation)&&void 0!==s&&s,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return this._newMarkAreaComponent(c)}},{key:"_markerLayout",value:function(){var t,e,i=this._spec,n=this._markerData,r=this._startRelativeSeries,a=this._endRelativeSeries,o=this._relativeSeries,s=this._computePointsAttr(),l=this._getRelativeDataView().latestData,u=n?n.latestData[0]&&n.latestData[0].latestData?n.latestData[0].latestData:n.latestData:l;if(i.clip||lt(i.label).some((function(t){return null==t?void 0:t.confine}))){var c=xZ([r.getRegion(),a.getRegion(),o.getRegion()]),h=c.minX,d=c.maxX,v=c.minY;e={x:h,y:v,width:d-h,height:c.maxY-v}}if(this._markerComponent){var f=lt(null===(t=this._markerComponent.attribute)||void 0===t?void 0:t.label),p=lt(this._spec.label);this._markerComponent.setAttributes(Object.assign(Object.assign({},s),{label:f.map((function(t,e){var i=p[e]||{};return Object.assign(Object.assign({},t),{text:i.formatMethod?i.formatMethod(u,l):null==t?void 0:t.text})})),limitRect:e,dx:this._layoutOffsetX,dy:this._layoutOffsetY}))}}},{key:"_initDataView",value:function(){var t=BZ(this._spec),e=t.doXProcess,i=t.doYProcess,n=t.doXYProcess,r=t.doAngleProcess,a=t.doRadiusProcess,o=t.doRadAngProcess,s=t.doCoordinatesProcess;if(!(e||i||n||r||a||o||s))return null;this._initCommonDataView()}}],[{key:"_getMarkerCoordinateType",value:function(t){var e=BZ(t),i=e.doAngleProcess,n=e.doRadiusProcess,r=e.doRadAngProcess;return"polar"===t.coordinateType||i||n||r?"polar":"cartesian"}}])}(DZ);GZ.specKey="markArea";var YZ={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"}}}}},XZ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=d.markArea,t.name=d.markArea,t.coordinateType="cartesian",t}return c(e,t),a(e,[{key:"_newMarkAreaComponent",value:function(t){return new aR(t)}},{key:"_computePointsAttr",value:function(){var t,e,i=this._spec,n=this._markerData,r=this._startRelativeSeries,a=this._endRelativeSeries,o=this._relativeSeries,s=BZ(i),l=s.doXProcess,u=s.doYProcess,c=s.doXYProcess,h=s.doCoordinatesProcess,d=C(i.positions),v=null!==(t=i.autoRange)&&void 0!==t&&t,f=null!==(e=i.includeFullBand)&&void 0!==e&&e,p=[];if(c){var g=m(pZ(n,r,a,o,v,f),2),y=g[0],_=g[1];y&&y.length&&_&&_.length&&(p=[{x:y[0].x,y:_[0].y},y[0],{x:_[0].x,y:y[0].y},_[0]])}else if(l||u){var k=m(pZ(n,r,a,o,v,f),2),x=k[0],S=k[1];x&&x.length&&S&&S.length&&(p=[].concat(b(x),[S[1],S[0]]))}else h?p=mZ(n,o,v,i.coordinatesOffset):d&&(p=kZ(i.positions,o,i.regionRelative));return{points:p}}},{key:"_computeOptions",value:function(){var t,e=this._spec,i=BZ(e),n=i.doXProcess,r=i.doYProcess,a=i.doXYProcess,o=i.doCoordinatesProcess;return a?t=[this._processSpecByDims([{dim:"x",specValue:e.x},{dim:"y",specValue:e.y}]),this._processSpecByDims([{dim:"x",specValue:e.x1},{dim:"y",specValue:e.y1}])]:n?t=[this._processSpecByDims([{dim:"x",specValue:e.x}]),this._processSpecByDims([{dim:"x",specValue:e.x1}])]:r?t=[this._processSpecByDims([{dim:"y",specValue:e.y}]),this._processSpecByDims([{dim:"y",specValue:e.y1}])]:o&&(t=this._processSpecCoo(e)),{options:t}}}])}(GZ);XZ.type=d.markArea,XZ.coordinateType="cartesian",XZ.builtInTheme={markArea:YZ};var KZ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=d.polarMarkArea,t.name=d.polarMarkArea,t.coordinateType="polar",t}return c(e,t),a(e,[{key:"_newMarkAreaComponent",value:function(t){var e=BZ(this._spec),i=e.doRadiusProcess,n=e.doAngleProcess,r=e.doRadAngProcess;return n||i||r?new sR(t):new aR(t)}},{key:"_computePointsAttr",value:function(){var t,e=this._spec,i=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,o=BZ(e),s=o.doAngleProcess,l=o.doRadiusProcess,u=o.doRadAngProcess,c=o.doCoordinatesProcess,h=null!==(t=e.autoRange)&&void 0!==t&&t,d={},v={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(s||l||u){var f=yZ(i,n,r,a,h);u?d={innerRadius:f[0][0].radius,outerRadius:f[1][0].radius,startAngle:f[0][0].angle,endAngle:f[1][0].angle,center:v}:s?d={innerRadius:0,outerRadius:Math.abs(f[0][0].radius),startAngle:f[0][1].angle,endAngle:f[1][1].angle,center:v}:l&&(d={innerRadius:f[0][0].radius,outerRadius:f[1][0].radius,startAngle:f[0][0].angle,endAngle:f[1][1].angle,center:v})}else c&&(d={points:_Z(i,a,h).map((function(t){return we(v,t.radius,t.angle)}))});return d}},{key:"_computeOptions",value:function(){var t,e=this._spec,i=BZ(e),n=i.doAngleProcess,r=i.doRadiusProcess,a=i.doRadAngProcess,o=i.doCoordinatesProcess;return a?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius1}])]:n?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius}])]:r?t=[this._processSpecByDims([{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"radius",specValue:e.radius1}])]:o&&(t=this._processSpecCoo(e)),{options:t}}}])}(GZ);KZ.type=d.polarMarkArea,KZ.coordinateType="polar",KZ.builtInTheme={polarMarkArea:YZ};var qZ=function(t){return pI(Object.assign({},t))},ZZ=function(t){return Object.assign(Object.assign({},t),{style:Object.assign({},pI(t.style))})},JZ=function(t){var e,i,n,r,a,o,s,l,u,c,h,d,v,f,p,g,y=qZ(null!==(i=null===(e=null==t?void 0:t.slider)||void 0===e?void 0:e.trackStyle)&&void 0!==i?i:{}),m=qZ(null!==(r=null===(n=null==t?void 0:t.slider)||void 0===n?void 0:n.railStyle)&&void 0!==r?r:{}),_=(g=null!==(o=null===(a=null==t?void 0:t.slider)||void 0===a?void 0:a.handlerStyle)&&void 0!==o?o:{},pI(Object.assign({},g))),b=ZZ(null!==(l=null===(s=null==t?void 0:t.controller)||void 0===s?void 0:s.start)&&void 0!==l?l:{}),k=ZZ(null!==(c=null===(u=null==t?void 0:t.controller)||void 0===u?void 0:u.pause)&&void 0!==c?c:{}),x=ZZ(null!==(d=null===(h=null==t?void 0:t.controller)||void 0===h?void 0:h.backward)&&void 0!==d?d:{}),S=ZZ(null!==(f=null===(v=null==t?void 0:t.controller)||void 0===v?void 0:v.forward)&&void 0!==f?f:{}),A=Object.assign(Object.assign({},t),{direction:t.direction,interval:t.interval,visible:t.visible,orient:null!==(p=t.orient)&&void 0!==p?p:"bottom",slider:Object.assign(Object.assign({},t.slider),{trackStyle:y,railStyle:m,handlerStyle:_}),controller:Object.assign(Object.assign({},t.controller),{start:b,pause:k,backward:x,forward:S})});return t.visible||(A.controller.visible=!1,A.slider.visible=!1),A},QZ=function(t){return"left"===t||"right"===t},$Z=function(t){return"top"===t||"bottom"===t},tJ={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}}}},eJ=function(r){function o(){var r;return n(this,o),(r=i(this,o,arguments)).layoutZIndex=t.LayoutZIndex.Player,r.layoutLevel=t.LayoutLevel.Player,r.specKey="player",r.type=d.player,r._orient="bottom",r._getPlayerAttrs=function(){var t,e,i,n,a,o,s,l,u=r._spec.type,c={size:{width:r._width,height:r._height},dx:null!==(t=r._spec.dx)&&void 0!==t?t:0+r._dx,dy:null!==(e=r._spec.dy)&&void 0!==e?e:0+r._dy};return"discrete"===u?Object.assign(Object.assign(Object.assign({},(s=r._spec,l=r._specs,Object.assign(Object.assign({},JZ(s)),{data:l,type:"discrete"}))),c),{disableTriggerEvent:r._option.disableTriggerEvent,loop:null===(n=null===(i=r._spec)||void 0===i?void 0:i.loop)||void 0===n||n}):Object.assign(Object.assign(Object.assign({},function(t,e){return Object.assign(Object.assign({},JZ(t)),{data:e,type:"continuous"})}(r._spec,r._specs)),c),{disableTriggerEvent:r._option.disableTriggerEvent,loop:null===(o=null===(a=r._spec)||void 0===a?void 0:a.loop)||void 0===o||o})},r._createOrUpdatePlayerComponent=function(){var t=Object.assign({},r._getPlayerAttrs()),e=r.getContainer();r._playerComponent?at(t,r._cacheAttrs)||(r._cacheAttrs=t,r._playerComponent.setAttributes(t),r._playerComponent._initAttributes(),r._playerComponent.render()):("discrete"===t.type?r._playerComponent=new qR(t):r._playerComponent=new JR(t),r._cacheAttrs=t,r._playerComponent.name="player",e.add(r._playerComponent),r._initEvent())},r._maxSize=function(){var t,e,i,n,a,o,s,l,u;return Math.max.apply(Math,b(lt(null===(e=null===(t=r._spec.controller.start)||void 0===t?void 0:t.style)||void 0===e?void 0:e.size)).concat(b(lt(null===(n=null===(i=r._spec.controller.pause)||void 0===i?void 0:i.style)||void 0===n?void 0:n.size)),b(lt(null===(o=null===(a=r._spec.controller.backward)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size)),b(lt(null===(l=null===(s=r._spec.controller.forward)||void 0===s?void 0:s.style)||void 0===l?void 0:l.size)),[null!==(u=QZ(r._orient)?r._spec.slider.railStyle.width:r._spec.slider.railStyle.height)&&void 0!==u?u:10]))},r._sliderExceededSize=function(){var t,e,i,n,a,o,s,l,u,c=null!==(t=QZ(r._orient)?r._spec.slider.railStyle.width:r._spec.slider.railStyle.height)&&void 0!==t?t:10,h=Math.max.apply(Math,b(lt(null===(i=null===(e=r._spec.controller.start)||void 0===e?void 0:e.style)||void 0===i?void 0:i.size)).concat(b(lt(null===(a=null===(n=r._spec.controller.pause)||void 0===n?void 0:n.style)||void 0===a?void 0:a.size)),b(lt(null===(s=null===(o=r._spec.controller.backward)||void 0===o?void 0:o.style)||void 0===s?void 0:s.size)),b(lt(null===(u=null===(l=r._spec.controller.forward)||void 0===l?void 0:l.style)||void 0===u?void 0:u.size))));return c>=h?c-h:0},r._initEvent=function(){r._option.disableTriggerEvent||(r._option.globalInstance.on(t.ChartEvent.rendered,(function(){var t;(null===(t=r._spec)||void 0===t?void 0:t.auto)&&(r._playerComponent.pause(),r._playerComponent.play())})),r._playerComponent.addEventListener(HR.end,(function(){var i;r.event.emit(t.ChartEvent.playerEnd,{model:e(r)}),r._alternate&&"discrete"===r._spec.type&&(r._direction="default"===r._direction?"reverse":"default",r._playerComponent.setAttributes({direction:r._direction,dataIndex:"reverse"===r._direction?r._specs.length-2:1})),(null===(i=r._spec)||void 0===i?void 0:i.loop)&&r._playerComponent.play()})),r._playerComponent.addEventListener(HR.change,(function(t){var e=t.detail.index;r.changePlayerIndex(e)})),r._playerComponent.addEventListener(HR.backward,(function(i){var n=i.detail.index,a=r._specs[n];r.event.emit(t.ChartEvent.playerBackward,{model:e(r),value:{spec:a,index:n,specs:r._specs}})})),r._playerComponent.addEventListener(HR.forward,(function(i){var n=i.detail.index,a=r._specs[n];r.event.emit(t.ChartEvent.playerForward,{model:e(r),value:{spec:a,index:n,specs:r._specs}})})),r._playerComponent.addEventListener(HR.play,(function(i){var n=i.detail.index,a=r._specs[n];r.event.emit(t.ChartEvent.playerPlay,{model:e(r),value:{spec:a,index:n,specs:r._specs}})})),r._playerComponent.addEventListener(HR.pause,(function(i){var n=i.detail.index,a=r._specs[n];r.event.emit(t.ChartEvent.playerPause,{model:e(r),value:{spec:a,index:n,specs:r._specs}})})))},r}return c(o,r),a(o,[{key:"orient",get:function(){return this._orient}},{key:"layoutOrient",set:function(t){this._orient=t}},{key:"setAttrFromSpec",value:function(){var t,e,i,n,r,a,s,l;_(o,"setAttrFromSpec",this,3)([]),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!==(n=this._spec.alternate)&&void 0!==n&&n,this._dx=null!==(r=this._spec.dx)&&void 0!==r?r:0,this._dy=null!==(a=this._spec.dy)&&void 0!==a?a:0,this._position=null!==(s=this._spec.position)&&void 0!==s?s:"middle",this._visible=null===(l=this._spec.visible)||void 0===l||l}},{key:"afterSetLayoutStartPoint",value:function(t){if(_(o,"afterSetLayoutStartPoint",this,3)([t]),z(t.x)){var e=QZ(this._orient)?t.x+this._sliderExceededSize()/2:t.x;this._playerComponent&&this._playerComponent.setAttribute("x",e)}if(z(t.y)){var i=$Z(this._orient)?t.y+this._sliderExceededSize()/2:t.y;this._playerComponent&&this._playerComponent.setAttribute("y",i)}}},{key:"getBoundsInRect",value:function(t,e){this._width=this._computeWidth(t),this._height=this._computeHeight(t),this._dx=this._computeDx(e),this._dy=this._computeDy(e);var i=this._computeLayoutRect(t,this._width,this._height);return this._createOrUpdatePlayerComponent(),i}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._playerComponent]}},{key:"_computeLayoutRect",value:function(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}}}},{key:"_computeWidth",value:function(t){return F(this._spec.width)?Math.min(t.width,Number(this._spec.width)):QZ(this._orient)?this._maxSize():t.width}},{key:"_computeHeight",value:function(t){return F(this._spec.height)?(this._height=this._spec.height,Math.min(t.height,Number(this._spec.height))):$Z(this._orient)?this._maxSize():t.height}},{key:"_computeDx",value:function(t){return QZ(this._orient)||"start"===this._position?0:"middle"===this._position?(t.width-this._width)/2:t.width-this._width}},{key:"_computeDy",value:function(t){return $Z(this._orient)||"start"===this._position?0:"middle"===this._position?(t.height-this._height)/2:t.height-this._height}},{key:"changePlayerIndex",value:function(e){var 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}})}}])}(vz);eJ.builtInTheme={player:tJ},eJ.specKey="player",eJ.type=d.player;var iJ=function(e){function r(e,a){var o;return n(this,r),(o=i(this,r,[e,a])).type=d.label,o.name=d.label,o.layoutType="none",o.layoutZIndex=t.LayoutZIndex.Label,o._regions=a.getRegionsInIndex(a.regionIndexes),o}return c(r,e),a(r,[{key:"_interactiveConfig",value:function(t){var e=t.interactive,i={hover:!1,select:!1,state:t.state};if(!0!==e)return i;var n=this._option.getChart().getSpec(),r=n.hover,a=n.select;return!1===r&&!1===r.enable||(i.hover=!0),!1===a&&!1===a.enable||(i.select=!0),i}},{key:"_compareSpec",value:function(t,e){var i=_(r,"_compareSpec",this,3)([t,e]);return i.reRender=!0,at(e,t)||(i.reMake=!0),i}},{key:"_getDataLabelType",value:function(t,e){var 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():""}},{key:"_setTransformOfComponent",value:function(t,e){var i=this;t.setAttributeTransform((function(t){var n=t.labelStyle,r=t.size,a=t.itemEncoder,o=r(),s=BL({type:"palette",key:"secondaryFontColor"},i.getColorScheme());return{dataLabels:lt(e).map((function(t,e){var r=n(e),l=[],u=t.getGraphics();if(u)return r.data&&r.data.length?r.data.forEach((function(t,i){if(u[i]){var n=a(t,{labelIndex:e});T(n.fill)&&(n.fill=s),T(n.data)&&(n.data=t),l.push(n)}})):u.forEach((function(t){var i=t.context,n=i.data;i.diffState!==iD.exit&&n.forEach((function(t,i){!function(t){if(null==t)throw new TypeError("Cannot destructure "+t)}(i);var n=a(t,{labelIndex:e});T(n.fill)&&(n.fill=s),T(n.data)&&(n.data=t),l.push(n)}))})),P(r.overlap)&&T(r.overlap.size)&&(r.overlap.size=Object.assign({},o)),Object.assign(Object.assign({smartInvert:!1,baseMarkGroupName:t.getProductId(),getBaseMarks:function(){return u}},r),{type:i._getDataLabelType(t,r.type),data:l})})),size:o}}))}},{key:"getVRenderComponents",value:function(){var t=[];return this.getMarks().forEach((function(e){var i=e.getComponent();i&&t.push(i)})),t}},{key:"clear",value:function(){_(r,"clear",this,3)([]),this.getMarks().forEach((function(t){t&&t.clearComponent()}))}}])}(vz);iJ.type=d.label;var nJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).skipEncode=!1,t}return c(e,t),a(e,[{key:"getRule",value:function(){return this._rule}},{key:"setRule",value:function(t){this._rule=t}},{key:"getTarget",value:function(){return this._target}},{key:"setTarget",value:function(t){this._target=t,this._rule||this.setRule(t.type)}},{key:"getComponent",value:function(){return this._component}},{key:"setComponent",value:function(t){this._component=t}},{key:"render",value:function(){}}])}(WV);nJ.type="text",nJ.constructorType="label";var rJ=function(){GV(),rO.registerMark(nJ.constructorType,nJ)},aJ=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_initTheme",value:function(t,e){return{spec:t,theme:this._theme}}}])}(dz),oJ=function(e){function r(e,a){var o;return n(this,r),(o=i(this,r,[e,a])).type=d.label,o.name=d.label,o.specKey="label",o.transformerConstructor=aJ,o.layoutZIndex=t.LayoutZIndex.Label,o._layoutRule=e.labelLayout||"series",o}return c(r,e),a(r,[{key:"init",value:function(t){_(r,"init",this,3)([t]),this.initEvent(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}},{key:"reInit",value:function(t){_(r,"reInit",this,3)([t]),this._labelInfoMap&&(this._labelInfoMap.forEach((function(t){t.forEach((function(t){t.labelMark.release()}))})),this._labelInfoMap.clear()),this._labelInfoMap&&this._labelInfoMap.clear(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}},{key:"initEvent",value:function(){var e=this;this.event.on(t.ChartEvent.dataZoomChange,(function(){e._labelComponentMap.forEach((function(t,e){var i=e.getComponent();i&&i.disableAnimation()})),e.event.on(gI.AFTER_MARK_RENDER_END,i)}));var i=function(){e._labelComponentMap.forEach((function(t,e){var i=e.getComponent();i&&i.enableAnimation()})),e.event.off(gI.AFTER_MARK_RENDER_END,i)}}},{key:"_initTextMark",value:function(){var t=this;this._labelInfoMap||(this._labelInfoMap=new Map),this._labelComponentMap||(this._labelComponentMap=new Map),gL(this._regions,(function(e){var i=e.getSpecInfo().markLabelSpec,n=void 0===i?{}:i,r=Object.keys(n),a=e.getRegion();t._labelInfoMap.get(a)||t._labelInfoMap.set(a,[]);for(var o=function(){var i=r[s],o=e.getMarkInName(i);o&&n[i].forEach((function(n,r){var s,l,u;if(n.visible){var c=t._labelInfoMap.get(a),h=t._createMark({type:"label",name:"".concat(null!==(s=e.userId)&&void 0!==s?s:e.id,"-").concat(i,"-label-").concat(r)},{attributeContext:e.getMarkAttributeContext()});n.showRelatedMarkTooltip&&(null===(u=null===(l=e.tooltipHelper)||void 0===l?void 0:l.activeTriggerSet.mark)||void 0===u||u.add(h)),h.setTarget(o),c.push({labelMark:h,baseMark:o,series:e,labelSpec:n})}}))},s=0;s<r.length;s++)o()}))}},{key:"_initLabelComponent",value:function(){var t=this,e={};this._labelComponentMap.forEach((function(t,i){e[i.name]=i})),this._labelInfoMap.forEach((function(i,n){if("region"===t._layoutRule){var r=!1,a="".concat(n.getGroupMark().name,"-label-component"),o=e[a];o||(r=!0,o=t._createMark({type:"component",name:a},{componentType:"label"},{support3d:t._spec.support3d})),o&&(r&&(o.setSkipBeforeLayouted(!0),t._marks.addMark(o),i.forEach((function(t){var e;null===(e=t.baseMark.getData())||void 0===e||e.addRelatedMark(o)}))),i[0]&&C(i[0].labelSpec.zIndex)&&o.setMarkConfig({zIndex:i[0].labelSpec.zIndex}),t._labelComponentMap.set(o,(function(){return t._labelInfoMap.get(n)})),e[a]=null)}else i.forEach((function(i,r){var a,o=!1,s="".concat(i.labelMark.name,"-component"),l=e[s];l||(o=!0,l=t._createMark({type:"component",name:s},{componentType:"label",noSeparateStyle:!0},{support3d:i.baseMark.getMarkConfig().support3d})),l&&(C(i.labelSpec.zIndex)&&l.setMarkConfig({zIndex:i.labelSpec.zIndex}),o&&(l.setSkipBeforeLayouted(!0),t._marks.addMark(l),null===(a=i.baseMark.getData())||void 0===a||a.addRelatedMark(l)),t._labelComponentMap.set(l,(function(){return t._labelInfoMap.get(n)[r]})),e[s]=null)}))})),Object.keys(e).forEach((function(i){var n=e[i];n&&(n.release(),t._labelComponentMap.delete(n))}))}},{key:"_initTextMarkStyle",value:function(){var e=this;this._labelComponentMap.forEach((function(t,e){lt(t()).forEach((function(t){t.labelMark.setComponent(e)}))})),this._labelInfoMap.forEach((function(i){i.forEach((function(i){var n,r,a=i.labelMark,o=i.labelSpec,s=i.series;if(e.initMarkStyleWithSpec(a,o),w(null==o?void 0:o.getStyleHandler)){var l=o.getStyleHandler(s);null==l||l.call(s,a,o)}(null===(r=null===(n=a.stateStyle)||void 0===n?void 0:n.normal)||void 0===r?void 0:r.lineWidth)&&a.setAttribute("stroke",s.getColorAttribute(),"normal",t.AttributeLevel.Base_Series)}))}))}},{key:"updateLayoutAttribute",value:function(){var t=this;_(r,"updateLayoutAttribute",this,3)([]),this._labelComponentMap.forEach((function(e,i){var n=e();O(n)?t._updateMultiLabelAttribute(n,i):t._updateSingleLabelAttribute(n,i)}))}},{key:"_updateMultiLabelAttribute",value:function(t,e){this._updateLabelComponentAttribute(e,t.map((function(t){return t.baseMark})),t)}},{key:"_updateSingleLabelAttribute",value:function(t,e){var i=t.baseMark;this._updateLabelComponentAttribute(e,i,[t])}},{key:"_updateLabelComponentAttribute",value:function(t,e,i){var n=this,r=this._option.getComponentsByType("totalLabel");t.setMarkConfig({interactive:!1}),t.setSimpleStyle({labelStyle:function(t){var e,a,o=i[t],s=o.labelSpec,l=o.labelMark,u=o.series,c=l.getRule(),h=n._interactiveConfig(s),d=null!==(a=null===(e=n._spec)||void 0===e?void 0:e.centerOffset)&&void 0!==a?a:0,v=nO({textStyle:Object.assign({pickable:!0===s.interactive},s.style),overlap:{avoidMarks:r.map((function(t){return t.getMarks()[0].getProductId()}))}},uV(c,o),Object.assign(Object.assign(Object.assign({},it(s,["position","style","state","type","stackDataFilterType","getStyleHandler"])),h),{centerOffset:d}),s.stackDataFilterType?{dataFilter:"min"===s.stackDataFilterType?function(t){return t.filter((function(t){return t.data[GO]}))}:function(t){return t.filter((function(t){return t.data[WO]}))}}:{});return u&&u.parseLabelStyle&&(v=u.parseLabelStyle(v,s,l)),"line"!==c&&"area"!==c||(v.type=c),v},size:function(){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:function(t,e){var n=e.labelIndex;return i[n]&&!i[n].labelMark.skipEncode?cV(i[n],t,i[n].labelSpec.formatMethod,i[n].labelSpec.formatter):{data:t}}}),this._setTransformOfComponent(t,e)}},{key:"compileMarks",value:function(){var t=this;this.getMarks().forEach((function(e){var i,n=t._labelComponentMap.get(e)();i=O(n)?n[0].series.getRegion().getGroupMark().getProduct():n.series.getRegion().getGroupMark().getProduct(),e.compile({group:i})}))}},{key:"getLabelInfoByTextGraphic",value:function(t){var e,i=null==t?void 0:t.parent,n=null==i?void 0:i.parent;if(n){var r=n.getChildren().indexOf(i);this._labelComponentMap.forEach((function(t,i){i.getComponent()===n&&(e=lt(t())[r])}))}return e}}],[{key:"getSpecInfo",value:function(t,e){var i=this,n=[];return((null==e?void 0:e.region)||[]).forEach((function(r,a){(r.seriesIndexes||[]).some((function(t){var i=e.series[t].markLabelSpec,n=void 0===i?{}:i;return Object.values(n).some((function(t){return Array.isArray(t)&&function(t){return t.some((function(t){return t.visible}))}(t)}))}))&&n.push({spec:t,type:d.label,specInfoPath:["component",i.specKey,a],regionIndexes:[a]})})),n}}])}(iJ);oJ.type=d.label,oJ.specKey="label",oJ.transformerConstructor=aJ;var sJ=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).type=d.totalLabel,e.name=d.totalLabel,e.specKey="totalLabel",e.layoutZIndex=t.LayoutZIndex.Label,e}return c(r,e),a(r,[{key:"init",value:function(t){_(r,"init",this,3)([t]),this._initTextMark(),this._initLabelComponent()}},{key:"reInit",value:function(t){_(r,"reInit",this,3)([t]),this._initTextMark()}},{key:"_initTextMark",value:function(){var t,e=this._getSeries();if(null===(t=e.getSpec().totalLabel)||void 0===t?void 0:t.visible){var i=e.getSeriesMark();if(i){var n=this._createMark({type:"label",name:"".concat(i.name,"-total-label")});this._baseMark=i,this._textMark=n,this._initTextMarkStyle()}}}},{key:"_initTextMarkStyle",value:function(){var e;_(r,"initMarkStyleWithSpec",this,3)([this._textMark,this._spec]),this.setMarkStyle(this._textMark,{text:function(t){return t[VO]}},"normal",t.AttributeLevel.Default);var i=this._getSeries();null===(e=i.initTotalLabelMarkStyle)||void 0===e||e.call(i,this._textMark)}},{key:"_initLabelComponent",value:function(){var t,e=this._getSeries(),i=this._createMark({type:"component",name:"".concat(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))}},{key:"updateLayoutAttribute",value:function(){var t=this;_(r,"updateLayoutAttribute",this,3)([]);var e=this._getSeries();this._marks.forEach((function(i,n){i.setMarkConfig({interactive:!1}),i.setSimpleStyle({labelStyle:function(){var i,n;if(t._baseMark){var r=t._spec,a=r.offset,o=r.animation,s=r.overlap,l=r.position,u=void 0===l?"top":l,c=t._interactiveConfig(t._spec);return nO({textStyle:{pickable:!0===t._spec.interactive},position:lJ(e,t._baseMark.type,u),x:0,y:0},null!==(n=null===(i=e.getTotalLabelComponentStyle)||void 0===i?void 0:i.call(e,{baseMark:t._baseMark,labelMark:t._textMark}))&&void 0!==n?n:{},Object.assign({offset:a,animation:o,overlap:s,dataFilter:function(t){return t.filter((function(t){return"bottom"===u?t.data[GO]:t.data[WO]}))}},c))}},size:function(){var e;return Object.assign({padding:null===(e=t._spec.overlap)||void 0===e?void 0:e.padding},t._regions[0].getLayoutRect())},itemEncoder:function(i){return cV({baseMark:t._baseMark,labelMark:t._textMark,series:e,labelSpec:e.getSpec().totalLabel},i,t._spec.formatMethod)}}),t._setTransformOfComponent(i,t._baseMark)}))}},{key:"compileMarks",value:function(){var t=this;this.getMarks().forEach((function(e){var i=t._regions[0].getGroupMark().getProduct();e.compile({group:i,context:{model:t}})}))}},{key:"_getSeries",value:function(){return this._option.getSeriesInIndex([this.getSpecPath()[1]])[0]}}],[{key:"getSpecInfo",value:function(t,e){var i,n=this,r=[];return null===(i=null==e?void 0:e.region)||void 0===i||i.forEach((function(t,i){var a;null===(a=t.seriesIndexes)||void 0===a||a.forEach((function(t){var a=e.series[t].spec[n.specKey];(null==a?void 0:a.visible)&&r.push({spec:a,type:d.totalLabel,specPath:["series",t,n.specKey],specInfoPath:["component",n.specKey,t],regionIndexes:[i],seriesIndexes:[t]})}))})),r}}])}(iJ);function lJ(t,e){var i,n,r,a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",s=t.direction;a="bottom"===o?{vertical:["bottom","top"],horizontal:["left","right"]}:{vertical:["top","bottom"],horizontal:["right","left"]};var l=("horizontal"===s?null===(i=t.getXAxisHelper())||void 0===i?void 0:i.isInverse():null===(n=t.getYAxisHelper())||void 0===n?void 0:n.isInverse())?1:0;switch(e){case"rect":case"symbol":r=a[s][l];break;default:r="top"}return r}sJ.type=d.totalLabel,sJ.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"}}}},sJ.specKey="totalLabel";var uJ=function(e){function o(){var e;return n(this,o),(e=i(this,o,arguments)).specKey="markPoint",e.layoutZIndex=t.LayoutZIndex.MarkPoint,e}return c(o,e),a(o,[{key:"_createMarkerComponent",value:function(){var t,e,i,n,a,o,s,l,u,c,h,d,v,f,p,g,y,m,_,b,k,x,S,A,M,w,T,C,E,B,P,R,L=this._spec,O=L.itemContent,I=void 0===O?{}:O,D=L.itemLine,F=void 0===D?{}:D,j=L.targetSymbol,z=void 0===j?{}:j,H=I,N=H.type,V=void 0===N?"text":N,U=H.text,W=H.symbol,G=H.image,Y=H.richText,X=H.customMark,K=H.textStyle,q=H.symbolStyle,Z=H.imageStyle,J=H.richTextStyle,Q=H.customMarkStyle,$=H.style,tt=void 0===$?{}:$,it=H.state,nt=void 0===it?{}:it,rt=r(H,["type","text","symbol","image","richText","customMark","textStyle","symbolStyle","imageStyle","richTextStyle","customMarkStyle","style","state"]),at=null,ot=null;"text"===V?(at=null!==(t=null==U?void 0:U.state)&&void 0!==t?t:nt,ot=SZ(et({dx:0,dy:0},null!==(e=null!=U?U:K)&&void 0!==e?e:tt),this._markerData,this._markAttributeContext)):"richText"===V?(at=null!==(i=null==Y?void 0:Y.state)&&void 0!==i?i:nt,ot=MZ(et({width:100,height:100},null!==(a=null!==(n=null==Y?void 0:Y.style)&&void 0!==n?n:J)&&void 0!==a?a:tt),this._markerData,this._markAttributeContext)):"symbol"===V?(at=null!==(o=null==W?void 0:W.state)&&void 0!==o?o:nt,ot=pI(MZ(et({symbolType:"star",fill:"rgb(48, 115, 242)",fillOpacity:.8,size:20},null!==(l=null!==(s=null==W?void 0:W.style)&&void 0!==s?s:q)&&void 0!==l?l:tt),this._markerData,this._markAttributeContext))):"image"===V?(at=null!==(u=null==G?void 0:G.state)&&void 0!==u?u:nt,ot=MZ(et({width:80,height:80},null!==(h=null!==(c=null==G?void 0:G.style)&&void 0!==c?c:Z)&&void 0!==h?h:tt),this._markerData,this._markAttributeContext)):"custom"===V&&(at=null!==(d=null==X?void 0:X.state)&&void 0!==d?d:nt,ot=MZ(null!==(f=null!==(v=null==X?void 0:X.style)&&void 0!==v?v:Q)&&void 0!==f?f:tt,this._markerData,this._markAttributeContext));var st={zIndex:this.layoutZIndex,interactive:null===(p=this._spec.interactive)||void 0===p||p,hover:null===(g=this._spec.interactive)||void 0===g||g,select:null===(y=this._spec.interactive)||void 0===y||y,position:{x:0,y:0},clipInRange:null!==(m=this._spec.clip)&&void 0!==m&&m,itemContent:Object.assign(Object.assign({type:V,offsetX:wZ(I.offsetX,this._relativeSeries.getRegion()),offsetY:wZ(I.offsetX,this._relativeSeries.getRegion())},rt),{style:MZ(ot,this._markerData,this._markAttributeContext)}),targetSymbol:{offset:null!==(_=z.offset)&&void 0!==_?_:0,visible:null!==(b=z.visible)&&void 0!==b&&b,size:null!==(k=z.size)&&void 0!==k?k:20,style:MZ(z.style,this._markerData,this._markAttributeContext)},state:{line:AZ(null!==(S=null===(x=this._spec.itemLine.line)||void 0===x?void 0:x.state)&&void 0!==S?S:{},this._markerData,this._markAttributeContext),lineStartSymbol:AZ(null!==(M=null===(A=this._spec.itemLine.startSymbol)||void 0===A?void 0:A.state)&&void 0!==M?M:{},this._markerData,this._markAttributeContext),lineEndSymbol:AZ(null!==(T=null===(w=this._spec.itemLine.endSymbol)||void 0===w?void 0:w.state)&&void 0!==T?T:{},this._markerData,this._markAttributeContext),itemContent:AZ(at,this._markerData,this._markAttributeContext),textBackground:AZ(null===(E=null===(C=this._spec.itemContent.text)||void 0===C?void 0:C.labelBackground)||void 0===E?void 0:E.state,this._markerData,this._markAttributeContext),targetItem:AZ(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},lt=F.visible,ut=F.line,ct=void 0===ut?{}:ut,ht=r(F,["visible","line"]);return st.itemLine=!1!==lt?Object.assign(Object.assign({},ht),{visible:!0,lineStyle:pI(ct.style)}):{visible:!1},new uR(st)}},{key:"_markerLayout",value:function(){var t,e,i,n,r,a,o=this._spec,s=this._markerData,l=this._relativeSeries,u=this._computePointsAttr().point,c=this._getRelativeDataView().latestData,h=s?s.latestData[0]&&s.latestData[0].latestData?s.latestData[0].latestData:s.latestData:c;if(o.clip||(null===(t=o.itemContent)||void 0===t?void 0:t.confine)){var d=xZ([l.getRegion()]),v=d.minX,f=d.maxX,p=d.minY;a={x:v,y:p,width:f-v,height:d.maxY-p}}if(this._markerComponent){var g=null!==(e=this._markerComponent.attribute)&&void 0!==e?e:{},y=null!==(n=null===(i=g.itemContent)||void 0===i?void 0:i.textStyle)&&void 0!==n?n:{};this._markerComponent.setAttributes({position:void 0===u?{x:null,y:null}:u,itemContent:Object.assign(Object.assign({},g.itemContent),{textStyle:Object.assign(Object.assign({},y),{text:(null===(r=this._spec.itemContent.text)||void 0===r?void 0:r.formatMethod)?this._spec.itemContent.text.formatMethod(h,c):y.text}),offsetX:TZ(u,g.itemContent.offsetX,this._relativeSeries.getRegion()),offsetY:TZ(u,g.itemContent.offsetY,this._relativeSeries.getRegion())}),limitRect:a,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}}},{key:"_initDataView",value:function(){var t=this._spec,e=PZ(t),i=e.doXYProcess,n=e.doPolarProcess,r=e.doGeoProcess;(C(t.coordinate)||i||n||r)&&this._initCommonDataView()}}],[{key:"_getMarkerCoordinateType",value:function(t){var e=PZ(t),i=e.doPolarProcess,n=e.doGeoProcess;return"polar"===t.coordinateType||i?"polar":"geo"===t.coordinateType||n?"geo":"cartesian"}}])}(DZ);uJ.specKey="markPoint";var cJ={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}},hJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=d.markPoint,t.name=d.markPoint,t.coordinateType="cartesian",t}return c(e,t),a(e,[{key:"_computePointsAttr",value:function(){var t,e,i,n,r=this._spec,a=this._markerData,o=this._relativeSeries,s=C(r.x)&&C(r.y),l=C(r.coordinate),u=C(r.position),c=null!==(t=null==r?void 0:r.autoRange)&&void 0!==t&&t;return s?n=null===(i=null===(e=pZ(a,o,o,o,c))||void 0===e?void 0:e[0])||void 0===i?void 0:i[0]:l?n=mZ(a,o,c,r.coordinatesOffset)[0]:u&&(n=kZ(r.position,o,r.regionRelative)[0]),{point:n}}},{key:"_computeOptions",value:function(){var t,e=this._spec,i=PZ(e).doXYProcess,n=C(e.coordinate);return i?t=[this._processSpecByDims([{dim:"x",specValue:e.x},{dim:"y",specValue:e.y}])]:n&&(t=this._processSpecCoo(e)),{options:t}}}])}(uJ);hJ.type=d.markPoint,hJ.coordinateType="cartesian",hJ.builtInTheme={markPoint:cJ};var dJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=d.polarMarkPoint,t.name=d.polarMarkPoint,t.coordinateType="polar",t}return c(e,t),a(e,[{key:"_computePointsAttr",value:function(){var t,e,i=this._markerData,n=this._relativeSeries,r=yZ(i,n,n,n,null!==(e=null===(t=this._spec)||void 0===t?void 0:t.autoRange)&&void 0!==e&&e)[0][0];return{point:we({x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y},r.radius,r.angle)}}},{key:"_computeOptions",value:function(){var t=this._spec;return{options:[this._processSpecByDims([{dim:"radius",specValue:t.radius},{dim:"angle",specValue:t.angle}])]}}}])}(uJ);dJ.type=d.polarMarkPoint,dJ.coordinateType="polar",dJ.builtInTheme={polarMarkPoint:cJ};var vJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=d.geoMarkPoint,t.name=d.geoMarkPoint,t.coordinateType="geo",t}return c(e,t),a(e,[{key:"_computePointsAttr",value:function(){var t=function(t,e){var i=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((function(t){C(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}}},{key:"_computeOptions",value:function(){var t=this._spec;return{options:[this._processSpecByDims([{dim:"areaName",specValue:t.areaName}])]}}}])}(uJ);vJ.type=d.geoMarkPoint,vJ.coordinateType="geo",vJ.builtInTheme={geoMarkPoint:cJ};var fJ="inBrush",pJ="outOfBrush",gJ=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).layoutType="none",e.type=d.brush,e.name=d.brush,e.specKey="brush",e.layoutZIndex=t.LayoutZIndex.Brush,e._linkedSeries=[],e._itemMap={},e._linkedItemMap={},e._inBrushElementsMap={},e._outOfBrushElementsMap={},e._linkedInBrushElementsMap={},e._linkedOutOfBrushElementsMap={},e._cacheInteractiveRangeAttrs=[],e._releatedAxes=[],e._regionAxisMap={},e._axisDataZoomMap={},e._zoomRecord=[],e}return c(r,e),a(r,[{key:"init",value:function(){var e=this._transformBrushedMarkAttr(this._spec.inBrush),i=this._transformBrushedMarkAttr(this._spec.outOfBrush);this._option.getAllSeries().forEach((function(n){n.getActiveMarks().forEach((function(r){r&&(n.setMarkStyle(r,Object.assign({},e),fJ,t.AttributeLevel.Series),n.setMarkStyle(r,Object.assign({},i),pJ,t.AttributeLevel.Series))}))}))}},{key:"_initNeedOperatedItem",value:function(){var t=this,e=this._spec.seriesId,i=this._spec.seriesIndex;this._relativeRegions.forEach((function(n){var r=[];n.getSeries().forEach((function(a){(e&&lt(e).includes(a.userId.toString())||i&&lt(i).includes(a.getSpecIndex())||!i&&!e)&&r.push.apply(r,b(a.getMarksWithoutRoot())),t._itemMap[n.id]=r}))})),this._linkedSeries.forEach((function(e){t._linkedItemMap[e.id]=e.getMarksWithoutRoot()}))}},{key:"created",value:function(){_(r,"created",this,3)([]),this.initEvent(),this._bindRegions(),this._bindLinkedSeries(),this._initRegionAxisMap(),this._initAxisDataZoomMap(),this._initNeedOperatedItem()}},{key:"_bindRegions",value:function(){C(this._spec.regionId)||C(this._spec.regionIndex)?this._relativeRegions=this._option.getRegionsInUserIdOrIndex(lt(this._spec.regionId),lt(this._spec.regionIndex)):this._relativeRegions=this._option.getAllRegions()}},{key:"_bindLinkedSeries",value:function(){(C(this._spec.brushLinkSeriesId)||C(this._spec.brushLinkSeriesIndex))&&(this._linkedSeries=this._option.getSeriesInUserIdOrIndex(lt(this._spec.brushLinkSeriesId),lt(this._spec.brushLinkSeriesIndex)))}},{key:"_initRegionAxisMap",value:function(){var t=this;C(this._spec.axisId)?lt(this._spec.axisId).forEach((function(e){t._releatedAxes.push(t._option.getComponentByUserId(e))})):C(this._spec.axisIndex)?lt(this._spec.axisIndex).forEach((function(e){t._releatedAxes.push(t._option.getComponentByIndex("axes",e))})):this._releatedAxes=this._option.getComponentsByKey("axes"),this._releatedAxes.forEach((function(e){null==e||e.getRegions().forEach((function(i){t._regionAxisMap["region_"+i.id]?t._regionAxisMap["region_"+i.id].push(e):t._regionAxisMap["region_"+i.id]=[e]}))}))}},{key:"_initAxisDataZoomMap",value:function(){var t=this;this._option.getComponentsByKey("dataZoom").forEach((function(e){e.relatedAxisComponent&&(t._axisDataZoomMap[e.relatedAxisComponent.id]=e)}))}},{key:"initEvent",value:function(){}},{key:"_compareSpec",value:function(t,e){var i=this;this._brushComponents&&this._relativeRegions.forEach((function(t,e){i._updateBrushComponent(t,e)}));var n=_(r,"_compareSpec",this,3)([t,e]);return at(e,t)||(n.reRender=!0,n.reMake=!0),n}},{key:"onLayoutEnd",value:function(){var t,e=this;_(r,"onLayoutEnd",this,3)([]),this._option.disableTriggerEvent||(null===(t=this._spec.visible)||void 0===t||t)&&(this._brushComponents?this._relativeRegions.forEach((function(t,i){e._updateBrushComponent(t,i)})):(this._brushComponents=[],this._relativeRegions.forEach((function(t,i){e._createBrushComponent(t,i)}))))}},{key:"_updateBrushComponent",value:function(t,e){var i=this._getBrushInteractiveAttr(t),n=this._brushComponents[e];n.setAttributes(i),this._initMarkBrushState(e,""),n.children[0].removeAllChild()}},{key:"_createBrushComponent",value:function(e,i){var n,r,a=this,o=this._getBrushInteractiveAttr(e),s=new eL(Object.assign(Object.assign(Object.assign({zIndex:this.layoutZIndex,brushStyle:pI(null===(n=this._spec)||void 0===n?void 0:n.style)},o),this._spec),{disableTriggerEvent:this._option.disableTriggerEvent}));s.id=null!==(r=this._spec.id)&&void 0!==r?r:"brush-".concat(this.id),this.getContainer().add(s),this._brushComponents.push(s),this._cacheInteractiveRangeAttrs.push(o),s.addEventListener(KR.brushActive,(function(n){a._initMarkBrushState(i,pJ),a._emitEvent(t.ChartEvent.brushActive,e)})),s.addEventListener(KR.drawStart,(function(i){a._setRegionMarkPickable(e,!0),a._emitEvent(t.ChartEvent.brushStart,e)})),s.addEventListener(KR.moveStart,(function(i){a._setRegionMarkPickable(e,!0),a._emitEvent(t.ChartEvent.brushStart,e)})),s.addEventListener(KR.drawing,(function(i){a._setRegionMarkPickable(e,!1),a._handleBrushChange(e,i),a._emitEvent(t.ChartEvent.brushChange,e)})),s.addEventListener(KR.moving,(function(i){a._setRegionMarkPickable(e,!1),a._handleBrushChange(e,i),a._emitEvent(t.ChartEvent.brushChange,e)})),s.addEventListener(KR.brushClear,(function(n){a._setRegionMarkPickable(e,!0),a._initMarkBrushState(i,""),a._emitEvent(t.ChartEvent.brushClear,e)})),s.addEventListener(KR.drawEnd,(function(n){var r;a._setRegionMarkPickable(e,!0);var o=n.detail.operateMask,s=a._spec.updateElementsState,l=void 0===s||s;if(null===(r=a._spec)||void 0===r?void 0:r.onBrushEnd)!0===a._spec.onBrushEnd(n)?(a.clearGraphic(),a._initMarkBrushState(i,""),a._emitEvent(t.ChartEvent.brushClear,e)):(a._spec.onBrushEnd(n),a._emitEvent(t.ChartEvent.brushEnd,e));else{var u=a._extendDataInBrush(a._inBrushElementsMap);(!a._spec.zoomWhenEmpty&&u.length>0||!l)&&a._setAxisAndDataZoom(o,e),a._emitEvent(t.ChartEvent.brushEnd,e)}})),s.addEventListener(KR.moveEnd,(function(i){a._setRegionMarkPickable(e,!0);var n=i.detail.operateMask,r=a._spec.updateElementsState,o=void 0===r||r,s=a._extendDataInBrush(a._inBrushElementsMap);(!a._spec.zoomWhenEmpty&&s.length>0||o)&&a._setAxisAndDataZoom(n,e),a._emitEvent(t.ChartEvent.brushEnd,e)}))}},{key:"_getBrushInteractiveAttr",value:function(t){var e=t.getLayoutStartPoint(),i=t.getLayoutRect(),n=e.x,r=n+i.width,a=e.y,o=a+i.height;return{interactiveRange:{minY:a,maxY:o,minX:n,maxX:r},xRange:[n,r],yRange:[a,o]}}},{key:"_transformBrushedMarkAttr",value:function(t){var 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({},pI(t)),e)}},{key:"_handleBrushChange",value:function(t,e){var i=e.detail.operateMask,n=this._spec.updateElementsState;(void 0===n||n)&&(this._reconfigItem(i,t),this._reconfigLinkedItem(i,t))}},{key:"_extendDataInBrush",value:function(t){var e,i,n=[];for(var r in t)for(var a in t[r])n.push(Object.assign({},null===(i=null===(e=t[r][a].context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0]));return n}},{key:"_extendDatumOutOfBrush",value:function(t){var e,i,n=[];for(var r in t)n.push(null===(i=null===(e=t[r].context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0]);return n}},{key:"_emitEvent",value:function(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})}},{key:"_reconfigItem",value:function(t,e){var i,n,r,a=this;if((null==t?void 0:t.globalTransMatrix)&&(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)){var o=null!==(r=null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.points)&&void 0!==r?r:[],s=t.globalTransMatrix,l=s.a,u=s.b,c=s.c,h=s.d,d=s.e,v=s.f,f=o.map((function(t){return{x:l*t.x+c*t.y+d,y:u*t.x+h*t.y+v}})),p=this._spec.markTypeFilter,g=void 0===p?[]:p;this._itemMap[e.id].forEach((function(e){if(!g.includes(e.type)){var i=e.getGraphics();i&&i.length&&i.forEach((function(i){var n,r,o,s=e.id+"_"+i.context.key,l=a._isBrushContainItem(t.globalAABBBounds,f,i);(null===(n=a._outOfBrushElementsMap)||void 0===n?void 0:n[s])&&l?(i.addState(fJ,!0),a._inBrushElementsMap[null==t?void 0:t.name]||(a._inBrushElementsMap[null==t?void 0:t.name]={}),a._inBrushElementsMap[null==t?void 0:t.name][s]=i,delete a._outOfBrushElementsMap[s]):(null===(o=null===(r=a._inBrushElementsMap)||void 0===r?void 0:r[null==t?void 0:t.name])||void 0===o?void 0:o[s])&&!l&&(i.removeState(fJ),i.addState(pJ,!0),a._outOfBrushElementsMap[s]=i,delete a._inBrushElementsMap[t.name][s])}))}}))}}},{key:"_reconfigLinkedItem",value:function(t,e){var i,n=this;if((null==t?void 0:t.globalTransMatrix)&&(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)){var r=e.getLayoutStartPoint(),a=e.getSeries().map((function(t){return t.id}));this._linkedSeries.forEach((function(e){var i,o;if(!a.includes(e.id)){var s=e.getRegion().getLayoutStartPoint(),l=s.x-r.x,u=s.y-r.y,c=null!==(o=null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)&&void 0!==o?o:[],h=t.globalTransMatrix,d=h.a,v=h.b,f=h.c,p=h.d,g=h.e,y=h.f,m=l||0,_=u||0,b=c.map((function(t){return{x:d*t.x+f*t.y+g+m,y:v*t.x+p*t.y+y+_}}));t.globalAABBBounds.clone().set(t.globalAABBBounds.x1+m,t.globalAABBBounds.y1+_,t.globalAABBBounds.x2+m,t.globalAABBBounds.y2+_);var k=n._spec.markTypeFilter,x=void 0===k?[]:k;n._linkedItemMap[e.id].forEach((function(e){if(!x.includes(e.type)){var i=e.getGraphics();i&&i.length&&i.forEach((function(i){var r,a,o;i.context;var s=e.id+"_"+i.context.key;(null===(r=n._linkedOutOfBrushElementsMap)||void 0===r?void 0:r[s])&&n._isBrushContainItem(t.globalAABBBounds,b,i)?(i.addState(fJ,!0),n._linkedInBrushElementsMap[null==t?void 0:t.name]||(n._linkedInBrushElementsMap[null==t?void 0:t.name]={}),n._linkedInBrushElementsMap[null==t?void 0:t.name][s]=i,delete n._linkedOutOfBrushElementsMap[s]):(null===(o=null===(a=n._linkedInBrushElementsMap)||void 0===a?void 0:a[null==t?void 0:t.name])||void 0===o?void 0:o[s])&&!n._isBrushContainItem(t.globalAABBBounds,b,i)&&(i.removeState(fJ),i.addState(pJ,!0),n._linkedOutOfBrushElementsMap[s]=i)}))}}))}}))}}},{key:"_isBrushContainItem",value:function(t,e,i){if(["symbol","rect"].includes(i.type)){var n=null==i?void 0:i.globalAABBBounds,r=n.x1,a=n.x2,o=n.y1,s=n.y2;return function(t,e){for(var i=0;i<e.length;i++){if(Xe(t,e[i].x,e[i].y))return!0;if(i>0&&Ye(e[i-1].x,e[i-1].y,e[i].x,e[i].y,t))return!0}return!1}(e,[{x:r,y:o},{x:a,y:o},{x:a,y:s},{x:r,y:s}])}return t.intersects(i.globalAABBBounds)}},{key:"_initItemMap",value:function(t,e,i){var n=this._spec.markTypeFilter,r=void 0===n?[]:n;Object.entries(t).forEach((function(t){var n=m(t,2);n[0],n[1].forEach((function(t){if(!r.includes(t.type)){var n=t.getGraphics();n&&n.length&&n.forEach((function(n){var r=t.id+"_"+n.context.key;n.removeState(fJ),n.removeState(pJ),i&&n.addState(i,!0),e[r]=n}))}}))}))}},{key:"_initMarkBrushState",value:function(t,e){this._brushComponents.forEach((function(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)}},{key:"_setRegionMarkPickable",value:function(t,e){t.getGroupMark().getGraphics().forEach((function(t){return t.setAttribute("childrenPickable",e)}))}},{key:"_stateClamp",value:function(t){return Math.min(Math.max(0,t),1)}},{key:"_setAxisAndDataZoom",value:function(t,e){var i,n=this;if(this._zoomRecord=[],this._spec.zoomAfterBrush){var r=t.AABBBounds;null===(i=this._regionAxisMap["region_"+e.id])||void 0===i||i.forEach((function(t){var i,a,o="bottom"===t.layoutOrient||"top"===t.layoutOrient,s=null!==(i=n._spec.axisRangeExpand)&&void 0!==i?i:0,l=r.x1,u=r.x2,c=r.y1,h=r.y2,d=o?"x":"y",v=o?"width":"height",f=o?l:c,p=o?u:h;if(n._axisDataZoomMap[t.id]){var g=n._axisDataZoomMap[t.id],y=(f-e.getLayoutStartPoint()[d])/e.getLayoutRect()[v],m=(p-e.getLayoutStartPoint()[d])/e.getLayoutRect()[v],_=n._stateClamp(y-s),b=n._stateClamp(m+s);g.setStartAndEnd(Math.min(_,b),Math.max(_,b),["percent","percent"]),n._zoomRecord.push({operateComponent:g,start:_,end:b,startValue:Vq(_,g.stateScale,Wq(g.relatedAxisComponent,g.isHorizontal)),endValue:Vq(b,g.stateScale,Wq(g.relatedAxisComponent,g.isHorizontal))})}else{var k=t.getScale().range(),x=null!==(a=t.scaleRangeFactor())&&void 0!==a?a:[0,1],S=ut(k)<k[0],A=f-e.getLayoutStartPoint()[d],M=p-e.getLayoutStartPoint()[d],w=S?Math.min(A,M):Math.max(A,M),T=S?Math.max(A,M):Math.min(A,M),C=(T-k[0])/(ut(k)-k[0])*(x[1]-x[0])+x[0],E=(w-k[0])/(ut(k)-k[0])*(x[1]-x[0])+x[0],B=n._stateClamp(C-s),P=n._stateClamp(E+s);t.scaleRangeFactor([B,P]),t.effect.scaleUpdate(),n._zoomRecord.push({operateComponent:t,start:B,end:P,startValue:t.getScale().invert(T),endValue:t.getScale().invert(w)})}}))}}},{key:"_getNeedClearVRenderComponents",value:function(){return this._brushComponents}},{key:"clearGraphic",value:function(){this._brushComponents&&this._brushComponents.forEach((function(t){t._container.incrementalClearChild()}))}},{key:"clear",value:function(){var t=this;if(this._brushComponents){var e=this.getContainer();this._brushComponents.forEach((function(i,n){t._initMarkBrushState(n,""),i.removeAllChild(),i.releaseBrushEvents(),e&&e.removeChild(i)})),this._brushComponents=null}}}],[{key:"getSpecInfo",value:function(t){return yF(t,this.specKey,this.type,(function(t){return!1!==t.visible}))}}])}(vz);gJ.type=d.brush,gJ.builtInTheme={brush:{style:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",lineWidth:2},brushMode:"single",brushType:"rect",brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:0}},gJ.specKey="brush";var yJ=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).type=d.customMark,e.specKey="customMark",e.layoutType="none",e.layoutZIndex=t.LayoutZIndex.CustomMark,e.layoutLevel=t.LayoutLevel.CustomMark,e}return c(r,e),a(r,[{key:"created",value:function(){_(r,"created",this,3)([]),this.initMarks(),this.initEvent()}},{key:"getMarkAttributeContext",value:function(){return this._markAttributeContext}},{key:"_buildMarkAttributeContext",value:function(){var t=this;this._markAttributeContext={vchart:this._option.globalInstance,globalScale:function(e,i){var n;return null===(n=t._option.globalScale.getScale(e))||void 0===n?void 0:n.scale(i)}}}},{key:"initMarks",value:function(){var t=this;if(this._spec){var e=null;if(this._spec.parent){var i=this.getChart().getAllMarks().find((function(e){return e.getUserId()===t._spec.parent}));"group"===i.type&&(e=i)}this._createExtensionMark(this._spec,e,"".concat(TO,"_series_").concat(this.id,"_extensionMark"),0)}}},{key:"_createExtensionMark",value:function(t,e,i){var n,r,a=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=this._createMark({type:t.type,name:C(t.name)?"".concat(t.name):"".concat(i,"_").concat(o)},{skipBeforeLayouted:!0,attributeContext:this._getMarkAttributeContext(),componentType:t.componentType,key:t.dataKey});if(s){if(C(t.id)&&s.setUserId(t.id),(null===(n=this._option.globalInstance)||void 0===n?void 0:n.isAnimationEnable())&&t.animation){var l=YF({},XF(t.type,t,this._markAttributeContext));s.setAnimationConfig(l)}if(T(e)?this._marks.addMark(s):e&&e.addMark(s),this.initMarkStyleWithSpec(s,t),"group"===t.type&&(i="".concat(i,"_").concat(o),null===(r=t.children)||void 0===r||r.forEach((function(t,e){a._createExtensionMark(t,s,i,e)}))),C(t.dataId)||z(t.dataIndex)){var u=this.getChart().getSeriesData(t.dataId,t.dataIndex);u&&(s.setDataView(u),u.target.addListener("change",(function(){s.getData().updateData()})))}}}},{key:"initEvent",value:function(){}},{key:"_compareSpec",value:function(t,e){var i=_(r,"_compareSpec",this,3)([t,e]);return at(e,t)||(i.reMake=!0),i.change=!0,i.reRender=!0,i}},{key:"_getMarkAttributeContext",value:function(){var t=this;return{vchart:this._option.globalInstance,chart:this.getChart(),globalScale:function(e,i){var n;return null===(n=t._option.globalScale.getScale(e))||void 0===n?void 0:n.scale(i)},getLayoutBounds:function(){var e=t.getLayoutStartPoint(),i=e.x,n=e.y,r=t.getLayoutRect(),a=r.width,o=r.height;return(new ii).set(i,n,i+a,n+o)}}}},{key:"_getLayoutRect",value:function(){var t=new ii;return this.getMarks().forEach((function(e){var i=e.getProduct();i&&t.union(i.AABBBounds)})),t.empty()?{width:0,height:0}:{width:t.width(),height:t.height()}}},{key:"getBoundsInRect",value:function(t){this.setLayoutRect(t);var e=this._getLayoutRect(),i=this.getLayoutStartPoint(),n=i.x,r=i.y;return{x1:n,y1:r,x2:n+e.width,y2:r+e.height}}},{key:"getVRenderComponents",value:function(){var t=[],e=function(i){if(i&&"group"===i.type)i.getMarks().forEach((function(t){e(t)}));else if("component"===i.type){var n=null==i?void 0:i.getComponent();n&&t.push(n)}};return this.getMarks().forEach((function(t){e(t)})),t}}])}(vz);yJ.type=d.customMark,yJ.specKey="customMark";var mJ=function(){function t(e,i){n(this,t),this._chartLayoutRect={x:0,y:0,width:1,height:1},this._col=1,this._row=1,this._elementMap=new Map,this.standardizationSpec(e),this._gridInfo=e,this._col=e.col,this._row=e.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==i?void 0:i.onError,this.initUserSetting()}return a(t,[{key:"standardizationSpec",value:function(t){var e,i,n;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!==(n=t.elements)&&void 0!==n?n:[]}},{key:"initUserSetting",value:function(){var t=this;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((function(e,i){e||(t._colSize[i]={value:0,isUserSetting:!1,isLayoutSetting:!1})})),this._rowSize.forEach((function(e,i){e||(t._rowSize[i]={value:0,isUserSetting:!1,isLayoutSetting:!1})}))}},{key:"setSizeFromUserSetting",value:function(t,e,i,n){t.forEach((function(t){t.index<0&&t.index>=i||(z(t.size)?e[t.index]={value:+t.size,isUserSetting:!0,isLayoutSetting:!1}:w(t.size)&&(e[t.index]={value:t.size(n),isUserSetting:!0,isLayoutSetting:!1}))}))}},{key:"clearLayoutSize",value:function(){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((function(t){t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)})),this._rowSize.forEach((function(t){t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)}))}},{key:"getItemGridInfo",value:function(t){var e,i,n=this._elementMap.get(t);return n||(i=null===(e=this._gridInfo.elements)||void 0===e?void 0:e.find((function(e){var i;if("modelId"in e&&C(e.modelId)){if(C(t.model.userId)&&t.model.userId===e.modelId)return!0}else if("modelKey"in e&&C(e.modelKey)&&"modelIndex"in e&&C(e.modelIndex)&&(null!==(i=t.model.specKey)&&void 0!==i?i:t.model.type)===e.modelKey&&t.model.getSpecIndex()===e.modelIndex)return!0;return!1})),i||(i={col:0,colSpan:1,row:0,rowSpan:1}),this._elementMap.set(t,i),i)}},{key:"getSizeFromGrid",value:function(t,e){for(var i,n="col"===e?this._colSize:this._rowSize,r=0,a=t[e];a<t[e]+(null!==(i=t["".concat(e,"Span")])&&void 0!==i?i:1);a++)r+=n[a].value;return r}},{key:"getSizeFromUser",value:function(t,e){var i,n,r="col"===e?this._colSize:this._rowSize;if(null===(i=r[t[e]])||void 0===i?void 0:i.isUserSetting){for(var a=0,o=t[e];o<t[e]+(null!==(n=t["".concat(e,"Span")])&&void 0!==n?n:1);o++){if(!r[o].isUserSetting)return;a+=r[o].value}return a}}},{key:"setItemLayoutSizeToGrid",value:function(t,e){if(_J(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}}},{key:"layoutGrid",value:function(t){var e="col"===t?this._colSize:this._rowSize,i="col"===t?this._chartLayoutRect.width:this._chartLayoutRect.height,n=[];e.forEach((function(t){t.isUserSetting||t.isLayoutSetting?i-=t.value:n.push(t)})),i<0&&console.warn("layout content ".concat(t," size bigger than chart")),n.forEach((function(t){return t.value=i/n.length}))}},{key:"getItemPosition",value:function(t){for(var e=this.getItemGridInfo(t),i={x:this._chartLayoutRect.x,y:this._chartLayoutRect.y},n=0;n<e.col;n++)i.x+=this._colSize[n].value;for(var r=0;r<e.row;r++)i.y+=this._rowSize[r].value;return i.x+=t.layoutPaddingLeft+t.layoutOffsetX,i.y+=t.layoutPaddingTop+t.layoutOffsetY,i}},{key:"getItemLayoutRect",value:function(t){var e,i,n=this.getItemGridInfo(t);return{width:(null!==(e=this.getSizeFromGrid(n,"col"))&&void 0!==e?e:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(i=this.getSizeFromGrid(n,"row"))&&void 0!==i?i:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom}}},{key:"layoutItems",value:function(t,e,i,n){var r=this;this._chartLayoutRect=i,this._chartViewBox=n,this.clearLayoutSize(),e.sort((function(t,e){return e.layoutLevel-t.layoutLevel}));var a=e.filter((function(t){return"normal"===t.layoutType&&!1!==t.getModelVisible()})),o=a.filter((function(t){return _J(t)})),s=a.filter((function(t){return!_J(t)}));a.forEach((function(t){r.layoutOneItem(t,"user",!1)}));var l=e.filter((function(t){return"region-relative"===t.layoutType})),u=l.filter((function(t){return _J(t)})),c=l.filter((function(t){return!_J(t)}));u.forEach((function(t){return r.layoutOneItem(t,"user",!1)})),this.layoutGrid("col"),s.forEach((function(t){return r.layoutOneItem(t,"colGrid",!1)})),c.forEach((function(t){r.layoutOneItem(t,"colGrid",!1)})),this.layoutGrid("row"),c.forEach((function(t){r.layoutOneItem(t,"grid",!1)})),o.forEach((function(t){return r.layoutOneItem(t,"grid",!1)})),u.forEach((function(t){r.layoutOneItem(t,"grid",!0)})),this.layoutGrid("col"),e.filter((function(t){return"region"===t.layoutType})).forEach((function(t){return r.layoutOneItem(t,"grid",!1)})),this.layoutAbsoluteItems(e.filter((function(t){return"absolute"===t.layoutType}))),e.filter((function(t){return"absolute"!==t.layoutType})).forEach((function(t){t.setLayoutStartPosition(r.getItemPosition(t))}))}},{key:"layoutAbsoluteItems",value:function(t){var e=this;t.forEach((function(t){t.absoluteLayoutInRect(e._chartLayoutRect)}))}},{key:"layoutOneItem",value:function(t,e,i){var n,r,a="rowGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),o="colGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),s=this.getItemGridInfo(t),l={width:(null!==(n=o(s,"col"))&&void 0!==n?n:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(r=a(s,"row"))&&void 0!==r?r:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom},u=t.computeBoundsInRect(l);z(u.width)||(u.width=l.width),z(u.height)||(u.height=l.height),t.setLayoutRect("grid"!==e?u:l),this.setItemLayoutSizeToGrid(t,s)}}])}();function _J(t){return"left"===t.layoutOrient||"right"===t.layoutOrient}mJ.type="grid";var bJ="vchart-tooltip",kJ="".concat(bJ,"-container"),xJ="".concat(bJ,"-title"),SJ="".concat(bJ,"-content-box"),AJ={offsetX:10,offsetY:10},MJ="99999999999999";function wJ(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\(/g,"&#40;").replace(/ /g," &nbsp;")}var TJ=function(t,e){return t?(e||(e=t.getBoundingClientRect()),t.offsetWidth>0?e.width/t.offsetWidth:t.offsetHeight>0?e.height/t.offsetHeight:1):1},CJ=function(t){return L(t)&&""!==(null==t?void 0:t.trim())||F(t)?wJ(t):""},EJ=function(t,e){var i;if(C(t))if(F(t))i=t;else if(w(t)){var n=t(e);F(n)&&(i=n)}return i},BJ={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]},PJ=function(t,e){var i,n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return null!==(n=null===(i=BJ[t])||void 0===i?void 0:i["x"===e?0:1])&&void 0!==n?n:r},RJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments))._visible=!0,t._isReleased=!1,t.showTooltip=function(e,i,n){return n.changePositionOnly?t.changeTooltipPosition(n,i):t.changeTooltip(!0,n,i)},t.changeTooltip=function(e,i,n){return t._isReleased?1:e?t.changeTooltipPosition(i,n):(t._updateTooltip(!1,i),0)},t.changeTooltipPosition=function(e,i){var n,r,a,o,s;if(t._isReleased)return 1;var l=e.event,u=e.tooltipSpec,c=e.activeTooltipSpec,h=e.changePositionOnly;if(!c)return 1;var d=c.activeType;if(c.handler)return null!==(a=null===(r=(n=c.handler).showTooltip)||void 0===r?void 0:r.call(n,d,i,e))&&void 0!==a?a:0;var v=c,f=t._getActualTooltipPosition(c,e,t._getTooltipBoxSize(c,h));c.position=f;var p=null!==(o=c.updatePosition)&&void 0!==o?o:null===(s=u[d])||void 0===s?void 0:s.updatePosition;p&&(c.position=p(c.position,i,e));var g=!1!==(null==v?void 0:v.visible);return i&&"pointerout"!==l.type&&c.visible&&(c.title||c.content)||(g=!1),t._updateTooltip(g,Object.assign(Object.assign({},e),{changePositionOnly:h})),0},t._getActualTooltipPosition=function(e,i,n){var r,a,o,s,l,u,c,h,d,v=t._chartOption.getRectByDimensionData,f=i.tooltipSpec,p={x:1/0,y:1/0};if(!f)return p;var g,y=i.event,m=e.activeType,_=e.data,b="dimension"===m?null===(a=null===(r=_[0])||void 0===r?void 0:r.data)||void 0===a?void 0:a[0]:null==_?void 0:_[0],k=t._option,x=k.offsetX,S=k.offsetY,A=f[m],M=kF(null==A?void 0:A.position,_,i),T=null!==(o=kF(null==A?void 0:A.positionMode,_,i))&&void 0!==o?o:"mark"===m?"mark":"pointer",B=null!=n?n:{},P=B.width,R=void 0===P?0:P,L=B.height,O=void 0===L?0:L,I="canvas"===f.renderMode,D=null===(s=null==i?void 0:i.chart)||void 0===s?void 0:s.getCanvasRect(),j=null!==(l=null==D?void 0:D.width)&&void 0!==l?l:CO,H=null!==(u=null==D?void 0:D.height)&&void 0!==u?u:EO,N=!1,V={width:0,height:0},U={x:0,y:0},W={x:0,y:0},G=1,Y=1,X=sb(t._env);if(X&&!f.confine?(V.width=window.innerWidth,V.height=window.innerHeight):(V.width=j,V.height=H),X&&!I){var K=t._getParentElement(f);W=null!==(h=null===(c=null==K?void 0:K.getBoundingClientRect)||void 0===c?void 0:c.call(K))&&void 0!==h?h:p;var q=null!==(d=t._compiler.getCanvas())&&void 0!==d?d:t._chartContainer;g=null==q?void 0:q.getBoundingClientRect(),U={x:g.x-W.x,y:g.y-W.y},G=TJ(q,g),Y=TJ(K,W)}var Z,J=Y/G,Q={},$={x:M,y:M},tt={x:["left","right"],y:["top","bottom"]},et=function(t,e){var n,r,a,o=t.orient,s=t.mode,l=t.offset,u=i.model,c=null==u?void 0:u.getLayoutStartPoint(),h=null!=l?l:"x"===e?x:S;if("mark"===s){N=!0;var d=i.item,f=null==d?void 0:d.AABBBounds;f&&c&&(r=("x"===e?f.x1:f.y1)+c[e],a=("x"===e?f.x2:f.y2)+c[e])}else if(v&&"crosshair"===s&&"cartesian"===(null===(n=null==b?void 0:b.series)||void 0===n?void 0:n.coordinate)&&b.datum&&b.datum.length){N=!0;var p=v(b,c);p&&(r=p.start[e],a=p.end[e])}else $[e]=o;if(N){var g=tt[e][0],y="x"===e?R:O;switch(PJ(o,e)){case-2:Q[g]=r-y*J-h;break;case-1.5:Q[g]=r+h;break;case 0:Q[g]=(r+a)/2-y*J/2;break;case-1:Q[g]=(r+a)/2-y*J-h;break;case 1:Q[g]=(r+a)/2+h;break;case 1.5:Q[g]=a-y*J-h;break;case 2:Q[g]=a+h}}},it=["x","y"];if(E(M))if(E(Z=M)&&(C(Z.left)||C(Z.right)||C(Z.top)||C(Z.bottom))){var nt=M.left,rt=M.right,at=M.top,ot=M.bottom;Q.left=EJ(nt,y),Q.top=EJ(at,y),Q.right=EJ(rt,y),Q.bottom=EJ(ot,y)}else(function(t){return E(t)&&(C(t.x)||C(t.y))})(M)&&it.forEach((function(t){var e=M[t];F(e)||w(e)?Q[tt[t][0]]=EJ(e,y):et(e,t)}));else C(M)&&(et({orient:M,mode:T},"x"),et({orient:M,mode:T},"y"));var st={x:null,y:null};return it.forEach((function(t){var e,i="x"===t?R:O,n="x"===t?j:H,r="x"===t?x:S,a=PJ($[t],t);if(z(Q[tt[t][0]]))st[t]=Q[tt[t][0]];else if(z(Q[tt[t][1]]))st[t]=n-i*J-Q[tt[t][1]];else{var o="x"===t?y.canvasX:y.canvasY;st[t]=a>0?o+r:0===a?o-i*J/2:o-i*J-r}st[t]*=G,X&&(st[t]+=U[t]),st[t]/=Y;var s="x"===t?V.width:V.height,l=f.confine?-(W[t]-(null!==(e=null==g?void 0:g[t])&&void 0!==e?e:0)/G)/Y:-W[t]/Y,u=s/Y+l-i;2!==a&&st[t]<l?N?st[t]=l:(st[t]+=0===a?r+i/2:2*r+i,st[t]>u&&(st[t]=u)):-2!==a&&st[t]>u&&(N?st[t]=u:(st[t]-=0===a?r+i/2:2*r+i,st[t]<l&&(st[t]=l)))})),st},t}return c(e,t),a(e,[{key:"env",get:function(){return this._env}},{key:"onAdd",value:function(t){_(e,"onAdd",this,3)([t]);var i=t.component;this._component=i,this._chartOption=i.getOption(),this._env=this._chartOption.mode,this._chartContainer=this._chartOption.globalInstance.getContainer(),this._compiler=i.getCompiler(),this._initFromSpec()}},{key:"hideTooltip",value:function(t){return this.changeTooltip(!1,t)}},{key:"release",value:function(){var t,e,i,n,r=null!==(e=null===(t=this._component)||void 0===t?void 0:t.getSpec())&&void 0!==e?e:{};r.handler?null===(n=(i=r.handler).release)||void 0===n||n.call(i):(this._removeTooltip(),this._isReleased=!0,this._chartOption=null,this._component=null)}},{key:"_getDefaultOption",value:function(){var t,e,i=this._component.getSpec().offset;return i?{offsetX:null!==(t=i.x)&&void 0!==t?t:AJ.offsetX,offsetY:null!==(e=i.y)&&void 0!==e?e:AJ.offsetY}:AJ}},{key:"_getParentElement",value:function(t){return t.parentElement}},{key:"getTooltipContainer",value:function(){return this._container}},{key:"_initFromSpec",value:function(){this._option=this._getDefaultOption()}},{key:"reInit",value:function(){this._initFromSpec()}}])}(zj);RJ.specKey="tooltip";var LJ=function(t,e){return C(t)?O(t)?t.map((function(t){return"".concat(t,"px")})).join(" "):"".concat(t,"px"):null!=e?e:"initial"},OJ=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};C(i.fontFamily)&&(n.fontFamily=i.fontFamily);var r=null!==(t=i.fill)&&void 0!==t?t:i.fontColor;return C(r)&&(n.color=r),C(i.fontWeight)&&(n.fontWeight=i.fontWeight),C(i.textAlign)&&(n.textAlign=i.textAlign),C(i.fontSize)&&(n.fontSize=LJ(i.fontSize)),C(i.maxWidth)&&(n.maxWidth=LJ(i.maxWidth)),i.multiLine||C(i.maxWidth)&&!1!==i.multiLine?(n.whiteSpace="initial",n.wordBreak=null!==(e=i.wordBreak)&&void 0!==e?e:"break-word"):(n.wordBreak="normal",n.whiteSpace="nowrap"),n},IJ=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.lineHeight;return t.fontSize?WL(e,t.fontSize):0},DJ=function(t){var e,i=t.backgroundColor,n=t.border,r=t.shadow,a=t.padding,o={borderWidth:"".concat(null!==(e=null==n?void 0:n.width)&&void 0!==e?e:0,"px")},s=null;(null==n?void 0:n.color)&&(o.borderColor=n.color),i&&(o.backgroundColor=i),o.boxShadow=r?"".concat(r.x,"px ").concat(r.y,"px ").concat(r.blur,"px ").concat(r.spread,"px ").concat(r.color):"initial";var l=(null!=n?n:{}).radius;return C(l)&&(o.borderRadius=z(l)?"".concat(l,"px"):"".concat(l)),a&&(s=ki(a),o.padding=LJ(s)),{panelStyle:o,panelPadding:s}};function FJ(t,e){t&&t.style&&e&&Object.keys(e).forEach((function(i){t.style[i]=e[i]}))}var jJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,[e.type])).type=DH.dom,t._tooltipContainer=null==ob?void 0:ob.body,t}return c(e,t),a(e,[{key:"getVisibility",value:function(){return!!this._rootDom&&"visible"===this._rootDom.style.visibility}},{key:"setVisibility",value:function(t){t!==this.getVisibility()&&this._rootDom&&(this._rootDom.style.visibility=t?"visible":"hidden")}},{key:"getRootDom",value:function(){return this._rootDom}},{key:"onAdd",value:function(t){_(e,"onAdd",this,3)([t]),this._initStyle(),this.initEl()}},{key:"initEl",value:function(){var t=this._component.getSpec().parentElement;if(ob&&t&&t.children&&t.children.length){for(var e=0;e<t.children.length;e++)if(t.children[e].classList.contains(kJ)){this._container=t.children[e];break}this._container||(this._container=ob.createElement("div"),this._container.style.position="relative",this._container.style.zIndex=MJ,this._container.classList.add(kJ),t.appendChild(this._container))}}},{key:"initRootDom",value:function(){var t,e=this._component.getSpec(),i=document.createElement("div"),n=null===(t=this._chartOption)||void 0===t?void 0:t.getTheme("fontFamily");FJ(i,Object.assign({left:"0",top:"0",pointerEvents:"none",padding:"12px",position:"absolute",zIndex:MJ,fontFamily:null!=n?n:$L.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","".concat(this.id)),this._container.appendChild(i),this._rootDom=i}},{key:"_getTooltipBoxSize",value:function(t,e){var i;this._rootDom||this.initRootDom(),e||this._updateDomStringByCol(t),this._updateDomStyle("height",e);var n=null===(i=this._rootDom)||void 0===i?void 0:i.getBoundingClientRect();return{width:null==n?void 0:n.width,height:null==n?void 0:n.height}}},{key:"_removeTooltip",value:function(){this._rootDom&&this._rootDom.parentNode&&(this._rootDom.parentNode.removeChild(this._rootDom),this._rootDom=null),this._container=null}},{key:"_updateTooltip",value:function(t,e){var i,n;if(t&&this._rootDom){var r=e.tooltipSpec,a=e.activeTooltipSpec;e.changePositionOnly||(this._tooltipActual=a);var o=this._rootDom;if(o){var s=null!==(i=a.position)&&void 0!==i?i:{},l=s.x,u=void 0===l?0:l,c=s.y,h=void 0===c?0:c,d={x:u,y:h},v=this.getVisibility();r.updateElement&&(this._updatePosition(null!==(n=this._cacheCustomTooltipPosition)&&void 0!==n?n:{x:u,y:h}),r.updateElement(o,a,e),d=this._getActualTooltipPosition(a,e,{width:o.offsetWidth,height:o.offsetHeight}),this._cacheCustomTooltipPosition=d),!v&&t&&(this._rootDom.style.transition="none",this._updatePosition(d,!1),this._rootDom.getBoundingClientRect()),this._updatePosition(d)}this.setVisibility(t)}else this.setVisibility(t),this._cacheCustomTooltipPosition=void 0}},{key:"_initStyle",value:function(){var t=this._component.getSpec();this._domStyle=function(){var t,e,i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=r.style,o=void 0===a?{}:a,s=r.enterable,l=r.transitionDuration,u=o.panel,c=void 0===u?{}:u,h=o.titleLabel,d=o.shape,v=o.keyLabel,f=o.valueLabel,p=o.spaceRow,g=o.align,y=DJ(c),m=y.panelStyle,_=y.panelPadding,b={marginTop:"0px",marginBottom:"0px"};m.pointerEvents=s?"auto":"none",l&&(m.transitionDuration=l?"".concat(l,"ms"):"initial",m.transitionProperty=l?"transform":"initial",m.transitionTimingFunction=l?"ease-out":"initial"),z(p)&&(b.marginBottom="".concat(p,"px"));var k={width:LJ(null!==(t=null==d?void 0:d.size)&&void 0!==t?t:8)},x=OJ(h),S=OJ(v),A=OJ(f),M="right"===g?"marginLeft":"marginRight";"right"===g&&(m.direction="rtl"),T(x.textAlign)&&(x.textAlign="right"===g?"right":"left"),T(S.textAlign)&&(S.textAlign="right"===g?"right":"left"),T(A.textAlign)&&(A.textAlign="right"===g?"left":"right"),k[M]=LJ(null!==(e=d.spacing)&&void 0!==e?e:8),S[M]=LJ(null!==(i=v.spacing)&&void 0!==i?i:26),A[M]=LJ(null!==(n=f.spacing)&&void 0!==n?n:0);var w=Math.max(IJ(f),IJ(v));return b.lineHeight=w>0?"".concat(w,"px"):"20px",{panelPadding:_,row:b,panel:m,title:x,shape:k,key:S,value:A}}(t)}},{key:"_updateDomStringByCol",value:function(t){var e,i=this,n=t.title,r=void 0===n?{}:n,a=t.content,o=a&&a.length,s=this._domStyle.row,l=b(this._rootDom.children),u=l.find((function(t){return t.className.includes(xJ)})),c=l.find((function(t){return t.className.includes(SJ)}));if(!u&&!1!==r.visible){u=document.createElement("h2");var h=document.createElement("span");u.appendChild(h),u.classList.add(xJ),this._rootDom.firstChild?this._rootDom.insertBefore(u,this._rootDom.firstChild):this._rootDom.appendChild(u)}u&&!1!==r.visible?(FJ(u,Object.assign(Object.assign(Object.assign({},this._domStyle.title),o?s:{marginBottom:"0px"}),{marginTop:"0px"})),u.firstChild.innerHTML="".concat(null!==(e=r.value)&&void 0!==e?e:"")):u&&!1===r.visible&&u.parentNode.removeChild(u);var d=["shape","key","value"];if(!c&&o&&(c=document.createElement("div"),d.forEach((function(t){var e=document.createElement("div");e.classList.add("".concat(bJ,"-column")),e.classList.add("".concat(bJ,"-").concat(t,"-column")),e.setAttribute("data-col",t),c.appendChild(e)})),c.classList.add(SJ),this._rootDom.appendChild(c)),c&&o){var v=b(c.children);FJ(c,{whiteSpace:"nowrap"}),v.forEach((function(t,e){var n=t.getAttribute("data-col");if(n&&d.includes(n)){var r="shape"===n&&a.every((function(t){return!t.hasShape||!t.shapeType}));FJ(t,Object.assign(Object.assign({},i._domStyle[n]),{display:r?"none":"inline-block",verticalAlign:"top"}));var o=b(t.children);o.slice(a.length).forEach((function(t){t.parentNode.removeChild(t)})),a.forEach((function(e,r){var l=o[r];l||((l=document.createElement("div")).classList.add("".concat(bJ,"-").concat(n)),t.appendChild(l));var u=Object.assign({},s);r===a.length-1&&(u.marginBottom="0px"),u.display=!1===e.visible?"none":"block",u.height="initial","key"===n?(l.innerHTML=CJ(e.key),e.keyStyle&&OJ(e.keyStyle,u)):"value"===n?(l.innerHTML=CJ(e.value),e.valueStyle&&OJ(e.valueStyle,u)):"shape"===n&&(l.innerHTML=function(t,e){var i,n,r,a,o,s;if(!t||!t.hasShape||!t.shapeType)return"";var l,u,c='style="display:inline-block;vertical-align:middle;"',h=t.shapeType,d=t.shapeStroke,v=t.shapeHollow,f=void 0!==v&&v,p=t.shapeFill,g=null!==(i=t.shapeSize)&&void 0!==i?i:8,y=t.shapeLineWidth?wJ(t.shapeLineWidth)+"px":"0px",_="currentColor",b=function(){return d?wJ(d):_},k=g,x=function(t){return new Wf({symbolType:t,size:k,fill:!0})},S=x(h),A=S.getParsedPath();if(!A.path&&A.pathStr&&(S=x(A.pathStr)),S.getParsedPath().path){var M=S.getParsedPath().path;u=M.toString(),l=M.bounds}else A.isSvg&&A.svgCache&&(u=A.svgCache.map((function(t){return t.path.toString()})).join(),l=A.svgCache.reduce((function(t,e){return t.union(e.path.bounds)}),new ii));var w="".concat(l.x1," ").concat(l.y1," ").concat(l.width()," ").concat(l.height());if("0px"!==y){var T=w.split(" ").map((function(t){return Number(t)})),C=m(T,4),B=C[0],P=C[1],R=C[2],O=C[3],I=Number(y.slice(0,-2));w="".concat(B-I/2," ").concat(P-I/2," ").concat(R+I," ").concat(O+I)}var D=Ru.IsGradientStr(p);if(!p||L(p)&&!D||f)return _=f?"none":p?wJ(p):"currentColor","\n <svg ".concat(c,' width="').concat(g,'" height="').concat(g,'" viewBox="').concat(w,'">\n <path\n d="').concat(u,'"\n style="fill: ').concat(_,"; stroke: ").concat(b(),"; stroke-width: ").concat(y,'"\n >\n </path>\n </svg>');var F=D?Ru.Parse(p):E(p)?p:null;if(F){_="gradientColor"+(null!=e?e:"");var j="",z=(null!==(n=F.stops)&&void 0!==n?n:[]).map((function(t){return'<stop offset="'.concat(wJ(t.offset.toString()),'" stop-color="').concat(wJ(t.color),'"/>')})).join("");return"radial"===F.gradient?j='<radialGradient id="'.concat(_,'" cx="50%" cy="50%" r="50%" fx="0%" fy="0%">\n ').concat(z,"\n </radialGradient>"):"linear"===F.gradient&&(j='<linearGradient id="'.concat(_,'" x1="').concat(100*(null!==(r=F.x0)&&void 0!==r?r:0),'%" y1="').concat(100*(null!==(a=F.y0)&&void 0!==a?a:0),'%" x2="').concat(100*(null!==(o=F.x1)&&void 0!==o?o:0),'%" y2="').concat(100*(null!==(s=F.y1)&&void 0!==s?s:0),'%">\n ').concat(z,"\n </linearGradient>")),"\n <svg ".concat(c,' width="').concat(g,'" height="').concat(g,'" viewBox="-0.5 -0.5 1 1">\n ').concat(j,'\n <path\n d="').concat(u,'"\n style="fill: url(#').concat(_,"); stroke: ").concat(b(),"; stroke-width: ").concat(y,'"\n >\n </path>\n </svg>')}return""}(e,"".concat(i.id,"_").concat(r))),FJ(l,u)}))}}))}else c&&!o&&c.parentNode.removeChild(c)}},{key:"_updateDomStyle",value:function(){var t,e,i,n,r,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"width",o=arguments.length>1?arguments[1]:void 0,s=this._rootDom,l=b(s.children).find((function(t){return t.className.includes(SJ)})),u=b(s.children).find((function(t){return t.className.includes(xJ)}));if(l){var c=this._component.getSpec(),h={},d=null===(t=c.style)||void 0===t?void 0:t.titleLabel;if(d&&d.autoWidth&&!1!==d.multiLine&&u){var v=b(l.children).reduce((function(t,e){return"height"===a?t+e.getBoundingClientRect().width:Math.max(t,e.getBoundingClientRect().width)}),0);v>0&&(u.style.maxWidth="".concat(v,"px"),u.style.maxWidth="".concat(Math.ceil(l.getBoundingClientRect().width),"px"))}if(C(null===(e=null==c?void 0:c.style)||void 0===e?void 0:e.maxContentHeight)){var f=u&&u.className.includes(xJ)?u.getBoundingClientRect().height+(null!==(i=c.style.spaceRow)&&void 0!==i?i:0):0,p=this._chartOption.getChartViewRect(),g=WL(c.style.maxContentHeight,Math.min(p.height,document.body.clientHeight)-f-(this._domStyle.panelPadding?this._domStyle.panelPadding[0]+this._domStyle.panelPadding[1]:0));g>0&&(h.maxHeight="".concat(g,"px"),h.overflowY="auto",h.width="calc(100% + ".concat(this._domStyle.panelPadding?this._domStyle.panelPadding[1]+"px":"10px",")"),FJ(l,h))}var y=l.children,m=[];if(y){for(var _=0;_<y.length;_++)for(var k=null!==(n=y[_].children)&&void 0!==n?n:[],x=0;x<k.length;x++){o&&(k[x].style[a]="initial");var S=k[x].getBoundingClientRect()[a];(void 0===m[x]||m[x]<S)&&(m[x]=S)}for(var A=0;A<y.length;A++)for(var M=null!==(r=y[A].children)&&void 0!==r?r:[],w=0;w<M.length;w++)M[w].style[a]="".concat(m[w],"px")}}}},{key:"_getParentElement",value:function(t){var i;return null!==(i=this._container)&&void 0!==i?i:_(e,"_getParentElement",this,3)([t])}},{key:"isTooltipShown",value:function(){return this.getVisibility()}},{key:"reInit",value:function(){_(e,"reInit",this,3)([]),this._initStyle(),this._rootDom&&FJ(this._rootDom,this._domStyle.panel),this.getVisibility()&&(this._updateDomStringByCol(this._tooltipActual),this._updateDomStyle("height",!1))}},{key:"_updatePosition",value:function(t){var e=t.x,i=t.y,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._rootDom&&(this._rootDom.style.transform="translate3d(".concat(e,"px, ").concat(i,"px, 0)"),n&&""!==this._rootDom.style.transition&&(this._rootDom.style.transition="",Object.assign(this._rootDom.style,this._domStyle.panel)))}}])}(RJ);jJ.type=DH.dom;var zJ={fontFamily:$L.fontFamily,spacing:10,wordBreak:"break-word"},HJ=function(t,e){var i,n,r;"rich"!==(null==t?void 0:t.type)&&"html"!==(null==t?void 0:t.type)?(t=(null!=t?t:"").toString(),n=e.multiLine?(n=t.split("\n")).map((function(t,e){return e<n.length-1?t+"\n":t})):[t],r=n.map((function(t){return Object.assign(Object.assign({},e),{text:t})}))):(r=t.text,n=t);var a,o=(a={wordBreak:null!==(i=e.wordBreak)&&void 0!==i?i:"break-word",maxWidth:e.maxWidth?e.maxWidth:void 0,width:0,height:0,textConfig:r},Ep||(Ep=Bp.CreateGraphic("richtext",{})),Ep.setAttributes(a),Ep.AABBBounds);return{width:o.width(),height:o.height(),text:n}};function NJ(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;return Object.assign(Object.assign({},null!=r?r:zJ),{fill:null!==(t=i.fill)&&void 0!==t?t:i.fontColor,textAlign:i.textAlign,textBaseline:i.textBaseline,fontFamily:null!==(e=i.fontFamily)&&void 0!==e?e:n,fontSize:i.fontSize,fontWeight:i.fontWeight,lineHeight:i.lineHeight,spacing:i.spacing,multiLine:C(i.maxWidth)?!1!==i.multiLine:i.multiLine,maxWidth:i.maxWidth,wordBreak:i.wordBreak,autoWidth:i.autoWidth})}var VJ=function(t){var e,i=t.backgroundColor,n=t.border,r=t.shadow,a={lineWidth:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:0,shadow:!!r};(null==n?void 0:n.color)&&(a.stroke=n.color),i&&(a.fill=i),r&&(a.shadowColor=r.color,a.shadowBlur=r.blur,a.shadowOffsetX=r.x,a.shadowOffsetY=r.y,a.shadowSpread=r.spread);var o=(null!=n?n:{}).radius;return C(o)&&(a.cornerRadius=[o,o,o,o]),a},UJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,[e.type])).type=DH.canvas,t._attributes=null,t}return c(e,t),a(e,[{key:"onAdd",value:function(t){var i;_(e,"onAdd",this,3)([t]),this._tooltipCanvasId=null===(i=this._chartOption.modeParams)||void 0===i?void 0:i.tooltipCanvasId}},{key:"_initTooltipComponent",value:function(t){var e=this._getLayer(t);this._tooltipComponent=new oL({autoCalculatePosition:!1,autoMeasure:!1}),e.add(this._tooltipComponent)}},{key:"_getLayer",value:function(t){if(this._layer)return this._layer;this._layer=t.createLayer(this._tooltipCanvasId);var e=this._layer.layerHandler.canvas.nativeCanvas;return e&&e.style&&(e.style.touchAction="none",e.style.pointerEvents="none"),this._layer}},{key:"_getTooltipBoxSize",value:function(t,e){var i,n;if(!e||T(this._attributes)){var r=null===(i=this._chartOption)||void 0===i?void 0:i.getTheme("fontFamily");this._attributes=function(t,e,i){var n,r,a,o,s,l=e.style,u=void 0===l?{}:l,c=e.enterable,h=e.transitionDuration,d=u.panel,v=void 0===d?{}:d,f=u.titleLabel,p=u.shape,g=u.keyLabel,y=u.valueLabel,m=u.spaceRow,_=u.align,b=ki(v.padding),k=XL(v.padding),x=NJ(Object.assign({textAlign:"right"===_?"right":"left"},f),i),S=NJ(Object.assign({textAlign:"right"===_?"right":"left"},g),i),A=NJ(y,i),M={fill:!0,size:null!==(n=null==p?void 0:p.size)&&void 0!==n?n:8,spacing:null!==(r=null==p?void 0:p.spacing)&&void 0!==r?r:6},w={panel:VJ(v),padding:b,title:{},content:[],titleStyle:{value:x,spaceRow:m},contentStyle:{shape:M,key:S,value:A,spaceRow:m},hasContentShape:!1,keyWidth:0,valueWidth:0,enterable:c,transitionDuration:h,align:_},T=t.title,E=void 0===T?{}:T,B=t.content,P=void 0===B?[]:B,R=k.left+k.right,L=k.top+k.bottom,O=0,I=!!P.length,D=0,F=0,j=0,z=0;if(I){var H=[],N=[],V=[],U=[],W=0;w.content=P.map((function(t,e){var i=0,n=t.hasShape,r=t.key,a=t.shapeType,o=void 0===a?"":a,s=t.shapeFill,l=t.shapeStroke,u=t.shapeLineWidth,c=t.shapeSize,h=t.value,d=t.isKeyAdaptive,v=t.spaceRow,f=t.keyStyle,p=t.valueStyle,g=t.shapeHollow,y={height:0,spaceRow:null!=v?v:m};if(C(r)){var _=nO({},S,NJ(f,void 0,{})),b=HJ(r,_),k=b.width,x=b.height,w=b.text;y.key=Object.assign(Object.assign({width:k,height:x},_),{text:w}),d?N.push(k):H.push(k),i=Math.max(i,x)}if(C(h)){var T=nO({},A,NJ(p,void 0,{})),E=HJ(h,T),B=E.width,R=E.height,L=E.text;y.value=Object.assign(Object.assign({width:B,height:R},T),{text:L}),V.push(B),i=Math.max(i,R)}if(n){var O={visible:!0,symbolType:o};g?O.stroke=s:O.fill=s,O.stroke=null!=l?l:s,O.lineWidth=u,y.shape=O;var I=null!=c?c:M.size;i=Math.max(I,i),U.push(I)}else y.shape={visible:!1};return y.height=i,W+=i,e<P.length-1&&(W+=y.spaceRow),y})),L+=W,D=H.length?ct(H):0,F=N.length?ct(N):0,j=V.length?ct(V):0,z=U.length?ct(U)+M.spacing:0,O=Math.max(z+D+S.spacing+j+A.spacing,z+F,O),w.hasContentShape=!!U.length,w.keyWidth=D,w.valueWidth=j}var G=0,Y=0,X=0,K=E.visible,q=void 0===K||K,Z=E.value,J=void 0===Z?"":Z,Q=E.valueStyle,$=E.spaceRow;w.title.visible=q,w.title.spaceRow=null!=$?$:m;var tt={},et=function(){return tt.autoWidth&&!1!==tt.multiLine};if(q){tt=nO({},x,NJ(Q,void 0,{})),et()&&(tt.multiLine=null===(a=tt.multiLine)||void 0===a||a,tt.maxWidth=null!==(o=tt.maxWidth)&&void 0!==o?o:I?Math.ceil(O):void 0);var it=HJ(J,tt),nt=it.text,rt=it.width,at=it.height;w.title.value=Object.assign(Object.assign({width:et()?Math.min(rt,null!==(s=tt.maxWidth)&&void 0!==s?s:Number.MAX_VALUE):rt,height:at},tt),{text:nt}),G=w.title.value.width,X=(Y=w.title.value.height)+(I?w.title.spaceRow:0)}return L+=X,w.title.width=G,w.title.height=Y,et()?R+=O||G:R+=Math.max(G,O),I&&w.content.forEach((function(t){var e,i=t.value;i&&(null===(e=i.autoWidth)||void 0===e||e)&&(i.width=R-k.left-k.right-z-D-S.spacing-A.spacing,i.maxWidth||(i.maxWidth=Math.ceil(i.width)),w.valueWidth=Math.max(w.valueWidth,i.width))})),w.panel.width=R,w.panel.height=L,w}(t,this._component.getSpec(),r)}var a=(null!==(n=this._attributes)&&void 0!==n?n:{}).panel;return{width:a.width+a.lineWidth,height:a.height+a.lineWidth}}},{key:"_removeTooltip",value:function(){this._layer&&this._layer.removeAllChild(),this._attributes=null}},{key:"_updateTooltip",value:function(t,e){this._visible=t;var i=this._compiler.getStage();if(i)if(t){this._tooltipComponent||this._initTooltipComponent(i);var n=e.activeTooltipSpec.position;e.changePositionOnly?C(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}))}else this._tooltipComponent&&this._tooltipComponent.attribute.visible&&(this._tooltipComponent.hideAll(),this._tooltipComponent.setAttributes({visibleAll:!1}))}},{key:"isTooltipShown",value:function(){var t;return null===(t=this._tooltipComponent)||void 0===t?void 0:t.attribute.visibleAll}},{key:"release",value:function(){var t;_(e,"release",this,3)([]),null===(t=this._layer)||void 0===t||t.release()}}])}(RJ);UJ.type=DH.canvas;var WJ=/\{([^}]+)\}/,GJ=/\{([^}]+)\}/g,YJ=/:/,XJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,[e.type])).type="formatterPlugin",t._timeModeFormat={utc:Ri.getInstance().timeUTCFormat,local:Ri.getInstance().timeFormat},t._formatter=t._format,t._timeFormatter=t._timeModeFormat.local,t._numericFormatter=zi.getInstance().format,t._numericSpecifier=zi.getInstance().formatter,t._numericFormatterCache=new Map,t._isNumericFormatterCache=new Map,t}return c(e,t),a(e,[{key:"onInit",value:function(t,i){var n;if(t.globalInstance){this._spec=null!==(n=null==i?void 0:i[e.specKey])&&void 0!==n?n:{};var r=this._spec,a=r.timeMode,o=r.customFormatter,s=r.numericFormatter,l=r.timeFormatter;w(o)?this._formatter=o:(this._formatter=this._format.bind(this),w(l)?this._timeFormatter=l:a&&this._timeModeFormat[a]&&(this._timeFormatter=this._timeModeFormat[a]),s&&(this._numericFormatter=s,this._numericSpecifier=null,this._numericFormatterCache=null)),rO.registerFormatter(this._formatter)}}},{key:"_format",value:function(t,e,i){var n=this;return O(t)?t.map((function(t,r){var a=O(i)?i[r]:i;return a?n._formatSingleLine(t,e,a):t})):O(i)?i.map((function(i){return n._formatSingleLine(t,e,i)})):this._formatSingleLine(t,e,i)}},{key:"_formatSingleLine",value:function(t,e,i){var n,r=this;if(this._isNumericFormatterCache&&(this._isNumericFormatterCache.get(i)?n=this._isNumericFormatterCache.get(i):(n=WJ.test(i),this._isNumericFormatterCache.set(i,n))),n){var a=i.replace(GJ,(function(t,i){if(!YJ.test(i)){var n=e[i.trim()];return void 0!==n?n:t}var a=i.split(":"),o=e[a.shift()],s=a.join(":");return r._formatSingleText(o,s)}));return a}return this._formatSingleText(t,i)}},{key:"_formatSingleText",value:function(t,e){var i;return Di.test(e)&&this._numericFormatter?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)):e.includes("%")&&this._timeFormatter?this._timeFormatter(e,t):e.startsWith("calc(")?this._calcFormatter(e,t):t}},{key:"_calcFormatter",value:function(t,e){try{var i=t.slice(5,-1).replace(/v/g,String(e));return this._calculateMathExpression(i,e)}catch(t){return e}}},{key:"_calculateMathExpression",value:function(t,e){var i=t.replace(/\s+/g,"");if(!this._isValidMathExpression(i))return e;try{var n=new Function("return ("+i+")")();if("number"!=typeof n||isNaN(n)||!isFinite(n))throw new Error("Invalid calculation result");return n}catch(t){return e}}},{key:"_isValidMathExpression",value:function(t){return/^[0-9+\-*/().]+$/.test(t)}},{key:"release",value:function(){_(e,"release",this,3)([]),this._format=null,this._timeFormatter=null,this._numericFormatter=null,this._numericSpecifier=null,this._numericFormatterCache=null,this._isNumericFormatterCache=null}}])}(zj);XJ.pluginType="chart",XJ.specKey="formatter",XJ.type="formatterPlugin",hF.useRegisters([function(){HH(),VH(),WH(),mH(),yH(),eH(),Yz(),Cj(),Bj(),tF(),JD(),zz(),Iz(),rO.registerSeries(iH.type,iH),rO.registerChart(GH.type,GH)},function(){HH(),VH(),WH(),yH(),eH(),Yz(),Cj(),KH(),Bj(),JH(),zz(),Iz(),rO.registerSeries($H.type,$H),mH(),rO.registerChart(eN.type,eN)},function(){HH(),VH(),WH(),yH(),pN(),mH(),rO.registerChart(yN.type,yN)},function(){HH(),VH(),mH(),yH(),TN(),rO.registerChart(EN.type,EN)},function(){VH(),AU(),rO.registerChart(yK.type,yK)},function(){HH(),VH(),mH(),yH(),VU(),rO.registerChart(bK.type,bK)},function(){HH(),VH(),WH(),mH(),yH(),JU(),rO.registerChart(xK.type,xK)},function(){HH(),VH(),WH(),mH(),yH(),pN(),rO.registerTransform("bin",co),rO.registerChart(CK.type,CK)},function(){VH(),WN(),ON(),rO.registerSeries(YN.type,YN),rO.registerImplement("registerMap",OI),rO.registerImplement("unregisterMap",II),QD(),rO.registerChart(hK.type,hK)},function(){VH(),EX(),rO.registerSeries(PX.type,PX),mU(),dW(),jU(),pW(),rO.registerChart(RK.type,RK)},function(){VH(),iY(),rO.registerChart(IK.type,IK)},function(){VH(),SY(),rO.registerChart(FK.type,FK)},function(){HH(),VH(),WH(),mH(),yH(),xV(),rO.registerChart(qK.type,qK)},function(){HH(),VH(),mH(),yH(),UV(),rO.registerTransform("boxplot",ho),rO.registerChart(JK.type,JK)},function(){HH(),VH(),mH(),yH(),pW(),rO.registerChart(BK.type,BK)},function(){HH(),VH(),mH(),yH(),xW(),rO.registerChart(zK.type,zK)},function(){HH(),VH(),mH(),yH(),iU(),rO.registerChart(NK.type,NK)},function(){HH(),VH(),WH(),mH(),yH(),KH(),zz(),Iz(),rO.registerSeries(aU.type,aU),rO.registerChart(eq.type,eq)},function(){VH(),HY(),rO.registerChart(UK.type,UK)},function(){VH(),YY(),rO.registerChart(GK.type,GK)},function(){VH(),_X(),rO.registerChart(XK.type,XK)},function(){VH(),Hs.load(RM),hX(),rO.registerChart($K.type,$K)},function(){VH(),jX(),rO.registerChart(nq.type,nq)},function(){VH(),JX(),rO.registerChart(aq.type,aq)},function(){HH(),VH(),WH(),mH(),rO.registerChart(AK.type,AK),yH()},Iz,zz,function(){rO.registerGraphicComponent(uz.lineAxis,(function(t,e){return new XC(t,e)})),rO.registerGraphicComponent(cz.lineAxisGrid,(function(t,e){return new rP(t,e)})),mz(),rO.registerComponent(Hz.type,Hz)},function(){rO.registerGraphicComponent(uz.lineAxis,(function(t,e){return new XC(t,e)})),rO.registerGraphicComponent(cz.lineAxisGrid,(function(t,e){return new rP(t,e)})),mz(),rO.registerComponent(Nz.type,Nz)},function(){rO.registerGraphicComponent(uz.lineAxis,(function(t,e){return new XC(t,e)})),rO.registerGraphicComponent(cz.lineAxisGrid,(function(t,e){return new rP(t,e)})),mz(),rO.registerComponent(Vz.type,Vz)},HU,jU,function(){rO.registerComponent(cq.type,cq)},function(){rO.registerComponent(kq.type,kq)},function(){rO.registerComponent(Lq.type,Lq)},function(){rO.registerComponent(Fq.type,Fq)},function(){rO.registerComponent(jq.type,jq)},function(){rO.registerComponent($q.type,$q)},function(){rO.registerComponent(eZ.type,eZ)},function(){rO.registerComponent(aZ.type,aZ)},WN,function(){rO.registerComponent(VZ.type,VZ),iR()},function(){rO.registerComponent(XZ.type,XZ),rR()},function(){rO.registerComponent(hJ.type,hJ),lR()},function(){rO.registerComponent(UZ.type,UZ),oR._animate=FP,iR()},function(){rO.registerComponent(KZ.type,KZ),sR._animate=zP,rR()},function(){rO.registerComponent(dJ.type,dJ),lR()},function(){rO.registerComponent(vJ.type,vJ),lR()},function(){rO.registerComponent(WZ.type,WZ)},function(){rO.registerComponent(eJ.type,eJ)},function(){rO.registerGraphicComponent(oJ.type,(function(t){return new tP(t)})),rJ(),pz(),rO.registerComponent(oJ.type,oJ,!0,1/0)},function(){rO.registerGraphicComponent(sJ.type,(function(t){return new tP(t)})),rJ(),pz(),rO.registerComponent(sJ.type,sJ,!0)},function(){rO.registerComponent(gJ.type,gJ)},function(){rO.registerComponent(yJ.type,yJ)},function(){Hs.load(kw)},function(){rO.registerLayout(mJ.type,mJ)},function(){var t;t=UJ,rO.registerComponentPlugin(t.type,t)},function(){var t;t=XJ,rO.registerChartPlugin(t.type,t)},oF,uF]),hF.useRegisters([function(){oS(Hs)}]),t.DEFAULT_CHART_HEIGHT=EO,t.DEFAULT_CHART_WIDTH=CO,t.DEFAULT_CLOSE_STROKE_JOIN=fF,t.DEFAULT_DATA_INDEX=PO,t.DEFAULT_DATA_KEY=RO,t.DEFAULT_DATA_SERIES_FIELD=LO,t.DEFAULT_KEY=QO,t.DEFAULT_LAYOUT_RECT_LEVEL=0,t.DEFAULT_LAYOUT_RECT_LEVEL_MIN=-1,t.DEFAULT_LINEAR_INTERPOLATE=vF,t.DEFAULT_MAP_LOOK_UP_KEY=$O,t.DEFAULT_MEASURE_CANVAS_ID=BO,t.DEFAULT_SERIES_STYLE_NAME=OO,t.DEFAULT_SMOOTH_INTERPOLATE=dF,t.Factory=rO,t.MOSAIC_CAT_END_PERCENT=qO,t.MOSAIC_CAT_START_PERCENT=KO,t.MOSAIC_VALUE_END_PERCENT=XO,t.MOSAIC_VALUE_START_PERCENT=YO,t.ManualTicker=function(t){function e(t){var r;return n(this,e),(r=i(this,e,[t])).lastFrameTime=0,r.status=Ls.RUNNING,r}return c(e,t),a(e,[{key:"setupTickHandler",value:function(){var t=new ET;return this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}},{key:"checkSkip",value:function(t){return!1}},{key:"getTime",value:function(){return this.tickerHandler.getTime()}},{key:"tickAt",value:function(t){this.tickTo(t)}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===Ls.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Ls.PAUSE)return!1;if(this.ifCanStop())return!1}return this.status=Ls.RUNNING,!0}}])}(CT),t.PREFIX=TO,t.SEGMENT_FIELD_END=JO,t.SEGMENT_FIELD_START=ZO,t.STACK_FIELD_END=FO,t.STACK_FIELD_END_OffsetSilhouette=NO,t.STACK_FIELD_END_PERCENT=zO,t.STACK_FIELD_KEY=IO,t.STACK_FIELD_START=DO,t.STACK_FIELD_START_OffsetSilhouette=HO,t.STACK_FIELD_START_PERCENT=jO,t.STACK_FIELD_TOTAL=VO,t.STACK_FIELD_TOTAL_BOTTOM=GO,t.STACK_FIELD_TOTAL_PERCENT=UO,t.STACK_FIELD_TOTAL_TOP=WO,t.StreamLight=function(t){function e(t,r,a,o,s){return n(this,e),i(this,e,[t,r,a,o,s])}return c(e,t),a(e,[{key:"getEndProps",value:function(){return{}}},{key:"onStart",value:function(){this.target&&("rect"===this.target.type?this.onStartRect():"line"===this.target.type?this.onStartLineOrArea("line"):"area"===this.target.type&&this.onStartLineOrArea("area"))}},{key:"onStartLineOrArea",value:function(t){var e,i=this.target.attachShadow(),n=Vs.graphicService.creator[t](Object.assign({},null===(e=this.params)||void 0===e?void 0:e.attribute));this[t]=n,n.pathProxy=new au,i.add(n)}},{key:"onStartRect",value:function(){var t,e,i,n=this.target.attachShadow(),r=null===(e=null===(t=this.params)||void 0===t?void 0:t.isHorizontal)||void 0===e||e,a=r?"height":"width",o=r?"width":"height",l=this.target.AABBBounds[a](),u=r?0:this.target.AABBBounds.y1,c=Vs.graphicService.creator.rect(Object.assign(Object.assign(s(s(s(s({},a,l),"fill","#bcdeff"),"shadowBlur",30),"shadowColor","#bcdeff"),null===(i=this.params)||void 0===i?void 0:i.attribute),s({x:0,y:u},o,0)));this.rect=c,n.add(c)}},{key:"onBind",value:function(){}},{key:"onEnd",value:function(){this.target.detachShadow()}},{key:"onUpdate",value:function(t,e,i){return this.rect?this.onUpdateRect(t,e,i):this.line||this.area?this.onUpdateLineOrArea(t,e,i):void 0}},{key:"onUpdateRect",value:function(t,e,i){var n,r,a,o,s,l,u,c,h,d,v,f,p,g,y,m,_=null===(r=null===(n=this.params)||void 0===n?void 0:n.isHorizontal)||void 0===r||r,b=this.target.attribute;if(_){var k=null!==(o=null!==(a=b.width)&&void 0!==a?a:Math.abs(b.x1-b.x))&&void 0!==o?o:250,x=null!==(l=null===(s=this.params)||void 0===s?void 0:s.streamLength)&&void 0!==l?l:k,S=null!==(h=null===(c=null===(u=this.params)||void 0===u?void 0:u.attribute)||void 0===c?void 0:c.width)&&void 0!==h?h:60,A=-S,M=A+(x-A)*e,w=Math.max(M,0),T=Math.min(Math.min(M+S,S),x-M),C=T+w>k?Math.max(k-w,0):T;this.rect.setAttributes({x:w+Math.min(b.x1-b.x,0),width:C},!1,{type:al.ANIMATE_PLAY,animationState:{ratio:e,end:t}})}else{var E,B=null!==(v=null!==(d=b.height)&&void 0!==d?d:Math.abs(b.y1-b.y))&&void 0!==v?v:250,P=null!==(p=null===(f=this.params)||void 0===f?void 0:f.streamLength)&&void 0!==p?p:B,R=null!==(m=null===(y=null===(g=this.params)||void 0===g?void 0:g.attribute)||void 0===y?void 0:y.height)&&void 0!==m?m:60,L=B-(P+R)*e,O=Math.min(L,B),I=Math.min(B-L,R);O<=0?(E=Math.max(O+I,0),O=0):E=I,this.rect.setAttributes({y:O+Math.min(b.y1-b.y,0),height:E},!1,{type:al.ANIMATE_PLAY,animationState:{ratio:e,end:t}})}}},{key:"onUpdateLineOrArea",value:function(t,e,i){var n=this.line||this.area;if(n){var r=n.pathProxy,a=this.target;a.cache||a.cacheArea?this._onUpdateLineOrAreaWithCache(r,a,t,e,i):this._onUpdateLineWithoutCache(r,a,t,e,i);var o=a.attribute;n.setAttributes(Object.assign({stroke:o.stroke},n.attribute)),n.addUpdateBoundTag()}}},{key:"_onUpdateLineOrAreaWithCache",value:function(t,e,i,n,r){var a,o;if(t.clear(),"line"===e.type){var s=e.cache;Array.isArray(s)||(s=[s]);var l=s.reduce((function(t,e){return t+e.getLength()}),0),u=[];return s.forEach((function(t){t.curves.forEach((function(t){return u.push(t)}))})),this._updateCurves(t,u,l,n)}if("area"===e.type&&(null===(o=null===(a=e.cacheArea)||void 0===a?void 0:a.top)||void 0===o?void 0:o.curves)){var c=e.cacheArea,h=c.top.curves.reduce((function(t,e){return t+e.getLength()}),0);return this._updateCurves(t,c.top.curves,h,n)}}},{key:"_updateCurves",value:function(t,e,i,n){for(var r,a,o=i*n,s=Math.min(o+(null!==(a=null===(r=this.params)||void 0===r?void 0:r.streamLength)&&void 0!==a?a:10),i),l=0,u=!1,c=0;c<e.length;c++)if(!1!==e[c].defined){var h=e[c],d=h.getLength(),v=1-(l+d-o)/d,f=void 0,p=1-(l+d-s)/d;if(l<o&&l+d>o)if(u=!0,h.p2&&h.p3){var g=m(Ml(h,v),2);g[0];var y=g[1];t.moveTo(y.p0.x,y.p0.y),f=y}else{var _=h.getPointAt(v);t.moveTo(_.x,_.y)}if(l<s&&l+d>s){if(h.p2&&h.p3){f&&(p=(s-o)/f.getLength());var b=m(Ml(f||h,p),1)[0];t.bezierCurveTo(b.p1.x,b.p1.y,b.p2.x,b.p2.y,b.p3.x,b.p3.y)}else{var k=h.getPointAt(p);t.lineTo(k.x,k.y)}break}if(u)if(h.p2&&h.p3){var x=f||h;t.bezierCurveTo(x.p1.x,x.p1.y,x.p2.x,x.p2.y,x.p3.x,x.p3.y)}else t.lineTo(h.p1.x,h.p1.y);l+=d}}},{key:"_onUpdateLineWithoutCache",value:function(t,e,i,n,r){var a,o,s=e.attribute,l=s.points,u=s.curveType;if(l&&!(l.length<2)&&"linear"===u){for(var c=0,h=1;h<l.length;h++)c+=ke.distancePP(l[h],l[h-1]);for(var d=c*n,v=Math.min(d+(null!==(o=null===(a=this.params)||void 0===a?void 0:a.streamLength)&&void 0!==o?o:10),c),f=[],p=0,g=1;g<l.length;g++){var y=ke.distancePP(l[g],l[g-1]);if(p<d&&p+y>d&&f.push(ke.pointAtPP(l[g-1],l[g],1-(p+y-d)/y)),p<v&&p+y>v){f.push(ke.pointAtPP(l[g-1],l[g],1-(p+y-v)/y));break}f.length&&f.push(l[g]),p+=y}if(f.length&&!(f.length<2)){t.clear(),t.moveTo(f[0].x,f[0].y);for(var m=1;m<f.length;m++)t.lineTo(f[m].x,f[m].y)}}}}])}(UT),t.ThemeManager=bO,t.USER_LAYOUT_RECT_LEVEL=9,t.VChart=hF,t.boundsInRect=YL,t.builtinThemes=uO,t.calcLayoutNumber=WL,t.calcPadding=GL,t.computeActualDataScheme=CL,t.convertPoint=KL,t.createArc=xp,t.createArea=_p,t.createGroup=Kv,t.createLine=Kf,t.createRect=Qf,t.createRichText=vp,t.createSymbol=Gf,t.createText=Vf,t.darkTheme=eO,t.dataScheme=ZL,t.default=hF,t.defaultThemeName=cO,t.getActualColor=BL,t.getActualNumValue=qL,t.getColorSchemeBySeries=OL,t.getDataScheme=TL,t.getFunnelTheme=sO,t.getMergedTheme=mO,t.getSpecInfo=yF,t.getTheme=pO,t.hasThemeMerged=vO,t.isColorKey=PL,t.isPercent=VL,t.isPercentOffset=UL,t.isProgressiveDataColorScheme=RL,t.isTokenKey=QL,t.isValidOrient=NL,t.lightTheme=tO,t.lookup=mF,t.measureText=wO,t.normalizeLayoutPaddingSpec=XL,t.queryColorFromColorScheme=EL,t.queryToken=JL,t.registerDataSetInstanceParser=BI,t.registerDataSetInstanceTransform=EI,t.registerTheme=fO,t.removeTheme=gO,t.themeExist=yO,t.themes=hO,t.token=$L,t.transformColorSchemeToStandardStruct=LL,t.transformToGraphic=pI,t.version="2.0.12",t.vglobal=zm,t.warn=ib,Object.defineProperty(t,"__esModule",{value:!0})})(M.exports);var w=A(M.exports);Component({properties:{styles:{type:String},canvasId:{type:String},spec:{type:Object,observer:function(t,e){this.chart&&JSON.stringify(t)!==JSON.stringify(e)&&this.chart.updateSpec(t)}},options:{type:Object,value:{}},events:{type:Object,value:[]}},data:{offscreenCanvasWidth:0,offscreenCanvasHeight:0,chart:void 0},detached:function(){this.chart&&this.chart.release()},ready:function(){var t=this;this.data.spec&&this.data.canvasId?(tt.onWindowResize((function(e){t.init()})),this.init()):console.warn("组件需绑定 spec 变量并且设置唯一 canvas-id")},methods:{init:function(){var t=this;tt.createSelectorQuery().in(this).select("#".concat(this.data.canvasId,"_draw_canvas")).boundingClientRect((function(e){if(e){t.setData({offscreenCanvasWidth:e.width,offscreenCanvasHeight:e.height}),t.chart&&t.chart.release();var i=new w(v(v({},t.data.spec),{},{width:e.width,height:e.height}),v({mode:"miniApp",modeParams:{domref:e,force:!0,canvasIdLists:["".concat(t.data.canvasId,"_draw_canvas"),"".concat(t.data.canvasId,"_tooltip_canvas"),"".concat(t.data.canvasId,"_hit_canvas")],tooltipCanvasId:"".concat(t.data.canvasId,"_tooltip_canvas"),freeCanvasIdx:2},dpr:tt.getSystemInfoSync().pixelRatio,renderCanvas:"".concat(t.data.canvasId,"_draw_canvas")},t.data.options));t.chart=i,t.triggerEvent("chartinit"),t.data.events&&t.data.events.forEach((function(t){t&&i.on(t.type,v(v({},t.query),{},{source:"chart"}),t.handler)})),i.renderAsync().then((function(e){t.triggerEvent("chartready")}))}else console.error("未找到 #".concat(t.data.canvasId," 组件"))})).exec()},bindEvent:function(t){var e=tt.getSystemInfoSync().brand;if(!("PC"===e&&t.type.startsWith("touch")||"PC"!==e&&t.type.startsWith("mouse"))){var i=this.chart;i&&(t.target=i.getCanvas(),i.getStage().window.dispatchEvent(t))}}}})}));
25
+ */GG.defaultOptions={gridSize:8,ellipticity:1,maxSingleWordTryCount:1};var YG=function(t){function e(t){var r;return n(this,e),(r=i(this,e,[et({},e.defaultOptions,t)])).random=r.options.random?Math.random:function(){return 0},r.aspectRatio=1,r}return c(e,t),a(e,[{key:"fit",value:function(t){for(var e=0,i=this.result.length;e<i;e++)if(XG(t,this.result[e]))return!1;return!0}},{key:"getTextInfo",value:function(t,e){var 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]},n=this.options.getTextBounds(i);return i.width=n.width(),i.height=n.height(),i.top=this.center[1]-i.height+.21*i.height,i.left=this.center[0]-i.width/2,i}},{key:"layoutWord",value:function(t){for(var e=this.getTextInfo(this.data[t],t),i=2*Math.PI,n=0,r=e.left,a=e.top,o=e.width,s=e.height,l=1,u=this.fit(e);!u&&n<this.maxRadius;)n+=.5,l=this.shape(n/this.maxRadius*2*Math.PI),i+=.5*(this.options.random?this.random()>.5?1:-1:t%2==0?1:-1),r=this.center[0]-o/2+n*l*Math.cos(i)*this.aspectRatio,a=this.center[1]-s/2+n*l*Math.sin(i),e.left=r,e.top=a,e.x=r+o/2,e.y=a+s/2,u=this.fit(e);return!!u&&!!(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)}},{key:"layout",value:function(t,e){var i=this;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((function(t,e){return i.getTextFontSize(e)-i.getTextFontSize(t)}));for(var n=0;n<t.length&&(this.layoutWord(n),n++,this.progressiveIndex=n,!this.exceedTime()););return this.result}}])}(LG);function XG(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)}YG.defaultOptions={enlarge:!1};var KG={x:"x",y:"y",z:"z",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",angle:"angle"},qG=function(t,e){var i,n,r,a,o,s;if(t.size&&(t.size[0]<=0||t.size[1]<=0))return xt.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];var l=e,u=(null!==(i=t.size)&&void 0!==i?i:[500,500]).slice();u[0]=Math.floor(u[0]),u[1]=Math.floor(u[1]);var c=t.fontFamily?ZG(t.fontFamily):"sans-serif",h=t.fontStyle?ZG(t.fontStyle):"normal",d=t.fontWeight?ZG(t.fontWeight):"normal",v=t.rotate?ZG(t.rotate):0,f=ZG(t.text),p=null!==(n=t.spiral)&&void 0!==n?n:"archimedean",g=t.padding?ZG(t.padding):1,y=null!==(r=t.shape)&&void 0!==r?r:"square",m=null!==(a=t.shrink)&&void 0!==a&&a,_=null!==(o=t.enlarge)&&void 0!==o&&o,b=null!==(s=t.clip)&&void 0!==s&&s,k=t.minFontSize,x=t.randomVisible,S=t.as?Object.assign(Object.assign({},KG),t.as):KG,A=t.depth_3d,M=t.postProjection,w=t.fontSize?ZG(t.fontSize):14,T=t.fontSizeRange;if(T&&!F(w)){var C=w,E=QG($G(C,l),T);w=function(t){return E(C(t))}}var B=IG;"fast"===t.layoutType?B=YG:"grid"===t.layoutType&&(B=GG);var P=new B(Object.assign(Object.assign({},t),{text:f,padding:g,spiral:p,shape:y,rotate:v,fontFamily:c,fontStyle:h,fontWeight:d,fontSize:w,shrink:m,clip:b,enlarge:_,minFontSize:k,random:x,outputCallback:function(e){for(var i,n,r=[],a=0,o=e.length;a<o;a++)(i=(n=e[a]).datum)[S.x]=n.x,i[S.y]=n.y,i[S.fontFamily]=n.fontFamily,i[S.fontSize]=n.fontSize,i[S.fontStyle]=n.fontStyle,i[S.fontWeight]=n.fontWeight,i[S.angle]=n.angle,"StereographicProjection"===M&&tY(u,n,i,S,A),t.dataIndexKey&&(i[t.dataIndexKey]="".concat(a)),r.push(i);return r}}));return P.layout(l,{width:u[0],height:u[1]}),t.progressiveStep>0||t.progressiveTime>0?{progressive:P}:P.output()},ZG=function(t){return L(t)||F(t)||w(t)||O(t)?t:function(e){return e[t.field]}},JG=function(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)},QG=function(t,e,i){if(t[0]===t[1])return function(t){return e[0]};var n=JG(t[0]),r=JG(t[1]),a=Math.min(n,r),o=Math.max(n,r);return function(t){return(JG(t)-a)/(o-a)*(e[1]-e[0])+e[0]}},$G=function(t,e){for(var i,n=1/0,r=-1/0,a=e.length,o=0;o<a;++o)(i=yt(t(e[o])))<n&&(n=i),i>r&&(r=i);return 1===e.length&&n===r&&(n-=1e4),[n,r]};function tY(t,e,i,n,r){var a=Math.max(t[0],t[1])/2,o=function(t,e,i,n,r){var a=r.x,o=r.y,s=a/t*Math.PI*2,l=Math.PI-o/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(s)+n.x,y:i*Math.cos(l)+n.y,z:i*Math.sin(l)*Math.sin(s)+n.z}}(t[0],t[1],a,{x:a,y:a,z:null!=r?r:a},e);i[n.x]=o.x,i[n.y]=o.y,i[n.z]=o.z}var eY=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=_L.wordCloud,t}return c(e,t),a(e)}(PW);eY.type=_L.wordCloud;var iY=function(){rO.registerGrammarTransform("wordcloud",{transform:qG}),GV(),rO.registerAnimation("wordCloud",(function(t,e){return{appear:RW(t,e),enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{duration:KD.disappear.duration}}})),rO.registerSeries(eY.type,eY)},nY=function(t,e){var i,n,r=t.map((function(t){return Object.assign({},t)}));if(!r||0===r.length)return r;var a=e.valueField,o=e.asTransformRatio,s=e.asReachRatio,l=e.asHeightRatio,u=e.asValueRatio,c=e.asNextValueRatio,h=e.asLastValueRatio,d=e.asLastValue,v=e.asCurrentValue,f=e.asNextValue,p=e.heightVisual,g=void 0!==p&&p,y=e.isCone,m=void 0===y||y,_=e.range,b=r.reduce((function(t,e){return Math.max(t,Number.parseFloat(e[a])||-1/0)}),-1/0),k=r.reduce((function(t,e){return Math.min(t,Number.parseFloat(e[a])||1/0)}),1/0),x=[null!==(i=null==_?void 0:_.min)&&void 0!==i?i:k,null!==(n=null==_?void 0:_.max)&&void 0!==n?n:b];return r.forEach((function(t,e){var i,n,p=Number.parseFloat(t[a]),y=Number.parseFloat(null===(i=r[e-1])||void 0===i?void 0:i[a]),_=Number.parseFloat(null===(n=r[e+1])||void 0===n?void 0:n[a]),b=z(_*p)&&0!==p?_/p:0,k=z(p*y)&&0!==y?p/y:0;d&&(t[d]=y),f&&(t[f]=_),o&&(t[o]=b),s&&(t[s]=0===e?1:k),l&&(t[l]=!0===g?b:1/r.length),u&&(t[u]=p/x[1]),c&&(t[c]=e===r.length-1?m?0:t[u]:_/x[1]),h&&(t[h]=0===e?1:y/x[1]),v&&(t[v]=p)})),r},rY=function(t,e){var i,n,r=null===(n=null===(i=t[0])||void 0===i?void 0:i.latestData)||void 0===n?void 0:n.map((function(t){return Object.assign({},t)}));return r&&0!==r.length?(r.shift(),r.forEach((function(t){t[e.asIsTransformLevel]=!0})),r):r},aY="".concat(TO,"_FUNNEL_TRANSFORM_RATIO"),oY="".concat(TO,"_FUNNEL_REACH_RATIO"),sY="".concat(TO,"_FUNNEL_HEIGHT_RATIO"),lY="".concat(TO,"_FUNNEL_VALUE_RATIO"),uY="".concat(TO,"_FUNNEL_LAST_VALUE_RATIO"),cY="".concat(TO,"_FUNNEL_NEXT_VALUE_RATIO"),hY="".concat(TO,"_FUNNEL_LAST_VALUE"),dY="".concat(TO,"_FUNNEL_CURRENT_VALUE"),vY="".concat(TO,"_FUNNEL_NEXT_VALUE"),fY="".concat(TO,"_FUNNEL_TRANSFORM_LEVEL"),pY=function(t){function e(t){var r,a,o;return n(this,e),(r=i(this,e,[t])).dimensionTooltipTitleCallback=function(t,e){var i,n,a,o=r.series;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?r._transformRatioText:null!==(n=r._getDimensionData(t))&&void 0!==n?n:null===(a=t.properties)||void 0===a?void 0:a["".concat(o.getCategoryField())]},r.markTooltipValueCallback=function(t,e){var i;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?"".concat((100*(null==t?void 0:t[oY])).toFixed(1),"%"):r._getMeasureData(t)},r.markTooltipKeyCallback=function(t,e){var i;if("transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name))return r._transformRatioText;var n=r._seriesCacheInfo,a=n.dimensionFields,o=n.seriesFields,s=a[a.length-1];return C(o[0])?null==t?void 0:t[o[0]]:null==t?void 0:t[s]},r._transformRatioText=null!==(o=null===(a=t.getSpec())||void 0===a?void 0:a.transformRatioText)&&void 0!==o?o:"转化率",r}return c(e,t),a(e)}(wF),gY=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{points:[]})}}])}(HD),yY=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t}return c(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{lineWidth:0})}}])}(gY);yY.type="polygon";var mY=function(){rO.registerMark(yY.type,yY),vM(),sM(),RT.registerBuiltInAnimate("growPointsOut",EC),rO.registerGraphicComponent("polygon",Mp)},_Y=Object.assign(Object.assign({},jF),{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"}}),bY=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"funnel"),t.isTransform&&this._addMarkLabelSpec(t,"transform","transformLabel")}}])}(tj),kY=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=_L.funnel,t._funnelMarkName="funnel",t._funnelMarkType="polygon",t._transformMarkName="transform",t._transformMarkType="polygon",t.transformerConstructor=bY,t._funnelMark=null,t._funnelTransformMark=null,t._labelMark=null,t._transformLabelMark=null,t._funnelOuterLabelMark={},t}return c(r,e),a(r,[{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"setAttrFromSpec",value:function(){var t,e,i,n,a;_(r,"setAttrFromSpec",this,3)([]),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!==(a=null===(n=null===(i=this._spec.outerLabel)||void 0===i?void 0:i.line)||void 0===n?void 0:n.minLength)&&void 0!==a?a: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)}},{key:"initData",value:function(){if(_(r,"initData",this,3)([]),this._data){EI(this._dataSet,"funnel",nY),EI(this._dataSet,"funnelTransform",rY);var t=new Xo(this._dataSet,{name:"".concat(TO,"_series_").concat(this.id,"_viewDataTransform")});t.parse([this.getViewData()],{type:"dataview"}),this._viewDataTransform=new ID(this._option,t)}}},{key:"compile",value:function(){var t,e;_(r,"compile",this,3)([]),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()}))}},{key:"compileData",value:function(){var t;_(r,"compileData",this,3)([]),null===(t=this._viewDataTransform)||void 0===t||t.compile()}},{key:"getStatisticFields",value:function(){var t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}},{key:"_statisticViewData",value:function(){var t,e,i,n,a,o,s,l,u;_(r,"_statisticViewData",this,3)([]),this._data.getDataView().transform({type:"funnel",options:{valueField:this.getValueField(),isCone:this._spec.isCone,asCurrentValue:dY,asTransformRatio:aY,asReachRatio:oY,asHeightRatio:sY,asValueRatio:lY,asNextValueRatio:cY,asLastValueRatio:uY,asLastValue:hY,asNextValue:vY,range:{min:null!==(e=null===(t=this._spec.range)||void 0===t?void 0:t.min)&&void 0!==e?e:null===(n=null===(i=this.getViewDataStatistics().latestData)||void 0===i?void 0:i[this.getValueField()])||void 0===n?void 0:n.min,max:null!==(o=null===(a=this._spec.range)||void 0===a?void 0:a.max)&&void 0!==o?o:null===(l=null===(s=this.getViewDataStatistics().latestData)||void 0===s?void 0:s[this.getValueField()])||void 0===l?void 0:l.max}}}),null===(u=this._viewDataTransform.getDataView())||void 0===u||u.transform({type:"funnelTransform",options:{asIsTransformLevel:fY}})}},{key:"initMark",value:function(){var t,e,i,n,a,o,s,l;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},r.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:ZF(this._spec,this._funnelMarkName),morphElementKey:this._seriesField}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},r.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===(n=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===n?void 0:n.visible){var u=(null!==(a=this._spec.outerLabel)&&void 0!==a?a:{}).line,c=(null!==(s=null===(o=this._theme)||void 0===o?void 0:o.outerLabel)&&void 0!==s?s:{}).line;this._funnelOuterLabelMark.label=this._createMark(r.mark.outerLabel,{themeSpec:null===(l=this._theme)||void 0===l?void 0:l.outerLabel,markSpec:this._spec.outerLabel,noSeparateStyle:!0,parent:!1}),this._funnelOuterLabelMark.line=this._createMark(r.mark.outerLabelLine,{themeSpec:c,markSpec:u,noSeparateStyle:!0,parent:!1})}}},{key:"initTooltip",value:function(){this._tooltipHelper=new pY(this),this._funnelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelMark),this._funnelTransformMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelTransformMark)}},{key:"getDimensionField",value:function(){return this._seriesField?[this._seriesField]:[]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"getGroupFields",value:function(){return null}},{key:"initMarkStyle",value:function(){var e,i,n,r,a=this,o=this._funnelMark;o&&this.setMarkStyle(o,{points:function(t){return a.getPoints(t)},visible:function(t){return C(t[a._valueField])},fill:this.getColorAttribute()},"normal",t.AttributeLevel.Series);var s=this._funnelTransformMark;s&&this.setMarkStyle(s,{points:function(t){return a.getPoints(t)}},"normal",t.AttributeLevel.Series);var l=this._funnelOuterLabelMark.label;l&&(this.setMarkStyle(l,{text:function(t){return"".concat(t[a.getCategoryField()])},x:function(t){return a._computeOuterLabelPosition(t).x},y:function(t){return a._computeOuterLabelPosition(t).y},textAlign:function(t){return a._computeOuterLabelPosition(t).align},textBaseline:function(t){return a._computeOuterLabelPosition(t).textBaseline},maxLineWidth:function(t){return a._computeOuterLabelLimit(t)},width:0,height:0},"normal",t.AttributeLevel.Series),w(this._spec.outerLabel.formatMethod)&&this.setMarkStyle(l,{text:function(t){return a._spec.outerLabel.formatMethod("".concat(t[a.getCategoryField()]),t)}},"normal",t.AttributeLevel.User_Mark));var u=this._funnelOuterLabelMark.line;if(u&&l){this.setMarkStyle(u,{x:function(t){return a._computeOuterLabelLinePosition(t).x1},y:function(t){return a._computeOuterLabelLinePosition(t).y1},x1:function(t){return a._computeOuterLabelLinePosition(t).x2},y1:function(t){return a._computeOuterLabelLinePosition(t).y2}},"normal",t.AttributeLevel.Series);var c=null!==(n=null===(i=null===(e=this._spec.outerLabel)||void 0===e?void 0:e.line)||void 0===i?void 0:i.visible)&&void 0!==n?n:null===(r=this._spec.outerLabel)||void 0===r?void 0:r.visible;C(c)&&u.setVisible(c)}}},{key:"initLabelMarkStyle",value:function(e){var i,n=this;if(e){var r=e.getTarget(),a=e.getComponent();if(r===this._funnelMark){this._labelMark=e,this.setMarkStyle(e,{text:function(t){return"".concat(t[n.getCategoryField()]," ").concat(t[n.getValueField()])},x:function(t){return n._computeLabelPosition(t).x},y:function(t){return n._computeLabelPosition(t).y},maxLineWidth:function(t){return n._computeLabelLimit(t,n._spec.label)},stroke:this.getColorAttribute()},"normal",t.AttributeLevel.Series);var o=this.getCompiler().getRootMarks();this._funnelOuterLabelMark.label&&tb(o,this._funnelOuterLabelMark.label,a),this._funnelOuterLabelMark.line&&tb(o,this._funnelOuterLabelMark.line,null!==(i=this._funnelOuterLabelMark.label)&&void 0!==i?i:a)}else this._funnelTransformMark&&r===this._funnelTransformMark&&(this._transformLabelMark=e,this.setMarkStyle(e,{text:function(t){return"".concat((100*xL(oY).bind(n)(t)).toFixed(1),"%")},x:function(t){return n._computeLabelPosition(t).x},y:function(t){return n._computeLabelPosition(t).y},maxLineWidth:function(t){return n._computeLabelLimit(t,n._spec.transformLabel)}},"normal",t.AttributeLevel.Series))}}},{key:"initAnimation",value:function(){var t,e,i,n,r,a,o,s=this,l=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"===l&&this._rootMark&&this._rootMark.setAnimationConfig(YF(null===(n=rO.getAnimationInKey("cartesianGroupClip"))||void 0===n?void 0:n({direction:function(){return s._isHorizontal()?"x":"y"},width:function(){var t=s.getRootMark().getProduct();if(t){var e=t.AABBBounds,i=e.x1,n=e.x2;return Math.max(i,n)}return s.getLayoutRect().width},height:function(){var t=s.getRootMark().getProduct();if(t){var e=t.AABBBounds,i=e.y1,n=e.y2;return Math.max(i,n)}return s.getLayoutRect().height},orient:function(){return s._isReverse()?"negative":"positive"}},l),XF("group",this._spec,this._markAttributeContext))),[null===(r=this._funnelOuterLabelMark)||void 0===r?void 0:r.label].forEach((function(t){t&&t.setAnimationConfig(YF(rO.getAnimationInKey("fadeInOut")(),XF(t.name,s._spec,s._markAttributeContext)))})),[this._funnelMark,this._funnelTransformMark].forEach((function(t){t&&t.setAnimationConfig(YF(rO.getAnimationInKey("funnel")({},l),XF(t.name,s._spec,s._markAttributeContext)))})),(null===(a=this._funnelOuterLabelMark)||void 0===a?void 0:a.line)&&this._funnelOuterLabelMark.line.setAnimationConfig(YF(null===(o=rO.getAnimationInKey("fadeInOut"))||void 0===o?void 0:o(),XF("outerLabelLine",this._spec,this._markAttributeContext)))}},{key:"initGroups",value:function(){}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return null}},{key:"initEvent",value:function(){var t,e=this;_(r,"initEvent",this,3)([]),null===(t=this._viewDataTransform.getDataView())||void 0===t||t.target.addListener("change",(function(t){e._viewDataTransform.updateData()}))}},{key:"getPoints",value:function(t){var e,i,n=this.isTransformLevel(t),r=this._getMainAxisLength(n)/2;n?(e="rect"===this._shape?this._getSecondaryAxisLength(t[uY])/2:this._getSecondaryAxisLength(t[lY])/2,i=this._getSecondaryAxisLength(t[lY])/2):(e=this._getSecondaryAxisLength(t[lY])/2,i="rect"===this._shape?e:this._getSecondaryAxisLength(t[cY])/2);var a=this._getPositionByData(t),o=a.x,s=a.y,l=this._getPolygonPoints([o,s],e,i,e,i,r);return"center"!==this._funnelAlign&&this._adjustPoints(l),l}},{key:"isTransformLevel",value:function(t){return!!(null==t?void 0:t[fY])}},{key:"_buildMarkAttributeContext",value:function(){_(r,"_buildMarkAttributeContext",this,3)([]),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getPoints=this.getPoints.bind(this),this._markAttributeContext.isTransformLevel=this.isTransformLevel.bind(this)}},{key:"valueToPosition",value:function(t){var e,i,n,r=this,a=null===(n=null===(i=null===(e=this.getViewData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.find)||void 0===n?void 0:n.call(i,(function(e){return e[r._categoryField]===t}));return C(a)?this._getPolygonCenter(this.getPoints(a)):null}},{key:"dataToPosition",value:function(t,e){return e&&!this.isDatumInViewData(t)?null:this.valueToPosition(t[this._categoryField])}},{key:"dataToPositionX",value:function(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}},{key:"dataToPositionY",value:function(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}},{key:"dataToPositionZ",value:function(t){return 0}},{key:"_getMainAxisLength",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.getViewData().latestData.length,n=this._isHorizontal()?this.getLayoutRect().width:this.getLayoutRect().height,r=!!this._spec.isTransform,a=r?0:null!==(t=this._spec.gap)&&void 0!==t?t:0,o=r?Math.max(0,i-1):0,s=this._spec.heightRatio||.5,l=(n-a*Math.max(0,i-1))/(i+s*o);return e?r?l*s:0:l}},{key:"_getSecondaryAxisLength",value:function(t){var e=Number.isNaN(t)||!Number.isFinite(t)?0:t,i=this._computeMaxSize(),n=this._computeMinSize();return n+(i-n)*e}},{key:"_getPositionByData",value:function(t){var e,i=this,n=null===(e=this.getViewData().latestData)||void 0===e?void 0:e.findIndex((function(e){return e[i._categoryField]===t[i._categoryField]&&e[RO]===t[RO]}));if(!C(n)||n<0)return{};var r=this.isTransformLevel(t),a=this._isHorizontal(),o=a?this.getLayoutRect().height:this.getLayoutRect().width,s=a?this.getLayoutRect().width:this.getLayoutRect().height,l=o/2,u=0,c=this._getMainAxisLength(),h=this._getMainAxisLength(!0);return u+=n*(c+h),u+=r?-h/2:c/2,!this._spec.isTransform&&this._spec.gap&&(u+=this._spec.gap*n),this._isReverse()&&(u=s-u),this._isHorizontal()?{x:u,y:l}:{x:l,y:u}}},{key:"_getPolygonPoints",value:function(t,e,i,n,r,a){var o=t[0],s=t[1];switch(this._funnelOrient){case"left":return[{x:o-a,y:s+e},{x:o-a,y:s-n},{x:o+a,y:s-r},{x:o+a,y:s+i}];case"right":return[{x:o+a,y:s-n},{x:o+a,y:s+n},{x:o-a,y:s+i},{x:o-a,y:s-i}];case"bottom":return[{x:o+e,y:s+a},{x:o-n,y:s+a},{x:o-r,y:s-a},{x:o+i,y:s-a}];default:return[{x:o-e,y:s-a},{x:o+n,y:s-a},{x:o+r,y:s+a},{x:o-i,y:s+a}]}}},{key:"_getPolygonCenter",value:function(t){if(this._isHorizontal()){var 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}}var n=(t[0].x+t[3].x)/2,r=(t[0].y+t[3].y)/2;return{x:(n+(t[1].x+t[2].x)/2)/2,y:(r+(t[1].y+t[2].y)/2)/2}}},{key:"_adjustPoints",value:function(t){var e,i,n;return this._isHorizontal()?(n="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)):(n="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][n]-=e,t[1][n]-=e,t[2][n]-=i,t[3][n]-=i,t}},{key:"_computeLabelPosition",value:function(t){var e=this.getPoints(t);return this._getPolygonCenter(e)}},{key:"_computeLabelLimit",value:function(t,e){var i=null==e?void 0:e.limit;if(F(i))return i;var n=this.getPoints(t);return"shapeSize"===i?this._isHorizontal()?Math.abs(n[3].x-n[0].x):(Math.abs(n[0].x-n[1].x)+Math.abs(n[2].x-n[3].x))/2:this._isHorizontal()?Math.abs(n[3].x-n[0].x):void 0}},{key:"_computeOuterLabelPosition",value:function(t){var e,i,n,r,a,o=null===(i=this._spec.outerLabel)||void 0===i?void 0:i.position,s="center",l="middle";if(o=this._isHorizontal()?["top","bottom"].includes(o)?o:"bottom"===this._funnelAlign?"top":"bottom":["left","right"].includes(o)?o:"left"===this._funnelAlign?"right":"left",!1!==(null===(n=this._spec.outerLabel)||void 0===n?void 0:n.alignLabel))r=(e=this._getPositionByData(t)).x,a=e.y,"left"===o?(r=0,s="left"):"right"===o?(r=this.getLayoutRect().width,s="right"):"top"===o?(a=0,l="top"):"bottom"===o&&(a=this.getLayoutRect().height,l="bottom");else{var u=this._computeOuterLabelLinePosition(t);r=u.x2,a=u.y2,"left"===o?(r-=5,s="right"):"right"===o?(r+=5,s="left"):"top"===o?(a-=5,l="bottom"):"bottom"===o&&(a+=5,l="top")}return{x:r,y:a,align:s,textBaseline:l}}},{key:"_computeOuterLabelLimit",value:function(t){var e,i,n,r,a,o;if(this._isHorizontal())return this._getMainAxisLength(this.isTransformLevel(t));var s=this.getPoints(t),l=(Math.abs(s[0].x-s[1].x)+Math.abs(s[2].x-s[3].x))/2,u=this.getCategoryField(),c=null===(r=null===(n=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getComponent())||void 0===n?void 0:n.find((function(e){var i,n=e.attribute;return"text"===e.type&&(null===(i=n.data)||void 0===i?void 0:i[u])===t[u]}),!0))||void 0===r?void 0:r.AABBBounds,h=c?c.x2-c.x1:0,d=this._funnelOuterLabelMark.line?this._minLabelLineWidth:0,v=this.getLayoutRect().width-Math.max(l,h);return"center"===this._funnelAlign&&(v/=2),v-d-(null!==(o=null===(a=this._spec.outerLabel)||void 0===a?void 0:a.spaceWidth)&&void 0!==o?o:5)}},{key:"_computeOuterLabelLinePosition",value:function(t){var e,i,n,r,a,o,s,l,u,c,h,d,v,f,p=this.getCategoryField(),g=null===(r=null===(n=null===(i=null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)||void 0===i?void 0:i.getGraphics())||void 0===n?void 0:n.find((function(e){var i;return(null===(i=e.context.data[0])||void 0===i?void 0:i[p])===t[p]})))||void 0===r?void 0:r.AABBBounds,y=null===(o=null===(a=this._labelMark)||void 0===a?void 0:a.getComponent())||void 0===o?void 0:o.getComponent(),m=null===(s=null==y?void 0:y.find((function(e){var i,n=e.attribute;return"text"===e.type&&(null===(i=n.data)||void 0===i?void 0:i[p])===t[p]}),!0))||void 0===s?void 0:s.AABBBounds,_=null!==(l=this._spec.outerLabel)&&void 0!==l?l:{};if(this._isHorizontal()){var b=null!==(u=_.spaceWidth)&&void 0!==u?u:5,k=this.getPoints(t),x=(Math.abs(k[0].y-k[1].y)+Math.abs(k[2].y-k[3].y))/2;return"top"===this._spec.outerLabel.position||"bottom"===this._funnelAlign?(v=this._getPolygonCenter(k).y-x/2-b,f=!1!==_.alignLabel?(null==g?void 0:g.y2)+b:v-b,h=this._getPolygonCenter(k).x,v-f<this._minLabelLineWidth&&(f=v-this._minLabelLineWidth),d=h):(v=this._getPolygonCenter(k).y+x/2+b,f=!1!==_.alignLabel?(null==g?void 0:g.y1)-b:v+b,h=this._getPolygonCenter(k).x,f-v<this._minLabelLineWidth&&(f=v+this._minLabelLineWidth),d=h),{x1:h,x2:d,y1:v,y2:f}}var S=this.getPoints(t),A=(Math.abs(S[0].x-S[1].x)+Math.abs(S[2].x-S[3].x))/2,M=(null==m?void 0:m.x2)-(null==m?void 0:m.x1)||0,w=null!==(c=_.spaceWidth)&&void 0!==c?c:5;return"right"===this._spec.outerLabel.position||"left"===this._funnelAlign?(h=this._getPolygonCenter(S).x+Math.max(M/2,A/2)+w,d=!1!==_.alignLabel?(null==g?void 0:g.x1)-w:h+w,v=this._getPolygonCenter(S).y,d-h<this._minLabelLineWidth&&(d=h+this._minLabelLineWidth),f=v):(h=this._getPolygonCenter(S).x-Math.max(M/2,A/2)-w,d=!1!==_.alignLabel?(null==g?void 0:g.x2)+w:h-w,v=this._getPolygonCenter(S).y,h-d<this._minLabelLineWidth&&(d=h-this._minLabelLineWidth),f=v),{x1:h,x2:d,y1:v,y2:f}}},{key:"_computeMaxSize",value:function(){var t,e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return WL(null!==(t=this._spec.maxSize)&&void 0!==t?t:"80%",e)}},{key:"_computeMinSize",value:function(){var t,e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return WL(null!==(t=this._spec.minSize)&&void 0!==t?t:0,e)}},{key:"_isHorizontal",value:function(){return"left"===this._funnelOrient||"right"===this._funnelOrient}},{key:"_isReverse",value:function(){return"bottom"===this._funnelOrient||"right"===this._funnelOrient}},{key:"getDefaultShapeType",value:function(){return"square"}},{key:"getActiveMarks",value:function(){return[this._funnelMark]}}])}(ej);kY.type=_L.funnel,kY.mark=_Y,kY.builtInTheme={funnel:lO},kY.transformerConstructor=bY;var xY,SY=function(){mY(),GV(),iV(),rO.registerSeries(kY.type,kY),rO.registerAnimation("funnel",(function(t,e){return Object.assign({appear:"clipIn"===e?void 0:{type:"fadeIn"}},ZD)})),rO.registerAnimation("cartesianGroupClip",(function(t){return{appear:{custom:hC,customParameters:function(e,i){return{animationType:"in",group:i,direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()}}}}})),QD()},AY=function(t,e){var i=(t-e[0])/(e[1]-e[0]||1);return Math.max(0,Math.min(1,i))},MY=function(t){var e=t.filter((function(t){return t.context.diffState===iD.update})),i=ht(e.map((function(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((function(t){var e,n;return(null===(n=null===(e=null==t?void 0:t.context)||void 0===e?void 0:e.data)||void 0===n?void 0:n[0].depth)===i}))},wY=function(t,e,i){if(Y(t))return[e,i];var n=ht(t.map((function(t){return 1*t.getFinalAttribute().startAngle}))),r=ct(t.map((function(t){return 1*t.getFinalAttribute().endAngle})));return[n,r]},TY=function(t){return{channel:{startAngle:{from:function(e,i){var n=t.animationInfo(),r=n.startAngle,a=n.endAngle,o=MY(i.parent.children),s=wY(o,r,a);return AY(i.getFinalAttribute().startAngle,s)*(a-r)+r},to:function(t,e){return e.getFinalAttribute().startAngle}},endAngle:{from:function(e,i){var n=t.animationInfo(),r=n.startAngle,a=n.endAngle,o=MY(i.parent.children),s=wY(o,r,a);return AY(i.getFinalAttribute().endAngle,s)*(a-r)+r},to:function(t,e){return e.getFinalAttribute().endAngle}},outerRadius:{from:function(t,e){return e.getFinalAttribute().innerRadius},to:function(t,e){return e.getFinalAttribute().outerRadius}},innerRadius:{from:function(t,e){return e.getFinalAttribute().innerRadius},to:function(t,e){return e.getFinalAttribute().innerRadius}}}}},CY=function(t){var e=ht(t.map((function(t){return 1*t.getFinalAttribute().startAngle}))),i=ct(t.map((function(t){return 1*t.getFinalAttribute().endAngle})));return[e,i]},EY=function(t){return{channel:{startAngle:{from:function(t,e){return e.getFinalAttribute().startAngle},to:function(e,i){var n=t.animationInfo(),r=n.startAngle,a=n.endAngle,o=MY(i.parent.children),s=CY(o);return AY(i.getFinalAttribute().startAngle,s)*(a-r)+r}},endAngle:{from:function(t,e){return e.getFinalAttribute().endAngle},to:function(e,i){var n=t.animationInfo(),r=n.startAngle,a=n.endAngle,o=MY(i.parent.children),s=CY(o);return AY(i.getFinalAttribute().endAngle,s)*(a-r)+r}},outerRadius:{from:function(t,e){return e.getFinalAttribute().outerRadius},to:function(){return t.animationInfo().innerRadius}},innerRadius:{from:function(t,e){return e.getFinalAttribute().innerRadius},to:function(){return t.animationInfo().innerRadius}}}}},BY=function(t,e){switch(e){case"fadeIn":return{type:"fadeIn"};case"growAngle":return{type:"growAngleIn"};default:return{type:"growRadiusIn"}}},PY=function(t){if(!t)return[];var e=[];return DW(t,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),e},RY=function(t,e){if(!t)return t;var i=e(),n=i.width,r=i.height;return new cG(i).layout(t,{width:n,height:r})},LY=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).markTooltipKeyCallback=function(e){return null==e?void 0:e[t.series.getDimensionField()[0]]},t}return c(e,t),a(e)}(wF);!function(t){t.DrillDown="drillDown",t.DrillUp="drillUp"}(xY||(xY={}));var OY=function(t,e){var i=e.info(),n=e.keyField(),r=null==i?void 0:i.key;if(T(r))return t;if(i.type===xY.DrillDown)return lt(uI(t,r,n,"children"));if(i.type===xY.DrillUp){var a=cI(t,r,n,"children");if(a)return lt(a)}return t},IY=function(){function e(){n(this,e)}return a(e,[{key:"_getDrillTriggerEvent",value:function(t){var e;return null===(e=zN(this._drillParams.mode))||void 0===e?void 0:e[t]}},{key:"_hideTooltip",value:function(){var t=this.getChart().getComponentsByType(d.tooltip)[0];t&&t.hideTooltip()}},{key:"initDrillable",value:function(t){this._drillParams=t}},{key:"initDrillableData",value:function(t){var e=this,i=this._drillParams.getRawData;EI(t,"drillFilter",OY),i().transform({type:"drillFilter",options:{info:function(){return e._drillInfo},keyField:function(){return e._drillParams.drillField()}}})}},{key:"bindDrillEvent",value:function(){var t=this,e=this._drillParams,i=e.event,n=e.getRawData,r=(0,e.drillField)();this._getDrillTriggerEvent("start")&&i.on(this._getDrillTriggerEvent("start"),(function(e){var i,a,s;if(T(e.datum)||T(null===(i=e.datum)||void 0===i?void 0:i[r]))t.drillUp();else{t._hideTooltip();var l=e.datum[r],u=null!==(s=null===(a=t._drillInfo)||void 0===a?void 0:a.path)&&void 0!==s?s:[],c=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"key",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children",r=[],a=function(t,s){var l,u=o(t);try{for(u.s();!(l=u.n()).done;){var c=l.value;if(c[i]===e)return r.push.apply(r,b(s).concat([c[i].toString()])),!0;if(c[n]){var h=a(c[n],[].concat(b(s),[c[i]]));if(!0===h)return h}}}catch(t){u.e(t)}finally{u.f()}return!1};return a(t,[]),r}(n().rawData,l,r,"children");u[u.length-1]===c[c.length-1]?t.drillUp():t.drillDown(c)}}))}},{key:"drillDown",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this._drillParams,n=i.getRawData,r=i.event;if(!O(e)||Y(e))return e;var a=e[e.length-1];return this._drillInfo={key:a,path:e,type:xY.DrillDown},n().reRunAllTransform(),r.emit(t.ChartEvent.drill,{value:{path:e,type:xY.DrillDown},model:this}),e}},{key:"drillUp",value:function(){var e,i,n=this._drillParams,r=n.getRawData,a=n.event,o=null!==(i=null===(e=this._drillInfo)||void 0===e?void 0:e.path)&&void 0!==i?i:[];if(!O(o)||Y(o))return o;var s=o.pop();return this._drillInfo={key:s,path:o,type:xY.DrillUp},r().reRunAllTransform(),a.emit(t.ChartEvent.drill,{value:{path:o,type:xY.DrillUp},model:this}),o}}])}(),DY=Object.assign(Object.assign({},jF),{sunburst:{name:"sunburst",type:"arc"}}),FY=function(t,e,i){return t.push({key:e,operations:["values"]}),t.push({key:i,operations:["max","min"]}),t.push({key:PF,operations:["max","min","values"]}),t.push({key:RF,operations:["values"]}),t},jY={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"}}}},zY=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=_L.sunburst,t}return c(r,e),a(r,[{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"getValueField",value:function(){return this._valueField}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"setAttrFromSpec",value:function(){var t,e=this;_(r,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:RF),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:function(){var t;return null!==(t=e._spec.drillField)&&void 0!==t?t:RO},getRawData:function(){return e.getRawData()}}),this._startAngle=xe(this._spec.startAngle),this._endAngle=xe(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}},{key:"initData",value:function(){var t=this;_(r,"initData",this,3)([]);var e=this.getRawData();e&&(this._spec.drill&&this.initDrillableData(this._dataSet),EI(this._dataSet,"sunburstLayout",RY),EI(this._dataSet,"flatten",PY),e.transform({type:"sunburstLayout",options:function(){var e=t._computeLevel(),i=e.innerRadius,n=e.outerRadius,r=e.gap,a=e.label;return{nodeKey:t._categoryField,width:t.getLayoutRect().width,height:t.getLayoutRect().height,center:[C(t._centerX)?t._centerX:t.getLayoutRect().width/2,C(t._centerY)?t._centerY:t.getLayoutRect().height/2],startAngle:t._startAngle,endAngle:t._endAngle,innerRadius:i,outerRadius:n,gapRadius:r,label:a}}}),e.transform({type:"flatten",options:{callback:function(t){if(t.datum){var e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}},{key:"getStatisticFields",value:function(){return FY(_(r,"getStatisticFields",this,3)([]),this._categoryField,this._valueField)}},{key:"_addDataIndexAndKey",value:function(){var t=this.getRawData();T(null==t?void 0:t.dataSet)||(EI(t.dataSet,"addVChartProperty",_F),t.transform({type:"addVChartProperty",options:{beforeCall:DF.bind(this),call:FF}}))}},{key:"initMark",value:function(){this._initArcMark(),this._initLabelMark()}},{key:"initMarkStyle",value:function(){this._initArcMarkStyle(),this._initLabelMarkStyle()}},{key:"_initArcMark",value:function(){if(!1!==this._sunburst.visible){var t=this._createMark(r.mark.sunburst,{isSeriesMark:!0});this._sunburstMark=t}}},{key:"_initArcMarkStyle",value:function(){var e=this;T(this._sunburstMark)||this.setMarkStyle(this._sunburstMark,{x:function(t){return t.x+(C(e._offsetX)?e._offsetX:0)},y:function(t){return t.y+(C(e._offsetY)?e._offsetY:0)},outerRadius:function(t){return t.outerRadius},innerRadius:function(t){return t.innerRadius},startAngle:function(t){return t.startAngle},endAngle:function(t){return t.endAngle},fill:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initLabelMark",value:function(){if(!0===this._label.visible){var t=this._createMark(r.mark.label,{isSeriesMark:!1});this._labelMark=t}}},{key:"_initLabelMarkStyle",value:function(){var e=this;T(this._labelMark)||this.setMarkStyle(this._labelMark,{visible:function(t){var i,n=e._labelAutoVisible;return E(n)&&!0===n.enable?(t.endAngle-t.startAngle)*(t.outerRadius-t.innerRadius)>(null!==(i=null==n?void 0:n.circumference)&&void 0!==i?i:10):e._spec.label.visible},x:function(t){var i;return(null===(i=t.label)||void 0===i?void 0:i.x)+(C(e._offsetX)?e._offsetX:0)},y:function(t){var i;return(null===(i=t.label)||void 0===i?void 0:i.y)+(C(e._offsetY)?e._offsetY:0)},textBaseline:function(t){var e;return null===(e=t.label)||void 0===e?void 0:e.textBaseline},textAlign:function(t){var e;return null===(e=t.label)||void 0===e?void 0:e.textAlign},angle:function(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:function(t){return t.name}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"initTooltip",value:function(){this._tooltipHelper=new LY(this),this._sunburstMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._sunburstMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}},{key:"initAnimation",value:function(){var t,e,i=this,n={animationInfo:function(){return{innerRadius:i._computeRadius(lt(i.__innerRadius))[0],outerRadius:i._computeRadius(lt(i.__outerRadius))[0],startAngle:lt(i._startAngle)[0],endAngle:lt(i._endAngle)[0]}}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this.getMarksInType("arc").forEach((function(t){var e;t.setAnimationConfig(YF(null===(e=rO.getAnimationInKey("sunburst"))||void 0===e?void 0:e(n,r),XF(t.name,i._spec,i._markAttributeContext)))})),this.getMarksInType("text").forEach((function(t){var e;t.setAnimationConfig(YF(null===(e=rO.getAnimationInKey("fadeInOut"))||void 0===e?void 0:e(),XF(t.name,i._spec,i._markAttributeContext)))}))}},{key:"initEvent",value:function(){_(r,"initEvent",this,3)([]),this._spec.drill&&this.bindDrillEvent()}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._rawData.reRunAllTransform()}},{key:"_computeRadius",value:function(t){var e=this;return O(t)?t.map((function(t){return e._computeLayoutRadius()*t})):this._computeLayoutRadius()*t}},{key:"_computeLevel",value:function(){return{innerRadius:this._computeRadius(this.__innerRadius),outerRadius:this._computeRadius(this.__outerRadius),gap:this._gap,label:this._labelLayout}}},{key:"getGroupFields",value:function(){return[]}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return""}},{key:"_noAnimationDataKey",value:function(t,e){}},{key:"getActiveMarks",value:function(){return[this._sunburstMark]}},{key:"getMarkData",value:function(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}])}(oU);zY.type=_L.sunburst,zY.mark=DY,zY.builtInTheme={sunburst:jY},st(zY,IY);var HY=function(){rO.registerSeries(zY.type,zY),mU(),GV(),QD(),rO.registerAnimation("sunburst",(function(t,e){return{appear:BY(0,e),enter:TY(t),exit:EY(t),disappear:{duration:KD.disappear.duration}}}))},NY=function(t,e){if(!t)return t;var i=e(),n=i.width,r=i.height;return 0===n||0===r?t:new QW(i).layout(t,{width:n,height:r})},VY=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).markTooltipKeyCallback=function(e){return null==e?void 0:e[t.series.getDimensionField()[0]]},t}return c(e,t),a(e)}(wF),UY=function(t){return"fadeIn"===t?{type:"fadeIn"}:{type:"growRadiusIn"}},WY=Object.assign(Object.assign({},jF),{circlePacking:{name:"circlePacking",type:"arc"}}),GY=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=_L.circlePacking,t}return c(r,e),a(r,[{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"getValueField",value:function(){return this._valueField}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"setAttrFromSpec",value:function(){var t,e=this;_(r,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:RF),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:function(){var t;return null!==(t=e._spec.drillField)&&void 0!==t?t:RO},getRawData:function(){return e.getRawData()}}),this._circlePacking=this._spec.circlePacking,this._label=this._spec.label,this._layoutPadding=this._spec.layoutPadding}},{key:"initData",value:function(){var t=this;_(r,"initData",this,3)([]);var e=this.getRawData();T(e)||(this._spec.drill&&this.initDrillableData(this._dataSet),EI(this._dataSet,"circlePackingLayout",NY),EI(this._dataSet,"flatten",PY),e.transform({type:"circlePackingLayout",options:function(){return{nodeKey:t._categoryField,padding:t._layoutPadding,includeRoot:!1,width:t.getLayoutRect().width||1,height:t.getLayoutRect().height||1}}}),e.transform({type:"flatten",options:{callback:function(t){if(t.datum){var e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}},{key:"_addDataIndexAndKey",value:function(){var t=this.getRawData();T(null==t?void 0:t.dataSet)||(EI(t.dataSet,"addVChartProperty",_F),t.transform({type:"addVChartProperty",options:{beforeCall:DF.bind(this),call:FF}}))}},{key:"initMark",value:function(){this._initCirclePackingMark(),this._initLabelMark()}},{key:"initMarkStyle",value:function(){this._initCirclePackingMarkStyle(),this._initLabelMarkStyle()}},{key:"_initCirclePackingMark",value:function(){var t;if(!1!==(null===(t=this._circlePacking)||void 0===t?void 0:t.visible)){var e=this._createMark(r.mark.circlePacking,{isSeriesMark:!0});this._circlePackingMark=e}}},{key:"_initCirclePackingMarkStyle",value:function(){T(this._circlePackingMark)||this.setMarkStyle(this._circlePackingMark,{x:function(t){return t.x},y:function(t){return t.y},outerRadius:function(t){return t.radius},innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),zIndex:function(t){return t.depth}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initLabelMark",value:function(){var t;if(!1!==(null===(t=this._label)||void 0===t?void 0:t.visible)){var e=this._createMark(r.mark.label,{isSeriesMark:!1});this._labelMark=e}}},{key:"_initLabelMarkStyle",value:function(){T(this._labelMark)||this.setMarkStyle(this._labelMark,{x:function(t){return t.x},y:function(t){return t.y},text:function(t){return t.key},cursor:"pointer"},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"getStatisticFields",value:function(){return FY(_(r,"getStatisticFields",this,3)([]),this._categoryField,this._valueField)}},{key:"initTooltip",value:function(){this._tooltipHelper=new VY(this),this._circlePackingMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circlePackingMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}},{key:"initAnimation",value:function(){var t,e=this,i=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this.getMarksInType("arc").forEach((function(t){var n;t.setAnimationConfig(YF(null===(n=rO.getAnimationInKey("circlePacking"))||void 0===n?void 0:n(void 0,i),XF(t.name,e._spec,e._markAttributeContext)))})),this.getMarksInType("text").forEach((function(t){var i;t.setAnimationConfig(YF(null===(i=rO.getAnimationInKey("scaleInOut"))||void 0===i?void 0:i(),XF(t.name,e._spec,e._markAttributeContext)))}))}},{key:"initEvent",value:function(){_(r,"initEvent",this,3)([]),this._spec.drill&&this.bindDrillEvent()}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._rawData.reRunAllTransform()}},{key:"_noAnimationDataKey",value:function(t,e){}},{key:"getActiveMarks",value:function(){return[this._circlePackingMark]}},{key:"getMarkData",value:function(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}])}(rj);GY.type=_L.circlePacking,GY.mark=WY,GY.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"}}}}},st(GY,IY);var YY=function(){rO.registerSeries(GY.type,GY),mU(),GV(),JD(),rO.registerAnimation("circlePacking",(function(t,e){return{appear:UY(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{duration:KD.disappear.duration}}}))},XY=function(t,e,i){e.forEach((function(e){T(e[i])||t.add(e[i]),e.children&&e.children.length>0&&XY(t,e.children,i)}))},KY=function(t){var e;if(!t||!O(t))return[];if(t.length>1){var i={links:[],nodes:[]};return t.forEach((function(t){"links"!==t.id&&"nodes"!==t.id||(i[t.id]=t.values)})),[i]}return(null===(e=t[0])||void 0===e?void 0:e.latestData)?t[0].latestData:t},qY=function(t,e){if(!t||!(null==e?void 0:e.view)||!t.length)return[];var 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[];var n=t[0];if(("source"!==e.sourceField||"target"!==e.targetField||"value"!==e.valueField)&&n.links){var r=[];n.links.forEach((function(t){var i={};for(var n in t)n===e.sourceField?i.source=t[e.sourceField]:n===e.targetField?i.target=t[e.targetField]:n===e.valueField?i.value=t[e.valueField]:i[n]=t[n];r.push(i)})),n.links=r}var a=new sG(e),o=[];return o.push(a.layout(n,i)),o},ZY=function(t){var e,i;return t&&O(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:[]},JY=function(t){var e,i;return t&&O(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:[]},QY=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments))._getDimensionData=function(e){if(e.source){if(F(e.source)){var i=t.series.getSeriesKeys();return i[e.source]+" => "+i[e.target]}return e.source+" => "+e.target}return e.datum?e.datum[t.series.getSpec().categoryField]:e.key},t.markTooltipValueCallback=function(t){return t.value},t}return c(e,t),a(e)}(wF),$Y=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:{overall:e?t.growFrom():e,orient:"positive"}}},tX=function(t,e){return"fadeIn"===e?{type:"fadeIn"}:$Y(t)},eX=function(t){return"fadeIn"===t?{type:"fadeIn"}:{type:"linkPathGrowIn"}},iX=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"onBind",value:function(){var t,i,n;_(e,"onBind",this,3)([]),(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);var r=function(t,e,i){var n={x0:t.getFinalAttribute().x0,x1:t.getFinalAttribute().x1,y0:t.getFinalAttribute().y0,y1:t.getFinalAttribute().y1,thickness:t.getFinalAttribute().thickness};return{from:Object.assign({},n,{x1:n.x0,y1:n.y0}),to:n}}(this.target,this.params.options,this.params),a=r.from,o=r.to,s=null!==(n=null===(i=this.target.context)||void 0===i?void 0:i.lastAttrs)&&void 0!==n?n:a,l=this.target.getFinalAttribute();l&&Object.assign(this.target.attribute,l),this.props=o,this.propKeys=Object.keys(o).filter((function(t){return null!=o[t]})),this.animate.reSyncProps(),this.from=s,this.to=o,this.target.setAttributes(s)}},{key:"onUpdate",value:function(t,e,i){var n=this,r=this.target.attribute;this.propKeys.forEach((function(t){r[t]=n.from[t]+(n.to[t]-n.from[t])*e})),this.target.setAttributes(r)}}])}(UT),nX=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"onBind",value:function(){var t,i,n;_(e,"onBind",this,3)([]),(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);var r=function(t,e,i){var n={x0:t.getFinalAttribute().x0,x1:t.getFinalAttribute().x1,y0:t.getFinalAttribute().y0,y1:t.getFinalAttribute().y1,thickness:t.getFinalAttribute().thickness};return{from:n,to:Object.assign({},n,{x1:n.x0,y1:n.y0})}}(this.target,this.params.options,this.params),a=r.from,o=r.to,s=null!==(n=null===(i=this.target.context)||void 0===i?void 0:i.lastAttrs)&&void 0!==n?n:a;this.props=o,this.propKeys=Object.keys(o).filter((function(t){return null!=o[t]})),this.animate.reSyncProps(),this.from=s,this.to=o,this.target.setAttributes(s)}},{key:"onUpdate",value:function(t,e,i){var n=this,r=this.target.attribute;this.propKeys.forEach((function(t){r[t]=n.from[t]+(n.to[t]-n.from[t])*e})),this.target.setAttributes(r)}}])}(UT),rX=function(t,e){var i,n=null!==(i=t.curvature)&&void 0!==i?i:.5,r="number"==typeof e?t.thickness*e:t.thickness,a=t.x0,o=t.x1,s=t.y0,l=t.y1,u=a+n*(o-a),c=o+n*(a-o),h=function(t){return t};!1!==t.round&&(a=Math.round(a),o=Math.round(o),s=Math.round(s),l=Math.round(l),u=Math.round(u),c=Math.round(c),h=Math.round),"line"===t.pathType||t.pathType,"center"===t.align?(s=h(t.y0-r/2),l=h(t.y1-r/2)):"end"===t.align?(s=h(t.y0+t.thickness/2-r),l=h(t.y1+t.thickness/2-r)):(s=h(t.y0-t.thickness/2),l=h(t.y1-t.thickness/2));var d=h(s+r),v=h(l+r),f=Math.abs(o-a)>1e-6,p=t.endArrow&&f?"L".concat(o,",").concat(h(l-r/2),"L").concat(h(o+r),",").concat(h((l+v)/2),"L").concat(o,",").concat(h(v+r/2)):"",g=t.startArrow&&f?"L".concat(a,",").concat(h(d+r/2),"L").concat(h(a-r),",").concat(h((s+d)/2),"L").concat(a,",").concat(h(s-r/2)):"";return"line"===t.pathType?"M".concat(a,",").concat(s,"L").concat(o,",").concat(l).concat(p,"L").concat(o,",").concat(v,"L").concat(a,",").concat(d).concat(g,"Z"):"polyline"===t.pathType?"M".concat(a,",").concat(s,"L").concat(u,",").concat(s,"L").concat(u,",").concat(l,"L").concat(o,",").concat(l,"\n ").concat(p,"L").concat(o,",").concat(v,"L").concat(u,",").concat(v,"L").concat(u,",").concat(d,"L").concat(a,",").concat(d).concat(g,"Z"):"M".concat(a,",").concat(s,"C").concat(u,",").concat(s,",").concat(c,",").concat(l,",").concat(o,",").concat(l,"\n ").concat(p,"L").concat(o,",").concat(v,"C").concat(c,",").concat(v,",").concat(u,",").concat(d,",").concat(a,",").concat(d).concat(g,"Z")},aX=function(t,e){var i,n=null!==(i=t.curvature)&&void 0!==i?i:.5,r="number"==typeof e?t.thickness*e:t.thickness,a=t.y0,o=t.y1,s=t.x0,l=t.x1,u=a+n*(o-a),c=o+n*(a-o),h=function(t){return t};!1!==t.round&&(h=Math.round,a=Math.round(a),o=Math.round(o),s=Math.round(s),l=Math.round(l),u=Math.round(u),c=Math.round(c)),"line"===t.pathType||t.pathType,"center"===t.align?(s=h(t.x0-r/2),l=h(t.x1-r/2)):"end"===t.align?(s=h(t.x0+t.thickness/2-r),l=h(t.x1+t.thickness/2-r)):(s=h(t.x0-t.thickness/2),l=h(t.x1-t.thickness/2));var d=h(s+r),v=h(l+r),f=Math.abs(o-a)>1e-6,p=t.endArrow&&f?"L".concat(h(l-r/2),",").concat(o,"L").concat(h((l+v)/2),",").concat(h(o+r),"L").concat(h(v+r/2),",").concat(o):"",g=t.startArrow&&f?"L".concat(h(d+r/2),",").concat(a,"L").concat(h((d+s)/2),",").concat(h(a-r),"L").concat(h(s-r/2),",").concat(a):"";return"line"===t.pathType?"M".concat(s,",").concat(a,"L").concat(l,",").concat(o).concat(p,"L").concat(v,",").concat(o,"L").concat(d,",").concat(a).concat(g,"Z"):"polyline"===t.pathType?"M".concat(s,",").concat(a,"L").concat(s,",").concat(u,"L").concat(l,",").concat(u,"L").concat(l,",").concat(o,"\n ").concat(p,"L").concat(v,",").concat(o,"L").concat(v,",").concat(u,"L").concat(d,",").concat(u,"L").concat(d,",").concat(a).concat(g,"Z"):"M".concat(s,",").concat(a,"C").concat(s,",").concat(u,",").concat(l,",").concat(c,",").concat(l,",").concat(o,"\n ").concat(p,"L").concat(v,",").concat(o,"C").concat(v,",").concat(c,",").concat(d,",").concat(u,",").concat(d,",").concat(a).concat(g,"Z")},oX=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t._subMarks={back:{type:"path",defaultAttributes:{zIndex:0}},front:{type:"path",defaultAttributes:{zIndex:1}}},t._positionChannels=["x0","y0","x1","y1","thickness","round","curvature","ratio","pathType","align","endArrow","startArrow","ratio"],t._channelEncoder={backgroundStyle:function(t){return{back:t}}},t._positionEncoder=function(e,i,n){var r,a,o=Object.assign(Object.assign({},n.attribute),e),s=null!==(r=o.direction)&&void 0!==r?r:null===(a=t._glyphConfig)||void 0===a?void 0:a.direction,l=["vertical","TB","BT"].includes(s)?aX:rX,u="number"==typeof o.ratio&&o.ratio>=0&&o.ratio<=1;return{back:{path:u?l(o,1):""},front:{path:l(o,u?o.ratio:1)}}},t}return c(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{x:0,y:0,x0:0,y0:0,x1:100,y1:100,thickness:1,round:!0})}}])}(wV);oX.type="linkPath";var sX=Object.assign(Object.assign({},jF),{node:{name:"node",type:"rect"},link:{name:"link",type:"linkPath"}}),lX=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"node")}}])}(tj),uX=function(t,e,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4?arguments[4]:void 0;t.runtimeStateCache||(t.runtimeStateCache={}),t.runtimeStateCache[e]=i,t.hasState(e)&&t.removeState(e),t.addState(e,n,r)},cX=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).type=_L.sankey,e.transformerConstructor=lX,e._nodeLayoutZIndex=t.LayoutZIndex.Node,e._labelLayoutZIndex=t.LayoutZIndex.Label,e._viewBox=new ii,e._fillByNode=function(t){var i,n,r,a,o;if(t&&t.sourceRect&&t.targetRect)return e._fillByLink(t);var s=null===(n=null===(i=e._spec.node)||void 0===i?void 0:i.style)||void 0===n?void 0:n.fill;if(C(s))return s;if(C(e._spec.seriesField)){var l=null===(a=null===(r=e._option)||void 0===r?void 0:r.globalScale)||void 0===a?void 0:a.getScale("color"),u=(null==t?void 0:t.datum)?t.datum:t;return null==l?void 0:l.scale(null==u?void 0:u[e._spec.seriesField])}return null===(o=e._colorScale)||void 0===o?void 0:o.scale(e._getNodeNameFromData(t))},e._fillByLink=function(t){var i,n,r,a,o,s,l=null===(n=null===(i=e._spec.link)||void 0===i?void 0:i.style)||void 0===n?void 0:n.fill;if(l)return l;if(C(e._spec.seriesField)){var u=null===(r=e._nodesSeriesData.latestData)||void 0===r?void 0:r.find((function(e){return t.source===e.key})),c=null==u?void 0:u.datum,h=null===(o=null===(a=e._option)||void 0===a?void 0:a.globalScale)||void 0===o?void 0:o.getScale("color");return null==h?void 0:h.scale(null==c?void 0:c[e._spec.seriesField])}var d=F(t.source)?e.getNodeList()[t.source]:t.source;return null===(s=e._colorScale)||void 0===s?void 0:s.scale(d)},e._handleEmphasisElement=function(t){var i,n=null!==(i=e._spec.emphasis)&&void 0!==i?i:{},r=t.item;"adjacency"===n.effect?r&&t.mark===e._nodeMark?e._handleNodeAdjacencyClick(r):r&&t.mark===e._linkMark?e._handleLinkAdjacencyClick(r):e._handleClearEmpty():"related"===n.effect&&(r&&t.mark===e._nodeMark?e._handleNodeRelatedClick(r):r&&t.mark===e._linkMark?e._handleLinkRelatedClick(r):e._handleClearEmpty())},e._handleClearEmpty=function(){var i,n;if(e._needClear){var r=null===(i=e._nodeMark)||void 0===i?void 0:i.getGraphics();if(r&&r.length){var a=null===(n=e._linkMark)||void 0===n?void 0:n.getGraphics();a&&a.length&&(r.forEach((function(e){e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE)})),a.forEach((function(e){e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE)})),e._needClear=!1)}}},e._handleNodeAdjacencyClick=function(i){var n=mI(i),r=[n.key];if(e._linkMark){var a=e._linkMark.getGraphics();if(!a||!a.length)return;a.forEach((function(e,i){var a=mI(e);a.source===n.key?(r.includes(a.target)||r.push(a.target),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0)):a.target===n.key?(r.includes(a.source)||r.push(a.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))}))}e._nodeMark&&e._highLightElements(e._nodeMark.getGraphics(),r),e._needClear=!0},e._handleLinkAdjacencyClick=function(i){var n=mI(i),r=[n.source,n.target];if(e._linkMark){var a=e._linkMark.getGraphics();if(!a||!a.length)return;a.forEach((function(e){e===i?(e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),uX(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:1})):(e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}e._nodeMark&&e._highLightElements(e._nodeMark.getGraphics(),r),e._needClear=!0},e._handleNodeRelatedClick=function(i){var n,r=mI(i),a=e._nodeMark.getGraphics();if(a&&a.length){var o=e._linkMark.getGraphics();if(o&&o.length){var s=(null===(n=mI(o[0]))||void 0===n?void 0:n.parents)?"parents":"source";if("source"===s){var l=[r.key],u=[];if(o.forEach((function(t,e){var i,n,o,s,c=mI(t),h=(null==c?void 0:c.parents)?"parents":"source";if(lt(c[h]).includes(r.key)){if(u.includes(null!==(i=c.key)&&void 0!==i?i:c.index)||u.push(null!==(n=c.key)&&void 0!==n?n:c.index),l.includes(c.source)||l.push(c.source),!l.includes(c.target)){l.push(c.target);for(var d,v=a.find((function(t){return t.data[0].key===c.target})).data[0].sourceLinks,f=function(){var t=[];return{v:(v.forEach((function(e){var i,n;if(!u.includes(null!==(i=e.key)&&void 0!==i?i:e.index)&&(u.push(null!==(n=e.key)&&void 0!==n?n:e.index),!l.includes(e.target))){l.push(e.target);var r=a.find((function(t){return t.data[0].key===e.target}));t.push(r.data[0].targetLinks)}})),void(v=t))}};(null==v?void 0:v.length)>0;)if(d=f())return d.v}}else if(c.target===r.key&&(u.includes(null!==(o=c.key)&&void 0!==o?o:c.index)||u.push(null!==(s=c.key)&&void 0!==s?s:c.index),!l.includes(c.source))){l.push(c.source);for(var p,g=a.find((function(t){return t.data[0].key===c.source})).data[0].targetLinks,y=function(){var t=[];return{v:(g.forEach((function(e){var i,n;if(!u.includes(null!==(i=e.key)&&void 0!==i?i:e.index)&&(u.push(null!==(n=e.key)&&void 0!==n?n:e.index),!l.includes(e.source))){l.push(e.source);var r=a.find((function(t){return t.data[0].key===e.source}));t.push(r.data[0].targetLinks)}})),void(g=t))}};(null==g?void 0:g.length)>0;)if(p=y())return p.v}})),e._linkMark){var c=e._linkMark.getGraphics();if(!c||!c.length)return;c.forEach((function(e,i){var n,r=mI(e);u.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))}))}e._nodeMark&&e._highLightElements(e._nodeMark.getGraphics(),l)}else{var h=[r.key],d=r.targetLinks.reduce((function(t,e){return lt(e.datum).forEach((function(e){for(var i=e.parents,n=i.length,a=function(){var n=i[o].key,a=i[o+1]?i[o+1].key:r.key,s=e.value,l=t.find((function(t){return t.source===n&&t.target===a}));l?l.value+=s:t.push({source:n,target:a,value:s})},o=0;o<n;o++)a()})),t}),[]);o.forEach((function(e,i){var n=mI(e),a=n.datum,o=a?a.filter((function(t){return t[s].some((function(t){return t.key===r.key}))})):null,l=d.find((function(t){return t.source===n.source&&t.target===n.target}));if(o&&o.length){h.includes(n.source)||h.push(n.source),h.includes(n.target)||h.push(n.target);var u=o.reduce((function(t,e){return t+e.value}),0),c=u/n.value;return e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void uX(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:c})}if(l)return h.includes(n.source)||h.push(n.source),h.includes(n.target)||h.push(n.target),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void uX(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:l.value/n.value});e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)})),e._nodeMark&&e._highLightElements(e._nodeMark.getGraphics(),h)}e._needClear=!0}}},e._handleLinkRelatedClick=function(i){var n=e._nodeMark.getGraphics();if(n&&n.length){var r=e._linkMark.getGraphics();if(r&&r.length){if("source"==(mI(i)?"parents":"source"))e._linkMark&&r.forEach((function(e){e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE)})),e._nodeMark&&n.forEach((function(e){e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE)}));else{var a=mI(i),o=[a.source,a.target],s=[];lt(a.datum).forEach((function(t){for(var e=t.parents,i=e.length,n=function(){var i=e[r].key,n=e[r+1].key,a=t.value,o=s.find((function(t){return t.source===i&&t.target===n}));s.push({source:e[r].key,target:e[r+1].key,value:t.value}),o?o.value+=a:s.push({source:i,target:n,value:a})},r=0;r<i-1;r++)n()})),r.forEach((function(e){var i=mI(e),n=i.datum;if(i.source===a.source&&i.target===a.target)return e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void uX(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:1});var r=n?n.filter((function(t){var e=t.parents.map((function(t){return t.key}));return e.includes(a.source)&&e.includes(a.target)})):null;if(r&&r.length){o.includes(i.source)||o.push(i.source),o.includes(i.target)||o.push(i.target);var l=r.filter((function(t){return t.parents.some((function(e,i){var n;return e.key===a.source&&(null===(n=t.parents[i+1])||void 0===n?void 0:n.key)===a.target}))})).reduce((function(t,e){return t+e.value}),0),u=l/i.value;return e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void uX(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:u})}var c=s.find((function(t){return t.source===i.source&&t.target===i.target}));if(c)return o.includes(i.source)||o.push(i.source),o.includes(i.target)||o.push(i.target),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void uX(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:c.value/i.value});e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)})),e._highLightElements(n,o)}e._needClear=!0}}},e}return c(r,e),a(r,[{key:"direction",get:function(){var t;return null!==(t=this._spec.direction)&&void 0!==t?t:"horizontal"}},{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"setAttrFromSpec",value:function(){var t;_(r,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:this._spec.categoryField)}},{key:"initData",value:function(){var e,i,n,a,o=this;_(r,"initData",this,3)([]);var s=this.getViewData(),l=this.getRawData();if(l&&s){EI(this._dataSet,"sankeyLayout",qY),EI(this._dataSet,"sankeyFormat",KY),l.transform({type:"sankeyFormat"},!1),s.transform({type:"sankeyLayout",options:{view:function(){return{x0:o._viewBox.x1,x1:o._viewBox.x2,y0:o._viewBox.y1,y1:o._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!==(n=this._spec.nodeWidth)&&void 0!==n?n:10,linkWidth:this._spec.linkWidth,minStepWidth:this._spec.minStepWidth,minNodeHeight:null!==(a=this._spec.minNodeHeight)&&void 0!==a?a: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});var u=this._option.dataSet;EI(u,"sankeyNodes",ZY),EI(u,"flatten",PY);var c=new Xo(u,{name:"sankey-node-".concat(this.id,"-data")});c.parse([this.getViewData()],{type:"dataview"}),c.transform({type:"sankeyNodes"}),c.transform({type:"flatten",options:{callback:function(t){if(t.datum){var e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}},!1),c.transform({type:"addVChartProperty",options:{beforeCall:OF.bind(this),call:IF}},!1),this._nodesSeriesData=c,EI(u,"sankeyLinks",JY);var h=new Xo(u,{name:"sankey-link-".concat(this.id,"-data")});h.parse([this.getViewData()],{type:"dataview"}),h.transform({type:"sankeyLinks"}),h.transform({type:"addVChartProperty",options:{beforeCall:OF.bind(this),call:IF}},!1),this._linksSeriesData=h}}},{key:"compileData",value:function(){var t,e;_(r,"compileData",this,3)([]),null===(t=this._linkMark)||void 0===t||t.compileData(),null===(e=this._nodeMark)||void 0===e||e.compileData()}},{key:"initMark",value:function(){this._rootMark.setMarkConfig({overflow:this._spec.overflow,interactive:!!this._spec.overflow});var t=this._createMark(r.mark.node,{isSeriesMark:!0,dataView:this._nodesSeriesData});t&&(t.setMarkConfig({zIndex:this._nodeLayoutZIndex}),this._nodeMark=t);var e=this._createMark(r.mark.link,{dataView:this._linksSeriesData});e&&(this._linkMark=e)}},{key:"_buildMarkAttributeContext",value:function(){_(r,"_buildMarkAttributeContext",this,3)([]),this._markAttributeContext.valueToNode=this.valueToNode.bind(this),this._markAttributeContext.valueToLink=this.valueToLink.bind(this)}},{key:"valueToNode",value:function(t){var e=this._nodesSeriesData.latestData,i=lt(t)[0];return e&&e.find((function(t){return t.key===i}))}},{key:"valueToLink",value:function(t){var e=this._linksSeriesData.latestData,i=lt(t);return e&&e.find((function(t){return t&&t.source===i[0]&&t.target===i[1]}))}},{key:"valueToPositionX",value:function(t){var e=this.valueToNode(t);return null==e?void 0:e.x0}},{key:"valueToPositionY",value:function(t){var e=this.valueToNode(t);return null==e?void 0:e.y0}},{key:"initMarkStyle",value:function(){this._initNodeMarkStyle(),this._initLinkMarkStyle()}},{key:"_initNodeMarkStyle",value:function(){var e,i,n=this._nodeMark;n&&(this.setMarkStyle(n,{x:function(t){return t.x0},x1:function(t){return t.x1},y:function(t){return t.y0},y1:function(t){return t.y1}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Mark),this.setMarkStyle(n,{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))}},{key:"_initLinkMarkStyle",value:function(){var e,i,n=this._linkMark;n&&(n.setGlyphConfig({direction:this.direction}),this.setMarkStyle(n,{x0:function(t){return t.x0},x1:function(t){return t.x1},y0:function(t){return t.y0},y1:function(t){return t.y1},thickness:function(t){return t.thickness}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this.setMarkStyle(n,{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))}},{key:"initLabelMarkStyle",value:function(t,e){var i=this;if(t){var n=e.position;n&&n.includes("inside")?this.setMarkStyle(t,{fill:"#ffffff",text:function(t){return i._createText(t,e)},maxLineWidth:function(t){var i;return null!==(i=e.limit)&&void 0!==i?i:t.x1-t.x0}}):this.setMarkStyle(t,{fill:this._fillByNode,text:function(t){return i._createText(t,e)},maxLineWidth:e.limit}),t.setMarkConfig({zIndex:this._labelLayoutZIndex})}}},{key:"_createText",value:function(t,e){if(T(t)||T(t.datum))return"";var i=t.datum[this._spec.categoryField]||"",n=e||{},r=gF(n.formatMethod,n.formatter,i,t.datum),a=r.formatFunc,o=r.args;return a&&(i=a.apply(void 0,b(o).concat([{series:this}]))),i}},{key:"initAnimation",value:function(){var t,e,i,n,r=this,a={direction:this.direction,growFrom:function(){var t,e;return"horizontal"===r.direction?null===(t=r._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=r._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},o=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(YF(null===(i=rO.getAnimationInKey("sankeyNode"))||void 0===i?void 0:i(a,o),XF("node",this._spec,this._markAttributeContext))),this._linkMark&&this._linkMark.setAnimationConfig(YF(null===(n=rO.getAnimationInKey("sankeyLinkPath"))||void 0===n?void 0:n(a,o),XF("link",this._spec,this._markAttributeContext)))}},{key:"initEvent",value:function(){var t,e,i;_(r,"initEvent",this,3)([]),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));var n=null!==(i=this._spec.emphasis)&&void 0!==i?i:{};if(!0!==this._option.disableTriggerEvent&&n.enable&&("adjacency"===n.effect||"related"===n.effect)){var a="hover"===n.trigger?"pointerover":"pointerdown";this.event.on(a,{level:SI.chart},this._handleEmphasisElement)}}},{key:"nodesSeriesDataUpdate",value:function(){this._nodeMark.getData().updateData(),this._nodeList=null,this._setNodeOrdinalColorScale()}},{key:"linksSeriesDataUpdate",value:function(){this._linkMark.getData().updateData()}},{key:"_highLightElements",value:function(e,i){e&&e.length&&e.forEach((function(e){e.removeState([t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS]),i.includes(mI(e).key)?e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0):e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)}))}},{key:"initTooltip",value:function(){this._tooltipHelper=new QY(this),this._nodeMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodeMark),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark)}},{key:"_setNodeOrdinalColorScale",value:function(){var t,e,i,n,r,a=null===(e=null===(t=this._option)||void 0===t?void 0:t.globalScale)||void 0===e?void 0:e.getScale("color");if(null==a?void 0:a._specified)this._colorScale=a;else{var o,s;a&&(o=a.domain(),s=a.range()),s||(s=this._getDataScheme()),o&&!T(o[0])||(o=this.getNodeList())&&o.length>10&&(s=null===(i=this._getDataScheme()[1])||void 0===i?void 0:i.scheme);var l=new IL;null===(r=(n=l.domain(o)).range)||void 0===r||r.call(n,s),this._colorScale=l}}},{key:"getNodeList",value:function(){var t,e,i=this;if(this._nodeList)return this._nodeList;var n=this._rawData.latestData[0],r=(null==n?void 0:n.nodes)?(null===(t=n.nodes[0])||void 0===t?void 0:t.children)?Array.from(this.extractNamesFromTree(n.nodes,this._spec.categoryField)):n.nodes.map((function(t,e){return t[i._spec.categoryField]})):(null==n?void 0:n.links)?Array.from(this.extractNamesFromLink(n.links)):null===(e=null==n?void 0:n.values)||void 0===e?void 0:e.map((function(t,e){return t[i._spec.categoryField]}));return this._nodeList=r,r}},{key:"_getNodeNameFromData",value:function(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]}},{key:"extractNamesFromTree",value:function(t,e){var i=this,n=new Set;return t.forEach((function(t){n.add(t[e]),t.children&&i.extractNamesFromTree(t.children,e).forEach((function(t){return n.add(t)}))})),n}},{key:"extractNamesFromLink",value:function(t){var e=new Set,i=this._spec,n=i.sourceField,r=i.targetField;return t.forEach((function(t){C(t[n])&&e.add(t[n]),C(t[r])&&e.add(t[r])})),e}},{key:"getDimensionField",value:function(){return[this._spec.categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"getRawDataStatisticsByField",value:function(t,e){var i;return this._rawStatisticsCache||(this._rawStatisticsCache={}),this._rawStatisticsCache[t]||(this._viewDataStatistics&&this.getViewData().transformsArr.length<=1&&(null===(i=this._viewDataStatistics.latestData)||void 0===i?void 0:i[t])?this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t]:this._rawData&&(this._rawStatisticsCache[t]={values:this._collectByField(t)})),this._rawStatisticsCache[t]}},{key:"_collectByField",value:function(t){var e,i,n,r=this,a=[],o=null===(i=null===(e=this.getRawData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i[0];if(!o)return[];if(o.links)(null===(n=o.nodes)||void 0===n?void 0:n.length)&&o.nodes.forEach((function(t){t[r._seriesField]&&a.push(t[r._seriesField])}));else if(o.nodes){var s=new Set;return XY(s,o.nodes,this._seriesField),Array.from(s)}return a}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this.getViewData().reRunAllTransform()}},{key:"getDefaultShapeType",value:function(){return"square"}},{key:"_noAnimationDataKey",value:function(t,e){}},{key:"getActiveMarks",value:function(){return[this._nodeMark,this._linkMark]}},{key:"getMarkData",value:function(t){return t.datum?O(t.datum)?t.datum[t.datum.length-1]:t.datum:t}}])}(rj);cX.type=_L.sankey,cX.transformerConstructor=lX,cX.mark=sX,cX.builtInTheme={sankey:{link:{style:{fillOpacity:.15,round:!0}}}};var hX=function(){uN(),TV(),aM(),rO.registerGraphicComponent("path",(function(t){return gp(t)})),rO.registerMark(oX.type,oX),GV(),rO.registerAnimation("sankeyNode",(function(t,e){return Object.assign({appear:tX(t,e)},ZD)})),rO.registerAnimation("sankeyLinkPath",(function(t,e){return{appear:eX(e),enter:{type:"linkPathGrowIn"},exit:{type:"linkPathGrowOut"},disappear:{duration:KD.disappear.duration}}})),RT.registerBuiltInAnimate("linkPathGrowOut",nX),RT.registerBuiltInAnimate("linkPathGrowIn",iX),QD(),rO.registerSeries(cX.type,cX)},dX=function(t,e){var i={},n=e.fields;if(w(n)&&(n=n()),!(null==n?void 0:n.length)||!(null==t?void 0:t.length))return i;if(!t[0].latestData)return i;var r=t[0].latestData,a=PY(r);return i=CF([{latestData:a}],e)},vX=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).markTooltipKeyCallback=function(e){var i,n;return null===(n=null===(i=t.series)||void 0===i?void 0:i.getMarkData(e))||void 0===n?void 0:n[t.series.getDimensionField()[0]]},t.markTooltipValueCallback=function(e){var i,n,r=t._seriesCacheInfo.measureFields,a=null===(i=t.series)||void 0===i?void 0:i.getMarkData(e);if(r[0]&&a)return null!==(n=a[r[0]])&&void 0!==n?n:e.value},t.dimensionTooltipTitleCallback=function(e){var i,n=t._seriesCacheInfo.dimensionFields,r=null===(i=t.series)||void 0===i?void 0:i.getMarkData(e);if(n[0]&&r)return r[n[0]]},t}return c(e,t),a(e,[{key:"defaultShapeType",get:function(){return"square"}}])}(wF),fX=Object.assign(Object.assign({},jF),{nonLeaf:{name:"nonLeaf",type:"rect"},leaf:{name:"leaf",type:"rect"},nonLeafLabel:{name:"nonLeafLabel",type:"text"}}),pX=function(t){return"fadeIn"===t?{type:"fadeIn"}:{type:"growCenterIn"}},gX=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"nonLeaf","nonLeafLabel","initNonLeafLabelMarkStyle"),this._addMarkLabelSpec(t,"leaf")}}])}(tj),yX=function(t,e){if(e.getViewBox()){var i=new fG(e).layout(t,e.getViewBox()),n=[];return DW(i,n,{maxDepth:null==e?void 0:e.maxDepth}),n.forEach((function(t,i){t&&[RF,"name"].forEach((function(i){t[i]=t.datum[t.depth][e.nameField]}))})),n}return[]},mX=function(r){function o(){var t;return n(this,o),(t=i(this,o,arguments)).type=_L.treemap,t.transformerConstructor=gX,t._categoryField="name",t._valueField="value",t._viewBox=new ii,t._enableAnimationHook=t.enableMarkAnimation.bind(e(t)),t.isHierarchyData=function(){return!0},t}return c(o,r),a(o,[{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"setAttrFromSpec",value:function(){var t,e=this;_(o,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:RF),this._spec.roam&&(this.initZoomable(this.event,this._option.mode),this._matrix=new ai),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:function(){var t,i;return null!==(i=null!==(t=e._spec.drillField)&&void 0!==t?t:e._categoryField)&&void 0!==i?i:RO},getRawData:function(){return e.getRawData()}}),z(this._spec.maxDepth)&&(this._maxDepth=this._spec.maxDepth-1)}},{key:"initData",value:function(){var t,e,i,n,r,a=this;_(o,"initData",this,3)([]),EI(this._dataSet,"treemap",yX),null===(t=this._data.getDataView())||void 0===t||t.transform({type:"treemap",options:{nameField:this._categoryField,valueField:this._valueField,getViewBox:function(){return a._viewBox.empty()?null:{x0:a._viewBox.x1,x1:a._viewBox.x2,y0:a._viewBox.y1,y1:a._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===(n=this._spec.nonLeafLabel)||void 0===n?void 0:n.position,minVisibleArea:null!==(r=this._spec.minVisibleArea)&&void 0!==r?r:10,minChildrenVisibleArea:this._spec.minChildrenVisibleArea,minChildrenVisibleSize:this._spec.minChildrenVisibleSize}}),this.getViewData()&&this._spec.drill&&this.initDrillableData(this._dataSet)}},{key:"_runTreemapTransform",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._data.getDataView().reRunAllTransform(),t&&this.getCompiler().renderNextTick()}},{key:"_addDataIndexAndKey",value:function(){var t;(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(EI(this._rawData.dataSet,"addVChartProperty",_F),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:DF.bind(this),call:FF}}))}},{key:"getRawDataStatisticsByField",value:function(t,e){var i;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]&&this._rawData){var n=dX([this._rawData],{fields:[{key:t,operations:e?["min","max"]:["values"]}]})[t];this._rawStatisticsCache[t]=et(null!==(i=this._rawStatisticsCache[t])&&void 0!==i?i:{},n)}return this._rawStatisticsCache[t]}},{key:"_createHierarchyDataStatistics",value:function(t,e){var i=this;EI(this._dataSet,"hierarchyDimensionStatistics",dX),EI(this._dataSet,"flatten",PY);var n=new Xo(this._dataSet,{name:t});return n.parse(e,{type:"dataview"}),n.transform({type:"hierarchyDimensionStatistics",options:{fields:function(){var t=i.getStatisticFields();return i._seriesField&&i._seriesField!==i._categoryField&&t.push({key:i._seriesField,operations:["values"]}),t}}},!1),n}},{key:"getStatisticFields",value:function(){return FY(_(o,"getStatisticFields",this,3)([]),this._categoryField,this._valueField)}},{key:"initMark",value:function(){var t=this,e=this._createMark(o.mark.nonLeaf,{isSeriesMark:!0});e&&(e.setTransform([{type:"filter",callback:function(e){return!t._shouldFilterElement(e,"nonLeaf")}}]),this._nonLeafMark=e);var i=this._createMark(o.mark.leaf,{isSeriesMark:!0});i&&(i.setTransform([{type:"filter",callback:function(e){return!t._shouldFilterElement(e,"leaf")}}]),this._leafMark=i)}},{key:"initMarkStyle",value:function(){this._initLeafMarkStyle(),this._initNonLeafMarkStyle()}},{key:"_initLeafMarkStyle",value:function(){this._leafMark&&this.setMarkStyle(this._leafMark,{x:function(t){return t.x0},y:function(t){return t.y0},x1:function(t){return t.x1},y1:function(t){return t.y1},fill:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initNonLeafMarkStyle",value:function(){this._nonLeafMark&&this.setMarkStyle(this._nonLeafMark,{x:function(t){return t.x0},y:function(t){return t.y0},x1:function(t){return t.x1},y1:function(t){return t.y1},fill:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initRichStyleOfLabelMark",value:function(e){"rich"===e.getTextType()&&this.setMarkStyle(e,{maxWidth:function(t){return Math.abs(t.x0-t.x1)},maxHeight:function(t){return Math.abs(t.y0-t.y1)},ellipsis:!0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"initLabelMarkStyle",value:function(e){var i=this;e&&(this._labelMark=e,e.setRule("treemap"),this.setMarkStyle(e,{x:function(t){return(t.x0+t.x1)/2},y:function(t){return(t.y0+t.y1)/2},text:function(t){var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[i.getDimensionField()[0]]},maxLineWidth:function(t){return t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._initRichStyleOfLabelMark(e))}},{key:"initNonLeafLabelMarkStyle",value:function(e){var i=this;e&&(this._nonLeafLabelMark=e,e.setRule("treemap"),this.setMarkStyle(e,{x:function(t){return t.labelRect?(t.labelRect.x0+t.labelRect.x1)/2:(t.x0+t.x1)/2},y:function(t){return t.labelRect?(t.labelRect.y0+t.labelRect.y1)/2:(t.y0+t.y1)/2},text:function(t){var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[i.getDimensionField()[0]]},maxLineWidth:function(t){return t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._initRichStyleOfLabelMark(e))}},{key:"initAnimation",value:function(){var t=this;this.getMarksInType("rect").forEach((function(e){var i;e.setAnimationConfig(YF(null===(i=rO.getAnimationInKey("treemap"))||void 0===i?void 0:i(),XF(e.name,t._spec,t._markAttributeContext)))}))}},{key:"initEvent",value:function(){var t=this;_(o,"initEvent",this,3)([]),this._spec.roam&&(this.initDragEventOfSeries(this),this.event.on("panmove",(function(e){t.handlePan(e)})),this.initZoomEventOfSeries(this),this.event.on("zoom",(function(e){t.handleZoom(e)}))),this._spec.drill&&this.bindDrillEvent()}},{key:"_getDataIdKey",value:function(){return"key"}},{key:"initTooltip",value:function(){this._tooltipHelper=new vX(this),this._leafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._leafMark),this._nonLeafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nonLeafMark)}},{key:"_shouldFilterElement",value:function(t,e){var i=t.isLeaf;return"leaf"===e?!i:i}},{key:"handlePan",value:function(t){var e=t.delta;if(0!==e[0]||0!==e[1]){this._matrix.reset(),this._matrix.translate(e[0],e[1]);var i=this._matrix,n=i.a,r=i.b,a=i.c,o=i.d,s=i.e,l=i.f;this._matrix.multiply(n,r,a,o,s,l),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}}},{key:"handleZoom",value:function(t){var e=t.scale,i=t.scaleCenter;if(1!==e){this._matrix.reset();var n=i.x,r=i.y;this._matrix.translate(n,r),this._matrix.scale(e,e),this._matrix.translate(-n,-r);var a=this._matrix,o=a.a,s=a.b,l=a.c,u=a.d,c=a.e,h=a.f;this._matrix.multiply(o,s,l,u,c,h),this.disableMarkAnimation(),this.event.on(gI.AFTER_DO_RENDER,this._enableAnimationHook),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"onLayoutEnd",value:function(){_(o,"onLayoutEnd",this,3)([]),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runTreemapTransform()}},{key:"enableMarkAnimation",value:function(){this.getMarks().forEach((function(t){})),[this._labelMark,this._nonLeafLabelMark].forEach((function(t){t&&t.getComponent()&&t.getComponent().getProduct().enableAnimation()})),this.event.off(gI.AFTER_DO_RENDER,this._enableAnimationHook)}},{key:"disableMarkAnimation",value:function(){this.getMarks().forEach((function(t){})),[this._labelMark,this._nonLeafLabelMark].forEach((function(t){t&&t.getComponent()&&t.getComponent().getProduct().disableAnimation()}))}},{key:"getDefaultShapeType",value:function(){return"square"}},{key:"getActiveMarks",value:function(){return[this._nonLeafMark,this._leafMark]}},{key:"getMarkData",value:function(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}])}(rj);mX.type=_L.treemap,mX.mark=fX,mX.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"}}}},mX.transformerConstructor=gX,st(mX,IY),st(mX,NN);var _X=function(){rO.registerGrammarTransform("filter",{transform:function(t,e){return null==e?void 0:e.filter(t.callback)}}),rO.registerGrammarTransform("map",{transform:function(t,e){return null==e||e.forEach((function(e,i){t.callback(e)})),e}}),uN(),GV(),rO.registerAnimation("treemap",(function(t,e){return{appear:pX(e),enter:{type:"growCenterIn"},exit:{type:"growCenterOut"},disappear:{duration:KD.disappear.duration}}})),QD(),rO.registerSeries(mX.type,mX)},bX=Object.assign(Object.assign({},sW),{segment:{name:"segment",type:"arc"},track:{name:"track",type:"arc"}}),kX=Object.assign(Object.assign({},jF),{pin:{name:"pin",type:"path"},pinBackground:{name:"pinBackground",type:"path"},pointer:{name:"pointer",type:["path","rect"]}}),xX={type:"fadeIn"};function SX(t,e){return"fadeIn"===e?xX:function(t){return{channel:{angle:{from:t.startAngle+Math.PI/2}}}}(t)}var AX=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments))._supportStack=!1,t}return c(e,t),a(e)}(tj),MX=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"enableByType",value:function(t){return"dimension"!==t}}])}(wF),wX="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",TX={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:wX,fill:"#888"}},pinBackground:{width:.06,height:.06,style:{path:wX,fill:"#ddd"}}},CX=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=_L.gaugePointer,t.transformerConstructor=AX,t._pinMark=null,t._pointerMark=null,t._pinBackgroundMark=null,t}return c(e,t),a(e,[{key:"setAttrFromSpec",value:function(){var t;_(e,"setAttrFromSpec",this,3)([]),this.setRadiusField(this._spec.radiusField),this._pointerType="rect"===(null===(t=this._spec.pointer)||void 0===t?void 0:t.type)?"rect":"path"}},{key:"initMark",value:function(){this._pinBackgroundMark=this._createMark(e.mark.pinBackground),this._pointerMark=this._createMark(Object.assign(Object.assign({},e.mark.pointer),{type:this._pointerType}),{isSeriesMark:!0}),this._pinMark=this._createMark(e.mark.pin)}},{key:"initMarkStyle",value:function(){this.initPinBackgroundMarkStyle(),this.initPointerMarkStyle(),this.initPinMarkStyle()}},{key:"initGroups",value:function(){}},{key:"initPointerMarkStyle",value:function(){var t=this,e=this._pointerMark,i=this._spec.pointer;e&&(this.setMarkStyle(e,{x:function(e){var n,r;return t._getPointerAnchor(e,i).x-t._getPointerWidth()*(null!==(r=null===(n=null==i?void 0:i.center)||void 0===n?void 0:n[0])&&void 0!==r?r:0)},y:function(e){var n,r;return t._getPointerAnchor(e,i).y-t._getPointerHeight(e)*(null!==(r=null===(n=null==i?void 0:i.center)||void 0===n?void 0:n[1])&&void 0!==r?r:0)},anchor:function(e){var n=t._getPointerAnchor(e,i);return[n.x,n.y]},fill:this.getColorAttribute(),zIndex:200}),"path"===this._pointerType?this.setMarkStyle(e,{scaleX:this._getPointerWidth.bind(this),scaleY:this._getPointerHeight.bind(this),angle:function(e){return t._getPointerAngle(e)+Math.PI/2}}):this.setMarkStyle(e,{width:this._getPointerWidth.bind(this),height:this._getPointerHeight.bind(this),angle:function(e){return t._getPointerAngle(e)-Math.PI/2}}))}},{key:"initTooltip",value:function(){this._tooltipHelper=new MX(this),this._pointerMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pointerMark)}},{key:"_getPointerAnchor",value:function(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]]])})}},{key:"_getPointerWidth",value:function(){return this._spec.pointer.width*this._computeLayoutRadius()}},{key:"_getPointerHeight",value:function(t){var e,i,n=this._spec.pointer,r=this._radiusField[0];return C(this.radiusAxisHelper)&&C(r)?this.radiusAxisHelper.dataToPosition([t[r]])-(null!==(e=null==n?void 0:n.innerPadding)&&void 0!==e?e:0)-(null!==(i=null==n?void 0:n.outerPadding)&&void 0!==i?i:10):n.height*this._computeLayoutRadius()}},{key:"_getPointerAngle",value:function(t){var e=this.angleAxisHelper.getScale().domain(),i=ct(e),n=ht(e),r=Lt(t[this._angleField[0]],n,i);return this.angleAxisHelper.dataToPosition([r])}},{key:"_getRotatedPointerCenterOffset",value:function(t){var e,i,n,r,a=this._spec.pointer,o=this._getPointerWidth()*(null!==(i=null===(e=null==a?void 0:a.center)||void 0===e?void 0:e[0])&&void 0!==i?i:0),s=-this._getPointerHeight(t)*(null!==(r=null===(n=null==a?void 0:a.center)||void 0===n?void 0:n[1])&&void 0!==r?r:0),l=this._getPointerAngle(t)-Math.PI/2,u=Math.cos(l),c=Math.sin(l);return{x:o*u+s*c,y:-(s*u-o*c)}}},{key:"initPinBackgroundMarkStyle",value:function(){var t=this,e=this._pinBackgroundMark,i=this._spec.pinBackground;e&&this.setMarkStyle(e,{x:function(e){return t._getPointerAnchor(e,i).x},y:function(e){return t._getPointerAnchor(e,i).y},scaleX:function(){return i.width*t._computeLayoutRadius()},scaleY:function(){return i.height*t._computeLayoutRadius()},fill:this.getColorAttribute(),zIndex:100})}},{key:"initPinMarkStyle",value:function(){var t=this,e=this._pinMark,i=this._spec.pin;e&&this.setMarkStyle(e,{x:function(e){return t._getPointerAnchor(e,i).x},y:function(e){return t._getPointerAnchor(e,i).y},scaleX:function(){return i.width*t._computeLayoutRadius()},scaleY:function(){return i.height*t._computeLayoutRadius()},fill:this.getColorAttribute(),zIndex:300})}},{key:"getInteractionTriggers",value:function(){return this._parseInteractionConfig(this._pointerMark?[this._pointerMark]:[])}},{key:"initAnimation",value:function(){var t,e,i,n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._pointerMark.setAnimationConfig(YF(null===(i=rO.getAnimationInKey("gaugePointer"))||void 0===i?void 0:i({startAngle:this._startAngle},n),XF("pointer",this._spec,this._markAttributeContext)))}},{key:"getDefaultShapeType",value:function(){return"circle"}},{key:"getActiveMarks",value:function(){return[]}}])}(lW);CX.type=_L.gaugePointer,CX.mark=kX,CX.builtInTheme={gaugePointer:TX},CX.transformerConstructor=AX;var EX=function(){rO.registerSeries(CX.type,CX),ON(),uN(),rO.registerAnimation("gaugePointer",(function(t,e){var i=SX(t,e);return{appear:i,enter:i,disappear:{duration:KD.disappear.duration}}})),HU(),jU()},BX=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments))._supportStack=!1,t}return c(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"segment")}}])}(tj),PX=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=_L.gauge,t.transformerConstructor=BX,t._segmentMark=null,t._trackMark=null,t._padAngle=0,t}return c(r,e),a(r,[{key:"setAttrFromSpec",value:function(){var t;_(r,"setAttrFromSpec",this,3)([]),this._padAngle=xe(null!==(t=this._spec.padAngle)&&void 0!==t?t:0)}},{key:"initData",value:function(){var t,e=this;_(r,"initData",this,3)([]),EI(this._option.dataSet,"spiltSegment",(function(t,i){var n=t.slice();return n.sort((function(t,i){return t[e._angleField[0]]-i[e._angleField[0]]})),n.forEach((function(t,i){t[JO]=t[e._angleField[0]],t[ZO]=i>0?n[i-1][JO]:void 0})),n})),null===(t=this.getViewData())||void 0===t||t.transform({type:"spiltSegment"},!1)}},{key:"initMark",value:function(){_(r,"initMark",this,3)([]),this._trackMark=this._createMark(r.mark.track,{parent:this._arcGroupMark,dataView:!1}),this._segmentMark=this._createMark(r.mark.segment,{parent:this._arcGroupMark,isSeriesMark:!0})}},{key:"initMarkStyle",value:function(){_(r,"initMarkStyle",this,3)([]),this.initTrackMarkStyle(),this.initSegmentMarkStyle()}},{key:"initSegmentMarkStyle",value:function(){var t,e=this,i=this._segmentMark;i&&this.setMarkStyle(i,{x:function(){return e.angleAxisHelper.center().x},y:function(){return e.angleAxisHelper.center().y},startAngle:this._getAngleValueStart.bind(this),endAngle:this._getAngleValueEnd.bind(this),innerRadius:function(){var t;return e._computeLayoutRadius()*(null!==(t=e._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:function(){var t,i;return e._computeLayoutRadius()*(null!==(i=null!==(t=e._spec.radius)&&void 0!==t?t:e._spec.outerRadius)&&void 0!==i?i:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0})}},{key:"generateRadiusStyle",value:function(t){var e=this;if(t){var i={};return t.outerRadius&&(i.outerRadius=function(){return e._computeLayoutRadius()*t.outerRadius}),t.innerRadius&&(i.innerRadius=function(){return e._computeLayoutRadius()*t.innerRadius}),i}}},{key:"initMarkStyleWithSpec",value:function(e,i){if(_(r,"initMarkStyleWithSpec",this,3)([e,i]),e&&"segment"===e.name){var n=this.getSpec().segment;if(n)for(var a in n.state||{})this.setMarkStyle(e,this.generateRadiusStyle(n.state[a]),a,t.AttributeLevel.User_Mark)}}},{key:"initTooltip",value:function(){_(r,"initTooltip",this,3)([]),this._segmentMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._segmentMark)}},{key:"initTrackMarkStyle",value:function(){var t,e=this,i=this._trackMark;i&&this.setMarkStyle(i,{x:function(){return e.angleAxisHelper.center().x},y:function(){return e.angleAxisHelper.center().y},startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:function(){var t;return e._computeLayoutRadius()*(null!==(t=e._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:function(){var t,i;return e._computeLayoutRadius()*(null!==(i=null!==(t=e._spec.radius)&&void 0!==t?t:e._spec.outerRadius)&&void 0!==i?i:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,zIndex:100})}},{key:"_getAngleValueStartWithoutMask",value:function(t){var e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),n=It(e,(e+i)/2)(e+(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?jL(n,this.angleAxisHelper.getScale(0)):n}},{key:"_getAngleValueEndWithoutMask",value:function(t){var e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),n=It(i,(e+i)/2)(i-(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?jL(n,this.angleAxisHelper.getScale(0)):n}},{key:"_getAngleValueStartWithoutPadAngle",value:function(t){return C(t[ZO])?this.angleAxisHelper.dataToPosition([t[ZO]]):this._startAngle}},{key:"_getAngleValueEndWithoutPadAngle",value:function(t){return this.angleAxisHelper.dataToPosition([t[JO]])}},{key:"initAnimation",value:function(){var t,e,i,n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._segmentMark.setAnimationConfig(YF(null===(i=rO.getAnimationInKey("circularProgress"))||void 0===i?void 0:i({startAngle:this._startAngle},n),XF("segment",this._spec,this._markAttributeContext)))}},{key:"getDefaultShapeType",value:function(){return"circle"}},{key:"getActiveMarks",value:function(){return[]}}])}(lW);PX.type=_L.gauge,PX.mark=bX,PX.builtInTheme={gauge:{outerRadius:.8,innerRadius:.6,padAngle:1.146,segment:{style:{fillOpacity:1}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}}},PX.transformerConstructor=BX;var RX=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t}return c(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{fill:void 0,lineWidth:0,padding:0})}},{key:"_createGraphic",value:function(){return Gf(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}},{key:"_transformGraphicAttributes",value:function(t,i,n){var r,a,o,s=_(e,"_transformGraphicAttributes",this,3)([t,i,n]),l=null!==(a=null!==(r=s.shape)&&void 0!==r?r:s.symbolType)&&void 0!==a?a:null===(o=t.attribute)||void 0===o?void 0:o.symbolType;return T(l)?s.symbolType="rect":s.symbolType=l,s}}])}(HD);function LX(t){return!1===t?{}:{type:"fadeIn"}}RX.type="cell";var OX=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"enableByType",value:function(t){return"dimension"!==t}}])}(wF),IX=Object.assign(Object.assign({},jF),{cell:{name:"cell",type:"cell"},cellBackground:{name:"cellBackground",type:"cell"}}),DX=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"cell")}}])}(tj),FX=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=_L.heatmap,t.transformerConstructor=DX,t}return c(r,e),a(r,[{key:"getFieldValue",value:function(){return this._fieldValue}},{key:"setFieldValue",value:function(t){this._fieldValue=lt(t)}},{key:"setAttrFromSpec",value:function(){_(r,"setAttrFromSpec",this,3)([]),this.setFieldValue(this._spec.valueField)}},{key:"initMark",value:function(){this._cellMark=this._createMark(r.mark.cell,{isSeriesMark:!0},{morph:ZF(this._spec,r.mark.cell.name),morphElementKey:this.getDimensionField()[0]}),this._backgroundMark=this._createMark(r.mark.cellBackground)}},{key:"initMarkStyle",value:function(){this.initCellMarkStyle(),this.initCellBackgroundMarkStyle()}},{key:"initLabelMarkStyle",value:function(t){var e=this;t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:function(t){return t[e.getMeasureField()[0]]}})}},{key:"initCellMarkStyle",value:function(){var e=this;this.setMarkStyle(this._cellMark,{x:function(t){return e.dataToPositionX(t)},y:function(t){return e.dataToPositionY(t)},size:function(){return[e.getCellSize(e._xAxisHelper),e.getCellSize(e._yAxisHelper)]},fill:this.getColorAttribute()},"normal",t.AttributeLevel.Series)}},{key:"initCellBackgroundMarkStyle",value:function(){var e,i,n,r=this,a=ki(null!==(n=null===(i=null===(e=this._spec.cellBackground)||void 0===e?void 0:e.style)||void 0===i?void 0:i.padding)&&void 0!==n?n:0);this.setMarkStyle(this._backgroundMark,{x:function(t){var e=r.getCellSize(r._xAxisHelper);return r.dataToPositionX(t)-e/2+a[3]},y:function(t){var e=r.getCellSize(r._yAxisHelper);return r.dataToPositionY(t)-e/2+a[0]},width:function(){return r.getCellSize(r._xAxisHelper)-a[1]-a[3]},height:function(){return r.getCellSize(r._yAxisHelper)-a[0]-a[2]}},"normal",t.AttributeLevel.Series)}},{key:"getColorAttribute",value:function(){var t;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:this.getFieldValue()[0]}}},{key:"getInteractionTriggers",value:function(){return this._parseInteractionConfig(this._cellMark?[this._cellMark]:[])}},{key:"initAnimation",value:function(){var t,e,i,n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset,r=nj(this);this._cellMark.setAnimationConfig(YF(null===(i=rO.getAnimationInKey("heatmap"))||void 0===i?void 0:i(n),XF("cell",this._spec,this._markAttributeContext),r))}},{key:"getCellSize",value:function(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}},{key:"initTooltip",value:function(){this._tooltipHelper=new OX(this),this._cellMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._cellMark)}},{key:"getDefaultShapeType",value:function(){return"rect"}},{key:"getDimensionField",value:function(){return[].concat(this.fieldX,this.fieldY)}},{key:"getMeasureField",value:function(){return this.getFieldValue()}},{key:"getActiveMarks",value:function(){return[this._cellMark]}}])}(rj);FX.type=_L.heatmap,FX.mark=IX,FX.builtInTheme={heatmap:{cell:{style:{shape:"rect",fillOpacity:1}},cellBackground:{visible:!1}}},FX.transformerConstructor=DX;var jX=function(){GV(),rO.registerMark(RX.type,RX),rO.registerGraphicComponent("symbol",Gf),vM(),pM(),WB(),rO.registerAnimation("heatmap",(function(t,e){return Object.assign(Object.assign({},ZD),{appear:LX(e)})})),zz(),Iz(),rO.registerSeries(FX.type,FX)},zX=Object.assign(Object.assign({},jF),{nodePoint:{name:"nodePoint",type:"symbol"},ripplePoint:{name:"ripplePoint",type:"ripple"},centerPoint:{name:"centerPoint",type:"symbol"},centerLabel:{name:"centerLabel",type:"text"}}),HX="".concat(TO,"_CORRELATION_X"),NX="".concat(TO,"_CORRELATION_Y"),VX="".concat(TO,"_CORRELATION_SIZE"),UX=function(t,e){var i,n,r,a,o,l,u,c,h,d,v,f,p,g,y;if(!t||!(null==e?void 0:e.view)||!O(t))return t;var _=e.view();if(_.x1-_.x0==0||_.y1-_.y0==0||_.x1-_.x0==-1/0||_.x1-_.x0==1/0||_.y1-_.y0==-1/0||_.y1-_.y0==1/0)return t;var b=xe(null!==(i=e.startAngle)&&void 0!==i?i:-90),k=xe(null!==(n=e.endAngle)&&void 0!==n?n:270),x=Math.max((_.x1-_.x0)/2,(_.y1-_.y0)/2),S=Xt(null!==(r=e.innerRadius)&&void 0!==r?r:0,x),A=Xt(e.outerRadius,x),M=[F(null===(a=e.center)||void 0===a?void 0:a[0])?e.center[0]:_.x0+Xt(null!==(l=null===(o=e.center)||void 0===o?void 0:o[0])&&void 0!==l?l:"50%",_.x1-_.x0),F(null===(u=e.center)||void 0===u?void 0:u[1])?e.center[1]:_.y0+Xt(null!==(h=null===(c=e.center)||void 0===c?void 0:c[1])&&void 0!==h?h:"50%",_.y1-_.y0)],w=Yt(e.field),C=t.map(w),E=m(qt(C),2),B=E[0],P=E[1],R=B===P?function(t){return(S+A)/2}:function(t){return S+(A-S)*(t-B)/(P-B)},L=T(e.radiusField)?w:Yt(e.radiusField),I=null!==(v=null===(d=null==e?void 0:e.radiusRange)||void 0===d?void 0:d[1])&&void 0!==v?v:5,D=function(t){return I};if(L){var j=m(L!==w?qt(t.map(L)):[B,P],2),z=j[0],H=j[1],N=null!==(p=null===(f=e.radiusRange)||void 0===f?void 0:f[0])&&void 0!==p?p:5,V=null!==(y=null===(g=e.radiusRange)||void 0===g?void 0:g[1])&&void 0!==y?y:5;z!==H&&(D=function(t){return N+(V-N)*(L(t)-z)/(H-z)})}var U=Math.min(b,k),W=Math.max(b,k),G=WX(U,W,t.length),Y=[],X=(W-U)/60;return t.forEach((function(t,e){for(var i,n,r=R(C[e]),a=D(t),o=G[e],l=0;l<60&&(i=M[0]+r*Math.cos(o),n=M[1]+r*Math.sin(o),GX({x:i,y:n,size:a},Y)||i-a<_.x0||i+a>_.x1||n-a<_.y0||n+a>_.y1);l++)l<59&&((o+=X)>W?o=U:o<U&&(o=W));Y.push(Object.assign(s(s(s({},HX,i),NX,n),VX,a),t))})),Y},WX=function(t,e,i){for(var n=0,r=Math.max(Math.ceil(2*(e-t)/Math.PI),2),a=(e-t)/r,o=0,s=1,l=0,u=0,c=[],h=t;l<i;)u<r&&(c.push(h+(u%2?Math.floor(u/2)+Math.floor(r/2):u/2)*a*s),u++),l++,u===r&&(u=0,0===n?n=a/2:n/=2,h=-1==(s*=-1)?e-n:t+n,(o+=1)>=2&&(a/=2,r*=2));return c},GX=function(t,e){return!(!e||!e.length)&&e.some((function(e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<Math.pow(t.size+e.size,2)}))},YX=function(t,e){if(!t||!O(t))return[];var i=e.keyword,n=e.categoryField,r=t[0].latestData[0];return s(s(s({},n,i),PO,null==r?void 0:r[PO]),LO,null==r?void 0:r[LO])},XX=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t._subMarks={ripple0:{type:"symbol",defaultAttributes:{fillOpacity:.75}},ripple1:{type:"symbol",defaultAttributes:{fillOpacity:.5}},ripple2:{type:"symbol",defaultAttributes:{fillOpacity:.25}}},t._positionChannels=["ripple","size"],t._positionEncoder=function(t,e,i){var n=t.ripple,r=void 0===n?i.attribute.ripple:n,a=t.size,o=void 0===a?i.attribute.size:a,s=Lt(r,0,1),l=.5*o;return{ripple0:{size:o+l*s,fillOpacity:.75-.25*s},ripple1:{size:o+l*(1+s),fillOpacity:.5-.25*s},ripple2:{size:o+l*(2+s),fillOpacity:.25-.25*s}}},t}return c(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{x:0,y:0,ripple:0})}}])}(wV);XX.type="ripple";var KX=function(t,e){return"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"}},qX=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"nodePoint"),this._addMarkLabelSpec(t,"centerPoint","centerLabel")}}])}(tj),ZX=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=_L.correlation,t.transformerConstructor=qX,t._viewBox=new ii,t}return c(r,e),a(r,[{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"getSeriesField",value:function(){return this._seriesField}},{key:"setSeriesField",value:function(t){C(t)&&(this._seriesField=t)}},{key:"getSizeField",value:function(){return this._sizeField}},{key:"setSizeField",value:function(t){C(t)&&(this._sizeField=t)}},{key:"getSizeRange",value:function(){return this._sizeRange}},{key:"setSizeRange",value:function(t){C(t)&&(this._sizeRange=t)}},{key:"setAttrFromSpec",value:function(){_(r,"setAttrFromSpec",this,3)([]),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)}},{key:"initData",value:function(){var t,e,i;if(_(r,"initData",this,3)([]),this._data){EI(this._dataSet,"correlation",UX);var n=new Yo;BI(n,"dataview",Uo),EI(n,"correlationCenter",YX);var a=new Xo(n,{name:"".concat(this.type,"_").concat(this.id,"_center")});a.parse([this.getViewData()],{type:"dataview"}),a.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 ID(this._option,a)}}},{key:"compileData",value:function(){var t;_(r,"compileData",this,3)([]),null===(t=this._centerSeriesData)||void 0===t||t.compile()}},{key:"_statisticViewData",value:function(){var t=this;_(r,"_statisticViewData",this,3)([]),this._data.getDataView().transform({type:"correlation",options:{view:function(){return{x0:t._viewBox.x1,x1:t._viewBox.x2,y0:t._viewBox.y1,y1:t._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}})}},{key:"initMark",value:function(){var e=this._createMark(r.mark.nodePoint,{groupKey:this._seriesField,isSeriesMark:!0,key:PO});e&&(e.setMarkConfig({zIndex:t.LayoutZIndex.Node}),this._nodePointMark=e);var i=this._createMark(r.mark.ripplePoint,{key:PO,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});i&&(this._ripplePointMark=i);var n=this._createMark(r.mark.centerPoint,{key:PO,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});n&&(n.setMarkConfig({zIndex:t.LayoutZIndex.Node}),this._centerPointMark=n)}},{key:"initMarkStyle",value:function(){this._initNodePointMarkStyle(),this._initRipplePointMarkStyle(),this._initCenterPointMarkStyle()}},{key:"_initNodePointMarkStyle",value:function(){var e,i,n,r,a=this._nodePointMark;if(a){var o=null!==(i=null===(e=this._spec.nodePoint)||void 0===e?void 0:e.style)&&void 0!==i?i:{};this.setMarkStyle(a,{x:function(t){return t[HX]},y:function(t){return t[NX]},size:function(t){return t[VX]},fill:null!==(n=o.fill)&&void 0!==n?n:this.getColorAttribute(),fillOpacity:null!==(r=o.fillOpacity)&&void 0!==r?r:1,lineWidth:0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}}},{key:"_initRipplePointMarkStyle",value:function(){var e,i,n,r,a,o=this,s=this._ripplePointMark;if(s){var l=null!==(i=null===(e=this._spec.ripplePoint)||void 0===e?void 0:e.style)&&void 0!==i?i:{};this.setMarkStyle(s,{x:function(){var t;return null!==(t=o._spec.centerX)&&void 0!==t?t:(o._viewBox.x1+o._viewBox.x2)/2},y:function(){var t;return null!==(t=o._spec.centerY)&&void 0!==t?t:(o._viewBox.y1+o._viewBox.y2)/2},size:function(){return Math.max(o._viewBox.x2-o._viewBox.x1,o._viewBox.y2-o._viewBox.y1)/2},fill:null!==(n=l.fill)&&void 0!==n?n:this.getColorAttribute(),opacity:null!==(r=l.fillOpacity)&&void 0!==r?r:.2,ripple:null!==(a=l.ripple)&&void 0!==a?a:0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}}},{key:"_initCenterPointMarkStyle",value:function(){var e,i,n,r,a,o,s=this,l=this._centerPointMark;l&&this.setMarkStyle(l,{x:function(){var t;return null!==(t=s._spec.centerX)&&void 0!==t?t:(s._viewBox.x1+s._viewBox.x2)/2},y:function(){var t;return null!==(t=s._spec.centerY)&&void 0!==t?t:(s._viewBox.y1+s._viewBox.y2)/2},size:function(){return.2*Math.max(s._viewBox.x2-s._viewBox.x1,s._viewBox.y2-s._viewBox.y1)/2},fill:null!==(n=null===(i=null===(e=this._spec.centerPoint)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill)&&void 0!==n?n:this.getColorAttribute(),fillOpacity:null!==(o=null===(a=null===(r=this._spec.centerPoint)||void 0===r?void 0:r.style)||void 0===a?void 0:a.fillOpacity)&&void 0!==o?o:1},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"initTooltip",value:function(){_(r,"initTooltip",this,3)([]),this._nodePointMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodePointMark)}},{key:"initLabelMarkStyle",value:function(e){var i=this;e&&this.setMarkStyle(e,{fill:this.getColorAttribute(),text:function(t){return t[i._categoryField]},z:this.dataToPositionZ.bind(this)},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"initAnimation",value:function(){var t,e,i=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this._nodePointMark.setAnimationConfig(YF(null===(e=rO.getAnimationInKey("correlation"))||void 0===e?void 0:e({},i),XF("nodePoint",this._spec,this._markAttributeContext)))}},{key:"getGroupFields",value:function(){return[]}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return""}},{key:"getActiveMarks",value:function(){return[this._nodePointMark,this._centerPointMark]}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this._rawData.reRunAllTransform(),this.getViewData().reRunAllTransform()}}])}(oU);ZX.type=_L.correlation,ZX.mark=zX,ZX.builtInTheme={correlation:{centerLabel:{visible:!0,position:"center",style:{fill:"#fff",text:""}},label:{visible:!0,position:"bottom",style:{fill:"#000"}}}},ZX.transformerConstructor=qX;var JX=function(){Bj(),TV(),pM(),rO.registerMark(XX.type,XX),rO.registerGraphicComponent("symbol",(function(t){return Gf(t)})),rO.registerSeries(ZX.type,ZX),rO.registerAnimation("correlation",(function(t,e){return Object.assign({appear:KX(0,e)},qD)}))},QX=Object.assign(Object.assign({},jF),{liquidGroup:{name:"liquidGroup",type:"group"},liquid:{name:"liquid",type:"liquid"},liquidBackground:{name:"liquidBackground",type:"group"},liquidOutline:{name:"liquidOutline",type:"group"}}),$X=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t._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}}},t._positionChannels=["wave","y","height"],t._positionEncoder=function(t,e,i){for(var n=t.wave,r=void 0===n?i.attribute.wave:n,a=t.y,o=void 0===a?i.attribute.y:a,s=t.height,l=void 0===s?i.attribute.height:s,u=[],c=[],h=[],d=0;d<21;d++){var v=50*d-500,f=o+(d%2==0?20:0),p=o+l;u.push({x:v+100*r,y:f,y1:p}),c.push({x:v+200*r-40,y:f,y1:p}),h.push({x:v+300*r-20,y:f,y1:p})}return{wave0:{x:0,y:0,points:u},wave1:{x:0,y:0,points:c},wave2:{x:0,y:0,points:h}}},t}return c(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{wave:0})}}])}(wV);$X.type="liquid";var tK=function(t,e){return"drop"===t?function(t,e,i){var n=4*i/3,r=Math.max(n,2*i),a=n/2,o=t,s=a+e-r/2,l=Math.asin(a/(.85*(r-a))),u=Math.sin(l)*a,c=Math.cos(l)*a,h=o-c,d=s+u,v=t,f=s+a/Math.sin(l);return"\n M ".concat(h," ").concat(d,"\n A ").concat(a," ").concat(a," 0 1 1 ").concat(h+2*c," ").concat(d,"\n Q ").concat(v," ").concat(f," ").concat(t," ").concat(e+r/2,"\n Q ").concat(v," ").concat(f," ").concat(h," ").concat(d,"\n Z \n ")}(0,0,e):t},eK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).markTooltipKeyCallback=function(e){return t.series.getValueField()},t.markTooltipValueCallback=function(e){return e[t.series.getValueField()]},t.shapeStrokeCallback=function(e){return t.series.getMarkInName("liquid").getAttribute("fill",e)},t}return c(e,t),a(e)}(wF),iK=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=_L.liquid,t.transformerConstructor=Pj,t._liquidBackgroundMark=null,t._liquidOutlineMark=null,t._getLiquidPosY=function(){var e=t._getLiquidBackPosAndSize(),i=e.height,n=e.startY;return(t._reverse?i*t._heightRatio:i*(1-t._heightRatio))+n},t._getLiquidHeight=function(){return t._getLiquidBackPosAndSize().height*t._heightRatio},t._getLiquidBackPosAndSize=function(){var e,i,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=t._marginSpec,a=r.top,o=void 0===a?0:a,s=r.bottom,l=void 0===s?0:s,u=r.left,c=void 0===u?0:u,h=r.right,d=void 0===h?0:h,v=n?{}:t._paddingSpec,f=v.top,p=void 0===f?0:f,g=v.bottom,y=void 0===g?0:g,m=v.left,_=void 0===m?0:m,b=v.right,k=void 0===b?0:b;"triangle"===t._maskShape&&(l/=Math.sqrt(3),o=o/Math.sqrt(3)*2,y/=Math.sqrt(3),p=p/Math.sqrt(3)*2);var x=null!==(i=null===(e=t._region)||void 0===e?void 0:e.getLayoutRect())&&void 0!==i?i:{width:0,height:0},S=x.width,A=x.height,M=S/2+(c+_-(d+k))/2,w=A/2+(o+p-(l+y))/2,T=S-(c+d+_+k),C=A-(o+l+p+y),E=Math.min(T,C);return"rect"!==t._maskShape&&(T=E,C=E),{x:M,y:w,size:E,width:T,height:C,startX:M-T/2,startY:w-C/2,endX:M+T/2,endY:w+C/2}},t._getLiquidBackPath=function(){var e,i,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("rect"===t._maskShape){var r=t._getLiquidBackPosAndSize(n),a=r.x,o=r.y,s=r.width,l=r.height;i=Qf({x:a-s/2,y:o-l/2,width:s,height:l,fill:!0})}else{var u=t._getLiquidBackPosAndSize(n),c=u.x,h=u.y,d=u.size;i=Gf({x:c,y:h,size:d,symbolType:tK(null!==(e=t._spec.maskShape)&&void 0!==e?e:"circle",d),fill:!0})}return[i]},t}return c(r,e),a(r,[{key:"setValueField",value:function(t){C(t)&&(this._valueField=t)}},{key:"getValueField",value:function(){return this._valueField}},{key:"setAttrFromSpec",value:function(){var t,e;_(r,"setAttrFromSpec",this,3)([]),this._marginSpec=XL(this._spec.outlineMargin),this._paddingSpec=XL(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"}},{key:"viewDataUpdate",value:function(t){var e=this;_(r,"viewDataUpdate",this,3)([t]),this._heightRatio=se.apply(void 0,b(this._data.getLatestData().map((function(t){return t[e._valueField]}))))}},{key:"initMark",value:function(){this._initLiquidOutlineMark(),this._initLiquidBackgroundMark(),this._initLiquidMark()}},{key:"initMarkStyle",value:function(){this._initLiquidOutlineMarkStyle(),this._initLiquidBackgroundMarkStyle(),this._initLiquidMarkStyle()}},{key:"_initLiquidOutlineMark",value:function(){return this._liquidOutlineMark=this._createMark(r.mark.liquidOutline,{isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidOutlineMark}},{key:"_initLiquidBackgroundMark",value:function(){return this._liquidBackgroundMark=this._createMark(r.mark.liquidBackground,{isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidBackgroundMark}},{key:"_initLiquidMark",value:function(){return this._liquidGroupMark=this._createMark(r.mark.liquidGroup,{parent:this._liquidBackgroundMark,isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidMark=this._createMark(r.mark.liquid,{parent:this._liquidGroupMark,isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidMark}},{key:"_buildMarkAttributeContext",value:function(){_(r,"_buildMarkAttributeContext",this,3)([]),this._markAttributeContext.getLiquidBackPosAndSize=this._getLiquidBackPosAndSize,this._markAttributeContext.getLiquidPosY=this._getLiquidPosY,this._markAttributeContext.getLiquidHeight=this._getLiquidHeight}},{key:"_initLiquidOutlineMarkStyle",value:function(){var e=this,i=this._liquidOutlineMark;i.created(),this.setMarkStyle(i,{stroke:this.getColorAttribute(),width:function(){return e._region.getLayoutRect().width},height:function(){return e._region.getLayoutRect().height},path:function(){return e._getLiquidBackPath(!0)}},"normal",t.AttributeLevel.Series),this._liquidOutlineMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex})}},{key:"_initLiquidBackgroundMarkStyle",value:function(){var e=this,i=this._liquidBackgroundMark;i.created(),this.setMarkStyle(i,{width:function(){return e._region.getLayoutRect().width},height:function(){return e._region.getLayoutRect().height},path:function(){return e._getLiquidBackPath()}},"normal",t.AttributeLevel.Series),this._liquidBackgroundMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex,clip:!0})}},{key:"_initLiquidMarkStyle",value:function(){var e=this,i=this._liquidMark,n=this._liquidGroupMark;n&&this.setMarkStyle(n,{x:function(){return e._region.getLayoutStartPoint().x+e._region.getLayoutRect().width/2},angle:this._reverse?-Math.PI:0,y:0,dy:this._getLiquidPosY}),i&&this.setMarkStyle(i,{y:0,dy:0,height:this._getLiquidHeight,fill:this.getColorAttribute(),wave:0},"normal",t.AttributeLevel.Series)}},{key:"initTooltip",value:function(){this._tooltipHelper=new eK(this),this._liquidMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._liquidMark)}},{key:"getInteractionTriggers",value:function(){return this._parseInteractionConfig(this._liquidMark?[this._liquidMark]:[])}},{key:"initAnimation",value:function(){var t,e,i,n,r=this,a={height:{from:0,to:function(){return r._getLiquidHeight()}},dy:{from:function(){var t=r._getLiquidBackPosAndSize(),e=t.height,i=t.startY;return(r._reverse?0:e)+i}}},o=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._liquidMark.setAnimationConfig(YF(null===(i=rO.getAnimationInKey("liquid"))||void 0===i?void 0:i(a,o),XF("liquid",this._spec,this._markAttributeContext))),this._liquidGroupMark.setAnimationConfig(YF(null===(n=rO.getAnimationInKey("liquidGroup"))||void 0===n?void 0:n(a,o),XF("liquidGroup",this._spec,this._markAttributeContext)))}},{key:"initEvent",value:function(){var e=this;_(r,"initEvent",this,3)([]),this._spec.indicatorSmartInvert&&this._option.getChart().getComponentsByKey("indicator")&&this.event.on(t.ChartEvent.renderFinished,(function(){e._option.getChart().getComponentsByKey("indicator").forEach((function(t){var i,n,r,a=null===(i=e._liquidMark.getGraphics()[0].getSubGraphic())||void 0===i?void 0:i[0],o=a.globalAABBBounds,s=o.y1,l=o.y2;s+=e._region.getLayoutStartPoint().y,l+=e._region.getLayoutStartPoint().y,null===(r=null===(n=null==t?void 0:t.getIndicatorComponent())||void 0===n?void 0:n.getChildren()[0])||void 0===r||r.getChildren().forEach((function(t){var e=t.globalAABBBounds,i=e.y1,n=e.y2;if(s<i&&l>n){var r=zM(t.attribute.fill,a.attribute.fill);t.setAttribute("fill",r)}}))}))}))}},{key:"dataToPosition",value:function(t){return null}},{key:"dataToPositionX",value:function(t){return null}},{key:"dataToPositionY",value:function(t){return null}},{key:"valueToPosition",value:function(t,e){return null}},{key:"getStatisticFields",value:function(){return[]}},{key:"getGroupFields",value:function(){return[]}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return""}},{key:"getActiveMarks",value:function(){return[this._liquidMark]}}])}(ej);iK.type=_L.liquid,iK.mark=QX,iK.builtInTheme={liquid:{outlinePadding:10,liquidBackground:{style:{lineWidth:0,fillOpacity:.2}},liquidOutline:{style:{lineWidth:2}}}},iK.transformerConstructor=Pj;var nK=function(t){return lt(t).join(",")},rK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).dimensionTooltipTitleCallback=function(e){return nK(null==e?void 0:e[t.series.getDimensionField()[0]])},t.markTooltipKeyCallback=function(e){return nK(null==e?void 0:e[t.series.getDimensionField()[0]])},t}return c(e,t),a(e)}(wF),aK=Object.assign(Object.assign({},jF),{circle:{name:"circle",type:"arc"},overlap:{name:"overlap",type:"path"},overlapLabel:{name:"overlapLabel",type:"text"}}),oK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"circle"),this._addMarkLabelSpec(t,"overlap","overlapLabel","initOverlapLabelMarkStyle")}}])}(tj),sK=function(t,e){var i=e.getViewBox();return i&&(null==t?void 0:t.length)?wG(Object.assign({setField:e.setField,valueField:e.valueField},i),t):[]},lK=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=_L.venn,t.transformerConstructor=oK,t._viewBox=new ii,t}return c(r,e),a(r,[{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"setAttrFromSpec",value:function(){var t,e,i;_(r,"setAttrFromSpec",this,3)([]),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:RO)}},{key:"initData",value:function(){var t,e=this;_(r,"initData",this,3)([]),EI(this._dataSet,"venn",sK),null===(t=this._data.getDataView())||void 0===t||t.transform({type:"venn",options:{getViewBox:function(){return e._viewBox.empty()?null:{x0:e._viewBox.x1,x1:e._viewBox.x2,y0:e._viewBox.y1,y1:e._viewBox.y2}},setField:this._categoryField,valueField:this._valueField}})}},{key:"compile",value:function(){_(r,"compile",this,3)([]),this._runVennTransform()}},{key:"_runVennTransform",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._data.getDataView().reRunAllTransform(),t&&this.getCompiler().renderNextTick()}},{key:"initMark",value:function(){var t=this._createMark(r.mark.circle,{isSeriesMark:!0});t&&(t.setTransform([{type:"vennMark",datumType:"circle"}]),this._circleMark=t);var e=this._createMark(r.mark.overlap,{isSeriesMark:!0});e&&(e.setTransform([{type:"vennMark",datumType:"overlap"}]),this._overlapMark=e)}},{key:"initMarkStyle",value:function(){this._initCircleMarkStyle(),this._initOverlapMarkStyle()}},{key:"_initCircleMarkStyle",value:function(){this._circleMark&&this.setMarkStyle(this._circleMark,{x:function(t){return t.x},y:function(t){return t.y},innerRadius:0,outerRadius:function(t){return t.radius},startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),stroke:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initOverlapMarkStyle",value:function(){this._overlapMark&&(this.setMarkStyle(this._overlapMark,{x:function(t){return t.x},y:function(t){return t.y},path:function(t){return t.path},arcs:function(t){return t.arcs},fill:this.getColorAttribute(),stroke:this.getColorAttribute(),zIndex:function(t){return 100*t.sets.length}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this.setMarkStyle(this._overlapMark,{zIndex:function(t){return 100*t.sets.length+1}},t.STATE_VALUE_ENUM.STATE_HOVER,t.AttributeLevel.Series))}},{key:"initLabelMarkStyle",value:function(e){e&&(this._labelMark=e,e.setRule("venn"),this.setMarkStyle(e,{x:function(t){return t.labelX},y:function(t){return t.labelY},text:function(t){return nK(t.sets)},maxLineWidth:function(t){var e=t.x,i=t.radius,n=t.labelX,r=e-i,a=e+i;return Math.min(n-r,a-n)}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series))}},{key:"initOverlapLabelMarkStyle",value:function(e){e&&(this._labelMark=e,e.setRule("venn"),this.setMarkStyle(e,{x:function(t){return t.labelX},y:function(t){return t.labelY},text:function(t){return nK(t.sets)}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series))}},{key:"initTooltip",value:function(){this._tooltipHelper=new rK(this),this._circleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circleMark),this._overlapMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._overlapMark)}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runVennTransform()}},{key:"getDefaultShapeType",value:function(){return"circle"}},{key:"getActiveMarks",value:function(){return[this._circleMark,this._overlapMark]}},{key:"getStatisticFields",value:function(){var t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}},{key:"getGroupFields",value:function(){return null}},{key:"dataToPosition",value:function(t,e){return{x:t.x,y:t.y}}},{key:"dataToPositionX",value:function(t){return t.x}},{key:"dataToPositionY",value:function(t){return t.y}},{key:"valueToPosition",value:function(t,e){throw new Error("Method not implemented.")}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return null}},{key:"_getSeriesInfo",value:function(t,e){var i=this,n=this.getDefaultShapeType();return e.map((function(e){return{key:nK(e),originalKey:e,style:i.getSeriesStyle(s({},t,e)),shapeType:n}}))}},{key:"getSeriesFieldValue",value:function(t,e){var i=_(r,"getSeriesFieldValue",this,3)([t,e]);return nK(i)}},{key:"legendSelectedFilter",value:function(t,e){if(t.type===d.discreteLegend){var i=t.getLegendDefaultData(!0);if(0===e.length&&i.length)return[];if(e.length===i.length)return e;var n={};e.forEach((function(t){n[t]=!0}));var r=i.filter((function(t){return!n[nK(t)]})),a=i.filter((function(t){return!r.includes(t)&&r.some((function(e){return lt(e).every((function(e){return t.includes(e)}))}))}));e=e.slice(),a.forEach((function(t){e.splice(e.indexOf(nK(t)),1)}))}return e}},{key:"initAnimation",value:function(){var t=this;this.getMarksInType("arc").forEach((function(e){var i;e.setAnimationConfig(YF(null===(i=rO.getAnimationInKey("vennCircle"))||void 0===i?void 0:i(),XF(e.name,t._spec,t._markAttributeContext)))})),this.getMarksInType("path").forEach((function(e){var i;e.setAnimationConfig(YF(null===(i=rO.getAnimationInKey("vennOverlap"))||void 0===i?void 0:i(),XF(e.name,t._spec,t._markAttributeContext)))}))}}])}(ej);lK.type=_L.venn,lK.mark=aK,lK.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"}}}}},lK.transformerConstructor=oK;var uK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=_L.mosaic,t.transformerConstructor=vN,t}return c(e,t),a(e,[{key:"bandWidthField",get:function(){return this._bandWidthField}},{key:"getStack",value:function(){return!0}},{key:"getPercent",value:function(){return this._spec.percent}},{key:"getGroupFields",value:function(){return"vertical"===this.direction?this._specXField:this._specYField}},{key:"setAttrFromSpec",value:function(){_(e,"setAttrFromSpec",this,3)([]);var t=this.getPercent();"horizontal"===this.direction?(t&&(this.setFieldX(XO),this.setFieldX2(YO)),this.setFieldY(qO),this.setFieldY2(KO)):(t&&(this.setFieldY(XO),this.setFieldY2(YO)),this.setFieldX(qO),this.setFieldX2(KO)),this._spec.bandWidthField&&(this._bandWidthField=this._spec.bandWidthField)}},{key:"parseLabelStyle",value:function(t,e){if((null==e?void 0:e.filterByGroup)&&T(t.dataFilter)){var i=this.getGroupFields(),n=e.filterByGroup,r=n.field,a=n.type,o=void 0===a?"max":a,s=n.filter;delete t.filterField;var l=i.indexOf(r);if(l<0)return;var u=l%2?"min"===o?"horizontal"===this.direction?this._fieldY2:this._fieldX2:"horizontal"===this.direction?this._fieldY:this._fieldX:"min"===o?"horizontal"===this.direction?this._fieldX2:this._fieldY2:"horizontal"===this.direction?this._fieldX:this._fieldY,c="min"===o?function(t,e){var i,n;return(null===(i=t.data)||void 0===i?void 0:i[u])<(null===(n=e.data)||void 0===n?void 0:n[u])}:function(t,e){var i,n;return(null===(i=t.data)||void 0===i?void 0:i[u])>(null===(n=e.data)||void 0===n?void 0:n[u])};t.dataFilter=function(t){var e={};return t.forEach((function(t){var i=t.data,n=null==i?void 0:i[r];T(n)||s&&!s(t)||e[n]&&!c(t,e[n])||(e[n]=t)})),t.filter((function(t){var i,n=null===(i=t.data)||void 0===i?void 0:i[r];return e[n]&&e[n]===t}))}}return t}}])}(fN);uK.type=_L.mosaic,uK.builtInTheme={mosaic:{label:{visible:!1,position:"center",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},bar:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}}}},uK.transformerConstructor=vN;var cK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_isValidSeries",value:function(t){return t===_L.map}},{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["type","nameField","valueField","map","nameProperty","centroidProperty","nameMap","area","defaultFillColor","showDefaultName"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),t.region.forEach((function(t){t.coordinate="geo"})),_(e,"transformSeriesSpec",this,3)([t])}}])}(lH),hK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=cK,t.type="map",t.seriesType=_L.map,t}return c(e,t),a(e)}(oH);hK.type="map",hK.seriesType=_L.map,hK.transformerConstructor=cK;var dK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_isValidSeries",value:function(t){return!this.seriesType||t===this.seriesType}},{key:"getIndicatorSpec",value:function(t){var e,i,n,r=lt(t.indicator),a=null!==(e=t.innerRadius)&&void 0!==e?e:null===(n=null===(i=t.series)||void 0===i?void 0:i[0])||void 0===n?void 0:n.innerRadius;return C(a)&&r.forEach((function(t){T(t.limitRatio)&&(t.limitRatio=a)})),r}},{key:"_getDefaultSeriesSpec",value:function(t,i){return _(e,"_getDefaultSeriesSpec",this,3)([t,["radius","outerRadius","innerRadius","startAngle","endAngle","sortDataByAxis"],i])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),O(t.dataZoom)&&t.dataZoom.length>0&&t.dataZoom.forEach((function(t){"axis"===t.filterMode&&(t.filterMode="filter")})),this.transformSeriesSpec(t),C(t.indicator)&&(t.indicator=this.getIndicatorSpec(t))}}])}(lH),vK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"needAxes",value:function(){return!1}},{key:"_getDefaultSeriesSpec",value:function(t){var i=_(e,"_getDefaultSeriesSpec",this,3)([t,["startAngle","endAngle","centerX","centerY"]]);return i.categoryField=t.categoryField||t.radiusField,i.valueField=t.valueField||t.angleField,i}},{key:"_transformProgressAxisSpec",value:function(t,e,i,n,r){var a,o;t.axes||(t.axes=[]);var s=(null!==(a=t.axes)&&void 0!==a?a:[]).find((function(t){return"radius"===t.orient})),l=(null!==(o=t.axes)&&void 0!==o?o:[]).find((function(t){return"angle"===t.orient}));l||(l=e,t.axes.push(l)),s||(s=i,t.axes.push(s)),T(l.type)&&(l.type="linear"),T(s.type)&&(s.type="band");var u=Uj(l,{min:0,max:1});T(l.min)&&(l.min=u.min),T(l.max)&&(l.max=u.max),n&&Object.assign(l,nO({},n,l)),r&&Object.assign(s,nO({},r,s))}}])}(dK),fK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"needAxes",value:function(){return!0}},{key:"_getDefaultSeriesSpec",value:function(t){var i=_(e,"_getDefaultSeriesSpec",this,3)([t]);return i.categoryField=t.categoryField||t.angleField,i.valueField=t.valueField||t.radiusField,i}},{key:"transformSpec",value:function(t){var i;if(_(e,"transformSpec",this,3)([t]),this.needAxes()){t.axes||(t.axes=[]);var n={radius:!1,angle:!1};(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((function(t){var e=t.orient;"radius"===e&&(n.radius=!0),"angle"===e&&(n.angle=!0)})),n.angle||t.axes.push({orient:"angle"}),n.radius||t.axes.push({orient:"radius"})}}}])}(dK),pK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"needAxes",value:function(){return!1}},{key:"_getDefaultSeriesSpec",value:function(t){var i,n=_(e,"_getDefaultSeriesSpec",this,3)([t,["center","centerOffset","cornerRadius","padAngle","minAngle","emptyPlaceholder","showAllZero","supportNegative","useSequentialAnimation","layoutRadius"]]);return n.categoryField=t.categoryField||t.seriesField,n.valueField=t.valueField||t.angleField,n.emptyCircle=null===(i=t.emptyPlaceholder)||void 0===i?void 0:i.emptyCircle,n}}])}(dK),gK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=pK,t}return c(e,t),a(e)}(oH);gK.transformerConstructor=pK;var yK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=pK,t.type="pie",t.seriesType=_L.pie,t}return c(e,t),a(e)}(gK);yK.type="pie",yK.seriesType=_L.pie,yK.transformerConstructor=pK;var mK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r,a=_(e,"_getDefaultSeriesSpec",this,3)([t]);return a.radius=null!==(i=t.radius)&&void 0!==i?i:az,a.outerRadius=null!==(n=t.outerRadius)&&void 0!==n?n:az,a.innerRadius=null!==(r=t.innerRadius)&&void 0!==r?r:0,a.stack=t.stack,a.percent=t.percent,a}},{key:"transformSpec",value:function(t){var i;_(e,"transformSpec",this,3)([t]),(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((function(t){["domainLine","grid","label","tick"].forEach((function(e){t[e]||(t[e]={visible:!1})})),"angle"===t.orient&&T(t.bandPosition)&&(t.bandPosition=.5)})),t.crosshair=lt(t.crosshair||{}).map((function(t){return nO({categoryField:{visible:!0,line:{visible:!0,type:"rect"}}},t)}))}}])}(fK),_K=function(t,e){if(!t)return null;var i=_j(t,(function(t){return"angle"===t.getOrient()}),e),n=_j(t,(function(t){return"radius"===t.getOrient()}),e);if(!(i&&i.length||n&&n.length))return null;var r=[],a=function(t){return t.getDimensionField()[0]},o=e.x,s=e.y;return i&&i.forEach((function(t){var e,i=t.getScale();if(i&&lE(i.type)){var l=i.domain(),u=i.range(),c=t.getCenter(),h={x:o-t.getLayoutStartPoint().x-c.x,y:s-t.getLayoutStartPoint().y-c.y},d=vL({x:1,y:0},h);d=function(t,e){var i=2*Math.PI,n=ht(e),r=ct(e);return t<n?t+=Math.ceil((n-t)/i)*i:t>r&&(t-=Math.ceil((t-r)/i)*i),t}(d,u);var v=fL(h),f=null===(e=n[0])||void 0===e?void 0:e.getScale(),p=null==f?void 0:f.range();if((d-(null==u?void 0:u[0]))*(d-(null==u?void 0:u[1]))>0||(v-(null==p?void 0:p[0]))*(v-(null==p?void 0:p[1]))>0)return;var g=t.invert(d);if(T(g))return;var y=l.findIndex((function(t){return(null==t?void 0:t.toString())===g.toString()}));y<0&&(y=void 0);var m=yj(g,t,"polar",a);r.push({index:y,value:g,position:i.scale(g),axis:t,data:m})}})),n&&n.forEach((function(t){var e,n=t.getScale(),l=null==n?void 0:n.range();if(n&&lE(n.type)){var u=t.getCenter(),c={x:o-t.getLayoutStartPoint().x-u.x,y:s-t.getLayoutStartPoint().y-u.y},h=vL({x:1,y:0},c);h<-Math.PI/2&&(h=2*Math.PI+h);var d=fL(c),v=null===(e=i[0])||void 0===e?void 0:e.getScale(),f=null==v?void 0:v.range();if((h-(null==f?void 0:f[0]))*(h-(null==f?void 0:f[1]))>0||(d-(null==l?void 0:l[0]))*(d-(null==l?void 0:l[1]))>0)return;var p=n.invert(d);if(T(p))return;var g=n.domain().findIndex((function(t){return(null==t?void 0:t.toString())===p.toString()}));g<0&&(g=void 0);var y=yj(p,t,"polar",a);r.push({index:g,value:p,position:n.scale(p),axis:t,data:y})}})),r.length?r:null},bK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=mK,t.type="rose",t.seriesType=_L.rose,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=_K}}])}(oH);bK.type="rose",bK.seriesType=_L.rose,bK.transformerConstructor=mK,st(bK,vH);var kK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n=_(e,"_getDefaultSeriesSpec",this,3)([t]);return n.line=t.line,n.point=t.point,n.stack=t.stack,n.percent=t.percent,n.area=nO({visible:!1},t.area),n.seriesMark=null!==(i=t.seriesMark)&&void 0!==i?i:"area",n.activePoint=t.activePoint,n.pointDis=t.pointDis,n.pointDisMul=t.pointDisMul,n.markOverlap=t.markOverlap,n}},{key:"transformSpec",value:function(t){var i;_(e,"transformSpec",this,3)([t]),(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((function(t){"radius"===t.orient&&(["domainLine","label","tick"].forEach((function(e){t[e]||(t[e]={visible:!1})})),t.grid||(t.grid={visible:!0}))})),t.crosshair=lt(t.crosshair||{}).map((function(t){return nO({categoryField:{visible:!0,line:{visible:!0,type:"line"}}},t)}))}}])}(fK),xK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=kK,t.type="radar",t.seriesType=_L.radar,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=_K}}])}(oH);xK.type="radar",xK.seriesType=_L.radar,xK.transformerConstructor=kK,st(xK,vH);var SK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i=_(e,"_getDefaultSeriesSpec",this,3)([t]);return delete i.data,i}},{key:"_transformAxisSpec",value:function(t){var e=this;t.axes&&t.autoBandSize&&t.series.forEach((function(i,n){var r;if("bar"===i.type){var a=e._findBandAxisBySeries(i,n,t.axes);if(a&&!a.bandSize&&!a.maxBandSize&&!a.minBandSize){var o=E(i.autoBandSize)&&null!==(r=i.autoBandSize.extend)&&void 0!==r?r:0,s=i.barMaxWidth,l=i.barMinWidth,u=i.barWidth,c=i.barGapInGroup;e._applyAxisBandSize(a,o,{barMaxWidth:s,barMinWidth:l,barWidth:u,barGapInGroup:c})}}}))}},{key:"transformSpec",value:function(t){var i=this;if(_(e,"transformSpec",this,3)([t]),t.series&&t.series.length){var n=this._getDefaultSeriesSpec(t);t.series.forEach((function(t){i._isValidSeries(t.type)&&Object.keys(n).forEach((function(e){e in t||(t[e]=n[e])}))}))}t.axes&&t.axes.length&&t.axes.forEach((function(e){X(e,"trimPadding")&&nO(e,cD(i.type,t))})),this._transformAxisSpec(t)}}])}(lH),AK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=SK,t.type="common",t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=function(t,e,i){var n,r;return[].concat(b(null!==(n=AH(t,e,i))&&void 0!==n?n:[]),b(null!==(r=_K(t,e))&&void 0!==r?r:[]))},this._modelOption.getDimensionInfoByValue=wH,this._modelOption.getRectByDimensionData=RH}}])}(oH);AK.type="common",AK.transformerConstructor=SK,st(AK,vH);var MK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),t.axes.forEach((function(t){return t.type="linear"}))}},{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["x2Field","y2Field","barMinHeight","barBackground","barGap"]])}}])}(uH),wK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=MK,t}return c(e,t),a(e)}(oH);wK.transformerConstructor=MK,st(wK,vH);var TK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),sD(t)}}])}(MK),CK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=TK,t.type="histogram",t.seriesType=_L.bar,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=AH,this._modelOption.getDimensionInfoByValue=wH,this._modelOption.getRectByDimensionData=RH}}])}(wK);CK.type="histogram",CK.seriesType=_L.bar,CK.transformerConstructor=TK;var EK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r=_(e,"_getDefaultSeriesSpec",this,3)([t]);return r.progress=t.progress,r.track=t.track,r.tickMask=t.tickMask,r.cornerRadius=null!==(i=t.cornerRadius)&&void 0!==i?i:0,r.roundCap=null!==(n=t.roundCap)&&void 0!==n&&n,r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this._transformProgressAxisSpec(t,{orient:"angle",visible:!1},{orient:"radius",visible:!1},{forceInitTick:t.tickMask&&!1!==t.tickMask.visible})}}])}(vK),BK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=EK,t.type="circularProgress",t.seriesType=_L.circularProgress,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=_K}}])}(oH);BK.type="circularProgress",BK.seriesType=_L.circularProgress,BK.transformerConstructor=EK,st(BK,vH);var PK=function(e){function r(){return n(this,r),i(this,r,arguments)}return c(r,e),a(r,[{key:"_getDefaultSeriesSpec",value:function(t){var e=_(r,"_getDefaultSeriesSpec",this,3)([t]);return e.radiusField=t.radiusField,e.pin=t.pin,e.pinBackground=t.pinBackground,e.pointer=t.pointer,e}},{key:"_getDefaultCircularProgressSeriesSpec",value:function(t){var e=_(r,"_getDefaultSeriesSpec",this,3)([t]);return e.type=_L.circularProgress,e}},{key:"transformSpec",value:function(e){var i,n,a,o,s;_(r,"transformSpec",this,3)([e]);var l=null===(i=e.series)||void 0===i?void 0:i.find((function(t){return t.type===_L.gauge||t.type===_L.circularProgress}));T(l)&&("circularProgress"===(l=null!==(n=e.gauge)&&void 0!==n?n:this._getDefaultCircularProgressSeriesSpec(e)).type&&(T(l.radiusField)&&T(l.categoryField)&&(l.radiusField=null!==(o=null!==(a=e.radiusField)&&void 0!==a?a:e.categoryField)&&void 0!==o?o:e.seriesField),T(l.valueField)&&T(l.angleField)&&(l.valueField=null!==(s=e.valueField)&&void 0!==s?s:e.angleField)),1===e.series.length?e.series.push(l):e.series.forEach((function(t){t.type===l.type&&Object.keys(l).forEach((function(e){e in t||(t[e]=l[e])}))}))),l.type===_L.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)}},{key:"_transformGaugeAxisSpec",value:function(e){var i;e.axes||(e.axes=[]);var n={radius:null,angle:null};(null!==(i=e.axes)&&void 0!==i?i:[]).forEach((function(t){var e=t.orient;"radius"===e&&(n.radius=t),"angle"===e&&(n.angle=t)})),n.angle||(n.angle={orient:"angle",visible:!0},e.axes.push(n.angle)),n.radius||(n.radius={orient:"radius",visible:!1},e.axes.push(n.radius)),T(n.angle.type)&&(n.angle.type="linear"),T(n.radius.type)&&(n.radius.type="linear"),T(n.angle.zIndex)&&(n.angle.zIndex=t.LayoutZIndex.Region+50)}}])}(vK),RK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=PK,t.type="gauge",t.seriesType=_L.gaugePointer,t}return c(e,t),a(e)}(oH);RK.type="gauge",RK.seriesType=_L.gaugePointer,RK.transformerConstructor=PK;var LK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}},{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["nameField","valueField","fontFamilyField","fontWeightField","fontStyleField","colorHexField","colorMode","colorList","rotateAngles","fontWeightRange","fontSizeRange","maskShape","keepAspect","random","wordCloudConfig","wordCloudShapeConfig","word","fillingWord","wordMask"]])}}])}(lH),OK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=LK,t.type="wordCloud",t.seriesType=_L.wordCloud,t}return c(e,t),a(e)}(oH);OK.transformerConstructor=LK;var IK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=LK,t.type="wordCloud",t.seriesType=_L.wordCloud,t}return c(e,t),a(e)}(OK);IK.type="wordCloud",IK.seriesType=_L.wordCloud,IK.transformerConstructor=LK;var DK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"needAxes",value:function(){return!1}},{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","funnelAlign","funnelOrient","heightRatio","shape","funnel","transform","outerLabel","transformLabel","isTransform","maxSize","minSize","gap","isCone","range","transformRatioText"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),_(e,"transformSeriesSpec",this,3)([t])}}])}(lH),FK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=DK,t.type="funnel",t.seriesType=_L.funnel,t}return c(e,t),a(e)}(oH);FK.type="funnel",FK.seriesType=_L.funnel,FK.transformerConstructor=DK;var jK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"needAxes",value:function(){return!1}},{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r=_(e,"_getDefaultSeriesSpec",this,3)([t,["bandWidth","progress","track","clamp"]]);return r.direction=null!==(i=t.direction)&&void 0!==i?i:"horizontal",r.cornerRadius=null!==(n=t.cornerRadius)&&void 0!==n?n:0,r}},{key:"transformSpec",value:function(t){var i,n;if(_(e,"transformSpec",this,3)([t]),t.axes||(t.axes=[]),"vertical"===t.direction){var r=null,a=null;(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((function(t){var e=t.orient;"left"===e&&(r=t),"bottom"===e&&(a=t)})),r||(r={orient:"left",visible:!1},t.axes.push(r)),a||(a={orient:"bottom",visible:!1},t.axes.push(a)),T(a.type)&&(a.type="band"),T(r.type)&&(r.type="linear");var o=Uj(r,{min:0,max:1});T(r.min)&&(r.min=o.min),T(r.max)&&(r.max=o.max)}else{var s=null,l=null;(null!==(n=t.axes)&&void 0!==n?n:[]).forEach((function(t){var e=t.orient;"left"===e&&(s=t),"bottom"===e&&(l=t)})),s||(s={type:"band",orient:"left",visible:!1},t.axes.push(s)),l||(l={orient:"bottom",visible:!1},t.axes.push(l)),T(l.type)&&(l.type="linear"),T(s.type)&&(s.type="band");var u=Uj(l,{min:0,max:1});T(l.min)&&(l.min=u.min),T(l.max)&&(l.max=u.max)}}}])}(uH),zK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=jK,t.type="linearProgress",t.seriesType=_L.linearProgress,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=AH,this._modelOption.getDimensionInfoByValue=wH,this._modelOption.getRectByDimensionData=RH}}])}(oH);zK.type="linearProgress",zK.seriesType=_L.linearProgress,zK.transformerConstructor=jK,st(zK,vH);var HK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r=_(e,"_getDefaultSeriesSpec",this,3)([t,["barWidth","barMaxWidth","barMinWidth","barGapInGroup","barBackground","barMinHeight","stackCornerRadius","bar"]]);return"horizontal"===t.direction?r.xField=null!==(i=t.xField)&&void 0!==i?i:[t.minField,t.maxField]:r.yField=null!==(n=t.yField)&&void 0!==n?n:[t.minField,t.maxField],r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),sD(t)}}])}(uH),NK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=HK,t.type="rangeColumn",t.seriesType=_L.rangeColumn,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=AH,this._modelOption.getDimensionInfoByValue=wH,this._modelOption.getRectByDimensionData=RH}}])}(oH);NK.type="rangeColumn",NK.seriesType=_L.rangeColumn,NK.transformerConstructor=HK;var VK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i=C(t.startAngle)?t.startAngle:-90,n=C(t.endAngle)?t.endAngle:i+Se(2*Math.PI),r=_(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","centerX","centerY","offsetX","offsetY","innerRadius","outerRadius","gap","labelLayout","label","labelAutoVisible","drill","drillField"]]);return r.startAngle=i,r.endAngle=n,r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(lH),UK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=VK,t.type="sunburst",t.seriesType=_L.sunburst,t}return c(e,t),a(e)}(oH);UK.type="sunburst",UK.seriesType=_L.sunburst,UK.transformerConstructor=VK;var WK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","layoutPadding","circlePacking","drill","drillField"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(lH),GK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=WK,t.type="circlePacking",t.seriesType=_L.circlePacking,t}return c(e,t),a(e)}(oH);GK.type="circlePacking",GK.seriesType=_L.circlePacking,GK.transformerConstructor=WK;var YK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","aspectRatio","splitType","maxDepth","gapWidth","nodePadding","minVisibleArea","minChildrenVisibleArea","minChildrenVisibleSize","roam","drill","drillField","leaf","nonLeaf","nonLeafLabel"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(lH),XK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=YK,t.type="treemap",t.seriesType=_L.treemap,t}return c(e,t),a(e)}(oH);XK.type="treemap",XK.seriesType=_L.treemap,XK.transformerConstructor=YK;var KK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),t.legends&&lt(t.legends).forEach((function(t){t.select=!1,t.hover=!1,t.filter=!1})),sD(t)}},{key:"_getDefaultSeriesSpec",value:function(t){var i=_(e,"_getDefaultSeriesSpec",this,3)([t]);return i.bar=t.bar,i.stackLabel=t.stackLabel,i.leaderLine=t.leaderLine,i.total=t.total,i.calculationMode=t.calculationMode,i}}])}(gN),qK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=KK,t.type="waterfall",t.seriesType=_L.waterfall,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=AH,this._modelOption.getDimensionInfoByValue=wH,this._modelOption.getRectByDimensionData=RH}}])}(yN);qK.type="waterfall",qK.seriesType=_L.waterfall,qK.transformerConstructor=KK;var ZK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n=[t.maxField,t.medianField,t.q1Field,t.q3Field,t.minField,t.outliersField],r=_(e,"_getDefaultSeriesSpec",this,3)([t,["boxPlot","outlier","minField","maxField","q1Field","medianField","q3Field","outliersField","outliersStyle","boxWidth","boxMaxWidth","boxMinWidth","boxGapInGroup"]]);return r.direction=null!==(i=t.direction)&&void 0!==i?i:"vertical",r["horizontal"===r.direction?"xField":"yField"]=n,r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),sD(t)}}])}(uH),JK=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=ZK,t.type="boxPlot",t.seriesType=_L.boxPlot,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=AH,this._modelOption.getDimensionInfoByValue=wH,this._modelOption.getRectByDimensionData=RH}}])}(oH);JK.type="boxPlot",JK.seriesType=_L.boxPlot,JK.transformerConstructor=ZK;var QK=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([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"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(lH),$K=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=QK,t.type="sankey",t.seriesType=_L.sankey,t}return c(e,t),a(e,[{key:"_setStateInDatum",value:function(t,e,i,n){var r=O(e)?e[0]:e;if(r){var a=null;this.filterGraphicsByDatum(r,{filter:function(t,e){return"text"!==e.type&&e.getProduct()&&(!i||i(t,e))},region:n,getDatum:function(t){var e,i=null===(e=mI(t))||void 0===e?void 0:e.datum;return O(i)&&(i=i[0]),i},callback:function(t,e,i,n){var r,a,o=e.getProductId();o&&(o.includes("node")||o.includes("link"))&&(null===(a=(r=i)._handleEmphasisElement)||void 0===a||a.call(r,{item:t,mark:e}))},regionCallback:function(t,e){r&&t.length&&(a=t[0])}}),a&&this._interaction.updateStateOfGraphics(t,[a])}else this._interaction.clearByState(t)}}])}(oH);$K.type="sankey",$K.seriesType=_L.sankey,$K.transformerConstructor=QK;var tq=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r=_(e,"_getDefaultSeriesSpec",this,3)([t]);return r.area=t.area,r.point=t.point,r.line=t.line,"horizontal"===t.direction?r.xField=null!==(i=t.xField)&&void 0!==i?i:[t.minField,t.maxField]:r.yField=null!==(n=t.yField)&&void 0!==n?n:[t.minField,t.maxField],r.stack=!1,r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),sD(t)}}])}(uH),eq=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=tq,t.type="rangeArea",t.seriesType=_L.rangeArea,t}return c(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=AH,this._modelOption.getDimensionInfoByValue=wH,this._modelOption.getRectByDimensionData=RH}}])}(oH);eq.type="rangeArea",eq.seriesType=_L.rangeArea,eq.transformerConstructor=tq;var iq=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["valueField","cell"]])}}])}(uH),nq=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=iq,t.type="heatmap",t.seriesType=_L.heatmap,t}return c(e,t),a(e)}(oH);nq.type="heatmap",nq.seriesType=_L.heatmap,nq.transformerConstructor=iq;var rq=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","sizeField","sizeRange","centerX","centerY","innerRadius","outerRadius","startAngle","endAngle","ripplePoint","centerPoint","centerLabel","nodePoint"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(lH),aq=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=rq,t.type="correlation",t.seriesType=_L.correlation,t}return c(e,t),a(e)}(oH);function oq(t){var e,i,n=Object.assign({},t);return Y(t.style)||(n.textStyle=pI(t.style)),Y(t.textStyle)||nO(n.textStyle,pI(t.textStyle)),(null===(e=t.shape)||void 0===e?void 0:e.style)&&pI(n.shape.style),(null===(i=t.background)||void 0===i?void 0:i.style)&&pI(n.background.style),n}aq.type="correlation",aq.seriesType=_L.correlation,aq.transformerConstructor=rq;var sq=function(t,e){var i=[],n={},r=e.series,a=e.seriesField;return r().forEach((function(t){var e=a(t);(e===t.getSeriesField()?t.getSeriesInfoList():t.getSeriesInfoInField(e)).forEach((function(t){n[t.key]||(n[t.key]=!0,i.push(t))}))})),i},lq=function(t,e){var i,n,r,a=e.series,o=e.selected,s=e.field,l=e.data,u=e.customFilter,c=o(),h=l();if(0===c.length&&h.length)return[];if(c.length===h.length)return t;var d={};c.forEach((function(t){d[t]=!0}));var v=null!==(i=s())&&void 0!==i?i:LO;return u?u(t,c,v):(O(t)&&(null===(n=t[0])||void 0===n?void 0:n.nodes)?(t[0].nodes=t[0].nodes.filter((function(t){return!0===d[t.key]})),(null===(r=t[0])||void 0===r?void 0:r.links)&&(t[0].links=t[0].links.filter((function(t){return!0===d[t.source]&&!0===d[t.target]})))):C(v)&&(t=t.filter((function(t){return!0===d[a.getSeriesFieldValue(t,v)]}))),t)},uq=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).layoutType="normal",e.layoutZIndex=t.LayoutZIndex.Legend,e.layoutLevel=t.LayoutLevel.Legend,e.specKey="legends",e._orient="left",e._visible=!0,e._position="middle",e._preSelectedData=[],e._selectedData=[],e.effect={onSelectedDataChange:function(){gL(e._regions,(function(t){var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:e._seriesUserId,specIndex:e._seriesIndex}),gL(e._regions,(function(t){t.reFilterViewData()}),{userId:e._seriesUserId,specIndex:e._seriesIndex})}},e}return c(r,e),a(r,[{key:"orient",get:function(){return this._orient}},{key:"visible",get:function(){return this._visible}},{key:"position",get:function(){return this._position}},{key:"getLegendData",value:function(){return this._legendData.getLatestData()}},{key:"getSelectedData",value:function(){return this._selectedData}},{key:"setAttrFromSpec",value:function(){var t;_(r,"setAttrFromSpec",this,3)([]),this._orient=NL(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;var e=this._spec,i=e.regionId,n=e.regionIndex,a=e.seriesId,o=e.seriesIndex;C(a)&&(this._seriesUserId=lt(a)),C(i)&&(this._regionUserId=lt(i)),C(o)&&(this._seriesIndex=lt(o)),C(n)&&(this._regionUserIndex=lt(n)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionUserIndex)}},{key:"created",value:function(){_(r,"created",this,3)([]),this.initData()}},{key:"_compareSpec",value:function(t,e){var i=_(r,"_compareSpec",this,3)([t,e]);return i.reRender=!0,(null==t?void 0:t.orient)!==(null==e?void 0:e.orient)?(i.reMake=!0,i):(at(e,t)||(i.reCompile=!0),i)}},{key:"_bindLegendDataChange",value:function(){this._preSelectedData=this._selectedData.slice(),this._initSelectedData(),this._forceLayout()}},{key:"initData",value:function(){var e=this,i=this._initLegendData();i.target.addListener("change",this._bindLegendDataChange.bind(this)),this._legendData=new ID(this._option,i),this._initSelectedData(),gL(this._regions,(function(i){i.event.on(t.ChartEvent.rawDataUpdate,{filter:function(t){var e=t.model;return(null==e?void 0:e.id)===i.id}},(function(){e._legendData.getDataView().reRunAllTransform({skipEqual:!0})}))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},{key:"setSelectedData",value:function(e){var i,n,r,a=this,o=this._selectedData;T(e)||JSON.stringify(o)===JSON.stringify(e)||(gL(this._regions,(function(t){t.legendSelectedFilter&&(e=t.legendSelectedFilter(a,e))}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._selectedData=b(e),null===(n=(i=this.effect).onSelectedDataChange)||void 0===n||n.call(i),this.event.emit(t.ChartEvent.legendSelectedDataChange,{model:this}),null===(r=this._legendComponent)||void 0===r||r.setSelected(this._selectedData))}},{key:"afterSetLayoutStartPoint",value:function(t){if(_(r,"afterSetLayoutStartPoint",this,3)([t]),this._legendComponent){var e=t.x,i=t.y;z(e*i)&&this._legendComponent.setAttributes({x:e,y:i})}}},{key:"getBoundsInRect",value:function(t,e){var i=this;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};var n={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},r=this._getLegendAttributes(t);if(r.disableTriggerEvent=this._option.disableTriggerEvent,this._legendComponent)at(r,this._cacheAttrs)||this._legendComponent.setAttributes(nO({},r,{defaultSelected:this._selectedData}));else{var a=new(this._getLegendConstructor())(nO({},r,{defaultSelected:this._selectedData}));a.name="legend",this._legendComponent=a,this.getContainer().add(a),this._option.disableTriggerEvent||this._initEvent(),a.on("*",(function(t,e){return i._delegateEvent(i._legendComponent,t,e)}))}this._cacheAttrs=r;var o=isFinite(this._legendComponent.AABBBounds.width())?this._legendComponent.AABBBounds.width():0,s=isFinite(this._legendComponent.AABBBounds.height())?this._legendComponent.AABBBounds.height():0;if("normal-inline"!==this.layoutType){var l="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",u=this._position,c=e.width,h=e.height,d=0,v=0;"horizontal"===l?"middle"===u?d=(c-o)/2:"end"===u&&(d=c-o):"middle"===u?v=(h-s)/2:"end"===u&&(v=h-s),this._legendComponent.setAttributes({dx:d,dy:v})}return n.x2=n.x1+o,n.y2=n.y1+s,n}},{key:"onDataUpdate",value:function(){var e,i;if(JSON.stringify(this._preSelectedData)!==JSON.stringify(this._selectedData)){if(this._legendComponent){var n=this._getLegendAttributes(this.getLayoutRect());at(n,this._cacheAttrs)||this._legendComponent.setAttributes(nO({},n,{defaultSelected:this._selectedData}))}null===(i=(e=this.effect).onSelectedDataChange)||void 0===i||i.call(e),this.event.emit(t.ChartEvent.legendSelectedDataChange,{model:this})}}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._legendComponent]}},{key:"clear",value:function(){_(r,"clear",this,3)([]),this._cacheAttrs=null,this._preSelectedData=null}}])}(vz);uq.specKey="legends";var cq=function(e){function o(){var t;return n(this,o),(t=i(this,o,arguments)).type=d.discreteLegend,t.name=d.discreteLegend,t}return c(o,e),a(o,[{key:"init",value:function(e){var i=this;_(o,"init",this,3)([e]),gL(this._regions,(function(e){e.addViewDataFilter({type:"discreteLegendFilter",options:{series:e,selected:function(){return i._selectedData},field:function(){return i._getSeriesLegendField(e)},data:function(){return i.getLegendDefaultData()},customFilter:i._spec.customFilter},level:t.TransformLevel.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},{key:"_initLegendData",value:function(){var t=this;EI(this._option.dataSet,"discreteLegendFilter",lq),EI(this._option.dataSet,"discreteLegendDataMake",sq);var e=new Xo(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")});return e.transform({type:"discreteLegendDataMake",options:{series:function(){var e=[];return gL(t._regions,(function(t){e.push(t)}),{specIndex:t._spec.seriesIndex,userId:t._spec.seriesId}),e},seriesField:function(e){return t._getSeriesLegendField(e)}}}),e}},{key:"_getSeriesLegendField",value:function(t){var e,i,n,r=t.getSeriesField(),a=null!==(e=this._spec.scaleName)&&void 0!==e?e:this._spec.scale;if(T(a))return r;if(!t.getRawData())return r;var o=this._option.globalScale.getScaleSpec(a);if(!o)return r;if(this._spec.field)return this._spec.field;if(!vb(o.domain))return r;var s=o.domain.find((function(e){return e.dataId===t.getRawData().name}));return s&&null!==(n=null===(i=s.fields)||void 0===i?void 0:i[0])&&void 0!==n?n:r}},{key:"_initSelectedData",value:function(){var t=this,e=this.getLegendDefaultData();if(this._unselectedData){var i=[],n=[];e.forEach((function(e){t._unselectedData.includes(e)?n.push(e):i.push(e)})),this._selectedData=i,this._unselectedData=n}else this._spec.defaultSelected?this._selectedData=b(this._spec.defaultSelected):this._selectedData=e}},{key:"getLegendDefaultData",value:function(t){return w(this._spec.data)?this._getLegendItems().map((function(t){return t.label})):this._legendData.getLatestData().map(t?function(t){return t.originalKey}:function(t){return t.key})}},{key:"_addDefaultTitleText",value:function(t){var e,i,n,r;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&T(t.title.text)&&T(null===(i=t.title.style)||void 0===i?void 0:i.text)){var a=null===(r=null===(n=this._regions)||void 0===n?void 0:n[0])||void 0===r?void 0:r.getSeries()[0];if(!a)return;t.title.text=iI(a.getRawData(),a.getSeriesField())}}},{key:"_getLegendAttributes",value:function(t){var e="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=Object.assign(Object.assign({layout:e,items:this._getLegendItems(),zIndex:this.layoutZIndex},function(t,e){var i=r(t,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]),n=t.title,a=void 0===n?{}:n,o=t.item,s=void 0===o?{}:o,l=t.pager,u=void 0===l?{}:l,c=t.background,h=void 0===c?{}:c;a=Z(a),s=Z(s),u=Z(u),h=Z(h);var d=i;return a.visible?d.title=oq(a):d.title={visible:!1},Y(s.focusIconStyle)||pI(s.focusIconStyle),s.shape&&(s.shape=dI(s.shape)),s.label&&(s.label=dI(s.label)),s.value&&(s.value=dI(s.value)),s.background&&(s.background=dI(s.background)),VL(s.maxWidth)&&(s.maxWidth=Number(s.maxWidth.substring(0,s.maxWidth.length-1))*e.width/100),VL(s.width)&&(s.width=Number(s.width.substring(0,s.width.length-1))*e.width/100),VL(s.height)&&(s.height=Number(s.height.substring(0,s.height.length-1))*e.width/100),d.item=s,"scrollbar"===u.type?(Y(u.railStyle)||pI(u.railStyle),Y(u.sliderStyle)||pI(u.sliderStyle)):(Y(u.textStyle)||pI(u.textStyle),u.handler&&dI(u.handler)),d.pager=u,h.visible&&!Y(h.style)&&(nO(d,h.style),C(h.padding)&&(d.padding=h.padding)),d}(this._spec,t)),{maxWidth:t.width,maxHeight:t.height});return this._addDefaultTitleText(i),this._addLegendItemFormatMethods(i),i}},{key:"_getLegendConstructor",value:function(){return MR}},{key:"setSelectedData",value:function(t){t&&(this._unselectedData=this.getLegendDefaultData().filter((function(e){return!t.includes(e)}))),_(o,"setSelectedData",this,3)([t])}},{key:"_initEvent",value:function(){var e=this;if(this._legendComponent){var i=!1!==this._spec.filter;this._legendComponent.addEventListener(fR.legendItemClick,(function(n){var r=X(n,"detail.currentSelected");i&&e.setSelectedData(r),e.event.emit(t.ChartEvent.legendItemClick,{model:e,value:r,event:n})})),this._legendComponent.addEventListener(fR.legendItemHover,(function(i){var n=X(i,"detail");e.event.emit(t.ChartEvent.legendItemHover,{model:e,value:n,event:i})})),this._legendComponent.addEventListener(fR.legendItemUnHover,(function(i){var n=X(i,"detail");e.event.emit(t.ChartEvent.legendItemUnHover,{model:e,value:n,event:i})}))}}},{key:"_getLegendItems",value:function(){var t=(this._legendData.getLatestData()||[]).map((function(t){var e,i,n=t.style("fillOpacity"),r=t.style("strokeOpacity"),a=t.style("opacity"),o=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:z(n)?n:1,strokeOpacity:z(r)?r:1,opacity:z(a)?a:1,texturePadding:o?1:null,textureSize:o?4:null,texture:o,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 w(this._spec.data)?this._spec.data(t,this._option.globalScale.getScale("color"),this._option.globalScale):t}},{key:"_addLegendItemFormatMethods",value:function(t){var e,i,n,r,a=null!==(i=null===(e=this._spec.item)||void 0===e?void 0:e.label)&&void 0!==i?i:{},o=a.formatMethod,s=a.formatter,l=null!==(r=null===(n=this._spec.item)||void 0===n?void 0:n.value)&&void 0!==r?r:{},u=l.formatMethod,c=l.formatter,h=gF(o,s).formatFunc;s&&!o&&h&&(t.item.label.formatMethod=function(t,e){return h(t,e,s)});var d=gF(u,c).formatFunc;c&&!u&&d&&(t.item.value.formatMethod=function(t,e){return d(c,t,e,s)})}}],[{key:"getSpecInfo",value:function(t){return yF(t,this.specKey,this.type,(function(t){return!t.type||"discrete"===t.type}))}}])}(uq);cq.specKey="legends",cq.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}},cq.type=d.discreteLegend;var hq=function(t,e){var i=e.series,n=e.field,r=e.scale,a=n();if(n&&a){var o=1/0,s=-1/0;return i().forEach((function(t){var e=t.getRawDataStatisticsByField(a,!0),i=null==e?void 0:e.min,n=null==e?void 0:e.max;z(i)&&(o=Math.min(i,o)),z(n)&&(s=Math.max(n,s))})),[o,s]}if(r){var l=r();return l?l.domain():[]}return[]},dq=function(t,e){var i=e.selected,n=e.field,r=e.data,a=e.isHierarchyData,o=e.customFilter,s=i(),l=n(),u=a||function(t){return t&&t.some((function(t){return t&&function(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children";return!!E(t)&&!!t.hasOwnProperty(e)&&Array.isArray(t[e])}(t)}))};if(s===r())return t;if(l&&!Y(s)){var c=m(s,2),h=c[0],d=c[1];return o?o(t,s,l):u(t)?hI(t,+h,+d,l):t.filter((function(t){return t[l]>=h&&t[l]<=d}))}return t},vq={color:ER,size:PR},fq={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}},pq=function(t){var 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({},fq),{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"}}}})},gq={horizontal:pq(!0),vertical:pq(!1)},yq=function(t){var 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({},fq),{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"}}}})},mq={horizontal:yq(!0),vertical:yq(!1)},_q=["#C4E7FF","#98CAFF","#75ACFF","#518FF9","#2775DC","#005CBE","#00429F","#00287E"],bq=[2,10],kq=function(e){function o(t,e){var r;n(this,o),(r=i(this,o,[t,e])).type=d.colorLegend,r.name=d.colorLegend;var a="color"===r._spec.type?d.colorLegend:d.sizeLegend;return r.type=a,r.name=a,r}return c(o,e),a(o,[{key:"setAttrFromSpec",value:function(){_(o,"setAttrFromSpec",this,3)([]),this._field=this._spec.field,this._legendType=this._spec.type}},{key:"init",value:function(e){var i=this;_(o,"init",this,3)([e]),gL(this._regions,(function(e){e.addViewDataFilter({type:"continuousLegendFilter",options:{selected:function(){return i._selectedData},field:function(){return i._field},data:function(){return i._legendData.getLatestData()},isHierarchyData:e.isHierarchyData,customFilter:i._spec.customFilter},level:t.TransformLevel.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},{key:"_getScaleInGlobal",value:function(){var t=this._option.globalScale,e=this._spec.scale;return e||(e=this._legendType),t.getScale(e)}},{key:"_initLegendData",value:function(){var t=this;EI(this._option.dataSet,"continuousLegendFilter",dq),EI(this._option.dataSet,"continuousLegendDataMake",hq);var e=new Xo(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")});return e.transform({type:"continuousLegendDataMake",options:{series:function(){return yL(t._regions,{userId:t._seriesUserId,specIndex:t._seriesIndex})},field:function(){return t._field},scale:this._getScaleInGlobal.bind(this)}}),e}},{key:"_initSelectedData",value:function(){this._spec.defaultSelected?this._selectedData=this._spec.defaultSelected.slice():this._selectedData=this._legendData.getLatestData()}},{key:"_addDefaultTitleText",value:function(t){var e,i,n,r;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&T(t.title.text)&&T(null===(i=t.title.style)||void 0===i?void 0:i.text)){var a=this._field;if(a){var o=null===(r=null===(n=this._regions)||void 0===n?void 0:n[0])||void 0===r?void 0:r.getSeries()[0];if(!o)return;return void(t.title.text=iI(o.getRawData(),a))}var s=this._spec.scale;s||(s=this._legendType);var l=this._option.globalScale.getScaleSpec(s);if(!vb(null==l?void 0:l.domain))return;var u=l.domain[0];if(0===u.fields.length)return;t.title.text=iI(this._option.dataSet.getDataView(u.dataId),u.fields[0])}}},{key:"_getLegendAttributes",value:function(t){var e,i,n="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",a="horizontal"===n?"bottom":this.layoutOrient,o=[],l=this._getScaleInGlobal();l&&"linear"===l.type&&(o=l.range()),Y(o)&&(o="color"===this._legendType?_q:bq);var u=null!==(e=this._legendData.getLatestData()[0])&&void 0!==e?e:0,c=null!==(i=this._legendData.getLatestData()[1])&&void 0!==i?i:1;this._legendData.getLatestData()[0]===this._legendData.getLatestData()[1]&&(u=Math.min(0,this._legendData.getLatestData()[0]),c=0===this._legendData.getLatestData()[0]?1:Math.max(0,this._legendData.getLatestData()[0]));var h=Object.assign(s({layout:n,align:a,zIndex:this.layoutZIndex,min:u,max:c,value:this._spec.defaultSelected},"color"===this._legendType?"colors":"sizeRange",o),function(t){var e=nO({},t),i=e.title,n=void 0===i?{}:i,a=e.handler,o=void 0===a?{}:a,s=e.rail,l=void 0===s?{}:s,u=e.track,c=void 0===u?{}:u,h=e.startText,d=e.endText,v=e.handlerText,f=e.sizeBackground,p=e.background,g=void 0===p?{}:p;e.type,e.id,e.visible,e.orient,e.position,e.data,e.defaultSelected,e.field,e.filter,e.regionId,e.regionIndex,e.seriesIndex,e.seriesId,e.padding;var y=r(e,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return n.visible?y.title=oq(n):y.title={visible:!1},y.showHandler=!1!==o.visible,Y(o.style)||(y.handlerStyle=pI(o.style)),C(l.width)&&(y.railWidth=l.width),C(l.height)&&(y.railHeight=l.height),Y(l.style)||(y.railStyle=pI(l.style)),Y(c.style)||(y.trackStyle=pI(c.style)),y.startText=dI(h),y.endText=dI(d),y.handlerText=dI(v),Y(f)||(y.sizeBackground=pI(f)),g.visible&&!Y(g.style)&&(nO(y,g.style),C(g.padding)&&(y.padding=g.padding)),y}(this._spec));return this._addDefaultTitleText(h),h}},{key:"_getLegendConstructor",value:function(){return vq[this._legendType]}},{key:"_initEvent",value:function(){var e=this;if(this._legendComponent){var i=!1!==this._spec.filter;this._legendComponent.addEventListener("change",Ft((function(n){var r=X(n,"detail.value");i&&e.setSelectedData(r),e.event.emit(t.ChartEvent.legendFilter,{model:e,value:r,event:n})}),30))}}}],[{key:"getSpecInfo",value:function(t){var e=yF(t,this.specKey,this.type,(function(t){return"color"===(e=t.type)||"size"===e;var e}));return e&&e.forEach((function(t){t.type="color"===t.spec.type?d.colorLegend:d.sizeLegend})),e}}])}(uq);kq.specKey="legends",kq.builtInTheme={colorLegend:gq,sizeLegend:mq},kq.type=d.continuousLegend;var xq=function(t,e){return C(e)?t.map((function(t){return e[t]})):void 0},Sq=function(t,e){return function(i){return t.every((function(t,n){return i[t]===(null==e?void 0:e[n])}))}},Aq=function(t){return!T(t)&&(O(t)?t.length>0&&t.every(C):Object.keys(t).length>0)};function Mq(t,e,i){var n,r,a,o,s,l,u=Object.assign({regionIndex:0},e),c=i.getOption(),h=c.getRegionsInUserIdOrIndex(C(u.regionId)?[u.regionId]:void 0,C(u.regionIndex)?[u.regionIndex]:void 0)[0];if(!h)return"none";var d=Cq(t,h),v=null!==(n=u.activeType)&&void 0!==n?n:d.length>1?"dimension":"mark",f=h.getLayoutStartPoint(),p=h.getLayoutRect(),g=c.globalInstance.getContainer(),y=Object.assign({x:0,y:0},g?function(t){var e=t.getBoundingClientRect();return{x:e.x,y:e.y}}(g):{}),m=function(t){var e,i=t.data,n=i.dimensionFields,r=i.dimensionData,a=i.measureFields,o=i.measureData,s=i.groupField,l=i.groupData;return null===(e=t.series.getViewData())||void 0===e?void 0:e.latestData.find((function(t){return Sq(n,r)(t)&&Sq(a,o)(t)&&(T(s)||Sq([s],[l])(t))}))},_=h.getOption().globalInstance.getStage().window.getViewBoxTransform().getInverse(),k=function(t){var e,i,n=function(t){return{x:Math.min(Math.max(t.x,0),p.width),y:Math.min(Math.max(t.y,0),p.height)}}(t),r=null!==(e=u.x)&&void 0!==e?e:f.x+n.x,a=null!==(i=u.y)&&void 0!==i?i:f.y+n.y,o={x:0,y:0};_.transformPoint({x:r,y:a},o);var s=o.x,l=o.y;return{canvasX:s,canvasY:l,clientX:y.x+s,clientY:y.y+l}};if("dimension"===v){var x=d[0];if(!x)return"none";var S=new Map;d.forEach((function(t){var e;S.has(t.series)||S.set(t.series,[]),null===(e=S.get(t.series))||void 0===e||e.push(t)}));var A=[{value:t[x.data.dimensionFields[0]],data:b(S.keys()).map((function(t){var e,i;return{series:t,datum:null!==(i=null===(e=S.get(t))||void 0===e?void 0:e.map((function(t){return m(t)})))&&void 0!==i?i:[]}}))}];C(x.dimType)&&(A[0].position=x.pos[x.dimType],A[0].dimType=x.dimType);var M={changePositionOnly:!1,action:"enter",tooltip:null,dimensionInfo:A,chart:null!==(r=c.globalInstance.getChart())&&void 0!==r?r:void 0,datum:void 0,model:void 0,source:xI.chart,event:k({x:d.reduce((function(t,e){return t+e.pos.x}),0)/d.length,y:d.reduce((function(t,e){return t+e.pos.y}),0)/d.length}),item:void 0};null===(s=null===(o=null===(a=i.processor)||void 0===a?void 0:a.dimension)||void 0===o?void 0:o.showTooltip)||void 0===s||s.call(o,A,M,!1);var w=c.globalInstance;return hF.globalConfig.uniqueTooltip&&hF.hideTooltip(w.id),v}if("mark"===v){var E=d[0];if(!E)return"none";var B=Object.assign(Object.assign({},m(E)),t),P=[{datum:[B],series:E.series}],R={changePositionOnly:!1,tooltip:null,dimensionInfo:[{value:B[E.data.dimensionFields[0]],data:P}],chart:null!==(l=c.globalInstance.getChart())&&void 0!==l?l:void 0,datum:B,model:E.series,source:xI.chart,event:k(E.pos),item:void 0};i.processor.mark.showTooltip({datum:B,mark:null,series:E.series},R,!1);var L=c.globalInstance;return hF.globalConfig.uniqueTooltip&&hF.hideTooltip(L.id),v}return"none"}var wq,Tq,Cq=function(t,e){var i=e.getSeries(),n=[];return i.forEach((function(e){var i,r,a,o,s,l,u,c=e.getDimensionField(),h=e.getMeasureField(),d=e.getSeriesField(),v=C(d)?t[d]:void 0,f=C(d)&&null!==(o=null===(a=null===(r=null===(i=e.getViewDataStatistics)||void 0===i?void 0:i.call(e))||void 0===r?void 0:r.latestData[d])||void 0===a?void 0:a.values)&&void 0!==o?o:[],p=xq(c,t),g=xq(h,t),y=Aq(g),_=!y&&C(d)&&T(v)&&f.length>0,b=function(){var t,i=null===(t=e.getViewData())||void 0===t?void 0:t.latestData.find(Sq(c,p));if(y||(g=xq(h,i),Aq(g))){var r=e.type===_L.pie?e.dataToCentralPosition(i):e.dataToPosition(i);T(r)||isNaN(r.x)||isNaN(r.y)||n.push({pos:r,data:{dimensionFields:c,dimensionData:p,measureFields:h,measureData:g,hasMeasureData:y,groupField:d,groupData:v},series:e})}};if("cartesian"===e.coordinate){var k=e,x=lE(null===(l=null===(s=e.getYAxisHelper())||void 0===s?void 0:s.getScale(0))||void 0===l?void 0:l.type)?"y":"x",S=c.map((function(t,e){return[t,e]})).filter((function(t){var e=m(t,2)[1];return T(null==p?void 0:p[e])})),A=[null!=p?p:[]];S.length>0&&S.forEach((function(t){var i,n,r,a,o=m(t,2),s=o[0],l=o[1],u=null!==(a=null===(r=null===(n=null===(i=e.getViewDataStatistics)||void 0===i?void 0:i.call(e))||void 0===n?void 0:n.latestData[s])||void 0===r?void 0:r.values)&&void 0!==a?a:[],c=[];A.forEach((function(t){u.forEach((function(e){var i,n=null!==(i=null==t?void 0:t.slice())&&void 0!==i?i:[];n[l]=e,c.push(n)}))})),A=c})),A.forEach((function(t){var i,r;if(_){var a=null===(i=k.getViewData())||void 0===i?void 0:i.latestData.filter(Sq(c,t));f.forEach((function(i){var r=a.find((function(t){return t[d]===i}));if(g=xq(h,r),Aq(g)){var o=k.dataToPosition(r);T(o)||isNaN(o.x)||isNaN(o.y)||n.push({pos:o,data:{dimensionFields:c,dimensionData:t,measureFields:h,measureData:g,hasMeasureData:y,groupField:d,groupData:i},series:e,dimType:x})}}))}else{var o=null===(r=k.getViewData())||void 0===r?void 0:r.latestData.find(Sq(c,t));if(!y&&(g=xq(h,o),!Aq(g)))return;var s=k.dataToPosition(o);if(T(s)||isNaN(s.x)||isNaN(s.y))return;n.push({pos:s,data:{dimensionFields:c,dimensionData:t,measureFields:h,measureData:g,hasMeasureData:y,groupField:d,groupData:v},dimType:x,series:e})}}))}else if("polar"===e.coordinate)if(e.type===_L.pie)b();else{var M=e;if(_){var w=(null===(u=M.getViewData())||void 0===u?void 0:u.latestData.filter(Sq(c,p))).find((function(t){return t[d]===v}));f.forEach((function(t){if(g=xq(h,w),Aq(g)){var i=M.dataToPosition(w);T(i)||isNaN(i.x)||isNaN(i.y)||n.push({pos:i,data:{dimensionFields:c,dimensionData:p,measureFields:h,measureData:g,hasMeasureData:y,groupField:d,groupData:t},series:e})}}))}else b()}else"geo"===e.coordinate&&b()})),n},Eq=function(t){return C(t)&&!O(t)},Bq=function(t){return C(t)&&O(t)},Pq=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_shouldMergeThemeToSpec",value:function(){return!1}},{key:"_initTheme",value:function(t,i){var n,r,a,o=_(e,"_initTheme",this,3)([t,i]),s=o.spec,l=o.theme;return s.style=nO({},this._theme,s.style),s.offset=nO({},l.offset,t.offset),s.transitionDuration=null!==(n=t.transitionDuration)&&void 0!==n?n:l.transitionDuration,s.trigger=null!==(r=t.trigger)&&void 0!==r?r:l.trigger,s.triggerOff=null!==(a=t.triggerOff)&&void 0!==a?a:l.triggerOff,{spec:s,theme:l}}},{key:"_transformSpecAfterMergingTheme",value:function(t,i,n){var r,a,o,s,l,u,c;_(e,"_transformSpecAfterMergingTheme",this,3)([t,i,n]),t.visible=null===(r=t.visible)||void 0===r||r,t.activeType=function(t){var e,i,n;if(!1===(null==t?void 0:t.visible))return[];var r={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===(n=null==t?void 0:t.group)||void 0===n?void 0:n.visible)};return C(null==t?void 0:t.activeType)&&Object.keys(r).forEach((function(e){var i;r[e]=null===(i=null==t?void 0:t.activeType)||void 0===i?void 0:i.includes(e)})),Object.keys(r).filter((function(t){return r[t]}))}(t),t.renderMode=null!==(a=t.renderMode)&&void 0!==a?a:ub(this._option.mode)||!sb(this._option.mode)?"canvas":"html",t.trigger=null!==(o=t.trigger)&&void 0!==o?o:"hover",t.className=null!==(s=t.className)&&void 0!==s?s:"vchart-tooltip-element",t.enterable=null!==(l=t.enterable)&&void 0!==l&&l,t.transitionDuration=null!==(u=t.transitionDuration)&&void 0!==u?u:150,t.confine=null!==(c=t.confine)&&void 0!==c?c:"canvas"===t.renderMode,C(t.parentElement)?L(t.parentElement)&&(t.parentElement=zm.getElementById(t.parentElement)):sb(this._option.mode)&&(t.parentElement=null==ob?void 0:ob.body)}}])}(dz),Rq={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}},Lq=function(r){function o(){var r;return n(this,o),(r=i(this,o,arguments)).layoutZIndex=1,r.type=d.tooltip,r.name=d.tooltip,r.transformerConstructor=Pq,r.specKey="tooltip",r.layoutType="none",r._isReleased=!1,r._alwaysShow=!1,r._eventList=[],r._isTooltipShown=!1,r._clickLock=!1,r._mountEvent=function(t,e,i){r.event.on(t,e,i),r._eventList.push({eventType:t,handler:i})},r._handleClickToLock=function(t){var e,i;if(r._clickLock)r._handleChartMouseOut(t),r._clickLock=!1;else{if(!r._isTooltipShown&&!(null===(i=null===(e=r.tooltipHandler)||void 0===e?void 0:e.isTooltipShown)||void 0===i?void 0:i.call(e)))return;r._clickLock=!0}},r._getMouseOutHandler=function(t){return function(e){var i,n,a,o,s;if(!r._isReleased&&!r._alwaysShow&&!r._clickLock&&(r._isTooltipShown||(null===(n=null===(i=r.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===n?void 0:n.call(i)))){var l=sb(null===(a=r._option)||void 0===a?void 0:a.mode),u=e.event,c=u.clientX,h=u.clientY;l&&t&&r._isPointerInChart({x:c,y:h})||(r._enterable?r._outTimer=setTimeout((function(){r._handleChartMouseOut(e)}),null!==(s=null===(o=r._spec)||void 0===o?void 0:o.showDelay)&&void 0!==s?s:50):r._handleChartMouseOut(e))}}},r._handleChartMouseOut=function(t){var i;r._cacheActiveType&&(null===(i=r._option)||void 0===i?void 0:i.componentShowContent)&&(!1===r._option.componentShowContent.tooltip||E(r._option.componentShowContent.tooltip)&&!1===r._option.componentShowContent.tooltip[r._cacheActiveType])||r._alwaysShow||r._isReleased||r._isEnterTooltip||"none"!==r._spec.triggerOff&&(r._hideTooltipByHandler(Object.assign(Object.assign({},t),{tooltip:e(r)})),r._handleMouseMove&&r._handleMouseMove.cancel&&r._handleMouseMove.cancel(),r._cacheEnterableRect=null,r._cacheInfo=void 0,r._cacheParams=void 0,r._cacheActiveType=void 0)},r._getMouseMoveHandler=function(t){return function(e){var i,n,a,o;r._isReleased||r._isEnterTooltip||(r._outTimer&&(clearTimeout(r._outTimer),r._outTimer=null),r.tooltipHandler||r._initHandler(),r.processor||r._initProcessor(),r._alwaysShow||(r._clickLock?t&&(r._handleChartMouseOut(e),r._clickLock=!1):!t&&r._enterable&&(null===(n=null===(i=r.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===n?void 0:n.call(i))?(r._showTimer&&clearTimeout(r._showTimer),r._showTimer=setTimeout((function(){r._handleChartMouseMove(e,t)}),null!==(o=null===(a=r._spec)||void 0===a?void 0:a.showDelay)&&void 0!==o?o:50)):r._handleChartMouseMove(e,t)))}},r._handleChartMouseMove=function(t,e){if(!r._isReleased){for(var i=r._getMouseEventData(t),n=i.tooltipInfo.dimension,a=i.ignore.mark,o={mark:!1,dimension:!1,group:!1},s=["group","mark","dimension"],l=0,u=s.length;l<u;l++){var c=s[l],h=!!r.processor[c]&&r._showTooltipByMouseEvent(c,i,t,e);if("unShowByOption"===h)o[c]="unShowByOption";else if(h){o[c]=!0;break}}Object.values(o).every((function(t){return!t}))&&!function(t){return T(t.mark)&&T(t.model)&&T(t.datum)}(t)&&(a&&Eq(r._cacheInfo)?o.mark=r._showTooltipByMouseEvent("mark",i,t,e,!0):C(n)&&(o.dimension=r._showTooltipByMouseEvent("dimension",i,t,e))),!0===o.mark||!0===o.group||!0===o.dimension&&!T(n)?r._initEventOfTooltipContent():r._cacheActiveType&&"unShowByOption"===o[r._cacheActiveType]||r._handleChartMouseOut(t)}},r._showTooltipByMouseEvent=function(t,e,i,n,a){var o;if(!r._showContentByEvent(t))return"unShowByOption";var s,l=r.processor[t];if(!l.shouldHandleTooltip(i,e.tooltipInfo[t]))return!1;if(r._hideTimer&&clearTimeout(r._hideTimer),a)s=!l.showTooltip(r._cacheInfo,i,!0);else{var u=e.tooltipInfo[t],c=r._isSameAsCache(u,i,t);(s=!l.showTooltip(u,i,c))&&(r._cacheInfo=u,r._cacheParams=i,r._cacheActiveType=t)}s&&(r._isTooltipShown=!0,n&&r._spec.lockAfterClick&&!r._clickLock?r._clickLock=!0:Number.isFinite(r._spec.hideTimer)&&(r._hideTimer=setTimeout((function(){r._handleChartMouseOut()}),r._spec.hideTimer)));var h=null===(o=r._option)||void 0===o?void 0:o.globalInstance;return s&&hF.globalConfig.uniqueTooltip&&h&&hF.hideTooltip(h.id),s},r._getMouseEventData=function(t){var e={tooltipInfo:{},ignore:{}};return Object.keys(r.processor).forEach((function(i){var n=r.processor[i].getMouseEventData(t),a=n.tooltipInfo,o=n.ignore;e.tooltipInfo[i]=a,e.ignore[i]=o})),e},r._hideTooltipByHandler=function(i){var n,a,o;if(!r._isTooltipShown&&!(null===(a=null===(n=r.tooltipHandler)||void 0===n?void 0:n.isTooltipShown)||void 0===a?void 0:a.call(n)))return 0;r.event.emit(t.ChartEvent.tooltipHide,Object.assign(Object.assign({},i),{source:xI.chart,tooltip:e(r)})),Object.values(r.processor).forEach((function(t){t.clearCache()}));var s=null!==(o=r._spec.handler)&&void 0!==o?o:r.tooltipHandler;if(s.hideTooltip){var l=s.hideTooltip.call(s,i);return l||(r._isTooltipShown=!1),l}return 1},r.hideTooltip=function(){if(r._isReleased)return!1;var t={changePositionOnly:!1,tooltip:e(r),item:void 0,datum:void 0,source:xI.chart};return r._alwaysShow=!1,!r._hideTooltipByHandler(t)},r}return c(o,r),a(o,[{key:"isTooltipShown",value:function(){return this._isTooltipShown}},{key:"_registerEvent",value:function(){}},{key:"_releaseEvent",value:function(){}},{key:"onLayoutEnd",value:function(){}},{key:"created",value:function(){_(o,"created",this,3)([]),this._regions=this._option.getAllRegions(),this._initEvent()}},{key:"release",value:function(){var t,e,i=this;_(o,"release",this,3)([]),this._isReleased=!0,this._hideTimer&&clearTimeout(this._hideTimer),this._eventList.forEach((function(t){var e=t.eventType,n=t.handler;i.event.off(e,n)})),this._eventList=[],null===(e=null===(t=this.tooltipHandler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),this._isTooltipShown=!1}},{key:"beforeRelease",value:function(){this.event.emit(t.ChartEvent.tooltipHide,{tooltip:this,chart:this.getChart()}),this.event.emit(t.ChartEvent.tooltipRelease,{tooltip:this,chart:this.getChart()})}},{key:"_initHandler",value:function(){var t,e,i,n=null!==(t=this._spec.renderMode)&&void 0!==t?t:"html",r=this._option.globalInstance.getTooltipHandlerByUser();if(r)this.tooltipHandler=r,this._enterable=!1;else{var a="canvas"===n?DH.canvas:DH.dom,o=rO.getComponentPluginInType(a);o||nb("Can not find tooltip handler: "+a);var s=new o;s.name="".concat(this._spec.className,"-").concat(null!==(e=this._option.globalInstance.id)&&void 0!==e?e:0,"-").concat(this.getSpecIndex()),null===(i=this.pluginService)||void 0===i||i.load([s]),this.tooltipHandler=s,this._spec.enterable&&"html"===n&&this.tooltipHandler?(this._enterable=!0,this._needInitEventOfTooltip=!0):this._enterable=!1}}},{key:"_initEventOfTooltipContent",value:function(){var t,e,i=this;if(this._needInitEventOfTooltip){var n=null===(e=(t=this.tooltipHandler).getRootDom)||void 0===e?void 0:e.call(t);n&&(n.addEventListener("pointerenter",(function(){var t;if(i._enterable){i._isEnterTooltip=!0;var e=null===(t=n.getBoundingClientRect)||void 0===t?void 0:t.call(n);e&&(i._cacheEnterableRect={width:e.width,height:e.height}),i._outTimer&&(clearTimeout(i._outTimer),i._outTimer=null),i._showTimer&&(clearTimeout(i._showTimer),i._showTimer=null)}})),n.addEventListener("pointerleave",(function(){var t,e,r;if(i._enterable&&(i._isEnterTooltip=!1,"none"!==i._spec.triggerOff&&i._cacheEnterableRect)){var a=null===(t=n.getBoundingClientRect)||void 0===t?void 0:t.call(n);a&&Object.keys(i._cacheEnterableRect).every((function(t){return i._cacheEnterableRect[t]===a[t]}))&&(i._cacheEnterableRect=null,i._outTimer=setTimeout(i.hideTooltip,null!==(r=null===(e=i._spec)||void 0===e?void 0:e.showDelay)&&void 0!==r?r:50))}})),this._needInitEventOfTooltip=!1)}}},{key:"_initProcessor",value:function(){var t=this,e=this._spec.activeType;this.processor={},e.forEach((function(e){var i=rO.createTooltipProcessor(e,t);i&&(t.processor[e]=i)}))}},{key:"_initEvent",value:function(){var t,e=this;if(!this._option.disableTriggerEvent){var i=lt(null!==(t=this._spec.trigger)&&void 0!==t?t:"hover"),n=lt(this._spec.triggerOff),r=this._option.mode;i.forEach((function(t){var i;"hover"===t?(e._handleMouseMove=e._throttle(e._getMouseMoveHandler(!1)),e._mountEvent("pointermove",{source:"chart"},e._handleMouseMove),(lb(r)||ub(r))&&(e._mountEvent("pointerdown",{source:"chart"},e._getMouseMoveHandler(!1)),e._mountEvent("pointerup",{source:"window"},e._getMouseOutHandler(!0))),e._mountEvent("pointerleave",{source:"chart"},e._getMouseOutHandler(!1))):"click"===t?(e._mountEvent("pointertap",{source:"chart"},e._getMouseMoveHandler(!0)),e._mountEvent("pointerup",{source:"window"},e._getMouseOutHandler(!0))):E(t)&&e._mountEvent(t.eventType,{source:null!==(i=t.source)&&void 0!==i?i:"chart",consume:t.consume},e._getMouseMoveHandler(!0))})),n.filter((function(t){return E(t)})).forEach((function(t){var i,n;e._mountEvent(t.eventType,{source:null!==(i=t.source)&&void 0!==i?i:"chart",consume:t.consume},e._getMouseOutHandler(null!==(n=t.checkOutside)&&void 0!==n&&n))})),!i.includes("click")&&this._spec.lockAfterClick&&this._mountEvent("pointertap",{source:"chart"},this._handleClickToLock)}}},{key:"_throttle",value:function(t){return jt(t,F(this._spec.throttleInterval)?this._spec.throttleInterval:"html"===this._spec.renderMode&&this._spec.transitionDuration?50:10)}},{key:"_showContentByEvent",value:function(t){var e;if(null===(e=this._option)||void 0===e?void 0:e.componentShowContent){if(!1===this._option.componentShowContent.tooltip)return!1;if(E(this._option.componentShowContent.tooltip)&&!1===this._option.componentShowContent.tooltip[t])return!1}return!0}},{key:"reInit",value:function(t){var e,i,n;if(_(o,"reInit",this,3)([t]),this.tooltipHandler){var r=null!==(e=this._spec.renderMode)&&void 0!==e?e:"html",a=this._spec.enterable&&"html"===r;a&&!this._enterable&&(this._needInitEventOfTooltip=!0),this._enterable=a,null===(n=(i=this.tooltipHandler).reInit)||void 0===n||n.call(i)}else this._initHandler()}},{key:"showTooltip",value:function(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;var n=Mq(t,e,this);return"none"!==n&&(this._alwaysShow=!!(null==e?void 0:e.alwaysShow),this._cacheActiveType=n),n}},{key:"_isSameAsCache",value:function(t,e,i){if(i!==this._cacheActiveType)return!1;if(t===this._cacheInfo)return!0;if(T(this._cacheInfo)||T(t))return!1;if(Bq(t)){if(Eq(this._cacheInfo))return!1;var n=this._cacheInfo;return n.length===t.length&&t.every((function(t,e){return pj(t,n[e])}))}if(Bq(this._cacheInfo))return!1;var r=this._cacheInfo;if((null==t?void 0:t.datum)!==r.datum||(null==t?void 0:t.mark)!==r.mark||(null==t?void 0:t.series)!==r.series)return!1;var a=this._cacheParams;return!T(a)&&!T(e)&&a.mark===e.mark&&a.model===e.model&&a.datum===e.datum}},{key:"_isPointerInChart",value:function(t){var e,i=null===(e=this._option)||void 0===e?void 0:e.globalInstance;if(!i)return!1;if(!i.getChart())return!1;var n=t.x,r=t.y,a=i.getCanvas().getBoundingClientRect(),o=a.x,s=a.y,l=a.width,u=a.height;return n>=o&&n<=o+l&&r>=s&&r<=s+u}},{key:"getVisible",value:function(){return!1!==this._spec.visible}}])}(vz);Lq.type=d.tooltip,Lq.transformerConstructor=Pq,Lq.builtInTheme={tooltip:Rq},Lq.specKey="tooltip",function(t){t[t.success=0]="success",t[t.failed=1]="failed"}(wq||(wq={})),function(t){t[t.ALL=3]="ALL",t[t.HORIZONTAL=2]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Tq||(Tq={}));var Oq={x:["top","bottom"],y:["left","right"],category:["angle"],value:["radius"]},Iq=function(e){function o(e,r){var a;return n(this,o),(a=i(this,o,[e,r])).specKey="crosshair",a.layoutType="none",a.gridZIndex=t.LayoutZIndex.CrossHair_Grid,a.labelZIndex=t.LayoutZIndex.CrossHair,a.trigger="hover",a._handleIn=function(t){if(a._option){var e=a.calculateTriggerPoint(t),i=e.x,n=e.y;a.showDefault=!1,a._layoutCrosshair(i,n);var r=a._getNeedClearVRenderComponents();a._hasActive=r.some((function(t){return t&&!1!==t.attribute.visible}))}},a._handleClickInEvent=function(t){if(!a._hasActive||!a._spec.lockAfterClick||a._clickLock)return a._clickLock?(a._clickLock=!1,void a._handleOutEvent()):void(a._onlyLockClick||(a._handleIn(t),F(a.triggerOff)&&(a._timer&&clearTimeout(a._timer),a._timer=setTimeout((function(){a._handleOutEvent()}),a.triggerOff))));a._clickLock=!0},a._handleHoverInEvent=jt((function(t){a._clickLock||a._handleIn(t)}),10),a._handleOutEvent=function(){a.enableRemain||a._clickLock||!a._hasActive||(a.clearOutEvent(),a.hideCrosshair())},a._handleTooltipShow=function(t){var e=t.tooltipData;if(!t.isEmptyTooltip&&e&&e.length)if(E(a._spec.followTooltip)&&!1===a._spec.followTooltip[t.activeType])a._handleTooltipHideOrRelease();else{var i=a.calculateTriggerPoint(t),n=i.x,r=i.y;a.showDefault=!1,a._layoutCrosshair(n,r,e,t.activeType);var o=a._getNeedClearVRenderComponents();a._hasActive=o.some((function(t){return t&&!1!==t.attribute.visible}))}else a._handleTooltipHideOrRelease()},a._handleTooltipHideOrRelease=function(){a.clearOutEvent(),a.hideCrosshair()},a.enable=!0,a.showDefault=!0,a}return c(o,e),a(o,[{key:"enableRemain",get:function(){return"none"===this.triggerOff}},{key:"_setAllAxisValues",value:function(t,e,i){var n=this,r=!1;if(t.forEach((function(t){lE(t.axis.getScale().type)&&(r?n.enable=!1:r=!0)})),!this.enable)return!1;var a=this._stateByField[i].currentValue;return t.forEach((function(t,i){var r=t.axis;a.set(i,{datum:n._getDatumAtPoint(r,e),axis:r})})),!0}},{key:"clearAxisValue",value:function(){var t=this;Object.keys(this._stateByField).forEach((function(e){t._stateByField[e].currentValue.clear()}))}},{key:"hideCrosshair",value:function(){this.clearAxisValue(),this.hide()}},{key:"showCrosshair",value:function(t){var e=this;t&&t.length&&(this.showDefault=!1,this.clearAxisValue(),t.forEach((function(t){var i=t.axis,n=t.value;e.setAxisValue(n,i)})),this.layoutByValue(!1))}},{key:"_getLimitBounds",value:function(){var t,e;if(!this._limitBounds){var i=null!==(e=null===(t=this._option.globalInstance.getChart())||void 0===t?void 0:t.getViewRect())&&void 0!==e?e:{width:0,height:0},n=i.width,r=i.height;this._limitBounds={x1:0,y1:0,x2:n,y2:r}}return this._limitBounds}},{key:"_showDefaultCrosshairBySpec",value:function(){var t=this,e=!1;return Object.keys(this._stateByField).forEach((function(i){var n=t._spec[i];if(n&&n.visible&&n.defaultSelect){var r=n.defaultSelect,a=r.axisIndex,o=void 0===a?0:a,s=r.datum,l=t._option.getComponentsByKey("axes").find((function(t){return t.getSpecIndex()===o}));l&&(e=!0,t._stateByField[i].currentValue.clear(),t._stateByField[i].currentValue.set(o,{axis:l,datum:s}))}})),e}},{key:"_updateVisibleCrosshair",value:function(){var t=this,e=!1;Object.keys(this._stateByField).forEach((function(i){var n=t._spec[i];n&&n.visible&&t._stateByField[i].currentValue.size?e=!0:t._hideByField(i)})),e&&this.layoutByValue(!1)}},{key:"_showDefaultCrosshair",value:function(){this.showDefault?this._showDefaultCrosshairBySpec()&&this.layoutByValue(!1):this._updateVisibleCrosshair()}},{key:"setAttrFromSpec",value:function(){_(o,"setAttrFromSpec",this,3)([]),this._parseCrosshairSpec()}},{key:"created",value:function(){_(o,"created",this,3)([]),this._initEvent()}},{key:"_compareSpec",value:function(t,e){var i=_(o,"_compareSpec",this,3)([t,e]);return i.reMake||at(e,t)||(i.reRender=!0,i.reMake=!0),i}},{key:"_initEvent",value:function(){var t=this;if(!this._option.disableTriggerEvent)if(this._spec.followTooltip)this._registerTooltipEvent();else{var e=this._getTriggerEvent();e&&e.forEach((function(e){t._registerEvent(e.in,!1,e.click),e.out&&t._registerEvent(e.out,!0)}))}}},{key:"_registerEvent",value:function(t,e,i){var n,r=this;if(!1!==(null===(n=this._option.componentShowContent)||void 0===n?void 0:n.crosshair)){var a=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent,o=e?{level:SI.chart}:{source:xI.chart};O(t)?t.forEach((function(t){r.event.on(t,o,a)})):this.event.on(t,o,a)}}},{key:"_eventOff",value:function(t,e,i){var n=this,r=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent;O(t)?t.forEach((function(t){n.event.off(t,r)})):this.event.off(t,r)}},{key:"onBeforeRender",value:function(){this._limitBounds=null,this._showDefaultCrosshair()}},{key:"calculateTriggerPoint",value:function(t){var e=t.event,i=this._option.getCompiler().getStage().getLayer(void 0),n={x:e.viewX,y:e.viewY};return i.globalTransMatrix.transformPoint({x:e.viewX,y:e.viewY},n),{x:n.x-this.getLayoutStartPoint().x,y:n.y-this.getLayoutStartPoint().y}}},{key:"_getTriggerEvent",value:function(){var e=this,i=this._option.mode,n=function(e){return e===t.RenderModeEnum["desktop-browser"]||e===t.RenderModeEnum["desktop-miniApp"]?{click:"pointertap",hover:"pointermove",hoverOut:"pointerleave",clickOut:"pointerleave"}:lb(e)||ub(e)?{click:"tap",hover:["pointerdown","pointermove"],hoverOut:"pointerleave",clickOut:"pointerleave"}:null}(void 0===i?t.RenderModeEnum["desktop-browser"]:i);if(n){var r=lt(this.trigger||"hover"),a=function(t){return"click"===t?"none"===e.triggerOff?null:n.clickOut:n.hoverOut};this._spec.lockAfterClick&&!r.includes("click")?(r.push("click"),this._onlyLockClick=!0):this._onlyLockClick=!1;var o=[];return r.forEach((function(t){o.push({click:"click"===t,in:n[t],out:a(t)})})),o}return null}},{key:"_registerTooltipEvent",value:function(){this.event.on(t.ChartEvent.tooltipHide,{source:xI.chart},this._handleTooltipHideOrRelease),this.event.on(t.ChartEvent.tooltipShow,{source:xI.chart},this._handleTooltipShow),this.event.on(t.ChartEvent.tooltipRelease,{source:xI.chart},this._handleTooltipHideOrRelease)}},{key:"_getAxisInfoByField",value:function(t){var e,i,n=null===(i=(e=this._option).getComponentsByKey)||void 0===i?void 0:i.call(e,"axes");if(!(null==n?void 0:n.length))return null;var r=X(this._spec,"".concat(t,"Field.bindingAxesIndex"));if(r||(r=[],n.forEach((function(e,i){Oq[t].includes(e.getOrient())&&r.push(i)}))),!r.length)return null;var a=new Map,o=1/0,s=1/0,l=-1/0,u=-1/0,c=this.getLayoutStartPoint(),h=c.x,d=c.y;return r.forEach((function(t){var e,i;o=1/0,s=1/0,l=-1/0,u=-1/0;var r=n.find((function(e){return e.getSpecIndex()===t}));if(r){var c=(null===(i=(e=r).getInnerOffset)||void 0===i?void 0:i.call(e))||{left:0,right:0,top:0,bottom:0};r.getRegions().forEach((function(t){var e=t.getLayoutStartPoint(),i=e.x,n=e.y;o=Math.min(o,i-h+c.left),s=Math.min(s,n-d+c.top),l=Math.max(l,i+t.getLayoutRect().width-h-c.right),u=Math.max(u,n+t.getLayoutRect().height-d-c.bottom)})),a.set(t,{x1:o,y1:s,x2:l,y2:u,axis:r})}})),a}},{key:"onLayoutEnd",value:function(){var t=this._regions[0];this.setLayoutRect(t.getLayoutRect()),this.setLayoutStartPosition(t.getLayoutStartPoint()),_(o,"onLayoutEnd",this,3)([])}},{key:"_releaseEvent",value:function(){var t=this;this.clearOutEvent();var e=this._getTriggerEvent();e&&e.forEach((function(e){t._eventOff(e.in,!1,e.click),e.out&&t._eventOff(e.out,!0)}))}},{key:"_parseFieldInfo",value:function(){var t=this;Object.keys(this._stateByField).forEach((function(e){var i=t._spec[e],n=t._stateByField[e].crosshairComp;if(i&&i.visible){if(t._stateByField[e].attributes=t._parseField(i,e),n){var r=t._stateByField[e].attributes,a=r.style,o="rect"===r.type?"rectStyle":"lineStyle";n.setAttributes(s({},o,a))}}else n&&n.parent&&n.parent.removeChild(n)}))}},{key:"_parseCrosshairSpec",value:function(){this._parseFieldInfo();var t=this._spec,e=t.trigger,i=t.triggerOff,n=t.labelZIndex,r=t.gridZIndex;e&&(this.trigger=e),("none"===i||F(i)&&i>0)&&(this.triggerOff=i),void 0!==n&&(this.labelZIndex=n),void 0!==r&&(this.gridZIndex=r)}},{key:"_parseField",value:function(t,e){var i,n,a,o={},s=t.line,l=void 0===s?{}:s,u=t.label,c=void 0===u?{}:u,h=t.visible;if(o.visible=h,o.type=l.type||"line",!1===l.visible)o.style={visible:!1};else{var d=l.style||{},v=d.stroke,f=d.fill,p=d.lineWidth,g=d,y=g.strokeOpacity,m=g.fillOpacity,_=g.opacity,b=r(g,["strokeOpacity","fillOpacity","opacity"]),k="line"===o.type,x=k?y:m;if(F(_)&&(x=(null!=x?x:1)*_),o.style=Object.assign({opacity:x,pickable:!1,visible:!0},b),k)o.style.stroke=v||f,o.style.lineWidth=X(l,"width",p||2);else{o.style.fill=f||v,(null===(n=null===(i=null==t?void 0:t.line)||void 0===i?void 0:i.style)||void 0===n?void 0:n.stroke)&&(o.style.stroke=t.line.style.stroke);var S=X(l,"width");if("string"==typeof S){var A=parseInt(S.substring(0,S.length-1),10)/100;o.style.sizePercent=A}else"number"!=typeof S&&"function"!=typeof S||(o.style.size=S)}}if(c.visible){var w=c.labelBackground||{},T=null!==(a=c.syncAxisLabelAngle)&&void 0!==a&&a,C=c.style||{},E=w.style||{},B=E.fill,P=void 0===B?"rgba(47, 59, 82, 0.9)":B,R=E.stroke,L=E.outerBorder,O=r(E,["fill","stroke","outerBorder"]);o.label={visible:!0,formatMethod:c.formatMethod,formatter:c.formatter,minWidth:w.minWidth,maxWidth:w.maxWidth,padding:w.padding,syncAxisLabelAngle:T,textStyle:Object.assign(Object.assign({fontSize:14,pickable:!1},C),{fill:C.fill||"#fff",stroke:X(C,"stroke")}),panel:(M(w.visible)?w.visible:w)?Object.assign({visible:!0,pickable:!1,fill:P,stroke:R,outerBorder:Object.assign({stroke:P,distance:0,lineWidth:3},L)},O):{visible:!1},zIndex:this.labelZIndex,childrenPickable:!1,pickable:!1}}else o.label={visible:!1};return o}},{key:"_filterAxisByPoint",value:function(t,e,i){return t&&t.forEach((function(n){var r,a,o,s=n.axis;if(a=e,o=i,((r=n).x1>a||r.x2<a||r.y1>o||r.y2<o)&&t.delete(s.getSpecIndex()),s.type.startsWith("polarAxis")){var l=s.getCenter(),u=s.getInnerRadius(),c=s.getOuterRadius(),h=ke.distancePP({x:e,y:i},l);(h>c||h<u)&&t.delete(s.getSpecIndex())}})),t}},{key:"_updateCrosshairLabel",value:function(t,e,i){var n=this.getContainer();t?t.setAttributes(e):(t=new rw(e),null==n||n.add(t),i(t)),function(t,e){var i=e.x1,n=e.y1,r=e.x2,a=e.y2,o=t.AABBBounds,s=o.x1,l=o.y1,u=o.x2,c=o.y2,h=t.attribute,d=h.dx,v=void 0===d?0:d,f=h.dy,p=void 0===f?0:f,g=0,y=0;s<i&&(g=i-s),l<n&&(y=n-l),u>r&&(g=r-u),c>a&&(y=a-c),g&&t.setAttribute("dx",g+v),y&&t.setAttribute("dy",y+p)}(t,this._getLimitBounds())}},{key:"clearOutEvent",value:function(){this._timer&&(clearTimeout(this._timer),this._timer=null),this._clickLock&&(this._clickLock=null),this._hasActive&&(this._hasActive=null)}},{key:"_hideByField",value:function(t){var e=this._stateByField[t],i=e.crosshairComp,n=e.labelsComp;i&&i.hideAll(),n&&Object.keys(n).forEach((function(t){n[t]&&n[t].hideAll()}))}},{key:"hide",value:function(){var t=this;Object.keys(this._stateByField).forEach((function(e){t._hideByField(e)}))}},{key:"_getNeedClearVRenderComponents",value:function(){var t=this;return Object.keys(this._stateByField).reduce((function(e,i){var n=t._stateByField[i],r=n.crosshairComp,a=n.labelsComp;return r&&e.push(r),a&&Object.keys(a).forEach((function(t){a[t]&&e.push(a[t])})),e}),[])}}])}(vz);Iq.specKey="crosshair";var Dq={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}}}}},Fq=function(t){function e(t,r){var a;return n(this,e),(a=i(this,e,[t,r])).type=d.cartesianCrosshair,a.name=d.cartesianCrosshair,a._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}}},a}return c(e,t),a(e,[{key:"_findAllAxisContains",value:function(t,e){var i=this._getAxisInfoByField("x"),n=this._getAxisInfoByField("y");return{xAxisMap:this._filterAxisByPoint(i,t,e),yAxisMap:this._filterAxisByPoint(n,t,e)}}},{key:"_getDatumAtPoint",value:function(t,e){var i=aj(t.getOrient())?"x":"y",n=e[i]-(t.getLayoutStartPoint()[i]-this.getLayoutStartPoint()[i]);return t.getScale().invert(n)}},{key:"setAxisValue",value:function(t,e){aj(e.getOrient())?this._stateByField.xField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e}):this._stateByField.yField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e})}},{key:"_layoutCrosshair",value:function(t,e,i,n){var r,a=t,o=e;if(i&&i.length)if("dimension"===n){var s,l=i[0],u=l.data.findIndex((function(t){return t.datum.length>0}));if(u>-1){var c=l.data[u];s=c.series.dataToPosition(c.datum[0])}(C(l.dimType)?"y"===l.dimType:oj(null===(r=null==l?void 0:l.axis)||void 0===r?void 0:r.getOrient()))?o=null==s?void 0:s.y:a=null==s?void 0:s.x}else if("mark"===n){var h=i[0],d=h.series.dataToPosition(h.datum[0]);a=null==d?void 0:d.x,o=null==d?void 0:d.y}this.clearAxisValue();var v=this._findAllAxisContains(a,o),f=v.xAxisMap,p=v.yAxisMap;if(f&&0===f.size||p&&0===p.size){if(this.enableRemain)return;this.hide()}else f&&f.size&&this._setAllAxisValues(f,{x:a,y:o},"xField"),p&&p.size&&this._setAllAxisValues(p,{x:a,y:o},"yField"),this.layoutByValue()}},{key:"layoutByValue",value:function(t){var e=this;if(this.enable){var i=kL(this._regions,"cartesian");i&&(TH(this._stateByField,i,this.getLayoutStartPoint(),null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach((function(t){e._layoutByField(t)})))}}},{key:"_layoutByField",value:function(t){var e=this,i=this._stateByField[t],n=i.cacheInfo,r=i.attributes,a=i.labelsComp,o=i.bandSize,l=i.coordKey;if(r&&n&&(!n._isCache||!this.enableRemain)){var u=n.coord,c=n.labels,h=n.visible,d=n.labelsTextStyle;if(h){var v=BH(this._stateByField[t]);this._updateCrosshairByField(t,v),Object.keys(c).forEach((function(i){var h,v,f;if(c[i].visible){var p=Object.assign(Object.assign(Object.assign(s({},l,u+o/2),c[i]),r.label),{angle:r.label.syncAxisLabelAngle&&null!==(v=null===(h=n.axisLabel)||void 0===h?void 0:h.attribute.angle)&&void 0!==v?v:0,textStyle:Object.assign(Object.assign({},null===(f=r.label)||void 0===f?void 0:f.textStyle),d[i]),zIndex:e.labelZIndex,visible:!0});e._updateCrosshairLabel(a[i],p,(function(e){e.name="crosshair-".concat(t.replace("Field",""),"-").concat(i,"-label"),a[i]=e}))}else a[i]&&a[i].hideAll()}))}else this._hideByField(t)}}},{key:"_updateCrosshairByField",value:function(t,e){var i=this.getContainer(),n=this._stateByField[t].attributes,r=this._stateByField[t].crosshairComp;if(r)r.setAttributes(e);else{var a=n.style;"line"===n.type?r=new Sw(Object.assign(Object.assign({},e),{lineStyle:a,zIndex:this.gridZIndex+1,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1})):"rect"===n.type&&(r=new Aw(Object.assign(Object.assign({},e),{rectStyle:a,zIndex:this.gridZIndex,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1}))),null==i||i.add(r),this._stateByField[t].crosshairComp=r}}}],[{key:"getSpecInfo",value:function(t){return yF(t,this.specKey,this.type,(function(t){return t.xField&&!1!==t.xField.visible||t.yField&&!1!==t.yField.visible}))}}])}(Iq);Fq.specKey="crosshair",Fq.builtInTheme={crosshair:Dq},Fq.type=d.cartesianCrosshair;var jq=function(t){function e(t,r){var a;return n(this,e),(a=i(this,e,[t,r])).type=d.polarCrosshair,a.name=d.polarCrosshair,a._stateByField={categoryField:{coordKey:"angle",anotherAxisKey:"radius",currentValue:new Map,labelsComp:{all:null}},valueField:{coordKey:"radius",anotherAxisKey:"angle",currentValue:new Map,labelsComp:{all:null}}},a}return c(e,t),a(e,[{key:"setAxisValue",value:function(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})}},{key:"_findAllAxisContains",value:function(t,e){var i=this._getAxisInfoByField("category"),n=this._getAxisInfoByField("value");return{angleAxisMap:this._filterAxisByPoint(i,t,e),radiusAxisMap:this._filterAxisByPoint(n,t,e)}}},{key:"_getDatumAtPoint",value:function(t,e){var i=t.getLayoutStartPoint(),n=i.x,r=i.y,a=this.getLayoutStartPoint(),o=a.x,s=a.y;return t.positionToData({x:e.x-(n-o),y:e.y-(r-s)})}},{key:"_layoutCrosshair",value:function(t,e,i,n){var r=t,a=e;if(i&&i.length)if("dimension"===n){var o=i[0];if(o.axis){var s=o.axis.pointToCoord({x:r,y:a}),l="radius"===o.axis.getOrient()?{radius:o.position,angle:s.angle}:{radius:s.radius,angle:o.position},u=o.axis.coordToPoint(l);r=u.x,a=u.y}}else if("mark"===n){var c=i[0],h=c.series.dataToPosition(c.datum[0]);r=h.x,a=h.y}this.clearAxisValue();var d=this._findAllAxisContains(r,a),v=d.angleAxisMap,f=d.radiusAxisMap;if(0!==v.size||0!==f.size)v&&this._setAllAxisValues(v,{x:r,y:a},"categoryField"),f&&this._setAllAxisValues(f,{x:r,y:a},"valueField"),this.layoutByValue();else{if(this.enableRemain)return;this.hide()}}},{key:"layoutByValue",value:function(t){var e=this;if(this.enable){var i=kL(this._regions,"polar");i&&(function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object.keys(t).forEach((function(n){var r=t[n],a=r.attributes,o=r.currentValue,s=r.cacheInfo,l=r.coordKey;if(a){var u=!!o.size,c=i&&!u&&C(s),h=c?s:{coord:0,axis:null,visible:u,coordRange:[0,0],sizeRange:[0,0],labels:{all:{visible:!1,text:"",offset:0}}};if(s&&(s._isCache=c),"valueField"===n&&(h.sides=e.angleAxisHelper.getScale(0).domain().length),o.forEach((function(t){var i,r=t.axis,o=t.datum,s=void 0===o?"":o,l=r.niceLabelFormatter;if((null===(i=a.label)||void 0===i?void 0:i.visible)&&(h.labels.all.visible=!0,h.labels.all.defaultFormatter=l,h.labels.all.text=s,h.labels.all.offset=Vj(r.getSpec())),"categoryField"===n){var u=e.angleAxisHelper.dataToPosition([s]),c=e.angleAxisHelper.getBandwidth(0),d=r.getOuterRadius();h.coord=u,h.coordRange=[u-c/2,u+c/2],h.sizeRange=[d,d]}else{var v=r.startAngle,f=e.radiusAxisHelper.dataToPosition([s]);h.coord=f,h.coordRange=[f,f],h.sizeRange=[v,v]}h.axis=r})),h&&!c&&h.labels.all.visible&&a&&a.label){var d=h.labels.all,v=a.label,f=gF(v.formatMethod,v.formatter,d.text,{label:d.text,orient:l}),p=f.formatFunc,g=f.args;p?d.text=p.apply(void 0,b(g)):d.defaultFormatter&&(d.text=d.defaultFormatter(d.text))}t[n].cacheInfo=h}}))}(this._stateByField,i,null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach((function(t){e._layoutByField(t)})))}}},{key:"_layoutByField",value:function(t){var e,i,n,r=this._stateByField[t],a=r.cacheInfo,o=r.attributes,s=r.crosshairComp,l=r.labelsComp,u=r.coordKey;if(!(!a||a._isCache&&this.enableRemain)){var c=this.getContainer(),h=a.visible,d=a.labels,v=a.coord,f=a.sizeRange,p=a.axis;if(h){var g=this.getLayoutStartPoint(),y=null===(i=null===(e=this._spec.valueField)||void 0===e?void 0:e.line)||void 0===i?void 0:i.smooth,m=function(t,e,i){var n=t.cacheInfo,r=t.coordKey,a=t.attributes,o=n.axis,s=n.coord,l=n.sizeRange,u=n.coordRange,c=o.getCenter(),h={x:c.x+e.x,y:c.y+e.y};if("angle"===r)return"sector"==("rect"===a.type?"sector":"line")?{center:h,innerRadius:o.getInnerRadius(),radius:o.getOuterRadius(),startAngle:u[0],endAngle:u[1]}:{start:we(h,o.getInnerRadius(),s),end:we(h,o.getOuterRadius(),s)};var d=o.startAngle,v=o.endAngle,f=n.sides,p=s;if(!i){var g=o.getCenter(),y=o.coordToPoint({angle:l[0],radius:s}),m=Ce(g,y),_=(v-d)/f,b=Math.floor((m-d)/_),k=b*_+d,x=Math.min((b+1)*_+d,v),S=we(g,s,k),A=we(g,s,x),M=Oe([A.x,A.y],[S.x,S.y],[g.x,g.y],[y.x,y.y]);M&&(p=Lt(ke.distancePN(y,M[0],M[1])+s,o.getInnerRadius(),o.getOuterRadius()))}return{center:h,startAngle:d,endAngle:v,radius:p,sides:f}}(this._stateByField[t],g,y);if(s)s.setAttributes(m);else{var _;if("angle"===u){var b="rect"===o.type?"sector":"line";"line"===b?_=new Sw(Object.assign(Object.assign({},m),{lineStyle:o.style,zIndex:this.gridZIndex,pickable:!1})):"sector"===b&&(_=new ww(Object.assign(Object.assign({},m),{sectorStyle:o.style,zIndex:this.gridZIndex,pickable:!1})))}else _="polygon"==(y?"circle":"polygon")?new Tw(Object.assign(Object.assign({},m),{lineStyle:o.style,zIndex:this.gridZIndex+1})):new Mw(Object.assign(Object.assign({},m),{lineStyle:o.style,zIndex:this.gridZIndex}));this._stateByField[t].crosshairComp=_,c.add(_)}var k=d.all;if(k.visible){var x=p.getCenter(),S={x:x.x+g.x,y:x.y+g.y},A="angle"===u?function(t){return{align:(t=Ee(t))>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"left":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"right":"center",baseline:t>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"bottom":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"top":"middle"}}(v):function(t){return{align:(t=Ee(t))>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"right":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"left":"center",baseline:t>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"bottom":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"top":"middle"}}(p.startAngle),M="angle"===u?we(S,f[1]+k.offset,v):we(S,m.radius,p.startAngle),w=Object.assign(Object.assign(Object.assign(Object.assign({},M),o.label),k),{textStyle:Object.assign(Object.assign({},null===(n=o.label)||void 0===n?void 0:n.textStyle),{textAlign:A.align,textBaseline:A.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(l.all,w,(function(t){t.name="crosshair-".concat(u,"-label"),l.all=t}))}else l.all&&l.all.hideAll()}}}}],[{key:"getSpecInfo",value:function(t){return yF(t,this.specKey,this.type,(function(t){return t.categoryField&&!1!==t.categoryField.visible||t.valueField&&!1!==t.valueField.visible}))}}])}(Iq);jq.specKey="crosshair",jq.builtInTheme={crosshair:Dq},jq.type=d.polarCrosshair;var zq=function(t,e){var i=e.getNewDomain,n=e.isContinuous,r=e.field,a=e.originalFields,o=r(),s=i();if(T(s)||T(o))return t;var l=a(),u=O(o)?o[0]:o;return t[u]&&l&&l[u]&&l[u].lockStatisticsByDomain&&!n()&&(t[u].values=s),t},Hq=function(t,e){var i=e.getNewDomain,n=e.isContinuous,r=(0,e.field)(),a=i();if(T(a)||T(r))return t;if(0===a.length)return[];var o={};a.forEach((function(t){o[t]||(o[t]=1)}));var s=null;return s=n()?function(t){var e=!1;return lt(r).every((function(i){t[i]>=a[0]&&t[i]<=ut(a)&&(e=!0)})),e}:function(t){var e=!1;return lt(r).every((function(i){(o[t[i]+""]||o[t[i]])&&(e=!0)})),e},t.filter(s)},Nq=function(t,e){var i=e.input,n=i.stateFields,r=i.valueFields,a=i.dataCollection,o=i.isCategoryState,l=i.seriesCollection,u=e.output,c=u.stateField,h=u.valueField,d={},v=[],f=[],p=[],g=!1,y=!1;a.forEach((function(t,e){var i;if(!T(n[e])){var a=l[e];if(a){var o=a.getRawDataStatisticsByField(n[e]);C(null==o?void 0:o.max)&&C(null==o?void 0:o.min)&&(y=!0)}var s=null===(i=t.getFields())||void 0===i?void 0:i[n[e]];s&&s.lockStatisticsByDomain&&(g=!0,s.domain.forEach((function(t){T(d[t])&&(p.push(t),d[t]=0,v.push(t))}))),t.latestData.forEach((function(t){lt(n[e]).forEach((function(i){T(t[i])||(T(d[t[i]])&&(p.push(t[i]),d[t[i]]=0,v.push(t[i])),T(r[e])||(d[t[i]]+=isNaN(parseFloat(t[r[e]]))?1:parseFloat(t[r[e]])))}))}))}}));var m=g?p:!1===o||y?p.sort((function(t,e){return t-e})):v;return m.forEach((function(t){var e=s({},c,t);h&&(e[h]=d[t]),f.push(e)})),f},Vq=function(t,e,i){var n=e.domain();if(oE(e.type))return i?n[0]+(ut(n)-n[0])*(1-t):n[0]+(ut(n)-n[0])*t;var r=e.range();i&&(r=r.slice().reverse());var a=r[0]+(ut(r)-r[0])*t;return e.invert(a)},Uq=function(t,e,i){var n=e.scale(t),r=e.range();return!i&&oE(e.type)&&(r=r.slice().reverse()),Math.max(0,Math.min(1,(n-r[0])/(ut(r)-r[0])))},Wq=function(t,e){var i=t;if(!i)return!1;var n=i.getScale();return n.range()[0]>n.range()[1]&&(!i.getInverse()||e)},Gq=function(t){var e=null==t?void 0:t.bandSize,i=null==t?void 0:t.maxBandSize,n=null==t?void 0:t.minBandSize;if(e||n||i)return{bandSize:e,maxBandSize:i,minBandSize:n}},Yq=function(t,e,i){return"start"===t?"percent"===e&&C(i.start)||"value"===e&&C(i.startValue):"percent"===e&&C(i.end)||"value"===e&&C(i.endValue)},Xq=function(t,e,i){if(oE(i.type))return[Math.min(e,t),Math.max(e,t)];var n=i.domain(),r=n.indexOf(t),a=n.indexOf(e);return n.slice(Math.min(r,a),Math.max(r,a)+1)},Kq=function(){function t(e,i,r,a,o,s,l,u){var c=this;n(this,t),this._activeRoam=!0,this._zoomAttr={enable:!0,rate:1,focus:!0},this._dragAttr={enable:!0,rate:1,reverse:!0},this._scrollAttr={enable:!0,rate:1,reverse:!0},this.initZoomEvent=function(){var t,e,i,n,r,a,o,s={delayType:null!==(e=null===(t=c._spec)||void 0===t?void 0:t.delayType)&&void 0!==e?e:"throttle",delayTime:C(null===(i=c._spec)||void 0===i?void 0:i.delayType)?null!==(r=null===(n=c._spec)||void 0===n?void 0:n.delayTime)&&void 0!==r?r:30:0,realTime:null===(o=null===(a=c._spec)||void 0===a?void 0:a.realTime)||void 0===o||o,allowComponentZoom:!0};c._zoomAttr.enable&&c.initZoomEventOfRegions(c.getRegions(),null,c.handleChartZoom,s),c._scrollAttr.enable&&c.initScrollEventOfRegions(c.getRegions(),null,c.handleChartScroll,s),c._dragAttr.enable&&c.initDragEventOfRegions(c.getRegions(),null,c.handleChartDrag,s)},this.handleChartZoom=function(t,e){var i,n;if(c._activeRoam&&(!c._zoomAttr.filter||c._zoomAttr.filter(t,e))){var r=t.zoomDelta,a=t.zoomX,o=t.zoomY,s=c.getRegions()[0].getLayoutStartPoint(),l=s.x,u=s.y,h=c.getRegions()[0].getLayoutRect(),d=h.width,v=h.height,f=Math.abs(c.getState().start-c.getState().end),p=null!==(n=null===(i=c._spec.roamZoom)||void 0===i?void 0:i.rate)&&void 0!==n?n:1;if(!(f>=1&&r<1||f<=.01&&r>1)){var g=c._isHorizontal?a:o,y=f*(r-1)*p,m=y/2,_=y/2;if(g){var b=c._isHorizontal?l:u,k=c._isHorizontal?d:v;m=Math.abs(b-g)/Math.abs(k-b)*y,_=Math.abs(k-g)/Math.abs(k-b)*y}var x=Lt(c.getState().start+m,0,1),S=Lt(c.getState().end-_,0,1);c._handleChange(Math.min(x,S),Math.max(x,S),!0)}}},this.handleChartScroll=function(t,e){var i;if(!c._activeRoam||c._scrollAttr.filter&&!c._scrollAttr.filter(t,e))return!1;var n=t.scrollX,r=t.scrollY,a=c._isHorizontal?n:r,o=c._isHorizontal?re(n/r)>=.5:re(r/n)>=.5;c._scrollAttr.reverse||(a=-a),o&&c.handleChartMove(a,null!==(i=c._scrollAttr.rate)&&void 0!==i?i:1);var s=0!==c.getState().start&&1!==c.getState().end;return o&&s},this.handleChartDrag=function(t,e){var i;if(c._activeRoam&&(!c._dragAttr.filter||c._dragAttr.filter(t,e))){var n=m(t,2),r=n[0],a=n[1],o=c._isHorizontal?r:a;c._dragAttr.reverse&&(o=-o),c.handleChartMove(o,null!==(i=c._dragAttr.rate)&&void 0!==i?i:1)}},this.handleChartMove=function(t,e){var i=c._isHorizontal?c.getLayoutRect().width:c.getLayoutRect().height;if(Math.abs(t)>=1e-6)if(t>0&&c.getState().end<1){var n=Math.min(1-c.getState().end,t/i)*e;c._handleChange(c.getState().start+n,c.getState().end+n,!0)}else if(t<0&&c.getState().start>0){var r=Math.max(-c.getState().start,t/i)*e;c._handleChange(c.getState().start+r,c.getState().end+r,!0)}return!1},this._type=e,this._spec=i,this._handleChange=r,this.getLayoutRect=a,this.getState=o,this.getRegions=s,this._regions=s(),this.getOption=l,this._option=l(),this.getEvent=u,this._isHorizontal="horizontal"===uj(lj(i))}return a(t,[{key:"enableInteraction",value:function(){this._activeRoam=!0}},{key:"disableInteraction",value:function(){this._activeRoam=!1}},{key:"zoomIn",value:function(t){this.handleChartZoom({zoomDelta:1.2,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}},{key:"zoomOut",value:function(t){this.handleChartZoom({zoomDelta:.8,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}},{key:"setEventAttrFromSpec",value:function(){!0===this._spec.roamZoom||this._spec.roamZoom?this._zoomAttr=et({},this._zoomAttr,this._spec.roamZoom):this._zoomAttr.enable=!1,!0===this._spec.roamDrag||this._spec.roamDrag?this._dragAttr=et({},this._dragAttr,this._spec.roamDrag):this._dragAttr.enable=!1,!0===this._spec.roamScroll||this._spec.roamScroll?this._scrollAttr=et({},this._scrollAttr,this._spec.roamScroll):this._scrollAttr.enable=!1,M(this._spec.roam)&&(this._zoomAttr.enable="scrollBar"!==this._type&&this._spec.roam,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.getEvent(),this._option.mode)}}])}();st(Kq,NN);var qq=function(r){function o(t,r){var a;return n(this,o),(a=i(this,o,[t,r])).layoutType="none",a._orient="left",a._cacheVisibility=void 0,a._dataUpdating=!1,a._hasInitStateScale=!1,a._shouldChange=!0,a._stateField="x",a._handleStateChange=function(t,e,i){var n,r;return a._startValue=t,a._endValue=e,a._newDomain=Xq(a._startValue,a._endValue,a._stateScale),null===(r=(n=a.effect).onZoomChange)||void 0===r||r.call(n,i),!0},a.effect={onZoomChange:function(t){var e,i,n=a._relatedAxisComponent;if(n&&"axis"===a._filterMode){var r=n.getScale(),o=n.getSpec();a._auto&&Gq(o)&&a._spec.ignoreBandSize&&(r.bandwidth("auto"),r.maxBandwidth("auto"),r.minBandwidth("auto")),a._updateRangeFactor(t),a._auto&&(null===(i=null===(e=a._component)||void 0===e?void 0:e.setStartAndEnd)||void 0===i||i.call(e,a._start,a._end)),n.effect.scaleUpdate({value:"force"})}else gL(a._regions,(function(t){var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:a._seriesUserId,specIndex:a._seriesIndex}),gL(a._regions,(function(t){t.reFilterViewData()}),{userId:a._seriesUserId,specIndex:a._seriesIndex})}},a._visible=!0,a._orient=lj(t),a._isHorizontal="horizontal"===uj(a._orient),a._dataFilterEvent=new Kq(a.type,a._spec,a._handleChange.bind(e(a)),a.getLayoutRect.bind(e(a)),(function(){return{start:a._start,end:a._end}}),(function(){return a._regions}),function(){return a._option}.bind(e(a)),(function(){return a.event})),a}return c(o,r),a(o,[{key:"isHorizontal",get:function(){return this._isHorizontal}},{key:"stateScale",get:function(){return this._stateScale}},{key:"relatedAxisComponent",get:function(){return this._relatedAxisComponent}},{key:"setStartAndEnd",value:function(t,e){var i=m(arguments.length>2&&void 0!==arguments[2]?arguments[2]:["percent","percent"],2),n=i[0],r=void 0===n?"percent":n,a=i[1],o=void 0===a?"percent":a,s="percent"===r?t:Uq(t,this._stateScale,this._isHorizontal),l="percent"===o?e:Uq(e,this._stateScale,this._isHorizontal);this._handleChange(s,l,!0)}},{key:"enableInteraction",value:function(){this._dataFilterEvent.enableInteraction()}},{key:"disableInteraction",value:function(){this._dataFilterEvent.disableInteraction()}},{key:"zoomIn",value:function(t){this._dataFilterEvent.zoomIn(t)}},{key:"zoomOut",value:function(t){this._dataFilterEvent.zoomOut(t)}},{key:"_initEvent",value:function(){var e;this._dataFilterEvent.initZoomEvent(),null===(e=this._relatedAxisComponent)||void 0===e||e.event.on(t.ChartEvent.scaleRawDomainUpdate,(function(t){var e=t.model;console.log("scaleRawDomainUpdate",e.getRawDomain())}))}},{key:"_handleChange",value:function(t,e,i){var n,r;null!==(r=null===(n=this._spec)||void 0===n?void 0:n.zoomLock)&&void 0!==r&&r||e-t!==this._spanCache&&(e-t<this._minSpan||e-t>this._maxSpan)?this._shouldChange=!1:(this._shouldChange=!0,this._spanCache=e-t)}},{key:"_updateRangeFactor",value:function(t){var e=this._relatedAxisComponent,i=e.getScale(),n=Wq(e,this._isHorizontal),r=n?[1-this._end,1-this._start]:[this._start,this._end];if(n)switch(t){case"startHandler":e.scaleRangeFactorEnd(r[1]);break;case"endHandler":e.scaleRangeFactorStart(r[0]);break;default:e.scaleRangeFactorStart(r[0],!0),e.scaleRangeFactorEnd(r[1])}else switch(t){case"startHandler":e.scaleRangeFactorStart(r[0]);break;case"endHandler":e.scaleRangeFactorEnd(r[1]);break;default:e.scaleRangeFactorEnd(r[1],!0),e.scaleRangeFactorStart(r[0])}var a=i.rangeFactor();a?(this._start=n?1-a[1]:a[0],this._end=n?1-a[0]:a[1]):(this._start=0,this._end=1)}},{key:"visible",get:function(){return this._visible}},{key:"created",value:function(){_(o,"created",this,3)([]),this._setAxisFromSpec(),this._setRegionsFromSpec(),this._initEvent(),this._initData(),this._initStateScale(),this._setStateFromSpec()}},{key:"initLayout",value:function(){_(o,"initLayout",this,3)([]),this._layout&&(this._layout.layoutOrient=this._orient)}},{key:"init",value:function(t){_(o,"init",this,3)([t]),this._addTransformToSeries(),0===this._start&&1===this._end||this.effect.onZoomChange()}},{key:"_compareSpec",value:function(t,e){var i=_(o,"_compareSpec",this,3)([t,e]);return i.reMake||at(e,t)||(i.reRender=!0,i.reMake=!0),i}},{key:"reInit",value:function(t){var e=this;_(o,"reInit",this,3)([t]),this._marks.forEach((function(t){t.getMarks().forEach((function(t){e.initMarkStyleWithSpec(t,e._spec[t.name])}))}))}},{key:"onLayoutStart",value:function(t,e){_(o,"onLayoutStart",this,3)([t,e]);var i=this._autoUpdate(t);this._autoVisible(i),this._dataUpdating=!1}},{key:"updateLayoutAttribute",value:function(){this._visible&&this._createOrUpdateComponent(),this._hasInitStateScale||(0===this._start&&1===this._end||(this._newDomain=function(t,e,i,n,r){if(oE(r.type)){var a=r.domain(),o=a[0],s=ut(a)-o,l=C(t)?o+s*t:+e,u=C(i)?o+s*i:+n;return[Math.min(u,l),Math.max(u,l)]}var c=r.domain(),h=r.range(),d=h[h.length-1]-h[0],v=C(t)?c.indexOf(r.invert(d*t+h[0])):c.indexOf(e),f=C(i)?c.indexOf(r.invert(d*i+h[0])):c.indexOf(n);return c.slice(Math.min(v,f),Math.max(v,f)+1)}(this._spec.start,this._startValue,this._spec.end,this._endValue,this._stateScale),this.effect.onZoomChange()),this._hasInitStateScale=!0)}},{key:"_initAfterLayout",value:function(){this._stateScale=null,this._initStateScale(),this._updateScaleRange(),this._setStateFromAxis()}},{key:"_beforeLayoutEnd",value:function(){this._hasInitStateScale?this._updateScaleRange():this._initAfterLayout()}},{key:"onLayoutEnd",value:function(){var t;this._beforeLayoutEnd();var e=!(0===this._start&&1===this._end);this._autoVisible(e),_(o,"onLayoutEnd",this,3)([]),null===(t=this._relatedAxisComponent)||void 0===t||t.updateScaleRange()}},{key:"getBoundsInRect",value:function(t){var 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}},{key:"setAttrFromSpec",value:function(){var t;_(o,"setAttrFromSpec",this,3)([]),this._dataFilterEvent.setEventAttrFromSpec(),this._field=this._spec.field,this._width=this._computeWidth(),this._height=this._computeHeight(),this._visible=null===(t=this._spec.visible)||void 0===t||t}},{key:"_setAxisFromSpec",value:function(){var t=this;if(C(this._spec.axisId)?this._relatedAxisComponent=this._option.getComponentByUserId(this._spec.axisId):C(this._spec.axisIndex)&&(this._relatedAxisComponent=this._option.getComponentByIndex("axes",this._spec.axisIndex)),T(this._spec.field)&&!this._relatedAxisComponent){var e=this._option.getComponentsByKey("axes"),i=e.find((function(e){return uj(e._orient)===uj(t._orient)}));if(i)this._relatedAxisComponent=i;else{var n=e.find((function(t){return!oE(t.getScale().type)}));this._relatedAxisComponent=n}}this._relatedAxisComponent&&"axis"===this._filterMode&&(this._relatedAxisComponent.autoIndentOnce=!0)}},{key:"_setRegionsFromSpec",value:function(){var t,e;this._regions=this._relatedAxisComponent?this._relatedAxisComponent.getRegions():this._option.getAllRegions();var i=this._relatedAxisComponent?null===(e=(t=this._relatedAxisComponent).getBindSeriesFilter)||void 0===e?void 0:e.call(t):null;if(C(i)&&(C(i.userId)&&(this._seriesUserId=lt(i.userId)),C(i.specIndex)&&(this._seriesIndex=lt(i.specIndex))),C(this._spec.seriesId)){var n=lt(this._spec.seriesId);this._seriesUserId?this._seriesUserId=this._seriesUserId.filter((function(t){return n.includes(t)})):this._seriesUserId=n}if(C(this._spec.seriesIndex)){var r=lt(this._spec.seriesIndex);this._seriesIndex?this._seriesIndex=this._seriesIndex.filter((function(t){return r.includes(t)})):this._seriesIndex=r}if(C(this._spec.regionIndex)){var a=this._option.getRegionsInIndex(lt(this._spec.regionIndex));this._regions=this._regions.filter((function(t){return a.includes(t)}))}else if(C(this._spec.regionId)){var o=lt(this._spec.regionId);this._regions=o.length?this._regions.filter((function(t){return o.includes(t.id)})):[]}}},{key:"_initData",value:function(){var t,e=this,i=[],n=[],r=[],a=[];if(this._relatedAxisComponent){var o={};gL(this._regions,(function(n){var s,l,u="cartesian"===n.coordinate?n.getXAxisHelper():"polar"===n.coordinate?n.angleAxisHelper:null,c="cartesian"===n.coordinate?n.getYAxisHelper():"polar"===n.coordinate?n.radiusAxisHelper:null;if(u&&c){var h=u.getAxisId()===e._relatedAxisComponent.id?u:c.getAxisId()===e._relatedAxisComponent.id?c:e._isHorizontal?u:c,d=h===u?c:u,v=oE(d.getScale(0).type),f=oE(h.getScale(0).type);i.push(n.getRawData());var p=n.getSpec(),g="cartesian"===n.coordinate?lt(p.xField):lt(null!==(s=p.angleField)&&void 0!==s?s:p.categoryField),y="cartesian"===n.coordinate?lt(p.yField):lt(null!==(l=p.radiusField)&&void 0!==l?l:p.valueField);if(o[n.id]="link"===n.type?["from_xField"]:h===u?g:y,f?(t=!1,r.push(o[n.id])):(t=!0,r.push(o[n.id][0])),e._valueField){var m="link"===n.type?["from_yField"]:d===u?g:y;v&&a.push.apply(a,b(m))}}}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._originalStateFields=o}else gL(this._regions,(function(t){i.push(t.getRawData()),n.push(t),r.push(e._field),e._valueField&&a.push(e._spec.valueField)}),{userId:this._seriesUserId,specIndex:this._seriesIndex});var s=this._option.dataSet;BI(s,"dataview",Uo),EI(s,"dataFilterComputeDomain",Nq);var l=new Xo(s,{name:"".concat(this.type,"_").concat(this.id,"_data")});l.transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:i,seriesCollection:n,stateFields:r,valueFields:a,isCategoryState:t},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data=new ID(this._option,l),l.reRunAllTransform(),s.multipleDataViewAddListener(i,"change",this._handleDataCollectionChange.bind(this))}},{key:"_addTransformToSeries",value:function(){var e=this;this._relatedAxisComponent&&"axis"===this._filterMode||(EI(this._option.dataSet,"dataFilterWithNewDomain",Hq),EI(this._option.dataSet,"lockStatisticsFilter",zq),gL(this._regions,(function(i){i.getViewDataStatistics().transform({type:"lockStatisticsFilter",options:{originalFields:function(){return i.getViewDataStatistics().getFields()},getNewDomain:function(){return e._newDomain},field:function(){var t;return null!==(t=e._field)&&void 0!==t?t:e._parseFieldOfSeries(i)},isContinuous:function(){return oE(e._stateScale.type)}},level:1},!1),i.addViewDataFilter({type:"dataFilterWithNewDomain",options:{getNewDomain:function(){return e._newDomain},field:function(){var t;return null!==(t=e._field)&&void 0!==t?t:e._parseFieldOfSeries(i)},isContinuous:function(){return oE(e._stateScale.type)}},level:t.TransformLevel.dataZoomFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex}))}},{key:"onDataUpdate",value:function(){var t,e=this._computeDomainOfStateScale(oE(this._stateScale.type));this._stateScale.domain(e,!1),this._handleChange(this._start,this._end,!0),this._spec.auto&&!at(this._domainCache,e)&&(this._domainCache=e,this._dataUpdating=!0,null===(t=this.getChart())||void 0===t||t.setLayoutTag(!0,null,!1))}},{key:"_parseFieldOfSeries",value:function(t){var e;return null===(e=this._originalStateFields)||void 0===e?void 0:e[t.id]}},{key:"_setStateFromSpec",value:function(){var t,e;if(this._auto=!!this._spec.auto,this._spec.rangeMode){var i=m(this._spec.rangeMode,2),n=i[0],r=i[1];Yq("start",n,this._spec)&&Yq("end",r,this._spec)&&(t="percent"===n?this._spec.start:Uq(this._spec.startValue,this._stateScale,this._isHorizontal),e="percent"===r?this._spec.end:Uq(this._spec.endValue,this._stateScale,this._isHorizontal))}else t=this._spec.start?this._spec.start:this._spec.startValue?Uq(this._spec.startValue,this._stateScale,this._isHorizontal):0,e=this._spec.end?this._spec.end:this._spec.endValue?Uq(this._spec.endValue,this._stateScale,this._isHorizontal):1;this._start=Math.max(0,Math.min(1,t)),this._end=Math.max(0,Math.min(1,e))}},{key:"_setStateFromAxis",value:function(){var t,e;this._setStateFromSpec();var i=this._relatedAxisComponent;this._startValue=Vq(this._start,this._stateScale,Wq(i,this._isHorizontal)),this._endValue=Vq(this._end,this._stateScale,Wq(i,this._isHorizontal)),this._minSpan=null!==(t=this._spec.minSpan)&&void 0!==t?t:0,this._maxSpan=null!==(e=this._spec.maxSpan)&&void 0!==e?e:1,oE(this._stateScale.type)&&this._stateScale.domain()[0]!==ut(this._stateScale.domain())&&(this._spec.minValueSpan&&(this._minSpan=this._spec.minValueSpan/(ut(this._stateScale.domain())-this._stateScale.domain()[0])),this._spec.maxValueSpan&&(this._maxSpan=this._spec.maxValueSpan/(ut(this._stateScale.domain())-this._stateScale.domain()[0]))),this._minSpan=Math.max(0,this._minSpan),this._maxSpan=Math.min(this._maxSpan,1),i&&(i&&"axis"===this._filterMode||0===this._start&&1===this._end||(this._newDomain=Xq(this._startValue,this._endValue,this._stateScale)))}},{key:"_initStateScale",value:function(){var t,e,i,n,r,a,o=this,s=[0,1];if(this._relatedAxisComponent){var l=this._relatedAxisComponent.getScale().clone();this._stateScale=l,null===(e=(t=l).maxBandwidth)||void 0===e||e.call(t,"auto",!0),null===(n=(i=l).minBandwidth)||void 0===n||n.call(i,"auto",!0),null===(a=(r=l).bandwidth)||void 0===a||a.call(r,"auto",!0),l.rangeFactor(s,!0).range(s)}else{var u=!0;this._field&&gL(this._regions,(function(t){var e=t.getRawDataStatisticsByField(o._field);z(null==e?void 0:e.min)&&z(null==e?void 0:e.max)||(u=!1)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._stateScale=u?new ZE:new EE,this._stateScale.domain(this._computeDomainOfStateScale(u),!0).range(s)}}},{key:"_computeDomainOfStateScale",value:function(t){var e=this;if(this._spec.customDomain)return this._spec.customDomain;var i=this._data.getLatestData().map((function(t){return t[e._stateField]}));if(t){var n=i.map((function(t){return 1*t}));return i.length?[ht(n),ct(n)]:[-1/0,1/0]}return i}},{key:"_autoVisible",value:function(e){if(this._auto){e?this.show():this.hide();var i=this._isHorizontal?"height":"width";this.layout.setLayoutRect(s({},i,e?this["_".concat(i)]:0),s({},i,t.AttributeLevel.Built_In))}}},{key:"hide",value:function(){var t;null===(t=this._component)||void 0===t||t.hideAll()}},{key:"show",value:function(){var t;null===(t=this._component)||void 0===t||t.showAll()}},{key:"_autoUpdate",value:function(t){var e,i,n,r,a,o;if(!this._auto)return this._cacheVisibility=void 0,!0;var s=this._relatedAxisComponent,l=null==s?void 0:s.getSpec(),u=null==s?void 0:s.getScale(),c=Gq(l);if(!this._dataUpdating&&lE(u.type)&&(null==t?void 0:t.height)===(null===(e=this._cacheRect)||void 0===e?void 0:e.height)&&(null==t?void 0:t.width)===(null===(i=this._cacheRect)||void 0===i?void 0:i.width)&&this._fixedBandSize===(null==c?void 0:c.bandSize))return this._cacheVisibility;var h=!0;if(this._isHorizontal&&(null==t?void 0:t.width)!==(null===(n=this._cacheRect)||void 0===n?void 0:n.width)?u.range(s.getInverse()?[t.width,0]:[0,t.width]):(null==t?void 0:t.height)!==(null===(r=this._cacheRect)||void 0===r?void 0:r.height)&&u.range(s.getInverse()?[0,t.height]:[t.height,0]),this._cacheRect={width:null==t?void 0:t.width,height:null==t?void 0:t.height},this._fixedBandSize=null==c?void 0:c.bandSize,lE(u.type)){c&&(this._start||this._end)&&(this.type===d.scrollBar&&(this._start=0,this._end=1),this._updateRangeFactor());var v=m(null!==(a=u.rangeFactor())&&void 0!==a?a:[],2),f=v[0],p=v[1];h=!(T(f)&&T(p)||0===f&&1===p)}else{var g=m(null!==(o=u.rangeFactor())&&void 0!==o?o:[this._start,this._end],2),y=g[0],_=g[1];h=!(0===y&&1===_)}return this.setStartAndEnd(this._start,this._end),this._cacheVisibility=h,h}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._component]}}])}(vz);st(qq,NN);var Zq=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_mergeThemeToSpec",value:function(t,e){var i=this,n=this._theme,r=t;if(this._shouldMergeThemeToSpec()){var a=function(t){var e=nO({selectedBackgroundChart:{line:{},area:{}}},i._theme,t),n=t.selectedBackgroundChart,r=void 0===n?{}:n,a=r.line,o=r.area;return a&&!1!==a.visible&&(e.selectedBackgroundChart.line.style=Object.assign(Object.assign({},e.selectedBackgroundChart.line.style),{visible:!0})),o&&!1!==o.visible&&(e.selectedBackgroundChart.area.style=Object.assign(Object.assign({},e.selectedBackgroundChart.area.style),{visible:!0})),e},o=t;r=O(o)?o.map((function(t){return a(t)})):a(o)}return this._adjustPadding(r),{spec:r,theme:n}}}])}(dz),Jq=function(t){return{area:{style:{visible:t,stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{visible:t,stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}}},Qq={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:Jq(!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:Jq(!0)},$q=function(e){function r(e,a){var o,s;return n(this,r),(o=i(this,r,[e,a])).type=d.dataZoom,o.name=d.dataZoom,o.transformerConstructor=Zq,o.specKey="dataZoom",o.layoutZIndex=t.LayoutZIndex.DataZoom,o.layoutLevel=t.LayoutLevel.DataZoom,o.layoutType="region-relative",o._isReverseCache=!1,o._dataToPositionX=function(t){var e=o._isHorizontal?0:o._middleHandlerSize,i=o._isHorizontal?o._startHandlerSize/2:0,n=o._isHorizontal?o._stateScale:o._valueScale,r=o._isHorizontal?o._stateField:o._valueField;return n.scale(t[r])+o.getLayoutStartPoint().x+e+i},o._dataToPositionX2=function(t){var e=o._isHorizontal?0:o._middleHandlerSize,i=o._isHorizontal?o._startHandlerSize/2:0,n=o._isHorizontal?o._stateScale:o._valueScale,r=n.domain()[0];return n.scale(r)+o.getLayoutStartPoint().x+e+i},o._dataToPositionY=function(t){var e=o._isHorizontal?o._middleHandlerSize:0,i=o._isHorizontal?0:o._startHandlerSize/2,n=o._isHorizontal?o._valueScale:o._getPreviewStateScale(),r=o._isHorizontal?o._valueField:o._stateField;return n.scale(t[r])+o.getLayoutStartPoint().y+e+i},o._dataToPositionY2=function(t){var e=o._isHorizontal?o._middleHandlerSize:0,i=o._isHorizontal?0:o._startHandlerSize/2,n=o._isHorizontal?o._valueScale:o._getPreviewStateScale(),r=n.domain()[0];return n.scale(r)+o.getLayoutStartPoint().y+e+i},o._valueField="y",o._filterMode=null!==(s=e.filterMode)&&void 0!==s?s:"filter",o}return c(r,e),a(r,[{key:"_handleChange",value:function(e,i,n,a){if(_(r,"_handleChange",this,3)([e,i,n]),this._shouldChange)if(n&&this._component)this._component.setStartAndEnd(e,i);else{var o=this._relatedAxisComponent,s=Vq(e,this._stateScale,Wq(o,this._isHorizontal)),l=Vq(i,this._stateScale,Wq(o,this._isHorizontal));if(!C(s)||!C(l))return;this._start=e,this._end=i,(w(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(e,i,s,l):this._handleStateChange(s,l,a))&&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}})}}},{key:"_handleDataCollectionChange",value:function(){this._data.getDataView().reRunAllTransform();var t=this._computeDomainOfValueScale();t&&(this._valueScale||(this._valueScale=new ZE),this._valueScale.domain(t),this._updateValueScaleRange(),this._component&&this._createOrUpdateComponent(!0))}},{key:"created",value:function(){_(r,"created",this,3)([]),this._initValueScale()}},{key:"updateLayoutAttribute",value:function(){!1!==this._cacheVisibility&&_(r,"updateLayoutAttribute",this,3)([])}},{key:"_beforeLayoutEnd",value:function(){_(r,"_beforeLayoutEnd",this,3)([]);var t=this._relatedAxisComponent;(Wq(t,this._isHorizontal)&&!this._isReverseCache||this._auto)&&(this._isReverseCache=Wq(t,this._isHorizontal),this.effect.onZoomChange())}},{key:"clear",value:function(){if(this._component){var t=this.getContainer();this._component.removeAllChild(),t&&t.removeChild(this._component),this._component=null}_(r,"clear",this,3)([])}},{key:"getBoundsInRect",value:function(t){var e,i,n,r,a={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},o=this._startHandlerSize*(null!==(e=this._spec.startHandler.style.scaleX)&&void 0!==e?e:1),s=this._startHandlerSize*(null!==(i=this._spec.startHandler.style.scaleY)&&void 0!==i?i:1),l=this._endHandlerSize*(null!==(n=this._spec.endHandler.style.scaleX)&&void 0!==n?n:1),u=this._endHandlerSize*(null!==(r=this._spec.endHandler.style.scaleY)&&void 0!==r?r:1),c=this._visible?this._isHorizontal?(o-this._startHandlerSize)/2+(l-this._endHandlerSize)/2:(Math.max(o,l)-this._width)/2:0,h=this._visible?this._isHorizontal?(Math.max(s,u)-this._height)/2:(s-this._startHandlerSize)/2+(u-this._endHandlerSize)/2:0;return this._isHorizontal?(a.y2=a.y1+this._height+h,a.x2=a.x1+t.width+c):(a.x2=a.x1+this._width+c,a.y2=a.y1+t.height+h),a}},{key:"setAttrFromSpec",value:function(){var t,e,i,n,a,o,s,l,u,c;_(r,"setAttrFromSpec",this,3)([]);var h=this._isHorizontal?Number(this._spec.height):Number(this._spec.width);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(),T(null===(a=null===(n=null===(i=this._spec)||void 0===i?void 0:i.startHandler)||void 0===n?void 0:n.style)||void 0===a?void 0:a.size)&&(this._spec.startHandler.style.size=isNaN(h)?this._backgroundSize:h-this._middleHandlerSize),T(null===(l=null===(s=null===(o=this._spec)||void 0===o?void 0:o.endHandler)||void 0===s?void 0:s.style)||void 0===l?void 0:l.size)&&(this._spec.endHandler.style.size=isNaN(h)?this._backgroundSize:h-this._middleHandlerSize);var d=null===(u=this._spec.startHandler.style.visible)||void 0===u||u,v=null===(c=this._spec.endHandler.style.visible)||void 0===c||c;this._startHandlerSize=d?this._spec.startHandler.style.size:0,this._endHandlerSize=v?this._spec.endHandler.style.size:0,this._width=this._computeWidth(),this._height=this._computeHeight()}},{key:"_initValueScale",value:function(){var t=this._computeDomainOfValueScale();if(t){var e=new ZE;e.domain(t),this._valueScale=e}}},{key:"_updateScaleRange",value:function(){this._updateStateScaleRange(),this._updateValueScaleRange()}},{key:"_updateStateScaleRange",value:function(){var t,e,i,n=this._startHandlerSize+this._endHandlerSize;if(this._stateScale){var r,a=this._isHorizontal?this.getLayoutRect().width-n:this.getLayoutRect().height-n,o=null!==(e=null===(t=this._relatedAxisComponent)||void 0===t?void 0:t.getScale().range())&&void 0!==e?e:[this._startHandlerSize/2,a+this._startHandlerSize/2],s=this._computeWidth(),l=this._computeHeight();r=this._isHorizontal?this._visible?[this._startHandlerSize/2,s-n+this._startHandlerSize/2]:o:this._visible?[this._startHandlerSize/2,l-n+this._startHandlerSize/2]:o,this._stateScale.range(r),null===(i=this._previewStateScale)||void 0===i||i.range(Wq(this._relatedAxisComponent,this._isHorizontal)?r.reverse():r)}}},{key:"_updateValueScaleRange",value:function(){if(this._valueScale){var t=this._computeWidth(),e=this._computeHeight();this._isHorizontal?this._valueScale.range([e-this._middleHandlerSize,0]):"left"===this.layoutOrient?this._valueScale.range([t-this._middleHandlerSize,0]):this._valueScale.range([0,t-this._middleHandlerSize])}}},{key:"_computeDomainOfValueScale",value:function(){var t=this,e=this._data.getLatestData().map((function(e){return e[t._valueField]})),i=e.map((function(t){return 1*t}));return e.length?[ht(i),ct(i)]:null}},{key:"_isScaleValid",value:function(t){if(!t||!t.domain())return!1;var e,i=t.domain();return!(oE(t.type)&&i[0]===ut(i)||lE(t.type)&&1===(e=i,e&&O(e)?Array.from(new Set(lt(e))):e).length)}},{key:"_getXScale",value:function(){return this._relatedAxisComponent.getScale().type===this.stateScale.type&&this._isHorizontal?this.stateScale:this._isHorizontal?this._stateScale:this._valueScale}},{key:"_getYScale",value:function(){return this._isHorizontal?this._valueScale:this._stateScale}},{key:"_computeMiddleHandlerSize",value:function(){var t,e,i,n,r=0;if(null===(e=null===(t=this._spec)||void 0===t?void 0:t.middleHandler)||void 0===e?void 0:e.visible){var a=null!==(i=this._spec.middleHandler.icon.style.size)&&void 0!==i?i:8,o=null!==(n=this._spec.middleHandler.background.size)&&void 0!==n?n:40;r+=Math.max(a,o)}return r}},{key:"_computeWidth",value:function(){return!1===this._visible?0:F(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:Math.max(this._startHandlerSize||0,this._endHandlerSize||0,this._backgroundSize||0)+this._middleHandlerSize}},{key:"_computeHeight",value:function(){return!1===this._visible?0:F(this._spec.height)?this._spec.height:this._isHorizontal?Math.max(this._startHandlerSize||0,this._endHandlerSize||0,this._backgroundSize||0)+this._middleHandlerSize:this.getLayoutRect().height}},{key:"_getAttrs",value:function(t){var e,i,n,r,a,o=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:o.showDetail,brushSelect:null!==(i=o.brushSelect)&&void 0!==i&&i,zoomLock:null!==(n=o.zoomLock)&&void 0!==n&&n,minSpan:this._minSpan,maxSpan:this._maxSpan,delayType:o.delayType,delayTime:C(o.delayType)?null!==(r=o.delayTime)&&void 0!==r?r:30:0,realTime:null===(a=o.realTime)||void 0===a||a,previewData:t&&this._data.getLatestData(),previewPointsX:t&&this._dataToPositionX,previewPointsY:t&&this._dataToPositionY,tolerance:this._spec.tolerance,isReverse:Wq(this._relatedAxisComponent,this._isHorizontal)},this._getComponentAttrs(t))}},{key:"_getLayoutAttrs",value:function(){return{position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y},size:{width:this._computeWidth(),height:this._computeHeight()}}}},{key:"_createOrUpdateComponent",value:function(t){var e=this;if(this._visible){var i=this._isHorizontal?this._stateScale:this._valueScale,n=this._isHorizontal?this._valueScale:this._stateScale,r=this._isScaleValid(i)&&this._isScaleValid(n)&&!1!==this._spec.showBackgroundChart,a=this._getAttrs(r),o=this._relatedAxisComponent;if(this._component)this._component.setAttributes(a),t&&(this._component.setPreviewData(this._data.getDataView().latestData),r&&(this._isHorizontal?this._component.setPreviewPointsY1(this._dataToPositionY2):this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((function(t){return Vq(t,e._stateScale,Wq(o,e._isHorizontal))}))));else{var s=this.getContainer();this._component=new xP(a),this._component.setPreviewData(this._data.getDataView().latestData),this._isHorizontal?r&&this._component.setPreviewPointsY1(this._dataToPositionY2):r&&this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((function(t){return Vq(t,e._stateScale,Wq(o,e._isHorizontal))})),this._component.addEventListener("dataZoomChange",(function(t){var i=t.detail,n=i.start,r=i.end,a=i.tag;e._handleChange(n,r,void 0,a)})),s.add(this._component)}}}},{key:"_getComponentAttrs",value:function(t){var e,i,n,r,a,o,s,l,u,c,h,d=this._spec,v=d.middleHandler,f=void 0===v?{}:v,p=d.startText,g=void 0===p?{}:p,y=d.endText,m=void 0===y?{}:y,_=d.backgroundChart,b=void 0===_?{}:_,k=d.selectedBackgroundChart,x=void 0===k?{}:k;return{backgroundStyle:pI(null===(e=this._spec.background)||void 0===e?void 0:e.style),startHandlerStyle:pI(null===(i=this._spec.startHandler)||void 0===i?void 0:i.style),middleHandlerStyle:f.visible?{visible:!0,icon:pI(null===(n=f.icon)||void 0===n?void 0:n.style),background:{size:null===(r=f.background)||void 0===r?void 0:r.size,style:pI(null===(a=f.background)||void 0===a?void 0:a.style)}}:{visible:!1},endHandlerStyle:pI(null===(o=this._spec.endHandler)||void 0===o?void 0:o.style),startTextStyle:{padding:g.padding,formatMethod:this._getHandlerTextFormatMethod(g),textStyle:pI(g.style)},endTextStyle:{padding:m.padding,formatMethod:this._getHandlerTextFormatMethod(m),textStyle:pI(m.style)},selectedBackgroundStyle:pI(this._spec.selectedBackground.style),dragMaskStyle:pI(null===(s=this._spec.dragMask)||void 0===s?void 0:s.style),backgroundChartStyle:t?{line:nO(pI(null===(l=b.line)||void 0===l?void 0:l.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},pI(null===(u=b.area)||void 0===u?void 0:u.style))}:{line:{visible:!1},area:{visible:!1}},selectedBackgroundChartStyle:t?{line:nO(pI(null===(c=x.line)||void 0===c?void 0:c.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},pI(null===(h=x.area)||void 0===h?void 0:h.style))}:{line:{visible:!1},area:{visible:!1}},disableTriggerEvent:this._option.disableTriggerEvent}}},{key:"_getHandlerTextFormatMethod",value:function(t){var e=t.formatMethod,i=t.formatter,n=gF(e,i).formatFunc;return n?function(t){return n(t,{label:t},i)}:void 0}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._component]}},{key:"onDataUpdate",value:function(){_(r,"onDataUpdate",this,3)([]),this._previewStateScale!==this._stateScale&&(this._previewStateScale=null)}},{key:"_getPreviewStateScale",value:function(){return this._previewStateScale||(Wq(this._relatedAxisComponent,this._isHorizontal)?(this._previewStateScale=this._stateScale.clone(),this._previewStateScale.range(this._stateScale.range().reverse())):this._previewStateScale=this._stateScale),this._previewStateScale}}])}(qq);$q.type=d.dataZoom,$q.transformerConstructor=Zq,$q.builtInTheme={dataZoom:Qq},$q.specKey="dataZoom";var tZ={horizontal:{height:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}},vertical:{width:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}}},eZ=function(e){function r(e,a){var o,s;return n(this,r),(o=i(this,r,[e,a])).type=d.scrollBar,o.name=d.scrollBar,o.specKey="scrollBar",o.layoutZIndex=t.LayoutZIndex.DataZoom,o.layoutLevel=t.LayoutLevel.DataZoom,o.layoutType="region-relative",o._filterMode=null!==(s=e.filterMode)&&void 0!==s?s:"axis",o}return c(r,e),a(r,[{key:"_handleChange",value:function(e,i,n){_(r,"_handleChange",this,3)([e,i,n]);var a=sL(this._start,e)&&sL(this._end,i);if(this._shouldChange&&(!a||!1===this._spec.realTime)){n&&this._component&&this._component.setAttribute("range",[e,i]),this._start=e,this._end=i;var o=Vq(e,this._stateScale,!1),s=Vq(i,this._stateScale,!1);(w(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(e,i,o,s):this._handleStateChange(o,s))&&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}})}}},{key:"_handleDataCollectionChange",value:function(){this._spec.auto&&this._data.getDataView().reRunAllTransform()}},{key:"_beforeLayoutEnd",value:function(){var t,e;_(r,"_beforeLayoutEnd",this,3)([]),null===(e=(t=this.effect).onZoomChange)||void 0===e||e.call(t)}},{key:"onLayoutEnd",value:function(){this._updateComponentBounds(),_(r,"onLayoutEnd",this,3)([])}},{key:"_updateScaleRange",value:function(){}},{key:"_updateComponentBounds",value:function(){this._component&&this._component.setAttributes({x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height})}},{key:"_computeWidth",value:function(){return!1===this._visible?0:F(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:12}},{key:"_computeHeight",value:function(){return!1===this._visible?0:F(this._spec.height)?this._spec.height:this._isHorizontal?12:this.getLayoutRect().height}},{key:"_getAttrs",value:function(){var t,e,i,n,r,a;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:C(null===(e=this._spec)||void 0===e?void 0:e.delayType)?null!==(n=null===(i=this._spec)||void 0===i?void 0:i.delayTime)&&void 0!==n?n:30:0,realTime:null===(a=null===(r=this._spec)||void 0===r?void 0:r.realTime)||void 0===a||a},this._getComponentAttrs())}},{key:"_createOrUpdateComponent",value:function(){var t=this,e=this._getAttrs();if(this._component)this._component.setAttributes(e);else{var i=this.getContainer();this._component=new CM(e),this._component.addEventListener("scrollDrag",(function(e){var i=e.detail.value;t._handleChange(i[0],i[1])})),this._component.addEventListener("scrollUp",(function(e){var i=e.detail.value;t._handleChange(i[0],i[1])})),i.add(this._component)}}},{key:"_getComponentAttrs",value:function(){var t=this._spec,e=t.rail,i=t.slider,n=t.innerPadding,r={};return T(n)||(r.padding=n),Y(null==e?void 0:e.style)||(r.railStyle=pI(e.style)),Y(null==i?void 0:i.style)||(r.sliderStyle=pI(i.style)),r.disableTriggerEvent=this._option.disableTriggerEvent,r}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._component]}}])}(qq);eZ.type=d.scrollBar,eZ.builtInTheme={scrollBar:tZ},eZ.specKey="scrollBar";var iZ=function(t,e){var i=e.datum,n=e.title,r=e.content,a=[],o=i.call(null);return n.visible&&a.push({type:"title",index:0,datum:o,spec:n}),lt(r).forEach((function(t,e){t.visible&&a.push({type:"content",index:e,datum:o,spec:t})})),a},nZ=function(t,e){return{fontSize:{type:"token",key:t},fill:{type:"palette",key:e},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},rZ={title:{visible:!0,autoLimit:!1,autoFit:!1,style:nZ("l1FontSize","primaryFontColor")},content:{visible:!0,style:nZ("l2FontSize","tertiaryFontColor")}},aZ=function(e){function o(){var e;return n(this,o),(e=i(this,o,arguments)).type=d.indicator,e.name=d.indicator,e.specKey="indicator",e.layoutType="none",e.layoutZIndex=t.LayoutZIndex.Indicator,e.layoutLevel=t.LayoutLevel.Indicator,e._gap=0,e._activeDatum=null,e}return c(o,e),a(o,[{key:"created",value:function(){_(o,"created",this,3)([]),this.initData(),this.initEvent()}},{key:"setAttrFromSpec",value:function(){_(o,"setAttrFromSpec",this,3)([]),this._gap=this._spec.gap||0,this._title=this._spec.title,this._content=lt(this._spec.content),this._regions=this._option.getRegionsInUserIdOrIndex(lt(this._spec.regionId),lt(this._spec.regionIndex))}},{key:"initEvent",value:function(){var t=this;this._option.disableTriggerEvent||"none"!==this._spec.trigger&&("hover"===this._spec.trigger?(this.event.on("element-highlight:start",(function(e){var i=e.graphics[0];t.isRelativeModel(i)&&t.updateDatum(mI(i))})),this.event.on("element-highlight:reset",(function(e){t._activeDatum&&t.updateDatum(null)}))):(this.event.on("element-select:start",(function(e){var i=e.graphics[0];t.isRelativeModel(i)&&t.updateDatum(mI(i))})),this.event.on("element-select:reset",(function(e){t._activeDatum&&t.updateDatum(null)}))))}},{key:"updateDatum",value:function(t){this._activeDatum=t,this._displayData.updateData();var e=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(e)}},{key:"initData",value:function(){var t=this;EI(this._option.dataSet,"indicatorFilter",iZ);var e=new Xo(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")});e.transform({type:"indicatorFilter",options:{title:this._title,content:this._content,datum:function(){return t._activeDatum}}}),e.target.addListener("change",this.updateDatum.bind(this)),this._displayData=new ID(this._option,e)}},{key:"updateLayoutAttribute",value:function(){var t=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(t),_(o,"updateLayoutAttribute",this,3)([])}},{key:"_getIndicatorAttrs",value:function(){var t=this;if(!1===this._spec.visible||!1===this._spec.fixed&&null===this._activeDatum)return{visible:!1};var e=this._regions[0],i=e.getLayoutRect(),n=i.width,a=i.height,o=e.getLayoutStartPoint(),s=o.x,l=o.y,u=this._spec,c=u.content,h=u.offsetX,d=u.offsetY,v=u.limitRatio,f=u.title,p=r(u,["content","offsetX","offsetY","limitRatio","title"]),g=[];return lt(c).forEach((function(e){var i=nO({},t._theme.content,e);g.push({visible:!1!==i.visible&&(!i.field||null!==t._activeDatum),space:i.space||t._gap,autoLimit:i.autoLimit,autoFit:i.autoFit,fitPercent:i.fitPercent,fitStrategy:i.fitStrategy,style:Object.assign(Object.assign({},fI(it(i.style,["text"]),t._activeDatum)),{text:t._createText(i.field,i.style.text)})})})),Object.assign({visible:!0,size:{width:n,height:a},zIndex:this.layoutZIndex,x:s,y:l,dx:h?qL(h,this._computeLayoutRadius()):0,dy:d?qL(d,this._computeLayoutRadius()):0,limitRatio:v||1/0,title:{visible:!1!==f.visible&&(!C(f.field)||null!==this._activeDatum),space:f.space||this._gap,autoLimit:f.autoLimit,autoFit:f.autoFit,fitPercent:f.fitPercent,fitStrategy:f.fitStrategy,style:Object.assign(Object.assign({},fI(it(f.style,["text"]),this._activeDatum)),{text:this._createText(f.field,f.style.text)})},content:g},p)}},{key:"_createOrUpdateIndicatorComponent",value:function(t){var e=this;if(!1===t.visible)return this._indicatorComponent&&this._indicatorComponent.parent&&this._indicatorComponent.parent.removeChild(this._indicatorComponent),void(this._indicatorComponent=null);if(this._indicatorComponent)at(t,this._cacheAttrs)||this._indicatorComponent.setAttributes(t);else{var i=this.getContainer(),n=new DR(t);n.name="indicator",i.add(n),this._indicatorComponent=n,this._indicatorComponent.on("*",(function(t,i){return e._delegateEvent(e._indicatorComponent,t,i)}))}this._cacheAttrs=t}},{key:"_createText",value:function(t,e){var i;return t?this._activeDatum?this._activeDatum[t]:"":w(e)?null!==(i=e(this._activeDatum,void 0))&&void 0!==i?i:"":null!=e?e:""}},{key:"_computeLayoutRadius",value:function(){var t=this._regions[0].getLayoutRect(),e=t.width,i=t.height;return Math.min(e/2,i/2)}},{key:"isRelativeModel",value:function(t){return this._regions.some((function(e){return!!e.getSeriesInId(t.context.modelId)}))}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._indicatorComponent]}},{key:"clear",value:function(){this._cacheAttrs=null,_(o,"clear",this,3)([])}},{key:"getIndicatorComponent",value:function(){return this._indicatorComponent}}],[{key:"getSpecInfo",value:function(t){return yF(t,this.specKey,this.type,(function(t){return t&&!1!==t.visible}))}}])}(vz);aZ.type=d.indicator,aZ.builtInTheme={indicator:rZ},aZ.specKey="indicator";var oZ=["sum","average","min","max","variance","standardDeviation","median"];function sZ(t,e,i){if(!i)return!1;var n=t.map((function(t){return 1*t})),r=ht(n),a=ct(n);return e<r||e>a}function lZ(t,e,i,n,r,a){var o,s,l=n.relativeSeries;return F(t.x)&&sZ(e,t.x,i)&&(null===(s=null==l?void 0:(o=l.getXAxisHelper()).setExtendDomain)||void 0===s||s.call(o,"marker_xAxis_extend",t.x)),VL(t.x)?dZ(t.x,r)+a.x:vZ(l.getXAxisHelper(),[t.x])+a.x}function uZ(t,e,i,n,r,a){var o,s,l=n.relativeSeries;return F(t.y)&&sZ(e,t.y,i)&&(null===(s=null===(o=l.getYAxisHelper())||void 0===o?void 0:o.setExtendDomain)||void 0===s||s.call(o,"marker_yAxis_extend",t.y)),VL(t.y)?dZ(t.y,r)+a.y:vZ(l.getYAxisHelper(),[t.y])+a.y}function cZ(t,e,i,n){var r,a,o=n.relativeSeries;return F(t.angle)&&sZ(e,t.angle,i)&&(null===(a=null===(r=o.angleAxisHelper)||void 0===r?void 0:r.setExtendDomain)||void 0===a||a.call(r,"marker_angleAxis_extend",t.angle)),vZ(o.angleAxisHelper,[t.angle])}function hZ(t,e,i,n){var r,a,o=n.relativeSeries;return F(t.radius)&&sZ(e,t.radius,i)&&(null===(a=null===(r=o.radiusAxisHelper)||void 0===r?void 0:r.setExtendDomain)||void 0===a||a.call(r,"marker_radiusAxis_extend",t.radius)),vZ(o.radiusAxisHelper,[t.radius])}function dZ(t,e){return Number(t.substring(0,t.length-1))*e/100}function vZ(t,e){var i=t.getScale(0);return oE(i.type)&&i.domain()[0]===i.domain()[1]&&e[0]!==i.domain()[0]?NaN:t.dataToPosition(e)}function fZ(t){return oZ.includes(t)}function pZ(t,e,i,n,r){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=e.getRegion(),s=o.getLayoutStartPoint(),l=i.getRegion(),u=l.getLayoutStartPoint(),c=Math.abs(Math.min(s.x,u.x)-Math.max(s.x+o.getLayoutRect().width,u.x+l.getLayoutRect().width)),h=Math.abs(Math.min(s.y,u.y)-Math.max(s.y+o.getLayoutRect().height,u.y+l.getLayoutRect().height)),d={relativeSeries:n,startRelativeSeries:e,endRelativeSeries:i},v=[],f=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,p=n.getXAxisHelper(),g=n.getYAxisHelper(),y=p.getScale(0).domain(),m=g.getScale(0).domain(),_=a&&!p.isContinuous&&!!p.getBandwidth,b=a&&!g.isContinuous&&!!g.getBandwidth,k={min:null,max:null},x={min:null,max:null};return f.forEach((function(t){var e,i,n=C(t.x),a=C(t.y);if(n&&a)e=lZ(t,y,r,d,c,s),i=uZ(t,m,r,d,h,s),gZ(e,_,k,v.length),gZ(i,b,x,v.length),v.push([{x:e,y:i}]);else if(n){e=lZ(t,y,r,d,c,s),i=Math.max(s.y+o.getLayoutRect().height,u.y+l.getLayoutRect().height);var f=Math.min(s.y,u.y);gZ(e,_,k,v.length),v.push([{x:e,y:i},{x:e,y:f}])}else if(a){e=Math.min(s.x,u.x),i=uZ(t,m,r,d,h,s);var p=Math.max(s.x+o.getLayoutRect().width,u.x+l.getLayoutRect().width);gZ(i,b,x,v.length),v.push([{x:e,y:i},{x:p,y:i}])}})),function(t,e,i,n,r){if(n.min||n.max){var a=e.getBandwidth(0)*(1+e.getScale(0).paddingInner());n.min&&t[n.min.index].forEach((function(t){return t.x-=a/2})),n.max&&t[n.max.index].forEach((function(t){return t.x+=a/2}))}if(r.min||r.max){var o=i.getBandwidth(0)*(1+i.getScale(0).paddingInner());r.min&&t[r.min.index].forEach((function(t){return t.y-=o/2})),r.max&&t[r.max.index].forEach((function(t){return t.y+=o/2}))}}(v,p,g,k,x),v}function gZ(t,e,i,n){return e&&((null===i.min||i.min.value>t)&&(i.min={value:t,index:n}),(null===i.max||i.max.value<t)&&(i.max={value:t,index:n})),t}function yZ(t,e,i,n,r){var a={relativeSeries:n,startRelativeSeries:e,endRelativeSeries:i},o=[],s=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,l=n.angleAxisHelper.getScale(0).domain(),u=n.radiusAxisHelper.getScale(0).domain(),c=Math.min(n.getRegion().getLayoutRect().width/2,n.getRegion().getLayoutRect().height/2);return s.forEach((function(t){var e=C(t.angle),i=C(t.radius);if(e&&i){var n=cZ(t,l,r,a),s=hZ(t,u,r,a);o.push([{angle:n,radius:s}])}else if(e){var h=cZ(t,l,r,a);o.push([{angle:h,radius:-c},{angle:h,radius:c}])}else if(i){var d=hZ(t,u,r,a);o.push([{radius:d,angle:0},{radius:d,angle:2*Math.PI}])}})),o}function mZ(t,e,i,n){var r=[],a=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,o=O(n);return a.forEach((function(t,a){var s,l,u,c,h=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,d=h.getRegion(),v=d.getLayoutStartPoint(),f=d.getLayoutRect(),p=f.width,g=f.height,y=0,m=0;if(n){var _=o?n[a]:n,b=_.x,k=_.y;b&&(y=VL(b)?Number(b.substring(0,b.length-1))*p/100:b),k&&(m=VL(k)?Number(k.substring(0,k.length-1))*g/100:k)}var x=h.getXAxisHelper().getScale(0).domain(),S=h.getYAxisHelper().getScale(0).domain(),A=lt(t.x),M=lt(t.y);1===A.length&&F(A[0])&&sZ(x,A[0],i)&&(null===(l=null===(s=h.getXAxisHelper())||void 0===s?void 0:s.setExtendDomain)||void 0===l||l.call(s,"marker_xAxis_extend",A[0])),1===M.length&&F(M[0])&&sZ(S,M[0],i)&&(null===(c=null===(u=h.getYAxisHelper())||void 0===u?void 0:u.setExtendDomain)||void 0===c||c.call(u,"marker_yAxis_extend",M[0])),r.push({x:vZ(h.getXAxisHelper(),A)+v.x+y,y:vZ(h.getYAxisHelper(),M)+v.y+m})})),r}function _Z(t,e,i){var n=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((function(t){var r,a,o,s,l=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,u=l.angleAxisHelper.getScale(0).domain(),c=l.radiusAxisHelper.getScale(0).domain(),h=lt(t.angle),d=lt(t.radius);1===h.length&&F(h[0])&&sZ(u,h[0],i)&&(null===(a=null===(r=l.angleAxisHelper)||void 0===r?void 0:r.setExtendDomain)||void 0===a||a.call(r,"marker_xAxis_extend",h[0])),1===d.length&&F(d[0])&&sZ(c,d[0],i)&&(null===(s=null===(o=l.radiusAxisHelper)||void 0===o?void 0:o.setExtendDomain)||void 0===s||s.call(o,"marker_yAxis_extend",d[0])),n.push({angle:vZ(l.angleAxisHelper,h),radius:vZ(l.radiusAxisHelper,d)})})),n}function bZ(t,e,i){var n=t.x,r=t.y;return VL(n)&&(n=dZ(n,e)),VL(r)&&(r=dZ(r,i)),{x:n,y:r}}function kZ(t,e,i){var n;if(n=w(t)?lt(t(e.getData().getLatestData(),e)):lt(t),i){var r=e.getRegion(),a=r.getLayoutStartPoint(),o=a.x,s=a.y,l=r.getLayoutRect(),u=l.width,c=l.height;return n.map((function(t){var e=bZ(t,u,c),i=e.x,n=e.y;return{x:i+=o,y:n+=s}}))}var h=e.getOption().getChart().getViewRect(),d=h.width,v=h.height;return n.map((function(t){return bZ(t,d,v)}))}function xZ(t){var e=1/0,i=-1/0,n=1/0,r=-1/0;return t.forEach((function(t){var a=t.getLayoutStartPoint(),o=t.getLayoutRect();a.x<e&&(e=a.x),a.x+o.width>i&&(i=a.x+o.width),a.y<n&&(n=a.y),a.y+o.height>r&&(r=a.y+o.height)})),{minX:e,maxX:i,minY:n,maxY:r}}function SZ(t,e,i){var n=t.labelBackground,a=void 0===n?{}:n,o=t.style,s=t.shape,l=r(t,["labelBackground","style","shape"]);if(!1!==t.visible){var u=l;return(null==s?void 0:s.visible)?u.shape=Object.assign({visible:!0},pI(s.style)):u.shape={visible:!1},!1!==a.visible?(u.panel=Object.assign({visible:!0,customShape:a.customShape},MZ(pI(a.style),e,i)),C(a.padding)&&(u.padding=ki(a.padding))):(u.panel={visible:!1},u.padding=0),o&&(u.textStyle=MZ(pI(o),e,i)),u}return{visible:!1}}function AZ(t,e,i){for(var n in t)w(t[n])&&(t[n]=t[n](e,i));return t}function MZ(t,e,i){return w(t)?t(e,i):t}function wZ(t,e){return w(t)?t(e):t}function TZ(t,e,i){return C(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 CZ(t){return{isXProcess:C(t.x),isYProcess:C(t.y),isX1Process:C(t.x1),isY1Process:C(t.y1),isAngleProcess:C(t.angle),isRadiusProcess:C(t.radius),isAngle1Process:C(t.angle1),isRadius1Process:C(t.radius1),isCoordinatesProcess:C(t.coordinates),isValidProcess:C(t.process)}}function EZ(t){var e=CZ(t),i=e.isXProcess,n=e.isYProcess,r=e.isX1Process,a=e.isY1Process,o=e.isAngleProcess,s=e.isRadiusProcess,l=e.isAngle1Process,u=e.isRadius1Process,c=e.isCoordinatesProcess,h=e.isValidProcess;return{doXProcess:i&&!n&&!a,doXYY1Process:i&&n&&a,doYProcess:n&&!i&&!r,doYXX1Process:n&&i&&r,doXYProcess:i&&n&&r&&a,doAngleProcess:o&&!l&&!s&&!u,doRadiusProcess:s&&!u&&!o&&!l,doAngRadRad1Process:o&&!l&&s&&u,doRadAngAng1Process:s&&o&&l&&!u,doRadAngProcess:o&&s&&l&&u,doCoordinatesProcess:c&&(!h||"process"in t&&"xy"in t.process)}}function BZ(t){var e=CZ(t),i=e.isXProcess,n=e.isYProcess,r=e.isX1Process,a=e.isY1Process,o=e.isAngleProcess,s=e.isRadiusProcess,l=e.isAngle1Process,u=e.isRadius1Process;return{doXProcess:i&&r&&!n&&!a,doYProcess:n&&a&&!i&&!r,doXYProcess:i&&r&&n&&a,doAngleProcess:o&&l&&!s&&!u,doRadiusProcess:s&&u&&!o&&!l,doRadAngProcess:o&&s&&l&&u,doCoordinatesProcess:e.isCoordinatesProcess}}function PZ(t){return{doXYProcess:C(t.x)&&C(t.y),doPolarProcess:C(t.angle)&&C(t.radius),doGeoProcess:C(t.areaName)}}function RZ(t,e){var i;if(e.coordinates){var n,a,o=e,s=o.coordinates,l=o.coordinateType,u=o.getSeriesByIdOrIndex,c=r(o,["coordinates","coordinateType","getSeriesByIdOrIndex"]);if(w(s)){var h=e.getRelativeSeries();n=s(h.getData().getLatestData(),h)}else n=s;i=(n=lt(n)).map((function(t){var e=u(t.refRelativeSeriesId,t.refRelativeSeriesIndex);if("cartesian"===l){var i=e.getSpec(),n=i.xField,r=i.yField,o=t.xFieldDim,s=t.xFieldIndex,h=t.yFieldDim,d=t.yFieldIndex,v=n;C(s)&&(v=lt(n)[s]),o&&lt(n).includes(o)&&(v=o);var f=r;C(d)&&(f=lt(r)[d]),h&&lt(r).includes(h)&&(f=h),a=Object.assign({x:void 0,y:void 0},c),L(t[v])&&fZ(t[v])?a.x={field:v,aggrType:t[v]}:a.x=lt(v).map((function(e){return t[e]})),L(t[f])&&fZ(t[f])?a.y={field:f,aggrType:t[f]}:a.y=lt(f).map((function(e){return t[e]}))}else if("polar"===l){var p=e.getSpec(),g=p.valueField,y=p.categoryField,m=t.angleFieldDim,_=t.angleFieldIndex,b=y;C(_)&&(b=lt(y)[_]),m&&lt(y).includes(m)&&(b=m);var k=g;a=Object.assign({angle:void 0,radius:void 0},c),L(t[b])&&fZ(t[b])?a.angle={field:b,aggrType:t[b]}:a.angle=lt(b).map((function(e){return t[e]})),L(t[k])&&fZ(t[k])?a.radius={field:k,aggrType:t[k]}:a.radius=lt(k).map((function(e){return t[e]}))}return a.getRefRelativeSeries=function(){return e},a}))}else i=e;var d=[];return i.forEach((function(e){var i={x:null,y:null,angle:null,radius:null,areaName:null};if(C(e.x)){var n=e.x;O(n)?i.x=n.map((function(i){return OZ(i,t,e)})):i.x=OZ(n,t,e)}if(C(e.y)){var r=e.y;O(r)?i.y=r.map((function(i){return OZ(i,t,e)})):i.y=OZ(r,t,e)}if(C(e.angle)){var a=e.angle;O(a)?i.angle=a.map((function(i){return OZ(i,t,e)})):i.angle=OZ(a,t,e)}if(C(e.radius)){var o=e.radius;O(o)?i.radius=o.map((function(i){return OZ(i,t,e)})):i.radius=OZ(o,t,e)}if(C(e.areaName)){var s=e.areaName;i.areaName=OZ(s,t,e)}e.getRefRelativeSeries&&(i.getRefRelativeSeries=e.getRefRelativeSeries),d.push(i)})),d}var LZ={min:function(t,e){return lL(t[0].latestData,e.field)},max:function(t,e){return uL(t[0].latestData,e.field)},sum:function(t,e){return cL(t[0].latestData,e.field)},average:function(t,e){return hL(t[0].latestData,e.field)},variance:function(t,e){return dL(t[0].latestData,e.field)},standardDeviation:function(t,e){return function(t,e){return Math.sqrt(dL(t,e))}(t[0].latestData,e.field)},median:function(t,e){return function(t,e){return wt(t.map((function(t){return t[e]})))}(t[0].latestData,e.field)}};function OZ(t,e,i){var n=i.getRelativeSeries(),r=i.getStartRelativeSeries(),a=i.getEndRelativeSeries(),o=n.getData().getLatestData(),s=r.getData().getLatestData(),l=a.getData().getLatestData();if(w(t))return t(o,s,l,n,r,a);if(P(t)){var u=t.aggrType,c=t.field;return LZ[u](e,{field:c})}return t}function IZ(t,e){if(e&&e.getRelativeSeries){var i=e.getRelativeSeries();if(i){var n=i.getViewData();return n&&n.latestData&&n.latestData.length?t:[]}}return t}var DZ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).layoutType="none",t._layoutOffsetX=0,t._layoutOffsetY=0,t}return c(e,t),a(e,[{key:"getRelativeSeries",value:function(){return this._relativeSeries}},{key:"getMarkerData",value:function(){return this._markerData}},{key:"getMarkAttributeContext",value:function(){return this._markAttributeContext}},{key:"_buildMarkerAttributeContext",value:function(){this._markAttributeContext={relativeSeries:this._relativeSeries,startRelativeSeries:this._startRelativeSeries,endRelativeSeries:this._endRelativeSeries,vchart:this._option.globalInstance}}},{key:"created",value:function(){_(e,"created",this,3)([]),this._bindSeries(),this._initDataView(),this.initEvent(),this._buildMarkerAttributeContext()}},{key:"_getAllRelativeSeries",value:function(){var t=this;return{getRelativeSeries:function(){return t._relativeSeries},getStartRelativeSeries:function(){return t._startRelativeSeries},getEndRelativeSeries:function(){return t._endRelativeSeries}}}},{key:"_getFieldInfoFromSpec",value:function(t,e,i){var n={x:"xField",y:"yField",radius:"valueField",angle:"categoryField",areaName:"nameField"};return L(e)&&fZ(e)?{field:i.getSpec()[n[t]],aggrType:e}:e}},{key:"_processSpecByDims",value:function(t){var e=this,i=this._relativeSeries,n={};return t.forEach((function(t){return n[t.dim]=e._getFieldInfoFromSpec(t.dim,t.specValue,i)})),Object.assign(Object.assign({},n),this._getAllRelativeSeries())}},{key:"_processSpecCoo",value:function(t){var e=this;return Object.assign(Object.assign({coordinates:t.coordinates||t.coordinate},this._getAllRelativeSeries()),{getSeriesByIdOrIndex:function(t,i){return e._getSeriesByIdOrIndex(t,i)},coordinateType:this.coordinateType})}},{key:"_getRelativeDataView",value:function(){if(this._specifiedDataSeries){var t=[];lt(this._specifiedDataSeries).forEach((function(e){t=t.concat(e.getViewData().latestData)}));var e=new Yo;return e.registerParser("array",v),new Xo(e).parse(t,{type:"array"})}return this._relativeSeries.getViewData()}},{key:"updateLayoutAttribute",value:function(){var t,i,n,r=this;if(null===(t=this._spec.visible)||void 0===t||t){if(!this._markerComponent){var a=this._createMarkerComponent();a.name=null!==(i=this._spec.name)&&void 0!==i?i:this.type,a.id=null!==(n=this._spec.id)&&void 0!==n?n:"".concat(this.type,"-").concat(this.id),this._markerComponent=a,this.getContainer().add(this._markerComponent),this._markerComponent.on("*",(function(t,e){r._delegateEvent(r._markerComponent,t,e,null,r.getMarkerData.bind(r))}))}this._markerLayout()}_(e,"updateLayoutAttribute",this,3)([])}},{key:"_getSeriesByIdOrIndex",value:function(t,e){var i,n,r;return(r=null===(i=this._option.getSeriesInUserIdOrIndex(C(t)?[t]:[],[e]))||void 0===i?void 0:i[0])||(r=null!==(n=this._relativeSeries)&&void 0!==n?n:this._getFirstSeries()),r}},{key:"_bindSeries",value:function(){var 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))}},{key:"initEvent",value:function(){"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)))}},{key:"clear",value:function(){_(e,"clear",this,3)([]),this._firstSeries=null}},{key:"_getFirstSeries",value:function(){var t;if(this._firstSeries)return this._firstSeries;var e=kL(this._regions);return e?(this._firstSeries=e,e):(null===(t=this._option)||void 0===t||t.onError("need at least one series"),null)}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._markerComponent]}},{key:"onLayoutStart",value:function(t,i){T(this._spec.offsetX)||(this._layoutOffsetX=WL(this._spec.offsetX,i.width,i)),T(this._spec.offsetY)||(this._layoutOffsetY=WL(this._spec.offsetY,i.height,i)),_(e,"onLayoutStart",this,3)([t,i])}},{key:"_compareSpec",value:function(t,i){var n=_(e,"_compareSpec",this,3)([t,i]);return at(i,t)||(n.reRender=!0,n.reMake=!0,n.change=!0),n}},{key:"_initCommonDataView",value:function(){var t=this,e=this._computeOptions().options,i=this._getRelativeDataView();EI(this._option.dataSet,"markerAggregation",RZ),EI(this._option.dataSet,"markerFilter",IZ);var n=new Xo(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")});n.parse([i],{type:"dataview"}),n.transform({type:"markerAggregation",options:e}),n.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),n.target.on("change",(function(){t._markerLayout()})),this._markerData=n}}],[{key:"_getMarkerCoordinateType",value:function(t){return"cartesian"}},{key:"getSpecInfo",value:function(t){var e=this;return yF(t,this.specKey,this.type,(function(t){return!1!==t.visible&&e._getMarkerCoordinateType(t)===e.coordinateType}))}}])}(vz);function FZ(t,e){return function(t,e,i){var n=Qt(t,(function(t){return t[e]}),(function(t){return t[i]})),r=n.predict,a=lL(t,e),o=uL(t,e),l=r(a),u=r(o);return[s(s({},e,a),i,l),s(s({},e,o),i,u)]}(t[0].latestData,e.fieldX,e.fieldY)}var jZ=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).specKey="markLine",e.layoutZIndex=t.LayoutZIndex.MarkLine,e}return c(r,e),a(r,[{key:"_createMarkerComponent",value:function(){var t,e,i,n,r,a,o,s,l,u,c,h,d,v=this,f=this._spec,p=f.startSymbol,g=void 0===p?{}:p,y=f.endSymbol,m=void 0===y?{}:y,_=lt(null!==(t=this._spec.label)&&void 0!==t?t:{}),b={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===(n=this._spec.interactive)||void 0===n||n,points:[{x:0,y:0},{x:0,y:0}],center:{x:0,y:0},radius:0,startAngle:0,endAngle:0,lineStyle:MZ(pI(null===(r=this._spec.line)||void 0===r?void 0:r.style),this._markerData,this._markAttributeContext),clipInRange:null!==(a=this._spec.clip)&&void 0!==a&&a,label:_.map((function(t){return SZ(t,v._markerData,v._markAttributeContext)})),state:{line:AZ(null!==(s=null===(o=this._spec.line)||void 0===o?void 0:o.state)&&void 0!==s?s:{},this._markerData,this._markAttributeContext),lineStartSymbol:AZ(null!==(u=null===(l=this._spec.startSymbol)||void 0===l?void 0:l.state)&&void 0!==u?u:{},this._markerData,this._markAttributeContext),lineEndSymbol:AZ(null!==(h=null===(c=this._spec.endSymbol)||void 0===c?void 0:c.state)&&void 0!==h?h:{},this._markerData,this._markAttributeContext),label:_.map((function(t){var e;return AZ(null!==(e=t.state)&&void 0!==e?e:{},v._markerData,v._markAttributeContext)})),labelBackground:_.map((function(t){var e,i;return AZ(null!==(i=null===(e=t.labelBackground)||void 0===e?void 0:e.state)&&void 0!==i?i:{},v._markerData,v._markAttributeContext)}))},animation:null!==(d=this._spec.animation)&&void 0!==d&&d,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return g.visible?b.startSymbol=Object.assign(Object.assign({},g),{visible:!0,style:MZ(pI(g.style),this._markerData,this._markAttributeContext)}):b.startSymbol={visible:!1},m.visible?b.endSymbol=Object.assign(Object.assign({},m),{visible:!0,style:MZ(pI(m.style),this._markerData,this._markAttributeContext)}):b.endSymbol={visible:!1},this._newMarkLineComponent(b)}},{key:"_getUpdateMarkerAttrs",value:function(){var t,e,i,n=this._spec,r=this._markerData,a=this._startRelativeSeries,o=this._endRelativeSeries,s=this._relativeSeries,l=this._computePointsAttr(),u=s.getViewData().latestData,c=r.latestData[0]&&r.latestData[0].latestData?r.latestData[0].latestData:r.latestData;if(n.clip||lt(n.label).some((function(t){return null==t?void 0:t.confine}))){var h=xZ([a.getRegion(),o.getRegion(),s.getRegion()]),d=h.minX,v=h.maxX,f=h.minY;i={x:d,y:f,width:v-d,height:h.maxY-f}}var p=lt((null!==(e=null===(t=this._markerComponent)||void 0===t?void 0:t.attribute)&&void 0!==e?e:{}).label),g=lt(this._spec.label),y=p.map((function(t,e){var i=g[e]||{};return Object.assign(Object.assign({},t),{text:i.formatMethod?i.formatMethod(c,u):null==t?void 0:t.text})}));return Object.assign(Object.assign({},l),{label:y,limitRect:i,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}},{key:"_markerLayout",value:function(){var t,e=this._getUpdateMarkerAttrs();null===(t=this._markerComponent)||void 0===t||t.setAttributes(e)}},{key:"_initDataView",value:function(){var t=this,e=this._spec,i="coordinates"in e,n=EZ(e),r=n.doXProcess,a=n.doYProcess,o=n.doXYY1Process,s=n.doYXX1Process,l=n.doXYProcess,u=n.doAngleProcess,c=n.doRadiusProcess,h=n.doAngRadRad1Process,d=n.doRadAngAng1Process,v=n.doRadAngProcess;if(this._markerData=this._getRelativeDataView(),r||a||o||s||l||u||c||h||d||v||i){EI(this._option.dataSet,"markerAggregation",RZ),EI(this._option.dataSet,"markerRegression",FZ),EI(this._option.dataSet,"markerFilter",IZ);var f=this._computeOptions(),p=f.options,g=f.needAggr,y=f.needRegr,m=f.processData,_=new Xo(this._option.dataSet);_.parse([m],{type:"dataview"}),g&&_.transform({type:"markerAggregation",options:p}),y&&_.transform({type:"markerRegression",options:p}),_.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),_.target.on("change",(function(){t._markerLayout()})),this._markerData=_}}}],[{key:"_getMarkerCoordinateType",value:function(t){var e=EZ(t),i=e.doAngleProcess,n=e.doRadiusProcess,r=e.doAngRadRad1Process,a=e.doRadAngAng1Process,o=e.doRadAngProcess;return"polar"===t.coordinateType||i||n||r||a||o?"polar":"cartesian"}}])}(DZ);jZ.specKey="markLine";var zZ=function(t){return{visible:t,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}}},HZ={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},NZ={line:{style:{lineDash:[3,3],stroke:{type:"palette",key:"markLineStrokeColor"}}},startSymbol:zZ(!1),endSymbol:zZ(!0),label:HZ},VZ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=d.markLine,t.name=d.markLine,t.coordinateType="cartesian",t}return c(e,t),a(e,[{key:"_newMarkLineComponent",value:function(t){return new nR(t)}},{key:"_computePointsAttr",value:function(){var t,e=this._spec,i=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,o=C(e.coordinates),s=C(e.process),l=s&&C(e.process.x),u=s&&C(e.process.y),c=C(e.positions),h=null!==(t=e.autoRange)&&void 0!==t&&t,d=EZ(e),v=d.doXProcess,f=d.doYProcess,p=d.doXYY1Process,g=d.doYXX1Process,y=d.doXYProcess,m=d.doCoordinatesProcess,_=[];if(v||p||f||g||y||o&&l||o&&u){var b=pZ(i,n,r,a,h);_=1===b.length?b[0]:b.map((function(t){return t[0]}))}else m?_=mZ(i,a,h,e.coordinatesOffset):c&&(_=kZ(e.positions,a,e.regionRelative));return{points:_}}},{key:"_markerLayout",value:function(){var t,e,i,n,r,a=this._getUpdateMarkerAttrs();if("type-step"===this._spec.type){var o,s=this._startRelativeSeries,l=this._endRelativeSeries,u=this._spec.line||{},c=u.multiSegment,h=u.mainSegmentIndex,d=this._spec,v=d.connectDirection,f=d.expandDistance,p=void 0===f?0:f;if(VL(p)){var g=s.getRegion(),y=g.getLayoutStartPoint(),m=l.getRegion(),_=m.getLayoutStartPoint();if("bottom"===v||"top"===v){var b=Math.abs(Math.min(y.y,_.y)-Math.max(y.y+g.getLayoutRect().height,_.y+m.getLayoutRect().height));o=Number(p.substring(0,p.length-1))*b/100}else{var k=Math.abs(Math.min(y.x,_.x)-Math.max(y.x+g.getLayoutRect().width,_.x+m.getLayoutRect().width));o=Number(p.substring(0,p.length-1))*k/100}}else o=p;var x=a.points,S=a.limitRect;if(!x||x.length<2)return void(null===(t=this._markerComponent)||void 0===t||t.setAttributes(a));var A,M=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=[],a=t.y-e.y,o=t.x-e.x;switch(i){case"top":r.push(t),r.push({x:t.x,y:a>0?t.y-n-Math.abs(a):t.y-n}),r.push({x:e.x,y:a>0?e.y-n:e.y-n-Math.abs(a)}),r.push(e);break;case"bottom":r.push(t),r.push({x:t.x,y:a<0?t.y+n+Math.abs(a):t.y+n}),r.push({x:e.x,y:a<0?e.y+n:e.y+n+Math.abs(a)}),r.push(e);break;case"left":r.push(t),r.push({x:o>0?t.x-n-Math.abs(o):t.x-n,y:t.y}),r.push({x:o>0?e.x-n:e.x-n-Math.abs(o),y:e.y}),r.push(e);break;case"right":r.push(t),r.push({x:o>0?t.x+n:t.x+n+Math.abs(o),y:t.y}),r.push({x:o>0?e.x+n+Math.abs(o):e.x+n,y:e.y}),r.push(e)}return r}(x[0],x[1],v,o);A=c&&C(h)?{position:"middle",autoRotate:!1}:Object.assign({position:"start",autoRotate:!1},function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=t.y-e.y,a=t.x-e.x;return"bottom"===i?{dx:a>0?-a/2:Math.abs(a/2),dy:r>0?n:Math.abs(r)+n}:"top"===i?{dx:a>0?-Math.abs(a/2):+Math.abs(a/2),dy:r>0?-(Math.abs(r)+n):-n}:"left"===i?{dx:a>0?-a-n:-n,dy:r>0?-r/2:Math.abs(r/2)}:"right"===i?{dx:a>0?n:Math.abs(a)+n,dy:r>0?-r/2:Math.abs(r/2)}:{}}(x[0],x[1],v,o));var w=lt((null!==(i=null===(e=this._markerComponent)||void 0===e?void 0:e.attribute)&&void 0!==i?i:{}).label),T=lt(a.label),E=lt(this._spec.label);null===(n=this._markerComponent)||void 0===n||n.setAttributes({points:c?[[M[0],M[1]],[M[1],M[2]],[M[2],M[3]]]:M,label:T.map((function(t,e){var i,n,r,a,o=0,s=0,l=null!==(i=A.dx)&&void 0!==i?i:0,u=null!==(n=A.dy)&&void 0!==n?n:0,c=null!==(r=E[e])&&void 0!==r?r:E[0];return z(null==c?void 0:c.refX)&&(o+=c.refX),z(null==c?void 0:c.refY)&&(s+=c.refY),z(null==c?void 0:c.dx)&&(l+=c.dx),z(null==c?void 0:c.dy)&&(u+=c.dy),Object.assign(Object.assign(Object.assign({},t),A),{refX:o,refY:s,dx:l,dy:u,textStyle:Object.assign(Object.assign({},null===(a=w[e])||void 0===a?void 0:a.textStyle),{textAlign:"center",textBaseline:"middle"})})})),limitRect:S,multiSegment:c,mainSegmentIndex:h,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}else null===(r=this._markerComponent)||void 0===r||r.setAttributes(a)}},{key:"_computeOptions",value:function(){var t,e=this._getRelativeDataView(),i=!0,n=!1,r=this._spec,a=this._relativeSeries,o=EZ(r),s=o.doXProcess,l=o.doYProcess,u=o.doXYY1Process,c=o.doYXX1Process,h=o.doXYProcess,d=o.doCoordinatesProcess;if(h)t=[this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y}]),this._processSpecByDims([{dim:"x",specValue:r.x1},{dim:"y",specValue:r.y1}])];else if(s)t=[this._processSpecByDims([{dim:"x",specValue:r.x}])];else if(l)t=[this._processSpecByDims([{dim:"y",specValue:r.y}])];else if(u)t=[this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y}]),this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y1}])];else if(c)t=[this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y}]),this._processSpecByDims([{dim:"x",specValue:r.x1},{dim:"y",specValue:r.y}])];else if(d){if(t=this._processSpecCoo(r),i=!1,e=new Xo(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")}).parse([a.getViewData()],{type:"dataview"}).transform({type:"markerAggregation",options:t}),r.process&&C(r.process.x)&&(t=[this._processSpecByDims([{dim:"x",specValue:r.process.x}])],i=!0),r.process&&C(r.process.y)&&(t=t=[this._processSpecByDims([{dim:"y",specValue:r.process.y}])],i=!0),r.process&&C(r.process.xy)){var v=a.getSpec();t={fieldX:v.xField,fieldY:v.yField},n=!0}}else i=!1;return{options:t,needAggr:i,needRegr:n,processData:e}}}])}(jZ);VZ.type=d.markLine,VZ.coordinateType="cartesian",VZ.builtInTheme={markLine:NZ};var UZ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=d.polarMarkLine,t.name=d.polarMarkLine,t.coordinateType="polar",t}return c(e,t),a(e,[{key:"_newMarkLineComponent",value:function(t){var e=EZ(this._spec),i=e.doRadiusProcess,n=e.doRadAngAng1Process;return i||n?new oR(t):new nR(t)}},{key:"_computePointsAttr",value:function(){var t,e=this._spec,i=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,o=null!==(t=e.autoRange)&&void 0!==t&&t,s=EZ(e),l=s.doAngleProcess,u=s.doRadiusProcess,c=s.doAngRadRad1Process,h=s.doRadAngAng1Process,d=s.doRadAngProcess,v=s.doCoordinatesProcess,f=[],p={},g={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(l||u||c||h||d){var y=yZ(i,n,r,a,o);f=1===y.length?y[0]:y.map((function(t){return t[0]})),p=f[0].radius===f[1].radius?{radius:f[0].radius,startAngle:f[0].angle,endAngle:f[1].angle,center:g}:{points:f.map((function(t){return we(g,t.radius,t.angle)}))}}else v&&(p={points:(f=_Z(i,a,o)).map((function(t){return we(g,t.radius,t.angle)}))});return p}},{key:"_computeOptions",value:function(){var t,e=this._spec,i=EZ(e),n=i.doAngleProcess,r=i.doRadiusProcess,a=i.doAngRadRad1Process,o=i.doRadAngAng1Process,s=i.doRadAngProcess,l=i.doCoordinatesProcess,u=this._getRelativeDataView();return s?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius1}])]:n?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle}])]:r?t=[this._processSpecByDims([{dim:"radius",specValue:e.radius}])]:a?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius1}])]:o?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius}])]:l&&(t=this._processSpecCoo(e)),{options:t,needAggr:!0,needRegr:!1,processData:u}}}])}(jZ);UZ.type=d.polarMarkLine,UZ.coordinateType="polar",UZ.builtInTheme={polarMarkLine:NZ};var WZ=function(e){function r(e,a){var o;return n(this,r),(o=i(this,r,[e,a])).type=d.title,o.specKey=d.title,o.layoutType="normal",o.layoutZIndex=t.LayoutZIndex.Title,o.layoutLevel=t.LayoutLevel.Title,o._orient="top",o._orient=NL(e.orient)?e.orient:"top",o}return c(r,e),a(r,[{key:"orient",get:function(){return this._orient}},{key:"initLayout",value:function(){_(r,"initLayout",this,3)([]),this._layout&&(this._layout.layoutOrient=this._orient)}},{key:"_compareSpec",value:function(t,e){var i=_(r,"_compareSpec",this,3)([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}},{key:"afterSetLayoutStartPoint",value:function(t){z(t.x)&&this._titleComponent&&this._titleComponent.setAttribute("x",t.x),z(t.y)&&this._titleComponent&&this._titleComponent.setAttribute("y",t.y),_(r,"afterSetLayoutStartPoint",this,3)([t])}},{key:"getBoundsInRect",value:function(t){var e={};this.setLayoutRect(t);var i=this._getTitleAttrs();this._createOrUpdateTitleComponent(i),e=this._getTitleLayoutRect();var n=this.getLayoutStartPoint(),r=n.x,a=n.y;return{x1:r,y1:a,x2:r+e.width,y2:a+e.height}}},{key:"_getTitleLayoutRect",value:function(){var t=this._titleComponent.AABBBounds;return{width:this._spec.width?this._spec.width:z(t.width())?t.width():0,height:this._spec.height?this._spec.height:z(t.height())?t.height():0}}},{key:"_getTitleAttrs",value:function(){var t,e,i,n,r,a,o,s;if(!1===this._spec.visible)return{visible:!1};var l=this.getLayoutRect(),u=WL(this._spec.width,l.width,null,l.width),c=WL(this._spec.maxWidth,l.width,null,l.width),h=Math.max(Math.min(u,c,l.width),0),d=Object.assign(Object.assign({},it(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!==(n=this._spec.subtext)&&void 0!==n?n:"",x:null!==(r=this._spec.x)&&void 0!==r?r:0,y:null!==(a=this._spec.y)&&void 0!==a?a:0,height:this._spec.height,minWidth:this._spec.minWidth,maxWidth:h,minHeight:this._spec.minHeight,maxHeight:this._spec.maxHeight,padding:this._spec.innerPadding,align:null!==(o=this._spec.align)&&void 0!==o?o:"left",verticalAlign:null!==(s=this._spec.verticalAlign)&&void 0!==s?s:"top",textStyle:Object.assign({width:h,maxLineWidth:h},this._spec.textStyle),subtextStyle:Object.assign({maxLineWidth:h},this._spec.subtextStyle)});return C(this._spec.width)&&(d.textStyle.width=Math.max(u,l.width),d.subtextStyle.width=d.textStyle.width),d}},{key:"_createOrUpdateTitleComponent",value:function(t){var e=this;if(this._titleComponent)at(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{var i=this.getContainer(),n=new RR(t);n.name="title",i.add(n),this._titleComponent=n,n.on("*",(function(t,i){return e._delegateEvent(n,t,i)}))}return this._cacheAttrs=t,this._titleComponent}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._titleComponent]}},{key:"clear",value:function(){_(r,"clear",this,3)([]),this._cacheAttrs=null}}],[{key:"getSpecInfo",value:function(t){return yF(t,this.specKey,d.title,(function(t){return!1!==t.visible}))}}])}(vz);WZ.type=d.title,WZ.specKey=d.title,WZ.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"}}}};var GZ=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).specKey="markArea",e.layoutZIndex=t.LayoutZIndex.MarkArea,e}return c(r,e),a(r,[{key:"_createMarkerComponent",value:function(){var t,e,i,n,r,a,o,s,l=this,u=lt(null!==(t=this._spec.label)&&void 0!==t?t:{}),c={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===(n=this._spec.interactive)||void 0===n||n,points:[{x:0,y:0}],center:{x:0,y:0},innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,areaStyle:MZ(pI(null===(r=this._spec.area)||void 0===r?void 0:r.style),this._markerData,this._markAttributeContext),clipInRange:null!==(a=this._spec.clip)&&void 0!==a&&a,label:u.map((function(t){return SZ(t,l._markerData,l._markAttributeContext)})),state:{area:AZ(null===(o=this._spec.area)||void 0===o?void 0:o.state,this._markerData,this._markAttributeContext),label:u.map((function(t){return AZ(t.state,l._markerData,l._markAttributeContext)})),labelBackground:u.map((function(t){var e;return AZ(null===(e=t.labelBackground)||void 0===e?void 0:e.state,l._markerData,l._markAttributeContext)}))},animation:null!==(s=this._spec.animation)&&void 0!==s&&s,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return this._newMarkAreaComponent(c)}},{key:"_markerLayout",value:function(){var t,e,i=this._spec,n=this._markerData,r=this._startRelativeSeries,a=this._endRelativeSeries,o=this._relativeSeries,s=this._computePointsAttr(),l=this._getRelativeDataView().latestData,u=n?n.latestData[0]&&n.latestData[0].latestData?n.latestData[0].latestData:n.latestData:l;if(i.clip||lt(i.label).some((function(t){return null==t?void 0:t.confine}))){var c=xZ([r.getRegion(),a.getRegion(),o.getRegion()]),h=c.minX,d=c.maxX,v=c.minY;e={x:h,y:v,width:d-h,height:c.maxY-v}}if(this._markerComponent){var f=lt(null===(t=this._markerComponent.attribute)||void 0===t?void 0:t.label),p=lt(this._spec.label);this._markerComponent.setAttributes(Object.assign(Object.assign({},s),{label:f.map((function(t,e){var i=p[e]||{};return Object.assign(Object.assign({},t),{text:i.formatMethod?i.formatMethod(u,l):null==t?void 0:t.text})})),limitRect:e,dx:this._layoutOffsetX,dy:this._layoutOffsetY}))}}},{key:"_initDataView",value:function(){var t=BZ(this._spec),e=t.doXProcess,i=t.doYProcess,n=t.doXYProcess,r=t.doAngleProcess,a=t.doRadiusProcess,o=t.doRadAngProcess,s=t.doCoordinatesProcess;if(!(e||i||n||r||a||o||s))return null;this._initCommonDataView()}}],[{key:"_getMarkerCoordinateType",value:function(t){var e=BZ(t),i=e.doAngleProcess,n=e.doRadiusProcess,r=e.doRadAngProcess;return"polar"===t.coordinateType||i||n||r?"polar":"cartesian"}}])}(DZ);GZ.specKey="markArea";var YZ={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"}}}}},XZ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=d.markArea,t.name=d.markArea,t.coordinateType="cartesian",t}return c(e,t),a(e,[{key:"_newMarkAreaComponent",value:function(t){return new aR(t)}},{key:"_computePointsAttr",value:function(){var t,e,i=this._spec,n=this._markerData,r=this._startRelativeSeries,a=this._endRelativeSeries,o=this._relativeSeries,s=BZ(i),l=s.doXProcess,u=s.doYProcess,c=s.doXYProcess,h=s.doCoordinatesProcess,d=C(i.positions),v=null!==(t=i.autoRange)&&void 0!==t&&t,f=null!==(e=i.includeFullBand)&&void 0!==e&&e,p=[];if(c){var g=m(pZ(n,r,a,o,v,f),2),y=g[0],_=g[1];y&&y.length&&_&&_.length&&(p=[{x:y[0].x,y:_[0].y},y[0],{x:_[0].x,y:y[0].y},_[0]])}else if(l||u){var k=m(pZ(n,r,a,o,v,f),2),x=k[0],S=k[1];x&&x.length&&S&&S.length&&(p=[].concat(b(x),[S[1],S[0]]))}else h?p=mZ(n,o,v,i.coordinatesOffset):d&&(p=kZ(i.positions,o,i.regionRelative));return{points:p}}},{key:"_computeOptions",value:function(){var t,e=this._spec,i=BZ(e),n=i.doXProcess,r=i.doYProcess,a=i.doXYProcess,o=i.doCoordinatesProcess;return a?t=[this._processSpecByDims([{dim:"x",specValue:e.x},{dim:"y",specValue:e.y}]),this._processSpecByDims([{dim:"x",specValue:e.x1},{dim:"y",specValue:e.y1}])]:n?t=[this._processSpecByDims([{dim:"x",specValue:e.x}]),this._processSpecByDims([{dim:"x",specValue:e.x1}])]:r?t=[this._processSpecByDims([{dim:"y",specValue:e.y}]),this._processSpecByDims([{dim:"y",specValue:e.y1}])]:o&&(t=this._processSpecCoo(e)),{options:t}}}])}(GZ);XZ.type=d.markArea,XZ.coordinateType="cartesian",XZ.builtInTheme={markArea:YZ};var KZ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=d.polarMarkArea,t.name=d.polarMarkArea,t.coordinateType="polar",t}return c(e,t),a(e,[{key:"_newMarkAreaComponent",value:function(t){var e=BZ(this._spec),i=e.doRadiusProcess,n=e.doAngleProcess,r=e.doRadAngProcess;return n||i||r?new sR(t):new aR(t)}},{key:"_computePointsAttr",value:function(){var t,e=this._spec,i=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,o=BZ(e),s=o.doAngleProcess,l=o.doRadiusProcess,u=o.doRadAngProcess,c=o.doCoordinatesProcess,h=null!==(t=e.autoRange)&&void 0!==t&&t,d={},v={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(s||l||u){var f=yZ(i,n,r,a,h);u?d={innerRadius:f[0][0].radius,outerRadius:f[1][0].radius,startAngle:f[0][0].angle,endAngle:f[1][0].angle,center:v}:s?d={innerRadius:0,outerRadius:Math.abs(f[0][0].radius),startAngle:f[0][1].angle,endAngle:f[1][1].angle,center:v}:l&&(d={innerRadius:f[0][0].radius,outerRadius:f[1][0].radius,startAngle:f[0][0].angle,endAngle:f[1][1].angle,center:v})}else c&&(d={points:_Z(i,a,h).map((function(t){return we(v,t.radius,t.angle)}))});return d}},{key:"_computeOptions",value:function(){var t,e=this._spec,i=BZ(e),n=i.doAngleProcess,r=i.doRadiusProcess,a=i.doRadAngProcess,o=i.doCoordinatesProcess;return a?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius1}])]:n?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius}])]:r?t=[this._processSpecByDims([{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"radius",specValue:e.radius1}])]:o&&(t=this._processSpecCoo(e)),{options:t}}}])}(GZ);KZ.type=d.polarMarkArea,KZ.coordinateType="polar",KZ.builtInTheme={polarMarkArea:YZ};var qZ=function(t){return pI(Object.assign({},t))},ZZ=function(t){return Object.assign(Object.assign({},t),{style:Object.assign({},pI(t.style))})},JZ=function(t){var e,i,n,r,a,o,s,l,u,c,h,d,v,f,p,g,y=qZ(null!==(i=null===(e=null==t?void 0:t.slider)||void 0===e?void 0:e.trackStyle)&&void 0!==i?i:{}),m=qZ(null!==(r=null===(n=null==t?void 0:t.slider)||void 0===n?void 0:n.railStyle)&&void 0!==r?r:{}),_=(g=null!==(o=null===(a=null==t?void 0:t.slider)||void 0===a?void 0:a.handlerStyle)&&void 0!==o?o:{},pI(Object.assign({},g))),b=ZZ(null!==(l=null===(s=null==t?void 0:t.controller)||void 0===s?void 0:s.start)&&void 0!==l?l:{}),k=ZZ(null!==(c=null===(u=null==t?void 0:t.controller)||void 0===u?void 0:u.pause)&&void 0!==c?c:{}),x=ZZ(null!==(d=null===(h=null==t?void 0:t.controller)||void 0===h?void 0:h.backward)&&void 0!==d?d:{}),S=ZZ(null!==(f=null===(v=null==t?void 0:t.controller)||void 0===v?void 0:v.forward)&&void 0!==f?f:{}),A=Object.assign(Object.assign({},t),{direction:t.direction,interval:t.interval,visible:t.visible,orient:null!==(p=t.orient)&&void 0!==p?p:"bottom",slider:Object.assign(Object.assign({},t.slider),{trackStyle:y,railStyle:m,handlerStyle:_}),controller:Object.assign(Object.assign({},t.controller),{start:b,pause:k,backward:x,forward:S})});return t.visible||(A.controller.visible=!1,A.slider.visible=!1),A},QZ=function(t){return"left"===t||"right"===t},$Z=function(t){return"top"===t||"bottom"===t},tJ={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}}}},eJ=function(r){function o(){var r;return n(this,o),(r=i(this,o,arguments)).layoutZIndex=t.LayoutZIndex.Player,r.layoutLevel=t.LayoutLevel.Player,r.specKey="player",r.type=d.player,r._orient="bottom",r._getPlayerAttrs=function(){var t,e,i,n,a,o,s,l,u=r._spec.type,c={size:{width:r._width,height:r._height},dx:null!==(t=r._spec.dx)&&void 0!==t?t:0+r._dx,dy:null!==(e=r._spec.dy)&&void 0!==e?e:0+r._dy};return"discrete"===u?Object.assign(Object.assign(Object.assign({},(s=r._spec,l=r._specs,Object.assign(Object.assign({},JZ(s)),{data:l,type:"discrete"}))),c),{disableTriggerEvent:r._option.disableTriggerEvent,loop:null===(n=null===(i=r._spec)||void 0===i?void 0:i.loop)||void 0===n||n}):Object.assign(Object.assign(Object.assign({},function(t,e){return Object.assign(Object.assign({},JZ(t)),{data:e,type:"continuous"})}(r._spec,r._specs)),c),{disableTriggerEvent:r._option.disableTriggerEvent,loop:null===(o=null===(a=r._spec)||void 0===a?void 0:a.loop)||void 0===o||o})},r._createOrUpdatePlayerComponent=function(){var t=Object.assign({},r._getPlayerAttrs()),e=r.getContainer();r._playerComponent?at(t,r._cacheAttrs)||(r._cacheAttrs=t,r._playerComponent.setAttributes(t),r._playerComponent._initAttributes(),r._playerComponent.render()):("discrete"===t.type?r._playerComponent=new qR(t):r._playerComponent=new JR(t),r._cacheAttrs=t,r._playerComponent.name="player",e.add(r._playerComponent),r._initEvent())},r._maxSize=function(){var t,e,i,n,a,o,s,l,u;return Math.max.apply(Math,b(lt(null===(e=null===(t=r._spec.controller.start)||void 0===t?void 0:t.style)||void 0===e?void 0:e.size)).concat(b(lt(null===(n=null===(i=r._spec.controller.pause)||void 0===i?void 0:i.style)||void 0===n?void 0:n.size)),b(lt(null===(o=null===(a=r._spec.controller.backward)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size)),b(lt(null===(l=null===(s=r._spec.controller.forward)||void 0===s?void 0:s.style)||void 0===l?void 0:l.size)),[null!==(u=QZ(r._orient)?r._spec.slider.railStyle.width:r._spec.slider.railStyle.height)&&void 0!==u?u:10]))},r._sliderExceededSize=function(){var t,e,i,n,a,o,s,l,u,c=null!==(t=QZ(r._orient)?r._spec.slider.railStyle.width:r._spec.slider.railStyle.height)&&void 0!==t?t:10,h=Math.max.apply(Math,b(lt(null===(i=null===(e=r._spec.controller.start)||void 0===e?void 0:e.style)||void 0===i?void 0:i.size)).concat(b(lt(null===(a=null===(n=r._spec.controller.pause)||void 0===n?void 0:n.style)||void 0===a?void 0:a.size)),b(lt(null===(s=null===(o=r._spec.controller.backward)||void 0===o?void 0:o.style)||void 0===s?void 0:s.size)),b(lt(null===(u=null===(l=r._spec.controller.forward)||void 0===l?void 0:l.style)||void 0===u?void 0:u.size))));return c>=h?c-h:0},r._initEvent=function(){r._option.disableTriggerEvent||(r._option.globalInstance.on(t.ChartEvent.rendered,(function(){var t;(null===(t=r._spec)||void 0===t?void 0:t.auto)&&(r._playerComponent.pause(),r._playerComponent.play())})),r._playerComponent.addEventListener(HR.end,(function(){var i;r.event.emit(t.ChartEvent.playerEnd,{model:e(r)}),r._alternate&&"discrete"===r._spec.type&&(r._direction="default"===r._direction?"reverse":"default",r._playerComponent.setAttributes({direction:r._direction,dataIndex:"reverse"===r._direction?r._specs.length-2:1})),(null===(i=r._spec)||void 0===i?void 0:i.loop)&&r._playerComponent.play()})),r._playerComponent.addEventListener(HR.change,(function(t){var e=t.detail.index;r.changePlayerIndex(e)})),r._playerComponent.addEventListener(HR.backward,(function(i){var n=i.detail.index,a=r._specs[n];r.event.emit(t.ChartEvent.playerBackward,{model:e(r),value:{spec:a,index:n,specs:r._specs}})})),r._playerComponent.addEventListener(HR.forward,(function(i){var n=i.detail.index,a=r._specs[n];r.event.emit(t.ChartEvent.playerForward,{model:e(r),value:{spec:a,index:n,specs:r._specs}})})),r._playerComponent.addEventListener(HR.play,(function(i){var n=i.detail.index,a=r._specs[n];r.event.emit(t.ChartEvent.playerPlay,{model:e(r),value:{spec:a,index:n,specs:r._specs}})})),r._playerComponent.addEventListener(HR.pause,(function(i){var n=i.detail.index,a=r._specs[n];r.event.emit(t.ChartEvent.playerPause,{model:e(r),value:{spec:a,index:n,specs:r._specs}})})))},r}return c(o,r),a(o,[{key:"orient",get:function(){return this._orient}},{key:"layoutOrient",set:function(t){this._orient=t}},{key:"setAttrFromSpec",value:function(){var t,e,i,n,r,a,s,l;_(o,"setAttrFromSpec",this,3)([]),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!==(n=this._spec.alternate)&&void 0!==n&&n,this._dx=null!==(r=this._spec.dx)&&void 0!==r?r:0,this._dy=null!==(a=this._spec.dy)&&void 0!==a?a:0,this._position=null!==(s=this._spec.position)&&void 0!==s?s:"middle",this._visible=null===(l=this._spec.visible)||void 0===l||l}},{key:"afterSetLayoutStartPoint",value:function(t){if(_(o,"afterSetLayoutStartPoint",this,3)([t]),z(t.x)){var e=QZ(this._orient)?t.x+this._sliderExceededSize()/2:t.x;this._playerComponent&&this._playerComponent.setAttribute("x",e)}if(z(t.y)){var i=$Z(this._orient)?t.y+this._sliderExceededSize()/2:t.y;this._playerComponent&&this._playerComponent.setAttribute("y",i)}}},{key:"getBoundsInRect",value:function(t,e){this._width=this._computeWidth(t),this._height=this._computeHeight(t),this._dx=this._computeDx(e),this._dy=this._computeDy(e);var i=this._computeLayoutRect(t,this._width,this._height);return this._createOrUpdatePlayerComponent(),i}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._playerComponent]}},{key:"_computeLayoutRect",value:function(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}}}},{key:"_computeWidth",value:function(t){return F(this._spec.width)?Math.min(t.width,Number(this._spec.width)):QZ(this._orient)?this._maxSize():t.width}},{key:"_computeHeight",value:function(t){return F(this._spec.height)?(this._height=this._spec.height,Math.min(t.height,Number(this._spec.height))):$Z(this._orient)?this._maxSize():t.height}},{key:"_computeDx",value:function(t){return QZ(this._orient)||"start"===this._position?0:"middle"===this._position?(t.width-this._width)/2:t.width-this._width}},{key:"_computeDy",value:function(t){return $Z(this._orient)||"start"===this._position?0:"middle"===this._position?(t.height-this._height)/2:t.height-this._height}},{key:"changePlayerIndex",value:function(e){var 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}})}}])}(vz);eJ.builtInTheme={player:tJ},eJ.specKey="player",eJ.type=d.player;var iJ=function(e){function r(e,a){var o;return n(this,r),(o=i(this,r,[e,a])).type=d.label,o.name=d.label,o.layoutType="none",o.layoutZIndex=t.LayoutZIndex.Label,o._regions=a.getRegionsInIndex(a.regionIndexes),o}return c(r,e),a(r,[{key:"_interactiveConfig",value:function(t){var e=t.interactive,i={hover:!1,select:!1,state:t.state};if(!0!==e)return i;var n=this._option.getChart().getSpec(),r=n.hover,a=n.select;return!1===r&&!1===r.enable||(i.hover=!0),!1===a&&!1===a.enable||(i.select=!0),i}},{key:"_compareSpec",value:function(t,e){var i=_(r,"_compareSpec",this,3)([t,e]);return i.reRender=!0,at(e,t)||(i.reMake=!0),i}},{key:"_getDataLabelType",value:function(t,e){var 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():""}},{key:"_setTransformOfComponent",value:function(t,e){var i=this;t.setAttributeTransform((function(t){var n=t.labelStyle,r=t.size,a=t.itemEncoder,o=r(),s=BL({type:"palette",key:"secondaryFontColor"},i.getColorScheme());return{dataLabels:lt(e).map((function(t,e){var r=n(e),l=[],u=t.getGraphics();if(u)return r.data&&r.data.length?r.data.forEach((function(t,i){if(u[i]){var n=a(t,{labelIndex:e});T(n.fill)&&(n.fill=s),T(n.data)&&(n.data=t),l.push(n)}})):u.forEach((function(t){var i=t.context,n=i.data;i.diffState!==iD.exit&&n.forEach((function(t,i){!function(t){if(null==t)throw new TypeError("Cannot destructure "+t)}(i);var n=a(t,{labelIndex:e});T(n.fill)&&(n.fill=s),T(n.data)&&(n.data=t),l.push(n)}))})),P(r.overlap)&&T(r.overlap.size)&&(r.overlap.size=Object.assign({},o)),Object.assign(Object.assign({smartInvert:!1,baseMarkGroupName:t.getProductId(),getBaseMarks:function(){return u}},r),{type:i._getDataLabelType(t,r.type),data:l})})),size:o}}))}},{key:"getVRenderComponents",value:function(){var t=[];return this.getMarks().forEach((function(e){var i=e.getComponent();i&&t.push(i)})),t}},{key:"clear",value:function(){_(r,"clear",this,3)([]),this.getMarks().forEach((function(t){t&&t.clearComponent()}))}}])}(vz);iJ.type=d.label;var nJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).skipEncode=!1,t}return c(e,t),a(e,[{key:"getRule",value:function(){return this._rule}},{key:"setRule",value:function(t){this._rule=t}},{key:"getTarget",value:function(){return this._target}},{key:"setTarget",value:function(t){this._target=t,this._rule||this.setRule(t.type)}},{key:"getComponent",value:function(){return this._component}},{key:"setComponent",value:function(t){this._component=t}},{key:"render",value:function(){}}])}(WV);nJ.type="text",nJ.constructorType="label";var rJ=function(){GV(),rO.registerMark(nJ.constructorType,nJ)},aJ=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e,[{key:"_initTheme",value:function(t,e){return{spec:t,theme:this._theme}}}])}(dz),oJ=function(e){function r(e,a){var o;return n(this,r),(o=i(this,r,[e,a])).type=d.label,o.name=d.label,o.specKey="label",o.transformerConstructor=aJ,o.layoutZIndex=t.LayoutZIndex.Label,o._layoutRule=e.labelLayout||"series",o}return c(r,e),a(r,[{key:"init",value:function(t){_(r,"init",this,3)([t]),this.initEvent(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}},{key:"reInit",value:function(t){_(r,"reInit",this,3)([t]),this._labelInfoMap&&(this._labelInfoMap.forEach((function(t){t.forEach((function(t){t.labelMark.release()}))})),this._labelInfoMap.clear()),this._labelInfoMap&&this._labelInfoMap.clear(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}},{key:"initEvent",value:function(){var e=this;this.event.on(t.ChartEvent.dataZoomChange,(function(){e._labelComponentMap.forEach((function(t,e){var i=e.getComponent();i&&i.disableAnimation()})),e.event.on(gI.AFTER_MARK_RENDER_END,i)}));var i=function(){e._labelComponentMap.forEach((function(t,e){var i=e.getComponent();i&&i.enableAnimation()})),e.event.off(gI.AFTER_MARK_RENDER_END,i)}}},{key:"_initTextMark",value:function(){var t=this;this._labelInfoMap||(this._labelInfoMap=new Map),this._labelComponentMap||(this._labelComponentMap=new Map),gL(this._regions,(function(e){var i=e.getSpecInfo().markLabelSpec,n=void 0===i?{}:i,r=Object.keys(n),a=e.getRegion();t._labelInfoMap.get(a)||t._labelInfoMap.set(a,[]);for(var o=function(){var i=r[s],o=e.getMarkInName(i);o&&n[i].forEach((function(n,r){var s,l,u;if(n.visible){var c=t._labelInfoMap.get(a),h=t._createMark({type:"label",name:"".concat(null!==(s=e.userId)&&void 0!==s?s:e.id,"-").concat(i,"-label-").concat(r)},{attributeContext:e.getMarkAttributeContext()});n.showRelatedMarkTooltip&&(null===(u=null===(l=e.tooltipHelper)||void 0===l?void 0:l.activeTriggerSet.mark)||void 0===u||u.add(h)),h.setTarget(o),c.push({labelMark:h,baseMark:o,series:e,labelSpec:n})}}))},s=0;s<r.length;s++)o()}))}},{key:"_initLabelComponent",value:function(){var t=this,e={};this._labelComponentMap.forEach((function(t,i){e[i.name]=i})),this._labelInfoMap.forEach((function(i,n){if("region"===t._layoutRule){var r=!1,a="".concat(n.getGroupMark().name,"-label-component"),o=e[a];o||(r=!0,o=t._createMark({type:"component",name:a},{componentType:"label"},{support3d:t._spec.support3d})),o&&(r&&(o.setSkipBeforeLayouted(!0),t._marks.addMark(o),i.forEach((function(t){var e;null===(e=t.baseMark.getData())||void 0===e||e.addRelatedMark(o)}))),i[0]&&C(i[0].labelSpec.zIndex)&&o.setMarkConfig({zIndex:i[0].labelSpec.zIndex}),t._labelComponentMap.set(o,(function(){return t._labelInfoMap.get(n)})),e[a]=null)}else i.forEach((function(i,r){var a,o=!1,s="".concat(i.labelMark.name,"-component"),l=e[s];l||(o=!0,l=t._createMark({type:"component",name:s},{componentType:"label",noSeparateStyle:!0},{support3d:i.baseMark.getMarkConfig().support3d})),l&&(C(i.labelSpec.zIndex)&&l.setMarkConfig({zIndex:i.labelSpec.zIndex}),o&&(l.setSkipBeforeLayouted(!0),t._marks.addMark(l),null===(a=i.baseMark.getData())||void 0===a||a.addRelatedMark(l)),t._labelComponentMap.set(l,(function(){return t._labelInfoMap.get(n)[r]})),e[s]=null)}))})),Object.keys(e).forEach((function(i){var n=e[i];n&&(n.release(),t._labelComponentMap.delete(n))}))}},{key:"_initTextMarkStyle",value:function(){var e=this;this._labelComponentMap.forEach((function(t,e){lt(t()).forEach((function(t){t.labelMark.setComponent(e)}))})),this._labelInfoMap.forEach((function(i){i.forEach((function(i){var n,r,a=i.labelMark,o=i.labelSpec,s=i.series;if(e.initMarkStyleWithSpec(a,o),w(null==o?void 0:o.getStyleHandler)){var l=o.getStyleHandler(s);null==l||l.call(s,a,o)}(null===(r=null===(n=a.stateStyle)||void 0===n?void 0:n.normal)||void 0===r?void 0:r.lineWidth)&&a.setAttribute("stroke",s.getColorAttribute(),"normal",t.AttributeLevel.Base_Series)}))}))}},{key:"updateLayoutAttribute",value:function(){var t=this;_(r,"updateLayoutAttribute",this,3)([]),this._labelComponentMap.forEach((function(e,i){var n=e();O(n)?t._updateMultiLabelAttribute(n,i):t._updateSingleLabelAttribute(n,i)}))}},{key:"_updateMultiLabelAttribute",value:function(t,e){this._updateLabelComponentAttribute(e,t.map((function(t){return t.baseMark})),t)}},{key:"_updateSingleLabelAttribute",value:function(t,e){var i=t.baseMark;this._updateLabelComponentAttribute(e,i,[t])}},{key:"_updateLabelComponentAttribute",value:function(t,e,i){var n=this,r=this._option.getComponentsByType("totalLabel");t.setMarkConfig({interactive:!1}),t.setSimpleStyle({labelStyle:function(t){var e,a,o=i[t],s=o.labelSpec,l=o.labelMark,u=o.series,c=l.getRule(),h=n._interactiveConfig(s),d=null!==(a=null===(e=n._spec)||void 0===e?void 0:e.centerOffset)&&void 0!==a?a:0,v=nO({textStyle:Object.assign({pickable:!0===s.interactive},s.style),overlap:{avoidMarks:r.map((function(t){return t.getMarks()[0].getProductId()}))}},uV(c,o),Object.assign(Object.assign(Object.assign({},it(s,["position","style","state","type","stackDataFilterType","getStyleHandler"])),h),{centerOffset:d}),s.stackDataFilterType?{dataFilter:"min"===s.stackDataFilterType?function(t){return t.filter((function(t){return t.data[GO]}))}:function(t){return t.filter((function(t){return t.data[WO]}))}}:{});return u&&u.parseLabelStyle&&(v=u.parseLabelStyle(v,s,l)),"line"!==c&&"area"!==c||(v.type=c),v},size:function(){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:function(t,e){var n=e.labelIndex;return i[n]&&!i[n].labelMark.skipEncode?cV(i[n],t,i[n].labelSpec.formatMethod,i[n].labelSpec.formatter):{data:t}}}),this._setTransformOfComponent(t,e)}},{key:"compileMarks",value:function(){var t=this;this.getMarks().forEach((function(e){var i,n=t._labelComponentMap.get(e)();i=O(n)?n[0].series.getRegion().getGroupMark().getProduct():n.series.getRegion().getGroupMark().getProduct(),e.compile({group:i})}))}},{key:"getLabelInfoByTextGraphic",value:function(t){var e,i=null==t?void 0:t.parent,n=null==i?void 0:i.parent;if(n){var r=n.getChildren().indexOf(i);this._labelComponentMap.forEach((function(t,i){i.getComponent()===n&&(e=lt(t())[r])}))}return e}}],[{key:"getSpecInfo",value:function(t,e){var i=this,n=[];return((null==e?void 0:e.region)||[]).forEach((function(r,a){(r.seriesIndexes||[]).some((function(t){var i=e.series[t].markLabelSpec,n=void 0===i?{}:i;return Object.values(n).some((function(t){return Array.isArray(t)&&function(t){return t.some((function(t){return t.visible}))}(t)}))}))&&n.push({spec:t,type:d.label,specInfoPath:["component",i.specKey,a],regionIndexes:[a]})})),n}}])}(iJ);oJ.type=d.label,oJ.specKey="label",oJ.transformerConstructor=aJ;var sJ=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).type=d.totalLabel,e.name=d.totalLabel,e.specKey="totalLabel",e.layoutZIndex=t.LayoutZIndex.Label,e}return c(r,e),a(r,[{key:"init",value:function(t){_(r,"init",this,3)([t]),this._initTextMark(),this._initLabelComponent()}},{key:"reInit",value:function(t){_(r,"reInit",this,3)([t]),this._initTextMark()}},{key:"_initTextMark",value:function(){var t,e=this._getSeries();if(null===(t=e.getSpec().totalLabel)||void 0===t?void 0:t.visible){var i=e.getSeriesMark();if(i){var n=this._createMark({type:"label",name:"".concat(i.name,"-total-label")});this._baseMark=i,this._textMark=n,this._initTextMarkStyle()}}}},{key:"_initTextMarkStyle",value:function(){var e;_(r,"initMarkStyleWithSpec",this,3)([this._textMark,this._spec]),this.setMarkStyle(this._textMark,{text:function(t){return t[VO]}},"normal",t.AttributeLevel.Default);var i=this._getSeries();null===(e=i.initTotalLabelMarkStyle)||void 0===e||e.call(i,this._textMark)}},{key:"_initLabelComponent",value:function(){var t,e=this._getSeries(),i=this._createMark({type:"component",name:"".concat(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))}},{key:"updateLayoutAttribute",value:function(){var t=this;_(r,"updateLayoutAttribute",this,3)([]);var e=this._getSeries();this._marks.forEach((function(i,n){i.setMarkConfig({interactive:!1}),i.setSimpleStyle({labelStyle:function(){var i,n;if(t._baseMark){var r=t._spec,a=r.offset,o=r.animation,s=r.overlap,l=r.position,u=void 0===l?"top":l,c=t._interactiveConfig(t._spec);return nO({textStyle:{pickable:!0===t._spec.interactive},position:lJ(e,t._baseMark.type,u),x:0,y:0},null!==(n=null===(i=e.getTotalLabelComponentStyle)||void 0===i?void 0:i.call(e,{baseMark:t._baseMark,labelMark:t._textMark}))&&void 0!==n?n:{},Object.assign({offset:a,animation:o,overlap:s,dataFilter:function(t){return t.filter((function(t){return"bottom"===u?t.data[GO]:t.data[WO]}))}},c))}},size:function(){var e;return Object.assign({padding:null===(e=t._spec.overlap)||void 0===e?void 0:e.padding},t._regions[0].getLayoutRect())},itemEncoder:function(i){return cV({baseMark:t._baseMark,labelMark:t._textMark,series:e,labelSpec:e.getSpec().totalLabel},i,t._spec.formatMethod)}}),t._setTransformOfComponent(i,t._baseMark)}))}},{key:"compileMarks",value:function(){var t=this;this.getMarks().forEach((function(e){var i=t._regions[0].getGroupMark().getProduct();e.compile({group:i,context:{model:t}})}))}},{key:"_getSeries",value:function(){return this._option.getSeriesInIndex([this.getSpecPath()[1]])[0]}}],[{key:"getSpecInfo",value:function(t,e){var i,n=this,r=[];return null===(i=null==e?void 0:e.region)||void 0===i||i.forEach((function(t,i){var a;null===(a=t.seriesIndexes)||void 0===a||a.forEach((function(t){var a=e.series[t].spec[n.specKey];(null==a?void 0:a.visible)&&r.push({spec:a,type:d.totalLabel,specPath:["series",t,n.specKey],specInfoPath:["component",n.specKey,t],regionIndexes:[i],seriesIndexes:[t]})}))})),r}}])}(iJ);function lJ(t,e){var i,n,r,a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",s=t.direction;a="bottom"===o?{vertical:["bottom","top"],horizontal:["left","right"]}:{vertical:["top","bottom"],horizontal:["right","left"]};var l=("horizontal"===s?null===(i=t.getXAxisHelper())||void 0===i?void 0:i.isInverse():null===(n=t.getYAxisHelper())||void 0===n?void 0:n.isInverse())?1:0;switch(e){case"rect":case"symbol":r=a[s][l];break;default:r="top"}return r}sJ.type=d.totalLabel,sJ.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"}}}},sJ.specKey="totalLabel";var uJ=function(e){function o(){var e;return n(this,o),(e=i(this,o,arguments)).specKey="markPoint",e.layoutZIndex=t.LayoutZIndex.MarkPoint,e}return c(o,e),a(o,[{key:"_createMarkerComponent",value:function(){var t,e,i,n,a,o,s,l,u,c,h,d,v,f,p,g,y,m,_,b,k,x,S,A,M,w,T,C,E,B,P,R,L,O=this._spec,I=O.itemContent,D=void 0===I?{}:I,F=O.itemLine,j=void 0===F?{}:F,z=O.targetSymbol,H=void 0===z?{}:z,N=D,V=N.type,U=void 0===V?"text":V,W=N.text,G=N.symbol,Y=N.image,X=N.richText,K=N.customMark,q=N.textStyle,Z=N.symbolStyle,J=N.imageStyle,Q=N.richTextStyle,$=N.customMarkStyle,tt=N.style,it=void 0===tt?{}:tt,nt=N.state,rt=void 0===nt?{}:nt,at=r(N,["type","text","symbol","image","richText","customMark","textStyle","symbolStyle","imageStyle","richTextStyle","customMarkStyle","style","state"]),ot=null,st=null,lt={};"text"===U?(ot=null!==(t=null==W?void 0:W.state)&&void 0!==t?t:rt,lt={dx:0,dy:0},st=SZ(Object.assign(Object.assign({},W),{style:et(lt,null!==(i=null!==(e=null==W?void 0:W.textStyle)&&void 0!==e?e:q)&&void 0!==i?i:it)}),this._markerData,this._markAttributeContext)):"richText"===U?(ot=null!==(n=null==X?void 0:X.state)&&void 0!==n?n:rt,st=MZ(et(lt={width:100,height:100},null!==(o=null!==(a=null==X?void 0:X.style)&&void 0!==a?a:Q)&&void 0!==o?o:it),this._markerData,this._markAttributeContext)):"symbol"===U?(ot=null!==(s=null==G?void 0:G.state)&&void 0!==s?s:rt,st=pI(MZ(et(lt={symbolType:"star",fill:"rgb(48, 115, 242)",fillOpacity:.8,size:20},null!==(u=null!==(l=null==G?void 0:G.style)&&void 0!==l?l:Z)&&void 0!==u?u:it),this._markerData,this._markAttributeContext))):"image"===U?(ot=null!==(c=null==Y?void 0:Y.state)&&void 0!==c?c:rt,st=MZ(et(lt={width:80,height:80},null!==(d=null!==(h=null==Y?void 0:Y.style)&&void 0!==h?h:J)&&void 0!==d?d:it),this._markerData,this._markAttributeContext)):"custom"===U&&(ot=null!==(v=null==K?void 0:K.state)&&void 0!==v?v:rt,st=MZ(null!==(p=null!==(f=null==K?void 0:K.style)&&void 0!==f?f:$)&&void 0!==p?p:it,this._markerData,this._markAttributeContext));var ut={zIndex:this.layoutZIndex,interactive:null===(g=this._spec.interactive)||void 0===g||g,hover:null===(y=this._spec.interactive)||void 0===y||y,select:null===(m=this._spec.interactive)||void 0===m||m,position:{x:0,y:0},clipInRange:null!==(_=this._spec.clip)&&void 0!==_&&_,itemContent:Object.assign(Object.assign({type:U,offsetX:wZ(D.offsetX,this._relativeSeries.getRegion()),offsetY:wZ(D.offsetX,this._relativeSeries.getRegion())},at),{style:MZ(st,this._markerData,this._markAttributeContext)}),targetSymbol:{offset:null!==(b=H.offset)&&void 0!==b?b:0,visible:null!==(k=H.visible)&&void 0!==k&&k,size:null!==(x=H.size)&&void 0!==x?x:20,style:MZ(H.style,this._markerData,this._markAttributeContext)},state:{line:AZ(null!==(A=null===(S=this._spec.itemLine.line)||void 0===S?void 0:S.state)&&void 0!==A?A:{},this._markerData,this._markAttributeContext),lineStartSymbol:AZ(null!==(w=null===(M=this._spec.itemLine.startSymbol)||void 0===M?void 0:M.state)&&void 0!==w?w:{},this._markerData,this._markAttributeContext),lineEndSymbol:AZ(null!==(C=null===(T=this._spec.itemLine.endSymbol)||void 0===T?void 0:T.state)&&void 0!==C?C:{},this._markerData,this._markAttributeContext),itemContent:AZ(ot,this._markerData,this._markAttributeContext),textBackground:AZ(null===(B=null===(E=this._spec.itemContent.text)||void 0===E?void 0:E.labelBackground)||void 0===B?void 0:B.state,this._markerData,this._markAttributeContext),targetItem:AZ(null!==(R=null===(P=this._spec.targetSymbol)||void 0===P?void 0:P.state)&&void 0!==R?R:{},this._markerData,this._markAttributeContext)},animation:null!==(L=this._spec.animation)&&void 0!==L&&L,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate},ct=j.visible,ht=j.line,dt=void 0===ht?{}:ht,vt=r(j,["visible","line"]);return ut.itemLine=!1!==ct?Object.assign(Object.assign({},vt),{visible:!0,lineStyle:pI(dt.style)}):{visible:!1},new uR(ut)}},{key:"_markerLayout",value:function(){var t,e,i,n,r,a,o=this._spec,s=this._markerData,l=this._relativeSeries,u=this._computePointsAttr().point,c=this._getRelativeDataView().latestData,h=s?s.latestData[0]&&s.latestData[0].latestData?s.latestData[0].latestData:s.latestData:c;if(o.clip||(null===(t=o.itemContent)||void 0===t?void 0:t.confine)){var d=xZ([l.getRegion()]),v=d.minX,f=d.maxX,p=d.minY;a={x:v,y:p,width:f-v,height:d.maxY-p}}if(this._markerComponent){var g=null!==(e=this._markerComponent.attribute)&&void 0!==e?e:{},y=null!==(n=null===(i=g.itemContent)||void 0===i?void 0:i.textStyle)&&void 0!==n?n:{};this._markerComponent.setAttributes({position:void 0===u?{x:null,y:null}:u,itemContent:Object.assign(Object.assign({},g.itemContent),{textStyle:Object.assign(Object.assign({},y),{text:(null===(r=this._spec.itemContent.text)||void 0===r?void 0:r.formatMethod)?this._spec.itemContent.text.formatMethod(h,c):y.text}),offsetX:TZ(u,g.itemContent.offsetX,this._relativeSeries.getRegion()),offsetY:TZ(u,g.itemContent.offsetY,this._relativeSeries.getRegion())}),limitRect:a,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}}},{key:"_initDataView",value:function(){var t=this._spec,e=PZ(t),i=e.doXYProcess,n=e.doPolarProcess,r=e.doGeoProcess;(C(t.coordinate)||i||n||r)&&this._initCommonDataView()}}],[{key:"_getMarkerCoordinateType",value:function(t){var e=PZ(t),i=e.doPolarProcess,n=e.doGeoProcess;return"polar"===t.coordinateType||i?"polar":"geo"===t.coordinateType||n?"geo":"cartesian"}}])}(DZ);uJ.specKey="markPoint";var cJ={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}},hJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=d.markPoint,t.name=d.markPoint,t.coordinateType="cartesian",t}return c(e,t),a(e,[{key:"_computePointsAttr",value:function(){var t,e,i,n,r=this._spec,a=this._markerData,o=this._relativeSeries,s=C(r.x)&&C(r.y),l=C(r.coordinate),u=C(r.position),c=null!==(t=null==r?void 0:r.autoRange)&&void 0!==t&&t;return s?n=null===(i=null===(e=pZ(a,o,o,o,c))||void 0===e?void 0:e[0])||void 0===i?void 0:i[0]:l?n=mZ(a,o,c,r.coordinatesOffset)[0]:u&&(n=kZ(r.position,o,r.regionRelative)[0]),{point:n}}},{key:"_computeOptions",value:function(){var t,e=this._spec,i=PZ(e).doXYProcess,n=C(e.coordinate);return i?t=[this._processSpecByDims([{dim:"x",specValue:e.x},{dim:"y",specValue:e.y}])]:n&&(t=this._processSpecCoo(e)),{options:t}}}])}(uJ);hJ.type=d.markPoint,hJ.coordinateType="cartesian",hJ.builtInTheme={markPoint:cJ};var dJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=d.polarMarkPoint,t.name=d.polarMarkPoint,t.coordinateType="polar",t}return c(e,t),a(e,[{key:"_computePointsAttr",value:function(){var t,e,i=this._markerData,n=this._relativeSeries,r=yZ(i,n,n,n,null!==(e=null===(t=this._spec)||void 0===t?void 0:t.autoRange)&&void 0!==e&&e)[0][0];return{point:we({x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y},r.radius,r.angle)}}},{key:"_computeOptions",value:function(){var t=this._spec;return{options:[this._processSpecByDims([{dim:"radius",specValue:t.radius},{dim:"angle",specValue:t.angle}])]}}}])}(uJ);dJ.type=d.polarMarkPoint,dJ.coordinateType="polar",dJ.builtInTheme={polarMarkPoint:cJ};var vJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=d.geoMarkPoint,t.name=d.geoMarkPoint,t.coordinateType="geo",t}return c(e,t),a(e,[{key:"_computePointsAttr",value:function(){var t=function(t,e){var i=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((function(t){C(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}}},{key:"_computeOptions",value:function(){var t=this._spec;return{options:[this._processSpecByDims([{dim:"areaName",specValue:t.areaName}])]}}}])}(uJ);vJ.type=d.geoMarkPoint,vJ.coordinateType="geo",vJ.builtInTheme={geoMarkPoint:cJ};var fJ="inBrush",pJ="outOfBrush",gJ=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).layoutType="none",e.type=d.brush,e.name=d.brush,e.specKey="brush",e.layoutZIndex=t.LayoutZIndex.Brush,e._linkedSeries=[],e._itemMap={},e._linkedItemMap={},e._inBrushElementsMap={},e._outOfBrushElementsMap={},e._linkedInBrushElementsMap={},e._linkedOutOfBrushElementsMap={},e._cacheInteractiveRangeAttrs=[],e._releatedAxes=[],e._regionAxisMap={},e._axisDataZoomMap={},e._zoomRecord=[],e}return c(r,e),a(r,[{key:"init",value:function(){var e=this._transformBrushedMarkAttr(this._spec.inBrush),i=this._transformBrushedMarkAttr(this._spec.outOfBrush);this._option.getAllSeries().forEach((function(n){n.getActiveMarks().forEach((function(r){r&&(n.setMarkStyle(r,Object.assign({},e),fJ,t.AttributeLevel.Series),n.setMarkStyle(r,Object.assign({},i),pJ,t.AttributeLevel.Series))}))}))}},{key:"_initNeedOperatedItem",value:function(){var t=this,e=this._spec.seriesId,i=this._spec.seriesIndex;this._relativeRegions.forEach((function(n){var r=[];n.getSeries().forEach((function(a){(e&&lt(e).includes(a.userId.toString())||i&&lt(i).includes(a.getSpecIndex())||!i&&!e)&&r.push.apply(r,b(a.getMarksWithoutRoot())),t._itemMap[n.id]=r}))})),this._linkedSeries.forEach((function(e){t._linkedItemMap[e.id]=e.getMarksWithoutRoot()}))}},{key:"created",value:function(){_(r,"created",this,3)([]),this.initEvent(),this._bindRegions(),this._bindLinkedSeries(),this._initRegionAxisMap(),this._initAxisDataZoomMap(),this._initNeedOperatedItem()}},{key:"_bindRegions",value:function(){C(this._spec.regionId)||C(this._spec.regionIndex)?this._relativeRegions=this._option.getRegionsInUserIdOrIndex(lt(this._spec.regionId),lt(this._spec.regionIndex)):this._relativeRegions=this._option.getAllRegions()}},{key:"_bindLinkedSeries",value:function(){(C(this._spec.brushLinkSeriesId)||C(this._spec.brushLinkSeriesIndex))&&(this._linkedSeries=this._option.getSeriesInUserIdOrIndex(lt(this._spec.brushLinkSeriesId),lt(this._spec.brushLinkSeriesIndex)))}},{key:"_initRegionAxisMap",value:function(){var t=this;C(this._spec.axisId)?lt(this._spec.axisId).forEach((function(e){t._releatedAxes.push(t._option.getComponentByUserId(e))})):C(this._spec.axisIndex)?lt(this._spec.axisIndex).forEach((function(e){t._releatedAxes.push(t._option.getComponentByIndex("axes",e))})):this._releatedAxes=this._option.getComponentsByKey("axes"),this._releatedAxes.forEach((function(e){null==e||e.getRegions().forEach((function(i){t._regionAxisMap["region_"+i.id]?t._regionAxisMap["region_"+i.id].push(e):t._regionAxisMap["region_"+i.id]=[e]}))}))}},{key:"_initAxisDataZoomMap",value:function(){var t=this;this._option.getComponentsByKey("dataZoom").forEach((function(e){e.relatedAxisComponent&&(t._axisDataZoomMap[e.relatedAxisComponent.id]=e)}))}},{key:"initEvent",value:function(){}},{key:"_compareSpec",value:function(t,e){var i=this;this._brushComponents&&this._relativeRegions.forEach((function(t,e){i._updateBrushComponent(t,e)}));var n=_(r,"_compareSpec",this,3)([t,e]);return at(e,t)||(n.reRender=!0,n.reMake=!0),n}},{key:"onLayoutEnd",value:function(){var t,e=this;_(r,"onLayoutEnd",this,3)([]),this._option.disableTriggerEvent||(null===(t=this._spec.visible)||void 0===t||t)&&(this._brushComponents?this._relativeRegions.forEach((function(t,i){e._updateBrushComponent(t,i)})):(this._brushComponents=[],this._relativeRegions.forEach((function(t,i){e._createBrushComponent(t,i)}))))}},{key:"_updateBrushComponent",value:function(t,e){var i=this._getBrushInteractiveAttr(t),n=this._brushComponents[e];n.setAttributes(i),this._initMarkBrushState(e,""),n.children[0].removeAllChild()}},{key:"_createBrushComponent",value:function(e,i){var n,r,a=this,o=this._getBrushInteractiveAttr(e),s=new eL(Object.assign(Object.assign(Object.assign({zIndex:this.layoutZIndex,brushStyle:pI(null===(n=this._spec)||void 0===n?void 0:n.style)},o),this._spec),{disableTriggerEvent:this._option.disableTriggerEvent}));s.id=null!==(r=this._spec.id)&&void 0!==r?r:"brush-".concat(this.id),this.getContainer().add(s),this._brushComponents.push(s),this._cacheInteractiveRangeAttrs.push(o),s.addEventListener(KR.brushActive,(function(n){a._initMarkBrushState(i,pJ),a._emitEvent(t.ChartEvent.brushActive,e)})),s.addEventListener(KR.drawStart,(function(i){a._setRegionMarkPickable(e,!0),a._emitEvent(t.ChartEvent.brushStart,e)})),s.addEventListener(KR.moveStart,(function(i){a._setRegionMarkPickable(e,!0),a._emitEvent(t.ChartEvent.brushStart,e)})),s.addEventListener(KR.drawing,(function(i){a._setRegionMarkPickable(e,!1),a._handleBrushChange(e,i),a._emitEvent(t.ChartEvent.brushChange,e)})),s.addEventListener(KR.moving,(function(i){a._setRegionMarkPickable(e,!1),a._handleBrushChange(e,i),a._emitEvent(t.ChartEvent.brushChange,e)})),s.addEventListener(KR.brushClear,(function(n){a._setRegionMarkPickable(e,!0),a._initMarkBrushState(i,""),a._emitEvent(t.ChartEvent.brushClear,e)})),s.addEventListener(KR.drawEnd,(function(n){var r;a._setRegionMarkPickable(e,!0);var o=n.detail.operateMask,s=a._spec.updateElementsState,l=void 0===s||s;if(null===(r=a._spec)||void 0===r?void 0:r.onBrushEnd)!0===a._spec.onBrushEnd(n)?(a.clearGraphic(),a._initMarkBrushState(i,""),a._emitEvent(t.ChartEvent.brushClear,e)):(a._spec.onBrushEnd(n),a._emitEvent(t.ChartEvent.brushEnd,e));else{var u=a._extendDataInBrush(a._inBrushElementsMap);(!a._spec.zoomWhenEmpty&&u.length>0||!l)&&a._setAxisAndDataZoom(o,e),a._emitEvent(t.ChartEvent.brushEnd,e)}})),s.addEventListener(KR.moveEnd,(function(i){a._setRegionMarkPickable(e,!0);var n=i.detail.operateMask,r=a._spec.updateElementsState,o=void 0===r||r,s=a._extendDataInBrush(a._inBrushElementsMap);(!a._spec.zoomWhenEmpty&&s.length>0||o)&&a._setAxisAndDataZoom(n,e),a._emitEvent(t.ChartEvent.brushEnd,e)}))}},{key:"_getBrushInteractiveAttr",value:function(t){var e=t.getLayoutStartPoint(),i=t.getLayoutRect(),n=e.x,r=n+i.width,a=e.y,o=a+i.height;return{interactiveRange:{minY:a,maxY:o,minX:n,maxX:r},xRange:[n,r],yRange:[a,o]}}},{key:"_transformBrushedMarkAttr",value:function(t){var 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({},pI(t)),e)}},{key:"_handleBrushChange",value:function(t,e){var i=e.detail.operateMask,n=this._spec.updateElementsState;(void 0===n||n)&&(this._reconfigItem(i,t),this._reconfigLinkedItem(i,t))}},{key:"_extendDataInBrush",value:function(t){var e,i,n=[];for(var r in t)for(var a in t[r])n.push(Object.assign({},null===(i=null===(e=t[r][a].context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0]));return n}},{key:"_extendDatumOutOfBrush",value:function(t){var e,i,n=[];for(var r in t)n.push(null===(i=null===(e=t[r].context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0]);return n}},{key:"_emitEvent",value:function(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})}},{key:"_reconfigItem",value:function(t,e){var i,n,r,a=this;if((null==t?void 0:t.globalTransMatrix)&&(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)){var o=null!==(r=null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.points)&&void 0!==r?r:[],s=t.globalTransMatrix,l=s.a,u=s.b,c=s.c,h=s.d,d=s.e,v=s.f,f=o.map((function(t){return{x:l*t.x+c*t.y+d,y:u*t.x+h*t.y+v}})),p=this._spec.markTypeFilter,g=void 0===p?[]:p;this._itemMap[e.id].forEach((function(e){if(!g.includes(e.type)){var i=e.getGraphics();i&&i.length&&i.forEach((function(i){var n,r,o,s=e.id+"_"+i.context.key,l=a._isBrushContainItem(t.globalAABBBounds,f,i);(null===(n=a._outOfBrushElementsMap)||void 0===n?void 0:n[s])&&l?(i.addState(fJ,!0),a._inBrushElementsMap[null==t?void 0:t.name]||(a._inBrushElementsMap[null==t?void 0:t.name]={}),a._inBrushElementsMap[null==t?void 0:t.name][s]=i,delete a._outOfBrushElementsMap[s]):(null===(o=null===(r=a._inBrushElementsMap)||void 0===r?void 0:r[null==t?void 0:t.name])||void 0===o?void 0:o[s])&&!l&&(i.removeState(fJ),i.addState(pJ,!0),a._outOfBrushElementsMap[s]=i,delete a._inBrushElementsMap[t.name][s])}))}}))}}},{key:"_reconfigLinkedItem",value:function(t,e){var i,n=this;if((null==t?void 0:t.globalTransMatrix)&&(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)){var r=e.getLayoutStartPoint(),a=e.getSeries().map((function(t){return t.id}));this._linkedSeries.forEach((function(e){var i,o;if(!a.includes(e.id)){var s=e.getRegion().getLayoutStartPoint(),l=s.x-r.x,u=s.y-r.y,c=null!==(o=null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)&&void 0!==o?o:[],h=t.globalTransMatrix,d=h.a,v=h.b,f=h.c,p=h.d,g=h.e,y=h.f,m=l||0,_=u||0,b=c.map((function(t){return{x:d*t.x+f*t.y+g+m,y:v*t.x+p*t.y+y+_}}));t.globalAABBBounds.clone().set(t.globalAABBBounds.x1+m,t.globalAABBBounds.y1+_,t.globalAABBBounds.x2+m,t.globalAABBBounds.y2+_);var k=n._spec.markTypeFilter,x=void 0===k?[]:k;n._linkedItemMap[e.id].forEach((function(e){if(!x.includes(e.type)){var i=e.getGraphics();i&&i.length&&i.forEach((function(i){var r,a,o;i.context;var s=e.id+"_"+i.context.key;(null===(r=n._linkedOutOfBrushElementsMap)||void 0===r?void 0:r[s])&&n._isBrushContainItem(t.globalAABBBounds,b,i)?(i.addState(fJ,!0),n._linkedInBrushElementsMap[null==t?void 0:t.name]||(n._linkedInBrushElementsMap[null==t?void 0:t.name]={}),n._linkedInBrushElementsMap[null==t?void 0:t.name][s]=i,delete n._linkedOutOfBrushElementsMap[s]):(null===(o=null===(a=n._linkedInBrushElementsMap)||void 0===a?void 0:a[null==t?void 0:t.name])||void 0===o?void 0:o[s])&&!n._isBrushContainItem(t.globalAABBBounds,b,i)&&(i.removeState(fJ),i.addState(pJ,!0),n._linkedOutOfBrushElementsMap[s]=i)}))}}))}}))}}},{key:"_isBrushContainItem",value:function(t,e,i){if(["symbol","rect"].includes(i.type)){var n=null==i?void 0:i.globalAABBBounds,r=n.x1,a=n.x2,o=n.y1,s=n.y2;return function(t,e){for(var i=0;i<e.length;i++){if(Xe(t,e[i].x,e[i].y))return!0;if(i>0&&Ye(e[i-1].x,e[i-1].y,e[i].x,e[i].y,t))return!0}return!1}(e,[{x:r,y:o},{x:a,y:o},{x:a,y:s},{x:r,y:s}])}return t.intersects(i.globalAABBBounds)}},{key:"_initItemMap",value:function(t,e,i){var n=this._spec.markTypeFilter,r=void 0===n?[]:n;Object.entries(t).forEach((function(t){var n=m(t,2);n[0],n[1].forEach((function(t){if(!r.includes(t.type)){var n=t.getGraphics();n&&n.length&&n.forEach((function(n){var r=t.id+"_"+n.context.key;n.removeState(fJ),n.removeState(pJ),i&&n.addState(i,!0),e[r]=n}))}}))}))}},{key:"_initMarkBrushState",value:function(t,e){this._brushComponents.forEach((function(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)}},{key:"_setRegionMarkPickable",value:function(t,e){t.getGroupMark().getGraphics().forEach((function(t){return t.setAttribute("childrenPickable",e)}))}},{key:"_stateClamp",value:function(t){return Math.min(Math.max(0,t),1)}},{key:"_setAxisAndDataZoom",value:function(t,e){var i,n=this;if(this._zoomRecord=[],this._spec.zoomAfterBrush){var r=t.AABBBounds;null===(i=this._regionAxisMap["region_"+e.id])||void 0===i||i.forEach((function(t){var i,a,o="bottom"===t.layoutOrient||"top"===t.layoutOrient,s=null!==(i=n._spec.axisRangeExpand)&&void 0!==i?i:0,l=r.x1,u=r.x2,c=r.y1,h=r.y2,d=o?"x":"y",v=o?"width":"height",f=o?l:c,p=o?u:h;if(n._axisDataZoomMap[t.id]){var g=n._axisDataZoomMap[t.id],y=(f-e.getLayoutStartPoint()[d])/e.getLayoutRect()[v],m=(p-e.getLayoutStartPoint()[d])/e.getLayoutRect()[v],_=n._stateClamp(y-s),b=n._stateClamp(m+s);g.setStartAndEnd(Math.min(_,b),Math.max(_,b),["percent","percent"]),n._zoomRecord.push({operateComponent:g,start:_,end:b,startValue:Vq(_,g.stateScale,Wq(g.relatedAxisComponent,g.isHorizontal)),endValue:Vq(b,g.stateScale,Wq(g.relatedAxisComponent,g.isHorizontal))})}else{var k=t.getScale().range(),x=null!==(a=t.scaleRangeFactor())&&void 0!==a?a:[0,1],S=ut(k)<k[0],A=f-e.getLayoutStartPoint()[d],M=p-e.getLayoutStartPoint()[d],w=S?Math.min(A,M):Math.max(A,M),T=S?Math.max(A,M):Math.min(A,M),C=(T-k[0])/(ut(k)-k[0])*(x[1]-x[0])+x[0],E=(w-k[0])/(ut(k)-k[0])*(x[1]-x[0])+x[0],B=n._stateClamp(C-s),P=n._stateClamp(E+s);t.scaleRangeFactor([B,P]),t.effect.scaleUpdate(),n._zoomRecord.push({operateComponent:t,start:B,end:P,startValue:t.getScale().invert(T),endValue:t.getScale().invert(w)})}}))}}},{key:"_getNeedClearVRenderComponents",value:function(){return this._brushComponents}},{key:"clearGraphic",value:function(){this._brushComponents&&this._brushComponents.forEach((function(t){t._container.incrementalClearChild()}))}},{key:"clear",value:function(){var t=this;if(this._brushComponents){var e=this.getContainer();this._brushComponents.forEach((function(i,n){t._initMarkBrushState(n,""),i.removeAllChild(),i.releaseBrushEvents(),e&&e.removeChild(i)})),this._brushComponents=null}}}],[{key:"getSpecInfo",value:function(t){return yF(t,this.specKey,this.type,(function(t){return!1!==t.visible}))}}])}(vz);gJ.type=d.brush,gJ.builtInTheme={brush:{style:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",lineWidth:2},brushMode:"single",brushType:"rect",brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:0}},gJ.specKey="brush";var yJ=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).type=d.customMark,e.specKey="customMark",e.layoutType="none",e.layoutZIndex=t.LayoutZIndex.CustomMark,e.layoutLevel=t.LayoutLevel.CustomMark,e}return c(r,e),a(r,[{key:"created",value:function(){_(r,"created",this,3)([]),this.initMarks(),this.initEvent()}},{key:"getMarkAttributeContext",value:function(){return this._markAttributeContext}},{key:"_buildMarkAttributeContext",value:function(){var t=this;this._markAttributeContext={vchart:this._option.globalInstance,globalScale:function(e,i){var n;return null===(n=t._option.globalScale.getScale(e))||void 0===n?void 0:n.scale(i)}}}},{key:"initMarks",value:function(){var t=this;if(this._spec){var e=null;if(this._spec.parent){var i=this.getChart().getAllMarks().find((function(e){return e.getUserId()===t._spec.parent}));"group"===i.type&&(e=i)}this._createExtensionMark(this._spec,e,"".concat(TO,"_series_").concat(this.id,"_extensionMark"),0)}}},{key:"_createExtensionMark",value:function(t,e,i){var n,r,a=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=this._createMark({type:t.type,name:C(t.name)?"".concat(t.name):"".concat(i,"_").concat(o)},{skipBeforeLayouted:!0,attributeContext:this._getMarkAttributeContext(),componentType:t.componentType,key:t.dataKey});if(s){if(C(t.id)&&s.setUserId(t.id),(null===(n=this._option.globalInstance)||void 0===n?void 0:n.isAnimationEnable())&&t.animation){var l=YF({},XF(t.type,t,this._markAttributeContext));s.setAnimationConfig(l)}if(T(e)?this._marks.addMark(s):e&&e.addMark(s),this.initMarkStyleWithSpec(s,t),"group"===t.type&&(i="".concat(i,"_").concat(o),null===(r=t.children)||void 0===r||r.forEach((function(t,e){a._createExtensionMark(t,s,i,e)}))),C(t.dataId)||z(t.dataIndex)){var u=this.getChart().getSeriesData(t.dataId,t.dataIndex);u&&(s.setDataView(u),u.target.addListener("change",(function(){s.getData().updateData()})))}}}},{key:"initEvent",value:function(){}},{key:"_compareSpec",value:function(t,e){var i=_(r,"_compareSpec",this,3)([t,e]);return at(e,t)||(i.reMake=!0),i.change=!0,i.reRender=!0,i}},{key:"_getMarkAttributeContext",value:function(){var t=this;return{vchart:this._option.globalInstance,chart:this.getChart(),globalScale:function(e,i){var n;return null===(n=t._option.globalScale.getScale(e))||void 0===n?void 0:n.scale(i)},getLayoutBounds:function(){var e=t.getLayoutStartPoint(),i=e.x,n=e.y,r=t.getLayoutRect(),a=r.width,o=r.height;return(new ii).set(i,n,i+a,n+o)}}}},{key:"_getLayoutRect",value:function(){var t=new ii;return this.getMarks().forEach((function(e){var i=e.getProduct();i&&t.union(i.AABBBounds)})),t.empty()?{width:0,height:0}:{width:t.width(),height:t.height()}}},{key:"getBoundsInRect",value:function(t){this.setLayoutRect(t);var e=this._getLayoutRect(),i=this.getLayoutStartPoint(),n=i.x,r=i.y;return{x1:n,y1:r,x2:n+e.width,y2:r+e.height}}},{key:"getVRenderComponents",value:function(){var t=[],e=function(i){if(i&&"group"===i.type)i.getMarks().forEach((function(t){e(t)}));else if("component"===i.type){var n=null==i?void 0:i.getComponent();n&&t.push(n)}};return this.getMarks().forEach((function(t){e(t)})),t}}])}(vz);yJ.type=d.customMark,yJ.specKey="customMark";var mJ=function(){function t(e,i){n(this,t),this._chartLayoutRect={x:0,y:0,width:1,height:1},this._col=1,this._row=1,this._elementMap=new Map,this.standardizationSpec(e),this._gridInfo=e,this._col=e.col,this._row=e.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==i?void 0:i.onError,this.initUserSetting()}return a(t,[{key:"standardizationSpec",value:function(t){var e,i,n;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!==(n=t.elements)&&void 0!==n?n:[]}},{key:"initUserSetting",value:function(){var t=this;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((function(e,i){e||(t._colSize[i]={value:0,isUserSetting:!1,isLayoutSetting:!1})})),this._rowSize.forEach((function(e,i){e||(t._rowSize[i]={value:0,isUserSetting:!1,isLayoutSetting:!1})}))}},{key:"setSizeFromUserSetting",value:function(t,e,i,n){t.forEach((function(t){t.index<0&&t.index>=i||(z(t.size)?e[t.index]={value:+t.size,isUserSetting:!0,isLayoutSetting:!1}:w(t.size)&&(e[t.index]={value:t.size(n),isUserSetting:!0,isLayoutSetting:!1}))}))}},{key:"clearLayoutSize",value:function(){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((function(t){t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)})),this._rowSize.forEach((function(t){t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)}))}},{key:"getItemGridInfo",value:function(t){var e,i,n=this._elementMap.get(t);return n||(i=null===(e=this._gridInfo.elements)||void 0===e?void 0:e.find((function(e){var i;if("modelId"in e&&C(e.modelId)){if(C(t.model.userId)&&t.model.userId===e.modelId)return!0}else if("modelKey"in e&&C(e.modelKey)&&"modelIndex"in e&&C(e.modelIndex)&&(null!==(i=t.model.specKey)&&void 0!==i?i:t.model.type)===e.modelKey&&t.model.getSpecIndex()===e.modelIndex)return!0;return!1})),i||(i={col:0,colSpan:1,row:0,rowSpan:1}),this._elementMap.set(t,i),i)}},{key:"getSizeFromGrid",value:function(t,e){for(var i,n="col"===e?this._colSize:this._rowSize,r=0,a=t[e];a<t[e]+(null!==(i=t["".concat(e,"Span")])&&void 0!==i?i:1);a++)r+=n[a].value;return r}},{key:"getSizeFromUser",value:function(t,e){var i,n,r="col"===e?this._colSize:this._rowSize;if(null===(i=r[t[e]])||void 0===i?void 0:i.isUserSetting){for(var a=0,o=t[e];o<t[e]+(null!==(n=t["".concat(e,"Span")])&&void 0!==n?n:1);o++){if(!r[o].isUserSetting)return;a+=r[o].value}return a}}},{key:"setItemLayoutSizeToGrid",value:function(t,e){if(_J(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}}},{key:"layoutGrid",value:function(t){var e="col"===t?this._colSize:this._rowSize,i="col"===t?this._chartLayoutRect.width:this._chartLayoutRect.height,n=[];e.forEach((function(t){t.isUserSetting||t.isLayoutSetting?i-=t.value:n.push(t)})),i<0&&console.warn("layout content ".concat(t," size bigger than chart")),n.forEach((function(t){return t.value=i/n.length}))}},{key:"getItemPosition",value:function(t){for(var e=this.getItemGridInfo(t),i={x:this._chartLayoutRect.x,y:this._chartLayoutRect.y},n=0;n<e.col;n++)i.x+=this._colSize[n].value;for(var r=0;r<e.row;r++)i.y+=this._rowSize[r].value;return i.x+=t.layoutPaddingLeft+t.layoutOffsetX,i.y+=t.layoutPaddingTop+t.layoutOffsetY,i}},{key:"getItemLayoutRect",value:function(t){var e,i,n=this.getItemGridInfo(t);return{width:(null!==(e=this.getSizeFromGrid(n,"col"))&&void 0!==e?e:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(i=this.getSizeFromGrid(n,"row"))&&void 0!==i?i:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom}}},{key:"layoutItems",value:function(t,e,i,n){var r=this;this._chartLayoutRect=i,this._chartViewBox=n,this.clearLayoutSize(),e.sort((function(t,e){return e.layoutLevel-t.layoutLevel}));var a=e.filter((function(t){return"normal"===t.layoutType&&!1!==t.getModelVisible()})),o=a.filter((function(t){return _J(t)})),s=a.filter((function(t){return!_J(t)}));a.forEach((function(t){r.layoutOneItem(t,"user",!1)}));var l=e.filter((function(t){return"region-relative"===t.layoutType})),u=l.filter((function(t){return _J(t)})),c=l.filter((function(t){return!_J(t)}));u.forEach((function(t){return r.layoutOneItem(t,"user",!1)})),this.layoutGrid("col"),s.forEach((function(t){return r.layoutOneItem(t,"colGrid",!1)})),c.forEach((function(t){r.layoutOneItem(t,"colGrid",!1)})),this.layoutGrid("row"),c.forEach((function(t){r.layoutOneItem(t,"grid",!1)})),o.forEach((function(t){return r.layoutOneItem(t,"grid",!1)})),u.forEach((function(t){r.layoutOneItem(t,"grid",!0)})),this.layoutGrid("col"),e.filter((function(t){return"region"===t.layoutType})).forEach((function(t){return r.layoutOneItem(t,"grid",!1)})),this.layoutAbsoluteItems(e.filter((function(t){return"absolute"===t.layoutType}))),e.filter((function(t){return"absolute"!==t.layoutType})).forEach((function(t){t.setLayoutStartPosition(r.getItemPosition(t))}))}},{key:"layoutAbsoluteItems",value:function(t){var e=this;t.forEach((function(t){t.absoluteLayoutInRect(e._chartLayoutRect)}))}},{key:"layoutOneItem",value:function(t,e,i){var n,r,a="rowGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),o="colGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),s=this.getItemGridInfo(t),l={width:(null!==(n=o(s,"col"))&&void 0!==n?n:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(r=a(s,"row"))&&void 0!==r?r:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom},u=t.computeBoundsInRect(l);z(u.width)||(u.width=l.width),z(u.height)||(u.height=l.height),t.setLayoutRect("grid"!==e?u:l),this.setItemLayoutSizeToGrid(t,s)}}])}();function _J(t){return"left"===t.layoutOrient||"right"===t.layoutOrient}mJ.type="grid";var bJ="vchart-tooltip",kJ="".concat(bJ,"-container"),xJ="".concat(bJ,"-title"),SJ="".concat(bJ,"-content-box"),AJ={offsetX:10,offsetY:10},MJ="99999999999999";function wJ(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\(/g,"&#40;").replace(/ /g," &nbsp;")}var TJ=function(t,e){return t?(e||(e=t.getBoundingClientRect()),t.offsetWidth>0?e.width/t.offsetWidth:t.offsetHeight>0?e.height/t.offsetHeight:1):1},CJ=function(t){return L(t)&&""!==(null==t?void 0:t.trim())||F(t)?wJ(t):""},EJ=function(t,e){var i;if(C(t))if(F(t))i=t;else if(w(t)){var n=t(e);F(n)&&(i=n)}return i},BJ={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]},PJ=function(t,e){var i,n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return null!==(n=null===(i=BJ[t])||void 0===i?void 0:i["x"===e?0:1])&&void 0!==n?n:r},RJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments))._visible=!0,t._isReleased=!1,t.showTooltip=function(e,i,n){return n.changePositionOnly?t.changeTooltipPosition(n,i):t.changeTooltip(!0,n,i)},t.changeTooltip=function(e,i,n){return t._isReleased?1:e?t.changeTooltipPosition(i,n):(t._updateTooltip(!1,i),0)},t.changeTooltipPosition=function(e,i){var n,r,a,o,s;if(t._isReleased)return 1;var l=e.event,u=e.tooltipSpec,c=e.activeTooltipSpec,h=e.changePositionOnly;if(!c)return 1;var d=c.activeType;if(c.handler)return null!==(a=null===(r=(n=c.handler).showTooltip)||void 0===r?void 0:r.call(n,d,i,e))&&void 0!==a?a:0;var v=c,f=t._getActualTooltipPosition(c,e,t._getTooltipBoxSize(c,h));c.position=f;var p=null!==(o=c.updatePosition)&&void 0!==o?o:null===(s=u[d])||void 0===s?void 0:s.updatePosition;p&&(c.position=p(c.position,i,e));var g=!1!==(null==v?void 0:v.visible);return i&&"pointerout"!==l.type&&c.visible&&(c.title||c.content)||(g=!1),t._updateTooltip(g,Object.assign(Object.assign({},e),{changePositionOnly:h})),0},t._getActualTooltipPosition=function(e,i,n){var r,a,o,s,l,u,c,h,d,v=t._chartOption.getRectByDimensionData,f=i.tooltipSpec,p={x:1/0,y:1/0};if(!f)return p;var g,y=i.event,m=e.activeType,_=e.data,b="dimension"===m?null===(a=null===(r=_[0])||void 0===r?void 0:r.data)||void 0===a?void 0:a[0]:null==_?void 0:_[0],k=t._option,x=k.offsetX,S=k.offsetY,A=f[m],M=kF(null==A?void 0:A.position,_,i),T=null!==(o=kF(null==A?void 0:A.positionMode,_,i))&&void 0!==o?o:"mark"===m?"mark":"pointer",B=null!=n?n:{},P=B.width,R=void 0===P?0:P,L=B.height,O=void 0===L?0:L,I="canvas"===f.renderMode,D=null===(s=null==i?void 0:i.chart)||void 0===s?void 0:s.getCanvasRect(),j=null!==(l=null==D?void 0:D.width)&&void 0!==l?l:CO,H=null!==(u=null==D?void 0:D.height)&&void 0!==u?u:EO,N=!1,V={width:0,height:0},U={x:0,y:0},W={x:0,y:0},G=1,Y=1,X=sb(t._env);if(X&&!f.confine?(V.width=window.innerWidth,V.height=window.innerHeight):(V.width=j,V.height=H),X&&!I){var K=t._getParentElement(f);W=null!==(h=null===(c=null==K?void 0:K.getBoundingClientRect)||void 0===c?void 0:c.call(K))&&void 0!==h?h:p;var q=null!==(d=t._compiler.getCanvas())&&void 0!==d?d:t._chartContainer;g=null==q?void 0:q.getBoundingClientRect(),U={x:g.x-W.x,y:g.y-W.y},G=TJ(q,g),Y=TJ(K,W)}var Z,J=Y/G,Q={},$={x:M,y:M},tt={x:["left","right"],y:["top","bottom"]},et=function(t,e){var n,r,a,o=t.orient,s=t.mode,l=t.offset,u=i.model,c=null==u?void 0:u.getLayoutStartPoint(),h=null!=l?l:"x"===e?x:S;if("mark"===s){N=!0;var d=i.item,f=null==d?void 0:d.AABBBounds;f&&c&&(r=("x"===e?f.x1:f.y1)+c[e],a=("x"===e?f.x2:f.y2)+c[e])}else if(v&&"crosshair"===s&&"cartesian"===(null===(n=null==b?void 0:b.series)||void 0===n?void 0:n.coordinate)&&b.datum&&b.datum.length){N=!0;var p=v(b,c);p&&(r=p.start[e],a=p.end[e])}else $[e]=o;if(N){var g=tt[e][0],y="x"===e?R:O;switch(PJ(o,e)){case-2:Q[g]=r-y*J-h;break;case-1.5:Q[g]=r+h;break;case 0:Q[g]=(r+a)/2-y*J/2;break;case-1:Q[g]=(r+a)/2-y*J-h;break;case 1:Q[g]=(r+a)/2+h;break;case 1.5:Q[g]=a-y*J-h;break;case 2:Q[g]=a+h}}},it=["x","y"];if(E(M))if(E(Z=M)&&(C(Z.left)||C(Z.right)||C(Z.top)||C(Z.bottom))){var nt=M.left,rt=M.right,at=M.top,ot=M.bottom;Q.left=EJ(nt,y),Q.top=EJ(at,y),Q.right=EJ(rt,y),Q.bottom=EJ(ot,y)}else(function(t){return E(t)&&(C(t.x)||C(t.y))})(M)&&it.forEach((function(t){var e=M[t];F(e)||w(e)?Q[tt[t][0]]=EJ(e,y):et(e,t)}));else C(M)&&(et({orient:M,mode:T},"x"),et({orient:M,mode:T},"y"));var st={x:null,y:null};return it.forEach((function(t){var e,i="x"===t?R:O,n="x"===t?j:H,r="x"===t?x:S,a=PJ($[t],t);if(z(Q[tt[t][0]]))st[t]=Q[tt[t][0]];else if(z(Q[tt[t][1]]))st[t]=n-i*J-Q[tt[t][1]];else{var o="x"===t?y.canvasX:y.canvasY;st[t]=a>0?o+r:0===a?o-i*J/2:o-i*J-r}st[t]*=G,X&&(st[t]+=U[t]),st[t]/=Y;var s="x"===t?V.width:V.height,l=f.confine?-(W[t]-(null!==(e=null==g?void 0:g[t])&&void 0!==e?e:0)/G)/Y:-W[t]/Y,u=s/Y+l-i;2!==a&&st[t]<l?N?st[t]=l:(st[t]+=0===a?r+i/2:2*r+i,st[t]>u&&(st[t]=u)):-2!==a&&st[t]>u&&(N?st[t]=u:(st[t]-=0===a?r+i/2:2*r+i,st[t]<l&&(st[t]=l)))})),st},t}return c(e,t),a(e,[{key:"env",get:function(){return this._env}},{key:"onAdd",value:function(t){_(e,"onAdd",this,3)([t]);var i=t.component;this._component=i,this._chartOption=i.getOption(),this._env=this._chartOption.mode,this._chartContainer=this._chartOption.globalInstance.getContainer(),this._compiler=i.getCompiler(),this._initFromSpec()}},{key:"hideTooltip",value:function(t){return this.changeTooltip(!1,t)}},{key:"release",value:function(){var t,e,i,n,r=null!==(e=null===(t=this._component)||void 0===t?void 0:t.getSpec())&&void 0!==e?e:{};r.handler?null===(n=(i=r.handler).release)||void 0===n||n.call(i):(this._removeTooltip(),this._isReleased=!0,this._chartOption=null,this._component=null)}},{key:"_getDefaultOption",value:function(){var t,e,i=this._component.getSpec().offset;return i?{offsetX:null!==(t=i.x)&&void 0!==t?t:AJ.offsetX,offsetY:null!==(e=i.y)&&void 0!==e?e:AJ.offsetY}:AJ}},{key:"_getParentElement",value:function(t){return t.parentElement}},{key:"getTooltipContainer",value:function(){return this._container}},{key:"_initFromSpec",value:function(){this._option=this._getDefaultOption()}},{key:"reInit",value:function(){this._initFromSpec()}}])}(zj);RJ.specKey="tooltip";var LJ=function(t,e){return C(t)?O(t)?t.map((function(t){return"".concat(t,"px")})).join(" "):"".concat(t,"px"):null!=e?e:"initial"},OJ=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};C(i.fontFamily)&&(n.fontFamily=i.fontFamily);var r=null!==(t=i.fill)&&void 0!==t?t:i.fontColor;return C(r)&&(n.color=r),C(i.fontWeight)&&(n.fontWeight=i.fontWeight),C(i.textAlign)&&(n.textAlign=i.textAlign),C(i.fontSize)&&(n.fontSize=LJ(i.fontSize)),C(i.maxWidth)&&(n.maxWidth=LJ(i.maxWidth)),i.multiLine||C(i.maxWidth)&&!1!==i.multiLine?(n.whiteSpace="initial",n.wordBreak=null!==(e=i.wordBreak)&&void 0!==e?e:"break-word"):(n.wordBreak="normal",n.whiteSpace="nowrap"),n},IJ=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.lineHeight;return t.fontSize?WL(e,t.fontSize):0},DJ=function(t){var e,i=t.backgroundColor,n=t.border,r=t.shadow,a=t.padding,o={borderWidth:"".concat(null!==(e=null==n?void 0:n.width)&&void 0!==e?e:0,"px")},s=null;(null==n?void 0:n.color)&&(o.borderColor=n.color),i&&(o.backgroundColor=i),o.boxShadow=r?"".concat(r.x,"px ").concat(r.y,"px ").concat(r.blur,"px ").concat(r.spread,"px ").concat(r.color):"initial";var l=(null!=n?n:{}).radius;return C(l)&&(o.borderRadius=z(l)?"".concat(l,"px"):"".concat(l)),a&&(s=ki(a),o.padding=LJ(s)),{panelStyle:o,panelPadding:s}};function FJ(t,e){t&&t.style&&e&&Object.keys(e).forEach((function(i){t.style[i]=e[i]}))}var jJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,[e.type])).type=DH.dom,t._tooltipContainer=null==ob?void 0:ob.body,t}return c(e,t),a(e,[{key:"getVisibility",value:function(){return!!this._rootDom&&"visible"===this._rootDom.style.visibility}},{key:"setVisibility",value:function(t){t!==this.getVisibility()&&this._rootDom&&(this._rootDom.style.visibility=t?"visible":"hidden")}},{key:"getRootDom",value:function(){return this._rootDom}},{key:"onAdd",value:function(t){_(e,"onAdd",this,3)([t]),this._initStyle(),this.initEl()}},{key:"initEl",value:function(){var t=this._component.getSpec().parentElement;if(ob&&t&&t.children&&t.children.length){for(var e=0;e<t.children.length;e++)if(t.children[e].classList.contains(kJ)){this._container=t.children[e];break}this._container||(this._container=ob.createElement("div"),this._container.style.position="relative",this._container.style.zIndex=MJ,this._container.classList.add(kJ),t.appendChild(this._container))}}},{key:"initRootDom",value:function(){var t,e=this._component.getSpec(),i=document.createElement("div"),n=null===(t=this._chartOption)||void 0===t?void 0:t.getTheme("fontFamily");FJ(i,Object.assign({left:"0",top:"0",pointerEvents:"none",padding:"12px",position:"absolute",zIndex:MJ,fontFamily:null!=n?n:$L.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","".concat(this.id)),this._container.appendChild(i),this._rootDom=i}},{key:"_getTooltipBoxSize",value:function(t,e){var i;this._rootDom||this.initRootDom(),e||this._updateDomStringByCol(t),this._updateDomStyle("height",e);var n=null===(i=this._rootDom)||void 0===i?void 0:i.getBoundingClientRect();return{width:null==n?void 0:n.width,height:null==n?void 0:n.height}}},{key:"_removeTooltip",value:function(){this._rootDom&&this._rootDom.parentNode&&(this._rootDom.parentNode.removeChild(this._rootDom),this._rootDom=null),this._container=null}},{key:"_updateTooltip",value:function(t,e){var i,n;if(t&&this._rootDom){var r=e.tooltipSpec,a=e.activeTooltipSpec;e.changePositionOnly||(this._tooltipActual=a);var o=this._rootDom;if(o){var s=null!==(i=a.position)&&void 0!==i?i:{},l=s.x,u=void 0===l?0:l,c=s.y,h=void 0===c?0:c,d={x:u,y:h},v=this.getVisibility();r.updateElement&&(this._updatePosition(null!==(n=this._cacheCustomTooltipPosition)&&void 0!==n?n:{x:u,y:h}),r.updateElement(o,a,e),d=this._getActualTooltipPosition(a,e,{width:o.offsetWidth,height:o.offsetHeight}),this._cacheCustomTooltipPosition=d),!v&&t&&(this._rootDom.style.transition="none",this._updatePosition(d,!1),this._rootDom.getBoundingClientRect()),this._updatePosition(d)}this.setVisibility(t)}else this.setVisibility(t),this._cacheCustomTooltipPosition=void 0}},{key:"_initStyle",value:function(){var t=this._component.getSpec();this._domStyle=function(){var t,e,i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=r.style,o=void 0===a?{}:a,s=r.enterable,l=r.transitionDuration,u=o.panel,c=void 0===u?{}:u,h=o.titleLabel,d=o.shape,v=o.keyLabel,f=o.valueLabel,p=o.spaceRow,g=o.align,y=DJ(c),m=y.panelStyle,_=y.panelPadding,b={marginTop:"0px",marginBottom:"0px"};m.pointerEvents=s?"auto":"none",l&&(m.transitionDuration=l?"".concat(l,"ms"):"initial",m.transitionProperty=l?"transform":"initial",m.transitionTimingFunction=l?"ease-out":"initial"),z(p)&&(b.marginBottom="".concat(p,"px"));var k={width:LJ(null!==(t=null==d?void 0:d.size)&&void 0!==t?t:8)},x=OJ(h),S=OJ(v),A=OJ(f),M="right"===g?"marginLeft":"marginRight";"right"===g&&(m.direction="rtl"),T(x.textAlign)&&(x.textAlign="right"===g?"right":"left"),T(S.textAlign)&&(S.textAlign="right"===g?"right":"left"),T(A.textAlign)&&(A.textAlign="right"===g?"left":"right"),k[M]=LJ(null!==(e=d.spacing)&&void 0!==e?e:8),S[M]=LJ(null!==(i=v.spacing)&&void 0!==i?i:26),A[M]=LJ(null!==(n=f.spacing)&&void 0!==n?n:0);var w=Math.max(IJ(f),IJ(v));return b.lineHeight=w>0?"".concat(w,"px"):"20px",{panelPadding:_,row:b,panel:m,title:x,shape:k,key:S,value:A}}(t)}},{key:"_updateDomStringByCol",value:function(t){var e,i=this,n=t.title,r=void 0===n?{}:n,a=t.content,o=a&&a.length,s=this._domStyle.row,l=b(this._rootDom.children),u=l.find((function(t){return t.className.includes(xJ)})),c=l.find((function(t){return t.className.includes(SJ)}));if(!u&&!1!==r.visible){u=document.createElement("h2");var h=document.createElement("span");u.appendChild(h),u.classList.add(xJ),this._rootDom.firstChild?this._rootDom.insertBefore(u,this._rootDom.firstChild):this._rootDom.appendChild(u)}u&&!1!==r.visible?(FJ(u,Object.assign(Object.assign(Object.assign({},this._domStyle.title),o?s:{marginBottom:"0px"}),{marginTop:"0px"})),u.firstChild.innerHTML="".concat(null!==(e=r.value)&&void 0!==e?e:"")):u&&!1===r.visible&&u.parentNode.removeChild(u);var d=["shape","key","value"];if(!c&&o&&(c=document.createElement("div"),d.forEach((function(t){var e=document.createElement("div");e.classList.add("".concat(bJ,"-column")),e.classList.add("".concat(bJ,"-").concat(t,"-column")),e.setAttribute("data-col",t),c.appendChild(e)})),c.classList.add(SJ),this._rootDom.appendChild(c)),c&&o){var v=b(c.children);FJ(c,{whiteSpace:"nowrap"}),v.forEach((function(t,e){var n=t.getAttribute("data-col");if(n&&d.includes(n)){var r="shape"===n&&a.every((function(t){return!t.hasShape||!t.shapeType}));FJ(t,Object.assign(Object.assign({},i._domStyle[n]),{display:r?"none":"inline-block",verticalAlign:"top"}));var o=b(t.children);o.slice(a.length).forEach((function(t){t.parentNode.removeChild(t)})),a.forEach((function(e,r){var l=o[r];l||((l=document.createElement("div")).classList.add("".concat(bJ,"-").concat(n)),t.appendChild(l));var u=Object.assign({},s);r===a.length-1&&(u.marginBottom="0px"),u.display=!1===e.visible?"none":"block",u.height="initial","key"===n?(l.innerHTML=CJ(e.key),e.keyStyle&&OJ(e.keyStyle,u)):"value"===n?(l.innerHTML=CJ(e.value),e.valueStyle&&OJ(e.valueStyle,u)):"shape"===n&&(l.innerHTML=function(t,e){var i,n,r,a,o,s;if(!t||!t.hasShape||!t.shapeType)return"";var l,u,c='style="display:inline-block;vertical-align:middle;"',h=t.shapeType,d=t.shapeStroke,v=t.shapeHollow,f=void 0!==v&&v,p=t.shapeFill,g=null!==(i=t.shapeSize)&&void 0!==i?i:8,y=t.shapeLineWidth?wJ(t.shapeLineWidth)+"px":"0px",_="currentColor",b=function(){return d?wJ(d):_},k=g,x=function(t){return new Wf({symbolType:t,size:k,fill:!0})},S=x(h),A=S.getParsedPath();if(!A.path&&A.pathStr&&(S=x(A.pathStr)),S.getParsedPath().path){var M=S.getParsedPath().path;u=M.toString(),l=M.bounds}else A.isSvg&&A.svgCache&&(u=A.svgCache.map((function(t){return t.path.toString()})).join(),l=A.svgCache.reduce((function(t,e){return t.union(e.path.bounds)}),new ii));var w="".concat(l.x1," ").concat(l.y1," ").concat(l.width()," ").concat(l.height());if("0px"!==y){var T=w.split(" ").map((function(t){return Number(t)})),C=m(T,4),B=C[0],P=C[1],R=C[2],O=C[3],I=Number(y.slice(0,-2));w="".concat(B-I/2," ").concat(P-I/2," ").concat(R+I," ").concat(O+I)}var D=Ru.IsGradientStr(p);if(!p||L(p)&&!D||f)return _=f?"none":p?wJ(p):"currentColor","\n <svg ".concat(c,' width="').concat(g,'" height="').concat(g,'" viewBox="').concat(w,'">\n <path\n d="').concat(u,'"\n style="fill: ').concat(_,"; stroke: ").concat(b(),"; stroke-width: ").concat(y,'"\n >\n </path>\n </svg>');var F=D?Ru.Parse(p):E(p)?p:null;if(F){_="gradientColor"+(null!=e?e:"");var j="",z=(null!==(n=F.stops)&&void 0!==n?n:[]).map((function(t){return'<stop offset="'.concat(wJ(t.offset.toString()),'" stop-color="').concat(wJ(t.color),'"/>')})).join("");return"radial"===F.gradient?j='<radialGradient id="'.concat(_,'" cx="50%" cy="50%" r="50%" fx="0%" fy="0%">\n ').concat(z,"\n </radialGradient>"):"linear"===F.gradient&&(j='<linearGradient id="'.concat(_,'" x1="').concat(100*(null!==(r=F.x0)&&void 0!==r?r:0),'%" y1="').concat(100*(null!==(a=F.y0)&&void 0!==a?a:0),'%" x2="').concat(100*(null!==(o=F.x1)&&void 0!==o?o:0),'%" y2="').concat(100*(null!==(s=F.y1)&&void 0!==s?s:0),'%">\n ').concat(z,"\n </linearGradient>")),"\n <svg ".concat(c,' width="').concat(g,'" height="').concat(g,'" viewBox="-0.5 -0.5 1 1">\n ').concat(j,'\n <path\n d="').concat(u,'"\n style="fill: url(#').concat(_,"); stroke: ").concat(b(),"; stroke-width: ").concat(y,'"\n >\n </path>\n </svg>')}return""}(e,"".concat(i.id,"_").concat(r))),FJ(l,u)}))}}))}else c&&!o&&c.parentNode.removeChild(c)}},{key:"_updateDomStyle",value:function(){var t,e,i,n,r,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"width",o=arguments.length>1?arguments[1]:void 0,s=this._rootDom,l=b(s.children).find((function(t){return t.className.includes(SJ)})),u=b(s.children).find((function(t){return t.className.includes(xJ)}));if(l){var c=this._component.getSpec(),h={},d=null===(t=c.style)||void 0===t?void 0:t.titleLabel;if(d&&d.autoWidth&&!1!==d.multiLine&&u){var v=b(l.children).reduce((function(t,e){return"height"===a?t+e.getBoundingClientRect().width:Math.max(t,e.getBoundingClientRect().width)}),0);v>0&&(u.style.maxWidth="".concat(v,"px"),u.style.maxWidth="".concat(Math.ceil(l.getBoundingClientRect().width),"px"))}if(C(null===(e=null==c?void 0:c.style)||void 0===e?void 0:e.maxContentHeight)){var f=u&&u.className.includes(xJ)?u.getBoundingClientRect().height+(null!==(i=c.style.spaceRow)&&void 0!==i?i:0):0,p=this._chartOption.getChartViewRect(),g=WL(c.style.maxContentHeight,Math.min(p.height,document.body.clientHeight)-f-(this._domStyle.panelPadding?this._domStyle.panelPadding[0]+this._domStyle.panelPadding[1]:0));g>0&&(h.maxHeight="".concat(g,"px"),h.overflowY="auto",h.width="calc(100% + ".concat(this._domStyle.panelPadding?this._domStyle.panelPadding[1]+"px":"10px",")"),FJ(l,h))}var y=l.children,m=[];if(y){for(var _=0;_<y.length;_++)for(var k=null!==(n=y[_].children)&&void 0!==n?n:[],x=0;x<k.length;x++){o&&(k[x].style[a]="initial");var S=k[x].getBoundingClientRect()[a];(void 0===m[x]||m[x]<S)&&(m[x]=S)}for(var A=0;A<y.length;A++)for(var M=null!==(r=y[A].children)&&void 0!==r?r:[],w=0;w<M.length;w++)M[w].style[a]="".concat(m[w],"px")}}}},{key:"_getParentElement",value:function(t){var i;return null!==(i=this._container)&&void 0!==i?i:_(e,"_getParentElement",this,3)([t])}},{key:"isTooltipShown",value:function(){return this.getVisibility()}},{key:"reInit",value:function(){_(e,"reInit",this,3)([]),this._initStyle(),this._rootDom&&FJ(this._rootDom,this._domStyle.panel),this.getVisibility()&&(this._updateDomStringByCol(this._tooltipActual),this._updateDomStyle("height",!1))}},{key:"_updatePosition",value:function(t){var e=t.x,i=t.y,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._rootDom&&(this._rootDom.style.transform="translate3d(".concat(e,"px, ").concat(i,"px, 0)"),n&&""!==this._rootDom.style.transition&&(this._rootDom.style.transition="",Object.assign(this._rootDom.style,this._domStyle.panel)))}}])}(RJ);jJ.type=DH.dom;var zJ={fontFamily:$L.fontFamily,spacing:10,wordBreak:"break-word"},HJ=function(t,e){var i,n,r;"rich"!==(null==t?void 0:t.type)&&"html"!==(null==t?void 0:t.type)?(t=(null!=t?t:"").toString(),n=e.multiLine?(n=t.split("\n")).map((function(t,e){return e<n.length-1?t+"\n":t})):[t],r=n.map((function(t){return Object.assign(Object.assign({},e),{text:t})}))):(r=t.text,n=t);var a,o=(a={wordBreak:null!==(i=e.wordBreak)&&void 0!==i?i:"break-word",maxWidth:e.maxWidth?e.maxWidth:void 0,width:0,height:0,textConfig:r},Ep||(Ep=Bp.CreateGraphic("richtext",{})),Ep.setAttributes(a),Ep.AABBBounds);return{width:o.width(),height:o.height(),text:n}};function NJ(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;return Object.assign(Object.assign({},null!=r?r:zJ),{fill:null!==(t=i.fill)&&void 0!==t?t:i.fontColor,textAlign:i.textAlign,textBaseline:i.textBaseline,fontFamily:null!==(e=i.fontFamily)&&void 0!==e?e:n,fontSize:i.fontSize,fontWeight:i.fontWeight,lineHeight:i.lineHeight,spacing:i.spacing,multiLine:C(i.maxWidth)?!1!==i.multiLine:i.multiLine,maxWidth:i.maxWidth,wordBreak:i.wordBreak,autoWidth:i.autoWidth})}var VJ=function(t){var e,i=t.backgroundColor,n=t.border,r=t.shadow,a={lineWidth:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:0,shadow:!!r};(null==n?void 0:n.color)&&(a.stroke=n.color),i&&(a.fill=i),r&&(a.shadowColor=r.color,a.shadowBlur=r.blur,a.shadowOffsetX=r.x,a.shadowOffsetY=r.y,a.shadowSpread=r.spread);var o=(null!=n?n:{}).radius;return C(o)&&(a.cornerRadius=[o,o,o,o]),a},UJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,[e.type])).type=DH.canvas,t._attributes=null,t}return c(e,t),a(e,[{key:"onAdd",value:function(t){var i;_(e,"onAdd",this,3)([t]),this._tooltipCanvasId=null===(i=this._chartOption.modeParams)||void 0===i?void 0:i.tooltipCanvasId}},{key:"_initTooltipComponent",value:function(t){var e=this._getLayer(t);this._tooltipComponent=new oL({autoCalculatePosition:!1,autoMeasure:!1}),e.add(this._tooltipComponent)}},{key:"_getLayer",value:function(t){if(this._layer)return this._layer;this._layer=t.createLayer(this._tooltipCanvasId);var e=this._layer.layerHandler.canvas.nativeCanvas;return e&&e.style&&(e.style.touchAction="none",e.style.pointerEvents="none"),this._layer}},{key:"_getTooltipBoxSize",value:function(t,e){var i,n;if(!e||T(this._attributes)){var r=null===(i=this._chartOption)||void 0===i?void 0:i.getTheme("fontFamily");this._attributes=function(t,e,i){var n,r,a,o,s,l=e.style,u=void 0===l?{}:l,c=e.enterable,h=e.transitionDuration,d=u.panel,v=void 0===d?{}:d,f=u.titleLabel,p=u.shape,g=u.keyLabel,y=u.valueLabel,m=u.spaceRow,_=u.align,b=ki(v.padding),k=XL(v.padding),x=NJ(Object.assign({textAlign:"right"===_?"right":"left"},f),i),S=NJ(Object.assign({textAlign:"right"===_?"right":"left"},g),i),A=NJ(y,i),M={fill:!0,size:null!==(n=null==p?void 0:p.size)&&void 0!==n?n:8,spacing:null!==(r=null==p?void 0:p.spacing)&&void 0!==r?r:6},w={panel:VJ(v),padding:b,title:{},content:[],titleStyle:{value:x,spaceRow:m},contentStyle:{shape:M,key:S,value:A,spaceRow:m},hasContentShape:!1,keyWidth:0,valueWidth:0,enterable:c,transitionDuration:h,align:_},T=t.title,E=void 0===T?{}:T,B=t.content,P=void 0===B?[]:B,R=k.left+k.right,L=k.top+k.bottom,O=0,I=!!P.length,D=0,F=0,j=0,z=0;if(I){var H=[],N=[],V=[],U=[],W=0;w.content=P.map((function(t,e){var i=0,n=t.hasShape,r=t.key,a=t.shapeType,o=void 0===a?"":a,s=t.shapeFill,l=t.shapeStroke,u=t.shapeLineWidth,c=t.shapeSize,h=t.value,d=t.isKeyAdaptive,v=t.spaceRow,f=t.keyStyle,p=t.valueStyle,g=t.shapeHollow,y={height:0,spaceRow:null!=v?v:m};if(C(r)){var _=nO({},S,NJ(f,void 0,{})),b=HJ(r,_),k=b.width,x=b.height,w=b.text;y.key=Object.assign(Object.assign({width:k,height:x},_),{text:w}),d?N.push(k):H.push(k),i=Math.max(i,x)}if(C(h)){var T=nO({},A,NJ(p,void 0,{})),E=HJ(h,T),B=E.width,R=E.height,L=E.text;y.value=Object.assign(Object.assign({width:B,height:R},T),{text:L}),V.push(B),i=Math.max(i,R)}if(n){var O={visible:!0,symbolType:o};g?O.stroke=s:O.fill=s,O.stroke=null!=l?l:s,O.lineWidth=u,y.shape=O;var I=null!=c?c:M.size;i=Math.max(I,i),U.push(I)}else y.shape={visible:!1};return y.height=i,W+=i,e<P.length-1&&(W+=y.spaceRow),y})),L+=W,D=H.length?ct(H):0,F=N.length?ct(N):0,j=V.length?ct(V):0,z=U.length?ct(U)+M.spacing:0,O=Math.max(z+D+S.spacing+j+A.spacing,z+F,O),w.hasContentShape=!!U.length,w.keyWidth=D,w.valueWidth=j}var G=0,Y=0,X=0,K=E.visible,q=void 0===K||K,Z=E.value,J=void 0===Z?"":Z,Q=E.valueStyle,$=E.spaceRow;w.title.visible=q,w.title.spaceRow=null!=$?$:m;var tt={},et=function(){return tt.autoWidth&&!1!==tt.multiLine};if(q){tt=nO({},x,NJ(Q,void 0,{})),et()&&(tt.multiLine=null===(a=tt.multiLine)||void 0===a||a,tt.maxWidth=null!==(o=tt.maxWidth)&&void 0!==o?o:I?Math.ceil(O):void 0);var it=HJ(J,tt),nt=it.text,rt=it.width,at=it.height;w.title.value=Object.assign(Object.assign({width:et()?Math.min(rt,null!==(s=tt.maxWidth)&&void 0!==s?s:Number.MAX_VALUE):rt,height:at},tt),{text:nt}),G=w.title.value.width,X=(Y=w.title.value.height)+(I?w.title.spaceRow:0)}return L+=X,w.title.width=G,w.title.height=Y,et()?R+=O||G:R+=Math.max(G,O),I&&w.content.forEach((function(t){var e,i=t.value;i&&(null===(e=i.autoWidth)||void 0===e||e)&&(i.width=R-k.left-k.right-z-D-S.spacing-A.spacing,i.maxWidth||(i.maxWidth=Math.ceil(i.width)),w.valueWidth=Math.max(w.valueWidth,i.width))})),w.panel.width=R,w.panel.height=L,w}(t,this._component.getSpec(),r)}var a=(null!==(n=this._attributes)&&void 0!==n?n:{}).panel;return{width:a.width+a.lineWidth,height:a.height+a.lineWidth}}},{key:"_removeTooltip",value:function(){this._layer&&this._layer.removeAllChild(),this._attributes=null}},{key:"_updateTooltip",value:function(t,e){this._visible=t;var i=this._compiler.getStage();if(i)if(t){this._tooltipComponent||this._initTooltipComponent(i);var n=e.activeTooltipSpec.position;e.changePositionOnly?C(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}))}else this._tooltipComponent&&this._tooltipComponent.attribute.visible&&(this._tooltipComponent.hideAll(),this._tooltipComponent.setAttributes({visibleAll:!1}))}},{key:"isTooltipShown",value:function(){var t;return null===(t=this._tooltipComponent)||void 0===t?void 0:t.attribute.visibleAll}},{key:"release",value:function(){var t;_(e,"release",this,3)([]),null===(t=this._layer)||void 0===t||t.release()}}])}(RJ);UJ.type=DH.canvas;var WJ=/\{([^}]+)\}/,GJ=/\{([^}]+)\}/g,YJ=/:/,XJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,[e.type])).type="formatterPlugin",t._timeModeFormat={utc:Ri.getInstance().timeUTCFormat,local:Ri.getInstance().timeFormat},t._formatter=t._format,t._timeFormatter=t._timeModeFormat.local,t._numericFormatter=zi.getInstance().format,t._numericSpecifier=zi.getInstance().formatter,t._numericFormatterCache=new Map,t._isNumericFormatterCache=new Map,t}return c(e,t),a(e,[{key:"onInit",value:function(t,i){var n;if(t.globalInstance){this._spec=null!==(n=null==i?void 0:i[e.specKey])&&void 0!==n?n:{};var r=this._spec,a=r.timeMode,o=r.customFormatter,s=r.numericFormatter,l=r.timeFormatter;w(o)?this._formatter=o:(this._formatter=this._format.bind(this),w(l)?this._timeFormatter=l:a&&this._timeModeFormat[a]&&(this._timeFormatter=this._timeModeFormat[a]),s&&(this._numericFormatter=s,this._numericSpecifier=null,this._numericFormatterCache=null)),rO.registerFormatter(this._formatter)}}},{key:"_format",value:function(t,e,i){var n=this;return O(t)?t.map((function(t,r){var a=O(i)?i[r]:i;return a?n._formatSingleLine(t,e,a):t})):O(i)?i.map((function(i){return n._formatSingleLine(t,e,i)})):this._formatSingleLine(t,e,i)}},{key:"_formatSingleLine",value:function(t,e,i){var n,r=this;if(this._isNumericFormatterCache&&(this._isNumericFormatterCache.get(i)?n=this._isNumericFormatterCache.get(i):(n=WJ.test(i),this._isNumericFormatterCache.set(i,n))),n){var a=i.replace(GJ,(function(t,i){if(!YJ.test(i)){var n=e[i.trim()];return void 0!==n?n:t}var a=i.split(":"),o=e[a.shift()],s=a.join(":");return r._formatSingleText(o,s)}));return a}return this._formatSingleText(t,i)}},{key:"_formatSingleText",value:function(t,e){var i;return Di.test(e)&&this._numericFormatter?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)):e.includes("%")&&this._timeFormatter?this._timeFormatter(e,t):e.startsWith("calc(")?this._calcFormatter(e,t):t}},{key:"_calcFormatter",value:function(t,e){try{var i=t.slice(5,-1).replace(/v/g,String(e));return this._calculateMathExpression(i,e)}catch(t){return e}}},{key:"_calculateMathExpression",value:function(t,e){var i=t.replace(/\s+/g,"");if(!this._isValidMathExpression(i))return e;try{var n=new Function("return ("+i+")")();if("number"!=typeof n||isNaN(n)||!isFinite(n))throw new Error("Invalid calculation result");return n}catch(t){return e}}},{key:"_isValidMathExpression",value:function(t){return/^[0-9+\-*/().]+$/.test(t)}},{key:"release",value:function(){_(e,"release",this,3)([]),this._format=null,this._timeFormatter=null,this._numericFormatter=null,this._numericSpecifier=null,this._numericFormatterCache=null,this._isNumericFormatterCache=null}}])}(zj);XJ.pluginType="chart",XJ.specKey="formatter",XJ.type="formatterPlugin",hF.useRegisters([function(){HH(),VH(),WH(),mH(),yH(),eH(),Yz(),Cj(),Bj(),tF(),JD(),zz(),Iz(),rO.registerSeries(iH.type,iH),rO.registerChart(GH.type,GH)},function(){HH(),VH(),WH(),yH(),eH(),Yz(),Cj(),KH(),Bj(),JH(),zz(),Iz(),rO.registerSeries($H.type,$H),mH(),rO.registerChart(eN.type,eN)},function(){HH(),VH(),WH(),yH(),pN(),mH(),rO.registerChart(yN.type,yN)},function(){HH(),VH(),mH(),yH(),TN(),rO.registerChart(EN.type,EN)},function(){VH(),AU(),rO.registerChart(yK.type,yK)},function(){HH(),VH(),mH(),yH(),VU(),rO.registerChart(bK.type,bK)},function(){HH(),VH(),WH(),mH(),yH(),JU(),rO.registerChart(xK.type,xK)},function(){HH(),VH(),WH(),mH(),yH(),pN(),rO.registerTransform("bin",co),rO.registerChart(CK.type,CK)},function(){VH(),WN(),ON(),rO.registerSeries(YN.type,YN),rO.registerImplement("registerMap",OI),rO.registerImplement("unregisterMap",II),QD(),rO.registerChart(hK.type,hK)},function(){VH(),EX(),rO.registerSeries(PX.type,PX),mU(),dW(),jU(),pW(),rO.registerChart(RK.type,RK)},function(){VH(),iY(),rO.registerChart(IK.type,IK)},function(){VH(),SY(),rO.registerChart(FK.type,FK)},function(){HH(),VH(),WH(),mH(),yH(),xV(),rO.registerChart(qK.type,qK)},function(){HH(),VH(),mH(),yH(),UV(),rO.registerTransform("boxplot",ho),rO.registerChart(JK.type,JK)},function(){HH(),VH(),mH(),yH(),pW(),rO.registerChart(BK.type,BK)},function(){HH(),VH(),mH(),yH(),xW(),rO.registerChart(zK.type,zK)},function(){HH(),VH(),mH(),yH(),iU(),rO.registerChart(NK.type,NK)},function(){HH(),VH(),WH(),mH(),yH(),KH(),zz(),Iz(),rO.registerSeries(aU.type,aU),rO.registerChart(eq.type,eq)},function(){VH(),HY(),rO.registerChart(UK.type,UK)},function(){VH(),YY(),rO.registerChart(GK.type,GK)},function(){VH(),_X(),rO.registerChart(XK.type,XK)},function(){VH(),Hs.load(RM),hX(),rO.registerChart($K.type,$K)},function(){VH(),jX(),rO.registerChart(nq.type,nq)},function(){VH(),JX(),rO.registerChart(aq.type,aq)},function(){HH(),VH(),WH(),mH(),rO.registerChart(AK.type,AK),yH()},Iz,zz,function(){rO.registerGraphicComponent(uz.lineAxis,(function(t,e){return new XC(t,e)})),rO.registerGraphicComponent(cz.lineAxisGrid,(function(t,e){return new rP(t,e)})),mz(),rO.registerComponent(Hz.type,Hz)},function(){rO.registerGraphicComponent(uz.lineAxis,(function(t,e){return new XC(t,e)})),rO.registerGraphicComponent(cz.lineAxisGrid,(function(t,e){return new rP(t,e)})),mz(),rO.registerComponent(Nz.type,Nz)},function(){rO.registerGraphicComponent(uz.lineAxis,(function(t,e){return new XC(t,e)})),rO.registerGraphicComponent(cz.lineAxisGrid,(function(t,e){return new rP(t,e)})),mz(),rO.registerComponent(Vz.type,Vz)},HU,jU,function(){rO.registerComponent(cq.type,cq)},function(){rO.registerComponent(kq.type,kq)},function(){rO.registerComponent(Lq.type,Lq)},function(){rO.registerComponent(Fq.type,Fq)},function(){rO.registerComponent(jq.type,jq)},function(){rO.registerComponent($q.type,$q)},function(){rO.registerComponent(eZ.type,eZ)},function(){rO.registerComponent(aZ.type,aZ)},WN,function(){rO.registerComponent(VZ.type,VZ),iR()},function(){rO.registerComponent(XZ.type,XZ),rR()},function(){rO.registerComponent(hJ.type,hJ),lR()},function(){rO.registerComponent(UZ.type,UZ),oR._animate=FP,iR()},function(){rO.registerComponent(KZ.type,KZ),sR._animate=zP,rR()},function(){rO.registerComponent(dJ.type,dJ),lR()},function(){rO.registerComponent(vJ.type,vJ),lR()},function(){rO.registerComponent(WZ.type,WZ)},function(){rO.registerComponent(eJ.type,eJ)},function(){rO.registerGraphicComponent(oJ.type,(function(t){return new tP(t)})),rJ(),pz(),rO.registerComponent(oJ.type,oJ,!0,1/0)},function(){rO.registerGraphicComponent(sJ.type,(function(t){return new tP(t)})),rJ(),pz(),rO.registerComponent(sJ.type,sJ,!0)},function(){rO.registerComponent(gJ.type,gJ)},function(){rO.registerComponent(yJ.type,yJ)},function(){Hs.load(kw)},function(){rO.registerLayout(mJ.type,mJ)},function(){var t;t=UJ,rO.registerComponentPlugin(t.type,t)},function(){var t;t=XJ,rO.registerChartPlugin(t.type,t)},oF,uF]),hF.useRegisters([function(){oS(Hs)}]),t.DEFAULT_CHART_HEIGHT=EO,t.DEFAULT_CHART_WIDTH=CO,t.DEFAULT_CLOSE_STROKE_JOIN=fF,t.DEFAULT_DATA_INDEX=PO,t.DEFAULT_DATA_KEY=RO,t.DEFAULT_DATA_SERIES_FIELD=LO,t.DEFAULT_KEY=QO,t.DEFAULT_LAYOUT_RECT_LEVEL=0,t.DEFAULT_LAYOUT_RECT_LEVEL_MIN=-1,t.DEFAULT_LINEAR_INTERPOLATE=vF,t.DEFAULT_MAP_LOOK_UP_KEY=$O,t.DEFAULT_MEASURE_CANVAS_ID=BO,t.DEFAULT_SERIES_STYLE_NAME=OO,t.DEFAULT_SMOOTH_INTERPOLATE=dF,t.Factory=rO,t.MOSAIC_CAT_END_PERCENT=qO,t.MOSAIC_CAT_START_PERCENT=KO,t.MOSAIC_VALUE_END_PERCENT=XO,t.MOSAIC_VALUE_START_PERCENT=YO,t.ManualTicker=function(t){function e(t){var r;return n(this,e),(r=i(this,e,[t])).lastFrameTime=0,r.status=Ls.RUNNING,r}return c(e,t),a(e,[{key:"setupTickHandler",value:function(){var t=new ET;return this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}},{key:"checkSkip",value:function(t){return!1}},{key:"getTime",value:function(){return this.tickerHandler.getTime()}},{key:"tickAt",value:function(t){this.tickTo(t)}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===Ls.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Ls.PAUSE)return!1;if(this.ifCanStop())return!1}return this.status=Ls.RUNNING,!0}}])}(CT),t.PREFIX=TO,t.SEGMENT_FIELD_END=JO,t.SEGMENT_FIELD_START=ZO,t.STACK_FIELD_END=FO,t.STACK_FIELD_END_OffsetSilhouette=NO,t.STACK_FIELD_END_PERCENT=zO,t.STACK_FIELD_KEY=IO,t.STACK_FIELD_START=DO,t.STACK_FIELD_START_OffsetSilhouette=HO,t.STACK_FIELD_START_PERCENT=jO,t.STACK_FIELD_TOTAL=VO,t.STACK_FIELD_TOTAL_BOTTOM=GO,t.STACK_FIELD_TOTAL_PERCENT=UO,t.STACK_FIELD_TOTAL_TOP=WO,t.StreamLight=function(t){function e(t,r,a,o,s){return n(this,e),i(this,e,[t,r,a,o,s])}return c(e,t),a(e,[{key:"getEndProps",value:function(){return{}}},{key:"onStart",value:function(){this.target&&("rect"===this.target.type?this.onStartRect():"line"===this.target.type?this.onStartLineOrArea("line"):"area"===this.target.type&&this.onStartLineOrArea("area"))}},{key:"onStartLineOrArea",value:function(t){var e,i=this.target.attachShadow(),n=Vs.graphicService.creator[t](Object.assign({},null===(e=this.params)||void 0===e?void 0:e.attribute));this[t]=n,n.pathProxy=new au,i.add(n)}},{key:"onStartRect",value:function(){var t,e,i,n=this.target.attachShadow(),r=null===(e=null===(t=this.params)||void 0===t?void 0:t.isHorizontal)||void 0===e||e,a=r?"height":"width",o=r?"width":"height",l=this.target.AABBBounds[a](),u=r?0:this.target.AABBBounds.y1,c=Vs.graphicService.creator.rect(Object.assign(Object.assign(s(s(s(s({},a,l),"fill","#bcdeff"),"shadowBlur",30),"shadowColor","#bcdeff"),null===(i=this.params)||void 0===i?void 0:i.attribute),s({x:0,y:u},o,0)));this.rect=c,n.add(c)}},{key:"onBind",value:function(){}},{key:"onEnd",value:function(){this.target.detachShadow()}},{key:"onUpdate",value:function(t,e,i){return this.rect?this.onUpdateRect(t,e,i):this.line||this.area?this.onUpdateLineOrArea(t,e,i):void 0}},{key:"onUpdateRect",value:function(t,e,i){var n,r,a,o,s,l,u,c,h,d,v,f,p,g,y,m,_=null===(r=null===(n=this.params)||void 0===n?void 0:n.isHorizontal)||void 0===r||r,b=this.target.attribute;if(_){var k=null!==(o=null!==(a=b.width)&&void 0!==a?a:Math.abs(b.x1-b.x))&&void 0!==o?o:250,x=null!==(l=null===(s=this.params)||void 0===s?void 0:s.streamLength)&&void 0!==l?l:k,S=null!==(h=null===(c=null===(u=this.params)||void 0===u?void 0:u.attribute)||void 0===c?void 0:c.width)&&void 0!==h?h:60,A=-S,M=A+(x-A)*e,w=Math.max(M,0),T=Math.min(Math.min(M+S,S),x-M),C=T+w>k?Math.max(k-w,0):T;this.rect.setAttributes({x:w+Math.min(b.x1-b.x,0),width:C},!1,{type:al.ANIMATE_PLAY,animationState:{ratio:e,end:t}})}else{var E,B=null!==(v=null!==(d=b.height)&&void 0!==d?d:Math.abs(b.y1-b.y))&&void 0!==v?v:250,P=null!==(p=null===(f=this.params)||void 0===f?void 0:f.streamLength)&&void 0!==p?p:B,R=null!==(m=null===(y=null===(g=this.params)||void 0===g?void 0:g.attribute)||void 0===y?void 0:y.height)&&void 0!==m?m:60,L=B-(P+R)*e,O=Math.min(L,B),I=Math.min(B-L,R);O<=0?(E=Math.max(O+I,0),O=0):E=I,this.rect.setAttributes({y:O+Math.min(b.y1-b.y,0),height:E},!1,{type:al.ANIMATE_PLAY,animationState:{ratio:e,end:t}})}}},{key:"onUpdateLineOrArea",value:function(t,e,i){var n=this.line||this.area;if(n){var r=n.pathProxy,a=this.target;a.cache||a.cacheArea?this._onUpdateLineOrAreaWithCache(r,a,t,e,i):this._onUpdateLineWithoutCache(r,a,t,e,i);var o=a.attribute;n.setAttributes(Object.assign({stroke:o.stroke},n.attribute)),n.addUpdateBoundTag()}}},{key:"_onUpdateLineOrAreaWithCache",value:function(t,e,i,n,r){var a,o;if(t.clear(),"line"===e.type){var s=e.cache;Array.isArray(s)||(s=[s]);var l=s.reduce((function(t,e){return t+e.getLength()}),0),u=[];return s.forEach((function(t){t.curves.forEach((function(t){return u.push(t)}))})),this._updateCurves(t,u,l,n)}if("area"===e.type&&(null===(o=null===(a=e.cacheArea)||void 0===a?void 0:a.top)||void 0===o?void 0:o.curves)){var c=e.cacheArea,h=c.top.curves.reduce((function(t,e){return t+e.getLength()}),0);return this._updateCurves(t,c.top.curves,h,n)}}},{key:"_updateCurves",value:function(t,e,i,n){for(var r,a,o=i*n,s=Math.min(o+(null!==(a=null===(r=this.params)||void 0===r?void 0:r.streamLength)&&void 0!==a?a:10),i),l=0,u=!1,c=0;c<e.length;c++)if(!1!==e[c].defined){var h=e[c],d=h.getLength(),v=1-(l+d-o)/d,f=void 0,p=1-(l+d-s)/d;if(l<o&&l+d>o)if(u=!0,h.p2&&h.p3){var g=m(Ml(h,v),2);g[0];var y=g[1];t.moveTo(y.p0.x,y.p0.y),f=y}else{var _=h.getPointAt(v);t.moveTo(_.x,_.y)}if(l<s&&l+d>s){if(h.p2&&h.p3){f&&(p=(s-o)/f.getLength());var b=m(Ml(f||h,p),1)[0];t.bezierCurveTo(b.p1.x,b.p1.y,b.p2.x,b.p2.y,b.p3.x,b.p3.y)}else{var k=h.getPointAt(p);t.lineTo(k.x,k.y)}break}if(u)if(h.p2&&h.p3){var x=f||h;t.bezierCurveTo(x.p1.x,x.p1.y,x.p2.x,x.p2.y,x.p3.x,x.p3.y)}else t.lineTo(h.p1.x,h.p1.y);l+=d}}},{key:"_onUpdateLineWithoutCache",value:function(t,e,i,n,r){var a,o,s=e.attribute,l=s.points,u=s.curveType;if(l&&!(l.length<2)&&"linear"===u){for(var c=0,h=1;h<l.length;h++)c+=ke.distancePP(l[h],l[h-1]);for(var d=c*n,v=Math.min(d+(null!==(o=null===(a=this.params)||void 0===a?void 0:a.streamLength)&&void 0!==o?o:10),c),f=[],p=0,g=1;g<l.length;g++){var y=ke.distancePP(l[g],l[g-1]);if(p<d&&p+y>d&&f.push(ke.pointAtPP(l[g-1],l[g],1-(p+y-d)/y)),p<v&&p+y>v){f.push(ke.pointAtPP(l[g-1],l[g],1-(p+y-v)/y));break}f.length&&f.push(l[g]),p+=y}if(f.length&&!(f.length<2)){t.clear(),t.moveTo(f[0].x,f[0].y);for(var m=1;m<f.length;m++)t.lineTo(f[m].x,f[m].y)}}}}])}(UT),t.ThemeManager=bO,t.USER_LAYOUT_RECT_LEVEL=9,t.VChart=hF,t.boundsInRect=YL,t.builtinThemes=uO,t.calcLayoutNumber=WL,t.calcPadding=GL,t.computeActualDataScheme=CL,t.convertPoint=KL,t.createArc=xp,t.createArea=_p,t.createGroup=Kv,t.createLine=Kf,t.createRect=Qf,t.createRichText=vp,t.createSymbol=Gf,t.createText=Vf,t.darkTheme=eO,t.dataScheme=ZL,t.default=hF,t.defaultThemeName=cO,t.getActualColor=BL,t.getActualNumValue=qL,t.getColorSchemeBySeries=OL,t.getDataScheme=TL,t.getFunnelTheme=sO,t.getMergedTheme=mO,t.getSpecInfo=yF,t.getTheme=pO,t.hasThemeMerged=vO,t.isColorKey=PL,t.isPercent=VL,t.isPercentOffset=UL,t.isProgressiveDataColorScheme=RL,t.isTokenKey=QL,t.isValidOrient=NL,t.lightTheme=tO,t.lookup=mF,t.measureText=wO,t.normalizeLayoutPaddingSpec=XL,t.queryColorFromColorScheme=EL,t.queryToken=JL,t.registerDataSetInstanceParser=BI,t.registerDataSetInstanceTransform=EI,t.registerTheme=fO,t.removeTheme=gO,t.themeExist=yO,t.themes=hO,t.token=$L,t.transformColorSchemeToStandardStruct=LL,t.transformToGraphic=pI,t.version="2.0.12",t.vglobal=zm,t.warn=ib,Object.defineProperty(t,"__esModule",{value:!0})})(M.exports);var w=A(M.exports);Component({properties:{styles:{type:String},canvasId:{type:String},spec:{type:Object,observer:function(t,e){this.chart&&JSON.stringify(t)!==JSON.stringify(e)&&this.chart.updateSpec(t)}},options:{type:Object,value:{}},events:{type:Object,value:[]}},data:{offscreenCanvasWidth:0,offscreenCanvasHeight:0,chart:void 0},detached:function(){this.chart&&this.chart.release()},ready:function(){var t=this;this.data.spec&&this.data.canvasId?(tt.onWindowResize((function(e){t.init()})),this.init()):console.warn("组件需绑定 spec 变量并且设置唯一 canvas-id")},methods:{init:function(){var t=this;tt.createSelectorQuery().in(this).select("#".concat(this.data.canvasId,"_draw_canvas")).boundingClientRect((function(e){if(e){t.setData({offscreenCanvasWidth:e.width,offscreenCanvasHeight:e.height}),t.chart&&t.chart.release();var i=new w(v(v({},t.data.spec),{},{width:e.width,height:e.height}),v({mode:"miniApp",modeParams:{domref:e,force:!0,canvasIdLists:["".concat(t.data.canvasId,"_draw_canvas"),"".concat(t.data.canvasId,"_tooltip_canvas"),"".concat(t.data.canvasId,"_hit_canvas")],tooltipCanvasId:"".concat(t.data.canvasId,"_tooltip_canvas"),freeCanvasIdx:2},dpr:tt.getSystemInfoSync().pixelRatio,renderCanvas:"".concat(t.data.canvasId,"_draw_canvas")},t.data.options));t.chart=i,t.triggerEvent("chartinit"),t.data.events&&t.data.events.forEach((function(t){t&&i.on(t.type,v(v({},t.query),{},{source:"chart"}),t.handler)})),i.renderAsync().then((function(e){t.triggerEvent("chartready")}))}else console.error("未找到 #".concat(t.data.canvasId," 组件"))})).exec()},bindEvent:function(t){var e=tt.getSystemInfoSync().brand;if(!("PC"===e&&t.type.startsWith("touch")||"PC"!==e&&t.type.startsWith("mouse"))){var i=this.chart;i&&(t.target=i.getCanvas(),i.getStage().window.dispatchEvent(t))}}}})}));