Math.PI/2?"right":"left"):C&&"center"!==C?"left"===C?(b=r.r0+S,a>Math.PI/2&&(C="right")):"right"===C&&(b=r.r-S,a>Math.PI/2&&(C="left")):(b=o===2*Math.PI&&0===r.r0?0:(r.r+r.r0)/2,C="center"),m.style.align=C,m.style.verticalAlign=g(p,"verticalAlign")||"middle",m.x=b*l+r.cx,m.y=b*c+r.cy;var k=g(p,"rotate"),O=0;"radial"===k?(O=wa(-a),O>Math.PI/2&&O<1.5*Math.PI&&(O+=Math.PI)):"tangential"===k?(O=Math.PI/2-a,O>Math.PI/2?O-=Math.PI:O<-Math.PI/2&&(O+=Math.PI)):s["z"](k)&&(O=k*Math.PI/180),m.rotation=wa(O)})),h.dirtyStyle()},t}(_g),IF=DF,AF="sunburstRootToNode",EF="sunburstHighlight",PF="sunburstUnhighlight";function LF(e){e.registerAction({type:AF,update:"updateView"},(function(e,t){function n(t,n){var i=KE(e,[AF],t);if(i){var r=t.getViewRoot();r&&(e.direction=JE(r,i.node)?"rollUp":"drillDown"),t.resetViewRoot(i.node)}}t.eachComponent({mainType:"series",subType:"sunburst",query:e},n)})),e.registerAction({type:EF,update:"none"},(function(e,t,n){function i(t){var n=KE(e,[EF],t);n&&(e.dataIndex=n.node.dataIndex)}e=Object(s["m"])({},e),t.eachComponent({mainType:"series",subType:"sunburst",query:e},i),n.dispatchAction(Object(s["m"])(e,{type:"highlight"}))})),e.registerAction({type:PF,update:"updateView"},(function(e,t,n){e=Object(s["m"])({},e),n.dispatchAction(Object(s["m"])(e,{type:"downplay"}))}))}var NF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return o(t,e),t.prototype.render=function(e,t,n,i){var r=this;this.seriesModel=e,this.api=n,this.ecModel=t;var o=e.getData(),a=o.tree.root,l=e.getViewRoot(),c=this.group,u=e.get("renderLabelForZeroData"),h=[];l.eachNode((function(e){h.push(e)}));var d=this._oldChildren||[];function p(e,t){function n(e){return e.getId()}function i(n,i){var r=null==n?null:e[n],o=null==i?null:t[i];f(r,o)}0===e.length&&0===t.length||new dS(t,e,n,n).add(i).update(i).remove(s["h"](i,null)).execute()}function f(i,r){if(u||!i||i.getValue()||(i=null),i!==a&&r!==a)if(r&&r.piece)i?(r.piece.updateData(!1,i,e,t,n),o.setItemGraphicEl(i.dataIndex,r.piece)):g(r);else if(i){var s=new IF(i,e,t,n);c.add(s),o.setItemGraphicEl(i.dataIndex,s)}}function g(e){e&&e.piece&&(c.remove(e.piece),e.piece=null)}function m(i,o){o.depth>0?(r.virtualPiece?r.virtualPiece.updateData(!1,i,e,t,n):(r.virtualPiece=new IF(i,e,t,n),c.add(r.virtualPiece)),o.piece.off("click"),r.virtualPiece.on("click",(function(e){r._rootToNode(o.parentNode)}))):r.virtualPiece&&(c.remove(r.virtualPiece),r.virtualPiece=null)}p(h,d),m(a,l),this._initEvents(),this._oldChildren=h},t.prototype._initEvents=function(){var e=this;this.group.off("click"),this.group.on("click",(function(t){var n=!1,i=e.seriesModel.getViewRoot();i.eachNode((function(i){if(!n&&i.piece&&i.piece===t.target){var r=i.getModel().get("nodeClick");if("rootToNode"===r)e._rootToNode(i);else if("link"===r){var o=i.getModel(),a=o.get("link");if(a){var s=o.get("target",!0)||"_blank";Pu(a,s)}}n=!0}}))}))},t.prototype._rootToNode=function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:AF,from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},t.prototype.containPoint=function(e,t){var n=t.getData(),i=n.getItemLayout(0);if(i){var r=e[0]-i.cx,o=e[1]-i.cy,a=Math.sqrt(r*r+o*o);return a<=i.r&&a>=i.r0}},t.type="sunburst",t}(Um),jF=NF,RF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreStyleOnData=!0,n}return o(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};zF(n);var i=this._levelModels=s["H"](e.levels||[],(function(e){return new Mc(e,this,t)}),this),r=XE.createTree(n,this,o);function o(e){e.wrapMethod("getItemModel",(function(e,t){var n=r.getNodeByDataIndex(t),o=i[n.depth];return o&&(e.parentModel=o),e}))}return r.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treePathInfo=QE(i,this),n},t.prototype.getLevelModel=function(e){return this._levelModels&&this._levelModels[e.depth]},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){hP(this)},t.type="series.sunburst",t.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},t}(Cf);function zF(e){var t=0;s["k"](e.children,(function(e){zF(e);var n=e.value;s["t"](n)&&(n=n[0]),t+=n}));var n=e.value;s["t"](n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),s["t"](e.value)?e.value[0]=n:e.value=n}var $F=RF,BF=Math.PI/180;function FF(e,t,n){t.eachSeriesByType(e,(function(e){var t=e.get("center"),i=e.get("radius");s["t"](i)||(i=[0,i]),s["t"](t)||(t=[t,t]);var r=n.getWidth(),o=n.getHeight(),a=Math.min(r,o),l=ji(t[0],r),c=ji(t[1],o),u=ji(i[0],a/2),h=ji(i[1],a/2),d=-e.get("startAngle")*BF,p=e.get("minAngle")*BF,f=e.getData().tree.root,g=e.getViewRoot(),m=g.depth,v=e.get("sort");null!=v&&VF(g,v);var y=0;s["k"](g.children,(function(e){!isNaN(e.getValue())&&y++}));var b=g.getValue(),_=Math.PI/(b||y)*2,x=g.depth>0,w=g.height-(x?-1:1),S=(h-u)/(w||1),C=e.get("clockwise"),k=e.get("stillShowZeroSum"),O=C?1:-1,M=function(t,n){if(t){var i=n;if(t!==f){var r=t.getValue(),o=0===b&&k?_:r*_;o
1)r=r.parentNode;var o=n.getColorFromPalette(r.name||r.dataIndex+"",t);return e.depth>1&&Object(s["C"])(o)&&(o=Object($t["c"])(o,(e.depth-1)/(i-1)*.5)),o}e.eachSeriesByType("sunburst",(function(e){var t=e.getData(),i=t.tree;i.eachNode((function(r){var o=r.getModel(),a=o.getModel("itemStyle").getItemStyle();a.fill||(a.fill=n(r,e,i.root.height));var l=t.ensureUniqueItemVisual(r.dataIndex,"style");Object(s["m"])(l,a)}))}))}function qF(e){e.registerChartView(jF),e.registerSeriesModel($F),e.registerLayout(Object(s["h"])(FF,"sunburst")),e.registerProcessor(Object(s["h"])(dO,"sunburst")),e.registerVisual(WF),LF(e)}var GF={color:"fill",borderColor:"stroke"},UF={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},YF=Ir(),XF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return o(t,e),t.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},t.prototype.getInitialData=function(e,t){return aC(null,this)},t.prototype.getDataParams=function(t,n,i){var r=e.prototype.getDataParams.call(this,t,n);return i&&(r.info=YF(i).info),r},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},t}(Cf),KF=XF;function ZF(e,t){return t=t||[0,0],s["H"](["x","y"],(function(n,i){var r=this.getAxis(n),o=t[i],a=e[i]/2;return"category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(o-a)-r.dataToCoord(o+a))}),this)}function JF(e){var t=e.master.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:s["c"](ZF,e)}}}function QF(e,t){return t=t||[0,0],s["H"]([0,1],(function(n){var i=t[n],r=e[n]/2,o=[],a=[];return o[n]=i-r,a[n]=i+r,o[1-n]=a[1-n]=t[1-n],Math.abs(this.dataToPoint(o)[n]-this.dataToPoint(a)[n])}),this)}function eV(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(t){return e.dataToPoint(t)},size:s["c"](QF,e)}}}function tV(e,t){var n=this.getAxis(),i=t instanceof Array?t[0]:t,r=(e instanceof Array?e[0]:e)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-r)-n.dataToCoord(i+r))}function nV(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:Object(s["c"])(tV,e)}}}function iV(e,t){return t=t||[0,0],s["H"](["Radius","Angle"],(function(n,i){var r="get"+n+"Axis",o=this[r](),a=t[i],s=e[i]/2,l="category"===o.type?o.getBandWidth():Math.abs(o.dataToCoord(a-s)-o.dataToCoord(a+s));return"Angle"===n&&(l=l*Math.PI/180),l}),this)}function rV(e){var t=e.getRadiusAxis(),n=e.getAngleAxis(),i=t.getExtent();return i[0]>i[1]&&i.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:i[1],r0:i[0]},api:{coord:function(i){var r=t.dataToRadius(i[0]),o=n.dataToAngle(i[1]),a=e.coordToPoint([r,o]);return a.push(r,o*Math.PI/180),a},size:s["c"](iV,e)}}}function oV(e){var t=e.getRect(),n=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(t,n){return e.dataToPoint(t,n)}}}}function aV(e,t,n,i){return e&&(e.legacy||!1!==e.legacy&&!n&&!i&&"tspan"!==t&&("text"===t||Object(s["q"])(e,"text")))}function sV(e,t,n){var i,r,o,a=e;if("text"===t)o=a;else{o={},Object(s["q"])(a,"text")&&(o.text=a.text),Object(s["q"])(a,"rich")&&(o.rich=a.rich),Object(s["q"])(a,"textFill")&&(o.fill=a.textFill),Object(s["q"])(a,"textStroke")&&(o.stroke=a.textStroke),Object(s["q"])(a,"fontFamily")&&(o.fontFamily=a.fontFamily),Object(s["q"])(a,"fontSize")&&(o.fontSize=a.fontSize),Object(s["q"])(a,"fontStyle")&&(o.fontStyle=a.fontStyle),Object(s["q"])(a,"fontWeight")&&(o.fontWeight=a.fontWeight),r={type:"text",style:o,silent:!0},i={};var l=Object(s["q"])(a,"textPosition");n?i.position=l?a.textPosition:"inside":l&&(i.position=a.textPosition),Object(s["q"])(a,"textPosition")&&(i.position=a.textPosition),Object(s["q"])(a,"textOffset")&&(i.offset=a.textOffset),Object(s["q"])(a,"textRotation")&&(i.rotation=a.textRotation),Object(s["q"])(a,"textDistance")&&(i.distance=a.textDistance)}return lV(o,e),Object(s["k"])(o.rich,(function(e){lV(e,e)})),{textConfig:i,textContent:r}}function lV(e,t){t&&(t.font=t.textFont||t.font,Object(s["q"])(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),Object(s["q"])(t,"textAlign")&&(e.align=t.textAlign),Object(s["q"])(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),Object(s["q"])(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),Object(s["q"])(t,"textWidth")&&(e.width=t.textWidth),Object(s["q"])(t,"textHeight")&&(e.height=t.textHeight),Object(s["q"])(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),Object(s["q"])(t,"textPadding")&&(e.padding=t.textPadding),Object(s["q"])(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),Object(s["q"])(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),Object(s["q"])(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),Object(s["q"])(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),Object(s["q"])(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),Object(s["q"])(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),Object(s["q"])(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function cV(e,t,n){var i=e;i.textPosition=i.textPosition||n.position||"inside",null!=n.offset&&(i.textOffset=n.offset),null!=n.rotation&&(i.textRotation=n.rotation),null!=n.distance&&(i.textDistance=n.distance);var r=i.textPosition.indexOf("inside")>=0,o=e.fill||"#000";uV(i,t);var a=null==i.textFill;return r?a&&(i.textFill=n.insideFill||"#fff",!i.textStroke&&n.insideStroke&&(i.textStroke=n.insideStroke),!i.textStroke&&(i.textStroke=o),null==i.textStrokeWidth&&(i.textStrokeWidth=2)):(a&&(i.textFill=e.fill||n.outsideFill||"#000"),!i.textStroke&&n.outsideStroke&&(i.textStroke=n.outsideStroke)),i.text=t.text,i.rich=t.rich,Object(s["k"])(t.rich,(function(e){uV(e,e)})),i}function uV(e,t){t&&(Object(s["q"])(t,"fill")&&(e.textFill=t.fill),Object(s["q"])(t,"stroke")&&(e.textStroke=t.fill),Object(s["q"])(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),Object(s["q"])(t,"font")&&(e.font=t.font),Object(s["q"])(t,"fontStyle")&&(e.fontStyle=t.fontStyle),Object(s["q"])(t,"fontWeight")&&(e.fontWeight=t.fontWeight),Object(s["q"])(t,"fontSize")&&(e.fontSize=t.fontSize),Object(s["q"])(t,"fontFamily")&&(e.fontFamily=t.fontFamily),Object(s["q"])(t,"align")&&(e.textAlign=t.align),Object(s["q"])(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),Object(s["q"])(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),Object(s["q"])(t,"width")&&(e.textWidth=t.width),Object(s["q"])(t,"height")&&(e.textHeight=t.height),Object(s["q"])(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),Object(s["q"])(t,"padding")&&(e.textPadding=t.padding),Object(s["q"])(t,"borderColor")&&(e.textBorderColor=t.borderColor),Object(s["q"])(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),Object(s["q"])(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),Object(s["q"])(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),Object(s["q"])(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),Object(s["q"])(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),Object(s["q"])(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),Object(s["q"])(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),Object(s["q"])(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),Object(s["q"])(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),Object(s["q"])(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var hV={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},dV=Object(s["F"])(hV),pV=(Object(s["N"])(Xn,(function(e,t){return e[t]=1,e}),{}),Xn.join(", "),["","style","shape","extra"]),fV=Ir();function gV(e,t,n,i,r){var o=e+"Animation",a=Vl(e,i,r)||{},l=fV(t).userDuring;return a.duration>0&&(a.during=l?Object(s["c"])(kV,{el:t,userDuring:l}):null,a.setToFinal=!0,a.scope=e),Object(s["m"])(a,n[o]),a}function mV(e,t,n,i){i=i||{};var r=i.dataIndex,o=i.isInit,a=i.clearStyle,l=n.isAnimationEnabled(),c=fV(e),u=t.style;c.userDuring=t.during;var h={},d={};if(DV(e,t,d),MV("shape",t,d),MV("extra",t,d),!o&&l&&(TV(e,t,h),OV("shape",e,t,h),OV("extra",e,t,h),IV(e,t,u,h)),d.style=u,_V(e,d,a),wV(e,t),l)if(o){var p={};Object(s["k"])(pV,(function(e){var n=e?t[e]:t;n&&n.enterFrom&&(e&&(p[e]=p[e]||{}),Object(s["m"])(e?p[e]:p,n.enterFrom))}));var f=gV("enter",e,t,n,r);f.duration>0&&e.animateFrom(p,f)}else xV(e,t,r||0,n,h);vV(e,t),u?e.dirty():e.markRedraw()}function vV(e,t){for(var n=fV(e).leaveToProps,i=0;i =0},t.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},t}(Ku),RK=jK,zK=s["h"],$K=s["k"],BK=Ci,FK=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return o(t,e),t.prototype.init=function(){this.group.add(this._contentGroup=new BK),this.group.add(this._selectorGroup=new BK),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var r=e.get("align"),o=e.get("orient");r&&"auto"!==r||(r="right"===e.get("left")&&"vertical"===o?"right":"left");var a=e.get("selector",!0),l=e.get("selectorPosition",!0);!a||l&&"auto"!==l||(l="horizontal"===o?"end":"start"),this.renderInner(r,e,t,n,a,o,l);var c=e.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},h=e.get("padding"),d=Bu(c,u,h),p=this.layoutInner(e,r,d,i,a,l),f=Bu(s["i"]({width:p.width,height:p.height},c),u,h);this.group.x=f.x-p.x,this.group.y=f.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=GG(p,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,i,r,o,a){var l=this.getContentGroup(),c=s["f"](),u=t.get("selectedMode"),h=[];n.eachRawSeries((function(e){!e.get("legendHoverLink")&&h.push(e.id)})),$K(t.getData(),(function(r,o){var a=r.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var d=new BK;return d.newline=!0,void l.add(d)}var p=n.getSeriesByName(a)[0];if(!c.get(a)){if(p){var f=p.getData(),g=f.getVisual("legendLineStyle")||{},m=f.getVisual("legendIcon"),v=f.getVisual("style"),y=this._createItem(p,a,o,r,t,e,g,v,m,u,i);y.on("click",zK(WK,a,null,i,h)).on("mouseover",zK(GK,p.name,null,i,h)).on("mouseout",zK(UK,p.name,null,i,h)),c.set(a,!0)}else n.eachRawSeries((function(n){if(!c.get(a)&&n.legendVisualProvider){var l=n.legendVisualProvider;if(!l.containName(a))return;var d=l.indexOfName(a),p=l.getItemVisual(d,"style"),f=l.getItemVisual(d,"legendIcon"),g=Object($t["g"])(p.fill);g&&0===g[3]&&(g[3]=.2,p=s["m"](s["m"]({},p),{fill:Object($t["h"])(g,"rgba")}));var m=this._createItem(n,a,o,r,t,e,{},p,f,u,i);m.on("click",zK(WK,null,a,i,h)).on("mouseover",zK(GK,null,a,i,h)).on("mouseout",zK(UK,null,a,i,h)),c.set(a,!0)}}),this);0}}),this),r&&this._createSelector(r,t,i,o,a)},t.prototype._createSelector=function(e,t,n,i,r){var o=this.getSelectorGroup();$K(e,(function(e){var i=e.type,r=new Cs({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect"})}});o.add(r);var a=t.getModel("selectorLabel"),s=t.getModel(["emphasis","selectorLabel"]);tc(r,{normal:a,emphasis:s},{defaultText:e.title}),Ml(r)}))},t.prototype._createItem=function(e,t,n,i,r,o,a,l,c,u,h){var d=e.visualDrawType,p=r.get("itemWidth"),f=r.get("itemHeight"),g=r.isSelected(t),m=i.get("symbolRotate"),v=i.get("symbolKeepAspect"),y=i.get("icon");c=y||c||"roundRect";var b=VK(c,i,a,l,d,g,h),_=new BK,x=i.getModel("textStyle");if(!s["w"](e.getLegendIcon)||y&&"inherit"!==y){var w="inherit"===y&&e.getData().getVisual("symbol")?"inherit"===m?e.getData().getVisual("symbolRotate"):m:0;_.add(HK({itemWidth:p,itemHeight:f,icon:c,iconRotate:w,itemStyle:b.itemStyle,lineStyle:b.lineStyle,symbolKeepAspect:v}))}else _.add(e.getLegendIcon({itemWidth:p,itemHeight:f,icon:c,iconRotate:m,itemStyle:b.itemStyle,lineStyle:b.lineStyle,symbolKeepAspect:v}));var S="left"===o?p+5:-5,C=o,k=r.get("formatter"),O=t;s["C"](k)&&k?O=k.replace("{name}",null!=t?t:""):s["w"](k)&&(O=k(t));var M=g?x.getTextColor():i.get("inactiveColor");_.add(new Cs({style:ic(x,{text:O,x:S,y:f/2,fill:M,align:C,verticalAlign:"middle"},{inheritColor:M})}));var T=new as({shape:_.getBoundingRect(),invisible:!0}),D=i.getModel("tooltip");return D.get("show")&&jm({el:T,componentModel:r,itemName:t,itemTooltipOption:D.option}),_.add(T),_.eachChild((function(e){e.silent=!0})),T.silent=!u,this.getContentGroup().add(_),Ml(_),_.__legendDataIndex=n,_},t.prototype.layoutInner=function(e,t,n,i,r,o){var a=this.getContentGroup(),s=this.getSelectorGroup();zu(e.get("orient"),a,e.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),c=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),r){zu("horizontal",s,e.get("selectorItemGap",!0));var u=s.getBoundingRect(),h=[-u.x,-u.y],d=e.get("selectorButtonGap",!0),p=e.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",m=0===p?"y":"x";"end"===o?h[p]+=l[f]+d:c[p]+=u[f]+d,h[1-p]+=l[g]/2-u[g]/2,s.x=h[0],s.y=h[1],a.x=c[0],a.y=c[1];var v={x:0,y:0};return v[f]=l[f]+d+u[f],v[g]=Math.max(l[g],u[g]),v[m]=Math.min(0,u[m]+h[1-p]),v}return a.x=c[0],a.y=c[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(Of);function VK(e,t,n,i,r,o,a){function s(e,t){"auto"===e.lineWidth&&(e.lineWidth=t.lineWidth>0?2:0),$K(e,(function(n,i){"inherit"===e[i]&&(e[i]=t[i])}))}var l=t.getModel("itemStyle"),c=l.getItemStyle(),u=0===e.lastIndexOf("empty",0)?"fill":"stroke",h=l.getShallow("decal");c.decal=h&&"inherit"!==h?Xy(h,a):i.decal,"inherit"===c.fill&&(c.fill=i[r]),"inherit"===c.stroke&&(c.stroke=i[u]),"inherit"===c.opacity&&(c.opacity=("fill"===r?i:n).opacity),s(c,i);var d=t.getModel("lineStyle"),p=d.getLineStyle();if(s(p,n),"auto"===c.fill&&(c.fill=i.fill),"auto"===c.stroke&&(c.stroke=i.fill),"auto"===p.stroke&&(p.stroke=i.fill),!o){var f=t.get("inactiveBorderWidth"),g=c[u];c.lineWidth="auto"===f?i.lineWidth>0&&g?2:0:c.lineWidth,c.fill=t.get("inactiveColor"),c.stroke=t.get("inactiveBorderColor"),p.stroke=d.get("inactiveColor"),p.lineWidth=d.get("inactiveWidth")}return{itemStyle:c,lineStyle:p}}function HK(e){var t=e.icon||"roundRect",n=ay(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n}function WK(e,t,n,i){UK(e,t,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),GK(e,t,n,i)}function qK(e){var t,n=e.getZr().storage.getDisplayList(),i=0,r=n.length;while(i',C=window.open();C.document.write(S),C.document.title=i}},t.getDefaultOption=function(e){var t={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:e.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:e.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return t},t}($G),ZG=KG,JG="__ec_magicType_stack__",QG=[["line","bar"],["stack"]],eU=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.getIcons=function(){var e=this.model,t=e.get("icon"),n={};return s["k"](e.get("type"),(function(e){t[e]&&(n[e]=t[e])})),n},t.getDefaultOption=function(e){var t={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:e.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return t},t.prototype.onclick=function(e,t,n){var i=this.model,r=i.get(["seriesIndex",n]);if(tU[n]){var o,a={series:[]},l=function(e){var t=e.subType,r=e.id,o=tU[n](t,r,e,i);o&&(s["i"](o,e.option),a.series.push(o));var l=e.coordinateSystem;if(l&&"cartesian2d"===l.type&&("line"===n||"bar"===n)){var c=l.getAxesByScale("ordinal")[0];if(c){var u=c.dim,h=u+"Axis",d=e.getReferringComponents(h,Lr).models[0],p=d.componentIndex;a[h]=a[h]||[];for(var f=0;f<=p;f++)a[h][p]=a[h][p]||{};a[h][p].boundaryGap="bar"===n}}};s["k"](QG,(function(e){s["r"](e,n)>=0&&s["k"](e,(function(e){i.setIconStatus(e,"normal")}))})),i.setIconStatus(n,"emphasis"),e.eachComponent({mainType:"series",query:null==r?null:{seriesIndex:r}},l);var c=n;"stack"===n&&(o=s["I"]({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(c="tiled")),t.dispatchAction({type:"changeMagicType",currentType:c,newOption:a,newTitle:o,featureName:"magicType"})}},t}($G),tU={line:function(e,t,n,i){if("bar"===e)return s["I"]({id:t,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(e,t,n,i){if("line"===e)return s["I"]({id:t,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(e,t,n,i){var r=n.get("stack")===JG;if("line"===e||"bar"===e)return i.setIconStatus("stack",r?"normal":"emphasis"),s["I"]({id:t,stack:r?"":JG},i.get(["option","stack"])||{},!0)}};C_({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(e,t){t.mergeOption(e.newOption)}));var nU=eU,iU=new Array(60).join("-"),rU="\t";function oU(e){var t={},n=[],i=[];return e.eachRawSeries((function(e){var r=e.coordinateSystem;if(!r||"cartesian2d"!==r.type&&"polar"!==r.type)n.push(e);else{var o=r.getBaseAxis();if("category"===o.type){var a=o.dim+"_"+o.index;t[a]||(t[a]={categoryAxis:o,valueAxis:r.getOtherAxis(o),series:[]},i.push({axisDim:o.dim,axisIndex:o.index})),t[a].series.push(e)}else n.push(e)}})),{seriesGroupByCategoryAxis:t,other:n,meta:i}}function aU(e){var t=[];return s["k"](e,(function(e,n){var i=e.categoryAxis,r=e.valueAxis,o=r.dim,a=[" "].concat(s["H"](e.series,(function(e){return e.name}))),l=[i.model.getCategories()];s["k"](e.series,(function(e){var t=e.getRawData();l.push(e.getRawData().mapArray(t.mapDimension(o),(function(e){return e})))}));for(var c=[a.join(rU)],u=0;u
",m=u.join(g);this._showOrMove(o,(function(){this._updateContentNotChangedOnAxis(e,l)?this._updatePosition(o,d,r[0],r[1],this._tooltipContent,l):this._showTooltipContent(o,m,l,Math.random()+"",r[0],r[1],d,null,h)}))},t.prototype._showSeriesItemTooltip=function(e,t,n){var i=this._ecModel,r=ks(t),o=r.seriesIndex,a=i.getSeriesByIndex(o),l=r.dataModel||a,c=r.dataIndex,u=r.dataType,h=l.getData(u),d=this._renderMode,p=e.positionDefault,f=SY([h.getItemModel(c),l,a&&(a.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),g=f.get("trigger");if(null==g||"item"===g){var m=l.getDataParams(c,u),v=new cf;m.marker=v.makeTooltipMarker("item",Eu(m.color),d);var y=ip(l.formatTooltip(c,!1,u)),b=f.get("order"),_=f.get("valueFormatter"),x=y.frag,w=x?Qp(_?Object(s["m"])({valueFormatter:_},x):x,v,d,b,i.get("useUTC"),f.get("textStyle")):y.text,S="item_"+l.name+"_"+c;this._showOrMove(f,(function(){this._showTooltipContent(f,w,m,S,e.offsetX,e.offsetY,e.position,e.target,v)})),n({type:"showTip",dataIndexInside:c,dataIndex:h.getRawIndex(c),seriesIndex:o,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var i=ks(t),r=i.tooltipConfig,o=r.option||{};if(Object(s["C"])(o)){var a=o;o={content:a,formatter:a}}var l=[o],c=this._ecModel.getComponent(i.componentMainType,i.componentIndex);c&&l.push(c),l.push({formatter:o.content});var u=e.positionDefault,h=SY(l,this._tooltipModel,u?{position:u}:null),d=h.get("content"),p=Math.random()+"",f=new cf;this._showOrMove(h,(function(){var n=Object(s["d"])(h.get("formatterParams")||{});this._showTooltipContent(h,d,n,p,e.offsetX,e.offsetY,e.position,t,f)})),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,i,r,o,a,l,c){if(this._ticket="",e.get("showContent")&&e.get("show")){var u=this._tooltipContent;u.setEnterable(e.get("enterable"));var h=e.get("formatter");a=a||e.get("position");var d=t,p=this._getNearestPoint([r,o],n,e.get("trigger"),e.get("borderColor")),f=p.color;if(h)if(Object(s["C"])(h)){var g=e.ecModel.get("useUTC"),m=Object(s["t"])(n)?n[0]:n,v=m&&m.axisType&&m.axisType.indexOf("time")>=0;d=h,v&&(d=ou(m.axisValue,d,g)),d=Du(d,n,!0)}else if(Object(s["w"])(h)){var y=Object(s["c"])((function(t,i){t===this._ticket&&(u.setContent(i,c,e,f,a),this._updatePosition(e,a,r,o,u,n,l))}),this);this._ticket=i,d=h(n,i,y)}else d=h;u.setContent(d,c,e,f,a),u.show(e,f),this._updatePosition(e,a,r,o,u,n,l)}},t.prototype._getNearestPoint=function(e,t,n,i){return"axis"===n||Object(s["t"])(t)?{color:i||("html"===this._renderMode?"#fff":"none")}:Object(s["t"])(t)?void 0:{color:i||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,i,r,o,a){var l=this._api.getWidth(),c=this._api.getHeight();t=t||e.get("position");var u=r.getSize(),h=e.get("align"),d=e.get("verticalAlign"),p=a&&a.getBoundingRect().clone();if(a&&p.applyTransform(a.transform),Object(s["w"])(t)&&(t=t([n,i],o,r.el,p,{viewSize:[l,c],contentSize:u.slice()})),Object(s["t"])(t))n=ji(t[0],l),i=ji(t[1],c);else if(Object(s["A"])(t)){var f=t;f.width=u[0],f.height=u[1];var g=Bu(f,{width:l,height:c});n=g.x,i=g.y,h=null,d=null}else if(Object(s["C"])(t)&&a){var m=MY(t,p,u,e.get("borderWidth"));n=m[0],i=m[1]}else{m=kY(n,i,r,l,c,h?null:20,d?null:20);n=m[0],i=m[1]}if(h&&(n-=TY(h)?u[0]/2:"right"===h?u[0]:0),d&&(i-=TY(d)?u[1]/2:"bottom"===d?u[1]:0),JU(e)){m=OY(n,i,r,l,c);n=m[0],i=m[1]}r.moveTo(n,i)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,i=this._cbParamsList,r=!!n&&n.length===e.length;return r&&Object(s["k"])(n,(function(n,o){var a=n.dataByAxis||[],l=e[o]||{},c=l.dataByAxis||[];r=r&&a.length===c.length,r&&Object(s["k"])(a,(function(e,n){var o=c[n]||{},a=e.seriesDataIndices||[],l=o.seriesDataIndices||[];r=r&&e.value===o.value&&e.axisType===o.axisType&&e.axisId===o.axisId&&a.length===l.length,r&&Object(s["k"])(a,(function(e,t){var n=l[t];r=r&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex})),i&&Object(s["k"])(e.seriesDataIndices,(function(e){var n=e.seriesIndex,o=t[n],a=i[n];o&&a&&a.data!==o.data&&(r=!1)}))}))})),this._lastDataByCoordSys=e,this._cbParamsList=t,!!r},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,t){!a["a"].node&&t.getDom()&&(Qm(this,"_updatePosition"),this._tooltipContent.dispose(),nW("itemTooltip",t))},t.type="tooltip",t}(Of);function SY(e,t,n){var i,r=t.ecModel;n?(i=new Mc(n,r,r),i=new Mc(t.option,i,r)):i=t;for(var o=e.length-1;o>=0;o--){var a=e[o];a&&(a instanceof Mc&&(a=a.get("tooltip",!0)),Object(s["C"])(a)&&(a={formatter:a}),a&&(i=new Mc(a,i,r)))}return i}function CY(e,t){return e.dispatchAction||Object(s["c"])(t.dispatchAction,t)}function kY(e,t,n,i,r,o,a){var s=n.getSize(),l=s[0],c=s[1];return null!=o&&(e+l+o+2>i?e-=l+o:e+=o),null!=a&&(t+c+a>r?t-=c+a:t+=a),[e,t]}function OY(e,t,n,i,r){var o=n.getSize(),a=o[0],s=o[1];return e=Math.min(e+a,i)-a,t=Math.min(t+s,r)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function MY(e,t,n,i){var r=n[0],o=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,c=t.width,u=t.height;switch(e){case"inside":s=t.x+c/2-r/2,l=t.y+u/2-o/2;break;case"top":s=t.x+c/2-r/2,l=t.y-o-a;break;case"bottom":s=t.x+c/2-r/2,l=t.y+u+a;break;case"left":s=t.x-r-a,l=t.y+u/2-o/2;break;case"right":s=t.x+c+a,l=t.y+u/2-o/2}return[s,l]}function TY(e){return"center"===e||"middle"===e}function DY(e,t,n){var i=Pr(e).queryOptionMap,r=i.keys()[0];if(r&&"series"!==r){var o=jr(t,r,i.get(r),{useDefault:!1,enableAll:!1,enableNone:!1}),a=o.models[0];if(a){var s,l=n.getViewOfComponentModel(a);return l.group.traverse((function(t){var n=ks(t).tooltipConfig;if(n&&n.name===e.name)return s=t,!0})),s?{componentMainType:r,componentIndex:a.componentIndex,el:s}:void 0}}}var IY=wY;function AY(e){N_(yW),e.registerComponentModel(ZU),e.registerComponentView(IY),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},s["L"]),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},s["L"])}var EY=["rect","polygon","keep","clear"];function PY(e,t){var n=lr(e?e.brush:[]);if(n.length){var i=[];s["k"](n,(function(e){var t=e.hasOwnProperty("toolbox")?e.toolbox:[];t instanceof Array&&(i=i.concat(t))}));var r=e&&e.toolbox;s["t"](r)&&(r=r[0]),r||(r={feature:{}},e.toolbox=[r]);var o=r.feature||(r.feature={}),a=o.brush||(o.brush={}),l=a.type||(a.type=[]);l.push.apply(l,i),LY(l),t&&!l.length&&l.push.apply(l,EY)}}function LY(e){var t={};s["k"](e,(function(e){t[e]=1})),e.length=0,s["k"](t,(function(t,n){e.push(n)}))}var NY=s["k"];function jY(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!0}function RY(e,t,n){var i={};return NY(t,(function(t){var o=i[t]=r();NY(e[t],(function(e,i){if(rL.isValidType(i)){var r={type:i,visual:e};n&&n(r,t),o[i]=new rL(r),"opacity"===i&&(r=s["d"](r),r.type="colorAlpha",o.__hidden.__alphaForOpacity=new rL(r))}}))})),i;function r(){var e=function(){};e.prototype.__hidden=e.prototype;var t=new e;return t}}function zY(e,t,n){var i;s["k"](n,(function(e){t.hasOwnProperty(e)&&jY(t[e])&&(i=!0)})),i&&s["k"](n,(function(n){t.hasOwnProperty(n)&&jY(t[n])?e[n]=s["d"](t[n]):delete e[n]}))}function $Y(e,t,n,i,r,o){var a,l={};function c(e){return Bv(n,a,e)}function u(e,t){Vv(n,a,e,t)}function h(e,s){a=null==o?e:s;var h=n.getRawDataItem(a);if(!h||!1!==h.visualMap)for(var d=i.call(r,e),p=t[d],f=l[d],g=0,m=f.length;g