win-chart 2.9.1 → 2.9.2

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.
@@ -0,0 +1,22 @@
1
+ import e,{useRef as t,useDebugValue as n,createElement as r,useContext as i,useState as o,useEffect as a}from"react";var s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(e,t)};function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(){return u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},u.apply(this,arguments)};function c(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var h=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},d=new function(){this.browser=new h,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(d.wxa=!0,d.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?d.worker=!0:"undefined"==typeof navigator||0===navigator.userAgent.indexOf("Node.js")?(d.node=!0,d.svgSupported=!0):function(e,t){var n=t.browser,r=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),o=e.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(e);r&&(n.firefox=!0,n.version=r[1]);i&&(n.ie=!0,n.version=i[1]);o&&(n.edge=!0,n.version=o[1],n.newEdge=+o[1].split(".")[0]>18);a&&(n.weChat=!0);t.svgSupported="undefined"!=typeof SVGRect,t.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,t.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),t.domSupported="undefined"!=typeof document;var s=document.documentElement.style;t.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),t.transformSupported=t.transform3dSupported||n.ie&&+n.version>=9}(navigator.userAgent,d);var p="sans-serif",f="12px "+p;var g,m,v=function(e){var t={};if("undefined"==typeof JSON)return t;for(var n=0;n<e.length;n++){var r=String.fromCharCode(n+32),i=(e.charCodeAt(n)-20)/100;t[r]=i}return t}("007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N"),y={createCanvas:function(){return"undefined"!=typeof document&&document.createElement("canvas")},measureText:function(e,t){if(!g){var n=y.createCanvas();g=n&&n.getContext("2d")}if(g)return m!==t&&(m=g.font=t||f),g.measureText(e);e=e||"";var r=/((?:\d+)?\.?\d*)px/.exec(t=t||f),i=r&&+r[1]||12,o=0;if(t.indexOf("mono")>=0)o=i*e.length;else for(var a=0;a<e.length;a++){var s=v[e[a]];o+=null==s?i:s*i}return{width:o}},loadImage:function(e,t,n){var r=new Image;return r.onload=t,r.onerror=n,r.src=e,r}};function _(e){for(var t in y)e[t]&&(y[t]=e[t])}var x=X(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],(function(e,t){return e["[object "+t+"]"]=!0,e}),{}),b=X(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],(function(e,t){return e["[object "+t+"Array]"]=!0,e}),{}),w=Object.prototype.toString,S=Array.prototype,T=S.forEach,M=S.filter,C=S.slice,D=S.map,A=function(){}.constructor,I=A?A.prototype:null,E="__proto__",L=2311;function N(){return L++}function P(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];"undefined"!=typeof console&&console.error.apply(console,e)}function O(e){if(null==e||"object"!=typeof e)return e;var t=e,n=w.call(e);if("[object Array]"===n){if(!xe(e)){t=[];for(var r=0,i=e.length;r<i;r++)t[r]=O(e[r])}}else if(b[n]){if(!xe(e)){var o=e.constructor;if(o.from)t=o.from(e);else{t=new o(e.length);for(r=0,i=e.length;r<i;r++)t[r]=e[r]}}}else if(!x[n]&&!xe(e)&&!ae(e))for(var a in t={},e)e.hasOwnProperty(a)&&a!==E&&(t[a]=O(e[a]));return t}function R(e,t,n){if(!re(t)||!re(e))return n?O(t):e;for(var r in t)if(t.hasOwnProperty(r)&&r!==E){var i=e[r],o=t[r];!re(o)||!re(i)||J(o)||J(i)||ae(o)||ae(i)||ie(o)||ie(i)||xe(o)||xe(i)?!n&&r in e||(e[r]=O(t[r])):R(i,o,n)}return e}function k(e,t){for(var n=e[0],r=1,i=e.length;r<i;r++)n=R(n,e[r],t);return n}function z(e,t){if(Object.assign)Object.assign(e,t);else for(var n in t)t.hasOwnProperty(n)&&n!==E&&(e[n]=t[n]);return e}function V(e,t,n){for(var r=q(t),i=0;i<r.length;i++){var o=r[i];(n?null!=t[o]:null==e[o])&&(e[o]=t[o])}return e}var B=y.createCanvas;function F(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n}return-1}function G(e,t){var n=e.prototype;function r(){}for(var i in r.prototype=t.prototype,e.prototype=new r,n)n.hasOwnProperty(i)&&(e.prototype[i]=n[i]);e.prototype.constructor=e,e.superClass=t}function H(e,t,n){if(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,Object.getOwnPropertyNames)for(var r=Object.getOwnPropertyNames(t),i=0;i<r.length;i++){var o=r[i];"constructor"!==o&&(n?null!=t[o]:null==e[o])&&(e[o]=t[o])}else V(e,t,n)}function U(e){return!!e&&("string"!=typeof e&&"number"==typeof e.length)}function W(e,t,n){if(e&&t)if(e.forEach&&e.forEach===T)e.forEach(t,n);else if(e.length===+e.length)for(var r=0,i=e.length;r<i;r++)t.call(n,e[r],r,e);else for(var o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o,e)}function j(e,t,n){if(!e)return[];if(!t)return fe(e);if(e.map&&e.map===D)return e.map(t,n);for(var r=[],i=0,o=e.length;i<o;i++)r.push(t.call(n,e[i],i,e));return r}function X(e,t,n,r){if(e&&t){for(var i=0,o=e.length;i<o;i++)n=t.call(r,n,e[i],i,e);return n}}function Y(e,t,n){if(!e)return[];if(!t)return fe(e);if(e.filter&&e.filter===M)return e.filter(t,n);for(var r=[],i=0,o=e.length;i<o;i++)t.call(n,e[i],i,e)&&r.push(e[i]);return r}function Z(e,t,n){if(e&&t)for(var r=0,i=e.length;r<i;r++)if(t.call(n,e[r],r,e))return e[r]}function q(e){if(!e)return[];if(Object.keys)return Object.keys(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}var K=I&&Q(I.bind)?I.call.bind(I.bind):function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return function(){return e.apply(t,n.concat(C.call(arguments)))}};function $(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){return e.apply(this,t.concat(C.call(arguments)))}}function J(e){return Array.isArray?Array.isArray(e):"[object Array]"===w.call(e)}function Q(e){return"function"==typeof e}function ee(e){return"string"==typeof e}function te(e){return"[object String]"===w.call(e)}function ne(e){return"number"==typeof e}function re(e){var t=typeof e;return"function"===t||!!e&&"object"===t}function ie(e){return!!x[w.call(e)]}function oe(e){return!!b[w.call(e)]}function ae(e){return"object"==typeof e&&"number"==typeof e.nodeType&&"object"==typeof e.ownerDocument}function se(e){return null!=e.colorStops}function le(e){return null!=e.image}function ue(e){return"[object RegExp]"===w.call(e)}function ce(e){return e!=e}function he(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e.length;n<r;n++)if(null!=e[n])return e[n]}function de(e,t){return null!=e?e:t}function pe(e,t,n){return null!=e?e:null!=t?t:n}function fe(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return C.apply(e,t)}function ge(e){if("number"==typeof e)return[e,e,e,e];var t=e.length;return 2===t?[e[0],e[1],e[0],e[1]]:3===t?[e[0],e[1],e[2],e[1]]:e}function me(e,t){if(!e)throw new Error(t)}function ve(e){return null==e?null:"function"==typeof e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var ye="__ec_primitive__";function _e(e){e[ye]=!0}function xe(e){return e[ye]}var be=function(){function e(){this.data={}}return e.prototype.delete=function(e){var t=this.has(e);return t&&delete this.data[e],t},e.prototype.has=function(e){return this.data.hasOwnProperty(e)},e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){return this.data[e]=t,this},e.prototype.keys=function(){return q(this.data)},e.prototype.forEach=function(e){var t=this.data;for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},e}(),we="function"==typeof Map;var Se=function(){function e(t){var n=J(t);this.data=we?new Map:new be;var r=this;function i(e,t){n?r.set(e,t):r.set(t,e)}t instanceof e?t.each(i):t&&W(t,i)}return e.prototype.hasKey=function(e){return this.data.has(e)},e.prototype.get=function(e){return this.data.get(e)},e.prototype.set=function(e,t){return this.data.set(e,t),t},e.prototype.each=function(e,t){this.data.forEach((function(n,r){e.call(t,n,r)}))},e.prototype.keys=function(){var e=this.data.keys();return we?Array.from(e):e},e.prototype.removeKey=function(e){this.data.delete(e)},e}();function Te(e){return new Se(e)}function Me(e,t){for(var n=new e.constructor(e.length+t.length),r=0;r<e.length;r++)n[r]=e[r];var i=e.length;for(r=0;r<t.length;r++)n[r+i]=t[r];return n}function Ce(e,t){var n;if(Object.create)n=Object.create(e);else{var r=function(){};r.prototype=e,n=new r}return t&&z(n,t),n}function De(e){var t=e.style;t.webkitUserSelect="none",t.userSelect="none",t.webkitTapHighlightColor="rgba(0,0,0,0)",t["-webkit-touch-callout"]="none"}function Ae(e,t){return e.hasOwnProperty(t)}function Ie(){}var Ee=180/Math.PI,Le=Object.freeze({__proto__:null,HashMap:Se,RADIAN_TO_DEGREE:Ee,assert:me,bind:K,clone:O,concatArray:Me,createCanvas:B,createHashMap:Te,createObject:Ce,curry:$,defaults:V,disableUserSelect:De,each:W,eqNaN:ce,extend:z,filter:Y,find:Z,guid:N,hasOwn:Ae,indexOf:F,inherits:G,isArray:J,isArrayLike:U,isBuiltInObject:ie,isDom:ae,isFunction:Q,isGradientObject:se,isImagePatternObject:le,isNumber:ne,isObject:re,isPrimitive:xe,isRegExp:ue,isString:ee,isStringSafe:te,isTypedArray:oe,keys:q,logError:P,map:j,merge:R,mergeAll:k,mixin:H,noop:Ie,normalizeCssArray:ge,reduce:X,retrieve:he,retrieve2:de,retrieve3:pe,setAsPrimitive:_e,slice:fe,trim:ve});function Ne(e,t){return null==e&&(e=0),null==t&&(t=0),[e,t]}function Pe(e,t){return e[0]=t[0],e[1]=t[1],e}function Oe(e){return[e[0],e[1]]}function Re(e,t,n){return e[0]=t,e[1]=n,e}function ke(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function ze(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e}function Ve(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function Be(e){return Math.sqrt(Ge(e))}var Fe=Be;function Ge(e){return e[0]*e[0]+e[1]*e[1]}var He=Ge;function Ue(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function We(e,t){var n=Be(t);return 0===n?(e[0]=0,e[1]=0):(e[0]=t[0]/n,e[1]=t[1]/n),e}function je(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var Xe=je;function Ye(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var Ze=Ye;function qe(e,t,n,r){return e[0]=t[0]+r*(n[0]-t[0]),e[1]=t[1]+r*(n[1]-t[1]),e}function Ke(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e}function $e(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}function Je(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}var Qe=Object.freeze({__proto__:null,add:ke,applyTransform:Ke,clone:Oe,copy:Pe,create:Ne,dist:Xe,distSquare:Ze,distance:je,distanceSquare:Ye,div:function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},len:Be,lenSquare:Ge,length:Fe,lengthSquare:He,lerp:qe,max:Je,min:$e,mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},normalize:We,scale:Ue,scaleAndAdd:ze,set:Re,sub:Ve}),et=function(e,t){this.target=e,this.topTarget=t&&t.topTarget},tt=function(){function e(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return e.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new et(t,e),"dragstart",e.event))},e.prototype._drag=function(e){var t=this._draggingTarget;if(t){var n=e.offsetX,r=e.offsetY,i=n-this._x,o=r-this._y;this._x=n,this._y=r,t.drift(i,o,e),this.handler.dispatchToElement(new et(t,e),"drag",e.event);var a=this.handler.findHover(n,r,t).target,s=this._dropTarget;this._dropTarget=a,t!==a&&(s&&a!==s&&this.handler.dispatchToElement(new et(s,e),"dragleave",e.event),a&&a!==s&&this.handler.dispatchToElement(new et(a,e),"dragenter",e.event))}},e.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new et(t,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new et(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},e}(),nt=function(){function e(e){e&&(this._$eventProcessor=e)}return e.prototype.on=function(e,t,n,r){this._$handlers||(this._$handlers={});var i=this._$handlers;if("function"==typeof t&&(r=n,n=t,t=null),!n||!e)return this;var o=this._$eventProcessor;null!=t&&o&&o.normalizeQuery&&(t=o.normalizeQuery(t)),i[e]||(i[e]=[]);for(var a=0;a<i[e].length;a++)if(i[e][a].h===n)return this;var s={h:n,query:t,ctx:r||this,callAtLast:n.zrEventfulCallAtLast},l=i[e].length-1,u=i[e][l];return u&&u.callAtLast?i[e].splice(l,0,s):i[e].push(s),this},e.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length},e.prototype.off=function(e,t){var n=this._$handlers;if(!n)return this;if(!e)return this._$handlers={},this;if(t){if(n[e]){for(var r=[],i=0,o=n[e].length;i<o;i++)n[e][i].h!==t&&r.push(n[e][i]);n[e]=r}n[e]&&0===n[e].length&&delete n[e]}else delete n[e];return this},e.prototype.trigger=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!this._$handlers)return this;var r=this._$handlers[e],i=this._$eventProcessor;if(r)for(var o=t.length,a=r.length,s=0;s<a;s++){var l=r[s];if(!i||!i.filter||null==l.query||i.filter(e,l.query))switch(o){case 0:l.h.call(l.ctx);break;case 1:l.h.call(l.ctx,t[0]);break;case 2:l.h.call(l.ctx,t[0],t[1]);break;default:l.h.apply(l.ctx,t)}}return i&&i.afterTrigger&&i.afterTrigger(e),this},e.prototype.triggerWithContext=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!this._$handlers)return this;var r=this._$handlers[e],i=this._$eventProcessor;if(r)for(var o=t.length,a=t[o-1],s=r.length,l=0;l<s;l++){var u=r[l];if(!i||!i.filter||null==u.query||i.filter(e,u.query))switch(o){case 0:u.h.call(a);break;case 1:u.h.call(a,t[0]);break;case 2:u.h.call(a,t[0],t[1]);break;default:u.h.apply(a,t.slice(1,o-1))}}return i&&i.afterTrigger&&i.afterTrigger(e),this},e}(),rt=Math.log(2);function it(e,t,n,r,i,o){var a=r+"-"+i,s=e.length;if(o.hasOwnProperty(a))return o[a];if(1===t){var l=Math.round(Math.log((1<<s)-1&~i)/rt);return e[n][l]}for(var u=r|1<<n,c=n+1;r&1<<c;)c++;for(var h=0,d=0,p=0;d<s;d++){var f=1<<d;f&i||(h+=(p%2?-1:1)*e[n][d]*it(e,t-1,c,u,i|f,o),p++)}return o[a]=h,h}function ot(e,t){var n=[[e[0],e[1],1,0,0,0,-t[0]*e[0],-t[0]*e[1]],[0,0,0,e[0],e[1],1,-t[1]*e[0],-t[1]*e[1]],[e[2],e[3],1,0,0,0,-t[2]*e[2],-t[2]*e[3]],[0,0,0,e[2],e[3],1,-t[3]*e[2],-t[3]*e[3]],[e[4],e[5],1,0,0,0,-t[4]*e[4],-t[4]*e[5]],[0,0,0,e[4],e[5],1,-t[5]*e[4],-t[5]*e[5]],[e[6],e[7],1,0,0,0,-t[6]*e[6],-t[6]*e[7]],[0,0,0,e[6],e[7],1,-t[7]*e[6],-t[7]*e[7]]],r={},i=it(n,8,0,0,0,r);if(0!==i){for(var o=[],a=0;a<8;a++)for(var s=0;s<8;s++)null==o[s]&&(o[s]=0),o[s]+=((a+s)%2?-1:1)*it(n,7,0===a?1:0,1<<a,1<<s,r)/i*t[a];return function(e,t,n){var r=t*o[6]+n*o[7]+1;e[0]=(t*o[0]+n*o[1]+o[2])/r,e[1]=(t*o[3]+n*o[4]+o[5])/r}}}var at="___zrEVENTSAVED",st=[];function lt(e,t,n,r,i){if(t.getBoundingClientRect&&d.domSupported&&!ut(t)){var o=t[at]||(t[at]={}),a=function(e,t){var n=t.markers;if(n)return n;n=t.markers=[];for(var r=["left","right"],i=["top","bottom"],o=0;o<4;o++){var a=document.createElement("div"),s=o%2,l=(o>>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",r[s]+":0",i[l]+":0",r[1-s]+":auto",i[1-l]+":auto",""].join("!important;"),e.appendChild(a),n.push(a)}return n}(t,o),s=function(e,t,n){for(var r=n?"invTrans":"trans",i=t[r],o=t.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var c=e[u].getBoundingClientRect(),h=2*u,d=c.left,p=c.top;a.push(d,p),l=l&&o&&d===o[h]&&p===o[h+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&i?i:(t.srcCoords=a,t[r]=n?ot(s,a):ot(a,s))}(a,o,i);if(s)return s(e,n,r),!0}return!1}function ut(e){return"CANVAS"===e.nodeName.toUpperCase()}var ct=/([&<>"'])/g,ht={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function dt(e){return null==e?"":(e+"").replace(ct,(function(e,t){return ht[t]}))}var pt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ft=[],gt=d.browser.firefox&&+d.browser.version.split(".")[0]<39;function mt(e,t,n,r){return n=n||{},r?vt(e,t,n):gt&&null!=t.layerX&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):null!=t.offsetX?(n.zrX=t.offsetX,n.zrY=t.offsetY):vt(e,t,n),n}function vt(e,t,n){if(d.domSupported&&e.getBoundingClientRect){var r=t.clientX,i=t.clientY;if(ut(e)){var o=e.getBoundingClientRect();return n.zrX=r-o.left,void(n.zrY=i-o.top)}if(lt(ft,e,r,i))return n.zrX=ft[0],void(n.zrY=ft[1])}n.zrX=n.zrY=0}function yt(e){return e||window.event}function _t(e,t,n){if(null!=(t=yt(t)).zrX)return t;var r=t.type;if(r&&r.indexOf("touch")>=0){var i="touchend"!==r?t.targetTouches[0]:t.changedTouches[0];i&&mt(e,i,t,n)}else{mt(e,t,t,n);var o=function(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,r=e.deltaY;if(null==n||null==r)return t;var i=0!==r?Math.abs(r):Math.abs(n),o=r>0?-1:r<0?1:n>0?-1:1;return 3*i*o}(t);t.zrDelta=o?o/120:-(t.detail||0)/3}var a=t.button;return null==t.which&&void 0!==a&&pt.test(t.type)&&(t.which=1&a?1:2&a?3:4&a?2:0),t}function xt(e,t,n,r){e.addEventListener(t,n,r)}var bt=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function wt(e){return 2===e.which||3===e.which}var St=function(){function e(){this._track=[]}return e.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(e,t,n){var r=e.touches;if(r){for(var i={points:[],touches:[],target:t,event:e},o=0,a=r.length;o<a;o++){var s=r[o],l=mt(n,s,{});i.points.push([l.zrX,l.zrY]),i.touches.push(s)}this._track.push(i)}},e.prototype._recognize=function(e){for(var t in Mt)if(Mt.hasOwnProperty(t)){var n=Mt[t](this._track,e);if(n)return n}},e}();function Tt(e){var t=e[1][0]-e[0][0],n=e[1][1]-e[0][1];return Math.sqrt(t*t+n*n)}var Mt={pinch:function(e,t){var n=e.length;if(n){var r,i=(e[n-1]||{}).points,o=(e[n-2]||{}).points||i;if(o&&o.length>1&&i&&i.length>1){var a=Tt(i)/Tt(o);!isFinite(a)&&(a=1),t.pinchScale=a;var s=[((r=i)[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2];return t.pinchX=s[0],t.pinchY=s[1],{type:"pinch",target:e[0].target,event:t}}}}};function Ct(){return[1,0,0,1,0,0]}function Dt(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function At(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function It(e,t,n){var r=t[0]*n[0]+t[2]*n[1],i=t[1]*n[0]+t[3]*n[1],o=t[0]*n[2]+t[2]*n[3],a=t[1]*n[2]+t[3]*n[3],s=t[0]*n[4]+t[2]*n[5]+t[4],l=t[1]*n[4]+t[3]*n[5]+t[5];return e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e}function Et(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e}function Lt(e,t,n,r){void 0===r&&(r=[0,0]);var i=t[0],o=t[2],a=t[4],s=t[1],l=t[3],u=t[5],c=Math.sin(n),h=Math.cos(n);return e[0]=i*h+s*c,e[1]=-i*c+s*h,e[2]=o*h+l*c,e[3]=-o*c+h*l,e[4]=h*(a-r[0])+c*(u-r[1])+r[0],e[5]=h*(u-r[1])-c*(a-r[0])+r[1],e}function Nt(e,t,n){var r=n[0],i=n[1];return e[0]=t[0]*r,e[1]=t[1]*i,e[2]=t[2]*r,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*i,e}function Pt(e,t){var n=t[0],r=t[2],i=t[4],o=t[1],a=t[3],s=t[5],l=n*a-o*r;return l?(l=1/l,e[0]=a*l,e[1]=-o*l,e[2]=-r*l,e[3]=n*l,e[4]=(r*s-a*i)*l,e[5]=(o*i-n*s)*l,e):null}function Ot(e){var t=[1,0,0,1,0,0];return At(t,e),t}var Rt=Object.freeze({__proto__:null,clone:Ot,copy:At,create:Ct,identity:Dt,invert:Pt,mul:It,rotate:Lt,scale:Nt,translate:Et}),kt=function(){function e(e,t){this.x=e||0,this.y=t||0}return e.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(e,t){return this.x=e,this.y=t,this},e.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},e.prototype.scale=function(e){this.x*=e,this.y*=e},e.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},e.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},e.prototype.dot=function(e){return this.x*e.x+this.y*e.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},e.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},e.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},e.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},e.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},e.set=function(e,t,n){e.x=t,e.y=n},e.copy=function(e,t){e.x=t.x,e.y=t.y},e.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},e.lenSquare=function(e){return e.x*e.x+e.y*e.y},e.dot=function(e,t){return e.x*t.x+e.y*t.y},e.add=function(e,t,n){e.x=t.x+n.x,e.y=t.y+n.y},e.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},e.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},e.scaleAndAdd=function(e,t,n,r){e.x=t.x+n.x*r,e.y=t.y+n.y*r},e.lerp=function(e,t,n,r){var i=1-r;e.x=i*t.x+r*n.x,e.y=i*t.y+r*n.y},e}(),zt=Math.min,Vt=Math.max,Bt=new kt,Ft=new kt,Gt=new kt,Ht=new kt,Ut=new kt,Wt=new kt,jt=function(){function e(e,t,n,r){n<0&&(e+=n,n=-n),r<0&&(t+=r,r=-r),this.x=e,this.y=t,this.width=n,this.height=r}return e.prototype.union=function(e){var t=zt(e.x,this.x),n=zt(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Vt(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=Vt(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=t,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(e){var t=this,n=e.width/t.width,r=e.height/t.height,i=[1,0,0,1,0,0];return Et(i,i,[-t.x,-t.y]),Nt(i,i,[n,r]),Et(i,i,[e.x,e.y]),i},e.prototype.intersect=function(t,n){if(!t)return!1;t instanceof e||(t=e.create(t));var r=this,i=r.x,o=r.x+r.width,a=r.y,s=r.y+r.height,l=t.x,u=t.x+t.width,c=t.y,h=t.y+t.height,d=!(o<l||u<i||s<c||h<a);if(n){var p=1/0,f=0,g=Math.abs(o-l),m=Math.abs(u-i),v=Math.abs(s-c),y=Math.abs(h-a),_=Math.min(g,m),x=Math.min(v,y);o<l||u<i?_>f&&(f=_,g<m?kt.set(Wt,-g,0):kt.set(Wt,m,0)):_<p&&(p=_,g<m?kt.set(Ut,g,0):kt.set(Ut,-m,0)),s<c||h<a?x>f&&(f=x,v<y?kt.set(Wt,0,-v):kt.set(Wt,0,y)):_<p&&(p=_,v<y?kt.set(Ut,0,v):kt.set(Ut,0,-y))}return n&&kt.copy(n,d?Ut:Wt),d},e.prototype.contain=function(e,t){var n=this;return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return 0===this.width||0===this.height},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},e.applyTransform=function(t,n,r){if(r){if(r[1]<1e-5&&r[1]>-1e-5&&r[2]<1e-5&&r[2]>-1e-5){var i=r[0],o=r[3],a=r[4],s=r[5];return t.x=n.x*i+a,t.y=n.y*o+s,t.width=n.width*i,t.height=n.height*o,t.width<0&&(t.x+=t.width,t.width=-t.width),void(t.height<0&&(t.y+=t.height,t.height=-t.height))}Bt.x=Gt.x=n.x,Bt.y=Ht.y=n.y,Ft.x=Ht.x=n.x+n.width,Ft.y=Gt.y=n.y+n.height,Bt.transform(r),Ht.transform(r),Ft.transform(r),Gt.transform(r),t.x=zt(Bt.x,Ft.x,Gt.x,Ht.x),t.y=zt(Bt.y,Ft.y,Gt.y,Ht.y);var l=Vt(Bt.x,Ft.x,Gt.x,Ht.x),u=Vt(Bt.y,Ft.y,Gt.y,Ht.y);t.width=l-t.x,t.height=u-t.y}else t!==n&&e.copy(t,n)},e}(),Xt="silent";function Yt(){bt(this.event)}var Zt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handler=null,t}return l(t,e),t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(nt),qt=function(e,t){this.x=e,this.y=t},Kt=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],$t=new jt(0,0,0,0),Jt=function(e){function t(t,n,r,i,o){var a=e.call(this)||this;return a._hovered=new qt(0,0),a.storage=t,a.painter=n,a.painterRoot=i,a._pointerSize=o,r=r||new Zt,a.proxy=null,a.setHandlerProxy(r),a._draggingMgr=new tt(a),a}return l(t,e),t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(W(Kt,(function(t){e.on&&e.on(t,this[t],this)}),this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var t=e.zrX,n=e.zrY,r=tn(this,t,n),i=this._hovered,o=i.target;o&&!o.__zr&&(o=(i=this.findHover(i.x,i.y)).target);var a=this._hovered=r?new qt(t,n):this.findHover(t,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(i,"mouseout",e),this.dispatchToElement(a,"mousemove",e),s&&s!==o&&this.dispatchToElement(a,"mouseover",e)},t.prototype.mouseout=function(e){var t=e.zrEventControl;"only_globalout"!==t&&this.dispatchToElement(this._hovered,"mouseout",e),"no_globalout"!==t&&this.trigger("globalout",{type:"globalout",event:e})},t.prototype.resize=function(){this._hovered=new qt(0,0)},t.prototype.dispatch=function(e,t){var n=this[e];n&&n.call(this,t)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},t.prototype.dispatchToElement=function(e,t,n){var r=(e=e||{}).target;if(!r||!r.silent){for(var i="on"+t,o=function(e,t,n){return{type:e,event:n,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Yt}}(t,e,n);r&&(r[i]&&(o.cancelBubble=!!r[i].call(r,o)),r.trigger(t,o),r=r.__hostTarget?r.__hostTarget:r.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(t,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(e){"function"==typeof e[i]&&e[i].call(e,o),e.trigger&&e.trigger(t,o)})))}},t.prototype.findHover=function(e,t,n){var r=this.storage.getDisplayList(),i=new qt(e,t);if(en(r,i,e,t,n),this._pointerSize&&!i.target){for(var o=[],a=this._pointerSize,s=a/2,l=new jt(e-s,t-s,a,a),u=r.length-1;u>=0;u--){var c=r[u];c===n||c.ignore||c.ignoreCoarsePointer||c.parent&&c.parent.ignoreCoarsePointer||($t.copy(c.getBoundingRect()),c.transform&&$t.applyTransform(c.transform),$t.intersect(l)&&o.push(c))}if(o.length)for(var h=Math.PI/12,d=2*Math.PI,p=0;p<s;p+=4)for(var f=0;f<d;f+=h){if(en(o,i,e+p*Math.cos(f),t+p*Math.sin(f),n),i.target)return i}}return i},t.prototype.processGesture=function(e,t){this._gestureMgr||(this._gestureMgr=new St);var n=this._gestureMgr;"start"===t&&n.clear();var r=n.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if("end"===t&&n.clear(),r){var i=r.type;e.gestureEvent=i;var o=new qt;o.target=r.target,this.dispatchToElement(o,i,r.event)}},t}(nt);function Qt(e,t,n){if(e[e.rectHover?"rectContain":"contain"](t,n)){for(var r=e,i=void 0,o=!1;r;){if(r.ignoreClip&&(o=!0),!o){var a=r.getClipPath();if(a&&!a.contain(t,n))return!1}r.silent&&(i=!0);var s=r.__hostTarget;r=s||r.parent}return!i||Xt}return!1}function en(e,t,n,r,i){for(var o=e.length-1;o>=0;o--){var a=e[o],s=void 0;if(a!==i&&!a.ignore&&(s=Qt(a,n,r))&&(!t.topTarget&&(t.topTarget=a),s!==Xt)){t.target=a;break}}}function tn(e,t,n){var r=e.painter;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}W(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(e){Jt.prototype[e]=function(t){var n,r,i=t.zrX,o=t.zrY,a=tn(this,i,o);if("mouseup"===e&&a||(r=(n=this.findHover(i,o)).target),"mousedown"===e)this._downEl=r,this._downPoint=[t.zrX,t.zrY],this._upEl=r;else if("mouseup"===e)this._upEl=r;else if("click"===e){if(this._downEl!==this._upEl||!this._downPoint||Xe(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,e,t)}}));function nn(e,t,n,r){var i=t+1;if(i===n)return 1;if(r(e[i++],e[t])<0){for(;i<n&&r(e[i],e[i-1])<0;)i++;!function(e,t,n){n--;for(;t<n;){var r=e[t];e[t++]=e[n],e[n--]=r}}(e,t,i)}else for(;i<n&&r(e[i],e[i-1])>=0;)i++;return i-t}function rn(e,t,n,r,i){for(r===t&&r++;r<n;r++){for(var o,a=e[r],s=t,l=r;s<l;)i(a,e[o=s+l>>>1])<0?l=o:s=o+1;var u=r-s;switch(u){case 3:e[s+3]=e[s+2];case 2:e[s+2]=e[s+1];case 1:e[s+1]=e[s];break;default:for(;u>0;)e[s+u]=e[s+u-1],u--}e[s]=a}}function on(e,t,n,r,i,o){var a=0,s=0,l=1;if(o(e,t[n+i])>0){for(s=r-i;l<s&&o(e,t[n+i+l])>0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=i,l+=i}else{for(s=i+1;l<s&&o(e,t[n+i-l])<=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=a;a=i-l,l=i-u}for(a++;a<l;){var c=a+(l-a>>>1);o(e,t[n+c])>0?a=c+1:l=c}return l}function an(e,t,n,r,i,o){var a=0,s=0,l=1;if(o(e,t[n+i])<0){for(s=i+1;l<s&&o(e,t[n+i-l])<0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=a;a=i-l,l=i-u}else{for(s=r-i;l<s&&o(e,t[n+i+l])>=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=i,l+=i}for(a++;a<l;){var c=a+(l-a>>>1);o(e,t[n+c])<0?l=c:a=c+1}return l}function sn(e,t){var n,r,i=7,o=0,a=[];function s(s){var l=n[s],u=r[s],c=n[s+1],h=r[s+1];r[s]=u+h,s===o-3&&(n[s+1]=n[s+2],r[s+1]=r[s+2]),o--;var d=an(e[c],e,l,u,0,t);l+=d,0!==(u-=d)&&0!==(h=on(e[l+u-1],e,c,h,h-1,t))&&(u<=h?function(n,r,o,s){var l=0;for(l=0;l<r;l++)a[l]=e[n+l];var u=0,c=o,h=n;if(e[h++]=e[c++],0==--s){for(l=0;l<r;l++)e[h+l]=a[u+l];return}if(1===r){for(l=0;l<s;l++)e[h+l]=e[c+l];return void(e[h+s]=a[u])}var d,p,f,g=i;for(;;){d=0,p=0,f=!1;do{if(t(e[c],a[u])<0){if(e[h++]=e[c++],p++,d=0,0==--s){f=!0;break}}else if(e[h++]=a[u++],d++,p=0,1==--r){f=!0;break}}while((d|p)<g);if(f)break;do{if(0!==(d=an(e[c],a,u,r,0,t))){for(l=0;l<d;l++)e[h+l]=a[u+l];if(h+=d,u+=d,(r-=d)<=1){f=!0;break}}if(e[h++]=e[c++],0==--s){f=!0;break}if(0!==(p=on(a[u],e,c,s,0,t))){for(l=0;l<p;l++)e[h+l]=e[c+l];if(h+=p,c+=p,0===(s-=p)){f=!0;break}}if(e[h++]=a[u++],1==--r){f=!0;break}g--}while(d>=7||p>=7);if(f)break;g<0&&(g=0),g+=2}if((i=g)<1&&(i=1),1===r){for(l=0;l<s;l++)e[h+l]=e[c+l];e[h+s]=a[u]}else{if(0===r)throw new Error;for(l=0;l<r;l++)e[h+l]=a[u+l]}}(l,u,c,h):function(n,r,o,s){var l=0;for(l=0;l<s;l++)a[l]=e[o+l];var u=n+r-1,c=s-1,h=o+s-1,d=0,p=0;if(e[h--]=e[u--],0==--r){for(d=h-(s-1),l=0;l<s;l++)e[d+l]=a[l];return}if(1===s){for(p=(h-=r)+1,d=(u-=r)+1,l=r-1;l>=0;l--)e[p+l]=e[d+l];return void(e[h]=a[c])}var f=i;for(;;){var g=0,m=0,v=!1;do{if(t(a[c],e[u])<0){if(e[h--]=e[u--],g++,m=0,0==--r){v=!0;break}}else if(e[h--]=a[c--],m++,g=0,1==--s){v=!0;break}}while((g|m)<f);if(v)break;do{if(0!==(g=r-an(a[c],e,n,r,r-1,t))){for(r-=g,p=(h-=g)+1,d=(u-=g)+1,l=g-1;l>=0;l--)e[p+l]=e[d+l];if(0===r){v=!0;break}}if(e[h--]=a[c--],1==--s){v=!0;break}if(0!==(m=s-on(e[u],a,0,s,s-1,t))){for(s-=m,p=(h-=m)+1,d=(c-=m)+1,l=0;l<m;l++)e[p+l]=a[d+l];if(s<=1){v=!0;break}}if(e[h--]=e[u--],0==--r){v=!0;break}f--}while(g>=7||m>=7);if(v)break;f<0&&(f=0),f+=2}(i=f)<1&&(i=1);if(1===s){for(p=(h-=r)+1,d=(u-=r)+1,l=r-1;l>=0;l--)e[p+l]=e[d+l];e[h]=a[c]}else{if(0===s)throw new Error;for(d=h-(s-1),l=0;l<s;l++)e[d+l]=a[l]}}(l,u,c,h))}return n=[],r=[],{mergeRuns:function(){for(;o>1;){var e=o-2;if(e>=1&&r[e-1]<=r[e]+r[e+1]||e>=2&&r[e-2]<=r[e]+r[e-1])r[e-1]<r[e+1]&&e--;else if(r[e]>r[e+1])break;s(e)}},forceMergeRuns:function(){for(;o>1;){var e=o-2;e>0&&r[e-1]<r[e+1]&&e--,s(e)}},pushRun:function(e,t){n[o]=e,r[o]=t,o+=1}}}function ln(e,t,n,r){n||(n=0),r||(r=e.length);var i=r-n;if(!(i<2)){var o=0;if(i<32)rn(e,n,r,n+(o=nn(e,n,r,t)),t);else{var a=sn(e,t),s=function(e){for(var t=0;e>=32;)t|=1&e,e>>=1;return e+t}(i);do{if((o=nn(e,n,r,t))<s){var l=i;l>s&&(l=s),rn(e,n,n+l,n+o,t),o=l}a.pushRun(n,o),a.mergeRuns(),i-=o,n+=o}while(0!==i);a.forceMergeRuns()}}}var un=!1;function cn(){un||(un=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function hn(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var dn,pn=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=hn}return e.prototype.traverse=function(e,t){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(e,t)},e.prototype.getDisplayList=function(e,t){t=t||!1;var n=this._displayList;return!e&&n.length||this.updateDisplayList(t),n},e.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var t=this._roots,n=this._displayList,r=0,i=t.length;r<i;r++)this._updateAndAddDisplayable(t[r],null,e);n.length=this._displayListLen,ln(n,hn)},e.prototype._updateAndAddDisplayable=function(e,t,n){if(!e.ignore||n){e.beforeUpdate(),e.update(),e.afterUpdate();var r=e.getClipPath();if(e.ignoreClip)t=null;else if(r){t=t?t.slice():[];for(var i=r,o=e;i;)i.parent=o,i.updateTransform(),t.push(i),o=i,i=i.getClipPath()}if(e.childrenRef){for(var a=e.childrenRef(),s=0;s<a.length;s++){var l=a[s];e.__dirty&&(l.__dirty|=1),this._updateAndAddDisplayable(l,t,n)}e.__dirty=0}else{var u=e;t&&t.length?u.__clipPaths=t:u.__clipPaths&&u.__clipPaths.length>0&&(u.__clipPaths=[]),isNaN(u.z)&&(cn(),u.z=0),isNaN(u.z2)&&(cn(),u.z2=0),isNaN(u.zlevel)&&(cn(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var c=e.getDecalElement&&e.getDecalElement();c&&this._updateAndAddDisplayable(c,t,n);var h=e.getTextGuideLine();h&&this._updateAndAddDisplayable(h,t,n);var d=e.getTextContent();d&&this._updateAndAddDisplayable(d,t,n)}},e.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},e.prototype.delRoot=function(e){if(e instanceof Array)for(var t=0,n=e.length;t<n;t++)this.delRoot(e[t]);else{var r=F(this._roots,e);r>=0&&this._roots.splice(r,1)}},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}();dn=d.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var fn={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},exponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,n=.1,r=.4;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*-.5:n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-fn.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?.5*fn.bounceIn(2*e):.5*fn.bounceOut(2*e-1)+.5}},gn=Math.pow,mn=Math.sqrt,vn=1e-8,yn=1e-4,_n=mn(3),xn=1/3,bn=Ne(),wn=Ne(),Sn=Ne();function Tn(e){return e>-1e-8&&e<vn}function Mn(e){return e>vn||e<-1e-8}function Cn(e,t,n,r,i){var o=1-i;return o*o*(o*e+3*i*t)+i*i*(i*r+3*o*n)}function Dn(e,t,n,r,i){var o=1-i;return 3*(((t-e)*o+2*(n-t)*i)*o+(r-n)*i*i)}function An(e,t,n,r,i,o){var a=r+3*(t-n)-e,s=3*(n-2*t+e),l=3*(t-e),u=e-i,c=s*s-3*a*l,h=s*l-9*a*u,d=l*l-3*s*u,p=0;if(Tn(c)&&Tn(h)){if(Tn(s))o[0]=0;else(T=-l/s)>=0&&T<=1&&(o[p++]=T)}else{var f=h*h-4*c*d;if(Tn(f)){var g=h/c,m=-g/2;(T=-s/a+g)>=0&&T<=1&&(o[p++]=T),m>=0&&m<=1&&(o[p++]=m)}else if(f>0){var v=mn(f),y=c*s+1.5*a*(-h+v),_=c*s+1.5*a*(-h-v);(T=(-s-((y=y<0?-gn(-y,xn):gn(y,xn))+(_=_<0?-gn(-_,xn):gn(_,xn))))/(3*a))>=0&&T<=1&&(o[p++]=T)}else{var x=(2*c*s-3*a*h)/(2*mn(c*c*c)),b=Math.acos(x)/3,w=mn(c),S=Math.cos(b),T=(-s-2*w*S)/(3*a),M=(m=(-s+w*(S+_n*Math.sin(b)))/(3*a),(-s+w*(S-_n*Math.sin(b)))/(3*a));T>=0&&T<=1&&(o[p++]=T),m>=0&&m<=1&&(o[p++]=m),M>=0&&M<=1&&(o[p++]=M)}}return p}function In(e,t,n,r,i){var o=6*n-12*t+6*e,a=9*t+3*r-3*e-9*n,s=3*t-3*e,l=0;if(Tn(a)){if(Mn(o))(c=-s/o)>=0&&c<=1&&(i[l++]=c)}else{var u=o*o-4*a*s;if(Tn(u))i[0]=-o/(2*a);else if(u>0){var c,h=mn(u),d=(-o-h)/(2*a);(c=(-o+h)/(2*a))>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}function En(e,t,n,r,i,o){var a=(t-e)*i+e,s=(n-t)*i+t,l=(r-n)*i+n,u=(s-a)*i+a,c=(l-s)*i+s,h=(c-u)*i+u;o[0]=e,o[1]=a,o[2]=u,o[3]=h,o[4]=h,o[5]=c,o[6]=l,o[7]=r}function Ln(e,t,n,r,i,o,a,s,l,u,c){var h,d,p,f,g,m=.005,v=1/0;bn[0]=l,bn[1]=u;for(var y=0;y<1;y+=.05)wn[0]=Cn(e,n,i,a,y),wn[1]=Cn(t,r,o,s,y),(f=Ze(bn,wn))<v&&(h=y,v=f);v=1/0;for(var _=0;_<32&&!(m<yn);_++)d=h-m,p=h+m,wn[0]=Cn(e,n,i,a,d),wn[1]=Cn(t,r,o,s,d),f=Ze(wn,bn),d>=0&&f<v?(h=d,v=f):(Sn[0]=Cn(e,n,i,a,p),Sn[1]=Cn(t,r,o,s,p),g=Ze(Sn,bn),p<=1&&g<v?(h=p,v=g):m*=.5);return c&&(c[0]=Cn(e,n,i,a,h),c[1]=Cn(t,r,o,s,h)),mn(v)}function Nn(e,t,n,r,i,o,a,s,l){for(var u=e,c=t,h=0,d=1/l,p=1;p<=l;p++){var f=p*d,g=Cn(e,n,i,a,f),m=Cn(t,r,o,s,f),v=g-u,y=m-c;h+=Math.sqrt(v*v+y*y),u=g,c=m}return h}function Pn(e,t,n,r){var i=1-r;return i*(i*e+2*r*t)+r*r*n}function On(e,t,n,r){return 2*((1-r)*(t-e)+r*(n-t))}function Rn(e,t,n){var r=e+n-2*t;return 0===r?.5:(e-t)/r}function kn(e,t,n,r,i){var o=(t-e)*r+e,a=(n-t)*r+t,s=(a-o)*r+o;i[0]=e,i[1]=o,i[2]=s,i[3]=s,i[4]=a,i[5]=n}function zn(e,t,n,r,i,o,a,s,l){var u,c=.005,h=1/0;bn[0]=a,bn[1]=s;for(var d=0;d<1;d+=.05){wn[0]=Pn(e,n,i,d),wn[1]=Pn(t,r,o,d),(m=Ze(bn,wn))<h&&(u=d,h=m)}h=1/0;for(var p=0;p<32&&!(c<yn);p++){var f=u-c,g=u+c;wn[0]=Pn(e,n,i,f),wn[1]=Pn(t,r,o,f);var m=Ze(wn,bn);if(f>=0&&m<h)u=f,h=m;else{Sn[0]=Pn(e,n,i,g),Sn[1]=Pn(t,r,o,g);var v=Ze(Sn,bn);g<=1&&v<h?(u=g,h=v):c*=.5}}return l&&(l[0]=Pn(e,n,i,u),l[1]=Pn(t,r,o,u)),mn(h)}function Vn(e,t,n,r,i,o,a){for(var s=e,l=t,u=0,c=1/a,h=1;h<=a;h++){var d=h*c,p=Pn(e,n,i,d),f=Pn(t,r,o,d),g=p-s,m=f-l;u+=Math.sqrt(g*g+m*m),s=p,l=f}return u}var Bn=/cubic-bezier\(([0-9,\.e ]+)\)/;function Fn(e){var t=e&&Bn.exec(e);if(t){var n=t[1].split(","),r=+ve(n[0]),i=+ve(n[1]),o=+ve(n[2]),a=+ve(n[3]);if(isNaN(r+i+o+a))return;var s=[];return function(e){return e<=0?0:e>=1?1:An(0,r,o,1,e,s)&&Cn(0,i,a,1,s[0])}}}var Gn=function(){function e(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||Ie,this.ondestroy=e.ondestroy||Ie,this.onrestart=e.onrestart||Ie,e.easing&&this.setEasing(e.easing)}return e.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),!this._paused){var n=this._life,r=e-this._startTime-this._pausedTime,i=r/n;i<0&&(i=0),i=Math.min(i,1);var o=this.easingFunc,a=o?o(i):i;if(this.onframe(a),1===i){if(!this.loop)return!0;var s=r%n;this._startTime=e-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=t},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(e){this.easing=e,this.easingFunc=Q(e)?e:fn[e]||Fn(e)},e}(),Hn=function(e){this.value=e},Un=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new Hn(e);return this.insertEntry(t),t},e.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),Wn=function(){function e(e){this._list=new Un,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,r=this._map,i=null;if(null==r[e]){var o=n.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=n.head;n.remove(s),delete r[s.key],i=s.value,this._lastRemovedEntry=s}a?a.value=t:a=new Hn(t),a.key=e,n.insertEntry(a),r[e]=a}return i},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(null!=t)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),jn={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Xn(e){return(e=Math.round(e))<0?0:e>255?255:e}function Yn(e){return e<0?0:e>1?1:e}function Zn(e){var t=e;return t.length&&"%"===t.charAt(t.length-1)?Xn(parseFloat(t)/100*255):Xn(parseInt(t,10))}function qn(e){var t=e;return t.length&&"%"===t.charAt(t.length-1)?Yn(parseFloat(t)/100):Yn(parseFloat(t))}function Kn(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function $n(e,t,n){return e+(t-e)*n}function Jn(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function Qn(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var er=new Wn(20),tr=null;function nr(e,t){tr&&Qn(tr,t),tr=er.put(e,tr||t.slice())}function rr(e,t){if(e){t=t||[];var n=er.get(e);if(n)return Qn(t,n);var r=(e+="").replace(/ /g,"").toLowerCase();if(r in jn)return Qn(t,jn[r]),nr(e,t),t;var i,o=r.length;if("#"===r.charAt(0))return 4===o||5===o?(i=parseInt(r.slice(1,4),16))>=0&&i<=4095?(Jn(t,(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,5===o?parseInt(r.slice(4),16)/15:1),nr(e,t),t):void Jn(t,0,0,0,1):7===o||9===o?(i=parseInt(r.slice(1,7),16))>=0&&i<=16777215?(Jn(t,(16711680&i)>>16,(65280&i)>>8,255&i,9===o?parseInt(r.slice(7),16)/255:1),nr(e,t),t):void Jn(t,0,0,0,1):void 0;var a=r.indexOf("("),s=r.indexOf(")");if(-1!==a&&s+1===o){var l=r.substr(0,a),u=r.substr(a+1,s-(a+1)).split(","),c=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?Jn(t,+u[0],+u[1],+u[2],1):Jn(t,0,0,0,1);c=qn(u.pop());case"rgb":return u.length>=3?(Jn(t,Zn(u[0]),Zn(u[1]),Zn(u[2]),3===u.length?c:qn(u[3])),nr(e,t),t):void Jn(t,0,0,0,1);case"hsla":return 4!==u.length?void Jn(t,0,0,0,1):(u[3]=qn(u[3]),ir(u,t),nr(e,t),t);case"hsl":return 3!==u.length?void Jn(t,0,0,0,1):(ir(u,t),nr(e,t),t);default:return}}Jn(t,0,0,0,1)}}function ir(e,t){var n=(parseFloat(e[0])%360+360)%360/360,r=qn(e[1]),i=qn(e[2]),o=i<=.5?i*(r+1):i+r-i*r,a=2*i-o;return Jn(t=t||[],Xn(255*Kn(a,o,n+1/3)),Xn(255*Kn(a,o,n)),Xn(255*Kn(a,o,n-1/3)),1),4===e.length&&(t[3]=e[3]),t}function or(e,t){var n=rr(e);if(n){for(var r=0;r<3;r++)n[r]=t<0?n[r]*(1-t)|0:(255-n[r])*t+n[r]|0,n[r]>255?n[r]=255:n[r]<0&&(n[r]=0);return dr(n,4===n.length?"rgba":"rgb")}}function ar(e,t,n){if(t&&t.length&&e>=0&&e<=1){n=n||[];var r=e*(t.length-1),i=Math.floor(r),o=Math.ceil(r),a=t[i],s=t[o],l=r-i;return n[0]=Xn($n(a[0],s[0],l)),n[1]=Xn($n(a[1],s[1],l)),n[2]=Xn($n(a[2],s[2],l)),n[3]=Yn($n(a[3],s[3],l)),n}}var sr=ar;function lr(e,t,n){if(t&&t.length&&e>=0&&e<=1){var r=e*(t.length-1),i=Math.floor(r),o=Math.ceil(r),a=rr(t[i]),s=rr(t[o]),l=r-i,u=dr([Xn($n(a[0],s[0],l)),Xn($n(a[1],s[1],l)),Xn($n(a[2],s[2],l)),Yn($n(a[3],s[3],l))],"rgba");return n?{color:u,leftIndex:i,rightIndex:o,value:r}:u}}var ur=lr;function cr(e,t,n,r){var i=rr(e);if(e)return i=function(e){if(e){var t,n,r=e[0]/255,i=e[1]/255,o=e[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),l=s-a,u=(s+a)/2;if(0===l)t=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var c=((s-r)/6+l/2)/l,h=((s-i)/6+l/2)/l,d=((s-o)/6+l/2)/l;r===s?t=d-h:i===s?t=1/3+c-d:o===s&&(t=2/3+h-c),t<0&&(t+=1),t>1&&(t-=1)}var p=[360*t,n,u];return null!=e[3]&&p.push(e[3]),p}}(i),null!=t&&(i[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=n&&(i[1]=qn(n)),null!=r&&(i[2]=qn(r)),dr(ir(i),"rgba")}function hr(e,t){var n=rr(e);if(n&&null!=t)return n[3]=Yn(t),dr(n,"rgba")}function dr(e,t){if(e&&e.length){var n=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(n+=","+e[3]),t+"("+n+")"}}function pr(e,t){var n=rr(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}var fr=new Wn(100);function gr(e){if(ee(e)){var t=fr.get(e);return t||(t=or(e,-.1),fr.put(e,t)),t}if(se(e)){var n=z({},e);return n.colorStops=j(e.colorStops,(function(e){return{offset:e.offset,color:or(e.color,-.1)}})),n}return e}var mr=Object.freeze({__proto__:null,fastLerp:ar,fastMapToColor:sr,lerp:lr,lift:or,liftColor:gr,lum:pr,mapToColor:ur,modifyAlpha:hr,modifyHSL:cr,parse:rr,random:function(){return dr([Math.round(255*Math.random()),Math.round(255*Math.random()),Math.round(255*Math.random())],"rgb")},stringify:dr,toHex:function(e){var t=rr(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}}),vr=Math.round;function yr(e){var t;if(e&&"transparent"!==e){if("string"==typeof e&&e.indexOf("rgba")>-1){var n=rr(e);n&&(e="rgb("+n[0]+","+n[1]+","+n[2]+")",t=n[3])}}else e="none";return{color:e,opacity:null==t?1:t}}var _r=1e-4;function xr(e){return e<_r&&e>-1e-4}function br(e){return vr(1e3*e)/1e3}function wr(e){return vr(1e4*e)/1e4}var Sr={left:"start",right:"end",center:"middle",middle:"middle"};function Tr(e){return e&&!!e.image}function Mr(e){return Tr(e)||function(e){return e&&!!e.svgElement}(e)}function Cr(e){return"linear"===e.type}function Dr(e){return"radial"===e.type}function Ar(e){return e&&("linear"===e.type||"radial"===e.type)}function Ir(e){return"url(#"+e+")"}function Er(e){var t=e.getGlobalScale(),n=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function Lr(e){var t=e.x||0,n=e.y||0,r=(e.rotation||0)*Ee,i=de(e.scaleX,1),o=de(e.scaleY,1),a=e.skewX||0,s=e.skewY||0,l=[];return(t||n)&&l.push("translate("+t+"px,"+n+"px)"),r&&l.push("rotate("+r+")"),1===i&&1===o||l.push("scale("+i+","+o+")"),(a||s)&&l.push("skew("+vr(a*Ee)+"deg, "+vr(s*Ee)+"deg)"),l.join(" ")}var Nr=d.hasGlobalWindow&&Q(window.btoa)?function(e){return window.btoa(unescape(encodeURIComponent(e)))}:"undefined"!=typeof Buffer?function(e){return Buffer.from(e).toString("base64")}:function(e){return"production"!==process.env.NODE_ENV&&P("Base64 isn't natively supported in the current environment."),null},Pr=Array.prototype.slice;function Or(e,t,n){return(t-e)*n+e}function Rr(e,t,n,r){for(var i=t.length,o=0;o<i;o++)e[o]=Or(t[o],n[o],r);return e}function kr(e,t,n,r){for(var i=t.length,o=0;o<i;o++)e[o]=t[o]+n[o]*r;return e}function zr(e,t,n,r){for(var i=t.length,o=i&&t[0].length,a=0;a<i;a++){e[a]||(e[a]=[]);for(var s=0;s<o;s++)e[a][s]=t[a][s]+n[a][s]*r}return e}function Vr(e,t){for(var n=e.length,r=t.length,i=n>r?t:e,o=Math.min(n,r),a=i[o-1]||{color:[0,0,0,0],offset:0},s=o;s<Math.max(n,r);s++)i.push({offset:a.offset,color:a.color.slice()})}function Br(e,t,n){var r=e,i=t;if(r.push&&i.push){var o=r.length,a=i.length;if(o!==a)if(o>a)r.length=a;else for(var s=o;s<a;s++)r.push(1===n?i[s]:Pr.call(i[s]));var l=r[0]&&r[0].length;for(s=0;s<r.length;s++)if(1===n)isNaN(r[s])&&(r[s]=i[s]);else for(var u=0;u<l;u++)isNaN(r[s][u])&&(r[s][u]=i[s][u])}}function Fr(e){if(U(e)){var t=e.length;if(U(e[0])){for(var n=[],r=0;r<t;r++)n.push(Pr.call(e[r]));return n}return Pr.call(e)}return e}function Gr(e){return e[0]=Math.floor(e[0])||0,e[1]=Math.floor(e[1])||0,e[2]=Math.floor(e[2])||0,e[3]=null==e[3]?1:e[3],"rgba("+e.join(",")+")"}function Hr(e){return 4===e||5===e}function Ur(e){return 1===e||2===e}var Wr=[0,0,0,0],jr=function(){function e(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return e.prototype.isFinished=function(){return this._finished},e.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},e.prototype.needsAnimate=function(){return this.keyframes.length>=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var r=this.keyframes,i=r.length,o=!1,a=6,s=t;if(U(t)){var l=function(e){return U(e&&e[0])?2:1}(t);a=l,(1===l&&!ne(t[0])||2===l&&!ne(t[0][0]))&&(o=!0)}else if(ne(t)&&!ce(t))a=0;else if(ee(t))if(isNaN(+t)){var u=rr(t);u&&(s=u,a=3)}else a=0;else if(se(t)){var c=z({},s);c.colorStops=j(t.colorStops,(function(e){return{offset:e.offset,color:rr(e.color)}})),Cr(t)?a=4:Dr(t)&&(a=5),s=c}0===i?this.valType=a:a===this.valType&&6!==a||(o=!0),this.discrete=this.discrete||o;var h={time:e,value:s,rawValue:t,percent:0};return n&&(h.easing=n,h.easingFunc=Q(n)?n:fn[n]||Fn(n)),r.push(h),h},e.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort((function(e,t){return e.time-t.time}));for(var r=this.valType,i=n.length,o=n[i-1],a=this.discrete,s=Ur(r),l=Hr(r),u=0;u<i;u++){var c=n[u],h=c.value,d=o.value;c.percent=c.time/e,a||(s&&u!==i-1?Br(h,d,r):l&&Vr(h.colorStops,d.colorStops))}if(!a&&5!==r&&t&&this.needsAnimate()&&t.needsAnimate()&&r===t.valType&&!t._finished){this._additiveTrack=t;var p=n[0].value;for(u=0;u<i;u++)0===r?n[u].additiveValue=n[u].value-p:3===r?n[u].additiveValue=kr([],n[u].value,p,-1):Ur(r)&&(n[u].additiveValue=1===r?kr([],n[u].value,p,-1):zr([],n[u].value,p,-1))}},e.prototype.step=function(e,t){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var n,r,i,o=null!=this._additiveTrack,a=o?"additiveValue":"value",s=this.valType,l=this.keyframes,u=l.length,c=this.propName,h=3===s,d=this._lastFr,p=Math.min;if(1===u)r=i=l[0];else{if(t<0)n=0;else if(t<this._lastFrP){for(n=p(d+1,u-1);n>=0&&!(l[n].percent<=t);n--);n=p(n,u-2)}else{for(n=d;n<u&&!(l[n].percent>t);n++);n=p(n-1,u-2)}i=l[n+1],r=l[n]}if(r&&i){this._lastFr=n,this._lastFrP=t;var f=i.percent-r.percent,g=0===f?1:p((t-r.percent)/f,1);i.easingFunc&&(g=i.easingFunc(g));var m=o?this._additiveValue:h?Wr:e[c];if(!Ur(s)&&!h||m||(m=this._additiveValue=[]),this.discrete)e[c]=g<1?r.rawValue:i.rawValue;else if(Ur(s))1===s?Rr(m,r[a],i[a],g):function(e,t,n,r){for(var i=t.length,o=i&&t[0].length,a=0;a<i;a++){e[a]||(e[a]=[]);for(var s=0;s<o;s++)e[a][s]=Or(t[a][s],n[a][s],r)}}(m,r[a],i[a],g);else if(Hr(s)){var v=r[a],y=i[a],_=4===s;e[c]={type:_?"linear":"radial",x:Or(v.x,y.x,g),y:Or(v.y,y.y,g),colorStops:j(v.colorStops,(function(e,t){var n=y.colorStops[t];return{offset:Or(e.offset,n.offset,g),color:Gr(Rr([],e.color,n.color,g))}})),global:y.global},_?(e[c].x2=Or(v.x2,y.x2,g),e[c].y2=Or(v.y2,y.y2,g)):e[c].r=Or(v.r,y.r,g)}else if(h)Rr(m,r[a],i[a],g),o||(e[c]=Gr(m));else{var x=Or(r[a],i[a],g);o?this._additiveValue=x:e[c]=x}o&&this._addToTarget(e)}}},e.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,r=this._additiveValue;0===t?e[n]=e[n]+r:3===t?(rr(e[n],Wr),kr(Wr,Wr,r,1),e[n]=Gr(Wr)):1===t?kr(e[n],e[n],r,1):2===t&&zr(e[n],e[n],r,1)},e}(),Xr=function(){function e(e,t,n,r){this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&r?P("Can' use additive animation on looped animation."):(this._additiveAnimators=r,this._allowDiscrete=n)}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(e){this._target=e},e.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,q(t),n)},e.prototype.whenWithKeys=function(e,t,n,r){for(var i=this._tracks,o=0;o<n.length;o++){var a=n[o],s=i[a];if(!s){s=i[a]=new jr(a);var l=void 0,u=this._getAdditiveTrack(a);if(u){var c=u.keyframes,h=c[c.length-1];l=h&&h.value,3===u.valType&&l&&(l=Gr(l))}else l=this._target[a];if(null==l)continue;e>0&&s.addKeyframe(0,Fr(l),r),this._trackKeys.push(a)}s.addKeyframe(e,Fr(t[a]),r)}return this._maxTime=Math.max(this._maxTime,e),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n<t;n++)e[n].call(this)},e.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,t=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,t)for(var n=0;n<t.length;n++)t[n].call(this)},e.prototype._setTracksFinished=function(){for(var e=this._tracks,t=this._trackKeys,n=0;n<t.length;n++)e[t[n]].setFinished()},e.prototype._getAdditiveTrack=function(e){var t,n=this._additiveAnimators;if(n)for(var r=0;r<n.length;r++){var i=n[r].getTrack(e);i&&(t=i)}return t},e.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var t=this,n=[],r=this._maxTime||0,i=0;i<this._trackKeys.length;i++){var o=this._trackKeys[i],a=this._tracks[o],s=this._getAdditiveTrack(o),l=a.keyframes,u=l.length;if(a.prepare(r,s),a.needsAnimate())if(!this._allowDiscrete&&a.discrete){var c=l[u-1];c&&(t._target[a.propName]=c.rawValue),a.setFinished()}else n.push(a)}if(n.length||this._force){var h=new Gn({life:r,loop:this._loop,delay:this._delay||0,onframe:function(e){t._started=2;var r=t._additiveAnimators;if(r){for(var i=!1,o=0;o<r.length;o++)if(r[o]._clip){i=!0;break}i||(t._additiveAnimators=null)}for(o=0;o<n.length;o++)n[o].step(t._target,e);var a=t._onframeCbs;if(a)for(o=0;o<a.length;o++)a[o](t._target,e)},ondestroy:function(){t._doneCallback()}});this._clip=h,this.animation&&this.animation.addClip(h),e&&h.setEasing(e)}else this._doneCallback();return this}},e.prototype.stop=function(e){if(this._clip){var t=this._clip;e&&t.onframe(1),this._abortedCallback()}},e.prototype.delay=function(e){return this._delay=e,this},e.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},e.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},e.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},e.prototype.getClip=function(){return this._clip},e.prototype.getTrack=function(e){return this._tracks[e]},e.prototype.getTracks=function(){var e=this;return j(this._trackKeys,(function(t){return e._tracks[t]}))},e.prototype.stopTracks=function(e,t){if(!e.length||!this._clip)return!0;for(var n=this._tracks,r=this._trackKeys,i=0;i<e.length;i++){var o=n[e[i]];o&&!o.isFinished()&&(t?o.step(this._target,1):1===this._started&&o.step(this._target,0),o.setFinished())}var a=!0;for(i=0;i<r.length;i++)if(!n[r[i]].isFinished()){a=!1;break}return a&&this._abortedCallback(),a},e.prototype.saveTo=function(e,t,n){if(e){t=t||this._trackKeys;for(var r=0;r<t.length;r++){var i=t[r],o=this._tracks[i];if(o&&!o.isFinished()){var a=o.keyframes,s=a[n?0:a.length-1];s&&(e[i]=Fr(s.rawValue))}}}},e.prototype.__changeFinalValue=function(e,t){t=t||q(e);for(var n=0;n<t.length;n++){var r=t[n],i=this._tracks[r];if(i){var o=i.keyframes;if(o.length>1){var a=o.pop();i.addKeyframe(a.time,e[r]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},e}();function Yr(){return(new Date).getTime()}var Zr,qr,Kr=function(e){function t(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t=t||{},n.stage=t.stage||{},n}return l(t,e),t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},t.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._head=n,n?n.prev=t:this._tail=t,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},t.prototype.update=function(e){for(var t=Yr()-this._pausedTime,n=t-this._time,r=this._head;r;){var i=r.next;r.step(t,n)?(r.ondestroy(),this.removeClip(r),r=i):r=i}this._time=t,e||(this.trigger("frame",n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0,dn((function t(){e._running&&(dn(t),!e._paused&&e.update())}))},t.prototype.start=function(){this._running||(this._time=Yr(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Yr(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Yr()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var e=this._head;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._head=this._tail=null},t.prototype.isFinished=function(){return null==this._head},t.prototype.animate=function(e,t){t=t||{},this.start();var n=new Xr(e,t.loop);return this.addAnimator(n),n},t}(nt),$r=d.domSupported,Jr=(qr={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:Zr=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:j(Zr,(function(e){var t=e.replace("mouse","pointer");return qr.hasOwnProperty(t)?t:e}))}),Qr=["mousemove","mouseup"],ei=["pointermove","pointerup"],ti=!1;function ni(e){var t=e.pointerType;return"pen"===t||"touch"===t}function ri(e){e&&(e.zrByTouch=!0)}function ii(e,t){for(var n=t,r=!1;n&&9!==n.nodeType&&!(r=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return r}var oi=function(e,t){this.stopPropagation=Ie,this.stopImmediatePropagation=Ie,this.preventDefault=Ie,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY},ai={mousedown:function(e){e=_t(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=_t(this.dom,e);var t=this.__mayPointerCapture;!t||e.zrX===t[0]&&e.zrY===t[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=_t(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){ii(this,(e=_t(this.dom,e)).toElement||e.relatedTarget)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){ti=!0,e=_t(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){ti||(e=_t(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){ri(e=_t(this.dom,e)),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),ai.mousemove.call(this,e),ai.mousedown.call(this,e)},touchmove:function(e){ri(e=_t(this.dom,e)),this.handler.processGesture(e,"change"),ai.mousemove.call(this,e)},touchend:function(e){ri(e=_t(this.dom,e)),this.handler.processGesture(e,"end"),ai.mouseup.call(this,e),+new Date-+this.__lastTouchMoment<300&&ai.click.call(this,e)},pointerdown:function(e){ai.mousedown.call(this,e)},pointermove:function(e){ni(e)||ai.mousemove.call(this,e)},pointerup:function(e){ai.mouseup.call(this,e)},pointerout:function(e){ni(e)||ai.mouseout.call(this,e)}};W(["click","dblclick","contextmenu"],(function(e){ai[e]=function(t){t=_t(this.dom,t),this.trigger(e,t)}}));var si={pointermove:function(e){ni(e)||si.mousemove.call(this,e)},pointerup:function(e){si.mouseup.call(this,e)},mousemove:function(e){this.trigger("mousemove",e)},mouseup:function(e){var t=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",e),t&&(e.zrEventControl="only_globalout",this.trigger("mouseout",e))}};function li(e,t){var n=t.domHandlers;d.pointerEventsSupported?W(Jr.pointer,(function(r){ci(t,r,(function(t){n[r].call(e,t)}))})):(d.touchEventsSupported&&W(Jr.touch,(function(r){ci(t,r,(function(i){n[r].call(e,i),function(e){e.touching=!0,null!=e.touchTimer&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout((function(){e.touching=!1,e.touchTimer=null}),700)}(t)}))})),W(Jr.mouse,(function(r){ci(t,r,(function(i){i=yt(i),t.touching||n[r].call(e,i)}))})))}function ui(e,t){function n(n){ci(t,n,(function(r){r=yt(r),ii(e,r.target)||(r=function(e,t){return _t(e.dom,new oi(e,t),!0)}(e,r),t.domHandlers[n].call(e,r))}),{capture:!0})}d.pointerEventsSupported?W(ei,n):d.touchEventsSupported||W(Qr,n)}function ci(e,t,n,r){e.mounted[t]=n,e.listenerOpts[t]=r,xt(e.domTarget,t,n,r)}function hi(e){var t,n,r,i,o=e.mounted;for(var a in o)o.hasOwnProperty(a)&&(t=e.domTarget,n=a,r=o[a],i=e.listenerOpts[a],t.removeEventListener(n,r,i));e.mounted={}}var di=function(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t},pi=function(e){function t(t,n){var r=e.call(this)||this;return r.__pointerCapturing=!1,r.dom=t,r.painterRoot=n,r._localHandlerScope=new di(t,ai),$r&&(r._globalHandlerScope=new di(document,si)),li(r,r._localHandlerScope),r}return l(t,e),t.prototype.dispose=function(){hi(this._localHandlerScope),$r&&hi(this._globalHandlerScope)},t.prototype.setCursor=function(e){this.dom.style&&(this.dom.style.cursor=e||"default")},t.prototype.__togglePointerCapture=function(e){if(this.__mayPointerCapture=null,$r&&+this.__pointerCapturing^+e){this.__pointerCapturing=e;var t=this._globalHandlerScope;e?ui(this,t):hi(t)}},t}(nt),fi=1;d.hasGlobalWindow&&(fi=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var gi=fi,mi="#333",vi="#ccc",yi=Dt,_i=5e-5;function xi(e){return e>_i||e<-5e-5}var bi=[],wi=[],Si=[1,0,0,1,0,0],Ti=Math.abs,Mi=function(){function e(){}return e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},e.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},e.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},e.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},e.prototype.needLocalTransform=function(){return xi(this.rotation)||xi(this.x)||xi(this.y)||xi(this.scaleX-1)||xi(this.scaleY-1)||xi(this.skewX)||xi(this.skewY)},e.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;t||e?(n=n||[1,0,0,1,0,0],t?this.getLocalTransform(n):yi(n),e&&(t?It(n,e,n):At(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&(yi(n),this.invTransform=null)},e.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(null!=t&&1!==t){this.getGlobalScale(bi);var n=bi[0]<0?-1:1,r=bi[1]<0?-1:1,i=((bi[0]-n)*t+n)/bi[0]||0,o=((bi[1]-r)*t+r)/bi[1]||0;e[0]*=i,e[1]*=i,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||[1,0,0,1,0,0],Pt(this.invTransform,e)},e.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},e.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],r=Math.atan2(e[1],e[0]),i=Math.PI/2+r-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(i),t=Math.sqrt(t),this.skewX=i,this.skewY=0,this.rotation=-r,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||[1,0,0,1,0,0],It(wi,e.invTransform,t),t=wi);var n=this.originX,r=this.originY;(n||r)&&(Si[4]=n,Si[5]=r,It(wi,t,Si),wi[4]-=n,wi[5]-=r,t=wi),this.setLocalTransform(t)}},e.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},e.prototype.transformCoordToLocal=function(e,t){var n=[e,t],r=this.invTransform;return r&&Ke(n,n,r),n},e.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],r=this.transform;return r&&Ke(n,n,r),n},e.prototype.getLineScale=function(){var e=this.transform;return e&&Ti(e[0]-1)>1e-10&&Ti(e[3]-1)>1e-10?Math.sqrt(Ti(e[0]*e[3]-e[2]*e[1])):1},e.prototype.copyTransform=function(e){Di(this,e)},e.getLocalTransform=function(e,t){t=t||[];var n=e.originX||0,r=e.originY||0,i=e.scaleX,o=e.scaleY,a=e.anchorX,s=e.anchorY,l=e.rotation||0,u=e.x,c=e.y,h=e.skewX?Math.tan(e.skewX):0,d=e.skewY?Math.tan(-e.skewY):0;if(n||r||a||s){var p=n+a,f=r+s;t[4]=-p*i-h*f*o,t[5]=-f*o-d*p*i}else t[4]=t[5]=0;return t[0]=i,t[3]=o,t[1]=d*i,t[2]=h*o,l&&Lt(t,t,l),t[4]+=n+u,t[5]+=r+c,t},e.initDefaultProps=function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0}(),e}(),Ci=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Di(e,t){for(var n=0;n<Ci.length;n++){var r=Ci[n];e[r]=t[r]}}var Ai={};function Ii(e,t){var n=Ai[t=t||f];n||(n=Ai[t]=new Wn(500));var r=n.get(e);return null==r&&(r=y.measureText(e,t).width,n.put(e,r)),r}function Ei(e,t,n,r){var i=Ii(e,t),o=Oi(t),a=Ni(0,i,n),s=Pi(0,o,r);return new jt(a,s,i,o)}function Li(e,t,n,r){var i=((e||"")+"").split("\n");if(1===i.length)return Ei(i[0],t,n,r);for(var o=new jt(0,0,0,0),a=0;a<i.length;a++){var s=Ei(i[a],t,n,r);0===a?o.copy(s):o.union(s)}return o}function Ni(e,t,n){return"right"===n?e-=t:"center"===n&&(e-=t/2),e}function Pi(e,t,n){return"middle"===n?e-=t/2:"bottom"===n&&(e-=t),e}function Oi(e){return Ii("国",e)}function Ri(e,t){return"string"==typeof e?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}function ki(e,t,n){var r=t.position||"inside",i=null!=t.distance?t.distance:5,o=n.height,a=n.width,s=o/2,l=n.x,u=n.y,c="left",h="top";if(r instanceof Array)l+=Ri(r[0],n.width),u+=Ri(r[1],n.height),c=null,h=null;else switch(r){case"left":l-=i,u+=s,c="right",h="middle";break;case"right":l+=i+a,u+=s,h="middle";break;case"top":l+=a/2,u-=i,c="center",h="bottom";break;case"bottom":l+=a/2,u+=o+i,c="center";break;case"inside":l+=a/2,u+=s,c="center",h="middle";break;case"insideLeft":l+=i,u+=s,h="middle";break;case"insideRight":l+=a-i,u+=s,c="right",h="middle";break;case"insideTop":l+=a/2,u+=i,c="center";break;case"insideBottom":l+=a/2,u+=o-i,c="center",h="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=a-i,u+=i,c="right";break;case"insideBottomLeft":l+=i,u+=o-i,h="bottom";break;case"insideBottomRight":l+=a-i,u+=o-i,c="right",h="bottom"}return(e=e||{}).x=l,e.y=u,e.align=c,e.verticalAlign=h,e}var zi="__zr_normal__",Vi=Ci.concat(["ignore"]),Bi=X(Ci,(function(e,t){return e[t]=!0,e}),{ignore:!1}),Fi={},Gi=new jt(0,0,0,0),Hi=function(){function e(e){this.id=N(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return e.prototype._init=function(e){this.attr(e)},e.prototype.drift=function(e,t,n){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0}var r=this.transform;r||(r=this.transform=[1,0,0,1,0,0]),r[4]+=e,r[5]+=t,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,r=n.local,i=t.innerTransformable,o=void 0,a=void 0,s=!1;i.parent=r?this:null;var l=!1;if(i.copyTransform(t),null!=n.position){var u=Gi;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),r||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Fi,n,u):ki(Fi,n,u),i.x=Fi.x,i.y=Fi.y,o=Fi.align,a=Fi.verticalAlign;var c=n.origin;if(c&&null!=n.rotation){var h=void 0,d=void 0;"center"===c?(h=.5*u.width,d=.5*u.height):(h=Ri(c[0],u.width),d=Ri(c[1],u.height)),l=!0,i.originX=-i.x+h+(r?0:u.x),i.originY=-i.y+d+(r?0:u.y)}}null!=n.rotation&&(i.rotation=n.rotation);var p=n.offset;p&&(i.x+=p[0],i.y+=p[1],l||(i.originX=-p[0],i.originY=-p[1]));var f=null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),m=void 0,v=void 0,y=void 0;f&&this.canBeInsideText()?(m=n.insideFill,v=n.insideStroke,null!=m&&"auto"!==m||(m=this.getInsideTextFill()),null!=v&&"auto"!==v||(v=this.getInsideTextStroke(m),y=!0)):(m=n.outsideFill,v=n.outsideStroke,null!=m&&"auto"!==m||(m=this.getOutsideFill()),null!=v&&"auto"!==v||(v=this.getOutsideStroke(m),y=!0)),(m=m||"#000")===g.fill&&v===g.stroke&&y===g.autoStroke&&o===g.align&&a===g.verticalAlign||(s=!0,g.fill=m,g.stroke=v,g.autoStroke=y,g.align=o,g.verticalAlign=a,t.setDefaultTextStyle(g)),t.__dirty|=1,s&&t.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(e){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?vi:mi},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof t&&rr(t);n||(n=[255,255,255,1]);for(var r=n[3],i=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*r+(i?0:255)*(1-r);return n[3]=1,dr(n,"rgba")},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){"textConfig"===e?this.setTextConfig(t):"textContent"===e?this.setTextContent(t):"clipPath"===e?this.setClipPath(t):"extra"===e?(this.extra=this.extra||{},z(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if("string"==typeof e)this.attrKV(e,t);else if(re(e))for(var n=q(e),r=0;r<n.length;r++){var i=n[r];this.attrKV(i,e[i])}return this.markRedraw(),this},e.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var t=this._normalState,n=0;n<this.animators.length;n++){var r=this.animators[n],i=r.__fromStateTransition;if(!(r.getLoop()||i&&i!==zi)){var o=r.targetName,a=o?t[o]:t;r.saveTo(a)}}},e.prototype._innerSaveToNormal=function(e){var t=this._normalState;t||(t=this._normalState={}),e.textConfig&&!t.textConfig&&(t.textConfig=this.textConfig),this._savePrimaryToNormal(e,t,Vi)},e.prototype._savePrimaryToNormal=function(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];null==e[i]||i in t||(t[i]=this[i])}},e.prototype.hasState=function(){return this.currentStates.length>0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(zi,!1,e)},e.prototype.useState=function(e,t,n,r){var i=e===zi;if(this.hasState()||!i){var o=this.currentStates,a=this.stateTransition;if(!(F(o,e)>=0)||!t&&1!==o.length){var s;if(this.stateProxy&&!i&&(s=this.stateProxy(e)),s||(s=this.states&&this.states[e]),s||i){i||this.saveCurrentToNormalState(s);var l=!!(s&&s.hoverLayer||r);l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,s,this._normalState,t,!n&&!this.__inHover&&a&&a.duration>0,a);var u=this._textContent,c=this._textGuide;return u&&u.useState(e,t,n,l),c&&c.useState(e,t,n,l),i?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),s}P("State "+e+" not exists.")}}},e.prototype.useStates=function(e,t,n){if(e.length){var r=[],i=this.currentStates,o=e.length,a=o===i.length;if(a)for(var s=0;s<o;s++)if(e[s]!==i[s]){a=!1;break}if(a)return;for(s=0;s<o;s++){var l=e[s],u=void 0;this.stateProxy&&(u=this.stateProxy(l,e)),u||(u=this.states[l]),u&&r.push(u)}var c=r[o-1],h=!!(c&&c.hoverLayer||n);h&&this._toggleHoverLayerFlag(!0);var d=this._mergeStates(r),p=this.stateTransition;this.saveCurrentToNormalState(d),this._applyStateObj(e.join(","),d,this._normalState,!1,!t&&!this.__inHover&&p&&p.duration>0,p);var f=this._textContent,g=this._textGuide;f&&f.useStates(e,t,h),g&&g.useStates(e,t,h),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}else this.clearStates()},e.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},e.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var t=this.animators[e];t.targetName&&t.changeTarget(this[t.targetName])}},e.prototype.removeState=function(e){var t=F(this.currentStates,e);if(t>=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var r=this.currentStates.slice(),i=F(r,e),o=F(r,t)>=0;i>=0?o?r.splice(i,1):r[i]=t:n&&!o&&r.push(t),this.useStates(r)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t,n={},r=0;r<e.length;r++){var i=e[r];z(n,i),i.textConfig&&z(t=t||{},i.textConfig)}return t&&(n.textConfig=t),n},e.prototype._applyStateObj=function(e,t,n,r,i,o){var a=!(t&&r);t&&t.textConfig?(this.textConfig=z({},r?this.textConfig:n.textConfig),z(this.textConfig,t.textConfig)):a&&n.textConfig&&(this.textConfig=n.textConfig);for(var s={},l=!1,u=0;u<Vi.length;u++){var c=Vi[u],h=i&&Bi[c];t&&null!=t[c]?h?(l=!0,s[c]=t[c]):this[c]=t[c]:a&&null!=n[c]&&(h?(l=!0,s[c]=n[c]):this[c]=n[c])}if(!i)for(u=0;u<this.animators.length;u++){var d=this.animators[u],p=d.targetName;d.getLoop()||d.__changeFinalValue(p?(t||n)[p]:t||n)}l&&this._transitionState(e,s,o)},e.prototype._attachComponent=function(e){if(!e.__zr||e.__hostTarget){if(e!==this){var t=this.__zr;t&&e.addSelfToZr(t),e.__zr=t,e.__hostTarget=this}else if("production"!==process.env.NODE_ENV)throw new Error("Recursive component attachment.")}else if("production"!==process.env.NODE_ENV)throw new Error("Text element has been added to zrender.")},e.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},e.prototype.getClipPath=function(){return this._clipPath},e.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},e.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},e.prototype.getTextContent=function(){return this._textContent},e.prototype.setTextContent=function(e){var t=this._textContent;if(t!==e){if(t&&t!==e&&this.removeTextContent(),"production"!==process.env.NODE_ENV&&e.__zr&&!e.__hostTarget)throw new Error("Text element has been added to zrender.");e.innerTransformable=new Mi,this._attachComponent(e),this._textContent=e,this.markRedraw()}},e.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),z(this.textConfig,e),this.markRedraw()},e.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},e.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},e.prototype.getTextGuideLine=function(){return this._textGuide},e.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},e.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},e.prototype.markRedraw=function(){this.__dirty|=1;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},e.prototype.dirty=function(){this.markRedraw()},e.prototype._toggleHoverLayerFlag=function(e){this.__inHover=e;var t=this._textContent,n=this._textGuide;t&&(t.__inHover=e),n&&(n.__inHover=e)},e.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.addAnimator(t[n]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},e.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.removeAnimator(t[n]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},e.prototype.animate=function(e,t,n){var r=e?this[e]:this;if("production"===process.env.NODE_ENV||r){var i=new Xr(r,t,n);return e&&(i.targetName=e),this.addAnimator(i,e),i}P('Property "'+e+'" is not existed in element '+this.id)},e.prototype.addAnimator=function(e,t){var n=this.__zr,r=this;e.during((function(){r.updateDuringAnimation(t)})).done((function(){var t=r.animators,n=F(t,e);n>=0&&t.splice(n,1)})),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,r=n.length,i=[],o=0;o<r;o++){var a=n[o];e&&e!==a.scope?i.push(a):a.stop(t)}return this.animators=i,this},e.prototype.animateTo=function(e,t,n){Ui(this,e,t,n)},e.prototype.animateFrom=function(e,t,n){Ui(this,e,t,n,!0)},e.prototype._transitionState=function(e,t,n,r){for(var i=Ui(this,t,n,r),o=0;o<i.length;o++)i[o].__fromStateTransition=e},e.prototype.getBoundingRect=function(){return null},e.prototype.getPaintRect=function(){return null},e.initDefaultProps=function(){var t=e.prototype;t.type="element",t.name="",t.ignore=t.silent=t.isGroup=t.draggable=t.dragging=t.ignoreClip=t.__inHover=!1,t.__dirty=1;var n={};function r(e,t,r){n[e+t+r]||(console.warn("DEPRECATED: '"+e+"' has been deprecated. use '"+t+"', '"+r+"' instead"),n[e+t+r]=!0)}function i(e,n,i,o){function a(e,t){Object.defineProperty(t,0,{get:function(){return e[i]},set:function(t){e[i]=t}}),Object.defineProperty(t,1,{get:function(){return e[o]},set:function(t){e[o]=t}})}Object.defineProperty(t,e,{get:function(){("production"!==process.env.NODE_ENV&&r(e,i,o),this[n])||a(this,this[n]=[]);return this[n]},set:function(t){"production"!==process.env.NODE_ENV&&r(e,i,o),this[i]=t[0],this[o]=t[1],this[n]=t,a(this,t)}})}Object.defineProperty&&(i("position","_legacyPos","x","y"),i("scale","_legacyScale","scaleX","scaleY"),i("origin","_legacyOrigin","originX","originY"))}(),e}();function Ui(e,t,n,r,i){var o=[];Xi(e,"",e,t,n=n||{},r,o,i);var a=o.length,s=!1,l=n.done,u=n.aborted,c=function(){s=!0,--a<=0&&(s?l&&l():u&&u())},h=function(){--a<=0&&(s?l&&l():u&&u())};a||l&&l(),o.length>0&&n.during&&o[0].during((function(e,t){n.during(t)}));for(var d=0;d<o.length;d++){var p=o[d];c&&p.done(c),h&&p.aborted(h),n.force&&p.duration(n.duration),p.start(n.easing)}return o}function Wi(e,t,n){for(var r=0;r<n;r++)e[r]=t[r]}function ji(e,t,n){if(U(t[n]))if(U(e[n])||(e[n]=[]),oe(t[n])){var r=t[n].length;e[n].length!==r&&(e[n]=new t[n].constructor(r),Wi(e[n],t[n],r))}else{var i=t[n],o=e[n],a=i.length;if(U(i[0]))for(var s=i[0].length,l=0;l<a;l++)o[l]?Wi(o[l],i[l],s):o[l]=Array.prototype.slice.call(i[l]);else Wi(o,i,a);o.length=i.length}else e[n]=t[n]}function Xi(e,t,n,r,i,o,a,s){for(var l=q(r),u=i.duration,c=i.delay,h=i.additive,d=i.setToFinal,p=!re(o),f=e.animators,g=[],m=0;m<l.length;m++){var v=l[m],y=r[v];if(null!=y&&null!=n[v]&&(p||o[v]))if(!re(y)||U(y)||se(y))g.push(v);else{if(t){s||(n[v]=y,e.updateDuringAnimation(t));continue}Xi(e,v,n[v],y,i,o&&o[v],a,s)}else s||(n[v]=y,e.updateDuringAnimation(t),g.push(v))}var _=g.length;if(!h&&_)for(var x=0;x<f.length;x++){if((w=f[x]).targetName===t)if(w.stopTracks(g)){var b=F(f,w);f.splice(b,1)}}if(i.force||(g=Y(g,(function(e){return t=r[e],i=n[e],!(t===i||U(t)&&U(i)&&function(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}(t,i));var t,i})),_=g.length),_>0||i.force&&!a.length){var w,S=void 0,T=void 0,M=void 0;if(s){T={},d&&(S={});for(x=0;x<_;x++){T[v=g[x]]=n[v],d?S[v]=r[v]:n[v]=r[v]}}else if(d){M={};for(x=0;x<_;x++){M[v=g[x]]=Fr(n[v]),ji(n,r,v)}}(w=new Xr(n,!1,!1,h?Y(f,(function(e){return e.targetName===t})):null)).targetName=t,i.scope&&(w.scope=i.scope),d&&S&&w.whenWithKeys(0,S,g),M&&w.whenWithKeys(0,M,g),w.whenWithKeys(null==u?500:u,s?T:r,g).delay(c||0),e.addAnimator(w,t),a.push(w)}}H(Hi,nt),H(Hi,Mi);var Yi=function(e){function t(t){var n=e.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(t),n}return l(t,e),t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(e){return this._children[e]},t.prototype.childOfName=function(e){for(var t=this._children,n=0;n<t.length;n++)if(t[n].name===e)return t[n]},t.prototype.childCount=function(){return this._children.length},t.prototype.add=function(e){if(e&&(e!==this&&e.parent!==this&&(this._children.push(e),this._doAdd(e)),"production"!==process.env.NODE_ENV&&e.__hostTarget))throw"This elemenet has been used as an attachment";return this},t.prototype.addBefore=function(e,t){if(e&&e!==this&&e.parent!==this&&t&&t.parent===this){var n=this._children,r=n.indexOf(t);r>=0&&(n.splice(r,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,t){var n=F(this._children,e);return n>=0&&this.replaceAt(t,n),this},t.prototype.replaceAt=function(e,t){var n=this._children,r=n[t];if(e&&e!==this&&e.parent!==this&&e!==r){n[t]=e,r.parent=null;var i=this.__zr;i&&r.removeSelfFromZr(i),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,r=F(n,e);return r<0||(n.splice(r,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh()),this},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;n<e.length;n++){var r=e[n];t&&r.removeSelfFromZr(t),r.parent=null}return e.length=0,this},t.prototype.eachChild=function(e,t){for(var n=this._children,r=0;r<n.length;r++){var i=n[r];e.call(t,i,r)}return this},t.prototype.traverse=function(e,t){for(var n=0;n<this._children.length;n++){var r=this._children[n],i=e.call(t,r);r.isGroup&&!i&&r.traverse(e,t)}return this},t.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++){this._children[n].addSelfToZr(t)}},t.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++){this._children[n].removeSelfFromZr(t)}},t.prototype.getBoundingRect=function(e){for(var t=new jt(0,0,0,0),n=e||this._children,r=[],i=null,o=0;o<n.length;o++){var a=n[o];if(!a.ignore&&!a.invisible){var s=a.getBoundingRect(),l=a.getLocalTransform(r);l?(jt.applyTransform(t,s,l),(i=i||t.clone()).union(t)):(i=i||s.clone()).union(s)}}return i||t},t}(Hi);Yi.prototype.type="group";
2
+ /*!
3
+ * ZRender, a high performance 2d drawing library.
4
+ *
5
+ * Copyright (c) 2013, Baidu Inc.
6
+ * All rights reserved.
7
+ *
8
+ * LICENSE
9
+ * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
10
+ */
11
+ var Zi={},qi={};var Ki,$i=function(){function e(e,t,n){var r=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,n=n||{},this.dom=t,this.id=e;var i=new pn,o=n.renderer||"canvas";if(Zi[o]||(o=q(Zi)[0]),"production"!==process.env.NODE_ENV&&!Zi[o])throw new Error("Renderer '"+o+"' is not imported. Please import it first.");n.useDirtyRect=null!=n.useDirtyRect&&n.useDirtyRect;var a=new Zi[o](t,i,n,e),s=n.ssr||a.ssrOnly;this.storage=i,this.painter=a;var l,u=d.node||d.worker||s?null:new pi(a.getViewportRoot(),a.root),c=n.useCoarsePointer;(null==c||"auto"===c?d.touchEventsSupported:!!c)&&(l=de(n.pointerSize,44)),this.handler=new Jt(i,a,u,a.root,l),this.animation=new Kr({stage:{update:s?null:function(){return r._flush(!0)}}}),s||this.animation.start()}return e.prototype.add=function(e){!this._disposed&&e&&(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},e.prototype.remove=function(e){!this._disposed&&e&&(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},e.prototype.configLayer=function(e,t){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,t),this.refresh())},e.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=function(e){if(!e)return!1;if("string"==typeof e)return pr(e,1)<.4;if(e.colorStops){for(var t=e.colorStops,n=0,r=t.length,i=0;i<r;i++)n+=pr(t[i].color,1);return(n/=r)<.4}return!1}(e))},e.prototype.getBackgroundColor=function(){return this._backgroundColor},e.prototype.setDarkMode=function(e){this._darkMode=e},e.prototype.isDarkMode=function(){return this._darkMode},e.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},e.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},e.prototype.flush=function(){this._disposed||this._flush(!1)},e.prototype._flush=function(e){var t,n=Yr();this._needsRefresh&&(t=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately());var r=Yr();t?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:r-n})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},e.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},e.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},e.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t<e.length;t++)e[t]instanceof Yi&&e[t].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},e.prototype.dispose=function(){var e;this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,e=this.id,delete qi[e])},e}();function Ji(e,t){var n=new $i(N(),e,t);return qi[n.id]=n,n}function Qi(e,t){Zi[e]=t}function eo(e){if("function"==typeof Ki)return Ki(e)}function to(e){Ki=e}var no=Object.freeze({__proto__:null,dispose:function(e){e.dispose()},disposeAll:function(){for(var e in qi)qi.hasOwnProperty(e)&&qi[e].dispose();qi={}},getElementSSRData:eo,getInstance:function(e){return qi[e]},init:Ji,registerPainter:Qi,registerSSRDataGetter:to,version:"5.6.0"}),ro=1e-4;function io(e,t,n,r){var i=t[0],o=t[1],a=n[0],s=n[1],l=o-i,u=s-a;if(0===l)return 0===u?a:(a+s)/2;if(r)if(l>0){if(e<=i)return a;if(e>=o)return s}else{if(e>=i)return a;if(e<=o)return s}else{if(e===i)return a;if(e===o)return s}return(e-i)/l*u+a}function oo(e,t){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return ee(e)?(n=e,n.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e;var n}function ao(e,t,n){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),n?e:+e}function so(e){return e.sort((function(e,t){return e-t})),e}function lo(e){if(e=+e,isNaN(e))return 0;if(e>1e-14)for(var t=1,n=0;n<15;n++,t*=10)if(Math.round(e*t)/t===e)return n;return uo(e)}function uo(e){var t=e.toString().toLowerCase(),n=t.indexOf("e"),r=n>0?+t.slice(n+1):0,i=n>0?n:t.length,o=t.indexOf("."),a=o<0?0:i-1-o;return Math.max(0,a-r)}function co(e,t){var n=Math.log,r=Math.LN10,i=Math.floor(n(e[1]-e[0])/r),o=Math.round(n(Math.abs(t[1]-t[0]))/r),a=Math.min(Math.max(-i+o,0),20);return isFinite(a)?a:20}function ho(e,t){var n=X(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===n)return[];for(var r=Math.pow(10,t),i=j(e,(function(e){return(isNaN(e)?0:e)/n*r*100})),o=100*r,a=j(i,(function(e){return Math.floor(e)})),s=X(a,(function(e,t){return e+t}),0),l=j(i,(function(e,t){return e-a[t]}));s<o;){for(var u=Number.NEGATIVE_INFINITY,c=null,h=0,d=l.length;h<d;++h)l[h]>u&&(u=l[h],c=h);++a[c],l[c]=0,++s}return j(a,(function(e){return e/r}))}function po(e,t){var n=Math.max(lo(e),lo(t)),r=e+t;return n>20?r:ao(r,n)}var fo=9007199254740991;function go(e){var t=2*Math.PI;return(e%t+t)%t}function mo(e){return e>-1e-4&&e<ro}var vo=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function yo(e){if(e instanceof Date)return e;if(ee(e)){var t=vo.exec(e);if(!t)return new Date(NaN);if(t[8]){var n=+t[4]||0;return"Z"!==t[8].toUpperCase()&&(n-=+t[8].slice(0,3)),new Date(Date.UTC(+t[1],+(t[2]||1)-1,+t[3]||1,n,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0))}return new Date(+t[1],+(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0)}return null==e?new Date(NaN):new Date(Math.round(e))}function _o(e){return Math.pow(10,xo(e))}function xo(e){if(0===e)return 0;var t=Math.floor(Math.log(e)/Math.LN10);return e/Math.pow(10,t)>=10&&t++,t}function bo(e,t){var n=xo(e),r=Math.pow(10,n),i=e/r;return e=(t?i<1.5?1:i<2.5?2:i<4?3:i<7?5:10:i<1?1:i<2?2:i<3?3:i<5?5:10)*r,n>=-20?+e.toFixed(n<0?-n:0):e}function wo(e,t){var n=(e.length-1)*t+1,r=Math.floor(n),i=+e[r-1],o=n-r;return o?i+o*(e[r]-i):i}function So(e){e.sort((function(e,t){return s(e,t,0)?-1:1}));for(var t=-1/0,n=1,r=0;r<e.length;){for(var i=e[r].interval,o=e[r].close,a=0;a<2;a++)i[a]<=t&&(i[a]=t,o[a]=a?1:1-n),t=i[a],n=o[a];i[0]===i[1]&&o[0]*o[1]!=1?e.splice(r,1):r++}return e;function s(e,t,n){return e.interval[n]<t.interval[n]||e.interval[n]===t.interval[n]&&(e.close[n]-t.close[n]==(n?-1:1)||!n&&s(e,t,1))}}function To(e){var t=parseFloat(e);return t==e&&(0!==t||!ee(e)||e.indexOf("x")<=0)?t:NaN}function Mo(e){return!isNaN(To(e))}function Co(){return Math.round(9*Math.random())}function Do(e,t){return 0===t?e:Do(t,e%t)}function Ao(e,t){return null==e?t:null==t?e:e*t/Do(e,t)}var Io={},Eo="undefined"!=typeof console&&console.warn&&console.log;function Lo(e,t,n){if(Eo){if(n){if(Io[t])return;Io[t]=!0}console[e]("[ECharts] "+t)}}function No(e,t){Lo("warn",e,t)}function Po(e,t){Lo("error",e,t)}function Oo(e){"production"!==process.env.NODE_ENV&&Lo("warn","DEPRECATED: "+e,!0)}function Ro(e,t,n){"production"!==process.env.NODE_ENV&&Oo((n?"["+n+"]":"")+e+" is deprecated, use "+t+" instead.")}function ko(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="";if("production"!==process.env.NODE_ENV){var r=function(e){return void 0===e?"undefined":e===1/0?"Infinity":e===-1/0?"-Infinity":ce(e)?"NaN":e instanceof Date?"Date("+e.toISOString()+")":Q(e)?"function () { ... }":ue(e)?e+"":null};n=j(e,(function(e){if(ee(e))return e;var t=r(e);if(null!=t)return t;if("undefined"==typeof JSON||!JSON.stringify)return"?";try{return JSON.stringify(e,(function(e,t){var n=r(t);return null==n?t:n}))}catch(e){return"?"}})).join(" ")}return n}function zo(e){throw new Error(e)}function Vo(e,t,n){return(t-e)*n+e}var Bo="series\0",Fo="\0_ec_\0";function Go(e){return e instanceof Array?e:null==e?[]:[e]}function Ho(e,t,n){if(e){e[t]=e[t]||{},e.emphasis=e.emphasis||{},e.emphasis[t]=e.emphasis[t]||{};for(var r=0,i=n.length;r<i;r++){var o=n[r];!e.emphasis[t].hasOwnProperty(o)&&e[t].hasOwnProperty(o)&&(e.emphasis[t][o]=e[t][o])}}}var Uo=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function Wo(e){return!re(e)||J(e)||e instanceof Date?e:e.value}function jo(e){return re(e)&&!(e instanceof Array)}function Xo(e,t,n){var r="normalMerge"===n,i="replaceMerge"===n,o="replaceAll"===n;e=e||[],t=(t||[]).slice();var a=Te();W(t,(function(e,n){re(e)?"production"!==process.env.NODE_ENV&&(null==e.id||$o(e.id)||Ko(e.id),null==e.name||$o(e.name)||Ko(e.name)):t[n]=null}));var s,l,u=function(e,t,n){var r=[];if("replaceAll"===n)return r;for(var i=0;i<e.length;i++){var o=e[i];o&&null!=o.id&&t.set(o.id,i),r.push({existing:"replaceMerge"===n||Qo(o)?null:o,newOption:null,keyInfo:null,brandNew:null})}return r}(e,a,n);return(r||i)&&function(e,t,n,r){W(r,(function(i,o){if(i&&null!=i.id){var a=Zo(i.id),s=n.get(a);if(null!=s){var l=e[s];me(!l.newOption,'Duplicated option on id "'+a+'".'),l.newOption=i,l.existing=t[s],r[o]=null}}}))}(u,e,a,t),r&&function(e,t){W(t,(function(n,r){if(n&&null!=n.name)for(var i=0;i<e.length;i++){var o=e[i].existing;if(!e[i].newOption&&o&&(null==o.id||null==n.id)&&!Qo(n)&&!Qo(o)&&Yo("name",o,n))return e[i].newOption=n,void(t[r]=null)}}))}(u,t),r||i?function(e,t,n){W(t,(function(t){if(t){for(var r,i=0;(r=e[i])&&(r.newOption||Qo(r.existing)||r.existing&&null!=t.id&&!Yo("id",t,r.existing));)i++;r?(r.newOption=t,r.brandNew=n):e.push({newOption:t,brandNew:n,existing:null,keyInfo:null}),i++}}))}(u,t,i):o&&function(e,t){W(t,(function(t){e.push({newOption:t,brandNew:!0,existing:null,keyInfo:null})}))}(u,t),s=u,l=Te(),W(s,(function(e){var t=e.existing;t&&l.set(t.id,e)})),W(s,(function(e){var t=e.newOption;me(!t||null==t.id||!l.get(t.id)||l.get(t.id)===e,"id duplicates: "+(t&&t.id)),t&&null!=t.id&&l.set(t.id,e),!e.keyInfo&&(e.keyInfo={})})),W(s,(function(e,t){var n=e.existing,r=e.newOption,i=e.keyInfo;if(re(r)){if(i.name=null!=r.name?Zo(r.name):n?n.name:Bo+t,n)i.id=Zo(n.id);else if(null!=r.id)i.id=Zo(r.id);else{var o=0;do{i.id="\0"+i.name+"\0"+o++}while(l.get(i.id))}l.set(i.id,e)}})),u}function Yo(e,t,n){var r=qo(t[e],null),i=qo(n[e],null);return null!=r&&null!=i&&r===i}function Zo(e){if("production"!==process.env.NODE_ENV&&null==e)throw new Error;return qo(e,"")}function qo(e,t){return null==e?t:ee(e)?e:ne(e)||te(e)?e+"":t}function Ko(e){"production"!==process.env.NODE_ENV&&No("`"+e+"` is invalid id or name. Must be a string or number.")}function $o(e){return te(e)||Mo(e)}function Jo(e){var t=e.name;return!(!t||!t.indexOf(Bo))}function Qo(e){return e&&null!=e.id&&0===Zo(e.id).indexOf(Fo)}function ea(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?J(t.dataIndex)?j(t.dataIndex,(function(t){return e.indexOfRawIndex(t)})):e.indexOfRawIndex(t.dataIndex):null!=t.name?J(t.name)?j(t.name,(function(t){return e.indexOfName(t)})):e.indexOfName(t.name):void 0}function ta(){var e="__ec_inner_"+na++;return function(t){return t[e]||(t[e]={})}}var na=Co();function ra(e,t,n){var r=ia(t,n),i=r.mainTypeSpecified,o=r.queryOptionMap,a=r.others,s=n?n.defaultMainType:null;return!i&&s&&o.set(s,{}),o.each((function(t,r){var i=sa(e,r,t,{useDefault:s===r,enableAll:!n||null==n.enableAll||n.enableAll,enableNone:!n||null==n.enableNone||n.enableNone});a[r+"Models"]=i.models,a[r+"Model"]=i.models[0]})),a}function ia(e,t){var n;if(ee(e)){var r={};r[e+"Index"]=0,n=r}else n=e;var i=Te(),o={},a=!1;return W(n,(function(e,n){if("dataIndex"!==n&&"dataIndexInside"!==n){var r=n.match(/^(\w+)(Index|Id|Name)$/)||[],s=r[1],l=(r[2]||"").toLowerCase();if(s&&l&&!(t&&t.includeMainTypes&&F(t.includeMainTypes,s)<0))a=a||!!s,(i.get(s)||i.set(s,{}))[l]=e}else o[n]=e})),{mainTypeSpecified:a,queryOptionMap:i,others:o}}var oa={useDefault:!0,enableAll:!1,enableNone:!1},aa={useDefault:!1,enableAll:!0,enableNone:!0};function sa(e,t,n,r){r=r||oa;var i=n.index,o=n.id,a=n.name,s={models:null,specified:null!=i||null!=o||null!=a};if(!s.specified){var l=void 0;return s.models=r.useDefault&&(l=e.getComponent(t))?[l]:[],s}return"none"===i||!1===i?(me(r.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[],s):("all"===i&&(me(r.enableAll,'`"all"` is not a valid value on index option.'),i=o=a=null),s.models=e.queryComponents({mainType:t,index:i,id:o,name:a}),s)}function la(e,t,n){e.setAttribute?e.setAttribute(t,n):e[t]=n}function ua(e,t){var n=Te(),r=[];return W(e,(function(e){var i=t(e);(n.get(i)||(r.push(i),n.set(i,[]))).push(e)})),{keys:r,buckets:n}}function ca(e,t,n,r,i){var o=null==t||"auto"===t;if(null==r)return r;if(ne(r))return ao(f=Vo(n||0,r,i),o?Math.max(lo(n||0),lo(r)):t);if(ee(r))return i<1?n:r;for(var a=[],s=n,l=r,u=Math.max(s?s.length:0,l.length),c=0;c<u;++c){var h=e.getDimensionInfo(c);if(h&&"ordinal"===h.type)a[c]=(i<1&&s?s:l)[c];else{var d=s&&s[c]?s[c]:0,p=l[c],f=Vo(d,p,i);a[c]=ao(f,o?Math.max(lo(d),lo(p)):t)}}return a}var ha="___EC__COMPONENT__CONTAINER___",da="___EC__EXTENDED_CLASS___";function pa(e){var t={main:"",sub:""};if(e){var n=e.split(".");t.main=n[0]||"",t.sub=n[1]||""}return t}function fa(e,t){e.$constructor=e,e.extend=function(e){"production"!==process.env.NODE_ENV&&W(t,(function(t){e[t]||console.warn("Method `"+t+"` should be implemented"+(e.type?" in "+e.type:"")+".")}));var n,r,i=this;return Q(r=i)&&/^class\s/.test(Function.prototype.toString.call(r))?n=function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t}(i):(n=function(){(e.$constructor||i).apply(this,arguments)},G(n,this)),z(n.prototype,e),n[da]=!0,n.extend=this.extend,n.superCall=va,n.superApply=ya,n.superClass=i,n}}function ga(e,t){e.extend=t.extend}var ma=Math.round(10*Math.random());function va(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return this.superClass.prototype[t].apply(e,n)}function ya(e,t,n){return this.superClass.prototype[t].apply(e,n)}function _a(e){var t={};e.registerClass=function(e){var n,r=e.type||e.prototype.type;if(r){me(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(n=r),'componentType "'+n+'" illegal'),e.prototype.type=r;var i=pa(r);if(i.sub){if(i.sub!==ha){var o=function(e){var n=t[e.main];n&&n[ha]||((n=t[e.main]={})[ha]=!0);return n}(i);o[i.sub]=e}}else"production"!==process.env.NODE_ENV&&t[i.main]&&console.warn(i.main+" exists."),t[i.main]=e}return e},e.getClass=function(e,n,r){var i=t[e];if(i&&i[ha]&&(i=n?i[n]:null),r&&!i)throw new Error(n?"Component "+e+"."+(n||"")+" is used but not imported.":e+".type should be specified.");return i},e.getClassesByMainType=function(e){var n=pa(e),r=[],i=t[n.main];return i&&i[ha]?W(i,(function(e,t){t!==ha&&r.push(e)})):r.push(i),r},e.hasClass=function(e){var n=pa(e);return!!t[n.main]},e.getAllClassMainTypes=function(){var e=[];return W(t,(function(t,n){e.push(n)})),e},e.hasSubTypes=function(e){var n=pa(e),r=t[n.main];return r&&r[ha]}}function xa(e,t){for(var n=0;n<e.length;n++)e[n][1]||(e[n][1]=e[n][0]);return t=t||!1,function(n,r,i){for(var o={},a=0;a<e.length;a++){var s=e[a][1];if(!(r&&F(r,s)>=0||i&&F(i,s)<0)){var l=n.getShallow(s,t);null!=l&&(o[e[a][0]]=l)}}return o}}var ba=xa([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),wa=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return ba(this,e,t)},e}(),Sa=new Wn(50);function Ta(e){if("string"==typeof e){var t=Sa.get(e);return t&&t.image}return e}function Ma(e,t,n,r,i){if(e){if("string"==typeof e){if(t&&t.__zrImageSrc===e||!n)return t;var o=Sa.get(e),a={hostEl:n,cb:r,cbPayload:i};return o?!Da(t=o.image)&&o.pending.push(a):((t=y.loadImage(e,Ca,Ca)).__zrImageSrc=e,Sa.put(e,t.__cachedImgObj={image:t,pending:[a]})),t}return e}return t}function Ca(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var n=e.pending[t],r=n.cb;r&&r(this,n.cbPayload),n.hostEl.dirty()}e.pending.length=0}function Da(e){return e&&e.width&&e.height}var Aa=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function Ia(e,t,n,r,i){if(!t)return"";var o=(e+"").split("\n");i=Ea(t,n,r,i);for(var a=0,s=o.length;a<s;a++)o[a]=La(o[a],i);return o.join("\n")}function Ea(e,t,n,r){var i=z({},r=r||{});i.font=t,n=de(n,"..."),i.maxIterations=de(r.maxIterations,2);var o=i.minChar=de(r.minChar,0);i.cnCharWidth=Ii("国",t);var a=i.ascCharWidth=Ii("a",t);i.placeholder=de(r.placeholder,"");for(var s=e=Math.max(0,e-1),l=0;l<o&&s>=a;l++)s-=a;var u=Ii(n,t);return u>s&&(n="",u=0),s=e-u,i.ellipsis=n,i.ellipsisWidth=u,i.contentWidth=s,i.containerWidth=e,i}function La(e,t){var n=t.containerWidth,r=t.font,i=t.contentWidth;if(!n)return"";var o=Ii(e,r);if(o<=n)return e;for(var a=0;;a++){if(o<=i||a>=t.maxIterations){e+=t.ellipsis;break}var s=0===a?Na(e,i,t.ascCharWidth,t.cnCharWidth):o>0?Math.floor(e.length*i/o):0;o=Ii(e=e.substr(0,s),r)}return""===e&&(e=t.placeholder),e}function Na(e,t,n,r){for(var i=0,o=0,a=e.length;o<a&&i<t;o++){var s=e.charCodeAt(o);i+=0<=s&&s<=127?n:r}return o}var Pa=function(){},Oa=function(e){this.tokens=[],e&&(this.tokens=e)},Ra=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[]};function ka(e,t,n,r,i){var o,a,s=""===t,l=i&&n.rich[i]||{},u=e.lines,c=l.font||n.font,h=!1;if(r){var d=l.padding,p=d?d[1]+d[3]:0;if(null!=l.width&&"auto"!==l.width){var f=Ri(l.width,r.width)+p;u.length>0&&f+r.accumWidth>r.width&&(o=t.split("\n"),h=!0),r.accumWidth=f}else{var g=Ba(t,c,r.width,r.breakAll,r.accumWidth);r.accumWidth=g.accumWidth+p,a=g.linesWidths,o=g.lines}}else o=t.split("\n");for(var m=0;m<o.length;m++){var v=o[m],y=new Pa;if(y.styleName=i,y.text=v,y.isLineHolder=!v&&!s,"number"==typeof l.width?y.width=l.width:y.width=a?a[m]:Ii(v,c),m||h)u.push(new Oa([y]));else{var _=(u[u.length-1]||(u[0]=new Oa)).tokens,x=_.length;1===x&&_[0].isLineHolder?_[0]=y:(v||!x||s)&&_.push(y)}}}var za=X(",&?/;] ".split(""),(function(e,t){return e[t]=!0,e}),{});function Va(e){return!function(e){var t=e.charCodeAt(0);return t>=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}(e)||!!za[e]}function Ba(e,t,n,r,i){for(var o=[],a=[],s="",l="",u=0,c=0,h=0;h<e.length;h++){var d=e.charAt(h);if("\n"!==d){var p=Ii(d,t),f=!r&&!Va(d);(o.length?c+p>n:i+c+p>n)?c?(s||l)&&(f?(s||(s=l,l="",c=u=0),o.push(s),a.push(c-u),l+=d,s="",c=u+=p):(l&&(s+=l,l="",u=0),o.push(s),a.push(c),s=d,c=p)):f?(o.push(l),a.push(u),l=d,u=p):(o.push(d),a.push(p)):(c+=p,f?(l+=d,u+=p):(l&&(s+=l,l="",u=0),s+=d))}else l&&(s+=l,c+=u),o.push(s),a.push(c),s="",l="",u=0,c=0}return o.length||s||(s=e,l="",u=0),l&&(s+=l),s&&(o.push(s),a.push(c)),1===o.length&&(c+=i),{accumWidth:c,lines:o,linesWidths:a}}var Fa="__zr_style_"+Math.round(10*Math.random()),Ga={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Ha={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Ga[Fa]=!0;var Ua=["z","z2","invisible"],Wa=["invisible"],ja=function(e){function t(t){return e.call(this,t)||this}var n;return l(t,e),t.prototype._init=function(t){for(var n=q(t),r=0;r<n.length;r++){var i=n[r];"style"===i?this.useStyle(t[i]):e.prototype.attrKV.call(this,i,t[i])}this.style||this.useStyle({})},t.prototype.beforeBrush=function(){},t.prototype.afterBrush=function(){},t.prototype.innerBeforeBrush=function(){},t.prototype.innerAfterBrush=function(){},t.prototype.shouldBePainted=function(e,t,n,r){var i=this.transform;if(this.ignore||this.invisible||0===this.style.opacity||this.culling&&function(e,t,n){Xa.copy(e.getBoundingRect()),e.transform&&Xa.applyTransform(e.transform);return Ya.width=t,Ya.height=n,!Xa.intersect(Ya)}(this,e,t)||i&&!i[0]&&!i[3])return!1;if(n&&this.__clipPaths)for(var o=0;o<this.__clipPaths.length;++o)if(this.__clipPaths[o].isZeroArea())return!1;if(r&&this.parent)for(var a=this.parent;a;){if(a.ignore)return!1;a=a.parent}return!0},t.prototype.contain=function(e,t){return this.rectContain(e,t)},t.prototype.traverse=function(e,t){e.call(t,this)},t.prototype.rectContain=function(e,t){var n=this.transformCoordToLocal(e,t);return this.getBoundingRect().contain(n[0],n[1])},t.prototype.getPaintRect=function(){var e=this._paintRect;if(!this._paintRect||this.__dirty){var t=this.transform,n=this.getBoundingRect(),r=this.style,i=r.shadowBlur||0,o=r.shadowOffsetX||0,a=r.shadowOffsetY||0;e=this._paintRect||(this._paintRect=new jt(0,0,0,0)),t?jt.applyTransform(e,n,t):e.copy(n),(i||o||a)&&(e.width+=2*i+Math.abs(o),e.height+=2*i+Math.abs(a),e.x=Math.min(e.x,e.x+o-i),e.y=Math.min(e.y,e.y+a-i));var s=this.dirtyRectTolerance;e.isZero()||(e.x=Math.floor(e.x-s),e.y=Math.floor(e.y-s),e.width=Math.ceil(e.width+1+2*s),e.height=Math.ceil(e.height+1+2*s))}return e},t.prototype.setPrevPaintRect=function(e){e?(this._prevPaintRect=this._prevPaintRect||new jt(0,0,0,0),this._prevPaintRect.copy(e)):this._prevPaintRect=null},t.prototype.getPrevPaintRect=function(){return this._prevPaintRect},t.prototype.animateStyle=function(e){return this.animate("style",e)},t.prototype.updateDuringAnimation=function(e){"style"===e?this.dirtyStyle():this.markRedraw()},t.prototype.attrKV=function(t,n){"style"!==t?e.prototype.attrKV.call(this,t,n):this.style?this.setStyle(n):this.useStyle(n)},t.prototype.setStyle=function(e,t){return"string"==typeof e?this.style[e]=t:z(this.style,e),this.dirtyStyle(),this},t.prototype.dirtyStyle=function(e){e||this.markRedraw(),this.__dirty|=2,this._rect&&(this._rect=null)},t.prototype.dirty=function(){this.dirtyStyle()},t.prototype.styleChanged=function(){return!!(2&this.__dirty)},t.prototype.styleUpdated=function(){this.__dirty&=-3},t.prototype.createStyle=function(e){return Ce(Ga,e)},t.prototype.useStyle=function(e){e[Fa]||(e=this.createStyle(e)),this.__inHover?this.__hoverStyle=e:this.style=e,this.dirtyStyle()},t.prototype.isStyleObject=function(e){return e[Fa]},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.style&&!n.style&&(n.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(t,n,Ua)},t.prototype._applyStateObj=function(t,n,r,i,o,a){e.prototype._applyStateObj.call(this,t,n,r,i,o,a);var s,l=!(n&&i);if(n&&n.style?o?i?s=n.style:(s=this._mergeStyle(this.createStyle(),r.style),this._mergeStyle(s,n.style)):(s=this._mergeStyle(this.createStyle(),i?this.style:r.style),this._mergeStyle(s,n.style)):l&&(s=r.style),s)if(o){var u=this.style;if(this.style=this.createStyle(l?{}:u),l)for(var c=q(u),h=0;h<c.length;h++){(p=c[h])in s&&(s[p]=s[p],this.style[p]=u[p])}var d=q(s);for(h=0;h<d.length;h++){var p=d[h];this.style[p]=this.style[p]}this._transitionState(t,{style:s},a,this.getAnimationStyleProps())}else this.useStyle(s);var f=this.__inHover?Wa:Ua;for(h=0;h<f.length;h++){p=f[h];n&&null!=n[p]?this[p]=n[p]:l&&null!=r[p]&&(this[p]=r[p])}},t.prototype._mergeStates=function(t){for(var n,r=e.prototype._mergeStates.call(this,t),i=0;i<t.length;i++){var o=t[i];o.style&&(n=n||{},this._mergeStyle(n,o.style))}return n&&(r.style=n),r},t.prototype._mergeStyle=function(e,t){return z(e,t),e},t.prototype.getAnimationStyleProps=function(){return Ha},t.initDefaultProps=((n=t.prototype).type="displayable",n.invisible=!1,n.z=0,n.z2=0,n.zlevel=0,n.culling=!1,n.cursor="pointer",n.rectHover=!1,n.incremental=!1,n._rect=null,n.dirtyRectTolerance=0,void(n.__dirty=3)),t}(Hi),Xa=new jt(0,0,0,0),Ya=new jt(0,0,0,0);var Za=Math.min,qa=Math.max,Ka=Math.sin,$a=Math.cos,Ja=2*Math.PI,Qa=Ne(),es=Ne(),ts=Ne();function ns(e,t,n){if(0!==e.length){for(var r=e[0],i=r[0],o=r[0],a=r[1],s=r[1],l=1;l<e.length;l++)r=e[l],i=Za(i,r[0]),o=qa(o,r[0]),a=Za(a,r[1]),s=qa(s,r[1]);t[0]=i,t[1]=a,n[0]=o,n[1]=s}}function rs(e,t,n,r,i,o){i[0]=Za(e,n),i[1]=Za(t,r),o[0]=qa(e,n),o[1]=qa(t,r)}var is=[],os=[];function as(e,t,n,r,i,o,a,s,l,u){var c=In,h=Cn,d=c(e,n,i,a,is);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var p=0;p<d;p++){var f=h(e,n,i,a,is[p]);l[0]=Za(f,l[0]),u[0]=qa(f,u[0])}d=c(t,r,o,s,os);for(p=0;p<d;p++){var g=h(t,r,o,s,os[p]);l[1]=Za(g,l[1]),u[1]=qa(g,u[1])}l[0]=Za(e,l[0]),u[0]=qa(e,u[0]),l[0]=Za(a,l[0]),u[0]=qa(a,u[0]),l[1]=Za(t,l[1]),u[1]=qa(t,u[1]),l[1]=Za(s,l[1]),u[1]=qa(s,u[1])}function ss(e,t,n,r,i,o,a,s){var l=Rn,u=Pn,c=qa(Za(l(e,n,i),1),0),h=qa(Za(l(t,r,o),1),0),d=u(e,n,i,c),p=u(t,r,o,h);a[0]=Za(e,i,d),a[1]=Za(t,o,p),s[0]=qa(e,i,d),s[1]=qa(t,o,p)}function ls(e,t,n,r,i,o,a,s,l){var u=$e,c=Je,h=Math.abs(i-o);if(h%Ja<1e-4&&h>1e-4)return s[0]=e-n,s[1]=t-r,l[0]=e+n,void(l[1]=t+r);if(Qa[0]=$a(i)*n+e,Qa[1]=Ka(i)*r+t,es[0]=$a(o)*n+e,es[1]=Ka(o)*r+t,u(s,Qa,es),c(l,Qa,es),(i%=Ja)<0&&(i+=Ja),(o%=Ja)<0&&(o+=Ja),i>o&&!a?o+=Ja:i<o&&a&&(i+=Ja),a){var d=o;o=i,i=d}for(var p=0;p<o;p+=Math.PI/2)p>i&&(ts[0]=$a(p)*n+e,ts[1]=Ka(p)*r+t,u(s,ts,s),c(l,ts,l))}var us={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},cs=[],hs=[],ds=[],ps=[],fs=[],gs=[],ms=Math.min,vs=Math.max,ys=Math.cos,_s=Math.sin,xs=Math.abs,bs=Math.PI,ws=2*bs,Ss="undefined"!=typeof Float32Array,Ts=[];function Ms(e){return Math.round(e/bs*1e8)/1e8%2*bs}function Cs(e,t){var n=Ms(e[0]);n<0&&(n+=ws);var r=n-e[0],i=e[1];i+=r,!t&&i-n>=ws?i=n+ws:t&&n-i>=ws?i=n-ws:!t&&n>i?i=n+(ws-Ms(n-i)):t&&n<i&&(i=n-(ws-Ms(i-n))),e[0]=n,e[1]=i}var Ds=function(){function e(e){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,e&&(this._saveData=!1),this._saveData&&(this.data=[])}return e.prototype.increaseVersion=function(){this._version++},e.prototype.getVersion=function(){return this._version},e.prototype.setScale=function(e,t,n){(n=n||0)>0&&(this._ux=xs(n/gi/e)||0,this._uy=xs(n/gi/t)||0)},e.prototype.setDPR=function(e){this.dpr=e},e.prototype.setContext=function(e){this._ctx=e},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(us.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},e.prototype.lineTo=function(e,t){var n=xs(e-this._xi),r=xs(t-this._yi),i=n>this._ux||r>this._uy;if(this.addData(us.L,e,t),this._ctx&&i&&this._ctx.lineTo(e,t),i)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var o=n*n+r*r;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=o)}return this},e.prototype.bezierCurveTo=function(e,t,n,r,i,o){return this._drawPendingPt(),this.addData(us.C,e,t,n,r,i,o),this._ctx&&this._ctx.bezierCurveTo(e,t,n,r,i,o),this._xi=i,this._yi=o,this},e.prototype.quadraticCurveTo=function(e,t,n,r){return this._drawPendingPt(),this.addData(us.Q,e,t,n,r),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,r),this._xi=n,this._yi=r,this},e.prototype.arc=function(e,t,n,r,i,o){this._drawPendingPt(),Ts[0]=r,Ts[1]=i,Cs(Ts,o),r=Ts[0];var a=(i=Ts[1])-r;return this.addData(us.A,e,t,n,n,r,a,0,o?0:1),this._ctx&&this._ctx.arc(e,t,n,r,i,o),this._xi=ys(i)*n+e,this._yi=_s(i)*n+t,this},e.prototype.arcTo=function(e,t,n,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,r,i),this},e.prototype.rect=function(e,t,n,r){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,r),this.addData(us.R,e,t,n,r),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(us.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},e.prototype.fill=function(e){e&&e.fill(),this.toStatic()},e.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(e){var t=e.length;this.data&&this.data.length===t||!Ss||(this.data=new Float32Array(t));for(var n=0;n<t;n++)this.data[n]=e[n];this._len=t},e.prototype.appendPath=function(e){e instanceof Array||(e=[e]);for(var t=e.length,n=0,r=this._len,i=0;i<t;i++)n+=e[i].len();Ss&&this.data instanceof Float32Array&&(this.data=new Float32Array(r+n));for(i=0;i<t;i++)for(var o=e[i].data,a=0;a<o.length;a++)this.data[r++]=o[a];this._len=r},e.prototype.addData=function(e,t,n,r,i,o,a,s,l){if(this._saveData){var u=this.data;this._len+arguments.length>u.length&&(this._expandData(),u=this.data);for(var c=0;c<arguments.length;c++)u[this._len++]=arguments[c]}},e.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t<this._len;t++)e[t]=this.data[t];this.data=e}},e.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,Ss&&this._len>11&&(this.data=new Float32Array(e)))}},e.prototype.getBoundingRect=function(){ds[0]=ds[1]=fs[0]=fs[1]=Number.MAX_VALUE,ps[0]=ps[1]=gs[0]=gs[1]=-Number.MAX_VALUE;var e,t=this.data,n=0,r=0,i=0,o=0;for(e=0;e<this._len;){var a=t[e++],s=1===e;switch(s&&(i=n=t[e],o=r=t[e+1]),a){case us.M:n=i=t[e++],r=o=t[e++],fs[0]=i,fs[1]=o,gs[0]=i,gs[1]=o;break;case us.L:rs(n,r,t[e],t[e+1],fs,gs),n=t[e++],r=t[e++];break;case us.C:as(n,r,t[e++],t[e++],t[e++],t[e++],t[e],t[e+1],fs,gs),n=t[e++],r=t[e++];break;case us.Q:ss(n,r,t[e++],t[e++],t[e],t[e+1],fs,gs),n=t[e++],r=t[e++];break;case us.A:var l=t[e++],u=t[e++],c=t[e++],h=t[e++],d=t[e++],p=t[e++]+d;e+=1;var f=!t[e++];s&&(i=ys(d)*c+l,o=_s(d)*h+u),ls(l,u,c,h,d,p,f,fs,gs),n=ys(p)*c+l,r=_s(p)*h+u;break;case us.R:rs(i=n=t[e++],o=r=t[e++],i+t[e++],o+t[e++],fs,gs);break;case us.Z:n=i,r=o}$e(ds,ds,fs),Je(ps,ps,gs)}return 0===e&&(ds[0]=ds[1]=ps[0]=ps[1]=0),new jt(ds[0],ds[1],ps[0]-ds[0],ps[1]-ds[1])},e.prototype._calculateLength=function(){var e=this.data,t=this._len,n=this._ux,r=this._uy,i=0,o=0,a=0,s=0;this._pathSegLen||(this._pathSegLen=[]);for(var l=this._pathSegLen,u=0,c=0,h=0;h<t;){var d=e[h++],p=1===h;p&&(a=i=e[h],s=o=e[h+1]);var f=-1;switch(d){case us.M:i=a=e[h++],o=s=e[h++];break;case us.L:var g=e[h++],m=(_=e[h++])-o;(xs(I=g-i)>n||xs(m)>r||h===t-1)&&(f=Math.sqrt(I*I+m*m),i=g,o=_);break;case us.C:var v=e[h++],y=e[h++],_=(g=e[h++],e[h++]),x=e[h++],b=e[h++];f=Nn(i,o,v,y,g,_,x,b,10),i=x,o=b;break;case us.Q:f=Vn(i,o,v=e[h++],y=e[h++],g=e[h++],_=e[h++],10),i=g,o=_;break;case us.A:var w=e[h++],S=e[h++],T=e[h++],M=e[h++],C=e[h++],D=e[h++],A=D+C;h+=1,p&&(a=ys(C)*T+w,s=_s(C)*M+S),f=vs(T,M)*ms(ws,Math.abs(D)),i=ys(A)*T+w,o=_s(A)*M+S;break;case us.R:a=i=e[h++],s=o=e[h++],f=2*e[h++]+2*e[h++];break;case us.Z:var I=a-i;m=s-o;f=Math.sqrt(I*I+m*m),i=a,o=s}f>=0&&(l[c++]=f,u+=f)}return this._pathLen=u,u},e.prototype.rebuildPath=function(e,t){var n,r,i,o,a,s,l,u,c,h,d=this.data,p=this._ux,f=this._uy,g=this._len,m=t<1,v=0,y=0,_=0;if(!m||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=t*this._pathLen))e:for(var x=0;x<g;){var b=d[x++],w=1===x;switch(w&&(n=i=d[x],r=o=d[x+1]),b!==us.L&&_>0&&(e.lineTo(c,h),_=0),b){case us.M:n=i=d[x++],r=o=d[x++],e.moveTo(i,o);break;case us.L:a=d[x++],s=d[x++];var S=xs(a-i),T=xs(s-o);if(S>p||T>f){if(m){if(v+(Z=l[y++])>u){var M=(u-v)/Z;e.lineTo(i*(1-M)+a*M,o*(1-M)+s*M);break e}v+=Z}e.lineTo(a,s),i=a,o=s,_=0}else{var C=S*S+T*T;C>_&&(c=a,h=s,_=C)}break;case us.C:var D=d[x++],A=d[x++],I=d[x++],E=d[x++],L=d[x++],N=d[x++];if(m){if(v+(Z=l[y++])>u){En(i,D,I,L,M=(u-v)/Z,cs),En(o,A,E,N,M,hs),e.bezierCurveTo(cs[1],hs[1],cs[2],hs[2],cs[3],hs[3]);break e}v+=Z}e.bezierCurveTo(D,A,I,E,L,N),i=L,o=N;break;case us.Q:D=d[x++],A=d[x++],I=d[x++],E=d[x++];if(m){if(v+(Z=l[y++])>u){kn(i,D,I,M=(u-v)/Z,cs),kn(o,A,E,M,hs),e.quadraticCurveTo(cs[1],hs[1],cs[2],hs[2]);break e}v+=Z}e.quadraticCurveTo(D,A,I,E),i=I,o=E;break;case us.A:var P=d[x++],O=d[x++],R=d[x++],k=d[x++],z=d[x++],V=d[x++],B=d[x++],F=!d[x++],G=R>k?R:k,H=xs(R-k)>.001,U=z+V,W=!1;if(m)v+(Z=l[y++])>u&&(U=z+V*(u-v)/Z,W=!0),v+=Z;if(H&&e.ellipse?e.ellipse(P,O,R,k,B,z,U,F):e.arc(P,O,G,z,U,F),W)break e;w&&(n=ys(z)*R+P,r=_s(z)*k+O),i=ys(U)*R+P,o=_s(U)*k+O;break;case us.R:n=i=d[x],r=o=d[x+1],a=d[x++],s=d[x++];var j=d[x++],X=d[x++];if(m){if(v+(Z=l[y++])>u){var Y=u-v;e.moveTo(a,s),e.lineTo(a+ms(Y,j),s),(Y-=j)>0&&e.lineTo(a+j,s+ms(Y,X)),(Y-=X)>0&&e.lineTo(a+vs(j-Y,0),s+X),(Y-=j)>0&&e.lineTo(a,s+vs(X-Y,0));break e}v+=Z}e.rect(a,s,j,X);break;case us.Z:if(m){var Z;if(v+(Z=l[y++])>u){M=(u-v)/Z;e.lineTo(i*(1-M)+n*M,o*(1-M)+r*M);break e}v+=Z}e.closePath(),i=n,o=r}}},e.prototype.clone=function(){var t=new e,n=this.data;return t.data=n.slice?n.slice():Array.prototype.slice.call(n),t._len=this._len,t},e.CMD=us,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),e}();function As(e,t,n,r,i,o,a){if(0===i)return!1;var s=i,l=0;if(a>t+s&&a>r+s||a<t-s&&a<r-s||o>e+s&&o>n+s||o<e-s&&o<n-s)return!1;if(e===n)return Math.abs(o-e)<=s/2;var u=(l=(t-r)/(e-n))*o-a+(e*r-n*t)/(e-n);return u*u/(l*l+1)<=s/2*s/2}function Is(e,t,n,r,i,o,a,s,l,u,c){if(0===l)return!1;var h=l;return!(c>t+h&&c>r+h&&c>o+h&&c>s+h||c<t-h&&c<r-h&&c<o-h&&c<s-h||u>e+h&&u>n+h&&u>i+h&&u>a+h||u<e-h&&u<n-h&&u<i-h&&u<a-h)&&Ln(e,t,n,r,i,o,a,s,u,c,null)<=h/2}function Es(e,t,n,r,i,o,a,s,l){if(0===a)return!1;var u=a;return!(l>t+u&&l>r+u&&l>o+u||l<t-u&&l<r-u&&l<o-u||s>e+u&&s>n+u&&s>i+u||s<e-u&&s<n-u&&s<i-u)&&zn(e,t,n,r,i,o,s,l,null)<=u/2}var Ls=2*Math.PI;function Ns(e){return(e%=Ls)<0&&(e+=Ls),e}var Ps=2*Math.PI;function Os(e,t,n,r,i,o,a,s,l){if(0===a)return!1;var u=a;s-=e,l-=t;var c=Math.sqrt(s*s+l*l);if(c-u>n||c+u<n)return!1;if(Math.abs(r-i)%Ps<1e-4)return!0;if(o){var h=r;r=Ns(i),i=Ns(h)}else r=Ns(r),i=Ns(i);r>i&&(i+=Ps);var d=Math.atan2(l,s);return d<0&&(d+=Ps),d>=r&&d<=i||d+Ps>=r&&d+Ps<=i}function Rs(e,t,n,r,i,o){if(o>t&&o>r||o<t&&o<r)return 0;if(r===t)return 0;var a=(o-t)/(r-t),s=r<t?1:-1;1!==a&&0!==a||(s=r<t?.5:-.5);var l=a*(n-e)+e;return l===i?1/0:l>i?s:0}var ks=Ds.CMD,zs=2*Math.PI;var Vs=[-1,-1,-1],Bs=[-1,-1];function Fs(e,t,n,r,i,o,a,s,l,u){if(u>t&&u>r&&u>o&&u>s||u<t&&u<r&&u<o&&u<s)return 0;var c,h=An(t,r,o,s,u,Vs);if(0===h)return 0;for(var d=0,p=-1,f=void 0,g=void 0,m=0;m<h;m++){var v=Vs[m],y=0===v||1===v?.5:1;Cn(e,n,i,a,v)<l||(p<0&&(p=In(t,r,o,s,Bs),Bs[1]<Bs[0]&&p>1&&(c=void 0,c=Bs[0],Bs[0]=Bs[1],Bs[1]=c),f=Cn(t,r,o,s,Bs[0]),p>1&&(g=Cn(t,r,o,s,Bs[1]))),2===p?v<Bs[0]?d+=f<t?y:-y:v<Bs[1]?d+=g<f?y:-y:d+=s<g?y:-y:v<Bs[0]?d+=f<t?y:-y:d+=s<f?y:-y)}return d}function Gs(e,t,n,r,i,o,a,s){if(s>t&&s>r&&s>o||s<t&&s<r&&s<o)return 0;var l=function(e,t,n,r,i){var o=e-2*t+n,a=2*(t-e),s=e-r,l=0;if(Tn(o))Mn(a)&&(c=-s/a)>=0&&c<=1&&(i[l++]=c);else{var u=a*a-4*o*s;if(Tn(u))(c=-a/(2*o))>=0&&c<=1&&(i[l++]=c);else if(u>0){var c,h=mn(u),d=(-a-h)/(2*o);(c=(-a+h)/(2*o))>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}(t,r,o,s,Vs);if(0===l)return 0;var u=Rn(t,r,o);if(u>=0&&u<=1){for(var c=0,h=Pn(t,r,o,u),d=0;d<l;d++){var p=0===Vs[d]||1===Vs[d]?.5:1;Pn(e,n,i,Vs[d])<a||(Vs[d]<u?c+=h<t?p:-p:c+=o<h?p:-p)}return c}p=0===Vs[0]||1===Vs[0]?.5:1;return Pn(e,n,i,Vs[0])<a?0:o<t?p:-p}function Hs(e,t,n,r,i,o,a,s){if((s-=t)>n||s<-n)return 0;var l=Math.sqrt(n*n-s*s);Vs[0]=-l,Vs[1]=l;var u=Math.abs(r-i);if(u<1e-4)return 0;if(u>=zs-1e-4){r=0,i=zs;var c=o?1:-1;return a>=Vs[0]+e&&a<=Vs[1]+e?c:0}if(r>i){var h=r;r=i,i=h}r<0&&(r+=zs,i+=zs);for(var d=0,p=0;p<2;p++){var f=Vs[p];if(f+e>a){var g=Math.atan2(s,f);c=o?1:-1;g<0&&(g=zs+g),(g>=r&&g<=i||g+zs>=r&&g+zs<=i)&&(g>Math.PI/2&&g<1.5*Math.PI&&(c=-c),d+=c)}}return d}function Us(e,t,n,r,i){for(var o,a,s,l,u=e.data,c=e.len(),h=0,d=0,p=0,f=0,g=0,m=0;m<c;){var v=u[m++],y=1===m;switch(v===ks.M&&m>1&&(n||(h+=Rs(d,p,f,g,r,i))),y&&(f=d=u[m],g=p=u[m+1]),v){case ks.M:d=f=u[m++],p=g=u[m++];break;case ks.L:if(n){if(As(d,p,u[m],u[m+1],t,r,i))return!0}else h+=Rs(d,p,u[m],u[m+1],r,i)||0;d=u[m++],p=u[m++];break;case ks.C:if(n){if(Is(d,p,u[m++],u[m++],u[m++],u[m++],u[m],u[m+1],t,r,i))return!0}else h+=Fs(d,p,u[m++],u[m++],u[m++],u[m++],u[m],u[m+1],r,i)||0;d=u[m++],p=u[m++];break;case ks.Q:if(n){if(Es(d,p,u[m++],u[m++],u[m],u[m+1],t,r,i))return!0}else h+=Gs(d,p,u[m++],u[m++],u[m],u[m+1],r,i)||0;d=u[m++],p=u[m++];break;case ks.A:var _=u[m++],x=u[m++],b=u[m++],w=u[m++],S=u[m++],T=u[m++];m+=1;var M=!!(1-u[m++]);o=Math.cos(S)*b+_,a=Math.sin(S)*w+x,y?(f=o,g=a):h+=Rs(d,p,o,a,r,i);var C=(r-_)*w/b+_;if(n){if(Os(_,x,w,S,S+T,M,t,C,i))return!0}else h+=Hs(_,x,w,S,S+T,M,C,i);d=Math.cos(S+T)*b+_,p=Math.sin(S+T)*w+x;break;case ks.R:if(f=d=u[m++],g=p=u[m++],o=f+u[m++],a=g+u[m++],n){if(As(f,g,o,g,t,r,i)||As(o,g,o,a,t,r,i)||As(o,a,f,a,t,r,i)||As(f,a,f,g,t,r,i))return!0}else h+=Rs(o,g,o,a,r,i),h+=Rs(f,a,f,g,r,i);break;case ks.Z:if(n){if(As(d,p,f,g,t,r,i))return!0}else h+=Rs(d,p,f,g,r,i);d=f,p=g}}return n||(s=p,l=g,Math.abs(s-l)<1e-4)||(h+=Rs(d,p,f,g,r,i)||0),0!==h}var Ws=V({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Ga),js={style:V({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Ha.style)},Xs=Ci.concat(["invisible","culling","z","z2","zlevel","parent"]),Ys=function(e){function t(t){return e.call(this,t)||this}var n;return l(t,e),t.prototype.update=function(){var n=this;e.prototype.update.call(this);var r=this.style;if(r.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(e){n.buildPath(e,n.shape)}),i.silent=!0;var o=i.style;for(var a in r)o[a]!==r[a]&&(o[a]=r[a]);o.fill=r.fill?r.decal:null,o.decal=null,o.shadowColor=null,r.strokeFirst&&(o.stroke=null);for(var s=0;s<Xs.length;++s)i[Xs[s]]=this[Xs[s]];i.__dirty|=1}else this._decalEl&&(this._decalEl=null)},t.prototype.getDecalElement=function(){return this._decalEl},t.prototype._init=function(t){var n=q(t);this.shape=this.getDefaultShape();var r=this.getDefaultStyle();r&&this.useStyle(r);for(var i=0;i<n.length;i++){var o=n[i],a=t[o];"style"===o?this.style?z(this.style,a):this.useStyle(a):"shape"===o?z(this.shape,a):e.prototype.attrKV.call(this,o,a)}this.style||this.useStyle({})},t.prototype.getDefaultStyle=function(){return null},t.prototype.getDefaultShape=function(){return{}},t.prototype.canBeInsideText=function(){return this.hasFill()},t.prototype.getInsideTextFill=function(){var e=this.style.fill;if("none"!==e){if(ee(e)){var t=pr(e,0);return t>.5?mi:t>.2?"#eee":vi}if(e)return vi}return mi},t.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(ee(t)){var n=this.__zr;if(!(!n||!n.isDarkMode())===pr(e,0)<.4)return t}},t.prototype.buildPath=function(e,t,n){},t.prototype.pathUpdated=function(){this.__dirty&=-5},t.prototype.getUpdatedPathProxy=function(e){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},t.prototype.createPathProxy=function(){this.path=new Ds(!1)},t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return!(null==t||"none"===t||!(e.lineWidth>0))},t.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},t.prototype.getBoundingRect=function(){var e=this._rect,t=this.style,n=!e;if(n){var r=!1;this.path||(r=!0,this.createPathProxy());var i=this.path;(r||4&this.__dirty)&&(i.beginPath(),this.buildPath(i,this.shape,!1),this.pathUpdated()),e=i.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=e.clone());if(this.__dirty||n){o.copy(e);var a=t.strokeNoScale?this.getLineScale():1,s=t.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(o.width+=s/a,o.height+=s/a,o.x-=s/a/2,o.y-=s/a/2)}return o}return e},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect(),i=this.style;if(e=n[0],t=n[1],r.contain(e,t)){var o=this.path;if(this.hasStroke()){var a=i.lineWidth,s=i.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),function(e,t,n,r){return Us(e,t,!0,n,r)}(o,a/s,e,t)))return!0}if(this.hasFill())return function(e,t,n){return Us(e,0,!1,t,n)}(o,e,t)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate("shape",e)},t.prototype.updateDuringAnimation=function(e){"style"===e?this.dirtyStyle():"shape"===e?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(t,n){"shape"===t?this.setShape(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setShape=function(e,t){var n=this.shape;return n||(n=this.shape={}),"string"==typeof e?n[e]=t:z(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(4&this.__dirty)},t.prototype.createStyle=function(e){return Ce(Ws,e)},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=z({},this.shape))},t.prototype._applyStateObj=function(t,n,r,i,o,a){e.prototype._applyStateObj.call(this,t,n,r,i,o,a);var s,l=!(n&&i);if(n&&n.shape?o?i?s=n.shape:(s=z({},r.shape),z(s,n.shape)):(s=z({},i?this.shape:r.shape),z(s,n.shape)):l&&(s=r.shape),s)if(o){this.shape=z({},this.shape);for(var u={},c=q(s),h=0;h<c.length;h++){var d=c[h];"object"==typeof s[d]?this.shape[d]=s[d]:u[d]=s[d]}this._transitionState(t,{shape:u},a)}else this.shape=s,this.dirtyShape()},t.prototype._mergeStates=function(t){for(var n,r=e.prototype._mergeStates.call(this,t),i=0;i<t.length;i++){var o=t[i];o.shape&&(n=n||{},this._mergeStyle(n,o.shape))}return n&&(r.shape=n),r},t.prototype.getAnimationStyleProps=function(){return js},t.prototype.isZeroArea=function(){return!1},t.extend=function(e){var n=function(t){function n(n){var r=t.call(this,n)||this;return e.init&&e.init.call(r,n),r}return l(n,t),n.prototype.getDefaultStyle=function(){return O(e.style)},n.prototype.getDefaultShape=function(){return O(e.shape)},n}(t);for(var r in e)"function"==typeof e[r]&&(n.prototype[r]=e[r]);return n},t.initDefaultProps=((n=t.prototype).type="path",n.strokeContainThreshold=5,n.segmentIgnoreThreshold=0,n.subPixelOptimize=!1,n.autoBatch=!1,void(n.__dirty=7)),t}(ja),Zs=V({strokeFirst:!0,font:f,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},Ws),qs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return null!=t&&"none"!==t&&e.lineWidth>0},t.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},t.prototype.createStyle=function(e){return Ce(Zs,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){var e=this.style;if(!this._rect){var t=e.text;null!=t?t+="":t="";var n=Li(t,e.font,e.textAlign,e.textBaseline);if(n.x+=e.x||0,n.y+=e.y||0,this.hasStroke()){var r=e.lineWidth;n.x-=r/2,n.y-=r/2,n.width+=r,n.height+=r}this._rect=n}return this._rect},t.initDefaultProps=void(t.prototype.dirtyRectTolerance=10),t}(ja);qs.prototype.type="tspan";var Ks=V({x:0,y:0},Ga),$s={style:V({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Ha.style)};var Js=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.createStyle=function(e){return Ce(Ks,e)},t.prototype._getSize=function(e){var t=this.style,n=t[e];if(null!=n)return n;var r,i=(r=t.image)&&"string"!=typeof r&&r.width&&r.height?t.image:this.__image;if(!i)return 0;var o="width"===e?"height":"width",a=t[o];return null==a?i[e]:i[e]/i[o]*a},t.prototype.getWidth=function(){return this._getSize("width")},t.prototype.getHeight=function(){return this._getSize("height")},t.prototype.getAnimationStyleProps=function(){return $s},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||(this._rect=new jt(e.x||0,e.y||0,this.getWidth(),this.getHeight())),this._rect},t}(ja);Js.prototype.type="image";var Qs=Math.round;function el(e,t,n){if(t){var r=t.x1,i=t.x2,o=t.y1,a=t.y2;e.x1=r,e.x2=i,e.y1=o,e.y2=a;var s=n&&n.lineWidth;return s?(Qs(2*r)===Qs(2*i)&&(e.x1=e.x2=nl(r,s,!0)),Qs(2*o)===Qs(2*a)&&(e.y1=e.y2=nl(o,s,!0)),e):e}}function tl(e,t,n){if(t){var r=t.x,i=t.y,o=t.width,a=t.height;e.x=r,e.y=i,e.width=o,e.height=a;var s=n&&n.lineWidth;return s?(e.x=nl(r,s,!0),e.y=nl(i,s,!0),e.width=Math.max(nl(r+o,s,!1)-e.x,0===o?0:1),e.height=Math.max(nl(i+a,s,!1)-e.y,0===a?0:1),e):e}}function nl(e,t,n){if(!t)return e;var r=Qs(2*e);return(r+Qs(t))%2==0?r/2:(r+(n?1:-1))/2}var rl=function(){this.x=0,this.y=0,this.width=0,this.height=0},il={},ol=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultShape=function(){return new rl},t.prototype.buildPath=function(e,t){var n,r,i,o;if(this.subPixelOptimize){var a=tl(il,t,this.style);n=a.x,r=a.y,i=a.width,o=a.height,a.r=t.r,t=a}else n=t.x,r=t.y,i=t.width,o=t.height;t.r?function(e,t){var n,r,i,o,a,s=t.x,l=t.y,u=t.width,c=t.height,h=t.r;u<0&&(s+=u,u=-u),c<0&&(l+=c,c=-c),"number"==typeof h?n=r=i=o=h:h instanceof Array?1===h.length?n=r=i=o=h[0]:2===h.length?(n=i=h[0],r=o=h[1]):3===h.length?(n=h[0],r=o=h[1],i=h[2]):(n=h[0],r=h[1],i=h[2],o=h[3]):n=r=i=o=0,n+r>u&&(n*=u/(a=n+r),r*=u/a),i+o>u&&(i*=u/(a=i+o),o*=u/a),r+i>c&&(r*=c/(a=r+i),i*=c/a),n+o>c&&(n*=c/(a=n+o),o*=c/a),e.moveTo(s+n,l),e.lineTo(s+u-r,l),0!==r&&e.arc(s+u-r,l+r,r,-Math.PI/2,0),e.lineTo(s+u,l+c-i),0!==i&&e.arc(s+u-i,l+c-i,i,0,Math.PI/2),e.lineTo(s+o,l+c),0!==o&&e.arc(s+o,l+c-o,o,Math.PI/2,Math.PI),e.lineTo(s,l+n),0!==n&&e.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}(e,t):e.rect(n,r,i,o)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(Ys);ol.prototype.type="rect";var al={fill:"#000"},sl={style:V({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},Ha.style)},ll=function(e){function t(t){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=al,n.attr(t),n}return l(t,e),t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t<this._children.length;t++){var n=this._children[t];n.zlevel=this.zlevel,n.z=this.z,n.z2=this.z2,n.culling=this.culling,n.cursor=this.cursor,n.invisible=this.invisible}},t.prototype.updateTransform=function(){var t=this.innerTransformable;t?(t.updateTransform(),t.transform&&(this.transform=t.transform)):e.prototype.updateTransform.call(this)},t.prototype.getLocalTransform=function(t){var n=this.innerTransformable;return n?n.getLocalTransform(t):e.prototype.getLocalTransform.call(this,t)},t.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),e.prototype.getComputedTransform.call(this)},t.prototype._updateSubTexts=function(){var e;this._childCursor=0,gl(e=this.style),W(e.rich,gl),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},t.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].__zr=t},t.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].__zr=null},t.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var e=new jt(0,0,0,0),t=this._children,n=[],r=null,i=0;i<t.length;i++){var o=t[i],a=o.getBoundingRect(),s=o.getLocalTransform(n);s?(e.copy(a),e.applyTransform(s),(r=r||e.clone()).union(e)):(r=r||a.clone()).union(a)}this._rect=r||e}return this._rect},t.prototype.setDefaultTextStyle=function(e){this._defaultStyle=e||al},t.prototype.setTextContent=function(e){if("production"!==process.env.NODE_ENV)throw new Error("Can't attach text on another text")},t.prototype._mergeStyle=function(e,t){if(!t)return e;var n=t.rich,r=e.rich||n&&{};return z(e,t),n&&r?(this._mergeRich(r,n),e.rich=r):r&&(e.rich=r),e},t.prototype._mergeRich=function(e,t){for(var n=q(t),r=0;r<n.length;r++){var i=n[r];e[i]=e[i]||{},z(e[i],t[i])}},t.prototype.getAnimationStyleProps=function(){return sl},t.prototype._getOrCreateChild=function(e){var t=this._children[this._childCursor];return t&&t instanceof e||(t=new e),this._children[this._childCursor++]=t,t.__zr=this.__zr,t.parent=this,t},t.prototype._updatePlainTexts=function(){var e=this.style,t=e.font||f,n=e.padding,r=function(e,t){null!=e&&(e+="");var n,r=t.overflow,i=t.padding,o=t.font,a="truncate"===r,s=Oi(o),l=de(t.lineHeight,s),u=!!t.backgroundColor,c="truncate"===t.lineOverflow,h=t.width,d=(n=null==h||"break"!==r&&"breakAll"!==r?e?e.split("\n"):[]:e?Ba(e,t.font,h,"breakAll"===r,0).lines:[]).length*l,p=de(t.height,d);if(d>p&&c){var f=Math.floor(p/l);n=n.slice(0,f)}if(e&&a&&null!=h)for(var g=Ea(h,o,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),m=0;m<n.length;m++)n[m]=La(n[m],g);var v=p,y=0;for(m=0;m<n.length;m++)y=Math.max(Ii(n[m],o),y);null==h&&(h=y);var _=y;return i&&(v+=i[0]+i[2],_+=i[1]+i[3],h+=i[1]+i[3]),u&&(_=h),{lines:n,height:p,outerWidth:_,outerHeight:v,lineHeight:l,calculatedLineHeight:s,contentWidth:y,contentHeight:d,width:h}}(_l(e),e),i=xl(e),o=!!e.backgroundColor,a=r.outerHeight,s=r.outerWidth,l=r.contentWidth,u=r.lines,c=r.lineHeight,h=this._defaultStyle,d=e.x||0,p=e.y||0,g=e.align||h.align||"left",m=e.verticalAlign||h.verticalAlign||"top",v=d,y=Pi(p,r.contentHeight,m);if(i||n){var _=Ni(d,s,g),x=Pi(p,a,m);i&&this._renderBackground(e,e,_,x,s,a)}y+=c/2,n&&(v=yl(d,g,n),"top"===m?y+=n[0]:"bottom"===m&&(y-=n[2]));for(var b=0,w=!1,S=(vl("fill"in e?e.fill:(w=!0,h.fill))),T=(ml("stroke"in e?e.stroke:o||h.autoStroke&&!w?null:(b=2,h.stroke))),M=e.textShadowBlur>0,C=null!=e.width&&("truncate"===e.overflow||"break"===e.overflow||"breakAll"===e.overflow),D=r.calculatedLineHeight,A=0;A<u.length;A++){var I=this._getOrCreateChild(qs),E=I.createStyle();I.useStyle(E),E.text=u[A],E.x=v,E.y=y,g&&(E.textAlign=g),E.textBaseline="middle",E.opacity=e.opacity,E.strokeFirst=!0,M&&(E.shadowBlur=e.textShadowBlur||0,E.shadowColor=e.textShadowColor||"transparent",E.shadowOffsetX=e.textShadowOffsetX||0,E.shadowOffsetY=e.textShadowOffsetY||0),E.stroke=T,E.fill=S,T&&(E.lineWidth=e.lineWidth||b,E.lineDash=e.lineDash,E.lineDashOffset=e.lineDashOffset||0),E.font=t,pl(E,e),y+=c,C&&I.setBoundingRect(new jt(Ni(E.x,e.width,E.textAlign),Pi(E.y,D,E.textBaseline),l,D))}},t.prototype._updateRichTexts=function(){var e=this.style,t=function(e,t){var n=new Ra;if(null!=e&&(e+=""),!e)return n;for(var r,i=t.width,o=t.height,a=t.overflow,s="break"!==a&&"breakAll"!==a||null==i?null:{width:i,accumWidth:0,breakAll:"breakAll"===a},l=Aa.lastIndex=0;null!=(r=Aa.exec(e));){var u=r.index;u>l&&ka(n,e.substring(l,u),t,s),ka(n,r[2],t,s,r[1]),l=Aa.lastIndex}l<e.length&&ka(n,e.substring(l,e.length),t,s);var c=[],h=0,d=0,p=t.padding,f="truncate"===a,g="truncate"===t.lineOverflow;function m(e,t,n){e.width=t,e.lineHeight=n,h+=n,d=Math.max(d,t)}e:for(var v=0;v<n.lines.length;v++){for(var y=n.lines[v],_=0,x=0,b=0;b<y.tokens.length;b++){var w=(N=y.tokens[b]).styleName&&t.rich[N.styleName]||{},S=N.textPadding=w.padding,T=S?S[1]+S[3]:0,M=N.font=w.font||t.font;N.contentHeight=Oi(M);var C=de(w.height,N.contentHeight);if(N.innerHeight=C,S&&(C+=S[0]+S[2]),N.height=C,N.lineHeight=pe(w.lineHeight,t.lineHeight,C),N.align=w&&w.align||t.align,N.verticalAlign=w&&w.verticalAlign||"middle",g&&null!=o&&h+N.lineHeight>o){b>0?(y.tokens=y.tokens.slice(0,b),m(y,x,_),n.lines=n.lines.slice(0,v+1)):n.lines=n.lines.slice(0,v);break e}var D=w.width,A=null==D||"auto"===D;if("string"==typeof D&&"%"===D.charAt(D.length-1))N.percentWidth=D,c.push(N),N.contentWidth=Ii(N.text,M);else{if(A){var I=w.backgroundColor,E=I&&I.image;E&&Da(E=Ta(E))&&(N.width=Math.max(N.width,E.width*C/E.height))}var L=f&&null!=i?i-x:null;null!=L&&L<N.width?!A||L<T?(N.text="",N.width=N.contentWidth=0):(N.text=Ia(N.text,L-T,M,t.ellipsis,{minChar:t.truncateMinChar}),N.width=N.contentWidth=Ii(N.text,M)):N.contentWidth=Ii(N.text,M)}N.width+=T,x+=N.width,w&&(_=Math.max(_,N.lineHeight))}m(y,x,_)}for(n.outerWidth=n.width=de(i,d),n.outerHeight=n.height=de(o,h),n.contentHeight=h,n.contentWidth=d,p&&(n.outerWidth+=p[1]+p[3],n.outerHeight+=p[0]+p[2]),v=0;v<c.length;v++){var N,P=(N=c[v]).percentWidth;N.width=parseInt(P,10)/100*n.width}return n}(_l(e),e),n=t.width,r=t.outerWidth,i=t.outerHeight,o=e.padding,a=e.x||0,s=e.y||0,l=this._defaultStyle,u=e.align||l.align,c=e.verticalAlign||l.verticalAlign,h=Ni(a,r,u),d=Pi(s,i,c),p=h,f=d;o&&(p+=o[3],f+=o[0]);var g=p+n;xl(e)&&this._renderBackground(e,e,h,d,r,i);for(var m=!!e.backgroundColor,v=0;v<t.lines.length;v++){for(var y=t.lines[v],_=y.tokens,x=_.length,b=y.lineHeight,w=y.width,S=0,T=p,M=g,C=x-1,D=void 0;S<x&&(!(D=_[S]).align||"left"===D.align);)this._placeToken(D,e,b,f,T,"left",m),w-=D.width,T+=D.width,S++;for(;C>=0&&"right"===(D=_[C]).align;)this._placeToken(D,e,b,f,M,"right",m),w-=D.width,M-=D.width,C--;for(T+=(n-(T-p)-(g-M)-w)/2;S<=C;)D=_[S],this._placeToken(D,e,b,f,T+D.width/2,"center",m),T+=D.width,S++;f+=b}},t.prototype._placeToken=function(e,t,n,r,i,o,a){var s=t.rich[e.styleName]||{};s.text=e.text;var l=e.verticalAlign,u=r+n/2;"top"===l?u=r+e.height/2:"bottom"===l&&(u=r+n-e.height/2),!e.isLineHolder&&xl(s)&&this._renderBackground(s,t,"right"===o?i-e.width:"center"===o?i-e.width/2:i,u-e.height/2,e.width,e.height);var c=!!s.backgroundColor,h=e.textPadding;h&&(i=yl(i,o,h),u-=e.height/2-h[0]-e.innerHeight/2);var d=this._getOrCreateChild(qs),p=d.createStyle();d.useStyle(p);var g=this._defaultStyle,m=!1,v=0,y=vl("fill"in s?s.fill:"fill"in t?t.fill:(m=!0,g.fill)),_=ml("stroke"in s?s.stroke:"stroke"in t?t.stroke:c||a||g.autoStroke&&!m?null:(v=2,g.stroke)),x=s.textShadowBlur>0||t.textShadowBlur>0;p.text=e.text,p.x=i,p.y=u,x&&(p.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,p.shadowColor=s.textShadowColor||t.textShadowColor||"transparent",p.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),p.textAlign=o,p.textBaseline="middle",p.font=e.font||f,p.opacity=pe(s.opacity,t.opacity,1),pl(p,s),_&&(p.lineWidth=pe(s.lineWidth,t.lineWidth,v),p.lineDash=de(s.lineDash,t.lineDash),p.lineDashOffset=t.lineDashOffset||0,p.stroke=_),y&&(p.fill=y);var b=e.contentWidth,w=e.contentHeight;d.setBoundingRect(new jt(Ni(p.x,b,p.textAlign),Pi(p.y,w,p.textBaseline),b,w))},t.prototype._renderBackground=function(e,t,n,r,i,o){var a,s,l,u=e.backgroundColor,c=e.borderWidth,h=e.borderColor,d=u&&u.image,p=u&&!d,f=e.borderRadius,g=this;if(p||e.lineHeight||c&&h){(a=this._getOrCreateChild(ol)).useStyle(a.createStyle()),a.style.fill=null;var m=a.shape;m.x=n,m.y=r,m.width=i,m.height=o,m.r=f,a.dirtyShape()}if(p)(l=a.style).fill=u||null,l.fillOpacity=de(e.fillOpacity,1);else if(d){(s=this._getOrCreateChild(Js)).onload=function(){g.dirtyStyle()};var v=s.style;v.image=u.image,v.x=n,v.y=r,v.width=i,v.height=o}c&&h&&((l=a.style).lineWidth=c,l.stroke=h,l.strokeOpacity=de(e.strokeOpacity,1),l.lineDash=e.borderDash,l.lineDashOffset=e.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var y=(a||s).style;y.shadowBlur=e.shadowBlur||0,y.shadowColor=e.shadowColor||"transparent",y.shadowOffsetX=e.shadowOffsetX||0,y.shadowOffsetY=e.shadowOffsetY||0,y.opacity=pe(e.opacity,t.opacity,1)},t.makeFont=function(e){var t="";return fl(e)&&(t=[e.fontStyle,e.fontWeight,dl(e.fontSize),e.fontFamily||"sans-serif"].join(" ")),t&&ve(t)||e.textFont||e.font},t}(ja),ul={left:!0,right:1,center:1},cl={top:1,bottom:1,middle:1},hl=["fontStyle","fontWeight","fontSize","fontFamily"];function dl(e){return"string"!=typeof e||-1===e.indexOf("px")&&-1===e.indexOf("rem")&&-1===e.indexOf("em")?isNaN(+e)?"12px":e+"px":e}function pl(e,t){for(var n=0;n<hl.length;n++){var r=hl[n],i=t[r];null!=i&&(e[r]=i)}}function fl(e){return null!=e.fontSize||e.fontFamily||e.fontWeight}function gl(e){if(e){e.font=ll.makeFont(e);var t=e.align;"middle"===t&&(t="center"),e.align=null==t||ul[t]?t:"left";var n=e.verticalAlign;"center"===n&&(n="middle"),e.verticalAlign=null==n||cl[n]?n:"top",e.padding&&(e.padding=ge(e.padding))}}function ml(e,t){return null==e||t<=0||"transparent"===e||"none"===e?null:e.image||e.colorStops?"#000":e}function vl(e){return null==e||"none"===e?null:e.image||e.colorStops?"#000":e}function yl(e,t,n){return"right"===t?e-n[1]:"center"===t?e+n[3]/2-n[1]/2:e+n[3]}function _l(e){var t=e.text;return null!=t&&(t+=""),t}function xl(e){return!!(e.backgroundColor||e.lineHeight||e.borderWidth&&e.borderColor)}var bl=ta(),wl=function(e,t,n,r){if(r){var i=bl(r);i.dataIndex=n,i.dataType=t,i.seriesIndex=e,i.ssrType="chart","group"===r.type&&r.traverse((function(r){var i=bl(r);i.seriesIndex=e,i.dataIndex=n,i.dataType=t,i.ssrType="chart"}))}},Sl=1,Tl={},Ml=ta(),Cl=ta(),Dl=["emphasis","blur","select"],Al=["normal","emphasis","blur","select"],Il=10,El="highlight",Ll="downplay",Nl="select",Pl="unselect",Ol="toggleSelect";function Rl(e){return null!=e&&"none"!==e}function kl(e,t,n){e.onHoverStateChange&&(e.hoverState||0)!==n&&e.onHoverStateChange(t),e.hoverState=n}function zl(e){kl(e,"emphasis",2)}function Vl(e){2===e.hoverState&&kl(e,"normal",0)}function Bl(e){kl(e,"blur",1)}function Fl(e){1===e.hoverState&&kl(e,"normal",0)}function Gl(e){e.selected=!0}function Hl(e){e.selected=!1}function Ul(e,t,n){t(e,n)}function Wl(e,t,n){Ul(e,t,n),e.isGroup&&e.traverse((function(e){Ul(e,t,n)}))}function jl(e,t){switch(t){case"emphasis":e.hoverState=2;break;case"normal":e.hoverState=0;break;case"blur":e.hoverState=1;break;case"select":e.selected=!0}}function Xl(e,t){var n=this.states[e];if(this.style){if("emphasis"===e)return function(e,t,n,r){var i=n&&F(n,"select")>=0,o=!1;if(e instanceof Ys){var a=Ml(e),s=i&&a.selectFill||a.normalFill,l=i&&a.selectStroke||a.normalStroke;if(Rl(s)||Rl(l)){var u=(r=r||{}).style||{};"inherit"===u.fill?(o=!0,r=z({},r),(u=z({},u)).fill=s):!Rl(u.fill)&&Rl(s)?(o=!0,r=z({},r),(u=z({},u)).fill=gr(s)):!Rl(u.stroke)&&Rl(l)&&(o||(r=z({},r),u=z({},u)),u.stroke=gr(l)),r.style=u}}if(r&&null==r.z2){o||(r=z({},r));var c=e.z2EmphasisLift;r.z2=e.z2+(null!=c?c:Il)}return r}(this,0,t,n);if("blur"===e)return function(e,t,n){var r=F(e.currentStates,t)>=0,i=e.style.opacity,o=r?null:function(e,t,n,r){for(var i=e.style,o={},a=0;a<t.length;a++){var s=t[a],l=i[s];o[s]=null==l?r&&r[s]:l}for(a=0;a<e.animators.length;a++){var u=e.animators[a];u.__fromStateTransition&&u.__fromStateTransition.indexOf(n)<0&&"style"===u.targetName&&u.saveTo(o,t)}return o}(e,["opacity"],t,{opacity:1}),a=(n=n||{}).style||{};return null==a.opacity&&(n=z({},n),a=z({opacity:r?i:.1*o.opacity},a),n.style=a),n}(this,e,n);if("select"===e)return function(e,t,n){if(n&&null==n.z2){n=z({},n);var r=e.z2SelectLift;n.z2=e.z2+(null!=r?r:9)}return n}(this,0,n)}return n}function Yl(e){e.stateProxy=Xl;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=Xl),n&&(n.stateProxy=Xl)}function Zl(e,t){!nu(e,t)&&!e.__highByOuter&&Wl(e,zl)}function ql(e,t){!nu(e,t)&&!e.__highByOuter&&Wl(e,Vl)}function Kl(e,t){e.__highByOuter|=1<<(t||0),Wl(e,zl)}function $l(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&Wl(e,Vl)}function Jl(e){Wl(e,Bl)}function Ql(e){Wl(e,Fl)}function eu(e){Wl(e,Gl)}function tu(e){Wl(e,Hl)}function nu(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function ru(e){var t=e.getModel(),n=[],r=[];t.eachComponent((function(t,i){var o=Cl(i),a="series"===t,s=a?e.getViewOfSeriesModel(i):e.getViewOfComponentModel(i);!a&&r.push(s),o.isBlured&&(s.group.traverse((function(e){Fl(e)})),a&&n.push(i)),o.isBlured=!1})),W(r,(function(e){e&&e.toggleBlurSeries&&e.toggleBlurSeries(n,!1,t)}))}function iu(e,t,n,r){var i=r.getModel();function o(e,t){for(var n=0;n<t.length;n++){var r=e.getItemGraphicEl(t[n]);r&&Ql(r)}}if(n=n||"coordinateSystem",null!=e&&t&&"none"!==t){var a=i.getSeriesByIndex(e),s=a.coordinateSystem;s&&s.master&&(s=s.master);var l=[];i.eachSeries((function(e){var i=a===e,u=e.coordinateSystem;if(u&&u.master&&(u=u.master),!("series"===n&&!i||"coordinateSystem"===n&&!(u&&s?u===s:i)||"series"===t&&i)){if(r.getViewOfSeriesModel(e).group.traverse((function(e){e.__highByOuter&&i&&"self"===t||Bl(e)})),U(t))o(e.getData(),t);else if(re(t))for(var c=q(t),h=0;h<c.length;h++)o(e.getData(c[h]),t[c[h]]);l.push(e),Cl(e).isBlured=!0}})),i.eachComponent((function(e,t){if("series"!==e){var n=r.getViewOfComponentModel(t);n&&n.toggleBlurSeries&&n.toggleBlurSeries(l,!0,i)}}))}}function ou(e,t,n){if(null!=e&&null!=t){var r=n.getModel().getComponent(e,t);if(r){Cl(r).isBlured=!0;var i=n.getViewOfComponentModel(r);i&&i.focusBlurEnabled&&i.group.traverse((function(e){Bl(e)}))}}}function au(e,t,n,r){var i={focusSelf:!1,dispatchers:null};if(null==e||"series"===e||null==t||null==n)return i;var o=r.getModel().getComponent(e,t);if(!o)return i;var a=r.getViewOfComponentModel(o);if(!a||!a.findHighDownDispatchers)return i;for(var s,l=a.findHighDownDispatchers(n),u=0;u<l.length;u++)if("production"===process.env.NODE_ENV||mu(l[u])||Po("param should be highDownDispatcher"),"self"===bl(l[u]).focus){s=!0;break}return{focusSelf:s,dispatchers:l}}function su(e){W(e.getAllData(),(function(t){var n=t.data,r=t.type;n.eachItemGraphicEl((function(t,n){e.isSelected(n,r)?eu(t):tu(t)}))}))}function lu(e){var t=[];return e.eachSeries((function(e){W(e.getAllData(),(function(n){n.data;var r=n.type,i=e.getSelectedDataIndices();if(i.length>0){var o={dataIndex:i,seriesIndex:e.seriesIndex};null!=r&&(o.dataType=r),t.push(o)}}))})),t}function uu(e,t,n){gu(e,!0),Wl(e,Yl),hu(e,t,n)}function cu(e,t,n,r){r?function(e){gu(e,!1)}(e):uu(e,t,n)}function hu(e,t,n){var r=bl(e);null!=t?(r.focus=t,r.blurScope=n):r.focus&&(r.focus=null)}var du=["emphasis","blur","select"],pu={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function fu(e,t,n,r){n=n||"itemStyle";for(var i=0;i<du.length;i++){var o=du[i],a=t.getModel([o,n]);e.ensureState(o).style=r?r(a):a[pu[n]]()}}function gu(e,t){var n=!1===t,r=e;e.highDownSilentOnTouch&&(r.__highDownSilentOnTouch=e.highDownSilentOnTouch),n&&!r.__highDownDispatcher||(r.__highByOuter=r.__highByOuter||0,r.__highDownDispatcher=!n)}function mu(e){return!(!e||!e.__highDownDispatcher)}function vu(e){var t=e.type;return t===Nl||t===Pl||t===Ol}function yu(e){var t=e.type;return t===El||t===Ll}var _u=Ds.CMD,xu=[[],[],[]],bu=Math.sqrt,wu=Math.atan2;function Su(e,t){if(t){var n,r,i,o,a,s,l=e.data,u=e.len(),c=_u.M,h=_u.C,d=_u.L,p=_u.R,f=_u.A,g=_u.Q;for(i=0,o=0;i<u;){switch(n=l[i++],o=i,r=0,n){case c:case d:r=1;break;case h:r=3;break;case g:r=2;break;case f:var m=t[4],v=t[5],y=bu(t[0]*t[0]+t[1]*t[1]),_=bu(t[2]*t[2]+t[3]*t[3]),x=wu(-t[1]/_,t[0]/y);l[i]*=y,l[i++]+=m,l[i]*=_,l[i++]+=v,l[i++]*=y,l[i++]*=_,l[i++]+=x,l[i++]+=x,o=i+=2;break;case p:s[0]=l[i++],s[1]=l[i++],Ke(s,s,t),l[o++]=s[0],l[o++]=s[1],s[0]+=l[i++],s[1]+=l[i++],Ke(s,s,t),l[o++]=s[0],l[o++]=s[1]}for(a=0;a<r;a++){var b=xu[a];b[0]=l[i++],b[1]=l[i++],Ke(b,b,t),l[o++]=b[0],l[o++]=b[1]}}e.increaseVersion()}}var Tu=Math.sqrt,Mu=Math.sin,Cu=Math.cos,Du=Math.PI;function Au(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Iu(e,t){return(e[0]*t[0]+e[1]*t[1])/(Au(e)*Au(t))}function Eu(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(Iu(e,t))}function Lu(e,t,n,r,i,o,a,s,l,u,c){var h=l*(Du/180),d=Cu(h)*(e-n)/2+Mu(h)*(t-r)/2,p=-1*Mu(h)*(e-n)/2+Cu(h)*(t-r)/2,f=d*d/(a*a)+p*p/(s*s);f>1&&(a*=Tu(f),s*=Tu(f));var g=(i===o?-1:1)*Tu((a*a*(s*s)-a*a*(p*p)-s*s*(d*d))/(a*a*(p*p)+s*s*(d*d)))||0,m=g*a*p/s,v=g*-s*d/a,y=(e+n)/2+Cu(h)*m-Mu(h)*v,_=(t+r)/2+Mu(h)*m+Cu(h)*v,x=Eu([1,0],[(d-m)/a,(p-v)/s]),b=[(d-m)/a,(p-v)/s],w=[(-1*d-m)/a,(-1*p-v)/s],S=Eu(b,w);if(Iu(b,w)<=-1&&(S=Du),Iu(b,w)>=1&&(S=0),S<0){var T=Math.round(S/Du*1e6)/1e6;S=2*Du+T%2*Du}c.addData(u,y,_,a,s,x,S,h,o)}var Nu=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Pu=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;var Ou=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.applyTransform=function(e){},t}(Ys);function Ru(e){return null!=e.setData}function ku(e,t){var n=function(e){var t=new Ds;if(!e)return t;var n,r=0,i=0,o=r,a=i,s=Ds.CMD,l=e.match(Nu);if(!l)return t;for(var u=0;u<l.length;u++){for(var c=l[u],h=c.charAt(0),d=void 0,p=c.match(Pu)||[],f=p.length,g=0;g<f;g++)p[g]=parseFloat(p[g]);for(var m=0;m<f;){var v=void 0,y=void 0,_=void 0,x=void 0,b=void 0,w=void 0,S=void 0,T=r,M=i,C=void 0,D=void 0;switch(h){case"l":r+=p[m++],i+=p[m++],d=s.L,t.addData(d,r,i);break;case"L":r=p[m++],i=p[m++],d=s.L,t.addData(d,r,i);break;case"m":r+=p[m++],i+=p[m++],d=s.M,t.addData(d,r,i),o=r,a=i,h="l";break;case"M":r=p[m++],i=p[m++],d=s.M,t.addData(d,r,i),o=r,a=i,h="L";break;case"h":r+=p[m++],d=s.L,t.addData(d,r,i);break;case"H":r=p[m++],d=s.L,t.addData(d,r,i);break;case"v":i+=p[m++],d=s.L,t.addData(d,r,i);break;case"V":i=p[m++],d=s.L,t.addData(d,r,i);break;case"C":d=s.C,t.addData(d,p[m++],p[m++],p[m++],p[m++],p[m++],p[m++]),r=p[m-2],i=p[m-1];break;case"c":d=s.C,t.addData(d,p[m++]+r,p[m++]+i,p[m++]+r,p[m++]+i,p[m++]+r,p[m++]+i),r+=p[m-2],i+=p[m-1];break;case"S":v=r,y=i,C=t.len(),D=t.data,n===s.C&&(v+=r-D[C-4],y+=i-D[C-3]),d=s.C,T=p[m++],M=p[m++],r=p[m++],i=p[m++],t.addData(d,v,y,T,M,r,i);break;case"s":v=r,y=i,C=t.len(),D=t.data,n===s.C&&(v+=r-D[C-4],y+=i-D[C-3]),d=s.C,T=r+p[m++],M=i+p[m++],r+=p[m++],i+=p[m++],t.addData(d,v,y,T,M,r,i);break;case"Q":T=p[m++],M=p[m++],r=p[m++],i=p[m++],d=s.Q,t.addData(d,T,M,r,i);break;case"q":T=p[m++]+r,M=p[m++]+i,r+=p[m++],i+=p[m++],d=s.Q,t.addData(d,T,M,r,i);break;case"T":v=r,y=i,C=t.len(),D=t.data,n===s.Q&&(v+=r-D[C-4],y+=i-D[C-3]),r=p[m++],i=p[m++],d=s.Q,t.addData(d,v,y,r,i);break;case"t":v=r,y=i,C=t.len(),D=t.data,n===s.Q&&(v+=r-D[C-4],y+=i-D[C-3]),r+=p[m++],i+=p[m++],d=s.Q,t.addData(d,v,y,r,i);break;case"A":_=p[m++],x=p[m++],b=p[m++],w=p[m++],S=p[m++],Lu(T=r,M=i,r=p[m++],i=p[m++],w,S,_,x,b,d=s.A,t);break;case"a":_=p[m++],x=p[m++],b=p[m++],w=p[m++],S=p[m++],Lu(T=r,M=i,r+=p[m++],i+=p[m++],w,S,_,x,b,d=s.A,t)}}"z"!==h&&"Z"!==h||(d=s.Z,t.addData(d),r=o,i=a),n=d}return t.toStatic(),t}(e),r=z({},t);return r.buildPath=function(e){if(Ru(e)){e.setData(n.data),(t=e.getContext())&&e.rebuildPath(t,1)}else{var t=e;n.rebuildPath(t,1)}},r.applyTransform=function(e){Su(n,e),this.dirtyShape()},r}function zu(e,t){return new Ou(ku(e,t))}function Vu(e,t){t=t||{};var n=new Ys;return e.shape&&n.setShape(e.shape),n.setStyle(e.style),t.bakeTransform?Su(n.path,e.getComputedTransform()):t.toLocal?n.setLocalTransform(e.getComputedTransform()):n.copyTransform(e),n.buildPath=e.buildPath,n.applyTransform=n.applyTransform,n.z=e.z,n.z2=e.z2,n.zlevel=e.zlevel,n}var Bu=function(){this.cx=0,this.cy=0,this.r=0},Fu=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultShape=function(){return new Bu},t.prototype.buildPath=function(e,t){e.moveTo(t.cx+t.r,t.cy),e.arc(t.cx,t.cy,t.r,0,2*Math.PI)},t}(Ys);Fu.prototype.type="circle";var Gu=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},Hu=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultShape=function(){return new Gu},t.prototype.buildPath=function(e,t){var n=.5522848,r=t.cx,i=t.cy,o=t.rx,a=t.ry,s=o*n,l=a*n;e.moveTo(r-o,i),e.bezierCurveTo(r-o,i-l,r-s,i-a,r,i-a),e.bezierCurveTo(r+s,i-a,r+o,i-l,r+o,i),e.bezierCurveTo(r+o,i+l,r+s,i+a,r,i+a),e.bezierCurveTo(r-s,i+a,r-o,i+l,r-o,i),e.closePath()},t}(Ys);Hu.prototype.type="ellipse";var Uu=Math.PI,Wu=2*Uu,ju=Math.sin,Xu=Math.cos,Yu=Math.acos,Zu=Math.atan2,qu=Math.abs,Ku=Math.sqrt,$u=Math.max,Ju=Math.min,Qu=1e-4;function ec(e,t,n,r,i,o,a){var s=e-n,l=t-r,u=(a?o:-o)/Ku(s*s+l*l),c=u*l,h=-u*s,d=e+c,p=t+h,f=n+c,g=r+h,m=(d+f)/2,v=(p+g)/2,y=f-d,_=g-p,x=y*y+_*_,b=i-o,w=d*g-f*p,S=(_<0?-1:1)*Ku($u(0,b*b*x-w*w)),T=(w*_-y*S)/x,M=(-w*y-_*S)/x,C=(w*_+y*S)/x,D=(-w*y+_*S)/x,A=T-m,I=M-v,E=C-m,L=D-v;return A*A+I*I>E*E+L*L&&(T=C,M=D),{cx:T,cy:M,x0:-c,y0:-h,x1:T*(i/b-1),y1:M*(i/b-1)}}function tc(e,t){var n,r=$u(t.r,0),i=$u(t.r0||0,0),o=r>0;if(o||i>0){if(o||(r=i,i=0),i>r){var a=r;r=i,i=a}var s=t.startAngle,l=t.endAngle;if(!isNaN(s)&&!isNaN(l)){var u=t.cx,c=t.cy,h=!!t.clockwise,d=qu(l-s),p=d>Wu&&d%Wu;if(p>Qu&&(d=p),r>Qu)if(d>Wu-Qu)e.moveTo(u+r*Xu(s),c+r*ju(s)),e.arc(u,c,r,s,l,!h),i>Qu&&(e.moveTo(u+i*Xu(l),c+i*ju(l)),e.arc(u,c,i,l,s,h));else{var f=void 0,g=void 0,m=void 0,v=void 0,y=void 0,_=void 0,x=void 0,b=void 0,w=void 0,S=void 0,T=void 0,M=void 0,C=void 0,D=void 0,A=void 0,I=void 0,E=r*Xu(s),L=r*ju(s),N=i*Xu(l),P=i*ju(l),O=d>Qu;if(O){var R=t.cornerRadius;R&&(n=function(e){var t;if(J(e)){var n=e.length;if(!n)return e;t=1===n?[e[0],e[0],0,0]:2===n?[e[0],e[0],e[1],e[1]]:3===n?e.concat(e[2]):e}else t=[e,e,e,e];return t}(R),f=n[0],g=n[1],m=n[2],v=n[3]);var k=qu(r-i)/2;if(y=Ju(k,m),_=Ju(k,v),x=Ju(k,f),b=Ju(k,g),T=w=$u(y,_),M=S=$u(x,b),(w>Qu||S>Qu)&&(C=r*Xu(l),D=r*ju(l),A=i*Xu(s),I=i*ju(s),d<Uu)){var z=function(e,t,n,r,i,o,a,s){var l=n-e,u=r-t,c=a-i,h=s-o,d=h*l-c*u;if(!(d*d<Qu))return[e+(d=(c*(t-o)-h*(e-i))/d)*l,t+d*u]}(E,L,A,I,C,D,N,P);if(z){var V=E-z[0],B=L-z[1],F=C-z[0],G=D-z[1],H=1/ju(Yu((V*F+B*G)/(Ku(V*V+B*B)*Ku(F*F+G*G)))/2),U=Ku(z[0]*z[0]+z[1]*z[1]);T=Ju(w,(r-U)/(H+1)),M=Ju(S,(i-U)/(H-1))}}}if(O)if(T>Qu){var W=Ju(m,T),j=Ju(v,T),X=ec(A,I,E,L,r,W,h),Y=ec(C,D,N,P,r,j,h);e.moveTo(u+X.cx+X.x0,c+X.cy+X.y0),T<w&&W===j?e.arc(u+X.cx,c+X.cy,T,Zu(X.y0,X.x0),Zu(Y.y0,Y.x0),!h):(W>0&&e.arc(u+X.cx,c+X.cy,W,Zu(X.y0,X.x0),Zu(X.y1,X.x1),!h),e.arc(u,c,r,Zu(X.cy+X.y1,X.cx+X.x1),Zu(Y.cy+Y.y1,Y.cx+Y.x1),!h),j>0&&e.arc(u+Y.cx,c+Y.cy,j,Zu(Y.y1,Y.x1),Zu(Y.y0,Y.x0),!h))}else e.moveTo(u+E,c+L),e.arc(u,c,r,s,l,!h);else e.moveTo(u+E,c+L);if(i>Qu&&O)if(M>Qu){W=Ju(f,M),X=ec(N,P,C,D,i,-(j=Ju(g,M)),h),Y=ec(E,L,A,I,i,-W,h);e.lineTo(u+X.cx+X.x0,c+X.cy+X.y0),M<S&&W===j?e.arc(u+X.cx,c+X.cy,M,Zu(X.y0,X.x0),Zu(Y.y0,Y.x0),!h):(j>0&&e.arc(u+X.cx,c+X.cy,j,Zu(X.y0,X.x0),Zu(X.y1,X.x1),!h),e.arc(u,c,i,Zu(X.cy+X.y1,X.cx+X.x1),Zu(Y.cy+Y.y1,Y.cx+Y.x1),h),W>0&&e.arc(u+Y.cx,c+Y.cy,W,Zu(Y.y1,Y.x1),Zu(Y.y0,Y.x0),!h))}else e.lineTo(u+N,c+P),e.arc(u,c,i,l,s,h);else e.lineTo(u+N,c+P)}else e.moveTo(u,c);e.closePath()}}}var nc=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},rc=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultShape=function(){return new nc},t.prototype.buildPath=function(e,t){tc(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(Ys);rc.prototype.type="sector";var ic=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},oc=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultShape=function(){return new ic},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=2*Math.PI;e.moveTo(n+t.r,r),e.arc(n,r,t.r,0,i,!1),e.moveTo(n+t.r0,r),e.arc(n,r,t.r0,0,i,!0)},t}(Ys);function ac(e,t,n){var r=t.smooth,i=t.points;if(i&&i.length>=2){if(r){var o=function(e,t,n,r){var i,o,a,s,l=[],u=[],c=[],h=[];if(r){a=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,p=e.length;d<p;d++)$e(a,a,e[d]),Je(s,s,e[d]);$e(a,a,r[0]),Je(s,s,r[1])}for(d=0,p=e.length;d<p;d++){var f=e[d];if(n)i=e[d?d-1:p-1],o=e[(d+1)%p];else{if(0===d||d===p-1){l.push(Oe(e[d]));continue}i=e[d-1],o=e[d+1]}Ve(u,o,i),Ue(u,u,t);var g=je(f,i),m=je(f,o),v=g+m;0!==v&&(g/=v,m/=v),Ue(c,u,-g),Ue(h,u,m);var y=ke([],f,c),_=ke([],f,h);r&&(Je(y,y,a),$e(y,y,s),Je(_,_,a),$e(_,_,s)),l.push(y),l.push(_)}return n&&l.push(l.shift()),l}(i,r,n,t.smoothConstraint);e.moveTo(i[0][0],i[0][1]);for(var a=i.length,s=0;s<(n?a:a-1);s++){var l=o[2*s],u=o[2*s+1],c=i[(s+1)%a];e.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{e.moveTo(i[0][0],i[0][1]);s=1;for(var h=i.length;s<h;s++)e.lineTo(i[s][0],i[s][1])}n&&e.closePath()}}oc.prototype.type="ring";var sc=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},lc=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultShape=function(){return new sc},t.prototype.buildPath=function(e,t){ac(e,t,!0)},t}(Ys);lc.prototype.type="polygon";var uc=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},cc=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new uc},t.prototype.buildPath=function(e,t){ac(e,t,!1)},t}(Ys);cc.prototype.type="polyline";var hc={},dc=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},pc=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new dc},t.prototype.buildPath=function(e,t){var n,r,i,o;if(this.subPixelOptimize){var a=el(hc,t,this.style);n=a.x1,r=a.y1,i=a.x2,o=a.y2}else n=t.x1,r=t.y1,i=t.x2,o=t.y2;var s=t.percent;0!==s&&(e.moveTo(n,r),s<1&&(i=n*(1-s)+i*s,o=r*(1-s)+o*s),e.lineTo(i,o))},t.prototype.pointAt=function(e){var t=this.shape;return[t.x1*(1-e)+t.x2*e,t.y1*(1-e)+t.y2*e]},t}(Ys);pc.prototype.type="line";var fc=[],gc=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1};function mc(e,t,n){var r=e.cpx2,i=e.cpy2;return null!=r||null!=i?[(n?Dn:Cn)(e.x1,e.cpx1,e.cpx2,e.x2,t),(n?Dn:Cn)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(n?On:Pn)(e.x1,e.cpx1,e.x2,t),(n?On:Pn)(e.y1,e.cpy1,e.y2,t)]}var vc=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new gc},t.prototype.buildPath=function(e,t){var n=t.x1,r=t.y1,i=t.x2,o=t.y2,a=t.cpx1,s=t.cpy1,l=t.cpx2,u=t.cpy2,c=t.percent;0!==c&&(e.moveTo(n,r),null==l||null==u?(c<1&&(kn(n,a,i,c,fc),a=fc[1],i=fc[2],kn(r,s,o,c,fc),s=fc[1],o=fc[2]),e.quadraticCurveTo(a,s,i,o)):(c<1&&(En(n,a,l,i,c,fc),a=fc[1],l=fc[2],i=fc[3],En(r,s,u,o,c,fc),s=fc[1],u=fc[2],o=fc[3]),e.bezierCurveTo(a,s,l,u,i,o)))},t.prototype.pointAt=function(e){return mc(this.shape,e,!1)},t.prototype.tangentAt=function(e){var t=mc(this.shape,e,!0);return We(t,t)},t}(Ys);vc.prototype.type="bezier-curve";var yc=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},_c=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new yc},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r,0),o=t.startAngle,a=t.endAngle,s=t.clockwise,l=Math.cos(o),u=Math.sin(o);e.moveTo(l*i+n,u*i+r),e.arc(n,r,i,o,a,!s)},t}(Ys);_c.prototype.type="arc";var xc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="compound",t}return l(t,e),t.prototype._updatePathDirty=function(){for(var e=this.shape.paths,t=this.shapeChanged(),n=0;n<e.length;n++)t=t||e[n].shapeChanged();t&&this.dirtyShape()},t.prototype.beforeBrush=function(){this._updatePathDirty();for(var e=this.shape.paths||[],t=this.getGlobalScale(),n=0;n<e.length;n++)e[n].path||e[n].createPathProxy(),e[n].path.setScale(t[0],t[1],e[n].segmentIgnoreThreshold)},t.prototype.buildPath=function(e,t){for(var n=t.paths||[],r=0;r<n.length;r++)n[r].buildPath(e,n[r].shape,!0)},t.prototype.afterBrush=function(){for(var e=this.shape.paths||[],t=0;t<e.length;t++)e[t].pathUpdated()},t.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),Ys.prototype.getBoundingRect.call(this)},t}(Ys),bc=function(){function e(e){this.colorStops=e||[]}return e.prototype.addColorStop=function(e,t){this.colorStops.push({offset:e,color:t})},e}(),wc=function(e){function t(t,n,r,i,o,a){var s=e.call(this,o)||this;return s.x=null==t?0:t,s.y=null==n?0:n,s.x2=null==r?1:r,s.y2=null==i?0:i,s.type="linear",s.global=a||!1,s}return l(t,e),t}(bc),Sc=function(e){function t(t,n,r,i,o){var a=e.call(this,i)||this;return a.x=null==t?.5:t,a.y=null==n?.5:n,a.r=null==r?.5:r,a.type="radial",a.global=o||!1,a}return l(t,e),t}(bc),Tc=[0,0],Mc=[0,0],Cc=new kt,Dc=new kt,Ac=function(){function e(e,t){this._corners=[],this._axes=[],this._origin=[0,0];for(var n=0;n<4;n++)this._corners[n]=new kt;for(n=0;n<2;n++)this._axes[n]=new kt;e&&this.fromBoundingRect(e,t)}return e.prototype.fromBoundingRect=function(e,t){var n=this._corners,r=this._axes,i=e.x,o=e.y,a=i+e.width,s=o+e.height;if(n[0].set(i,o),n[1].set(a,o),n[2].set(a,s),n[3].set(i,s),t)for(var l=0;l<4;l++)n[l].transform(t);kt.sub(r[0],n[1],n[0]),kt.sub(r[1],n[3],n[0]),r[0].normalize(),r[1].normalize();for(l=0;l<2;l++)this._origin[l]=r[l].dot(n[0])},e.prototype.intersect=function(e,t){var n=!0,r=!t;return Cc.set(1/0,1/0),Dc.set(0,0),!this._intersectCheckOneSide(this,e,Cc,Dc,r,1)&&(n=!1,r)||!this._intersectCheckOneSide(e,this,Cc,Dc,r,-1)&&(n=!1,r)||r||kt.copy(t,n?Cc:Dc),n},e.prototype._intersectCheckOneSide=function(e,t,n,r,i,o){for(var a=!0,s=0;s<2;s++){var l=this._axes[s];if(this._getProjMinMaxOnAxis(s,e._corners,Tc),this._getProjMinMaxOnAxis(s,t._corners,Mc),Tc[1]<Mc[0]||Tc[0]>Mc[1]){if(a=!1,i)return a;var u=Math.abs(Mc[0]-Tc[1]),c=Math.abs(Tc[0]-Mc[1]);Math.min(u,c)>r.len()&&(u<c?kt.scale(r,l,-u*o):kt.scale(r,l,c*o))}else if(n){u=Math.abs(Mc[0]-Tc[1]),c=Math.abs(Tc[0]-Mc[1]);Math.min(u,c)<n.len()&&(u<c?kt.scale(n,l,u*o):kt.scale(n,l,-c*o))}}return a},e.prototype._getProjMinMaxOnAxis=function(e,t,n){for(var r=this._axes[e],i=this._origin,o=t[0].dot(r)+i[e],a=o,s=o,l=1;l<t.length;l++){var u=t[l].dot(r)+i[e];a=Math.min(u,a),s=Math.max(u,s)}n[0]=a,n[1]=s},e}(),Ic=[],Ec=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.notClear=!0,t.incremental=!0,t._displayables=[],t._temporaryDisplayables=[],t._cursor=0,t}return l(t,e),t.prototype.traverse=function(e,t){e.call(t,this)},t.prototype.useStyle=function(){this.style={}},t.prototype.getCursor=function(){return this._cursor},t.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},t.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},t.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},t.prototype.addDisplayable=function(e,t){t?this._temporaryDisplayables.push(e):this._displayables.push(e),this.markRedraw()},t.prototype.addDisplayables=function(e,t){t=t||!1;for(var n=0;n<e.length;n++)this.addDisplayable(e[n],t)},t.prototype.getDisplayables=function(){return this._displayables},t.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},t.prototype.eachPendingDisplayable=function(e){for(var t=this._cursor;t<this._displayables.length;t++)e&&e(this._displayables[t]);for(t=0;t<this._temporaryDisplayables.length;t++)e&&e(this._temporaryDisplayables[t])},t.prototype.update=function(){this.updateTransform();for(var e=this._cursor;e<this._displayables.length;e++){(t=this._displayables[e]).parent=this,t.update(),t.parent=null}for(e=0;e<this._temporaryDisplayables.length;e++){var t;(t=this._temporaryDisplayables[e]).parent=this,t.update(),t.parent=null}},t.prototype.getBoundingRect=function(){if(!this._rect){for(var e=new jt(1/0,1/0,-1/0,-1/0),t=0;t<this._displayables.length;t++){var n=this._displayables[t],r=n.getBoundingRect().clone();n.needLocalTransform()&&r.applyTransform(n.getLocalTransform(Ic)),e.union(r)}this._rect=e}return this._rect},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t);if(this.getBoundingRect().contain(n[0],n[1]))for(var r=0;r<this._displayables.length;r++){if(this._displayables[r].contain(e,t))return!0}return!1},t}(ja),Lc=ta();function Nc(e,t,n,r,i){var o;if(t&&t.ecModel){var a=t.ecModel.getUpdatePayload();o=a&&a.animation}var s="update"===e;if(t&&t.isAnimationEnabled()){var l=void 0,u=void 0,c=void 0;return r?(l=de(r.duration,200),u=de(r.easing,"cubicOut"),c=0):(l=t.getShallow(s?"animationDurationUpdate":"animationDuration"),u=t.getShallow(s?"animationEasingUpdate":"animationEasing"),c=t.getShallow(s?"animationDelayUpdate":"animationDelay")),o&&(null!=o.duration&&(l=o.duration),null!=o.easing&&(u=o.easing),null!=o.delay&&(c=o.delay)),Q(c)&&(c=c(n,i)),Q(l)&&(l=l(n)),{duration:l||0,delay:c,easing:u}}return null}function Pc(e,t,n,r,i,o,a){var s,l=!1;Q(i)?(a=o,o=i,i=null):re(i)&&(o=i.cb,a=i.during,l=i.isFrom,s=i.removeOpt,i=i.dataIndex);var u="leave"===e;u||t.stopAnimation("leave");var c=Nc(e,r,i,u?s||{}:null,r&&r.getAnimationDelayParams?r.getAnimationDelayParams(t,i):null);if(c&&c.duration>0){var h={duration:c.duration,delay:c.delay||0,easing:c.easing,done:o,force:!!o||!!a,setToFinal:!u,scope:e,during:a};l?t.animateFrom(n,h):t.animateTo(n,h)}else t.stopAnimation(),!l&&t.attr(n),a&&a(1),o&&o()}function Oc(e,t,n,r,i,o){Pc("update",e,t,n,r,i,o)}function Rc(e,t,n,r,i,o){Pc("enter",e,t,n,r,i,o)}function kc(e){if(!e.__zr)return!0;for(var t=0;t<e.animators.length;t++){if("leave"===e.animators[t].scope)return!0}return!1}function zc(e,t,n,r,i,o){kc(e)||Pc("leave",e,t,n,r,i,o)}function Vc(e,t,n,r){e.removeTextContent(),e.removeTextGuideLine(),zc(e,{style:{opacity:0}},t,n,r)}function Bc(e,t,n){function r(){e.parent&&e.parent.remove(e)}e.isGroup?e.traverse((function(e){e.isGroup||Vc(e,t,n,r)})):Vc(e,t,n,r)}function Fc(e){Lc(e).oldStyle=e.style}var Gc=Math.max,Hc=Math.min,Uc={};function Wc(e){return Ys.extend(e)}var jc=function(e,t){var n=ku(e,t);return function(e){function t(t){var r=e.call(this,t)||this;return r.applyTransform=n.applyTransform,r.buildPath=n.buildPath,r}return l(t,e),t}(Ou)};function Xc(e,t){return jc(e,t)}function Yc(e,t){Uc[e]=t}function Zc(e){if(Uc.hasOwnProperty(e))return Uc[e]}function qc(e,t,n,r){var i=zu(e,t);return n&&("center"===r&&(n=$c(n,i.getBoundingRect())),Qc(i,n)),i}function Kc(e,t,n){var r=new Js({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if("center"===n){var i={width:e.width,height:e.height};r.setStyle($c(t,i))}}});return r}function $c(e,t){var n,r=t.width/t.height,i=e.height*r;return n=i<=e.width?e.height:(i=e.width)/r,{x:e.x+e.width/2-i/2,y:e.y+e.height/2-n/2,width:i,height:n}}var Jc=function(e,t){for(var n=[],r=e.length,i=0;i<r;i++){var o=e[i];n.push(o.getUpdatedPathProxy(!0))}var a=new Ys(t);return a.createPathProxy(),a.buildPath=function(e){if(Ru(e)){e.appendPath(n);var t=e.getContext();t&&e.rebuildPath(t,1)}},a};function Qc(e,t){if(e.applyTransform){var n=e.getBoundingRect().calculateTransform(t);e.applyTransform(n)}}function eh(e,t){return el(e,e,{lineWidth:t}),e}var th=nl;function nh(e,t){for(var n=Dt([]);e&&e!==t;)It(n,e.getLocalTransform(),n),e=e.parent;return n}function rh(e,t,n){return t&&!U(t)&&(t=Mi.getLocalTransform(t)),n&&(t=Pt([],t)),Ke([],e,t)}function ih(e,t,n){var r=0===t[4]||0===t[5]||0===t[0]?1:Math.abs(2*t[4]/t[0]),i=0===t[4]||0===t[5]||0===t[2]?1:Math.abs(2*t[4]/t[2]),o=["left"===e?-r:"right"===e?r:0,"top"===e?-i:"bottom"===e?i:0];return o=rh(o,t,n),Math.abs(o[0])>Math.abs(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"}function oh(e){return!e.isGroup}function ah(e,t,n){if(e&&t){var r=function(e){var t={};return e.traverse((function(e){oh(e)&&e.anid&&(t[e.anid]=e)})),t}(e);t.traverse((function(e){if(oh(e)&&e.anid){var t=r[e.anid];if(t){var o=i(e);e.attr(i(t)),Oc(e,o,n,bl(e).dataIndex)}}}))}function i(e){var t={x:e.x,y:e.y,rotation:e.rotation};return function(e){return null!=e.shape}(e)&&(t.shape=z({},e.shape)),t}}function sh(e,t){return j(e,(function(e){var n=e[0];n=Gc(n,t.x),n=Hc(n,t.x+t.width);var r=e[1];return r=Gc(r,t.y),[n,r=Hc(r,t.y+t.height)]}))}function lh(e,t){var n=Gc(e.x,t.x),r=Hc(e.x+e.width,t.x+t.width),i=Gc(e.y,t.y),o=Hc(e.y+e.height,t.y+t.height);if(r>=n&&o>=i)return{x:n,y:i,width:r-n,height:o-i}}function uh(e,t,n){var r=z({rectHover:!0},t),i=r.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},e)return 0===e.indexOf("image://")?(i.image=e.slice(8),V(i,n),new Js(r)):qc(e.replace("path://",""),r,n,"center")}function ch(e,t,n,r,i){for(var o=0,a=i[i.length-1];o<i.length;o++){var s=i[o];if(hh(e,t,n,r,s[0],s[1],a[0],a[1]))return!0;a=s}}function hh(e,t,n,r,i,o,a,s){var l,u=n-e,c=r-t,h=a-i,d=s-o,p=dh(h,d,u,c);if((l=p)<=1e-6&&l>=-1e-6)return!1;var f=e-i,g=t-o,m=dh(f,g,u,c)/p;if(m<0||m>1)return!1;var v=dh(f,g,h,d)/p;return!(v<0||v>1)}function dh(e,t,n,r){return e*r-n*t}function ph(e){var t=e.itemTooltipOption,n=e.componentModel,r=e.itemName,i=ee(t)?{formatter:t}:t,o=n.mainType,a=n.componentIndex,s={componentType:o,name:r,$vars:["name"]};s[o+"Index"]=a;var l=e.formatterParamsExtra;l&&W(q(l),(function(e){Ae(s,e)||(s[e]=l[e],s.$vars.push(e))}));var u=bl(e.el);u.componentMainType=o,u.componentIndex=a,u.tooltipConfig={name:r,option:V({content:r,encodeHTMLContent:!0,formatterParams:s},i)}}function fh(e,t){var n;e.isGroup&&(n=t(e)),n||e.traverse(t)}function gh(e,t){if(e)if(J(e))for(var n=0;n<e.length;n++)fh(e[n],t);else fh(e,t)}Yc("circle",Fu),Yc("ellipse",Hu),Yc("sector",rc),Yc("ring",oc),Yc("polygon",lc),Yc("polyline",cc),Yc("rect",ol),Yc("line",pc),Yc("bezierCurve",vc),Yc("arc",_c);var mh=Object.freeze({__proto__:null,Arc:_c,BezierCurve:vc,BoundingRect:jt,Circle:Fu,CompoundPath:xc,Ellipse:Hu,Group:Yi,Image:Js,IncrementalDisplayable:Ec,Line:pc,LinearGradient:wc,OrientedBoundingRect:Ac,Path:Ys,Point:kt,Polygon:lc,Polyline:cc,RadialGradient:Sc,Rect:ol,Ring:oc,Sector:rc,Text:ll,applyTransform:rh,clipPointsByRect:sh,clipRectByRect:lh,createIcon:uh,extendPath:Xc,extendShape:Wc,getShapeClass:Zc,getTransform:nh,groupTransition:ah,initProps:Rc,isElementRemoved:kc,lineLineIntersect:hh,linePolygonIntersect:ch,makeImage:Kc,makePath:qc,mergePath:Jc,registerShape:Yc,removeElement:zc,removeElementWithFadeOut:Bc,resizePath:Qc,setTooltipConfig:ph,subPixelOptimize:th,subPixelOptimizeLine:eh,subPixelOptimizeRect:function(e){return tl(e.shape,e.shape,e.style),e},transformDirection:ih,traverseElements:gh,updateProps:Oc}),vh={};function yh(e,t){for(var n=0;n<Dl.length;n++){var r=Dl[n],i=t[r],o=e.ensureState(r);o.style=o.style||{},o.style.text=i}var a=e.currentStates.slice();e.clearStates(!0),e.setStyle({text:t.normal}),e.useStates(a,!0)}function _h(e,t,n){var r,i=e.labelFetcher,o=e.labelDataIndex,a=e.labelDimIndex,s=t.normal;i&&(r=i.getFormattedLabel(o,"normal",null,a,s&&s.get("formatter"),null!=n?{interpolatedValue:n}:null)),null==r&&(r=Q(e.defaultText)?e.defaultText(o,e,n):e.defaultText);for(var l={normal:r},u=0;u<Dl.length;u++){var c=Dl[u],h=t[c];l[c]=de(i?i.getFormattedLabel(o,c,null,a,h&&h.get("formatter")):null,r)}return l}function xh(e,t,n,r){n=n||vh;for(var i=e instanceof ll,o=!1,a=0;a<Al.length;a++){if((d=t[Al[a]])&&d.getShallow("show")){o=!0;break}}var s=i?e:e.getTextContent();if(o){i||(s||(s=new ll,e.setTextContent(s)),e.stateProxy&&(s.stateProxy=e.stateProxy));var l=_h(n,t),u=t.normal,c=!!u.getShallow("show"),h=wh(u,r&&r.normal,n,!1,!i);h.text=l.normal,i||e.setTextConfig(Sh(u,n,!1));for(a=0;a<Dl.length;a++){var d,p=Dl[a];if(d=t[p]){var f=s.ensureState(p),g=!!de(d.getShallow("show"),c);if(g!==c&&(f.ignore=!g),f.style=wh(d,r&&r[p],n,!0,!i),f.style.text=l[p],!i)e.ensureState(p).textConfig=Sh(d,n,!0)}}s.silent=!!u.getShallow("silent"),null!=s.style.x&&(h.x=s.style.x),null!=s.style.y&&(h.y=s.style.y),s.ignore=!c,s.useStyle(h),s.dirty(),n.enableTextSetter&&(Ih(s).setLabelText=function(e){var r=_h(n,t,e);yh(s,r)})}else s&&(s.ignore=!0);e.dirty()}function bh(e,t){t=t||"label";for(var n={normal:e.getModel(t)},r=0;r<Dl.length;r++){var i=Dl[r];n[i]=e.getModel([i,t])}return n}function wh(e,t,n,r,i){var o={};return function(e,t,n,r,i){n=n||vh;var o,a=t.ecModel,s=a&&a.option.textStyle,l=function(e){var t;for(;e&&e!==e.ecModel;){var n=(e.option||vh).rich;if(n){t=t||{};for(var r=q(n),i=0;i<r.length;i++){t[r[i]]=1}}e=e.parentModel}return t}(t);if(l)for(var u in o={},l)if(l.hasOwnProperty(u)){var c=t.getModel(["rich",u]);Dh(o[u]={},c,s,n,r,i,!1,!0)}o&&(e.rich=o);var h=t.get("overflow");h&&(e.overflow=h);var d=t.get("minMargin");null!=d&&(e.margin=d);Dh(e,t,s,n,r,i,!0,!1)}(o,e,n,r,i),t&&z(o,t),o}function Sh(e,t,n){t=t||{};var r,i={},o=e.getShallow("rotate"),a=de(e.getShallow("distance"),n?null:5),s=e.getShallow("offset");return"outside"===(r=e.getShallow("position")||(n?null:"inside"))&&(r=t.defaultOutsidePosition||"top"),null!=r&&(i.position=r),null!=s&&(i.offset=s),null!=o&&(o*=Math.PI/180,i.rotation=o),null!=a&&(i.distance=a),i.outsideFill="inherit"===e.get("color")?t.inheritColor||null:"auto",i}var Th=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],Mh=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],Ch=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function Dh(e,t,n,r,i,o,a,s){n=!i&&n||vh;var l=r&&r.inheritColor,u=t.getShallow("color"),c=t.getShallow("textBorderColor"),h=de(t.getShallow("opacity"),n.opacity);"inherit"!==u&&"auto"!==u||("production"!==process.env.NODE_ENV&&"auto"===u&&Ro("color: 'auto'","color: 'inherit'"),u=l||null),"inherit"!==c&&"auto"!==c||("production"!==process.env.NODE_ENV&&"auto"===c&&Ro("color: 'auto'","color: 'inherit'"),c=l||null),o||(u=u||n.color,c=c||n.textBorderColor),null!=u&&(e.fill=u),null!=c&&(e.stroke=c);var d=de(t.getShallow("textBorderWidth"),n.textBorderWidth);null!=d&&(e.lineWidth=d);var p=de(t.getShallow("textBorderType"),n.textBorderType);null!=p&&(e.lineDash=p);var f=de(t.getShallow("textBorderDashOffset"),n.textBorderDashOffset);null!=f&&(e.lineDashOffset=f),i||null!=h||s||(h=r&&r.defaultOpacity),null!=h&&(e.opacity=h),i||o||null==e.fill&&r.inheritColor&&(e.fill=r.inheritColor);for(var g=0;g<Th.length;g++){var m=Th[g];null!=(y=de(t.getShallow(m),n[m]))&&(e[m]=y)}for(g=0;g<Mh.length;g++){m=Mh[g];null!=(y=t.getShallow(m))&&(e[m]=y)}if(null==e.verticalAlign){var v=t.getShallow("baseline");null!=v&&(e.verticalAlign=v)}if(!a||!r.disableBox){for(g=0;g<Ch.length;g++){var y;m=Ch[g];null!=(y=t.getShallow(m))&&(e[m]=y)}var _=t.getShallow("borderType");null!=_&&(e.borderDash=_),"auto"!==e.backgroundColor&&"inherit"!==e.backgroundColor||!l||("production"!==process.env.NODE_ENV&&"auto"===e.backgroundColor&&Ro("backgroundColor: 'auto'","backgroundColor: 'inherit'"),e.backgroundColor=l),"auto"!==e.borderColor&&"inherit"!==e.borderColor||!l||("production"!==process.env.NODE_ENV&&"auto"===e.borderColor&&Ro("borderColor: 'auto'","borderColor: 'inherit'"),e.borderColor=l)}}function Ah(e,t){var n=t&&t.getModel("textStyle");return ve([e.fontStyle||n&&n.getShallow("fontStyle")||"",e.fontWeight||n&&n.getShallow("fontWeight")||"",(e.fontSize||n&&n.getShallow("fontSize")||12)+"px",e.fontFamily||n&&n.getShallow("fontFamily")||"sans-serif"].join(" "))}var Ih=ta();function Eh(e,t,n,r){if(e){var i=Ih(e);i.prevValue=i.value,i.value=n;var o=t.normal;i.valueAnimation=o.get("valueAnimation"),i.valueAnimation&&(i.precision=o.get("precision"),i.defaultInterpolatedText=r,i.statesModels=t)}}function Lh(e,t,n,r,i){var o=Ih(e);if(o.valueAnimation&&o.prevValue!==o.value){var a=o.defaultInterpolatedText,s=de(o.interpolatedValue,o.prevValue),l=o.value;e.percent=0,(null==o.prevValue?Rc:Oc)(e,{percent:1},r,t,null,(function(r){var u=ca(n,o.precision,s,l,r);o.interpolatedValue=1===r?null:u;var c=_h({labelDataIndex:t,labelFetcher:i,defaultText:a?a(u):u+""},o.statesModels,u);yh(e,c)}))}}var Nh,Ph,Oh=["textStyle","color"],Rh=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],kh=new ll,zh=function(){function e(){}return e.prototype.getTextColor=function(e){var t=this.ecModel;return this.getShallow("color")||(!e&&t?t.get(Oh):null)},e.prototype.getFont=function(){return Ah({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},e.prototype.getTextRect=function(e){for(var t={text:e,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n<Rh.length;n++)t[Rh[n]]=this.getShallow(Rh[n]);return kh.useStyle(t),kh.update(),kh.getBoundingRect()},e}(),Vh=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],Bh=xa(Vh),Fh=function(){function e(){}return e.prototype.getLineStyle=function(e){return Bh(this,e)},e}(),Gh=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],Hh=xa(Gh),Uh=function(){function e(){}return e.prototype.getItemStyle=function(e,t){return Hh(this,e,t)},e}(),Wh=function(){function e(e,t,n){this.parentModel=t,this.ecModel=n,this.option=e}return e.prototype.init=function(e,t,n){},e.prototype.mergeOption=function(e,t){R(this.option,e,!0)},e.prototype.get=function(e,t){return null==e?this.option:this._doGet(this.parsePath(e),!t&&this.parentModel)},e.prototype.getShallow=function(e,t){var n=this.option,r=null==n?n:n[e];if(null==r&&!t){var i=this.parentModel;i&&(r=i.getShallow(e))}return r},e.prototype.getModel=function(t,n){var r=null!=t,i=r?this.parsePath(t):null;return new e(r?this._doGet(i):this.option,n=n||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(i)),this.ecModel)},e.prototype.isEmpty=function(){return null==this.option},e.prototype.restoreData=function(){},e.prototype.clone=function(){return new(0,this.constructor)(O(this.option))},e.prototype.parsePath=function(e){return"string"==typeof e?e.split("."):e},e.prototype.resolveParentPath=function(e){return e},e.prototype.isAnimationEnabled=function(){if(!d.node&&this.option){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},e.prototype._doGet=function(e,t){var n=this.option;if(!e)return n;for(var r=0;r<e.length&&(!e[r]||null!=(n=n&&"object"==typeof n?n[e[r]]:null));r++);return null==n&&t&&(n=t._doGet(this.resolveParentPath(e),t.parentModel)),n},e}();fa(Wh),Nh=Wh,Ph=["__\0is_clz",ma++].join("_"),Nh.prototype[Ph]=!0,"production"!==process.env.NODE_ENV&&me(!Nh.isInstance,'The method "is" can not be defined.'),Nh.isInstance=function(e){return!(!e||!e[Ph])},H(Wh,Fh),H(Wh,Uh),H(Wh,wa),H(Wh,zh);var jh=Math.round(10*Math.random());function Xh(e){return[e||"",jh++].join("_")}function Yh(e,t){return R(R({},e,!0),t,!0)}var Zh="ZH",qh="EN",Kh=qh,$h={},Jh={},Qh=d.domSupported&&(document.documentElement.lang||navigator.language||navigator.browserLanguage||Kh).toUpperCase().indexOf(Zh)>-1?Zh:Kh;function ed(e,t){e=e.toUpperCase(),Jh[e]=new Wh(t),$h[e]=t}function td(e){return Jh[e]}ed(qh,{time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}}),ed(Zh,{time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}});var nd=1e3,rd=6e4,id=36e5,od=864e5,ad=31536e6,sd={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},ld="{yyyy}-{MM}-{dd}",ud={year:"{yyyy}",month:"{yyyy}-{MM}",day:ld,hour:ld+" "+sd.hour,minute:ld+" "+sd.minute,second:ld+" "+sd.second,millisecond:sd.none},cd=["year","month","day","hour","minute","second","millisecond"],hd=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function dd(e,t){return"0000".substr(0,t-(e+="").length)+e}function pd(e){switch(e){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return e}}function fd(e){return e===pd(e)}function gd(e,t,n,r){var i=yo(e),o=i[yd(n)](),a=i[_d(n)]()+1,s=Math.floor((a-1)/3)+1,l=i[xd(n)](),u=i["get"+(n?"UTC":"")+"Day"](),c=i[bd(n)](),h=(c-1)%12+1,d=i[wd(n)](),p=i[Sd(n)](),f=i[Td(n)](),g=c>=12?"pm":"am",m=g.toUpperCase(),v=(r instanceof Wh?r:td(r||Qh)||Jh[Kh]).getModel("time"),y=v.get("month"),_=v.get("monthAbbr"),x=v.get("dayOfWeek"),b=v.get("dayOfWeekAbbr");return(t||"").replace(/{a}/g,g+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,o+"").replace(/{yy}/g,dd(o%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,y[a-1]).replace(/{MMM}/g,_[a-1]).replace(/{MM}/g,dd(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,dd(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,x[u]).replace(/{ee}/g,b[u]).replace(/{e}/g,u+"").replace(/{HH}/g,dd(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,dd(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,dd(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,dd(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,dd(f,3)).replace(/{S}/g,f+"")}function md(e,t){var n=yo(e),r=n[_d(t)]()+1,i=n[xd(t)](),o=n[bd(t)](),a=n[wd(t)](),s=n[Sd(t)](),l=0===n[Td(t)](),u=l&&0===s,c=u&&0===a,h=c&&0===o,d=h&&1===i;return d&&1===r?"year":d?"month":h?"day":c?"hour":u?"minute":l?"second":"millisecond"}function vd(e,t,n){var r=ne(e)?yo(e):e;switch(t=t||md(e,n)){case"year":return r[yd(n)]();case"half-year":return r[_d(n)]()>=6?1:0;case"quarter":return Math.floor((r[_d(n)]()+1)/4);case"month":return r[_d(n)]();case"day":return r[xd(n)]();case"half-day":return r[bd(n)]()/24;case"hour":return r[bd(n)]();case"minute":return r[wd(n)]();case"second":return r[Sd(n)]();case"millisecond":return r[Td(n)]()}}function yd(e){return e?"getUTCFullYear":"getFullYear"}function _d(e){return e?"getUTCMonth":"getMonth"}function xd(e){return e?"getUTCDate":"getDate"}function bd(e){return e?"getUTCHours":"getHours"}function wd(e){return e?"getUTCMinutes":"getMinutes"}function Sd(e){return e?"getUTCSeconds":"getSeconds"}function Td(e){return e?"getUTCMilliseconds":"getMilliseconds"}function Md(e){return e?"setUTCFullYear":"setFullYear"}function Cd(e){return e?"setUTCMonth":"setMonth"}function Dd(e){return e?"setUTCDate":"setDate"}function Ad(e){return e?"setUTCHours":"setHours"}function Id(e){return e?"setUTCMinutes":"setMinutes"}function Ed(e){return e?"setUTCSeconds":"setSeconds"}function Ld(e){return e?"setUTCMilliseconds":"setMilliseconds"}function Nd(e){if(!Mo(e))return ee(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function Pd(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,(function(e,t){return t.toUpperCase()})),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var Od=ge;function Rd(e,t,n){function r(e){return e&&ve(e)?e:"-"}function i(e){return!(null==e||isNaN(e)||!isFinite(e))}var o="time"===t,a=e instanceof Date;if(o||a){var s=o?yo(e):e;if(!isNaN(+s))return gd(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(a)return"-"}if("ordinal"===t)return te(e)?r(e):ne(e)&&i(e)?e+"":"-";var l=To(e);return i(l)?Nd(l):te(e)?r(e):"boolean"==typeof e?e+"":"-"}var kd=["a","b","c","d","e","f","g"],zd=function(e,t){return"{"+e+(null==t?"":t)+"}"};function Vd(e,t,n){J(t)||(t=[t]);var r=t.length;if(!r)return"";for(var i=t[0].$vars||[],o=0;o<i.length;o++){var a=kd[o];e=e.replace(zd(a),zd(a,0))}for(var s=0;s<r;s++)for(var l=0;l<i.length;l++){var u=t[s][i[l]];e=e.replace(zd(kd[l],s),n?dt(u):u)}return e}function Bd(e,t){var n=ee(e)?{color:e,extraCssText:t}:e||{},r=n.color,i=n.type;t=n.extraCssText;var o=n.renderMode||"html";return r?"html"===o?"subItem"===i?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+dt(r)+";"+(t||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+dt(r)+";"+(t||"")+'"></span>':{renderMode:o,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===i?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}:""}function Fd(e,t,n){"production"!==process.env.NODE_ENV&&Ro("echarts.format.formatTime","echarts.time.format"),"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var r=yo(t),i=n?"getUTC":"get",o=r[i+"FullYear"](),a=r[i+"Month"]()+1,s=r[i+"Date"](),l=r[i+"Hours"](),u=r[i+"Minutes"](),c=r[i+"Seconds"](),h=r[i+"Milliseconds"]();return e=e.replace("MM",dd(a,2)).replace("M",a).replace("yyyy",o).replace("yy",dd(o%100+"",2)).replace("dd",dd(s,2)).replace("d",s).replace("hh",dd(l,2)).replace("h",l).replace("mm",dd(u,2)).replace("m",u).replace("ss",dd(c,2)).replace("s",c).replace("SSS",dd(h,3))}function Gd(e,t){return t=t||"transparent",ee(e)?e:re(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function Hd(e,t){if("_blank"===t||"blank"===t){var n=window.open();n.opener=null,n.location.href=e}else window.open(e,t)}var Ud=W,Wd=["left","right","top","bottom","width","height"],jd=[["width","left","right"],["height","top","bottom"]];function Xd(e,t,n,r,i){var o=0,a=0;null==r&&(r=1/0),null==i&&(i=1/0);var s=0;t.eachChild((function(l,u){var c,h,d=l.getBoundingRect(),p=t.childAt(u+1),f=p&&p.getBoundingRect();if("horizontal"===e){var g=d.width+(f?-f.x+d.x:0);(c=o+g)>r||l.newline?(o=0,c=g,a+=s+n,s=d.height):s=Math.max(s,d.height)}else{var m=d.height+(f?-f.y+d.y:0);(h=a+m)>i||l.newline?(o+=s+n,a=0,h=m,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=o,l.y=a,l.markRedraw(),"horizontal"===e?o=c+n:a=h+n)}))}var Yd=Xd;function Zd(e,t,n){n=Od(n||0);var r=t.width,i=t.height,o=oo(e.left,r),a=oo(e.top,i),s=oo(e.right,r),l=oo(e.bottom,i),u=oo(e.width,r),c=oo(e.height,i),h=n[2]+n[0],d=n[1]+n[3],p=e.aspect;switch(isNaN(u)&&(u=r-s-d-o),isNaN(c)&&(c=i-l-h-a),null!=p&&(isNaN(u)&&isNaN(c)&&(p>r/i?u=.8*r:c=.8*i),isNaN(u)&&(u=p*c),isNaN(c)&&(c=u/p)),isNaN(o)&&(o=r-s-u-d),isNaN(a)&&(a=i-l-c-h),e.left||e.right){case"center":o=r/2-u/2-n[3];break;case"right":o=r-u-d}switch(e.top||e.bottom){case"middle":case"center":a=i/2-c/2-n[0];break;case"bottom":a=i-c-h}o=o||0,a=a||0,isNaN(u)&&(u=r-d-o-(s||0)),isNaN(c)&&(c=i-h-a-(l||0));var f=new jt(o+n[3],a+n[0],u,c);return f.margin=n,f}function qd(e,t,n,r,i,o){var a,s=!i||!i.hv||i.hv[0],l=!i||!i.hv||i.hv[1],u=i&&i.boundingMode||"all";if((o=o||e).x=e.x,o.y=e.y,!s&&!l)return!1;if("raw"===u)a="group"===e.type?new jt(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(a=e.getBoundingRect(),e.needLocalTransform()){var c=e.getLocalTransform();(a=a.clone()).applyTransform(c)}var h=Zd(V({width:a.width,height:a.height},t),n,r),d=s?h.x-a.x:0,p=l?h.y-a.y:0;return"raw"===u?(o.x=d,o.y=p):(o.x+=d,o.y+=p),o===e&&e.markRedraw(),!0}function Kd(e){var t=e.layoutMode||e.constructor.layoutMode;return re(t)?t:t?{type:t}:null}function $d(e,t,n){var r=n&&n.ignoreSize;!J(r)&&(r=[r,r]);var i=a(jd[0],0),o=a(jd[1],1);function a(n,i){var o={},a=0,u={},c=0;if(Ud(n,(function(t){u[t]=e[t]})),Ud(n,(function(e){s(t,e)&&(o[e]=u[e]=t[e]),l(o,e)&&a++,l(u,e)&&c++})),r[i])return l(t,n[1])?u[n[2]]=null:l(t,n[2])&&(u[n[1]]=null),u;if(2!==c&&a){if(a>=2)return o;for(var h=0;h<n.length;h++){var d=n[h];if(!s(o,d)&&s(e,d)){o[d]=e[d];break}}return o}return u}function s(e,t){return e.hasOwnProperty(t)}function l(e,t){return null!=e[t]&&"auto"!==e[t]}function u(e,t,n){Ud(e,(function(e){t[e]=n[e]}))}u(jd[0],e,i),u(jd[1],e,o)}function Jd(e){return Qd({},e)}function Qd(e,t){return t&&e&&Ud(Wd,(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})),e}$(Xd,"vertical"),$(Xd,"horizontal");var ep=ta(),tp=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.uid=Xh("ec_cpt_model"),i}return l(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=Kd(this),r=n?Jd(e):{};R(e,t.getTheme().get(this.mainType)),R(e,this.getDefaultOption()),n&&$d(e,r,n)},t.prototype.mergeOption=function(e,t){R(this.option,e,!0);var n=Kd(this);n&&$d(this.option,e,n)},t.prototype.optionUpdated=function(e,t){},t.prototype.getDefaultOption=function(){var e=this.constructor;if(!function(e){return!(!e||!e[da])}(e))return e.defaultOption;var t=ep(this);if(!t.defaultOption){for(var n=[],r=e;r;){var i=r.prototype.defaultOption;i&&n.push(i),r=r.superClass}for(var o={},a=n.length-1;a>=0;a--)o=R(o,n[a],!0);t.defaultOption=o}return t.defaultOption},t.prototype.getReferringComponents=function(e,t){var n=e+"Index",r=e+"Id";return sa(this.ecModel,e,{index:this.get(n,!0),id:this.get(r,!0)},t)},t.prototype.getBoxLayoutParams=function(){var e=this;return{left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")}},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type="component",e.id="",e.name="",e.mainType="",e.subType="",e.componentIndex=0}(),t}(Wh);ga(tp,Wh),_a(tp),function(e){var t={};e.registerSubTypeDefaulter=function(e,n){var r=pa(e);t[r.main]=n},e.determineSubType=function(n,r){var i=r.type;if(!i){var o=pa(n).main;e.hasSubTypes(n)&&t[o]&&(i=t[o](r))}return i}}(tp),function(e,t){function n(e,t){return e[t]||(e[t]={predecessor:[],successor:[]}),e[t]}e.topologicalTravel=function(e,r,i,o){if(e.length){var a=function(e){var r={},i=[];return W(e,(function(o){var a=n(r,o),s=function(e,t){var n=[];return W(e,(function(e){F(t,e)>=0&&n.push(e)})),n}(a.originalDeps=t(o),e);a.entryCount=s.length,0===a.entryCount&&i.push(o),W(s,(function(e){F(a.predecessor,e)<0&&a.predecessor.push(e);var t=n(r,e);F(t.successor,e)<0&&t.successor.push(o)}))})),{graph:r,noEntryList:i}}(r),s=a.graph,l=a.noEntryList,u={};for(W(e,(function(e){u[e]=!0}));l.length;){var c=l.pop(),h=s[c],d=!!u[c];d&&(i.call(o,c,h.originalDeps.slice()),delete u[c]),W(h.successor,d?f:p)}W(u,(function(){var t="";throw"production"!==process.env.NODE_ENV&&(t=ko("Circular dependency may exists: ",u,e,r)),new Error(t)}))}function p(e){s[e].entryCount--,0===s[e].entryCount&&l.push(e)}function f(e){u[e]=!0,p(e)}}}(tp,(function(e){var t=[];W(tp.getClassesByMainType(e),(function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])})),t=j(t,(function(e){return pa(e).main})),"dataset"!==e&&F(t,"dataset")<=0&&t.unshift("dataset");return t}));var np="";"undefined"!=typeof navigator&&(np=navigator.platform||"");var rp="rgba(0, 0, 0, 0.2)",ip={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:rp,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:rp,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:rp,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:rp,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:rp,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:rp,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:np.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},op=Te(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),ap="original",sp="arrayRows",lp="objectRows",up="keyedColumns",cp="typedArray",hp="unknown",dp="column",pp="row",fp=1,gp=2,mp=3,vp=ta();function yp(e,t,n){var r={},i=xp(t);if(!i||!e)return r;var o,a,s=[],l=[],u=t.ecModel,c=vp(u).datasetMap,h=i.uid+"_"+n.seriesLayoutBy;W(e=e.slice(),(function(t,n){var i=re(t)?t:e[n]={name:t};"ordinal"===i.type&&null==o&&(o=n,a=f(i)),r[i.name]=[]}));var d=c.get(h)||c.set(h,{categoryWayDim:a,valueWayDim:0});function p(e,t,n){for(var r=0;r<n;r++)e.push(t+r)}function f(e){var t=e.dimsDef;return t?t.length:1}return W(e,(function(e,t){var n=e.name,i=f(e);if(null==o){var a=d.valueWayDim;p(r[n],a,i),p(l,a,i),d.valueWayDim+=i}else if(o===t)p(r[n],0,i),p(s,0,i);else{a=d.categoryWayDim;p(r[n],a,i),p(l,a,i),d.categoryWayDim+=i}})),s.length&&(r.itemName=s),l.length&&(r.seriesName=l),r}function _p(e,t,n){var r={};if(!xp(e))return r;var i,o=t.sourceFormat,a=t.dimensionsDefine;o!==lp&&o!==up||W(a,(function(e,t){"name"===(re(e)?e.name:e)&&(i=t)}));var s=function(){for(var e={},r={},s=[],l=0,u=Math.min(5,n);l<u;l++){var c=wp(t.data,o,t.seriesLayoutBy,a,t.startIndex,l);s.push(c);var h=c===mp;if(h&&null==e.v&&l!==i&&(e.v=l),(null==e.n||e.n===e.v||!h&&s[e.n]===mp)&&(e.n=l),d(e)&&s[e.n]!==mp)return e;h||(c===gp&&null==r.v&&l!==i&&(r.v=l),null!=r.n&&r.n!==r.v||(r.n=l))}function d(e){return null!=e.v&&null!=e.n}return d(e)?e:d(r)?r:null}();if(s){r.value=[s.v];var l=null!=i?i:s.n;r.itemName=[l],r.seriesName=[l]}return r}function xp(e){if(!e.get("data",!0))return sa(e.ecModel,"dataset",{index:e.get("datasetIndex",!0),id:e.get("datasetId",!0)},oa).models[0]}function bp(e,t){return wp(e.data,e.sourceFormat,e.seriesLayoutBy,e.dimensionsDefine,e.startIndex,t)}function wp(e,t,n,r,i,o){var a,s,l;if(oe(e))return mp;if(r){var u=r[o];re(u)?(s=u.name,l=u.type):ee(u)&&(s=u)}if(null!=l)return"ordinal"===l?fp:mp;if(t===sp){var c=e;if(n===pp){for(var h=c[o],d=0;d<(h||[]).length&&d<5;d++)if(null!=(a=y(h[i+d])))return a}else for(d=0;d<c.length&&d<5;d++){var p=c[i+d];if(p&&null!=(a=y(p[o])))return a}}else if(t===lp){var f=e;if(!s)return mp;for(d=0;d<f.length&&d<5;d++){if((m=f[d])&&null!=(a=y(m[s])))return a}}else if(t===up){if(!s)return mp;if(!(h=e[s])||oe(h))return mp;for(d=0;d<h.length&&d<5;d++)if(null!=(a=y(h[d])))return a}else if(t===ap){var g=e;for(d=0;d<g.length&&d<5;d++){var m,v=Wo(m=g[d]);if(!J(v))return mp;if(null!=(a=y(v[o])))return a}}function y(e){var t=ee(e);return null!=e&&Number.isFinite(Number(e))&&""!==e?t?gp:mp:t&&"-"!==e?fp:void 0}return mp}var Sp=Te();var Tp,Mp,Cp,Dp=ta(),Ap=ta(),Ip=function(){function e(){}return e.prototype.getColorFromPalette=function(e,t,n){var r=Go(this.get("color",!0)),i=this.get("colorLayer",!0);return Lp(this,Dp,r,i,e,t,n)},e.prototype.clearColorPalette=function(){!function(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}(this,Dp)},e}();function Ep(e,t,n,r){var i=Go(e.get(["aria","decal","decals"]));return Lp(e,Ap,i,null,t,n,r)}function Lp(e,t,n,r,i,o,a){var s=t(o=o||e),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var c=null!=a&&r?function(e,t){for(var n=e.length,r=0;r<n;r++)if(e[r].length>t)return e[r];return e[n-1]}(r,a):n;if((c=c||n)&&c.length){var h=c[l];return i&&(u[i]=h),s.paletteIdx=(l+1)%c.length,h}}var Np="\0_ec_inner",Pp={grid:"GridComponent",polar:"PolarComponent",geo:"GeoComponent",singleAxis:"SingleAxisComponent",parallel:"ParallelComponent",calendar:"CalendarComponent",graphic:"GraphicComponent",toolbox:"ToolboxComponent",tooltip:"TooltipComponent",axisPointer:"AxisPointerComponent",brush:"BrushComponent",title:"TitleComponent",timeline:"TimelineComponent",markPoint:"MarkPointComponent",markLine:"MarkLineComponent",markArea:"MarkAreaComponent",legend:"LegendComponent",dataZoom:"DataZoomComponent",visualMap:"VisualMapComponent",xAxis:"GridComponent",yAxis:"GridComponent",angleAxis:"PolarComponent",radiusAxis:"PolarComponent"},Op={line:"LineChart",bar:"BarChart",pie:"PieChart",scatter:"ScatterChart",radar:"RadarChart",map:"MapChart",tree:"TreeChart",treemap:"TreemapChart",graph:"GraphChart",gauge:"GaugeChart",funnel:"FunnelChart",parallel:"ParallelChart",sankey:"SankeyChart",boxplot:"BoxplotChart",candlestick:"CandlestickChart",effectScatter:"EffectScatterChart",lines:"LinesChart",heatmap:"HeatmapChart",pictorialBar:"PictorialBarChart",themeRiver:"ThemeRiverChart",sunburst:"SunburstChart",custom:"CustomChart"},Rp={};var kp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.init=function(e,t,n,r,i,o){r=r||{},this.option=null,this._theme=new Wh(r),this._locale=new Wh(i),this._optionManager=o},t.prototype.setOption=function(e,t,n){"production"!==process.env.NODE_ENV&&(me(null!=e,"option is null/undefined"),me(1!==e[Np],"please use chart.getOption()"));var r=Bp(t);this._optionManager.setOption(e,n,r),this._resetOption(null,r)},t.prototype.resetOption=function(e,t){return this._resetOption(e,Bp(t))},t.prototype._resetOption=function(e,t){var n=!1,r=this._optionManager;if(!e||"recreate"===e){var i=r.mountOption("recreate"===e);"production"!==process.env.NODE_ENV&&W(i,(function(e,t){if(!tp.hasClass(t)){var n=Pp[t];n&&!Rp[n]&&(Po("Component "+t+" is used but not imported.\nimport { "+n+" } from 'echarts/components';\necharts.use(["+n+"]);"),Rp[n]=!0)}})),this.option&&"recreate"!==e?(this.restoreData(),this._mergeOption(i,t)):Cp(this,i),n=!0}if("timeline"!==e&&"media"!==e||this.restoreData(),!e||"recreate"===e||"timeline"===e){var o=r.getTimelineOption(this);o&&(n=!0,this._mergeOption(o,t))}if(!e||"recreate"===e||"media"===e){var a=r.getMediaOption(this);a.length&&W(a,(function(e){n=!0,this._mergeOption(e,t)}),this)}return n},t.prototype.mergeOption=function(e){this._mergeOption(e,null)},t.prototype._mergeOption=function(e,t){var n=this.option,r=this._componentsMap,i=this._componentsCount,o=[],a=Te(),s=t&&t.replaceMergeMainTypeMap;vp(this).datasetMap=Te(),W(e,(function(e,t){null!=e&&(tp.hasClass(t)?t&&(o.push(t),a.set(t,!0)):n[t]=null==n[t]?O(e):R(n[t],e,!0))})),s&&s.each((function(e,t){tp.hasClass(t)&&!a.get(t)&&(o.push(t),a.set(t,!0))})),tp.topologicalTravel(o,tp.getAllClassMainTypes(),(function(t){var o=function(e,t,n){var r=Sp.get(t);if(!r)return n;var i=r(e);if(!i)return n;if("production"!==process.env.NODE_ENV)for(var o=0;o<i.length;o++)me(Qo(i[o]));return n.concat(i)}(this,t,Go(e[t])),a=r.get(t),l=a?s&&s.get(t)?"replaceMerge":"normalMerge":"replaceAll",u=Xo(a,o,l);(function(e,t,n){W(e,(function(e){var r=e.newOption;re(r)&&(e.keyInfo.mainType=t,e.keyInfo.subType=function(e,t,n,r){return t.type?t.type:n?n.subType:r.determineSubType(e,t)}(t,r,e.existing,n))}))})(u,t,tp),n[t]=null,r.set(t,null),i.set(t,0);var c,h,d=[],p=[],f=0;W(u,(function(e,n){var r=e.existing,i=e.newOption;if(i){var o="series"===t,a=tp.getClass(t,e.keyInfo.subType,!o);if(!a){if("production"!==process.env.NODE_ENV){var s=e.keyInfo.subType,l=Op[s];Rp[s]||(Rp[s]=!0,Po(l?"Series "+s+" is used but not imported.\nimport { "+l+" } from 'echarts/charts';\necharts.use(["+l+"]);":"Unknown series "+s))}return}if("tooltip"===t){if(c)return void("production"!==process.env.NODE_ENV&&(h||(No("Currently only one tooltip component is allowed."),h=!0)));c=!0}if(r&&r.constructor===a)r.name=e.keyInfo.name,r.mergeOption(i,this),r.optionUpdated(i,!1);else{var u=z({componentIndex:n},e.keyInfo);z(r=new a(i,this,this,u),u),e.brandNew&&(r.__requireNewView=!0),r.init(i,this,this),r.optionUpdated(null,!0)}}else r&&(r.mergeOption({},this),r.optionUpdated({},!1));r?(d.push(r.option),p.push(r),f++):(d.push(void 0),p.push(void 0))}),this),n[t]=d,r.set(t,p),i.set(t,f),"series"===t&&Tp(this)}),this),this._seriesIndices||Tp(this)},t.prototype.getOption=function(){var e=O(this.option);return W(e,(function(t,n){if(tp.hasClass(n)){for(var r=Go(t),i=r.length,o=!1,a=i-1;a>=0;a--)r[a]&&!Qo(r[a])?o=!0:(r[a]=null,!o&&i--);r.length=i,e[n]=r}})),delete e[Np],e},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,t){var n=this._componentsMap.get(e);if(n){var r=n[t||0];if(r)return r;if(null==t)for(var i=0;i<n.length;i++)if(n[i])return n[i]}},t.prototype.queryComponents=function(e){var t=e.mainType;if(!t)return[];var n,r=e.index,i=e.id,o=e.name,a=this._componentsMap.get(t);return a&&a.length?(null!=r?(n=[],W(Go(r),(function(e){a[e]&&n.push(a[e])}))):n=null!=i?zp("id",i,a):null!=o?zp("name",o,a):Y(a,(function(e){return!!e})),Vp(n,e)):[]},t.prototype.findComponents=function(e){var t,n=e.query,r=e.mainType,i=function(e){var t=r+"Index",n=r+"Id",i=r+"Name";return!e||null==e[t]&&null==e[n]&&null==e[i]?null:{mainType:r,index:e[t],id:e[n],name:e[i]}}(n),o=i?this.queryComponents(i):Y(this._componentsMap.get(r),(function(e){return!!e}));return t=Vp(o,e),e.filter?Y(t,e.filter):t},t.prototype.eachComponent=function(e,t,n){var r=this._componentsMap;if(Q(e)){var i=t,o=e;r.each((function(e,t){for(var n=0;e&&n<e.length;n++){var r=e[n];r&&o.call(i,t,r,r.componentIndex)}}))}else for(var a=ee(e)?r.get(e):re(e)?this.findComponents(e):null,s=0;a&&s<a.length;s++){var l=a[s];l&&t.call(n,l,l.componentIndex)}},t.prototype.getSeriesByName=function(e){var t=qo(e,null);return Y(this._componentsMap.get("series"),(function(e){return!!e&&null!=t&&e.name===t}))},t.prototype.getSeriesByIndex=function(e){return this._componentsMap.get("series")[e]},t.prototype.getSeriesByType=function(e){return Y(this._componentsMap.get("series"),(function(t){return!!t&&t.subType===e}))},t.prototype.getSeries=function(){return Y(this._componentsMap.get("series"),(function(e){return!!e}))},t.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},t.prototype.eachSeries=function(e,t){Mp(this),W(this._seriesIndices,(function(n){var r=this._componentsMap.get("series")[n];e.call(t,r,n)}),this)},t.prototype.eachRawSeries=function(e,t){W(this._componentsMap.get("series"),(function(n){n&&e.call(t,n,n.componentIndex)}))},t.prototype.eachSeriesByType=function(e,t,n){Mp(this),W(this._seriesIndices,(function(r){var i=this._componentsMap.get("series")[r];i.subType===e&&t.call(n,i,r)}),this)},t.prototype.eachRawSeriesByType=function(e,t,n){return W(this.getSeriesByType(e),t,n)},t.prototype.isSeriesFiltered=function(e){return Mp(this),null==this._seriesIndicesMap.get(e.componentIndex)},t.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},t.prototype.filterSeries=function(e,t){Mp(this);var n=[];W(this._seriesIndices,(function(r){var i=this._componentsMap.get("series")[r];e.call(t,i,r)&&n.push(r)}),this),this._seriesIndices=n,this._seriesIndicesMap=Te(n)},t.prototype.restoreData=function(e){Tp(this);var t=this._componentsMap,n=[];t.each((function(e,t){tp.hasClass(t)&&n.push(t)})),tp.topologicalTravel(n,tp.getAllClassMainTypes(),(function(n){W(t.get(n),(function(t){!t||"series"===n&&function(e,t){if(t){var n=t.seriesIndex,r=t.seriesId,i=t.seriesName;return null!=n&&e.componentIndex!==n||null!=r&&e.id!==r||null!=i&&e.name!==i}}(t,e)||t.restoreData()}))}))},t.internalField=(Tp=function(e){var t=e._seriesIndices=[];W(e._componentsMap.get("series"),(function(e){e&&t.push(e.componentIndex)})),e._seriesIndicesMap=Te(t)},Mp=function(e){if("production"!==process.env.NODE_ENV&&!e._seriesIndices)throw new Error("Option should contains series.")},void(Cp=function(e,t){e.option={},e.option[Np]=1,e._componentsMap=Te({series:[]}),e._componentsCount=Te();var n=t.aria;re(n)&&null==n.enabled&&(n.enabled=!0),function(e,t){var n=e.color&&!e.colorLayer;W(t,(function(t,r){"colorLayer"===r&&n||tp.hasClass(r)||("object"==typeof t?e[r]=e[r]?R(e[r],t,!1):O(t):null==e[r]&&(e[r]=t))}))}(t,e._theme.option),R(t,ip,!1),e._mergeOption(t,null)})),t}(Wh);function zp(e,t,n){if(J(t)){var r=Te();return W(t,(function(e){null!=e&&(null!=qo(e,null)&&r.set(e,!0))})),Y(n,(function(t){return t&&r.get(t[e])}))}var i=qo(t,null);return Y(n,(function(t){return t&&null!=i&&t[e]===i}))}function Vp(e,t){return t.hasOwnProperty("subType")?Y(e,(function(e){return e&&e.subType===t.subType})):e}function Bp(e){var t=Te();return e&&W(Go(e.replaceMerge),(function(e){"production"!==process.env.NODE_ENV&&me(tp.hasClass(e),'"'+e+'" is not valid component main type in "replaceMerge"'),t.set(e,!0)})),{replaceMergeMainTypeMap:t}}H(kp,Ip);var Fp=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],Gp=function(e){W(Fp,(function(t){this[t]=K(e[t],e)}),this)},Hp={},Up=function(){function e(){this._coordinateSystems=[]}return e.prototype.create=function(e,t){var n=[];W(Hp,(function(r,i){var o=r.create(e,t);n=n.concat(o||[])})),this._coordinateSystems=n},e.prototype.update=function(e,t){W(this._coordinateSystems,(function(n){n.update&&n.update(e,t)}))},e.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},e.register=function(e,t){Hp[e]=t},e.get=function(e){return Hp[e]},e}(),Wp=/^(min|max)?(.+)$/,jp=function(){function e(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return e.prototype.setOption=function(e,t,n){e&&(W(Go(e.series),(function(e){e&&e.data&&oe(e.data)&&_e(e.data)})),W(Go(e.dataset),(function(e){e&&e.source&&oe(e.source)&&_e(e.source)}))),e=O(e);var r=this._optionBackup,i=function(e,t,n){var r,i,o=[],a=e.baseOption,s=e.timeline,l=e.options,u=e.media,c=!!e.media,h=!!(l||s||a&&a.timeline);a?(i=a).timeline||(i.timeline=s):((h||c)&&(e.options=e.media=null),i=e);c&&(J(u)?W(u,(function(e){"production"!==process.env.NODE_ENV&&e&&!e.option&&re(e.query)&&re(e.query.option)&&Po("Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }"),e&&e.option&&(e.query?o.push(e):r||(r=e))})):"production"!==process.env.NODE_ENV&&Po("Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }"));function d(e){W(t,(function(t){t(e,n)}))}return d(i),W(l,(function(e){return d(e)})),W(o,(function(e){return d(e.option)})),{baseOption:i,timelineOptions:l||[],mediaDefault:r,mediaList:o}}(e,t,!r);this._newBaseOption=i.baseOption,r?(i.timelineOptions.length&&(r.timelineOptions=i.timelineOptions),i.mediaList.length&&(r.mediaList=i.mediaList),i.mediaDefault&&(r.mediaDefault=i.mediaDefault)):this._optionBackup=i},e.prototype.mountOption=function(e){var t=this._optionBackup;return this._timelineOptions=t.timelineOptions,this._mediaList=t.mediaList,this._mediaDefault=t.mediaDefault,this._currentMediaIndices=[],O(e?t.baseOption:this._newBaseOption)},e.prototype.getTimelineOption=function(e){var t,n=this._timelineOptions;if(n.length){var r=e.getComponent("timeline");r&&(t=O(n[r.getCurrentIndex()]))}return t},e.prototype.getMediaOption=function(e){var t,n,r=this._api.getWidth(),i=this._api.getHeight(),o=this._mediaList,a=this._mediaDefault,s=[],l=[];if(!o.length&&!a)return l;for(var u=0,c=o.length;u<c;u++)Xp(o[u].query,r,i)&&s.push(u);return!s.length&&a&&(s=[-1]),s.length&&(t=s,n=this._currentMediaIndices,t.join(",")!==n.join(","))&&(l=j(s,(function(e){return O(-1===e?a.option:o[e].option)}))),this._currentMediaIndices=s,l},e}();function Xp(e,t,n){var r={width:t,height:n,aspectratio:t/n},i=!0;return W(e,(function(e,t){var n=t.match(Wp);if(n&&n[1]&&n[2]){var o=n[1],a=n[2].toLowerCase();(function(e,t,n){return"min"===n?e>=t:"max"===n?e<=t:e===t})(r[a],e,o)||(i=!1)}})),i}var Yp=W,Zp=re,qp=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Kp(e){var t=e&&e.itemStyle;if(t)for(var n=0,r=qp.length;n<r;n++){var i=qp[n],o=t.normal,a=t.emphasis;o&&o[i]&&("production"!==process.env.NODE_ENV&&Ro("itemStyle.normal."+i,i),e[i]=e[i]||{},e[i].normal?R(e[i].normal,o[i]):e[i].normal=o[i],o[i]=null),a&&a[i]&&("production"!==process.env.NODE_ENV&&Ro("itemStyle.emphasis."+i,"emphasis."+i),e[i]=e[i]||{},e[i].emphasis?R(e[i].emphasis,a[i]):e[i].emphasis=a[i],a[i]=null)}}function $p(e,t,n){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var r=e[t].normal,i=e[t].emphasis;r&&("production"!==process.env.NODE_ENV&&Oo("'normal' hierarchy in "+t+" has been removed since 4.0. All style properties are configured in "+t+" directly now."),n?(e[t].normal=e[t].emphasis=null,V(e[t],r)):e[t]=r),i&&("production"!==process.env.NODE_ENV&&Oo(t+".emphasis has been changed to emphasis."+t+" since 4.0"),e.emphasis=e.emphasis||{},e.emphasis[t]=i,i.focus&&(e.emphasis.focus=i.focus),i.blurScope&&(e.emphasis.blurScope=i.blurScope))}}function Jp(e){$p(e,"itemStyle"),$p(e,"lineStyle"),$p(e,"areaStyle"),$p(e,"label"),$p(e,"labelLine"),$p(e,"upperLabel"),$p(e,"edgeLabel")}function Qp(e,t){var n=Zp(e)&&e[t],r=Zp(n)&&n.textStyle;if(r){"production"!==process.env.NODE_ENV&&Oo("textStyle hierarchy in "+t+" has been removed since 4.0. All textStyle properties are configured in "+t+" directly now.");for(var i=0,o=Uo.length;i<o;i++){var a=Uo[i];r.hasOwnProperty(a)&&(n[a]=r[a])}}}function ef(e){e&&(Jp(e),Qp(e,"label"),e.emphasis&&Qp(e.emphasis,"label"))}function tf(e){return J(e)?e:e?[e]:[]}function nf(e){return(J(e)?e[0]:e)||{}}function rf(e,t){Yp(tf(e.series),(function(e){Zp(e)&&function(e){if(Zp(e)){Kp(e),Jp(e),Qp(e,"label"),Qp(e,"upperLabel"),Qp(e,"edgeLabel"),e.emphasis&&(Qp(e.emphasis,"label"),Qp(e.emphasis,"upperLabel"),Qp(e.emphasis,"edgeLabel"));var t=e.markPoint;t&&(Kp(t),ef(t));var n=e.markLine;n&&(Kp(n),ef(n));var r=e.markArea;r&&ef(r);var i=e.data;if("graph"===e.type){i=i||e.nodes;var o=e.links||e.edges;if(o&&!oe(o))for(var a=0;a<o.length;a++)ef(o[a]);W(e.categories,(function(e){Jp(e)}))}if(i&&!oe(i))for(a=0;a<i.length;a++)ef(i[a]);if((t=e.markPoint)&&t.data){var s=t.data;for(a=0;a<s.length;a++)ef(s[a])}if((n=e.markLine)&&n.data){var l=n.data;for(a=0;a<l.length;a++)J(l[a])?(ef(l[a][0]),ef(l[a][1])):ef(l[a])}"gauge"===e.type?(Qp(e,"axisLabel"),Qp(e,"title"),Qp(e,"detail")):"treemap"===e.type?($p(e.breadcrumb,"itemStyle"),W(e.levels,(function(e){Jp(e)}))):"tree"===e.type&&Jp(e.leaves)}}(e)}));var n=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];t&&n.push("valueAxis","categoryAxis","logAxis","timeAxis"),Yp(n,(function(t){Yp(tf(e[t]),(function(e){e&&(Qp(e,"axisLabel"),Qp(e.axisPointer,"label"))}))})),Yp(tf(e.parallel),(function(e){var t=e&&e.parallelAxisDefault;Qp(t,"axisLabel"),Qp(t&&t.axisPointer,"label")})),Yp(tf(e.calendar),(function(e){$p(e,"itemStyle"),Qp(e,"dayLabel"),Qp(e,"monthLabel"),Qp(e,"yearLabel")})),Yp(tf(e.radar),(function(e){Qp(e,"name"),e.name&&null==e.axisName&&(e.axisName=e.name,delete e.name,"production"!==process.env.NODE_ENV&&Oo("name property in radar component has been changed to axisName")),null!=e.nameGap&&null==e.axisNameGap&&(e.axisNameGap=e.nameGap,delete e.nameGap,"production"!==process.env.NODE_ENV&&Oo("nameGap property in radar component has been changed to axisNameGap")),"production"!==process.env.NODE_ENV&&Yp(e.indicator,(function(e){e.text&&Ro("text","name","radar.indicator")}))})),Yp(tf(e.geo),(function(e){Zp(e)&&(ef(e),Yp(tf(e.regions),(function(e){ef(e)})))})),Yp(tf(e.timeline),(function(e){ef(e),$p(e,"label"),$p(e,"itemStyle"),$p(e,"controlStyle",!0);var t=e.data;J(t)&&W(t,(function(e){re(e)&&($p(e,"label"),$p(e,"itemStyle"))}))})),Yp(tf(e.toolbox),(function(e){$p(e,"iconStyle"),Yp(e.feature,(function(e){$p(e,"iconStyle")}))})),Qp(nf(e.axisPointer),"label"),Qp(nf(e.tooltip).axisPointer,"label")}function of(e){e&&W(af,(function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])}))}var af=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],sf=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],lf=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function uf(e){var t=e&&e.itemStyle;if(t)for(var n=0;n<lf.length;n++){var r=lf[n][1],i=lf[n][0];null!=t[r]&&(t[i]=t[r],"production"!==process.env.NODE_ENV&&Ro(r,i))}}function cf(e){e&&"edge"===e.alignTo&&null!=e.margin&&null==e.edgeDistance&&("production"!==process.env.NODE_ENV&&Ro("label.margin","label.edgeDistance","pie"),e.edgeDistance=e.margin)}function hf(e){e&&e.downplay&&!e.blur&&(e.blur=e.downplay,"production"!==process.env.NODE_ENV&&Ro("downplay","blur","sunburst"))}function df(e,t){if(e)for(var n=0;n<e.length;n++)t(e[n]),e[n]&&df(e[n].children,t)}function pf(e,t){rf(e,t),e.series=Go(e.series),W(e.series,(function(e){if(re(e)){var t=e.type;if("line"===t)null!=e.clipOverflow&&(e.clip=e.clipOverflow,"production"!==process.env.NODE_ENV&&Ro("clipOverflow","clip","line"));else if("pie"===t||"gauge"===t){if(null!=e.clockWise&&(e.clockwise=e.clockWise,"production"!==process.env.NODE_ENV&&Ro("clockWise","clockwise")),cf(e.label),(i=e.data)&&!oe(i))for(var n=0;n<i.length;n++)cf(i[n]);null!=e.hoverOffset&&(e.emphasis=e.emphasis||{},(e.emphasis.scaleSize=null)&&("production"!==process.env.NODE_ENV&&Ro("hoverOffset","emphasis.scaleSize"),e.emphasis.scaleSize=e.hoverOffset))}else if("gauge"===t){var r=function(e,t){for(var n=t.split(","),r=e,i=0;i<n.length&&null!=(r=r&&r[n[i]]);i++);return r}(e,"pointer.color");null!=r&&function(e,t,n){for(var r,i=t.split(","),o=e,a=0;a<i.length-1;a++)null==o[r=i[a]]&&(o[r]={}),o=o[r];null==o[i[a]]&&(o[i[a]]=n)}(e,"itemStyle.color",r)}else if("bar"===t){var i;if(uf(e),uf(e.backgroundStyle),uf(e.emphasis),(i=e.data)&&!oe(i))for(n=0;n<i.length;n++)"object"==typeof i[n]&&(uf(i[n]),uf(i[n]&&i[n].emphasis))}else if("sunburst"===t){var o=e.highlightPolicy;o&&(e.emphasis=e.emphasis||{},e.emphasis.focus||(e.emphasis.focus=o,"production"!==process.env.NODE_ENV&&Ro("highlightPolicy","emphasis.focus","sunburst"))),hf(e),df(e.data,hf)}else"graph"===t||"sankey"===t?function(e){e&&null!=e.focusNodeAdjacency&&(e.emphasis=e.emphasis||{},null==e.emphasis.focus&&("production"!==process.env.NODE_ENV&&Ro("focusNodeAdjacency","emphasis: { focus: 'adjacency'}","graph/sankey"),e.emphasis.focus="adjacency"))}(e):"map"===t&&(e.mapType&&!e.map&&("production"!==process.env.NODE_ENV&&Ro("mapType","map","map"),e.map=e.mapType),e.mapLocation&&("production"!==process.env.NODE_ENV&&Oo("`mapLocation` is not used anymore."),V(e,e.mapLocation)));null!=e.hoverAnimation&&(e.emphasis=e.emphasis||{},e.emphasis&&null==e.emphasis.scale&&("production"!==process.env.NODE_ENV&&Ro("hoverAnimation","emphasis.scale"),e.emphasis.scale=e.hoverAnimation)),of(e)}})),e.dataRange&&(e.visualMap=e.dataRange),W(sf,(function(t){var n=e[t];n&&(J(n)||(n=[n]),W(n,(function(e){of(e)})))}))}function ff(e){W(e,(function(t,n){var r=[],i=[NaN,NaN],o=[t.stackResultDimension,t.stackedOverDimension],a=t.data,s=t.isStackedByIndex,l=t.seriesModel.get("stackStrategy")||"samesign";a.modify(o,(function(o,u,c){var h,d,p=a.get(t.stackedDimension,c);if(isNaN(p))return i;s?d=a.getRawIndex(c):h=a.get(t.stackedByDimension,c);for(var f=NaN,g=n-1;g>=0;g--){var m=e[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,h)),d>=0){var v=m.data.getByRawIndex(m.stackResultDimension,d);if("all"===l||"positive"===l&&v>0||"negative"===l&&v<0||"samesign"===l&&p>=0&&v>0||"samesign"===l&&p<=0&&v<0){p=po(p,v),f=v;break}}}return r[0]=p,r[1]=f,r}))}))}var gf,mf,vf,yf,_f,xf=function(e){this.data=e.data||(e.sourceFormat===up?{}:[]),this.sourceFormat=e.sourceFormat||hp,this.seriesLayoutBy=e.seriesLayoutBy||dp,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var n=0;n<t.length;n++){var r=t[n];null==r.type&&bp(this,n)===fp&&(r.type="ordinal")}};function bf(e){return e instanceof xf}function wf(e,t,n){n=n||Tf(e);var r=t.seriesLayoutBy,i=function(e,t,n,r,i){var o,a;if(!e)return{dimensionsDefine:Mf(i),startIndex:a,dimensionsDetectedCount:o};if(t===sp){var s=e;"auto"===r||null==r?Cf((function(e){null!=e&&"-"!==e&&(ee(e)?null==a&&(a=1):a=0)}),n,s,10):a=ne(r)?r:r?1:0,i||1!==a||(i=[],Cf((function(e,t){i[t]=null!=e?e+"":""}),n,s,1/0)),o=i?i.length:n===pp?s.length:s[0]?s[0].length:null}else if(t===lp)i||(i=function(e){var t,n=0;for(;n<e.length&&!(t=e[n++]););if(t)return q(t)}(e));else if(t===up)i||(i=[],W(e,(function(e,t){i.push(t)})));else if(t===ap){var l=Wo(e[0]);o=J(l)&&l.length||1}else t===cp&&"production"!==process.env.NODE_ENV&&me(!!i,"dimensions must be given if data is TypedArray.");return{startIndex:a,dimensionsDefine:Mf(i),dimensionsDetectedCount:o}}(e,n,r,t.sourceHeader,t.dimensions);return new xf({data:e,sourceFormat:n,seriesLayoutBy:r,dimensionsDefine:i.dimensionsDefine,startIndex:i.startIndex,dimensionsDetectedCount:i.dimensionsDetectedCount,metaRawOption:O(t)})}function Sf(e){return new xf({data:e,sourceFormat:oe(e)?cp:ap})}function Tf(e){var t=hp;if(oe(e))t=cp;else if(J(e)){0===e.length&&(t=sp);for(var n=0,r=e.length;n<r;n++){var i=e[n];if(null!=i){if(J(i)||oe(i)){t=sp;break}if(re(i)){t=lp;break}}}}else if(re(e))for(var o in e)if(Ae(e,o)&&U(e[o])){t=up;break}return t}function Mf(e){if(e){var t=Te();return j(e,(function(e,n){var r={name:(e=re(e)?e:{name:e}).name,displayName:e.displayName,type:e.type};if(null==r.name)return r;r.name+="",null==r.displayName&&(r.displayName=r.name);var i=t.get(r.name);return i?r.name+="-"+i.count++:t.set(r.name,{count:1}),r}))}}function Cf(e,t,n,r){if(t===pp)for(var i=0;i<n.length&&i<r;i++)e(n[i]?n[i][0]:null,i);else{var o=n[0]||[];for(i=0;i<o.length&&i<r;i++)e(o[i],i)}}function Df(e){var t=e.sourceFormat;return t===lp||t===up}var Af=function(){function e(e,t){var n=bf(e)?e:Sf(e);this._source=n;var r=this._data=n.data;if(n.sourceFormat===cp){if("production"!==process.env.NODE_ENV&&null==t)throw new Error("Typed array data must specify dimension size");this._offset=0,this._dimSize=t,this._data=r}_f(this,r,n)}return e.prototype.getSource=function(){return this._source},e.prototype.count=function(){return 0},e.prototype.getItem=function(e,t){},e.prototype.appendData=function(e){},e.prototype.clean=function(){},e.protoInitialize=function(){var t=e.prototype;t.pure=!1,t.persistent=!0}(),e.internalField=function(){var e;_f=function(e,i,o){var a=o.sourceFormat,s=o.seriesLayoutBy,l=o.startIndex,u=o.dimensionsDefine,c=yf[Vf(a,s)];if("production"!==process.env.NODE_ENV&&me(c,"Invalide sourceFormat: "+a),z(e,c),a===cp)e.getItem=t,e.count=r,e.fillStorage=n;else{var h=Lf(a,s);e.getItem=K(h,null,i,l,u);var d=Of(a,s);e.count=K(d,null,i,l,u)}};var t=function(e,t){e-=this._offset,t=t||[];for(var n=this._data,r=this._dimSize,i=r*e,o=0;o<r;o++)t[o]=n[i+o];return t},n=function(e,t,n,r){for(var i=this._data,o=this._dimSize,a=0;a<o;a++){for(var s=r[a],l=null==s[0]?1/0:s[0],u=null==s[1]?-1/0:s[1],c=t-e,h=n[a],d=0;d<c;d++){var p=i[d*o+a];h[e+d]=p,p<l&&(l=p),p>u&&(u=p)}s[0]=l,s[1]=u}},r=function(){return this._data?this._data.length/this._dimSize:0};function i(e){for(var t=0;t<e.length;t++)this._data.push(e[t])}(e={})[sp+"_"+dp]={pure:!0,appendData:i},e[sp+"_"+pp]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[lp]={pure:!0,appendData:i},e[up]={pure:!0,appendData:function(e){var t=this._data;W(e,(function(e,n){for(var r=t[n]||(t[n]=[]),i=0;i<(e||[]).length;i++)r.push(e[i])}))}},e[ap]={appendData:i},e[cp]={persistent:!1,pure:!0,appendData:function(e){"production"!==process.env.NODE_ENV&&me(oe(e),"Added data must be TypedArray if data in initialization is TypedArray"),this._data=e},clean:function(){this._offset+=this.count(),this._data=null}},yf=e}(),e}(),If=function(e,t,n,r){return e[r]},Ef=((gf={})[sp+"_"+dp]=function(e,t,n,r){return e[r+t]},gf[sp+"_"+pp]=function(e,t,n,r,i){r+=t;for(var o=i||[],a=e,s=0;s<a.length;s++){var l=a[s];o[s]=l?l[r]:null}return o},gf[lp]=If,gf[up]=function(e,t,n,r,i){for(var o=i||[],a=0;a<n.length;a++){var s=n[a].name;if("production"!==process.env.NODE_ENV&&null==s)throw new Error;var l=e[s];o[a]=l?l[r]:null}return o},gf[ap]=If,gf);function Lf(e,t){var n=Ef[Vf(e,t)];return"production"!==process.env.NODE_ENV&&me(n,'Do not support get item on "'+e+'", "'+t+'".'),n}var Nf=function(e,t,n){return e.length},Pf=((mf={})[sp+"_"+dp]=function(e,t,n){return Math.max(0,e.length-t)},mf[sp+"_"+pp]=function(e,t,n){var r=e[0];return r?Math.max(0,r.length-t):0},mf[lp]=Nf,mf[up]=function(e,t,n){var r=n[0].name;if("production"!==process.env.NODE_ENV&&null==r)throw new Error;var i=e[r];return i?i.length:0},mf[ap]=Nf,mf);function Of(e,t){var n=Pf[Vf(e,t)];return"production"!==process.env.NODE_ENV&&me(n,'Do not support count on "'+e+'", "'+t+'".'),n}var Rf=function(e,t,n){return e[t]},kf=((vf={})[sp]=Rf,vf[lp]=function(e,t,n){return e[n]},vf[up]=Rf,vf[ap]=function(e,t,n){var r=Wo(e);return r instanceof Array?r[t]:r},vf[cp]=Rf,vf);function zf(e){var t=kf[e];return"production"!==process.env.NODE_ENV&&me(t,'Do not support get value on "'+e+'".'),t}function Vf(e,t){return e===sp?e+"_"+t:e}function Bf(e,t,n){if(e){var r=e.getRawDataItem(t);if(null!=r){var i=e.getStore(),o=i.getSource().sourceFormat;if(null!=n){var a=e.getDimensionIndex(n),s=i.getDimensionProperty(a);return zf(o)(r,a,s)}var l=r;return o===ap&&(l=Wo(r)),l}}}var Ff=/\{@(.+?)\}/g,Gf=function(){function e(){}return e.prototype.getDataParams=function(e,t){var n=this.getData(t),r=this.getRawValue(e,t),i=n.getRawIndex(e),o=n.getName(e),a=n.getRawDataItem(e),s=n.getItemVisual(e,"style"),l=s&&s[n.getItemVisual(e,"drawType")||"fill"],u=s&&s.stroke,c=this.mainType,h="series"===c,d=n.userOutput&&n.userOutput.get();return{componentType:c,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:h?this.subType:null,seriesIndex:this.seriesIndex,seriesId:h?this.id:null,seriesName:h?this.name:null,name:o,dataIndex:i,data:a,dataType:t,value:r,color:l,borderColor:u,dimensionNames:d?d.fullDimensions:null,encode:d?d.encode:null,$vars:["seriesName","name","value"]}},e.prototype.getFormattedLabel=function(e,t,n,r,i,o){t=t||"normal";var a=this.getData(n),s=this.getDataParams(e,n);(o&&(s.value=o.interpolatedValue),null!=r&&J(s.value)&&(s.value=s.value[r]),i)||(i=a.getItemModel(e).get("normal"===t?["label","formatter"]:[t,"label","formatter"]));return Q(i)?(s.status=t,s.dimensionIndex=r,i(s)):ee(i)?Vd(i,s).replace(Ff,(function(t,n){var r=n.length,i=n;"["===i.charAt(0)&&"]"===i.charAt(r-1)&&(i=+i.slice(1,r-1),"production"!==process.env.NODE_ENV&&isNaN(i)&&Po("Invalide label formatter: @"+n+", only support @[0], @[1], @[2], ..."));var s=Bf(a,e,i);if(o&&J(o.interpolatedValue)){var l=a.getDimensionIndex(i);l>=0&&(s=o.interpolatedValue[l])}return null!=s?s+"":""})):void 0},e.prototype.getRawValue=function(e,t){return Bf(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}();function Hf(e){var t,n;return re(e)?e.type?n=e:"production"!==process.env.NODE_ENV&&console.warn("The return type of `formatTooltip` is not supported: "+ko(e)):t=e,{text:t,frag:n}}function Uf(e){return new Wf(e)}var Wf=function(){function e(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return e.prototype.perform=function(e){var t,n=this._upstream,r=e&&e.skip;if(this._dirty&&n){var i=this.context;i.data=i.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!r&&(t=this._plan(this.context));var o,a=c(this._modBy),s=this._modDataCount||0,l=c(e&&e.modBy),u=e&&e.modDataCount||0;function c(e){return!(e>=1)&&(e=1),e}a===l&&s===u||(t="reset"),(this._dirty||"reset"===t)&&(this._dirty=!1,o=this._doReset(r)),this._modBy=l,this._modDataCount=u;var h=e&&e.step;if(n?("production"!==process.env.NODE_ENV&&me(null!=n._outputDueEnd),this._dueEnd=n._outputDueEnd):("production"!==process.env.NODE_ENV&&me(!this._progress||this._count),this._dueEnd=this._count?this._count(this.context):1/0),this._progress){var d=this._dueIndex,p=Math.min(null!=h?this._dueIndex+h:1/0,this._dueEnd);if(!r&&(o||d<p)){var f=this._progress;if(J(f))for(var g=0;g<f.length;g++)this._doProgress(f[g],d,p,l,u);else this._doProgress(f,d,p,l,u)}this._dueIndex=p;var m=null!=this._settedOutputEnd?this._settedOutputEnd:p;"production"!==process.env.NODE_ENV&&me(m>=this._outputDueEnd),this._outputDueEnd=m}else this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()},e.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},e.prototype._doProgress=function(e,t,n,r,i){jf.reset(t,n,r,i),this._callingProgress=e,this._callingProgress({start:t,end:n,count:n-t,next:jf.next},this.context)},e.prototype._doReset=function(e){var t,n;this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null,!e&&this._reset&&((t=this._reset(this.context))&&t.progress&&(n=t.forceFirstProgress,t=t.progress),J(t)&&!t.length&&(t=null)),this._progress=t,this._modBy=this._modDataCount=null;var r=this._downstream;return r&&r.dirty(),n},e.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},e.prototype.pipe=function(e){"production"!==process.env.NODE_ENV&&me(e&&!e._disposed&&e!==this),(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},e.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},e.prototype.getUpstream=function(){return this._upstream},e.prototype.getDownstream=function(){return this._downstream},e.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},e}(),jf=function(){var e,t,n,r,i,o={reset:function(l,u,c,h){t=l,e=u,n=c,r=h,i=Math.ceil(r/n),o.next=n>1&&r>0?s:a}};return o;function a(){return t<e?t++:null}function s(){var o=t%i*n+Math.ceil(t/i),a=t>=e?null:o<r?o:t;return t++,a}}();function Xf(e,t){var n=t&&t.type;return"ordinal"===n?e:("time"!==n||ne(e)||null==e||"-"===e||(e=+yo(e)),null==e||""===e?NaN:Number(e))}var Yf=Te({number:function(e){return parseFloat(e)},time:function(e){return+yo(e)},trim:function(e){return ee(e)?ve(e):e}});function Zf(e){return Yf.get(e)}var qf={lt:function(e,t){return e<t},lte:function(e,t){return e<=t},gt:function(e,t){return e>t},gte:function(e,t){return e>=t}},Kf=function(){function e(e,t){if(!ne(t)){var n="";"production"!==process.env.NODE_ENV&&(n='rvalue of "<", ">", "<=", ">=" can only be number in filter.'),zo(n)}this._opFn=qf[e],this._rvalFloat=To(t)}return e.prototype.evaluate=function(e){return ne(e)?this._opFn(e,this._rvalFloat):this._opFn(To(e),this._rvalFloat)},e}(),$f=function(){function e(e,t){var n="desc"===e;this._resultLT=n?1:-1,null==t&&(t=n?"min":"max"),this._incomparable="min"===t?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=ne(e)?e:To(e),r=ne(t)?t:To(t),i=isNaN(n),o=isNaN(r);if(i&&(n=this._incomparable),o&&(r=this._incomparable),i&&o){var a=ee(e),s=ee(t);a&&(n=s?e:0),s&&(r=a?t:0)}return n<r?this._resultLT:n>r?-this._resultLT:0},e}(),Jf=function(){function e(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=To(t)}return e.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n===this._rvalTypeof||"number"!==n&&"number"!==this._rvalTypeof||(t=To(e)===this._rvalFloat)}return this._isEQ?t:!t},e}();function Qf(e,t){return"eq"===e||"ne"===e?new Jf("eq"===e,t):Ae(qf,e)?new Kf(e,t):null}var eg=function(){function e(){}return e.prototype.getRawData=function(){throw new Error("not supported")},e.prototype.getRawDataItem=function(e){throw new Error("not supported")},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(e){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(e,t){},e.prototype.retrieveValueFromItem=function(e,t){},e.prototype.convertValue=function(e,t){return Xf(e,t)},e}();function tg(e){var t=e.sourceFormat;if(!sg(t)){var n="";"production"!==process.env.NODE_ENV&&(n="`getRawData` is not supported in source format "+t),zo(n)}return e.data}function ng(e){var t=e.sourceFormat,n=e.data;if(!sg(t)){var r="";"production"!==process.env.NODE_ENV&&(r="`cloneRawData` is not supported in source format "+t),zo(r)}if(t===sp){for(var i=[],o=0,a=n.length;o<a;o++)i.push(n[o].slice());return i}if(t===lp){for(i=[],o=0,a=n.length;o<a;o++)i.push(z({},n[o]));return i}}function rg(e,t,n){if(null!=n)return ne(n)||!isNaN(n)&&!Ae(t,n)?e[n]:Ae(t,n)?t[n]:void 0}function ig(e){return O(e)}var og=Te();function ag(e,t,n,r){var i="";t.length||("production"!==process.env.NODE_ENV&&(i="Must have at least one upstream dataset."),zo(i)),re(e)||("production"!==process.env.NODE_ENV&&(i="transform declaration must be an object rather than "+typeof e+"."),zo(i));var o=e.type,a=og.get(o);a||("production"!==process.env.NODE_ENV&&(i='Can not find transform on type "'+o+'".'),zo(i));var s,l=j(t,(function(e){return function(e,t){var n=new eg,r=e.data,i=n.sourceFormat=e.sourceFormat,o=e.startIndex,a="";e.seriesLayoutBy!==dp&&("production"!==process.env.NODE_ENV&&(a='`seriesLayoutBy` of upstream dataset can only be "column" in data transform.'),zo(a));var s=[],l={},u=e.dimensionsDefine;if(u)W(u,(function(e,t){var n=e.name,r={index:t,name:n,displayName:e.displayName};if(s.push(r),null!=n){var i="";Ae(l,n)&&("production"!==process.env.NODE_ENV&&(i='dimension name "'+n+'" duplicated.'),zo(i)),l[n]=r}}));else for(var c=0;c<e.dimensionsDetectedCount;c++)s.push({index:c});var h=Lf(i,dp);t.__isBuiltIn&&(n.getRawDataItem=function(e){return h(r,o,s,e)},n.getRawData=K(tg,null,e)),n.cloneRawData=K(ng,null,e);var d=Of(i,dp);n.count=K(d,null,r,o,s);var p=zf(i);n.retrieveValue=function(e,t){var n=h(r,o,s,e);return f(n,t)};var f=n.retrieveValueFromItem=function(e,t){if(null!=e){var n=s[t];return n?p(e,t,n.name):void 0}};return n.getDimensionInfo=K(rg,null,s,l),n.cloneAllDimensionInfo=K(ig,null,s),n}(e,a)})),u=Go(a.transform({upstream:l[0],upstreamList:l,config:O(e.config)}));if("production"!==process.env.NODE_ENV&&e.print){var c=j(u,(function(e){var t=null!=r?" === pipe index: "+r:"";return["=== dataset index: "+n.datasetIndex+t+" ===","- transform result data:",ko(e.data),"- transform result dimensions:",ko(e.dimensions)].join("\n")})).join("\n");Lo("log",c,s)}return j(u,(function(e,n){var r,i="";re(e)||("production"!==process.env.NODE_ENV&&(i="A transform should not return some empty results."),zo(i)),e.data||("production"!==process.env.NODE_ENV&&(i="Transform result data should be not be null or undefined"),zo(i)),sg(Tf(e.data))||("production"!==process.env.NODE_ENV&&(i="Transform result data should be array rows or object rows."),zo(i));var o=t[0];if(o&&0===n&&!e.dimensions){var a=o.startIndex;a&&(e.data=o.data.slice(0,a).concat(e.data)),r={seriesLayoutBy:dp,sourceHeader:a,dimensions:o.metaRawOption.dimensions}}else r={seriesLayoutBy:dp,sourceHeader:0,dimensions:e.dimensions};return wf(e.data,r,null)}))}function sg(e){return e===sp||e===lp}var lg,ug="undefined",cg=typeof Uint32Array===ug?Array:Uint32Array,hg=typeof Uint16Array===ug?Array:Uint16Array,dg=typeof Int32Array===ug?Array:Int32Array,pg=typeof Float64Array===ug?Array:Float64Array,fg={float:pg,int:dg,ordinal:Array,number:Array,time:pg};function gg(e){return e>65535?cg:hg}function mg(e,t,n,r,i){var o=fg[n||"float"];if(i){var a=e[t],s=a&&a.length;if(s!==r){for(var l=new o(r),u=0;u<s;u++)l[u]=a[u];e[t]=l}}else e[t]=new o(r)}var vg=function(){function e(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=Te()}return e.prototype.initData=function(e,t,n){"production"!==process.env.NODE_ENV&&me(Q(e.getItem)&&Q(e.count),"Invalid data provider."),this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var r=e.getSource(),i=this.defaultDimValueGetter=lg[r.sourceFormat];this._dimValueGetter=n||i,this._rawExtent=[];var o=Df(r);this._dimensions=j(t,(function(e){return"production"!==process.env.NODE_ENV&&o&&me(null!=e.property),{type:e.type,property:e.property}})),this._initDataFromProvider(0,e.count())},e.prototype.getProvider=function(){return this._provider},e.prototype.getSource=function(){return this._provider.getSource()},e.prototype.ensureCalculationDimension=function(e,t){var n=this._calcDimNameToIdx,r=this._dimensions,i=n.get(e);if(null!=i){if(r[i].type===t)return i}else i=r.length;return r[i]={type:t},n.set(e,i),this._chunks[i]=new fg[t||"float"](this._rawCount),this._rawExtent[i]=[1/0,-1/0],i},e.prototype.collectOrdinalMeta=function(e,t){var n=this._chunks[e],r=this._dimensions[e],i=this._rawExtent,o=r.ordinalOffset||0,a=n.length;0===o&&(i[e]=[1/0,-1/0]);for(var s=i[e],l=o;l<a;l++){var u=n[l]=t.parseAndCollect(n[l]);isNaN(u)||(s[0]=Math.min(u,s[0]),s[1]=Math.max(u,s[1]))}r.ordinalMeta=t,r.ordinalOffset=a,r.type="ordinal"},e.prototype.getOrdinalMeta=function(e){return this._dimensions[e].ordinalMeta},e.prototype.getDimensionProperty=function(e){var t=this._dimensions[e];return t&&t.property},e.prototype.appendData=function(e){"production"!==process.env.NODE_ENV&&me(!this._indices,"appendData can only be called on raw data.");var t=this._provider,n=this.count();t.appendData(e);var r=t.count();return t.persistent||(r+=n),n<r&&this._initDataFromProvider(n,r,!0),[n,r]},e.prototype.appendValues=function(e,t){for(var n=this._chunks,r=this._dimensions,i=r.length,o=this._rawExtent,a=this.count(),s=a+Math.max(e.length,t||0),l=0;l<i;l++){mg(n,l,(p=r[l]).type,s,!0)}for(var u=[],c=a;c<s;c++)for(var h=c-a,d=0;d<i;d++){var p=r[d],f=lg.arrayRows.call(this,e[h]||u,p.property,h,d);n[d][c]=f;var g=o[d];f<g[0]&&(g[0]=f),f>g[1]&&(g[1]=f)}return this._rawCount=this._count=s,{start:a,end:s}},e.prototype._initDataFromProvider=function(e,t,n){for(var r=this._provider,i=this._chunks,o=this._dimensions,a=o.length,s=this._rawExtent,l=j(o,(function(e){return e.property})),u=0;u<a;u++){var c=o[u];s[u]||(s[u]=[1/0,-1/0]),mg(i,u,c.type,t,n)}if(r.fillStorage)r.fillStorage(e,t,i,s);else for(var h=[],d=e;d<t;d++){h=r.getItem(d,h);for(var p=0;p<a;p++){var f=i[p],g=this._dimValueGetter(h,l[p],d,p);f[d]=g;var m=s[p];g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=t,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var n=this._chunks[e];return n?n[this.getRawIndex(t)]:NaN},e.prototype.getValues=function(e,t){var n=[],r=[];if(null==t){t=e,e=[];for(var i=0;i<this._dimensions.length;i++)r.push(i)}else r=e;i=0;for(var o=r.length;i<o;i++)n.push(this.get(r[i],t));return n},e.prototype.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var n=this._chunks[e];return n?n[t]:NaN},e.prototype.getSum=function(e){var t=0;if(this._chunks[e])for(var n=0,r=this.count();n<r;n++){var i=this.get(e,n);isNaN(i)||(t+=i)}return t},e.prototype.getMedian=function(e){var t=[];this.each([e],(function(e){isNaN(e)||t.push(e)}));var n=t.sort((function(e,t){return e-t})),r=this.count();return 0===r?0:r%2==1?n[(r-1)/2]:(n[r/2]+n[r/2-1])/2},e.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(null!=n&&n<this._count&&n===e)return e;for(var r=0,i=this._count-1;r<=i;){var o=(r+i)/2|0;if(t[o]<e)r=o+1;else{if(!(t[o]>e))return o;i=o-1}}return-1},e.prototype.indicesOfNearest=function(e,t,n){var r=this._chunks[e],i=[];if(!r)return i;null==n&&(n=1/0);for(var o=1/0,a=-1,s=0,l=0,u=this.count();l<u;l++){var c=t-r[this.getRawIndex(l)],h=Math.abs(c);h<=n&&((h<o||h===o&&c>=0&&a<0)&&(o=h,a=c,s=0),c===a&&(i[s++]=l))}return i.length=s,i},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,r=this._count;if(n===Array){e=new n(r);for(var i=0;i<r;i++)e[i]=t[i]}else e=new n(t.buffer,0,r)}else{e=new(n=gg(this._rawCount))(this.count());for(i=0;i<e.length;i++)e[i]=i}return e},e.prototype.filter=function(e,t){if(!this._count)return this;for(var n=this.clone(),r=n.count(),i=new(gg(n._rawCount))(r),o=[],a=e.length,s=0,l=e[0],u=n._chunks,c=0;c<r;c++){var h=void 0,d=n.getRawIndex(c);if(0===a)h=t(c);else if(1===a){h=t(u[l][d],c)}else{for(var p=0;p<a;p++)o[p]=u[e[p]][d];o[p]=c,h=t.apply(null,o)}h&&(i[s++]=d)}return s<r&&(n._indices=i),n._count=s,n._extent=[],n._updateGetRawIdx(),n},e.prototype.selectRange=function(e){var t=this.clone(),n=t._count;if(!n)return this;var r=q(e),i=r.length;if(!i)return this;var o=t.count(),a=new(gg(t._rawCount))(o),s=0,l=r[0],u=e[l][0],c=e[l][1],h=t._chunks,d=!1;if(!t._indices){var p=0;if(1===i){for(var f=h[r[0]],g=0;g<n;g++){((_=f[g])>=u&&_<=c||isNaN(_))&&(a[s++]=p),p++}d=!0}else if(2===i){f=h[r[0]];var m=h[r[1]],v=e[r[1]][0],y=e[r[1]][1];for(g=0;g<n;g++){var _=f[g],x=m[g];(_>=u&&_<=c||isNaN(_))&&(x>=v&&x<=y||isNaN(x))&&(a[s++]=p),p++}d=!0}}if(!d)if(1===i)for(g=0;g<o;g++){var b=t.getRawIndex(g);((_=h[r[0]][b])>=u&&_<=c||isNaN(_))&&(a[s++]=b)}else for(g=0;g<o;g++){for(var w=!0,S=(b=t.getRawIndex(g),0);S<i;S++){var T=r[S];((_=h[T][b])<e[T][0]||_>e[T][1])&&(w=!1)}w&&(a[s++]=t.getRawIndex(g))}return s<o&&(t._indices=a),t._count=s,t._extent=[],t._updateGetRawIdx(),t},e.prototype.map=function(e,t){var n=this.clone(e);return this._updateDims(n,e,t),n},e.prototype.modify=function(e,t){this._updateDims(this,e,t)},e.prototype._updateDims=function(e,t,n){for(var r=e._chunks,i=[],o=t.length,a=e.count(),s=[],l=e._rawExtent,u=0;u<t.length;u++)l[t[u]]=[1/0,-1/0];for(var c=0;c<a;c++){for(var h=e.getRawIndex(c),d=0;d<o;d++)s[d]=r[t[d]][h];s[o]=c;var p=n&&n.apply(null,s);if(null!=p){"object"!=typeof p&&(i[0]=p,p=i);for(u=0;u<p.length;u++){var f=t[u],g=p[u],m=l[f],v=r[f];v&&(v[h]=g),g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}}},e.prototype.lttbDownSample=function(e,t){var n,r,i,o=this.clone([e],!0),a=o._chunks[e],s=this.count(),l=0,u=Math.floor(1/t),c=this.getRawIndex(0),h=new(gg(this._rawCount))(Math.min(2*(Math.ceil(s/u)+2),s));h[l++]=c;for(var d=1;d<s-1;d+=u){for(var p=Math.min(d+u,s-1),f=Math.min(d+2*u,s),g=(f+p)/2,m=0,v=p;v<f;v++){var y=a[M=this.getRawIndex(v)];isNaN(y)||(m+=y)}m/=f-p;var _=d,x=Math.min(d+u,s),b=d-1,w=a[c];n=-1,i=_;var S=-1,T=0;for(v=_;v<x;v++){var M;y=a[M=this.getRawIndex(v)];isNaN(y)?(T++,S<0&&(S=M)):(r=Math.abs((b-g)*(y-w)-(b-v)*(m-w)))>n&&(n=r,i=M)}T>0&&T<x-_&&(h[l++]=Math.min(S,i),i=Math.max(S,i)),h[l++]=i,c=i}return h[l++]=this.getRawIndex(s-1),o._count=l,o._indices=h,o.getRawIndex=this._getRawIdx,o},e.prototype.downSample=function(e,t,n,r){for(var i=this.clone([e],!0),o=i._chunks,a=[],s=Math.floor(1/t),l=o[e],u=this.count(),c=i._rawExtent[e]=[1/0,-1/0],h=new(gg(this._rawCount))(Math.ceil(u/s)),d=0,p=0;p<u;p+=s){s>u-p&&(s=u-p,a.length=s);for(var f=0;f<s;f++){var g=this.getRawIndex(p+f);a[f]=l[g]}var m=n(a),v=this.getRawIndex(Math.min(p+r(a,m)||0,u-1));l[v]=m,m<c[0]&&(c[0]=m),m>c[1]&&(c[1]=m),h[d++]=v}return i._count=d,i._indices=h,i._updateGetRawIdx(),i},e.prototype.each=function(e,t){if(this._count)for(var n=e.length,r=this._chunks,i=0,o=this.count();i<o;i++){var a=this.getRawIndex(i);switch(n){case 0:t(i);break;case 1:t(r[e[0]][a],i);break;case 2:t(r[e[0]][a],r[e[1]][a],i);break;default:for(var s=0,l=[];s<n;s++)l[s]=r[e[s]][a];l[s]=i,t.apply(null,l)}}},e.prototype.getDataExtent=function(e){var t=this._chunks[e],n=[1/0,-1/0];if(!t)return n;var r,i=this.count();if(!this._indices)return this._rawExtent[e].slice();if(r=this._extent[e])return r.slice();for(var o=(r=n)[0],a=r[1],s=0;s<i;s++){var l=t[this.getRawIndex(s)];l<o&&(o=l),l>a&&(a=l)}return r=[o,a],this._extent[e]=r,r},e.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],r=this._chunks,i=0;i<r.length;i++)n.push(r[i][t]);return n},e.prototype.clone=function(t,n){var r,i,o=new e,a=this._chunks,s=t&&X(t,(function(e,t){return e[t]=!0,e}),{});if(s)for(var l=0;l<a.length;l++)o._chunks[l]=s[l]?(r=a[l],i=void 0,(i=r.constructor)===Array?r.slice():new i(r)):a[l];else o._chunks=a;return this._copyCommonProps(o),n||(o._indices=this._cloneIndices()),o._updateGetRawIdx(),o},e.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=O(this._extent),e._rawExtent=O(this._rawExtent)},e.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,t=void 0;if(e===Array){var n=this._indices.length;t=new e(n);for(var r=0;r<n;r++)t[r]=this._indices[r]}else t=new e(this._indices);return t}return null},e.prototype._getRawIdxIdentity=function(e){return e},e.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function e(e,t,n,r){return Xf(e[r],this._dimensions[r])}lg={arrayRows:e,objectRows:function(e,t,n,r){return Xf(e[t],this._dimensions[r])},keyedColumns:e,original:function(e,t,n,r){var i=e&&(null==e.value?e:e.value);return Xf(i instanceof Array?i[r]:i,this._dimensions[r])},typedArray:function(e,t,n,r){return e[r]}}}(),e}(),yg=function(){function e(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var e,t,n=this._sourceHost,r=this._getUpstreamSourceManagers(),i=!!r.length;if(xg(n)){var o=n,a=void 0,s=void 0,l=void 0;if(i){var u=r[0];u.prepareSource(),a=(l=u.getSource()).data,s=l.sourceFormat,t=[u._getVersionSign()]}else s=oe(a=o.get("data",!0))?cp:ap,t=[];var c=this._getSourceMetaRawOption()||{},h=l&&l.metaRawOption||{},d=de(c.seriesLayoutBy,h.seriesLayoutBy)||null,p=de(c.sourceHeader,h.sourceHeader),f=de(c.dimensions,h.dimensions);e=d!==h.seriesLayoutBy||!!p!=!!h.sourceHeader||f?[wf(a,{seriesLayoutBy:d,sourceHeader:p,dimensions:f},s)]:[]}else{var g=n;if(i){var m=this._applyTransform(r);e=m.sourceList,t=m.upstreamSignList}else{e=[wf(g.get("source",!0),this._getSourceMetaRawOption(),null)],t=[]}}"production"!==process.env.NODE_ENV&&me(e&&t),this._setLocalSource(e,t)},e.prototype._applyTransform=function(e){var t,n=this._sourceHost,r=n.get("transform",!0),i=n.get("fromTransformResult",!0);if("production"!==process.env.NODE_ENV&&me(null!=i||null!=r),null!=i){var o="";1!==e.length&&("production"!==process.env.NODE_ENV&&(o="When using `fromTransformResult`, there should be only one upstream dataset"),bg(o))}var a,s=[],l=[];return W(e,(function(e){e.prepareSource();var t=e.getSource(i||0),n="";null==i||t||("production"!==process.env.NODE_ENV&&(n="Can not retrieve result by `fromTransformResult`: "+i),bg(n)),s.push(t),l.push(e._getVersionSign())})),r?t=function(e,t,n){var r=Go(e),i=r.length,o="";i||("production"!==process.env.NODE_ENV&&(o="If `transform` declared, it should at least contain one transform."),zo(o));for(var a=0,s=i;a<s;a++)t=ag(r[a],t,n,1===i?null:a),a!==s-1&&(t.length=Math.max(t.length,1));return t}(r,s,{datasetIndex:n.componentIndex}):null!=i&&(t=[(a=s[0],new xf({data:a.data,sourceFormat:a.sourceFormat,seriesLayoutBy:a.seriesLayoutBy,dimensionsDefine:O(a.dimensionsDefine),startIndex:a.startIndex,dimensionsDetectedCount:a.dimensionsDetectedCount}))]),{sourceList:t,upstreamSignList:l}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t<e.length;t++){var n=e[t];if(n._isDirty()||this._upstreamSignList[t]!==n._getVersionSign())return!0}},e.prototype.getSource=function(e){e=e||0;var t=this._sourceList[e];if(!t){var n=this._getUpstreamSourceManagers();return n[0]&&n[0].getSource(e)}return t},e.prototype.getSharedDataStore=function(e){"production"!==process.env.NODE_ENV&&me(xg(this._sourceHost),"Can only call getDataStore on series source manager.");var t=e.makeStoreSchema();return this._innerGetDataStore(t.dimensions,e.source,t.hash)},e.prototype._innerGetDataStore=function(e,t,n){var r=this._storeList,i=r[0];i||(i=r[0]={});var o=i[n];if(!o){var a=this._getUpstreamSourceManagers()[0];xg(this._sourceHost)&&a?o=a._innerGetDataStore(e,t,n):(o=new vg).initData(new Af(t,e.length),e),i[n]=o}return o},e.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(xg(e)){var t=xp(e);return t?[t.getSourceManager()]:[]}return j(function(e){return e.get("transform",!0)||e.get("fromTransformResult",!0)?sa(e.ecModel,"dataset",{index:e.get("fromDatasetIndex",!0),id:e.get("fromDatasetId",!0)},oa).models:[]}(e),(function(e){return e.getSourceManager()}))},e.prototype._getSourceMetaRawOption=function(){var e,t,n,r=this._sourceHost;if(xg(r))e=r.get("seriesLayoutBy",!0),t=r.get("sourceHeader",!0),n=r.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var i=r;e=i.get("seriesLayoutBy",!0),t=i.get("sourceHeader",!0),n=i.get("dimensions",!0)}return{seriesLayoutBy:e,sourceHeader:t,dimensions:n}},e}();function _g(e){e.option.transform&&_e(e.option.transform)}function xg(e){return"series"===e.mainType}function bg(e){throw new Error(e)}var wg="line-height:1";function Sg(e,t){var n=e.color||"#6e7079",r=e.fontSize||12,i=e.fontWeight||"400",o=e.color||"#464646",a=e.fontSize||14,s=e.fontWeight||"900";return"html"===t?{nameStyle:"font-size:"+dt(r+"")+"px;color:"+dt(n)+";font-weight:"+dt(i+""),valueStyle:"font-size:"+dt(a+"")+"px;color:"+dt(o)+";font-weight:"+dt(s+"")}:{nameStyle:{fontSize:r,fill:n,fontWeight:i},valueStyle:{fontSize:a,fill:o,fontWeight:s}}}var Tg=[0,10,20,30],Mg=["","\n","\n\n","\n\n\n"];function Cg(e,t){return t.type=e,t}function Dg(e){return"section"===e.type}function Ag(e){return Dg(e)?Eg:Lg}function Ig(e){if(Dg(e)){var t=0,n=e.blocks.length,r=n>1||n>0&&!e.noHeader;return W(e.blocks,(function(e){var n=Ig(e);n>=t&&(t=n+ +(r&&(!n||Dg(e)&&!e.noHeader)))})),t}return 0}function Eg(e,t,n,r){var i,o=t.noHeader,a=(i=Ig(t),{html:Tg[i],richText:Mg[i]}),s=[],l=t.blocks||[];me(!l||J(l)),l=l||[];var u=e.orderMode;if(t.sortBlocks&&u){l=l.slice();var c={valueAsc:"asc",valueDesc:"desc"};if(Ae(c,u)){var h=new $f(c[u],null);l.sort((function(e,t){return h.evaluate(e.sortParam,t.sortParam)}))}else"seriesDesc"===u&&l.reverse()}W(l,(function(n,i){var o=t.valueFormatter,l=Ag(n)(o?z(z({},e),{valueFormatter:o}):e,n,i>0?a.html:0,r);null!=l&&s.push(l)}));var d="richText"===e.renderMode?s.join(a.richText):Pg(s.join(""),o?n:a.html);if(o)return d;var p=Rd(t.header,"ordinal",e.useUTC),f=Sg(r,e.renderMode).nameStyle;return"richText"===e.renderMode?Og(e,p,f)+a.richText+d:Pg('<div style="'+f+";"+wg+';">'+dt(p)+"</div>"+d,n)}function Lg(e,t,n,r){var i=e.renderMode,o=t.noName,a=t.noValue,s=!t.markerType,l=t.name,u=e.useUTC,c=t.valueFormatter||e.valueFormatter||function(e){return j(e=J(e)?e:[e],(function(e,t){return Rd(e,J(p)?p[t]:p,u)}))};if(!o||!a){var h=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||"#333",i),d=o?"":Rd(l,"ordinal",u),p=t.valueType,f=a?[]:c(t.value,t.dataIndex),g=!s||!o,m=!s&&o,v=Sg(r,i),y=v.nameStyle,_=v.valueStyle;return"richText"===i?(s?"":h)+(o?"":Og(e,d,y))+(a?"":function(e,t,n,r,i){var o=[i],a=r?10:20;return n&&o.push({padding:[0,0,0,a],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(J(t)?t.join(" "):t,o)}(e,f,g,m,_)):Pg((s?"":h)+(o?"":function(e,t,n){return'<span style="'+n+";"+(t?"margin-left:2px":"")+'">'+dt(e)+"</span>"}(d,!s,y))+(a?"":function(e,t,n,r){var i=n?"10px":"20px",o=t?"float:right;margin-left:"+i:"";return e=J(e)?e:[e],'<span style="'+o+";"+r+'">'+j(e,(function(e){return dt(e)})).join("&nbsp;&nbsp;")+"</span>"}(f,g,m,_)),n)}}function Ng(e,t,n,r,i,o){if(e)return Ag(e)({useUTC:i,renderMode:n,orderMode:r,markupStyleCreator:t,valueFormatter:e.valueFormatter},e,0,o)}function Pg(e,t){return'<div style="'+("margin: "+t+"px 0 0")+";"+wg+';">'+e+'<div style="clear:both"></div></div>'}function Og(e,t,n){return e.markupStyleCreator.wrapRichTextStyle(t,n)}function Rg(e,t){return Gd(e.getData().getItemVisual(t,"style")[e.visualDrawType])}function kg(e,t){var n=e.get("padding");return null!=n?n:"richText"===t?[8,10]:10}var zg=function(){function e(){this.richTextStyles={},this._nextStyleNameId=Co()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var r="richText"===n?this._generateStyleName():null,i=Bd({color:t,type:e,renderMode:n,markerId:r});return ee(i)?i:("production"!==process.env.NODE_ENV&&me(r),this.richTextStyles[r]=i.style,i.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};J(t)?W(t,(function(e){return z(n,e)})):z(n,t);var r=this._generateStyleName();return this.richTextStyles[r]=n,"{"+r+"|"+e+"}"},e}();function Vg(e){var t,n,r,i,o=e.series,a=e.dataIndex,s=e.multipleSeries,l=o.getData(),u=l.mapDimensionsAll("defaultedTooltip"),c=u.length,h=o.getRawValue(a),d=J(h),p=Rg(o,a);if(c>1||d&&!c){var f=function(e,t,n,r,i){var o=t.getData(),a=X(e,(function(e,t,n){var r=o.getDimensionInfo(n);return e||r&&!1!==r.tooltip&&null!=r.displayName}),!1),s=[],l=[],u=[];function c(e,t){var n=o.getDimensionInfo(t);n&&!1!==n.otherDims.tooltip&&(a?u.push(Cg("nameValue",{markerType:"subItem",markerColor:i,name:n.displayName,value:e,valueType:n.type})):(s.push(e),l.push(n.type)))}return r.length?W(r,(function(e){c(Bf(o,n,e),e)})):W(e,c),{inlineValues:s,inlineValueTypes:l,blocks:u}}(h,o,a,u,p);t=f.inlineValues,n=f.inlineValueTypes,r=f.blocks,i=f.inlineValues[0]}else if(c){var g=l.getDimensionInfo(u[0]);i=t=Bf(l,a,u[0]),n=g.type}else i=t=d?h[0]:h;var m=Jo(o),v=m&&o.name||"",y=l.getName(a),_=s?v:y;return Cg("section",{header:v,noHeader:s||!m,sortParam:i,blocks:[Cg("nameValue",{markerType:"item",markerColor:p,name:_,noName:!ve(_),value:t,valueType:n,dataIndex:a})].concat(r||[])})}var Bg=ta();function Fg(e,t){return e.getName(t)||e.getId(t)}var Gg="__universalTransitionEnabled",Hg=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return l(t,e),t.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=Uf({count:Wg,reset:jg}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(Bg(this).sourceManager=new yg(this)).prepareSource();var r=this.getInitialData(e,n);Yg(r,this),this.dataTask.context.data=r,"production"!==process.env.NODE_ENV&&me(r,"getInitialData returned invalid data."),Bg(this).dataBeforeProcessed=r,Ug(this),this._initSelectedMapFromData(r)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=Kd(this),r=n?Jd(e):{},i=this.subType;tp.hasClass(i)&&(i+="Series"),R(e,t.getTheme().get(this.subType)),R(e,this.getDefaultOption()),Ho(e,"label",["show"]),this.fillDataTextStyle(e.data),n&&$d(e,r,n)},t.prototype.mergeOption=function(e,t){e=R(this.option,e,!0),this.fillDataTextStyle(e.data);var n=Kd(this);n&&$d(this.option,e,n);var r=Bg(this).sourceManager;r.dirty(),r.prepareSource();var i=this.getInitialData(e,t);Yg(i,this),this.dataTask.dirty(),this.dataTask.context.data=i,Bg(this).dataBeforeProcessed=i,Ug(this),this._initSelectedMapFromData(i)},t.prototype.fillDataTextStyle=function(e){if(e&&!oe(e))for(var t=["show"],n=0;n<e.length;n++)e[n]&&e[n].label&&Ho(e[n],"label",t)},t.prototype.getInitialData=function(e,t){},t.prototype.appendData=function(e){this.getRawData().appendData(e.data)},t.prototype.getData=function(e){var t=qg(this);if(t){var n=t.context.data;return null!=e&&n.getLinkedData?n.getLinkedData(e):n}return Bg(this).data},t.prototype.getAllData=function(){var e=this.getData();return e&&e.getLinkedDataAll?e.getLinkedDataAll():[{data:e}]},t.prototype.setData=function(e){var t=qg(this);if(t){var n=t.context;n.outputData=e,t!==this.dataTask&&(n.data=e)}Bg(this).data=e},t.prototype.getEncode=function(){var e=this.get("encode",!0);if(e)return Te(e)},t.prototype.getSourceManager=function(){return Bg(this).sourceManager},t.prototype.getSource=function(){return this.getSourceManager().getSource()},t.prototype.getRawData=function(){return Bg(this).dataBeforeProcessed},t.prototype.getColorBy=function(){return this.get("colorBy")||"series"},t.prototype.isColorBySeries=function(){return"series"===this.getColorBy()},t.prototype.getBaseAxis=function(){var e=this.coordinateSystem;return e&&e.getBaseAxis&&e.getBaseAxis()},t.prototype.formatTooltip=function(e,t,n){return Vg({series:this,dataIndex:e,multipleSeries:t})},t.prototype.isAnimationEnabled=function(){var e=this.ecModel;if(d.node&&(!e||!e.ssr))return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),!!t},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,t,n){var r=this.ecModel,i=Ip.prototype.getColorFromPalette.call(this,e,t,n);return i||(i=r.getColorFromPalette(e,t,n)),i},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(e,t){this._innerSelect(this.getData(t),e)},t.prototype.unselect=function(e,t){var n=this.option.selectedMap;if(n){var r=this.option.selectedMode,i=this.getData(t);if("series"===r||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var o=0;o<e.length;o++){var a=Fg(i,e[o]);n[a]=!1,this._selectedDataIndicesMap[a]=-1}}},t.prototype.toggleSelect=function(e,t){for(var n=[],r=0;r<e.length;r++)n[0]=e[r],this.isSelected(e[r],t)?this.unselect(n,t):this.select(n,t)},t.prototype.getSelectedDataIndices=function(){if("all"===this.option.selectedMap)return[].slice.call(this.getData().getIndices());for(var e=this._selectedDataIndicesMap,t=q(e),n=[],r=0;r<t.length;r++){var i=e[t[r]];i>=0&&n.push(i)}return n},t.prototype.isSelected=function(e,t){var n=this.option.selectedMap;if(!n)return!1;var r=this.getData(t);return("all"===n||n[Fg(r,e)])&&!r.getItemModel(e).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[Gg])return!0;var e=this.option.universalTransition;return!!e&&(!0===e||e&&e.enabled)},t.prototype._innerSelect=function(e,t){var n,r,i=this.option,o=i.selectedMode,a=t.length;if(o&&a)if("series"===o)i.selectedMap="all";else if("multiple"===o){re(i.selectedMap)||(i.selectedMap={});for(var s=i.selectedMap,l=0;l<a;l++){var u=t[l];s[h=Fg(e,u)]=!0,this._selectedDataIndicesMap[h]=e.getRawIndex(u)}}else if("single"===o||!0===o){var c=t[a-1],h=Fg(e,c);i.selectedMap=((n={})[h]=!0,n),this._selectedDataIndicesMap=((r={})[h]=e.getRawIndex(c),r)}},t.prototype._initSelectedMapFromData=function(e){if(!this.option.selectedMap){var t=[];e.hasItemOption&&e.each((function(n){var r=e.getRawDataItem(n);r&&r.selected&&t.push(n)})),t.length>0&&this._innerSelect(e,t)}},t.registerClass=function(e){return tp.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type="series.__base__",e.seriesIndex=0,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol="circle",e.visualStyleAccessPath="itemStyle",e.visualDrawType="fill"}(),t}(tp);function Ug(e){var t=e.name;Jo(e)||(e.name=function(e){var t=e.getRawData(),n=t.mapDimensionsAll("seriesName"),r=[];return W(n,(function(e){var n=t.getDimensionInfo(e);n.displayName&&r.push(n.displayName)})),r.join(" ")}(e)||t)}function Wg(e){return e.model.getRawData().count()}function jg(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),Xg}function Xg(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function Yg(e,t){W(Me(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),(function(n){e.wrapMethod(n,$(Zg,t))}))}function Zg(e,t){var n=qg(e);return n&&n.setOutputEnd((t||this).count()),t}function qg(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var r=n.currentTask;if(r){var i=r.agentStubMap;i&&(r=i.get(e.uid))}return r}}H(Hg,Gf),H(Hg,Ip),ga(Hg,tp);var Kg=function(){function e(){this.group=new Yi,this.uid=Xh("viewComponent")}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){},e.prototype.updateLayout=function(e,t,n,r){},e.prototype.updateVisual=function(e,t,n,r){},e.prototype.toggleBlurSeries=function(e,t,n){},e.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},e}();function $g(){var e=ta();return function(t){var n=e(t),r=t.pipelineContext,i=!!n.large,o=!!n.progressiveRender,a=n.large=!(!r||!r.large),s=n.progressiveRender=!(!r||!r.progressiveRender);return!(i===a&&o===s)&&"reset"}}fa(Kg),_a(Kg);var Jg=ta(),Qg=$g(),em=function(){function e(){this.group=new Yi,this.uid=Xh("viewChart"),this.renderTask=Uf({plan:rm,reset:im}),this.renderTask.context={view:this}}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){if("production"!==process.env.NODE_ENV)throw new Error("render method must been implemented")},e.prototype.highlight=function(e,t,n,r){var i=e.getData(r&&r.dataType);i?nm(i,r,"emphasis"):"production"!==process.env.NODE_ENV&&Po("Unknown dataType "+r.dataType)},e.prototype.downplay=function(e,t,n,r){var i=e.getData(r&&r.dataType);i?nm(i,r,"normal"):"production"!==process.env.NODE_ENV&&Po("Unknown dataType "+r.dataType)},e.prototype.remove=function(e,t){this.group.removeAll()},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.updateLayout=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.updateVisual=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.eachRendered=function(e){gh(this.group,e)},e.markUpdateMethod=function(e,t){Jg(e).updateMethod=t},e.protoInitialize=void(e.prototype.type="chart"),e}();function tm(e,t,n){e&&mu(e)&&("emphasis"===t?Kl:$l)(e,n)}function nm(e,t,n){var r=ea(e,t),i=t&&null!=t.highlightKey?function(e){var t=Tl[e];return null==t&&Sl<=32&&(t=Tl[e]=Sl++),t}(t.highlightKey):null;null!=r?W(Go(r),(function(t){tm(e.getItemGraphicEl(t),n,i)})):e.eachItemGraphicEl((function(e){tm(e,n,i)}))}function rm(e){return Qg(e.model)}function im(e){var t=e.model,n=e.ecModel,r=e.api,i=e.payload,o=t.pipelineContext.progressiveRender,a=e.view,s=i&&Jg(i).updateMethod,l=o?"incrementalPrepareRender":s&&a[s]?s:"render";return"render"!==l&&a[l](t,n,r,i),om[l]}fa(em,["dispose"]),_a(em);var om={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},am="\0__throttleOriginMethod",sm="\0__throttleRate",lm="\0__throttleType";function um(e,t,n){var r,i,o,a,s,l=0,u=0,c=null;function h(){u=(new Date).getTime(),c=null,e.apply(o,a||[])}t=t||0;var d=function(){for(var e=[],d=0;d<arguments.length;d++)e[d]=arguments[d];r=(new Date).getTime(),o=this,a=e;var p=s||t,f=s||n;s=null,i=r-(f?l:u)-p,clearTimeout(c),f?c=setTimeout(h,p):i>=0?h():c=setTimeout(h,-i),l=r};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(e){s=e},d}function cm(e,t,n,r){var i=e[t];if(i){var o=i[am]||i,a=i[lm];if(i[sm]!==n||a!==r){if(null==n||!r)return e[t]=o;(i=e[t]=um(o,n,"debounce"===r))[am]=o,i[lm]=r,i[sm]=n}return i}}function hm(e,t){var n=e[t];n&&n[am]&&(n.clear&&n.clear(),e[t]=n[am])}var dm=ta(),pm={itemStyle:xa(Gh,!0),lineStyle:xa(Vh,!0)},fm={lineStyle:"stroke",itemStyle:"fill"};function gm(e,t){var n=e.visualStyleMapper||pm[t];return n||(console.warn("Unknown style type '"+t+"'."),pm.itemStyle)}function mm(e,t){var n=e.visualDrawType||fm[t];return n||(console.warn("Unknown style type '"+t+"'."),"fill")}var vm={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),r=e.visualStyleAccessPath||"itemStyle",i=e.getModel(r),o=gm(e,r)(i),a=i.getShallow("decal");a&&(n.setVisual("decal",a),a.dirty=!0);var s=mm(e,r),l=o[s],u=Q(l)?l:null,c="auto"===o.fill||"auto"===o.stroke;if(!o[s]||u||c){var h=e.getColorFromPalette(e.name,null,t.getSeriesCount());o[s]||(o[s]=h,n.setVisual("colorFromPalette",!0)),o.fill="auto"===o.fill||Q(o.fill)?h:o.fill,o.stroke="auto"===o.stroke||Q(o.stroke)?h:o.stroke}if(n.setVisual("style",o),n.setVisual("drawType",s),!t.isSeriesFiltered(e)&&u)return n.setVisual("colorFromPalette",!1),{dataEach:function(t,n){var r=e.getDataParams(n),i=z({},o);i[s]=u(r),t.setItemVisual(n,"style",i)}}}},ym=new Wh,_m={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!e.ignoreStyleOnData&&!t.isSeriesFiltered(e)){var n=e.getData(),r=e.visualStyleAccessPath||"itemStyle",i=gm(e,r),o=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[r]){ym.option=n[r];var a=i(ym);z(e.ensureUniqueItemVisual(t,"style"),a),ym.option.decal&&(e.setItemVisual(t,"decal",ym.option.decal),ym.option.decal.dirty=!0),o in a&&e.setItemVisual(t,"colorFromPalette",!1)}}:null}}}},xm={performRawSeries:!0,overallReset:function(e){var t=Te();e.eachSeries((function(e){var n=e.getColorBy();if(!e.isColorBySeries()){var r=e.type+"-"+n,i=t.get(r);i||(i={},t.set(r,i)),dm(e).scope=i}})),e.eachSeries((function(t){if(!t.isColorBySeries()&&!e.isSeriesFiltered(t)){var n=t.getRawData(),r={},i=t.getData(),o=dm(t).scope,a=t.visualStyleAccessPath||"itemStyle",s=mm(t,a);i.each((function(e){var t=i.getRawIndex(e);r[t]=e})),n.each((function(e){var a=r[e];if(i.getItemVisual(a,"colorFromPalette")){var l=i.ensureUniqueItemVisual(a,"style"),u=n.getName(e)||e+"",c=n.count();l[s]=t.getColorFromPalette(u,o,c)}}))}}))}},bm=Math.PI;var wm=function(){function e(e,t,n,r){this._stageTaskMap=Te(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),r=this._visualHandlers=r.slice(),this._allHandlers=n.concat(r)}return e.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each((function(e){var t=e.overallTask;t&&t.dirty()}))},e.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),r=n.context,i=!t&&n.progressiveEnabled&&(!r||r.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,o=r&&r.modDataCount;return{step:i,modBy:null!=o?Math.ceil(o/i):null,modDataCount:o}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid),r=e.getData().count(),i=n.progressiveEnabled&&t.incrementalPrepareRender&&r>=n.threshold,o=e.get("large")&&r>=e.get("largeThreshold"),a="mod"===e.get("progressiveChunkMode")?r:null;e.pipelineContext=n.context={progressiveRender:i,modDataCount:a,large:o}},e.prototype.restorePipelines=function(e){var t=this,n=t._pipelineMap=Te();e.eachSeries((function(e){var r=e.getProgressive(),i=e.uid;n.set(i,{id:i,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:r&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(r||700),count:0}),t._pipe(e,e.dataTask)}))},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;W(this._allHandlers,(function(r){var i=e.get(r.uid)||e.set(r.uid,{}),o="";"production"!==process.env.NODE_ENV&&(o='"reset" and "overallReset" must not be both specified.'),me(!(r.reset&&r.overallReset),o),r.reset&&this._createSeriesStageTask(r,i,t,n),r.overallReset&&this._createOverallStageTask(r,i,t,n)}),this)},e.prototype.prepareView=function(e,t,n,r){var i=e.renderTask,o=i.context;o.model=t,o.ecModel=n,o.api=r,i.__block=!e.incrementalPrepareRender,this._pipe(t,i)},e.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},e.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},e.prototype._performStageTasks=function(e,t,n,r){r=r||{};var i=!1,o=this;function a(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}W(e,(function(e,s){if(!r.visualType||r.visualType===e.visualType){var l=o._stageTaskMap.get(e.uid),u=l.seriesTaskMap,c=l.overallTask;if(c){var h,d=c.agentStubMap;d.each((function(e){a(r,e)&&(e.dirty(),h=!0)})),h&&c.dirty(),o.updatePayload(c,n);var p=o.getPerformArgs(c,r.block);d.each((function(e){e.perform(p)})),c.perform(p)&&(i=!0)}else u&&u.each((function(s,l){a(r,s)&&s.dirty();var u=o.getPerformArgs(s,r.block);u.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),o.updatePayload(s,n),s.perform(u)&&(i=!0)}))}})),this.unfinished=i||this.unfinished},e.prototype.performSeriesTasks=function(e){var t;e.eachSeries((function(e){t=e.dataTask.perform()||t})),this.unfinished=t||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each((function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)}))},e.prototype.updatePayload=function(e,t){"remain"!==t&&(e.context.payload=t)},e.prototype._createSeriesStageTask=function(e,t,n,r){var i=this,o=t.seriesTaskMap,a=t.seriesTaskMap=Te(),s=e.seriesType,l=e.getTargetSeries;function u(t){var s=t.uid,l=a.set(s,o&&o.get(s)||Uf({plan:Dm,reset:Am,count:Lm}));l.context={model:t,ecModel:n,api:r,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:i},i._pipe(t,l)}e.createOnAllSeries?n.eachRawSeries(u):s?n.eachRawSeriesByType(s,u):l&&l(n,r).each(u)},e.prototype._createOverallStageTask=function(e,t,n,r){var i=this,o=t.overallTask=t.overallTask||Uf({reset:Sm});o.context={ecModel:n,api:r,overallReset:e.overallReset,scheduler:i};var a=o.agentStubMap,s=o.agentStubMap=Te(),l=e.seriesType,u=e.getTargetSeries,c=!0,h=!1,d="";function p(e){var t=e.uid,n=s.set(t,a&&a.get(t)||(h=!0,Uf({reset:Tm,onDirty:Cm})));n.context={model:e,overallProgress:c},n.agent=o,n.__block=c,i._pipe(e,n)}"production"!==process.env.NODE_ENV&&(d='"createOnAllSeries" is not supported for "overallReset", because it will block all streams.'),me(!e.createOnAllSeries,d),l?n.eachRawSeriesByType(l,p):u?u(n,r).each(p):(c=!1,W(n.getSeries(),p)),h&&o.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,r=this._pipelineMap.get(n);!r.head&&(r.head=t),r.tail&&r.tail.pipe(t),r.tail=t,t.__idxInPipeline=r.count++,t.__pipeline=r},e.wrapStageHandler=function(e,t){return Q(e)&&(e={overallReset:e,seriesType:Nm(e)}),e.uid=Xh("stageHandler"),t&&(e.visualType=t),e},e}();function Sm(e){e.overallReset(e.ecModel,e.api,e.payload)}function Tm(e){return e.overallProgress&&Mm}function Mm(){this.agent.dirty(),this.getDownstream().dirty()}function Cm(){this.agent&&this.agent.dirty()}function Dm(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function Am(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=Go(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?j(t,(function(e,t){return Em(t)})):Im}var Im=Em(0);function Em(e){return function(t,n){var r=n.data,i=n.resetDefines[e];if(i&&i.dataEach)for(var o=t.start;o<t.end;o++)i.dataEach(r,o);else i&&i.progress&&i.progress(t,r)}}function Lm(e){return e.data.count()}function Nm(e){Pm=null;try{e(Om,Rm)}catch(e){}return Pm}var Pm,Om={},Rm={};function km(e,t){for(var n in t.prototype)e[n]=Ie}km(Om,kp),km(Rm,Gp),Om.eachSeriesByType=Om.eachRawSeriesByType=function(e){Pm=e},Om.eachComponent=function(e){"series"===e.mainType&&e.subType&&(Pm=e.subType)};var zm=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],Vm={color:zm,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],zm]},Bm="#B9B8CE",Fm="#100C2A",Gm=function(){return{axisLine:{lineStyle:{color:Bm}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},Hm=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],Um={darkMode:!0,color:Hm,backgroundColor:Fm,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:Bm}},textStyle:{color:Bm},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:Bm}},dataZoom:{borderColor:"#71708A",textStyle:{color:Bm},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:Bm}},timeline:{lineStyle:{color:Bm},label:{color:Bm},controlStyle:{color:Bm,borderColor:Bm}},calendar:{itemStyle:{color:Fm},dayLabel:{color:Bm},monthLabel:{color:Bm},yearLabel:{color:Bm}},timeAxis:Gm(),logAxis:Gm(),valueAxis:Gm(),categoryAxis:Gm(),line:{symbol:"circle"},graph:{color:Hm},gauge:{title:{color:Bm},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:Bm},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};Um.categoryAxis.splitLine.show=!1;var Wm=function(){function e(){}return e.prototype.normalizeQuery=function(e){var t={},n={},r={};if(ee(e)){var i=pa(e);t.mainType=i.main||null,t.subType=i.sub||null}else{var o=["Index","Name","Id"],a={name:1,dataIndex:1,dataType:1};W(e,(function(e,i){for(var s=!1,l=0;l<o.length;l++){var u=o[l],c=i.lastIndexOf(u);if(c>0&&c===i.length-u.length){var h=i.slice(0,c);"data"!==h&&(t.mainType=h,t[u.toLowerCase()]=e,s=!0)}}a.hasOwnProperty(i)&&(n[i]=e,s=!0),s||(r[i]=e)}))}return{cptQuery:t,dataQuery:n,otherQuery:r}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var r=n.targetEl,i=n.packedEvent,o=n.model,a=n.view;if(!o||!a)return!0;var s=t.cptQuery,l=t.dataQuery;return u(s,o,"mainType")&&u(s,o,"subType")&&u(s,o,"index","componentIndex")&&u(s,o,"name")&&u(s,o,"id")&&u(l,i,"name")&&u(l,i,"dataIndex")&&u(l,i,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(e,t.otherQuery,r,i));function u(e,t,n,r){return null==e[n]||t[r||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),jm=["symbol","symbolSize","symbolRotate","symbolOffset"],Xm=jm.concat(["symbolKeepAspect"]),Ym={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendIcon&&n.setVisual("legendIcon",e.legendIcon),e.hasSymbolVisual){for(var r={},i={},o=!1,a=0;a<jm.length;a++){var s=jm[a],l=e.get(s);Q(l)?(o=!0,i[s]=l):r[s]=l}if(r.symbol=r.symbol||e.defaultSymbol,n.setVisual(z({legendIcon:e.legendIcon||r.symbol,symbolKeepAspect:e.get("symbolKeepAspect")},r)),!t.isSeriesFiltered(e)){var u=q(i);return{dataEach:o?function(t,n){for(var r=e.getRawValue(n),o=e.getDataParams(n),a=0;a<u.length;a++){var s=u[a];t.setItemVisual(n,s,i[s](r,o))}}:null}}}}},Zm={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(e.hasSymbolVisual&&!t.isSeriesFiltered(e))return{dataEach:e.getData().hasItemOption?function(e,t){for(var n=e.getItemModel(t),r=0;r<Xm.length;r++){var i=Xm[r],o=n.getShallow(i,!0);null!=o&&e.setItemVisual(t,i,o)}}:null}}};function qm(e,t,n){switch(n){case"color":return e.getItemVisual(t,"style")[e.getVisual("drawType")];case"opacity":return e.getItemVisual(t,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return e.getItemVisual(t,n);default:"production"!==process.env.NODE_ENV&&console.warn("Unknown visual type "+n)}}function Km(e,t){switch(t){case"color":return e.getVisual("style")[e.getVisual("drawType")];case"opacity":return e.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return e.getVisual(t);default:"production"!==process.env.NODE_ENV&&console.warn("Unknown visual type "+t)}}function $m(e,t,n,r){switch(n){case"color":e.ensureUniqueItemVisual(t,"style")[e.getVisual("drawType")]=r,e.setItemVisual(t,"colorFromPalette",!1);break;case"opacity":e.ensureUniqueItemVisual(t,"style").opacity=r;break;case"symbol":case"symbolSize":case"liftZ":e.setItemVisual(t,n,r);break;default:"production"!==process.env.NODE_ENV&&console.warn("Unknown visual type "+n)}}function Jm(e,t){function n(t,n){var r=[];return t.eachComponent({mainType:"series",subType:e,query:n},(function(e){r.push(e.seriesIndex)})),r}W([[e+"ToggleSelect","toggleSelect"],[e+"Select","select"],[e+"UnSelect","unselect"]],(function(e){t(e[0],(function(t,r,i){t=z({},t),"production"!==process.env.NODE_ENV&&Ro(t.type,e[1]),i.dispatchAction(z(t,{type:e[1],seriesIndex:n(r,t)}))}))}))}function Qm(e,t,n,r,i){var o=e+t;n.isSilent(o)||("production"!==process.env.NODE_ENV&&Oo("event "+o+" is deprecated."),r.eachComponent({mainType:"series",subType:"pie"},(function(e){for(var t=e.seriesIndex,r=e.option.selectedMap,a=i.selected,s=0;s<a.length;s++)if(a[s].seriesIndex===t){var l=e.getData(),u=ea(l,i.fromActionPayload);n.trigger(o,{type:o,seriesId:e.id,name:J(u)?l.getName(u[0]):l.getName(u),selected:ee(r)?r:z({},r)})}})))}function ev(e,t,n){for(var r;e&&(!t(e)||(r=e,!n));)e=e.__hostTarget||e.parent;return r}var tv=Math.round(9*Math.random()),nv="function"==typeof Object.defineProperty,rv=function(){function e(){this._id="__ec_inner_"+tv++}return e.prototype.get=function(e){return this._guard(e)[this._id]},e.prototype.set=function(e,t){var n=this._guard(e);return nv?Object.defineProperty(n,this._id,{value:t,enumerable:!1,configurable:!0}):n[this._id]=t,this},e.prototype.delete=function(e){return!!this.has(e)&&(delete this._guard(e)[this._id],!0)},e.prototype.has=function(e){return!!this._guard(e)[this._id]},e.prototype._guard=function(e){if(e!==Object(e))throw TypeError("Value of WeakMap is not a non-null object.");return e},e}(),iv=Ys.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,o=t.height/2;e.moveTo(n,r-o),e.lineTo(n+i,r+o),e.lineTo(n-i,r+o),e.closePath()}}),ov=Ys.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,o=t.height/2;e.moveTo(n,r-o),e.lineTo(n+i,r),e.lineTo(n,r+o),e.lineTo(n-i,r),e.closePath()}}),av=Ys.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.x,r=t.y,i=t.width/5*3,o=Math.max(i,t.height),a=i/2,s=a*a/(o-a),l=r-o+a+s,u=Math.asin(s/a),c=Math.cos(u)*a,h=Math.sin(u),d=Math.cos(u),p=.6*a,f=.7*a;e.moveTo(n-c,l+s),e.arc(n,l,a,Math.PI-u,2*Math.PI+u),e.bezierCurveTo(n+c-h*p,l+s+d*p,n,r-f,n,r),e.bezierCurveTo(n,r-f,n-c+h*p,l+s+d*p,n-c,l+s),e.closePath()}}),sv=Ys.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.height,r=t.width,i=t.x,o=t.y,a=r/3*2;e.moveTo(i,o),e.lineTo(i+a,o+n),e.lineTo(i,o+n/4*3),e.lineTo(i-a,o+n),e.lineTo(i,o),e.closePath()}}),lv={line:function(e,t,n,r,i){i.x1=e,i.y1=t+r/2,i.x2=e+n,i.y2=t+r/2},rect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r},roundRect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r,i.r=Math.min(n,r)/4},square:function(e,t,n,r,i){var o=Math.min(n,r);i.x=e,i.y=t,i.width=o,i.height=o},circle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.r=Math.min(n,r)/2},diamond:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r},pin:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},arrow:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},triangle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r}},uv={};W({line:pc,rect:ol,roundRect:ol,square:ol,circle:Fu,diamond:ov,pin:av,arrow:sv,triangle:iv},(function(e,t){uv[t]=new e}));var cv=Ys.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,n){var r=ki(e,t,n),i=this.shape;return i&&"pin"===i.symbolType&&"inside"===t.position&&(r.y=n.y+.4*n.height),r},buildPath:function(e,t,n){var r=t.symbolType;if("none"!==r){var i=uv[r];i||(i=uv[r="rect"]),lv[r](t.x,t.y,t.width,t.height,i.shape),i.buildPath(e,i.shape,n)}}});function hv(e,t){if("image"!==this.type){var n=this.style;this.__isEmptyBrush?(n.stroke=e,n.fill=t||"#fff",n.lineWidth=2):"line"===this.shape.symbolType?n.stroke=e:n.fill=e,this.markRedraw()}}function dv(e,t,n,r,i,o,a){var s,l=0===e.indexOf("empty");return l&&(e=e.substr(5,1).toLowerCase()+e.substr(6)),(s=0===e.indexOf("image://")?Kc(e.slice(8),new jt(t,n,r,i),a?"center":"cover"):0===e.indexOf("path://")?qc(e.slice(7),{},new jt(t,n,r,i),a?"center":"cover"):new cv({shape:{symbolType:e,x:t,y:n,width:r,height:i}})).__isEmptyBrush=l,s.setColor=hv,o&&s.setColor(o),s}function pv(e){return J(e)||(e=[+e,+e]),[e[0]||0,e[1]||0]}function fv(e,t){if(null!=e)return J(e)||(e=[e,e]),[oo(e[0],t[0])||0,oo(de(e[1],e[0]),t[1])||0]}function gv(e){return isFinite(e)}function mv(e,t,n){for(var r="radial"===t.type?function(e,t,n){var r=n.width,i=n.height,o=Math.min(r,i),a=null==t.x?.5:t.x,s=null==t.y?.5:t.y,l=null==t.r?.5:t.r;return t.global||(a=a*r+n.x,s=s*i+n.y,l*=o),a=gv(a)?a:.5,s=gv(s)?s:.5,l=l>=0&&gv(l)?l:.5,e.createRadialGradient(a,s,0,a,s,l)}(e,t,n):function(e,t,n){var r=null==t.x?0:t.x,i=null==t.x2?1:t.x2,o=null==t.y?0:t.y,a=null==t.y2?0:t.y2;return t.global||(r=r*n.width+n.x,i=i*n.width+n.x,o=o*n.height+n.y,a=a*n.height+n.y),r=gv(r)?r:0,i=gv(i)?i:1,o=gv(o)?o:0,a=gv(a)?a:0,e.createLinearGradient(r,o,i,a)}(e,t,n),i=t.colorStops,o=0;o<i.length;o++)r.addColorStop(i[o].offset,i[o].color);return r}function vv(e){return parseInt(e,10)}function yv(e,t,n){var r=["width","height"][t],i=["clientWidth","clientHeight"][t],o=["paddingLeft","paddingTop"][t],a=["paddingRight","paddingBottom"][t];if(null!=n[r]&&"auto"!==n[r])return parseFloat(n[r]);var s=document.defaultView.getComputedStyle(e);return(e[i]||vv(s[r])||vv(e.style[r]))-(vv(s[o])||0)-(vv(s[a])||0)|0}function _v(e){var t,n,r=e.style,i=r.lineDash&&r.lineWidth>0&&(t=r.lineDash,n=r.lineWidth,t&&"solid"!==t&&n>0?"dashed"===t?[4*n,2*n]:"dotted"===t?[n]:ne(t)?[t]:J(t)?t:null:null),o=r.lineDashOffset;if(i){var a=r.strokeNoScale&&e.getLineScale?e.getLineScale():1;a&&1!==a&&(i=j(i,(function(e){return e/a})),o/=a)}return[i,o]}var xv=new Ds(!0);function bv(e){var t=e.stroke;return!(null==t||"none"===t||!(e.lineWidth>0))}function wv(e){return"string"==typeof e&&"none"!==e}function Sv(e){var t=e.fill;return null!=t&&"none"!==t}function Tv(e,t){if(null!=t.fillOpacity&&1!==t.fillOpacity){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function Mv(e,t){if(null!=t.strokeOpacity&&1!==t.strokeOpacity){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function Cv(e,t,n){var r=Ma(t.image,t.__image,n);if(Da(r)){var i=e.createPattern(r,t.repeat||"repeat");if("function"==typeof DOMMatrix&&i&&i.setTransform){var o=new DOMMatrix;o.translateSelf(t.x||0,t.y||0),o.rotateSelf(0,0,(t.rotation||0)*Ee),o.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(o)}return i}}var Dv=["shadowBlur","shadowOffsetX","shadowOffsetY"],Av=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function Iv(e,t,n,r,i){var o=!1;if(!r&&t===(n=n||{}))return!1;if(r||t.opacity!==n.opacity){Nv(e,i),o=!0;var a=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(a)?Ga.opacity:a}(r||t.blend!==n.blend)&&(o||(Nv(e,i),o=!0),e.globalCompositeOperation=t.blend||Ga.blend);for(var s=0;s<Dv.length;s++){var l=Dv[s];(r||t[l]!==n[l])&&(o||(Nv(e,i),o=!0),e[l]=e.dpr*(t[l]||0))}return(r||t.shadowColor!==n.shadowColor)&&(o||(Nv(e,i),o=!0),e.shadowColor=t.shadowColor||Ga.shadowColor),o}function Ev(e,t,n,r,i){var o=Pv(t,i.inHover),a=r?null:n&&Pv(n,i.inHover)||{};if(o===a)return!1;var s=Iv(e,o,a,r,i);if((r||o.fill!==a.fill)&&(s||(Nv(e,i),s=!0),wv(o.fill)&&(e.fillStyle=o.fill)),(r||o.stroke!==a.stroke)&&(s||(Nv(e,i),s=!0),wv(o.stroke)&&(e.strokeStyle=o.stroke)),(r||o.opacity!==a.opacity)&&(s||(Nv(e,i),s=!0),e.globalAlpha=null==o.opacity?1:o.opacity),t.hasStroke()){var l=o.lineWidth/(o.strokeNoScale&&t.getLineScale?t.getLineScale():1);e.lineWidth!==l&&(s||(Nv(e,i),s=!0),e.lineWidth=l)}for(var u=0;u<Av.length;u++){var c=Av[u],h=c[0];(r||o[h]!==a[h])&&(s||(Nv(e,i),s=!0),e[h]=o[h]||c[1])}return s}function Lv(e,t){var n=t.transform,r=e.dpr||1;n?e.setTransform(r*n[0],r*n[1],r*n[2],r*n[3],r*n[4],r*n[5]):e.setTransform(r,0,0,r,0,0)}function Nv(e,t){t.batchFill&&e.fill(),t.batchStroke&&e.stroke(),t.batchFill="",t.batchStroke=""}function Pv(e,t){return t&&e.__hoverStyle||e.style}function Ov(e,t){Rv(e,t,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function Rv(e,t,n,r){var i=t.transform;if(!t.shouldBePainted(n.viewWidth,n.viewHeight,!1,!1))return t.__dirty&=-2,void(t.__isRendered=!1);var o=t.__clipPaths,a=n.prevElClipPaths,s=!1,l=!1;if(a&&!function(e,t){if(e===t||!e&&!t)return!1;if(!e||!t||e.length!==t.length)return!0;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}(o,a)||(a&&a.length&&(Nv(e,n),e.restore(),l=s=!0,n.prevElClipPaths=null,n.allClipped=!1,n.prevEl=null),o&&o.length&&(Nv(e,n),e.save(),function(e,t,n){for(var r=!1,i=0;i<e.length;i++){var o=e[i];r=r||o.isZeroArea(),Lv(t,o),t.beginPath(),o.buildPath(t,o.shape),t.clip()}n.allClipped=r}(o,e,n),s=!0),n.prevElClipPaths=o),n.allClipped)t.__isRendered=!1;else{t.beforeBrush&&t.beforeBrush(),t.innerBeforeBrush();var u=n.prevEl;u||(l=s=!0);var c,h,d=t instanceof Ys&&t.autoBatch&&function(e){var t=Sv(e),n=bv(e);return!(e.lineDash||!(+t^+n)||t&&"string"!=typeof e.fill||n&&"string"!=typeof e.stroke||e.strokePercent<1||e.strokeOpacity<1||e.fillOpacity<1)}(t.style);s||(c=i,h=u.transform,c&&h?c[0]!==h[0]||c[1]!==h[1]||c[2]!==h[2]||c[3]!==h[3]||c[4]!==h[4]||c[5]!==h[5]:c||h)?(Nv(e,n),Lv(e,t)):d||Nv(e,n);var p=Pv(t,n.inHover);t instanceof Ys?(1!==n.lastDrawType&&(l=!0,n.lastDrawType=1),Ev(e,t,u,l,n),d&&(n.batchFill||n.batchStroke)||e.beginPath(),function(e,t,n,r){var i,o=bv(n),a=Sv(n),s=n.strokePercent,l=s<1,u=!t.path;t.silent&&!l||!u||t.createPathProxy();var c=t.path||xv,h=t.__dirty;if(!r){var d=n.fill,p=n.stroke,f=a&&!!d.colorStops,g=o&&!!p.colorStops,m=a&&!!d.image,v=o&&!!p.image,y=void 0,_=void 0,x=void 0,b=void 0,w=void 0;(f||g)&&(w=t.getBoundingRect()),f&&(y=h?mv(e,d,w):t.__canvasFillGradient,t.__canvasFillGradient=y),g&&(_=h?mv(e,p,w):t.__canvasStrokeGradient,t.__canvasStrokeGradient=_),m&&(x=h||!t.__canvasFillPattern?Cv(e,d,t):t.__canvasFillPattern,t.__canvasFillPattern=x),v&&(b=h||!t.__canvasStrokePattern?Cv(e,p,t):t.__canvasStrokePattern,t.__canvasStrokePattern=x),f?e.fillStyle=y:m&&(x?e.fillStyle=x:a=!1),g?e.strokeStyle=_:v&&(b?e.strokeStyle=b:o=!1)}var S,T,M=t.getGlobalScale();c.setScale(M[0],M[1],t.segmentIgnoreThreshold),e.setLineDash&&n.lineDash&&(S=(i=_v(t))[0],T=i[1]);var C=!0;(u||4&h)&&(c.setDPR(e.dpr),l?c.setContext(null):(c.setContext(e),C=!1),c.reset(),t.buildPath(c,t.shape,r),c.toStatic(),t.pathUpdated()),C&&c.rebuildPath(e,l?s:1),S&&(e.setLineDash(S),e.lineDashOffset=T),r||(n.strokeFirst?(o&&Mv(e,n),a&&Tv(e,n)):(a&&Tv(e,n),o&&Mv(e,n))),S&&e.setLineDash([])}(e,t,p,d),d&&(n.batchFill=p.fill||"",n.batchStroke=p.stroke||"")):t instanceof qs?(3!==n.lastDrawType&&(l=!0,n.lastDrawType=3),Ev(e,t,u,l,n),function(e,t,n){var r,i=n.text;if(null!=i&&(i+=""),i){e.font=n.font||f,e.textAlign=n.textAlign,e.textBaseline=n.textBaseline;var o=void 0,a=void 0;e.setLineDash&&n.lineDash&&(o=(r=_v(t))[0],a=r[1]),o&&(e.setLineDash(o),e.lineDashOffset=a),n.strokeFirst?(bv(n)&&e.strokeText(i,n.x,n.y),Sv(n)&&e.fillText(i,n.x,n.y)):(Sv(n)&&e.fillText(i,n.x,n.y),bv(n)&&e.strokeText(i,n.x,n.y)),o&&e.setLineDash([])}}(e,t,p)):t instanceof Js?(2!==n.lastDrawType&&(l=!0,n.lastDrawType=2),function(e,t,n,r,i){Iv(e,Pv(t,i.inHover),n&&Pv(n,i.inHover),r,i)}(e,t,u,l,n),function(e,t,n){var r=t.__image=Ma(n.image,t.__image,t,t.onload);if(r&&Da(r)){var i=n.x||0,o=n.y||0,a=t.getWidth(),s=t.getHeight(),l=r.width/r.height;if(null==a&&null!=s?a=s*l:null==s&&null!=a?s=a/l:null==a&&null==s&&(a=r.width,s=r.height),n.sWidth&&n.sHeight){var u=n.sx||0,c=n.sy||0;e.drawImage(r,u,c,n.sWidth,n.sHeight,i,o,a,s)}else if(n.sx&&n.sy){var h=a-(u=n.sx),d=s-(c=n.sy);e.drawImage(r,u,c,h,d,i,o,a,s)}else e.drawImage(r,i,o,a,s)}}(e,t,p)):t.getTemporalDisplayables&&(4!==n.lastDrawType&&(l=!0,n.lastDrawType=4),function(e,t,n){var r=t.getDisplayables(),i=t.getTemporalDisplayables();e.save();var o,a,s={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:n.viewWidth,viewHeight:n.viewHeight,inHover:n.inHover};for(o=t.getCursor(),a=r.length;o<a;o++){(c=r[o]).beforeBrush&&c.beforeBrush(),c.innerBeforeBrush(),Rv(e,c,s,o===a-1),c.innerAfterBrush(),c.afterBrush&&c.afterBrush(),s.prevEl=c}for(var l=0,u=i.length;l<u;l++){var c;(c=i[l]).beforeBrush&&c.beforeBrush(),c.innerBeforeBrush(),Rv(e,c,s,l===u-1),c.innerAfterBrush(),c.afterBrush&&c.afterBrush(),s.prevEl=c}t.clearTemporalDisplayables(),t.notClear=!0,e.restore()}(e,t,n)),d&&r&&Nv(e,n),t.innerAfterBrush(),t.afterBrush&&t.afterBrush(),n.prevEl=t,t.__dirty=0,t.__isRendered=!0}}var kv=new rv,zv=new Wn(100),Vv=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function Bv(e,t){if("none"===e)return null;var n=t.getDevicePixelRatio(),r=t.getZr(),i="svg"===r.painter.type;e.dirty&&kv.delete(e);var o=kv.get(e);if(o)return o;var a=V(e,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});"none"===a.backgroundColor&&(a.backgroundColor=null);var s={repeat:"repeat"};return function(e){for(var t,o=[n],s=!0,l=0;l<Vv.length;++l){var u=a[Vv[l]];if(null!=u&&!J(u)&&!ee(u)&&!ne(u)&&"boolean"!=typeof u){s=!1;break}o.push(u)}if(s){t=o.join(",")+(i?"-svg":"");var c=zv.get(t);c&&(i?e.svgElement=c:e.image=c)}var h,d=Gv(a.dashArrayX),p=function(e){if(!e||"object"==typeof e&&0===e.length)return[0,0];if(ne(e)){var t=Math.ceil(e);return[t,t]}var n=j(e,(function(e){return Math.ceil(e)}));return e.length%2?n.concat(n):n}(a.dashArrayY),f=Fv(a.symbol),g=(b=d,j(b,(function(e){return Hv(e)}))),m=Hv(p),v=!i&&y.createCanvas(),_=i&&{tag:"g",attrs:{},key:"dcl",children:[]},x=function(){for(var e=1,t=0,n=g.length;t<n;++t)e=Ao(e,g[t]);var r=1;for(t=0,n=f.length;t<n;++t)r=Ao(r,f[t].length);e*=r;var i=m*g.length*f.length;if("production"!==process.env.NODE_ENV){var o=function(e){console.warn("Calculated decal size is greater than "+e+" due to decal option settings so "+e+" is used for the decal size. Please consider changing the decal option to make a smaller decal or set "+e+" to be larger to avoid incontinuity.")};e>a.maxTileWidth&&o("maxTileWidth"),i>a.maxTileHeight&&o("maxTileHeight")}return{width:Math.max(1,Math.min(e,a.maxTileWidth)),height:Math.max(1,Math.min(i,a.maxTileHeight))}}();var b;v&&(v.width=x.width*n,v.height=x.height*n,h=v.getContext("2d"));(function(){h&&(h.clearRect(0,0,v.width,v.height),a.backgroundColor&&(h.fillStyle=a.backgroundColor,h.fillRect(0,0,v.width,v.height)));for(var e=0,t=0;t<p.length;++t)e+=p[t];if(e<=0)return;var o=-m,s=0,l=0,u=0;for(;o<x.height;){if(s%2==0){for(var c=l/2%f.length,g=0,y=0,b=0;g<2*x.width;){var w=0;for(t=0;t<d[u].length;++t)w+=d[u][t];if(w<=0)break;if(y%2==0){var S=.5*(1-a.symbolSize),T=g+d[u][y]*S,M=o+p[s]*S,C=d[u][y]*a.symbolSize,D=p[s]*a.symbolSize,A=b/2%f[c].length;I(T,M,C,D,f[c][A])}g+=d[u][y],++b,++y===d[u].length&&(y=0)}++u===d.length&&(u=0)}o+=p[s],++l,++s===p.length&&(s=0)}function I(e,t,o,s,l){var u=i?1:n,c=dv(l,e*u,t*u,o*u,s*u,a.color,a.symbolKeepAspect);if(i){var d=r.painter.renderOneToVNode(c);d&&_.children.push(d)}else Ov(h,c)}})(),s&&zv.put(t,v||_);e.image=v,e.svgElement=_,e.svgWidth=x.width,e.svgHeight=x.height}(s),s.rotation=a.rotation,s.scaleX=s.scaleY=i?1:1/n,kv.set(e,s),e.dirty=!1,s}function Fv(e){if(!e||0===e.length)return[["rect"]];if(ee(e))return[[e]];for(var t=!0,n=0;n<e.length;++n)if(!ee(e[n])){t=!1;break}if(t)return Fv([e]);var r=[];for(n=0;n<e.length;++n)ee(e[n])?r.push([e[n]]):r.push(e[n]);return r}function Gv(e){if(!e||0===e.length)return[[0,0]];if(ne(e))return[[i=Math.ceil(e),i]];for(var t=!0,n=0;n<e.length;++n)if(!ne(e[n])){t=!1;break}if(t)return Gv([e]);var r=[];for(n=0;n<e.length;++n)if(ne(e[n])){var i=Math.ceil(e[n]);r.push([i,i])}else{(i=j(e[n],(function(e){return Math.ceil(e)}))).length%2==1?r.push(i.concat(i)):r.push(i)}return r}function Hv(e){for(var t=0,n=0;n<e.length;++n)t+=e[n];return e.length%2==1?2*t:t}var Uv=new nt,Wv={};function jv(e){return"production"!==process.env.NODE_ENV&&(Wv[e]||Po("Implementation of "+e+" doesn't exists.")),Wv[e]}var Xv=2e3,Yv=4500,Zv={PROCESSOR:{FILTER:1e3,SERIES_FILTER:800,STATISTIC:5e3},VISUAL:{LAYOUT:1e3,PROGRESSIVE_LAYOUT:1100,GLOBAL:Xv,CHART:3e3,POST_CHART_LAYOUT:4600,COMPONENT:4e3,BRUSH:5e3,CHART_ITEM:Yv,ARIA:6e3,DECAL:7e3}},qv="__flagInMainProcess",Kv="__pendingUpdate",$v="__needsUpdateStatus",Jv=/^[a-zA-Z0-9_]+$/,Qv="__connectUpdateStatus";function ey(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(!this.isDisposed())return ny(this,e,t);Cy(this.id)}}function ty(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return ny(this,e,t)}}function ny(e,t,n){return n[0]=n[0]&&n[0].toLowerCase(),nt.prototype[t].apply(e,n)}var ry,iy,oy,ay,sy,ly,uy,cy,hy,dy,py,fy,gy,my,vy,yy,_y,xy,by=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t}(nt),wy=by.prototype;wy.on=ty("on"),wy.off=ty("off");var Sy=function(e){function t(t,n,r){var i=e.call(this,new Wm)||this;i._chartsViews=[],i._chartsMap={},i._componentsViews=[],i._componentsMap={},i._pendingActions=[],r=r||{},ee(n)&&(n=Ny[n]),i._dom=t;var o="canvas",a="auto",s=!1;if("production"!==process.env.NODE_ENV){var l=d.hasGlobalWindow?window:global;l&&(o=de(l.__ECHARTS__DEFAULT__RENDERER__,o),a=de(l.__ECHARTS__DEFAULT__COARSE_POINTER,a),s=de(l.__ECHARTS__DEFAULT__USE_DIRTY_RECT__,s))}r.ssr&&to((function(e){var t=bl(e),n=t.dataIndex;if(null!=n){var r=Te();return r.set("series_index",t.seriesIndex),r.set("data_index",n),t.ssrType&&r.set("ssr_type",t.ssrType),r}}));var u=i._zr=Ji(t,{renderer:r.renderer||o,devicePixelRatio:r.devicePixelRatio,width:r.width,height:r.height,ssr:r.ssr,useDirtyRect:de(r.useDirtyRect,s),useCoarsePointer:de(r.useCoarsePointer,a),pointerSize:r.pointerSize});i._ssr=r.ssr,i._throttledZrFlush=um(K(u.flush,u),17),(n=O(n))&&pf(n,!0),i._theme=n,i._locale=function(e){if(ee(e)){var t=$h[e.toUpperCase()]||{};return e===Zh||e===qh?O(t):R(O(t),O($h[Kh]),!1)}return R(O(e),O($h[Kh]),!1)}(r.locale||Qh),i._coordSysMgr=new Up;var c=i._api=vy(i);function h(e,t){return e.__prio-t.__prio}return ln(Ly,h),ln(Iy,h),i._scheduler=new wm(i,c,Iy,Ly),i._messageCenter=new by,i._initEvents(),i.resize=K(i.resize,i),u.animation.on("frame",i._onframe,i),dy(u,i),py(u,i),_e(i),i}return l(t,e),t.prototype._onframe=function(){if(!this._disposed){xy(this);var e=this._scheduler;if(this[Kv]){var t=this[Kv].silent;this[qv]=!0;try{ry(this),ay.update.call(this,null,this[Kv].updateParams)}catch(e){throw this[qv]=!1,this[Kv]=null,e}this._zr.flush(),this[qv]=!1,this[Kv]=null,cy.call(this,t),hy.call(this,t)}else if(e.unfinished){var n=1,r=this._model,i=this._api;e.unfinished=!1;do{var o=+new Date;e.performSeriesTasks(r),e.performDataProcessorTasks(r),ly(this,r),e.performVisualTasks(r),my(this,this._model,i,"remain",{}),n-=+new Date-o}while(n>0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,t,n){if(this[qv])"production"!==process.env.NODE_ENV&&Po("`setOption` should not be called during main process.");else if(this._disposed)Cy(this.id);else{var r,i,o;if(re(t)&&(n=t.lazyUpdate,r=t.silent,i=t.replaceMerge,o=t.transition,t=t.notMerge),this[qv]=!0,!this._model||t){var a=new jp(this._api),s=this._theme,l=this._model=new kp;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(e,{replaceMerge:i},Ey);var u={seriesTransition:o,optionChanged:!0};if(n)this[Kv]={silent:r,updateParams:u},this[qv]=!1,this.getZr().wakeUp();else{try{ry(this),ay.update.call(this,null,u)}catch(e){throw this[Kv]=null,this[qv]=!1,e}this._ssr||this._zr.flush(),this[Kv]=null,this[qv]=!1,cy.call(this,r),hy.call(this,r)}}},t.prototype.setTheme=function(){Oo("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||d.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return"production"!==process.env.NODE_ENV&&Ro("getRenderedCanvas","renderToCanvas"),this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){e=e||{};var t=this._zr.painter;if("production"!==process.env.NODE_ENV&&"canvas"!==t.type)throw new Error("renderToCanvas can only be used in the canvas renderer.");return t.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get("backgroundColor"),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){e=e||{};var t=this._zr.painter;if("production"!==process.env.NODE_ENV&&"svg"!==t.type)throw new Error("renderToSVGString can only be used in the svg renderer.");return t.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){if(d.svgSupported){var e=this._zr;return W(e.storage.getDisplayList(),(function(e){e.stopAnimation(null,!0)})),e.painter.toDataURL()}},t.prototype.getDataURL=function(e){if(!this._disposed){var t=(e=e||{}).excludeComponents,n=this._model,r=[],i=this;W(t,(function(e){n.eachComponent({mainType:e},(function(e){var t=i._componentsMap[e.__viewId];t.group.ignore||(r.push(t),t.group.ignore=!0)}))}));var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return W(r,(function(e){e.group.ignore=!1})),o}Cy(this.id)},t.prototype.getConnectedDataURL=function(e){if(!this._disposed){var t="svg"===e.type,n=this.group,r=Math.min,i=Math.max,o=1/0;if(Ry[n]){var a=o,s=o,l=-1/0,u=-1/0,c=[],h=e&&e.pixelRatio||this.getDevicePixelRatio();W(Oy,(function(o,h){if(o.group===n){var d=t?o.getZr().painter.getSvgDom().innerHTML:o.renderToCanvas(O(e)),p=o.getDom().getBoundingClientRect();a=r(p.left,a),s=r(p.top,s),l=i(p.right,l),u=i(p.bottom,u),c.push({dom:d,left:p.left,top:p.top})}}));var d=(l*=h)-(a*=h),p=(u*=h)-(s*=h),f=y.createCanvas(),g=Ji(f,{renderer:t?"svg":"canvas"});if(g.resize({width:d,height:p}),t){var m="";return W(c,(function(e){var t=e.left-a,n=e.top-s;m+='<g transform="translate('+t+","+n+')">'+e.dom+"</g>"})),g.painter.getSvgRoot().innerHTML=m,e.connectedBackgroundColor&&g.painter.setBackgroundColor(e.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}return e.connectedBackgroundColor&&g.add(new ol({shape:{x:0,y:0,width:d,height:p},style:{fill:e.connectedBackgroundColor}})),W(c,(function(e){var t=new Js({style:{x:e.left*h-a,y:e.top*h-s,image:e.dom}});g.add(t)})),g.refreshImmediately(),f.toDataURL("image/"+(e&&e.type||"png"))}return this.getDataURL(e)}Cy(this.id)},t.prototype.convertToPixel=function(e,t){return sy(this,"convertToPixel",e,t)},t.prototype.convertFromPixel=function(e,t){return sy(this,"convertFromPixel",e,t)},t.prototype.containPixel=function(e,t){var n;if(!this._disposed)return W(ra(this._model,e),(function(e,r){r.indexOf("Models")>=0&&W(e,(function(e){var i=e.coordinateSystem;if(i&&i.containPoint)n=n||!!i.containPoint(t);else if("seriesModels"===r){var o=this._chartsMap[e.__viewId];o&&o.containPoint?n=n||o.containPoint(t,e):"production"!==process.env.NODE_ENV&&No(r+": "+(o?"The found component do not support containPoint.":"No view mapping to the found component."))}else"production"!==process.env.NODE_ENV&&No(r+": containPoint is not supported")}),this)}),this),!!n;Cy(this.id)},t.prototype.getVisual=function(e,t){var n=ra(this._model,e,{defaultMainType:"series"}),r=n.seriesModel;"production"!==process.env.NODE_ENV&&(r||No("There is no specified series model"));var i=r.getData(),o=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?i.indexOfRawIndex(n.dataIndex):null;return null!=o?qm(i,o,t):Km(i,t)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e,t,n,r=this;W(My,(function(e){var t=function(t){var n,i=r.getModel(),o=t.target,a="globalout"===e;if(a?n={}:o&&ev(o,(function(e){var t=bl(e);if(t&&null!=t.dataIndex){var r=t.dataModel||i.getSeriesByIndex(t.seriesIndex);return n=r&&r.getDataParams(t.dataIndex,t.dataType,o)||{},!0}if(t.eventData)return n=z({},t.eventData),!0}),!0),n){var s=n.componentType,l=n.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=n.seriesIndex);var u=s&&null!=l&&i.getComponent(s,l),c=u&&r["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];"production"!==process.env.NODE_ENV&&(a||u&&c||No("model or view can not be found by params")),n.event=t,n.type=e,r._$eventProcessor.eventInfo={targetEl:o,packedEvent:n,model:u,view:c},r.trigger(e,n)}};t.zrEventfulCallAtLast=!0,r._zr.on(e,t,r)})),W(Ay,(function(e,t){r._messageCenter.on(t,(function(e){this.trigger(t,e)}),r)})),W(["selectchanged"],(function(e){r._messageCenter.on(e,(function(t){this.trigger(e,t)}),r)})),e=this._messageCenter,t=this,n=this._api,e.on("selectchanged",(function(e){var r=n.getModel();e.isFromClick?(Qm("map","selectchanged",t,r,e),Qm("pie","selectchanged",t,r,e)):"select"===e.fromAction?(Qm("map","selected",t,r,e),Qm("pie","selected",t,r,e)):"unselect"===e.fromAction&&(Qm("map","unselected",t,r,e),Qm("pie","unselected",t,r,e))}))},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){this._disposed?Cy(this.id):this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed)Cy(this.id);else{this._disposed=!0,this.getDom()&&la(this.getDom(),Vy,"");var e=this,t=e._api,n=e._model;W(e._componentsViews,(function(e){e.dispose(n,t)})),W(e._chartsViews,(function(e){e.dispose(n,t)})),e._zr.dispose(),e._dom=e._model=e._chartsMap=e._componentsMap=e._chartsViews=e._componentsViews=e._scheduler=e._api=e._zr=e._throttledZrFlush=e._theme=e._coordSysMgr=e._messageCenter=null,delete Oy[e.id]}},t.prototype.resize=function(e){if(this[qv])"production"!==process.env.NODE_ENV&&Po("`resize` should not be called during main process.");else if(this._disposed)Cy(this.id);else{this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption("media"),r=e&&e.silent;this[Kv]&&(null==r&&(r=this[Kv].silent),n=!0,this[Kv]=null),this[qv]=!0;try{n&&ry(this),ay.update.call(this,{type:"resize",animation:z({duration:0},e&&e.animation)})}catch(e){throw this[qv]=!1,e}this[qv]=!1,cy.call(this,r),hy.call(this,r)}}},t.prototype.showLoading=function(e,t){if(this._disposed)Cy(this.id);else if(re(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),Py[e]){var n=Py[e](this._api,t),r=this._zr;this._loadingFX=n,r.add(n)}else"production"!==process.env.NODE_ENV&&No("Loading effects "+e+" not exists.")},t.prototype.hideLoading=function(){this._disposed?Cy(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},t.prototype.makeActionFromEvent=function(e){var t=z({},e);return t.type=Ay[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed)Cy(this.id);else if(re(t)||(t={silent:!!t}),Dy[e.type]&&this._model)if(this[qv])this._pendingActions.push(e);else{var n=t.silent;uy.call(this,e,n);var r=t.flush;r?this._zr.flush():!1!==r&&d.browser.weChat&&this._throttledZrFlush(),cy.call(this,n),hy.call(this,n)}},t.prototype.updateLabelLayout=function(){Uv.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed)Cy(this.id);else{var t=e.seriesIndex,n=this.getModel().getSeriesByIndex(t);"production"!==process.env.NODE_ENV&&me(e.data&&n),n.appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},t.internalField=function(){function e(e){e.clearColorPalette(),e.eachSeries((function(e){e.clearColorPalette()}))}function t(e){for(var t=[],n=e.currentStates,r=0;r<n.length;r++){var i=n[r];"emphasis"!==i&&"blur"!==i&&"select"!==i&&t.push(i)}e.selected&&e.states.select&&t.push("select"),2===e.hoverState&&e.states.emphasis?t.push("emphasis"):1===e.hoverState&&e.states.blur&&t.push("blur"),e.useStates(t)}function n(e,t){if(!e.preventAutoZ){var n=e.get("z")||0,i=e.get("zlevel")||0;t.eachRendered((function(e){return r(e,n,i,-1/0),!0}))}}function r(e,t,n,i){var o=e.getTextContent(),a=e.getTextGuideLine();if(e.isGroup)for(var s=e.childrenRef(),l=0;l<s.length;l++)i=Math.max(r(s[l],t,n,i),i);else e.z=t,e.zlevel=n,i=Math.max(e.z2,i);if(o&&(o.z=t,o.zlevel=n,isFinite(i)&&(o.z2=i+2)),a){var u=e.textGuideLineConfig;a.z=t,a.zlevel=n,isFinite(i)&&(a.z2=i+(u&&u.showAbove?1:-1))}return i}function i(e,t){t.eachRendered((function(e){if(!kc(e)){var t=e.getTextContent(),n=e.getTextGuideLine();e.stateTransition&&(e.stateTransition=null),t&&t.stateTransition&&(t.stateTransition=null),n&&n.stateTransition&&(n.stateTransition=null),e.hasState()?(e.prevStates=e.currentStates,e.clearStates()):e.prevStates&&(e.prevStates=null)}}))}function o(e,n){var r=e.getModel("stateAnimation"),i=e.isAnimationEnabled(),o=r.get("duration"),a=o>0?{duration:o,delay:r.get("delay"),easing:r.get("easing")}:null;n.eachRendered((function(e){if(e.states&&e.states.emphasis){if(kc(e))return;if(e instanceof Ys&&function(e){var t=Ml(e);t.normalFill=e.style.fill,t.normalStroke=e.style.stroke;var n=e.states.select||{};t.selectFill=n.style&&n.style.fill||null,t.selectStroke=n.style&&n.style.stroke||null}(e),e.__dirty){var n=e.prevStates;n&&e.useStates(n)}if(i){e.stateTransition=a;var r=e.getTextContent(),o=e.getTextGuideLine();r&&(r.stateTransition=a),o&&(o.stateTransition=a)}e.__dirty&&t(e)}}))}ry=function(e){var t=e._scheduler;t.restorePipelines(e._model),t.prepareStageTasks(),iy(e,!0),iy(e,!1),t.plan()},iy=function(e,t){for(var n=e._model,r=e._scheduler,i=t?e._componentsViews:e._chartsViews,o=t?e._componentsMap:e._chartsMap,a=e._zr,s=e._api,l=0;l<i.length;l++)i[l].__alive=!1;function u(e){var l=e.__requireNewView;e.__requireNewView=!1;var u="_ec_"+e.id+"_"+e.type,c=!l&&o[u];if(!c){var h=pa(e.type),d=t?Kg.getClass(h.main,h.sub):em.getClass(h.sub);"production"!==process.env.NODE_ENV&&me(d,h.sub+" does not exist."),(c=new d).init(n,s),o[u]=c,i.push(c),a.add(c.group)}e.__viewId=c.__id=u,c.__alive=!0,c.__model=e,c.group.__ecComponentInfo={mainType:e.mainType,index:e.componentIndex},!t&&r.prepareView(c,e,n,s)}t?n.eachComponent((function(e,t){"series"!==e&&u(t)})):n.eachSeries(u);for(l=0;l<i.length;){var c=i[l];c.__alive?l++:(!t&&c.renderTask.dispose(),a.remove(c.group),c.dispose(n,s),i.splice(l,1),o[c.__id]===c&&delete o[c.__id],c.__id=c.group.__ecComponentInfo=null)}},oy=function(e,t,n,r,i){var o=e._model;if(o.setUpdatePayload(n),r){var a={};a[r+"Id"]=n[r+"Id"],a[r+"Index"]=n[r+"Index"],a[r+"Name"]=n[r+"Name"];var s={mainType:r,query:a};i&&(s.subType=i);var l,u=n.excludeSeriesId;null!=u&&(l=Te(),W(Go(u),(function(e){var t=qo(e,null);null!=t&&l.set(t,!0)}))),o&&o.eachComponent(s,(function(t){if(!(l&&null!=l.get(t.id)))if(yu(n))if(t instanceof Hg)n.type!==El||n.notBlur||t.get(["emphasis","disabled"])||function(e,t,n){var r=e.seriesIndex,i=e.getData(t.dataType);if(i){var o=ea(i,t);o=(J(o)?o[0]:o)||0;var a=i.getItemGraphicEl(o);if(!a)for(var s=i.count(),l=0;!a&&l<s;)a=i.getItemGraphicEl(l++);if(a){var u=bl(a);iu(r,u.focus,u.blurScope,n)}else{var c=e.get(["emphasis","focus"]),h=e.get(["emphasis","blurScope"]);null!=c&&iu(r,c,h,n)}}else"production"!==process.env.NODE_ENV&&Po("Unknown dataType "+t.dataType)}(t,n,e._api);else{var r=au(t.mainType,t.componentIndex,n.name,e._api),i=r.focusSelf,o=r.dispatchers;n.type===El&&i&&!n.notBlur&&ou(t.mainType,t.componentIndex,e._api),o&&W(o,(function(e){n.type===El?Kl(e):$l(e)}))}else vu(n)&&t instanceof Hg&&(!function(e,t){if(vu(t)){var n=t.dataType,r=ea(e.getData(n),t);J(r)||(r=[r]),e[t.type===Ol?"toggleSelect":t.type===Nl?"select":"unselect"](r,n)}}(t,n,e._api),su(t),_y(e))}),e),o&&o.eachComponent(s,(function(t){l&&null!=l.get(t.id)||c(e["series"===r?"_chartsMap":"_componentsMap"][t.__viewId])}),e)}else W([].concat(e._componentsViews).concat(e._chartsViews),c);function c(r){r&&r.__alive&&r[t]&&r[t](r.__model,o,e._api,n)}},ay={prepareAndUpdate:function(e){ry(this),ay.update.call(this,e,{optionChanged:null!=e.newOption})},update:function(t,n){var r=this._model,i=this._api,o=this._zr,a=this._coordSysMgr,s=this._scheduler;if(r){r.setUpdatePayload(t),s.restoreData(r,t),s.performSeriesTasks(r),a.create(r,i),s.performDataProcessorTasks(r,t),ly(this,r),a.update(r,i),e(r),s.performVisualTasks(r,t),fy(this,r,i,t,n);var l=r.get("backgroundColor")||"transparent",u=r.get("darkMode");o.setBackgroundColor(l),null!=u&&"auto"!==u&&o.setDarkMode(u),Uv.trigger("afterupdate",r,i)}},updateTransform:function(t){var n=this,r=this._model,i=this._api;if(r){r.setUpdatePayload(t);var o=[];r.eachComponent((function(e,a){if("series"!==e){var s=n.getViewOfComponentModel(a);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(a,r,i,t);l&&l.update&&o.push(s)}else o.push(s)}}));var a=Te();r.eachSeries((function(e){var o=n._chartsMap[e.__viewId];if(o.updateTransform){var s=o.updateTransform(e,r,i,t);s&&s.update&&a.set(e.uid,1)}else a.set(e.uid,1)})),e(r),this._scheduler.performVisualTasks(r,t,{setDirty:!0,dirtyMap:a}),my(this,r,i,t,{},a),Uv.trigger("afterupdate",r,i)}},updateView:function(t){var n=this._model;n&&(n.setUpdatePayload(t),em.markUpdateMethod(t,"updateView"),e(n),this._scheduler.performVisualTasks(n,t,{setDirty:!0}),fy(this,n,this._api,t,{}),Uv.trigger("afterupdate",n,this._api))},updateVisual:function(t){var n=this,r=this._model;r&&(r.setUpdatePayload(t),r.eachSeries((function(e){e.getData().clearAllVisual()})),em.markUpdateMethod(t,"updateVisual"),e(r),this._scheduler.performVisualTasks(r,t,{visualType:"visual",setDirty:!0}),r.eachComponent((function(e,i){if("series"!==e){var o=n.getViewOfComponentModel(i);o&&o.__alive&&o.updateVisual(i,r,n._api,t)}})),r.eachSeries((function(e){n._chartsMap[e.__viewId].updateVisual(e,r,n._api,t)})),Uv.trigger("afterupdate",r,this._api))},updateLayout:function(e){ay.update.call(this,e)}},sy=function(e,t,n,r){if(e._disposed)Cy(e.id);else{for(var i,o=e._model,a=e._coordSysMgr.getCoordinateSystems(),s=ra(o,n),l=0;l<a.length;l++){var u=a[l];if(u[t]&&null!=(i=u[t](o,s,r)))return i}"production"!==process.env.NODE_ENV&&No("No coordinate system that supports "+t+" found by the given finder.")}},ly=function(e,t){var n=e._chartsMap,r=e._scheduler;t.eachSeries((function(e){r.updateStreamModes(e,n[e.__viewId])}))},uy=function(e,t){var n=this,r=this.getModel(),i=e.type,o=e.escapeConnect,a=Dy[i],s=a.actionInfo,l=(s.update||"update").split(":"),u=l.pop(),c=null!=l[0]&&pa(l[0]);this[qv]=!0;var h=[e],d=!1;e.batch&&(d=!0,h=j(e.batch,(function(t){return(t=V(z({},t),e)).batch=null,t})));var p,f=[],g=vu(e),m=yu(e);if(m&&ru(this._api),W(h,(function(t){if((p=(p=a.action(t,n._model,n._api))||z({},t)).type=s.event||p.type,f.push(p),m){var r=ia(e),i=r.queryOptionMap,o=r.mainTypeSpecified?i.keys()[0]:"series";oy(n,u,t,o),_y(n)}else g?(oy(n,u,t,"series"),_y(n)):c&&oy(n,u,t,c.main,c.sub)})),"none"!==u&&!m&&!g&&!c)try{this[Kv]?(ry(this),ay.update.call(this,e),this[Kv]=null):ay[u].call(this,e)}catch(e){throw this[qv]=!1,e}if(p=d?{type:s.event||i,escapeConnect:o,batch:f}:f[0],this[qv]=!1,!t){var v=this._messageCenter;if(v.trigger(p.type,p),g){var y={type:"selectchanged",escapeConnect:o,selected:lu(r),isFromClick:e.isFromClick||!1,fromAction:e.type,fromActionPayload:e};v.trigger(y.type,y)}}},cy=function(e){for(var t=this._pendingActions;t.length;){var n=t.shift();uy.call(this,n,e)}},hy=function(e){!e&&this.trigger("updated")},dy=function(e,t){e.on("rendered",(function(n){t.trigger("rendered",n),!e.animation.isFinished()||t[Kv]||t._scheduler.unfinished||t._pendingActions.length||t.trigger("finished")}))},py=function(e,t){e.on("mouseover",(function(e){var n=ev(e.target,mu);n&&(!function(e,t,n){"production"===process.env.NODE_ENV||mu(e)||Po("param should be highDownDispatcher");var r=bl(e),i=au(r.componentMainType,r.componentIndex,r.componentHighDownName,n),o=i.dispatchers,a=i.focusSelf;o?(a&&ou(r.componentMainType,r.componentIndex,n),W(o,(function(e){return Zl(e,t)}))):(iu(r.seriesIndex,r.focus,r.blurScope,n),"self"===r.focus&&ou(r.componentMainType,r.componentIndex,n),Zl(e,t))}(n,e,t._api),_y(t))})).on("mouseout",(function(e){var n=ev(e.target,mu);n&&(!function(e,t,n){"production"===process.env.NODE_ENV||mu(e)||Po("param should be highDownDispatcher"),ru(n);var r=bl(e),i=au(r.componentMainType,r.componentIndex,r.componentHighDownName,n).dispatchers;i?W(i,(function(e){return ql(e,t)})):ql(e,t)}(n,e,t._api),_y(t))})).on("click",(function(e){var n=ev(e.target,(function(e){return null!=bl(e).dataIndex}),!0);if(n){var r=n.selected?"unselect":"select",i=bl(n);t._api.dispatchAction({type:r,dataType:i.dataType,dataIndexInside:i.dataIndex,seriesIndex:i.seriesIndex,isFromClick:!0})}}))},fy=function(e,t,n,r,i){!function(e){var t=[],n=[],r=!1;if(e.eachComponent((function(e,i){var o=i.get("zlevel")||0,a=i.get("z")||0,s=i.getZLevelKey();r=r||!!s,("series"===e?n:t).push({zlevel:o,z:a,idx:i.componentIndex,type:e,key:s})})),r){var i,o,a=t.concat(n);ln(a,(function(e,t){return e.zlevel===t.zlevel?e.z-t.z:e.zlevel-t.zlevel})),W(a,(function(t){var n=e.getComponent(t.type,t.idx),r=t.zlevel,a=t.key;null!=i&&(r=Math.max(i,r)),a?(r===i&&a!==o&&r++,o=a):o&&(r===i&&r++,o=""),i=r,n.setZLevel(r)}))}}(t),gy(e,t,n,r,i),W(e._chartsViews,(function(e){e.__alive=!1})),my(e,t,n,r,i),W(e._chartsViews,(function(e){e.__alive||e.remove(t,n)}))},gy=function(e,t,r,a,s,l){W(l||e._componentsViews,(function(e){var s=e.__model;i(s,e),e.render(s,t,r,a),n(s,e),o(s,e)}))},my=function(e,t,r,a,s,l){var u=e._scheduler;s=z(s||{},{updatedSeries:t.getSeries()}),Uv.trigger("series:beforeupdate",t,r,s);var c=!1;t.eachSeries((function(t){var n=e._chartsMap[t.__viewId];n.__alive=!0;var r=n.renderTask;u.updatePayload(r,a),i(t,n),l&&l.get(t.uid)&&r.dirty(),r.perform(u.getPerformArgs(r))&&(c=!0),n.group.silent=!!t.get("silent"),function(e,t){var n=e.get("blendMode")||null;t.eachRendered((function(e){e.isGroup||(e.style.blend=n)}))}(t,n),su(t)})),u.unfinished=c||u.unfinished,Uv.trigger("series:layoutlabels",t,r,s),Uv.trigger("series:transition",t,r,s),t.eachSeries((function(t){var r=e._chartsMap[t.__viewId];n(t,r),o(t,r)})),function(e,t){var n=e._zr,r=n.storage,i=0;r.traverse((function(e){e.isGroup||i++})),i>t.get("hoverLayerThreshold")&&!d.node&&!d.worker&&t.eachSeries((function(t){if(!t.preventUsingHoverLayer){var n=e._chartsMap[t.__viewId];n.__alive&&n.eachRendered((function(e){e.states.emphasis&&(e.states.emphasis.hoverLayer=!0)}))}}))}(e,t),Uv.trigger("series:afterupdate",t,r,s)},_y=function(e){e[$v]=!0,e.getZr().wakeUp()},xy=function(e){e[$v]&&(e.getZr().storage.traverse((function(e){kc(e)||t(e)})),e[$v]=!1)},vy=function(e){return new(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return l(n,t),n.prototype.getCoordinateSystems=function(){return e._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(t){for(;t;){var n=t.__ecComponentInfo;if(null!=n)return e._model.getComponent(n.mainType,n.index);t=t.parent}},n.prototype.enterEmphasis=function(t,n){Kl(t,n),_y(e)},n.prototype.leaveEmphasis=function(t,n){$l(t,n),_y(e)},n.prototype.enterBlur=function(t){Jl(t),_y(e)},n.prototype.leaveBlur=function(t){Ql(t),_y(e)},n.prototype.enterSelect=function(t){eu(t),_y(e)},n.prototype.leaveSelect=function(t){tu(t),_y(e)},n.prototype.getModel=function(){return e.getModel()},n.prototype.getViewOfComponentModel=function(t){return e.getViewOfComponentModel(t)},n.prototype.getViewOfSeriesModel=function(t){return e.getViewOfSeriesModel(t)},n}(Gp))(e)},yy=function(e){function t(e,t){for(var n=0;n<e.length;n++){e[n][Qv]=t}}W(Ay,(function(n,r){e._messageCenter.on(r,(function(n){if(Ry[e.group]&&0!==e[Qv]){if(n&&n.escapeConnect)return;var r=e.makeActionFromEvent(n),i=[];W(Oy,(function(t){t!==e&&t.group===e.group&&i.push(t)})),t(i,0),W(i,(function(e){1!==e[Qv]&&e.dispatchAction(r)})),t(i,2)}}))}))}}(),t}(nt),Ty=Sy.prototype;Ty.on=ey("on"),Ty.off=ey("off"),Ty.one=function(e,t,n){var r=this;Oo("ECharts#one is deprecated."),this.on.call(this,e,(function n(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];t&&t.apply&&t.apply(this,i),r.off(e,n)}),n)};var My=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function Cy(e){"production"!==process.env.NODE_ENV&&No("Instance "+e+" has been disposed")}var Dy={},Ay={},Iy=[],Ey=[],Ly=[],Ny={},Py={},Oy={},Ry={},ky=+new Date-0,zy=+new Date-0,Vy="_echarts_instance_";function By(e,t,n){var r=!(n&&n.ssr);if(r){if("production"!==process.env.NODE_ENV&&!e)throw new Error("Initialize failed: invalid dom.");var i=Hy(e);if(i)return"production"!==process.env.NODE_ENV&&No("There is a chart instance already initialized on the dom."),i;"production"!==process.env.NODE_ENV&&(!ae(e)||"CANVAS"===e.nodeName.toUpperCase()||(e.clientWidth||n&&null!=n.width)&&(e.clientHeight||n&&null!=n.height)||No("Can't get DOM width or height. Please check dom.clientWidth and dom.clientHeight. They should not be 0.For example, you may need to call this in the callback of window.onload."))}var o=new Sy(e,t,n);return o.id="ec_"+ky++,Oy[o.id]=o,r&&la(e,Vy,o.id),yy(o),Uv.trigger("afterinit",o),o}function Fy(e){Ry[e]=!1}var Gy=Fy;function Hy(e){return Oy[function(e,t){return e.getAttribute?e.getAttribute(t):e[t]}(e,Vy)]}function Uy(e,t){Ny[e]=t}function Wy(e){F(Ey,e)<0&&Ey.push(e)}function jy(e,t){t_(Iy,e,t,2e3)}function Xy(e){Zy("afterinit",e)}function Yy(e){Zy("afterupdate",e)}function Zy(e,t){Uv.on(e,t)}function qy(e,t,n){Q(t)&&(n=t,t="");var r=re(e)?e.type:[e,e={event:t}][0];e.event=(e.event||r).toLowerCase(),t=e.event,Ay[t]||(me(Jv.test(r)&&Jv.test(t)),Dy[r]||(Dy[r]={action:n,actionInfo:e}),Ay[t]=r)}function Ky(e,t){Up.register(e,t)}function $y(e){var t=Up.get(e);if(t)return t.getDimensionsInfo?t.getDimensionsInfo():t.dimensions.slice()}function Jy(e,t){t_(Ly,e,t,1e3,"layout")}function Qy(e,t){t_(Ly,e,t,3e3,"visual")}var e_=[];function t_(e,t,n,r,i){if((Q(t)||re(t))&&(n=t,t=r),"production"!==process.env.NODE_ENV){if(isNaN(t)||null==t)throw new Error("Illegal priority");W(e,(function(e){me(e.__raw!==n)}))}if(!(F(e_,n)>=0)){e_.push(n);var o=wm.wrapStageHandler(n,i);o.__prio=t,o.__raw=n,e.push(o)}}function n_(e,t){Py[e]=t}function r_(e,t,n){var r=jv("registerMap");r&&r(e,t,n)}function i_(e){var t=jv("getMap");return t&&t(e)}var o_=function(e){var t=(e=O(e)).type,n="";t||("production"!==process.env.NODE_ENV&&(n="Must have a `type` when `registerTransform`."),zo(n));var r=t.split(":");2!==r.length&&("production"!==process.env.NODE_ENV&&(n='Name must include namespace like "ns:regression".'),zo(n));var i=!1;"echarts"===r[0]&&(t=r[1],i=!0),e.__isBuiltIn=i,og.set(t,e)};Qy(Xv,vm),Qy(Yv,_m),Qy(Yv,xm),Qy(Xv,Ym),Qy(Yv,Zm),Qy(7e3,(function(e,t){e.eachRawSeries((function(n){if(!e.isSeriesFiltered(n)){var r=n.getData();r.hasItemVisual()&&r.each((function(e){var n=r.getItemVisual(e,"decal");n&&(r.ensureUniqueItemVisual(e,"style").decal=Bv(n,t))}));var i=r.getVisual("decal");if(i)r.getVisual("style").decal=Bv(i,t)}}))})),Wy(pf),jy(900,(function(e){var t=Te();e.eachSeries((function(e){var n=e.get("stack");if(n){var r=t.get(n)||t.set(n,[]),i=e.getData(),o={stackResultDimension:i.getCalculationInfo("stackResultDimension"),stackedOverDimension:i.getCalculationInfo("stackedOverDimension"),stackedDimension:i.getCalculationInfo("stackedDimension"),stackedByDimension:i.getCalculationInfo("stackedByDimension"),isStackedByIndex:i.getCalculationInfo("isStackedByIndex"),data:i,seriesModel:e};if(!o.stackedDimension||!o.isStackedByIndex&&!o.stackedByDimension)return;r.length&&i.setCalculationInfo("stackedOnSeries",r[r.length-1].seriesModel),r.push(o)}})),t.each(ff)})),n_("default",(function(e,t){V(t=t||{},{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Yi,r=new ol({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});n.add(r);var i,o=new ll({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new ol({style:{fill:"none"},textContent:o,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});return n.add(a),t.showSpinner&&((i=new _c({shape:{startAngle:-bm/2,endAngle:-bm/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*bm/2}).start("circularInOut"),i.animateShape(!0).when(1e3,{startAngle:3*bm/2}).delay(300).start("circularInOut"),n.add(i)),n.resize=function(){var n=o.getBoundingRect().width,s=t.showSpinner?t.spinnerRadius:0,l=(e.getWidth()-2*s-(t.showSpinner&&n?10:0)-n)/2-(t.showSpinner&&n?0:5+n/2)+(t.showSpinner?0:n/2)+(n?0:s),u=e.getHeight()/2;t.showSpinner&&i.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),r.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},n.resize(),n})),qy({type:El,event:El,update:El},Ie),qy({type:Ll,event:Ll,update:Ll},Ie),qy({type:Nl,event:Nl,update:Nl},Ie),qy({type:Pl,event:Pl,update:Pl},Ie),qy({type:Ol,event:Ol,update:Ol},Ie),Uy("light",Vm),Uy("dark",Um);var a_=[],s_={registerPreprocessor:Wy,registerProcessor:jy,registerPostInit:Xy,registerPostUpdate:Yy,registerUpdateLifecycle:Zy,registerAction:qy,registerCoordinateSystem:Ky,registerLayout:Jy,registerVisual:Qy,registerTransform:o_,registerLoading:n_,registerMap:r_,registerImpl:function(e,t){"production"!==process.env.NODE_ENV&&Wv[e]&&Po("Already has an implementation of "+e+"."),Wv[e]=t},PRIORITY:Zv,ComponentModel:tp,ComponentView:Kg,SeriesModel:Hg,ChartView:em,registerComponentModel:function(e){tp.registerClass(e)},registerComponentView:function(e){Kg.registerClass(e)},registerSeriesModel:function(e){Hg.registerClass(e)},registerChartView:function(e){em.registerClass(e)},registerSubTypeDefaulter:function(e,t){tp.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){Qi(e,t)}};function l_(e){J(e)?W(e,(function(e){l_(e)})):F(a_,e)>=0||(a_.push(e),Q(e)&&(e={install:e}),e.install(s_))}function u_(e){return null==e?0:e.length||1}function c_(e){return e}var h_=function(){function e(e,t,n,r,i,o){this._old=e,this._new=t,this._oldKeyGetter=n||c_,this._newKeyGetter=r||c_,this.context=i,this._diffModeMultiple="multiple"===o}return e.prototype.add=function(e){return this._add=e,this},e.prototype.update=function(e){return this._update=e,this},e.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},e.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},e.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},e.prototype.remove=function(e){return this._remove=e,this},e.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},e.prototype._executeOneToOne=function(){var e=this._old,t=this._new,n={},r=new Array(e.length),i=new Array(t.length);this._initIndexMap(e,null,r,"_oldKeyGetter"),this._initIndexMap(t,n,i,"_newKeyGetter");for(var o=0;o<e.length;o++){var a=r[o],s=n[a],l=u_(s);if(l>1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,o)}else 1===l?(n[a]=null,this._update&&this._update(s,o)):this._remove&&this._remove(o)}this._performRestAdd(i,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},r={},i=[],o=[];this._initIndexMap(e,n,i,"_oldKeyGetter"),this._initIndexMap(t,r,o,"_newKeyGetter");for(var a=0;a<i.length;a++){var s=i[a],l=n[s],u=r[s],c=u_(l),h=u_(u);if(c>1&&1===h)this._updateManyToOne&&this._updateManyToOne(u,l),r[s]=null;else if(1===c&&h>1)this._updateOneToMany&&this._updateOneToMany(u,l),r[s]=null;else if(1===c&&1===h)this._update&&this._update(u,l),r[s]=null;else if(c>1&&h>1)this._updateManyToMany&&this._updateManyToMany(u,l),r[s]=null;else if(c>1)for(var d=0;d<c;d++)this._remove&&this._remove(l[d]);else this._remove&&this._remove(l)}this._performRestAdd(o,r)},e.prototype._performRestAdd=function(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=t[r],o=u_(i);if(o>1)for(var a=0;a<o;a++)this._add&&this._add(i[a]);else 1===o&&this._add&&this._add(i);t[r]=null}},e.prototype._initIndexMap=function(e,t,n,r){for(var i=this._diffModeMultiple,o=0;o<e.length;o++){var a="_ec_"+this[r](e[o],o);if(i||(n[o]=a),t){var s=t[a],l=u_(s);0===l?(t[a]=o,i&&n.push(a)):1===l?t[a]=[s,o]:s.push(o)}}},e}(),d_=function(){function e(e,t){this._encode=e,this._schema=t}return e.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},e.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},e}();function p_(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}function f_(e){return"category"===e?"ordinal":"time"===e?"time":"float"}var g_=function(e){this.otherDims={},null!=e&&z(this,e)},m_=ta(),v_={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},y_=function(){function e(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return e.prototype.isDimensionOmitted=function(){return this._dimOmitted},e.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||(this._dimNameMap=b_(this.source)))},e.prototype.getSourceDimensionIndex=function(e){return de(this._dimNameMap.get(e),-1)},e.prototype.getSourceDimension=function(e){var t=this.source.dimensionsDefine;if(t)return t[e]},e.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,t=Df(this.source),n=!w_(e),r="",i=[],o=0,a=0;o<e;o++){var s=void 0,l=void 0,u=void 0,c=this.dimensions[a];if(c&&c.storeDimIndex===o)s=t?c.name:null,l=c.type,u=c.ordinalMeta,a++;else{var h=this.getSourceDimension(o);h&&(s=t?h.name:null,l=h.type)}i.push({property:s,type:l,ordinalMeta:u}),!t||null==s||c&&c.isCalculationCoord||(r+=n?s.replace(/\`/g,"`1").replace(/\$/g,"`2"):s),r+="$",r+=v_[l]||"f",u&&(r+=u.uid),r+="$"}var d=this.source;return{dimensions:i,hash:[d.seriesLayoutBy,d.startIndex,r].join("$$")}},e.prototype.makeOutputDimensionNames=function(){for(var e=[],t=0,n=0;t<this._fullDimCount;t++){var r=void 0,i=this.dimensions[n];if(i&&i.storeDimIndex===t)i.isCalculationCoord||(r=i.name),n++;else{var o=this.getSourceDimension(t);o&&(r=o.name)}e.push(r)}return e},e.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},e}();function __(e){return e instanceof y_}function x_(e){for(var t=Te(),n=0;n<(e||[]).length;n++){var r=e[n],i=re(r)?r.name:r;null!=i&&null==t.get(i)&&t.set(i,n)}return t}function b_(e){var t=m_(e);return t.dimNameMap||(t.dimNameMap=x_(e.dimensionsDefine))}function w_(e){return e>30}var S_,T_,M_,C_,D_,A_,I_,E_=re,L_=j,N_="undefined"==typeof Int32Array?Array:Int32Array,P_=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],O_=["_approximateExtent"],R_=function(){function e(e,t){var n;this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var r=!1;__(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(r=!0,n=e),n=n||["x","y"];for(var i={},o=[],a={},s=!1,l={},u=0;u<n.length;u++){var c=n[u],h=ee(c)?new g_({name:c}):c instanceof g_?c:new g_(c),d=h.name;h.type=h.type||"float",h.coordDim||(h.coordDim=d,h.coordDimIndex=0);var p=h.otherDims=h.otherDims||{};o.push(d),i[d]=h,null!=l[d]&&(s=!0),h.createInvertedIndices&&(a[d]=[]),0===p.itemName&&(this._nameDimIdx=u),0===p.itemId&&(this._idDimIdx=u),"production"!==process.env.NODE_ENV&&me(r||h.storeDimIndex>=0),r&&(h.storeDimIndex=u)}if(this.dimensions=o,this._dimInfos=i,this._initGetDimensionInfo(s),this.hostModel=t,this._invertedIndicesMap=a,this._dimOmitted){var f=this._dimIdxToName=Te();W(o,(function(e){f.set(i[e].storeDimIndex,e)}))}}return e.prototype.getDimension=function(e){var t=this._recognizeDimIndex(e);if(null==t)return e;if(t=e,!this._dimOmitted)return this.dimensions[t];var n=this._dimIdxToName.get(t);if(null!=n)return n;var r=this._schema.getSourceDimension(t);return r?r.name:void 0},e.prototype.getDimensionIndex=function(e){var t=this._recognizeDimIndex(e);if(null!=t)return t;if(null==e)return-1;var n=this._getDimInfo(e);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},e.prototype._recognizeDimIndex=function(e){if(ne(e)||null!=e&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},e.prototype._getStoreDimIndex=function(e){var t=this.getDimensionIndex(e);if("production"!==process.env.NODE_ENV&&null==t)throw new Error("Unknown dimension "+e);return t},e.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},e.prototype._initGetDimensionInfo=function(e){var t=this._dimInfos;this._getDimInfo=e?function(e){return t.hasOwnProperty(e)?t[e]:void 0}:function(e){return t[e]}},e.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},e.prototype.mapDimension=function(e,t){var n=this._dimSummary;if(null==t)return n.encodeFirstDimNotExtra[e];var r=n.encode[e];return r?r[t]:null},e.prototype.mapDimensionsAll=function(e){return(this._dimSummary.encode[e]||[]).slice()},e.prototype.getStore=function(){return this._store},e.prototype.initData=function(e,t,n){var r,i=this;if(e instanceof vg&&(r=e),!r){var o=this.dimensions,a=bf(e)||U(e)?new Af(e,o.length):e;r=new vg;var s=L_(o,(function(e){return{type:i._dimInfos[e].type,property:e}}));r.initData(a,s,n)}this._store=r,this._nameList=(t||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,r.count()),this._dimSummary=function(e,t){var n={},r=n.encode={},i=Te(),o=[],a=[],s={};W(e.dimensions,(function(t){var n,l=e.getDimensionInfo(t),u=l.coordDim;if(u){"production"!==process.env.NODE_ENV&&me(null==op.get(u));var c=l.coordDimIndex;p_(r,u)[c]=t,l.isExtraCoord||(i.set(u,1),"ordinal"!==(n=l.type)&&"time"!==n&&(o[0]=t),p_(s,u)[c]=e.getDimensionIndex(l.name)),l.defaultTooltip&&a.push(t)}op.each((function(e,t){var n=p_(r,t),i=l.otherDims[t];null!=i&&!1!==i&&(n[i]=l.name)}))}));var l=[],u={};i.each((function(e,t){var n=r[t];u[t]=n[0],l=l.concat(n)})),n.dataDimsOnCoord=l,n.dataDimIndicesOnCoord=j(l,(function(t){return e.getDimensionInfo(t).storeDimIndex})),n.encodeFirstDimNotExtra=u;var c=r.label;c&&c.length&&(o=c.slice());var h=r.tooltip;return h&&h.length?a=h.slice():a.length||(a=o.slice()),r.defaultedLabel=o,r.defaultedTooltip=a,n.userOutput=new d_(s,t),n}(this,this._schema),this.userOutput=this._dimSummary.userOutput},e.prototype.appendData=function(e){var t=this._store.appendData(e);this._doInit(t[0],t[1])},e.prototype.appendValues=function(e,t){var n=this._store.appendValues(e,t.length),r=n.start,i=n.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),t)for(var a=r;a<i;a++){var s=a-r;this._nameList[a]=t[s],o&&I_(this,a)}},e.prototype._updateOrdinalMeta=function(){for(var e=this._store,t=this.dimensions,n=0;n<t.length;n++){var r=this._dimInfos[t[n]];r.ordinalMeta&&e.collectOrdinalMeta(r.storeDimIndex,r.ordinalMeta)}},e.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return null==this._idDimIdx&&e.getSource().sourceFormat!==cp&&!e.fillStorage},e.prototype._doInit=function(e,t){if(!(e>=t)){var n=this._store.getProvider();this._updateOrdinalMeta();var r=this._nameList,i=this._idList;if(n.getSource().sourceFormat===ap&&!n.pure)for(var o=[],a=e;a<t;a++){var s=n.getItem(a,o);if(!this.hasItemOption&&jo(s)&&(this.hasItemOption=!0),s){var l=s.name;null==r[a]&&null!=l&&(r[a]=qo(l,null));var u=s.id;null==i[a]&&null!=u&&(i[a]=qo(u,null))}}if(this._shouldMakeIdFromName())for(a=e;a<t;a++)I_(this,a);S_(this)}},e.prototype.getApproximateExtent=function(e){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e))},e.prototype.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},e.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},e.prototype.setCalculationInfo=function(e,t){E_(e)?z(this._calculationInfo,e):this._calculationInfo[e]=t},e.prototype.getName=function(e){var t=this.getRawIndex(e),n=this._nameList[t];return null==n&&null!=this._nameDimIdx&&(n=M_(this,this._nameDimIdx,t)),null==n&&(n=""),n},e.prototype._getCategory=function(e,t){var n=this._store.get(e,t),r=this._store.getOrdinalMeta(e);return r?r.categories[n]:n},e.prototype.getId=function(e){return T_(this,this.getRawIndex(e))},e.prototype.count=function(){return this._store.count()},e.prototype.get=function(e,t){var n=this._store,r=this._dimInfos[e];if(r)return n.get(r.storeDimIndex,t)},e.prototype.getByRawIndex=function(e,t){var n=this._store,r=this._dimInfos[e];if(r)return n.getByRawIndex(r.storeDimIndex,t)},e.prototype.getIndices=function(){return this._store.getIndices()},e.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e))},e.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},e.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},e.prototype.getValues=function(e,t){var n=this,r=this._store;return J(e)?r.getValues(L_(e,(function(e){return n._getStoreDimIndex(e)})),t):r.getValues(e)},e.prototype.hasValue=function(e){for(var t=this._dimSummary.dataDimIndicesOnCoord,n=0,r=t.length;n<r;n++)if(isNaN(this._store.get(t[n],e)))return!1;return!0},e.prototype.indexOfName=function(e){for(var t=0,n=this._store.count();t<n;t++)if(this.getName(t)===e)return t;return-1},e.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},e.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},e.prototype.rawIndexOf=function(e,t){var n=e&&this._invertedIndicesMap[e];if("production"!==process.env.NODE_ENV&&!n)throw new Error("Do not supported yet");var r=n[t];return null==r||isNaN(r)?-1:r},e.prototype.indicesOfNearest=function(e,t,n){return this._store.indicesOfNearest(this._getStoreDimIndex(e),t,n)},e.prototype.each=function(e,t,n){Q(e)&&(n=t,t=e,e=[]);var r=n||this,i=L_(C_(e),this._getStoreDimIndex,this);this._store.each(i,r?K(t,r):t)},e.prototype.filterSelf=function(e,t,n){Q(e)&&(n=t,t=e,e=[]);var r=n||this,i=L_(C_(e),this._getStoreDimIndex,this);return this._store=this._store.filter(i,r?K(t,r):t),this},e.prototype.selectRange=function(e){var t=this,n={};return W(q(e),(function(r){var i=t._getStoreDimIndex(r);n[i]=e[r]})),this._store=this._store.selectRange(n),this},e.prototype.mapArray=function(e,t,n){Q(e)&&(n=t,t=e,e=[]),n=n||this;var r=[];return this.each(e,(function(){r.push(t&&t.apply(this,arguments))}),n),r},e.prototype.map=function(e,t,n,r){var i=n||r||this,o=L_(C_(e),this._getStoreDimIndex,this),a=A_(this);return a._store=this._store.map(o,i?K(t,i):t),a},e.prototype.modify=function(e,t,n,r){var i=this,o=n||r||this;"production"!==process.env.NODE_ENV&&W(C_(e),(function(e){i.getDimensionInfo(e).isCalculationCoord||console.error("Danger: only stack dimension can be modified")}));var a=L_(C_(e),this._getStoreDimIndex,this);this._store.modify(a,o?K(t,o):t)},e.prototype.downSample=function(e,t,n,r){var i=A_(this);return i._store=this._store.downSample(this._getStoreDimIndex(e),t,n,r),i},e.prototype.lttbDownSample=function(e,t){var n=A_(this);return n._store=this._store.lttbDownSample(this._getStoreDimIndex(e),t),n},e.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},e.prototype.getItemModel=function(e){var t=this.hostModel,n=this.getRawDataItem(e);return new Wh(n,t,t&&t.ecModel)},e.prototype.diff=function(e){var t=this;return new h_(e?e.getStore().getIndices():[],this.getStore().getIndices(),(function(t){return T_(e,t)}),(function(e){return T_(t,e)}))},e.prototype.getVisual=function(e){var t=this._visual;return t&&t[e]},e.prototype.setVisual=function(e,t){this._visual=this._visual||{},E_(e)?z(this._visual,e):this._visual[e]=t},e.prototype.getItemVisual=function(e,t){var n=this._itemVisuals[e],r=n&&n[t];return null==r?this.getVisual(t):r},e.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,r=n[e];r||(r=n[e]={});var i=r[t];return null==i&&(J(i=this.getVisual(t))?i=i.slice():E_(i)&&(i=z({},i)),r[t]=i),i},e.prototype.setItemVisual=function(e,t,n){var r=this._itemVisuals[e]||{};this._itemVisuals[e]=r,E_(t)?z(r,t):r[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){E_(e)?z(this._layout,e):this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?z(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){var n=this.hostModel&&this.hostModel.seriesIndex;wl(n,this.dataType,e,t),this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){W(this._graphicEls,(function(n,r){n&&e&&e.call(t,n,r)}))},e.prototype.cloneShallow=function(t){return t||(t=new e(this._schema?this._schema:L_(this.dimensions,this._getDimInfo,this),this.hostModel)),D_(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(e,t){var n=this[e];Q(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat(fe(arguments)))})},e.internalField=(S_=function(e){var t=e._invertedIndicesMap;W(t,(function(n,r){var i=e._dimInfos[r],o=i.ordinalMeta,a=e._store;if(o){n=t[r]=new N_(o.categories.length);for(var s=0;s<n.length;s++)n[s]=-1;for(s=0;s<a.count();s++)n[a.get(i.storeDimIndex,s)]=s}}))},M_=function(e,t,n){return qo(e._getCategory(t,n),null)},T_=function(e,t){var n=e._idList[t];return null==n&&null!=e._idDimIdx&&(n=M_(e,e._idDimIdx,t)),null==n&&(n="e\0\0"+t),n},C_=function(e){return J(e)||(e=null!=e?[e]:[]),e},A_=function(t){var n=new e(t._schema?t._schema:L_(t.dimensions,t._getDimInfo,t),t.hostModel);return D_(n,t),n},D_=function(e,t){W(P_.concat(t.__wrappedMethods||[]),(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})),e.__wrappedMethods=t.__wrappedMethods,W(O_,(function(n){e[n]=O(t[n])})),e._calculationInfo=z({},t._calculationInfo)},void(I_=function(e,t){var n=e._nameList,r=e._idList,i=e._nameDimIdx,o=e._idDimIdx,a=n[t],s=r[t];if(null==a&&null!=i&&(n[t]=a=M_(e,i,t)),null==s&&null!=o&&(r[t]=s=M_(e,o,t)),null==s&&null!=a){var l=e._nameRepeatCount,u=l[a]=(l[a]||0)+1;s=a,u>1&&(s+="__ec__"+u),r[t]=s}})),e}();function k_(e,t){return z_(e,t).dimensions}function z_(e,t){bf(e)||(e=Sf(e));var n=(t=t||{}).coordDimensions||[],r=t.dimensionsDefine||e.dimensionsDefine||[],i=Te(),o=[],a=function(e,t,n,r){var i=Math.max(e.dimensionsDetectedCount||1,t.length,n.length,r||0);return W(t,(function(e){var t;re(e)&&(t=e.dimsDef)&&(i=Math.max(i,t.length))})),i}(e,n,r,t.dimensionsCount),s=t.canOmitUnusedDimensions&&w_(a),l=r===e.dimensionsDefine,u=l?b_(e):x_(r),c=t.encodeDefine;!c&&t.encodeDefaulter&&(c=t.encodeDefaulter(e,a));for(var h=Te(c),d=new dg(a),p=0;p<d.length;p++)d[p]=-1;function f(e){var t=d[e];if(t<0){var n=r[e],i=re(n)?n:{name:n},a=new g_,s=i.name;null!=s&&null!=u.get(s)&&(a.name=a.displayName=s),null!=i.type&&(a.type=i.type),null!=i.displayName&&(a.displayName=i.displayName);var l=o.length;return d[e]=l,a.storeDimIndex=e,o.push(a),a}return o[t]}if(!s)for(p=0;p<a;p++)f(p);h.each((function(e,t){var n=Go(e).slice();if(1===n.length&&!ee(n[0])&&n[0]<0)h.set(t,!1);else{var r=h.set(t,[]);W(n,(function(e,n){var i=ee(e)?u.get(e):e;null!=i&&i<a&&(r[n]=i,m(f(i),t,n))}))}}));var g=0;function m(e,t,n){null!=op.get(t)?e.otherDims[t]=n:(e.coordDim=t,e.coordDimIndex=n,i.set(t,!0))}W(n,(function(e){var t,n,r,i;if(ee(e))t=e,i={};else{t=(i=e).name;var o=i.ordinalMeta;i.ordinalMeta=null,(i=z({},i)).ordinalMeta=o,n=i.dimsDef,r=i.otherDims,i.name=i.coordDim=i.coordDimIndex=i.dimsDef=i.otherDims=null}var s=h.get(t);if(!1!==s){if(!(s=Go(s)).length)for(var u=0;u<(n&&n.length||1);u++){for(;g<a&&null!=f(g).coordDim;)g++;g<a&&s.push(g++)}W(s,(function(e,o){var a=f(e);if(l&&null!=i.type&&(a.type=i.type),m(V(a,i),t,o),null==a.name&&n){var s=n[o];!re(s)&&(s={name:s}),a.name=a.displayName=s.name,a.defaultTooltip=s.defaultTooltip}r&&V(a.otherDims,r)}))}}));var v=t.generateCoord,y=t.generateCoordCount,_=null!=y;y=v?y||1:0;var x=v||"value";function b(e){null==e.name&&(e.name=e.coordDim)}if(s)W(o,(function(e){b(e)})),o.sort((function(e,t){return e.storeDimIndex-t.storeDimIndex}));else for(var w=0;w<a;w++){var S=f(w);null==S.coordDim&&(S.coordDim=V_(x,i,_),S.coordDimIndex=0,(!v||y<=0)&&(S.isExtraCoord=!0),y--),b(S),null!=S.type||bp(e,w)!==fp&&(!S.isExtraCoord||null==S.otherDims.itemName&&null==S.otherDims.seriesName)||(S.type="ordinal")}return function(e){for(var t=Te(),n=0;n<e.length;n++){var r=e[n],i=r.name,o=t.get(i)||0;o>0&&(r.name=i+(o-1)),o++,t.set(i,o)}}(o),new y_({source:e,dimensions:o,fullDimensionCount:a,dimensionOmitted:s})}function V_(e,t,n){if(n||t.hasKey(e)){for(var r=0;t.hasKey(e+r);)r++;e+=r}return t.set(e,!0),e}var B_=function(e){this.coordSysDims=[],this.axisMap=Te(),this.categoryAxisMap=Te(),this.coordSysName=e};var F_={cartesian2d:function(e,t,n,r){var i=e.getReferringComponents("xAxis",oa).models[0],o=e.getReferringComponents("yAxis",oa).models[0];if("production"!==process.env.NODE_ENV){if(!i)throw new Error('xAxis "'+he(e.get("xAxisIndex"),e.get("xAxisId"),0)+'" not found');if(!o)throw new Error('yAxis "'+he(e.get("xAxisIndex"),e.get("yAxisId"),0)+'" not found')}t.coordSysDims=["x","y"],n.set("x",i),n.set("y",o),G_(i)&&(r.set("x",i),t.firstCategoryDimIndex=0),G_(o)&&(r.set("y",o),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,n,r){var i=e.getReferringComponents("singleAxis",oa).models[0];if("production"!==process.env.NODE_ENV&&!i)throw new Error("singleAxis should be specified.");t.coordSysDims=["single"],n.set("single",i),G_(i)&&(r.set("single",i),t.firstCategoryDimIndex=0)},polar:function(e,t,n,r){var i=e.getReferringComponents("polar",oa).models[0],o=i.findAxisModel("radiusAxis"),a=i.findAxisModel("angleAxis");if("production"!==process.env.NODE_ENV){if(!a)throw new Error("angleAxis option not found");if(!o)throw new Error("radiusAxis option not found")}t.coordSysDims=["radius","angle"],n.set("radius",o),n.set("angle",a),G_(o)&&(r.set("radius",o),t.firstCategoryDimIndex=0),G_(a)&&(r.set("angle",a),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},geo:function(e,t,n,r){t.coordSysDims=["lng","lat"]},parallel:function(e,t,n,r){var i=e.ecModel,o=i.getComponent("parallel",e.get("parallelIndex")),a=t.coordSysDims=o.dimensions.slice();W(o.parallelAxisIndex,(function(e,o){var s=i.getComponent("parallelAxis",e),l=a[o];n.set(l,s),G_(s)&&(r.set(l,s),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=o))}))}};function G_(e){return"category"===e.get("type")}function H_(e,t,n){var r,i,o,a=(n=n||{}).byIndex,s=n.stackedCoordDimension;!function(e){return!__(e.schema)}(t)?(i=t.schema,r=i.dimensions,o=t.store):r=t;var l,u,c,h,d=!(!e||!e.get("stack"));if(W(r,(function(e,t){ee(e)&&(r[t]=e={name:e}),d&&!e.isExtraCoord&&(a||l||!e.ordinalMeta||(l=e),u||"ordinal"===e.type||"time"===e.type||s&&s!==e.coordDim||(u=e))})),!u||a||l||(a=!0),u){c="__\0ecstackresult_"+e.id,h="__\0ecstackedover_"+e.id,l&&(l.createInvertedIndices=!0);var p=u.coordDim,f=u.type,g=0;W(r,(function(e){e.coordDim===p&&g++}));var m={name:c,coordDim:p,coordDimIndex:g,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:r.length},v={name:h,coordDim:h,coordDimIndex:g+1,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:r.length+1};i?(o&&(m.storeDimIndex=o.ensureCalculationDimension(h,f),v.storeDimIndex=o.ensureCalculationDimension(c,f)),i.appendCalculationDimension(m),i.appendCalculationDimension(v)):(r.push(m),r.push(v))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:a,stackedOverDimension:h,stackResultDimension:c}}function U_(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function W_(e,t){return U_(e,t)?e.getCalculationInfo("stackResultDimension"):t}function j_(e,t,n){n=n||{};var r,i=t.getSourceManager(),o=!1;e?(o=!0,r=Sf(e)):o=(r=i.getSource()).sourceFormat===ap;var a=function(e){var t=e.get("coordinateSystem"),n=new B_(t),r=F_[t];if(r)return r(e,n,n.axisMap,n.categoryAxisMap),n}(t),s=function(e,t){var n,r=e.get("coordinateSystem"),i=Up.get(r);return t&&t.coordSysDims&&(n=j(t.coordSysDims,(function(e){var n={name:e},r=t.axisMap.get(e);if(r){var i=r.get("type");n.type=f_(i)}return n}))),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}(t,a),l=n.useEncodeDefaulter,u=Q(l)?l:l?$(yp,s,t):null,c=z_(r,{coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!o}),h=function(e,t,n){var r,i;return n&&W(e,(function(e,o){var a=e.coordDim,s=n.categoryAxisMap.get(a);s&&(null==r&&(r=o),e.ordinalMeta=s.getOrdinalMeta(),t&&(e.createInvertedIndices=!0)),null!=e.otherDims.itemName&&(i=!0)})),i||null==r||(e[r].otherDims.itemName=0),r}(c.dimensions,n.createInvertedIndices,a),d=o?null:i.getSharedDataStore(c),p=H_(t,{schema:c,store:d}),f=new R_(c,t);f.setCalculationInfo(p);var g=null!=h&&function(e){if(e.sourceFormat===ap){var t=function(e){var t=0;for(;t<e.length&&null==e[t];)t++;return e[t]}(e.data||[]);return!J(Wo(t))}}(r)?function(e,t,n,r){return r===h?n:this.defaultDimValueGetter(e,t,n,r)}:null;return f.hasItemOption=!1,f.initData(o?r:d,null,g),f}var X_=function(){function e(e){this._setting=e||{},this._extent=[1/0,-1/0]}return e.prototype.getSetting=function(e){return this._setting[e]},e.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1])},e.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(t)||(n[1]=t)},e.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(e){this._isBlank=e},e}();_a(X_);var Y_=0,Z_=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++Y_}return e.createByAxisModel=function(t){var n=t.option,r=n.data,i=r&&j(r,q_);return new e({categories:i,needCollect:!i,deduplication:!1!==n.dedplication})},e.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},e.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if(!ee(e)&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var r=this._getOrCreateMap();return null==(t=r.get(e))&&(n?(t=this.categories.length,this.categories[t]=e,r.set(e,t)):t=NaN),t},e.prototype._getOrCreateMap=function(){return this._map||(this._map=Te(this.categories))},e}();function q_(e){return re(e)&&null!=e.value?e.value:e+""}function K_(e){return"interval"===e.type||"log"===e.type}function $_(e,t,n,r){var i={},o=e[1]-e[0],a=i.interval=bo(o/t,!0);null!=n&&a<n&&(a=i.interval=n),null!=r&&a>r&&(a=i.interval=r);var s=i.intervalPrecision=Q_(a);return function(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),ex(e,0,t),ex(e,1,t),e[0]>e[1]&&(e[0]=e[1])}(i.niceTickExtent=[ao(Math.ceil(e[0]/a)*a,s),ao(Math.floor(e[1]/a)*a,s)],e),i}function J_(e){var t=Math.pow(10,xo(e)),n=e/t;return n?2===n?n=3:3===n?n=5:n*=2:n=1,ao(n*t)}function Q_(e){return lo(e)+2}function ex(e,t,n){e[t]=Math.max(Math.min(e[t],n[1]),n[0])}function tx(e,t){return e>=t[0]&&e<=t[1]}function nx(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function rx(e,t){return e*(t[1]-t[0])+t[0]}var ix=function(e){function t(t){var n=e.call(this,t)||this;n.type="ordinal";var r=n.getSetting("ordinalMeta");return r||(r=new Z_({})),J(r)&&(r=new Z_({categories:j(r,(function(e){return re(e)?e.value:e}))})),n._ordinalMeta=r,n._extent=n.getSetting("extent")||[0,r.categories.length-1],n}return l(t,e),t.prototype.parse=function(e){return null==e?NaN:ee(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return tx(e=this.parse(e),this._extent)&&null!=this._ordinalMeta.categories[e]},t.prototype.normalize=function(e){return nx(e=this._getTickNumber(this.parse(e)),this._extent)},t.prototype.scale=function(e){return e=Math.round(rx(e,this._extent)),this.getRawOrdinalNumber(e)},t.prototype.getTicks=function(){for(var e=[],t=this._extent,n=t[0];n<=t[1];)e.push({value:n}),n++;return e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(null!=e){for(var t=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],r=this._ticksByOrdinalNumber=[],i=0,o=this._ordinalMeta.categories.length,a=Math.min(o,t.length);i<a;++i){var s=t[i];n[i]=s,r[s]=i}for(var l=0;i<o;++i){for(;null!=r[l];)l++;n.push(l),r[l]=i}}else this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null},t.prototype._getTickNumber=function(e){var t=this._ticksByOrdinalNumber;return t&&e>=0&&e<t.length?t[e]:e},t.prototype.getRawOrdinalNumber=function(e){var t=this._ordinalNumbersByTick;return t&&e>=0&&e<t.length?t[e]:e},t.prototype.getLabel=function(e){if(!this.isBlank()){var t=this.getRawOrdinalNumber(e.value),n=this._ordinalMeta.categories[t];return null==n?"":n+""}},t.prototype.count=function(){return this._extent[1]-this._extent[0]+1},t.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},t.prototype.isInExtentRange=function(e){return e=this._getTickNumber(e),this._extent[0]<=e&&this._extent[1]>=e},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type="ordinal",t}(X_);X_.registerClass(ix);var ox=ao,ax=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="interval",t._interval=0,t._intervalPrecision=2,t}return l(t,e),t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return tx(e,this._extent)},t.prototype.normalize=function(e){return nx(e,this._extent)},t.prototype.scale=function(e){return rx(e,this._extent)},t.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=parseFloat(e)),isNaN(t)||(n[1]=parseFloat(t))},t.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1]),this.setExtent(t[0],t[1])},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=Q_(e)},t.prototype.getTicks=function(e){var t=this._interval,n=this._extent,r=this._niceExtent,i=this._intervalPrecision,o=[];if(!t)return o;n[0]<r[0]&&(e?o.push({value:ox(r[0]-t,i)}):o.push({value:n[0]}));for(var a=r[0];a<=r[1]&&(o.push({value:a}),(a=ox(a+t,i))!==o[o.length-1].value);)if(o.length>1e4)return[];var s=o.length?o[o.length-1].value:r[1];return n[1]>s&&(e?o.push({value:ox(s+t,i)}):o.push({value:n[1]})),o},t.prototype.getMinorTicks=function(e){for(var t=this.getTicks(!0),n=[],r=this.getExtent(),i=1;i<t.length;i++){for(var o=t[i],a=t[i-1],s=0,l=[],u=(o.value-a.value)/e;s<e-1;){var c=ox(a.value+(s+1)*u);c>r[0]&&c<r[1]&&l.push(c),s++}n.push(l)}return n},t.prototype.getLabel=function(e,t){if(null==e)return"";var n=t&&t.precision;return null==n?n=lo(e.value)||0:"auto"===n&&(n=this._intervalPrecision),Nd(ox(e.value,n,!0))},t.prototype.calcNiceTicks=function(e,t,n){e=e||5;var r=this._extent,i=r[1]-r[0];if(isFinite(i)){i<0&&(i=-i,r.reverse());var o=$_(r,e,t,n);this._intervalPrecision=o.intervalPrecision,this._interval=o.interval,this._niceExtent=o.niceTickExtent}},t.prototype.calcNiceExtent=function(e){var t=this._extent;if(t[0]===t[1])if(0!==t[0]){var n=Math.abs(t[0]);e.fixMax||(t[1]+=n/2),t[0]-=n/2}else t[1]=1;var r=t[1]-t[0];isFinite(r)||(t[0]=0,t[1]=1),this.calcNiceTicks(e.splitNumber,e.minInterval,e.maxInterval);var i=this._interval;e.fixMin||(t[0]=ox(Math.floor(t[0]/i)*i)),e.fixMax||(t[1]=ox(Math.ceil(t[1]/i)*i))},t.prototype.setNiceExtent=function(e,t){this._niceExtent=[e,t]},t.type="interval",t}(X_);X_.registerClass(ax);var sx="undefined"!=typeof Float32Array,lx=sx?Float32Array:Array;function ux(e){return J(e)?sx?new Float32Array(e):e:new lx(e)}var cx="__ec_stack_";function hx(e){return e.get("stack")||cx+e.seriesIndex}function dx(e){return e.dim+e.index}function px(e,t){var n=[];return t.eachSeriesByType(e,(function(e){yx(e)&&n.push(e)})),n}function fx(e){var t=function(e){var t={};W(e,(function(e){var n=e.coordinateSystem.getBaseAxis();if("time"===n.type||"value"===n.type)for(var r=e.getData(),i=n.dim+"_"+n.index,o=r.getDimensionIndex(r.mapDimension(n.dim)),a=r.getStore(),s=0,l=a.count();s<l;++s){var u=a.get(o,s);t[i]?t[i].push(u):t[i]=[u]}}));var n={};for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(i){i.sort((function(e,t){return e-t}));for(var o=null,a=1;a<i.length;++a){var s=i[a]-i[a-1];s>0&&(o=null===o?s:Math.min(o,s))}n[r]=o}}return n}(e),n=[];return W(e,(function(e){var r,i=e.coordinateSystem.getBaseAxis(),o=i.getExtent();if("category"===i.type)r=i.getBandWidth();else if("value"===i.type||"time"===i.type){var a=i.dim+"_"+i.index,s=t[a],l=Math.abs(o[1]-o[0]),u=i.scale.getExtent(),c=Math.abs(u[1]-u[0]);r=s?l/c*s:l}else{var h=e.getData();r=Math.abs(o[1]-o[0])/h.count()}var d=oo(e.get("barWidth"),r),p=oo(e.get("barMaxWidth"),r),f=oo(e.get("barMinWidth")||(_x(e)?.5:1),r),g=e.get("barGap"),m=e.get("barCategoryGap");n.push({bandWidth:r,barWidth:d,barMaxWidth:p,barMinWidth:f,barGap:g,barCategoryGap:m,axisKey:dx(i),stackId:hx(e)})})),gx(n)}function gx(e){var t={};W(e,(function(e,n){var r=e.axisKey,i=e.bandWidth,o=t[r]||{bandWidth:i,remainedWidth:i,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},a=o.stacks;t[r]=o;var s=e.stackId;a[s]||o.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=e.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(o.remainedWidth,l),o.remainedWidth-=l);var u=e.barMaxWidth;u&&(a[s].maxWidth=u);var c=e.barMinWidth;c&&(a[s].minWidth=c);var h=e.barGap;null!=h&&(o.gap=h);var d=e.barCategoryGap;null!=d&&(o.categoryGap=d)}));var n={};return W(t,(function(e,t){n[t]={};var r=e.stacks,i=e.bandWidth,o=e.categoryGap;if(null==o){var a=q(r).length;o=Math.max(35-4*a,15)+"%"}var s=oo(o,i),l=oo(e.gap,1),u=e.remainedWidth,c=e.autoWidthCount,h=(u-s)/(c+(c-1)*l);h=Math.max(h,0),W(r,(function(e){var t=e.maxWidth,n=e.minWidth;if(e.width){r=e.width;t&&(r=Math.min(r,t)),n&&(r=Math.max(r,n)),e.width=r,u-=r+l*r,c--}else{var r=h;t&&t<r&&(r=Math.min(t,u)),n&&n>r&&(r=n),r!==h&&(e.width=r,u-=r+l*r,c--)}})),h=(u-s)/(c+(c-1)*l),h=Math.max(h,0);var d,p=0;W(r,(function(e,t){e.width||(e.width=h),d=e,p+=e.width*(1+l)})),d&&(p-=d.width*l);var f=-p/2;W(r,(function(e,r){n[t][r]=n[t][r]||{bandWidth:i,offset:f,width:e.width},f+=e.width*(1+l)}))})),n}function mx(e,t){var n=px(e,t),r=fx(n);W(n,(function(e){var t=e.getData(),n=e.coordinateSystem.getBaseAxis(),i=hx(e),o=r[dx(n)][i],a=o.offset,s=o.width;t.setLayout({bandWidth:o.bandWidth,offset:a,size:s})}))}function vx(e){return{seriesType:e,plan:$g(),reset:function(e){if(yx(e)){var t=e.getData(),n=e.coordinateSystem,r=n.getBaseAxis(),i=n.getOtherAxis(r),o=t.getDimensionIndex(t.mapDimension(i.dim)),a=t.getDimensionIndex(t.mapDimension(r.dim)),s=e.get("showBackground",!0),l=t.mapDimension(i.dim),u=t.getCalculationInfo("stackResultDimension"),c=U_(t,l)&&!!t.getCalculationInfo("stackedOnSeries"),h=i.isHorizontal(),d=function(e,t){var n=t.model.get("startValue");n||(n=0);return t.toGlobalCoord(t.dataToCoord("log"===t.type?n>0?n:1:n))}(0,i),p=_x(e),f=e.get("barMinHeight")||0,g=u&&t.getDimensionIndex(u),m=t.getLayout("size"),v=t.getLayout("offset");return{progress:function(e,t){for(var r,i=e.count,l=p&&ux(3*i),u=p&&s&&ux(3*i),y=p&&ux(i),_=n.master.getRect(),x=h?_.width:_.height,b=t.getStore(),w=0;null!=(r=e.next());){var S=b.get(c?g:o,r),T=b.get(a,r),M=d,C=void 0;c&&(C=+S-b.get(o,r));var D=void 0,A=void 0,I=void 0,E=void 0;if(h){var L=n.dataToPoint([S,T]);if(c)M=n.dataToPoint([C,T])[0];D=M,A=L[1]+v,I=L[0]-M,E=m,Math.abs(I)<f&&(I=(I<0?-1:1)*f)}else{L=n.dataToPoint([T,S]);if(c)M=n.dataToPoint([T,C])[1];D=L[0]+v,A=M,I=m,E=L[1]-M,Math.abs(E)<f&&(E=(E<=0?-1:1)*f)}p?(l[w]=D,l[w+1]=A,l[w+2]=h?I:E,u&&(u[w]=h?_.x:D,u[w+1]=h?A:_.y,u[w+2]=x),y[r]=r):t.setItemLayout(r,{x:D,y:A,width:I,height:E}),w+=3}p&&t.setLayout({largePoints:l,largeDataIndices:y,largeBackgroundPoints:u,valueAxisHorizontal:h})}}}}}}function yx(e){return e.coordinateSystem&&"cartesian2d"===e.coordinateSystem.type}function _x(e){return e.pipelineContext&&e.pipelineContext.large}var xx=function(e){function t(t){var n=e.call(this,t)||this;return n.type="time",n}return l(t,e),t.prototype.getLabel=function(e){var t=this.getSetting("useUTC");return gd(e.value,ud[function(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(pd(this._minLevelUnit))]||ud.second,t,this.getSetting("locale"))},t.prototype.getFormattedLabel=function(e,t,n){var r=this.getSetting("useUTC");return function(e,t,n,r,i){var o=null;if(ee(n))o=n;else if(Q(n))o=n(e.value,t,{level:e.level});else{var a=z({},sd);if(e.level>0)for(var s=0;s<cd.length;++s)a[cd[s]]="{primary|"+a[cd[s]]+"}";var l=n?!1===n.inherit?n:V(n,a):a,u=md(e.value,i);if(l[u])o=l[u];else if(l.inherit){for(s=hd.indexOf(u)-1;s>=0;--s)if(l[u]){o=l[u];break}o=o||a.none}if(J(o)){var c=null==e.level?0:e.level>=0?e.level:o.length+e.level;o=o[c=Math.min(c,o.length-1)]}}return gd(new Date(e.value),o,i,r)}(e,t,n,this.getSetting("locale"),r)},t.prototype.getTicks=function(){var e=this._interval,t=this._extent,n=[];if(!e)return n;n.push({value:t[0],level:0});var r=this.getSetting("useUTC"),i=function(e,t,n,r){var i=1e4,o=hd,a=0;function s(e,t,n,i,o,a,s){for(var l=new Date(t),u=t,c=l[i]();u<n&&u<=r[1];)s.push({value:u}),c+=e,l[o](c),u=l.getTime();s.push({value:u,notAdd:!0})}function l(e,i,o){var a=[],l=!i.length;if(!function(e,t,n,r){var i=yo(t),o=yo(n),a=function(e){return vd(i,e,r)===vd(o,e,r)},s=function(){return a("year")},l=function(){return s()&&a("month")},u=function(){return l()&&a("day")},c=function(){return u()&&a("hour")},h=function(){return c()&&a("minute")},d=function(){return h()&&a("second")},p=function(){return d()&&a("millisecond")};switch(e){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return h();case"second":return d();case"millisecond":return p()}}(pd(e),r[0],r[1],n)){l&&(i=[{value:Ax(new Date(r[0]),e,n)},{value:r[1]}]);for(var u=0;u<i.length-1;u++){var c=i[u].value,h=i[u+1].value;if(c!==h){var d=void 0,p=void 0,f=void 0,g=!1;switch(e){case"year":d=Math.max(1,Math.round(t/od/365)),p=yd(n),f=Md(n);break;case"half-year":case"quarter":case"month":d=Tx(t),p=_d(n),f=Cd(n);break;case"week":case"half-week":case"day":d=Sx(t),p=xd(n),f=Dd(n),g=!0;break;case"half-day":case"quarter-day":case"hour":d=Mx(t),p=bd(n),f=Ad(n);break;case"minute":d=Cx(t,!0),p=wd(n),f=Id(n);break;case"second":d=Cx(t,!1),p=Sd(n),f=Ed(n);break;case"millisecond":d=Dx(t),p=Td(n),f=Ld(n)}s(d,c,h,p,f,g,a),"year"===e&&o.length>1&&0===u&&o.unshift({value:o[0].value-d})}}for(u=0;u<a.length;u++)o.push(a[u]);return a}}for(var u=[],c=[],h=0,d=0,p=0;p<o.length&&a++<i;++p){var f=pd(o[p]);if(fd(o[p]))if(l(o[p],u[u.length-1]||[],c),f!==(o[p+1]?pd(o[p+1]):null)){if(c.length){d=h,c.sort((function(e,t){return e.value-t.value}));for(var g=[],m=0;m<c.length;++m){var v=c[m].value;0!==m&&c[m-1].value===v||(g.push(c[m]),v>=r[0]&&v<=r[1]&&h++)}var y=(r[1]-r[0])/t;if(h>1.5*y&&d>y/1.5)break;if(u.push(g),h>y||e===o[p])break}c=[]}}"production"!==process.env.NODE_ENV&&a>=i&&No("Exceed safe limit.");var _=Y(j(u,(function(e){return Y(e,(function(e){return e.value>=r[0]&&e.value<=r[1]&&!e.notAdd}))})),(function(e){return e.length>0})),x=[],b=_.length-1;for(p=0;p<_.length;++p)for(var w=_[p],S=0;S<w.length;++S)x.push({value:w[S].value,level:b-p});x.sort((function(e,t){return e.value-t.value}));var T=[];for(p=0;p<x.length;++p)0!==p&&x[p].value===x[p-1].value||T.push(x[p]);return T}(this._minLevelUnit,this._approxInterval,r,t);return(n=n.concat(i)).push({value:t[1],level:0}),n},t.prototype.calcNiceExtent=function(e){var t=this._extent;if(t[0]===t[1]&&(t[0]-=od,t[1]+=od),t[1]===-1/0&&t[0]===1/0){var n=new Date;t[1]=+new Date(n.getFullYear(),n.getMonth(),n.getDate()),t[0]=t[1]-od}this.calcNiceTicks(e.splitNumber,e.minInterval,e.maxInterval)},t.prototype.calcNiceTicks=function(e,t,n){e=e||10;var r=this._extent,i=r[1]-r[0];this._approxInterval=i/e,null!=t&&this._approxInterval<t&&(this._approxInterval=t),null!=n&&this._approxInterval>n&&(this._approxInterval=n);var o=bx.length,a=Math.min(function(e,t,n,r){for(;n<r;){var i=n+r>>>1;e[i][1]<t?n=i+1:r=i}return n}(bx,this._approxInterval,0,o),o-1);this._interval=bx[a][1],this._minLevelUnit=bx[Math.max(a-1,0)][0]},t.prototype.parse=function(e){return ne(e)?e:+yo(e)},t.prototype.contain=function(e){return tx(this.parse(e),this._extent)},t.prototype.normalize=function(e){return nx(this.parse(e),this._extent)},t.prototype.scale=function(e){return rx(e,this._extent)},t.type="time",t}(ax),bx=[["second",nd],["minute",rd],["hour",id],["quarter-day",216e5],["half-day",432e5],["day",10368e4],["half-week",3024e5],["week",6048e5],["month",26784e5],["quarter",8208e6],["half-year",ad/2],["year",ad]];function Sx(e,t){return(e/=od)>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function Tx(e){return(e/=2592e6)>6?6:e>3?3:e>2?2:1}function Mx(e){return(e/=id)>12?12:e>6?6:e>3.5?4:e>2?2:1}function Cx(e,t){return(e/=t?rd:nd)>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function Dx(e){return bo(e,!0)}function Ax(e,t,n){var r=new Date(e);switch(pd(t)){case"year":case"month":r[Cd(n)](0);case"day":r[Dd(n)](1);case"hour":r[Ad(n)](0);case"minute":r[Id(n)](0);case"second":r[Ed(n)](0),r[Ld(n)](0)}return r.getTime()}X_.registerClass(xx);var Ix=X_.prototype,Ex=ax.prototype,Lx=ao,Nx=Math.floor,Px=Math.ceil,Ox=Math.pow,Rx=Math.log,kx=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="log",t.base=10,t._originalScale=new ax,t._interval=0,t}return l(t,e),t.prototype.getTicks=function(e){var t=this._originalScale,n=this._extent,r=t.getExtent();return j(Ex.getTicks.call(this,e),(function(e){var t=e.value,i=ao(Ox(this.base,t));return i=t===n[0]&&this._fixMin?Vx(i,r[0]):i,{value:i=t===n[1]&&this._fixMax?Vx(i,r[1]):i}}),this)},t.prototype.setExtent=function(e,t){var n=Rx(this.base);e=Rx(Math.max(0,e))/n,t=Rx(Math.max(0,t))/n,Ex.setExtent.call(this,e,t)},t.prototype.getExtent=function(){var e=this.base,t=Ix.getExtent.call(this);t[0]=Ox(e,t[0]),t[1]=Ox(e,t[1]);var n=this._originalScale.getExtent();return this._fixMin&&(t[0]=Vx(t[0],n[0])),this._fixMax&&(t[1]=Vx(t[1],n[1])),t},t.prototype.unionExtent=function(e){this._originalScale.unionExtent(e);var t=this.base;e[0]=Rx(e[0])/Rx(t),e[1]=Rx(e[1])/Rx(t),Ix.unionExtent.call(this,e)},t.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},t.prototype.calcNiceTicks=function(e){e=e||10;var t=this._extent,n=t[1]-t[0];if(!(n===1/0||n<=0)){var r=_o(n);for(e/n*r<=.5&&(r*=10);!isNaN(r)&&Math.abs(r)<1&&Math.abs(r)>0;)r*=10;var i=[ao(Px(t[0]/r)*r),ao(Nx(t[1]/r)*r)];this._interval=r,this._niceExtent=i}},t.prototype.calcNiceExtent=function(e){Ex.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return tx(e=Rx(e)/Rx(this.base),this._extent)},t.prototype.normalize=function(e){return nx(e=Rx(e)/Rx(this.base),this._extent)},t.prototype.scale=function(e){return e=rx(e,this._extent),Ox(this.base,e)},t.type="log",t}(X_),zx=kx.prototype;function Vx(e,t){return Lx(e,lo(t))}zx.getMinorTicks=Ex.getMinorTicks,zx.getLabel=Ex.getLabel,X_.registerClass(kx);var Bx=function(){function e(e,t,n){this._prepareParams(e,t,n)}return e.prototype._prepareParams=function(e,t,n){n[1]<n[0]&&(n=[NaN,NaN]),this._dataMin=n[0],this._dataMax=n[1];var r=this._isOrdinal="ordinal"===e.type;this._needCrossZero="interval"===e.type&&t.getNeedCrossZero&&t.getNeedCrossZero();var i=t.get("min",!0);null==i&&(i=t.get("startValue",!0));var o=this._modelMinRaw=i;Q(o)?this._modelMinNum=Ux(e,o({min:n[0],max:n[1]})):"dataMin"!==o&&(this._modelMinNum=Ux(e,o));var a=this._modelMaxRaw=t.get("max",!0);if(Q(a)?this._modelMaxNum=Ux(e,a({min:n[0],max:n[1]})):"dataMax"!==a&&(this._modelMaxNum=Ux(e,a)),r)this._axisDataLen=t.getCategories().length;else{var s=t.get("boundaryGap"),l=J(s)?s:[s||0,s||0];"boolean"==typeof l[0]||"boolean"==typeof l[1]?("production"!==process.env.NODE_ENV&&console.warn('Boolean type for boundaryGap is only allowed for ordinal axis. Please use string in percentage instead, e.g., "20%". Currently, boundaryGap is set to be 0.'),this._boundaryGapInner=[0,0]):this._boundaryGapInner=[Ri(l[0],1),Ri(l[1],1)]}},e.prototype.calculate=function(){var e=this._isOrdinal,t=this._dataMin,n=this._dataMax,r=this._axisDataLen,i=this._boundaryGapInner,o=e?null:n-t||Math.abs(t),a="dataMin"===this._modelMinRaw?t:this._modelMinNum,s="dataMax"===this._modelMaxRaw?n:this._modelMaxNum,l=null!=a,u=null!=s;null==a&&(a=e?r?0:NaN:t-i[0]*o),null==s&&(s=e?r?r-1:NaN:n+i[1]*o),(null==a||!isFinite(a))&&(a=NaN),(null==s||!isFinite(s))&&(s=NaN);var c=ce(a)||ce(s)||e&&!r;this._needCrossZero&&(a>0&&s>0&&!l&&(a=0),a<0&&s<0&&!u&&(s=0));var h=this._determinedMin,d=this._determinedMax;return null!=h&&(a=h,l=!0),null!=d&&(s=d,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:c}},e.prototype.modifyDataMinMax=function(e,t){"production"!==process.env.NODE_ENV&&me(!this.frozen),this[Gx[e]]=t},e.prototype.setDeterminedMinMax=function(e,t){var n=Fx[e];"production"!==process.env.NODE_ENV&&me(!this.frozen&&null==this[n]),this[n]=t},e.prototype.freeze=function(){this.frozen=!0},e}(),Fx={min:"_determinedMin",max:"_determinedMax"},Gx={min:"_dataMin",max:"_dataMax"};function Hx(e,t,n){var r=e.rawExtentInfo;return r||(r=new Bx(e,t,n),e.rawExtentInfo=r,r)}function Ux(e,t){return null==t?null:ce(t)?NaN:e.parse(t)}function Wx(e,t){var n=e.type,r=Hx(e,t,e.getExtent()).calculate();e.setBlank(r.isBlank);var i=r.min,o=r.max,a=t.ecModel;if(a&&"time"===n){var s=px("bar",a),l=!1;if(W(s,(function(e){l=l||e.getBaseAxis()===t.axis})),l){var u=fx(s),c=function(e,t,n,r){var i=n.axis.getExtent(),o=i[1]-i[0],a=function(e,t,n){if(e&&t){var r=e[dx(t)];return null!=r&&null!=n?r[hx(n)]:r}}(r,n.axis);if(void 0===a)return{min:e,max:t};var s=1/0;W(a,(function(e){s=Math.min(e.offset,s)}));var l=-1/0;W(a,(function(e){l=Math.max(e.offset+e.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=t-e,h=c/(1-(s+l)/o)-c;return t+=h*(l/u),e-=h*(s/u),{min:e,max:t}}(i,o,t,u);i=c.min,o=c.max}}return{extent:[i,o],fixMin:r.minFixed,fixMax:r.maxFixed}}function jx(e,t){var n=t,r=Wx(e,n),i=r.extent,o=n.get("splitNumber");e instanceof kx&&(e.base=n.get("logBase"));var a=e.type,s=n.get("interval"),l="interval"===a||"time"===a;e.setExtent(i[0],i[1]),e.calcNiceExtent({splitNumber:o,fixMin:r.fixMin,fixMax:r.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&e.setInterval&&e.setInterval(s)}function Xx(e,t){if(t=t||e.get("type"))switch(t){case"category":return new ix({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new xx({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(X_.getClass(t)||ax)}}function Yx(e){var t,n,r=e.getLabelModel().get("formatter"),i="category"===e.type?e.scale.getExtent()[0]:null;return"time"===e.scale.type?(n=r,function(t,r){return e.scale.getFormattedLabel(t,r,n)}):ee(r)?function(t){return function(n){var r=e.scale.getLabel(n);return t.replace("{value}",null!=r?r:"")}}(r):Q(r)?(t=r,function(n,r){return null!=i&&(r=n.value-i),t(Zx(e,n),r,null!=n.level?{level:n.level}:null)}):function(t){return e.scale.getLabel(t)}}function Zx(e,t){return"category"===e.type?e.scale.getLabel(t):t.value}function qx(e,t){var n=t*Math.PI/180,r=e.width,i=e.height,o=r*Math.abs(Math.cos(n))+Math.abs(i*Math.sin(n)),a=r*Math.abs(Math.sin(n))+Math.abs(i*Math.cos(n));return new jt(e.x,e.y,o,a)}function Kx(e){var t=e.get("interval");return null==t?"auto":t}function $x(e){return"category"===e.type&&0===Kx(e.getLabelModel())}function Jx(e,t){var n={};return W(e.mapDimensionsAll(t),(function(t){n[W_(e,t)]=!0})),q(n)}var Qx=function(){function e(){}return e.prototype.getNeedCrossZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}();function eb(e){return j_(null,e)}var tb={isDimensionStacked:U_,enableDataStack:H_,getStackedDimension:W_};function nb(e,t){var n=t;t instanceof Wh||(n=new Wh(t));var r=Xx(n);return r.setExtent(e[0],e[1]),jx(r,n),r}function rb(e){H(e,Qx)}var ib=Object.freeze({__proto__:null,createDimensions:k_,createList:eb,createScale:nb,createSymbol:dv,createTextStyle:function(e,t){return wh(e,null,null,"normal"!==(t=t||{}).state)},dataStack:tb,enableHoverEmphasis:uu,getECData:bl,getLayoutRect:Zd,mixinAxisModelCommonMethods:rb});function ob(e,t){return Math.abs(e-t)<1e-8}function ab(e,t,n){var r=0,i=e[0];if(!i)return!1;for(var o=1;o<e.length;o++){var a=e[o];r+=Rs(i[0],i[1],a[0],a[1],t,n),i=a}var s=e[0];return ob(i[0],s[0])&&ob(i[1],s[1])||(r+=Rs(i[0],i[1],s[0],s[1],t,n)),0!==r}var sb=[];function lb(e,t){for(var n=0;n<e.length;n++)Ke(e[n],e[n],t)}function ub(e,t,n,r){for(var i=0;i<e.length;i++){var o=e[i];r&&(o=r.project(o)),o&&isFinite(o[0])&&isFinite(o[1])&&($e(t,t,o),Je(n,n,o))}}var cb=function(){function e(e){this.name=e}return e.prototype.setCenter=function(e){this._center=e},e.prototype.getCenter=function(){var e=this._center;return e||(e=this._center=this.calcCenter()),e},e}(),hb=function(e,t){this.type="polygon",this.exterior=e,this.interiors=t},db=function(e){this.type="linestring",this.points=e},pb=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.type="geoJSON",i.geometries=n,i._center=r&&[r[0],r[1]],i}return l(t,e),t.prototype.calcCenter=function(){for(var e,t=this.geometries,n=0,r=0;r<t.length;r++){var i=t[r],o=i.exterior,a=o&&o.length;a>n&&(e=i,n=a)}if(e)return function(e){for(var t=0,n=0,r=0,i=e.length,o=e[i-1][0],a=e[i-1][1],s=0;s<i;s++){var l=e[s][0],u=e[s][1],c=o*u-l*a;t+=c,n+=(o+l)*c,r+=(a+u)*c,o=l,a=u}return t?[n/t/3,r/t/3,t]:[e[0][0]||0,e[0][1]||0]}(e.exterior);var s=this.getBoundingRect();return[s.x+s.width/2,s.y+s.height/2]},t.prototype.getBoundingRect=function(e){var t=this._rect;if(t&&!e)return t;var n=[1/0,1/0],r=[-1/0,-1/0];return W(this.geometries,(function(t){"polygon"===t.type?ub(t.exterior,n,r,e):W(t.points,(function(t){ub(t,n,r,e)}))})),isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])||(n[0]=n[1]=r[0]=r[1]=0),t=new jt(n[0],n[1],r[0]-n[0],r[1]-n[1]),e||(this._rect=t),t},t.prototype.contain=function(e){var t=this.getBoundingRect(),n=this.geometries;if(!t.contain(e[0],e[1]))return!1;e:for(var r=0,i=n.length;r<i;r++){var o=n[r];if("polygon"===o.type){var a=o.exterior,s=o.interiors;if(ab(a,e[0],e[1])){for(var l=0;l<(s?s.length:0);l++)if(ab(s[l],e[0],e[1]))continue e;return!0}}}return!1},t.prototype.transformTo=function(e,t,n,r){var i=this.getBoundingRect(),o=i.width/i.height;n?r||(r=n/o):n=o*r;for(var a=new jt(e,t,n,r),s=i.calculateTransform(a),l=this.geometries,u=0;u<l.length;u++){var c=l[u];"polygon"===c.type?(lb(c.exterior,s),W(c.interiors,(function(e){lb(e,s)}))):W(c.points,(function(e){lb(e,s)}))}(i=this._rect).copy(a),this._center=[i.x+i.width/2,i.y+i.height/2]},t.prototype.cloneShallow=function(e){null==e&&(e=this.name);var n=new t(e,this.geometries,this._center);return n._rect=this._rect,n.transformTo=null,n},t}(cb),fb=function(e){function t(t,n){var r=e.call(this,t)||this;return r.type="geoSVG",r._elOnlyForCalculate=n,r}return l(t,e),t.prototype.calcCenter=function(){for(var e=this._elOnlyForCalculate,t=e.getBoundingRect(),n=[t.x+t.width/2,t.y+t.height/2],r=Dt(sb),i=e;i&&!i.isGeoSVGGraphicRoot;)It(r,i.getLocalTransform(),r),i=i.parent;return Pt(r,r),Ke(n,n,r),n},t}(cb);function gb(e,t,n){for(var r=0;r<e.length;r++)e[r]=mb(e[r],t[r],n)}function mb(e,t,n){for(var r=[],i=t[0],o=t[1],a=0;a<e.length;a+=2){var s=e.charCodeAt(a)-64,l=e.charCodeAt(a+1)-64;s=s>>1^-(1&s),l=l>>1^-(1&l),i=s+=i,o=l+=o,r.push([s/n,l/n])}return r}function vb(e,t){return j(Y((e=function(e){if(!e.UTF8Encoding)return e;var t=e,n=t.UTF8Scale;return null==n&&(n=1024),W(t.features,(function(e){var t=e.geometry,r=t.encodeOffsets,i=t.coordinates;if(r)switch(t.type){case"LineString":t.coordinates=mb(i,r,n);break;case"Polygon":case"MultiLineString":gb(i,r,n);break;case"MultiPolygon":W(i,(function(e,t){return gb(e,r[t],n)}))}})),t.UTF8Encoding=!1,t}(e)).features,(function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0})),(function(e){var n=e.properties,r=e.geometry,i=[];switch(r.type){case"Polygon":var o=r.coordinates;i.push(new hb(o[0],o.slice(1)));break;case"MultiPolygon":W(r.coordinates,(function(e){e[0]&&i.push(new hb(e[0],e.slice(1)))}));break;case"LineString":i.push(new db([r.coordinates]));break;case"MultiLineString":i.push(new db(r.coordinates))}var a=new pb(n[t||"name"],i,n.cp);return a.properties=n,a}))}var yb=Object.freeze({__proto__:null,MAX_SAFE_INTEGER:fo,asc:so,getPercentWithPrecision:function(e,t,n){return e[t]&&ho(e,n)[t]||0},getPixelPrecision:co,getPrecision:lo,getPrecisionSafe:uo,isNumeric:Mo,isRadianAroundZero:mo,linearMap:io,nice:bo,numericToNumber:To,parseDate:yo,quantile:wo,quantity:_o,quantityExponent:xo,reformIntervals:So,remRadian:go,round:ao}),_b=Object.freeze({__proto__:null,format:gd,parse:yo}),xb=Object.freeze({__proto__:null,Arc:_c,BezierCurve:vc,BoundingRect:jt,Circle:Fu,CompoundPath:xc,Ellipse:Hu,Group:Yi,Image:Js,IncrementalDisplayable:Ec,Line:pc,LinearGradient:wc,Polygon:lc,Polyline:cc,RadialGradient:Sc,Rect:ol,Ring:oc,Sector:rc,Text:ll,clipPointsByRect:sh,clipRectByRect:lh,createIcon:uh,extendPath:Xc,extendShape:Wc,getShapeClass:Zc,getTransform:nh,initProps:Rc,makeImage:Kc,makePath:qc,mergePath:Jc,registerShape:Yc,resizePath:Qc,updateProps:Oc}),bb=Object.freeze({__proto__:null,addCommas:Nd,capitalFirst:function(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e},encodeHTML:dt,formatTime:Fd,formatTpl:Vd,getTextRect:function(e,t,n,r,i,o,a,s){return new ll({style:{text:e,font:t,align:n,verticalAlign:r,padding:i,rich:o,overflow:a?"truncate":null,lineHeight:s}}).getBoundingRect()},getTooltipMarker:Bd,normalizeCssArray:Od,toCamelCase:Pd,truncateText:Ia}),wb=Object.freeze({__proto__:null,bind:K,clone:O,curry:$,defaults:V,each:W,extend:z,filter:Y,indexOf:F,inherits:G,isArray:J,isFunction:Q,isObject:re,isString:ee,map:j,merge:R,reduce:X}),Sb=ta();function Tb(e,t){var n=j(t,(function(t){return e.scale.parse(t)}));return"time"===e.type&&n.length>0&&(n.sort(),n.unshift(n[0]),n.push(n[n.length-1])),n}function Mb(e){var t=e.getLabelModel().get("customValues");if(t){var n=Yx(e);return{labels:Tb(e,t).map((function(t){var r={value:t};return{formattedLabel:n(r),rawLabel:e.scale.getLabel(r),tickValue:t}}))}}return"category"===e.type?function(e){var t=e.getLabelModel(),n=Db(e,t);return!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}(e):function(e){var t=e.scale.getTicks(),n=Yx(e);return{labels:j(t,(function(t,r){return{level:t.level,formattedLabel:n(t,r),rawLabel:e.scale.getLabel(t),tickValue:t.value}}))}}(e)}function Cb(e,t){var n=e.getTickModel().get("customValues");return n?{ticks:Tb(e,n)}:"category"===e.type?function(e,t){var n,r,i=Ab(e,"ticks"),o=Kx(t),a=Ib(i,o);if(a)return a;t.get("show")&&!e.scale.isBlank()||(n=[]);if(Q(o))n=Nb(e,o,!0);else if("auto"===o){var s=Db(e,e.getLabelModel());r=s.labelCategoryInterval,n=j(s.labels,(function(e){return e.tickValue}))}else n=Lb(e,r=o,!0);return Eb(i,o,{ticks:n,tickCategoryInterval:r})}(e,t):{ticks:j(e.scale.getTicks(),(function(e){return e.value}))}}function Db(e,t){var n,r,i=Ab(e,"labels"),o=Kx(t),a=Ib(i,o);return a||(Q(o)?n=Nb(e,o):(r="auto"===o?function(e){var t=Sb(e).autoInterval;return null!=t?t:Sb(e).autoInterval=e.calculateCategoryInterval()}(e):o,n=Lb(e,r)),Eb(i,o,{labels:n,labelCategoryInterval:r}))}function Ab(e,t){return Sb(e)[t]||(Sb(e)[t]=[])}function Ib(e,t){for(var n=0;n<e.length;n++)if(e[n].key===t)return e[n].value}function Eb(e,t,n){return e.push({key:t,value:n}),n}function Lb(e,t,n){var r=Yx(e),i=e.scale,o=i.getExtent(),a=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=o[0],c=i.count();0!==u&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=$x(e),d=a.get("showMinLabel")||h,p=a.get("showMaxLabel")||h;d&&u!==o[0]&&g(o[0]);for(var f=u;f<=o[1];f+=l)g(f);function g(e){var t={value:e};s.push(n?e:{formattedLabel:r(t),rawLabel:i.getLabel(t),tickValue:e})}return p&&f-l!==o[1]&&g(o[1]),s}function Nb(e,t,n){var r=e.scale,i=Yx(e),o=[];return W(r.getTicks(),(function(e){var a=r.getLabel(e),s=e.value;t(e.value,a)&&o.push(n?s:{formattedLabel:i(e),rawLabel:a,tickValue:s})})),o}var Pb=[0,1],Ob=function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]);return e>=n&&e<=r},e.prototype.containData=function(e){return this.scale.contain(e)},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(e){return co(e||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this._extent,r=this.scale;return e=r.normalize(e),this.onBand&&"ordinal"===r.type&&Rb(n=n.slice(),r.count()),io(e,Pb,n,t)},e.prototype.coordToData=function(e,t){var n=this._extent,r=this.scale;this.onBand&&"ordinal"===r.type&&Rb(n=n.slice(),r.count());var i=io(e,n,Pb,t);return this.scale.scale(i)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){var t=(e=e||{}).tickModel||this.getTickModel(),n=j(Cb(this,t).ticks,(function(e){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(e):e),tickValue:e}}),this);return function(e,t,n,r){var i=t.length;if(!e.onBand||n||!i)return;var o,a,s=e.getExtent();if(1===i)t[0].coord=s[0],o=t[1]={coord:s[1]};else{var l=t[i-1].tickValue-t[0].tickValue,u=(t[i-1].coord-t[0].coord)/l;W(t,(function(e){e.coord-=u/2})),a=1+e.scale.getExtent()[1]-t[i-1].tickValue,o={coord:t[i-1].coord+u*a},t.push(o)}var c=s[0]>s[1];h(t[0].coord,s[0])&&(r?t[0].coord=s[0]:t.shift());r&&h(s[0],t[0].coord)&&t.unshift({coord:s[0]});h(s[1],o.coord)&&(r?o.coord=s[1]:t.pop());r&&h(o.coord,s[1])&&t.push({coord:s[1]});function h(e,t){return e=ao(e),t=ao(t),c?e>t:e<t}}(this,n,t.get("alignWithLabel"),e.clamp),n},e.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var e=this.model.getModel("minorTick").get("splitNumber");return e>0&&e<100||(e=5),j(this.scale.getMinorTicks(e),(function(e){return j(e,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this)}),this)},e.prototype.getViewLabels=function(){return Mb(this).labels},e.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},e.prototype.getTickModel=function(){return this.model.getModel("axisTick")},e.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),n=t[1]-t[0]+(this.onBand?1:0);0===n&&(n=1);var r=Math.abs(e[1]-e[0]);return Math.abs(r)/n},e.prototype.calculateCategoryInterval=function(){return function(e){var t=function(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}(e),n=Yx(e),r=(t.axisRotate-t.labelRotate)/180*Math.PI,i=e.scale,o=i.getExtent(),a=i.count();if(o[1]-o[0]<1)return 0;var s=1;a>40&&(s=Math.max(1,Math.floor(a/40)));for(var l=o[0],u=e.dataToCoord(l+1)-e.dataToCoord(l),c=Math.abs(u*Math.cos(r)),h=Math.abs(u*Math.sin(r)),d=0,p=0;l<=o[1];l+=s){var f,g,m=Li(n({value:l}),t.font,"center","top");f=1.3*m.width,g=1.3*m.height,d=Math.max(d,f,7),p=Math.max(p,g,7)}var v=d/c,y=p/h;isNaN(v)&&(v=1/0),isNaN(y)&&(y=1/0);var _=Math.max(0,Math.floor(Math.min(v,y))),x=Sb(e.model),b=e.getExtent(),w=x.lastAutoInterval,S=x.lastTickCount;return null!=w&&null!=S&&Math.abs(w-_)<=1&&Math.abs(S-a)<=1&&w>_&&x.axisExtent0===b[0]&&x.axisExtent1===b[1]?_=w:(x.lastTickCount=a,x.lastAutoInterval=_,x.axisExtent0=b[0],x.axisExtent1=b[1]),_}(this)},e}();function Rb(e,t){var n=(e[1]-e[0])/t/2;e[0]+=n,e[1]-=n}var kb=2*Math.PI,zb=Ds.CMD,Vb=["top","right","bottom","left"];function Bb(e,t,n,r,i){var o=n.width,a=n.height;switch(e){case"top":r.set(n.x+o/2,n.y-t),i.set(0,-1);break;case"bottom":r.set(n.x+o/2,n.y+a+t),i.set(0,1);break;case"left":r.set(n.x-t,n.y+a/2),i.set(-1,0);break;case"right":r.set(n.x+o+t,n.y+a/2),i.set(1,0)}}function Fb(e,t,n,r,i,o,a,s,l){a-=e,s-=t;var u=Math.sqrt(a*a+s*s),c=(a/=u)*n+e,h=(s/=u)*n+t;if(Math.abs(r-i)%kb<1e-4)return l[0]=c,l[1]=h,u-n;if(o){var d=r;r=Ns(i),i=Ns(d)}else r=Ns(r),i=Ns(i);r>i&&(i+=kb);var p=Math.atan2(s,a);if(p<0&&(p+=kb),p>=r&&p<=i||p+kb>=r&&p+kb<=i)return l[0]=c,l[1]=h,u-n;var f=n*Math.cos(r)+e,g=n*Math.sin(r)+t,m=n*Math.cos(i)+e,v=n*Math.sin(i)+t,y=(f-a)*(f-a)+(g-s)*(g-s),_=(m-a)*(m-a)+(v-s)*(v-s);return y<_?(l[0]=f,l[1]=g,Math.sqrt(y)):(l[0]=m,l[1]=v,Math.sqrt(_))}function Gb(e,t,n,r,i,o,a,s){var l=i-e,u=o-t,c=n-e,h=r-t,d=Math.sqrt(c*c+h*h),p=(l*(c/=d)+u*(h/=d))/d;s&&(p=Math.min(Math.max(p,0),1)),p*=d;var f=a[0]=e+p*c,g=a[1]=t+p*h;return Math.sqrt((f-i)*(f-i)+(g-o)*(g-o))}function Hb(e,t,n,r,i,o,a){n<0&&(e+=n,n=-n),r<0&&(t+=r,r=-r);var s=e+n,l=t+r,u=a[0]=Math.min(Math.max(i,e),s),c=a[1]=Math.min(Math.max(o,t),l);return Math.sqrt((u-i)*(u-i)+(c-o)*(c-o))}var Ub=[];function Wb(e,t,n){var r=Hb(t.x,t.y,t.width,t.height,e.x,e.y,Ub);return n.set(Ub[0],Ub[1]),r}function jb(e,t,n){for(var r,i,o=0,a=0,s=0,l=0,u=1/0,c=t.data,h=e.x,d=e.y,p=0;p<c.length;){var f=c[p++];1===p&&(s=o=c[p],l=a=c[p+1]);var g=u;switch(f){case zb.M:o=s=c[p++],a=l=c[p++];break;case zb.L:g=Gb(o,a,c[p],c[p+1],h,d,Ub,!0),o=c[p++],a=c[p++];break;case zb.C:g=Ln(o,a,c[p++],c[p++],c[p++],c[p++],c[p],c[p+1],h,d,Ub),o=c[p++],a=c[p++];break;case zb.Q:g=zn(o,a,c[p++],c[p++],c[p],c[p+1],h,d,Ub),o=c[p++],a=c[p++];break;case zb.A:var m=c[p++],v=c[p++],y=c[p++],_=c[p++],x=c[p++],b=c[p++];p+=1;var w=!!(1-c[p++]);r=Math.cos(x)*y+m,i=Math.sin(x)*_+v,p<=1&&(s=r,l=i),g=Fb(m,v,_,x,x+b,w,(h-m)*_/y+m,d,Ub),o=Math.cos(x+b)*y+m,a=Math.sin(x+b)*_+v;break;case zb.R:g=Hb(s=o=c[p++],l=a=c[p++],c[p++],c[p++],h,d,Ub);break;case zb.Z:g=Gb(o,a,s,l,h,d,Ub,!0),o=s,a=l}g<u&&(u=g,n.set(Ub[0],Ub[1]))}return u}var Xb=new kt,Yb=new kt,Zb=new kt,qb=new kt,Kb=new kt;function $b(e,t){if(e){var n=e.getTextGuideLine(),r=e.getTextContent();if(r&&n){var i=e.textGuideLineConfig||{},o=[[0,0],[0,0],[0,0]],a=i.candidates||Vb,s=r.getBoundingRect().clone();s.applyTransform(r.getComputedTransform());var l=1/0,u=i.anchor,c=e.getComputedTransform(),h=c&&Pt([],c),d=t.get("length2")||0;u&&Zb.copy(u);for(var p=0;p<a.length;p++){Bb(a[p],0,s,Xb,qb),kt.scaleAndAdd(Yb,Xb,qb,d),Yb.transform(h);var f=e.getBoundingRect(),g=u?u.distance(Yb):e instanceof Ys?jb(Yb,e.path,Zb):Wb(Yb,f,Zb);g<l&&(l=g,Yb.transform(c),Zb.transform(c),Zb.toArray(o[0]),Yb.toArray(o[1]),Xb.toArray(o[2]))}ew(o,t.get("minTurnAngle")),n.setShape({points:o})}}}var Jb=[],Qb=new kt;function ew(e,t){if(t<=180&&t>0){t=t/180*Math.PI,Xb.fromArray(e[0]),Yb.fromArray(e[1]),Zb.fromArray(e[2]),kt.sub(qb,Xb,Yb),kt.sub(Kb,Zb,Yb);var n=qb.len(),r=Kb.len();if(!(n<.001||r<.001)){qb.scale(1/n),Kb.scale(1/r);var i=qb.dot(Kb);if(Math.cos(t)<i){var o=Gb(Yb.x,Yb.y,Zb.x,Zb.y,Xb.x,Xb.y,Jb,!1);Qb.fromArray(Jb),Qb.scaleAndAdd(Kb,o/Math.tan(Math.PI-t));var a=Zb.x!==Yb.x?(Qb.x-Yb.x)/(Zb.x-Yb.x):(Qb.y-Yb.y)/(Zb.y-Yb.y);if(isNaN(a))return;a<0?kt.copy(Qb,Yb):a>1&&kt.copy(Qb,Zb),Qb.toArray(e[1])}}}}function tw(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,Xb.fromArray(e[0]),Yb.fromArray(e[1]),Zb.fromArray(e[2]),kt.sub(qb,Yb,Xb),kt.sub(Kb,Zb,Yb);var r=qb.len(),i=Kb.len();if(!(r<.001||i<.001))if(qb.scale(1/r),Kb.scale(1/i),qb.dot(t)<Math.cos(n)){var o=Gb(Yb.x,Yb.y,Zb.x,Zb.y,Xb.x,Xb.y,Jb,!1);Qb.fromArray(Jb);var a=Math.PI/2,s=a+Math.acos(Kb.dot(t))-n;if(s>=a)kt.copy(Qb,Zb);else{Qb.scaleAndAdd(Kb,o/Math.tan(Math.PI/2-s));var l=Zb.x!==Yb.x?(Qb.x-Yb.x)/(Zb.x-Yb.x):(Qb.y-Yb.y)/(Zb.y-Yb.y);if(isNaN(l))return;l<0?kt.copy(Qb,Yb):l>1&&kt.copy(Qb,Zb)}Qb.toArray(e[1])}}}function nw(e,t,n,r){var i="normal"===n,o=i?e:e.ensureState(n);o.ignore=t;var a=r.get("smooth");a&&!0===a&&(a=.3),o.shape=o.shape||{},a>0&&(o.shape.smooth=a);var s=r.getModel("lineStyle").getLineStyle();i?e.useStyle(s):o.style=s}function rw(e,t){var n=t.smooth,r=t.points;if(r)if(e.moveTo(r[0][0],r[0][1]),n>0&&r.length>=3){var i=Xe(r[0],r[1]),o=Xe(r[1],r[2]);if(!i||!o)return e.lineTo(r[1][0],r[1][1]),void e.lineTo(r[2][0],r[2][1]);var a=Math.min(i,o)*n,s=qe([],r[1],r[0],a/i),l=qe([],r[1],r[2],a/o),u=qe([],s,l,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),e.bezierCurveTo(l[0],l[1],l[0],l[1],r[2][0],r[2][1])}else for(var c=1;c<r.length;c++)e.lineTo(r[c][0],r[c][1])}function iw(e,t,n){var r=e.getTextGuideLine(),i=e.getTextContent();if(i){for(var o=t.normal,a=o.get("show"),s=i.ignore,l=0;l<Al.length;l++){var u=Al[l],c=t[u],h="normal"===u;if(c){var d=c.get("show");if((h?s:de(i.states[u]&&i.states[u].ignore,s))||!de(d,a)){var p=h?r:r&&r.states[u];p&&(p.ignore=!0),r&&nw(r,!0,u,c);continue}r||(r=new cc,e.setTextGuideLine(r),h||!s&&a||nw(r,!0,"normal",t.normal),e.stateProxy&&(r.stateProxy=e.stateProxy)),nw(r,!1,u,c)}}if(r){V(r.style,n),r.style.fill=null;var f=o.get("showAbove");(e.textGuideLineConfig=e.textGuideLineConfig||{}).showAbove=f||!1,r.buildPath=rw}}else r&&e.removeTextGuideLine()}function ow(e,t){t=t||"labelLine";for(var n={normal:e.getModel(t)},r=0;r<Dl.length;r++){var i=Dl[r];n[i]=e.getModel([i,t])}return n}function aw(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if(!r.defaultAttr.ignore){var i=r.label,o=i.getComputedTransform(),a=i.getBoundingRect(),s=!o||o[1]<1e-5&&o[2]<1e-5,l=i.style.margin||0,u=a.clone();u.applyTransform(o),u.x-=l/2,u.y-=l/2,u.width+=l,u.height+=l;var c=s?new Ac(a,o):null;t.push({label:i,labelLine:r.labelLine,rect:u,localRect:a,obb:c,priority:r.priority,defaultAttr:r.defaultAttr,layoutOption:r.computedLayoutOption,axisAligned:s,transform:o})}}return t}function sw(e,t,n,r,i,o){var a=e.length;if(!(a<2)){e.sort((function(e,n){return e.rect[t]-n.rect[t]}));for(var s,l=0,u=!1,c=0,h=0;h<a;h++){var d=e[h],p=d.rect;(s=p[t]-l)<0&&(p[t]-=s,d.label[t]-=s,u=!0),c+=Math.max(-s,0),l=p[t]+p[n]}c>0&&o&&x(-c/a,0,a);var f,g,m=e[0],v=e[a-1];return y(),f<0&&b(-f,.8),g<0&&b(g,.8),y(),_(f,g,1),_(g,f,-1),y(),f<0&&w(-f),g<0&&w(g),u}function y(){f=m.rect[t]-r,g=i-v.rect[t]-v.rect[n]}function _(e,t,n){if(e<0){var r=Math.min(t,-e);if(r>0){x(r*n,0,a);var i=r+e;i<0&&b(-i*n,1)}else b(-e*n,1)}}function x(n,r,i){0!==n&&(u=!0);for(var o=r;o<i;o++){var a=e[o];a.rect[t]+=n,a.label[t]+=n}}function b(r,i){for(var o=[],s=0,l=1;l<a;l++){var u=e[l-1].rect,c=Math.max(e[l].rect[t]-u[t]-u[n],0);o.push(c),s+=c}if(s){var h=Math.min(Math.abs(r)/s,i);if(r>0)for(l=0;l<a-1;l++){x(o[l]*h,0,l+1)}else for(l=a-1;l>0;l--){x(-(o[l-1]*h),l,a)}}}function w(e){var t=e<0?-1:1;e=Math.abs(e);for(var n=Math.ceil(e/(a-1)),r=0;r<a-1;r++)if(t>0?x(n,0,r+1):x(-n,a-r-1,a),(e-=n)<=0)return}}function lw(e,t,n,r){return sw(e,"y","height",t,n,r)}function uw(e){var t=[];e.sort((function(e,t){return t.priority-e.priority}));var n=new jt(0,0,0,0);function r(e){if(!e.ignore){var t=e.ensureState("emphasis");null==t.ignore&&(t.ignore=!1)}e.ignore=!0}for(var i=0;i<e.length;i++){var o=e[i],a=o.axisAligned,s=o.localRect,l=o.transform,u=o.label,c=o.labelLine;n.copy(o.rect),n.width-=.1,n.height-=.1,n.x+=.05,n.y+=.05;for(var h=o.obb,d=!1,p=0;p<t.length;p++){var f=t[p];if(n.intersect(f.rect)){if(a&&f.axisAligned){d=!0;break}if(f.obb||(f.obb=new Ac(f.localRect,f.transform)),h||(h=new Ac(s,l)),h.intersect(f.obb)){d=!0;break}}}d?(r(u),c&&r(c)):(u.attr("ignore",o.defaultAttr.ignore),c&&c.attr("ignore",o.defaultAttr.labelGuideIgnore),t.push(o))}}function cw(e){if(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].slice());return t}}function hw(e,t){var n=e.label,r=t&&t.getTextGuideLine();return{dataIndex:e.dataIndex,dataType:e.dataType,seriesIndex:e.seriesModel.seriesIndex,text:e.label.style.text,rect:e.hostRect,labelRect:e.rect,align:n.style.align,verticalAlign:n.style.verticalAlign,labelLinePoints:cw(r&&r.shape.points)}}var dw=["align","verticalAlign","width","height","fontSize"],pw=new Mi,fw=ta(),gw=ta();function mw(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];null!=t[i]&&(e[i]=t[i])}}var vw=["x","y","rotation"],yw=function(){function e(){this._labelList=[],this._chartViewList=[]}return e.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},e.prototype._addLabel=function(e,t,n,r,i){var o=r.style,a=r.__hostTarget.textConfig||{},s=r.getComputedTransform(),l=r.getBoundingRect().plain();jt.applyTransform(l,l,s),s?pw.setLocalTransform(s):(pw.x=pw.y=pw.rotation=pw.originX=pw.originY=0,pw.scaleX=pw.scaleY=1),pw.rotation=Ns(pw.rotation);var u,c=r.__hostTarget;if(c){u=c.getBoundingRect().plain();var h=c.getComputedTransform();jt.applyTransform(u,u,h)}var d=u&&c.getTextGuideLine();this._labelList.push({label:r,labelLine:d,seriesModel:n,dataIndex:e,dataType:t,layoutOption:i,computedLayoutOption:null,rect:l,hostRect:u,priority:u?u.width*u.height:0,defaultAttr:{ignore:r.ignore,labelGuideIgnore:d&&d.ignore,x:pw.x,y:pw.y,scaleX:pw.scaleX,scaleY:pw.scaleY,rotation:pw.rotation,style:{x:o.x,y:o.y,align:o.align,verticalAlign:o.verticalAlign,width:o.width,height:o.height,fontSize:o.fontSize},cursor:r.cursor,attachedPos:a.position,attachedRot:a.rotation}})},e.prototype.addLabelsOfSeries=function(e){var t=this;this._chartViewList.push(e);var n=e.__model,r=n.get("labelLayout");(Q(r)||q(r).length)&&e.group.traverse((function(e){if(e.ignore)return!0;var i=e.getTextContent(),o=bl(e);i&&!i.disableLabelLayout&&t._addLabel(o.dataIndex,o.dataType,n,i,r)}))},e.prototype.updateLayoutConfig=function(e){var t=e.getWidth(),n=e.getHeight();function r(e,t){return function(){$b(e,t)}}for(var i=0;i<this._labelList.length;i++){var o=this._labelList[i],a=o.label,s=a.__hostTarget,l=o.defaultAttr,u=void 0;u=(u=Q(o.layoutOption)?o.layoutOption(hw(o,s)):o.layoutOption)||{},o.computedLayoutOption=u;var c=Math.PI/180;s&&s.setTextConfig({local:!1,position:null!=u.x||null!=u.y?null:l.attachedPos,rotation:null!=u.rotate?u.rotate*c:l.attachedRot,offset:[u.dx||0,u.dy||0]});var h=!1;if(null!=u.x?(a.x=oo(u.x,t),a.setStyle("x",0),h=!0):(a.x=l.x,a.setStyle("x",l.style.x)),null!=u.y?(a.y=oo(u.y,n),a.setStyle("y",0),h=!0):(a.y=l.y,a.setStyle("y",l.style.y)),u.labelLinePoints){var d=s.getTextGuideLine();d&&(d.setShape({points:u.labelLinePoints}),h=!1)}fw(a).needsUpdateLabelLine=h,a.rotation=null!=u.rotate?u.rotate*c:l.rotation,a.scaleX=l.scaleX,a.scaleY=l.scaleY;for(var p=0;p<dw.length;p++){var f=dw[p];a.setStyle(f,null!=u[f]?u[f]:l.style[f])}if(u.draggable){if(a.draggable=!0,a.cursor="move",s){var g=o.seriesModel;if(null!=o.dataIndex)g=o.seriesModel.getData(o.dataType).getItemModel(o.dataIndex);a.on("drag",r(s,g.getModel("labelLine")))}}else a.off("drag"),a.cursor=l.cursor}},e.prototype.layout=function(e){var t,n=e.getWidth(),r=e.getHeight(),i=aw(this._labelList),o=Y(i,(function(e){return"shiftX"===e.layoutOption.moveOverlap})),a=Y(i,(function(e){return"shiftY"===e.layoutOption.moveOverlap}));sw(o,"x","width",0,n,t),lw(a,0,r),uw(Y(i,(function(e){return e.layoutOption.hideOverlap})))},e.prototype.processLabelsOverall=function(){var e=this;W(this._chartViewList,(function(t){var n=t.__model,r=t.ignoreLabelLineUpdate,i=n.isAnimationEnabled();t.group.traverse((function(t){if(t.ignore&&!t.forceLabelAnimation)return!0;var o=!r,a=t.getTextContent();!o&&a&&(o=fw(a).needsUpdateLabelLine),o&&e._updateLabelLine(t,n),i&&e._animateLabels(t,n)}))}))},e.prototype._updateLabelLine=function(e,t){var n=e.getTextContent(),r=bl(e),i=r.dataIndex;if(n&&null!=i){var o=t.getData(r.dataType),a=o.getItemModel(i),s={},l=o.getItemVisual(i,"style");if(l){var u=o.getVisual("drawType");s.stroke=l[u]}var c=a.getModel("labelLine");iw(e,ow(a),s),$b(e,c)}},e.prototype._animateLabels=function(e,t){var n=e.getTextContent(),r=e.getTextGuideLine();if(n&&(e.forceLabelAnimation||!n.ignore&&!n.invisible&&!e.disableLabelAnimation&&!kc(e))){var i=(p=fw(n)).oldLayout,o=bl(e),a=o.dataIndex,s={x:n.x,y:n.y,rotation:n.rotation},l=t.getData(o.dataType);if(i){n.attr(i);var u=e.prevStates;u&&(F(u,"select")>=0&&n.attr(p.oldLayoutSelect),F(u,"emphasis")>=0&&n.attr(p.oldLayoutEmphasis)),Oc(n,s,t,a)}else if(n.attr(s),!Ih(n).valueAnimation){var c=de(n.style.opacity,1);n.style.opacity=0,Rc(n,{style:{opacity:c}},t,a)}if(p.oldLayout=s,n.states.select){var h=p.oldLayoutSelect={};mw(h,s,vw),mw(h,n.states.select,vw)}if(n.states.emphasis){var d=p.oldLayoutEmphasis={};mw(d,s,vw),mw(d,n.states.emphasis,vw)}Lh(n,a,l,t,t)}if(r&&!r.ignore&&!r.invisible){i=(p=gw(r)).oldLayout;var p,f={points:r.shape.points};i?(r.attr({shape:i}),Oc(r,{shape:f},t)):(r.setShape(f),r.style.strokePercent=0,Rc(r,{style:{strokePercent:1}},t)),p.oldLayout=f}},e}(),_w=ta();function xw(e){e.registerUpdateLifecycle("series:beforeupdate",(function(e,t,n){var r=_w(t).labelManager;r||(r=_w(t).labelManager=new yw),r.clearLabels()})),e.registerUpdateLifecycle("series:layoutlabels",(function(e,t,n){var r=_w(t).labelManager;n.updatedSeries.forEach((function(e){r.addLabelsOfSeries(t.getViewOfSeriesModel(e))})),r.updateLayoutConfig(t),r.layout(t),r.processLabelsOverall()}))}var bw=Math.sin,ww=Math.cos,Sw=Math.PI,Tw=2*Math.PI,Mw=180/Sw,Cw=function(){function e(){}return e.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},e.prototype.moveTo=function(e,t){this._add("M",e,t)},e.prototype.lineTo=function(e,t){this._add("L",e,t)},e.prototype.bezierCurveTo=function(e,t,n,r,i,o){this._add("C",e,t,n,r,i,o)},e.prototype.quadraticCurveTo=function(e,t,n,r){this._add("Q",e,t,n,r)},e.prototype.arc=function(e,t,n,r,i,o){this.ellipse(e,t,n,n,0,r,i,o)},e.prototype.ellipse=function(e,t,n,r,i,o,a,s){var l=a-o,u=!s,c=Math.abs(l),h=xr(c-Tw)||(u?l>=Tw:-l>=Tw),d=l>0?l%Tw:l%Tw+Tw,p=!1;p=!!h||!xr(c)&&d>=Sw==!!u;var f=e+n*ww(o),g=t+r*bw(o);this._start&&this._add("M",f,g);var m=Math.round(i*Mw);if(h){var v=1/this._p,y=(u?1:-1)*(Tw-v);this._add("A",n,r,m,1,+u,e+n*ww(o+y),t+r*bw(o+y)),v>.01&&this._add("A",n,r,m,0,+u,f,g)}else{var _=e+n*ww(a),x=t+r*bw(a);this._add("A",n,r,m,+p,+u,_,x)}},e.prototype.rect=function(e,t,n,r){this._add("M",e,t),this._add("l",n,0),this._add("l",0,r),this._add("l",-n,0),this._add("Z")},e.prototype.closePath=function(){this._d.length>0&&this._add("Z")},e.prototype._add=function(e,t,n,r,i,o,a,s,l){for(var u=[],c=this._p,h=1;h<arguments.length;h++){var d=arguments[h];if(isNaN(d))return void(this._invalid=!0);u.push(Math.round(d*c)/c)}this._d.push(e+u.join(" ")),this._start="Z"===e},e.prototype.generateStr=function(){this._str=this._invalid?"":this._d.join(""),this._d=[]},e.prototype.getStr=function(){return this._str},e}(),Dw="none",Aw=Math.round;var Iw=["lineCap","miterLimit","lineJoin"],Ew=j(Iw,(function(e){return"stroke-"+e.toLowerCase()}));function Lw(e,t,n,r){var i=null==t.opacity?1:t.opacity;if(n instanceof Js)e("opacity",i);else{if(function(e){var t=e.fill;return null!=t&&t!==Dw}(t)){var o=yr(t.fill);e("fill",o.color);var a=null!=t.fillOpacity?t.fillOpacity*o.opacity*i:o.opacity*i;a<1&&e("fill-opacity",a)}else e("fill",Dw);if(function(e){var t=e.stroke;return null!=t&&t!==Dw}(t)){var s=yr(t.stroke);e("stroke",s.color);var l=t.strokeNoScale?n.getLineScale():1,u=l?(t.lineWidth||0)/l:0,c=null!=t.strokeOpacity?t.strokeOpacity*s.opacity*i:s.opacity*i,h=t.strokeFirst;if(1!==u&&e("stroke-width",u),h&&e("paint-order",h?"stroke":"fill"),c<1&&e("stroke-opacity",c),t.lineDash){var d=_v(n),p=d[0],f=d[1];p&&(f=Aw(f||0),e("stroke-dasharray",p.join(",")),(f||r)&&e("stroke-dashoffset",f))}for(var g=0;g<Iw.length;g++){var m=Iw[g];if(t[m]!==Ws[m]){var v=t[m]||Ws[m];v&&e(Ew[g],v)}}}}}var Nw="http://www.w3.org/2000/svg",Pw="http://www.w3.org/1999/xlink",Ow="ecmeta_";function Rw(e){return document.createElementNS(Nw,e)}function kw(e,t,n,r,i){return{tag:e,attrs:n||{},children:r,text:i,key:t}}function zw(e,t){var n=(t=t||{}).newline?"\n":"";return function e(t){var r=t.children,i=t.tag,o=t.attrs,a=t.text;return function(e,t){var n=[];if(t)for(var r in t){var i=t[r],o=r;!1!==i&&(!0!==i&&null!=i&&(o+='="'+i+'"'),n.push(o))}return"<"+e+" "+n.join(" ")+">"}(i,o)+("style"!==i?dt(a):a||"")+(r?""+n+j(r,(function(t){return e(t)})).join(n)+n:"")+("</"+i+">")}(e)}function Vw(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function Bw(e,t,n,r){return kw("svg","root",{width:e,height:t,xmlns:Nw,"xmlns:xlink":Pw,version:"1.1",baseProfile:"full",viewBox:!!r&&"0 0 "+e+" "+t},n)}var Fw=0;function Gw(){return Fw++}var Hw={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},Uw="transform-origin";function Ww(e,t,n){var r=z({},e.shape);z(r,t),e.buildPath(n,r);var i=new Cw;return i.reset(Er(e)),n.rebuildPath(i,1),i.generateStr(),i.getStr()}function jw(e,t){var n=t.originX,r=t.originY;(n||r)&&(e[Uw]=n+"px "+r+"px")}var Xw={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function Yw(e,t){var n=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[n]=e,n}function Zw(e){return ee(e)?Hw[e]?"cubic-bezier("+Hw[e]+")":Fn(e)?e:"":""}function qw(e,t,n,r){var i=e.animators,o=i.length,a=[];if(e instanceof xc){var s=function(e,t,n){var r,i,o=e.shape.paths,a={};if(W(o,(function(e){var t=Vw(n.zrId);t.animation=!0,qw(e,{},t,!0);var o=t.cssAnims,s=t.cssNodes,l=q(o),u=l.length;if(u){var c=o[i=l[u-1]];for(var h in c){var d=c[h];a[h]=a[h]||{d:""},a[h].d+=d.d||""}for(var p in s){var f=s[p].animation;f.indexOf(i)>=0&&(r=f)}}})),r){t.d=!1;var s=Yw(a,n);return r.replace(i,s)}}(e,t,n);if(s)a.push(s);else if(!o)return}else if(!o)return;for(var l={},u=0;u<o;u++){var c=i[u],h=[c.getMaxTime()/1e3+"s"],d=Zw(c.getClip().easing),p=c.getDelay();d?h.push(d):h.push("linear"),p&&h.push(p/1e3+"s"),c.getLoop()&&h.push("infinite");var f=h.join(" ");l[f]=l[f]||[f,[]],l[f][1].push(c)}function g(i){var o,a=i[1],s=a.length,l={},u={},c={},h="animation-timing-function";function d(e,t,n){for(var r=e.getTracks(),i=e.getMaxTime(),o=0;o<r.length;o++){var a=r[o];if(a.needsAnimate()){var s=a.keyframes,l=a.propName;if(n&&(l=n(l)),l)for(var u=0;u<s.length;u++){var c=s[u],d=Math.round(c.time/i*100)+"%",p=Zw(c.easing),f=c.rawValue;(ee(f)||ne(f))&&(t[d]=t[d]||{},t[d][l]=c.rawValue,p&&(t[d][h]=p))}}}}for(var p=0;p<s;p++){(S=(w=a[p]).targetName)?"shape"===S&&d(w,u):!r&&d(w,l)}for(var f in l){var g={};Di(g,e),z(g,l[f]);var m=Lr(g),v=l[f][h];c[f]=m?{transform:m}:{},jw(c[f],g),v&&(c[f][h]=v)}var y=!0;for(var f in u){c[f]=c[f]||{};var _=!o;v=u[f][h];_&&(o=new Ds);var x=o.len();o.reset(),c[f].d=Ww(e,u[f],o);var b=o.len();if(!_&&x!==b){y=!1;break}v&&(c[f][h]=v)}if(!y)for(var f in c)delete c[f].d;if(!r)for(p=0;p<s;p++){var w,S;"style"===(S=(w=a[p]).targetName)&&d(w,c,(function(e){return Xw[e]}))}var T,M=q(c),C=!0;for(p=1;p<M.length;p++){var D=M[p-1],A=M[p];if(c[D][Uw]!==c[A][Uw]){C=!1;break}T=c[D][Uw]}if(C&&T){for(var f in c)c[f][Uw]&&delete c[f][Uw];t[Uw]=T}if(Y(M,(function(e){return q(c[e]).length>0})).length)return Yw(c,n)+" "+i[0]+" both"}for(var m in l){(s=g(l[m]))&&a.push(s)}if(a.length){var v=n.zrId+"-cls-"+Gw();n.cssNodes["."+v]={animation:a.join(",")},t.class=v}}function Kw(e,t,n,r){var i=JSON.stringify(e),o=n.cssStyleCache[i];o||(o=n.zrId+"-cls-"+Gw(),n.cssStyleCache[i]=o,n.cssNodes["."+o+":hover"]=e),t.class=t.class?t.class+" "+o:o}var $w=Math.round;function Jw(e){return e&&ee(e.src)}function Qw(e){return e&&Q(e.toDataURL)}function eS(e,t,n,r){Lw((function(i,o){var a="fill"===i||"stroke"===i;a&&Ar(o)?hS(t,e,i,r):a&&Mr(o)?dS(n,e,i,r):e[i]=a&&"none"===o?"transparent":o}),t,n,!1),function(e,t,n){var r=e.style;if(function(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}(r)){var i=function(e){var t=e.style,n=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(",")}(e),o=n.shadowCache,a=o[i];if(!a){var s=e.getGlobalScale(),l=s[0],u=s[1];if(!l||!u)return;var c=r.shadowOffsetX||0,h=r.shadowOffsetY||0,d=r.shadowBlur,p=yr(r.shadowColor),f=p.opacity,g=p.color,m=d/2/l+" "+d/2/u;a=n.zrId+"-s"+n.shadowIdx++,n.defs[a]=kw("filter",a,{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},[kw("feDropShadow","",{dx:c/l,dy:h/u,stdDeviation:m,"flood-color":g,"flood-opacity":f})]),o[i]=a}t.filter=Ir(a)}}(n,e,r)}function tS(e,t){var n=eo(t);n&&(n.each((function(t,n){null!=t&&(e[(Ow+n).toLowerCase()]=t+"")})),t.isSilent()&&(e[Ow+"silent"]="true"))}function nS(e){return xr(e[0]-1)&&xr(e[1])&&xr(e[2])&&xr(e[3]-1)}function rS(e,t,n){if(t&&(!function(e){return xr(e[4])&&xr(e[5])}(t)||!nS(t))){var r=1e4;e.transform=nS(t)?"translate("+$w(t[4]*r)/r+" "+$w(t[5]*r)/r+")":function(e){return"matrix("+br(e[0])+","+br(e[1])+","+br(e[2])+","+br(e[3])+","+wr(e[4])+","+wr(e[5])+")"}(t)}}function iS(e,t,n){for(var r=e.points,i=[],o=0;o<r.length;o++)i.push($w(r[o][0]*n)/n),i.push($w(r[o][1]*n)/n);t.points=i.join(" ")}function oS(e){return!e.smooth}var aS,sS,lS={circle:[(aS=["cx","cy","r"],sS=j(aS,(function(e){return"string"==typeof e?[e,e]:e})),function(e,t,n){for(var r=0;r<sS.length;r++){var i=sS[r],o=e[i[0]];null!=o&&(t[i[1]]=$w(o*n)/n)}})],polyline:[iS,oS],polygon:[iS,oS]};function uS(e,t){var n=e.style,r=e.shape,i=lS[e.type],o={},a=t.animation,s="path",l=e.style.strokePercent,u=t.compress&&Er(e)||4;if(!i||t.willUpdate||i[1]&&!i[1](r)||a&&function(e){for(var t=e.animators,n=0;n<t.length;n++)if("shape"===t[n].targetName)return!0;return!1}(e)||l<1){var c=!e.path||e.shapeChanged();e.path||e.createPathProxy();var h=e.path;c&&(h.beginPath(),e.buildPath(h,e.shape),e.pathUpdated());var d=h.getVersion(),p=e,f=p.__svgPathBuilder;p.__svgPathVersion===d&&f&&l===p.__svgPathStrokePercent||(f||(f=p.__svgPathBuilder=new Cw),f.reset(u),h.rebuildPath(f,l),f.generateStr(),p.__svgPathVersion=d,p.__svgPathStrokePercent=l),o.d=f.getStr()}else{s=e.type;var g=Math.pow(10,u);i[0](r,o,g)}return rS(o,e.transform),eS(o,n,e,t),tS(o,e),t.animation&&qw(e,o,t),t.emphasis&&function(e,t,n){if(!e.ignore)if(e.isSilent())Kw(u={"pointer-events":"none"},t,n);else{var r=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},i=r.fill;if(!i){var o=e.style&&e.style.fill,a=e.states.select&&e.states.select.style&&e.states.select.style.fill,s=e.currentStates.indexOf("select")>=0&&a||o;s&&(i=gr(s))}var l=r.lineWidth;l&&(l/=!r.strokeNoScale&&e.transform?e.transform[0]:1);var u={cursor:"pointer"};i&&(u.fill=i),r.stroke&&(u.stroke=r.stroke),l&&(u["stroke-width"]=l),Kw(u,t,n)}}(e,o,t),kw(s,e.id+"",o)}function cS(e,t){return e instanceof Ys?uS(e,t):e instanceof Js?function(e,t){var n=e.style,r=n.image;if(r&&!ee(r)&&(Jw(r)?r=r.src:Qw(r)&&(r=r.toDataURL())),r){var i=n.x||0,o=n.y||0,a={href:r,width:n.width,height:n.height};return i&&(a.x=i),o&&(a.y=o),rS(a,e.transform),eS(a,n,e,t),tS(a,e),t.animation&&qw(e,a,t),kw("image",e.id+"",a)}}(e,t):e instanceof qs?function(e,t){var n=e.style,r=n.text;if(null!=r&&(r+=""),r&&!isNaN(n.x)&&!isNaN(n.y)){var i=n.font||f,o=n.x||0,a=function(e,t,n){return"top"===n?e+=t/2:"bottom"===n&&(e-=t/2),e}(n.y||0,Oi(i),n.textBaseline),s={"dominant-baseline":"central","text-anchor":Sr[n.textAlign]||n.textAlign};if(fl(n)){var l="",u=n.fontStyle,c=dl(n.fontSize);if(!parseFloat(c))return;var h=n.fontFamily||p,d=n.fontWeight;l+="font-size:"+c+";font-family:"+h+";",u&&"normal"!==u&&(l+="font-style:"+u+";"),d&&"normal"!==d&&(l+="font-weight:"+d+";"),s.style=l}else s.style="font: "+i;return r.match(/\s/)&&(s["xml:space"]="preserve"),o&&(s.x=o),a&&(s.y=a),rS(s,e.transform),eS(s,n,e,t),tS(s,e),t.animation&&qw(e,s,t),kw("text",e.id+"",s,void 0,r)}}(e,t):void 0}function hS(e,t,n,r){var i,o=e[n],a={gradientUnits:o.global?"userSpaceOnUse":"objectBoundingBox"};if(Cr(o))i="linearGradient",a.x1=o.x,a.y1=o.y,a.x2=o.x2,a.y2=o.y2;else{if(!Dr(o))return void("production"!==process.env.NODE_ENV&&P("Illegal gradient type."));i="radialGradient",a.cx=de(o.x,.5),a.cy=de(o.y,.5),a.r=de(o.r,.5)}for(var s=o.colorStops,l=[],u=0,c=s.length;u<c;++u){var h=100*wr(s[u].offset)+"%",d=yr(s[u].color),p=d.color,f=d.opacity,g={offset:h};g["stop-color"]=p,f<1&&(g["stop-opacity"]=f),l.push(kw("stop",u+"",g))}var m=zw(kw(i,"",a,l)),v=r.gradientCache,y=v[m];y||(y=r.zrId+"-g"+r.gradientIdx++,v[m]=y,a.id=y,r.defs[y]=kw(i,y,a,l)),t[n]=Ir(y)}function dS(e,t,n,r){var i,o=e.style[n],a=e.getBoundingRect(),s={},l=o.repeat,u="no-repeat"===l,c="repeat-x"===l,h="repeat-y"===l;if(Tr(o)){var d=o.imageWidth,p=o.imageHeight,f=void 0,g=o.image;if(ee(g)?f=g:Jw(g)?f=g.src:Qw(g)&&(f=g.toDataURL()),"undefined"==typeof Image){var m="Image width/height must been given explictly in svg-ssr renderer.";me(d,m),me(p,m)}else if(null==d||null==p){var v=function(e,t){if(e){var n=e.elm,r=d||t.width,i=p||t.height;"pattern"===e.tag&&(c?(i=1,r/=a.width):h&&(r=1,i/=a.height)),e.attrs.width=r,e.attrs.height=i,n&&(n.setAttribute("width",r),n.setAttribute("height",i))}},y=Ma(f,null,e,(function(e){u||v(w,e),v(i,e)}));y&&y.width&&y.height&&(d=d||y.width,p=p||y.height)}i=kw("image","img",{href:f,width:d,height:p}),s.width=d,s.height=p}else o.svgElement&&(i=O(o.svgElement),s.width=o.svgWidth,s.height=o.svgHeight);if(i){var _,x;u?_=x=1:c?(x=1,_=s.width/a.width):h?(_=1,x=s.height/a.height):s.patternUnits="userSpaceOnUse",null==_||isNaN(_)||(s.width=_),null==x||isNaN(x)||(s.height=x);var b=Lr(o);b&&(s.patternTransform=b);var w=kw("pattern","",s,[i]),S=zw(w),T=r.patternCache,M=T[S];M||(M=r.zrId+"-p"+r.patternIdx++,T[S]=M,s.id=M,w=r.defs[M]=kw("pattern",M,s,[i])),t[n]=Ir(M)}}function pS(e,t,n){var r=n.clipPathCache,i=n.defs,o=r[e.id];if(!o){var a={id:o=n.zrId+"-c"+n.clipPathIdx++};r[e.id]=o,i[o]=kw("clipPath",o,a,[uS(e,n)])}t["clip-path"]=Ir(o)}function fS(e){return document.createTextNode(e)}function gS(e,t,n){e.insertBefore(t,n)}function mS(e,t){e.removeChild(t)}function vS(e,t){e.appendChild(t)}function yS(e){return e.parentNode}function _S(e){return e.nextSibling}function xS(e,t){e.textContent=t}var bS=kw("","");function wS(e){return void 0===e}function SS(e){return void 0!==e}function TS(e,t,n){for(var r={},i=t;i<=n;++i){var o=e[i].key;void 0!==o&&("production"!==process.env.NODE_ENV&&null!=r[o]&&console.error("Duplicate key "+o),r[o]=i)}return r}function MS(e,t){var n=e.key===t.key;return e.tag===t.tag&&n}function CS(e){var t,n=e.children,r=e.tag;if(SS(r)){var i=e.elm=Rw(r);if(IS(bS,e),J(n))for(t=0;t<n.length;++t){var o=n[t];null!=o&&vS(i,CS(o))}else SS(e.text)&&!re(e.text)&&vS(i,fS(e.text))}else e.elm=fS(e.text);return e.elm}function DS(e,t,n,r,i){for(;r<=i;++r){var o=n[r];null!=o&&gS(e,CS(o),t)}}function AS(e,t,n,r){for(;n<=r;++n){var i=t[n];if(null!=i)if(SS(i.tag))mS(yS(i.elm),i.elm);else mS(e,i.elm)}}function IS(e,t){var n,r=t.elm,i=e&&e.attrs||{},o=t.attrs||{};if(i!==o){for(n in o){var a=o[n];i[n]!==a&&(!0===a?r.setAttribute(n,""):!1===a?r.removeAttribute(n):"style"===n?r.style.cssText=a:120!==n.charCodeAt(0)?r.setAttribute(n,a):"xmlns:xlink"===n||"xmlns"===n?r.setAttributeNS("http://www.w3.org/2000/xmlns/",n,a):58===n.charCodeAt(3)?r.setAttributeNS("http://www.w3.org/XML/1998/namespace",n,a):58===n.charCodeAt(5)?r.setAttributeNS(Pw,n,a):r.setAttribute(n,a))}for(n in i)n in o||r.removeAttribute(n)}}function ES(e,t){var n=t.elm=e.elm,r=e.children,i=t.children;e!==t&&(IS(e,t),wS(t.text)?SS(r)&&SS(i)?r!==i&&function(e,t,n){for(var r,i,o,a=0,s=0,l=t.length-1,u=t[0],c=t[l],h=n.length-1,d=n[0],p=n[h];a<=l&&s<=h;)null==u?u=t[++a]:null==c?c=t[--l]:null==d?d=n[++s]:null==p?p=n[--h]:MS(u,d)?(ES(u,d),u=t[++a],d=n[++s]):MS(c,p)?(ES(c,p),c=t[--l],p=n[--h]):MS(u,p)?(ES(u,p),gS(e,u.elm,_S(c.elm)),u=t[++a],p=n[--h]):MS(c,d)?(ES(c,d),gS(e,c.elm,u.elm),c=t[--l],d=n[++s]):(wS(r)&&(r=TS(t,a,l)),wS(i=r[d.key])||(o=t[i]).tag!==d.tag?gS(e,CS(d),u.elm):(ES(o,d),t[i]=void 0,gS(e,o.elm,u.elm)),d=n[++s]);(a<=l||s<=h)&&(a>l?DS(e,null==n[h+1]?null:n[h+1].elm,n,s,h):AS(e,t,a,l))}(n,r,i):SS(i)?(SS(e.text)&&xS(n,""),DS(n,null,i,0,i.length-1)):SS(r)?AS(n,r,0,r.length-1):SS(e.text)&&xS(n,""):e.text!==t.text&&(SS(r)&&AS(n,r,0,r.length-1),xS(n,t.text)))}var LS=0,NS=function(){function e(e,t,n){if(this.type="svg",this.refreshHover=PS("refreshHover"),this.configLayer=PS("configLayer"),this.storage=t,this._opts=n=z({},n),this.root=e,this._id="zr"+LS++,this._oldVNode=Bw(n.width,n.height),e&&!n.ssr){var r=this._viewport=document.createElement("div");r.style.cssText="position:relative;overflow:hidden";var i=this._svgDom=this._oldVNode.elm=Rw("svg");IS(null,this._oldVNode),r.appendChild(i),e.appendChild(r)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",function(e,t){if(MS(e,t))ES(e,t);else{var n=e.elm,r=yS(n);CS(t),null!==r&&(gS(r,t.elm,_S(n)),AS(r,[e],0,0))}}(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return cS(e,Vw(this._id))},e.prototype.renderToVNode=function(e){e=e||{};var t=this.storage.getDisplayList(!0),n=this._width,r=this._height,i=Vw(this._id);i.animation=e.animation,i.willUpdate=e.willUpdate,i.compress=e.compress,i.emphasis=e.emphasis;var o=[],a=this._bgVNode=function(e,t,n,r){var i;if(n&&"none"!==n)if(i=kw("rect","bg",{width:e,height:t,x:"0",y:"0"}),Ar(n))hS({fill:n},i.attrs,"fill",r);else if(Mr(n))dS({style:{fill:n},dirty:Ie,getBoundingRect:function(){return{width:e,height:t}}},i.attrs,"fill",r);else{var o=yr(n),a=o.color,s=o.opacity;i.attrs.fill=a,s<1&&(i.attrs["fill-opacity"]=s)}return i}(n,r,this._backgroundColor,i);a&&o.push(a);var s=e.compress?null:this._mainVNode=kw("g","main",{},[]);this._paintList(t,i,s?s.children:o),s&&o.push(s);var l=j(q(i.defs),(function(e){return i.defs[e]}));if(l.length&&o.push(kw("defs","defs",{},l)),e.animation){var u=function(e,t,n){var r=(n=n||{}).newline?"\n":"",i=" {"+r,o=r+"}",a=j(q(e),(function(t){return t+i+j(q(e[t]),(function(n){return n+":"+e[t][n]+";"})).join(r)+o})).join(r),s=j(q(t),(function(e){return"@keyframes "+e+i+j(q(t[e]),(function(n){return n+i+j(q(t[e][n]),(function(r){var i=t[e][n][r];return"d"===r&&(i='path("'+i+'")'),r+":"+i+";"})).join(r)+o})).join(r)+o})).join(r);return a||s?["<![CDATA[",a,s,"]]>"].join(r):""}(i.cssNodes,i.cssAnims,{newline:!0});if(u){var c=kw("style","stl",{},[],u);o.push(c)}}return Bw(n,r,o,e.useViewBox)},e.prototype.renderToString=function(e){return e=e||{},zw(this.renderToVNode({animation:de(e.cssAnimation,!0),emphasis:de(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:de(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var r,i,o=e.length,a=[],s=0,l=0,u=0;u<o;u++){var c=e[u];if(!c.invisible){var h=c.__clipPaths,d=h&&h.length||0,p=i&&i.length||0,f=void 0;for(f=Math.max(d-1,p-1);f>=0&&(!h||!i||h[f]!==i[f]);f--);for(var g=p-1;g>f;g--)r=a[--s-1];for(var m=f+1;m<d;m++){var v={};pS(h[m],v,t);var y=kw("g","clip-g-"+l++,v,[]);(r?r.children:n).push(y),a[s++]=y,r=y}i=h;var _=cS(c,t);_&&(r?r.children:n).push(_)}}},e.prototype.resize=function(e,t){var n=this._opts,r=this.root,i=this._viewport;if(null!=e&&(n.width=e),null!=t&&(n.height=t),r&&i&&(i.style.display="none",e=yv(r,0,n),t=yv(r,1,n),i.style.display=""),this._width!==e||this._height!==t){if(this._width=e,this._height=t,i){var o=i.style;o.width=e+"px",o.height=t+"px"}if(Mr(this._backgroundColor))this.refresh();else{var a=this._svgDom;a&&(a.setAttribute("width",e),a.setAttribute("height",t));var s=this._bgVNode&&this._bgVNode.elm;s&&(s.setAttribute("width",e),s.setAttribute("height",t))}}},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype.dispose=function(){this.root&&(this.root.innerHTML=""),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},e.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},e.prototype.toDataURL=function(e){var t=this.renderToString(),n="data:image/svg+xml;";return e?(t=Nr(t))&&n+"base64,"+t:n+"charset=UTF-8,"+encodeURIComponent(t)},e}();function PS(e){return function(){"production"!==process.env.NODE_ENV&&P('In SVG mode painter not support method "'+e+'"')}}function OS(e,t,n){var r=y.createCanvas(),i=t.getWidth(),o=t.getHeight(),a=r.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=i+"px",a.height=o+"px",r.setAttribute("data-zr-dom-id",e)),r.width=i*n,r.height=o*n,r}var RS=function(e){function t(t,n,r){var i,o=e.call(this)||this;o.motionBlur=!1,o.lastFrameAlpha=.7,o.dpr=1,o.virtual=!1,o.config={},o.incremental=!1,o.zlevel=0,o.maxRepaintRectCount=5,o.__dirty=!0,o.__firstTimePaint=!0,o.__used=!1,o.__drawIndex=0,o.__startIndex=0,o.__endIndex=0,o.__prevStartIndex=null,o.__prevEndIndex=null,r=r||gi,"string"==typeof t?i=OS(t,n,r):re(t)&&(t=(i=t).id),o.id=t,o.dom=i;var a=i.style;return a&&(De(i),i.onselectstart=function(){return!1},a.padding="0",a.margin="0",a.borderWidth="0"),o.painter=n,o.dpr=r,o}return l(t,e),t.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},t.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},t.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},t.prototype.setUnpainted=function(){this.__firstTimePaint=!0},t.prototype.createBackBuffer=function(){var e=this.dpr;this.domBack=OS("back-"+this.id,this.painter,e),this.ctxBack=this.domBack.getContext("2d"),1!==e&&this.ctxBack.scale(e,e)},t.prototype.createRepaintRects=function(e,t,n,r){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var i,o=[],a=this.maxRepaintRectCount,s=!1,l=new jt(0,0,0,0);function u(e){if(e.isFinite()&&!e.isZero())if(0===o.length){(t=new jt(0,0,0,0)).copy(e),o.push(t)}else{for(var t,n=!1,r=1/0,i=0,u=0;u<o.length;++u){var c=o[u];if(c.intersect(e)){var h=new jt(0,0,0,0);h.copy(c),h.union(e),o[u]=h,n=!0;break}if(s){l.copy(e),l.union(c);var d=e.width*e.height,p=c.width*c.height,f=l.width*l.height-d-p;f<r&&(r=f,i=u)}}if(s&&(o[i].union(e),n=!0),!n)(t=new jt(0,0,0,0)).copy(e),o.push(t);s||(s=o.length>=a)}}for(var c=this.__startIndex;c<this.__endIndex;++c){if(p=e[c]){var h=p.shouldBePainted(n,r,!0,!0);(f=p.__isRendered&&(1&p.__dirty||!h)?p.getPrevPaintRect():null)&&u(f);var d=h&&(1&p.__dirty||!p.__isRendered)?p.getPaintRect():null;d&&u(d)}}for(c=this.__prevStartIndex;c<this.__prevEndIndex;++c){var p,f;h=(p=t[c])&&p.shouldBePainted(n,r,!0,!0);if(p&&(!h||!p.__zr)&&p.__isRendered)(f=p.getPrevPaintRect())&&u(f)}do{i=!1;for(c=0;c<o.length;)if(o[c].isZero())o.splice(c,1);else{for(var g=c+1;g<o.length;)o[c].intersect(o[g])?(i=!0,o[c].union(o[g]),o.splice(g,1)):g++;c++}}while(i);return this._paintRects=o,o},t.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},t.prototype.resize=function(e,t){var n=this.dpr,r=this.dom,i=r.style,o=this.domBack;i&&(i.width=e+"px",i.height=t+"px"),r.width=e*n,r.height=t*n,o&&(o.width=e*n,o.height=t*n,1!==n&&this.ctxBack.scale(n,n))},t.prototype.clear=function(e,t,n){var r=this.dom,i=this.ctx,o=r.width,a=r.height;t=t||this.clearColor;var s=this.motionBlur&&!e,l=this.lastFrameAlpha,u=this.dpr,c=this;s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(r,0,0,o/u,a/u));var h=this.domBack;function d(e,n,r,o){if(i.clearRect(e,n,r,o),t&&"transparent"!==t){var a=void 0;if(se(t))a=(t.global||t.__width===r&&t.__height===o)&&t.__canvasGradient||mv(i,t,{x:0,y:0,width:r,height:o}),t.__canvasGradient=a,t.__width=r,t.__height=o;else le(t)&&(t.scaleX=t.scaleX||u,t.scaleY=t.scaleY||u,a=Cv(i,t,{dirty:function(){c.setUnpainted(),c.painter.refresh()}}));i.save(),i.fillStyle=a||t,i.fillRect(e,n,r,o),i.restore()}s&&(i.save(),i.globalAlpha=l,i.drawImage(h,e,n,r,o),i.restore())}!n||s?d(0,0,o,a):n.length&&W(n,(function(e){d(e.x*u,e.y*u,e.width*u,e.height*u)}))},t}(nt),kS=1e5,zS=314159,VS=.01;var BS=function(){function e(e,t,n,r){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var i=!e.nodeName||"CANVAS"===e.nodeName.toUpperCase();this._opts=n=z({},n||{}),this.dpr=n.devicePixelRatio||gi,this._singleCanvas=i,this.root=e,e.style&&(De(e),e.innerHTML=""),this.storage=t;var o=this._zlevelList;this._prevDisplayList=[];var a=this._layers;if(i){var s=e,l=s.width,u=s.height;null!=n.width&&(l=n.width),null!=n.height&&(u=n.height),this.dpr=n.devicePixelRatio||1,s.width=l*this.dpr,s.height=u*this.dpr,this._width=l,this._height=u;var c=new RS(s,this,this.dpr);c.__builtin__=!0,c.initContext(),a[314159]=c,c.zlevel=zS,o.push(zS),this._domRoot=e}else{this._width=yv(e,0,n),this._height=yv(e,1,n);var h=this._domRoot=function(e,t){var n=document.createElement("div");return n.style.cssText=["position:relative","width:"+e+"px","height:"+t+"px","padding:0","margin:0","border-width:0"].join(";")+";",n}(this._width,this._height);e.appendChild(h)}}return e.prototype.getType=function(){return"canvas"},e.prototype.isSingleCanvas=function(){return this._singleCanvas},e.prototype.getViewportRoot=function(){return this._domRoot},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.refresh=function(e){var t=this.storage.getDisplayList(!0),n=this._prevDisplayList,r=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,n,e,this._redrawId);for(var i=0;i<r.length;i++){var o=r[i],a=this._layers[o];if(!a.__builtin__&&a.refresh){var s=0===i?this._backgroundColor:null;a.refresh(s)}}return this._opts.useDirtyRect&&(this._prevDisplayList=t.slice()),this},e.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},e.prototype._paintHoverList=function(e){var t=e.length,n=this._hoverlayer;if(n&&n.clear(),t){for(var r,i={inHover:!0,viewWidth:this._width,viewHeight:this._height},o=0;o<t;o++){var a=e[o];a.__inHover&&(n||(n=this._hoverlayer=this.getLayer(kS)),r||(r=n.ctx).save(),Rv(r,a,i,o===t-1))}r&&r.restore()}},e.prototype.getHoverLayer=function(){return this.getLayer(kS)},e.prototype.paintOne=function(e,t){Ov(e,t)},e.prototype._paintList=function(e,t,n,r){if(this._redrawId===r){n=n||!1,this._updateLayerStatus(e);var i=this._doPaintList(e,t,n),o=i.finished,a=i.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),a&&this._paintHoverList(e),o)this.eachLayer((function(e){e.afterBrush&&e.afterBrush()}));else{var s=this;dn((function(){s._paintList(e,t,n,r)}))}}},e.prototype._compositeManually=function(){var e=this.getLayer(zS).ctx,t=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,t,n),this.eachBuiltinLayer((function(r){r.virtual&&e.drawImage(r.dom,0,0,t,n)}))},e.prototype._doPaintList=function(e,t,n){for(var r=this,i=[],o=this._opts.useDirtyRect,a=0;a<this._zlevelList.length;a++){var s=this._zlevelList[a],l=this._layers[s];l.__builtin__&&l!==this._hoverlayer&&(l.__dirty||n)&&i.push(l)}for(var u=!0,c=!1,h=function(a){var s,l=i[a],h=l.ctx,d=o&&l.createRepaintRects(e,t,p._width,p._height),f=n?l.__startIndex:l.__drawIndex,g=!n&&l.incremental&&Date.now,m=g&&Date.now(),v=l.zlevel===p._zlevelList[0]?p._backgroundColor:null;if(l.__startIndex===l.__endIndex)l.clear(!1,v,d);else if(f===l.__startIndex){var y=e[f];y.incremental&&y.notClear&&!n||l.clear(!1,v,d)}-1===f&&(console.error("For some unknown reason. drawIndex is -1"),f=l.__startIndex);var _=function(t){var n={inHover:!1,allClipped:!1,prevEl:null,viewWidth:r._width,viewHeight:r._height};for(s=f;s<l.__endIndex;s++){var i=e[s];if(i.__inHover&&(c=!0),r._doPaintEl(i,l,o,t,n,s===l.__endIndex-1),g)if(Date.now()-m>15)break}n.prevElClipPaths&&h.restore()};if(d)if(0===d.length)s=l.__endIndex;else for(var x=p.dpr,b=0;b<d.length;++b){var w=d[b];h.save(),h.beginPath(),h.rect(w.x*x,w.y*x,w.width*x,w.height*x),h.clip(),_(w),h.restore()}else h.save(),_(),h.restore();l.__drawIndex=s,l.__drawIndex<l.__endIndex&&(u=!1)},p=this,f=0;f<i.length;f++)h(f);return d.wxa&&W(this._layers,(function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()})),{finished:u,needsRefreshHover:c}},e.prototype._doPaintEl=function(e,t,n,r,i,o){var a=t.ctx;if(n){var s=e.getPaintRect();(!r||s&&s.intersect(r))&&(Rv(a,e,i,o),e.setPrevPaintRect(s))}else Rv(a,e,i,o)},e.prototype.getLayer=function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=zS);var n=this._layers[e];return n||((n=new RS("zr_"+e,this,this.dpr)).zlevel=e,n.__builtin__=!0,this._layerConfig[e]?R(n,this._layerConfig[e],!0):this._layerConfig[e-VS]&&R(n,this._layerConfig[e-VS],!0),t&&(n.virtual=t),this.insertLayer(e,n),n.initContext()),n},e.prototype.insertLayer=function(e,t){var n=this._layers,r=this._zlevelList,i=r.length,o=this._domRoot,a=null,s=-1;if(n[e])"production"!==process.env.NODE_ENV&&P("ZLevel "+e+" has been used already");else if(function(e){return!!e&&(!!e.__builtin__||"function"==typeof e.resize&&"function"==typeof e.refresh)}(t)){if(i>0&&e>r[0]){for(s=0;s<i-1&&!(r[s]<e&&r[s+1]>e);s++);a=n[r[s]]}if(r.splice(s+1,0,e),n[e]=t,!t.virtual)if(a){var l=a.dom;l.nextSibling?o.insertBefore(t.dom,l.nextSibling):o.appendChild(t.dom)}else o.firstChild?o.insertBefore(t.dom,o.firstChild):o.appendChild(t.dom);t.painter||(t.painter=this)}else"production"!==process.env.NODE_ENV&&P("Layer of zlevel "+e+" is not valid")},e.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r];e.call(t,this._layers[i],i)}},e.prototype.eachBuiltinLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r],o=this._layers[i];o.__builtin__&&e.call(t,o,i)}},e.prototype.eachOtherLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r],o=this._layers[i];o.__builtin__||e.call(t,o,i)}},e.prototype.getLayers=function(){return this._layers},e.prototype._updateLayerStatus=function(e){function t(e){o&&(o.__endIndex!==e&&(o.__dirty=!0),o.__endIndex=e)}if(this.eachBuiltinLayer((function(e,t){e.__dirty=e.__used=!1})),this._singleCanvas)for(var n=1;n<e.length;n++){if((s=e[n]).zlevel!==e[n-1].zlevel||s.incremental){this._needsManuallyCompositing=!0;break}}var r,i,o=null,a=0;for(i=0;i<e.length;i++){var s,l=(s=e[i]).zlevel,u=void 0;r!==l&&(r=l,a=0),s.incremental?((u=this.getLayer(l+.001,this._needsManuallyCompositing)).incremental=!0,a=1):u=this.getLayer(l+(a>0?VS:0),this._needsManuallyCompositing),u.__builtin__||P("ZLevel "+l+" has been used by unkown layer "+u.id),u!==o&&(u.__used=!0,u.__startIndex!==i&&(u.__dirty=!0),u.__startIndex=i,u.incremental?u.__drawIndex=-1:u.__drawIndex=i,t(i),o=u),1&s.__dirty&&!s.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=i))}t(i),this.eachBuiltinLayer((function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)}))},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(e){e.clear()},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,W(this._layers,(function(e){e.setUnpainted()}))},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?R(n[e],t,!0):n[e]=t;for(var r=0;r<this._zlevelList.length;r++){var i=this._zlevelList[r];if(i===e||i===e+VS)R(this._layers[i],n[e],!0)}}},e.prototype.delLayer=function(e){var t=this._layers,n=this._zlevelList,r=t[e];r&&(r.dom.parentNode.removeChild(r.dom),delete t[e],n.splice(F(n,e),1))},e.prototype.resize=function(e,t){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var r=this._opts,i=this.root;if(null!=e&&(r.width=e),null!=t&&(r.height=t),e=yv(i,0,r),t=yv(i,1,r),n.style.display="",this._width!==e||t!==this._height){for(var o in n.style.width=e+"px",n.style.height=t+"px",this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,t);this.refresh(!0)}this._width=e,this._height=t}else{if(null==e||null==t)return;this._width=e,this._height=t,this.getLayer(zS).resize(e,t)}return this},e.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},e.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},e.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[314159].dom;var t=new RS("image",this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var n=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var r=t.dom.width,i=t.dom.height;this.eachLayer((function(e){e.__builtin__?n.drawImage(e.dom,0,0,r,i):e.renderToCanvas&&(n.save(),e.renderToCanvas(n),n.restore())}))}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},a=this.storage.getDisplayList(!0),s=0,l=a.length;s<l;s++){var u=a[s];Rv(n,u,o,s===l-1)}return t.dom},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e}();function FS(e){e.registerPainter("canvas",BS)}var GS=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return l(t,e),t.prototype.getInitialData=function(e){if("production"!==process.env.NODE_ENV){var t=e.coordinateSystem;if("polar"!==t&&"cartesian2d"!==t)throw new Error("Line not support coordinateSystem besides cartesian and polar")}return j_(null,this,{useEncodeDefaulter:!0})},t.prototype.getLegendIcon=function(e){var t=new Yi,n=dv("line",0,e.itemHeight/2,e.itemWidth,0,e.lineStyle.stroke,!1);t.add(n),n.setStyle(e.lineStyle);var r=this.getData().getVisual("symbol"),i=this.getData().getVisual("symbolRotate"),o="none"===r?"circle":r,a=.8*e.itemHeight,s=dv(o,(e.itemWidth-a)/2,(e.itemHeight-a)/2,a,a,e.itemStyle.fill);t.add(s),s.setStyle(e.itemStyle);var l="inherit"===e.iconRotate?i:e.iconRotate||0;return s.rotation=l*Math.PI/180,s.setOrigin([e.itemWidth/2,e.itemHeight/2]),o.indexOf("empty")>-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),t},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},t}(Hg);function HS(e,t){var n=e.mapDimensionsAll("defaultedLabel"),r=n.length;if(1===r){var i=Bf(e,t,n[0]);return null!=i?i+"":null}if(r){for(var o=[],a=0;a<n.length;a++)o.push(Bf(e,t,n[a]));return o.join(" ")}}function US(e,t){var n=e.mapDimensionsAll("defaultedLabel");if(!J(t))return t+"";for(var r=[],i=0;i<n.length;i++){var o=e.getDimensionIndex(n[i]);o>=0&&r.push(t[o])}return r.join(" ")}var WS=function(e){function t(t,n,r,i){var o=e.call(this)||this;return o.updateData(t,n,r,i),o}return l(t,e),t.prototype._createSymbol=function(e,t,n,r,i){this.removeAll();var o=dv(e,-1,-1,2,2,null,i);o.attr({z2:100,culling:!0,scaleX:r[0]/2,scaleY:r[1]/2}),o.drift=jS,this._symbolType=e,this.add(o)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){Kl(this.childAt(0))},t.prototype.downplay=function(){$l(this.childAt(0))},t.prototype.setZ=function(e,t){var n=this.childAt(0);n.zlevel=e,n.z=t},t.prototype.setDraggable=function(e,t){var n=this.childAt(0);n.draggable=e,n.cursor=!t&&e?"move":n.cursor},t.prototype.updateData=function(e,n,r,i){this.silent=!1;var o=e.getItemVisual(n,"symbol")||"circle",a=e.hostModel,s=t.getSymbolSize(e,n),l=o!==this._symbolType,u=i&&i.disableAnimation;if(l){var c=e.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,e,n,s,c)}else{(d=this.childAt(0)).silent=!1;var h={scaleX:s[0]/2,scaleY:s[1]/2};u?d.attr(h):Oc(d,h,a,n),Fc(d)}if(this._updateCommon(e,n,s,r,i),l){var d=this.childAt(0);if(!u){h={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}};d.scaleX=d.scaleY=0,d.style.opacity=0,Rc(d,h,a,n)}}u&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(e,t,n,r,i){var o,a,s,l,u,c,h,d,p,f=this.childAt(0),g=e.hostModel;if(r&&(o=r.emphasisItemStyle,a=r.blurItemStyle,s=r.selectItemStyle,l=r.focus,u=r.blurScope,h=r.labelStatesModels,d=r.hoverScale,p=r.cursorStyle,c=r.emphasisDisabled),!r||e.hasItemOption){var m=r&&r.itemModel?r.itemModel:e.getItemModel(t),v=m.getModel("emphasis");o=v.getModel("itemStyle").getItemStyle(),s=m.getModel(["select","itemStyle"]).getItemStyle(),a=m.getModel(["blur","itemStyle"]).getItemStyle(),l=v.get("focus"),u=v.get("blurScope"),c=v.get("disabled"),h=bh(m),d=v.getShallow("scale"),p=m.getShallow("cursor")}var y=e.getItemVisual(t,"symbolRotate");f.attr("rotation",(y||0)*Math.PI/180||0);var _=fv(e.getItemVisual(t,"symbolOffset"),n);_&&(f.x=_[0],f.y=_[1]),p&&f.attr("cursor",p);var x=e.getItemVisual(t,"style"),b=x.fill;if(f instanceof Js){var w=f.style;f.useStyle(z({image:w.image,x:w.x,y:w.y,width:w.width,height:w.height},x))}else f.__isEmptyBrush?f.useStyle(z({},x)):f.useStyle(x),f.style.decal=null,f.setColor(b,i&&i.symbolInnerColor),f.style.strokeNoScale=!0;var S=e.getItemVisual(t,"liftZ"),T=this._z2;null!=S?null==T&&(this._z2=f.z2,f.z2+=S):null!=T&&(f.z2=T,this._z2=null);var M=i&&i.useNameLabel;xh(f,h,{labelFetcher:g,labelDataIndex:t,defaultText:function(t){return M?e.getName(t):HS(e,t)},inheritColor:b,defaultOpacity:x.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var C=f.ensureState("emphasis");C.style=o,f.ensureState("select").style=s,f.ensureState("blur").style=a;var D=null==d||!0===d?Math.max(1.1,3/this._sizeY):isFinite(d)&&d>0?+d:1;C.scaleX=this._sizeX*D,C.scaleY=this._sizeY*D,this.setSymbolScale(1),cu(this,l,u,c)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t,n){var r=this.childAt(0),i=bl(this).dataIndex,o=n&&n.animation;if(this.silent=r.silent=!0,n&&n.fadeLabel){var a=r.getTextContent();a&&zc(a,{style:{opacity:0}},t,{dataIndex:i,removeOpt:o,cb:function(){r.removeTextContent()}})}else r.removeTextContent();zc(r,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:i,cb:e,removeOpt:o})},t.getSymbolSize=function(e,t){return pv(e.getItemVisual(t,"symbolSize"))},t}(Yi);function jS(e,t){this.parent.drift(e,t)}function XS(e,t,n,r){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(r.isIgnore&&r.isIgnore(n))&&!(r.clipShape&&!r.clipShape.contain(t[0],t[1]))&&"none"!==e.getItemVisual(n,"symbol")}function YS(e){return null==e||re(e)||(e={isIgnore:e}),e||{}}function ZS(e){var t=e.hostModel,n=t.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:bh(t),cursorStyle:t.get("cursor")}}var qS=function(){function e(e){this.group=new Yi,this._SymbolCtor=e||WS}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=YS(t);var n=this.group,r=e.hostModel,i=this._data,o=this._SymbolCtor,a=t.disableAnimation,s=ZS(e),l={disableAnimation:a},u=t.getSymbolPoint||function(t){return e.getItemLayout(t)};i||n.removeAll(),e.diff(i).add((function(r){var i=u(r);if(XS(e,i,r,t)){var a=new o(e,r,s,l);a.setPosition(i),e.setItemGraphicEl(r,a),n.add(a)}})).update((function(c,h){var d=i.getItemGraphicEl(h),p=u(c);if(XS(e,p,c,t)){var f=e.getItemVisual(c,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==f)n.remove(d),(d=new o(e,c,s,l)).setPosition(p);else{d.updateData(e,c,s,l);var m={x:p[0],y:p[1]};a?d.attr(m):Oc(d,m,r)}n.add(d),e.setItemGraphicEl(c,d)}else n.remove(d)})).remove((function(e){var t=i.getItemGraphicEl(e);t&&t.fadeOut((function(){n.remove(t)}),r)})).execute(),this._getSymbolPoint=u,this._data=e},e.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl((function(t,n){var r=e._getSymbolPoint(n);t.setPosition(r),t.markRedraw()}))},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=ZS(e),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){function r(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=YS(n);for(var i=e.start;i<e.end;i++){var o=t.getItemLayout(i);if(XS(t,o,i,n)){var a=new this._SymbolCtor(t,i,this._seriesScope);a.traverse(r),a.setPosition(o),this.group.add(a),t.setItemGraphicEl(i,a),this._progressiveEls.push(a)}}},e.prototype.eachRendered=function(e){gh(this._progressiveEls||this.group,e)},e.prototype.remove=function(e){var t=this.group,n=this._data;n&&e?n.eachItemGraphicEl((function(e){e.fadeOut((function(){t.remove(e)}),n.hostModel)})):t.removeAll()},e}();function KS(e,t,n){var r=e.getBaseAxis(),i=e.getOtherAxis(r),o=function(e,t){var n=0,r=e.scale.getExtent();"start"===t?n=r[0]:"end"===t?n=r[1]:ne(t)&&!isNaN(t)?n=t:r[0]>0?n=r[0]:r[1]<0&&(n=r[1]);return n}(i,n),a=r.dim,s=i.dim,l=t.mapDimension(s),u=t.mapDimension(a),c="x"===s||"radius"===s?1:0,h=j(e.dimensions,(function(e){return t.mapDimension(e)})),d=!1,p=t.getCalculationInfo("stackResultDimension");return U_(t,h[0])&&(d=!0,h[0]=p),U_(t,h[1])&&(d=!0,h[1]=p),{dataDimsForPoint:h,valueStart:o,valueAxisDim:s,baseAxisDim:a,stacked:!!d,valueDim:l,baseDim:u,baseDataOffset:c,stackedOverDimension:t.getCalculationInfo("stackedOverDimension")}}function $S(e,t,n,r){var i=NaN;e.stacked&&(i=n.get(n.getCalculationInfo("stackedOverDimension"),r)),isNaN(i)&&(i=e.valueStart);var o=e.baseDataOffset,a=[];return a[o]=n.get(e.baseDim,r),a[1-o]=i,t.dataToPoint(a)}var JS=Math.min,QS=Math.max;function eT(e,t){return isNaN(e)||isNaN(t)}function tT(e,t,n,r,i,o,a,s,l){for(var u,c,h,d,p,f,g=n,m=0;m<r;m++){var v=t[2*g],y=t[2*g+1];if(g>=i||g<0)break;if(eT(v,y)){if(l){g+=o;continue}break}if(g===n)e[o>0?"moveTo":"lineTo"](v,y),h=v,d=y;else{var _=v-u,x=y-c;if(_*_+x*x<.5){g+=o;continue}if(a>0){for(var b=g+o,w=t[2*b],S=t[2*b+1];w===v&&S===y&&m<r;)m++,g+=o,w=t[2*(b+=o)],S=t[2*b+1],_=(v=t[2*g])-u,x=(y=t[2*g+1])-c;var T=m+1;if(l)for(;eT(w,S)&&T<r;)T++,w=t[2*(b+=o)],S=t[2*b+1];var M=.5,C=0,D=0,A=void 0,I=void 0;if(T>=r||eT(w,S))p=v,f=y;else{C=w-u,D=S-c;var E=v-u,L=w-v,N=y-c,P=S-y,O=void 0,R=void 0;if("x"===s){var k=C>0?1:-1;p=v-k*(O=Math.abs(E))*a,f=y,A=v+k*(R=Math.abs(L))*a,I=y}else if("y"===s){var z=D>0?1:-1;p=v,f=y-z*(O=Math.abs(N))*a,A=v,I=y+z*(R=Math.abs(P))*a}else O=Math.sqrt(E*E+N*N),p=v-C*a*(1-(M=(R=Math.sqrt(L*L+P*P))/(R+O))),f=y-D*a*(1-M),I=y+D*a*M,A=JS(A=v+C*a*M,QS(w,v)),I=JS(I,QS(S,y)),A=QS(A,JS(w,v)),f=y-(D=(I=QS(I,JS(S,y)))-y)*O/R,p=JS(p=v-(C=A-v)*O/R,QS(u,v)),f=JS(f,QS(c,y)),A=v+(C=v-(p=QS(p,JS(u,v))))*R/O,I=y+(D=y-(f=QS(f,JS(c,y))))*R/O}e.bezierCurveTo(h,d,p,f,v,y),h=A,d=I}else e.lineTo(v,y)}u=v,c=y,g+=o}return m}var nT=function(){this.smooth=0,this.smoothConstraint=!0},rT=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polyline",n}return l(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new nT},t.prototype.buildPath=function(e,t){var n=t.points,r=0,i=n.length/2;if(t.connectNulls){for(;i>0&&eT(n[2*i-2],n[2*i-1]);i--);for(;r<i&&eT(n[2*r],n[2*r+1]);r++);}for(;r<i;)r+=tT(e,n,r,i,i,1,t.smooth,t.smoothMonotone,t.connectNulls)+1},t.prototype.getPointOn=function(e,t){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var n,r,i=this.path.data,o=Ds.CMD,a="x"===t,s=[],l=0;l<i.length;){var u=void 0,c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,g=void 0;switch(i[l++]){case o.M:n=i[l++],r=i[l++];break;case o.L:if(u=i[l++],c=i[l++],(g=a?(e-n)/(u-n):(e-r)/(c-r))<=1&&g>=0){var m=a?(c-r)*g+r:(u-n)*g+n;return a?[e,m]:[m,e]}n=u,r=c;break;case o.C:u=i[l++],c=i[l++],h=i[l++],d=i[l++],p=i[l++],f=i[l++];var v=a?An(n,u,h,p,e,s):An(r,c,d,f,e,s);if(v>0)for(var y=0;y<v;y++){var _=s[y];if(_<=1&&_>=0){m=a?Cn(r,c,d,f,_):Cn(n,u,h,p,_);return a?[e,m]:[m,e]}}n=p,r=f}}},t}(Ys),iT=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t}(nT),oT=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polygon",n}return l(t,e),t.prototype.getDefaultShape=function(){return new iT},t.prototype.buildPath=function(e,t){var n=t.points,r=t.stackedOnPoints,i=0,o=n.length/2,a=t.smoothMonotone;if(t.connectNulls){for(;o>0&&eT(n[2*o-2],n[2*o-1]);o--);for(;i<o&&eT(n[2*i],n[2*i+1]);i++);}for(;i<o;){var s=tT(e,n,i,o,o,1,t.smooth,a,t.connectNulls);tT(e,r,i+s-1,s,o,-1,t.stackedOnSmooth,a,t.connectNulls),i+=s+1,e.closePath()}},t}(Ys);function aT(e,t,n,r,i){var o=e.getArea(),a=o.x,s=o.y,l=o.width,u=o.height,c=n.get(["lineStyle","width"])||2;a-=c/2,s-=c/2,l+=c,u+=c,l=Math.ceil(l),a!==Math.floor(a)&&(a=Math.floor(a),l++);var h=new ol({shape:{x:a,y:s,width:l,height:u}});if(t){var d=e.getBaseAxis(),p=d.isHorizontal(),f=d.inverse;p?(f&&(h.shape.x+=l),h.shape.width=0):(f||(h.shape.y+=u),h.shape.height=0);var g=Q(i)?function(e){i(e,h)}:null;Rc(h,{shape:{width:l,height:u,x:a,y:s}},n,null,r,g)}return h}function sT(e,t,n){var r=e.getArea(),i=ao(r.r0,1),o=ao(r.r,1),a=new rc({shape:{cx:ao(e.cx,1),cy:ao(e.cy,1),r0:i,r:o,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}});t&&("angle"===e.getBaseAxis().dim?a.shape.endAngle=r.startAngle:a.shape.r=i,Rc(a,{shape:{endAngle:r.endAngle,r:o}},n));return a}function lT(e,t,n,r,i){return e?"polar"===e.type?sT(e,t,n):"cartesian2d"===e.type?aT(e,t,n,r,i):null:null}function uT(e,t){return e.type===t}function cT(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return;return!0}}function hT(e){for(var t=1/0,n=1/0,r=-1/0,i=-1/0,o=0;o<e.length;){var a=e[o++],s=e[o++];isNaN(a)||(t=Math.min(a,t),r=Math.max(a,r)),isNaN(s)||(n=Math.min(s,n),i=Math.max(s,i))}return[[t,n],[r,i]]}function dT(e,t){var n=hT(e),r=n[0],i=n[1],o=hT(t),a=o[0],s=o[1];return Math.max(Math.abs(r[0]-a[0]),Math.abs(r[1]-a[1]),Math.abs(i[0]-s[0]),Math.abs(i[1]-s[1]))}function pT(e){return ne(e)?e:e?.5:0}function fT(e,t,n,r){var i=t.getBaseAxis(),o="x"===i.dim||"radius"===i.dim?0:1,a=[],s=0,l=[],u=[],c=[],h=[];if(r){for(s=0;s<e.length;s+=2)isNaN(e[s])||isNaN(e[s+1])||h.push(e[s],e[s+1]);e=h}for(s=0;s<e.length-2;s+=2)switch(c[0]=e[s+2],c[1]=e[s+3],u[0]=e[s],u[1]=e[s+1],a.push(u[0],u[1]),n){case"end":l[o]=c[o],l[1-o]=u[1-o],a.push(l[0],l[1]);break;case"middle":var d=(u[o]+c[o])/2,p=[];l[o]=p[o]=d,l[1-o]=u[1-o],p[1-o]=c[1-o],a.push(l[0],l[1]),a.push(p[0],p[1]);break;default:l[o]=u[o],l[1-o]=c[1-o],a.push(l[0],l[1])}return a.push(e[s++],e[s++]),a}function gT(e,t,n){var r=e.getVisual("visualMeta");if(r&&r.length&&e.count())if("cartesian2d"===t.type){for(var i,o,a=r.length-1;a>=0;a--){var s=e.getDimensionInfo(r[a].dimension);if("x"===(i=s&&s.coordDim)||"y"===i){o=r[a];break}}if(o){var l=t.getAxis(i),u=j(o.stops,(function(e){return{coord:l.toGlobalCoord(l.dataToCoord(e.value)),color:e.color}})),c=u.length,h=o.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),h.reverse());var d=function(e,t){var n,r,i=[],o=e.length;function a(e,t,n){var r=e.coord;return{coord:n,color:lr((n-r)/(t.coord-r),[e.color,t.color])}}for(var s=0;s<o;s++){var l=e[s],u=l.coord;if(u<0)n=l;else{if(u>t){r?i.push(a(r,l,t)):n&&i.push(a(n,l,0),a(n,l,t));break}n&&(i.push(a(n,l,0)),n=null),i.push(l),r=l}}return i}(u,"x"===i?n.getWidth():n.getHeight()),p=d.length;if(!p&&c)return u[0].coord<0?h[1]?h[1]:u[c-1].color:h[0]?h[0]:u[0].color;var f=d[0].coord-10,g=d[p-1].coord+10,m=g-f;if(m<.001)return"transparent";W(d,(function(e){e.offset=(e.coord-f)/m})),d.push({offset:p?d[p-1].offset:.5,color:h[1]||"transparent"}),d.unshift({offset:p?d[0].offset:.5,color:h[0]||"transparent"});var v=new wc(0,0,0,0,d,!0);return v[i]=f,v[i+"2"]=g,v}"production"!==process.env.NODE_ENV&&console.warn("Visual map on line style only support x or y dimension.")}else"production"!==process.env.NODE_ENV&&console.warn("Visual map on line style is only supported on cartesian2d.")}function mT(e,t,n){var r=e.get("showAllSymbol"),i="auto"===r;if(!r||i){var o=n.getAxesByScale("ordinal")[0];if(o&&(!i||!function(e,t){var n=e.getExtent(),r=Math.abs(n[1]-n[0])/e.scale.count();isNaN(r)&&(r=0);for(var i=t.count(),o=Math.max(1,Math.round(i/5)),a=0;a<i;a+=o)if(1.5*WS.getSymbolSize(t,a)[e.isHorizontal()?1:0]>r)return!1;return!0}(o,t))){var a=t.mapDimension(o.dim),s={};return W(o.getViewLabels(),(function(e){var t=o.scale.getRawOrdinalNumber(e.tickValue);s[t]=1})),function(e){return!s.hasOwnProperty(t.get(a,e))}}}}function vT(e,t){return isNaN(e)||isNaN(t)}function yT(e,t){return[e[2*t],e[2*t+1]]}function _T(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t<Dl.length;t++)if(e.get([Dl[t],"endLabel","show"]))return!0;return!1}function xT(e,t,n,r){if(uT(t,"cartesian2d")){var i=r.getModel("endLabel"),o=i.get("valueAnimation"),a=r.getData(),s={lastFrameIndex:0},l=_T(r)?function(n,r){e._endLabelOnDuring(n,r,a,s,o,i,t)}:null,u=t.getBaseAxis().isHorizontal(),c=aT(t,n,r,(function(){var t=e._endLabel;t&&n&&null!=s.originalX&&t.attr({x:s.originalX,y:s.originalY})}),l);if(!r.get("clip",!0)){var h=c.shape,d=Math.max(h.width,h.height);u?(h.y-=d,h.height+=2*d):(h.x-=d,h.width+=2*d)}return l&&l(1,c),c}return"production"!==process.env.NODE_ENV&&r.get(["endLabel","show"])&&console.warn("endLabel is not supported for lines in polar systems."),sT(t,n,r)}var bT=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.init=function(){var e=new Yi,t=new qS;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e},t.prototype.render=function(e,t,n){var r=this,i=e.coordinateSystem,o=this.group,a=e.getData(),s=e.getModel("lineStyle"),l=e.getModel("areaStyle"),u=a.getLayout("points")||[],c="polar"===i.type,h=this._coordSys,d=this._symbolDraw,p=this._polyline,f=this._polygon,g=this._lineGroup,m=!t.ssr&&e.get("animation"),v=!l.isEmpty(),y=l.get("origin"),_=KS(i,a,y),x=v&&function(e,t,n){if(!n.valueDim)return[];for(var r=t.count(),i=ux(2*r),o=0;o<r;o++){var a=$S(n,e,t,o);i[2*o]=a[0],i[2*o+1]=a[1]}return i}(i,a,_),b=e.get("showSymbol"),w=e.get("connectNulls"),S=b&&!c&&mT(e,a,i),T=this._data;T&&T.eachItemGraphicEl((function(e,t){e.__temp&&(o.remove(e),T.setItemGraphicEl(t,null))})),b||d.remove(),o.add(g);var M,C=!c&&e.get("step");i&&i.getArea&&e.get("clip",!0)&&(null!=(M=i.getArea()).width?(M.x-=.1,M.y-=.1,M.width+=.2,M.height+=.2):M.r0&&(M.r0-=.5,M.r+=.5)),this._clipShapeForSymbol=M;var D=gT(a,i,n)||a.getVisual("style")[a.getVisual("drawType")];if(p&&h.type===i.type&&C===this._step){v&&!f?f=this._newPolygon(u,x):f&&!v&&(g.remove(f),f=this._polygon=null),c||this._initOrUpdateEndLabel(e,i,Gd(D));var A=g.getClipPath();if(A)Rc(A,{shape:xT(this,i,!1,e).shape},e);else g.setClipPath(xT(this,i,!0,e));b&&d.updateData(a,{isIgnore:S,clipShape:M,disableAnimation:!0,getSymbolPoint:function(e){return[u[2*e],u[2*e+1]]}}),cT(this._stackedOnPoints,x)&&cT(this._points,u)||(m?this._doUpdateAnimation(a,x,i,n,C,y,w):(C&&(u=fT(u,i,C,w),x&&(x=fT(x,i,C,w))),p.setShape({points:u}),f&&f.setShape({points:u,stackedOnPoints:x})))}else b&&d.updateData(a,{isIgnore:S,clipShape:M,disableAnimation:!0,getSymbolPoint:function(e){return[u[2*e],u[2*e+1]]}}),m&&this._initSymbolLabelAnimation(a,i,M),C&&(u=fT(u,i,C,w),x&&(x=fT(x,i,C,w))),p=this._newPolyline(u),v?f=this._newPolygon(u,x):f&&(g.remove(f),f=this._polygon=null),c||this._initOrUpdateEndLabel(e,i,Gd(D)),g.setClipPath(xT(this,i,!0,e));var I=e.getModel("emphasis"),E=I.get("focus"),L=I.get("blurScope"),N=I.get("disabled");(p.useStyle(V(s.getLineStyle(),{fill:"none",stroke:D,lineJoin:"bevel"})),fu(p,e,"lineStyle"),p.style.lineWidth>0&&"bolder"===e.get(["emphasis","lineStyle","width"]))&&(p.getState("emphasis").style.lineWidth=+p.style.lineWidth+1);bl(p).seriesIndex=e.seriesIndex,cu(p,E,L,N);var P=pT(e.get("smooth")),O=e.get("smoothMonotone");if(p.setShape({smooth:P,smoothMonotone:O,connectNulls:w}),f){var R=a.getCalculationInfo("stackedOnSeries"),k=0;f.useStyle(V(l.getAreaStyle(),{fill:D,opacity:.7,lineJoin:"bevel",decal:a.getVisual("style").decal})),R&&(k=pT(R.get("smooth"))),f.setShape({smooth:P,stackedOnSmooth:k,smoothMonotone:O,connectNulls:w}),fu(f,e,"areaStyle"),bl(f).seriesIndex=e.seriesIndex,cu(f,E,L,N)}var z=function(e){r._changePolyState(e)};a.eachItemGraphicEl((function(e){e&&(e.onHoverStateChange=z)})),this._polyline.onHoverStateChange=z,this._data=a,this._coordSys=i,this._stackedOnPoints=x,this._points=u,this._step=C,this._valueOrigin=y,e.get("triggerLineEvent")&&(this.packEventData(e,p),f&&this.packEventData(e,f))},t.prototype.packEventData=function(e,t){bl(t).eventData={componentType:"series",componentSubType:"line",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"line"}},t.prototype.highlight=function(e,t,n,r){var i=e.getData(),o=ea(i,r);if(this._changePolyState("emphasis"),!(o instanceof Array)&&null!=o&&o>=0){var a=i.getLayout("points"),s=i.getItemGraphicEl(o);if(!s){var l=a[2*o],u=a[2*o+1];if(isNaN(l)||isNaN(u))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;var c=e.get("zlevel")||0,h=e.get("z")||0;(s=new WS(i,o)).x=l,s.y=u,s.setZ(c,h);var d=s.getSymbolPath().getTextContent();d&&(d.zlevel=c,d.z=h,d.z2=this._polyline.z2+1),s.__temp=!0,i.setItemGraphicEl(o,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else em.prototype.highlight.call(this,e,t,n,r)},t.prototype.downplay=function(e,t,n,r){var i=e.getData(),o=ea(i,r);if(this._changePolyState("normal"),null!=o&&o>=0){var a=i.getItemGraphicEl(o);a&&(a.__temp?(i.setItemGraphicEl(o,null),this.group.remove(a)):a.downplay())}else em.prototype.downplay.call(this,e,t,n,r)},t.prototype._changePolyState=function(e){var t=this._polygon;jl(this._polyline,e),t&&jl(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new rT({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new oT({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var r,i,o=t.getBaseAxis(),a=o.inverse;"cartesian2d"===t.type?(r=o.isHorizontal(),i=!1):"polar"===t.type&&(r="angle"===o.dim,i=!0);var s=e.hostModel,l=s.get("animationDuration");Q(l)&&(l=l(null));var u=s.get("animationDelay")||0,c=Q(u)?u(null):u;e.eachItemGraphicEl((function(e,o){var s=e;if(s){var h=[e.x,e.y],d=void 0,p=void 0,f=void 0;if(n)if(i){var g=n,m=t.pointToCoord(h);r?(d=g.startAngle,p=g.endAngle,f=-m[1]/180*Math.PI):(d=g.r0,p=g.r,f=m[0])}else{var v=n;r?(d=v.x,p=v.x+v.width,f=e.x):(d=v.y+v.height,p=v.y,f=e.y)}var y=p===d?0:(f-d)/(p-d);a&&(y=1-y);var _=Q(u)?u(o):l*y+c,x=s.getSymbolPath(),b=x.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:_}),b&&b.animateFrom({style:{opacity:0}},{duration:300,delay:_}),x.disableLabelAnimation=!0}}))},t.prototype._initOrUpdateEndLabel=function(e,t,n){var r=e.getModel("endLabel");if(_T(e)){var i=e.getData(),o=this._polyline,a=i.getLayout("points");if(!a)return o.removeTextContent(),void(this._endLabel=null);var s=this._endLabel;s||((s=this._endLabel=new ll({z2:200})).ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var l=function(e){for(var t=e.length/2;t>0&&vT(e[2*t-2],e[2*t-1]);t--);return t-1}(a);l>=0&&(xh(o,bh(e,"endLabel"),{inheritColor:n,labelFetcher:e,labelDataIndex:l,defaultText:function(e,t,n){return null!=n?US(i,n):HS(i,e)},enableTextSetter:!0},function(e,t){var n=t.getBaseAxis(),r=n.isHorizontal(),i=n.inverse,o=r?i?"right":"left":"center",a=r?"middle":i?"top":"bottom";return{normal:{align:e.get("align")||o,verticalAlign:e.get("verticalAlign")||a}}}(r,t)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(e,t,n,r,i,o,a){var s=this._endLabel,l=this._polyline;if(s){e<1&&null==r.originalX&&(r.originalX=s.x,r.originalY=s.y);var u=n.getLayout("points"),c=n.hostModel,h=c.get("connectNulls"),d=o.get("precision"),p=o.get("distance")||0,f=a.getBaseAxis(),g=f.isHorizontal(),m=f.inverse,v=t.shape,y=m?g?v.x:v.y+v.height:g?v.x+v.width:v.y,_=(g?p:0)*(m?-1:1),x=(g?0:-p)*(m?-1:1),b=g?"x":"y",w=function(e,t,n){for(var r,i,o=e.length/2,a="x"===n?0:1,s=0,l=-1,u=0;u<o;u++)if(i=e[2*u+a],!isNaN(i)&&!isNaN(e[2*u+1-a]))if(0!==u){if(r<=t&&i>=t||r>=t&&i<=t){l=u;break}s=u,r=i}else r=i;return{range:[s,l],t:(t-r)/(i-r)}}(u,y,b),S=w.range,T=S[1]-S[0],M=void 0;if(T>=1){if(T>1&&!h){var C=yT(u,S[0]);s.attr({x:C[0]+_,y:C[1]+x}),i&&(M=c.getRawValue(S[0]))}else{(C=l.getPointOn(y,b))&&s.attr({x:C[0]+_,y:C[1]+x});var D=c.getRawValue(S[0]),A=c.getRawValue(S[1]);i&&(M=ca(n,d,D,A,w.t))}r.lastFrameIndex=S[0]}else{var I=1===e||r.lastFrameIndex>0?S[0]:0;C=yT(u,I);i&&(M=c.getRawValue(I)),s.attr({x:C[0]+_,y:C[1]+x})}if(i){var E=Ih(s);"function"==typeof E.setLabelText&&E.setLabelText(M)}}},t.prototype._doUpdateAnimation=function(e,t,n,r,i,o,a){var s=this._polyline,l=this._polygon,u=e.hostModel,c=function(e,t,n,r,i,o,a){for(var s=function(e,t){var n=[];return t.diff(e).add((function(e){n.push({cmd:"+",idx:e})})).update((function(e,t){n.push({cmd:"=",idx:t,idx1:e})})).remove((function(e){n.push({cmd:"-",idx:e})})).execute(),n}(e,t),l=[],u=[],c=[],h=[],d=[],p=[],f=[],g=KS(i,t,a),m=e.getLayout("points")||[],v=t.getLayout("points")||[],y=0;y<s.length;y++){var _=s[y],x=!0,b=void 0,w=void 0;switch(_.cmd){case"=":b=2*_.idx,w=2*_.idx1;var S=m[b],T=m[b+1],M=v[w],C=v[w+1];(isNaN(S)||isNaN(T))&&(S=M,T=C),l.push(S,T),u.push(M,C),c.push(n[b],n[b+1]),h.push(r[w],r[w+1]),f.push(t.getRawIndex(_.idx1));break;case"+":var D=_.idx,A=g.dataDimsForPoint,I=i.dataToPoint([t.get(A[0],D),t.get(A[1],D)]);w=2*D,l.push(I[0],I[1]),u.push(v[w],v[w+1]);var E=$S(g,i,t,D);c.push(E[0],E[1]),h.push(r[w],r[w+1]),f.push(t.getRawIndex(D));break;case"-":x=!1}x&&(d.push(_),p.push(p.length))}p.sort((function(e,t){return f[e]-f[t]}));var L=l.length,N=ux(L),P=ux(L),O=ux(L),R=ux(L),k=[];for(y=0;y<p.length;y++){var z=p[y],V=2*y,B=2*z;N[V]=l[B],N[V+1]=l[B+1],P[V]=u[B],P[V+1]=u[B+1],O[V]=c[B],O[V+1]=c[B+1],R[V]=h[B],R[V+1]=h[B+1],k[y]=d[z]}return{current:N,next:P,stackedOnCurrent:O,stackedOnNext:R,status:k}}(this._data,e,this._stackedOnPoints,t,this._coordSys,0,this._valueOrigin),h=c.current,d=c.stackedOnCurrent,p=c.next,f=c.stackedOnNext;if(i&&(h=fT(c.current,n,i,a),d=fT(c.stackedOnCurrent,n,i,a),p=fT(c.next,n,i,a),f=fT(c.stackedOnNext,n,i,a)),dT(h,p)>3e3||l&&dT(d,f)>3e3)return s.stopAnimation(),s.setShape({points:p}),void(l&&(l.stopAnimation(),l.setShape({points:p,stackedOnPoints:f})));s.shape.__points=c.current,s.shape.points=h;var g={shape:{points:p}};c.current!==h&&(g.shape.__points=c.next),s.stopAnimation(),Oc(s,g,u),l&&(l.setShape({points:h,stackedOnPoints:d}),l.stopAnimation(),Oc(l,{shape:{stackedOnPoints:f}},u),s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var m=[],v=c.status,y=0;y<v.length;y++){if("="===v[y].cmd){var _=e.getItemGraphicEl(v[y].idx1);_&&m.push({el:_,ptIdx:y})}}s.animators&&s.animators.length&&s.animators[0].during((function(){l&&l.dirtyShape();for(var e=s.shape.__points,t=0;t<m.length;t++){var n=m[t].el,r=2*m[t].ptIdx;n.x=e[r],n.y=e[r+1],n.markRedraw()}}))},t.prototype.remove=function(e){var t=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),n&&n.eachItemGraphicEl((function(e,r){e.__temp&&(t.remove(e),n.setItemGraphicEl(r,null))})),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},t.type="line",t}(em);function wT(e,t){return{seriesType:e,plan:$g(),reset:function(e){var n=e.getData(),r=e.coordinateSystem,i=e.pipelineContext,o=t||i.large;if(r){var a=j(r.dimensions,(function(e){return n.mapDimension(e)})).slice(0,2),s=a.length,l=n.getCalculationInfo("stackResultDimension");U_(n,a[0])&&(a[0]=l),U_(n,a[1])&&(a[1]=l);var u=n.getStore(),c=n.getDimensionIndex(a[0]),h=n.getDimensionIndex(a[1]);return s&&{progress:function(e,t){for(var n=e.end-e.start,i=o&&ux(n*s),a=[],l=[],d=e.start,p=0;d<e.end;d++){var f=void 0;if(1===s){var g=u.get(c,d);f=r.dataToPoint(g,null,l)}else a[0]=u.get(c,d),a[1]=u.get(h,d),f=r.dataToPoint(a,null,l);o?(i[p++]=f[0],i[p++]=f[1]):t.setItemLayout(d,f.slice())}o&&t.setLayout("points",i)}}}}}}var ST={average:function(e){for(var t=0,n=0,r=0;r<e.length;r++)isNaN(e[r])||(t+=e[r],n++);return 0===n?NaN:t/n},sum:function(e){for(var t=0,n=0;n<e.length;n++)t+=e[n]||0;return t},max:function(e){for(var t=-1/0,n=0;n<e.length;n++)e[n]>t&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;n<e.length;n++)e[n]<t&&(t=e[n]);return isFinite(t)?t:NaN},minmax:function(e){for(var t=-1/0,n=-1/0,r=0;r<e.length;r++){var i=e[r],o=Math.abs(i);o>t&&(t=o,n=i)}return isFinite(n)?n:NaN},nearest:function(e){return e[0]}},TT=function(e){return Math.round(e.length/2)};function MT(e){return{seriesType:e,reset:function(e,t,n){var r=e.getData(),i=e.get("sampling"),o=e.coordinateSystem,a=r.count();if(a>10&&"cartesian2d"===o.type&&i){var s=o.getBaseAxis(),l=o.getOtherAxis(s),u=s.getExtent(),c=n.getDevicePixelRatio(),h=Math.abs(u[1]-u[0])*(c||1),d=Math.round(a/h);if(isFinite(d)&&d>1){"lttb"===i&&e.setData(r.lttbDownSample(r.mapDimension(l.dim),1/d));var p=void 0;ee(i)?p=ST[i]:Q(i)&&(p=i),p&&e.setData(r.downSample(r.mapDimension(l.dim),1/d,p,TT))}}}}}var CT=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.getInitialData=function(e,t){return j_(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e,t,n){var r=this.coordinateSystem;if(r&&r.clampData){var i=r.clampData(e),o=r.dataToPoint(i);if(n)W(r.getAxes(),(function(e,n){if("category"===e.type&&null!=t){var r=e.getTicksCoords(),a=e.getTickModel().get("alignWithLabel"),s=i[n],l="x1"===t[n]||"y1"===t[n];if(l&&!a&&(s+=1),r.length<2)return;if(2===r.length)return void(o[n]=e.toGlobalCoord(e.getExtent()[l?1:0]));for(var u=void 0,c=void 0,h=1,d=0;d<r.length;d++){var p=r[d].coord,f=d===r.length-1?r[d-1].tickValue+h:r[d].tickValue;if(f===s){c=p;break}if(f<s)u=p;else if(null!=u&&f>s){c=(p+u)/2;break}1===d&&(h=f-r[0].tickValue)}null==c&&(u?u&&(c=r[r.length-1].coord):c=r[0].coord),o[n]=e.toGlobalCoord(c)}}));else{var a=this.getData(),s=a.getLayout("offset"),l=a.getLayout("size"),u=r.getBaseAxis().isHorizontal()?0:1;o[u]+=s+l/2}return o}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},t}(Hg);Hg.registerClass(CT);var DT=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.getInitialData=function(){return j_(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},t.prototype.getProgressiveThreshold=function(){var e=this.get("progressiveThreshold"),t=this.get("largeThreshold");return t>e&&(e=t),e},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=Yh(CT.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),t}(CT),AT=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},IT=function(e){function t(t){var n=e.call(this,t)||this;return n.type="sausage",n}return l(t,e),t.prototype.getDefaultShape=function(){return new AT},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r0||0,0),o=Math.max(t.r,0),a=.5*(o-i),s=i+a,l=t.startAngle,u=t.endAngle,c=t.clockwise,h=2*Math.PI,d=c?u-l<h:l-u<h;d||(l=u-(c?h:-h));var p=Math.cos(l),f=Math.sin(l),g=Math.cos(u),m=Math.sin(u);d?(e.moveTo(p*i+n,f*i+r),e.arc(p*s+n,f*s+r,a,-Math.PI+l,l,!c)):e.moveTo(p*o+n,f*o+r),e.arc(n,r,o,l,u,!c),e.arc(g*s+n,m*s+r,a,u-2*Math.PI,u-Math.PI,!c),0!==i&&e.arc(n,r,i,u,l,c)},t}(Ys);function ET(e,t,n){return t*Math.sin(e)*(n?-1:1)}function LT(e,t,n){return t*Math.cos(e)*(n?1:-1)}function NT(e,t,n){var r=e.get("borderRadius");if(null==r)return n?{cornerRadius:0}:null;J(r)||(r=[r,r,r,r]);var i=Math.abs(t.r||0-t.r0||0);return{cornerRadius:j(r,(function(e){return Ri(e,i)}))}}var PT=Math.max,OT=Math.min;var RT=function(e){function t(){var n=e.call(this)||this;return n.type=t.type,n._isFirstFrame=!0,n}return l(t,e),t.prototype.render=function(e,t,n,r){this._model=e,this._removeOnRenderedListener(n),this._updateDrawMode(e);var i=e.get("coordinateSystem");"cartesian2d"===i||"polar"===i?(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(e,t,n):this._renderNormal(e,t,n,r)):"production"!==process.env.NODE_ENV&&No("Only cartesian2d and polar supported for bar.")},t.prototype.incrementalPrepareRender=function(e){this._clear(),this._updateDrawMode(e),this._updateLargeClip(e)},t.prototype.incrementalRender=function(e,t){this._progressiveEls=[],this._incrementalRenderLarge(e,t)},t.prototype.eachRendered=function(e){gh(this._progressiveEls||this.group,e)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;null!=this._isLargeDraw&&t===this._isLargeDraw||(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e,t,n,r){var i,o=this.group,a=e.getData(),s=this._data,l=e.coordinateSystem,u=l.getBaseAxis();"cartesian2d"===l.type?i=u.isHorizontal():"polar"===l.type&&(i="angle"===u.dim);var c=e.isAnimationEnabled()?e:null,h=function(e,t){var n=e.get("realtimeSort",!0),r=t.getBaseAxis();"production"!==process.env.NODE_ENV&&n&&("category"!==r.type&&No("`realtimeSort` will not work because this bar series is not based on a category axis."),"cartesian2d"!==t.type&&No("`realtimeSort` will not work because this bar series is not on cartesian2d."));if(n&&"category"===r.type&&"cartesian2d"===t.type)return{baseAxis:r,otherAxis:t.getOtherAxis(r)}}(e,l);h&&this._enableRealtimeSort(h,a,n);var d=e.get("clip",!0)||h,p=function(e,t){var n=e.getArea&&e.getArea();if(uT(e,"cartesian2d")){var r=e.getBaseAxis();if("category"!==r.type||!r.onBand){var i=t.getLayout("bandWidth");r.isHorizontal()?(n.x-=i,n.width+=2*i):(n.y-=i,n.height+=2*i)}}return n}(l,a);o.removeClipPath();var f=e.get("roundCap",!0),g=e.get("showBackground",!0),m=e.getModel("backgroundStyle"),v=m.get("borderRadius")||0,y=[],_=this._backgroundEls,x=r&&r.isInitSort,b=r&&"changeAxisOrder"===r.type;function w(e){var t=UT[l.type](a,e),n=function(e,t,n){var r="polar"===e.type?rc:ol;return new r({shape:KT(t,n,e),silent:!0,z2:0})}(l,i,t);return n.useStyle(m.getItemStyle()),"cartesian2d"===l.type?n.setShape("r",v):n.setShape("cornerRadius",v),y[e]=n,n}a.diff(s).add((function(t){var n=a.getItemModel(t),r=UT[l.type](a,t,n);if(g&&w(t),a.hasValue(t)&&HT[l.type](r)){var s=!1;d&&(s=kT[l.type](p,r));var m=zT[l.type](e,a,t,r,i,c,u.model,!1,f);h&&(m.forceLabelAnimation=!0),jT(m,a,t,n,r,e,i,"polar"===l.type),x?m.attr({shape:r}):h?VT(h,c,m,r,t,i,!1,!1):Rc(m,{shape:r},e,t),a.setItemGraphicEl(t,m),o.add(m),m.ignore=s}})).update((function(t,n){var r=a.getItemModel(t),S=UT[l.type](a,t,r);if(g){var T=void 0;0===_.length?T=w(n):((T=_[n]).useStyle(m.getItemStyle()),"cartesian2d"===l.type?T.setShape("r",v):T.setShape("cornerRadius",v),y[t]=T);var M=UT[l.type](a,t);Oc(T,{shape:KT(i,M,l)},c,t)}var C=s.getItemGraphicEl(n);if(a.hasValue(t)&&HT[l.type](S)){var D=!1;if(d&&(D=kT[l.type](p,S))&&o.remove(C),C?Fc(C):C=zT[l.type](e,a,t,S,i,c,u.model,!!C,f),h&&(C.forceLabelAnimation=!0),b){var A=C.getTextContent();if(A){var I=Ih(A);null!=I.prevValue&&(I.prevValue=I.value)}}else jT(C,a,t,r,S,e,i,"polar"===l.type);x?C.attr({shape:S}):h?VT(h,c,C,S,t,i,!0,b):Oc(C,{shape:S},e,t,null),a.setItemGraphicEl(t,C),C.ignore=D,o.add(C)}else o.remove(C)})).remove((function(t){var n=s.getItemGraphicEl(t);n&&Bc(n,e,t)})).execute();var S=this._backgroundGroup||(this._backgroundGroup=new Yi);S.removeAll();for(var T=0;T<y.length;++T)S.add(y[T]);o.add(S),this._backgroundEls=y,this._data=a},t.prototype._renderLarge=function(e,t,n){this._clear(),ZT(e,this.group),this._updateLargeClip(e)},t.prototype._incrementalRenderLarge=function(e,t){this._removeBackground(),ZT(t,this.group,this._progressiveEls,!0)},t.prototype._updateLargeClip=function(e){var t=e.get("clip",!0)&&lT(e.coordinateSystem,!1,e),n=this.group;t?n.setClipPath(t):n.removeClipPath()},t.prototype._enableRealtimeSort=function(e,t,n){var r=this;if(t.count()){var i=e.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(t,e,n),this._isFirstFrame=!1;else{var o=function(e){var n=t.getItemGraphicEl(e),r=n&&n.shape;return r&&Math.abs(i.isHorizontal()?r.height:r.width)||0};this._onRendered=function(){r._updateSortWithinSameData(t,o,i,n)},n.getZr().on("rendered",this._onRendered)}}},t.prototype._dataSort=function(e,t,n){var r=[];return e.each(e.mapDimension(t.dim),(function(e,t){var i=n(t);i=null==i?NaN:i,r.push({dataIndex:t,mappedValue:i,ordinalNumber:e})})),r.sort((function(e,t){return t.mappedValue-e.mappedValue})),{ordinalNumbers:j(r,(function(e){return e.ordinalNumber}))}},t.prototype._isOrderChangedWithinSameData=function(e,t,n){for(var r=n.scale,i=e.mapDimension(n.dim),o=Number.MAX_VALUE,a=0,s=r.getOrdinalMeta().categories.length;a<s;++a){var l=e.rawIndexOf(i,r.getRawOrdinalNumber(a)),u=l<0?Number.MIN_VALUE:t(e.indexOfRawIndex(l));if(u>o)return!0;o=u}return!1},t.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,r=n.getExtent(),i=Math.max(0,r[0]),o=Math.min(r[1],n.getOrdinalMeta().categories.length-1);i<=o;++i)if(e.ordinalNumbers[i]!==n.getRawOrdinalNumber(i))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,r){if(this._isOrderChangedWithinSameData(e,t,n)){var i=this._dataSort(e,n,t);this._isOrderDifferentInView(i,n)&&(this._removeOnRenderedListener(r),r.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:i}))}},t.prototype._dispatchInitSort=function(e,t,n){var r=t.baseAxis,i=this._dataSort(e,r,(function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)}));n.dispatchAction({type:"changeAxisOrder",componentType:r.dim+"Axis",isInitSort:!0,axisId:r.index,sortInfo:i})},t.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},t.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&(e.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(e){var t=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl((function(t){Bc(t,e,bl(t).dataIndex)}))):t.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t}(em),kT={cartesian2d:function(e,t){var n=t.width<0?-1:1,r=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,o=e.y+e.height,a=PT(t.x,e.x),s=OT(t.x+t.width,i),l=PT(t.y,e.y),u=OT(t.y+t.height,o),c=s<a,h=u<l;return t.x=c&&a>i?s:a,t.y=h&&l>o?u:l,t.width=c?0:s-a,t.height=h?0:u-l,n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height),c||h},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}var i=OT(t.r,e.r),o=PT(t.r0,e.r0);t.r=i,t.r0=o;var a=i-o<0;if(n<0){r=t.r;t.r=t.r0,t.r0=r}return a}},zT={cartesian2d:function(e,t,n,r,i,o,a,s,l){var u=new ol({shape:z({},r),z2:1});(u.__dataIndex=n,u.name="item",o)&&(u.shape[i?"height":"width"]=0);return u},polar:function(e,t,n,r,i,o,a,s,l){var u=!i&&l?IT:rc,c=new u({shape:r,z2:1});c.name="item";var h,d,p=WT(i);if(c.calculateTextPosition=(h=p,d=({isRoundCap:u===IT}||{}).isRoundCap,function(e,t,n){var r=t.position;if(!r||r instanceof Array)return ki(e,t,n);var i=h(r),o=null!=t.distance?t.distance:5,a=this.shape,s=a.cx,l=a.cy,u=a.r,c=a.r0,p=(u+c)/2,f=a.startAngle,g=a.endAngle,m=(f+g)/2,v=d?Math.abs(u-c)/2:0,y=Math.cos,_=Math.sin,x=s+u*y(f),b=l+u*_(f),w="left",S="top";switch(i){case"startArc":x=s+(c-o)*y(m),b=l+(c-o)*_(m),w="center",S="top";break;case"insideStartArc":x=s+(c+o)*y(m),b=l+(c+o)*_(m),w="center",S="bottom";break;case"startAngle":x=s+p*y(f)+ET(f,o+v,!1),b=l+p*_(f)+LT(f,o+v,!1),w="right",S="middle";break;case"insideStartAngle":x=s+p*y(f)+ET(f,-o+v,!1),b=l+p*_(f)+LT(f,-o+v,!1),w="left",S="middle";break;case"middle":x=s+p*y(m),b=l+p*_(m),w="center",S="middle";break;case"endArc":x=s+(u+o)*y(m),b=l+(u+o)*_(m),w="center",S="bottom";break;case"insideEndArc":x=s+(u-o)*y(m),b=l+(u-o)*_(m),w="center",S="top";break;case"endAngle":x=s+p*y(g)+ET(g,o+v,!0),b=l+p*_(g)+LT(g,o+v,!0),w="left",S="middle";break;case"insideEndAngle":x=s+p*y(g)+ET(g,-o+v,!0),b=l+p*_(g)+LT(g,-o+v,!0),w="right",S="middle";break;default:return ki(e,t,n)}return(e=e||{}).x=x,e.y=b,e.align=w,e.verticalAlign=S,e}),o){var f=i?"r":"endAngle",g={};c.shape[f]=i?r.r0:r.startAngle,g[f]=r[f],(s?Oc:Rc)(c,{shape:g},o)}return c}};function VT(e,t,n,r,i,o,a,s){var l,u;o?(u={x:r.x,width:r.width},l={y:r.y,height:r.height}):(u={y:r.y,height:r.height},l={x:r.x,width:r.width}),s||(a?Oc:Rc)(n,{shape:l},t,i,null),(a?Oc:Rc)(n,{shape:u},t?e.baseAxis.model:null,i)}function BT(e,t){for(var n=0;n<t.length;n++)if(!isFinite(e[t[n]]))return!0;return!1}var FT=["x","y","width","height"],GT=["cx","cy","r","startAngle","endAngle"],HT={cartesian2d:function(e){return!BT(e,FT)},polar:function(e){return!BT(e,GT)}},UT={cartesian2d:function(e,t,n){var r=e.getItemLayout(t),i=n?function(e,t){var n=e.get(["itemStyle","borderColor"]);if(!n||"none"===n)return 0;var r=e.get(["itemStyle","borderWidth"])||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),o=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(r,i,o)}(n,r):0,o=r.width>0?1:-1,a=r.height>0?1:-1;return{x:r.x+o*i/2,y:r.y+a*i/2,width:r.width-o*i,height:r.height-a*i}},polar:function(e,t,n){var r=e.getItemLayout(t);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function WT(e){return function(e){var t=e?"Arc":"Angle";return function(e){switch(e){case"start":case"insideStart":case"end":case"insideEnd":return e+t;default:return e}}}(e)}function jT(e,t,n,r,i,o,a,s){var l=t.getItemVisual(n,"style");if(s){if(!o.get("roundCap")){var u=e.shape;z(u,NT(r.getModel("itemStyle"),u,!0)),e.setShape(u)}}else{var c=r.get(["itemStyle","borderRadius"])||0;e.setShape("r",c)}e.useStyle(l);var h=r.getShallow("cursor");h&&e.attr("cursor",h);var d=s?a?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":a?i.height>=0?"bottom":"top":i.width>=0?"right":"left",p=bh(r);xh(e,p,{labelFetcher:o,labelDataIndex:n,defaultText:HS(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var f=e.getTextContent();if(s&&f){var g=r.get(["label","position"]);e.textConfig.inside="middle"===g||null,function(e,t,n,r){if(ne(r))e.setTextConfig({rotation:r});else if(J(t))e.setTextConfig({rotation:0});else{var i,o=e.shape,a=o.clockwise?o.startAngle:o.endAngle,s=o.clockwise?o.endAngle:o.startAngle,l=(a+s)/2,u=n(t);switch(u){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":i=l;break;case"startAngle":case"insideStartAngle":i=a;break;case"endAngle":case"insideEndAngle":i=s;break;default:return void e.setTextConfig({rotation:0})}var c=1.5*Math.PI-i;"middle"===u&&c>Math.PI/2&&c<1.5*Math.PI&&(c-=Math.PI),e.setTextConfig({rotation:c})}}(e,"outside"===g?d:g,WT(a),r.get(["label","rotate"]))}Eh(f,p,o.getRawValue(n),(function(e){return US(t,e)}));var m=r.getModel(["emphasis"]);cu(e,m.get("focus"),m.get("blurScope"),m.get("disabled")),fu(e,r),function(e){return null!=e.startAngle&&null!=e.endAngle&&e.startAngle===e.endAngle}(i)&&(e.style.fill="none",e.style.stroke="none",W(e.states,(function(e){e.style&&(e.style.fill=e.style.stroke="none")})))}var XT=function(){},YT=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeBar",n}return l(t,e),t.prototype.getDefaultShape=function(){return new XT},t.prototype.buildPath=function(e,t){for(var n=t.points,r=this.baseDimIdx,i=1-this.baseDimIdx,o=[],a=[],s=this.barWidth,l=0;l<n.length;l+=3)a[r]=s,a[i]=n[l+2],o[r]=n[l+r],o[i]=n[l+i],e.rect(o[0],o[1],a[0],a[1])},t}(Ys);function ZT(e,t,n,r){var i=e.getData(),o=i.getLayout("valueAxisHorizontal")?1:0,a=i.getLayout("largeDataIndices"),s=i.getLayout("size"),l=e.getModel("backgroundStyle"),u=i.getLayout("largeBackgroundPoints");if(u){var c=new YT({shape:{points:u},incremental:!!r,silent:!0,z2:0});c.baseDimIdx=o,c.largeDataIndices=a,c.barWidth=s,c.useStyle(l.getItemStyle()),t.add(c),n&&n.push(c)}var h=new YT({shape:{points:i.getLayout("largePoints")},incremental:!!r,ignoreCoarsePointer:!0,z2:1});h.baseDimIdx=o,h.largeDataIndices=a,h.barWidth=s,t.add(h),h.useStyle(i.getVisual("style")),bl(h).seriesIndex=e.seriesIndex,e.get("silent")||(h.on("mousedown",qT),h.on("mousemove",qT)),n&&n.push(h)}var qT=um((function(e){var t=function(e,t,n){for(var r=e.baseDimIdx,i=1-r,o=e.shape.points,a=e.largeDataIndices,s=[],l=[],u=e.barWidth,c=0,h=o.length/3;c<h;c++){var d=3*c;if(l[r]=u,l[i]=o[d+2],s[r]=o[d+r],s[i]=o[d+i],l[i]<0&&(s[i]+=l[i],l[i]=-l[i]),t>=s[0]&&t<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return a[c]}return-1}(this,e.offsetX,e.offsetY);bl(this).dataIndex=t>=0?t:null}),30,!1);function KT(e,t,n){if(uT(n,"cartesian2d")){var r=t,i=n.getArea();return{x:e?r.x:i.x,y:e?i.y:r.y,width:e?r.width:i.width,height:e?i.height:r.height}}var o=t;return{cx:(i=n.getArea()).cx,cy:i.cy,r0:e?i.r0:o.r0,r:e?i.r:o.r,startAngle:e?o.startAngle:0,endAngle:e?o.endAngle:2*Math.PI}}var $T=2*Math.PI,JT=Math.PI/180;function QT(e,t){return Zd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function eM(e,t){var n=QT(e,t),r=e.get("center"),i=e.get("radius");J(i)||(i=[0,i]);var o,a,s=oo(n.width,t.getWidth()),l=oo(n.height,t.getHeight()),u=Math.min(s,l),c=oo(i[0],u/2),h=oo(i[1],u/2),d=e.coordinateSystem;if(d){var p=d.dataToPoint(r);o=p[0]||0,a=p[1]||0}else J(r)||(r=[r,r]),o=oo(r[0],s)+n.x,a=oo(r[1],l)+n.y;return{cx:o,cy:a,r0:c,r:h}}function tM(e,t,n){t.eachSeriesByType(e,(function(e){var t=e.getData(),r=t.mapDimension("value"),i=QT(e,n),o=eM(e,n),a=o.cx,s=o.cy,l=o.r,u=o.r0,c=-e.get("startAngle")*JT,h=e.get("endAngle"),d=e.get("padAngle")*JT;h="auto"===h?c-$T:-h*JT;var p=e.get("minAngle")*JT+d,f=0;t.each(r,(function(e){!isNaN(e)&&f++}));var g=t.getSum(r),m=Math.PI/(g||f)*2,v=e.get("clockwise"),y=e.get("roseType"),_=e.get("stillShowZeroSum"),x=t.getDataExtent(r);x[0]=0;var b=v?1:-1,w=[c,h],S=b*d/2;Cs(w,!v),c=w[0],h=w[1];var T=nM(e);T.startAngle=c,T.endAngle=h,T.clockwise=v;var M=Math.abs(h-c),C=M,D=0,A=c;if(t.setLayout({viewRect:i,r:l}),t.each(r,(function(e,n){var r;if(isNaN(e))t.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:v,cx:a,cy:s,r0:u,r:y?NaN:l});else{(r="area"!==y?0===g&&_?m:e*m:M/f)<p?(r=p,C-=p):D+=e;var i=A+b*r,o=0,c=0;d>r?c=o=A+b*r/2:(o=A+S,c=i-S),t.setItemLayout(n,{angle:r,startAngle:o,endAngle:c,clockwise:v,cx:a,cy:s,r0:u,r:y?io(e,x,[u,l]):l}),A=i}})),C<$T&&f)if(C<=.001){var I=M/f;t.each(r,(function(e,n){if(!isNaN(e)){var r=t.getItemLayout(n);r.angle=I;var i=0,o=0;I<d?o=i=c+b*(n+.5)*I:(i=c+b*n*I+S,o=c+b*(n+1)*I-S),r.startAngle=i,r.endAngle=o}}))}else m=C/D,A=c,t.each(r,(function(e,n){if(!isNaN(e)){var r=t.getItemLayout(n),i=r.angle===p?p:e*m,o=0,a=0;i<d?a=o=A+b*i/2:(o=A+S,a=A+b*i-S),r.startAngle=o,r.endAngle=a,A+=b*i}}))}))}var nM=ta();function rM(e){return{seriesType:e,reset:function(e,t){var n=t.findComponents({mainType:"legend"});if(n&&n.length){var r=e.getData();r.filterSelf((function(e){for(var t=r.getName(e),i=0;i<n.length;i++)if(!n[i].isSelected(t))return!1;return!0}))}}}}var iM=Math.PI/180;function oM(e,t,n,r,i,o,a,s,l,u){if(!(e.length<2)){for(var c=e.length,h=0;h<c;h++)if("outer"===e[h].position&&"labelLine"===e[h].labelAlignTo){var d=e[h].label.x-u;e[h].linePoints[1][0]+=d,e[h].label.x=u}lw(e,l,l+a)&&function(e){for(var o={list:[],maxY:0},a={list:[],maxY:0},s=0;s<e.length;s++)if("none"===e[s].labelAlignTo){var l=e[s],u=l.label.y>n?a:o,c=Math.abs(l.label.y-n);if(c>=u.maxY){var h=l.label.x-t-l.len2*i,d=r+l.len,f=Math.abs(h)<d?Math.sqrt(c*c/(1-h*h/d/d)):d;u.rB=f,u.maxY=c}u.list.push(l)}p(o),p(a)}(e)}function p(e){for(var o=e.rB,a=o*o,s=0;s<e.list.length;s++){var l=e.list[s],u=Math.abs(l.label.y-n),c=r+l.len,h=c*c,d=Math.sqrt((1-Math.abs(u*u/a))*h),p=t+(d+l.len2)*i,f=p-l.label.x;aM(l,l.targetTextWidth-f*i,!0),l.label.x=p}}}function aM(e,t,n){if(void 0===n&&(n=!1),null==e.labelStyleWidth){var r=e.label,i=r.style,o=e.rect,a=i.backgroundColor,s=i.padding,l=s?s[1]+s[3]:0,u=i.overflow,c=o.width+(a?0:l);if(t<c||n){var h=o.height;if(u&&u.match("break")){r.setStyle("backgroundColor",null),r.setStyle("width",t-l);var d=r.getBoundingRect();r.setStyle("width",Math.ceil(d.width)),r.setStyle("backgroundColor",a)}else{var p=t-l,f=t<c?p:n?p>e.unconstrainedWidth?null:p:null;r.setStyle("width",f)}var g=r.getBoundingRect();o.width=g.width;var m=(r.style.margin||0)+2.1;o.height=g.height+m,o.y-=(o.height-h)/2}}}function sM(e){return"center"===e.position}function lM(e){var t,n,r=e.getData(),i=[],o=!1,a=(e.get("minShowLabelAngle")||0)*iM,s=r.getLayout("viewRect"),l=r.getLayout("r"),u=s.width,c=s.x,h=s.y,d=s.height;function p(e){e.ignore=!0}r.each((function(e){var s=r.getItemGraphicEl(e),h=s.shape,d=s.getTextContent(),f=s.getTextGuideLine(),g=r.getItemModel(e),m=g.getModel("label"),v=m.get("position")||g.get(["emphasis","label","position"]),y=m.get("distanceToLabelLine"),_=m.get("alignTo"),x=oo(m.get("edgeDistance"),u),b=m.get("bleedMargin"),w=g.getModel("labelLine"),S=w.get("length");S=oo(S,u);var T=w.get("length2");if(T=oo(T,u),Math.abs(h.endAngle-h.startAngle)<a)return W(d.states,p),d.ignore=!0,void(f&&(W(f.states,p),f.ignore=!0));if(function(e){if(!e.ignore)return!0;for(var t in e.states)if(!1===e.states[t].ignore)return!0;return!1}(d)){var M,C,D,A,I=(h.startAngle+h.endAngle)/2,E=Math.cos(I),L=Math.sin(I);t=h.cx,n=h.cy;var N="inside"===v||"inner"===v;if("center"===v)M=h.cx,C=h.cy,A="center";else{var P=(N?(h.r+h.r0)/2*E:h.r*E)+t,O=(N?(h.r+h.r0)/2*L:h.r*L)+n;if(M=P+3*E,C=O+3*L,!N){var R=P+E*(S+l-h.r),k=O+L*(S+l-h.r),z=R+(E<0?-1:1)*T;M="edge"===_?E<0?c+x:c+u-x:z+(E<0?-y:y),C=k,D=[[P,O],[R,k],[z,k]]}A=N?"center":"edge"===_?E>0?"right":"left":E>0?"left":"right"}var V=Math.PI,B=0,F=m.get("rotate");if(ne(F))B=F*(V/180);else if("center"===v)B=0;else if("radial"===F||!0===F){B=E<0?-I+V:-I}else if("tangential"===F&&"outside"!==v&&"outer"!==v){var G=Math.atan2(E,L);G<0&&(G=2*V+G),L>0&&(G=V+G),B=G-V}if(o=!!B,d.x=M,d.y=C,d.rotation=B,d.setStyle({verticalAlign:"middle"}),N){d.setStyle({align:A});var H=d.states.select;H&&(H.x+=d.x,H.y+=d.y)}else{var U=d.getBoundingRect().clone();U.applyTransform(d.getComputedTransform());var j=(d.style.margin||0)+2.1;U.y-=j/2,U.height+=j,i.push({label:d,labelLine:f,position:v,len:S,len2:T,minTurnAngle:w.get("minTurnAngle"),maxSurfaceAngle:w.get("maxSurfaceAngle"),surfaceNormal:new kt(E,L),linePoints:D,textAlign:A,labelDistance:y,labelAlignTo:_,edgeDistance:x,bleedMargin:b,rect:U,unconstrainedWidth:U.width,labelStyleWidth:d.style.width})}s.setTextConfig({inside:N})}})),!o&&e.get("avoidLabelOverlap")&&function(e,t,n,r,i,o,a,s){for(var l=[],u=[],c=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=0;d<e.length;d++){var p=e[d].label;sM(e[d])||(p.x<t?(c=Math.min(c,p.x),l.push(e[d])):(h=Math.max(h,p.x),u.push(e[d])))}for(d=0;d<e.length;d++)if(!sM(m=e[d])&&m.linePoints){if(null!=m.labelStyleWidth)continue;p=m.label;var f=m.linePoints,g=void 0;g="edge"===m.labelAlignTo?p.x<t?f[2][0]-m.labelDistance-a-m.edgeDistance:a+i-m.edgeDistance-f[2][0]-m.labelDistance:"labelLine"===m.labelAlignTo?p.x<t?c-a-m.bleedMargin:a+i-h-m.bleedMargin:p.x<t?p.x-a-m.bleedMargin:a+i-p.x-m.bleedMargin,m.targetTextWidth=g,aM(m,g)}for(oM(u,t,n,r,1,0,o,0,s,h),oM(l,t,n,r,-1,0,o,0,s,c),d=0;d<e.length;d++){var m;if(!sM(m=e[d])&&m.linePoints){p=m.label,f=m.linePoints;var v="edge"===m.labelAlignTo,y=p.style.padding,_=y?y[1]+y[3]:0,x=p.style.backgroundColor?0:_,b=m.rect.width+x,w=f[1][0]-f[2][0];v?p.x<t?f[2][0]=a+m.edgeDistance+b+m.labelDistance:f[2][0]=a+i-m.edgeDistance-b-m.labelDistance:(p.x<t?f[2][0]=p.x+m.labelDistance:f[2][0]=p.x-m.labelDistance,f[1][0]=f[2][0]+w),f[1][1]=f[2][1]=p.y}}}(i,t,n,l,u,d,c,h);for(var f=0;f<i.length;f++){var g=i[f],m=g.label,v=g.labelLine,y=isNaN(m.x)||isNaN(m.y);if(m){m.setStyle({align:g.textAlign}),y&&(W(m.states,p),m.ignore=!0);var _=m.states.select;_&&(_.x+=m.x,_.y+=m.y)}if(v){var x=g.linePoints;y||!x?(W(v.states,p),v.ignore=!0):(ew(x,g.minTurnAngle),tw(x,g.surfaceNormal,g.maxSurfaceAngle),v.setShape({points:x}),m.__hostTarget.textGuideLineConfig={anchor:new kt(x[0][0],x[0][1])})}}}var uM=function(e){function t(t,n,r){var i=e.call(this)||this;i.z2=2;var o=new ll;return i.setTextContent(o),i.updateData(t,n,r,!0),i}return l(t,e),t.prototype.updateData=function(e,t,n,r){var i=this,o=e.hostModel,a=e.getItemModel(t),s=a.getModel("emphasis"),l=e.getItemLayout(t),u=z(NT(a.getModel("itemStyle"),l,!0),l);if(isNaN(u.startAngle))i.setShape(u);else{if(r){i.setShape(u);var c=o.getShallow("animationType");o.ecModel.ssr?(Rc(i,{scaleX:0,scaleY:0},o,{dataIndex:t,isFrom:!0}),i.originX=u.cx,i.originY=u.cy):"scale"===c?(i.shape.r=l.r0,Rc(i,{shape:{r:l.r}},o,t)):null!=n?(i.setShape({startAngle:n,endAngle:n}),Rc(i,{shape:{startAngle:l.startAngle,endAngle:l.endAngle}},o,t)):(i.shape.endAngle=l.startAngle,Oc(i,{shape:{endAngle:l.endAngle}},o,t))}else Fc(i),Oc(i,{shape:u},o,t);i.useStyle(e.getItemVisual(t,"style")),fu(i,a);var h=(l.startAngle+l.endAngle)/2,d=o.get("selectedOffset"),p=Math.cos(h)*d,f=Math.sin(h)*d,g=a.getShallow("cursor");g&&i.attr("cursor",g),this._updateLabel(o,e,t),i.ensureState("emphasis").shape=z({r:l.r+(s.get("scale")&&s.get("scaleSize")||0)},NT(s.getModel("itemStyle"),l)),z(i.ensureState("select"),{x:p,y:f,shape:NT(a.getModel(["select","itemStyle"]),l)}),z(i.ensureState("blur"),{shape:NT(a.getModel(["blur","itemStyle"]),l)});var m=i.getTextGuideLine(),v=i.getTextContent();m&&z(m.ensureState("select"),{x:p,y:f}),z(v.ensureState("select"),{x:p,y:f}),cu(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))}},t.prototype._updateLabel=function(e,t,n){var r=this,i=t.getItemModel(n),o=i.getModel("labelLine"),a=t.getItemVisual(n,"style"),s=a&&a.fill,l=a&&a.opacity;xh(r,bh(i),{labelFetcher:t.hostModel,labelDataIndex:n,inheritColor:s,defaultOpacity:l,defaultText:e.getFormattedLabel(n,"normal")||t.getName(n)});var u=r.getTextContent();r.setTextConfig({position:null,rotation:null}),u.attr({z2:10});var c=e.get(["label","position"]);if("outside"!==c&&"outer"!==c)r.removeTextGuideLine();else{var h=this.getTextGuideLine();h||(h=new cc,this.setTextGuideLine(h)),iw(this,ow(i),{stroke:s,opacity:pe(o.get(["lineStyle","opacity"]),l,1)})}},t}(rc),cM=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}return l(t,e),t.prototype.render=function(e,t,n,r){var i,o=e.getData(),a=this._data,s=this.group;if(!a&&o.count()>0){for(var l=o.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u<o.count();++u)l=o.getItemLayout(u);l&&(i=l.startAngle)}if(this._emptyCircleSector&&s.remove(this._emptyCircleSector),0===o.count()&&e.get("showEmptyCircle")){var c=nM(e),h=new rc({shape:z(eM(e,n),c)});h.useStyle(e.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=h,s.add(h)}o.diff(a).add((function(e){var t=new uM(o,e,i);o.setItemGraphicEl(e,t),s.add(t)})).update((function(e,t){var n=a.getItemGraphicEl(t);n.updateData(o,e,i),n.off("click"),s.add(n),o.setItemGraphicEl(e,n)})).remove((function(t){Bc(a.getItemGraphicEl(t),e,t)})).execute(),lM(e),"expansion"!==e.get("animationTypeUpdate")&&(this._data=o)},t.prototype.dispose=function(){},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var r=e[0]-n.cx,i=e[1]-n.cy,o=Math.sqrt(r*r+i*i);return o<=n.r&&o>=n.r0}},t.type="pie",t}(em);function hM(e,t,n){t=J(t)&&{coordDimensions:t}||z({encodeDefine:e.getEncode()},t);var r=e.getSource(),i=z_(r,t).dimensions,o=new R_(i,e);return o.initData(r,n),o}var dM=function(){function e(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return e.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},e.prototype.containName=function(e){return this._getRawData().indexOfName(e)>=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}(),pM=ta(),fM=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new dM(K(this.getData,this),K(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return hM(this,{coordDimensions:["value"],encodeDefaulter:$(_p,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),r=pM(n),i=r.seats;if(!i){var o=[];n.each(n.mapDimension("value"),(function(e){o.push(e)})),i=r.seats=ho(o,n.hostModel.get("percentPrecision"))}var a=e.prototype.getDataParams.call(this,t);return a.percent=i[t]||0,a.$vars.push("percent"),a},t.prototype._defaultLabelLine=function(e){Ho(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(Hg);var gM=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return l(t,e),t.prototype.getInitialData=function(e,t){return j_(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){var e=this.option.progressive;return null==e?this.option.large?5e3:this.get("progressive"):e},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?1e4:this.get("progressiveThreshold"):e},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},t.type="series.scatter",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},t}(Hg),mM=function(){},vM=function(e){function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return l(t,e),t.prototype.getDefaultShape=function(){return new mM},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.buildPath=function(e,t){var n,r=t.points,i=t.size,o=this.symbolProxy,a=o.shape,s=e.getContext?e.getContext():e,l=s&&i[0]<4,u=this.softClipShape;if(l)this._ctx=s;else{for(this._ctx=null,n=this._off;n<r.length;){var c=r[n++],h=r[n++];isNaN(c)||isNaN(h)||(u&&!u.contain(c,h)||(a.x=c-i[0]/2,a.y=h-i[1]/2,a.width=i[0],a.height=i[1],o.buildPath(e,a,!0)))}this.incremental&&(this._off=n,this.notClear=!0)}},t.prototype.afterBrush=function(){var e,t=this.shape,n=t.points,r=t.size,i=this._ctx,o=this.softClipShape;if(i){for(e=this._off;e<n.length;){var a=n[e++],s=n[e++];isNaN(a)||isNaN(s)||(o&&!o.contain(a,s)||i.fillRect(a-r[0]/2,s-r[1]/2,r[0],r[1]))}this.incremental&&(this._off=e,this.notClear=!0)}},t.prototype.findDataIndex=function(e,t){for(var n=this.shape,r=n.points,i=n.size,o=Math.max(i[0],4),a=Math.max(i[1],4),s=r.length/2-1;s>=0;s--){var l=2*s,u=r[l]-o/2,c=r[l+1]-a/2;if(e>=u&&t>=c&&e<=u+o&&t<=c+a)return s}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect();return e=n[0],t=n[1],r.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape,n=t.points,r=t.size,i=r[0],o=r[1],a=1/0,s=1/0,l=-1/0,u=-1/0,c=0;c<n.length;){var h=n[c++],d=n[c++];a=Math.min(h,a),l=Math.max(h,l),s=Math.min(d,s),u=Math.max(d,u)}e=this._rect=new jt(a-i/2,s-o/2,l-a+i,u-s+o)}return e},t}(Ys),yM=function(){function e(){this.group=new Yi}return e.prototype.updateData=function(e,t){this._clear();var n=this._create();n.setShape({points:e.getLayout("points")}),this._setCommon(n,e,t)},e.prototype.updateLayout=function(e){var t=e.getLayout("points");this.group.eachChild((function(e){if(null!=e.startIndex){var n=2*(e.endIndex-e.startIndex),r=4*e.startIndex*2;t=new Float32Array(t.buffer,r,n)}e.setShape("points",t),e.reset()}))},e.prototype.incrementalPrepareUpdate=function(e){this._clear()},e.prototype.incrementalUpdate=function(e,t,n){var r=this._newAdded[0],i=t.getLayout("points"),o=r&&r.shape.points;if(o&&o.length<2e4){var a=o.length,s=new Float32Array(a+i.length);s.set(o),s.set(i,a),r.endIndex=e.end,r.setShape({points:s})}else{this._newAdded=[];var l=this._create();l.startIndex=e.start,l.endIndex=e.end,l.incremental=!0,l.setShape({points:i}),this._setCommon(l,t,n)}},e.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},e.prototype._create=function(){var e=new vM({cursor:"default"});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},e.prototype._setCommon=function(e,t,n){var r=t.hostModel;n=n||{};var i=t.getVisual("symbolSize");e.setShape("size",i instanceof Array?i:[i,i]),e.softClipShape=n.clipShape||null,e.symbolProxy=dv(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<4;e.useStyle(r.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var a=t.getVisual("style"),s=a&&a.fill;s&&e.setColor(s);var l=bl(e);l.seriesIndex=r.seriesIndex,e.on("mousemove",(function(t){l.dataIndex=null;var n=e.hoverDataIdx;n>=0&&(l.dataIndex=n+(e.startIndex||0))}))},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),_M=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).updateData(r,{clipShape:this._getClipShape(e)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).incrementalPrepareUpdate(r),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},t.prototype.updateTransform=function(e,t,n){var r=e.getData();if(this.group.dirty(),!this._finished||r.count()>1e4)return{update:!0};var i=wT("").reset(e,t,n);i.progress&&i.progress({start:0,end:r.count(),count:r.count()},r),this._symbolDraw.updateLayout(r)},t.prototype.eachRendered=function(e){this._symbolDraw&&this._symbolDraw.eachRendered(e)},t.prototype._getClipShape=function(e){if(e.get("clip",!0)){var t=e.coordinateSystem;return t&&t.getArea&&t.getArea(.1)}},t.prototype._updateSymbolDraw=function(e,t){var n=this._symbolDraw,r=t.pipelineContext.large;return n&&r===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=r?new yM:new qS,this._isLargeDraw=r,this.group.removeAll()),this.group.add(n.group),n},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type="scatter",t}(em),xM=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},t}(tp),bM=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",oa).models[0]},t.type="cartesian2dAxis",t}(tp);H(bM,Qx);var wM={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},SM=R({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},wM),TM=R({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},wM),MM={category:SM,value:TM,time:R({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},TM),log:V({logBase:10},TM)},CM={value:1,category:1,time:1,log:1};function DM(e,t,n,r){W(CM,(function(i,o){var a=R(R({},MM[o],!0),r,!0),s=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t+"Axis."+o,n}return l(n,e),n.prototype.mergeDefaultAndTheme=function(e,t){var n=Kd(this),r=n?Jd(e):{};R(e,t.getTheme().get(o+"Axis")),R(e,this.getDefaultOption()),e.type=AM(e),n&&$d(e,r,n)},n.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=Z_.createByAxisModel(this))},n.prototype.getCategories=function(e){var t=this.option;if("category"===t.type)return e?t.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.type=t+"Axis."+o,n.defaultOption=a,n}(n);e.registerComponentModel(s)})),e.registerSubTypeDefaulter(t+"Axis",AM)}function AM(e){return e.type||(e.data?"category":"value")}var IM=function(){function e(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return e.prototype.getAxis=function(e){return this._axes[e]},e.prototype.getAxes=function(){return j(this._dimList,(function(e){return this._axes[e]}),this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),Y(this.getAxes(),(function(t){return t.scale.type===e}))},e.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},e}(),EM=["x","y"];function LM(e){return"interval"===e.type||"time"===e.type}var NM=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=EM,t}return l(t,e),t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,t=this.getAxis("y").scale;if(LM(e)&&LM(t)){var n=e.getExtent(),r=t.getExtent(),i=this.dataToPoint([n[0],r[0]]),o=this.dataToPoint([n[1],r[1]]),a=n[1]-n[0],s=r[1]-r[0];if(a&&s){var l=(o[0]-i[0])/a,u=(o[1]-i[1])/s,c=i[0]-n[0]*l,h=i[1]-r[0]*u,d=this._transform=[l,0,0,u,c,h];this._invTransform=Pt([],d)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(e){var t=this.getAxis("x"),n=this.getAxis("y");return t.contain(t.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},t.prototype.containZone=function(e,t){var n=this.dataToPoint(e),r=this.dataToPoint(t),i=this.getArea(),o=new jt(n[0],n[1],r[0]-n[0],r[1]-n[1]);return i.intersect(o)},t.prototype.dataToPoint=function(e,t,n){n=n||[];var r=e[0],i=e[1];if(this._transform&&null!=r&&isFinite(r)&&null!=i&&isFinite(i))return Ke(n,e,this._transform);var o=this.getAxis("x"),a=this.getAxis("y");return n[0]=o.toGlobalCoord(o.dataToCoord(r,t)),n[1]=a.toGlobalCoord(a.dataToCoord(i,t)),n},t.prototype.clampData=function(e,t){var n=this.getAxis("x").scale,r=this.getAxis("y").scale,i=n.getExtent(),o=r.getExtent(),a=n.parse(e[0]),s=r.parse(e[1]);return(t=t||[])[0]=Math.min(Math.max(Math.min(i[0],i[1]),a),Math.max(i[0],i[1])),t[1]=Math.min(Math.max(Math.min(o[0],o[1]),s),Math.max(o[0],o[1])),t},t.prototype.pointToData=function(e,t){var n=[];if(this._invTransform)return Ke(n,e,this._invTransform);var r=this.getAxis("x"),i=this.getAxis("y");return n[0]=r.coordToData(r.toLocalCoord(e[0]),t),n[1]=i.coordToData(i.toLocalCoord(e[1]),t),n},t.prototype.getOtherAxis=function(e){return this.getAxis("x"===e.dim?"y":"x")},t.prototype.getArea=function(e){e=e||0;var t=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),r=Math.min(t[0],t[1])-e,i=Math.min(n[0],n[1])-e,o=Math.max(t[0],t[1])-r+e,a=Math.max(n[0],n[1])-i+e;return new jt(r,i,o,a)},t}(IM),PM=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r)||this;return a.index=0,a.type=i||"value",a.position=o||"bottom",a}return l(t,e),t.prototype.isHorizontal=function(){var e=this.position;return"top"===e||"bottom"===e},t.prototype.getGlobalExtent=function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},t.prototype.pointToData=function(e,t){return this.coordToData(this.toLocalCoord(e["x"===this.dim?0:1]),t)},t.prototype.setCategorySortInfo=function(e){if("category"!==this.type)return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(Ob);function OM(e,t,n){n=n||{};var r=e.coordinateSystem,i=t.axis,o={},a=i.getAxesOnZeroOf()[0],s=i.position,l=a?"onZero":s,u=i.dim,c=r.getRect(),h=[c.x,c.x+c.width,c.y,c.y+c.height],d={left:0,right:1,top:0,bottom:1,onZero:2},p=t.get("offset")||0,f="x"===u?[h[2]-p,h[3]+p]:[h[0]-p,h[1]+p];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));f[d.onZero]=Math.max(Math.min(g,f[1]),f[0])}o.position=["y"===u?f[d[l]]:h[0],"x"===u?f[d[l]]:h[3]],o.rotation=Math.PI/2*("x"===u?0:1);o.labelDirection=o.tickDirection=o.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],o.labelOffset=a?f[d[s]]-f[d.onZero]:0,t.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),he(n.labelInside,t.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var m=t.get(["axisLabel","rotate"]);return o.labelRotate="top"===l?-m:m,o.z2=1,o}function RM(e){return"cartesian2d"===e.get("coordinateSystem")}function kM(e){var t={xAxisModel:null,yAxisModel:null};return W(t,(function(n,r){var i=r.replace(/Model$/,""),o=e.getReferringComponents(i,oa).models[0];if("production"!==process.env.NODE_ENV&&!o)throw new Error(i+' "'+pe(e.get(i+"Index"),e.get(i+"Id"),0)+'" not found');t[r]=o})),t}var zM=Math.log;function VM(e,t,n){var r=ax.prototype,i=r.getTicks.call(n),o=r.getTicks.call(n,!0),a=i.length-1,s=r.getInterval.call(n),l=Wx(e,t),u=l.extent,c=l.fixMin,h=l.fixMax;if("log"===e.type){var d=zM(e.base);u=[zM(u[0])/d,zM(u[1])/d]}e.setExtent(u[0],u[1]),e.calcNiceExtent({splitNumber:a,fixMin:c,fixMax:h});var p=r.getExtent.call(e);c&&(u[0]=p[0]),h&&(u[1]=p[1]);var f=r.getInterval.call(e),g=u[0],m=u[1];if(c&&h)f=(m-g)/a;else if(c)for(m=u[0]+f*a;m<u[1]&&isFinite(m)&&isFinite(u[1]);)f=J_(f),m=u[0]+f*a;else if(h)for(g=u[1]-f*a;g>u[0]&&isFinite(g)&&isFinite(u[0]);)f=J_(f),g=u[1]-f*a;else{e.getTicks().length-1>a&&(f=J_(f));var v=f*a;(g=ao((m=Math.ceil(u[1]/f)*f)-v))<0&&u[0]>=0?(g=0,m=ao(v)):m>0&&u[1]<=0&&(m=0,g=-ao(v))}var y=(i[0].value-o[0].value)/s,_=(i[a].value-o[a].value)/s;if(r.setExtent.call(e,g+f*y,m+f*_),r.setInterval.call(e,f),(y||_)&&r.setNiceExtent.call(e,g+f,m-f),"production"!==process.env.NODE_ENV){var x=r.getTicks.call(e);x[1]&&(!function(e){var t=Math.pow(10,xo(Math.abs(e))),n=Math.abs(e/t);return 0===n||1===n||2===n||3===n||5===n}(f)||uo(x[1].value)>uo(f))&&No("The ticks may be not readable when set min: "+t.get("min")+", max: "+t.get("max")+" and alignTicks: true")}}var BM=function(){function e(e,t,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=EM,this._initCartesian(e,t,n),this.model=e}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(e,t){var n=this._axesMap;function r(e){var t,n=q(e),r=n.length;if(r){for(var i=[],o=r-1;o>=0;o--){var a=e[+n[o]],s=a.model,l=a.scale;K_(l)&&s.get("alignTicks")&&null==s.get("interval")?i.push(a):(jx(l,s),K_(l)&&(t=a))}i.length&&(t||jx((t=i.pop()).scale,t.model),W(i,(function(e){VM(e.scale,e.model,t.scale)})))}}this._updateScale(e,this.model),r(n.x),r(n.y);var i={};W(n.x,(function(e){GM(n,"y",e,i)})),W(n.y,(function(e){GM(n,"x",e,i)})),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var r=e.getBoxLayoutParams(),i=!n&&e.get("containLabel"),o=Zd(r,{width:t.getWidth(),height:t.getHeight()});this._rect=o;var a=this._axesList;function s(){W(a,(function(e){var t=e.isHorizontal(),n=t?[0,o.width]:[0,o.height],r=e.inverse?1:0;e.setExtent(n[r],n[1-r]),function(e,t){var n=e.getExtent(),r=n[0]+n[1];e.toGlobalCoord="x"===e.dim?function(e){return e+t}:function(e){return r-e+t},e.toLocalCoord="x"===e.dim?function(e){return e-t}:function(e){return r-e+t}}(e,t?o.x:o.y)}))}s(),i&&(W(a,(function(e){if(!e.model.get(["axisLabel","inside"])){var t=function(e){var t=e.model,n=e.scale;if(t.get(["axisLabel","show"])&&!n.isBlank()){var r,i,o=n.getExtent();i=n instanceof ix?n.count():(r=n.getTicks()).length;var a,s=e.getLabelModel(),l=Yx(e),u=1;i>40&&(u=Math.ceil(i/40));for(var c=0;c<i;c+=u){var h=l(r?r[c]:{value:o[0]+c},c),d=qx(s.getTextRect(h),s.get("rotate")||0);a?a.union(d):a=d}return a}}(e);if(t){var n=e.isHorizontal()?"height":"width",r=e.model.get(["axisLabel","margin"]);o[n]-=t[n]+r,"top"===e.position?o.y+=t.height+r:"left"===e.position&&(o.x+=t.width+r)}}})),s()),W(this._coordsList,(function(e){e.calcAffineTransform()}))},e.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(null!=n)return n[t||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(e,t){if(null!=e&&null!=t){var n="x"+e+"y"+t;return this._coordsMap[n]}re(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var r=0,i=this._coordsList;r<i.length;r++)if(i[r].getAxis("x").index===e||i[r].getAxis("y").index===t)return i[r]},e.prototype.getCartesians=function(){return this._coordsList.slice()},e.prototype.convertToPixel=function(e,t,n){var r=this._findConvertTarget(t);return r.cartesian?r.cartesian.dataToPoint(n):r.axis?r.axis.toGlobalCoord(r.axis.dataToCoord(n)):null},e.prototype.convertFromPixel=function(e,t,n){var r=this._findConvertTarget(t);return r.cartesian?r.cartesian.pointToData(n):r.axis?r.axis.coordToData(r.axis.toLocalCoord(n)):null},e.prototype._findConvertTarget=function(e){var t,n,r=e.seriesModel,i=e.xAxisModel||r&&r.getReferringComponents("xAxis",oa).models[0],o=e.yAxisModel||r&&r.getReferringComponents("yAxis",oa).models[0],a=e.gridModel,s=this._coordsList;if(r)F(s,t=r.coordinateSystem)<0&&(t=null);else if(i&&o)t=this.getCartesian(i.componentIndex,o.componentIndex);else if(i)n=this.getAxis("x",i.componentIndex);else if(o)n=this.getAxis("y",o.componentIndex);else if(a){a.coordinateSystem===this&&(t=this._coordsList[0])}return{cartesian:t,axis:n}},e.prototype.containPoint=function(e){var t=this._coordsList[0];if(t)return t.containPoint(e)},e.prototype._initCartesian=function(e,t,n){var r=this,i=this,o={left:!1,right:!1,top:!1,bottom:!1},a={x:{},y:{}},s={x:0,y:0};if(t.eachComponent("xAxis",l("x"),this),t.eachComponent("yAxis",l("y"),this),!s.x||!s.y)return this._axesMap={},void(this._axesList=[]);function l(t){return function(n,r){if(FM(n,e)){var l=n.get("position");"x"===t?"top"!==l&&"bottom"!==l&&(l=o.bottom?"top":"bottom"):"left"!==l&&"right"!==l&&(l=o.left?"right":"left"),o[l]=!0;var u=new PM(t,Xx(n),[0,0],n.get("type"),l),c="category"===u.type;u.onBand=c&&n.get("boundaryGap"),u.inverse=n.get("inverse"),n.axis=u,u.model=n,u.grid=i,u.index=r,i._axesList.push(u),a[t][r]=u,s[t]++}}}this._axesMap=a,W(a.x,(function(t,n){W(a.y,(function(i,o){var a="x"+n+"y"+o,s=new NM(a);s.master=r,s.model=e,r._coordsMap[a]=s,r._coordsList.push(s),s.addAxis(t),s.addAxis(i)}))}))},e.prototype._updateScale=function(e,t){function n(e,t){W(Jx(e,t.dim),(function(n){t.scale.unionExtentFromData(e,n)}))}W(this._axesList,(function(e){if(e.scale.setExtent(1/0,-1/0),"category"===e.type){var t=e.model.get("categorySortInfo");e.scale.setSortInfo(t)}})),e.eachSeries((function(e){if(RM(e)){var r=kM(e),i=r.xAxisModel,o=r.yAxisModel;if(!FM(i,t)||!FM(o,t))return;var a=this.getCartesian(i.componentIndex,o.componentIndex),s=e.getData(),l=a.getAxis("x"),u=a.getAxis("y");n(s,l),n(s,u)}}),this)},e.prototype.getTooltipAxes=function(e){var t=[],n=[];return W(this.getCartesians(),(function(r){var i=null!=e&&"auto"!==e?r.getAxis(e):r.getBaseAxis(),o=r.getOtherAxis(i);F(t,i)<0&&t.push(i),F(n,o)<0&&n.push(o)})),{baseAxes:t,otherAxes:n}},e.create=function(t,n){var r=[];return t.eachComponent("grid",(function(i,o){var a=new e(i,t,n);a.name="grid_"+o,a.resize(i,n,!0),i.coordinateSystem=a,r.push(a)})),t.eachSeries((function(e){if(RM(e)){var t=kM(e),n=t.xAxisModel,r=t.yAxisModel,i=n.getCoordSysModel();if("production"!==process.env.NODE_ENV){if(!i)throw new Error('Grid "'+pe(n.get("gridIndex"),n.get("gridId"),0)+'" not found');if(n.getCoordSysModel()!==r.getCoordSysModel())throw new Error("xAxis and yAxis must use the same grid")}var o=i.coordinateSystem;e.coordinateSystem=o.getCartesian(n.componentIndex,r.componentIndex)}})),r},e.dimensions=EM,e}();function FM(e,t){return e.getCoordSysModel()===t}function GM(e,t,n,r){n.getAxesOnZeroOf=function(){return i?[i]:[]};var i,o=e[t],a=n.model,s=a.get(["axisLine","onZero"]),l=a.get(["axisLine","onZeroAxisIndex"]);if(s){if(null!=l)HM(o[l])&&(i=o[l]);else for(var u in o)if(o.hasOwnProperty(u)&&HM(o[u])&&!r[c(o[u])]){i=o[u];break}i&&(r[c(i)]=!0)}function c(e){return e.dim+"_"+e.index}}function HM(e){return e&&"category"!==e.type&&"time"!==e.type&&function(e){var t=e.scale.getExtent(),n=t[0],r=t[1];return!(n>0&&r>0||n<0&&r<0)}(e)}var UM=Math.PI,WM=function(){function e(e,t){this.group=new Yi,this.opt=t,this.axisModel=e,V(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new Yi({x:t.position[0],y:t.position[1],rotation:t.rotation});n.updateTransform(),this._transformGroup=n}return e.prototype.hasBuilder=function(e){return!!jM[e]},e.prototype.add=function(e){jM[e](this.opt,this.axisModel,this.group,this._transformGroup)},e.prototype.getGroup=function(){return this.group},e.innerTextLayout=function(e,t,n){var r,i,o=go(t-e);return mo(o)?(i=n>0?"top":"bottom",r="center"):mo(o-UM)?(i=n>0?"bottom":"top",r="center"):(i="middle",r=o>0&&o<UM?n>0?"right":"left":n>0?"left":"right"),{rotation:o,textAlign:r,textVerticalAlign:i}},e.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},e.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},e}(),jM={axisLine:function(e,t,n,r){var i=t.get(["axisLine","show"]);if("auto"===i&&e.handleAutoShown&&(i=e.handleAutoShown("axisLine")),i){var o=t.axis.getExtent(),a=r.transform,s=[o[0],0],l=[o[1],0],u=s[0]>l[0];a&&(Ke(s,s,a),Ke(l,l,a));var c=z({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new pc({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1});eh(h.shape,h.style.lineWidth),h.anid="line",n.add(h);var d=t.get(["axisLine","symbol"]);if(null!=d){var p=t.get(["axisLine","symbolSize"]);ee(d)&&(d=[d,d]),(ee(p)||ne(p))&&(p=[p,p]);var f=fv(t.get(["axisLine","symbolOffset"])||0,p),g=p[0],m=p[1];W([{rotate:e.rotation+Math.PI/2,offset:f[0],r:0},{rotate:e.rotation-Math.PI/2,offset:f[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(t,r){if("none"!==d[r]&&null!=d[r]){var i=dv(d[r],-g/2,-m/2,g,m,c.stroke,!0),o=t.r+t.offset,a=u?l:s;i.attr({rotation:t.rotate,x:a[0]+o*Math.cos(e.rotation),y:a[1]-o*Math.sin(e.rotation),silent:!0,z2:11}),n.add(i)}}))}}},axisTickLabel:function(e,t,n,r){var i=function(e,t,n,r){var i=n.axis,o=n.getModel("axisTick"),a=o.get("show");"auto"===a&&r.handleAutoShown&&(a=r.handleAutoShown("axisTick"));if(!a||i.scale.isBlank())return;for(var s=o.getModel("lineStyle"),l=r.tickDirection*o.get("length"),u=qM(i.getTicksCoords(),t.transform,l,V(s.getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;c<u.length;c++)e.add(u[c]);return u}(n,r,t,e),o=function(e,t,n,r){var i=n.axis,o=he(r.axisLabelShow,n.get(["axisLabel","show"]));if(!o||i.scale.isBlank())return;var a=n.getModel("axisLabel"),s=a.get("margin"),l=i.getViewLabels(),u=(he(r.labelRotate,a.get("rotate"))||0)*UM/180,c=WM.innerTextLayout(r.rotation,u,r.labelDirection),h=n.getCategories&&n.getCategories(!0),d=[],p=WM.isLabelSilent(n),f=n.get("triggerEvent");return W(l,(function(o,u){var g="ordinal"===i.scale.type?i.scale.getRawOrdinalNumber(o.tickValue):o.tickValue,m=o.formattedLabel,v=o.rawLabel,y=a;if(h&&h[g]){var _=h[g];re(_)&&_.textStyle&&(y=new Wh(_.textStyle,a,n.ecModel))}var x=y.getTextColor()||n.get(["axisLine","lineStyle","color"]),b=i.dataToCoord(g),w=y.getShallow("align",!0)||c.textAlign,S=de(y.getShallow("alignMinLabel",!0),w),T=de(y.getShallow("alignMaxLabel",!0),w),M=y.getShallow("verticalAlign",!0)||y.getShallow("baseline",!0)||c.textVerticalAlign,C=de(y.getShallow("verticalAlignMinLabel",!0),M),D=de(y.getShallow("verticalAlignMaxLabel",!0),M),A=new ll({x:b,y:r.labelOffset+r.labelDirection*s,rotation:c.rotation,silent:p,z2:10+(o.level||0),style:wh(y,{text:m,align:0===u?S:u===l.length-1?T:w,verticalAlign:0===u?C:u===l.length-1?D:M,fill:Q(x)?x("category"===i.type?v:"value"===i.type?g+"":g,u):x})});if(A.anid="label_"+g,f){var I=WM.makeAxisEventDataBase(n);I.targetType="axisLabel",I.value=v,I.tickIndex=u,"category"===i.type&&(I.dataIndex=g),bl(A).eventData=I}t.add(A),A.updateTransform(),d.push(A),e.add(A),A.decomposeTransform()})),d}(n,r,t,e);(function(e,t,n){if($x(e.axis))return;var r=e.get(["axisLabel","showMinLabel"]),i=e.get(["axisLabel","showMaxLabel"]);t=t||[],n=n||[];var o=t[0],a=t[1],s=t[t.length-1],l=t[t.length-2],u=n[0],c=n[1],h=n[n.length-1],d=n[n.length-2];!1===r?(XM(o),XM(u)):YM(o,a)&&(r?(XM(a),XM(c)):(XM(o),XM(u)));!1===i?(XM(s),XM(h)):YM(l,s)&&(i?(XM(l),XM(d)):(XM(s),XM(h)))}(t,o,i),function(e,t,n,r){var i=n.axis,o=n.getModel("minorTick");if(!o.get("show")||i.scale.isBlank())return;var a=i.getMinorTicksCoords();if(!a.length)return;for(var s=o.getModel("lineStyle"),l=r*o.get("length"),u=V(s.getLineStyle(),V(n.getModel("axisTick").getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])})),c=0;c<a.length;c++)for(var h=qM(a[c],t.transform,l,u,"minorticks_"+c),d=0;d<h.length;d++)e.add(h[d])}(n,r,t,e.tickDirection),t.get(["axisLabel","hideOverlap"]))&&uw(aw(j(o,(function(e){return{label:e,priority:e.z2,defaultAttr:{ignore:e.ignore}}}))))},axisName:function(e,t,n,r){var i=he(e.axisName,t.get("name"));if(i){var o,a,s=t.get("nameLocation"),l=e.nameDirection,u=t.getModel("nameTextStyle"),c=t.get("nameGap")||0,h=t.axis.getExtent(),d=h[0]>h[1]?-1:1,p=["start"===s?h[0]-d*c:"end"===s?h[1]+d*c:(h[0]+h[1])/2,ZM(s)?e.labelOffset+l*c:0],f=t.get("nameRotate");null!=f&&(f=f*UM/180),ZM(s)?o=WM.innerTextLayout(e.rotation,null!=f?f:e.rotation,l):(o=function(e,t,n,r){var i,o,a=go(n-e),s=r[0]>r[1],l="start"===t&&!s||"start"!==t&&s;mo(a-UM/2)?(o=l?"bottom":"top",i="center"):mo(a-1.5*UM)?(o=l?"top":"bottom",i="center"):(o="middle",i=a<1.5*UM&&a>UM/2?l?"left":"right":l?"right":"left");return{rotation:a,textAlign:i,textVerticalAlign:o}}(e.rotation,s,f||0,h),null!=(a=e.axisNameAvailableWidth)&&(a=Math.abs(a/Math.sin(o.rotation)),!isFinite(a)&&(a=null)));var g=u.getFont(),m=t.get("nameTruncate",!0)||{},v=m.ellipsis,y=he(e.nameTruncateMaxWidth,m.maxWidth,a),_=new ll({x:p[0],y:p[1],rotation:o.rotation,silent:WM.isLabelSilent(t),style:wh(u,{text:i,font:g,overflow:"truncate",width:y,ellipsis:v,fill:u.getTextColor()||t.get(["axisLine","lineStyle","color"]),align:u.get("align")||o.textAlign,verticalAlign:u.get("verticalAlign")||o.textVerticalAlign}),z2:1});if(ph({el:_,componentModel:t,itemName:i}),_.__fullText=i,_.anid="name",t.get("triggerEvent")){var x=WM.makeAxisEventDataBase(t);x.targetType="axisName",x.name=i,bl(_).eventData=x}r.add(_),_.updateTransform(),n.add(_),_.decomposeTransform()}}};function XM(e){e&&(e.ignore=!0)}function YM(e,t){var n=e&&e.getBoundingRect().clone(),r=t&&t.getBoundingRect().clone();if(n&&r){var i=Dt([]);return Lt(i,i,-e.rotation),n.applyTransform(It([],i,e.getLocalTransform())),r.applyTransform(It([],i,t.getLocalTransform())),n.intersect(r)}}function ZM(e){return"middle"===e||"center"===e}function qM(e,t,n,r,i){for(var o=[],a=[],s=[],l=0;l<e.length;l++){var u=e[l].coord;a[0]=u,a[1]=0,s[0]=u,s[1]=n,t&&(Ke(a,a,t),Ke(s,s,t));var c=new pc({shape:{x1:a[0],y1:a[1],x2:s[0],y2:s[1]},style:r,z2:2,autoBatch:!0,silent:!0});eh(c.shape,c.style.lineWidth),c.anid=i+"_"+e[l].tickValue,o.push(c)}return o}function KM(e,t){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(e,t,n){var r=t.getComponent("tooltip"),i=t.getComponent("axisPointer"),o=i.get("link",!0)||[],a=[];W(n.getCoordinateSystems(),(function(n){if(n.axisPointerEnabled){var s=eC(n.model),l=e.coordSysAxesInfo[s]={};e.coordSysMap[s]=n;var u=n.model.getModel("tooltip",r);if(W(n.getAxes(),$(p,!1,null)),n.getTooltipAxes&&r&&u.get("show")){var c="axis"===u.get("trigger"),h="cross"===u.get(["axisPointer","type"]),d=n.getTooltipAxes(u.get(["axisPointer","axis"]));(c||h)&&W(d.baseAxes,$(p,!h||"cross",c)),h&&W(d.otherAxes,$(p,"cross",!1))}}function p(r,s,c){var h=c.model.getModel("axisPointer",i),d=h.get("show");if(d&&("auto"!==d||r||QM(h))){null==s&&(s=h.get("triggerTooltip")),h=r?function(e,t,n,r,i,o){var a=t.getModel("axisPointer"),s={};W(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],(function(e){s[e]=O(a.get(e))})),s.snap="category"!==e.type&&!!o,"cross"===a.get("type")&&(s.type="line");var l=s.label||(s.label={});if(null==l.show&&(l.show=!1),"cross"===i){var u=a.get(["label","show"]);if(l.show=null==u||u,!o){var c=s.lineStyle=a.get("crossStyle");c&&V(l,c.textStyle)}}return e.model.getModel("axisPointer",new Wh(s,n,r))}(c,u,i,t,r,s):h;var p=h.get("snap"),f=h.get("triggerEmphasis"),g=eC(c.model),m=s||p||"category"===c.type,v=e.axesInfo[g]={key:g,axis:c,coordSys:n,axisPointerModel:h,triggerTooltip:s,triggerEmphasis:f,involveSeries:m,snap:p,useHandle:QM(h),seriesModels:[],linkGroup:null};l[g]=v,e.seriesInvolved=e.seriesInvolved||m;var y=function(e,t){for(var n=t.model,r=t.dim,i=0;i<e.length;i++){var o=e[i]||{};if($M(o[r+"AxisId"],n.id)||$M(o[r+"AxisIndex"],n.componentIndex)||$M(o[r+"AxisName"],n.name))return i}}(o,c);if(null!=y){var _=a[y]||(a[y]={axesInfo:{}});_.axesInfo[g]=v,_.mapper=o[y].mapper,v.linkGroup=_}}}}))}(n,e,t),n.seriesInvolved&&function(e,t){t.eachSeries((function(t){var n=t.coordinateSystem,r=t.get(["tooltip","trigger"],!0),i=t.get(["tooltip","show"],!0);n&&"none"!==r&&!1!==r&&"item"!==r&&!1!==i&&!1!==t.get(["axisPointer","show"],!0)&&W(e.coordSysAxesInfo[eC(n.model)],(function(e){var r=e.axis;n.getAxis(r.dim)===r&&(e.seriesModels.push(t),null==e.seriesDataCount&&(e.seriesDataCount=0),e.seriesDataCount+=t.getData().count())}))}))}(n,e),n}function $M(e,t){return"all"===e||J(e)&&F(e,t)>=0||e===t}function JM(e){var t=(e.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[eC(e)]}function QM(e){return!!e.get(["handle","show"])}function eC(e){return e.type+"||"+e.id}var tC={},nC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(t,n,r,i){this.axisPointerClass&&function(e){var t=JM(e);if(t){var n=t.axisPointerModel,r=t.axis.scale,i=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=r.parse(a));var s=QM(n);null==o&&(i.status=s?"show":"hide");var l=r.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),a<l[0]&&(a=l[0]),i.value=a,s&&(i.status=t.axis.scale.isBlank()?"hide":"show")}}(t),e.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(t,r,!0)},t.prototype.updateAxisPointer=function(e,t,n,r){this._doUpdateAxisPointerClass(e,n,!1)},t.prototype.remove=function(e,t){var n=this._axisPointer;n&&n.remove(t)},t.prototype.dispose=function(t,n){this._disposeAxisPointer(n),e.prototype.dispose.apply(this,arguments)},t.prototype._doUpdateAxisPointerClass=function(e,n,r){var i=t.getAxisPointerClass(this.axisPointerClass);if(i){var o=function(e){var t=JM(e);return t&&t.axisPointerModel}(e);o?(this._axisPointer||(this._axisPointer=new i)).render(e,o,n,r):this._disposeAxisPointer(n)}},t.prototype._disposeAxisPointer=function(e){this._axisPointer&&this._axisPointer.dispose(e),this._axisPointer=null},t.registerAxisPointerClass=function(e,t){if("production"!==process.env.NODE_ENV&&tC[e])throw new Error("axisPointer "+e+" exists");tC[e]=t},t.getAxisPointerClass=function(e){return e&&tC[e]},t.type="axis",t}(Kg),rC=ta();function iC(e,t,n,r){var i=n.axis;if(!i.scale.isBlank()){var o=n.getModel("splitArea"),a=o.getModel("areaStyle"),s=a.get("color"),l=r.coordinateSystem.getRect(),u=i.getTicksCoords({tickModel:o,clamp:!0});if(u.length){var c=s.length,h=rC(e).splitAreaColors,d=Te(),p=0;if(h)for(var f=0;f<u.length;f++){var g=h.get(u[f].tickValue);if(null!=g){p=(g+(c-1)*f)%c;break}}var m=i.toGlobalCoord(u[0].coord),v=a.getAreaStyle();s=J(s)?s:[s];for(f=1;f<u.length;f++){var y=i.toGlobalCoord(u[f].coord),_=void 0,x=void 0,b=void 0,w=void 0;i.isHorizontal()?(_=m,x=l.y,b=y-_,w=l.height,m=_+b):(_=l.x,x=m,b=l.width,m=x+(w=y-x));var S=u[f-1].tickValue;null!=S&&d.set(S,p),t.add(new ol({anid:null!=S?"area_"+S:null,shape:{x:_,y:x,width:b,height:w},style:V({fill:s[p]},v),autoBatch:!0,silent:!0})),p=(p+1)%c}rC(e).splitAreaColors=d}}}function oC(e){rC(e).splitAreaColors=null}var aC=["axisLine","axisTickLabel","axisName"],sC=["splitArea","splitLine","minorSplitLine"],lC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="CartesianAxisPointer",n}return l(t,e),t.prototype.render=function(t,n,r,i){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Yi,this.group.add(this._axisGroup),t.get("show")){var a=t.getCoordSysModel(),s=OM(a,t),l=new WM(t,z({handleAutoShown:function(e){for(var n=a.coordinateSystem.getCartesians(),r=0;r<n.length;r++)if(K_(n[r].getOtherAxis(t.axis).scale))return!0;return!1}},s));W(aC,l.add,l),this._axisGroup.add(l.getGroup()),W(sC,(function(e){t.get([e,"show"])&&uC[e](this,this._axisGroup,t,a)}),this),i&&"changeAxisOrder"===i.type&&i.isInitSort||ah(o,this._axisGroup,t),e.prototype.render.call(this,t,n,r,i)}},t.prototype.remove=function(){oC(this)},t.type="cartesianAxis",t}(nC),uC={splitLine:function(e,t,n,r){var i=n.axis;if(!i.scale.isBlank()){var o=n.getModel("splitLine"),a=o.getModel("lineStyle"),s=a.get("color");s=J(s)?s:[s];for(var l=r.coordinateSystem.getRect(),u=i.isHorizontal(),c=0,h=i.getTicksCoords({tickModel:o}),d=[],p=[],f=a.getLineStyle(),g=0;g<h.length;g++){var m=i.toGlobalCoord(h[g].coord);u?(d[0]=m,d[1]=l.y,p[0]=m,p[1]=l.y+l.height):(d[0]=l.x,d[1]=m,p[0]=l.x+l.width,p[1]=m);var v=c++%s.length,y=h[g].tickValue,_=new pc({anid:null!=y?"line_"+h[g].tickValue:null,autoBatch:!0,shape:{x1:d[0],y1:d[1],x2:p[0],y2:p[1]},style:V({stroke:s[v]},f),silent:!0});eh(_.shape,f.lineWidth),t.add(_)}}},minorSplitLine:function(e,t,n,r){var i=n.axis,o=n.getModel("minorSplitLine").getModel("lineStyle"),a=r.coordinateSystem.getRect(),s=i.isHorizontal(),l=i.getMinorTicksCoords();if(l.length)for(var u=[],c=[],h=o.getLineStyle(),d=0;d<l.length;d++)for(var p=0;p<l[d].length;p++){var f=i.toGlobalCoord(l[d][p].coord);s?(u[0]=f,u[1]=a.y,c[0]=f,c[1]=a.y+a.height):(u[0]=a.x,u[1]=f,c[0]=a.x+a.width,c[1]=f);var g=new pc({anid:"minor_line_"+l[d][p].tickValue,autoBatch:!0,shape:{x1:u[0],y1:u[1],x2:c[0],y2:c[1]},style:h,silent:!0});eh(g.shape,h.lineWidth),t.add(g)}},splitArea:function(e,t,n,r){iC(e,t,n,r)}},cC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="xAxis",t}(lC),hC=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=cC.type,t}return l(t,e),t.type="yAxis",t}(lC),dC=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="grid",t}return l(t,e),t.prototype.render=function(e,t){this.group.removeAll(),e.get("show")&&this.group.add(new ol({shape:e.coordinateSystem.getRect(),style:V({fill:e.get("backgroundColor")},e.getItemStyle()),silent:!0,z2:-1}))},t.type="grid",t}(Kg),pC={offset:0};function fC(e){e.registerComponentView(dC),e.registerComponentModel(xM),e.registerCoordinateSystem("cartesian2d",BM),DM(e,"x",bM,pC),DM(e,"y",bM,pC),e.registerComponentView(cC),e.registerComponentView(hC),e.registerPreprocessor((function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})}))}function gC(e){e.eachSeriesByType("radar",(function(e){var t=e.getData(),n=[],r=e.coordinateSystem;if(r){var i=r.getIndicatorAxes();W(i,(function(e,o){t.each(t.mapDimension(i[o].dim),(function(e,t){n[t]=n[t]||[];var i=r.dataToPoint(e,o);n[t][o]=mC(i)?i:vC(r)}))})),t.each((function(e){var i=Z(n[e],(function(e){return mC(e)}))||vC(r);n[e].push(i.slice()),t.setItemLayout(e,n[e])}))}}))}function mC(e){return!isNaN(e[0])&&!isNaN(e[1])}function vC(e){return[e.cx,e.cy]}function yC(e){var t=e.polar;if(t){J(t)||(t=[t]);var n=[];W(t,(function(t,r){t.indicator?(t.type&&!t.shape&&(t.shape=t.type),e.radar=e.radar||[],J(e.radar)||(e.radar=[e.radar]),e.radar.push(t)):n.push(t)})),e.polar=n}W(e.series,(function(e){e&&"radar"===e.type&&e.polarIndex&&(e.radarIndex=e.polarIndex)}))}var _C=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){var r=e.coordinateSystem,i=this.group,o=e.getData(),a=this._data;function s(e,t){var n=e.getItemVisual(t,"symbol")||"circle";if("none"!==n){var r=pv(e.getItemVisual(t,"symbolSize")),i=dv(n,-1,-1,2,2),o=e.getItemVisual(t,"symbolRotate")||0;return i.attr({style:{strokeNoScale:!0},z2:100,scaleX:r[0]/2,scaleY:r[1]/2,rotation:o*Math.PI/180||0}),i}}function l(t,n,r,i,o,a){r.removeAll();for(var l=0;l<n.length-1;l++){var u=s(i,o);u&&(u.__dimIdx=l,t[l]?(u.setPosition(t[l]),mh[a?"initProps":"updateProps"](u,{x:n[l][0],y:n[l][1]},e,o)):u.setPosition(n[l]),r.add(u))}}function u(e){return j(e,(function(e){return[r.cx,r.cy]}))}o.diff(a).add((function(t){var n=o.getItemLayout(t);if(n){var r=new lc,i=new cc,a={shape:{points:n}};r.shape.points=u(n),i.shape.points=u(n),Rc(r,a,e,t),Rc(i,a,e,t);var s=new Yi,c=new Yi;s.add(i),s.add(r),s.add(c),l(i.shape.points,n,c,o,t,!0),o.setItemGraphicEl(t,s)}})).update((function(t,n){var r=a.getItemGraphicEl(n),i=r.childAt(0),s=r.childAt(1),u=r.childAt(2),c={shape:{points:o.getItemLayout(t)}};c.shape.points&&(l(i.shape.points,c.shape.points,u,o,t,!1),Fc(s),Fc(i),Oc(i,c,e),Oc(s,c,e),o.setItemGraphicEl(t,r))})).remove((function(e){i.remove(a.getItemGraphicEl(e))})).execute(),o.eachItemGraphicEl((function(e,t){var n=o.getItemModel(t),r=e.childAt(0),a=e.childAt(1),s=e.childAt(2),l=o.getItemVisual(t,"style"),u=l.fill;i.add(e),r.useStyle(V(n.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:u})),fu(r,n,"lineStyle"),fu(a,n,"areaStyle");var c=n.getModel("areaStyle"),h=c.isEmpty()&&c.parentModel.isEmpty();a.ignore=h,W(["emphasis","select","blur"],(function(e){var t=n.getModel([e,"areaStyle"]),r=t.isEmpty()&&t.parentModel.isEmpty();a.ensureState(e).ignore=r&&h})),a.useStyle(V(c.getAreaStyle(),{fill:u,opacity:.7,decal:l.decal}));var d=n.getModel("emphasis"),p=d.getModel("itemStyle").getItemStyle();s.eachChild((function(e){if(e instanceof Js){var r=e.style;e.useStyle(z({image:r.image,x:r.x,y:r.y,width:r.width,height:r.height},l))}else e.useStyle(l),e.setColor(u),e.style.strokeNoScale=!0;e.ensureState("emphasis").style=O(p);var i=o.getStore().get(o.getDimensionIndex(e.__dimIdx),t);(null==i||isNaN(i))&&(i=""),xh(e,bh(n),{labelFetcher:o.hostModel,labelDataIndex:t,labelDimIndex:e.__dimIdx,defaultText:i,inheritColor:u,defaultOpacity:l.opacity})})),cu(e,d.get("focus"),d.get("blurScope"),d.get("disabled"))})),this._data=o},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.type="radar",t}(em),xC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return l(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new dM(K(this.getData,this),K(this.getRawData,this))},t.prototype.getInitialData=function(e,t){return hM(this,{generateCoord:"indicator_",generateCoordCount:1/0})},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.coordinateSystem.getIndicatorAxes(),o=this.getData().getName(e),a=""===o?this.name:o,s=Rg(this,e);return Cg("section",{header:a,sortBlocks:!0,blocks:j(i,(function(t){var n=r.get(r.mapDimension(t.dim),e);return Cg("nameValue",{markerType:"subItem",markerColor:s,name:t.name,value:n,sortParam:n})}))})},t.prototype.getTooltipPosition=function(e){if(null!=e)for(var t=this.getData(),n=this.coordinateSystem,r=t.getValues(j(n.dimensions,(function(e){return t.mapDimension(e)})),e),i=0,o=r.length;i<o;i++)if(!isNaN(r[i])){var a=n.getIndicatorAxes();return n.coordToPoint(a[i].dataToCoord(r[i]),i)}},t.type="series.radar",t.dependencies=["radar"],t.defaultOption={z:2,colorBy:"data",coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid",join:"round"},label:{position:"top"},symbolSize:8},t}(Hg),bC=MM.value;function wC(e,t){return V({show:t},e)}var SC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.optionUpdated=function(){var e=this.get("boundaryGap"),t=this.get("splitNumber"),n=this.get("scale"),r=this.get("axisLine"),i=this.get("axisTick"),o=this.get("axisLabel"),a=this.get("axisName"),s=this.get(["axisName","show"]),l=this.get(["axisName","formatter"]),u=this.get("axisNameGap"),c=this.get("triggerEvent"),h=j(this.get("indicator")||[],(function(h){null!=h.max&&h.max>0&&!h.min?h.min=0:null!=h.min&&h.min<0&&!h.max&&(h.max=0);var d=a;null!=h.color&&(d=V({color:h.color},a));var p=R(O(h),{boundaryGap:e,splitNumber:t,scale:n,axisLine:r,axisTick:i,axisLabel:o,name:h.text,showName:s,nameLocation:"end",nameGap:u,nameTextStyle:d,triggerEvent:c},!1);if(ee(l)){var f=p.name;p.name=l.replace("{value}",null!=f?f:"")}else Q(l)&&(p.name=l(p.name,p));var g=new Wh(p,null,this.ecModel);return H(g,Qx.prototype),g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this._indicatorModels=h},t.prototype.getIndicatorModels=function(){return this._indicatorModels},t.type="radar",t.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:R({lineStyle:{color:"#bbb"}},bC.axisLine),axisLabel:wC(bC.axisLabel,!1),axisTick:wC(bC.axisTick,!1),splitLine:wC(bC.splitLine,!0),splitArea:wC(bC.splitArea,!0),indicator:[]},t}(tp),TC=["axisLine","axisTickLabel","axisName"],MC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){this.group.removeAll(),this._buildAxes(e),this._buildSplitLineAndArea(e)},t.prototype._buildAxes=function(e){var t=e.coordinateSystem;W(j(t.getIndicatorAxes(),(function(e){var n=e.model.get("showName")?e.name:"";return new WM(e.model,{axisName:n,position:[t.cx,t.cy],rotation:e.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})})),(function(e){W(TC,e.add,e),this.group.add(e.getGroup())}),this)},t.prototype._buildSplitLineAndArea=function(e){var t=e.coordinateSystem,n=t.getIndicatorAxes();if(n.length){var r=e.get("shape"),i=e.getModel("splitLine"),o=e.getModel("splitArea"),a=i.getModel("lineStyle"),s=o.getModel("areaStyle"),l=i.get("show"),u=o.get("show"),c=a.get("color"),h=s.get("color"),d=J(c)?c:[c],p=J(h)?h:[h],f=[],g=[];if("circle"===r)for(var m=n[0].getTicksCoords(),v=t.cx,y=t.cy,_=0;_<m.length;_++){if(l)f[D(f,d,_)].push(new Fu({shape:{cx:v,cy:y,r:m[_].coord}}));if(u&&_<m.length-1)g[D(g,p,_)].push(new oc({shape:{cx:v,cy:y,r0:m[_].coord,r:m[_+1].coord}}))}else{var x,b=j(n,(function(e,n){var r=e.getTicksCoords();return x=null==x?r.length-1:Math.min(r.length-1,x),j(r,(function(e){return t.coordToPoint(e.coord,n)}))})),w=[];for(_=0;_<=x;_++){for(var S=[],T=0;T<n.length;T++)S.push(b[T][_]);if(S[0]?S.push(S[0].slice()):"production"!==process.env.NODE_ENV&&console.error("Can't draw value axis "+_),l)f[D(f,d,_)].push(new cc({shape:{points:S}}));if(u&&w)g[D(g,p,_-1)].push(new lc({shape:{points:S.concat(w)}}));w=S.slice().reverse()}}var M=a.getLineStyle(),C=s.getAreaStyle();W(g,(function(e,t){this.group.add(Jc(e,{style:V({stroke:"none",fill:p[t%p.length]},C),silent:!0}))}),this),W(f,(function(e,t){this.group.add(Jc(e,{style:V({fill:"none",stroke:d[t%d.length]},M),silent:!0}))}),this)}function D(e,t,n){var r=n%t.length;return e[r]=e[r]||[],r}},t.type="radar",t}(Kg),CC=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.type="value",i.angle=0,i.name="",i}return l(t,e),t}(Ob),DC=function(){function e(e,t,n){this.dimensions=[],this._model=e,this._indicatorAxes=j(e.getIndicatorModels(),(function(e,t){var n="indicator_"+t,r=new CC(n,new ax);return r.name=e.get("name"),r.model=e,e.axis=r,this.dimensions.push(n),r}),this),this.resize(e,n)}return e.prototype.getIndicatorAxes=function(){return this._indicatorAxes},e.prototype.dataToPoint=function(e,t){var n=this._indicatorAxes[t];return this.coordToPoint(n.dataToCoord(e),t)},e.prototype.coordToPoint=function(e,t){var n=this._indicatorAxes[t].angle;return[this.cx+e*Math.cos(n),this.cy-e*Math.sin(n)]},e.prototype.pointToData=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,r=Math.sqrt(t*t+n*n);t/=r,n/=r;for(var i,o=Math.atan2(-n,t),a=1/0,s=-1,l=0;l<this._indicatorAxes.length;l++){var u=this._indicatorAxes[l],c=Math.abs(o-u.angle);c<a&&(i=u,s=l,a=c)}return[s,+(i&&i.coordToData(r))]},e.prototype.resize=function(e,t){var n=e.get("center"),r=t.getWidth(),i=t.getHeight(),o=Math.min(r,i)/2;this.cx=oo(n[0],r),this.cy=oo(n[1],i),this.startAngle=e.get("startAngle")*Math.PI/180;var a=e.get("radius");(ee(a)||ne(a))&&(a=[0,a]),this.r0=oo(a[0],o),this.r=oo(a[1],o),W(this._indicatorAxes,(function(e,t){e.setExtent(this.r0,this.r);var n=this.startAngle+t*Math.PI*2/this._indicatorAxes.length;n=Math.atan2(Math.sin(n),Math.cos(n)),e.angle=n}),this)},e.prototype.update=function(e,t){var n=this._indicatorAxes,r=this._model;W(n,(function(e){e.scale.setExtent(1/0,-1/0)})),e.eachSeriesByType("radar",(function(t,i){if("radar"===t.get("coordinateSystem")&&e.getComponent("radar",t.get("radarIndex"))===r){var o=t.getData();W(n,(function(e){e.scale.unionExtentFromData(o,o.mapDimension(e.dim))}))}}),this);var i=r.get("splitNumber"),o=new ax;o.setExtent(0,i),o.setInterval(1),W(n,(function(e,t){VM(e.scale,e.model,o)}))},e.prototype.convertToPixel=function(e,t,n){return console.warn("Not implemented."),null},e.prototype.convertFromPixel=function(e,t,n){return console.warn("Not implemented."),null},e.prototype.containPoint=function(e){return console.warn("Not implemented."),!1},e.create=function(t,n){var r=[];return t.eachComponent("radar",(function(i){var o=new e(i,t,n);r.push(o),i.coordinateSystem=o})),t.eachSeriesByType("radar",(function(e){"radar"===e.get("coordinateSystem")&&(e.coordinateSystem=r[e.get("radarIndex")||0])})),r},e.dimensions=[],e}();function AC(e){e.registerCoordinateSystem("radar",DC),e.registerComponentModel(SC),e.registerComponentView(MC),e.registerVisual({seriesType:"radar",reset:function(e){var t=e.getData();t.each((function(e){t.setItemVisual(e,"legendIcon","roundRect")})),t.setVisual("legendIcon","roundRect")}})}var IC="\0_ec_interaction_mutex";function EC(e,t){return!!LC(e)[t]}function LC(e){return e[IC]||(e[IC]={})}qy({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},Ie);var NC=function(e){function t(t){var n=e.call(this)||this;n._zr=t;var r=K(n._mousedownHandler,n),i=K(n._mousemoveHandler,n),o=K(n._mouseupHandler,n),a=K(n._mousewheelHandler,n),s=K(n._pinchHandler,n);return n.enable=function(e,n){this.disable(),this._opt=V(O(n)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==e&&(e=!0),!0!==e&&"move"!==e&&"pan"!==e||(t.on("mousedown",r),t.on("mousemove",i),t.on("mouseup",o)),!0!==e&&"scale"!==e&&"zoom"!==e||(t.on("mousewheel",a),t.on("pinch",s))},n.disable=function(){t.off("mousedown",r),t.off("mousemove",i),t.off("mouseup",o),t.off("mousewheel",a),t.off("pinch",s)},n}return l(t,e),t.prototype.isDragging=function(){return this._dragging},t.prototype.isPinching=function(){return this._pinching},t.prototype.setPointerChecker=function(e){this.pointerChecker=e},t.prototype.dispose=function(){this.disable()},t.prototype._mousedownHandler=function(e){if(!wt(e)){for(var t=e.target;t;){if(t.draggable)return;t=t.__hostTarget||t.parent}var n=e.offsetX,r=e.offsetY;this.pointerChecker&&this.pointerChecker(e,n,r)&&(this._x=n,this._y=r,this._dragging=!0)}},t.prototype._mousemoveHandler=function(e){if(this._dragging&&RC("moveOnMouseMove",e,this._opt)&&"pinch"!==e.gestureEvent&&!EC(this._zr,"globalPan")){var t=e.offsetX,n=e.offsetY,r=this._x,i=this._y,o=t-r,a=n-i;this._x=t,this._y=n,this._opt.preventDefaultMouseMove&&bt(e.event),OC(this,"pan","moveOnMouseMove",e,{dx:o,dy:a,oldX:r,oldY:i,newX:t,newY:n,isAvailableBehavior:null})}},t.prototype._mouseupHandler=function(e){wt(e)||(this._dragging=!1)},t.prototype._mousewheelHandler=function(e){var t=RC("zoomOnMouseWheel",e,this._opt),n=RC("moveOnMouseWheel",e,this._opt),r=e.wheelDelta,i=Math.abs(r),o=e.offsetX,a=e.offsetY;if(0!==r&&(t||n)){if(t){var s=i>3?1.4:i>1?1.2:1.1;PC(this,"zoom","zoomOnMouseWheel",e,{scale:r>0?s:1/s,originX:o,originY:a,isAvailableBehavior:null})}if(n){var l=Math.abs(r);PC(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(r>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:o,originY:a,isAvailableBehavior:null})}}},t.prototype._pinchHandler=function(e){EC(this._zr,"globalPan")||PC(this,"zoom",null,e,{scale:e.pinchScale>1?1.1:1/1.1,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})},t}(nt);function PC(e,t,n,r,i){e.pointerChecker&&e.pointerChecker(r,i.originX,i.originY)&&(bt(r.event),OC(e,t,n,r,i))}function OC(e,t,n,r,i){i.isAvailableBehavior=K(RC,null,n,r),e.trigger(t,i)}function RC(e,t,n){var r=n[e];return!e||r&&(!ee(r)||t.event[r+"Key"])}function kC(e,t,n){var r=e.target;r.x+=t,r.y+=n,r.dirty()}function zC(e,t,n,r){var i=e.target,o=e.zoomLimit,a=e.zoom=e.zoom||1;if(a*=t,o){var s=o.min||0,l=o.max||1/0;a=Math.max(Math.min(l,a),s)}var u=a/e.zoom;e.zoom=a,i.x-=(n-i.x)*(u-1),i.y-=(r-i.y)*(u-1),i.scaleX*=u,i.scaleY*=u,i.dirty()}var VC,BC={axisPointer:1,tooltip:1,brush:1};function FC(e,t,n){var r=t.getComponentByElement(e.topTarget),i=r&&r.coordinateSystem;return r&&r!==n&&!BC.hasOwnProperty(r.mainType)&&i&&i.model!==n}function GC(e){ee(e)&&(e=(new DOMParser).parseFromString(e,"text/xml"));var t=e;for(9===t.nodeType&&(t=t.firstChild);"svg"!==t.nodeName.toLowerCase()||1!==t.nodeType;)t=t.nextSibling;return t}var HC={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},UC=q(HC),WC={"alignment-baseline":"textBaseline","stop-color":"stopColor"},jC=q(WC),XC=function(){function e(){this._defs={},this._root=null}return e.prototype.parse=function(e,t){t=t||{};var n=GC(e);if("production"!==process.env.NODE_ENV&&!n)throw new Error("Illegal svg");this._defsUsePending=[];var r=new Yi;this._root=r;var i=[],o=n.getAttribute("viewBox")||"",a=parseFloat(n.getAttribute("width")||t.width),s=parseFloat(n.getAttribute("height")||t.height);isNaN(a)&&(a=null),isNaN(s)&&(s=null),JC(n,r,null,!0,!1);for(var l,u,c=n.firstChild;c;)this._parseNode(c,r,i,null,!1,!1),c=c.nextSibling;if(function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r[0].style[r[1]]=e[r[2]]}}(this._defs,this._defsUsePending),this._defsUsePending=[],o){var h=nD(o);h.length>=4&&(l={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(l&&null!=a&&null!=s&&(u=sD(l,{x:0,y:0,width:a,height:s}),!t.ignoreViewBox)){var d=r;(r=new Yi).add(d),d.scaleX=d.scaleY=u.scale,d.x=u.x,d.y=u.y}return t.ignoreRootClip||null==a||null==s||r.setClipPath(new ol({shape:{x:0,y:0,width:a,height:s}})),{root:r,width:a,height:s,viewBoxRect:l,viewBoxTransform:u,named:i}},e.prototype._parseNode=function(e,t,n,r,i,o){var a,s=e.nodeName.toLowerCase(),l=r;if("defs"===s&&(i=!0),"text"===s&&(o=!0),"defs"===s||"switch"===s)a=t;else{if(!i){var u=VC[s];if(u&&Ae(VC,s)){a=u.call(this,e,t);var c=e.getAttribute("name");if(c){var h={name:c,namedFrom:null,svgNodeTagLower:s,el:a};n.push(h),"g"===s&&(l=h)}else r&&n.push({name:r.name,namedFrom:r,svgNodeTagLower:s,el:a});t.add(a)}}var d=YC[s];if(d&&Ae(YC,s)){var p=d.call(this,e),f=e.getAttribute("id");f&&(this._defs[f]=p)}}if(a&&a.isGroup)for(var g=e.firstChild;g;)1===g.nodeType?this._parseNode(g,a,n,l,i,o):3===g.nodeType&&o&&this._parseText(g,a),g=g.nextSibling},e.prototype._parseText=function(e,t){var n=new qs({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});KC(t,n),JC(e,n,this._defsUsePending,!1,!1),function(e,t){var n=t.__selfStyle;if(n){var r=n.textBaseline,i=r;r&&"auto"!==r?"baseline"===r?i="alphabetic":"before-edge"===r||"text-before-edge"===r?i="top":"after-edge"===r||"text-after-edge"===r?i="bottom":"central"!==r&&"mathematical"!==r||(i="middle"):i="alphabetic",e.style.textBaseline=i}var o=t.__inheritedStyle;if(o){var a=o.textAlign,s=a;a&&("middle"===a&&(s="center"),e.style.textAlign=s)}}(n,t);var r=n.style,i=r.fontSize;i&&i<9&&(r.fontSize=9,n.scaleX*=i/9,n.scaleY*=i/9);var o=(r.fontSize||r.fontFamily)&&[r.fontStyle,r.fontWeight,(r.fontSize||12)+"px",r.fontFamily||"sans-serif"].join(" ");r.font=o;var a=n.getBoundingRect();return this._textX+=a.width,t.add(n),n},e.internalField=void(VC={g:function(e,t){var n=new Yi;return KC(t,n),JC(e,n,this._defsUsePending,!1,!1),n},rect:function(e,t){var n=new ol;return KC(t,n),JC(e,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(e,t){var n=new Fu;return KC(t,n),JC(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),n.silent=!0,n},line:function(e,t){var n=new pc;return KC(t,n),JC(e,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(e,t){var n=new Hu;return KC(t,n),JC(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(e,t){var n,r=e.getAttribute("points");r&&(n=$C(r));var i=new lc({shape:{points:n||[]},silent:!0});return KC(t,i),JC(e,i,this._defsUsePending,!1,!1),i},polyline:function(e,t){var n,r=e.getAttribute("points");r&&(n=$C(r));var i=new cc({shape:{points:n||[]},silent:!0});return KC(t,i),JC(e,i,this._defsUsePending,!1,!1),i},image:function(e,t){var n=new Js;return KC(t,n),JC(e,n,this._defsUsePending,!1,!1),n.setStyle({image:e.getAttribute("xlink:href")||e.getAttribute("href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),n.silent=!0,n},text:function(e,t){var n=e.getAttribute("x")||"0",r=e.getAttribute("y")||"0",i=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(i),this._textY=parseFloat(r)+parseFloat(o);var a=new Yi;return KC(t,a),JC(e,a,this._defsUsePending,!1,!0),a},tspan:function(e,t){var n=e.getAttribute("x"),r=e.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=r&&(this._textY=parseFloat(r));var i=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0",a=new Yi;return KC(t,a),JC(e,a,this._defsUsePending,!1,!0),this._textX+=parseFloat(i),this._textY+=parseFloat(o),a},path:function(e,t){var n=zu(e.getAttribute("d")||"");return KC(t,n),JC(e,n,this._defsUsePending,!1,!1),n.silent=!0,n}}),e}(),YC={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||"0",10),n=parseInt(e.getAttribute("y1")||"0",10),r=parseInt(e.getAttribute("x2")||"10",10),i=parseInt(e.getAttribute("y2")||"0",10),o=new wc(t,n,r,i);return ZC(e,o),qC(e,o),o},radialgradient:function(e){var t=parseInt(e.getAttribute("cx")||"0",10),n=parseInt(e.getAttribute("cy")||"0",10),r=parseInt(e.getAttribute("r")||"0",10),i=new Sc(t,n,r);return ZC(e,i),qC(e,i),i}};function ZC(e,t){"userSpaceOnUse"===e.getAttribute("gradientUnits")&&(t.global=!0)}function qC(e,t){for(var n=e.firstChild;n;){if(1===n.nodeType&&"stop"===n.nodeName.toLocaleLowerCase()){var r=n.getAttribute("offset"),i=void 0;i=r&&r.indexOf("%")>0?parseInt(r,10)/100:r?parseFloat(r):0;var o={};aD(n,o,o);var a=o.stopColor||n.getAttribute("stop-color")||"#000000";t.colorStops.push({offset:i,color:a})}n=n.nextSibling}}function KC(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),V(t.__inheritedStyle,e.__inheritedStyle))}function $C(e){for(var t=nD(e),n=[],r=0;r<t.length;r+=2){var i=parseFloat(t[r]),o=parseFloat(t[r+1]);n.push([i,o])}return n}function JC(e,t,n,r,i){var o=t,a=o.__inheritedStyle=o.__inheritedStyle||{},s={};1===e.nodeType&&(function(e,t){var n=e.getAttribute("transform");if(n){n=n.replace(/,/g," ");var r=[],i=null;n.replace(rD,(function(e,t,n){return r.push(t,n),""}));for(var o=r.length-1;o>0;o-=2){var a=r[o],s=r[o-1],l=nD(a);switch(i=i||[1,0,0,1,0,0],s){case"translate":Et(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":Nt(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Lt(i,i,-parseFloat(l[0])*iD,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":It(i,[1,0,Math.tan(parseFloat(l[0])*iD),1,0,0],i);break;case"skewY":It(i,[1,Math.tan(parseFloat(l[0])*iD),0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5])}}t.setLocalTransform(i)}}(e,t),aD(e,a,s),r||function(e,t,n){for(var r=0;r<UC.length;r++){var i=UC[r];null!=(o=e.getAttribute(i))&&(t[HC[i]]=o)}for(r=0;r<jC.length;r++){var o;i=jC[r];null!=(o=e.getAttribute(i))&&(n[WC[i]]=o)}}(e,a,s)),o.style=o.style||{},null!=a.fill&&(o.style.fill=eD(o,"fill",a.fill,n)),null!=a.stroke&&(o.style.stroke=eD(o,"stroke",a.stroke,n)),W(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],(function(e){null!=a[e]&&(o.style[e]=parseFloat(a[e]))})),W(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign"],(function(e){null!=a[e]&&(o.style[e]=a[e])})),i&&(o.__selfStyle=s),a.lineDash&&(o.style.lineDash=j(nD(a.lineDash),(function(e){return parseFloat(e)}))),"hidden"!==a.visibility&&"collapse"!==a.visibility||(o.invisible=!0),"none"===a.display&&(o.ignore=!0)}var QC=/^url\(\s*#(.*?)\)/;function eD(e,t,n,r){var i=n&&n.match(QC);if(!i)return"none"===n&&(n=null),n;var o=ve(i[1]);r.push([e,t,o])}var tD=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function nD(e){return e.match(tD)||[]}var rD=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g,iD=Math.PI/180;var oD=/([^\s:;]+)\s*:\s*([^:;]+)/g;function aD(e,t,n){var r,i=e.getAttribute("style");if(i)for(oD.lastIndex=0;null!=(r=oD.exec(i));){var o=r[1],a=Ae(HC,o)?HC[o]:null;a&&(t[a]=r[2]);var s=Ae(WC,o)?WC[o]:null;s&&(n[s]=r[2])}}function sD(e,t){var n=t.width/e.width,r=t.height/e.height,i=Math.min(n,r);return{scale:i,x:-(e.x+e.width/2)*i+(t.x+t.width/2),y:-(e.y+e.height/2)*i+(t.y+t.height/2)}}var lD=Te(["rect","circle","line","ellipse","polygon","polyline","path","text","tspan","g"]),uD=function(){function e(e,t){this.type="geoSVG",this._usedGraphicMap=Te(),this._freedGraphics=[],this._mapName=e,this._parsedXML=GC(t)}return e.prototype.load=function(){var e=this._firstGraphic;if(!e){e=this._firstGraphic=this._buildGraphic(this._parsedXML),this._freedGraphics.push(e),this._boundingRect=this._firstGraphic.boundingRect.clone();var t=function(e){var t=[],n=Te();return W(e,(function(e){if(null==e.namedFrom){var r=new fb(e.name,e.el);t.push(r),n.set(e.name,r)}})),{regions:t,regionsMap:n}}(e.named),n=t.regions,r=t.regionsMap;this._regions=n,this._regionsMap=r}return{boundingRect:this._boundingRect,regions:this._regions,regionsMap:this._regionsMap}},e.prototype._buildGraphic=function(e){var t,n,r,i;try{me(null!=(n=(t=e&&(r=e,i={ignoreViewBox:!0,ignoreRootClip:!0},(new XC).parse(r,i))||{}).root))}catch(e){throw new Error("Invalid svg format\n"+e.message)}var o=new Yi;o.add(n),o.isGeoSVGGraphicRoot=!0;var a=t.width,s=t.height,l=t.viewBoxRect,u=this._boundingRect;if(!u){var c=void 0,h=void 0,d=void 0,p=void 0;if(null!=a?(c=0,d=a):l&&(c=l.x,d=l.width),null!=s?(h=0,p=s):l&&(h=l.y,p=l.height),null==c||null==h){var f=n.getBoundingRect();null==c&&(c=f.x,d=f.width),null==h&&(h=f.y,p=f.height)}u=this._boundingRect=new jt(c,h,d,p)}if(l){var g=sD(l,u);n.scaleX=n.scaleY=g.scale,n.x=g.x,n.y=g.y}o.setClipPath(new ol({shape:u.plain()}));var m=[];return W(t.named,(function(e){var t;null!=lD.get(e.svgNodeTagLower)&&(m.push(e),(t=e.el).silent=!1,t.isGroup&&t.traverse((function(e){e.silent=!1})))})),{root:o,boundingRect:u,named:m}},e.prototype.useGraphic=function(e){var t=this._usedGraphicMap,n=t.get(e);return n||(n=this._freedGraphics.pop()||this._buildGraphic(this._parsedXML),t.set(e,n),n)},e.prototype.freeGraphic=function(e){var t=this._usedGraphicMap,n=t.get(e);n&&(t.removeKey(e),this._freedGraphics.push(n))},e}();for(var cD=[126,25],hD="南海诸岛",dD=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],pD=0;pD<dD.length;pD++)for(var fD=0;fD<dD[pD].length;fD++)dD[pD][fD][0]/=10.5,dD[pD][fD][1]/=-14,dD[pD][fD][0]+=cD[0],dD[pD][fD][1]+=cD[1];var gD={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]};function mD(e,t){if("china"===e){var n=gD[t.name];if(n){var r=t.getCenter();r[0]+=n[0]/10.5,r[1]+=-n[1]/14,t.setCenter(r)}}}var vD=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];var yD=function(){function e(e,t,n){var r;this.type="geoJSON",this._parsedMap=Te(),this._mapName=e,this._specialAreas=n,this._geoJSON=ee(r=t)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(r):new Function("return ("+r+");")():r}return e.prototype.load=function(e,t){t=t||"name";var n=this._parsedMap.get(t);if(!n){var r=this._parseToRegions(t);n=this._parsedMap.set(t,{regions:r,boundingRect:_D(r)})}var i=Te(),o=[];return W(n.regions,(function(t){var n=t.name;e&&Ae(e,n)&&(t=t.cloneShallow(n=e[n])),o.push(t),i.set(n,t)})),{regions:o,boundingRect:n.boundingRect||new jt(0,0,0,0),regionsMap:i}},e.prototype._parseToRegions=function(e){var t,n=this._mapName,r=this._geoJSON;try{t=r?vb(r,e):[]}catch(e){throw new Error("Invalid geoJson format\n"+e.message)}return function(e,t){if("china"===e){for(var n=0;n<t.length;n++)if(t[n].name===hD)return;t.push(new pb(hD,j(dD,(function(e){return{type:"polygon",exterior:e}})),cD))}}(n,t),W(t,(function(e){var t=e.name;mD(n,e),function(e,t){"china"===e&&"台湾"===t.name&&t.geometries.push({type:"polygon",exterior:vD[0]})}(n,e);var r=this._specialAreas&&this._specialAreas[t];r&&e.transformTo(r.left,r.top,r.width,r.height)}),this),t},e.prototype.getMapForUser=function(){return{geoJson:this._geoJSON,geoJSON:this._geoJSON,specialAreas:this._specialAreas}},e}();function _D(e){for(var t,n=0;n<e.length;n++){var r=e[n].getBoundingRect();(t=t||r.clone()).union(r)}return t}var xD=Te(),bD=function(e,t,n){if(t.svg){var r=new uD(e,t.svg);xD.set(e,r)}else{var i=t.geoJson||t.geoJSON;i&&!t.features?n=t.specialAreas:i=t;r=new yD(e,i,n);xD.set(e,r)}},wD=function(e){return xD.get(e)},SD=function(e){var t=xD.get(e);return t&&"geoJSON"===t.type&&t.getMapForUser()},TD=function(e,t,n){var r=xD.get(e);if(r)return r.load(t,n);"production"!==process.env.NODE_ENV&&console.error("Map "+e+" not exists. The GeoJSON of the map must be provided.")},MD=["rect","circle","line","ellipse","polygon","polyline","path"],CD=Te(MD),DD=Te(MD.concat(["g"])),AD=Te(MD.concat(["g"])),ID=ta();function ED(e){var t=e.getItemStyle(),n=e.get("areaColor");return null!=n&&(t.fill=n),t}function LD(e){var t=e.style;t&&(t.stroke=t.stroke||t.fill,t.fill=null)}var ND=function(){function e(e){var t=new Yi;this.uid=Xh("ec_map_draw"),this._controller=new NC(e.getZr()),this._controllerHost={target:t},this.group=t,t.add(this._regionsGroup=new Yi),t.add(this._svgGroup=new Yi)}return e.prototype.draw=function(e,t,n,r,i){var o="geo"===e.mainType,a=e.getData&&e.getData();o&&t.eachComponent({mainType:"series",subType:"map"},(function(t){a||t.getHostGeoModel()!==e||(a=t.getData())}));var s=e.coordinateSystem,l=this._regionsGroup,u=this.group,c=s.getTransformInfo(),h=c.raw,d=c.roam;!l.childAt(0)||i?(u.x=d.x,u.y=d.y,u.scaleX=d.scaleX,u.scaleY=d.scaleY,u.dirty()):Oc(u,d,e);var p=a&&a.getVisual("visualMeta")&&a.getVisual("visualMeta").length>0,f={api:n,geo:s,mapOrGeoModel:e,data:a,isVisualEncodedByVisualMap:p,isGeo:o,transformInfoRaw:h};"geoJSON"===s.resourceType?this._buildGeoJSON(f):"geoSVG"===s.resourceType&&this._buildSVG(f),this._updateController(e,t,n),this._updateMapSelectHandler(e,l,n,r)},e.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=Te(),n=Te(),r=this._regionsGroup,i=e.transformInfoRaw,o=e.mapOrGeoModel,a=e.data,s=e.geo.projection,l=s&&s.stream;function u(e,t){return t&&(e=t(e)),e&&[e[0]*i.scaleX+i.x,e[1]*i.scaleY+i.y]}function c(e){for(var t=[],n=!l&&s&&s.project,r=0;r<e.length;++r){var i=u(e[r],n);i&&t.push(i)}return t}function h(e){return{shape:{points:c(e)}}}r.removeAll(),W(e.geo.regions,(function(i){var c=i.name,d=t.get(c),p=n.get(c)||{},f=p.dataIdx,g=p.regionModel;d||(d=t.set(c,new Yi),r.add(d),f=a?a.indexOfName(c):null,g=e.isGeo?o.getRegionModel(c):a?a.getItemModel(f):null,n.set(c,{dataIdx:f,regionModel:g}));var m=[],v=[];W(i.geometries,(function(e){if("polygon"===e.type){var t=[e.exterior].concat(e.interiors||[]);l&&(t=VD(t,l)),W(t,(function(e){m.push(new lc(h(e)))}))}else{var n=e.points;l&&(n=VD(n,l,!0)),W(n,(function(e){v.push(new cc(h(e)))}))}}));var y=u(i.getCenter(),s&&s.project);function _(t,n){if(t.length){var r=new xc({culling:!0,segmentIgnoreThreshold:1,shape:{paths:t}});d.add(r),PD(e,r,f,g),OD(e,r,c,g,o,f,y),n&&(LD(r),W(r.states,LD))}}_(m),_(v,!0)})),t.each((function(t,r){var i=n.get(r),a=i.dataIdx,s=i.regionModel;RD(e,t,r,s,o,a),kD(e,t,r,s,o),zD(e,t,r,s,o)}),this)},e.prototype._buildSVG=function(e){var t=e.geo.map,n=e.transformInfoRaw;this._svgGroup.x=n.x,this._svgGroup.y=n.y,this._svgGroup.scaleX=n.scaleX,this._svgGroup.scaleY=n.scaleY,this._svgResourceChanged(t)&&(this._freeSVG(),this._useSVG(t));var r=this._svgDispatcherMap=Te(),i=!1;W(this._svgGraphicRecord.named,(function(t){var n=t.name,o=e.mapOrGeoModel,a=e.data,s=t.svgNodeTagLower,l=t.el,u=a?a.indexOfName(n):null,c=o.getRegionModel(n);(null!=CD.get(s)&&l instanceof ja&&PD(e,l,u,c),l instanceof ja&&(l.culling=!0),l.z2EmphasisLift=0,t.namedFrom)||(null!=AD.get(s)&&OD(e,l,n,c,o,u,null),RD(e,l,n,c,o,u),kD(e,l,n,c,o),null!=DD.get(s)&&("self"===zD(e,l,n,c,o)&&(i=!0),(r.get(n)||r.set(n,[])).push(l)))}),this),this._enableBlurEntireSVG(i,e)},e.prototype._enableBlurEntireSVG=function(e,t){if(e&&t.isGeo){var n=t.mapOrGeoModel.getModel(["blur","itemStyle"]).getItemStyle().opacity;this._svgGraphicRecord.root.traverse((function(e){if(!e.isGroup){Yl(e);var t=e.ensureState("blur").style||{};null==t.opacity&&null!=n&&(t.opacity=n),e.ensureState("emphasis")}}))}},e.prototype.remove=function(){this._regionsGroup.removeAll(),this._regionsGroupByName=null,this._svgGroup.removeAll(),this._freeSVG(),this._controller.dispose(),this._controllerHost=null},e.prototype.findHighDownDispatchers=function(e,t){if(null==e)return[];var n=t.coordinateSystem;if("geoJSON"===n.resourceType){var r=this._regionsGroupByName;if(r){var i=r.get(e);return i?[i]:[]}}else if("geoSVG"===n.resourceType)return this._svgDispatcherMap&&this._svgDispatcherMap.get(e)||[]},e.prototype._svgResourceChanged=function(e){return this._svgMapName!==e},e.prototype._useSVG=function(e){var t=wD(e);if(t&&"geoSVG"===t.type){var n=t.useGraphic(this.uid);this._svgGroup.add(n.root),this._svgGraphicRecord=n,this._svgMapName=e}},e.prototype._freeSVG=function(){var e=this._svgMapName;if(null!=e){var t=wD(e);t&&"geoSVG"===t.type&&t.freeGraphic(this.uid),this._svgGraphicRecord=null,this._svgDispatcherMap=null,this._svgGroup.removeAll(),this._svgMapName=null}},e.prototype._updateController=function(e,t,n){var r=e.coordinateSystem,i=this._controller,o=this._controllerHost;o.zoomLimit=e.get("scaleLimit"),o.zoom=r.getZoom(),i.enable(e.get("roam")||!1);var a=e.mainType;function s(){var t={type:"geoRoam",componentType:a};return t[a+"Id"]=e.id,t}i.off("pan").on("pan",(function(e){this._mouseDownFlag=!1,kC(o,e.dx,e.dy),n.dispatchAction(z(s(),{dx:e.dx,dy:e.dy,animation:{duration:0}}))}),this),i.off("zoom").on("zoom",(function(e){this._mouseDownFlag=!1,zC(o,e.scale,e.originX,e.originY),n.dispatchAction(z(s(),{totalZoom:o.zoom,zoom:e.scale,originX:e.originX,originY:e.originY,animation:{duration:0}}))}),this),i.setPointerChecker((function(t,i,o){return r.containPoint([i,o])&&!FC(t,n,e)}))},e.prototype.resetForLabelLayout=function(){this.group.traverse((function(e){var t=e.getTextContent();t&&(t.ignore=ID(t).ignore)}))},e.prototype._updateMapSelectHandler=function(e,t,n,r){var i=this;t.off("mousedown"),t.off("click"),e.get("selectedMode")&&(t.on("mousedown",(function(){i._mouseDownFlag=!0})),t.on("click",(function(e){i._mouseDownFlag&&(i._mouseDownFlag=!1)})))},e}();function PD(e,t,n,r){var i=r.getModel("itemStyle"),o=r.getModel(["emphasis","itemStyle"]),a=r.getModel(["blur","itemStyle"]),s=r.getModel(["select","itemStyle"]),l=ED(i),u=ED(o),c=ED(s),h=ED(a),d=e.data;if(d){var p=d.getItemVisual(n,"style"),f=d.getItemVisual(n,"decal");e.isVisualEncodedByVisualMap&&p.fill&&(l.fill=p.fill),f&&(l.decal=Bv(f,e.api))}t.setStyle(l),t.style.strokeNoScale=!0,t.ensureState("emphasis").style=u,t.ensureState("select").style=c,t.ensureState("blur").style=h,Yl(t)}function OD(e,t,n,r,i,o,a){var s=e.data,l=e.isGeo,u=s&&isNaN(s.get(s.mapDimension("value"),o)),c=s&&s.getItemLayout(o);if(l||u||c&&c.showLabel){var h=l?n:o,d=void 0;(!s||o>=0)&&(d=i);var p=a?{normal:{align:"center",verticalAlign:"middle"}}:null;xh(t,bh(r),{labelFetcher:d,labelDataIndex:h,defaultText:n},p);var f=t.getTextContent();if(f&&(ID(f).ignore=f.ignore,t.textConfig&&a)){var g=t.getBoundingRect().clone();t.textConfig.layoutRect=g,t.textConfig.position=[(a[0]-g.x)/g.width*100+"%",(a[1]-g.y)/g.height*100+"%"]}t.disableLabelAnimation=!0}else t.removeTextContent(),t.removeTextConfig(),t.disableLabelAnimation=null}function RD(e,t,n,r,i,o){e.data?e.data.setItemGraphicEl(o,t):bl(t).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:n,region:r&&r.option||{}}}function kD(e,t,n,r,i){e.data||ph({el:t,componentModel:i,itemName:n,itemTooltipOption:r.get("tooltip")})}function zD(e,t,n,r,i){t.highDownSilentOnTouch=!!i.get("selectedMode");var o=r.getModel("emphasis"),a=o.get("focus");return cu(t,a,o.get("blurScope"),o.get("disabled")),e.isGeo&&function(e,t,n){var r=bl(e);r.componentMainType=t.mainType,r.componentIndex=t.componentIndex,r.componentHighDownName=n}(t,i,n),a}function VD(e,t,n){var r,i=[];function o(){r=[]}function a(){r.length&&(i.push(r),r=[])}var s=t({polygonStart:o,polygonEnd:a,lineStart:o,lineEnd:a,point:function(e,t){isFinite(e)&&isFinite(t)&&r.push([e,t])},sphere:function(){}});return!n&&s.polygonStart(),W(e,(function(e){s.lineStart();for(var t=0;t<e.length;t++)s.point(e[t][0],e[t][1]);s.lineEnd()})),!n&&s.polygonEnd(),i}var BD=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n,r){if(!r||"mapToggleSelect"!==r.type||r.from!==this.uid){var i=this.group;if(i.removeAll(),!e.getHostGeoModel()){if(this._mapDraw&&r&&"geoRoam"===r.type&&this._mapDraw.resetForLabelLayout(),r&&"geoRoam"===r.type&&"series"===r.componentType&&r.seriesId===e.id)(o=this._mapDraw)&&i.add(o.group);else if(e.needsDrawMap){var o=this._mapDraw||new ND(n);i.add(o.group),o.draw(e,t,n,this,r),this._mapDraw=o}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;e.get("showLegendSymbol")&&t.getComponent("legend")&&this._renderSymbols(e,t,n)}}},t.prototype.remove=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},t.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},t.prototype._renderSymbols=function(e,t,n){var r=e.originalData,i=this.group;r.each(r.mapDimension("value"),(function(t,n){if(!isNaN(t)){var o=r.getItemLayout(n);if(o&&o.point){var a=o.point,s=o.offset,l=new Fu({style:{fill:e.getData().getVisual("style").fill},shape:{cx:a[0]+9*s,cy:a[1],r:3},silent:!0,z2:8+(s?0:11)});if(!s){var u=e.mainSeries.getData(),c=r.getName(n),h=u.indexOfName(c),d=r.getItemModel(n),p=d.getModel("label"),f=u.getItemGraphicEl(h);xh(l,bh(d),{labelFetcher:{getFormattedLabel:function(t,n){return e.getFormattedLabel(h,n)}},defaultText:c}),l.disableLabelAnimation=!0,p.get("position")||l.setTextConfig({position:"bottom"}),f.onHoverStateChange=function(e){jl(l,e)}}i.add(l)}}}))},t.type="map",t}(em),FD=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.needsDrawMap=!1,n.seriesGroup=[],n.getTooltipPosition=function(e){if(null!=e){var t=this.getData().getName(e),n=this.coordinateSystem,r=n.getRegion(t);return r&&n.dataToPoint(r.getCenter())}},n}return l(t,e),t.prototype.getInitialData=function(e){for(var t=hM(this,{coordDimensions:["value"],encodeDefaulter:$(_p,this)}),n=Te(),r=[],i=0,o=t.count();i<o;i++){var a=t.getName(i);n.set(a,!0)}return W(TD(this.getMapType(),this.option.nameMap,this.option.nameProperty).regions,(function(e){var t=e.name;n.get(t)||r.push(t)})),t.appendValues([],r),t},t.prototype.getHostGeoModel=function(){var e=this.option.geoIndex;return null!=e?this.ecModel.getComponent("geo",e):null},t.prototype.getMapType=function(){return(this.getHostGeoModel()||this).option.map},t.prototype.getRawValue=function(e){var t=this.getData();return t.get(t.mapDimension("value"),e)},t.prototype.getRegionModel=function(e){var t=this.getData();return t.getItemModel(t.indexOfName(e))},t.prototype.formatTooltip=function(e,t,n){for(var r=this.getData(),i=this.getRawValue(e),o=r.getName(e),a=this.seriesGroup,s=[],l=0;l<a.length;l++){var u=a[l].originalData.indexOfName(o),c=r.mapDimension("value");isNaN(a[l].originalData.get(c,u))||s.push(a[l].name)}return Cg("section",{header:s.join(", "),noHeader:!s.length,blocks:[Cg("nameValue",{name:o,value:i})]})},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.getLegendIcon=function(e){var t=e.icon||"roundRect",n=dv(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill);return n.setStyle(e.itemStyle),n.style.stroke="none",t.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},t.type="series.map",t.dependencies=["geo"],t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},t}(Hg);function GD(e){var t={};e.eachSeriesByType("map",(function(e){var n=e.getHostGeoModel(),r=n?"o"+n.id:"i"+e.getMapType();(t[r]=t[r]||[]).push(e)})),W(t,(function(e,t){for(var n,r,i,o=(n=j(e,(function(e){return e.getData()})),r=e[0].get("mapValueCalculation"),i={},W(n,(function(e){e.each(e.mapDimension("value"),(function(t,n){var r="ec-"+e.getName(n);i[r]=i[r]||[],isNaN(t)||i[r].push(t)}))})),n[0].map(n[0].mapDimension("value"),(function(e,t){for(var o="ec-"+n[0].getName(t),a=0,s=1/0,l=-1/0,u=i[o].length,c=0;c<u;c++)s=Math.min(s,i[o][c]),l=Math.max(l,i[o][c]),a+=i[o][c];return 0===u?NaN:"min"===r?s:"max"===r?l:"average"===r?a/u:a}))),a=0;a<e.length;a++)e[a].originalData=e[a].getData();for(a=0;a<e.length;a++)e[a].seriesGroup=e,e[a].needsDrawMap=0===a&&!e[a].getHostGeoModel(),e[a].setData(o.cloneShallow()),e[a].mainSeries=e[0]}))}function HD(e){var t={};e.eachSeriesByType("map",(function(n){var r=n.getMapType();if(!n.getHostGeoModel()&&!t[r]){var i={};W(n.seriesGroup,(function(t){var n=t.coordinateSystem,r=t.originalData;t.get("showLegendSymbol")&&e.getComponent("legend")&&r.each(r.mapDimension("value"),(function(e,t){var o=r.getName(t),a=n.getRegion(o);if(a&&!isNaN(e)){var s=i[o]||0,l=n.dataToPoint(a.getCenter());i[o]=s+1,r.setItemLayout(t,{point:l,offset:s})}}))}));var o=n.getData();o.each((function(e){var t=o.getName(e),n=o.getItemLayout(e)||{};n.showLabel=!i[t],o.setItemLayout(e,n)})),t[r]=!0}}))}var UD=Ke,WD=function(e){function t(t){var n=e.call(this)||this;return n.type="view",n.dimensions=["x","y"],n._roamTransformable=new Mi,n._rawTransformable=new Mi,n.name=t,n}return l(t,e),t.prototype.setBoundingRect=function(e,t,n,r){return this._rect=new jt(e,t,n,r),this._rect},t.prototype.getBoundingRect=function(){return this._rect},t.prototype.setViewRect=function(e,t,n,r){this._transformTo(e,t,n,r),this._viewRect=new jt(e,t,n,r)},t.prototype._transformTo=function(e,t,n,r){var i=this.getBoundingRect(),o=this._rawTransformable;o.transform=i.calculateTransform(new jt(e,t,n,r));var a=o.parent;o.parent=null,o.decomposeTransform(),o.parent=a,this._updateTransform()},t.prototype.setCenter=function(e,t){e&&(this._center=[oo(e[0],t.getWidth()),oo(e[1],t.getHeight())],this._updateCenterAndZoom())},t.prototype.setZoom=function(e){e=e||1;var t=this.zoomLimit;t&&(null!=t.max&&(e=Math.min(t.max,e)),null!=t.min&&(e=Math.max(t.min,e))),this._zoom=e,this._updateCenterAndZoom()},t.prototype.getDefaultCenter=function(){var e=this.getBoundingRect();return[e.x+e.width/2,e.y+e.height/2]},t.prototype.getCenter=function(){return this._center||this.getDefaultCenter()},t.prototype.getZoom=function(){return this._zoom||1},t.prototype.getRoamTransform=function(){return this._roamTransformable.getLocalTransform()},t.prototype._updateCenterAndZoom=function(){var e=this._rawTransformable.getLocalTransform(),t=this._roamTransformable,n=this.getDefaultCenter(),r=this.getCenter(),i=this.getZoom();r=Ke([],r,e),n=Ke([],n,e),t.originX=r[0],t.originY=r[1],t.x=n[0]-r[0],t.y=n[1]-r[1],t.scaleX=t.scaleY=i,this._updateTransform()},t.prototype._updateTransform=function(){var e=this._roamTransformable,t=this._rawTransformable;t.parent=e,e.updateTransform(),t.updateTransform(),At(this.transform||(this.transform=[]),t.transform||[1,0,0,1,0,0]),this._rawTransform=t.getLocalTransform(),this.invTransform=this.invTransform||[],Pt(this.invTransform,this.transform),this.decomposeTransform()},t.prototype.getTransformInfo=function(){var e=this._rawTransformable,t=this._roamTransformable,n=new Mi;return n.transform=t.transform,n.decomposeTransform(),{roam:{x:n.x,y:n.y,scaleX:n.scaleX,scaleY:n.scaleY},raw:{x:e.x,y:e.y,scaleX:e.scaleX,scaleY:e.scaleY}}},t.prototype.getViewRect=function(){return this._viewRect},t.prototype.getViewRectAfterRoam=function(){var e=this.getBoundingRect().clone();return e.applyTransform(this.transform),e},t.prototype.dataToPoint=function(e,t,n){var r=t?this._rawTransform:this.transform;return n=n||[],r?UD(n,e,r):Pe(n,e)},t.prototype.pointToData=function(e){var t=this.invTransform;return t?UD([],e,t):[e[0],e[1]]},t.prototype.convertToPixel=function(e,t,n){var r=jD(t);return r===this?r.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,t,n){var r=jD(t);return r===this?r.pointToData(n):null},t.prototype.containPoint=function(e){return this.getViewRectAfterRoam().contain(e[0],e[1])},t.dimensions=["x","y"],t}(Mi);function jD(e){var t=e.seriesModel;return t?t.coordinateSystem:null}var XD={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},YD=["lng","lat"],ZD=function(e){function t(t,n,r){var i=e.call(this,t)||this;i.dimensions=YD,i.type="geo",i._nameCoordMap=Te(),i.map=n;var o,a=r.projection,s=TD(n,r.nameMap,r.nameProperty),l=wD(n),u=i.resourceType=l?l.type:null,c=i.regions=s.regions,h=XD[l.type];if(i._regionsMap=s.regionsMap,i.regions=s.regions,"production"!==process.env.NODE_ENV&&a&&("geoSVG"===u&&("production"!==process.env.NODE_ENV&&No("Map "+n+" with SVG source can't use projection. Only GeoJSON source supports projection."),a=null),a.project&&a.unproject||("production"!==process.env.NODE_ENV&&No("project and unproject must be both provided in the projeciton."),a=null)),i.projection=a,a)for(var d=0;d<c.length;d++){var p=c[d].getBoundingRect(a);(o=o||p.clone()).union(p)}else o=s.boundingRect;return i.setBoundingRect(o.x,o.y,o.width,o.height),i.aspectScale=a?1:de(r.aspectScale,h.aspectScale),i._invertLongitute=!a&&h.invertLongitute,i}return l(t,e),t.prototype._transformTo=function(e,t,n,r){var i=this.getBoundingRect(),o=this._invertLongitute;i=i.clone(),o&&(i.y=-i.y-i.height);var a=this._rawTransformable;a.transform=i.calculateTransform(new jt(e,t,n,r));var s=a.parent;a.parent=null,a.decomposeTransform(),a.parent=s,o&&(a.scaleY=-a.scaleY),this._updateTransform()},t.prototype.getRegion=function(e){return this._regionsMap.get(e)},t.prototype.getRegionByCoord=function(e){for(var t=this.regions,n=0;n<t.length;n++){var r=t[n];if("geoJSON"===r.type&&r.contain(e))return t[n]}},t.prototype.addGeoCoord=function(e,t){this._nameCoordMap.set(e,t)},t.prototype.getGeoCoord=function(e){var t=this._regionsMap.get(e);return this._nameCoordMap.get(e)||t&&t.getCenter()},t.prototype.dataToPoint=function(e,t,n){if(ee(e)&&(e=this.getGeoCoord(e)),e){var r=this.projection;return r&&(e=r.project(e)),e&&this.projectedToPoint(e,t,n)}},t.prototype.pointToData=function(e){var t=this.projection;return t&&(e=t.unproject(e)),e&&this.pointToProjected(e)},t.prototype.pointToProjected=function(t){return e.prototype.pointToData.call(this,t)},t.prototype.projectedToPoint=function(t,n,r){return e.prototype.dataToPoint.call(this,t,n,r)},t.prototype.convertToPixel=function(e,t,n){var r=qD(t);return r===this?r.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,t,n){var r=qD(t);return r===this?r.pointToData(n):null},t}(WD);function qD(e){var t=e.geoModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem||(n.getReferringComponents("geo",oa).models[0]||{}).coordinateSystem:null}function KD(e,t){var n=e.get("boundingCoords");if(null!=n){var r=n[0],i=n[1];if(isFinite(r[0])&&isFinite(r[1])&&isFinite(i[0])&&isFinite(i[1])){var o=this.projection;if(o){var a=r[0],s=r[1],l=i[0],u=i[1];r=[1/0,1/0],i=[-1/0,-1/0];var c=function(e,t,n,a){for(var s=n-e,l=a-t,u=0;u<=100;u++){var c=u/100,h=o.project([e+s*c,t+l*c]);$e(r,r,h),Je(i,i,h)}};c(a,s,l,s),c(l,s,l,u),c(l,u,a,u),c(a,u,l,s)}this.setBoundingRect(r[0],r[1],i[0]-r[0],i[1]-r[1])}else"production"!==process.env.NODE_ENV&&console.error("Invalid boundingCoords")}var h,d,p,f=this.getBoundingRect(),g=e.get("layoutCenter"),m=e.get("layoutSize"),v=t.getWidth(),y=t.getHeight(),_=f.width/f.height*this.aspectScale,x=!1;if(g&&m&&(h=[oo(g[0],v),oo(g[1],y)],d=oo(m,Math.min(v,y)),isNaN(h[0])||isNaN(h[1])||isNaN(d)?"production"!==process.env.NODE_ENV&&console.warn("Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead."):x=!0),x)p={},_>1?(p.width=d,p.height=d/_):(p.height=d,p.width=d*_),p.y=h[1]-p.height/2,p.x=h[0]-p.width/2;else{var b=e.getBoxLayoutParams();b.aspect=_,p=Zd(b,{width:v,height:y})}this.setViewRect(p.x,p.y,p.width,p.height),this.setCenter(e.get("center"),t),this.setZoom(e.get("zoom"))}H(ZD,WD);var $D=function(){function e(){this.dimensions=YD}return e.prototype.create=function(e,t){var n=[];function r(e){return{nameProperty:e.get("nameProperty"),aspectScale:e.get("aspectScale"),projection:e.get("projection")}}e.eachComponent("geo",(function(e,i){var o=e.get("map"),a=new ZD(o+i,o,z({nameMap:e.get("nameMap")},r(e)));a.zoomLimit=e.get("scaleLimit"),n.push(a),e.coordinateSystem=a,a.model=e,a.resize=KD,a.resize(e,t)})),e.eachSeries((function(e){if("geo"===e.get("coordinateSystem")){var t=e.get("geoIndex")||0;e.coordinateSystem=n[t]}}));var i={};return e.eachSeriesByType("map",(function(e){if(!e.getHostGeoModel()){var t=e.getMapType();i[t]=i[t]||[],i[t].push(e)}})),W(i,(function(e,i){var o=j(e,(function(e){return e.get("nameMap")})),a=new ZD(i,i,z({nameMap:k(o)},r(e[0])));a.zoomLimit=he.apply(null,j(e,(function(e){return e.get("scaleLimit")}))),n.push(a),a.resize=KD,a.resize(e[0],t),W(e,(function(e){e.coordinateSystem=a,function(e,t){W(t.get("geoCoord"),(function(t,n){e.addGeoCoord(n,t)}))}(a,e)}))})),n},e.prototype.getFilledRegions=function(e,t,n,r){for(var i=(e||[]).slice(),o=Te(),a=0;a<i.length;a++)o.set(i[a].name,i[a]);return W(TD(t,n,r).regions,(function(e){var t=e.name;!o.get(t)&&i.push({name:t})})),i},e}(),JD=new $D,QD=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(e,t,n){var r=wD(e.map);if(r&&"geoJSON"===r.type){var i=e.itemStyle=e.itemStyle||{};"color"in i||(i.color="#eee")}this.mergeDefaultAndTheme(e,n),Ho(e,"label",["show"])},t.prototype.optionUpdated=function(){var e=this,t=this.option;t.regions=JD.getFilledRegions(t.regions,t.map,t.nameMap,t.nameProperty);var n={};this._optionModelMap=X(t.regions||[],(function(t,r){var i=r.name;return i&&(t.set(i,new Wh(r,e,e.ecModel)),r.selected&&(n[i]=!0)),t}),Te()),t.selectedMap||(t.selectedMap=n)},t.prototype.getRegionModel=function(e){return this._optionModelMap.get(e)||new Wh(null,this,this.ecModel)},t.prototype.getFormattedLabel=function(e,t){var n=this.getRegionModel(e),r="normal"===t?n.get(["label","formatter"]):n.get(["emphasis","label","formatter"]),i={name:e};return Q(r)?(i.status=t,r(i)):ee(r)?r.replace("{a}",null!=e?e:""):void 0},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.select=function(e){var t=this.option,n=t.selectedMode;n&&("multiple"!==n&&(t.selectedMap=null),(t.selectedMap||(t.selectedMap={}))[e]=!0)},t.prototype.unSelect=function(e){var t=this.option.selectedMap;t&&(t[e]=!1)},t.prototype.toggleSelected=function(e){this[this.isSelected(e)?"unSelect":"select"](e)},t.prototype.isSelected=function(e){var t=this.option.selectedMap;return!(!t||!t[e])},t.type="geo",t.layoutMode="box",t.defaultOption={z:0,show:!0,left:"center",top:"center",aspectScale:null,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},t}(tp);function eA(e,t){return e.pointToProjected?e.pointToProjected(t):e.pointToData(t)}function tA(e,t,n,r){var i=e.getZoom(),o=e.getCenter(),a=t.zoom,s=e.projectedToPoint?e.projectedToPoint(o):e.dataToPoint(o);if(null!=t.dx&&null!=t.dy&&(s[0]-=t.dx,s[1]-=t.dy,e.setCenter(eA(e,s),r)),null!=a){if(n){var l=n.min||0,u=n.max||1/0;a=Math.max(Math.min(i*a,u),l)/i}e.scaleX*=a,e.scaleY*=a;var c=(t.originX-e.x)*(a-1),h=(t.originY-e.y)*(a-1);e.x-=c,e.y-=h,e.updateTransform(),e.setCenter(eA(e,s),r),e.setZoom(a*i)}return{center:e.getCenter(),zoom:e.getZoom()}}var nA=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.focusBlurEnabled=!0,n}return l(t,e),t.prototype.init=function(e,t){this._api=t},t.prototype.render=function(e,t,n,r){if(this._model=e,!e.get("show"))return this._mapDraw&&this._mapDraw.remove(),void(this._mapDraw=null);this._mapDraw||(this._mapDraw=new ND(n));var i=this._mapDraw;i.draw(e,t,n,this,r),i.group.on("click",this._handleRegionClick,this),i.group.silent=e.get("silent"),this.group.add(i.group),this.updateSelectStatus(e,t,n)},t.prototype._handleRegionClick=function(e){var t;ev(e.target,(function(e){return null!=(t=bl(e).eventData)}),!0),t&&this._api.dispatchAction({type:"geoToggleSelect",geoId:this._model.id,name:t.name})},t.prototype.updateSelectStatus=function(e,t,n){var r=this;this._mapDraw.group.traverse((function(e){var t=bl(e).eventData;if(t)return r._model.isSelected(t.name)?n.enterSelect(e):n.leaveSelect(e),!0}))},t.prototype.findHighDownDispatchers=function(e){return this._mapDraw&&this._mapDraw.findHighDownDispatchers(e,this._model)},t.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove()},t.type="geo",t}(Kg);function rA(e,t,n){bD(e,t,n)}function iA(e){function t(t,n){n.update="geo:updateSelectStatus",e.registerAction(n,(function(e,n){var r={},i=[];return n.eachComponent({mainType:"geo",query:e},(function(n){n[t](e.name),W(n.coordinateSystem.regions,(function(e){r[e.name]=n.isSelected(e.name)||!1}));var o=[];W(r,(function(e,t){r[t]&&o.push(t)})),i.push({geoIndex:n.componentIndex,name:o})})),{selected:r,allSelected:i,name:e.name}}))}e.registerCoordinateSystem("geo",JD),e.registerComponentModel(QD),e.registerComponentView(nA),e.registerImpl("registerMap",rA),e.registerImpl("getMap",(function(e){return SD(e)})),t("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),t("select",{type:"geoSelect",event:"geoselected"}),t("unSelect",{type:"geoUnSelect",event:"geounselected"}),e.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},(function(e,t,n){var r=e.componentType||"series";t.eachComponent({mainType:r,query:e},(function(t){var i=t.coordinateSystem;if("geo"===i.type){var o=tA(i,e,t.get("scaleLimit"),n);t.setCenter&&t.setCenter(o.center),t.setZoom&&t.setZoom(o.zoom),"series"===r&&W(t.seriesGroup,(function(e){e.setCenter(o.center),e.setZoom(o.zoom)}))}}))}))}function oA(e,t){var n=e.isExpand?e.children:[],r=e.parentNode.children,i=e.hierNode.i?r[e.hierNode.i-1]:null;if(n.length){!function(e){var t=e.children,n=t.length,r=0,i=0;for(;--n>=0;){var o=t[n];o.hierNode.prelim+=r,o.hierNode.modifier+=r,i+=o.hierNode.change,r+=o.hierNode.shift+i}}(e);var o=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;i?(e.hierNode.prelim=i.hierNode.prelim+t(e,i),e.hierNode.modifier=e.hierNode.prelim-o):e.hierNode.prelim=o}else i&&(e.hierNode.prelim=i.hierNode.prelim+t(e,i));e.parentNode.hierNode.defaultAncestor=function(e,t,n,r){if(t){for(var i=e,o=e,a=o.parentNode.children[0],s=t,l=i.hierNode.modifier,u=o.hierNode.modifier,c=a.hierNode.modifier,h=s.hierNode.modifier;s=uA(s),o=cA(o),s&&o;){i=uA(i),a=cA(a),i.hierNode.ancestor=e;var d=s.hierNode.prelim+h-o.hierNode.prelim-u+r(s,o);d>0&&(dA(hA(s,e,n),e,d),u+=d,l+=d),h+=s.hierNode.modifier,u+=o.hierNode.modifier,l+=i.hierNode.modifier,c+=a.hierNode.modifier}s&&!uA(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=h-l),o&&!cA(a)&&(a.hierNode.thread=o,a.hierNode.modifier+=u-c,n=e)}return n}(e,i,e.parentNode.hierNode.defaultAncestor||r[0],t)}function aA(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function sA(e){return arguments.length?e:pA}function lA(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function uA(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function cA(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function hA(e,t,n){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:n}function dA(e,t,n){var r=n/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=r,t.hierNode.shift+=n,t.hierNode.modifier+=n,t.hierNode.prelim+=n,e.hierNode.change+=r}function pA(e,t){return e.parentNode===t.parentNode?1:2}var fA=function(){this.parentPoint=[],this.childPoints=[]},gA=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new fA},t.prototype.buildPath=function(e,t){var n=t.childPoints,r=n.length,i=t.parentPoint,o=n[0],a=n[r-1];if(1===r)return e.moveTo(i[0],i[1]),void e.lineTo(o[0],o[1]);var s=t.orient,l="TB"===s||"BT"===s?0:1,u=1-l,c=oo(t.forkPosition,1),h=[];h[l]=i[l],h[u]=i[u]+(a[u]-i[u])*c,e.moveTo(i[0],i[1]),e.lineTo(h[0],h[1]),e.moveTo(o[0],o[1]),h[l]=o[l],e.lineTo(h[0],h[1]),h[l]=a[l],e.lineTo(h[0],h[1]),e.lineTo(a[0],a[1]);for(var d=1;d<r-1;d++){var p=n[d];e.moveTo(p[0],p[1]),h[l]=p[l],e.lineTo(h[0],h[1])}},t}(Ys),mA=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._mainGroup=new Yi,n}return l(t,e),t.prototype.init=function(e,t){this._controller=new NC(t.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},t.prototype.render=function(e,t,n){var r=e.getData(),i=e.layoutInfo,o=this._mainGroup;"radial"===e.get("layout")?(o.x=i.x+i.width/2,o.y=i.y+i.height/2):(o.x=i.x,o.y=i.y),this._updateViewCoordSys(e,n),this._updateController(e,t,n);var a=this._data;r.diff(a).add((function(t){vA(r,t)&&yA(r,t,null,o,e)})).update((function(t,n){var i=a.getItemGraphicEl(n);vA(r,t)?yA(r,t,i,o,e):i&&bA(a,n,i,o,e)})).remove((function(t){var n=a.getItemGraphicEl(t);n&&bA(a,t,n,o,e)})).execute(),this._nodeScaleRatio=e.get("nodeScaleRatio"),this._updateNodeAndLinkScale(e),!0===e.get("expandAndCollapse")&&r.eachItemGraphicEl((function(t,r){t.off("click").on("click",(function(){n.dispatchAction({type:"treeExpandAndCollapse",seriesId:e.id,dataIndex:r})}))})),this._data=r},t.prototype._updateViewCoordSys=function(e,t){var n=e.getData(),r=[];n.each((function(e){var t=n.getItemLayout(e);!t||isNaN(t.x)||isNaN(t.y)||r.push([+t.x,+t.y])}));var i=[],o=[];ns(r,i,o);var a=this._min,s=this._max;o[0]-i[0]==0&&(i[0]=a?a[0]:i[0]-1,o[0]=s?s[0]:o[0]+1),o[1]-i[1]==0&&(i[1]=a?a[1]:i[1]-1,o[1]=s?s[1]:o[1]+1);var l=e.coordinateSystem=new WD;l.zoomLimit=e.get("scaleLimit"),l.setBoundingRect(i[0],i[1],o[0]-i[0],o[1]-i[1]),l.setCenter(e.get("center"),t),l.setZoom(e.get("zoom")),this.group.attr({x:l.x,y:l.y,scaleX:l.scaleX,scaleY:l.scaleY}),this._min=i,this._max=o},t.prototype._updateController=function(e,t,n){var r=this,i=this._controller,o=this._controllerHost,a=this.group;i.setPointerChecker((function(t,r,i){var o=a.getBoundingRect();return o.applyTransform(a.transform),o.contain(r,i)&&!FC(t,n,e)})),i.enable(e.get("roam")),o.zoomLimit=e.get("scaleLimit"),o.zoom=e.coordinateSystem.getZoom(),i.off("pan").off("zoom").on("pan",(function(t){kC(o,t.dx,t.dy),n.dispatchAction({seriesId:e.id,type:"treeRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){zC(o,t.scale,t.originX,t.originY),n.dispatchAction({seriesId:e.id,type:"treeRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),r._updateNodeAndLinkScale(e),n.updateLabelLayout()}))},t.prototype._updateNodeAndLinkScale=function(e){var t=e.getData(),n=this._getNodeGlobalScale(e);t.eachItemGraphicEl((function(e,t){e.setSymbolScale(n)}))},t.prototype._getNodeGlobalScale=function(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var n=this._nodeScaleRatio,r=t.scaleX||1;return((t.getZoom()-1)*n+1)/r},t.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype.remove=function(){this._mainGroup.removeAll(),this._data=null},t.type="tree",t}(em);function vA(e,t){var n=e.getItemLayout(t);return n&&!isNaN(n.x)&&!isNaN(n.y)}function yA(e,t,n,r,i){var o=!n,a=e.tree.getNodeByDataIndex(t),s=a.getModel(),l=a.getVisual("style").fill,u=!1===a.isExpand&&0!==a.children.length?l:"#fff",c=e.tree.root,h=a.parentNode===c?a:a.parentNode||a,d=e.getItemGraphicEl(h.dataIndex),p=h.getLayout(),f=d?{x:d.__oldX,y:d.__oldY,rawX:d.__radialOldRawX,rawY:d.__radialOldRawY}:p,g=a.getLayout();o?((n=new WS(e,t,null,{symbolInnerColor:u,useNameLabel:!0})).x=f.x,n.y=f.y):n.updateData(e,t,null,{symbolInnerColor:u,useNameLabel:!0}),n.__radialOldRawX=n.__radialRawX,n.__radialOldRawY=n.__radialRawY,n.__radialRawX=g.rawX,n.__radialRawY=g.rawY,r.add(n),e.setItemGraphicEl(t,n),n.__oldX=n.x,n.__oldY=n.y,Oc(n,{x:g.x,y:g.y},i);var m=n.getSymbolPath();if("radial"===i.get("layout")){var v=c.children[0],y=v.getLayout(),_=v.children.length,x=void 0,b=void 0;if(g.x===y.x&&!0===a.isExpand&&v.children.length){var w={x:(v.children[0].getLayout().x+v.children[_-1].getLayout().x)/2,y:(v.children[0].getLayout().y+v.children[_-1].getLayout().y)/2};(x=Math.atan2(w.y-y.y,w.x-y.x))<0&&(x=2*Math.PI+x),(b=w.x<y.x)&&(x-=Math.PI)}else(x=Math.atan2(g.y-y.y,g.x-y.x))<0&&(x=2*Math.PI+x),0===a.children.length||0!==a.children.length&&!1===a.isExpand?(b=g.x<y.x)&&(x-=Math.PI):(b=g.x>y.x)||(x-=Math.PI);var S=b?"left":"right",T=s.getModel("label"),M=T.get("rotate"),C=M*(Math.PI/180),D=m.getTextContent();D&&(m.setTextConfig({position:T.get("position")||S,rotation:null==M?-x:C,origin:"center"}),D.setStyle("verticalAlign","middle"))}var A=s.get(["emphasis","focus"]),I="relative"===A?Me(a.getAncestorsIndices(),a.getDescendantIndices()):"ancestor"===A?a.getAncestorsIndices():"descendant"===A?a.getDescendantIndices():null;I&&(bl(n).focus=I),function(e,t,n,r,i,o,a,s){var l=t.getModel(),u=e.get("edgeShape"),c=e.get("layout"),h=e.getOrient(),d=e.get(["lineStyle","curveness"]),p=e.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),g=r.__edge;if("curve"===u)t.parentNode&&t.parentNode!==n&&(g||(g=r.__edge=new vc({shape:wA(c,h,d,i,i)})),Oc(g,{shape:wA(c,h,d,o,a)},e));else if("polyline"===u)if("orthogonal"===c){if(t!==n&&t.children&&0!==t.children.length&&!0===t.isExpand){for(var m=t.children,v=[],y=0;y<m.length;y++){var _=m[y].getLayout();v.push([_.x,_.y])}g||(g=r.__edge=new gA({shape:{parentPoint:[a.x,a.y],childPoints:[[a.x,a.y]],orient:h,forkPosition:p}})),Oc(g,{shape:{parentPoint:[a.x,a.y],childPoints:v}},e)}}else if("production"!==process.env.NODE_ENV)throw new Error("The polyline edgeShape can only be used in orthogonal layout");g&&("polyline"!==u||t.isExpand)&&(g.useStyle(V({strokeNoScale:!0,fill:null},f)),fu(g,l,"lineStyle"),Yl(g),s.add(g))}(i,a,c,n,f,p,g,r),n.__edge&&(n.onHoverStateChange=function(t){if("blur"!==t){var r=a.parentNode&&e.getItemGraphicEl(a.parentNode.dataIndex);r&&1===r.hoverState||jl(n.__edge,t)}})}function _A(e,t,n,r,i){var o=xA(t.tree.root,e),a=o.source,s=o.sourceLayout,l=t.getItemGraphicEl(e.dataIndex);if(l){var u=t.getItemGraphicEl(a.dataIndex).__edge,c=l.__edge||(!1===a.isExpand||1===a.children.length?u:void 0),h=r.get("edgeShape"),d=r.get("layout"),p=r.get("orient"),f=r.get(["lineStyle","curveness"]);c&&("curve"===h?zc(c,{shape:wA(d,p,f,s,s),style:{opacity:0}},r,{cb:function(){n.remove(c)},removeOpt:i}):"polyline"===h&&"orthogonal"===r.get("layout")&&zc(c,{shape:{parentPoint:[s.x,s.y],childPoints:[[s.x,s.y]]},style:{opacity:0}},r,{cb:function(){n.remove(c)},removeOpt:i}))}}function xA(e,t){for(var n,r=t.parentNode===e?t:t.parentNode||t;null==(n=r.getLayout());)r=r.parentNode===e?r:r.parentNode||r;return{source:r,sourceLayout:n}}function bA(e,t,n,r,i){var o=e.tree.getNodeByDataIndex(t),a=xA(e.tree.root,o).sourceLayout,s={duration:i.get("animationDurationUpdate"),easing:i.get("animationEasingUpdate")};zc(n,{x:a.x+1,y:a.y+1},i,{cb:function(){r.remove(n),e.setItemGraphicEl(t,null)},removeOpt:s}),n.fadeOut(null,e.hostModel,{fadeLabel:!0,animation:s}),o.children.forEach((function(t){_A(t,e,r,i,s)})),_A(o,e,r,i,s)}function wA(e,t,n,r,i){var o,a,s,l,u,c,h,d;if("radial"===e){u=r.rawX,h=r.rawY,c=i.rawX,d=i.rawY;var p=lA(u,h),f=lA(u,h+(d-h)*n),g=lA(c,d+(h-d)*n),m=lA(c,d);return{x1:p.x||0,y1:p.y||0,x2:m.x||0,y2:m.y||0,cpx1:f.x||0,cpy1:f.y||0,cpx2:g.x||0,cpy2:g.y||0}}return u=r.x,h=r.y,c=i.x,d=i.y,"LR"!==t&&"RL"!==t||(o=u+(c-u)*n,a=h,s=c+(u-c)*n,l=d),"TB"!==t&&"BT"!==t||(o=u,a=h+(d-h)*n,s=c,l=d+(h-d)*n),{x1:u,y1:h,x2:c,y2:d,cpx1:o,cpy1:a,cpx2:s,cpy2:l}}var SA=ta();function TA(e){var t=e.mainData,n=e.datas;n||(n={main:t},e.datasAttr={main:"data"}),e.datas=e.mainData=null,EA(t,n,e),W(n,(function(n){W(t.TRANSFERABLE_METHODS,(function(t){n.wrapMethod(t,$(MA,e))}))})),t.wrapMethod("cloneShallow",$(DA,e)),W(t.CHANGABLE_METHODS,(function(n){t.wrapMethod(n,$(CA,e))})),me(n[t.dataType]===t)}function MA(e,t){if(SA(r=this).mainData===r){var n=z({},SA(this).datas);n[this.dataType]=t,EA(t,n,e)}else LA(t,this.dataType,SA(this).mainData,e);var r;return t}function CA(e,t){return e.struct&&e.struct.update(),t}function DA(e,t){return W(SA(t).datas,(function(n,r){n!==t&&LA(n.cloneShallow(),r,t,e)})),t}function AA(e){var t=SA(this).mainData;return null==e||null==t?t:SA(t).datas[e]}function IA(){var e=SA(this).mainData;return null==e?[{data:e}]:j(q(SA(e).datas),(function(t){return{type:t,data:SA(e).datas[t]}}))}function EA(e,t,n){SA(e).datas={},W(t,(function(t,r){LA(t,r,e,n)}))}function LA(e,t,n,r){SA(n).datas[t]=e,SA(e).mainData=n,e.dataType=t,r.struct&&(e[r.structAttr]=r.struct,r.struct[r.datasAttr[t]]=e),e.getLinkedData=AA,e.getLinkedDataAll=IA}var NA=function(){function e(e,t){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=e||"",this.hostTree=t}return e.prototype.isRemoved=function(){return this.dataIndex<0},e.prototype.eachNode=function(e,t,n){Q(e)&&(n=t,t=e,e=null),ee(e=e||{})&&(e={order:e});var r,i=e.order||"preorder",o=this[e.attr||"children"];"preorder"===i&&(r=t.call(n,this));for(var a=0;!r&&a<o.length;a++)o[a].eachNode(e,t,n);"postorder"===i&&t.call(n,this)},e.prototype.updateDepthAndHeight=function(e){var t=0;this.depth=e;for(var n=0;n<this.children.length;n++){var r=this.children[n];r.updateDepthAndHeight(e+1),r.height>t&&(t=r.height)}this.height=t+1},e.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,n=this.children,r=n.length;t<r;t++){var i=n[t].getNodeById(e);if(i)return i}},e.prototype.contains=function(e){if(e===this)return!0;for(var t=0,n=this.children,r=n.length;t<r;t++){var i=n[t].contains(e);if(i)return i}},e.prototype.getAncestors=function(e){for(var t=[],n=e?this:this.parentNode;n;)t.push(n),n=n.parentNode;return t.reverse(),t},e.prototype.getAncestorsIndices=function(){for(var e=[],t=this;t;)e.push(t.dataIndex),t=t.parentNode;return e.reverse(),e},e.prototype.getDescendantIndices=function(){var e=[];return this.eachNode((function(t){e.push(t.dataIndex)})),e},e.prototype.getValue=function(e){var t=this.hostTree.data;return t.getStore().get(t.getDimensionIndex(e||"value"),this.dataIndex)},e.prototype.setLayout=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(e)},e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},e.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},e.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t<e.length;++t)if(e[t]===this)return t;return-1}return-1},e.prototype.isAncestorOf=function(e){for(var t=e.parentNode;t;){if(t===this)return!0;t=t.parentNode}return!1},e.prototype.isDescendantOf=function(e){return e!==this&&e.isAncestorOf(this)},e}(),PA=function(){function e(e){this.type="tree",this._nodes=[],this.hostModel=e}return e.prototype.eachNode=function(e,t,n){this.root.eachNode(e,t,n)},e.prototype.getNodeByDataIndex=function(e){var t=this.data.getRawIndex(e);return this._nodes[t]},e.prototype.getNodeById=function(e){return this.root.getNodeById(e)},e.prototype.update=function(){for(var e=this.data,t=this._nodes,n=0,r=t.length;n<r;n++)t[n].dataIndex=-1;for(n=0,r=e.count();n<r;n++)t[e.getRawIndex(n)].dataIndex=n},e.prototype.clearLayouts=function(){this.data.clearItemLayouts()},e.createTree=function(t,n,r){var i=new e(n),o=[],a=1;!function e(t,n){var r=t.value;a=Math.max(a,J(r)?r.length:1),o.push(t);var s=new NA(qo(t.name,""),i);n?function(e,t){var n=t.children;if(e.parentNode===t)return;n.push(e),e.parentNode=t}(s,n):i.root=s,i._nodes.push(s);var l=t.children;if(l)for(var u=0;u<l.length;u++)e(l[u],s)}(t),i.root.updateDepthAndHeight(0);var s=z_(o,{coordDimensions:["value"],dimensionsCount:a}).dimensions,l=new R_(s,n);return l.initData(o),r&&r(l),TA({mainData:l,struct:i,structAttr:"tree"}),i.update(),i},e}();function OA(e,t,n){if(e&&F(t,e.type)>=0){var r=n.getData().tree.root,i=e.targetNode;if(ee(i)&&(i=r.getNodeById(i)),i&&r.contains(i))return{node:i};var o=e.targetNodeId;if(null!=o&&(i=r.getNodeById(o)))return{node:i}}}function RA(e){for(var t=[];e;)(e=e.parentNode)&&t.push(e);return t.reverse()}function kA(e,t){return F(RA(e),t)>=0}function zA(e,t){for(var n=[];e;){var r=e.dataIndex;n.push({name:e.name,dataIndex:r,value:t.getRawValue(r)}),e=e.parentNode}return n.reverse(),n}var VA=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}return l(t,e),t.prototype.getInitialData=function(e){var t={name:e.name,children:e.data},n=e.leaves||{},r=new Wh(n,this,this.ecModel),i=PA.createTree(t,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=i.getNodeByDataIndex(t);return n&&n.children.length&&n.isExpand||(e.parentModel=r),e}))}));var o=0;i.eachNode("preorder",(function(e){e.depth>o&&(o=e.depth)}));var a=e.expandAndCollapse&&e.initialTreeDepth>=0?e.initialTreeDepth:o;return i.root.eachNode("preorder",(function(e){var t=e.hostTree.data.getRawDataItem(e.dataIndex);e.isExpand=t&&null!=t.collapsed?!t.collapsed:e.depth<=a})),i.data},t.prototype.getOrient=function(){var e=this.get("orient");return"horizontal"===e?e="LR":"vertical"===e&&(e="TB"),e},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.formatTooltip=function(e,t,n){for(var r=this.getData().tree,i=r.root.children[0],o=r.getNodeByDataIndex(e),a=o.getValue(),s=o.name;o&&o!==i;)s=o.parentNode.name+"."+s,o=o.parentNode;return Cg("nameValue",{name:s,value:a,noValue:isNaN(a)||null==a})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=zA(r,this),n.collapsed=!r.isExpand,n},t.type="series.tree",t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t}(Hg);function BA(e,t){for(var n,r=[e];n=r.pop();)if(t(n),n.isExpand){var i=n.children;if(i.length)for(var o=i.length-1;o>=0;o--)r.push(i[o])}}function FA(e,t){e.eachSeriesByType("tree",(function(e){!function(e,t){var n=function(e,t){return Zd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t);e.layoutInfo=n;var r=e.get("layout"),i=0,o=0,a=null;"radial"===r?(i=2*Math.PI,o=Math.min(n.height,n.width)/2,a=sA((function(e,t){return(e.parentNode===t.parentNode?1:2)/e.depth}))):(i=n.width,o=n.height,a=sA());var s=e.getData().tree.root,l=s.children[0];if(l){!function(e){var t=e;t.hierNode={defaultAncestor:null,ancestor:t,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var n,r,i=[t];n=i.pop();)if(r=n.children,n.isExpand&&r.length)for(var o=r.length-1;o>=0;o--){var a=r[o];a.hierNode={defaultAncestor:null,ancestor:a,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},i.push(a)}}(s),function(e,t,n){for(var r,i=[e],o=[];r=i.pop();)if(o.push(r),r.isExpand){var a=r.children;if(a.length)for(var s=0;s<a.length;s++)i.push(a[s])}for(;r=o.pop();)t(r,n)}(l,oA,a),s.hierNode.modifier=-l.hierNode.prelim,BA(l,aA);var u=l,c=l,h=l;BA(l,(function(e){var t=e.getLayout().x;t<u.getLayout().x&&(u=e),t>c.getLayout().x&&(c=e),e.depth>h.depth&&(h=e)}));var d=u===c?1:a(u,c)/2,p=d-u.getLayout().x,f=0,g=0,m=0,v=0;if("radial"===r)f=i/(c.getLayout().x+d+p),g=o/(h.depth-1||1),BA(l,(function(e){m=(e.getLayout().x+p)*f,v=(e.depth-1)*g;var t=lA(m,v);e.setLayout({x:t.x,y:t.y,rawX:m,rawY:v},!0)}));else{var y=e.getOrient();"RL"===y||"LR"===y?(g=o/(c.getLayout().x+d+p),f=i/(h.depth-1||1),BA(l,(function(e){v=(e.getLayout().x+p)*g,m="LR"===y?(e.depth-1)*f:i-(e.depth-1)*f,e.setLayout({x:m,y:v},!0)}))):"TB"!==y&&"BT"!==y||(f=i/(c.getLayout().x+d+p),g=o/(h.depth-1||1),BA(l,(function(e){m=(e.getLayout().x+p)*f,v="TB"===y?(e.depth-1)*g:o-(e.depth-1)*g,e.setLayout({x:m,y:v},!0)})))}}}(e,t)}))}function GA(e){e.eachSeriesByType("tree",(function(e){var t=e.getData();t.tree.eachNode((function(e){var n=e.getModel().getModel("itemStyle").getItemStyle();z(t.ensureUniqueItemVisual(e.dataIndex,"style"),n)}))}))}var HA=["treemapZoomToNode","treemapRender","treemapMove"];function UA(e){var t=e.getData().tree,n={};t.eachNode((function(t){for(var r=t;r&&r.depth>1;)r=r.parentNode;var i=Ep(e.ecModel,r.name||r.dataIndex+"",n);t.setVisual("decal",i)}))}var WA=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.preventUsingHoverLayer=!0,n}return l(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};jA(n);var r=e.levels||[],i=this.designatedVisualItemStyle={},o=new Wh({itemStyle:i},this,t);r=e.levels=function(e,t){var n,r,i=Go(t.get("color")),o=Go(t.get(["aria","decal","decals"]));if(!i)return;e=e||[],W(e,(function(e){var t=new Wh(e),i=t.get("color"),o=t.get("decal");(t.get(["itemStyle","color"])||i&&"none"!==i)&&(n=!0),(t.get(["itemStyle","decal"])||o&&"none"!==o)&&(r=!0)}));var a=e[0]||(e[0]={});n||(a.color=i.slice());!r&&o&&(a.decal=o.slice());return e}(r,t);var a=j(r||[],(function(e){return new Wh(e,o,t)}),this),s=PA.createTree(n,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=s.getNodeByDataIndex(t),r=n?a[n.depth]:null;return e.parentModel=r||o,e}))}));return s.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.getRawValue(e);return Cg("nameValue",{name:r.getName(e),value:i})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=zA(r,this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(e){this.layoutInfo=this.layoutInfo||{},z(this.layoutInfo,e)},t.prototype.mapIdToIndex=function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=Te(),this._idIndexMapCount=0);var n=t.get(e);return null==n&&t.set(e,n=this._idIndexMapCount++),n},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(){UA(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,scaleLimit:null,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},t}(Hg);function jA(e){var t=0;W(e.children,(function(e){jA(e);var n=e.value;J(n)&&(n=n[0]),t+=n}));var n=e.value;J(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),J(e.value)?e.value[0]=n:e.value=n}var XA=function(){function e(e){this.group=new Yi,e.add(this.group)}return e.prototype.render=function(e,t,n,r){var i=e.getModel("breadcrumb"),o=this.group;if(o.removeAll(),i.get("show")&&n){var a=i.getModel("itemStyle"),s=i.getModel("emphasis"),l=a.getModel("textStyle"),u=s.getModel(["itemStyle","textStyle"]),c={pos:{left:i.get("left"),right:i.get("right"),top:i.get("top"),bottom:i.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:i.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,c,l),this._renderContent(e,c,a,s,l,u,r),qd(o,c.pos,c.box)}},e.prototype._prepare=function(e,t,n){for(var r=e;r;r=r.parentNode){var i=qo(r.getModel().get("name"),""),o=n.getTextRect(i),a=Math.max(o.width+16,t.emptyItemWidth);t.totalWidth+=a+8,t.renderList.push({node:r,text:i,width:a})}},e.prototype._renderContent=function(e,t,n,r,i,o,a){for(var s=0,l=t.emptyItemWidth,u=e.get(["breadcrumb","height"]),c=function(e,t,n){var r=t.width,i=t.height,o=oo(e.left,r),a=oo(e.top,i),s=oo(e.right,r),l=oo(e.bottom,i);return(isNaN(o)||isNaN(parseFloat(e.left)))&&(o=0),(isNaN(s)||isNaN(parseFloat(e.right)))&&(s=r),(isNaN(a)||isNaN(parseFloat(e.top)))&&(a=0),(isNaN(l)||isNaN(parseFloat(e.bottom)))&&(l=i),n=Od(n||0),{width:Math.max(s-o-n[1]-n[3],0),height:Math.max(l-a-n[0]-n[2],0)}}(t.pos,t.box),h=t.totalWidth,d=t.renderList,p=r.getModel("itemStyle").getItemStyle(),f=d.length-1;f>=0;f--){var g=d[f],m=g.node,v=g.width,y=g.text;h>c.width&&(h-=v-l,v=l,y=null);var _=new lc({shape:{points:YA(s,0,v,u,f===d.length-1,0===f)},style:V(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new ll({style:wh(i,{text:y})}),textConfig:{position:"inside"},z2:1e5,onclick:$(a,m)});_.disableLabelAnimation=!0,_.getTextContent().ensureState("emphasis").style=wh(o,{text:y}),_.ensureState("emphasis").style=p,cu(_,r.get("focus"),r.get("blurScope"),r.get("disabled")),this.group.add(_),ZA(_,e,m),s+=v+8}},e.prototype.remove=function(){this.group.removeAll()},e}();function YA(e,t,n,r,i,o){var a=[[i?e:e-5,t],[e+n,t],[e+n,t+r],[i?e:e-5,t+r]];return!o&&a.splice(2,0,[e+n+5,t+r/2]),!i&&a.push([e,t+r/2]),a}function ZA(e,t,n){bl(e).eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&zA(n,t)}}var qA=function(){function e(){this._storage=[],this._elExistsMap={}}return e.prototype.add=function(e,t,n,r,i){return!this._elExistsMap[e.id]&&(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:n,delay:r,easing:i}),!0)},e.prototype.finished=function(e){return this._finishedCallback=e,this},e.prototype.start=function(){for(var e=this,t=this._storage.length,n=function(){--t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},r=0,i=this._storage.length;r<i;r++){var o=this._storage[r];o.el.animateTo(o.target,{duration:o.duration,delay:o.delay,easing:o.easing,setToFinal:!0,done:n,aborted:n})}return this},e}();var KA=Yi,$A=ol,JA="label",QA="upperLabel",eI=xa([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),tI=function(e){var t=eI(e);return t.stroke=t.fill=t.lineWidth=null,t},nI=ta(),rI=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._state="ready",n._storage={nodeGroup:[],background:[],content:[]},n}return l(t,e),t.prototype.render=function(e,t,n,r){if(!(F(t.findComponents({mainType:"series",subType:"treemap",query:r}),e)<0)){this.seriesModel=e,this.api=n,this.ecModel=t;var i=OA(r,["treemapZoomToNode","treemapRootToNode"],e),o=r&&r.type,a=e.layoutInfo,s=!this._oldTree,l=this._storage,u="treemapRootToNode"===o&&i&&l?{rootNodeGroup:l.nodeGroup[i.node.getRawIndex()],direction:r.direction}:null,c=this._giveContainerGroup(a),h=e.get("animation"),d=this._doRender(c,e,u);!h||s||o&&"treemapZoomToNode"!==o&&"treemapRootToNode"!==o?d.renderFinally():this._doAnimation(c,d,e,u),this._resetController(n),this._renderBreadcrumb(e,n,i)}},t.prototype._giveContainerGroup=function(e){var t=this._containerGroup;return t||(t=this._containerGroup=new KA,this._initEvents(t),this.group.add(t)),t.x=e.x,t.y=e.y,t},t.prototype._doRender=function(e,t,n){var r=t.getData().tree,i=this._oldTree,o={nodeGroup:[],background:[],content:[]},a={nodeGroup:[],background:[],content:[]},s=this._storage,l=[];function u(e,r,i,u){return function(e,t,n,r,i,o,a,s,l,u){if(!a)return;var c=a.getLayout(),h=e.getData(),d=a.getModel();if(h.setItemGraphicEl(a.dataIndex,null),!c||!c.isInView)return;var p=c.width,f=c.height,g=c.borderWidth,m=c.invisible,v=a.getRawIndex(),y=s&&s.getRawIndex(),_=a.viewChildren,x=c.upperHeight,b=_&&_.length,w=d.getModel("itemStyle"),S=d.getModel(["emphasis","itemStyle"]),T=d.getModel(["blur","itemStyle"]),M=d.getModel(["select","itemStyle"]),C=w.get("borderRadius")||0,D=G("nodeGroup",KA);if(!D)return;if(l.add(D),D.x=c.x||0,D.y=c.y||0,D.markRedraw(),nI(D).nodeWidth=p,nI(D).nodeHeight=f,c.isAboveViewRoot)return D;var A=G("background",$A,u,20);A&&R(D,A,b&&c.upperLabelHeight);var I=d.getModel("emphasis"),E=I.get("focus"),L=I.get("blurScope"),N=I.get("disabled"),P="ancestor"===E?a.getAncestorsIndices():"descendant"===E?a.getDescendantIndices():E;if(b)mu(D)&&gu(D,!1),A&&(gu(A,!N),h.setItemGraphicEl(a.dataIndex,A),hu(A,P,L));else{var O=G("content",$A,u,30);O&&k(D,O),A.disableMorphing=!0,A&&mu(A)&&gu(A,!1),gu(D,!N),h.setItemGraphicEl(a.dataIndex,D),hu(D,P,L)}return D;function R(t,n,r){var i=bl(n);if(i.dataIndex=a.dataIndex,i.seriesIndex=e.seriesIndex,n.setShape({x:0,y:0,width:p,height:f,r:C}),m)V(n);else{n.invisible=!1;var o=a.getVisual("style"),s=o.stroke,l=tI(w);l.fill=s;var u=eI(S);u.fill=S.get("borderColor");var c=eI(T);c.fill=T.get("borderColor");var h=eI(M);if(h.fill=M.get("borderColor"),r){var d=p-2*g;B(n,s,o.opacity,{x:g,y:0,width:d,height:x})}else n.removeTextContent();n.setStyle(l),n.ensureState("emphasis").style=u,n.ensureState("blur").style=c,n.ensureState("select").style=h,Yl(n)}t.add(n)}function k(t,n){var r=bl(n);r.dataIndex=a.dataIndex,r.seriesIndex=e.seriesIndex;var i=Math.max(p-2*g,0),o=Math.max(f-2*g,0);if(n.culling=!0,n.setShape({x:g,y:g,width:i,height:o,r:C}),m)V(n);else{n.invisible=!1;var s=a.getVisual("style"),l=s.fill,u=tI(w);u.fill=l,u.decal=s.decal;var c=eI(S),h=eI(T),d=eI(M);B(n,l,s.opacity,null),n.setStyle(u),n.ensureState("emphasis").style=c,n.ensureState("blur").style=h,n.ensureState("select").style=d,Yl(n)}t.add(n)}function V(e){!e.invisible&&o.push(e)}function B(t,n,r,i){var o=d.getModel(i?QA:JA),s=qo(d.get("name"),null),l=o.getShallow("show");xh(t,bh(d,i?QA:JA),{defaultText:l?s:null,inheritColor:n,defaultOpacity:r,labelFetcher:e,labelDataIndex:a.dataIndex});var u=t.getTextContent();if(u){var h=u.style,p=ge(h.padding||0);i&&(t.setTextConfig({layoutRect:i}),u.disableLabelLayout=!0),u.beforeUpdate=function(){var e=Math.max((i?i.width:t.shape.width)-p[1]-p[3],0),n=Math.max((i?i.height:t.shape.height)-p[0]-p[2],0);h.width===e&&h.height===n||u.setStyle({width:e,height:n})},h.truncateMinChar=2,h.lineOverflow="truncate",F(h,i,c);var f=u.getState("emphasis");F(f?f.style:null,i,c)}}function F(t,n,r){var i=t?t.text:null;if(!n&&r.isLeafRoot&&null!=i){var o=e.get("drillDownIcon",!0);t.text=o?o+" "+i:i}}function G(e,r,o,a){var s=null!=y&&n[e][y],l=i[e];return s?(n[e][y]=null,H(l,s)):m||((s=new r)instanceof ja&&(s.z2=function(e,t){return 100*e+t}(o,a)),U(l,s)),t[e][v]=s}function H(e,t){var n=e[v]={};t instanceof KA?(n.oldX=t.x,n.oldY=t.y):n.oldShape=z({},t.shape)}function U(e,t){var n=e[v]={},o=a.parentNode,s=t instanceof Yi;if(o&&(!r||"drillDown"===r.direction)){var l=0,u=0,c=i.background[o.getRawIndex()];!r&&c&&c.oldShape&&(l=c.oldShape.width,u=c.oldShape.height),s?(n.oldX=0,n.oldY=u):n.oldShape={x:l,y:u,width:0,height:0}}n.fadein=!s}}(t,a,s,n,o,l,e,r,i,u)}!function e(t,n,r,i,o){i?(n=t,W(t,(function(e,t){!e.isRemoved()&&s(t,t)}))):new h_(n,t,a,a).add(s).update(s).remove($(s,null)).execute();function a(e){return e.getId()}function s(a,s){var l=null!=a?t[a]:null,c=null!=s?n[s]:null,h=u(l,c,r,o);h&&e(l&&l.viewChildren||[],c&&c.viewChildren||[],h,i,o+1)}}(r.root?[r.root]:[],i&&i.root?[i.root]:[],e,r===i||!i,0);var c=function(e){var t={nodeGroup:[],background:[],content:[]};return e&&W(e,(function(e,n){var r=t[n];W(e,(function(e){e&&(r.push(e),nI(e).willDelete=!0)}))})),t}(s);if(this._oldTree=r,this._storage=a,this._controllerHost){var h=this.seriesModel.layoutInfo,d=r.root.getLayout();d.width===h.width&&d.height===h.height&&(this._controllerHost.zoom=1)}return{lastsForAnimation:o,willDeleteEls:c,renderFinally:function(){W(c,(function(e){W(e,(function(e){e.parent&&e.parent.remove(e)}))})),W(l,(function(e){e.invisible=!0,e.dirty()}))}}},t.prototype._doAnimation=function(e,t,n,r){var i=n.get("animationDurationUpdate"),o=n.get("animationEasing"),a=(Q(i)?0:i)||0,s=(Q(o)?null:o)||"cubicOut",l=new qA;W(t.willDeleteEls,(function(e,t){W(e,(function(e,n){if(!e.invisible){var i,o=e.parent,u=nI(o);if(r&&"drillDown"===r.direction)i=o===r.rootNodeGroup?{shape:{x:0,y:0,width:u.nodeWidth,height:u.nodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var c=0,h=0;u.willDelete||(c=u.nodeWidth/2,h=u.nodeHeight/2),i="nodeGroup"===t?{x:c,y:h,style:{opacity:0}}:{shape:{x:c,y:h,width:0,height:0},style:{opacity:0}}}i&&l.add(e,i,a,0,s)}}))})),W(this._storage,(function(e,n){W(e,(function(e,r){var i=t.lastsForAnimation[n][r],o={};i&&(e instanceof Yi?null!=i.oldX&&(o.x=e.x,o.y=e.y,e.x=i.oldX,e.y=i.oldY):(i.oldShape&&(o.shape=z({},e.shape),e.setShape(i.oldShape)),i.fadein?(e.setStyle("opacity",0),o.style={opacity:1}):1!==e.style.opacity&&(o.style={opacity:1})),l.add(e,o,a,0,s))}))}),this),this._state="animating",l.finished(K((function(){this._state="ready",t.renderFinally()}),this)).start()},t.prototype._resetController=function(e){var t=this._controller,n=this._controllerHost;n||(this._controllerHost={target:this.group},n=this._controllerHost),t||((t=this._controller=new NC(e.getZr())).enable(this.seriesModel.get("roam")),n.zoomLimit=this.seriesModel.get("scaleLimit"),n.zoom=this.seriesModel.get("zoom"),t.on("pan",K(this._onPan,this)),t.on("zoom",K(this._onZoom,this)));var r=new jt(0,0,e.getWidth(),e.getHeight());t.setPointerChecker((function(e,t,n){return r.contain(t,n)}))},t.prototype._clearController=function(){var e=this._controller;this._controllerHost=null,e&&(e.dispose(),e=null)},t.prototype._onPan=function(e){if("animating"!==this._state&&(Math.abs(e.dx)>3||Math.abs(e.dy)>3)){var t=this.seriesModel.getData().tree.root;if(!t)return;var n=t.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+e.dx,y:n.y+e.dy,width:n.width,height:n.height}})}},t.prototype._onZoom=function(e){var t=e.originX,n=e.originY,r=e.scale;if("animating"!==this._state){var i=this.seriesModel.getData().tree.root;if(!i)return;var o=i.getLayout();if(!o)return;var a,s=new jt(o.x,o.y,o.width,o.height),l=this._controllerHost;a=l.zoomLimit;var u=l.zoom=l.zoom||1;if(u*=r,a){var c=a.min||0,h=a.max||1/0;u=Math.max(Math.min(h,u),c)}var d=u/l.zoom;l.zoom=u;var p=this.seriesModel.layoutInfo,f=[1,0,0,1,0,0];Et(f,f,[-(t-=p.x),-(n-=p.y)]),Nt(f,f,[d,d]),Et(f,f,[t,n]),s.applyTransform(f),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:s.x,y:s.y,width:s.width,height:s.height}})}},t.prototype._initEvents=function(e){var t=this;e.on("click",(function(e){if("ready"===t._state){var n=t.seriesModel.get("nodeClick",!0);if(n){var r=t.findTarget(e.offsetX,e.offsetY);if(r){var i=r.node;if(i.getLayout().isLeafRoot)t._rootToNode(r);else if("zoomToNode"===n)t._zoomToNode(r);else if("link"===n){var o=i.hostTree.data.getItemModel(i.dataIndex),a=o.get("link",!0),s=o.get("target",!0)||"blank";a&&Hd(a,s)}}}}}),this)},t.prototype._renderBreadcrumb=function(e,t,n){var r=this;n||(n=null!=e.get("leafDepth",!0)?{node:e.getViewRoot()}:this.findTarget(t.getWidth()/2,t.getHeight()/2))||(n={node:e.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new XA(this.group))).render(e,t,n.node,(function(t){"animating"!==r._state&&(kA(e.getViewRoot(),t)?r._rootToNode({node:t}):r._zoomToNode({node:t}))}))},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(e){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype._rootToNode=function(e){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype.findTarget=function(e,t){var n;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(r){var i=this._storage.background[r.getRawIndex()];if(i){var o=i.transformCoordToLocal(e,t),a=i.shape;if(!(a.x<=o[0]&&o[0]<=a.x+a.width&&a.y<=o[1]&&o[1]<=a.y+a.height))return!1;n={node:r,offsetX:o[0],offsetY:o[1]}}}),this),n},t.type="treemap",t}(em);var iI=W,oI=re,aI=-1,sI=function(){function e(t){var n=t.mappingMethod,r=t.type,i=this.option=O(t);this.type=r,this.mappingMethod=n,this._normalizeData=vI[n];var o=e.visualHandlers[r];this.applyVisual=o.applyVisual,this.getColorMapper=o.getColorMapper,this._normalizedToVisual=o._normalizedToVisual[n],"piecewise"===n?(lI(i),function(e){var t=e.pieceList;e.hasSpecialVisual=!1,W(t,(function(t,n){t.originIndex=n,null!=t.visual&&(e.hasSpecialVisual=!0)}))}(i)):"category"===n?i.categories?function(e){var t=e.categories,n=e.categoryMap={},r=e.visual;if(iI(t,(function(e,t){n[e]=t})),!J(r)){var i=[];re(r)?iI(r,(function(e,t){var r=n[t];i[null!=r?r:aI]=e})):i[-1]=r,r=mI(e,i)}for(var o=t.length-1;o>=0;o--)null==r[o]&&(delete n[t[o]],t.pop())}(i):lI(i,!0):(me("linear"!==n||i.dataExtent),lI(i))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return K(this._normalizeData,this)},e.listVisualTypes=function(){return q(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){re(e)?W(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,r){var i,o=J(t)?[]:re(t)?{}:(i=!0,null);return e.eachVisual(t,(function(e,t){var a=n.call(r,e,t);i?o=a:o[t]=a})),o},e.retrieveVisuals=function(t){var n,r={};return t&&iI(e.visualHandlers,(function(e,i){t.hasOwnProperty(i)&&(r[i]=t[i],n=!0)})),n?r:null},e.prepareVisualTypes=function(e){if(J(e))e=e.slice();else{if(!oI(e))return[];var t=[];iI(e,(function(e,n){t.push(n)})),e=t}return e.sort((function(e,t){return"color"===t&&"color"!==e&&0===e.indexOf("color")?1:-1})),e},e.dependsOn=function(e,t){return"color"===t?!(!e||0!==e.indexOf(t)):e===t},e.findPieceIndex=function(e,t,n){for(var r,i=1/0,o=0,a=t.length;o<a;o++){var s=t[o].value;if(null!=s){if(s===e||ee(s)&&s===e+"")return o;n&&h(s,o)}}for(o=0,a=t.length;o<a;o++){var l=t[o],u=l.interval,c=l.close;if(u){if(u[0]===-1/0){if(yI(c[1],e,u[1]))return o}else if(u[1]===1/0){if(yI(c[0],u[0],e))return o}else if(yI(c[0],u[0],e)&&yI(c[1],e,u[1]))return o;n&&h(u[0],o),n&&h(u[1],o)}}if(n)return e===1/0?t.length-1:e===-1/0?0:r;function h(t,n){var o=Math.abs(t-e);o<i&&(i=o,r=n)}},e.visualHandlers={color:{applyVisual:hI("color"),getColorMapper:function(){var e=this.option;return K("category"===e.mappingMethod?function(e,t){return!t&&(e=this._normalizeData(e)),dI.call(this,e)}:function(t,n,r){var i=!!r;return!n&&(t=this._normalizeData(t)),r=ar(t,e.parsedVisual,r),i?r:dr(r,"rgba")},this)},_normalizedToVisual:{linear:function(e){return dr(ar(e,this.option.parsedVisual),"rgba")},category:dI,piecewise:function(e,t){var n=gI.call(this,t);return null==n&&(n=dr(ar(e,this.option.parsedVisual),"rgba")),n},fixed:pI}},colorHue:uI((function(e,t){return cr(e,t)})),colorSaturation:uI((function(e,t){return cr(e,null,t)})),colorLightness:uI((function(e,t){return cr(e,null,null,t)})),colorAlpha:uI((function(e,t){return hr(e,t)})),decal:{applyVisual:hI("decal"),_normalizedToVisual:{linear:null,category:dI,piecewise:null,fixed:null}},opacity:{applyVisual:hI("opacity"),_normalizedToVisual:fI([0,1])},liftZ:{applyVisual:hI("liftZ"),_normalizedToVisual:{linear:pI,category:pI,piecewise:pI,fixed:pI}},symbol:{applyVisual:function(e,t,n){n("symbol",this.mapValueToVisual(e))},_normalizedToVisual:{linear:cI,category:dI,piecewise:function(e,t){var n=gI.call(this,t);return null==n&&(n=cI.call(this,e)),n},fixed:pI}},symbolSize:{applyVisual:hI("symbolSize"),_normalizedToVisual:fI([0,1])}},e}();function lI(e,t){var n=e.visual,r=[];re(n)?iI(n,(function(e){r.push(e)})):null!=n&&r.push(n);t||1!==r.length||{color:1,symbol:1}.hasOwnProperty(e.type)||(r[1]=r[0]),mI(e,r)}function uI(e){return{applyVisual:function(t,n,r){var i=this.mapValueToVisual(t);r("color",e(n("color"),i))},_normalizedToVisual:fI([0,1])}}function cI(e){var t=this.option.visual;return t[Math.round(io(e,[0,1],[0,t.length-1],!0))]||{}}function hI(e){return function(t,n,r){r(e,this.mapValueToVisual(t))}}function dI(e){var t=this.option.visual;return t[this.option.loop&&e!==aI?e%t.length:e]}function pI(){return this.option.visual[0]}function fI(e){return{linear:function(t){return io(t,e,this.option.visual,!0)},category:dI,piecewise:function(t,n){var r=gI.call(this,n);return null==r&&(r=io(t,e,this.option.visual,!0)),r},fixed:pI}}function gI(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var r=n[sI.findPieceIndex(e,n)];if(r&&r.visual)return r.visual[this.type]}}function mI(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=j(t,(function(e){var t=rr(e);return t||"production"===process.env.NODE_ENV||No("'"+e+"' is an illegal color, fallback to '#000000'",!0),t||[0,0,0,1]}))),t}var vI={linear:function(e){return io(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=sI.findPieceIndex(e,t,!0);if(null!=n)return io(n,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return null==t?aI:t},fixed:Ie};function yI(e,t,n){return e?t<=n:t<n}var _I=ta(),xI={seriesType:"treemap",reset:function(e){var t=e.getData().tree.root;t.isRemoved()||bI(t,{},e.getViewRoot().getAncestors(),e)}};function bI(e,t,n,r){var i=e.getModel(),o=e.getLayout(),a=e.hostTree.data;if(o&&!o.invisible&&o.isInView){var s,l=i.getModel("itemStyle"),u=function(e,t,n){var r=z({},t),i=n.designatedVisualItemStyle;return W(["color","colorAlpha","colorSaturation"],(function(n){i[n]=t[n];var o=e.get(n);i[n]=null,null!=o&&(r[n]=o)})),r}(l,t,r),c=a.ensureUniqueItemVisual(e.dataIndex,"style"),h=l.get("borderColor"),d=l.get("borderColorSaturation");null!=d&&(h=function(e,t){return null!=t?cr(t,null,null,e):null}(d,s=wI(u))),c.stroke=h;var p=e.viewChildren;if(p&&p.length){var f=function(e,t,n,r,i,o){if(!o||!o.length)return;var a=TI(t,"color")||null!=i.color&&"none"!==i.color&&(TI(t,"colorAlpha")||TI(t,"colorSaturation"));if(!a)return;var s=t.get("visualMin"),l=t.get("visualMax"),u=n.dataExtent.slice();null!=s&&s<u[0]&&(u[0]=s),null!=l&&l>u[1]&&(u[1]=l);var c=t.get("colorMappingBy"),h={type:a.name,dataExtent:u,visual:a.range};"color"!==h.type||"index"!==c&&"id"!==c?h.mappingMethod="linear":(h.mappingMethod="category",h.loop=!0);var d=new sI(h);return _I(d).drColorMappingBy=c,d}(0,i,o,0,u,p);W(p,(function(e,t){if(e.depth>=n.length||e===n[e.depth]){var o=function(e,t,n,r,i,o){var a=z({},t);if(i){var s=i.type,l="color"===s&&_I(i).drColorMappingBy,u="index"===l?r:"id"===l?o.mapIdToIndex(n.getId()):n.getValue(e.get("visualDimension"));a[s]=i.mapValueToVisual(u)}return a}(i,u,e,t,f,r);bI(e,o,n,r)}}))}else s=wI(u),c.fill=s}}function wI(e){var t=SI(e,"color");if(t){var n=SI(e,"colorAlpha"),r=SI(e,"colorSaturation");return r&&(t=cr(t,null,null,r)),n&&(t=hr(t,n)),t}}function SI(e,t){var n=e[t];if(null!=n&&"none"!==n)return n}function TI(e,t){var n=e.get(t);return J(n)&&n.length?{name:t,range:n}:null}var MI=Math.max,CI=Math.min,DI=he,AI=W,II=["itemStyle","borderWidth"],EI=["itemStyle","gapWidth"],LI=["upperLabel","show"],NI=["upperLabel","height"],PI={seriesType:"treemap",reset:function(e,t,n,r){var i=n.getWidth(),o=n.getHeight(),a=e.option,s=Zd(e.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),l=a.size||[],u=oo(DI(s.width,l[0]),i),c=oo(DI(s.height,l[1]),o),h=r&&r.type,d=OA(r,["treemapZoomToNode","treemapRootToNode"],e),p="treemapRender"===h||"treemapMove"===h?r.rootRect:null,f=e.getViewRoot(),g=RA(f);if("treemapMove"!==h){var m="treemapZoomToNode"===h?function(e,t,n,r,i){var o,a=(t||{}).node,s=[r,i];if(!a||a===n)return s;var l=r*i,u=l*e.option.zoomToNodeRatio;for(;o=a.parentNode;){for(var c=0,h=o.children,d=0,p=h.length;d<p;d++)c+=h[d].getValue();var f=a.getValue();if(0===f)return s;u*=c/f;var g=o.getModel(),m=g.get(II);(u+=4*m*m+(3*m+Math.max(m,VI(g)))*Math.pow(u,.5))>fo&&(u=fo),a=o}u<l&&(u=l);var v=Math.pow(u/l,.5);return[r*v,i*v]}(e,d,f,u,c):p?[p.width,p.height]:[u,c],v=a.sort;v&&"asc"!==v&&"desc"!==v&&(v="desc");var y={squareRatio:a.squareRatio,sort:v,leafDepth:a.leafDepth};f.hostTree.clearLayouts();var _={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};f.setLayout(_),OI(f,y,!1,0),_=f.getLayout(),AI(g,(function(e,t){var n=(g[t+1]||f).getValue();e.setLayout(z({dataExtent:[n,n],borderWidth:0,upperHeight:0},_))}))}var x=e.getData().tree.root;x.setLayout(function(e,t,n){if(t)return{x:t.x,y:t.y};var r={x:0,y:0};if(!n)return r;var i=n.node,o=i.getLayout();if(!o)return r;var a=[o.width/2,o.height/2],s=i;for(;s;){var l=s.getLayout();a[0]+=l.x,a[1]+=l.y,s=s.parentNode}return{x:e.width/2-a[0],y:e.height/2-a[1]}}(s,p,d),!0),e.setLayoutInfo(s),zI(x,new jt(-s.x,-s.y,i,o),g,f,0)}};function OI(e,t,n,r){var i,o;if(!e.isRemoved()){var a=e.getLayout();i=a.width,o=a.height;var s=e.getModel(),l=s.get(II),u=s.get(EI)/2,c=VI(s),h=Math.max(l,c),d=l-u,p=h-u;e.setLayout({borderWidth:l,upperHeight:h,upperLabelHeight:c},!0);var f=(i=MI(i-2*d,0))*(o=MI(o-d-p,0)),g=function(e,t,n,r,i,o){var a=e.children||[],s=r.sort;"asc"!==s&&"desc"!==s&&(s=null);var l=null!=r.leafDepth&&r.leafDepth<=o;if(i&&!l)return e.viewChildren=[];a=Y(a,(function(e){return!e.isRemoved()})),function(e,t){t&&e.sort((function(e,n){var r="asc"===t?e.getValue()-n.getValue():n.getValue()-e.getValue();return 0===r?"asc"===t?e.dataIndex-n.dataIndex:n.dataIndex-e.dataIndex:r}))}(a,s);var u=function(e,t,n){for(var r=0,i=0,o=t.length;i<o;i++)r+=t[i].getValue();var a,s=e.get("visualDimension");t&&t.length?"value"===s&&n?(a=[t[t.length-1].getValue(),t[0].getValue()],"asc"===n&&a.reverse()):(a=[1/0,-1/0],AI(t,(function(e){var t=e.getValue(s);t<a[0]&&(a[0]=t),t>a[1]&&(a[1]=t)}))):a=[NaN,NaN];return{sum:r,dataExtent:a}}(t,a,s);if(0===u.sum)return e.viewChildren=[];if(u.sum=function(e,t,n,r,i){if(!r)return n;for(var o=e.get("visibleMin"),a=i.length,s=a,l=a-1;l>=0;l--){var u=i["asc"===r?a-l-1:l].getValue();u/n*t<o&&(s=l,n-=u)}return"asc"===r?i.splice(0,a-s):i.splice(s,a-s),n}(t,n,u.sum,s,a),0===u.sum)return e.viewChildren=[];for(var c=0,h=a.length;c<h;c++){var d=a[c].getValue()/u.sum*n;a[c].setLayout({area:d})}l&&(a.length&&e.setLayout({isLeafRoot:!0},!0),a.length=0);return e.viewChildren=a,e.setLayout({dataExtent:u.dataExtent},!0),a}(e,s,f,t,n,r);if(g.length){var m={x:d,y:p,width:i,height:o},v=CI(i,o),y=1/0,_=[];_.area=0;for(var x=0,b=g.length;x<b;){var w=g[x];_.push(w),_.area+=w.getLayout().area;var S=RI(_,v,t.squareRatio);S<=y?(x++,y=S):(_.area-=_.pop().getLayout().area,kI(_,v,m,u,!1),v=CI(m.width,m.height),_.length=_.area=0,y=1/0)}if(_.length&&kI(_,v,m,u,!0),!n){var T=s.get("childrenVisibleMin");null!=T&&f<T&&(n=!0)}for(x=0,b=g.length;x<b;x++)OI(g[x],t,n,r+1)}}}function RI(e,t,n){for(var r=0,i=1/0,o=0,a=void 0,s=e.length;o<s;o++)(a=e[o].getLayout().area)&&(a<i&&(i=a),a>r&&(r=a));var l=e.area*e.area,u=t*t*n;return l?MI(u*r/l,l/(u*i)):1/0}function kI(e,t,n,r,i){var o=t===n.width?0:1,a=1-o,s=["x","y"],l=["width","height"],u=n[s[o]],c=t?e.area/t:0;(i||c>n[l[a]])&&(c=n[l[a]]);for(var h=0,d=e.length;h<d;h++){var p=e[h],f={},g=c?p.getLayout().area/c:0,m=f[l[a]]=MI(c-2*r,0),v=n[s[o]]+n[l[o]]-u,y=h===d-1||v<g?v:g,_=f[l[o]]=MI(y-2*r,0);f[s[a]]=n[s[a]]+CI(r,m/2),f[s[o]]=u+CI(r,_/2),u+=y,p.setLayout(f,!0)}n[s[a]]+=c,n[l[a]]-=c}function zI(e,t,n,r,i){var o=e.getLayout(),a=n[i],s=a&&a===e;if(!(a&&!s||i===n.length&&e!==r)){e.setLayout({isInView:!0,invisible:!s&&!t.intersect(o),isAboveViewRoot:s},!0);var l=new jt(t.x-o.x,t.y-o.y,t.width,t.height);AI(e.viewChildren||[],(function(e){zI(e,l,n,r,i+1)}))}}function VI(e){return e.get(LI)?e.get(NI):0}function BI(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.eachSeriesByType("graph",(function(e){var n=e.getCategoriesData(),r=e.getGraph().data,i=n.mapArray(n.getName);r.filterSelf((function(e){var n=r.getItemModel(e).getShallow("category");if(null!=n){ne(n)&&(n=i[n]);for(var o=0;o<t.length;o++)if(!t[o].isSelected(n))return!1}return!0}))}))}function FI(e){var t={};e.eachSeriesByType("graph",(function(e){var n=e.getCategoriesData(),r=e.getData(),i={};n.each((function(r){var o=n.getName(r);i["ec-"+o]=r;var a=n.getItemModel(r),s=a.getModel("itemStyle").getItemStyle();s.fill||(s.fill=e.getColorFromPalette(o,t)),n.setItemVisual(r,"style",s);for(var l=["symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++){var c=a.getShallow(l[u],!0);null!=c&&n.setItemVisual(r,l[u],c)}})),n.count()&&r.each((function(e){var t=r.getItemModel(e).getShallow("category");if(null!=t){ee(t)&&(t=i["ec-"+t]);var o=n.getItemVisual(t,"style");z(r.ensureUniqueItemVisual(e,"style"),o);for(var a=["symbol","symbolSize","symbolKeepAspect"],s=0;s<a.length;s++)r.setItemVisual(e,a[s],n.getItemVisual(t,a[s]))}}))}))}function GI(e){return e instanceof Array||(e=[e,e]),e}function HI(e){e.eachSeriesByType("graph",(function(e){var t=e.getGraph(),n=e.getEdgeData(),r=GI(e.get("edgeSymbol")),i=GI(e.get("edgeSymbolSize"));n.setVisual("fromSymbol",r&&r[0]),n.setVisual("toSymbol",r&&r[1]),n.setVisual("fromSymbolSize",i&&i[0]),n.setVisual("toSymbolSize",i&&i[1]),n.setVisual("style",e.getModel("lineStyle").getLineStyle()),n.each((function(e){var r=n.getItemModel(e),i=t.getEdgeByIndex(e),o=GI(r.getShallow("symbol",!0)),a=GI(r.getShallow("symbolSize",!0)),s=r.getModel("lineStyle").getLineStyle(),l=n.ensureUniqueItemVisual(e,"style");switch(z(l,s),l.stroke){case"source":var u=i.node1.getVisual("style");l.stroke=u&&u.fill;break;case"target":u=i.node2.getVisual("style");l.stroke=u&&u.fill}o[0]&&i.setVisual("fromSymbol",o[0]),o[1]&&i.setVisual("toSymbol",o[1]),a[0]&&i.setVisual("fromSymbolSize",a[0]),a[1]&&i.setVisual("toSymbolSize",a[1])}))}))}var UI="--\x3e",WI=function(e){return e.get("autoCurveness")||null},jI=function(e,t){var n=WI(e),r=20,i=[];if(ne(n))r=n;else if(J(n))return void(e.__curvenessList=n);t>r&&(r=t);var o=r%2?r+2:r+3;i=[];for(var a=0;a<o;a++)i.push((a%2?a+1:a)/10*(a%2?-1:1));e.__curvenessList=i},XI=function(e,t,n){var r=[e.id,e.dataIndex].join("."),i=[t.id,t.dataIndex].join(".");return[n.uid,r,i].join(UI)},YI=function(e){var t=e.split(UI);return[t[0],t[2],t[1]].join(UI)},ZI=function(e,t){var n=t.__edgeMap;return n[e]?n[e].length:0};function qI(e,t,n,r){var i=WI(t),o=J(i);if(!i)return null;var a=function(e,t){var n=XI(e.node1,e.node2,t);return t.__edgeMap[n]}(e,t);if(!a)return null;for(var s=-1,l=0;l<a.length;l++)if(a[l]===n){s=l;break}var u=function(e,t){return ZI(XI(e.node1,e.node2,t),t)+ZI(XI(e.node2,e.node1,t),t)}(e,t);jI(t,u),e.lineStyle=e.lineStyle||{};var c=XI(e.node1,e.node2,t),h=t.__curvenessList,d=o||u%2?0:1;if(a.isForward)return h[d+s];var p=YI(c),f=ZI(p,t),g=h[s+f+d];return r?o?i&&0===i[0]?(f+d)%2?g:-g:((f%2?0:1)+d)%2?g:-g:(f+d)%2?g:-g:h[s+f+d]}function KI(e){var t=e.coordinateSystem;if(!t||"view"===t.type){var n=e.getGraph();n.eachNode((function(e){var t=e.getModel();e.setLayout([+t.get("x"),+t.get("y")])})),$I(n,e)}}function $I(e,t){e.eachEdge((function(e,n){var r=pe(e.getModel().get(["lineStyle","curveness"]),-qI(e,t,n,!0),0),i=Oe(e.node1.getLayout()),o=Oe(e.node2.getLayout()),a=[i,o];+r&&a.push([(i[0]+o[0])/2-(i[1]-o[1])*r,(i[1]+o[1])/2-(o[0]-i[0])*r]),e.setLayout(a)}))}function JI(e,t){e.eachSeriesByType("graph",(function(e){var t=e.get("layout"),n=e.coordinateSystem;if(n&&"view"!==n.type){var r=e.getData(),i=[];W(n.dimensions,(function(e){i=i.concat(r.mapDimensionsAll(e))}));for(var o=0;o<r.count();o++){for(var a=[],s=!1,l=0;l<i.length;l++){var u=r.get(i[l],o);isNaN(u)||(s=!0),a.push(u)}s?r.setItemLayout(o,n.dataToPoint(a)):r.setItemLayout(o,[NaN,NaN])}$I(r.graph,e)}else t&&"none"!==t||KI(e)}))}function QI(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var n=e.option.nodeScaleRatio,r=t.scaleX;return((t.getZoom()-1)*n+1)/r}function eE(e){var t=e.getVisual("symbolSize");return t instanceof Array&&(t=(t[0]+t[1])/2),+t}var tE=Math.PI,nE=[];function rE(e,t,n,r){var i=e.coordinateSystem;if(!i||"view"===i.type){var o=i.getBoundingRect(),a=e.getData(),s=a.graph,l=o.width/2+o.x,u=o.height/2+o.y,c=Math.min(o.width,o.height)/2,h=a.count();if(a.setLayout({cx:l,cy:u}),h){if(n){var d=i.pointToData(r),p=d[0],f=d[1],g=[p-l,f-u];We(g,g),Ue(g,g,c),n.setLayout([l+g[0],u+g[1]],!0),oE(n,e.get(["circular","rotateLabel"]),l,u)}iE[t](e,s,a,c,l,u,h),s.eachEdge((function(t,n){var r,i=pe(t.getModel().get(["lineStyle","curveness"]),qI(t,e,n),0),o=Oe(t.node1.getLayout()),a=Oe(t.node2.getLayout()),s=(o[0]+a[0])/2,c=(o[1]+a[1])/2;+i&&(r=[l*(i*=3)+s*(1-i),u*i+c*(1-i)]),t.setLayout([o,a,r])}))}}}var iE={value:function(e,t,n,r,i,o,a){var s=0,l=n.getSum("value"),u=2*Math.PI/(l||a);t.eachNode((function(e){var t=e.getValue("value"),n=u*(l?t:1)/2;s+=n,e.setLayout([r*Math.cos(s)+i,r*Math.sin(s)+o]),s+=n}))},symbolSize:function(e,t,n,r,i,o,a){var s=0;nE.length=a;var l=QI(e);t.eachNode((function(e){var t=eE(e);isNaN(t)&&(t=2),t<0&&(t=0),t*=l;var n=Math.asin(t/2/r);isNaN(n)&&(n=tE/2),nE[e.dataIndex]=n,s+=2*n}));var u=(2*tE-s)/a/2,c=0;t.eachNode((function(e){var t=u+nE[e.dataIndex];c+=t,(!e.getLayout()||!e.getLayout().fixed)&&e.setLayout([r*Math.cos(c)+i,r*Math.sin(c)+o]),c+=t}))}};function oE(e,t,n,r){var i=e.getGraphicEl();if(i){var o=e.getModel().get(["label","rotate"])||0,a=i.getSymbolPath();if(t){var s=e.getLayout(),l=Math.atan2(s[1]-r,s[0]-n);l<0&&(l=2*Math.PI+l);var u=s[0]<n;u&&(l-=Math.PI);var c=u?"left":"right";a.setTextConfig({rotation:-l,position:c,origin:"center"});var h=a.ensureState("emphasis");z(h.textConfig||(h.textConfig={}),{position:c})}else a.setTextConfig({rotation:o*=Math.PI/180})}}function aE(e){e.eachSeriesByType("graph",(function(e){"circular"===e.get("layout")&&rE(e,"symbolSize")}))}var sE=ze;function lE(e){e.eachSeriesByType("graph",(function(e){var t=e.coordinateSystem;if(!t||"view"===t.type)if("force"===e.get("layout")){var n=e.preservedPoints||{},r=e.getGraph(),i=r.data,o=r.edgeData,a=e.getModel("force"),s=a.get("initLayout");e.preservedPoints?i.each((function(e){var t=i.getId(e);i.setItemLayout(e,n[t]||[NaN,NaN])})):s&&"none"!==s?"circular"===s&&rE(e,"value"):KI(e);var l=i.getDataExtent("value"),u=o.getDataExtent("value"),c=a.get("repulsion"),h=a.get("edgeLength"),d=J(c)?c:[c,c],p=J(h)?h:[h,h];p=[p[1],p[0]];var f=i.mapArray("value",(function(e,t){var n=i.getItemLayout(t),r=io(e,l,d);return isNaN(r)&&(r=(d[0]+d[1])/2),{w:r,rep:r,fixed:i.getItemModel(t).get("fixed"),p:!n||isNaN(n[0])||isNaN(n[1])?null:n}})),g=o.mapArray("value",(function(t,n){var i=r.getEdgeByIndex(n),o=io(t,u,p);isNaN(o)&&(o=(p[0]+p[1])/2);var a=i.getModel(),s=pe(i.getModel().get(["lineStyle","curveness"]),-qI(i,e,n,!0),0);return{n1:f[i.node1.dataIndex],n2:f[i.node2.dataIndex],d:o,curveness:s,ignoreForceLayout:a.get("ignoreForceLayout")}})),m=t.getBoundingRect(),v=function(e,t,n){for(var r=e,i=t,o=n.rect,a=o.width,s=o.height,l=[o.x+a/2,o.y+s/2],u=null==n.gravity?.1:n.gravity,c=0;c<r.length;c++){var h=r[c];h.p||(h.p=Ne(a*(Math.random()-.5)+l[0],s*(Math.random()-.5)+l[1])),h.pp=Oe(h.p),h.edges=null}var d,p,f=null==n.friction?.6:n.friction,g=f;return{warmUp:function(){g=.8*f},setFixed:function(e){r[e].fixed=!0},setUnfixed:function(e){r[e].fixed=!1},beforeStep:function(e){d=e},afterStep:function(e){p=e},step:function(e){d&&d(r,i);for(var t=[],n=r.length,o=0;o<i.length;o++){var a=i[o];if(!a.ignoreForceLayout){var s=a.n1;Ve(t,(m=a.n2).p,s.p);var c=Be(t)-a.d,h=m.w/(s.w+m.w);isNaN(h)&&(h=0),We(t,t),!s.fixed&&sE(s.p,s.p,t,h*c*g),!m.fixed&&sE(m.p,m.p,t,-(1-h)*c*g)}}for(o=0;o<n;o++)(_=r[o]).fixed||(Ve(t,l,_.p),sE(_.p,_.p,t,u*g));for(o=0;o<n;o++){s=r[o];for(var f=o+1;f<n;f++){var m;Ve(t,(m=r[f]).p,s.p),0===(c=Be(t))&&(Re(t,Math.random()-.5,Math.random()-.5),c=1);var v=(s.rep+m.rep)/c/c;!s.fixed&&sE(s.pp,s.pp,t,v),!m.fixed&&sE(m.pp,m.pp,t,-v)}}var y=[];for(o=0;o<n;o++){var _;(_=r[o]).fixed||(Ve(y,_.p,_.pp),sE(_.p,_.p,y,g),Pe(_.pp,_.p))}var x=(g*=.992)<.01;p&&p(r,i,x),e&&e(x)}}}(f,g,{rect:m,gravity:a.get("gravity"),friction:a.get("friction")});v.beforeStep((function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].fixed&&Pe(e[n].p,r.getNodeByIndex(n).getLayout())})),v.afterStep((function(e,t,o){for(var a=0,s=e.length;a<s;a++)e[a].fixed||r.getNodeByIndex(a).setLayout(e[a].p),n[i.getId(a)]=e[a].p;for(a=0,s=t.length;a<s;a++){var l=t[a],u=r.getEdgeByIndex(a),c=l.n1.p,h=l.n2.p,d=u.getLayout();(d=d?d.slice():[])[0]=d[0]||[],d[1]=d[1]||[],Pe(d[0],c),Pe(d[1],h),+l.curveness&&(d[2]=[(c[0]+h[0])/2-(c[1]-h[1])*l.curveness,(c[1]+h[1])/2-(h[0]-c[0])*l.curveness]),u.setLayout(d)}})),e.forceLayout=v,e.preservedPoints=n,v.step()}else e.forceLayout=null}))}function uE(e,t){var n=[];return e.eachSeriesByType("graph",(function(e){var r=e.get("coordinateSystem");if(!r||"view"===r){var i=e.getData(),o=[],a=[];ns(i.mapArray((function(e){var t=i.getItemModel(e);return[+t.get("x"),+t.get("y")]})),o,a),a[0]-o[0]==0&&(a[0]+=1,o[0]-=1),a[1]-o[1]==0&&(a[1]+=1,o[1]-=1);var s=(a[0]-o[0])/(a[1]-o[1]),l=function(e,t,n){return Zd(z(e.getBoxLayoutParams(),{aspect:n}),{width:t.getWidth(),height:t.getHeight()})}(e,t,s);isNaN(s)&&(o=[l.x,l.y],a=[l.x+l.width,l.y+l.height]);var u=a[0]-o[0],c=a[1]-o[1],h=l.width,d=l.height,p=e.coordinateSystem=new WD;p.zoomLimit=e.get("scaleLimit"),p.setBoundingRect(o[0],o[1],u,c),p.setViewRect(l.x,l.y,h,d),p.setCenter(e.get("center"),t),p.setZoom(e.get("zoom")),n.push(p)}})),n}var cE=pc.prototype,hE=vc.prototype,dE=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};function pE(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}l(t,e)}(dE);var fE=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-line",n}return l(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new dE},t.prototype.buildPath=function(e,t){pE(t)?cE.buildPath.call(this,e,t):hE.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return pE(this.shape)?cE.pointAt.call(this,e):hE.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,n=pE(t)?[t.x2-t.x1,t.y2-t.y1]:hE.tangentAt.call(this,e);return We(n,n)},t}(Ys),gE=["fromSymbol","toSymbol"];function mE(e){return"_"+e+"Type"}function vE(e,t,n){var r=t.getItemVisual(n,e);if(!r||"none"===r)return r;var i=t.getItemVisual(n,e+"Size"),o=t.getItemVisual(n,e+"Rotate"),a=t.getItemVisual(n,e+"Offset"),s=t.getItemVisual(n,e+"KeepAspect"),l=pv(i);return r+l+fv(a||0,l)+(o||"")+(s||"")}function yE(e,t,n){var r=t.getItemVisual(n,e);if(r&&"none"!==r){var i=t.getItemVisual(n,e+"Size"),o=t.getItemVisual(n,e+"Rotate"),a=t.getItemVisual(n,e+"Offset"),s=t.getItemVisual(n,e+"KeepAspect"),l=pv(i),u=fv(a||0,l),c=dv(r,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return c.__specifiedRotation=null==o||isNaN(o)?void 0:+o*Math.PI/180||0,c.name=e,c}}function _E(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var n=t[2];n?(e.cpx1=n[0],e.cpy1=n[1]):(e.cpx1=NaN,e.cpy1=NaN)}var xE=function(e){function t(t,n,r){var i=e.call(this)||this;return i._createLine(t,n,r),i}return l(t,e),t.prototype._createLine=function(e,t,n){var r=e.hostModel,i=function(e){var t=new fE({name:"line",subPixelOptimize:!0});return _E(t.shape,e),t}(e.getItemLayout(t));i.shape.percent=0,Rc(i,{shape:{percent:1}},r,t),this.add(i),W(gE,(function(n){var r=yE(n,e,t);this.add(r),this[mE(n)]=vE(n,e,t)}),this),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var r=e.hostModel,i=this.childOfName("line"),o=e.getItemLayout(t),a={shape:{}};_E(a.shape,o),Oc(i,a,r,t),W(gE,(function(n){var r=vE(n,e,t),i=mE(n);if(this[i]!==r){this.remove(this.childOfName(n));var o=yE(n,e,t);this.add(o)}this[i]=r}),this),this._updateCommonStl(e,t,n)},t.prototype.getLinePath=function(){return this.childAt(0)},t.prototype._updateCommonStl=function(e,t,n){var r=e.hostModel,i=this.childOfName("line"),o=n&&n.emphasisLineStyle,a=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels,u=n&&n.emphasisDisabled,c=n&&n.focus,h=n&&n.blurScope;if(!n||e.hasItemOption){var d=e.getItemModel(t),p=d.getModel("emphasis");o=p.getModel("lineStyle").getLineStyle(),a=d.getModel(["blur","lineStyle"]).getLineStyle(),s=d.getModel(["select","lineStyle"]).getLineStyle(),u=p.get("disabled"),c=p.get("focus"),h=p.get("blurScope"),l=bh(d)}var f=e.getItemVisual(t,"style"),g=f.stroke;i.useStyle(f),i.style.fill=null,i.style.strokeNoScale=!0,i.ensureState("emphasis").style=o,i.ensureState("blur").style=a,i.ensureState("select").style=s,W(gE,(function(e){var t=this.childOfName(e);if(t){t.setColor(g),t.style.opacity=f.opacity;for(var n=0;n<Dl.length;n++){var r=Dl[n],o=i.getState(r);if(o){var a=o.style||{},s=t.ensureState(r),l=s.style||(s.style={});null!=a.stroke&&(l[t.__isEmptyBrush?"stroke":"fill"]=a.stroke),null!=a.opacity&&(l.opacity=a.opacity)}}t.markRedraw()}}),this);var m=r.getRawValue(t);xh(this,l,{labelDataIndex:t,labelFetcher:{getFormattedLabel:function(t,n){return r.getFormattedLabel(t,n,e.dataType)}},inheritColor:g||"#000",defaultOpacity:f.opacity,defaultText:(null==m?e.getName(t):isFinite(m)?ao(m):m)+""});var v=this.getTextContent();if(v){var y=l.normal;v.__align=v.style.align,v.__verticalAlign=v.style.verticalAlign,v.__position=y.get("position")||"middle";var _=y.get("distance");J(_)||(_=[_,_]),v.__labelDistance=_}this.setTextConfig({position:null,local:!0,inside:!1}),cu(this,c,h,u)},t.prototype.highlight=function(){Kl(this)},t.prototype.downplay=function(){$l(this)},t.prototype.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},t.prototype.setLinePoints=function(e){var t=this.childOfName("line");_E(t.shape,e),t.dirty()},t.prototype.beforeUpdate=function(){var e=this,t=e.childOfName("fromSymbol"),n=e.childOfName("toSymbol"),r=e.getTextContent();if(t||n||r&&!r.ignore){for(var i=1,o=this.parent;o;)o.scaleX&&(i/=o.scaleX),o=o.parent;var a=e.childOfName("line");if(this.__dirty||a.__dirty){var s=a.shape.percent,l=a.pointAt(0),u=a.pointAt(s),c=Ve([],u,l);if(We(c,c),t&&(t.setPosition(l),S(t,0),t.scaleX=t.scaleY=i*s,t.markRedraw()),n&&(n.setPosition(u),S(n,1),n.scaleX=n.scaleY=i*s,n.markRedraw()),r&&!r.ignore){r.x=r.y=0,r.originX=r.originY=0;var h=void 0,d=void 0,p=r.__labelDistance,f=p[0]*i,g=p[1]*i,m=s/2,v=a.tangentAt(m),y=[v[1],-v[0]],_=a.pointAt(m);y[1]>0&&(y[0]=-y[0],y[1]=-y[1]);var x=v[0]<0?-1:1;if("start"!==r.__position&&"end"!==r.__position){var b=-Math.atan2(v[1],v[0]);u[0]<l[0]&&(b=Math.PI+b),r.rotation=b}var w=void 0;switch(r.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":w=-g,d="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":w=g,d="top";break;default:w=0,d="middle"}switch(r.__position){case"end":r.x=c[0]*f+u[0],r.y=c[1]*g+u[1],h=c[0]>.8?"left":c[0]<-.8?"right":"center",d=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":r.x=-c[0]*f+l[0],r.y=-c[1]*g+l[1],h=c[0]>.8?"right":c[0]<-.8?"left":"center",d=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":r.x=f*x+l[0],r.y=l[1]+w,h=v[0]<0?"right":"left",r.originX=-f*x,r.originY=-w;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":r.x=_[0],r.y=_[1]+w,h="center",r.originY=-w;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":r.x=-f*x+u[0],r.y=u[1]+w,h=v[0]>=0?"right":"left",r.originX=f*x,r.originY=-w}r.scaleX=r.scaleY=i,r.setStyle({verticalAlign:r.__verticalAlign||d,align:r.__align||h})}}}function S(e,t){var n=e.__specifiedRotation;if(null==n){var r=a.tangentAt(t);e.attr("rotation",(1===t?-1:1)*Math.PI/2-Math.atan2(r[1],r[0]))}else e.attr("rotation",n)}},t}(Yi),bE=function(){function e(e){this.group=new Yi,this._LineCtor=e||xE}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this,r=n.group,i=n._lineData;n._lineData=e,i||r.removeAll();var o=wE(e);e.diff(i).add((function(n){t._doAdd(e,n,o)})).update((function(n,r){t._doUpdate(i,e,r,n,o)})).remove((function(e){r.remove(i.getItemGraphicEl(e))})).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl((function(t,n){t.updateLayout(e,n)}),this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=wE(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t){function n(e){e.isGroup||function(e){return e.animators&&e.animators.length>0}(e)||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var r=e.start;r<e.end;r++){if(TE(t.getItemLayout(r))){var i=new this._LineCtor(t,r,this._seriesScope);i.traverse(n),this.group.add(i),t.setItemGraphicEl(r,i),this._progressiveEls.push(i)}}},e.prototype.remove=function(){this.group.removeAll()},e.prototype.eachRendered=function(e){gh(this._progressiveEls||this.group,e)},e.prototype._doAdd=function(e,t,n){if(TE(e.getItemLayout(t))){var r=new this._LineCtor(e,t,n);e.setItemGraphicEl(t,r),this.group.add(r)}},e.prototype._doUpdate=function(e,t,n,r,i){var o=e.getItemGraphicEl(n);TE(t.getItemLayout(r))?(o?o.updateData(t,r,i):o=new this._LineCtor(t,r,i),t.setItemGraphicEl(r,o),this.group.add(o)):this.group.remove(o)},e}();function wE(e){var t=e.hostModel,n=t.getModel("emphasis");return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:bh(t)}}function SE(e){return isNaN(e[0])||isNaN(e[1])}function TE(e){return e&&!SE(e[0])&&!SE(e[1])}var ME=[],CE=[],DE=[],AE=Pn,IE=Ze,EE=Math.abs;function LE(e,t,n){for(var r,i=e[0],o=e[1],a=e[2],s=1/0,l=n*n,u=.1,c=.1;c<=.9;c+=.1){ME[0]=AE(i[0],o[0],a[0],c),ME[1]=AE(i[1],o[1],a[1],c),(p=EE(IE(ME,t)-l))<s&&(s=p,r=c)}for(var h=0;h<32;h++){var d=r+u;CE[0]=AE(i[0],o[0],a[0],r),CE[1]=AE(i[1],o[1],a[1],r),DE[0]=AE(i[0],o[0],a[0],d),DE[1]=AE(i[1],o[1],a[1],d);var p=IE(CE,t)-l;if(EE(p)<.01)break;var f=IE(DE,t)-l;u/=2,p<0?f>=0?r+=u:r-=u:f>=0?r-=u:r+=u}return r}function NE(e,t){var n=[],r=kn,i=[[],[],[]],o=[[],[]],a=[];t/=2,e.eachEdge((function(e,s){var l=e.getLayout(),u=e.getVisual("fromSymbol"),c=e.getVisual("toSymbol");l.__original||(l.__original=[Oe(l[0]),Oe(l[1])],l[2]&&l.__original.push(Oe(l[2])));var h=l.__original;if(null!=l[2]){if(Pe(i[0],h[0]),Pe(i[1],h[2]),Pe(i[2],h[1]),u&&"none"!==u){var d=eE(e.node1),p=LE(i,h[0],d*t);r(i[0][0],i[1][0],i[2][0],p,n),i[0][0]=n[3],i[1][0]=n[4],r(i[0][1],i[1][1],i[2][1],p,n),i[0][1]=n[3],i[1][1]=n[4]}if(c&&"none"!==c){d=eE(e.node2),p=LE(i,h[1],d*t);r(i[0][0],i[1][0],i[2][0],p,n),i[1][0]=n[1],i[2][0]=n[2],r(i[0][1],i[1][1],i[2][1],p,n),i[1][1]=n[1],i[2][1]=n[2]}Pe(l[0],i[0]),Pe(l[1],i[2]),Pe(l[2],i[1])}else{if(Pe(o[0],h[0]),Pe(o[1],h[1]),Ve(a,o[1],o[0]),We(a,a),u&&"none"!==u){d=eE(e.node1);ze(o[0],o[0],a,d*t)}if(c&&"none"!==c){d=eE(e.node2);ze(o[1],o[1],a,-d*t)}Pe(l[0],o[0]),Pe(l[1],o[1])}}))}function PE(e){return"view"===e.type}var OE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(e,t){var n=new qS,r=new bE,i=this.group;this._controller=new NC(t.getZr()),this._controllerHost={target:i},i.add(n.group),i.add(r.group),this._symbolDraw=n,this._lineDraw=r,this._firstRender=!0},t.prototype.render=function(e,t,n){var r=this,i=e.coordinateSystem;this._model=e;var o=this._symbolDraw,a=this._lineDraw,s=this.group;if(PE(i)){var l={x:i.x,y:i.y,scaleX:i.scaleX,scaleY:i.scaleY};this._firstRender?s.attr(l):Oc(s,l,e)}NE(e.getGraph(),QI(e));var u=e.getData();o.updateData(u);var c=e.getEdgeData();a.updateData(c),this._updateNodeAndLinkScale(),this._updateController(e,t,n),clearTimeout(this._layoutTimeout);var h=e.forceLayout,d=e.get(["force","layoutAnimation"]);h&&this._startForceLayoutIteration(h,d);var p=e.get("layout");u.graph.eachNode((function(t){var n=t.dataIndex,i=t.getGraphicEl(),o=t.getModel();if(i){i.off("drag").off("dragend");var a=o.get("draggable");a&&i.on("drag",(function(o){switch(p){case"force":h.warmUp(),!r._layouting&&r._startForceLayoutIteration(h,d),h.setFixed(n),u.setItemLayout(n,[i.x,i.y]);break;case"circular":u.setItemLayout(n,[i.x,i.y]),t.setLayout({fixed:!0},!0),rE(e,"symbolSize",t,[o.offsetX,o.offsetY]),r.updateLayout(e);break;default:u.setItemLayout(n,[i.x,i.y]),$I(e.getGraph(),e),r.updateLayout(e)}})).on("dragend",(function(){h&&h.setUnfixed(n)})),i.setDraggable(a,!!o.get("cursor")),"adjacency"===o.get(["emphasis","focus"])&&(bl(i).focus=t.getAdjacentDataIndices())}})),u.graph.eachEdge((function(e){var t=e.getGraphicEl(),n=e.getModel().get(["emphasis","focus"]);t&&"adjacency"===n&&(bl(t).focus={edge:[e.dataIndex],node:[e.node1.dataIndex,e.node2.dataIndex]})}));var f="circular"===e.get("layout")&&e.get(["circular","rotateLabel"]),g=u.getLayout("cx"),m=u.getLayout("cy");u.graph.eachNode((function(e){oE(e,f,g,m)})),this._firstRender=!1},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._startForceLayoutIteration=function(e,t){var n=this;!function r(){e.step((function(e){n.updateLayout(n._model),(n._layouting=!e)&&(t?n._layoutTimeout=setTimeout(r,16):r())}))}()},t.prototype._updateController=function(e,t,n){var r=this,i=this._controller,o=this._controllerHost,a=this.group;i.setPointerChecker((function(t,r,i){var o=a.getBoundingRect();return o.applyTransform(a.transform),o.contain(r,i)&&!FC(t,n,e)})),PE(e.coordinateSystem)?(i.enable(e.get("roam")),o.zoomLimit=e.get("scaleLimit"),o.zoom=e.coordinateSystem.getZoom(),i.off("pan").off("zoom").on("pan",(function(t){kC(o,t.dx,t.dy),n.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){zC(o,t.scale,t.originX,t.originY),n.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),r._updateNodeAndLinkScale(),NE(e.getGraph(),QI(e)),r._lineDraw.updateLayout(),n.updateLabelLayout()}))):i.disable()},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,t=e.getData(),n=QI(e);t.eachItemGraphicEl((function(e,t){e&&e.setSymbolScale(n)}))},t.prototype.updateLayout=function(e){NE(e.getGraph(),QI(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},t.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},t.type="graph",t}(em);function RE(e){return"_EC_"+e}var kE=function(){function e(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return e.prototype.isDirected=function(){return this._directed},e.prototype.addNode=function(e,t){e=null==e?""+t:""+e;var n=this._nodesMap;if(!n[RE(e)]){var r=new zE(e,t);return r.hostGraph=this,this.nodes.push(r),n[RE(e)]=r,r}"production"!==process.env.NODE_ENV&&console.error("Graph nodes have duplicate name or id")},e.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},e.prototype.getNodeById=function(e){return this._nodesMap[RE(e)]},e.prototype.addEdge=function(e,t,n){var r=this._nodesMap,i=this._edgesMap;if(ne(e)&&(e=this.nodes[e]),ne(t)&&(t=this.nodes[t]),e instanceof zE||(e=r[RE(e)]),t instanceof zE||(t=r[RE(t)]),e&&t){var o=e.id+"-"+t.id,a=new VE(e,t,n);return a.hostGraph=this,this._directed&&(e.outEdges.push(a),t.inEdges.push(a)),e.edges.push(a),e!==t&&t.edges.push(a),this.edges.push(a),i[o]=a,a}},e.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},e.prototype.getEdge=function(e,t){e instanceof zE&&(e=e.id),t instanceof zE&&(t=t.id);var n=this._edgesMap;return this._directed?n[e+"-"+t]:n[e+"-"+t]||n[t+"-"+e]},e.prototype.eachNode=function(e,t){for(var n=this.nodes,r=n.length,i=0;i<r;i++)n[i].dataIndex>=0&&e.call(t,n[i],i)},e.prototype.eachEdge=function(e,t){for(var n=this.edges,r=n.length,i=0;i<r;i++)n[i].dataIndex>=0&&n[i].node1.dataIndex>=0&&n[i].node2.dataIndex>=0&&e.call(t,n[i],i)},e.prototype.breadthFirstTraverse=function(e,t,n,r){if(t instanceof zE||(t=this._nodesMap[RE(t)]),t){for(var i="out"===n?"outEdges":"in"===n?"inEdges":"edges",o=0;o<this.nodes.length;o++)this.nodes[o].__visited=!1;if(!e.call(r,t,null))for(var a=[t];a.length;){var s=a.shift(),l=s[i];for(o=0;o<l.length;o++){var u=l[o],c=u.node1===s?u.node2:u.node1;if(!c.__visited){if(e.call(r,c,s))return;a.push(c),c.__visited=!0}}}}},e.prototype.update=function(){for(var e=this.data,t=this.edgeData,n=this.nodes,r=this.edges,i=0,o=n.length;i<o;i++)n[i].dataIndex=-1;for(i=0,o=e.count();i<o;i++)n[e.getRawIndex(i)].dataIndex=i;t.filterSelf((function(e){var n=r[t.getRawIndex(e)];return n.node1.dataIndex>=0&&n.node2.dataIndex>=0}));for(i=0,o=r.length;i<o;i++)r[i].dataIndex=-1;for(i=0,o=t.count();i<o;i++)r[t.getRawIndex(i)].dataIndex=i},e.prototype.clone=function(){for(var t=new e(this._directed),n=this.nodes,r=this.edges,i=0;i<n.length;i++)t.addNode(n[i].id,n[i].dataIndex);for(i=0;i<r.length;i++){var o=r[i];t.addEdge(o.node1.id,o.node2.id,o.dataIndex)}return t},e}(),zE=function(){function e(e,t){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=null==e?"":e,this.dataIndex=null==t?-1:t}return e.prototype.degree=function(){return this.edges.length},e.prototype.inDegree=function(){return this.inEdges.length},e.prototype.outDegree=function(){return this.outEdges.length},e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(e)},e.prototype.getAdjacentDataIndices=function(){for(var e={edge:[],node:[]},t=0;t<this.edges.length;t++){var n=this.edges[t];n.dataIndex<0||(e.edge.push(n.dataIndex),e.node.push(n.node1.dataIndex,n.node2.dataIndex))}return e},e.prototype.getTrajectoryDataIndices=function(){for(var e=Te(),t=Te(),n=0;n<this.edges.length;n++){var r=this.edges[n];if(!(r.dataIndex<0)){e.set(r.dataIndex,!0);for(var i=[r.node1],o=[r.node2],a=0;a<i.length;){var s=i[a];a++,t.set(s.dataIndex,!0);for(var l=0;l<s.inEdges.length;l++)e.set(s.inEdges[l].dataIndex,!0),i.push(s.inEdges[l].node1)}for(a=0;a<o.length;){var u=o[a];a++,t.set(u.dataIndex,!0);for(l=0;l<u.outEdges.length;l++)e.set(u.outEdges[l].dataIndex,!0),o.push(u.outEdges[l].node2)}}}return{edge:e.keys(),node:t.keys()}},e}(),VE=function(){function e(e,t,n){this.dataIndex=-1,this.node1=e,this.node2=t,this.dataIndex=null==n?-1:n}return e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)},e.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},e.prototype.getTrajectoryDataIndices=function(){var e=Te(),t=Te();e.set(this.dataIndex,!0);for(var n=[this.node1],r=[this.node2],i=0;i<n.length;){var o=n[i];i++,t.set(o.dataIndex,!0);for(var a=0;a<o.inEdges.length;a++)e.set(o.inEdges[a].dataIndex,!0),n.push(o.inEdges[a].node1)}for(i=0;i<r.length;){var s=r[i];i++,t.set(s.dataIndex,!0);for(a=0;a<s.outEdges.length;a++)e.set(s.outEdges[a].dataIndex,!0),r.push(s.outEdges[a].node2)}return{edge:e.keys(),node:t.keys()}},e}();function BE(e,t){return{getValue:function(n){var r=this[e][t];return r.getStore().get(r.getDimensionIndex(n||"value"),this.dataIndex)},setVisual:function(n,r){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,n,r)},getVisual:function(n){return this[e][t].getItemVisual(this.dataIndex,n)},setLayout:function(n,r){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,n,r)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}function FE(e,t,n,r,i){for(var o=new kE(r),a=0;a<e.length;a++)o.addNode(he(e[a].id,e[a].name,a),a);var s=[],l=[],u=0;for(a=0;a<t.length;a++){var c=t[a],h=c.source,d=c.target;o.addEdge(h,d,u)&&(l.push(c),s.push(he(qo(c.id,null),h+" > "+d)),u++)}var p,f=n.get("coordinateSystem");if("cartesian2d"===f||"polar"===f)p=j_(e,n);else{var g=Up.get(f),m=g&&g.dimensions||[];F(m,"value")<0&&m.concat(["value"]);var v=z_(e,{coordDimensions:m,encodeDefine:n.getEncode()}).dimensions;(p=new R_(v,n)).initData(e)}var y=new R_(["value"],n);return y.initData(l,s),i&&i(p,y),TA({mainData:p,struct:o,structAttr:"graph",datas:{node:p,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}H(zE,BE("hostGraph","data")),H(VE,BE("hostGraph","edgeData"));var GE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return l(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments);var n=this;function r(){return n._categoriesData}this.legendVisualProvider=new dM(r,r),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeDefaultAndTheme=function(t){e.prototype.mergeDefaultAndTheme.apply(this,arguments),Ho(t,"edgeLabel",["show"])},t.prototype.getInitialData=function(e,t){var n,r=e.edges||e.links||[],i=e.data||e.nodes||[],o=this;if(i&&r){WI(n=this)&&(n.__curvenessList=[],n.__edgeMap={},jI(n));var a=FE(i,r,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e){var t=o._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));var n=Wh.prototype.getModel;function r(e,t){var r=n.call(this,e,t);return r.resolveParentPath=i,r}function i(e){if(e&&("label"===e[0]||"label"===e[1])){var t=e.slice();return"label"===e[0]?t[0]="edgeLabel":"label"===e[1]&&(t[1]="edgeLabel"),t}return e}t.wrapMethod("getItemModel",(function(e){return e.resolveParentPath=i,e.getModel=r,e}))}));return W(a.edges,(function(e){!function(e,t,n,r){if(WI(n)){var i=XI(e,t,n),o=n.__edgeMap,a=o[YI(i)];o[i]&&!a?o[i].isForward=!0:a&&o[i]&&(a.isForward=!0,o[i].isForward=!1),o[i]=o[i]||[],o[i].push(r)}}(e.node1,e.node2,this,e.dataIndex)}),this),a.data}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.getCategoriesData=function(){return this._categoriesData},t.prototype.formatTooltip=function(e,t,n){if("edge"===n){var r=this.getData(),i=this.getDataParams(e,n),o=r.graph.getEdgeByIndex(e),a=r.getName(o.node1.dataIndex),s=r.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),Cg("nameValue",{name:l.join(" > "),value:i.value,noValue:null==i.value})}return Vg({series:this,dataIndex:e,multipleSeries:t})},t.prototype._updateCategoriesData=function(){var e=j(this.option.categories||[],(function(e){return null!=e.value?e:z({value:0},e)})),t=new R_(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e)}))},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},t.type="series.graph",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t}(Hg),HE={type:"graphRoam",event:"graphRoam",update:"none"};var UE=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},WE=function(e){function t(t){var n=e.call(this,t)||this;return n.type="pointer",n}return l(t,e),t.prototype.getDefaultShape=function(){return new UE},t.prototype.buildPath=function(e,t){var n=Math.cos,r=Math.sin,i=t.r,o=t.width,a=t.angle,s=t.x-n(a)*o*(o>=i/3?1:2),l=t.y-r(a)*o*(o>=i/3?1:2);a=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+n(a)*o,t.y+r(a)*o),e.lineTo(t.x+n(t.angle)*i,t.y+r(t.angle)*i),e.lineTo(t.x-n(a)*o,t.y-r(a)*o),e.lineTo(s,l)},t}(Ys);function jE(e,t){var n=null==e?"":e+"";return t&&(ee(t)?n=t.replace("{value}",n):Q(t)&&(n=t(e))),n}var XE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){this.group.removeAll();var r=e.get(["axisLine","lineStyle","color"]),i=function(e,t){var n=e.get("center"),r=t.getWidth(),i=t.getHeight(),o=Math.min(r,i);return{cx:oo(n[0],t.getWidth()),cy:oo(n[1],t.getHeight()),r:oo(e.get("radius"),o/2)}}(e,n);this._renderMain(e,t,n,r,i),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,t,n,r,i){var o=this.group,a=e.get("clockwise"),s=-e.get("startAngle")/180*Math.PI,l=-e.get("endAngle")/180*Math.PI,u=e.getModel("axisLine"),c=u.get("roundCap")?IT:rc,h=u.get("show"),d=u.getModel("lineStyle"),p=d.get("width"),f=[s,l];Cs(f,!a);for(var g=(l=f[1])-(s=f[0]),m=s,v=[],y=0;h&&y<r.length;y++){var _=new c({shape:{startAngle:m,endAngle:l=s+g*Math.min(Math.max(r[y][0],0),1),cx:i.cx,cy:i.cy,clockwise:a,r0:i.r-p,r:i.r},silent:!0});_.setStyle({fill:r[y][1]}),_.setStyle(d.getLineStyle(["color","width"])),v.push(_),m=l}v.reverse(),W(v,(function(e){return o.add(e)}));var x=function(e){if(e<=0)return r[0][1];var t;for(t=0;t<r.length;t++)if(r[t][0]>=e&&(0===t?0:r[t-1][0])<e)return r[t][1];return r[t-1][1]};this._renderTicks(e,t,n,x,i,s,l,a,p),this._renderTitleAndDetail(e,t,n,x,i),this._renderAnchor(e,i),this._renderPointer(e,t,n,x,i,s,l,a,p)},t.prototype._renderTicks=function(e,t,n,r,i,o,a,s,l){for(var u,c,h=this.group,d=i.cx,p=i.cy,f=i.r,g=+e.get("min"),m=+e.get("max"),v=e.getModel("splitLine"),y=e.getModel("axisTick"),_=e.getModel("axisLabel"),x=e.get("splitNumber"),b=y.get("splitNumber"),w=oo(v.get("length"),f),S=oo(y.get("length"),f),T=o,M=(a-o)/x,C=M/b,D=v.getModel("lineStyle").getLineStyle(),A=y.getModel("lineStyle").getLineStyle(),I=v.get("distance"),E=0;E<=x;E++){if(u=Math.cos(T),c=Math.sin(T),v.get("show")){var L=new pc({shape:{x1:u*(f-(N=I?I+l:l))+d,y1:c*(f-N)+p,x2:u*(f-w-N)+d,y2:c*(f-w-N)+p},style:D,silent:!0});"auto"===D.stroke&&L.setStyle({stroke:r(E/x)}),h.add(L)}if(_.get("show")){var N=_.get("distance")+I,P=jE(ao(E/x*(m-g)+g),_.get("formatter")),O=r(E/x),R=u*(f-w-N)+d,k=c*(f-w-N)+p,z=_.get("rotate"),V=0;"radial"===z?(V=-T+2*Math.PI)>Math.PI/2&&(V+=Math.PI):"tangential"===z?V=-T-Math.PI/2:ne(z)&&(V=z*Math.PI/180),0===V?h.add(new ll({style:wh(_,{text:P,x:R,y:k,verticalAlign:c<-.8?"top":c>.8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:O}),silent:!0})):h.add(new ll({style:wh(_,{text:P,x:R,y:k,verticalAlign:"middle",align:"center"},{inheritColor:O}),silent:!0,originX:R,originY:k,rotation:V}))}if(y.get("show")&&E!==x){N=(N=y.get("distance"))?N+l:l;for(var B=0;B<=b;B++){u=Math.cos(T),c=Math.sin(T);var F=new pc({shape:{x1:u*(f-N)+d,y1:c*(f-N)+p,x2:u*(f-S-N)+d,y2:c*(f-S-N)+p},silent:!0,style:A});"auto"===A.stroke&&F.setStyle({stroke:r((E+B/b)/x)}),h.add(F),T+=C}T-=C}else T+=M}},t.prototype._renderPointer=function(e,t,n,r,i,o,a,s,l){var u=this.group,c=this._data,h=this._progressEls,d=[],p=e.get(["pointer","show"]),f=e.getModel("progress"),g=f.get("show"),m=e.getData(),v=m.mapDimension("value"),y=+e.get("min"),_=+e.get("max"),x=[y,_],b=[o,a];function w(t,n){var r,o=m.getItemModel(t).getModel("pointer"),a=oo(o.get("width"),i.r),s=oo(o.get("length"),i.r),l=e.get(["pointer","icon"]),u=o.get("offsetCenter"),c=oo(u[0],i.r),h=oo(u[1],i.r),d=o.get("keepAspect");return(r=l?dv(l,c-a/2,h-s,a,s,null,d):new WE({shape:{angle:-Math.PI/2,width:a,r:s,x:c,y:h}})).rotation=-(n+Math.PI/2),r.x=i.cx,r.y=i.cy,r}function S(e,t){var n=f.get("roundCap")?IT:rc,r=f.get("overlap"),a=r?f.get("width"):l/m.count(),u=r?i.r-a:i.r-(e+1)*a,c=r?i.r:i.r-e*a,h=new n({shape:{startAngle:o,endAngle:t,cx:i.cx,cy:i.cy,clockwise:s,r0:u,r:c}});return r&&(h.z2=_-m.get(v,e)%_),h}(g||p)&&(m.diff(c).add((function(t){var n=m.get(v,t);if(p){var r=w(t,o);Rc(r,{rotation:-((isNaN(+n)?b[0]:io(n,x,b,!0))+Math.PI/2)},e),u.add(r),m.setItemGraphicEl(t,r)}if(g){var i=S(t,o),a=f.get("clip");Rc(i,{shape:{endAngle:io(n,x,b,a)}},e),u.add(i),wl(e.seriesIndex,m.dataType,t,i),d[t]=i}})).update((function(t,n){var r=m.get(v,t);if(p){var i=c.getItemGraphicEl(n),a=i?i.rotation:o,s=w(t,a);s.rotation=a,Oc(s,{rotation:-((isNaN(+r)?b[0]:io(r,x,b,!0))+Math.PI/2)},e),u.add(s),m.setItemGraphicEl(t,s)}if(g){var l=h[n],y=S(t,l?l.shape.endAngle:o),_=f.get("clip");Oc(y,{shape:{endAngle:io(r,x,b,_)}},e),u.add(y),wl(e.seriesIndex,m.dataType,t,y),d[t]=y}})).execute(),m.each((function(e){var t=m.getItemModel(e),n=t.getModel("emphasis"),i=n.get("focus"),o=n.get("blurScope"),a=n.get("disabled");if(p){var s=m.getItemGraphicEl(e),l=m.getItemVisual(e,"style"),u=l.fill;if(s instanceof Js){var c=s.style;s.useStyle(z({image:c.image,x:c.x,y:c.y,width:c.width,height:c.height},l))}else s.useStyle(l),"pointer"!==s.type&&s.setColor(u);s.setStyle(t.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===s.style.fill&&s.setStyle("fill",r(io(m.get(v,e),x,[0,1],!0))),s.z2EmphasisLift=0,fu(s,t),cu(s,i,o,a)}if(g){var h=d[e];h.useStyle(m.getItemVisual(e,"style")),h.setStyle(t.getModel(["progress","itemStyle"]).getItemStyle()),h.z2EmphasisLift=0,fu(h,t),cu(h,i,o,a)}})),this._progressEls=d)},t.prototype._renderAnchor=function(e,t){var n=e.getModel("anchor");if(n.get("show")){var r=n.get("size"),i=n.get("icon"),o=n.get("offsetCenter"),a=n.get("keepAspect"),s=dv(i,t.cx-r/2+oo(o[0],t.r),t.cy-r/2+oo(o[1],t.r),r,r,null,a);s.z2=n.get("showAbove")?1:0,s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},t.prototype._renderTitleAndDetail=function(e,t,n,r,i){var o=this,a=e.getData(),s=a.mapDimension("value"),l=+e.get("min"),u=+e.get("max"),c=new Yi,h=[],d=[],p=e.isAnimationEnabled(),f=e.get(["pointer","showAbove"]);a.diff(this._data).add((function(e){h[e]=new ll({silent:!0}),d[e]=new ll({silent:!0})})).update((function(e,t){h[e]=o._titleEls[t],d[e]=o._detailEls[t]})).execute(),a.each((function(t){var n=a.getItemModel(t),o=a.get(s,t),g=new Yi,m=r(io(o,[l,u],[0,1],!0)),v=n.getModel("title");if(v.get("show")){var y=v.get("offsetCenter"),_=i.cx+oo(y[0],i.r),x=i.cy+oo(y[1],i.r);(A=h[t]).attr({z2:f?0:2,style:wh(v,{x:_,y:x,text:a.getName(t),align:"center",verticalAlign:"middle"},{inheritColor:m})}),g.add(A)}var b=n.getModel("detail");if(b.get("show")){var w=b.get("offsetCenter"),S=i.cx+oo(w[0],i.r),T=i.cy+oo(w[1],i.r),M=oo(b.get("width"),i.r),C=oo(b.get("height"),i.r),D=e.get(["progress","show"])?a.getItemVisual(t,"style").fill:m,A=d[t],I=b.get("formatter");A.attr({z2:f?0:2,style:wh(b,{x:S,y:T,text:jE(o,I),width:isNaN(M)?null:M,height:isNaN(C)?null:C,align:"center",verticalAlign:"middle"},{inheritColor:D})}),Eh(A,{normal:b},o,(function(e){return jE(e,I)})),p&&Lh(A,t,a,e,{getFormattedLabel:function(e,t,n,r,i,a){return jE(a?a.interpolatedValue:o,I)}}),g.add(A)}c.add(g)})),this.group.add(c),this._titleEls=h,this._detailEls=d},t.type="gauge",t}(em),YE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="itemStyle",n}return l(t,e),t.prototype.getInitialData=function(e,t){return hM(this,["value"])},t.type="series.gauge",t.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t}(Hg);var ZE=["itemStyle","opacity"],qE=function(e){function t(t,n){var r=e.call(this)||this,i=r,o=new cc,a=new ll;return i.setTextContent(a),r.setTextGuideLine(o),r.updateData(t,n,!0),r}return l(t,e),t.prototype.updateData=function(e,t,n){var r=this,i=e.hostModel,o=e.getItemModel(t),a=e.getItemLayout(t),s=o.getModel("emphasis"),l=o.get(ZE);l=null==l?1:l,n||Fc(r),r.useStyle(e.getItemVisual(t,"style")),r.style.lineJoin="round",n?(r.setShape({points:a.points}),r.style.opacity=0,Rc(r,{style:{opacity:l}},i,t)):Oc(r,{style:{opacity:l},shape:{points:a.points}},i,t),fu(r,o),this._updateLabel(e,t),cu(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},t.prototype._updateLabel=function(e,t){var n=this,r=this.getTextGuideLine(),i=n.getTextContent(),o=e.hostModel,a=e.getItemModel(t),s=e.getItemLayout(t).label,l=e.getItemVisual(t,"style"),u=l.fill;xh(i,bh(a),{labelFetcher:e.hostModel,labelDataIndex:t,defaultOpacity:l.opacity,defaultText:e.getName(t)},{normal:{align:s.textAlign,verticalAlign:s.verticalAlign}}),n.setTextConfig({local:!0,inside:!!s.inside,insideStroke:u,outsideFill:u});var c=s.linePoints;r.setShape({points:c}),n.textGuideLineConfig={anchor:c?new kt(c[0][0],c[0][1]):null},Oc(i,{style:{x:s.x,y:s.y}},o,t),i.attr({rotation:s.rotation,originX:s.x,originY:s.y,z2:10}),iw(n,ow(a),{stroke:u})},t}(lc),KE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreLabelLineUpdate=!0,n}return l(t,e),t.prototype.render=function(e,t,n){var r=e.getData(),i=this._data,o=this.group;r.diff(i).add((function(e){var t=new qE(r,e);r.setItemGraphicEl(e,t),o.add(t)})).update((function(e,t){var n=i.getItemGraphicEl(t);n.updateData(r,e),o.add(n),r.setItemGraphicEl(e,n)})).remove((function(t){Bc(i.getItemGraphicEl(t),e,t)})).execute(),this._data=r},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type="funnel",t}(em),$E=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new dM(K(this.getData,this),K(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.getInitialData=function(e,t){return hM(this,{coordDimensions:["value"],encodeDefaulter:$(_p,this)})},t.prototype._defaultLabelLine=function(e){Ho(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.prototype.getDataParams=function(t){var n=this.getData(),r=e.prototype.getDataParams.call(this,t),i=n.mapDimension("value"),o=n.getSum(i);return r.percent=o?+(n.get(i,t)/o*100).toFixed(2):0,r.$vars.push("percent"),r},t.type="series.funnel",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t}(Hg);function JE(e,t){e.eachSeriesByType("funnel",(function(e){var n=e.getData(),r=n.mapDimension("value"),i=e.get("sort"),o=function(e,t){return Zd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t),a=e.get("orient"),s=o.width,l=o.height,u=function(e,t){for(var n=e.mapDimension("value"),r=e.mapArray(n,(function(e){return e})),i=[],o="ascending"===t,a=0,s=e.count();a<s;a++)i[a]=a;return Q(t)?i.sort(t):"none"!==t&&i.sort((function(e,t){return o?r[e]-r[t]:r[t]-r[e]})),i}(n,i),c=o.x,h=o.y,d="horizontal"===a?[oo(e.get("minSize"),l),oo(e.get("maxSize"),l)]:[oo(e.get("minSize"),s),oo(e.get("maxSize"),s)],p=n.getDataExtent(r),f=e.get("min"),g=e.get("max");null==f&&(f=Math.min(p[0],0)),null==g&&(g=p[1]);var m=e.get("funnelAlign"),v=e.get("gap"),y=(("horizontal"===a?s:l)-v*(n.count()-1))/n.count(),_=function(e,t){if("horizontal"===a){var i=io(n.get(r,e)||0,[f,g],d,!0),o=void 0;switch(m){case"top":o=h;break;case"center":o=h+(l-i)/2;break;case"bottom":o=h+(l-i)}return[[t,o],[t,o+i]]}var u,p=io(n.get(r,e)||0,[f,g],d,!0);switch(m){case"left":u=c;break;case"center":u=c+(s-p)/2;break;case"right":u=c+s-p}return[[u,t],[u+p,t]]};"ascending"===i&&(y=-y,v=-v,"horizontal"===a?c+=s:h+=l,u=u.reverse());for(var x=0;x<u.length;x++){var b=u[x],w=u[x+1],S=n.getItemModel(b);if("horizontal"===a){var T=S.get(["itemStyle","width"]);null==T?T=y:(T=oo(T,s),"ascending"===i&&(T=-T));var M=_(b,c),C=_(w,c+T);c+=T+v,n.setItemLayout(b,{points:M.concat(C.slice().reverse())})}else{var D=S.get(["itemStyle","height"]);null==D?D=y:(D=oo(D,l),"ascending"===i&&(D=-D));M=_(b,h),C=_(w,h+D);h+=D+v,n.setItemLayout(b,{points:M.concat(C.slice().reverse())})}}!function(e){var t=e.hostModel.get("orient");e.each((function(n){var r,i,o,a,s=e.getItemModel(n),l=s.getModel("label").get("position"),u=s.getModel("labelLine"),c=e.getItemLayout(n),h=c.points,d="inner"===l||"inside"===l||"center"===l||"insideLeft"===l||"insideRight"===l;if(d)"insideLeft"===l?(i=(h[0][0]+h[3][0])/2+5,o=(h[0][1]+h[3][1])/2,r="left"):"insideRight"===l?(i=(h[1][0]+h[2][0])/2-5,o=(h[1][1]+h[2][1])/2,r="right"):(i=(h[0][0]+h[1][0]+h[2][0]+h[3][0])/4,o=(h[0][1]+h[1][1]+h[2][1]+h[3][1])/4,r="center"),a=[[i,o],[i,o]];else{var p=void 0,f=void 0,g=void 0,m=void 0,v=u.get("length");"production"!==process.env.NODE_ENV&&("vertical"===t&&["top","bottom"].indexOf(l)>-1&&(l="left",console.warn("Position error: Funnel chart on vertical orient dose not support top and bottom.")),"horizontal"===t&&["left","right"].indexOf(l)>-1&&(l="bottom",console.warn("Position error: Funnel chart on horizontal orient dose not support left and right."))),"left"===l?(p=(h[3][0]+h[0][0])/2,f=(h[3][1]+h[0][1])/2,i=(g=p-v)-5,r="right"):"right"===l?(p=(h[1][0]+h[2][0])/2,f=(h[1][1]+h[2][1])/2,i=(g=p+v)+5,r="left"):"top"===l?(p=(h[3][0]+h[0][0])/2,o=(m=(f=(h[3][1]+h[0][1])/2)-v)-5,r="center"):"bottom"===l?(p=(h[1][0]+h[2][0])/2,o=(m=(f=(h[1][1]+h[2][1])/2)+v)+5,r="center"):"rightTop"===l?(p="horizontal"===t?h[3][0]:h[1][0],f="horizontal"===t?h[3][1]:h[1][1],"horizontal"===t?(o=(m=f-v)-5,r="center"):(i=(g=p+v)+5,r="top")):"rightBottom"===l?(p=h[2][0],f=h[2][1],"horizontal"===t?(o=(m=f+v)+5,r="center"):(i=(g=p+v)+5,r="bottom")):"leftTop"===l?(p=h[0][0],f="horizontal"===t?h[0][1]:h[1][1],"horizontal"===t?(o=(m=f-v)-5,r="center"):(i=(g=p-v)-5,r="right")):"leftBottom"===l?(p="horizontal"===t?h[1][0]:h[3][0],f="horizontal"===t?h[1][1]:h[2][1],"horizontal"===t?(o=(m=f+v)+5,r="center"):(i=(g=p-v)-5,r="right")):(p=(h[1][0]+h[2][0])/2,f=(h[1][1]+h[2][1])/2,"horizontal"===t?(o=(m=f+v)+5,r="center"):(i=(g=p+v)+5,r="left")),"horizontal"===t?i=g=p:o=m=f,a=[[p,f],[g,m]]}c.label={linePoints:a,x:i,y:o,verticalAlign:"middle",textAlign:r,inside:d}}))}(n)}))}var QE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._dataGroup=new Yi,n._initialized=!1,n}return l(t,e),t.prototype.init=function(){this.group.add(this._dataGroup)},t.prototype.render=function(e,t,n,r){this._progressiveEls=null;var i=this._dataGroup,o=e.getData(),a=this._data,s=e.coordinateSystem,l=s.dimensions,u=nL(e);if(o.diff(a).add((function(e){var t=tL(o,i,e,l,s);rL(t,o,e,u)})).update((function(t,n){var r=a.getItemGraphicEl(n),i=eL(o,t,l,s);o.setItemGraphicEl(t,r),Oc(r,{shape:{points:i}},e,t),Fc(r),rL(r,o,t,u)})).remove((function(e){var t=a.getItemGraphicEl(e);i.remove(t)})).execute(),!this._initialized){this._initialized=!0;var c=function(e,t,n){var r=e.model,i=e.getRect(),o=new ol({shape:{x:i.x,y:i.y,width:i.width,height:i.height}}),a="horizontal"===r.get("layout")?"width":"height";return o.setShape(a,0),Rc(o,{shape:{width:i.width,height:i.height}},t,n),o}(s,e,(function(){setTimeout((function(){i.removeClipPath()}))}));i.setClipPath(c)}this._data=o},t.prototype.incrementalPrepareRender=function(e,t,n){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},t.prototype.incrementalRender=function(e,t,n){for(var r=t.getData(),i=t.coordinateSystem,o=i.dimensions,a=nL(t),s=this._progressiveEls=[],l=e.start;l<e.end;l++){var u=tL(r,this._dataGroup,l,o,i);u.incremental=!0,rL(u,r,l,a),s.push(u)}},t.prototype.remove=function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null},t.type="parallel",t}(em);function eL(e,t,n,r){for(var i,o=[],a=0;a<n.length;a++){var s=n[a],l=e.get(e.mapDimension(s),t);i=l,("category"===r.getAxis(s).type?null==i:null==i||isNaN(i))||o.push(r.dataToPoint(l,s))}return o}function tL(e,t,n,r,i){var o=eL(e,n,r,i),a=new cc({shape:{points:o},z2:10});return t.add(a),e.setItemGraphicEl(n,a),a}function nL(e){var t=e.get("smooth",!0);return!0===t&&(t=.3),ce(t=To(t))&&(t=0),{smooth:t}}function rL(e,t,n,r){e.useStyle(t.getItemVisual(n,"style")),e.style.fill=null,e.setShape("smooth",r.smooth);var i=t.getItemModel(n),o=i.getModel("emphasis");fu(e,i,"lineStyle"),cu(e,o.get("focus"),o.get("blurScope"),o.get("disabled"))}var iL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return l(t,e),t.prototype.getInitialData=function(e,t){return j_(null,this,{useEncodeDefaulter:K(oL,null,this)})},t.prototype.getRawIndicesByActiveState=function(e){var t=this.coordinateSystem,n=this.getData(),r=[];return t.eachActiveState(n,(function(t,i){e===t&&r.push(n.getRawIndex(i))})),r},t.type="series.parallel",t.dependencies=["parallel"],t.defaultOption={z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"},t}(Hg);function oL(e){var t=e.ecModel.getComponent("parallel",e.get("parallelIndex"));if(t){var n={};return W(t.dimensions,(function(e){var t=+e.replace("dim","");n[e]=t})),n}}var aL=["lineStyle","opacity"],sL={seriesType:"parallel",reset:function(e,t){var n=e.coordinateSystem,r={normal:e.get(["lineStyle","opacity"]),active:e.get("activeOpacity"),inactive:e.get("inactiveOpacity")};return{progress:function(e,t){n.eachActiveState(t,(function(e,n){var i=r[e];if("normal"===e&&t.hasItemOption){var o=t.getItemModel(n).get(aL,!0);null!=o&&(i=o)}t.ensureUniqueItemVisual(n,"style").opacity=i}),e.start,e.end)}}}};function lL(e){!function(e){if(e.parallel)return;var t=!1;W(e.series,(function(e){e&&"parallel"===e.type&&(t=!0)})),t&&(e.parallel=[{}])}(e),function(e){var t=Go(e.parallelAxis);W(t,(function(t){if(re(t)){var n=t.parallelIndex||0,r=Go(e.parallel)[n];r&&r.parallelAxisDefault&&R(t,r.parallelAxisDefault,!1)}}))}(e)}var uL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){this._model=e,this._api=n,this._handlers||(this._handlers={},W(cL,(function(e,t){n.getZr().on(t,this._handlers[t]=K(e,this))}),this)),cm(this,"_throttledDispatchExpand",e.get("axisExpandRate"),"fixRate")},t.prototype.dispose=function(e,t){hm(this,"_throttledDispatchExpand"),W(this._handlers,(function(e,n){t.getZr().off(n,e)})),this._handlers=null},t.prototype._throttledDispatchExpand=function(e){this._dispatchExpand(e)},t.prototype._dispatchExpand=function(e){e&&this._api.dispatchAction(z({type:"parallelAxisExpand"},e))},t.type="parallel",t}(Kg),cL={mousedown:function(e){hL(this,"click")&&(this._mouseDownPoint=[e.offsetX,e.offsetY])},mouseup:function(e){var t=this._mouseDownPoint;if(hL(this,"click")&&t){var n=[e.offsetX,e.offsetY];if(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2)>5)return;var r=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);"none"!==r.behavior&&this._dispatchExpand({axisExpandWindow:r.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!this._mouseDownPoint&&hL(this,"mousemove")){var t=this._model,n=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),r=n.behavior;"jump"===r&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===r?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===r?null:{duration:0}})}}};function hL(e,t){var n=e._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===t}var dL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(){e.prototype.init.apply(this,arguments),this.mergeOption({})},t.prototype.mergeOption=function(e){var t=this.option;e&&R(t,e,!0),this._initDimensions()},t.prototype.contains=function(e,t){var n=e.get("parallelIndex");return null!=n&&t.getComponent("parallel",n)===this},t.prototype.setAxisExpand=function(e){W(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(t){e.hasOwnProperty(t)&&(this.option[t]=e[t])}),this)},t.prototype._initDimensions=function(){var e=this.dimensions=[],t=this.parallelAxisIndex=[];W(Y(this.ecModel.queryComponents({mainType:"parallelAxis"}),(function(e){return(e.get("parallelIndex")||0)===this.componentIndex}),this),(function(n){e.push("dim"+n.get("dim")),t.push(n.componentIndex)}))},t.type="parallel",t.dependencies=["parallelAxis"],t.layoutMode="box",t.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},t}(tp),pL=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r)||this;return a.type=i||"value",a.axisIndex=o,a}return l(t,e),t.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},t}(Ob);function fL(e,t,n,r,i,o){e=e||0;var a=n[1]-n[0];if(null!=i&&(i=mL(i,[0,a])),null!=o&&(o=Math.max(o,null!=i?i:0)),"all"===r){var s=Math.abs(t[1]-t[0]);s=mL(s,[0,a]),i=o=mL(s,[i,o]),r=0}t[0]=mL(t[0],n),t[1]=mL(t[1],n);var l=gL(t,r);t[r]+=e;var u,c=i||0,h=n.slice();return l.sign<0?h[0]+=c:h[1]-=c,t[r]=mL(t[r],h),u=gL(t,r),null!=i&&(u.sign!==l.sign||u.span<i)&&(t[1-r]=t[r]+l.sign*i),u=gL(t,r),null!=o&&u.span>o&&(t[1-r]=t[r]+u.sign*o),t}function gL(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function mL(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}var vL=W,yL=Math.min,_L=Math.max,xL=Math.floor,bL=Math.ceil,wL=ao,SL=Math.PI,TL=function(){function e(e,t,n){this.type="parallel",this._axesMap=Te(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,n)}return e.prototype._init=function(e,t,n){var r=e.dimensions,i=e.parallelAxisIndex;vL(r,(function(e,n){var r=i[n],o=t.getComponent("parallelAxis",r),a=this._axesMap.set(e,new pL(e,Xx(o),[0,0],o.get("type"),r)),s="category"===a.type;a.onBand=s&&o.get("boundaryGap"),a.inverse=o.get("inverse"),o.axis=a,a.model=o,a.coordinateSystem=o.coordinateSystem=this}),this)},e.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},e.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),n=t.axisBase,r=t.layoutBase,i=t.pixelDimIndex,o=e[1-i],a=e[i];return o>=n&&o<=n+t.axisLength&&a>=r&&a<=r+t.layoutLength},e.prototype.getModel=function(){return this._model},e.prototype._updateAxesFromSeries=function(e,t){t.eachSeries((function(n){if(e.contains(n,t)){var r=n.getData();vL(this.dimensions,(function(e){var t=this._axesMap.get(e);t.scale.unionExtentFromData(r,r.mapDimension(e)),jx(t.scale,t.model)}),this)}}),this)},e.prototype.resize=function(e,t){this._rect=Zd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},e.prototype.getRect=function(){return this._rect},e.prototype._makeLayoutInfo=function(){var e,t=this._model,n=this._rect,r=["x","y"],i=["width","height"],o=t.get("layout"),a="horizontal"===o?0:1,s=n[i[a]],l=[0,s],u=this.dimensions.length,c=ML(t.get("axisExpandWidth"),l),h=ML(t.get("axisExpandCount")||0,[0,u]),d=t.get("axisExpandable")&&u>3&&u>h&&h>1&&c>0&&s>0,p=t.get("axisExpandWindow");p?(e=ML(p[1]-p[0],l),p[1]=p[0]+e):(e=ML(c*(h-1),l),(p=[c*(t.get("axisExpandCenter")||xL(u/2))-e/2])[1]=p[0]+e);var f=(s-e)/(u-h);f<3&&(f=0);var g=[xL(wL(p[0]/c,1))+1,bL(wL(p[1]/c,1))-1],m=f/c*p[0];return{layout:o,pixelDimIndex:a,layoutBase:n[r[a]],layoutLength:s,axisBase:n[r[1-a]],axisLength:n[i[1-a]],axisExpandable:d,axisExpandWidth:c,axisCollapseWidth:f,axisExpandWindow:p,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},e.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,n=this.dimensions,r=this._makeLayoutInfo(),i=r.layout;t.each((function(e){var t=[0,r.axisLength],n=e.inverse?1:0;e.setExtent(t[n],t[1-n])})),vL(n,(function(t,n){var o=(r.axisExpandable?DL:CL)(n,r),a={horizontal:{x:o.position,y:r.axisLength},vertical:{x:0,y:o.position}},s={horizontal:SL/2,vertical:0},l=[a[i].x+e.x,a[i].y+e.y],u=s[i],c=[1,0,0,1,0,0];Lt(c,c,u),Et(c,c,l),this._axesLayout[t]={position:l,rotation:u,transform:c,axisNameAvailableWidth:o.axisNameAvailableWidth,axisLabelShow:o.axisLabelShow,nameTruncateMaxWidth:o.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},e.prototype.getAxis=function(e){return this._axesMap.get(e)},e.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},e.prototype.eachActiveState=function(e,t,n,r){null==n&&(n=0),null==r&&(r=e.count());var i=this._axesMap,o=this.dimensions,a=[],s=[];W(o,(function(t){a.push(e.mapDimension(t)),s.push(i.get(t).model)}));for(var l=this.hasAxisBrushed(),u=n;u<r;u++){var c=void 0;if(l){c="active";for(var h=e.getValues(a,u),d=0,p=o.length;d<p;d++){if("inactive"===s[d].getActiveState(h[d])){c="inactive";break}}}else c="normal";t(c,u)}},e.prototype.hasAxisBrushed=function(){for(var e=this.dimensions,t=this._axesMap,n=!1,r=0,i=e.length;r<i;r++)"normal"!==t.get(e[r]).model.getActiveState()&&(n=!0);return n},e.prototype.axisCoordToPoint=function(e,t){return rh([e,0],this._axesLayout[t].transform)},e.prototype.getAxisLayout=function(e){return O(this._axesLayout[e])},e.prototype.getSlidedAxisExpandWindow=function(e){var t=this._makeLayoutInfo(),n=t.pixelDimIndex,r=t.axisExpandWindow.slice(),i=r[1]-r[0],o=[0,t.axisExpandWidth*(t.axisCount-1)];if(!this.containPoint(e))return{behavior:"none",axisExpandWindow:r};var a,s=e[n]-t.layoutBase-t.axisExpandWindow0Pos,l="slide",u=t.axisCollapseWidth,c=this._model.get("axisExpandSlideTriggerArea"),h=null!=c[0];if(u)h&&u&&s<i*c[0]?(l="jump",a=s-i*c[2]):h&&u&&s>i*(1-c[0])?(l="jump",a=s-i*(1-c[2])):(a=s-i*c[1])>=0&&(a=s-i*(1-c[1]))<=0&&(a=0),(a*=t.axisExpandWidth/u)?fL(a,r,o,"all"):l="none";else{var d=r[1]-r[0];(r=[_L(0,o[1]*s/d-d/2)])[1]=yL(o[1],r[0]+d),r[0]=r[1]-d}return{axisExpandWindow:r,behavior:l}},e}();function ML(e,t){return yL(_L(e,t[0]),t[1])}function CL(e,t){var n=t.layoutLength/(t.axisCount-1);return{position:n*e,axisNameAvailableWidth:n,axisLabelShow:!0}}function DL(e,t){var n,r,i=t.layoutLength,o=t.axisExpandWidth,a=t.axisCount,s=t.axisCollapseWidth,l=t.winInnerIndices,u=s,c=!1;return e<l[0]?(n=e*s,r=s):e<=l[1]?(n=t.axisExpandWindow0Pos+e*o-t.axisExpandWindow[0],u=o,c=!0):(n=i-(a-1-e)*s,r=s),{position:n,axisNameAvailableWidth:u,axisLabelShow:c,nameTruncateMaxWidth:r}}var AL={create:function(e,t){var n=[];return e.eachComponent("parallel",(function(r,i){var o=new TL(r,e,t);o.name="parallel_"+i,o.resize(r,t),r.coordinateSystem=o,o.model=r,n.push(o)})),e.eachSeries((function(e){if("parallel"===e.get("coordinateSystem")){var t=e.getReferringComponents("parallel",oa).models[0];e.coordinateSystem=t.coordinateSystem}})),n}},IL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.activeIntervals=[],n}return l(t,e),t.prototype.getAreaSelectStyle=function(){return xa([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},t.prototype.setActiveIntervals=function(e){var t=this.activeIntervals=O(e);if(t)for(var n=t.length-1;n>=0;n--)so(t[n])},t.prototype.getActiveState=function(e){var t=this.activeIntervals;if(!t.length)return"normal";if(null==e||isNaN(+e))return"inactive";if(1===t.length){var n=t[0];if(n[0]<=e&&e<=n[1])return"active"}else for(var r=0,i=t.length;r<i;r++)if(t[r][0]<=e&&e<=t[r][1])return"active";return"inactive"},t}(tp);H(IL,Qx);var EL=!0,LL=Math.min,NL=Math.max,PL=Math.pow,OL="globalPan",RL={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},kL={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},zL={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},VL=0,BL=function(e){function t(t){var n=e.call(this)||this;return n._track=[],n._covers=[],n._handlers={},"production"!==process.env.NODE_ENV&&me(t),n._zr=t,n.group=new Yi,n._uid="brushController_"+VL++,W(dN,(function(e,t){this._handlers[t]=K(e,this)}),n),n}return l(t,e),t.prototype.enableBrush=function(e){return"production"!==process.env.NODE_ENV&&me(this._mounted),this._brushType&&this._doDisableBrush(),e.brushType&&this._doEnableBrush(e),this},t.prototype._doEnableBrush=function(e){var t=this._zr;this._enableGlobalPan||function(e,t,n){LC(e)[t]=n}(t,OL,this._uid),W(this._handlers,(function(e,n){t.on(n,e)})),this._brushType=e.brushType,this._brushOption=R(O(zL),e,!0)},t.prototype._doDisableBrush=function(){var e=this._zr;!function(e,t,n){var r=LC(e);r[t]===n&&(r[t]=null)}(e,OL,this._uid),W(this._handlers,(function(t,n){e.off(n,t)})),this._brushType=this._brushOption=null},t.prototype.setPanels=function(e){if(e&&e.length){var t=this._panels={};W(e,(function(e){t[e.panelId]=O(e)}))}else this._panels=null;return this},t.prototype.mount=function(e){e=e||{},"production"!==process.env.NODE_ENV&&(this._mounted=!0),this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({x:e.x||0,y:e.y||0,rotation:e.rotation||0,scaleX:e.scaleX||1,scaleY:e.scaleY||1}),this._transform=t.getLocalTransform(),this},t.prototype.updateCovers=function(e){"production"!==process.env.NODE_ENV&&me(this._mounted),e=j(e,(function(e){return R(O(zL),e,!0)}));var t=this._covers,n=this._covers=[],r=this,i=this._creatingCover;return new h_(t,e,(function(e,t){return o(e.__brushOption,t)}),o).add(a).update(a).remove((function(e){t[e]!==i&&r.group.remove(t[e])})).execute(),this;function o(e,t){return(null!=e.id?e.id:"\0-brush-index-"+t)+"-"+e.brushType}function a(o,a){var s=e[o];if(null!=a&&t[a]===i)n[o]=t[a];else{var l=n[o]=null!=a?(t[a].__brushOption=s,t[a]):GL(r,FL(r,s));WL(r,l)}}},t.prototype.unmount=function(){if("production"===process.env.NODE_ENV||this._mounted)return this.enableBrush(!1),ZL(this),this._zr.remove(this.group),"production"!==process.env.NODE_ENV&&(this._mounted=!1),this},t.prototype.dispose=function(){this.unmount(),this.off()},t}(nt);function FL(e,t){var n=fN[t.brushType].createCover(e,t);return n.__brushOption=t,UL(n,t),e.group.add(n),n}function GL(e,t){var n=jL(t);return n.endCreating&&(n.endCreating(e,t),UL(t,t.__brushOption)),t}function HL(e,t){var n=t.__brushOption;jL(t).updateCoverShape(e,t,n.range,n)}function UL(e,t){var n=t.z;null==n&&(n=1e4),e.traverse((function(e){e.z=n,e.z2=n}))}function WL(e,t){jL(t).updateCommon(e,t),HL(e,t)}function jL(e){return fN[e.__brushOption.brushType]}function XL(e,t,n){var r,i=e._panels;if(!i)return EL;var o=e._transform;return W(i,(function(e){e.isTargetByCursor(t,n,o)&&(r=e)})),r}function YL(e,t){var n=e._panels;if(!n)return EL;var r=t.__brushOption.panelId;return null!=r?n[r]:EL}function ZL(e){var t=e._covers,n=t.length;return W(t,(function(t){e.group.remove(t)}),e),t.length=0,!!n}function qL(e,t){var n=j(e._covers,(function(e){var t=e.__brushOption,n=O(t.range);return{brushType:t.brushType,panelId:t.panelId,range:n}}));e.trigger("brush",{areas:n,isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function KL(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function $L(e,t,n,r){var i=new Yi;return i.add(new ol({name:"main",style:tN(n),silent:!0,draggable:!0,cursor:"move",drift:$(iN,e,t,i,["n","s","w","e"]),ondragend:$(qL,t,{isEnd:!0})})),W(r,(function(n){i.add(new ol({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:$(iN,e,t,i,n),ondragend:$(qL,t,{isEnd:!0})}))})),i}function JL(e,t,n,r){var i=r.brushStyle.lineWidth||0,o=NL(i,6),a=n[0][0],s=n[1][0],l=a-i/2,u=s-i/2,c=n[0][1],h=n[1][1],d=c-o+i/2,p=h-o+i/2,f=c-a,g=h-s,m=f+i,v=g+i;eN(e,t,"main",a,s,f,g),r.transformable&&(eN(e,t,"w",l,u,o,v),eN(e,t,"e",d,u,o,v),eN(e,t,"n",l,u,m,o),eN(e,t,"s",l,p,m,o),eN(e,t,"nw",l,u,o,o),eN(e,t,"ne",d,u,o,o),eN(e,t,"sw",l,p,o,o),eN(e,t,"se",d,p,o,o))}function QL(e,t){var n=t.__brushOption,r=n.transformable,i=t.childAt(0);i.useStyle(tN(n)),i.attr({silent:!r,cursor:r?"move":"default"}),W([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],(function(n){var i=t.childOfName(n.join("")),o=1===n.length?rN(e,n[0]):function(e,t){var n=[rN(e,t[0]),rN(e,t[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}(e,n);i&&i.attr({silent:!r,invisible:!r,cursor:r?kL[o]+"-resize":null})}))}function eN(e,t,n,r,i,o,a){var s=t.childOfName(n);s&&s.setShape(function(e){var t=LL(e[0][0],e[1][0]),n=LL(e[0][1],e[1][1]),r=NL(e[0][0],e[1][0]),i=NL(e[0][1],e[1][1]);return{x:t,y:n,width:r-t,height:i-n}}(sN(e,t,[[r,i],[r+o,i+a]])))}function tN(e){return V({strokeNoScale:!0},e.brushStyle)}function nN(e,t,n,r){var i=[LL(e,n),LL(t,r)],o=[NL(e,n),NL(t,r)];return[[i[0],o[0]],[i[1],o[1]]]}function rN(e,t){var n=ih({w:"left",e:"right",n:"top",s:"bottom"}[t],function(e){return nh(e.group)}(e));return{left:"w",right:"e",top:"n",bottom:"s"}[n]}function iN(e,t,n,r,i,o){var a=n.__brushOption,s=e.toRectRange(a.range),l=aN(t,i,o);W(r,(function(e){var t=RL[e];s[t[0]][t[1]]+=l[t[0]]})),a.range=e.fromRectRange(nN(s[0][0],s[1][0],s[0][1],s[1][1])),WL(t,n),qL(t,{isEnd:!1})}function oN(e,t,n,r){var i=t.__brushOption.range,o=aN(e,n,r);W(i,(function(e){e[0]+=o[0],e[1]+=o[1]})),WL(e,t),qL(e,{isEnd:!1})}function aN(e,t,n){var r=e.group,i=r.transformCoordToLocal(t,n),o=r.transformCoordToLocal(0,0);return[i[0]-o[0],i[1]-o[1]]}function sN(e,t,n){var r=YL(e,t);return r&&r!==EL?r.clipPath(n,e._transform):O(n)}function lN(e){var t=e.event;t.preventDefault&&t.preventDefault()}function uN(e,t,n){return e.childOfName("main").contain(t,n)}function cN(e,t,n,r){var i,o=e._creatingCover,a=e._creatingPanel,s=e._brushOption;if(e._track.push(n.slice()),function(e){var t=e._track;if(!t.length)return!1;var n=t[t.length-1],r=t[0],i=n[0]-r[0],o=n[1]-r[1];return PL(i*i+o*o,.5)>6}(e)||o){if(a&&!o){"single"===s.brushMode&&ZL(e);var l=O(s);l.brushType=hN(l.brushType,a),l.panelId=a===EL?null:a.panelId,o=e._creatingCover=FL(e,l),e._covers.push(o)}if(o){var u=fN[hN(e._brushType,a)];o.__brushOption.range=u.getCreatingRange(sN(e,o,e._track)),r&&(GL(e,o),u.updateCommon(e,o)),HL(e,o),i={isEnd:r}}}else r&&"single"===s.brushMode&&s.removeOnClick&&XL(e,t,n)&&ZL(e)&&(i={isEnd:r,removeOnClick:!0});return i}function hN(e,t){return"auto"===e?("production"!==process.env.NODE_ENV&&me(t&&t.defaultBrushType,'MUST have defaultBrushType when brushType is "atuo"'),t.defaultBrushType):e}var dN={mousedown:function(e){if(this._dragging)pN(this,e);else if(!e.target||!e.target.draggable){lN(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=XL(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,n=e.offsetY,r=this.group.transformCoordToLocal(t,n);if(function(e,t,n){if(e._brushType&&!function(e,t,n){var r=e._zr;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}(e,t.offsetX,t.offsetY)){var r=e._zr,i=e._covers,o=XL(e,t,n);if(!e._dragging)for(var a=0;a<i.length;a++){var s=i[a].__brushOption;if(o&&(o===EL||s.panelId===o.panelId)&&fN[s.brushType].contain(i[a],n[0],n[1]))return}o&&r.setCursorStyle("crosshair")}}(this,e,r),this._dragging){lN(e);var i=cN(this,e,r,!1);i&&qL(this,i)}},mouseup:function(e){pN(this,e)}};function pN(e,t){if(e._dragging){lN(t);var n=t.offsetX,r=t.offsetY,i=e.group.transformCoordToLocal(n,r),o=cN(e,t,i,!0);e._dragging=!1,e._track=[],e._creatingCover=null,o&&qL(e,o)}}var fN={lineX:gN(0),lineY:gN(1),rect:{createCover:function(e,t){function n(e){return e}return $L({toRectRange:n,fromRectRange:n},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=KL(e);return nN(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,r){JL(e,t,n,r)},updateCommon:QL,contain:uN},polygon:{createCover:function(e,t){var n=new Yi;return n.add(new cc({name:"main",style:tN(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new lc({name:"main",draggable:!0,drift:$(oN,e,t),ondragend:$(qL,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,r){t.childAt(0).setShape({points:sN(e,t,n)})},updateCommon:QL,contain:uN}};function gN(e){return{createCover:function(t,n){return $L({toRectRange:function(t){var n=[t,[0,100]];return e&&n.reverse(),n},fromRectRange:function(t){return t[e]}},t,n,[[["w"],["e"]],[["n"],["s"]]][e])},getCreatingRange:function(t){var n=KL(t);return[LL(n[0][e],n[1][e]),NL(n[0][e],n[1][e])]},updateCoverShape:function(t,n,r,i){var o,a=YL(t,n);if(a!==EL&&a.getLinearBrushOtherExtent)o=a.getLinearBrushOtherExtent(e);else{var s=t._zr;o=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[r,o];e&&l.reverse(),JL(t,n,l,i)},updateCommon:QL,contain:uN}}function mN(e){return e=_N(e),function(t){return sh(t,e)}}function vN(e,t){return e=_N(e),function(n){var r=null!=t?t:n,i=r?e.width:e.height,o=r?e.x:e.y;return[o,o+(i||0)]}}function yN(e,t,n){var r=_N(e);return function(e,i){return r.contain(i[0],i[1])&&!FC(e,t,n)}}function _N(e){return jt.create(e)}var xN=["axisLine","axisTickLabel","axisName"],bN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(t,n){e.prototype.init.apply(this,arguments),(this._brushController=new BL(n.getZr())).on("brush",K(this._onBrush,this))},t.prototype.render=function(e,t,n,r){if(!function(e,t,n){return n&&"axisAreaSelect"===n.type&&t.findComponents({mainType:"parallelAxis",query:n})[0]===e}(e,t,r)){this.axisModel=e,this.api=n,this.group.removeAll();var i=this._axisGroup;if(this._axisGroup=new Yi,this.group.add(this._axisGroup),e.get("show")){var o=function(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}(e,t),a=o.coordinateSystem,s=e.getAreaSelectStyle(),l=s.width,u=e.axis.dim,c=z({strokeContainThreshold:l},a.getAxisLayout(u)),h=new WM(e,c);W(xN,h.add,h),this._axisGroup.add(h.getGroup()),this._refreshBrushController(c,s,e,o,l,n),ah(i,this._axisGroup,e)}}},t.prototype._refreshBrushController=function(e,t,n,r,i,o){var a=n.axis.getExtent(),s=a[1]-a[0],l=Math.min(30,.1*Math.abs(s)),u=jt.create({x:a[0],y:-i/2,width:s,height:i});u.x-=l,u.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:e.rotation,x:e.position[0],y:e.position[1]}).setPanels([{panelId:"pl",clipPath:mN(u),isTargetByCursor:yN(u,o,r),getLinearBrushOtherExtent:vN(u,0)}]).enableBrush({brushType:"lineX",brushStyle:t,removeOnClick:!0}).updateCovers(function(e){var t=e.axis;return j(e.activeIntervals,(function(e){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(e[0],!0),t.dataToCoord(e[1],!0)]}}))}(n))},t.prototype._onBrush=function(e){var t=e.areas,n=this.axisModel,r=n.axis,i=j(t,(function(e){return[r.coordToData(e.range[0],!0),r.coordToData(e.range[1],!0)]}));(!n.option.realtime===e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:n.id,intervals:i})},t.prototype.dispose=function(){this._brushController.dispose()},t.type="parallelAxis",t}(Kg);var wN={type:"axisAreaSelect",event:"axisAreaSelected"};var SN={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function TN(e){e.registerComponentView(uL),e.registerComponentModel(dL),e.registerCoordinateSystem("parallel",AL),e.registerPreprocessor(lL),e.registerComponentModel(IL),e.registerComponentView(bN),DM(e,"parallel",IL,SN),function(e){e.registerAction(wN,(function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},(function(t){t.axis.model.setActiveIntervals(e.intervals)}))})),e.registerAction("parallelAxisExpand",(function(e,t){t.eachComponent({mainType:"parallel",query:e},(function(t){t.setAxisExpand(e)}))}))}(e)}var MN=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0},CN=function(e){function t(t){return e.call(this,t)||this}return l(t,e),t.prototype.getDefaultShape=function(){return new MN},t.prototype.buildPath=function(e,t){var n=t.extent;e.moveTo(t.x1,t.y1),e.bezierCurveTo(t.cpx1,t.cpy1,t.cpx2,t.cpy2,t.x2,t.y2),"vertical"===t.orient?(e.lineTo(t.x2+n,t.y2),e.bezierCurveTo(t.cpx2+n,t.cpy2,t.cpx1+n,t.cpy1,t.x1+n,t.y1)):(e.lineTo(t.x2,t.y2+n),e.bezierCurveTo(t.cpx2,t.cpy2+n,t.cpx1,t.cpy1+n,t.x1,t.y1+n)),e.closePath()},t.prototype.highlight=function(){Kl(this)},t.prototype.downplay=function(){$l(this)},t}(Ys),DN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._focusAdjacencyDisabled=!1,n}return l(t,e),t.prototype.render=function(e,t,n){var r=this,i=e.getGraph(),o=this.group,a=e.layoutInfo,s=a.width,l=a.height,u=e.getData(),c=e.getData("edge"),h=e.get("orient");this._model=e,o.removeAll(),o.x=a.x,o.y=a.y,i.eachEdge((function(t){var n=new CN,r=bl(n);r.dataIndex=t.dataIndex,r.seriesIndex=e.seriesIndex,r.dataType="edge";var i,a,u,d,p,f,g,m,v=t.getModel(),y=v.getModel("lineStyle"),_=y.get("curveness"),x=t.node1.getLayout(),b=t.node1.getModel(),w=b.get("localX"),S=b.get("localY"),T=t.node2.getLayout(),M=t.node2.getModel(),C=M.get("localX"),D=M.get("localY"),A=t.getLayout();n.shape.extent=Math.max(1,A.dy),n.shape.orient=h,"vertical"===h?(i=(null!=w?w*s:x.x)+A.sy,a=(null!=S?S*l:x.y)+x.dy,u=(null!=C?C*s:T.x)+A.ty,p=i,f=a*(1-_)+(d=null!=D?D*l:T.y)*_,g=u,m=a*_+d*(1-_)):(i=(null!=w?w*s:x.x)+x.dx,a=(null!=S?S*l:x.y)+A.sy,p=i*(1-_)+(u=null!=C?C*s:T.x)*_,f=a,g=i*_+u*(1-_),m=d=(null!=D?D*l:T.y)+A.ty),n.setShape({x1:i,y1:a,x2:u,y2:d,cpx1:p,cpy1:f,cpx2:g,cpy2:m}),n.useStyle(y.getItemStyle()),AN(n.style,h,t);var I=""+v.get("value"),E=bh(v,"edgeLabel");xh(n,E,{labelFetcher:{getFormattedLabel:function(t,n,r,i,o,a){return e.getFormattedLabel(t,n,"edge",i,pe(o,E.normal&&E.normal.get("formatter"),I),a)}},labelDataIndex:t.dataIndex,defaultText:I}),n.setTextConfig({position:"inside"});var L=v.getModel("emphasis");fu(n,v,"lineStyle",(function(e){var n=e.getItemStyle();return AN(n,h,t),n})),o.add(n),c.setItemGraphicEl(t.dataIndex,n);var N=L.get("focus");cu(n,"adjacency"===N?t.getAdjacentDataIndices():"trajectory"===N?t.getTrajectoryDataIndices():N,L.get("blurScope"),L.get("disabled"))})),i.eachNode((function(t){var n=t.getLayout(),r=t.getModel(),i=r.get("localX"),a=r.get("localY"),c=r.getModel("emphasis"),h=r.get(["itemStyle","borderRadius"])||0,d=new ol({shape:{x:null!=i?i*s:n.x,y:null!=a?a*l:n.y,width:n.dx,height:n.dy,r:h},style:r.getModel("itemStyle").getItemStyle(),z2:10});xh(d,bh(r),{labelFetcher:{getFormattedLabel:function(t,n){return e.getFormattedLabel(t,n,"node")}},labelDataIndex:t.dataIndex,defaultText:t.id}),d.disableLabelAnimation=!0,d.setStyle("fill",t.getVisual("color")),d.setStyle("decal",t.getVisual("style").decal),fu(d,r),o.add(d),u.setItemGraphicEl(t.dataIndex,d),bl(d).dataType="node";var p=c.get("focus");cu(d,"adjacency"===p?t.getAdjacentDataIndices():"trajectory"===p?t.getTrajectoryDataIndices():p,c.get("blurScope"),c.get("disabled"))})),u.eachItemGraphicEl((function(t,i){u.getItemModel(i).get("draggable")&&(t.drift=function(t,o){r._focusAdjacencyDisabled=!0,this.shape.x+=t,this.shape.y+=o,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:e.id,dataIndex:u.getRawIndex(i),localX:this.shape.x/s,localY:this.shape.y/l})},t.ondragend=function(){r._focusAdjacencyDisabled=!1},t.draggable=!0,t.cursor="move")})),!this._data&&e.isAnimationEnabled()&&o.setClipPath(function(e,t,n){var r=new ol({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Rc(r,{shape:{width:e.width+20}},t,n),r}(o.getBoundingRect(),e,(function(){o.removeClipPath()}))),this._data=e.getData()},t.prototype.dispose=function(){},t.type="sankey",t}(em);function AN(e,t,n){switch(e.fill){case"source":e.fill=n.node1.getVisual("color"),e.decal=n.node1.getVisual("style").decal;break;case"target":e.fill=n.node2.getVisual("color"),e.decal=n.node2.getVisual("style").decal;break;case"gradient":var r=n.node1.getVisual("color"),i=n.node2.getVisual("color");ee(r)&&ee(i)&&(e.fill=new wc(0,0,+("horizontal"===t),+("vertical"===t),[{color:r,offset:0},{color:i,offset:1}]))}}var IN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.getInitialData=function(e,t){var n=e.edges||e.links,r=e.data||e.nodes,i=e.levels;this.levelModels=[];for(var o=this.levelModels,a=0;a<i.length;a++)if(null!=i[a].depth&&i[a].depth>=0)o[i[a].depth]=new Wh(i[a],this,t);else if("production"!==process.env.NODE_ENV)throw new Error("levels[i].depth is mandatory and should be natural number");if(r&&n){var s=FE(r,n,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e,t){var n=e.parentModel,r=n.getData().getItemLayout(t);if(r){var i=r.depth,o=n.levelModels[i];o&&(e.parentModel=o)}return e})),t.wrapMethod("getItemModel",(function(e,t){var n=e.parentModel,r=n.getGraph().getEdgeByIndex(t).node1.getLayout();if(r){var i=r.depth,o=n.levelModels[i];o&&(e.parentModel=o)}return e}))}));return s.data}},t.prototype.setNodePosition=function(e,t){var n=(this.option.data||this.option.nodes)[e];n.localX=t[0],n.localY=t[1]},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(e,t,n){function r(e){return isNaN(e)||null==e}if("edge"===n){var i=this.getDataParams(e,n),o=i.data,a=i.value;return Cg("nameValue",{name:o.source+" -- "+o.target,value:a,noValue:r(a)})}var s=this.getGraph().getNodeByIndex(e).getLayout().value,l=this.getDataParams(e,n).data.name;return Cg("nameValue",{name:null!=l?l+"":null,value:s,noValue:r(s)})},t.prototype.optionUpdated=function(){},t.prototype.getDataParams=function(t,n){var r=e.prototype.getDataParams.call(this,t,n);if(null==r.value&&"node"===n){var i=this.getGraph().getNodeByIndex(t).getLayout().value;r.value=i}return r},t.type="series.sankey",t.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},t}(Hg);function EN(e,t){e.eachSeriesByType("sankey",(function(e){var n=e.get("nodeWidth"),r=e.get("nodeGap"),i=function(e,t){return Zd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t);e.layoutInfo=i;var o=i.width,a=i.height,s=e.getGraph(),l=s.nodes,u=s.edges;!function(e){W(e,(function(e){var t=FN(e.outEdges,BN),n=FN(e.inEdges,BN),r=e.getValue()||0,i=Math.max(t,n,r);e.setLayout({value:i},!0)}))}(l);var c=Y(l,(function(e){return 0===e.getLayout().value}));!function(e,t,n,r,i,o,a,s,l){(function(e,t,n,r,i,o,a){for(var s=[],l=[],u=[],c=[],h=0,d=0;d<t.length;d++)s[d]=1;for(d=0;d<e.length;d++)l[d]=e[d].inEdges.length,0===l[d]&&u.push(e[d]);var p=-1;for(;u.length;){for(var f=0;f<u.length;f++){var g=u[f],m=g.hostGraph.data.getRawDataItem(g.dataIndex),v=null!=m.depth&&m.depth>=0;v&&m.depth>p&&(p=m.depth),g.setLayout({depth:v?m.depth:h},!0),"vertical"===o?g.setLayout({dy:n},!0):g.setLayout({dx:n},!0);for(var y=0;y<g.outEdges.length;y++){var _=g.outEdges[y];s[t.indexOf(_)]=0;var x=_.node2;0==--l[e.indexOf(x)]&&c.indexOf(x)<0&&c.push(x)}}++h,u=c,c=[]}for(d=0;d<s.length;d++)if(1===s[d])throw new Error("Sankey is a DAG, the original data has cycle!");var b=p>h-1?p:h-1;a&&"left"!==a&&function(e,t,n,r){if("right"===t){for(var i=[],o=e,a=0;o.length;){for(var s=0;s<o.length;s++){var l=o[s];l.setLayout({skNodeHeight:a},!0);for(var u=0;u<l.inEdges.length;u++){var c=l.inEdges[u];i.indexOf(c.node1)<0&&i.push(c.node1)}}o=i,i=[],++a}W(e,(function(e){LN(e)||e.setLayout({depth:Math.max(0,r-e.getLayout().skNodeHeight)},!0)}))}else"justify"===t&&function(e,t){W(e,(function(e){LN(e)||e.outEdges.length||e.setLayout({depth:t},!0)}))}(e,r)}(e,a,0,b);var w="vertical"===o?(i-n)/b:(r-n)/b;!function(e,t,n){W(e,(function(e){var r=e.getLayout().depth*t;"vertical"===n?e.setLayout({y:r},!0):e.setLayout({x:r},!0)}))}(e,w,o)})(e,t,n,i,o,s,l),function(e,t,n,r,i,o,a){var s=function(e,t){var n=[],r="vertical"===t?"y":"x",i=ua(e,(function(e){return e.getLayout()[r]}));return i.keys.sort((function(e,t){return e-t})),W(i.keys,(function(e){n.push(i.buckets.get(e))})),n}(e,a);(function(e,t,n,r,i,o){var a=1/0;W(e,(function(e){var t=e.length,s=0;W(e,(function(e){s+=e.getLayout().value}));var l="vertical"===o?(r-(t-1)*i)/s:(n-(t-1)*i)/s;l<a&&(a=l)})),W(e,(function(e){W(e,(function(e,t){var n=e.getLayout().value*a;"vertical"===o?(e.setLayout({x:t},!0),e.setLayout({dx:n},!0)):(e.setLayout({y:t},!0),e.setLayout({dy:n},!0))}))})),W(t,(function(e){var t=+e.getValue()*a;e.setLayout({dy:t},!0)}))})(s,t,n,r,i,a),NN(s,i,n,r,a);for(var l=1;o>0;o--)PN(s,l*=.99,a),NN(s,i,n,r,a),GN(s,l,a),NN(s,i,n,r,a)}(e,t,o,i,r,a,s),function(e,t){var n="vertical"===t?"x":"y";W(e,(function(e){e.outEdges.sort((function(e,t){return e.node2.getLayout()[n]-t.node2.getLayout()[n]})),e.inEdges.sort((function(e,t){return e.node1.getLayout()[n]-t.node1.getLayout()[n]}))})),W(e,(function(e){var t=0,n=0;W(e.outEdges,(function(e){e.setLayout({sy:t},!0),t+=e.getLayout().dy})),W(e.inEdges,(function(e){e.setLayout({ty:n},!0),n+=e.getLayout().dy}))}))}(e,s)}(l,u,n,r,o,a,0!==c.length?0:e.get("layoutIterations"),e.get("orient"),e.get("nodeAlign"))}))}function LN(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return null!=t.depth&&t.depth>=0}function NN(e,t,n,r,i){var o="vertical"===i?"x":"y";W(e,(function(e){var a,s,l;e.sort((function(e,t){return e.getLayout()[o]-t.getLayout()[o]}));for(var u=0,c=e.length,h="vertical"===i?"dx":"dy",d=0;d<c;d++)(l=u-(s=e[d]).getLayout()[o])>0&&(a=s.getLayout()[o]+l,"vertical"===i?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[o]+s.getLayout()[h]+t;if((l=u-t-("vertical"===i?r:n))>0){a=s.getLayout()[o]-l,"vertical"===i?s.setLayout({x:a},!0):s.setLayout({y:a},!0),u=a;for(d=c-2;d>=0;--d)(l=(s=e[d]).getLayout()[o]+s.getLayout()[h]+t-u)>0&&(a=s.getLayout()[o]-l,"vertical"===i?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[o]}}))}function PN(e,t,n){W(e.slice().reverse(),(function(e){W(e,(function(e){if(e.outEdges.length){var r=FN(e.outEdges,ON,n)/FN(e.outEdges,BN);if(isNaN(r)){var i=e.outEdges.length;r=i?FN(e.outEdges,RN,n)/i:0}if("vertical"===n){var o=e.getLayout().x+(r-VN(e,n))*t;e.setLayout({x:o},!0)}else{var a=e.getLayout().y+(r-VN(e,n))*t;e.setLayout({y:a},!0)}}}))}))}function ON(e,t){return VN(e.node2,t)*e.getValue()}function RN(e,t){return VN(e.node2,t)}function kN(e,t){return VN(e.node1,t)*e.getValue()}function zN(e,t){return VN(e.node1,t)}function VN(e,t){return"vertical"===t?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function BN(e){return e.getValue()}function FN(e,t,n){for(var r=0,i=e.length,o=-1;++o<i;){var a=+t(e[o],n);isNaN(a)||(r+=a)}return r}function GN(e,t,n){W(e,(function(e){W(e,(function(e){if(e.inEdges.length){var r=FN(e.inEdges,kN,n)/FN(e.inEdges,BN);if(isNaN(r)){var i=e.inEdges.length;r=i?FN(e.inEdges,zN,n)/i:0}if("vertical"===n){var o=e.getLayout().x+(r-VN(e,n))*t;e.setLayout({x:o},!0)}else{var a=e.getLayout().y+(r-VN(e,n))*t;e.setLayout({y:a},!0)}}}))}))}function HN(e){e.eachSeriesByType("sankey",(function(e){var t=e.getGraph(),n=t.nodes,r=t.edges;if(n.length){var i=1/0,o=-1/0;W(n,(function(e){var t=e.getLayout().value;t<i&&(i=t),t>o&&(o=t)})),W(n,(function(t){var n=new sI({type:"color",mappingMethod:"linear",dataExtent:[i,o],visual:e.get("color")}).mapValueToVisual(t.getLayout().value),r=t.getModel().get(["itemStyle","color"]);null!=r?(t.setVisual("color",r),t.setVisual("style",{fill:r})):(t.setVisual("color",n),t.setVisual("style",{fill:n}))}))}r.length&&W(r,(function(e){var t=e.getModel().get("lineStyle");e.setVisual("style",t)}))}))}var UN=function(){function e(){}return e.prototype.getInitialData=function(e,t){var n,r,i=t.getComponent("xAxis",this.get("xAxisIndex")),o=t.getComponent("yAxis",this.get("yAxisIndex")),a=i.get("type"),s=o.get("type");"category"===a?(e.layout="horizontal",n=i.getOrdinalMeta(),r=!0):"category"===s?(e.layout="vertical",n=o.getOrdinalMeta(),r=!0):e.layout=e.layout||"horizontal";var l=["x","y"],u="horizontal"===e.layout?0:1,c=this._baseAxisDim=l[u],h=l[1-u],d=[i,o],p=d[u].get("type"),f=d[1-u].get("type"),g=e.data;if(g&&r){var m=[];W(g,(function(e,t){var n;J(e)?(n=e.slice(),e.unshift(t)):J(e.value)?((n=z({},e)).value=n.value.slice(),e.value.unshift(t)):n=e,m.push(n)})),e.data=m}var v=this.defaultValueDimensions,y=[{name:c,type:f_(p),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:f_(f),dimsDef:v.slice()}];return hM(this,{coordDimensions:y,dimensionsCount:v.length+1,encodeDefaulter:$(yp,y,this)})},e.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},e}(),WN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],n.visualDrawType="stroke",n}return l(t,e),t.type="series.boxplot",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},t}(Hg);H(WN,UN,!0);var jN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){var r=e.getData(),i=this.group,o=this._data;this._data||i.removeAll();var a="horizontal"===e.get("layout")?1:0;r.diff(o).add((function(e){if(r.hasValue(e)){var t=ZN(r.getItemLayout(e),r,e,a,!0);r.setItemGraphicEl(e,t),i.add(t)}})).update((function(e,t){var n=o.getItemGraphicEl(t);if(r.hasValue(e)){var s=r.getItemLayout(e);n?(Fc(n),qN(s,n,r,e)):n=ZN(s,r,e,a),i.add(n),r.setItemGraphicEl(e,n)}else i.remove(n)})).remove((function(e){var t=o.getItemGraphicEl(e);t&&i.remove(t)})).execute(),this._data=r},t.prototype.remove=function(e){var t=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl((function(e){e&&t.remove(e)}))},t.type="boxplot",t}(em),XN=function(){},YN=function(e){function t(t){var n=e.call(this,t)||this;return n.type="boxplotBoxPath",n}return l(t,e),t.prototype.getDefaultShape=function(){return new XN},t.prototype.buildPath=function(e,t){var n=t.points,r=0;for(e.moveTo(n[r][0],n[r][1]),r++;r<4;r++)e.lineTo(n[r][0],n[r][1]);for(e.closePath();r<n.length;r++)e.moveTo(n[r][0],n[r][1]),r++,e.lineTo(n[r][0],n[r][1])},t}(Ys);function ZN(e,t,n,r,i){var o=e.ends,a=new YN({shape:{points:i?KN(o,r,e):o}});return qN(e,a,t,n,i),a}function qN(e,t,n,r,i){var o=n.hostModel;(0,mh[i?"initProps":"updateProps"])(t,{shape:{points:e.ends}},o,r),t.useStyle(n.getItemVisual(r,"style")),t.style.strokeNoScale=!0,t.z2=100;var a=n.getItemModel(r),s=a.getModel("emphasis");fu(t,a),cu(t,s.get("focus"),s.get("blurScope"),s.get("disabled"))}function KN(e,t,n){return j(e,(function(e){return(e=e.slice())[t]=n.initBaseline,e}))}var $N=W;function JN(e){var t=function(e){var t=[],n=[];return e.eachSeriesByType("boxplot",(function(e){var r=e.getBaseAxis(),i=F(n,r);i<0&&(i=n.length,n[i]=r,t[i]={axis:r,seriesModels:[]}),t[i].seriesModels.push(e)})),t}(e);$N(t,(function(e){var t=e.seriesModels;t.length&&(!function(e){var t,n=e.axis,r=e.seriesModels,i=r.length,o=e.boxWidthList=[],a=e.boxOffsetList=[],s=[];if("category"===n.type)t=n.getBandWidth();else{var l=0;$N(r,(function(e){l=Math.max(l,e.getData().count())}));var u=n.getExtent();t=Math.abs(u[1]-u[0])/l}$N(r,(function(e){var n=e.get("boxWidth");J(n)||(n=[n,n]),s.push([oo(n[0],t)||0,oo(n[1],t)||0])}));var c=.8*t-2,h=c/i*.3,d=(c-h*(i-1))/i,p=d/2-c/2;$N(r,(function(e,t){a.push(p),p+=h+d,o.push(Math.min(Math.max(d,s[t][0]),s[t][1]))}))}(e),$N(t,(function(t,n){!function(e,t,n){var r=e.coordinateSystem,i=e.getData(),o=n/2,a="horizontal"===e.get("layout")?0:1,s=1-a,l=["x","y"],u=i.mapDimension(l[a]),c=i.mapDimensionsAll(l[s]);if(null==u||c.length<5)return;for(var h=0;h<i.count();h++){var d=i.get(u,h),p=_(d,c[2],h),f=_(d,c[0],h),g=_(d,c[1],h),m=_(d,c[3],h),v=_(d,c[4],h),y=[];x(y,g,!1),x(y,m,!0),y.push(f,g,v,m),b(y,f),b(y,v),b(y,p),i.setItemLayout(h,{initBaseline:p[s],ends:y})}function _(e,n,o){var l,u=i.get(n,o),c=[];return c[a]=e,c[s]=u,isNaN(e)||isNaN(u)?l=[NaN,NaN]:(l=r.dataToPoint(c))[a]+=t,l}function x(e,t,n){var r=t.slice(),i=t.slice();r[a]+=o,i[a]-=o,n?e.push(r,i):e.push(i,r)}function b(e,t){var n=t.slice(),r=t.slice();n[a]-=o,r[a]+=o,e.push(n,r)}}(t,e.boxOffsetList[n],e.boxWidthList[n])})))}))}var QN={type:"echarts:boxplot",transform:function(e){var t=e.upstream;if(t.sourceFormat!==sp){var n="";"production"!==process.env.NODE_ENV&&(n=ko("source data is not applicable for this boxplot transform. Expect number[][].")),zo(n)}var r=function(e,t){for(var n=[],r=[],i=(t=t||{}).boundIQR,o="none"===i||0===i,a=0;a<e.length;a++){var s=so(e[a].slice()),l=wo(s,.25),u=wo(s,.5),c=wo(s,.75),h=s[0],d=s[s.length-1],p=(null==i?1.5:i)*(c-l),f=o?h:Math.max(h,l-p),g=o?d:Math.min(d,c+p),m=t.itemNameFormatter,v=Q(m)?m({value:a}):ee(m)?m.replace("{value}",a+""):a+"";n.push([v,f,l,u,c,g]);for(var y=0;y<s.length;y++){var _=s[y];if(_<f||_>g){var x=[v,_];r.push(x)}}}return{boxData:n,outliers:r}}(t.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:r.boxData},{data:r.outliers}]}};var eP=["color","borderColor"],tP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(e),this._isLargeDraw?this._renderLarge(e):this._renderNormal(e)},t.prototype.incrementalPrepareRender=function(e,t,n){this._clear(),this._updateDrawMode(e)},t.prototype.incrementalRender=function(e,t,n,r){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(e,t):this._incrementalRenderNormal(e,t)},t.prototype.eachRendered=function(e){gh(this._progressiveEls||this.group,e)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;null!=this._isLargeDraw&&t===this._isLargeDraw||(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e){var t=e.getData(),n=this._data,r=this.group,i=t.getLayout("isSimpleBox"),o=e.get("clip",!0),a=e.coordinateSystem,s=a.getArea&&a.getArea();this._data||r.removeAll(),t.diff(n).add((function(n){if(t.hasValue(n)){var a=t.getItemLayout(n);if(o&&oP(s,a))return;var l=iP(a,n,!0);Rc(l,{shape:{points:a.ends}},e,n),aP(l,t,n,i),r.add(l),t.setItemGraphicEl(n,l)}})).update((function(a,l){var u=n.getItemGraphicEl(l);if(t.hasValue(a)){var c=t.getItemLayout(a);o&&oP(s,c)?r.remove(u):(u?(Oc(u,{shape:{points:c.ends}},e,a),Fc(u)):u=iP(c),aP(u,t,a,i),r.add(u),t.setItemGraphicEl(a,u))}else r.remove(u)})).remove((function(e){var t=n.getItemGraphicEl(e);t&&r.remove(t)})).execute(),this._data=t},t.prototype._renderLarge=function(e){this._clear(),cP(e,this.group);var t=e.get("clip",!0)?lT(e.coordinateSystem,!1,e):null;t?this.group.setClipPath(t):this.group.removeClipPath()},t.prototype._incrementalRenderNormal=function(e,t){for(var n,r=t.getData(),i=r.getLayout("isSimpleBox");null!=(n=e.next());){var o=iP(r.getItemLayout(n));aP(o,r,n,i),o.incremental=!0,this.group.add(o),this._progressiveEls.push(o)}},t.prototype._incrementalRenderLarge=function(e,t){cP(t,this.group,this._progressiveEls,!0)},t.prototype.remove=function(e){this._clear()},t.prototype._clear=function(){this.group.removeAll(),this._data=null},t.type="candlestick",t}(em),nP=function(){},rP=function(e){function t(t){var n=e.call(this,t)||this;return n.type="normalCandlestickBox",n}return l(t,e),t.prototype.getDefaultShape=function(){return new nP},t.prototype.buildPath=function(e,t){var n=t.points;this.__simpleBox?(e.moveTo(n[4][0],n[4][1]),e.lineTo(n[6][0],n[6][1])):(e.moveTo(n[0][0],n[0][1]),e.lineTo(n[1][0],n[1][1]),e.lineTo(n[2][0],n[2][1]),e.lineTo(n[3][0],n[3][1]),e.closePath(),e.moveTo(n[4][0],n[4][1]),e.lineTo(n[5][0],n[5][1]),e.moveTo(n[6][0],n[6][1]),e.lineTo(n[7][0],n[7][1]))},t}(Ys);function iP(e,t,n){var r=e.ends;return new rP({shape:{points:n?sP(r,e):r},z2:100})}function oP(e,t){for(var n=!0,r=0;r<t.ends.length;r++)if(e.contain(t.ends[r][0],t.ends[r][1])){n=!1;break}return n}function aP(e,t,n,r){var i=t.getItemModel(n);e.useStyle(t.getItemVisual(n,"style")),e.style.strokeNoScale=!0,e.__simpleBox=r,fu(e,i)}function sP(e,t){return j(e,(function(e){return(e=e.slice())[1]=t.initBaseline,e}))}var lP=function(){},uP=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeCandlestickBox",n}return l(t,e),t.prototype.getDefaultShape=function(){return new lP},t.prototype.buildPath=function(e,t){for(var n=t.points,r=0;r<n.length;)if(this.__sign===n[r++]){var i=n[r++];e.moveTo(i,n[r++]),e.lineTo(i,n[r++])}else r+=3},t}(Ys);function cP(e,t,n,r){var i=e.getData().getLayout("largePoints"),o=new uP({shape:{points:i},__sign:1,ignoreCoarsePointer:!0});t.add(o);var a=new uP({shape:{points:i},__sign:-1,ignoreCoarsePointer:!0});t.add(a);var s=new uP({shape:{points:i},__sign:0,ignoreCoarsePointer:!0});t.add(s),hP(1,o,e),hP(-1,a,e),hP(0,s,e),r&&(o.incremental=!0,a.incremental=!0),n&&n.push(o,a)}function hP(e,t,n,r){var i=n.get(["itemStyle",e>0?"borderColor":"borderColor0"])||n.get(["itemStyle",e>0?"color":"color0"]);0===e&&(i=n.get(["itemStyle","borderColorDoji"]));var o=n.getModel("itemStyle").getItemStyle(eP);t.useStyle(o),t.style.fill=null,t.style.stroke=i}var dP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],n}return l(t,e),t.prototype.getShadowDim=function(){return"open"},t.prototype.brushSelector=function(e,t,n){var r=t.getItemLayout(e);return r&&n.rect(r.brushRect)},t.type="series.candlestick",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},t}(Hg);function pP(e){e&&J(e.series)&&W(e.series,(function(e){re(e)&&"k"===e.type&&(e.type="candlestick")}))}H(dP,UN,!0);var fP=["itemStyle","borderColor"],gP=["itemStyle","borderColor0"],mP=["itemStyle","borderColorDoji"],vP=["itemStyle","color"],yP=["itemStyle","color0"],_P={seriesType:"candlestick",plan:$g(),performRawSeries:!0,reset:function(e,t){function n(e,t){return t.get(e>0?vP:yP)}function r(e,t){return t.get(0===e?mP:e>0?fP:gP)}if(!t.isSeriesFiltered(e))return!e.pipelineContext.large&&{progress:function(e,t){for(var i;null!=(i=e.next());){var o=t.getItemModel(i),a=t.getItemLayout(i).sign,s=o.getItemStyle();s.fill=n(a,o),s.stroke=r(a,o)||s.fill,z(t.ensureUniqueItemVisual(i,"style"),s)}}}}},xP={seriesType:"candlestick",plan:$g(),reset:function(e){var t=e.coordinateSystem,n=e.getData(),r=function(e,t){var n,r=e.getBaseAxis(),i="category"===r.type?r.getBandWidth():(n=r.getExtent(),Math.abs(n[1]-n[0])/t.count()),o=oo(de(e.get("barMaxWidth"),i),i),a=oo(de(e.get("barMinWidth"),1),i),s=e.get("barWidth");return null!=s?oo(s,i):Math.max(Math.min(i/2,o),a)}(e,n),i=["x","y"],o=n.getDimensionIndex(n.mapDimension(i[0])),a=j(n.mapDimensionsAll(i[1]),n.getDimensionIndex,n),s=a[0],l=a[1],u=a[2],c=a[3];if(n.setLayout({candleWidth:r,isSimpleBox:r<=1.3}),!(o<0||a.length<4))return{progress:e.pipelineContext.large?function(n,r){var i,a,h=ux(4*n.count),d=0,p=[],f=[],g=r.getStore(),m=!!e.get(["itemStyle","borderColorDoji"]);for(;null!=(a=n.next());){var v=g.get(o,a),y=g.get(s,a),_=g.get(l,a),x=g.get(u,a),b=g.get(c,a);isNaN(v)||isNaN(x)||isNaN(b)?(h[d++]=NaN,d+=3):(h[d++]=bP(g,a,y,_,l,m),p[0]=v,p[1]=x,i=t.dataToPoint(p,null,f),h[d++]=i?i[0]:NaN,h[d++]=i?i[1]:NaN,p[1]=b,i=t.dataToPoint(p,null,f),h[d++]=i?i[1]:NaN)}r.setLayout("largePoints",h)}:function(e,n){var i,a=n.getStore();for(;null!=(i=e.next());){var h=a.get(o,i),d=a.get(s,i),p=a.get(l,i),f=a.get(u,i),g=a.get(c,i),m=Math.min(d,p),v=Math.max(d,p),y=T(m,h),_=T(v,h),x=T(f,h),b=T(g,h),w=[];M(w,_,0),M(w,y,1),w.push(D(b),D(_),D(x),D(y));var S=!!n.getItemModel(i).get(["itemStyle","borderColorDoji"]);n.setItemLayout(i,{sign:bP(a,i,d,p,l,S),initBaseline:d>p?_[1]:y[1],ends:w,brushRect:C(f,g,h)})}function T(e,n){var r=[];return r[0]=n,r[1]=e,isNaN(n)||isNaN(e)?[NaN,NaN]:t.dataToPoint(r)}function M(e,t,n){var i=t.slice(),o=t.slice();i[0]=th(i[0]+r/2,1,!1),o[0]=th(o[0]-r/2,1,!0),n?e.push(i,o):e.push(o,i)}function C(e,t,n){var i=T(e,n),o=T(t,n);return i[0]-=r/2,o[0]-=r/2,{x:i[0],y:i[1],width:r,height:o[1]-i[1]}}function D(e){return e[0]=th(e[0],1),e}}}}};function bP(e,t,n,r,i,o){return n>r?-1:n<r?1:o?0:t>0?e.get(i,t-1)<=r?1:-1:1}function wP(e,t){var n=t.rippleEffectColor||t.color;e.eachChild((function(e){e.attr({z:t.z,zlevel:t.zlevel,style:{stroke:"stroke"===t.brushType?n:null,fill:"fill"===t.brushType?n:null}})}))}var SP=function(e){function t(t,n){var r=e.call(this)||this,i=new WS(t,n),o=new Yi;return r.add(i),r.add(o),r.updateData(t,n),r}return l(t,e),t.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},t.prototype.startEffectAnimation=function(e){for(var t=e.symbolType,n=e.color,r=e.rippleNumber,i=this.childAt(1),o=0;o<r;o++){var a=dv(t,-1,-1,2,2,n);a.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scaleX:.5,scaleY:.5});var s=-o/r*e.period+e.effectOffset;a.animate("",!0).when(e.period,{scaleX:e.rippleScale/2,scaleY:e.rippleScale/2}).delay(s).start(),a.animateStyle(!0).when(e.period,{opacity:0}).delay(s).start(),i.add(a)}wP(i,e)},t.prototype.updateEffectAnimation=function(e){for(var t=this._effectCfg,n=this.childAt(1),r=["symbolType","period","rippleScale","rippleNumber"],i=0;i<r.length;i++){var o=r[i];if(t[o]!==e[o])return this.stopEffectAnimation(),void this.startEffectAnimation(e)}wP(n,e)},t.prototype.highlight=function(){Kl(this)},t.prototype.downplay=function(){$l(this)},t.prototype.getSymbolType=function(){var e=this.childAt(0);return e&&e.getSymbolType()},t.prototype.updateData=function(e,t){var n=this,r=e.hostModel;this.childAt(0).updateData(e,t);var i=this.childAt(1),o=e.getItemModel(t),a=e.getItemVisual(t,"symbol"),s=pv(e.getItemVisual(t,"symbolSize")),l=e.getItemVisual(t,"style"),u=l&&l.fill,c=o.getModel("emphasis");i.setScale(s),i.traverse((function(e){e.setStyle("fill",u)}));var h=fv(e.getItemVisual(t,"symbolOffset"),s);h&&(i.x=h[0],i.y=h[1]);var d=e.getItemVisual(t,"symbolRotate");i.rotation=(d||0)*Math.PI/180||0;var p={};p.showEffectOn=r.get("showEffectOn"),p.rippleScale=o.get(["rippleEffect","scale"]),p.brushType=o.get(["rippleEffect","brushType"]),p.period=1e3*o.get(["rippleEffect","period"]),p.effectOffset=t/e.count(),p.z=r.getShallow("z")||0,p.zlevel=r.getShallow("zlevel")||0,p.symbolType=a,p.color=u,p.rippleEffectColor=o.get(["rippleEffect","color"]),p.rippleNumber=o.get(["rippleEffect","number"]),"render"===p.showEffectOn?(this._effectCfg?this.updateEffectAnimation(p):this.startEffectAnimation(p),this._effectCfg=p):(this._effectCfg=null,this.stopEffectAnimation(),this.onHoverStateChange=function(e){"emphasis"===e?"render"!==p.showEffectOn&&n.startEffectAnimation(p):"normal"===e&&"render"!==p.showEffectOn&&n.stopEffectAnimation()}),this._effectCfg=p,cu(this,c.get("focus"),c.get("blurScope"),c.get("disabled"))},t.prototype.fadeOut=function(e){e&&e()},t}(Yi),TP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(){this._symbolDraw=new qS(SP)},t.prototype.render=function(e,t,n){var r=e.getData(),i=this._symbolDraw;i.updateData(r,{clipShape:this._getClipShape(e)}),this.group.add(i.group)},t.prototype._getClipShape=function(e){var t=e.coordinateSystem,n=t&&t.getArea&&t.getArea();return e.get("clip",!0)?n:null},t.prototype.updateTransform=function(e,t,n){var r=e.getData();this.group.dirty();var i=wT("").reset(e,t,n);i.progress&&i.progress({start:0,end:r.count(),count:r.count()},r),this._symbolDraw.updateLayout()},t.prototype._updateGroupTransform=function(e){var t=e.coordinateSystem;t&&t.getRoamTransform&&(this.group.transform=Ot(t.getRoamTransform()),this.group.decomposeTransform())},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0)},t.type="effectScatter",t}(em),MP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return l(t,e),t.prototype.getInitialData=function(e,t){return j_(null,this,{useEncodeDefaulter:!0})},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.type="series.effectScatter",t.dependencies=["grid","polar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",clip:!0,rippleEffect:{period:4,scale:2.5,brushType:"fill",number:3},universalTransition:{divideShape:"clone"},symbolSize:10},t}(Hg);var CP=function(e){function t(t,n,r){var i=e.call(this)||this;return i.add(i.createLine(t,n,r)),i._updateEffectSymbol(t,n),i}return l(t,e),t.prototype.createLine=function(e,t,n){return new xE(e,t,n)},t.prototype._updateEffectSymbol=function(e,t){var n=e.getItemModel(t).getModel("effect"),r=n.get("symbolSize"),i=n.get("symbol");J(r)||(r=[r,r]);var o=e.getItemVisual(t,"style"),a=n.get("color")||o&&o.stroke,s=this.childAt(1);this._symbolType!==i&&(this.remove(s),(s=dv(i,-.5,-.5,1,1,a)).z2=100,s.culling=!0,this.add(s)),s&&(s.setStyle("shadowColor",a),s.setStyle(n.getItemStyle(["color"])),s.scaleX=r[0],s.scaleY=r[1],s.setColor(a),this._symbolType=i,this._symbolScale=r,this._updateEffectAnimation(e,n,t))},t.prototype._updateEffectAnimation=function(e,t,n){var r=this.childAt(1);if(r){var i=e.getItemLayout(n),o=1e3*t.get("period"),a=t.get("loop"),s=t.get("roundTrip"),l=t.get("constantSpeed"),u=he(t.get("delay"),(function(t){return t/e.count()*o/3}));if(r.ignore=!0,this._updateAnimationPoints(r,i),l>0&&(o=this._getLineLength(r)/l*1e3),o!==this._period||a!==this._loop||s!==this._roundTrip){r.stopAnimation();var c=void 0;c=Q(u)?u(n):u,r.__t>0&&(c=-o*r.__t),this._animateSymbol(r,o,c,a,s)}this._period=o,this._loop=a,this._roundTrip=s}},t.prototype._animateSymbol=function(e,t,n,r,i){if(t>0){e.__t=0;var o=this,a=e.animate("",r).when(i?2*t:t,{__t:i?2:1}).delay(n).during((function(){o._updateSymbolPosition(e)}));r||a.done((function(){o.remove(e)})),a.start()}},t.prototype._getLineLength=function(e){return Xe(e.__p1,e.__cp1)+Xe(e.__cp1,e.__p2)},t.prototype._updateAnimationPoints=function(e,t){e.__p1=t[0],e.__p2=t[1],e.__cp1=t[2]||[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]},t.prototype.updateData=function(e,t,n){this.childAt(0).updateData(e,t,n),this._updateEffectSymbol(e,t)},t.prototype._updateSymbolPosition=function(e){var t=e.__p1,n=e.__p2,r=e.__cp1,i=e.__t<1?e.__t:2-e.__t,o=[e.x,e.y],a=o.slice(),s=Pn,l=On;o[0]=s(t[0],r[0],n[0],i),o[1]=s(t[1],r[1],n[1],i);var u=e.__t<1?l(t[0],r[0],n[0],i):l(n[0],r[0],t[0],1-i),c=e.__t<1?l(t[1],r[1],n[1],i):l(n[1],r[1],t[1],1-i);e.rotation=-Math.atan2(c,u)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==e.__lastT&&e.__lastT<e.__t?(e.scaleY=1.05*Xe(a,o),1===i&&(o[0]=a[0]+(o[0]-a[0])/2,o[1]=a[1]+(o[1]-a[1])/2)):1===e.__lastT?e.scaleY=2*Xe(t,o):e.scaleY=this._symbolScale[1]),e.__lastT=e.__t,e.ignore=!1,e.x=o[0],e.y=o[1]},t.prototype.updateLayout=function(e,t){this.childAt(0).updateLayout(e,t);var n=e.getItemModel(t).getModel("effect");this._updateEffectAnimation(e,n,t)},t}(Yi),DP=function(e){function t(t,n,r){var i=e.call(this)||this;return i._createPolyline(t,n,r),i}return l(t,e),t.prototype._createPolyline=function(e,t,n){var r=e.getItemLayout(t),i=new cc({shape:{points:r}});this.add(i),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var r=e.hostModel;Oc(this.childAt(0),{shape:{points:e.getItemLayout(t)}},r,t),this._updateCommonStl(e,t,n)},t.prototype._updateCommonStl=function(e,t,n){var r=this.childAt(0),i=e.getItemModel(t),o=n&&n.emphasisLineStyle,a=n&&n.focus,s=n&&n.blurScope,l=n&&n.emphasisDisabled;if(!n||e.hasItemOption){var u=i.getModel("emphasis");o=u.getModel("lineStyle").getLineStyle(),l=u.get("disabled"),a=u.get("focus"),s=u.get("blurScope")}r.useStyle(e.getItemVisual(t,"style")),r.style.fill=null,r.style.strokeNoScale=!0,r.ensureState("emphasis").style=o,cu(this,a,s,l)},t.prototype.updateLayout=function(e,t){this.childAt(0).setShape("points",e.getItemLayout(t))},t}(Yi),AP=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._lastFrame=0,t._lastFramePercent=0,t}return l(t,e),t.prototype.createLine=function(e,t,n){return new DP(e,t,n)},t.prototype._updateAnimationPoints=function(e,t){this._points=t;for(var n=[0],r=0,i=1;i<t.length;i++){var o=t[i-1],a=t[i];r+=Xe(o,a),n.push(r)}if(0!==r){for(i=0;i<n.length;i++)n[i]/=r;this._offsets=n,this._length=r}else this._length=0},t.prototype._getLineLength=function(){return this._length},t.prototype._updateSymbolPosition=function(e){var t=e.__t<1?e.__t:2-e.__t,n=this._points,r=this._offsets,i=n.length;if(r){var o,a=this._lastFrame;if(t<this._lastFramePercent){for(o=Math.min(a+1,i-1);o>=0&&!(r[o]<=t);o--);o=Math.min(o,i-2)}else{for(o=a;o<i&&!(r[o]>t);o++);o=Math.min(o-1,i-2)}var s=(t-r[o])/(r[o+1]-r[o]),l=n[o],u=n[o+1];e.x=l[0]*(1-s)+s*u[0],e.y=l[1]*(1-s)+s*u[1];var c=e.__t<1?u[0]-l[0]:l[0]-u[0],h=e.__t<1?u[1]-l[1]:l[1]-u[1];e.rotation=-Math.atan2(h,c)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=t,e.ignore=!1}},t}(CP),IP=function(){this.polyline=!1,this.curveness=0,this.segs=[]},EP=function(e){function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return l(t,e),t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new IP},t.prototype.buildPath=function(e,t){var n,r=t.segs,i=t.curveness;if(t.polyline)for(n=this._off;n<r.length;){var o=r[n++];if(o>0){e.moveTo(r[n++],r[n++]);for(var a=1;a<o;a++)e.lineTo(r[n++],r[n++])}}else for(n=this._off;n<r.length;){var s=r[n++],l=r[n++],u=r[n++],c=r[n++];if(e.moveTo(s,l),i>0){var h=(s+u)/2-(l-c)*i,d=(l+c)/2-(u-s)*i;e.quadraticCurveTo(h,d,u,c)}else e.lineTo(u,c)}this.incremental&&(this._off=n,this.notClear=!0)},t.prototype.findDataIndex=function(e,t){var n=this.shape,r=n.segs,i=n.curveness,o=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s<r.length;){var l=r[s++];if(l>0)for(var u=r[s++],c=r[s++],h=1;h<l;h++){if(As(u,c,d=r[s++],p=r[s++],o,e,t))return a}a++}else for(a=0,s=0;s<r.length;){u=r[s++],c=r[s++];var d=r[s++],p=r[s++];if(i>0){if(Es(u,c,(u+d)/2-(c-p)*i,(c+p)/2-(d-u)*i,d,p,o,e,t))return a}else if(As(u,c,d,p,o,e,t))return a;a++}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect();return e=n[0],t=n[1],r.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape.segs,n=1/0,r=1/0,i=-1/0,o=-1/0,a=0;a<t.length;){var s=t[a++],l=t[a++];n=Math.min(s,n),i=Math.max(s,i),r=Math.min(l,r),o=Math.max(l,o)}e=this._rect=new jt(n,r,i,o)}return e},t}(Ys),LP=function(){function e(){this.group=new Yi}return e.prototype.updateData=function(e){this._clear();var t=this._create();t.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(t,e)},e.prototype.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clear()},e.prototype.incrementalUpdate=function(e,t){var n=this._newAdded[0],r=t.getLayout("linesPoints"),i=n&&n.shape.segs;if(i&&i.length<2e4){var o=i.length,a=new Float32Array(o+r.length);a.set(i),a.set(r,o),n.setShape({segs:a})}else{this._newAdded=[];var s=this._create();s.incremental=!0,s.setShape({segs:r}),this._setCommon(s,t),s.__startIndex=e.start}},e.prototype.remove=function(){this._clear()},e.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},e.prototype._create=function(){var e=new EP({cursor:"default",ignoreCoarsePointer:!0});return this._newAdded.push(e),this.group.add(e),e},e.prototype._setCommon=function(e,t,n){var r=t.hostModel;e.setShape({polyline:r.get("polyline"),curveness:r.get(["lineStyle","curveness"])}),e.useStyle(r.getModel("lineStyle").getLineStyle()),e.style.strokeNoScale=!0;var i=t.getVisual("style");i&&i.stroke&&e.setStyle("stroke",i.stroke),e.setStyle("fill",null);var o=bl(e);o.seriesIndex=r.seriesIndex,e.on("mousemove",(function(t){o.dataIndex=null;var n=e.hoverDataIdx;n>0&&(o.dataIndex=n+e.__startIndex)}))},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),NP={seriesType:"lines",plan:$g(),reset:function(e){var t=e.coordinateSystem;if(t){var n=e.get("polyline"),r=e.pipelineContext.large;return{progress:function(i,o){var a=[];if(r){var s=void 0,l=i.end-i.start;if(n){for(var u=0,c=i.start;c<i.end;c++)u+=e.getLineCoordsCount(c);s=new Float32Array(l+2*u)}else s=new Float32Array(4*l);var h=0,d=[];for(c=i.start;c<i.end;c++){var p=e.getLineCoords(c,a);n&&(s[h++]=p);for(var f=0;f<p;f++)d=t.dataToPoint(a[f],!1,d),s[h++]=d[0],s[h++]=d[1]}o.setLayout("linesPoints",s)}else for(c=i.start;c<i.end;c++){var g=o.getItemModel(c),m=(p=e.getLineCoords(c,a),[]);if(n)for(var v=0;v<p;v++)m.push(t.dataToPoint(a[v]));else{m[0]=t.dataToPoint(a[0]),m[1]=t.dataToPoint(a[1]);var y=g.get(["lineStyle","curveness"]);+y&&(m[2]=[(m[0][0]+m[1][0])/2-(m[0][1]-m[1][1])*y,(m[0][1]+m[1][1])/2-(m[1][0]-m[0][0])*y])}o.setItemLayout(c,m)}}}}"production"!==process.env.NODE_ENV&&Po("The lines series must have a coordinate system.")}},PP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){var r=e.getData(),i=this._updateLineDraw(r,e),o=e.get("zlevel"),a=e.get(["effect","trailLength"]),s=n.getZr(),l="svg"===s.painter.getType();l||s.painter.getLayer(o).clear(!0),null==this._lastZlevel||l||s.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(e)&&a>0&&(l?"production"!==process.env.NODE_ENV&&console.warn("SVG render mode doesn't support lines with trail effect"):s.configLayer(o,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)})),i.updateData(r);var u=e.get("clip",!0)&&lT(e.coordinateSystem,!1,e);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=o,this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var r=e.getData();this._updateLineDraw(r,e).incrementalPrepareUpdate(r),this._clearLayer(n),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._lineDraw.incrementalUpdate(e,t.getData()),this._finished=e.end===t.getData().count()},t.prototype.eachRendered=function(e){this._lineDraw&&this._lineDraw.eachRendered(e)},t.prototype.updateTransform=function(e,t,n){var r=e.getData(),i=e.pipelineContext;if(!this._finished||i.large||i.progressiveRender)return{update:!0};var o=NP.reset(e,t,n);o.progress&&o.progress({start:0,end:r.count(),count:r.count()},r),this._lineDraw.updateLayout(),this._clearLayer(n)},t.prototype._updateLineDraw=function(e,t){var n=this._lineDraw,r=this._showEffect(t),i=!!t.get("polyline"),o=t.pipelineContext.large;return"production"!==process.env.NODE_ENV&&r&&o&&console.warn("Large lines not support effect"),n&&r===this._hasEffet&&i===this._isPolyline&&o===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=o?new LP:new bE(i?r?AP:DP:r?CP:xE),this._hasEffet=r,this._isPolyline=i,this._isLargeDraw=o),this.group.add(n.group),n},t.prototype._showEffect=function(e){return!!e.get(["effect","show"])},t.prototype._clearLayer=function(e){var t=e.getZr();"svg"===t.painter.getType()||null==this._lastZlevel||t.painter.getLayer(this._lastZlevel).clear(!0)},t.prototype.remove=function(e,t){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(t)},t.prototype.dispose=function(e,t){this.remove(e,t)},t.type="lines",t}(em),OP="undefined"==typeof Uint32Array?Array:Uint32Array,RP="undefined"==typeof Float64Array?Array:Float64Array;function kP(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&("production"!==process.env.NODE_ENV&&console.warn("Lines data configuration has been changed to { coords:[[1,2],[2,3]] }"),e.data=j(t,(function(e){var t={coords:[e[0].coord,e[1].coord]};return e[0].name&&(t.fromName=e[0].name),e[1].name&&(t.toName=e[1].name),k([t,e[0],e[1]])})))}var zP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return l(t,e),t.prototype.init=function(t){t.data=t.data||[],kP(t);var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count)),e.prototype.init.apply(this,arguments)},t.prototype.mergeOption=function(t){if(kP(t),t.data){var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count))}e.prototype.mergeOption.apply(this,arguments)},t.prototype.appendData=function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=Me(this._flatCoords,t.flatCoords),this._flatCoordsOffset=Me(this._flatCoordsOffset,t.flatCoordsOffset)):(this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset),e.data=new Float32Array(t.count)),this.getRawData().appendData(e.data)},t.prototype._getCoordsFromItemModel=function(e){var t=this.getData().getItemModel(e),n=t.option instanceof Array?t.option:t.getShallow("coords");if("production"!==process.env.NODE_ENV&&!(n instanceof Array&&n.length>0&&n[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(n)+". Lines must have 2d coords array in data item.");return n},t.prototype.getLineCoordsCount=function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},t.prototype.getLineCoords=function(e,t){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*e],r=this._flatCoordsOffset[2*e+1],i=0;i<r;i++)t[i]=t[i]||[],t[i][0]=this._flatCoords[n+2*i],t[i][1]=this._flatCoords[n+2*i+1];return r}var o=this._getCoordsFromItemModel(e);for(i=0;i<o.length;i++)t[i]=t[i]||[],t[i][0]=o[i][0],t[i][1]=o[i][1];return o.length},t.prototype._processFlatCoordsArray=function(e){var t=0;if(this._flatCoords&&(t=this._flatCoords.length),ne(e[0])){for(var n=e.length,r=new OP(n),i=new RP(n),o=0,a=0,s=0,l=0;l<n;){s++;var u=e[l++];r[a++]=o+t,r[a++]=u;for(var c=0;c<u;c++){var h=e[l++],d=e[l++];if(i[o++]=h,i[o++]=d,l>n&&"production"!==process.env.NODE_ENV)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(r.buffer,0,a),flatCoords:i,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},t.prototype.getInitialData=function(e,t){if("production"!==process.env.NODE_ENV&&!Up.get(e.coordinateSystem))throw new Error("Unknown coordinate system "+e.coordinateSystem);var n=new R_(["value"],this);return n.hasItemOption=!1,n.initData(e.data,[],(function(e,t,r,i){if(e instanceof Array)return NaN;n.hasItemOption=!0;var o=e.value;return null!=o?o instanceof Array?o[i]:o:void 0})),n},t.prototype.formatTooltip=function(e,t,n){var r=this.getData().getItemModel(e),i=r.get("name");if(i)return i;var o=r.get("fromName"),a=r.get("toName"),s=[];return null!=o&&s.push(o),null!=a&&s.push(a),Cg("nameValue",{name:s.join(" > ")})},t.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},t.prototype.getProgressive=function(){var e=this.option.progressive;return null==e?this.option.large?1e4:this.get("progressive"):e},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?2e4:this.get("progressiveThreshold"):e},t.prototype.getZLevelKey=function(){var e=this.getModel("effect"),t=e.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:e.get("show")&&t>0?t+"":""},t.type="series.lines",t.dependencies=["grid","polar","geo","calendar"],t.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},t}(Hg);function VP(e){return e instanceof Array||(e=[e,e]),e}var BP={seriesType:"lines",reset:function(e){var t=VP(e.get("symbol")),n=VP(e.get("symbolSize")),r=e.getData();return r.setVisual("fromSymbol",t&&t[0]),r.setVisual("toSymbol",t&&t[1]),r.setVisual("fromSymbolSize",n&&n[0]),r.setVisual("toSymbolSize",n&&n[1]),{dataEach:r.hasItemOption?function(e,t){var n=e.getItemModel(t),r=VP(n.getShallow("symbol",!0)),i=VP(n.getShallow("symbolSize",!0));r[0]&&e.setItemVisual(t,"fromSymbol",r[0]),r[1]&&e.setItemVisual(t,"toSymbol",r[1]),i[0]&&e.setItemVisual(t,"fromSymbolSize",i[0]),i[1]&&e.setItemVisual(t,"toSymbolSize",i[1])}:null}}};var FP=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=y.createCanvas();this.canvas=e}return e.prototype.update=function(e,t,n,r,i,o){var a=this._getBrush(),s=this._getGradient(i,"inRange"),l=this._getGradient(i,"outOfRange"),u=this.pointSize+this.blurSize,c=this.canvas,h=c.getContext("2d"),d=e.length;c.width=t,c.height=n;for(var p=0;p<d;++p){var f=e[p],g=f[0],m=f[1],v=r(f[2]);h.globalAlpha=v,h.drawImage(a,g-u,m-u)}if(!c.width||!c.height)return c;for(var y=h.getImageData(0,0,c.width,c.height),_=y.data,x=0,b=_.length,w=this.minOpacity,S=this.maxOpacity-w;x<b;){v=_[x+3]/256;var T=4*Math.floor(255*v);if(v>0){var M=o(v)?s:l;v>0&&(v=v*S+w),_[x++]=M[T],_[x++]=M[T+1],_[x++]=M[T+2],_[x++]=M[T+3]*v*256}else x+=4}return h.putImageData(y,0,0),c},e.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=y.createCanvas()),t=this.pointSize+this.blurSize,n=2*t;e.width=n,e.height=n;var r=e.getContext("2d");return r.clearRect(0,0,n,n),r.shadowOffsetX=n,r.shadowBlur=this.blurSize,r.shadowColor="#000",r.beginPath(),r.arc(-t,t,this.pointSize,0,2*Math.PI,!0),r.closePath(),r.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,r=n[t]||(n[t]=new Uint8ClampedArray(1024)),i=[0,0,0,0],o=0,a=0;a<256;a++)e[t](a/255,!0,i),r[o++]=i[0],r[o++]=i[1],r[o++]=i[2],r[o++]=i[3];return r},e}();function GP(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}var HP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){var r;if(t.eachComponent("visualMap",(function(t){t.eachTargetSeries((function(n){n===e&&(r=t)}))})),"production"!==process.env.NODE_ENV&&!r)throw new Error("Heatmap must use with visualMap");this._progressiveEls=null,this.group.removeAll();var i=e.coordinateSystem;"cartesian2d"===i.type||"calendar"===i.type?this._renderOnCartesianAndCalendar(e,n,0,e.getData().count()):GP(i)&&this._renderOnGeo(i,e,r,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,r){var i=t.coordinateSystem;i&&(GP(i)?this.render(t,n,r):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(t,r,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){gh(this._progressiveEls||this.group,e)},t.prototype._renderOnCartesianAndCalendar=function(e,t,n,r,i){var o,a,s,l,u=e.coordinateSystem,c=uT(u,"cartesian2d");if(c){var h=u.getAxis("x"),d=u.getAxis("y");if("production"!==process.env.NODE_ENV){if("category"!==h.type||"category"!==d.type)throw new Error("Heatmap on cartesian must have two category axes");if(!h.onBand||!d.onBand)throw new Error("Heatmap on cartesian must have two axes with boundaryGap true")}o=h.getBandWidth()+.5,a=d.getBandWidth()+.5,s=h.scale.getExtent(),l=d.scale.getExtent()}for(var p=this.group,f=e.getData(),g=e.getModel(["emphasis","itemStyle"]).getItemStyle(),m=e.getModel(["blur","itemStyle"]).getItemStyle(),v=e.getModel(["select","itemStyle"]).getItemStyle(),y=e.get(["itemStyle","borderRadius"]),_=bh(e),x=e.getModel("emphasis"),b=x.get("focus"),w=x.get("blurScope"),S=x.get("disabled"),T=c?[f.mapDimension("x"),f.mapDimension("y"),f.mapDimension("value")]:[f.mapDimension("time"),f.mapDimension("value")],M=n;M<r;M++){var C=void 0,D=f.getItemVisual(M,"style");if(c){var A=f.get(T[0],M),I=f.get(T[1],M);if(isNaN(f.get(T[2],M))||isNaN(A)||isNaN(I)||A<s[0]||A>s[1]||I<l[0]||I>l[1])continue;var E=u.dataToPoint([A,I]);C=new ol({shape:{x:E[0]-o/2,y:E[1]-a/2,width:o,height:a},style:D})}else{if(isNaN(f.get(T[1],M)))continue;C=new ol({z2:1,shape:u.dataToRect([f.get(T[0],M)]).contentShape,style:D})}if(f.hasItemOption){var L=f.getItemModel(M),N=L.getModel("emphasis");g=N.getModel("itemStyle").getItemStyle(),m=L.getModel(["blur","itemStyle"]).getItemStyle(),v=L.getModel(["select","itemStyle"]).getItemStyle(),y=L.get(["itemStyle","borderRadius"]),b=N.get("focus"),w=N.get("blurScope"),S=N.get("disabled"),_=bh(L)}C.shape.r=y;var P=e.getRawValue(M),O="-";P&&null!=P[2]&&(O=P[2]+""),xh(C,_,{labelFetcher:e,labelDataIndex:M,defaultOpacity:D.opacity,defaultText:O}),C.ensureState("emphasis").style=g,C.ensureState("blur").style=m,C.ensureState("select").style=v,cu(C,b,w,S),C.incremental=i,i&&(C.states.emphasis.hoverLayer=!0),p.add(C),f.setItemGraphicEl(M,C),this._progressiveEls&&this._progressiveEls.push(C)}},t.prototype._renderOnGeo=function(e,t,n,r){var i=n.targetVisuals.inRange,o=n.targetVisuals.outOfRange,a=t.getData(),s=this._hmLayer||this._hmLayer||new FP;s.blurSize=t.get("blurSize"),s.pointSize=t.get("pointSize"),s.minOpacity=t.get("minOpacity"),s.maxOpacity=t.get("maxOpacity");var l=e.getViewRect().clone(),u=e.getRoamTransform();l.applyTransform(u);var c=Math.max(l.x,0),h=Math.max(l.y,0),d=Math.min(l.width+l.x,r.getWidth()),p=Math.min(l.height+l.y,r.getHeight()),f=d-c,g=p-h,m=[a.mapDimension("lng"),a.mapDimension("lat"),a.mapDimension("value")],v=a.mapArray(m,(function(t,n,r){var i=e.dataToPoint([t,n]);return i[0]-=c,i[1]-=h,i.push(r),i})),y=n.getExtent(),_="visualMap.continuous"===n.type?function(e,t){var n=e[1]-e[0];return t=[(t[0]-e[0])/n,(t[1]-e[0])/n],function(e){return e>=t[0]&&e<=t[1]}}(y,n.option.range):function(e,t,n){var r=e[1]-e[0],i=(t=j(t,(function(t){return{interval:[(t.interval[0]-e[0])/r,(t.interval[1]-e[0])/r]}}))).length,o=0;return function(e){var r;for(r=o;r<i;r++)if((a=t[r].interval)[0]<=e&&e<=a[1]){o=r;break}if(r===i)for(r=o-1;r>=0;r--){var a;if((a=t[r].interval)[0]<=e&&e<=a[1]){o=r;break}}return r>=0&&r<i&&n[r]}}(y,n.getPieceList(),n.option.selected);s.update(v,f,g,i.color.getNormalizer(),{inRange:i.color.getColorMapper(),outOfRange:o.color.getColorMapper()},_);var x=new Js({style:{width:f,height:g,x:c,y:h,image:s.canvas},silent:!0});this.group.add(x)},t.type="heatmap",t}(em),UP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.getInitialData=function(e,t){return j_(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var e=Up.get(this.get("coordinateSystem"));if(e&&e.dimensions)return"lng"===e.dimensions[0]&&"lat"===e.dimensions[1]},t.type="series.heatmap",t.dependencies=["grid","geo","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},t}(Hg);var WP=["itemStyle","borderWidth"],jP=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],XP=new Fu,YP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){var r=this.group,i=e.getData(),o=this._data,a=e.coordinateSystem,s=a.getBaseAxis().isHorizontal(),l=a.master.getRect(),u={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:e,coordSys:a,coordSysExtent:[[l.x,l.x+l.width],[l.y,l.y+l.height]],isHorizontal:s,valueDim:jP[+s],categoryDim:jP[1-+s]};i.diff(o).add((function(e){if(i.hasValue(e)){var t=tO(i,e),n=ZP(i,e,t,u),o=iO(i,u,n);i.setItemGraphicEl(e,o),r.add(o),uO(o,u,n)}})).update((function(e,t){var n=o.getItemGraphicEl(t);if(i.hasValue(e)){var a=tO(i,e),s=ZP(i,e,a,u),l=aO(i,s);n&&l!==n.__pictorialShapeStr&&(r.remove(n),i.setItemGraphicEl(e,null),n=null),n?function(e,t,n){var r=n.animationModel,i=n.dataIndex,o=e.__pictorialBundle;Oc(o,{x:n.bundlePosition[0],y:n.bundlePosition[1]},r,i),n.symbolRepeat?$P(e,t,n,!0):JP(e,t,n,!0);QP(e,n,!0),eO(e,t,n,!0)}(n,u,s):n=iO(i,u,s,!0),i.setItemGraphicEl(e,n),n.__pictorialSymbolMeta=s,r.add(n),uO(n,u,s)}else r.remove(n)})).remove((function(e){var t=o.getItemGraphicEl(e);t&&oO(o,e,t.__pictorialSymbolMeta.animationModel,t)})).execute();var c=e.get("clip",!0)?lT(e.coordinateSystem,!1,e):null;return c?r.setClipPath(c):r.removeClipPath(),this._data=i,this.group},t.prototype.remove=function(e,t){var n=this.group,r=this._data;e.get("animation")?r&&r.eachItemGraphicEl((function(t){oO(r,bl(t).dataIndex,e,t)})):n.removeAll()},t.type="pictorialBar",t}(em);function ZP(e,t,n,r){var i=e.getItemLayout(t),o=n.get("symbolRepeat"),a=n.get("symbolClip"),s=n.get("symbolPosition")||"start",l=(n.get("symbolRotate")||0)*Math.PI/180||0,u=n.get("symbolPatternSize")||2,c=n.isAnimationEnabled(),h={dataIndex:t,layout:i,itemModel:n,symbolType:e.getItemVisual(t,"symbol")||"circle",style:e.getItemVisual(t,"style"),symbolClip:a,symbolRepeat:o,symbolRepeatDirection:n.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:c?n:null,hoverScale:c&&n.get(["emphasis","scale"]),z2:n.getShallow("z",!0)||0};!function(e,t,n,r,i){var o,a=r.valueDim,s=e.get("symbolBoundingData"),l=r.coordSys.getOtherAxis(r.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),c=1-+(n[a.wh]<=0);if(J(s)){var h=[qP(l,s[0])-u,qP(l,s[1])-u];h[1]<h[0]&&h.reverse(),o=h[c]}else o=null!=s?qP(l,s)-u:t?r.coordSysExtent[a.index][c]-u:n[a.wh];i.boundingLength=o,t&&(i.repeatCutLength=n[a.wh]);i.pxSign=o>0?1:-1}(n,o,i,r,h),function(e,t,n,r,i,o,a,s,l,u){var c,h=l.valueDim,d=l.categoryDim,p=Math.abs(n[d.wh]),f=e.getItemVisual(t,"symbolSize");c=J(f)?f.slice():null==f?["100%","100%"]:[f,f];c[d.index]=oo(c[d.index],p),c[h.index]=oo(c[h.index],r?p:Math.abs(o)),u.symbolSize=c;var g=u.symbolScale=[c[0]/s,c[1]/s];g[h.index]*=(l.isHorizontal?-1:1)*a}(e,t,i,o,0,h.boundingLength,h.pxSign,u,r,h),function(e,t,n,r,i){var o=e.get(WP)||0;o&&(XP.attr({scaleX:t[0],scaleY:t[1],rotation:n}),XP.updateTransform(),o/=XP.getLineScale(),o*=t[r.valueDim.index]);i.valueLineWidth=o||0}(n,h.symbolScale,l,r,h);var d=h.symbolSize,p=fv(n.get("symbolOffset"),d);return function(e,t,n,r,i,o,a,s,l,u,c,h){var d=c.categoryDim,p=c.valueDim,f=h.pxSign,g=Math.max(t[p.index]+s,0),m=g;if(r){var v=Math.abs(l),y=he(e.get("symbolMargin"),"15%")+"",_=!1;y.lastIndexOf("!")===y.length-1&&(_=!0,y=y.slice(0,y.length-1));var x=oo(y,t[p.index]),b=Math.max(g+2*x,0),w=_?0:2*x,S=Mo(r),T=S?r:cO((v+w)/b);b=g+2*(x=(v-T*g)/2/(_?T:Math.max(T-1,1))),w=_?0:2*x,S||"fixed"===r||(T=u?cO((Math.abs(u)+w)/b):0),m=T*b-w,h.repeatTimes=T,h.symbolMargin=x}var M=f*(m/2),C=h.pathPosition=[];C[d.index]=n[d.wh]/2,C[p.index]="start"===a?M:"end"===a?l-M:l/2,o&&(C[0]+=o[0],C[1]+=o[1]);var D=h.bundlePosition=[];D[d.index]=n[d.xy],D[p.index]=n[p.xy];var A=h.barRectShape=z({},n);A[p.wh]=f*Math.max(Math.abs(n[p.wh]),Math.abs(C[p.index]+M)),A[d.wh]=n[d.wh];var I=h.clipShape={};I[d.xy]=-n[d.xy],I[d.wh]=c.ecSize[d.wh],I[p.xy]=0,I[p.wh]=n[p.wh]}(n,d,i,o,0,p,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,r,h),h}function qP(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function KP(e){var t=e.symbolPatternSize,n=dv(e.symbolType,-t/2,-t/2,t,t);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function $P(e,t,n,r){var i=e.__pictorialBundle,o=n.symbolSize,a=n.valueLineWidth,s=n.pathPosition,l=t.valueDim,u=n.repeatTimes||0,c=0,h=o[t.valueDim.index]+a+2*n.symbolMargin;for(sO(e,(function(e){e.__pictorialAnimationIndex=c,e.__pictorialRepeatTimes=u,c<u?lO(e,null,f(c),n,r):lO(e,null,{scaleX:0,scaleY:0},n,r,(function(){i.remove(e)})),c++}));c<u;c++){var d=KP(n);d.__pictorialAnimationIndex=c,d.__pictorialRepeatTimes=u,i.add(d);var p=f(c);lO(d,{x:p.x,y:p.y,scaleX:0,scaleY:0},{scaleX:p.scaleX,scaleY:p.scaleY,rotation:p.rotation},n,r)}function f(e){var t=s.slice(),r=n.pxSign,i=e;return("start"===n.symbolRepeatDirection?r>0:r<0)&&(i=u-1-e),t[l.index]=h*(i-u/2+.5)+s[l.index],{x:t[0],y:t[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function JP(e,t,n,r){var i=e.__pictorialBundle,o=e.__pictorialMainPath;o?lO(o,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,r):(o=e.__pictorialMainPath=KP(n),i.add(o),lO(o,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,r))}function QP(e,t,n){var r=z({},t.barRectShape),i=e.__pictorialBarRect;i?lO(i,null,{shape:r},t,n):((i=e.__pictorialBarRect=new ol({z2:2,shape:r,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}})).disableMorphing=!0,e.add(i))}function eO(e,t,n,r){if(n.symbolClip){var i=e.__pictorialClipPath,o=z({},n.clipShape),a=t.valueDim,s=n.animationModel,l=n.dataIndex;if(i)Oc(i,{shape:o},s,l);else{o[a.wh]=0,i=new ol({shape:o}),e.__pictorialBundle.setClipPath(i),e.__pictorialClipPath=i;var u={};u[a.wh]=n.clipShape[a.wh],mh[r?"updateProps":"initProps"](i,{shape:u},s,l)}}}function tO(e,t){var n=e.getItemModel(t);return n.getAnimationDelayParams=nO,n.isAnimationEnabled=rO,n}function nO(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function rO(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function iO(e,t,n,r){var i=new Yi,o=new Yi;return i.add(o),i.__pictorialBundle=o,o.x=n.bundlePosition[0],o.y=n.bundlePosition[1],n.symbolRepeat?$P(i,t,n):JP(i,0,n),QP(i,n,r),eO(i,t,n,r),i.__pictorialShapeStr=aO(e,n),i.__pictorialSymbolMeta=n,i}function oO(e,t,n,r){var i=r.__pictorialBarRect;i&&i.removeTextContent();var o=[];sO(r,(function(e){o.push(e)})),r.__pictorialMainPath&&o.push(r.__pictorialMainPath),r.__pictorialClipPath&&(n=null),W(o,(function(e){zc(e,{scaleX:0,scaleY:0},n,t,(function(){r.parent&&r.parent.remove(r)}))})),e.setItemGraphicEl(t,null)}function aO(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function sO(e,t,n){W(e.__pictorialBundle.children(),(function(r){r!==e.__pictorialBarRect&&t.call(n,r)}))}function lO(e,t,n,r,i,o){t&&e.attr(t),r.symbolClip&&!i?n&&e.attr(n):n&&mh[i?"updateProps":"initProps"](e,n,r.animationModel,r.dataIndex,o)}function uO(e,t,n){var r=n.dataIndex,i=n.itemModel,o=i.getModel("emphasis"),a=o.getModel("itemStyle").getItemStyle(),s=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),c=o.get("focus"),h=o.get("blurScope"),d=o.get("scale");sO(e,(function(e){if(e instanceof Js){var t=e.style;e.useStyle(z({image:t.image,x:t.x,y:t.y,width:t.width,height:t.height},n.style))}else e.useStyle(n.style);var r=e.ensureState("emphasis");r.style=a,d&&(r.scaleX=1.1*e.scaleX,r.scaleY=1.1*e.scaleY),e.ensureState("blur").style=s,e.ensureState("select").style=l,u&&(e.cursor=u),e.z2=n.z2}));var p=t.valueDim.posDesc[+(n.boundingLength>0)],f=e.__pictorialBarRect;f.ignoreClip=!0,xh(f,bh(i),{labelFetcher:t.seriesModel,labelDataIndex:r,defaultText:HS(t.seriesModel.getData(),r),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:p}),cu(e,c,h,o.get("disabled"))}function cO(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}var hO=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n.defaultSymbol="roundRect",n}return l(t,e),t.prototype.getInitialData=function(t){return t.stack=null,e.prototype.getInitialData.apply(this,arguments)},t.type="series.pictorialBar",t.dependencies=["grid"],t.defaultOption=Yh(CT.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),t}(CT);var dO=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._layers=[],n}return l(t,e),t.prototype.render=function(e,t,n){var r=e.getData(),i=this,o=this.group,a=e.getLayerSeries(),s=r.getLayout("layoutInfo"),l=s.rect,u=s.boundaryGap;function c(e){return e.name}o.x=0,o.y=l.y+u[0];var h=new h_(this._layersSeries||[],a,c,c),d=[];function p(t,n,s){var l=i._layers;if("remove"!==t){for(var u,c,h=[],p=[],f=a[n].indices,g=0;g<f.length;g++){var m=r.getItemLayout(f[g]),v=m.x,y=m.y0,_=m.y;h.push(v,y),p.push(v,y+_),u=r.getItemVisual(f[g],"style")}var x=r.getItemLayout(f[0]),b=e.getModel("label").get("margin"),w=e.getModel("emphasis");if("add"===t){var S=d[n]=new Yi;c=new oT({shape:{points:h,stackedOnPoints:p,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),S.add(c),o.add(S),e.isAnimationEnabled()&&c.setClipPath(function(e,t,n){var r=new ol({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Rc(r,{shape:{x:e.x-50,width:e.width+100,height:e.height+20}},t,n),r}(c.getBoundingRect(),e,(function(){c.removeClipPath()})))}else{S=l[s];c=S.childAt(0),o.add(S),d[n]=S,Oc(c,{shape:{points:h,stackedOnPoints:p}},e),Fc(c)}xh(c,bh(e),{labelDataIndex:f[g-1],defaultText:r.getName(f[g-1]),inheritColor:u.fill},{normal:{verticalAlign:"middle"}}),c.setTextConfig({position:null,local:!0});var T=c.getTextContent();T&&(T.x=x.x-b,T.y=x.y0+x.y/2),c.useStyle(u),r.setItemGraphicEl(n,c),fu(c,e),cu(c,w.get("focus"),w.get("blurScope"),w.get("disabled"))}else o.remove(l[n])}h.add(K(p,this,"add")).update(K(p,this,"update")).remove(K(p,this,"remove")).execute(),this._layersSeries=a,this._layers=d},t.type="themeRiver",t}(em);var pO=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new dM(K(this.getData,this),K(this.getRawData,this))},t.prototype.fixData=function(e){var t=e.length,n={},r=ua(e,(function(e){return n.hasOwnProperty(e[0]+"")||(n[e[0]+""]=-1),e[2]})),i=[];r.buckets.each((function(e,t){i.push({name:t,dataList:e})}));for(var o=i.length,a=0;a<o;++a){for(var s=i[a].name,l=0;l<i[a].dataList.length;++l){var u=i[a].dataList[l][0]+"";n[u]=a}for(var u in n)n.hasOwnProperty(u)&&n[u]!==a&&(n[u]=a,e[t]=[u,0,s],t++)}return e},t.prototype.getInitialData=function(e,t){for(var n=this.getReferringComponents("singleAxis",oa).models[0].get("type"),r=Y(e.data,(function(e){return void 0!==e[2]})),i=this.fixData(r||[]),o=[],a=this.nameMap=Te(),s=0,l=0;l<i.length;++l)o.push(i[l][2]),a.get(i[l][2])||(a.set(i[l][2],s),s++);var u=z_(i,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:f_(n)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}).dimensions,c=new R_(u,this);return c.initData(i),c},t.prototype.getLayerSeries=function(){for(var e=this.getData(),t=e.count(),n=[],r=0;r<t;++r)n[r]=r;var i=e.mapDimension("single"),o=ua(n,(function(t){return e.get("name",t)})),a=[];return o.buckets.each((function(t,n){t.sort((function(t,n){return e.get(i,t)-e.get(i,n)})),a.push({name:n,indices:t})})),a},t.prototype.getAxisTooltipData=function(e,t,n){J(e)||(e=e?[e]:[]);for(var r,i=this.getData(),o=this.getLayerSeries(),a=[],s=o.length,l=0;l<s;++l){for(var u=Number.MAX_VALUE,c=-1,h=o[l].indices.length,d=0;d<h;++d){var p=i.get(e[0],o[l].indices[d]),f=Math.abs(p-t);f<=u&&(r=p,u=f,c=o[l].indices[d])}a.push(c)}return{dataIndices:a,nestestValue:r}},t.prototype.formatTooltip=function(e,t,n){var r=this.getData();return Cg("nameValue",{name:r.getName(e),value:r.get(r.mapDimension("value"),e)})},t.type="series.themeRiver",t.dependencies=["singleAxis"],t.defaultOption={z:2,colorBy:"data",coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",fontSize:11},emphasis:{label:{show:!0}}},t}(Hg);function fO(e,t){e.eachSeriesByType("themeRiver",(function(e){var t=e.getData(),n=e.coordinateSystem,r={},i=n.getRect();r.rect=i;var o=e.get("boundaryGap"),a=n.getAxis();(r.boundaryGap=o,"horizontal"===a.orient)?(o[0]=oo(o[0],i.height),o[1]=oo(o[1],i.height),gO(t,e,i.height-o[0]-o[1])):(o[0]=oo(o[0],i.width),o[1]=oo(o[1],i.width),gO(t,e,i.width-o[0]-o[1]));t.setLayout("layoutInfo",r)}))}function gO(e,t,n){if(e.count())for(var r,i=t.coordinateSystem,o=t.getLayerSeries(),a=e.mapDimension("single"),s=e.mapDimension("value"),l=j(o,(function(t){return j(t.indices,(function(t){var n=i.dataToPoint(e.get(a,t));return n[1]=e.get(s,t),n}))})),u=function(e){for(var t=e.length,n=e[0].length,r=[],i=[],o=0,a=0;a<n;++a){for(var s=0,l=0;l<t;++l)s+=e[l][a][1];s>o&&(o=s),r.push(s)}for(var u=0;u<n;++u)i[u]=(o-r[u])/2;o=0;for(var c=0;c<n;++c){var h=r[c]+i[c];h>o&&(o=h)}return{y0:i,max:o}}(l),c=u.y0,h=n/u.max,d=o.length,p=o[0].indices.length,f=0;f<p;++f){r=c[f]*h,e.setItemLayout(o[0].indices[f],{layerIndex:0,x:l[0][f][0],y0:r,y:l[0][f][1]*h});for(var g=1;g<d;++g)r+=l[g-1][f][1]*h,e.setItemLayout(o[g].indices[f],{layerIndex:g,x:l[g][f][0],y0:r,y:l[g][f][1]*h})}}var mO=function(e){function t(t,n,r,i){var o=e.call(this)||this;o.z2=2,o.textConfig={inside:!0},bl(o).seriesIndex=n.seriesIndex;var a=new ll({z2:4,silent:t.getModel().get(["label","silent"])});return o.setTextContent(a),o.updateData(!0,t,n,r,i),o}return l(t,e),t.prototype.updateData=function(e,t,n,r,i){this.node=t,t.piece=this,n=n||this._seriesModel,r=r||this._ecModel;var o=this;bl(o).dataIndex=t.dataIndex;var a=t.getModel(),s=a.getModel("emphasis"),l=t.getLayout(),u=z({},l);u.label=null;var c=t.getVisual("style");c.lineJoin="bevel";var h=t.getVisual("decal");h&&(c.decal=Bv(h,i));var d=NT(a.getModel("itemStyle"),u,!0);z(u,d),W(Dl,(function(e){var t=o.ensureState(e),n=a.getModel([e,"itemStyle"]);t.style=n.getItemStyle();var r=NT(n,u);r&&(t.shape=r)})),e?(o.setShape(u),o.shape.r=l.r0,Rc(o,{shape:{r:l.r}},n,t.dataIndex)):(Oc(o,{shape:u},n),Fc(o)),o.useStyle(c),this._updateLabel(n);var p=a.getShallow("cursor");p&&o.attr("cursor",p),this._seriesModel=n||this._seriesModel,this._ecModel=r||this._ecModel;var f=s.get("focus");cu(this,"ancestor"===f?t.getAncestorsIndices():"descendant"===f?t.getDescendantIndices():f,s.get("blurScope"),s.get("disabled"))},t.prototype._updateLabel=function(e){var t=this,n=this.node.getModel(),r=n.getModel("label"),i=this.node.getLayout(),o=i.endAngle-i.startAngle,a=(i.startAngle+i.endAngle)/2,s=Math.cos(a),l=Math.sin(a),u=this,c=u.getTextContent(),h=this.node.dataIndex,d=r.get("minAngle")/180*Math.PI,p=r.get("show")&&!(null!=d&&Math.abs(o)<d);function f(e,t){var n=e.get(t);return null==n?r.get(t):n}c.ignore=!p,W(Al,(function(r){var d="normal"===r?n.getModel("label"):n.getModel([r,"label"]),p="normal"===r,g=p?c:c.ensureState(r),m=e.getFormattedLabel(h,r);p&&(m=m||t.node.name),g.style=wh(d,{},null,"normal"!==r,!0),m&&(g.style.text=m);var v=d.get("show");null==v||p||(g.ignore=!v);var y,_=f(d,"position"),x=p?u:u.states[r],b=x.style.fill;x.textConfig={outsideFill:"inherit"===d.get("color")?b:null,inside:"outside"!==_};var w=f(d,"distance")||0,S=f(d,"align"),T=f(d,"rotate"),M=.5*Math.PI,C=1.5*Math.PI,D=Ns("tangential"===T?Math.PI/2-a:a),A=D>M&&!mo(D-M)&&D<C;"outside"===_?(y=i.r+w,S=A?"right":"left"):S&&"center"!==S?"left"===S?(y=i.r0+w,S=A?"right":"left"):"right"===S&&(y=i.r-w,S=A?"left":"right"):(y=o===2*Math.PI&&0===i.r0?0:(i.r+i.r0)/2,S="center"),g.style.align=S,g.style.verticalAlign=f(d,"verticalAlign")||"middle",g.x=y*s+i.cx,g.y=y*l+i.cy;var I=0;"radial"===T?I=Ns(-a)+(A?Math.PI:0):"tangential"===T?I=Ns(Math.PI/2-a)+(A?Math.PI:0):ne(T)&&(I=T*Math.PI/180),g.rotation=Ns(I)})),c.dirtyStyle()},t}(rc),vO="sunburstRootToNode",yO="sunburstHighlight";var _O=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n,r){var i=this;this.seriesModel=e,this.api=n,this.ecModel=t;var o=e.getData(),a=o.tree.root,s=e.getViewRoot(),l=this.group,u=e.get("renderLabelForZeroData"),c=[];s.eachNode((function(e){c.push(e)}));var h=this._oldChildren||[];!function(r,i){if(0===r.length&&0===i.length)return;function s(e){return e.getId()}function c(s,c){!function(r,i){u||!r||r.getValue()||(r=null);if(r!==a&&i!==a)if(i&&i.piece)r?(i.piece.updateData(!1,r,e,t,n),o.setItemGraphicEl(r.dataIndex,i.piece)):function(e){if(!e)return;e.piece&&(l.remove(e.piece),e.piece=null)}(i);else if(r){var s=new mO(r,e,t,n);l.add(s),o.setItemGraphicEl(r.dataIndex,s)}}(null==s?null:r[s],null==c?null:i[c])}new h_(i,r,s,s).add(c).update(c).remove($(c,null)).execute()}(c,h),function(r,o){o.depth>0?(i.virtualPiece?i.virtualPiece.updateData(!1,r,e,t,n):(i.virtualPiece=new mO(r,e,t,n),l.add(i.virtualPiece)),o.piece.off("click"),i.virtualPiece.on("click",(function(e){i._rootToNode(o.parentNode)}))):i.virtualPiece&&(l.remove(i.virtualPiece),i.virtualPiece=null)}(a,s),this._initEvents(),this._oldChildren=c},t.prototype._initEvents=function(){var e=this;this.group.off("click"),this.group.on("click",(function(t){var n=!1;e.seriesModel.getViewRoot().eachNode((function(r){if(!n&&r.piece&&r.piece===t.target){var i=r.getModel().get("nodeClick");if("rootToNode"===i)e._rootToNode(r);else if("link"===i){var o=r.getModel(),a=o.get("link");if(a)Hd(a,o.get("target",!0)||"_blank")}n=!0}}))}))},t.prototype._rootToNode=function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:vO,from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var r=e[0]-n.cx,i=e[1]-n.cy,o=Math.sqrt(r*r+i*i);return o<=n.r&&o>=n.r0}},t.type="sunburst",t}(em),xO=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreStyleOnData=!0,n}return l(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};bO(n);var r=this._levelModels=j(e.levels||[],(function(e){return new Wh(e,this,t)}),this),i=PA.createTree(n,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=i.getNodeByDataIndex(t),o=r[n.depth];return o&&(e.parentModel=o),e}))}));return i.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(t);return n.treePathInfo=zA(r,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(){UA(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}(Hg);function bO(e){var t=0;W(e.children,(function(e){bO(e);var n=e.value;J(n)&&(n=n[0]),t+=n}));var n=e.value;J(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),J(e.value)?e.value[0]=n:e.value=n}var wO=Math.PI/180;function SO(e,t,n){t.eachSeriesByType(e,(function(e){var t=e.get("center"),r=e.get("radius");J(r)||(r=[0,r]),J(t)||(t=[t,t]);var i=n.getWidth(),o=n.getHeight(),a=Math.min(i,o),s=oo(t[0],i),l=oo(t[1],o),u=oo(r[0],a/2),c=oo(r[1],a/2),h=-e.get("startAngle")*wO,d=e.get("minAngle")*wO,p=e.getData().tree.root,f=e.getViewRoot(),g=f.depth,m=e.get("sort");null!=m&&TO(f,m);var v=0;W(f.children,(function(e){!isNaN(e.getValue())&&v++}));var y=f.getValue(),_=Math.PI/(y||v)*2,x=f.depth>0,b=f.height-(x?-1:1),w=(c-u)/(b||1),S=e.get("clockwise"),T=e.get("stillShowZeroSum"),M=S?1:-1,C=function(t,n){if(t){var r=n;if(t!==p){var i=t.getValue(),o=0===y&&T?_:i*_;o<d&&(o=d),r=n+M*o;var c=t.depth-g-(x?-1:1),h=u+w*c,f=u+w*(c+1),m=e.getLevelModel(t);if(m){var v=m.get("r0",!0),b=m.get("r",!0),D=m.get("radius",!0);null!=D&&(v=D[0],b=D[1]),null!=v&&(h=oo(v,a/2)),null!=b&&(f=oo(b,a/2))}t.setLayout({angle:o,startAngle:n,endAngle:r,clockwise:S,cx:s,cy:l,r0:h,r:f})}if(t.children&&t.children.length){var A=0;W(t.children,(function(e){A+=C(e,n+A)}))}return r-n}};if(x){var D=u,A=u+w,I=2*Math.PI;p.setLayout({angle:I,startAngle:h,endAngle:h+I,clockwise:S,cx:s,cy:l,r0:D,r:A})}C(f,h)}))}function TO(e,t){var n=e.children||[];e.children=function(e,t){if(Q(t)){var n=j(e,(function(e,t){var n=e.getValue();return{params:{depth:e.depth,height:e.height,dataIndex:e.dataIndex,getValue:function(){return n}},index:t}}));return n.sort((function(e,n){return t(e.params,n.params)})),j(n,(function(t){return e[t.index]}))}var r="asc"===t;return e.sort((function(e,t){var n=(e.getValue()-t.getValue())*(r?1:-1);return 0===n?(e.dataIndex-t.dataIndex)*(r?-1:1):n}))}(n,t),n.length&&W(e.children,(function(e){TO(e,t)}))}function MO(e){var t={};e.eachSeriesByType("sunburst",(function(e){var n=e.getData(),r=n.tree;r.eachNode((function(i){var o=i.getModel().getModel("itemStyle").getItemStyle();o.fill||(o.fill=function(e,n,r){for(var i=e;i&&i.depth>1;)i=i.parentNode;var o=n.getColorFromPalette(i.name||i.dataIndex+"",t);return e.depth>1&&ee(o)&&(o=or(o,(e.depth-1)/(r-1)*.5)),o}(i,e,r.root.height)),z(n.ensureUniqueItemVisual(i.dataIndex,"style"),o)}))}))}var CO={color:"fill",borderColor:"stroke"},DO={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},AO=ta(),IO=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(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 j_(null,this)},t.prototype.getDataParams=function(t,n,r){var i=e.prototype.getDataParams.call(this,t,n);return r&&(i.info=AO(r).info),i},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},t}(Hg);function EO(e,t){return t=t||[0,0],j(["x","y"],(function(n,r){var i=this.getAxis(n),o=t[r],a=e[r]/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(o-a)-i.dataToCoord(o+a))}),this)}function LO(e,t){return t=t||[0,0],j([0,1],(function(n){var r=t[n],i=e[n]/2,o=[],a=[];return o[n]=r-i,a[n]=r+i,o[1-n]=a[1-n]=t[1-n],Math.abs(this.dataToPoint(o)[n]-this.dataToPoint(a)[n])}),this)}function NO(e,t){var n=this.getAxis(),r=t instanceof Array?t[0]:t,i=(e instanceof Array?e[0]:e)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(r-i)-n.dataToCoord(r+i))}function PO(e,t){return t=t||[0,0],j(["Radius","Angle"],(function(n,r){var i=this["get"+n+"Axis"](),o=t[r],a=e[r]/2,s="category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(o-a)-i.dataToCoord(o+a));return"Angle"===n&&(s=s*Math.PI/180),s}),this)}var OO={};function RO(e,t,n,r){return e&&(e.legacy||!1!==e.legacy&&!n&&!r&&"tspan"!==t&&("text"===t||Ae(e,"text")))}function kO(e,t,n){var r,i,o,a=e;if("text"===t)o=a;else{o={},Ae(a,"text")&&(o.text=a.text),Ae(a,"rich")&&(o.rich=a.rich),Ae(a,"textFill")&&(o.fill=a.textFill),Ae(a,"textStroke")&&(o.stroke=a.textStroke),Ae(a,"fontFamily")&&(o.fontFamily=a.fontFamily),Ae(a,"fontSize")&&(o.fontSize=a.fontSize),Ae(a,"fontStyle")&&(o.fontStyle=a.fontStyle),Ae(a,"fontWeight")&&(o.fontWeight=a.fontWeight),i={type:"text",style:o,silent:!0},r={};var s=Ae(a,"textPosition");n?r.position=s?a.textPosition:"inside":s&&(r.position=a.textPosition),Ae(a,"textPosition")&&(r.position=a.textPosition),Ae(a,"textOffset")&&(r.offset=a.textOffset),Ae(a,"textRotation")&&(r.rotation=a.textRotation),Ae(a,"textDistance")&&(r.distance=a.textDistance)}return zO(o,e),W(o.rich,(function(e){zO(e,e)})),{textConfig:r,textContent:i}}function zO(e,t){t&&(t.font=t.textFont||t.font,Ae(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),Ae(t,"textAlign")&&(e.align=t.textAlign),Ae(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),Ae(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),Ae(t,"textWidth")&&(e.width=t.textWidth),Ae(t,"textHeight")&&(e.height=t.textHeight),Ae(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),Ae(t,"textPadding")&&(e.padding=t.textPadding),Ae(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),Ae(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),Ae(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),Ae(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),Ae(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),Ae(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),Ae(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function VO(e,t,n){var r=e;r.textPosition=r.textPosition||n.position||"inside",null!=n.offset&&(r.textOffset=n.offset),null!=n.rotation&&(r.textRotation=n.rotation),null!=n.distance&&(r.textDistance=n.distance);var i=r.textPosition.indexOf("inside")>=0,o=e.fill||"#000";BO(r,t);var a=null==r.textFill;return i?a&&(r.textFill=n.insideFill||"#fff",!r.textStroke&&n.insideStroke&&(r.textStroke=n.insideStroke),!r.textStroke&&(r.textStroke=o),null==r.textStrokeWidth&&(r.textStrokeWidth=2)):(a&&(r.textFill=e.fill||n.outsideFill||"#000"),!r.textStroke&&n.outsideStroke&&(r.textStroke=n.outsideStroke)),r.text=t.text,r.rich=t.rich,W(t.rich,(function(e){BO(e,e)})),r}function BO(e,t){t&&(Ae(t,"fill")&&(e.textFill=t.fill),Ae(t,"stroke")&&(e.textStroke=t.fill),Ae(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),Ae(t,"font")&&(e.font=t.font),Ae(t,"fontStyle")&&(e.fontStyle=t.fontStyle),Ae(t,"fontWeight")&&(e.fontWeight=t.fontWeight),Ae(t,"fontSize")&&(e.fontSize=t.fontSize),Ae(t,"fontFamily")&&(e.fontFamily=t.fontFamily),Ae(t,"align")&&(e.textAlign=t.align),Ae(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),Ae(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),Ae(t,"width")&&(e.textWidth=t.width),Ae(t,"height")&&(e.textHeight=t.height),Ae(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),Ae(t,"padding")&&(e.textPadding=t.padding),Ae(t,"borderColor")&&(e.textBorderColor=t.borderColor),Ae(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),Ae(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),Ae(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),Ae(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),Ae(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),Ae(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),Ae(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),Ae(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),Ae(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),Ae(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}function FO(e,t){if("production"!==process.env.NODE_ENV){var n=e+"^_^"+t;OO[n]||(console.warn('[ECharts] DEPRECATED: "'+e+'" has been deprecated. '+t),OO[n]=!0)}}var GO={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},HO=q(GO),UO=X(Ci,(function(e,t){return e[t]=1,e}),{}),WO=Ci.join(", "),jO=["","style","shape","extra"],XO=ta();function YO(e,t,n,r,i){var o=e+"Animation",a=Nc(e,r,i)||{},s=XO(t).userDuring;return a.duration>0&&(a.during=s?K(nR,{el:t,userDuring:s}):null,a.setToFinal=!0,a.scope=e),z(a,n[o]),a}function ZO(e,t,n,r){var i=(r=r||{}).dataIndex,o=r.isInit,a=r.clearStyle,s=n.isAnimationEnabled(),l=XO(e),u=t.style;l.userDuring=t.during;var c={},h={};if(function(e,t,n){for(var r=0;r<HO.length;r++){var i=HO[r],o=GO[i],a=t[i];a&&(n[o[0]]=a[0],n[o[1]]=a[1])}for(r=0;r<Ci.length;r++){var s=Ci[r];null!=t[s]&&(n[s]=t[s])}}(0,t,h),iR("shape",t,h),iR("extra",t,h),!o&&s&&(function(e,t,n){for(var r=t.transition,i=$O(r)?Ci:Go(r||[]),o=0;o<i.length;o++){var a=i[o];if("style"!==a&&"shape"!==a&&"extra"!==a){var s=e[a];"production"!==process.env.NODE_ENV&&JO(a,"el.transition"),n[a]=s}}}(e,t,c),rR("shape",e,t,c),rR("extra",e,t,c),function(e,t,n,r){if(!n)return;var i,o=e.style;if(o){var a=n.transition,s=t.transition;if(a&&!$O(a)){var l=Go(a);!i&&(i=r.style={});for(var u=0;u<l.length;u++){var c=o[f=l[u]];i[f]=c}}else if(e.getAnimationStyleProps&&($O(s)||$O(a)||F(s,"style")>=0)){var h=e.getAnimationStyleProps(),d=h?h.style:null;if(d){!i&&(i=r.style={});var p=q(n);for(u=0;u<p.length;u++){var f;if(d[f=p[u]]){c=o[f];i[f]=c}}}}}}(e,t,u,c)),h.style=u,function(e,t,n){var r=t.style;if(!e.isGroup&&r){if(n){e.useStyle({});for(var i=e.animators,o=0;o<i.length;o++){var a=i[o];"style"===a.targetName&&a.changeTarget(e.style)}}e.setStyle(r)}t&&(t.style=null,t&&e.attr(t),t.style=r)}(e,h,a),function(e,t){Ae(t,"silent")&&(e.silent=t.silent),Ae(t,"ignore")&&(e.ignore=t.ignore),e instanceof ja&&Ae(t,"invisible")&&(e.invisible=t.invisible);e instanceof Ys&&Ae(t,"autoBatch")&&(e.autoBatch=t.autoBatch)}(e,t),s)if(o){var d={};W(jO,(function(e){var n=e?t[e]:t;n&&n.enterFrom&&(e&&(d[e]=d[e]||{}),z(e?d[e]:d,n.enterFrom))}));var p=YO("enter",e,t,n,i);p.duration>0&&e.animateFrom(d,p)}else!function(e,t,n,r,i){if(i){var o=YO("update",e,t,r,n);o.duration>0&&e.animateFrom(i,o)}}(e,t,i||0,n,c);qO(e,t),u?e.dirty():e.markRedraw()}function qO(e,t){for(var n=XO(e).leaveToProps,r=0;r<jO.length;r++){var i=jO[r],o=i?t[i]:t;o&&o.leaveTo&&(n||(n=XO(e).leaveToProps={}),i&&(n[i]=n[i]||{}),z(i?n[i]:n,o.leaveTo))}}function KO(e,t,n,r){if(e){var i=e.parent,o=XO(e).leaveToProps;if(o){var a=YO("update",e,t,n,0);a.done=function(){i.remove(e)},e.animateTo(o,a)}else i.remove(e)}}function $O(e){return"all"===e}var JO,QO={},eR={setTransform:function(e,t){return"production"!==process.env.NODE_ENV&&me(Ae(UO,e),"Only "+WO+" available in `setTransform`."),QO.el[e]=t,this},getTransform:function(e){return"production"!==process.env.NODE_ENV&&me(Ae(UO,e),"Only "+WO+" available in `getTransform`."),QO.el[e]},setShape:function(e,t){"production"!==process.env.NODE_ENV&&tR(e);var n=QO.el;return(n.shape||(n.shape={}))[e]=t,n.dirtyShape&&n.dirtyShape(),this},getShape:function(e){"production"!==process.env.NODE_ENV&&tR(e);var t=QO.el.shape;if(t)return t[e]},setStyle:function(e,t){"production"!==process.env.NODE_ENV&&tR(e);var n=QO.el,r=n.style;return r&&("production"!==process.env.NODE_ENV&&ce(t)&&No("style."+e+" must not be assigned with NaN."),r[e]=t,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(e){"production"!==process.env.NODE_ENV&&tR(e);var t=QO.el.style;if(t)return t[e]},setExtra:function(e,t){return"production"!==process.env.NODE_ENV&&tR(e),(QO.el.extra||(QO.el.extra={}))[e]=t,this},getExtra:function(e){"production"!==process.env.NODE_ENV&&tR(e);var t=QO.el.extra;if(t)return t[e]}};function tR(e){if("production"!==process.env.NODE_ENV&&("transition"===e||"enterFrom"===e||"leaveTo"===e))throw new Error('key must not be "'+e+'"')}function nR(){var e=this,t=e.el;if(t){var n=XO(t).userDuring,r=e.userDuring;n===r?(QO.el=t,r(eR)):e.el=e.userDuring=null}}function rR(e,t,n,r){var i=n[e];if(i){var o,a=t[e];if(a){var s=n.transition,l=i.transition;if(l)if(!o&&(o=r[e]={}),$O(l))z(o,a);else for(var u=Go(l),c=0;c<u.length;c++){var h=a[p=u[c]];o[p]=h}else if($O(s)||F(s,e)>=0){!o&&(o=r[e]={});var d=q(a);for(c=0;c<d.length;c++){var p;h=a[p=d[c]];oR(i[p],h)&&(o[p]=h)}}}}}function iR(e,t,n){var r=t[e];if(r)for(var i=n[e]={},o=q(r),a=0;a<o.length;a++){var s=o[a];i[s]=Fr(r[s])}}function oR(e,t){return U(e)?e!==t:null!=e&&isFinite(e)}"production"!==process.env.NODE_ENV&&(JO=function(e,t){Ae(UO,e)||No("Prop `"+e+"` is not a permitted in `"+t+"`. Only `"+q(UO).join("`, `")+"` are permitted.")});var aR=ta(),sR=["percent","easing","shape","style","extra"];function lR(e){e.stopAnimation("keyframe"),e.attr(aR(e))}function uR(e,t,n){if(n.isAnimationEnabled()&&t)if(J(t))W(t,(function(t){uR(e,t,n)}));else{var r=t.keyframes,i=t.duration;if(n&&null==i){var o=Nc("enter",n,0);i=o&&o.duration}if(r&&i){var a=aR(e);W(jO,(function(n){if(!n||e[n]){var o,s=!1;r.sort((function(e,t){return e.percent-t.percent})),W(r,(function(r){var l=e.animators,u=n?r[n]:r;if("production"!==process.env.NODE_ENV&&r.percent>=1&&(s=!0),u){var c=q(u);if(n||(c=Y(c,(function(e){return F(sR,e)<0}))),c.length){o||((o=e.animate(n,t.loop,!0)).scope="keyframe");for(var h=0;h<l.length;h++)l[h]!==o&&l[h].targetName===o.targetName&&l[h].stopTracks(c);n&&(a[n]=a[n]||{});var d=n?a[n]:a;W(c,(function(t){d[t]=((n?e[n]:e)||{})[t]})),o.whenWithKeys(i*r.percent,u,c,r.easing)}}})),o&&("production"!==process.env.NODE_ENV&&(s||No("End frame with percent: 1 is missing in the keyframeAnimation.",!0)),o.delay(t.delay||0).duration(i).start(t.easing))}}))}}}var cR="emphasis",hR="normal",dR="blur",pR="select",fR=[hR,cR,dR,pR],gR={normal:["itemStyle"],emphasis:[cR,"itemStyle"],blur:[dR,"itemStyle"],select:[pR,"itemStyle"]},mR={normal:["label"],emphasis:[cR,"label"],blur:[dR,"label"],select:[pR,"label"]},vR=["x","y"],yR={normal:{},emphasis:{},blur:{},select:{}},_R={cartesian2d:function(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:K(EO,e)}}},geo:function(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:K(LO,e)}}},single:function(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:K(NO,e)}}},polar:function(e){var t=e.getRadiusAxis(),n=e.getAngleAxis(),r=t.getExtent();return r[0]>r[1]&&r.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:r[1],r0:r[0]},api:{coord:function(r){var i=t.dataToRadius(r[0]),o=n.dataToAngle(r[1]),a=e.coordToPoint([i,o]);return a.push(i,o*Math.PI/180),a},size:K(PO,e)}}},calendar:function(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 xR(e){return e instanceof Ys}function bR(e){return e instanceof ja}var wR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n,r){this._progressiveEls=null;var i=this._data,o=e.getData(),a=this.group,s=DR(e,o,t,n);i||a.removeAll(),o.diff(i).add((function(t){IR(n,null,t,s(t,r),e,a,o)})).remove((function(t){var n=i.getItemGraphicEl(t);n&&KO(n,AO(n).option,e)})).update((function(t,l){var u=i.getItemGraphicEl(l);IR(n,u,t,s(t,r),e,a,o)})).execute();var l=e.get("clip",!0)?lT(e.coordinateSystem,!1,e):null;l?a.setClipPath(l):a.removeClipPath(),this._data=o},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll(),this._data=null},t.prototype.incrementalRender=function(e,t,n,r,i){var o=t.getData(),a=DR(t,o,n,r),s=this._progressiveEls=[];function l(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}for(var u=e.start;u<e.end;u++){var c=IR(null,null,u,a(u,i),t,this.group,o);c&&(c.traverse(l),s.push(c))}},t.prototype.eachRendered=function(e){gh(this._progressiveEls||this.group,e)},t.prototype.filterForExposedEvent=function(e,t,n,r){var i=t.element;if(null==i||n.name===i)return!0;for(;(n=n.__hostTarget||n.parent)&&n!==this.group;)if(n.name===i)return!0;return!1},t.type="custom",t}(em);function SR(e){var t,n=e.type;if("path"===n){var r=e.shape,i=null!=r.width&&null!=r.height?{x:r.x||0,y:r.y||0,width:r.width,height:r.height}:null,o=BR(r);t=qc(o,null,i,r.layout||"center"),AO(t).customPathData=o}else if("image"===n)t=new Js({}),AO(t).customImagePath=e.style.image;else if("text"===n)t=new ll({});else if("group"===n)t=new Yi;else{if("compoundPath"===n)throw new Error('"compoundPath" is not supported yet.');var a=Zc(n);if(!a){var s="";"production"!==process.env.NODE_ENV&&(s='graphic type "'+n+'" can not be found.'),zo(s)}t=new a}return AO(t).customGraphicType=n,t.name=e.name,t.z2EmphasisLift=1,t.z2SelectLift=1,t}function TR(e,t,n,r,i,o,a){lR(t);var s=i&&i.normal.cfg;s&&t.setTextConfig(s),r&&null==r.transition&&(r.transition=vR);var l=r&&r.style;if(l){if("text"===t.type){var u=l;Ae(u,"textFill")&&(u.fill=u.textFill),Ae(u,"textStroke")&&(u.stroke=u.textStroke)}var c=void 0,h=xR(t)?l.decal:null;e&&h&&(h.dirty=!0,c=Bv(h,e)),l.__decalPattern=c}bR(t)&&(l&&(c=l.__decalPattern)&&(l.decal=c));ZO(t,r,o,{dataIndex:n,isInit:a,clearStyle:!0}),uR(t,r.keyframeAnimation,o)}function MR(e,t,n,r,i){var o=t.isGroup?null:t,a=i&&i[e].cfg;if(o){var s=o.ensureState(e);if(!1===r){var l=o.getState(e);l&&(l.style=null)}else s.style=r||null;a&&(s.textConfig=a),Yl(o)}}function CR(e,t,n){var r=n===hR,i=r?t:PR(t,n),o=i?i.z2:null;null!=o&&((r?e:e.ensureState(n)).z2=o||0)}function DR(e,t,n,r){var i=e.get("renderItem"),o=e.coordinateSystem,a={};o&&("production"!==process.env.NODE_ENV&&(me(i,"series.render is required."),me(o.prepareCustoms||_R[o.type],"This coordSys does not support custom series.")),a=o.prepareCustoms?o.prepareCustoms(o):_R[o.type](o));for(var s,l,u=V({getWidth:r.getWidth,getHeight:r.getHeight,getZr:r.getZr,getDevicePixelRatio:r.getDevicePixelRatio,value:function(e,n){return null==n&&(n=s),t.getStore().get(t.getDimensionIndex(e||0),n)},style:function(n,r){"production"!==process.env.NODE_ENV&&FO("api.style","Please write literal style directly instead.");null==r&&(r=s);var i=t.getItemVisual(r,"style"),o=i&&i.fill,a=i&&i.opacity,l=y(r,hR).getItemStyle();null!=o&&(l.fill=o),null!=a&&(l.opacity=a);var u={inheritColor:ee(o)?o:"#000"},c=_(r,hR),h=wh(c,null,u,!1,!0);h.text=c.getShallow("show")?de(e.getFormattedLabel(r,hR),HS(t,r)):null;var d=Sh(c,u,!1);return b(n,l),l=VO(l,h,d),n&&x(l,n),l.legacy=!0,l},ordinalRawValue:function(e,n){null==n&&(n=s),e=e||0;var r=t.getDimensionInfo(e);if(!r){var i=t.getDimensionIndex(e);return i>=0?t.getStore().get(i,n):void 0}var o=t.get(r.name,n),a=r&&r.ordinalMeta;return a?a.categories[o]:o},styleEmphasis:function(n,r){"production"!==process.env.NODE_ENV&&FO("api.styleEmphasis","Please write literal style directly instead.");null==r&&(r=s);var i=y(r,cR).getItemStyle(),o=_(r,cR),a=wh(o,null,null,!0,!0);a.text=o.getShallow("show")?pe(e.getFormattedLabel(r,cR),e.getFormattedLabel(r,hR),HS(t,r)):null;var l=Sh(o,null,!0);return b(n,i),i=VO(i,a,l),n&&x(i,n),i.legacy=!0,i},visual:function(e,n){if(null==n&&(n=s),Ae(CO,e)){var r=t.getItemVisual(n,"style");return r?r[CO[e]]:null}if(Ae(DO,e))return t.getItemVisual(n,e)},barLayout:function(e){if("cartesian2d"===o.type){return function(e){var t=[],n=e.axis,r="axis0";if("category"===n.type){for(var i=n.getBandWidth(),o=0;o<e.count;o++)t.push(V({bandWidth:i,axisKey:r,stackId:cx+o},e));var a=gx(t),s=[];for(o=0;o<e.count;o++){var l=a[r][cx+o];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}}(V({axis:o.getBaseAxis()},e))}},currentSeriesIndices:function(){return n.getCurrentSeriesIndices()},font:function(e){return Ah(e,n)}},a.api||{}),c={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:a.coordSys,dataInsideLength:t.count(),encode:AR(e.getData())},h={},d={},p={},f={},g=0;g<fR.length;g++){var m=fR[g];p[m]=e.getModel(gR[m]),f[m]=e.getModel(mR[m])}function v(e){return e===s?l||(l=t.getItemModel(e)):t.getItemModel(e)}function y(e,n){return t.hasItemOption?e===s?h[n]||(h[n]=v(e).getModel(gR[n])):v(e).getModel(gR[n]):p[n]}function _(e,n){return t.hasItemOption?e===s?d[n]||(d[n]=v(e).getModel(mR[n])):v(e).getModel(mR[n]):f[n]}return function(e,n){return s=e,l=null,h={},d={},i&&i(V({dataIndexInside:e,dataIndex:t.getRawIndex(e),actionType:n?n.type:null},c),u)};function x(e,t){for(var n in t)Ae(t,n)&&(e[n]=t[n])}function b(e,t){e&&(e.textFill&&(t.textFill=e.textFill),e.textPosition&&(t.textPosition=e.textPosition))}}function AR(e){var t={};return W(e.dimensions,(function(n){var r=e.getDimensionInfo(n);if(!r.isExtraCoord){var i=r.coordDim;(t[i]=t[i]||[])[r.coordDimIndex]=e.getDimensionIndex(n)}})),t}function IR(e,t,n,r,i,o,a){if(r){var s=ER(e,t,n,r,i,o);return s&&a.setItemGraphicEl(n,s),s&&cu(s,r.focus,r.blurScope,r.emphasisDisabled),s}o.remove(t)}function ER(e,t,n,r,i,o){"production"!==process.env.NODE_ENV&&me(r,"should not have an null/undefined element setting");var a=-1,s=t;t&&LR(t,r,i)&&(a=F(o.childrenRef(),t),t=null);var l,u,c=!t,h=t;h?h.clearStates():(h=SR(r),s&&(l=s,(u=h).copyTransform(l),bR(u)&&bR(l)&&(u.setStyle(l.style),u.z=l.z,u.z2=l.z2,u.zlevel=l.zlevel,u.invisible=l.invisible,u.ignore=l.ignore,xR(u)&&xR(l)&&u.setShape(l.shape)))),!1===r.morph?h.disableMorphing=!0:h.disableMorphing&&(h.disableMorphing=!1),yR.normal.cfg=yR.normal.conOpt=yR.emphasis.cfg=yR.emphasis.conOpt=yR.blur.cfg=yR.blur.conOpt=yR.select.cfg=yR.select.conOpt=null,yR.isLegacy=!1,function(e,t,n,r,i,o){if(e.isGroup)return;NR(n,null,o),NR(n,cR,o);var a=o.normal.conOpt,s=o.emphasis.conOpt,l=o.blur.conOpt,u=o.select.conOpt;if(null!=a||null!=s||null!=u||null!=l){var c=e.getTextContent();if(!1===a)c&&e.removeTextContent();else{a=o.normal.conOpt=a||{type:"text"},c?c.clearStates():(c=SR(a),e.setTextContent(c)),TR(null,c,t,a,null,r,i);for(var h=a&&a.style,d=0;d<fR.length;d++){var p=fR[d];if(p!==hR){var f=o[p].conOpt;MR(p,c,0,OR(a,f,p),null)}}h?c.dirty():c.markRedraw()}}}(h,n,r,i,c,yR),function(e,t,n,r,i){var o=n.clipPath;if(!1===o)e&&e.getClipPath()&&e.removeClipPath();else if(o){var a=e.getClipPath();a&&LR(a,o,r)&&(a=null),a||(a=SR(o),"production"!==process.env.NODE_ENV&&me(xR(a),"Only any type of `path` can be used in `clipPath`, rather than "+a.type+"."),e.setClipPath(a)),TR(null,a,t,o,null,r,i)}}(h,n,r,i,c),TR(e,h,n,r,yR,i,c),Ae(r,"info")&&(AO(h).info=r.info);for(var d=0;d<fR.length;d++){var p=fR[d];if(p!==hR){var f=PR(r,p);MR(p,h,0,OR(r,f,p),yR)}}return function(e,t,n){if(!e.isGroup){var r=e,i=n.currentZ,o=n.currentZLevel;r.z=i,r.zlevel=o;var a=t.z2;null!=a&&(r.z2=a||0);for(var s=0;s<fR.length;s++)CR(r,t,fR[s])}}(h,r,i),"group"===r.type&&function(e,t,n,r,i){var o=r.children,a=o?o.length:0,s=r.$mergeChildren,l="byName"===s||r.diffChildrenByName,u=!1===s;if(!a&&!l&&!u)return;if(l)return c={api:e,oldChildren:t.children()||[],newChildren:o||[],dataIndex:n,seriesModel:i,group:t},void new h_(c.oldChildren,c.newChildren,kR,kR,c).add(zR).update(zR).remove(VR).execute();var c;u&&t.removeAll();for(var h=0;h<a;h++){var d=o[h],p=t.childAt(h);d?(null==d.ignore&&(d.ignore=!1),ER(e,p,n,d,i,t)):("production"!==process.env.NODE_ENV&&me(p,"renderItem should not return a group containing elements as null/undefined/{} if they do not exist before."),p.ignore=!0)}for(var f=t.childCount()-1;f>=h;f--){var g=t.childAt(f);RR(t,g,i)}}(e,h,n,r,i),a>=0?o.replaceAt(h,a):o.add(h),h}function LR(e,t,n){var r,i=AO(e),o=t.type,a=t.shape,s=t.style;return n.isUniversalTransitionEnabled()||null!=o&&o!==i.customGraphicType||"path"===o&&((r=a)&&(Ae(r,"pathData")||Ae(r,"d")))&&BR(a)!==i.customPathData||"image"===o&&Ae(s,"image")&&s.image!==i.customImagePath}function NR(e,t,n){var r=t?PR(e,t):e,i=t?OR(e,r,cR):e.style,o=e.type,a=r?r.textConfig:null,s=e.textContent,l=s?t?PR(s,t):s:null;if(i&&(n.isLegacy||RO(i,o,!!a,!!l))){n.isLegacy=!0;var u=kO(i,o,!t);!a&&u.textConfig&&(a=u.textConfig),!l&&u.textContent&&(l=u.textContent)}if(!t&&l){var c=l;!c.type&&(c.type="text"),"production"!==process.env.NODE_ENV&&me("text"===c.type,'textContent.type must be "text"')}var h=t?n[t]:n.normal;h.cfg=a,h.conOpt=l}function PR(e,t){return t?e?e[t]:null:e}function OR(e,t,n){var r=t&&t.style;return null==r&&n===cR&&e&&(r=e.styleEmphasis),r}function RR(e,t,n){t&&KO(t,AO(e).option,n)}function kR(e,t){var n=e&&e.name;return null!=n?n:"e\0\0"+t}function zR(e,t){var n=this.context,r=null!=e?n.newChildren[e]:null,i=null!=t?n.oldChildren[t]:null;ER(n.api,i,n.dataIndex,r,n.seriesModel,n.group)}function VR(e){var t=this.context,n=t.oldChildren[e];n&&KO(n,AO(n).option,t.seriesModel)}function BR(e){return e&&(e.pathData||e.d)}var FR=ta(),GR=O,HR=K,UR=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,r){var i=t.get("value"),o=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=n,r||this._lastValue!==i||this._lastStatus!==o){this._lastValue=i,this._lastStatus=o;var a=this._group,s=this._handle;if(!o||"hide"===o)return a&&a.hide(),void(s&&s.hide());a&&a.show(),s&&s.show();var l={};this.makeElOption(l,i,e,t,n);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var c=this._moveAnimation=this.determineAnimation(e,t);if(a){var h=$(WR,t,c);this.updatePointerEl(a,l,h),this.updateLabelEl(a,l,h,t)}else a=this._group=new Yi,this.createPointerEl(a,l,e,t),this.createLabelEl(a,l,e,t),n.getZr().add(a);ZR(a,t,!0),this._renderHandle(i)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get("animation"),r=e.axis,i="category"===r.type,o=t.get("snap");if(!o&&!i)return!1;if("auto"===n||null==n){var a=this.animationThreshold;if(i&&r.getBandWidth()>a)return!0;if(o){var s=JM(e).seriesDataCount,l=r.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},e.prototype.makeElOption=function(e,t,n,r,i){},e.prototype.createPointerEl=function(e,t,n,r){var i=t.pointer;if(i){var o=FR(e).pointerEl=new mh[i.type](GR(t.pointer));e.add(o)}},e.prototype.createLabelEl=function(e,t,n,r){if(t.label){var i=FR(e).labelEl=new ll(GR(t.label));e.add(i),XR(i,r)}},e.prototype.updatePointerEl=function(e,t,n){var r=FR(e).pointerEl;r&&t.pointer&&(r.setStyle(t.pointer.style),n(r,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,r){var i=FR(e).labelEl;i&&(i.setStyle(t.label.style),n(i,{x:t.label.x,y:t.label.y}),XR(i,r))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t,n=this._axisPointerModel,r=this._api.getZr(),i=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a)return i&&r.remove(i),void(this._handle=null);this._handle||(t=!0,i=this._handle=uh(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){bt(e.event)},onmousedown:HR(this._onHandleDragMove,this,0,0),drift:HR(this._onHandleDragMove,this),ondragend:HR(this._onHandleDragEnd,this)}),r.add(i)),ZR(i,n,!1),i.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");J(s)||(s=[s,s]),i.scaleX=s[0]/2,i.scaleY=s[1]/2,cm(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},e.prototype._moveHandleToValue=function(e,t){WR(this._axisPointerModel,!t&&this._moveAnimation,this._handle,YR(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var r=this.updateHandleTransform(YR(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=r,n.stopAnimation(),n.attr(YR(r)),FR(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,r=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),r&&t.remove(r),this._group=null,this._handle=null,this._payloadInfo=null),hm(this,"_doDispatchAxisPointer")},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}},e}();function WR(e,t,n,r){jR(FR(n).lastProp,r)||(FR(n).lastProp=r,t?Oc(n,r,e):(n.stopAnimation(),n.attr(r)))}function jR(e,t){if(re(e)&&re(t)){var n=!0;return W(t,(function(t,r){n=n&&jR(e[r],t)})),!!n}return e===t}function XR(e,t){e[t.get(["label","show"])?"show":"hide"]()}function YR(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function ZR(e,t,n){var r=t.get("z"),i=t.get("zlevel");e&&e.traverse((function(e){"group"!==e.type&&(null!=r&&(e.z=r),null!=i&&(e.zlevel=i),e.silent=n)}))}function qR(e){var t,n=e.get("type"),r=e.getModel(n+"Style");return"line"===n?(t=r.getLineStyle()).fill=null:"shadow"===n&&((t=r.getAreaStyle()).stroke=null),t}function KR(e,t,n,r,i){var o=$R(n.get("value"),t.axis,t.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=Od(a.get("padding")||0),l=a.getFont(),u=Li(o,l),c=i.position,h=u.width+s[1]+s[3],d=u.height+s[0]+s[2],p=i.align;"right"===p&&(c[0]-=h),"center"===p&&(c[0]-=h/2);var f=i.verticalAlign;"bottom"===f&&(c[1]-=d),"middle"===f&&(c[1]-=d/2),function(e,t,n,r){var i=r.getWidth(),o=r.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+n,o)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}(c,h,d,r);var g=a.get("backgroundColor");g&&"auto"!==g||(g=t.get(["axisLine","lineStyle","color"])),e.label={x:c[0],y:c[1],style:wh(a,{text:o,font:l,fill:a.getTextColor(),padding:s,backgroundColor:g}),z2:10}}function $R(e,t,n,r,i){e=t.scale.parse(e);var o=t.scale.getLabel({value:e},{precision:i.precision}),a=i.formatter;if(a){var s={value:Zx(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};W(r,(function(e){var t=n.getSeriesByIndex(e.seriesIndex),r=e.dataIndexInside,i=t&&t.getDataParams(r);i&&s.seriesData.push(i)})),ee(a)?o=a.replace("{value}",o):Q(a)&&(o=a(s))}return o}function JR(e,t,n){var r=[1,0,0,1,0,0];return Lt(r,r,n.rotation),Et(r,r,n.position),rh([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],r)}function QR(e,t,n,r,i,o){var a=WM.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=i.get(["label","margin"]),KR(t,r,i,o,{position:JR(r.axis,e,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}function ek(e,t,n){return{x1:e[n=n||0],y1:e[1-n],x2:t[n],y2:t[1-n]}}function tk(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}}function nk(e,t,n,r,i,o){return{cx:e,cy:t,r0:n,r:r,startAngle:i,endAngle:o,clockwise:!0}}var rk=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.makeElOption=function(e,t,n,r,i){var o=n.axis,a=o.grid,s=r.get("type"),l=ik(a,o).getOtherAxis(o).getGlobalExtent(),u=o.toGlobalCoord(o.dataToCoord(t,!0));if(s&&"none"!==s){var c=qR(r),h=ok[s](o,u,l);h.style=c,e.graphicKey=h.type,e.pointer=h}QR(t,e,OM(a.model,n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=OM(t.axis.grid.model,t,{labelInside:!1});r.labelMargin=n.get(["handle","margin"]);var i=JR(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,o=i.grid,a=i.getGlobalExtent(!0),s=ik(o,i).getOtherAxis(i).getGlobalExtent(),l="x"===i.dim?0:1,u=[e.x,e.y];u[l]+=t[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var c=(s[1]+s[0])/2,h=[c,c];h[l]=u[l];return{x:u[0],y:u[1],rotation:e.rotation,cursorPoint:h,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},t}(UR);function ik(e,t){var n={};return n[t.dim+"AxisIndex"]=t.index,e.getCartesian(n)}var ok={line:function(e,t,n){return{type:"Line",subPixelOptimize:!0,shape:ek([t,n[0]],[t,n[1]],ak(e))}},shadow:function(e,t,n){var r=Math.max(1,e.getBandWidth()),i=n[1]-n[0];return{type:"Rect",shape:tk([t-r/2,n[0]],[r,i],ak(e))}}};function ak(e){return"x"===e.dim?0:1}var sk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},t}(tp),lk=ta(),uk=W;function ck(e,t,n){if(!d.node){var r=t.getZr();lk(r).records||(lk(r).records={}),function(e,t){if(lk(e).initialized)return;function n(n,r){e.on(n,(function(n){var i=function(e){var t={showTip:[],hideTip:[]},n=function(r){var i=t[r.type];i?i.push(r):(r.dispatchAction=n,e.dispatchAction(r))};return{dispatchAction:n,pendings:t}}(t);uk(lk(e).records,(function(e){e&&r(e,n,i.dispatchAction)})),function(e,t){var n,r=e.showTip.length,i=e.hideTip.length;r?n=e.showTip[r-1]:i&&(n=e.hideTip[i-1]);n&&(n.dispatchAction=null,t.dispatchAction(n))}(i.pendings,t)}))}lk(e).initialized=!0,n("click",$(dk,"click")),n("mousemove",$(dk,"mousemove")),n("globalout",hk)}(r,t),(lk(r).records[e]||(lk(r).records[e]={})).handler=n}}function hk(e,t,n){e.handler("leave",null,n)}function dk(e,t,n,r){t.handler(e,n,r)}function pk(e,t){if(!d.node){var n=t.getZr();(lk(n).records||{})[e]&&(lk(n).records[e]=null)}}var fk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){var r=t.getComponent("tooltip"),i=e.get("triggerOn")||r&&r.get("triggerOn")||"mousemove|click";ck("axisPointer",n,(function(e,t,n){"none"!==i&&("leave"===e||i.indexOf(e)>=0)&&n({type:"updateAxisPointer",currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})}))},t.prototype.remove=function(e,t){pk("axisPointer",t)},t.prototype.dispose=function(e,t){pk("axisPointer",t)},t.type="axisPointer",t}(Kg);function gk(e,t){var n,r=[],i=e.seriesIndex;if(null==i||!(n=t.getSeriesByIndex(i)))return{point:[]};var o=n.getData(),a=ea(o,e);if(null==a||a<0||J(a))return{point:[]};var s=o.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)r=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(e.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u).dim,h=u.dim,d="x"===c||"radius"===c?1:0,p=o.mapDimension(h),f=[];f[d]=o.get(p,a),f[1-d]=o.get(o.getCalculationInfo("stackResultDimension"),a),r=l.dataToPoint(f)||[]}else r=l.dataToPoint(o.getValues(j(l.dimensions,(function(e){return o.mapDimension(e)})),a))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),r=[g.x+g.width/2,g.y+g.height/2]}return{point:r,el:s}}var mk=ta();function vk(e,t,n){var r=e.currTrigger,i=[e.x,e.y],o=e,a=e.dispatchAction||K(n.dispatchAction,n),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){wk(i)&&(i=gk({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},t).point);var l=wk(i),u=o.axesInfo,c=s.axesInfo,h="leave"===r||wk(i),d={},p={},f={list:[],map:{}},g={showPointer:$(_k,p),showTooltip:$(xk,f)};W(s.coordSysMap,(function(e,t){var n=l||e.containPoint(i);W(s.coordSysAxesInfo[t],(function(e,t){var r=e.axis,o=function(e,t){for(var n=0;n<(e||[]).length;n++){var r=e[n];if(t.axis.dim===r.axisDim&&t.axis.model.componentIndex===r.axisIndex)return r}}(u,e);if(!h&&n&&(!u||o)){var a=o&&o.value;null!=a||l||(a=r.pointToData(i)),null!=a&&yk(e,a,g,!1,d)}}))}));var m={};return W(c,(function(e,t){var n=e.linkGroup;n&&!p[t]&&W(n.axesInfo,(function(t,r){var i=p[r];if(t!==e&&i){var o=i.value;n.mapper&&(o=e.axis.scale.parse(n.mapper(o,bk(t),bk(e)))),m[e.key]=o}}))})),W(m,(function(e,t){yk(c[t],e,g,!0,d)})),function(e,t,n){var r=n.axesInfo=[];W(t,(function(t,n){var i=t.axisPointerModel.option,o=e[n];o?(!t.useHandle&&(i.status="show"),i.value=o.value,i.seriesDataIndices=(o.payloadBatch||[]).slice()):!t.useHandle&&(i.status="hide"),"show"===i.status&&r.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:i.value})}))}(p,c,d),function(e,t,n,r){if(wk(t)||!e.list.length)return void r({type:"hideTip"});var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}(f,i,e,a),function(e,t,n){var r=n.getZr(),i="axisPointerLastHighlights",o=mk(r)[i]||{},a=mk(r)[i]={};W(e,(function(e,t){var n=e.axisPointerModel.option;"show"===n.status&&e.triggerEmphasis&&W(n.seriesDataIndices,(function(e){var t=e.seriesIndex+" | "+e.dataIndex;a[t]=e}))}));var s=[],l=[];W(o,(function(e,t){!a[t]&&l.push(e)})),W(a,(function(e,t){!o[t]&&s.push(e)})),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}(c,0,n),d}}function yk(e,t,n,r,i){var o=e.axis;if(!o.scale.isBlank()&&o.containData(t))if(e.involveSeries){var a=function(e,t){var n=t.axis,r=n.dim,i=e,o=[],a=Number.MAX_VALUE,s=-1;return W(t.seriesModels,(function(t,l){var u,c,h=t.getData().mapDimensionsAll(r);if(t.getAxisTooltipData){var d=t.getAxisTooltipData(h,e,n);c=d.dataIndices,u=d.nestestValue}else{if(!(c=t.getData().indicesOfNearest(h[0],e,"category"===n.type?.5:null)).length)return;u=t.getData().get(h[0],c[0])}if(null!=u&&isFinite(u)){var p=e-u,f=Math.abs(p);f<=a&&((f<a||p>=0&&s<0)&&(a=f,s=p,i=u,o.length=0),W(c,(function(e){o.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})})))}})),{payloadBatch:o,snapToValue:i}}(t,e),s=a.payloadBatch,l=a.snapToValue;s[0]&&null==i.seriesIndex&&z(i,s[0]),!r&&e.snap&&o.containData(l)&&null!=l&&(t=l),n.showPointer(e,t,s),n.showTooltip(e,a,l)}else n.showPointer(e,t)}function _k(e,t,n,r){e[t.key]={value:n,payloadBatch:r}}function xk(e,t,n,r){var i=n.payloadBatch,o=t.axis,a=o.model,s=t.axisPointerModel;if(t.triggerTooltip&&i.length){var l=t.coordSys.model,u=eC(l),c=e.map[u];c||(c=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(c)),c.dataByAxis.push({axisDim:o.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:r,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function bk(e){var t=e.axis.model,n={},r=n.axisDim=e.axis.dim;return n.axisIndex=n[r+"AxisIndex"]=t.componentIndex,n.axisName=n[r+"AxisName"]=t.name,n.axisId=n[r+"AxisId"]=t.id,n}function wk(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}function Sk(e){nC.registerAxisPointerClass("CartesianAxisPointer",rk),e.registerComponentModel(sk),e.registerComponentView(fk),e.registerPreprocessor((function(e){if(e){(!e.axisPointer||0===e.axisPointer.length)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!J(t)&&(e.axisPointer.link=[t])}})),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,(function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=KM(e,t)})),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},vk)}var Tk=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.makeElOption=function(e,t,n,r,i){var o=n.axis;"angle"===o.dim&&(this.animationThreshold=Math.PI/18);var a=o.polar,s=a.getOtherAxis(o).getExtent(),l=o.dataToCoord(t),u=r.get("type");if(u&&"none"!==u){var c=qR(r),h=Mk[u](o,a,l,s);h.style=c,e.graphicKey=h.type,e.pointer=h}var d=function(e,t,n,r,i){var o=t.axis,a=o.dataToCoord(e),s=r.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,c,h=r.getRadiusAxis().getExtent();if("radius"===o.dim){var d=[1,0,0,1,0,0];Lt(d,d,s),Et(d,d,[r.cx,r.cy]),l=rh([a,-i],d);var p=t.getModel("axisLabel").get("rotate")||0,f=WM.innerTextLayout(s,p*Math.PI/180,-1);u=f.textAlign,c=f.textVerticalAlign}else{var g=h[1];l=r.coordToPoint([g+i,a]);var m=r.cx,v=r.cy;u=Math.abs(l[0]-m)/g<.3?"center":l[0]>m?"left":"right",c=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:c}}(t,n,0,a,r.get(["label","margin"]));KR(e,n,r,i,d)},t}(UR);var Mk={line:function(e,t,n,r){return"angle"===e.dim?{type:"Line",shape:ek(t.coordToPoint([r[0],n]),t.coordToPoint([r[1],n]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r:n}}},shadow:function(e,t,n,r){var i=Math.max(1,e.getBandWidth()),o=Math.PI/180;return"angle"===e.dim?{type:"Sector",shape:nk(t.cx,t.cy,r[0],r[1],(-n-i/2)*o,(i/2-n)*o)}:{type:"Sector",shape:nk(t.cx,t.cy,n-i/2,n+i/2,0,2*Math.PI)}}},Ck=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.findAxisModel=function(e){var t;return this.ecModel.eachComponent(e,(function(e){e.getCoordSysModel()===this&&(t=e)}),this),t},t.type="polar",t.dependencies=["radiusAxis","angleAxis"],t.defaultOption={z:0,center:["50%","50%"],radius:"80%"},t}(tp),Dk=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",oa).models[0]},t.type="polarAxis",t}(tp);H(Dk,Qx);var Ak=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="angleAxis",t}(Dk),Ik=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="radiusAxis",t}(Dk),Ek=function(e){function t(t,n){return e.call(this,"radius",t,n)||this}return l(t,e),t.prototype.pointToData=function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},t}(Ob);Ek.prototype.dataToRadius=Ob.prototype.dataToCoord,Ek.prototype.radiusToData=Ob.prototype.coordToData;var Lk=ta(),Nk=function(e){function t(t,n){return e.call(this,"angle",t,n||[0,360])||this}return l(t,e),t.prototype.pointToData=function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},t.prototype.calculateCategoryInterval=function(){var e=this,t=e.getLabelModel(),n=e.scale,r=n.getExtent(),i=n.count();if(r[1]-r[0]<1)return 0;var o=r[0],a=e.dataToCoord(o+1)-e.dataToCoord(o),s=Math.abs(a),l=Li(null==o?"":o+"",t.getFont(),"center","top"),u=Math.max(l.height,7)/s;isNaN(u)&&(u=1/0);var c=Math.max(0,Math.floor(u)),h=Lk(e.model),d=h.lastAutoInterval,p=h.lastTickCount;return null!=d&&null!=p&&Math.abs(d-c)<=1&&Math.abs(p-i)<=1&&d>c?c=d:(h.lastTickCount=i,h.lastAutoInterval=c),c},t}(Ob);Nk.prototype.dataToAngle=Ob.prototype.dataToCoord,Nk.prototype.angleToData=Ob.prototype.coordToData;var Pk=["radius","angle"],Ok=function(){function e(e){this.dimensions=Pk,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new Ek,this._angleAxis=new Nk,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return e.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},e.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},e.prototype.getAxis=function(e){return this["_"+e+"Axis"]},e.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},e.prototype.getAxesByScale=function(e){var t=[],n=this._angleAxis,r=this._radiusAxis;return n.scale.type===e&&t.push(n),r.scale.type===e&&t.push(r),t},e.prototype.getAngleAxis=function(){return this._angleAxis},e.prototype.getRadiusAxis=function(){return this._radiusAxis},e.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},e.prototype.getTooltipAxes=function(e){var t=null!=e&&"auto"!==e?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},e.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},e.prototype.pointToData=function(e,t){var n=this.pointToCoord(e);return[this._radiusAxis.radiusToData(n[0],t),this._angleAxis.angleToData(n[1],t)]},e.prototype.pointToCoord=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,r=this.getAngleAxis(),i=r.getExtent(),o=Math.min(i[0],i[1]),a=Math.max(i[0],i[1]);r.inverse?o=a-360:a=o+360;var s=Math.sqrt(t*t+n*n);t/=s,n/=s;for(var l=Math.atan2(-n,t)/Math.PI*180,u=l<o?1:-1;l<o||l>a;)l+=360*u;return[s,l]},e.prototype.coordToPoint=function(e){var t=e[0],n=e[1]/180*Math.PI;return[Math.cos(n)*t+this.cx,-Math.sin(n)*t+this.cy]},e.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis().getExtent().slice();t[0]>t[1]&&t.reverse();var n=e.getExtent(),r=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:t[0],r:t[1],startAngle:-n[0]*r,endAngle:-n[1]*r,clockwise:e.inverse,contain:function(e,t){var n=e-this.cx,r=t-this.cy,i=n*n+r*r-1e-4,o=this.r,a=this.r0;return i<=o*o&&i>=a*a}}},e.prototype.convertToPixel=function(e,t,n){return Rk(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return Rk(t)===this?this.pointToData(n):null},e}();function Rk(e){var t=e.seriesModel,n=e.polarModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}function kk(e,t){var n=this,r=n.getAngleAxis(),i=n.getRadiusAxis();if(r.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),e.eachSeries((function(e){if(e.coordinateSystem===n){var t=e.getData();W(Jx(t,"radius"),(function(e){i.scale.unionExtentFromData(t,e)})),W(Jx(t,"angle"),(function(e){r.scale.unionExtentFromData(t,e)}))}})),jx(r.scale,r.model),jx(i.scale,i.model),"category"===r.type&&!r.onBand){var o=r.getExtent(),a=360/r.scale.count();r.inverse?o[1]+=a:o[1]-=a,r.setExtent(o[0],o[1])}}function zk(e,t){var n;if(e.type=t.get("type"),e.scale=Xx(t),e.onBand=t.get("boundaryGap")&&"category"===e.type,e.inverse=t.get("inverse"),function(e){return"angleAxis"===e.mainType}(t)){e.inverse=e.inverse!==t.get("clockwise");var r=t.get("startAngle"),i=null!==(n=t.get("endAngle"))&&void 0!==n?n:r+(e.inverse?-360:360);e.setExtent(r,i)}t.axis=e,e.model=t}var Vk={dimensions:Pk,create:function(e,t){var n=[];return e.eachComponent("polar",(function(e,r){var i=new Ok(r+"");i.update=kk;var o=i.getRadiusAxis(),a=i.getAngleAxis(),s=e.findAxisModel("radiusAxis"),l=e.findAxisModel("angleAxis");zk(o,s),zk(a,l),function(e,t,n){var r=t.get("center"),i=n.getWidth(),o=n.getHeight();e.cx=oo(r[0],i),e.cy=oo(r[1],o);var a=e.getRadiusAxis(),s=Math.min(i,o)/2,l=t.get("radius");null==l?l=[0,"100%"]:J(l)||(l=[0,l]);var u=[oo(l[0],s),oo(l[1],s)];a.inverse?a.setExtent(u[1],u[0]):a.setExtent(u[0],u[1])}(i,e,t),n.push(i),e.coordinateSystem=i,i.model=e})),e.eachSeries((function(e){if("polar"===e.get("coordinateSystem")){var t=e.getReferringComponents("polar",oa).models[0];if("production"!==process.env.NODE_ENV&&!t)throw new Error('Polar "'+he(e.get("polarIndex"),e.get("polarId"),0)+'" not found');e.coordinateSystem=t.coordinateSystem}})),n}},Bk=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function Fk(e,t,n){t[1]>t[0]&&(t=t.slice().reverse());var r=e.coordToPoint([t[0],n]),i=e.coordToPoint([t[1],n]);return{x1:r[0],y1:r[1],x2:i[0],y2:i[1]}}function Gk(e){return e.getRadiusAxis().inverse?0:1}function Hk(e){var t=e[0],n=e[e.length-1];t&&n&&Math.abs(Math.abs(t.coord-n.coord)-360)<1e-4&&e.pop()}var Uk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="PolarAxisPointer",n}return l(t,e),t.prototype.render=function(e,t){if(this.group.removeAll(),e.get("show")){var n=e.axis,r=n.polar,i=r.getRadiusAxis().getExtent(),o=n.getTicksCoords(),a=n.getMinorTicksCoords(),s=j(n.getViewLabels(),(function(e){e=O(e);var t=n.scale,r="ordinal"===t.type?t.getRawOrdinalNumber(e.tickValue):e.tickValue;return e.coord=n.dataToCoord(r),e}));Hk(s),Hk(o),W(Bk,(function(t){!e.get([t,"show"])||n.scale.isBlank()&&"axisLine"!==t||Wk[t](this.group,e,r,o,a,i,s)}),this)}},t.type="angleAxis",t}(nC),Wk={axisLine:function(e,t,n,r,i,o){var a,s=t.getModel(["axisLine","lineStyle"]),l=n.getAngleAxis(),u=Math.PI/180,c=l.getExtent(),h=Gk(n),d=h?0:1,p=360===Math.abs(c[1]-c[0])?"Circle":"Arc";(a=0===o[d]?new mh[p]({shape:{cx:n.cx,cy:n.cy,r:o[h],startAngle:-c[0]*u,endAngle:-c[1]*u,clockwise:l.inverse},style:s.getLineStyle(),z2:1,silent:!0}):new oc({shape:{cx:n.cx,cy:n.cy,r:o[h],r0:o[d]},style:s.getLineStyle(),z2:1,silent:!0})).style.fill=null,e.add(a)},axisTick:function(e,t,n,r,i,o){var a=t.getModel("axisTick"),s=(a.get("inside")?-1:1)*a.get("length"),l=o[Gk(n)],u=j(r,(function(e){return new pc({shape:Fk(n,[l,l+s],e.coord)})}));e.add(Jc(u,{style:V(a.getModel("lineStyle").getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])})}))},minorTick:function(e,t,n,r,i,o){if(i.length){for(var a=t.getModel("axisTick"),s=t.getModel("minorTick"),l=(a.get("inside")?-1:1)*s.get("length"),u=o[Gk(n)],c=[],h=0;h<i.length;h++)for(var d=0;d<i[h].length;d++)c.push(new pc({shape:Fk(n,[u,u+l],i[h][d].coord)}));e.add(Jc(c,{style:V(s.getModel("lineStyle").getLineStyle(),V(a.getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])}))}))}},axisLabel:function(e,t,n,r,i,o,a){var s=t.getCategories(!0),l=t.getModel("axisLabel"),u=l.get("margin"),c=t.get("triggerEvent");W(a,(function(r,i){var a=l,h=r.tickValue,d=o[Gk(n)],p=n.coordToPoint([d+u,r.coord]),f=n.cx,g=n.cy,m=Math.abs(p[0]-f)/d<.3?"center":p[0]>f?"left":"right",v=Math.abs(p[1]-g)/d<.3?"middle":p[1]>g?"top":"bottom";if(s&&s[h]){var y=s[h];re(y)&&y.textStyle&&(a=new Wh(y.textStyle,l,l.ecModel))}var _=new ll({silent:WM.isLabelSilent(t),style:wh(a,{x:p[0],y:p[1],fill:a.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:r.formattedLabel,align:m,verticalAlign:v})});if(e.add(_),c){var x=WM.makeAxisEventDataBase(t);x.targetType="axisLabel",x.value=r.rawLabel,bl(_).eventData=x}}),this)},splitLine:function(e,t,n,r,i,o){var a=t.getModel("splitLine").getModel("lineStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=0;c<r.length;c++){var h=l++%s.length;u[h]=u[h]||[],u[h].push(new pc({shape:Fk(n,o,r[c].coord)}))}for(c=0;c<u.length;c++)e.add(Jc(u[c],{style:V({stroke:s[c%s.length]},a.getLineStyle()),silent:!0,z:t.get("z")}))},minorSplitLine:function(e,t,n,r,i,o){if(i.length){for(var a=t.getModel("minorSplitLine").getModel("lineStyle"),s=[],l=0;l<i.length;l++)for(var u=0;u<i[l].length;u++)s.push(new pc({shape:Fk(n,o,i[l][u].coord)}));e.add(Jc(s,{style:a.getLineStyle(),silent:!0,z:t.get("z")}))}},splitArea:function(e,t,n,r,i,o){if(r.length){var a=t.getModel("splitArea").getModel("areaStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=Math.PI/180,h=-r[0].coord*c,d=Math.min(o[0],o[1]),p=Math.max(o[0],o[1]),f=t.get("clockwise"),g=1,m=r.length;g<=m;g++){var v=g===m?r[0].coord:r[g].coord,y=l++%s.length;u[y]=u[y]||[],u[y].push(new rc({shape:{cx:n.cx,cy:n.cy,r0:d,r:p,startAngle:h,endAngle:-v*c,clockwise:f},silent:!0})),h=-v*c}for(g=0;g<u.length;g++)e.add(Jc(u[g],{style:V({fill:s[g%s.length]},a.getAreaStyle()),silent:!0}))}}},jk=["axisLine","axisTickLabel","axisName"],Xk=["splitLine","splitArea","minorSplitLine"],Yk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="PolarAxisPointer",n}return l(t,e),t.prototype.render=function(e,t){if(this.group.removeAll(),e.get("show")){var n=this._axisGroup,r=this._axisGroup=new Yi;this.group.add(r);var i=e.axis,o=i.polar,a=o.getAngleAxis(),s=i.getTicksCoords(),l=i.getMinorTicksCoords(),u=a.getExtent()[0],c=i.getExtent(),h=function(e,t,n){return{position:[e.cx,e.cy],rotation:n/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:t.getModel("axisLabel").get("rotate"),z2:1}}(o,e,u),d=new WM(e,h);W(jk,d.add,d),r.add(d.getGroup()),ah(n,r,e),W(Xk,(function(t){e.get([t,"show"])&&!i.scale.isBlank()&&Zk[t](this.group,e,o,u,c,s,l)}),this)}},t.type="radiusAxis",t}(nC),Zk={splitLine:function(e,t,n,r,i,o){var a=t.getModel("splitLine").getModel("lineStyle"),s=a.get("color"),l=0,u=n.getAngleAxis(),c=Math.PI/180,h=u.getExtent(),d=360===Math.abs(h[1]-h[0])?"Circle":"Arc";s=s instanceof Array?s:[s];for(var p=[],f=0;f<o.length;f++){var g=l++%s.length;p[g]=p[g]||[],p[g].push(new mh[d]({shape:{cx:n.cx,cy:n.cy,r:Math.max(o[f].coord,0),startAngle:-h[0]*c,endAngle:-h[1]*c,clockwise:u.inverse}}))}for(f=0;f<p.length;f++)e.add(Jc(p[f],{style:V({stroke:s[f%s.length],fill:null},a.getLineStyle()),silent:!0}))},minorSplitLine:function(e,t,n,r,i,o,a){if(a.length){for(var s=t.getModel("minorSplitLine").getModel("lineStyle"),l=[],u=0;u<a.length;u++)for(var c=0;c<a[u].length;c++)l.push(new Fu({shape:{cx:n.cx,cy:n.cy,r:a[u][c].coord}}));e.add(Jc(l,{style:V({fill:null},s.getLineStyle()),silent:!0}))}},splitArea:function(e,t,n,r,i,o){if(o.length){var a=t.getModel("splitArea").getModel("areaStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=o[0].coord,h=1;h<o.length;h++){var d=l++%s.length;u[d]=u[d]||[],u[d].push(new rc({shape:{cx:n.cx,cy:n.cy,r0:c,r:o[h].coord,startAngle:0,endAngle:2*Math.PI},silent:!0})),c=o[h].coord}for(h=0;h<u.length;h++)e.add(Jc(u[h],{style:V({fill:s[h%s.length]},a.getAreaStyle()),silent:!0}))}}};function qk(e){return e.get("stack")||"__ec_stack_"+e.seriesIndex}function Kk(e,t){return t.dim+e.model.componentIndex}function $k(e,t,n){var r={},i=function(e){var t={};W(e,(function(e,n){var r=e.getData(),i=e.coordinateSystem,o=i.getBaseAxis(),a=Kk(i,o),s=o.getExtent(),l="category"===o.type?o.getBandWidth():Math.abs(s[1]-s[0])/r.count(),u=t[a]||{bandWidth:l,remainedWidth:l,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},c=u.stacks;t[a]=u;var h=qk(e);c[h]||u.autoWidthCount++,c[h]=c[h]||{width:0,maxWidth:0};var d=oo(e.get("barWidth"),l),p=oo(e.get("barMaxWidth"),l),f=e.get("barGap"),g=e.get("barCategoryGap");d&&!c[h].width&&(d=Math.min(u.remainedWidth,d),c[h].width=d,u.remainedWidth-=d),p&&(c[h].maxWidth=p),null!=f&&(u.gap=f),null!=g&&(u.categoryGap=g)}));var n={};return W(t,(function(e,t){n[t]={};var r=e.stacks,i=e.bandWidth,o=oo(e.categoryGap,i),a=oo(e.gap,1),s=e.remainedWidth,l=e.autoWidthCount,u=(s-o)/(l+(l-1)*a);u=Math.max(u,0),W(r,(function(e,t){var n=e.maxWidth;n&&n<u&&(n=Math.min(n,s),e.width&&(n=Math.min(n,e.width)),s-=n,e.width=n,l--)})),u=(s-o)/(l+(l-1)*a),u=Math.max(u,0);var c,h=0;W(r,(function(e,t){e.width||(e.width=u),c=e,h+=e.width*(1+a)})),c&&(h-=c.width*a);var d=-h/2;W(r,(function(e,r){n[t][r]=n[t][r]||{offset:d,width:e.width},d+=e.width*(1+a)}))})),n}(Y(t.getSeriesByType(e),(function(e){return!t.isSeriesFiltered(e)&&e.coordinateSystem&&"polar"===e.coordinateSystem.type})));t.eachSeriesByType(e,(function(e){if("polar"===e.coordinateSystem.type){var t=e.getData(),n=e.coordinateSystem,o=n.getBaseAxis(),a=Kk(n,o),s=qk(e),l=i[a][s],u=l.offset,c=l.width,h=n.getOtherAxis(o),d=e.coordinateSystem.cx,p=e.coordinateSystem.cy,f=e.get("barMinHeight")||0,g=e.get("barMinAngle")||0;r[s]=r[s]||[];for(var m=t.mapDimension(h.dim),v=t.mapDimension(o.dim),y=U_(t,m),_="radius"!==o.dim||!e.get("roundCap",!0),x=h.model.get("startValue"),b=h.dataToCoord(x||0),w=0,S=t.count();w<S;w++){var T=t.get(m,w),M=t.get(v,w),C=T>=0?"p":"n",D=b;y&&(r[s][M]||(r[s][M]={p:b,n:b}),D=r[s][M][C]);var A=void 0,I=void 0,E=void 0,L=void 0;if("radius"===h.dim){var N=h.dataToCoord(T)-b,P=o.dataToCoord(M);Math.abs(N)<f&&(N=(N<0?-1:1)*f),A=D,I=D+N,L=(E=P-u)-c,y&&(r[s][M][C]=I)}else{var O=h.dataToCoord(T,_)-b,R=o.dataToCoord(M);Math.abs(O)<g&&(O=(O<0?-1:1)*g),I=(A=R+u)+c,E=D,L=D+O,y&&(r[s][M][C]=L)}t.setItemLayout(w,{cx:d,cy:p,r0:A,r:I,startAngle:-E*Math.PI/180,endAngle:-L*Math.PI/180,clockwise:E>=L})}}}))}var Jk={startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:0}},Qk={splitNumber:5},ez=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="polar",t}(Kg);function tz(e,t){t=t||{};var n=e.coordinateSystem,r=e.axis,i={},o=r.position,a=r.orient,s=n.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};i.position=["vertical"===a?u.vertical[o]:l[0],"horizontal"===a?u.horizontal[o]:l[3]];i.rotation=Math.PI/2*{horizontal:0,vertical:1}[a];i.labelDirection=i.tickDirection=i.nameDirection={top:-1,bottom:1,right:1,left:-1}[o],e.get(["axisTick","inside"])&&(i.tickDirection=-i.tickDirection),he(t.labelInside,e.get(["axisLabel","inside"]))&&(i.labelDirection=-i.labelDirection);var c=t.rotate;return null==c&&(c=e.get(["axisLabel","rotate"])),i.labelRotation="top"===o?-c:c,i.z2=1,i}var nz=["axisLine","axisTickLabel","axisName"],rz=["splitArea","splitLine"],iz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="SingleAxisPointer",n}return l(t,e),t.prototype.render=function(t,n,r,i){var o=this.group;o.removeAll();var a=this._axisGroup;this._axisGroup=new Yi;var s=tz(t),l=new WM(t,s);W(nz,l.add,l),o.add(this._axisGroup),o.add(l.getGroup()),W(rz,(function(e){t.get([e,"show"])&&oz[e](this,this.group,this._axisGroup,t)}),this),ah(a,this._axisGroup,t),e.prototype.render.call(this,t,n,r,i)},t.prototype.remove=function(){oC(this)},t.type="singleAxis",t}(nC),oz={splitLine:function(e,t,n,r){var i=r.axis;if(!i.scale.isBlank()){var o=r.getModel("splitLine"),a=o.getModel("lineStyle"),s=a.get("color");s=s instanceof Array?s:[s];for(var l=a.get("width"),u=r.coordinateSystem.getRect(),c=i.isHorizontal(),h=[],d=0,p=i.getTicksCoords({tickModel:o}),f=[],g=[],m=0;m<p.length;++m){var v=i.toGlobalCoord(p[m].coord);c?(f[0]=v,f[1]=u.y,g[0]=v,g[1]=u.y+u.height):(f[0]=u.x,f[1]=v,g[0]=u.x+u.width,g[1]=v);var y=new pc({shape:{x1:f[0],y1:f[1],x2:g[0],y2:g[1]},silent:!0});eh(y.shape,l);var _=d++%s.length;h[_]=h[_]||[],h[_].push(y)}var x=a.getLineStyle(["color"]);for(m=0;m<h.length;++m)t.add(Jc(h[m],{style:V({stroke:s[m%s.length]},x),silent:!0}))}},splitArea:function(e,t,n,r){iC(e,n,r,r)}},az=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.getCoordSysModel=function(){return this},t.type="singleAxis",t.layoutMode="box",t.defaultOption={left:"5%",top:"5%",right:"5%",bottom:"5%",type:"value",position:"bottom",orient:"horizontal",axisLine:{show:!0,lineStyle:{width:1,type:"solid"}},tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:1}},axisLabel:{show:!0,interval:"auto"},splitLine:{show:!0,lineStyle:{type:"dashed",opacity:.2}}},t}(tp);H(az,Qx.prototype);var sz=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r)||this;return a.type=i||"value",a.position=o||"bottom",a}return l(t,e),t.prototype.isHorizontal=function(){var e=this.position;return"top"===e||"bottom"===e},t.prototype.pointToData=function(e,t){return this.coordinateSystem.pointToData(e)[0]},t}(Ob),lz=["single"],uz=function(){function e(e,t,n){this.type="single",this.dimension="single",this.dimensions=lz,this.axisPointerEnabled=!0,this.model=e,this._init(e,t,n)}return e.prototype._init=function(e,t,n){var r=this.dimension,i=new sz(r,Xx(e),[0,0],e.get("type"),e.get("position")),o="category"===i.type;i.onBand=o&&e.get("boundaryGap"),i.inverse=e.get("inverse"),i.orient=e.get("orient"),e.axis=i,i.model=e,i.coordinateSystem=this,this._axis=i},e.prototype.update=function(e,t){e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();W(t.mapDimensionsAll(this.dimension),(function(e){this._axis.scale.unionExtentFromData(t,e)}),this),jx(this._axis.scale,this._axis.model)}}),this)},e.prototype.resize=function(e,t){this._rect=Zd({left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")},{width:t.getWidth(),height:t.getHeight()}),this._adjustAxis()},e.prototype.getRect=function(){return this._rect},e.prototype._adjustAxis=function(){var e=this._rect,t=this._axis,n=t.isHorizontal(),r=n?[0,e.width]:[0,e.height],i=t.inverse?1:0;t.setExtent(r[i],r[1-i]),this._updateAxisTransform(t,n?e.x:e.y)},e.prototype._updateAxisTransform=function(e,t){var n=e.getExtent(),r=n[0]+n[1],i=e.isHorizontal();e.toGlobalCoord=i?function(e){return e+t}:function(e){return r-e+t},e.toLocalCoord=i?function(e){return e-t}:function(e){return r-e+t}},e.prototype.getAxis=function(){return this._axis},e.prototype.getBaseAxis=function(){return this._axis},e.prototype.getAxes=function(){return[this._axis]},e.prototype.getTooltipAxes=function(){return{baseAxes:[this.getAxis()],otherAxes:[]}},e.prototype.containPoint=function(e){var t=this.getRect(),n=this.getAxis();return"horizontal"===n.orient?n.contain(n.toLocalCoord(e[0]))&&e[1]>=t.y&&e[1]<=t.y+t.height:n.contain(n.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},e.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e["horizontal"===t.orient?0:1]))]},e.prototype.dataToPoint=function(e){var t=this.getAxis(),n=this.getRect(),r=[],i="horizontal"===t.orient?0:1;return e instanceof Array&&(e=e[0]),r[i]=t.toGlobalCoord(t.dataToCoord(+e)),r[1-i]=0===i?n.y+n.height/2:n.x+n.width/2,r},e.prototype.convertToPixel=function(e,t,n){return cz(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return cz(t)===this?this.pointToData(n):null},e}();function cz(e){var t=e.seriesModel,n=e.singleAxisModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}var hz={create:function(e,t){var n=[];return e.eachComponent("singleAxis",(function(r,i){var o=new uz(r,e,t);o.name="single_"+i,o.resize(r,t),r.coordinateSystem=o,n.push(o)})),e.eachSeries((function(e){if("singleAxis"===e.get("coordinateSystem")){var t=e.getReferringComponents("singleAxis",oa).models[0];e.coordinateSystem=t&&t.coordinateSystem}})),n},dimensions:lz},dz=["x","y"],pz=["width","height"],fz=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.makeElOption=function(e,t,n,r,i){var o=n.axis,a=o.coordinateSystem,s=vz(a,1-mz(o)),l=a.dataToPoint(t)[0],u=r.get("type");if(u&&"none"!==u){var c=qR(r),h=gz[u](o,l,s);h.style=c,e.graphicKey=h.type,e.pointer=h}QR(t,e,tz(n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=tz(t,{labelInside:!1});r.labelMargin=n.get(["handle","margin"]);var i=JR(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,o=i.coordinateSystem,a=mz(i),s=vz(o,a),l=[e.x,e.y];l[a]+=t[a],l[a]=Math.min(s[1],l[a]),l[a]=Math.max(s[0],l[a]);var u=vz(o,1-a),c=(u[1]+u[0])/2,h=[c,c];return h[a]=l[a],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:h,tooltipOption:{verticalAlign:"middle"}}},t}(UR),gz={line:function(e,t,n){return{type:"Line",subPixelOptimize:!0,shape:ek([t,n[0]],[t,n[1]],mz(e))}},shadow:function(e,t,n){var r=e.getBandWidth(),i=n[1]-n[0];return{type:"Rect",shape:tk([t-r/2,n[0]],[r,i],mz(e))}}};function mz(e){return e.isHorizontal()?0:1}function vz(e,t){var n=e.getRect();return[n[dz[t]],n[dz[t]]+n[pz[t]]]}var yz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="single",t}(Kg);var _z=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(t,n,r){var i=Jd(t);e.prototype.init.apply(this,arguments),xz(t,i)},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),xz(this.option,t)},t.prototype.getCellSize=function(){return this.option.cellSize},t.type="calendar",t.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},t}(tp);function xz(e,t){var n,r=e.cellSize;1===(n=J(r)?r:e.cellSize=[r,r]).length&&(n[1]=n[0]);var i=j([0,1],(function(e){return function(e,t){return null!=e[jd[t][0]]||null!=e[jd[t][1]]&&null!=e[jd[t][2]]}(t,e)&&(n[e]="auto"),null!=n[e]&&"auto"!==n[e]}));$d(e,t,{type:"box",ignoreSize:i})}var bz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){var r=this.group;r.removeAll();var i=e.coordinateSystem,o=i.getRangeInfo(),a=i.getOrient(),s=t.getLocaleModel();this._renderDayRect(e,o,r),this._renderLines(e,o,a,r),this._renderYearText(e,o,a,r),this._renderMonthText(e,s,a,r),this._renderWeekText(e,s,o,a,r)},t.prototype._renderDayRect=function(e,t,n){for(var r=e.coordinateSystem,i=e.getModel("itemStyle").getItemStyle(),o=r.getCellWidth(),a=r.getCellHeight(),s=t.start.time;s<=t.end.time;s=r.getNextNDay(s,1).time){var l=r.dataToRect([s],!1).tl,u=new ol({shape:{x:l[0],y:l[1],width:o,height:a},cursor:"default",style:i});n.add(u)}},t.prototype._renderLines=function(e,t,n,r){var i=this,o=e.coordinateSystem,a=e.getModel(["splitLine","lineStyle"]).getLineStyle(),s=e.get(["splitLine","show"]),l=a.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=t.start,c=0;u.time<=t.end.time;c++){d(u.formatedDate),0===c&&(u=o.getDateInfo(t.start.y+"-"+t.start.m));var h=u.date;h.setMonth(h.getMonth()+1),u=o.getDateInfo(h)}function d(t){i._firstDayOfMonth.push(o.getDateInfo(t)),i._firstDayPoints.push(o.dataToRect([t],!1).tl);var l=i._getLinePointsOfOneWeek(e,t,n);i._tlpoints.push(l[0]),i._blpoints.push(l[l.length-1]),s&&i._drawSplitline(l,a,r)}d(o.getNextNDay(t.end.time,1).formatedDate),s&&this._drawSplitline(i._getEdgesPoints(i._tlpoints,l,n),a,r),s&&this._drawSplitline(i._getEdgesPoints(i._blpoints,l,n),a,r)},t.prototype._getEdgesPoints=function(e,t,n){var r=[e[0].slice(),e[e.length-1].slice()],i="horizontal"===n?0:1;return r[0][i]=r[0][i]-t/2,r[1][i]=r[1][i]+t/2,r},t.prototype._drawSplitline=function(e,t,n){var r=new cc({z2:20,shape:{points:e},style:t});n.add(r)},t.prototype._getLinePointsOfOneWeek=function(e,t,n){for(var r=e.coordinateSystem,i=r.getDateInfo(t),o=[],a=0;a<7;a++){var s=r.getNextNDay(i.time,a),l=r.dataToRect([s.time],!1);o[2*s.day]=l.tl,o[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return o},t.prototype._formatterLabel=function(e,t){return ee(e)&&e?(n=e,W(t,(function(e,t){n=n.replace("{"+t+"}",e)})),n):Q(e)?e(t):t.nameMap;var n},t.prototype._yearTextPositionControl=function(e,t,n,r,i){var o=t[0],a=t[1],s=["center","bottom"];"bottom"===r?(a+=i,s=["center","top"]):"left"===r?o-=i:"right"===r?(o+=i,s=["center","top"]):a-=i;var l=0;return"left"!==r&&"right"!==r||(l=Math.PI/2),{rotation:l,x:o,y:a,style:{align:s[0],verticalAlign:s[1]}}},t.prototype._renderYearText=function(e,t,n,r){var i=e.getModel("yearLabel");if(i.get("show")){var o=i.get("margin"),a=i.get("position");a||(a="horizontal"!==n?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,c="horizontal"===n?0:1,h={top:[l,s[c][1]],bottom:[l,s[1-c][1]],left:[s[1-c][0],u],right:[s[c][0],u]},d=t.start.y;+t.end.y>+t.start.y&&(d=d+"-"+t.end.y);var p=i.get("formatter"),f={start:t.start.y,end:t.end.y,nameMap:d},g=this._formatterLabel(p,f),m=new ll({z2:30,style:wh(i,{text:g})});m.attr(this._yearTextPositionControl(m,h[a],n,a,o)),r.add(m)}},t.prototype._monthTextPositionControl=function(e,t,n,r,i){var o="left",a="top",s=e[0],l=e[1];return"horizontal"===n?(l+=i,t&&(o="center"),"start"===r&&(a="bottom")):(s+=i,t&&(a="middle"),"start"===r&&(o="right")),{x:s,y:l,align:o,verticalAlign:a}},t.prototype._renderMonthText=function(e,t,n,r){var i=e.getModel("monthLabel");if(i.get("show")){var o=i.get("nameMap"),a=i.get("margin"),s=i.get("position"),l=i.get("align"),u=[this._tlpoints,this._blpoints];o&&!ee(o)||(o&&(t=td(o)||t),o=t.get(["time","monthAbbr"])||[]);var c="start"===s?0:1,h="horizontal"===n?0:1;a="start"===s?-a:a;for(var d="center"===l,p=0;p<u[c].length-1;p++){var f=u[c][p].slice(),g=this._firstDayOfMonth[p];if(d){var m=this._firstDayPoints[p];f[h]=(m[h]+u[0][p+1][h])/2}var v=i.get("formatter"),y=o[+g.m-1],_={yyyy:g.y,yy:(g.y+"").slice(2),MM:g.m,M:+g.m,nameMap:y},x=this._formatterLabel(v,_),b=new ll({z2:30,style:z(wh(i,{text:x}),this._monthTextPositionControl(f,d,n,s,a))});r.add(b)}}},t.prototype._weekTextPositionControl=function(e,t,n,r,i){var o="center",a="middle",s=e[0],l=e[1],u="start"===n;return"horizontal"===t?(s=s+r+(u?1:-1)*i[0]/2,o=u?"right":"left"):(l=l+r+(u?1:-1)*i[1]/2,a=u?"bottom":"top"),{x:s,y:l,align:o,verticalAlign:a}},t.prototype._renderWeekText=function(e,t,n,r,i){var o=e.getModel("dayLabel");if(o.get("show")){var a=e.coordinateSystem,s=o.get("position"),l=o.get("nameMap"),u=o.get("margin"),c=a.getFirstDayOfWeek();if(!l||ee(l))l&&(t=td(l)||t),l=t.get(["time","dayOfWeekShort"])||j(t.get(["time","dayOfWeekAbbr"]),(function(e){return e[0]}));var h=a.getNextNDay(n.end.time,7-n.lweek).time,d=[a.getCellWidth(),a.getCellHeight()];u=oo(u,Math.min(d[1],d[0])),"start"===s&&(h=a.getNextNDay(n.start.time,-(7+n.fweek)).time,u=-u);for(var p=0;p<7;p++){var f,g=a.getNextNDay(h,p),m=a.dataToRect([g.time],!1).center;f=Math.abs((p+c)%7);var v=new ll({z2:30,style:z(wh(o,{text:l[f]}),this._weekTextPositionControl(m,r,s,u,d))});i.add(v)}}},t.type="calendar",t}(Kg),wz=864e5,Sz=function(){function e(t,n,r){this.type="calendar",this.dimensions=e.dimensions,this.getDimensionsInfo=e.getDimensionsInfo,this._model=t}return e.getDimensionsInfo=function(){return[{name:"time",type:"time"},"value"]},e.prototype.getRangeInfo=function(){return this._rangeInfo},e.prototype.getModel=function(){return this._model},e.prototype.getRect=function(){return this._rect},e.prototype.getCellWidth=function(){return this._sw},e.prototype.getCellHeight=function(){return this._sh},e.prototype.getOrient=function(){return this._orient},e.prototype.getFirstDayOfWeek=function(){return this._firstDayOfWeek},e.prototype.getDateInfo=function(e){var t=(e=yo(e)).getFullYear(),n=e.getMonth()+1,r=n<10?"0"+n:""+n,i=e.getDate(),o=i<10?"0"+i:""+i,a=e.getDay();return{y:t+"",m:r,d:o,day:a=Math.abs((a+7-this.getFirstDayOfWeek())%7),time:e.getTime(),formatedDate:t+"-"+r+"-"+o,date:e}},e.prototype.getNextNDay=function(e,t){return 0===(t=t||0)||(e=new Date(this.getDateInfo(e).time)).setDate(e.getDate()+t),this.getDateInfo(e)},e.prototype.update=function(e,t){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var n=this._rangeInfo.weeks||1,r=["width","height"],i=this._model.getCellSize().slice(),o=this._model.getBoxLayoutParams(),a="horizontal"===this._orient?[n,7]:[7,n];W([0,1],(function(e){u(i,e)&&(o[r[e]]=i[e]*a[e])}));var s={width:t.getWidth(),height:t.getHeight()},l=this._rect=Zd(o,s);function u(e,t){return null!=e[t]&&"auto"!==e[t]}W([0,1],(function(e){u(i,e)||(i[e]=l[r[e]]/a[e])})),this._sw=i[0],this._sh=i[1]},e.prototype.dataToPoint=function(e,t){J(e)&&(e=e[0]),null==t&&(t=!0);var n=this.getDateInfo(e),r=this._rangeInfo,i=n.formatedDate;if(t&&!(n.time>=r.start.time&&n.time<r.end.time+wz))return[NaN,NaN];var o=n.day,a=this._getRangeInfo([r.start.time,i]).nthWeek;return"vertical"===this._orient?[this._rect.x+o*this._sw+this._sw/2,this._rect.y+a*this._sh+this._sh/2]:[this._rect.x+a*this._sw+this._sw/2,this._rect.y+o*this._sh+this._sh/2]},e.prototype.pointToData=function(e){var t=this.pointToDate(e);return t&&t.time},e.prototype.dataToRect=function(e,t){var n=this.dataToPoint(e,t);return{contentShape:{x:n[0]-(this._sw-this._lineWidth)/2,y:n[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:n,tl:[n[0]-this._sw/2,n[1]-this._sh/2],tr:[n[0]+this._sw/2,n[1]-this._sh/2],br:[n[0]+this._sw/2,n[1]+this._sh/2],bl:[n[0]-this._sw/2,n[1]+this._sh/2]}},e.prototype.pointToDate=function(e){var t=Math.floor((e[0]-this._rect.x)/this._sw)+1,n=Math.floor((e[1]-this._rect.y)/this._sh)+1,r=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(n,t-1,r):this._getDateByWeeksAndDay(t,n-1,r)},e.prototype.convertToPixel=function(e,t,n){var r=Tz(t);return r===this?r.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){var r=Tz(t);return r===this?r.pointToData(n):null},e.prototype.containPoint=function(e){return console.warn("Not implemented."),!1},e.prototype._initRangeOption=function(){var e,t=this._model.get("range");if(J(t)&&1===t.length&&(t=t[0]),J(t))e=t;else{var n=t.toString();if(/^\d{4}$/.test(n)&&(e=[n+"-01-01",n+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(n)){var r=this.getDateInfo(n),i=r.date;i.setMonth(i.getMonth()+1);var o=this.getNextNDay(i,-1);e=[r.formatedDate,o.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(n)&&(e=[n,n])}if(!e)return"production"!==process.env.NODE_ENV&&P("Invalid date range."),t;var a=this._getRangeInfo(e);return a.start.time>a.end.time&&e.reverse(),e},e.prototype._getRangeInfo=function(e){var t,n=[this.getDateInfo(e[0]),this.getDateInfo(e[1])];n[0].time>n[1].time&&(t=!0,n.reverse());var r=Math.floor(n[1].time/wz)-Math.floor(n[0].time/wz)+1,i=new Date(n[0].time),o=i.getDate(),a=n[1].date.getDate();i.setDate(o+r-1);var s=i.getDate();if(s!==a)for(var l=i.getTime()-n[1].time>0?1:-1;(s=i.getDate())!==a&&(i.getTime()-n[1].time)*l>0;)r-=l,i.setDate(s-l);var u=Math.floor((r+n[0].day+6)/7),c=t?1-u:u-1;return t&&n.reverse(),{range:[n[0].formatedDate,n[1].formatedDate],start:n[0],end:n[1],allDay:r,weeks:u,nthWeek:c,fweek:n[0].day,lweek:n[1].day}},e.prototype._getDateByWeeksAndDay=function(e,t,n){var r=this._getRangeInfo(n);if(e>r.weeks||0===e&&t<r.fweek||e===r.weeks&&t>r.lweek)return null;var i=7*(e-1)-r.fweek+t,o=new Date(r.start.time);return o.setDate(+r.start.d+i),this.getDateInfo(o)},e.create=function(t,n){var r=[];return t.eachComponent("calendar",(function(t){var n=new e(t);r.push(n),t.coordinateSystem=n})),t.eachSeries((function(e){"calendar"===e.get("coordinateSystem")&&(e.coordinateSystem=r[e.get("calendarIndex")||0])})),r},e.dimensions=["time","value"],e}();function Tz(e){var t=e.calendarModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem:null}function Mz(e,t){var n;return W(t,(function(t){null!=e[t]&&"auto"!==e[t]&&(n=!0)})),n}var Cz=["transition","enterFrom","leaveTo"],Dz=Cz.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function Az(e,t,n){if(n&&(!e[n]&&t[n]&&(e[n]={}),e=e[n],t=t[n]),e&&t)for(var r=n?Cz:Dz,i=0;i<r.length;i++){var o=r[i];null==e[o]&&null!=t[o]&&(e[o]=t[o])}}var Iz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.preventAutoZ=!0,n}return l(t,e),t.prototype.mergeOption=function(t,n){var r=this.option.elements;this.option.elements=null,e.prototype.mergeOption.call(this,t,n),this.option.elements=r},t.prototype.optionUpdated=function(e,t){var n=this.option,r=(t?n:e).elements,i=n.elements=t?[]:n.elements,o=[];this._flatten(r,o,null);var a=Xo(i,o,"normalMerge"),s=this._elOptionsToUpdate=[];W(a,(function(e,t){var n=e.newOption;"production"!==process.env.NODE_ENV&&me(re(n)||e.existing,"Empty graphic option definition"),n&&(s.push(n),function(e,t){var n=e.existing;if(t.id=e.keyInfo.id,!t.type&&n&&(t.type=n.type),null==t.parentId){var r=t.parentOption;r?t.parentId=r.id:n&&(t.parentId=n.parentId)}t.parentOption=null}(e,n),function(e,t,n){var r=z({},n),i=e[t],o=n.$action||"merge";if("merge"===o)if(i){if("production"!==process.env.NODE_ENV){var a=n.type;me(!a||i.type===a,'Please set $action: "replace" to change `type`')}R(i,r,!0),$d(i,r,{ignoreSize:!0}),Qd(n,i),Az(n,i),Az(n,i,"shape"),Az(n,i,"style"),Az(n,i,"extra"),n.clipPath=i.clipPath}else e[t]=r;else"replace"===o?e[t]=r:"remove"===o&&i&&(e[t]=null)}(i,t,n),function(e,t){if(e&&(e.hv=t.hv=[Mz(t,["left","right"]),Mz(t,["top","bottom"])],"group"===e.type)){var n=e,r=t;null==n.width&&(n.width=r.width=0),null==n.height&&(n.height=r.height=0)}}(i[t],n))}),this),n.elements=Y(i,(function(e){return e&&delete e.$action,null!=e}))},t.prototype._flatten=function(e,t,n){W(e,(function(e){if(e){n&&(e.parentOption=n),t.push(e);var r=e.children;r&&r.length&&this._flatten(r,t,e),delete e.children}}),this)},t.prototype.useElOptionsToUpdate=function(){var e=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,e},t.type="graphic",t.defaultOption={elements:[]},t}(tp),Ez={path:null,compoundPath:null,group:Yi,image:Js,text:ll},Lz=ta(),Nz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(){this._elMap=Te()},t.prototype.render=function(e,t,n){e!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=e,this._updateElements(e),this._relocate(e,n)},t.prototype._updateElements=function(e){var t=e.useElOptionsToUpdate();if(t){var n=this._elMap,r=this.group,i=e.get("z"),o=e.get("zlevel");W(t,(function(t){var a=qo(t.id,null),s=null!=a?n.get(a):null,l=qo(t.parentId,null),u=null!=l?n.get(l):r,c=t.type,h=t.style;"text"===c&&h&&t.hv&&t.hv[1]&&(h.textVerticalAlign=h.textBaseline=h.verticalAlign=h.align=null);var d=t.textContent,p=t.textConfig;if(h&&RO(h,c,!!p,!!d)){var f=kO(h,c,!0);!p&&f.textConfig&&(p=t.textConfig=f.textConfig),!d&&f.textContent&&(d=f.textContent)}var g=function(e){return e=z({},e),W(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(Wd),(function(t){delete e[t]})),e}(t);"production"!==process.env.NODE_ENV&&s&&me(u===s.parent,"Changing parent is not supported.");var m=t.$action||"merge",v="merge"===m,y="replace"===m;if(v){var _=s;(C=!s)?_=Oz(a,u,t.type,n):(_&&(Lz(_).isNew=!1),lR(_)),_&&(ZO(_,g,e,{isInit:C}),kz(_,t,i,o))}else if(y){Rz(s,t,n,e);var x=Oz(a,u,t.type,n);x&&(ZO(x,g,e,{isInit:!0}),kz(x,t,i,o))}else"remove"===m&&(qO(s,t),Rz(s,t,n,e));var b=n.get(a);if(b&&d)if(v){var w=b.getTextContent();w?w.attr(d):b.setTextContent(new ll(d))}else y&&b.setTextContent(new ll(d));if(b){var S=t.clipPath;if(S){var T=S.type,M=void 0,C=!1;if(v){var D=b.getClipPath();M=(C=!D||Lz(D).type!==T)?Pz(T):D}else y&&(C=!0,M=Pz(T));b.setClipPath(M),ZO(M,S,e,{isInit:C}),uR(M,S.keyframeAnimation,e)}var A=Lz(b);b.setTextConfig(p),A.option=t,function(e,t,n){var r=bl(e).eventData;e.silent||e.ignore||r||(r=bl(e).eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name});r&&(r.info=n.info)}(b,e,t),ph({el:b,componentModel:e,itemName:b.name,itemTooltipOption:t.tooltip}),uR(b,t.keyframeAnimation,e)}}))}},t.prototype._relocate=function(e,t){for(var n=e.option.elements,r=this.group,i=this._elMap,o=t.getWidth(),a=t.getHeight(),s=["x","y"],l=0;l<n.length;l++){if((f=null!=(p=qo((d=n[l]).id,null))?i.get(p):null)&&f.isGroup){var u=(g=f.parent)===r,c=Lz(f),h=Lz(g);c.width=oo(c.option.width,u?o:h.width)||0,c.height=oo(c.option.height,u?a:h.height)||0}}for(l=n.length-1;l>=0;l--){var d,p,f;if(f=null!=(p=qo((d=n[l]).id,null))?i.get(p):null){var g=f.parent,m=(h=Lz(g),{}),v=qd(f,d,g===r?{width:o,height:a}:{width:h.width,height:h.height},null,{hv:d.hv,boundingMode:d.bounding},m);if(!Lz(f).isNew&&v){for(var y=d.transition,_={},x=0;x<s.length;x++){var b=s[x],w=m[b];y&&($O(y)||F(y,b)>=0)?_[b]=w:f[b]=w}Oc(f,_,e,0)}else f.attr(m)}}},t.prototype._clear=function(){var e=this,t=this._elMap;t.each((function(n){Rz(n,Lz(n).option,t,e._lastGraphicModel)})),this._elMap=Te()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(Kg);function Pz(e){"production"!==process.env.NODE_ENV&&me(e,"graphic type MUST be set");var t=Ae(Ez,e)?Ez[e]:Zc(e);"production"!==process.env.NODE_ENV&&me(t,"graphic type "+e+" can not be found");var n=new t({});return Lz(n).type=e,n}function Oz(e,t,n,r){var i=Pz(n);return t.add(i),r.set(e,i),Lz(i).id=e,Lz(i).isNew=!0,i}function Rz(e,t,n,r){e&&e.parent&&("group"===e.type&&e.traverse((function(e){Rz(e,t,n,r)})),KO(e,t,r),n.removeKey(Lz(e).id))}function kz(e,t,n,r){e.isGroup||W([["cursor",ja.prototype.cursor],["zlevel",r||0],["z",n||0],["z2",0]],(function(n){var r=n[0];Ae(t,r)?e[r]=de(t[r],n[1]):null==e[r]&&(e[r]=n[1])})),W(q(t),(function(n){if(0===n.indexOf("on")){var r=t[n];e[n]=Q(r)?r:null}})),Ae(t,"draggable")&&(e.draggable=t.draggable),null!=t.name&&(e.name=t.name),null!=t.id&&(e.id=t.id)}var zz=["x","y","radius","angle","single"],Vz=["cartesian2d","polar","singleAxis"];function Bz(e){return"production"!==process.env.NODE_ENV&&me(e),e+"Axis"}function Fz(e,t){var n,r=Te(),i=[],o=Te();e.eachComponent({mainType:"dataZoom",query:t},(function(e){o.get(e.uid)||s(e)}));do{n=!1,e.eachComponent("dataZoom",a)}while(n);function a(e){!o.get(e.uid)&&function(e){var t=!1;return e.eachTargetAxis((function(e,n){var i=r.get(e);i&&i[n]&&(t=!0)})),t}(e)&&(s(e),n=!0)}function s(e){o.set(e.uid,!0),i.push(e),e.eachTargetAxis((function(e,t){(r.get(e)||r.set(e,[]))[t]=!0}))}return i}function Gz(e){var t=e.ecModel,n={infoList:[],infoMap:Te()};return e.eachTargetAxis((function(e,r){var i=t.getComponent(Bz(e),r);if(i){var o=i.getCoordSysModel();if(o){var a=o.uid,s=n.infoMap.get(a);s||(s={model:o,axisModels:[]},n.infoList.push(s),n.infoMap.set(a,s)),s.axisModels.push(i)}}})),n}var Hz=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},e}(),Uz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return l(t,e),t.prototype.init=function(e,t,n){var r=Wz(e);this.settledOption=r,this.mergeDefaultAndTheme(e,n),this._doInit(r)},t.prototype.mergeOption=function(e){var t=Wz(e);R(this.option,e,!0),R(this.settledOption,t,!0),this._doInit(t)},t.prototype._doInit=function(e){var t=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;W([["start","startValue"],["end","endValue"]],(function(e,r){"value"===this._rangePropMode[r]&&(t[e[0]]=n[e[0]]=null)}),this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get("orient",!0),t=this._targetAxisInfoMap=Te();this._fillSpecifiedTargetAxis(t)?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||"horizontal",this._fillAutoTargetAxisByOrient(t,this._orient)),this._noTarget=!0,t.each((function(e){e.indexList.length&&(this._noTarget=!1)}),this)},t.prototype._fillSpecifiedTargetAxis=function(e){var t=!1;return W(zz,(function(n){var r=this.getReferringComponents(Bz(n),aa);if(r.specified){t=!0;var i=new Hz;W(r.models,(function(e){i.add(e.componentIndex)})),e.set(n,i)}}),this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,r=!0;if(r){var i="vertical"===t?"y":"x";o(n.findComponents({mainType:i+"Axis"}),i)}r&&o(n.findComponents({mainType:"singleAxis",filter:function(e){return e.get("orient",!0)===t}}),"single");function o(t,n){var i=t[0];if(i){var o=new Hz;if(o.add(i.componentIndex),e.set(n,o),r=!1,"x"===n||"y"===n){var a=i.getReferringComponents("grid",oa).models[0];a&&W(t,(function(e){i.componentIndex!==e.componentIndex&&a===e.getReferringComponents("grid",oa).models[0]&&o.add(e.componentIndex)}))}}}r&&W(zz,(function(t){if(r){var i=n.findComponents({mainType:Bz(t),filter:function(e){return"category"===e.get("type",!0)}});if(i[0]){var o=new Hz;o.add(i[0].componentIndex),e.set(t,o),r=!1}}}),this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis((function(t){!e&&(e=t)}),this),"y"===e?"vertical":"horizontal"},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var t=this._rangePropMode,n=this.get("rangeMode");W([["start","startValue"],["end","endValue"]],(function(r,i){var o=null!=e[r[0]],a=null!=e[r[1]];o&&!a?t[i]="percent":!o&&a?t[i]="value":n?t[i]=n[i]:o&&(t[i]="percent")}))},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis((function(t,n){null==e&&(e=this.ecModel.getComponent(Bz(t),n))}),this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each((function(n,r){W(n.indexList,(function(n){e.call(t,r,n)}))}))},t.prototype.getAxisProxy=function(e,t){var n=this.getAxisModel(e,t);if(n)return n.__dzAxisProxy},t.prototype.getAxisModel=function(e,t){"production"!==process.env.NODE_ENV&&me(e&&null!=t);var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[t])return this.ecModel.getComponent(Bz(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;W([["start","startValue"],["end","endValue"]],(function(r){null==e[r[0]]&&null==e[r[1]]||(t[r[0]]=n[r[0]]=e[r[0]],t[r[1]]=n[r[1]]=e[r[1]])}),this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;W(["start","startValue","end","endValue"],(function(n){t[n]=e[n]}))},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},t.prototype.getValueRange=function(e,t){if(null!=e||null!=t)return this.getAxisProxy(e,t).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return e.__dzAxisProxy;for(var t,n=this._targetAxisInfoMap.keys(),r=0;r<n.length;r++)for(var i=n[r],o=this._targetAxisInfoMap.get(i),a=0;a<o.indexList.length;a++){var s=this.getAxisProxy(i,o.indexList[a]);if(s.hostedBy(this))return s;t||(t=s)}return t},t.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},t.prototype.getOrient=function(){return"production"!==process.env.NODE_ENV&&me(this._orient),this._orient},t.type="dataZoom",t.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],t.defaultOption={z:4,filterMode:"filter",start:0,end:100},t}(tp);function Wz(e){var t={};return W(["start","end","startValue","endValue","throttle"],(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}var jz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="dataZoom.select",t}(Uz),Xz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n,r){this.dataZoomModel=e,this.ecModel=t,this.api=n},t.type="dataZoom",t}(Kg),Yz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="dataZoom.select",t}(Xz),Zz=W,qz=so,Kz=function(){function e(e,t,n,r){this._dimName=e,this._axisIndex=t,this.ecModel=r,this._dataZoomModel=n}return e.prototype.hostedBy=function(e){return this._dataZoomModel===e},e.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},e.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},e.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries((function(t){if(function(e){var t=e.get("coordinateSystem");return F(Vz,t)>=0}(t)){var n=Bz(this._dimName),r=t.getReferringComponents(n,oa).models[0];r&&this._axisIndex===r.componentIndex&&e.push(t)}}),this),e},e.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},e.prototype.getMinMaxSpan=function(){return O(this._minMaxSpan)},e.prototype.calculateDataWindow=function(e){var t,n=this._dataExtent,r=this.getAxisModel().axis.scale,i=this._dataZoomModel.getRangePropMode(),o=[0,100],a=[],s=[];Zz(["start","end"],(function(l,u){var c=e[l],h=e[l+"Value"];"percent"===i[u]?(null==c&&(c=o[u]),h=r.parse(io(c,o,n))):(t=!0,c=io(h=null==h?n[u]:r.parse(h),n,o)),s[u]=null==h||isNaN(h)?n[u]:h,a[u]=null==c||isNaN(c)?o[u]:c})),qz(s),qz(a);var l=this._minMaxSpan;function u(e,t,n,i,o){var a=o?"Span":"ValueSpan";fL(0,e,n,"all",l["min"+a],l["max"+a]);for(var s=0;s<2;s++)t[s]=io(e[s],n,i,!0),o&&(t[s]=r.parse(t[s]))}return t?u(s,a,n,o,!1):u(a,s,o,n,!0),{valueWindow:s,percentWindow:a}},e.prototype.reset=function(e){if(e===this._dataZoomModel){var t=this.getTargetSeriesModels();this._dataExtent=function(e,t,n){var r=[1/0,-1/0];Zz(n,(function(e){!function(e,t,n){t&&W(Jx(t,n),(function(n){var r=t.getApproximateExtent(n);r[0]<e[0]&&(e[0]=r[0]),r[1]>e[1]&&(e[1]=r[1])}))}(r,e.getData(),t)}));var i=e.getAxisModel(),o=Hx(i.axis.scale,i,r).calculate();return[o.min,o.max]}(this,this._dimName,t),this._updateMinMaxSpan();var n=this.calculateDataWindow(e.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},e.prototype.filterData=function(e,t){if(e===this._dataZoomModel){var n=this._dimName,r=this.getTargetSeriesModels(),i=e.get("filterMode"),o=this._valueWindow;"none"!==i&&Zz(r,(function(e){var t=e.getData(),r=t.mapDimensionsAll(n);if(r.length){if("weakFilter"===i){var a=t.getStore(),s=j(r,(function(e){return t.getDimensionIndex(e)}),t);t.filterSelf((function(e){for(var t,n,i,l=0;l<r.length;l++){var u=a.get(s[l],e),c=!isNaN(u),h=u<o[0],d=u>o[1];if(c&&!h&&!d)return!0;c&&(i=!0),h&&(t=!0),d&&(n=!0)}return i&&t&&n}))}else Zz(r,(function(n){if("empty"===i)e.setData(t=t.map(n,(function(e){return function(e){return e>=o[0]&&e<=o[1]}(e)?e:NaN})));else{var r={};r[n]=o,t.selectRange(r)}}));Zz(r,(function(e){t.setApproximateExtent(o,e)}))}}))}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;Zz(["min","max"],(function(r){var i=t.get(r+"Span"),o=t.get(r+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?i=io(n[0]+o,n,[0,100],!0):null!=i&&(o=io(i,[0,100],n,!0)-n[0]),e[r+"Span"]=i,e[r+"ValueSpan"]=o}),this)},e.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var r=co(n,[0,500]);r=Math.min(r,20);var i=e.axis.scale.rawExtentInfo;0!==t[0]&&i.setDeterminedMinMax("min",+n[0].toFixed(r)),100!==t[1]&&i.setDeterminedMinMax("max",+n[1].toFixed(r)),i.freeze()}},e}();var $z={getTargetSeries:function(e){function t(t){e.eachComponent("dataZoom",(function(n){n.eachTargetAxis((function(r,i){var o=e.getComponent(Bz(r),i);t(r,i,o,n)}))}))}t((function(e,t,n,r){n.__dzAxisProxy=null}));var n=[];t((function(t,r,i,o){i.__dzAxisProxy||(i.__dzAxisProxy=new Kz(t,r,o,e),n.push(i.__dzAxisProxy))}));var r=Te();return W(n,(function(e){W(e.getTargetSeriesModels(),(function(e){r.set(e.uid,e)}))})),r},overallReset:function(e,t){e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(t,n){e.getAxisProxy(t,n).reset(e)})),e.eachTargetAxis((function(n,r){e.getAxisProxy(n,r).filterData(e,t)}))})),e.eachComponent("dataZoom",(function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getDataPercentWindow(),r=t.getDataValueWindow();e.setCalculatedRange({start:n[0],end:n[1],startValue:r[0],endValue:r[1]})}}))}};var Jz=!1;function Qz(e){Jz||(Jz=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,$z),function(e){e.registerAction("dataZoom",(function(e,t){W(Fz(t,e),(function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})}))}))}(e),e.registerSubTypeDefaulter("dataZoom",(function(){return"slider"})))}function eV(e){e.registerComponentModel(jz),e.registerComponentView(Yz),Qz(e)}var tV=function(){},nV={};function rV(e,t){nV[e]=t}function iV(e){return nV[e]}var oV=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;W(this.option.feature,(function(e,n){var r=iV(n);r&&(r.getDefaultOption&&(r.defaultOption=r.getDefaultOption(t)),R(e,r.defaultOption))}))},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},t}(tp);function aV(e,t){var n=Od(t.get("padding")),r=t.getItemStyle(["color","opacity"]);return r.fill=t.get("backgroundColor"),e=new ol({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get("borderRadius")},style:r,silent:!0,z2:-1})}var sV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.render=function(e,t,n,r){var i=this.group;if(i.removeAll(),e.get("show")){var o=+e.get("itemSize"),a="vertical"===e.get("orient"),s=e.get("feature")||{},l=this._features||(this._features={}),u=[];W(s,(function(e,t){u.push(t)})),new h_(this._featureNames||[],u).add(c).update(c).remove($(c,null)).execute(),this._featureNames=u,function(e,t,n){var r=t.getBoxLayoutParams(),i=t.get("padding"),o={width:n.getWidth(),height:n.getHeight()},a=Zd(r,o,i);Yd(t.get("orient"),e,t.get("itemGap"),a.width,a.height),qd(e,r,o,i)}(i,e,n),i.add(aV(i.getBoundingRect(),e)),a||i.eachChild((function(e){var t=e.__title,r=e.ensureState("emphasis"),a=r.textConfig||(r.textConfig={}),s=e.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!Q(l)&&t){var u=l.style||(l.style={}),c=Li(t,ll.makeFont(u)),h=e.x+i.x,d=!1;e.y+i.y+o+c.height>n.getHeight()&&(a.position="top",d=!0);var p=d?-5-c.height:o+10;h+c.width/2>n.getWidth()?(a.position=["100%",p],u.align="right"):h-c.width/2<0&&(a.position=[0,p],u.align="left")}}))}function c(c,h){var d,p=u[c],f=u[h],g=s[p],m=new Wh(g,e,e.ecModel);if(r&&null!=r.newTitle&&r.featureName===p&&(g.title=r.newTitle),p&&!f){if(function(e){return 0===e.indexOf("my")}(p))d={onclick:m.option.onclick,featureName:p};else{var v=iV(p);if(!v)return;d=new v}l[p]=d}else if(!(d=l[f]))return;d.uid=Xh("toolbox-feature"),d.model=m,d.ecModel=t,d.api=n;var y=d instanceof tV;p||!f?!m.get("show")||y&&d.unusable?y&&d.remove&&d.remove(t,n):(!function(r,s,l){var u,c,h=r.getModel("iconStyle"),d=r.getModel(["emphasis","iconStyle"]),p=s instanceof tV&&s.getIcons?s.getIcons():r.get("icon"),f=r.get("title")||{};ee(p)?(u={})[l]=p:u=p;ee(f)?(c={})[l]=f:c=f;var g=r.iconPaths={};W(u,(function(l,u){var p=uh(l,{},{x:-o/2,y:-o/2,width:o,height:o});p.setStyle(h.getItemStyle()),p.ensureState("emphasis").style=d.getItemStyle();var f=new ll({style:{text:c[u],align:d.get("textAlign"),borderRadius:d.get("textBorderRadius"),padding:d.get("textPadding"),fill:null,font:Ah({fontStyle:d.get("textFontStyle"),fontFamily:d.get("textFontFamily"),fontSize:d.get("textFontSize"),fontWeight:d.get("textFontWeight")},t)},ignore:!0});p.setTextContent(f),ph({el:p,componentModel:e,itemName:u,formatterParamsExtra:{title:c[u]}}),p.__title=c[u],p.on("mouseover",(function(){var t=d.getItemStyle(),r=a?null==e.get("right")&&"right"!==e.get("left")?"right":"left":null==e.get("bottom")&&"bottom"!==e.get("top")?"bottom":"top";f.setStyle({fill:d.get("textFill")||t.fill||t.stroke||"#000",backgroundColor:d.get("textBackgroundColor")}),p.setTextConfig({position:d.get("textPosition")||r}),f.ignore=!e.get("showTitle"),n.enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==r.get(["iconStatus",u])&&n.leaveEmphasis(this),f.hide()})),("emphasis"===r.get(["iconStatus",u])?Kl:$l)(p),i.add(p),p.on("click",K(s.onclick,s,t,n,u)),g[u]=p}))}(m,d,p),m.setIconStatus=function(e,t){var n=this.option,r=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,r[e]&&("emphasis"===t?Kl:$l)(r[e])},d instanceof tV&&d.render&&d.render(m,t,n,r)):y&&d.dispose&&d.dispose(t,n)}},t.prototype.updateView=function(e,t,n,r){W(this._features,(function(e){e instanceof tV&&e.updateView&&e.updateView(e.model,t,n,r)}))},t.prototype.remove=function(e,t){W(this._features,(function(n){n instanceof tV&&n.remove&&n.remove(e,t)})),this.group.removeAll()},t.prototype.dispose=function(e,t){W(this._features,(function(n){n instanceof tV&&n.dispose&&n.dispose(e,t)}))},t.type="toolbox",t}(Kg);var lV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.onclick=function(e,t){var n=this.model,r=n.get("name")||e.get("title.0.text")||"echarts",i="svg"===t.getZr().painter.getType(),o=i?"svg":n.get("type",!0)||"png",a=t.getConnectedDataURL({type:o,backgroundColor:n.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=d.browser;if("function"!=typeof MouseEvent||!s.newEdge&&(s.ie||s.edge))if(window.navigator.msSaveOrOpenBlob||i){var l=a.split(","),u=l[0].indexOf("base64")>-1,c=i?decodeURIComponent(l[1]):l[1];u&&(c=window.atob(c));var h=r+"."+o;if(window.navigator.msSaveOrOpenBlob){for(var p=c.length,f=new Uint8Array(p);p--;)f[p]=c.charCodeAt(p);var g=new Blob([f]);window.navigator.msSaveOrOpenBlob(g,h)}else{var m=document.createElement("iframe");document.body.appendChild(m);var v=m.contentWindow,y=v.document;y.open("image/svg+xml","replace"),y.write(c),y.close(),v.focus(),y.execCommand("SaveAs",!0,h),document.body.removeChild(m)}}else{var _=n.get("lang"),x='<body style="margin:0;"><img src="'+a+'" style="max-width:100%;" title="'+(_&&_[0]||"")+'" /></body>',b=window.open();b.document.write(x),b.document.title=r}else{var w=document.createElement("a");w.download=r+"."+o,w.target="_blank",w.href=a;var S=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});w.dispatchEvent(S)}},t.getDefaultOption=function(e){return{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"])}},t}(tV),uV="__ec_magicType_stack__",cV=[["line","bar"],["stack"]],hV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.getIcons=function(){var e=this.model,t=e.get("icon"),n={};return W(e.get("type"),(function(e){t[e]&&(n[e]=t[e])})),n},t.getDefaultOption=function(e){return{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:{}}},t.prototype.onclick=function(e,t,n){var r=this.model,i=r.get(["seriesIndex",n]);if(dV[n]){var o,a={series:[]};W(cV,(function(e){F(e,n)>=0&&W(e,(function(e){r.setIconStatus(e,"normal")}))})),r.setIconStatus(n,"emphasis"),e.eachComponent({mainType:"series",query:null==i?null:{seriesIndex:i}},(function(e){var t=e.subType,i=e.id,o=dV[n](t,i,e,r);o&&(V(o,e.option),a.series.push(o));var s=e.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var u=l.dim+"Axis",c=e.getReferringComponents(u,oa).models[0].componentIndex;a[u]=a[u]||[];for(var h=0;h<=c;h++)a[u][c]=a[u][c]||{};a[u][c].boundaryGap="bar"===n}}}));var s=n;"stack"===n&&(o=R({stack:r.option.title.tiled,tiled:r.option.title.stack},r.option.title),"emphasis"!==r.get(["iconStatus",n])&&(s="tiled")),t.dispatchAction({type:"changeMagicType",currentType:s,newOption:a,newTitle:o,featureName:"magicType"})}},t}(tV),dV={line:function(e,t,n,r){if("bar"===e)return R({id:t,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},r.get(["option","line"])||{},!0)},bar:function(e,t,n,r){if("line"===e)return R({id:t,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},r.get(["option","bar"])||{},!0)},stack:function(e,t,n,r){var i=n.get("stack")===uV;if("line"===e||"bar"===e)return r.setIconStatus("stack",i?"normal":"emphasis"),R({id:t,stack:i?"":uV},r.get(["option","stack"])||{},!0)}};qy({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(e,t){t.mergeOption(e.newOption)}));var pV=new Array(60).join("-"),fV="\t";function gV(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var mV=new RegExp("[\t]+","g");function vV(e,t){var n=e.split(new RegExp("\n*"+pV+"\n*","g")),r={series:[]};return W(n,(function(e,n){if(function(e){if(e.slice(0,e.indexOf("\n")).indexOf(fV)>=0)return!0}(e)){var i=function(e){for(var t=e.split(/\n+/g),n=[],r=j(gV(t.shift()).split(mV),(function(e){return{name:e,data:[]}})),i=0;i<t.length;i++){var o=gV(t[i]).split(mV);n.push(o.shift());for(var a=0;a<o.length;a++)r[a]&&(r[a].data[i]=o[a])}return{series:r,categories:n}}(e),o=t[n],a=o.axisDim+"Axis";o&&(r[a]=r[a]||[],r[a][o.axisIndex]={data:i.categories},r.series=r.series.concat(i.series))}else{i=function(e){for(var t=e.split(/\n+/g),n=gV(t.shift()),r=[],i=0;i<t.length;i++){var o=gV(t[i]);if(o){var a=o.split(mV),s="",l=void 0,u=!1;isNaN(a[0])?(u=!0,s=a[0],a=a.slice(1),r[i]={name:s,value:[]},l=r[i].value):l=r[i]=[];for(var c=0;c<a.length;c++)l.push(+a[c]);1===l.length&&(u?r[i].value=l[0]:r[i]=l[0])}}return{name:n,data:r}}(e);r.series.push(i)}})),r}var yV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.onclick=function(e,t){setTimeout((function(){t.dispatchAction({type:"hideTip"})}));var n=t.getDom(),r=this.model;this._dom&&n.removeChild(this._dom);var i=document.createElement("div");i.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",i.style.backgroundColor=r.get("backgroundColor")||"#fff";var o=document.createElement("h4"),a=r.get("lang")||[];o.innerHTML=a[0]||r.get("title"),o.style.cssText="margin:10px 20px",o.style.color=r.get("textColor");var s=document.createElement("div"),l=document.createElement("textarea");s.style.cssText="overflow:auto";var u=r.get("optionToContent"),c=r.get("contentToOption"),h=function(e){var t,n,r,i=function(e){var t={},n=[],r=[];return e.eachRawSeries((function(e){var i=e.coordinateSystem;if(!i||"cartesian2d"!==i.type&&"polar"!==i.type)n.push(e);else{var o=i.getBaseAxis();if("category"===o.type){var a=o.dim+"_"+o.index;t[a]||(t[a]={categoryAxis:o,valueAxis:i.getOtherAxis(o),series:[]},r.push({axisDim:o.dim,axisIndex:o.index})),t[a].series.push(e)}else n.push(e)}})),{seriesGroupByCategoryAxis:t,other:n,meta:r}}(e);return{value:Y([(n=i.seriesGroupByCategoryAxis,r=[],W(n,(function(e,t){var n=e.categoryAxis,i=e.valueAxis.dim,o=[" "].concat(j(e.series,(function(e){return e.name}))),a=[n.model.getCategories()];W(e.series,(function(e){var t=e.getRawData();a.push(e.getRawData().mapArray(t.mapDimension(i),(function(e){return e})))}));for(var s=[o.join(fV)],l=0;l<a[0].length;l++){for(var u=[],c=0;c<a.length;c++)u.push(a[c][l]);s.push(u.join(fV))}r.push(s.join("\n"))})),r.join("\n\n"+pV+"\n\n")),(t=i.other,j(t,(function(e){var t=e.getRawData(),n=[e.name],r=[];return t.each(t.dimensions,(function(){for(var e=arguments.length,i=arguments[e-1],o=t.getName(i),a=0;a<e-1;a++)r[a]=arguments[a];n.push((o?o+fV:"")+r.join(fV))})),n.join("\n")})).join("\n\n"+pV+"\n\n"))],(function(e){return!!e.replace(/[\n\t\s]/g,"")})).join("\n\n"+pV+"\n\n"),meta:i.meta}}(e);if(Q(u)){var d=u(t.getOption());ee(d)?s.innerHTML=d:ae(d)&&s.appendChild(d)}else{l.readOnly=r.get("readOnly");var p=l.style;p.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",p.color=r.get("textColor"),p.borderColor=r.get("textareaBorderColor"),p.backgroundColor=r.get("textareaColor"),l.value=h.value,s.appendChild(l)}var f=h.meta,g=document.createElement("div");g.style.cssText="position:absolute;bottom:5px;left:0;right:0";var m="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",v=document.createElement("div"),y=document.createElement("div");m+=";background-color:"+r.get("buttonColor"),m+=";color:"+r.get("buttonTextColor");var _=this;function x(){n.removeChild(i),_._dom=null}xt(v,"click",x),xt(y,"click",(function(){if(null==c&&null!=u||null!=c&&null==u)return"production"!==process.env.NODE_ENV&&No("It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored."),void x();var e;try{e=Q(c)?c(s,t.getOption()):vV(l.value,f)}catch(e){throw x(),new Error("Data view format error "+e)}e&&t.dispatchAction({type:"changeDataView",newOption:e}),x()})),v.innerHTML=a[1],y.innerHTML=a[2],y.style.cssText=v.style.cssText=m,!r.get("readOnly")&&g.appendChild(y),g.appendChild(v),i.appendChild(o),i.appendChild(s),i.appendChild(g),s.style.height=n.clientHeight-80+"px",n.appendChild(i),this._dom=i},t.prototype.remove=function(e,t){this._dom&&t.getDom().removeChild(this._dom)},t.prototype.dispose=function(e,t){this.remove(e,t)},t.getDefaultOption=function(e){return{show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:e.getLocaleModel().get(["toolbox","dataView","title"]),lang:e.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"}},t}(tV);function _V(e,t){return j(e,(function(e,n){var r=t&&t[n];if(re(r)&&!J(r)){re(e)&&!J(e)||(e={value:e});var i=null!=r.name&&null==e.name;return e=V(e,r),i&&delete e.name,e}return e}))}qy({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},(function(e,t){var n=[];W(e.newOption.series,(function(e){var r=t.getSeriesByName(e.name)[0];if(r){var i=r.get("data");n.push({name:e.name,data:_V(e.data,i)})}else n.push(z({type:"scatter"},e))})),t.mergeOption(V({series:n},e.newOption))}));var xV=W,bV=ta();function wV(e){var t=bV(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var SV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.onclick=function(e,t){!function(e){bV(e).snapshots=null}(e),t.dispatchAction({type:"restore",from:this.uid})},t.getDefaultOption=function(e){return{show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:e.getLocaleModel().get(["toolbox","restore","title"])}},t}(tV);qy({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(e,t){t.resetOption("recreate")}));var TV=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],MV=function(){function e(e,t,n){var r=this;this._targetInfoList=[];var i=DV(t,e);W(AV,(function(e,t){(!n||!n.include||F(n.include,t)>=0)&&e(i,r._targetInfoList)}))}return e.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,(function(e,t,n){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var r=LV[e.brushType](0,n,t);e.__rangeOffset={offset:PV[e.brushType](r.values,e.range,[1,1]),xyMinMax:r.xyMinMax}}})),e},e.prototype.matchOutputRanges=function(e,t,n){W(e,(function(e){var r=this.findTargetInfo(e,t);r&&!0!==r&&W(r.coordSyses,(function(r){var i=LV[e.brushType](1,r,e.range,!0);n(e,i.values,r,t)}))}),this)},e.prototype.setInputRanges=function(e,t){W(e,(function(e){var n,r,i,o,a,s=this.findTargetInfo(e,t);if("production"!==process.env.NODE_ENV&&(me(!s||!0===s||e.coordRange,"coordRange must be specified when coord index specified."),me(!s||!0!==s||e.range,"range must be specified in global brush.")),e.range=e.range||[],s&&!0!==s){e.panelId=s.panelId;var l=LV[e.brushType](0,s.coordSys,e.coordRange),u=e.__rangeOffset;e.range=u?PV[e.brushType](l.values,u.offset,(n=l.xyMinMax,r=u.xyMinMax,i=RV(n),o=RV(r),a=[i[0]/o[0],i[1]/o[1]],isNaN(a[0])&&(a[0]=1),isNaN(a[1])&&(a[1]=1),a)):l.values}}),this)},e.prototype.makePanelOpts=function(e,t){return j(this._targetInfoList,(function(n){var r=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:mN(r),isTargetByCursor:yN(r,e,n.coordSysModel),getLinearBrushOtherExtent:vN(r)}}))},e.prototype.controlSeries=function(e,t,n){var r=this.findTargetInfo(e,n);return!0===r||r&&F(r.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,r=DV(t,e),i=0;i<n.length;i++){var o=n[i],a=e.panelId;if(a){if(o.panelId===a)return o}else for(var s=0;s<IV.length;s++)if(IV[s](r,o))return o}return!0},e}();function CV(e){return e[0]>e[1]&&e.reverse(),e}function DV(e,t){return ra(e,t,{includeMainTypes:TV})}var AV={grid:function(e,t){var n=e.xAxisModels,r=e.yAxisModels,i=e.gridModels,o=Te(),a={},s={};(n||r||i)&&(W(n,(function(e){var t=e.axis.grid.model;o.set(t.id,t),a[t.id]=!0})),W(r,(function(e){var t=e.axis.grid.model;o.set(t.id,t),s[t.id]=!0})),W(i,(function(e){o.set(e.id,e),a[e.id]=!0,s[e.id]=!0})),o.each((function(e){var i=e.coordinateSystem,o=[];W(i.getCartesians(),(function(e,t){(F(n,e.getAxis("x").model)>=0||F(r,e.getAxis("y").model)>=0)&&o.push(e)})),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:o[0],coordSyses:o,getPanelRect:EV.grid,xAxisDeclared:a[e.id],yAxisDeclared:s[e.id]})})))},geo:function(e,t){W(e.geoModels,(function(e){var n=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:EV.geo})}))}},IV=[function(e,t){var n=e.xAxisModel,r=e.yAxisModel,i=e.gridModel;return!i&&n&&(i=n.axis.grid.model),!i&&r&&(i=r.axis.grid.model),i&&i===t.gridModel},function(e,t){var n=e.geoModel;return n&&n===t.geoModel}],EV={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(nh(e)),t}},LV={lineX:$(NV,0),lineY:$(NV,1),rect:function(e,t,n,r){var i=e?t.pointToData([n[0][0],n[1][0]],r):t.dataToPoint([n[0][0],n[1][0]],r),o=e?t.pointToData([n[0][1],n[1][1]],r):t.dataToPoint([n[0][1],n[1][1]],r),a=[CV([i[0],o[0]]),CV([i[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(e,t,n,r){var i=[[1/0,-1/0],[1/0,-1/0]];return{values:j(n,(function(n){var o=e?t.pointToData(n,r):t.dataToPoint(n,r);return i[0][0]=Math.min(i[0][0],o[0]),i[1][0]=Math.min(i[1][0],o[1]),i[0][1]=Math.max(i[0][1],o[0]),i[1][1]=Math.max(i[1][1],o[1]),o})),xyMinMax:i}}};function NV(e,t,n,r){"production"!==process.env.NODE_ENV&&me("cartesian2d"===n.type,"lineX/lineY brush is available only in cartesian2d.");var i=n.getAxis(["x","y"][e]),o=CV(j([0,1],(function(e){return t?i.coordToData(i.toLocalCoord(r[e]),!0):i.toGlobalCoord(i.dataToCoord(r[e]))}))),a=[];return a[e]=o,a[1-e]=[NaN,NaN],{values:o,xyMinMax:a}}var PV={lineX:$(OV,0),lineY:$(OV,1),rect:function(e,t,n){return[[e[0][0]-n[0]*t[0][0],e[0][1]-n[0]*t[0][1]],[e[1][0]-n[1]*t[1][0],e[1][1]-n[1]*t[1][1]]]},polygon:function(e,t,n){return j(e,(function(e,r){return[e[0]-n[0]*t[r][0],e[1]-n[1]*t[r][1]]}))}};function OV(e,t,n,r){return[t[0]-r[e]*n[0],t[1]-r[e]*n[1]]}function RV(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var kV,zV,VV=W,BV=Fo+"toolbox-dataZoom_",FV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.render=function(e,t,n,r){this._brushController||(this._brushController=new BL(n.getZr()),this._brushController.on("brush",K(this._onBrush,this)).mount()),function(e,t,n,r,i){var o=n._isZoomActive;r&&"takeGlobalCursor"===r.type&&(o="dataZoomSelect"===r.key&&r.dataZoomSelectActive);n._isZoomActive=o,e.setIconStatus("zoom",o?"emphasis":"normal");var a=new MV(HV(e),t,{include:["grid"]}),s=a.makePanelOpts(i,(function(e){return e.xAxisDeclared&&!e.yAxisDeclared?"lineX":!e.xAxisDeclared&&e.yAxisDeclared?"lineY":"rect"}));n._brushController.setPanels(s).enableBrush(!(!o||!s.length)&&{brushType:"auto",brushStyle:e.getModel("brushStyle").getItemStyle()})}(e,t,this,r,n),function(e,t){e.setIconStatus("back",function(e){return wV(e).length}(t)>1?"emphasis":"normal")}(e,t)},t.prototype.onclick=function(e,t,n){GV[n].call(this)},t.prototype.remove=function(e,t){this._brushController&&this._brushController.unmount()},t.prototype.dispose=function(e,t){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(e){var t=e.areas;if(e.isEnd&&t.length){var n={},r=this.ecModel;this._brushController.updateCovers([]),new MV(HV(this.model),r,{include:["grid"]}).matchOutputRanges(t,r,(function(e,t,n){if("cartesian2d"===n.type){var r=e.brushType;"rect"===r?(i("x",n,t[0]),i("y",n,t[1])):i({lineX:"x",lineY:"y"}[r],n,t)}})),function(e,t){var n=wV(e);xV(t,(function(t,r){for(var i=n.length-1;i>=0&&!n[i][r];i--);if(i<0){var o=e.queryComponents({mainType:"dataZoom",subType:"select",id:r})[0];if(o){var a=o.getPercentRange();n[0][r]={dataZoomId:r,start:a[0],end:a[1]}}}})),n.push(t)}(r,n),this._dispatchZoomAction(n)}function i(e,t,i){var o=t.getAxis(e),a=o.model,s=function(e,t,n){var r;return n.eachComponent({mainType:"dataZoom",subType:"select"},(function(n){n.getAxisModel(e,t.componentIndex)&&(r=n)})),r}(e,a,r),l=s.findRepresentativeAxisProxy(a).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(i=fL(0,i.slice(),o.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(n[s.id]={dataZoomId:s.id,startValue:i[0],endValue:i[1]})}},t.prototype._dispatchZoomAction=function(e){var t=[];VV(e,(function(e,n){t.push(O(e))})),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},t.getDefaultOption=function(e){return{show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:e.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},t}(tV),GV={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(function(e){var t=wV(e),n=t[t.length-1];t.length>1&&t.pop();var r={};return xV(n,(function(e,n){for(var i=t.length-1;i>=0;i--)if(e=t[i][n]){r[n]=e;break}})),r}(this.ecModel))}};function HV(e){var t={xAxisIndex:e.get("xAxisIndex",!0),yAxisIndex:e.get("yAxisIndex",!0),xAxisId:e.get("xAxisId",!0),yAxisId:e.get("yAxisId",!0)};return null==t.xAxisIndex&&null==t.xAxisId&&(t.xAxisIndex="all"),null==t.yAxisIndex&&null==t.yAxisId&&(t.yAxisIndex="all"),t}kV="dataZoom",zV=function(e){var t=e.getComponent("toolbox",0),n=["feature","dataZoom"];if(t&&null!=t.get(n)){var r=t.getModel(n),i=[],o=ra(e,HV(r));return VV(o.xAxisModels,(function(e){return a(e,"xAxis","xAxisIndex")})),VV(o.yAxisModels,(function(e){return a(e,"yAxis","yAxisIndex")})),i}function a(e,t,n){var o=e.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:r.get("filterMode",!0)||"filter",id:BV+t+o};a[n]=o,i.push(a)}},me(null==Sp.get(kV)&&zV),Sp.set(kV,zV);var UV=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},t}(tp);function WV(e){var t=e.get("confine");return null!=t?!!t:"richText"===e.get("renderMode")}function jV(e){if(d.domSupported)for(var t=document.documentElement.style,n=0,r=e.length;n<r;n++)if(e[n]in t)return e[n]}var XV=jV(["transform","webkitTransform","OTransform","MozTransform","msTransform"]);function YV(e,t){if(!e)return t;t=Pd(t,!0);var n=e.indexOf(t);return(e=-1===n?t:"-"+e.slice(0,n)+"-"+t).toLowerCase()}var ZV=YV(jV(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),qV=YV(XV,"transform"),KV="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(d.transform3dSupported?"will-change:transform;":"");function $V(e,t,n){var r=e.toFixed(0)+"px",i=t.toFixed(0)+"px";if(!d.transformSupported)return n?"top:"+i+";left:"+r+";":[["top",i],["left",r]];var o=d.transform3dSupported,a="translate"+(o?"3d":"")+"("+r+","+i+(o?",0":"")+")";return n?"top:0;left:0;"+qV+":"+a+";":[["top",0],["left",0],[XV,a]]}function JV(e,t,n){var r=[],i=e.get("transitionDuration"),o=e.get("backgroundColor"),a=e.get("shadowBlur"),s=e.get("shadowColor"),l=e.get("shadowOffsetX"),u=e.get("shadowOffsetY"),c=e.getModel("textStyle"),h=kg(e,"html"),p=l+"px "+u+"px "+a+"px "+s;return r.push("box-shadow:"+p),t&&i&&r.push(function(e,t){var n="cubic-bezier(0.23,1,0.32,1)",r=" "+e/2+"s "+n,i="opacity"+r+",visibility"+r;return t||(r=" "+e+"s "+n,i+=d.transformSupported?","+qV+r:",left"+r+",top"+r),ZV+":"+i}(i,n)),o&&r.push("background-color:"+o),W(["width","color","radius"],(function(t){var n="border-"+t,i=Pd(n),o=e.get(i);null!=o&&r.push(n+":"+o+("color"===t?"":"px"))})),r.push(function(e){var t=[],n=e.get("fontSize"),r=e.getTextColor();r&&t.push("color:"+r),t.push("font:"+e.getFont()),n&&t.push("line-height:"+Math.round(3*n/2)+"px");var i=e.get("textShadowColor"),o=e.get("textShadowBlur")||0,a=e.get("textShadowOffsetX")||0,s=e.get("textShadowOffsetY")||0;return i&&o&&t.push("text-shadow:"+a+"px "+s+"px "+o+"px "+i),W(["decoration","align"],(function(n){var r=e.get(n);r&&t.push("text-"+n+":"+r)})),t.join(";")}(c)),null!=h&&r.push("padding:"+Od(h).join("px ")+"px"),r.join(";")+";"}function QV(e,t,n,r,i){var o=t&&t.painter;if(n){var a=o&&o.getViewportRoot();a&&function(e,t,n,r,i){lt(st,t,r,i,!0)&&lt(e,n,st[0],st[1])}(e,a,n,r,i)}else{e[0]=r,e[1]=i;var s=o&&o.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var eB=function(){function e(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,d.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var r=this._zr=e.getZr(),i=t.appendTo,o=i&&(ee(i)?document.querySelector(i):ae(i)?i:Q(i)&&i(e.getDom()));QV(this._styleCoord,r,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(n),this._api=e,this._container=o;var a=this;n.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},n.onmousemove=function(e){if(e=e||window.event,!a._enterable){var t=r.handler;_t(r.painter.getViewportRoot(),e,!0),t.dispatch("mousemove",e)}},n.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return e.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),n=(o="position",(a=(i=t).currentStyle||document.defaultView&&document.defaultView.getComputedStyle(i))?a[o]:null),r=t.style;"absolute"!==r.position&&"absolute"!==n&&(r.position="relative")}var i,o,a,s=e.get("alwaysShowContent");s&&this._moveIfResized(),this._alwaysShowContent=s,this.el.className=e.get("className")||""},e.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,r=n.style,i=this._styleCoord;n.innerHTML?r.cssText=KV+JV(e,!this._firstShow,this._longHide)+$V(i[0],i[1],!0)+"border-color:"+Gd(t)+";"+(e.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):r.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,t,n,r,i){var o=this.el;if(null!=e){var a="";if(ee(i)&&"item"===n.get("trigger")&&!WV(n)&&(a=function(e,t,n){if(!ee(n)||"inside"===n)return"";var r=e.get("backgroundColor"),i=e.get("borderWidth");t=Gd(t);var o,a,s="left"===(o=n)?"right":"right"===o?"left":"top"===o?"bottom":"top",l=Math.max(1.5*Math.round(i),6),u="",c=qV+":";F(["left","right"],s)>-1?(u+="top:50%",c+="translateY(-50%) rotate("+(a="left"===s?-225:-45)+"deg)"):(u+="left:50%",c+="translateX(-50%) rotate("+(a="top"===s?225:45)+"deg)");var h=a*Math.PI/180,d=l+i,p=d*Math.abs(Math.cos(h))+d*Math.abs(Math.sin(h)),f=t+" solid "+i+"px;";return'<div style="'+["position:absolute;width:"+l+"px;height:"+l+"px;z-index:-1;",(u+=";"+s+":-"+Math.round(100*((p-Math.SQRT2*i)/2+Math.SQRT2*i-(p-d)/2))/100+"px")+";"+c+";","border-bottom:"+f,"border-right:"+f,"background-color:"+r+";"].join("")+'"></div>'}(n,r,i)),ee(e))o.innerHTML=e+a;else if(e){o.innerHTML="",J(e)||(e=[e]);for(var s=0;s<e.length;s++)ae(e[s])&&e[s].parentNode!==o&&o.appendChild(e[s]);if(a&&o.childNodes.length){var l=document.createElement("div");l.innerHTML=a,o.appendChild(l)}}}else o.innerHTML=""},e.prototype.setEnterable=function(e){this._enterable=e},e.prototype.getSize=function(){var e=this.el;return[e.offsetWidth,e.offsetHeight]},e.prototype.moveTo=function(e,t){var n=this._styleCoord;if(QV(n,this._zr,this._container,e,t),null!=n[0]&&null!=n[1]){var r=this.el.style;W($V(n[0],n[1]),(function(e){r[e[0]]=e[1]}))}},e.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},e.prototype.hide=function(){var e=this,t=this.el.style;t.visibility="hidden",t.opacity="0",d.transform3dSupported&&(t.willChange=""),this._show=!1,this._longHideTimeout=setTimeout((function(){return e._longHide=!0}),500)},e.prototype.hideLater=function(e){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(K(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var e=this.el.parentNode;e&&e.removeChild(this.el),this.el=this._container=null},e}(),tB=function(){function e(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),iB(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return e.prototype.update=function(e){var t=e.get("alwaysShowContent");t&&this._moveIfResized(),this._alwaysShowContent=t},e.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},e.prototype.setContent=function(e,t,n,r,i){var o=this;re(e)&&zo("production"!==process.env.NODE_ENV?"Passing DOM nodes as content is not supported in richText tooltip!":""),this.el&&this._zr.remove(this.el);var a=n.getModel("textStyle");this.el=new ll({style:{rich:t.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:r,textShadowColor:a.get("textShadowColor"),fill:n.get(["textStyle","color"]),padding:kg(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),W(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],(function(e){o.el.style[e]=n.get(e)})),W(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],(function(e){o.el.style[e]=a.get(e)||0})),this._zr.add(this.el);var s=this;this.el.on("mouseover",(function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0})),this.el.on("mouseout",(function(){s._enterable&&s._show&&s.hideLater(s._hideDelay),s._inContent=!1}))},e.prototype.setEnterable=function(e){this._enterable=e},e.prototype.getSize=function(){var e=this.el,t=this.el.getBoundingRect(),n=rB(e.style);return[t.width+n.left+n.right,t.height+n.top+n.bottom]},e.prototype.moveTo=function(e,t){var n=this.el;if(n){var r=this._styleCoord;iB(r,this._zr,e,t),e=r[0],t=r[1];var i=n.style,o=nB(i.borderWidth||0),a=rB(i);n.x=e+o+a.left,n.y=t+o+a.top,n.markRedraw()}},e.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},e.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},e.prototype.hideLater=function(e){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(K(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){this._zr.remove(this.el)},e}();function nB(e){return Math.max(0,e)}function rB(e){var t=nB(e.shadowBlur||0),n=nB(e.shadowOffsetX||0),r=nB(e.shadowOffsetY||0);return{left:nB(t-n),right:nB(t+n),top:nB(t-r),bottom:nB(t+r)}}function iB(e,t,n,r){e[0]=n,e[1]=r,e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var oB=new ol({shape:{x:-1,y:-1,width:2,height:2}}),aB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(e,t){if(!d.node&&t.getDom()){var n,r=e.getComponent("tooltip"),i=this._renderMode="auto"===(n=r.get("renderMode"))?d.domSupported?"html":"richText":n||"html";this._tooltipContent="richText"===i?new tB(t):new eB(t,{appendTo:r.get("appendToBody",!0)?"body":r.get("appendTo",!0)})}},t.prototype.render=function(e,t,n){if(!d.node&&n.getDom()){this.group.removeAll(),this._tooltipModel=e,this._ecModel=t,this._api=n;var r=this._tooltipContent;r.update(e),r.setEnterable(e.get("enterable")),this._initGlobalListener(),this._keepShow(),"richText"!==this._renderMode&&e.get("transitionDuration")?cm(this,"_updatePosition",50,"fixRate"):hm(this,"_updatePosition")}},t.prototype._initGlobalListener=function(){var e=this._tooltipModel.get("triggerOn");ck("itemTooltip",this._api,K((function(t,n,r){"none"!==e&&(e.indexOf(t)>=0?this._tryShow(n,r):"leave"===t&&this._hide(r))}),this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api,r=e.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==r&&"click"!==r){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!n.isDisposed()&&i.manuallyShowTip(e,t,n,{x:i._lastX,y:i._lastY,dataByCoordSys:i._lastDataByCoordSys})}))}},t.prototype.manuallyShowTip=function(e,t,n,r){if(r.from!==this.uid&&!d.node&&n.getDom()){var i=lB(r,n);this._ticket="";var o=r.dataByCoordSys,a=function(e,t,n){var r=ia(e).queryOptionMap,i=r.keys()[0];if(!i||"series"===i)return;var o=sa(t,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),a=o.models[0];if(!a)return;var s,l=n.getViewOfComponentModel(a);if(l.group.traverse((function(t){var n=bl(t).tooltipConfig;if(n&&n.name===e.name)return s=t,!0})),s)return{componentMainType:i,componentIndex:a.componentIndex,el:s}}(r,t,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:r.position,positionDefault:"bottom"},i)}else if(r.tooltip&&null!=r.x&&null!=r.y){var l=oB;l.x=r.x,l.y=r.y,l.update(),bl(l).tooltipConfig={name:null,option:r.tooltip},this._tryShow({offsetX:r.x,offsetY:r.y,target:l},i)}else if(o)this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,dataByCoordSys:o,tooltipOption:r.tooltipOption},i);else if(null!=r.seriesIndex){if(this._manuallyAxisShowTip(e,t,n,r))return;var u=gk(r,t),c=u.point[0],h=u.point[1];null!=c&&null!=h&&this._tryShow({offsetX:c,offsetY:h,target:u.el,position:r.position,positionDefault:"bottom"},i)}else null!=r.x&&null!=r.y&&(n.dispatchAction({type:"updateAxisPointer",x:r.x,y:r.y}),this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,target:n.getZr().findHover(r.x,r.y).target},i))}},t.prototype.manuallyHideTip=function(e,t,n,r){var i=this._tooltipContent;this._tooltipModel&&i.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,r.from!==this.uid&&this._hide(lB(r,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,r){var i=r.seriesIndex,o=r.dataIndex,a=t.getComponent("axisPointer").coordSysAxesInfo;if(null!=i&&null!=o&&null!=a){var s=t.getSeriesByIndex(i);if(s)if("axis"===sB([s.getData().getItemModel(o),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:i,dataIndex:o,position:r.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var r=e.dataByCoordSys;if(r&&r.length)this._showAxisTooltip(r,e);else if(n){var i,o;if("legend"===bl(n).ssrType)return;this._lastDataByCoordSys=null,ev(n,(function(e){return null!=bl(e).dataIndex?(i=e,!0):null!=bl(e).tooltipConfig?(o=e,!0):void 0}),!0),i?this._showSeriesItemTooltip(e,i,t):o?this._showComponentItemTooltip(e,o,t):this._hide(t)}else this._lastDataByCoordSys=null,this._hide(t)}},t.prototype._showOrMove=function(e,t){var n=e.get("showDelay");t=K(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,r=this._tooltipModel,i=[t.offsetX,t.offsetY],o=sB([t.tooltipOption],r),a=this._renderMode,s=[],l=Cg("section",{blocks:[],noHeader:!0}),u=[],c=new zg;W(e,(function(e){W(e.dataByAxis,(function(e){var t=n.getComponent(e.axisDim+"Axis",e.axisIndex),i=e.value;if(t&&null!=i){var o=$R(i,t.axis,n,e.seriesDataIndices,e.valueLabelOpt),h=Cg("section",{header:o,noHeader:!ve(o),sortBlocks:!0,blocks:[]});l.blocks.push(h),W(e.seriesDataIndices,(function(l){var d=n.getSeriesByIndex(l.seriesIndex),p=l.dataIndexInside,f=d.getDataParams(p);if(!(f.dataIndex<0)){f.axisDim=e.axisDim,f.axisIndex=e.axisIndex,f.axisType=e.axisType,f.axisId=e.axisId,f.axisValue=Zx(t.axis,{value:i}),f.axisValueLabel=o,f.marker=c.makeTooltipMarker("item",Gd(f.color),a);var g=Hf(d.formatTooltip(p,!0,null)),m=g.frag;if(m){var v=sB([d],r).get("valueFormatter");h.blocks.push(v?z({valueFormatter:v},m):m)}g.text&&u.push(g.text),s.push(f)}}))}}))})),l.blocks.reverse(),u.reverse();var h=t.position,d=o.get("order"),p=Ng(l,c,a,d,n.get("useUTC"),o.get("textStyle"));p&&u.unshift(p);var f="richText"===a?"\n\n":"<br/>",g=u.join(f);this._showOrMove(o,(function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(o,h,i[0],i[1],this._tooltipContent,s):this._showTooltipContent(o,g,s,Math.random()+"",i[0],i[1],h,null,c)}))},t.prototype._showSeriesItemTooltip=function(e,t,n){var r=this._ecModel,i=bl(t),o=i.seriesIndex,a=r.getSeriesByIndex(o),s=i.dataModel||a,l=i.dataIndex,u=i.dataType,c=s.getData(u),h=this._renderMode,d=e.positionDefault,p=sB([c.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),f=p.get("trigger");if(null==f||"item"===f){var g=s.getDataParams(l,u),m=new zg;g.marker=m.makeTooltipMarker("item",Gd(g.color),h);var v=Hf(s.formatTooltip(l,!1,u)),y=p.get("order"),_=p.get("valueFormatter"),x=v.frag,b=x?Ng(_?z({valueFormatter:_},x):x,m,h,y,r.get("useUTC"),p.get("textStyle")):v.text,w="item_"+s.name+"_"+l;this._showOrMove(p,(function(){this._showTooltipContent(p,b,g,w,e.offsetX,e.offsetY,e.position,e.target,m)})),n({type:"showTip",dataIndexInside:l,dataIndex:c.getRawIndex(l),seriesIndex:o,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var r="html"===this._renderMode,i=bl(t),o=i.tooltipConfig.option||{},a=o.encodeHTMLContent;if(ee(o)){o={content:o,formatter:o},a=!0}a&&r&&o.content&&((o=O(o)).content=dt(o.content));var s=[o],l=this._ecModel.getComponent(i.componentMainType,i.componentIndex);l&&s.push(l),s.push({formatter:o.content});var u=e.positionDefault,c=sB(s,this._tooltipModel,u?{position:u}:null),h=c.get("content"),d=Math.random()+"",p=new zg;this._showOrMove(c,(function(){var n=O(c.get("formatterParams")||{});this._showTooltipContent(c,h,n,d,e.offsetX,e.offsetY,e.position,t,p)})),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,r,i,o,a,s,l){if(this._ticket="",e.get("showContent")&&e.get("show")){var u=this._tooltipContent;u.setEnterable(e.get("enterable"));var c=e.get("formatter");a=a||e.get("position");var h=t,d=this._getNearestPoint([i,o],n,e.get("trigger"),e.get("borderColor")).color;if(c)if(ee(c)){var p=e.ecModel.get("useUTC"),f=J(n)?n[0]:n;h=c,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(h=gd(f.axisValue,h,p)),h=Vd(h,n,!0)}else if(Q(c)){var g=K((function(t,r){t===this._ticket&&(u.setContent(r,l,e,d,a),this._updatePosition(e,a,i,o,u,n,s))}),this);this._ticket=r,h=c(n,r,g)}else h=c;u.setContent(h,l,e,d,a),u.show(e,d),this._updatePosition(e,a,i,o,u,n,s)}},t.prototype._getNearestPoint=function(e,t,n,r){return"axis"===n||J(t)?{color:r||("html"===this._renderMode?"#fff":"none")}:J(t)?void 0:{color:r||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,r,i,o,a){var s=this._api.getWidth(),l=this._api.getHeight();t=t||e.get("position");var u=i.getSize(),c=e.get("align"),h=e.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),Q(t)&&(t=t([n,r],o,i.el,d,{viewSize:[s,l],contentSize:u.slice()})),J(t))n=oo(t[0],s),r=oo(t[1],l);else if(re(t)){var p=t;p.width=u[0],p.height=u[1];var f=Zd(p,{width:s,height:l});n=f.x,r=f.y,c=null,h=null}else if(ee(t)&&a){var g=function(e,t,n,r){var i=n[0],o=n[1],a=Math.ceil(Math.SQRT2*r)+8,s=0,l=0,u=t.width,c=t.height;switch(e){case"inside":s=t.x+u/2-i/2,l=t.y+c/2-o/2;break;case"top":s=t.x+u/2-i/2,l=t.y-o-a;break;case"bottom":s=t.x+u/2-i/2,l=t.y+c+a;break;case"left":s=t.x-i-a,l=t.y+c/2-o/2;break;case"right":s=t.x+u+a,l=t.y+c/2-o/2}return[s,l]}(t,d,u,e.get("borderWidth"));n=g[0],r=g[1]}else{g=function(e,t,n,r,i,o,a){var s=n.getSize(),l=s[0],u=s[1];null!=o&&(e+l+o+2>r?e-=l+o:e+=o);null!=a&&(t+u+a>i?t-=u+a:t+=a);return[e,t]}(n,r,i,s,l,c?null:20,h?null:20);n=g[0],r=g[1]}if(c&&(n-=uB(c)?u[0]/2:"right"===c?u[0]:0),h&&(r-=uB(h)?u[1]/2:"bottom"===h?u[1]:0),WV(e)){g=function(e,t,n,r,i){var o=n.getSize(),a=o[0],s=o[1];return e=Math.min(e+a,r)-a,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}(n,r,i,s,l);n=g[0],r=g[1]}i.moveTo(n,r)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,r=this._cbParamsList,i=!!n&&n.length===e.length;return i&&W(n,(function(n,o){var a=n.dataByAxis||[],s=(e[o]||{}).dataByAxis||[];(i=i&&a.length===s.length)&&W(a,(function(e,n){var o=s[n]||{},a=e.seriesDataIndices||[],l=o.seriesDataIndices||[];(i=i&&e.value===o.value&&e.axisType===o.axisType&&e.axisId===o.axisId&&a.length===l.length)&&W(a,(function(e,t){var n=l[t];i=i&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex})),r&&W(e.seriesDataIndices,(function(e){var n=e.seriesIndex,o=t[n],a=r[n];o&&a&&a.data!==o.data&&(i=!1)}))}))})),this._lastDataByCoordSys=e,this._cbParamsList=t,!!i},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,t){!d.node&&t.getDom()&&(hm(this,"_updatePosition"),this._tooltipContent.dispose(),pk("itemTooltip",t))},t.type="tooltip",t}(Kg);function sB(e,t,n){var r,i=t.ecModel;n?(r=new Wh(n,i,i),r=new Wh(t.option,r,i)):r=t;for(var o=e.length-1;o>=0;o--){var a=e[o];a&&(a instanceof Wh&&(a=a.get("tooltip",!0)),ee(a)&&(a={formatter:a}),a&&(r=new Wh(a,r,i)))}return r}function lB(e,t){return e.dispatchAction||K(t.dispatchAction,t)}function uB(e){return"center"===e||"middle"===e}var cB=["rect","polygon","keep","clear"];function hB(e,t){var n=Go(e?e.brush:[]);if(n.length){var r=[];W(n,(function(e){var t=e.hasOwnProperty("toolbox")?e.toolbox:[];t instanceof Array&&(r=r.concat(t))}));var i=e&&e.toolbox;J(i)&&(i=i[0]),i||(i={feature:{}},e.toolbox=[i]);var o=i.feature||(i.feature={}),a=o.brush||(o.brush={}),s=a.type||(a.type=[]);s.push.apply(s,r),function(e){var t={};W(e,(function(e){t[e]=1})),e.length=0,W(t,(function(t,n){e.push(n)}))}(s),t&&!s.length&&s.push.apply(s,cB)}}var dB=W;function pB(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!0}function fB(e,t,n){var r={};return dB(t,(function(t){var i,o=r[t]=((i=function(){}).prototype.__hidden=i.prototype,new i);dB(e[t],(function(e,r){if(sI.isValidType(r)){var i={type:r,visual:e};n&&n(i,t),o[r]=new sI(i),"opacity"===r&&((i=O(i)).type="colorAlpha",o.__hidden.__alphaForOpacity=new sI(i))}}))})),r}function gB(e,t,n){var r;W(n,(function(e){t.hasOwnProperty(e)&&pB(t[e])&&(r=!0)})),r&&W(n,(function(n){t.hasOwnProperty(n)&&pB(t[n])?e[n]=O(t[n]):delete e[n]}))}var mB={lineX:vB(0),lineY:vB(1),rect:{point:function(e,t,n){return e&&n.boundingRect.contain(e[0],e[1])},rect:function(e,t,n){return e&&n.boundingRect.intersect(e)}},polygon:{point:function(e,t,n){return e&&n.boundingRect.contain(e[0],e[1])&&ab(n.range,e[0],e[1])},rect:function(e,t,n){var r=n.range;if(!e||r.length<=1)return!1;var i=e.x,o=e.y,a=e.width,s=e.height,l=r[0];return!!(ab(r,i,o)||ab(r,i+a,o)||ab(r,i,o+s)||ab(r,i+a,o+s)||jt.create(e).contain(l[0],l[1])||ch(i,o,i+a,o,r)||ch(i,o,i,o+s,r)||ch(i+a,o,i+a,o+s,r)||ch(i,o+s,i+a,o+s,r))||void 0}}};function vB(e){var t=["x","y"],n=["width","height"];return{point:function(t,n,r){if(t){var i=r.range;return yB(t[e],i)}},rect:function(r,i,o){if(r){var a=o.range,s=[r[t[e]],r[t[e]]+r[n[e]]];return s[1]<s[0]&&s.reverse(),yB(s[0],a)||yB(s[1],a)||yB(a[0],s)||yB(a[1],s)}}}}function yB(e,t){return t[0]<=e&&e<=t[1]}var _B=["inBrush","outOfBrush"],xB="__ecBrushSelect",bB="__ecInBrushSelectEvent";function wB(e){e.eachComponent({mainType:"brush"},(function(t){(t.brushTargetManager=new MV(t.option,e)).setInputRanges(t.areas,e)}))}function SB(e,t,n){var r,i,o=[];e.eachComponent({mainType:"brush"},(function(e){n&&"takeGlobalCursor"===n.type&&e.setBrushOption("brush"===n.key?n.brushOption:{brushType:!1})})),wB(e),e.eachComponent({mainType:"brush"},(function(t,n){var a={brushId:t.id,brushIndex:n,brushName:t.name,areas:O(t.areas),selected:[]};o.push(a);var s=t.option,l=s.brushLink,u=[],c=[],h=[],d=!1;n||(r=s.throttleType,i=s.throttleDelay);var p=j(t.areas,(function(e){var t=CB[e.brushType],n=V({boundingRect:t?t(e):void 0},e);return n.selectors=function(e){var t=e.brushType,n={point:function(r){return mB[t].point(r,n,e)},rect:function(r){return mB[t].rect(r,n,e)}};return n}(n),n})),f=fB(t.option,_B,(function(e){e.mappingMethod="fixed"}));function g(e){return"all"===l||!!u[e]}function m(e){return!!e.length}J(l)&&W(l,(function(e){u[e]=1})),e.eachSeries((function(n,r){var i=h[r]=[];"parallel"===n.subType?function(e,t){var n=e.coordinateSystem;d=d||n.hasAxisBrushed(),g(t)&&n.eachActiveState(e.getData(),(function(e,t){"active"===e&&(c[t]=1)}))}(n,r):function(n,r,i){if(!n.brushSelector||function(e,t){var n=e.option.seriesIndex;return null!=n&&"all"!==n&&(J(n)?F(n,t)<0:t!==n)}(t,r))return;if(W(p,(function(r){t.brushTargetManager.controlSeries(r,n,e)&&i.push(r),d=d||m(i)})),g(r)&&m(i)){var o=n.getData();o.each((function(e){MB(n,i,o,e)&&(c[e]=1)}))}}(n,r,i)})),e.eachSeries((function(e,t){var n={seriesId:e.id,seriesIndex:t,seriesName:e.name,dataIndex:[]};a.selected.push(n);var r=h[t],i=e.getData(),o=g(t)?function(e){return c[e]?(n.dataIndex.push(i.getRawIndex(e)),"inBrush"):"outOfBrush"}:function(t){return MB(e,r,i,t)?(n.dataIndex.push(i.getRawIndex(t)),"inBrush"):"outOfBrush"};(g(t)?d:m(r))&&function(e,t,n,r,i){var o,a={};function s(e){return qm(n,o,e)}function l(e,t){$m(n,o,e,t)}W(e,(function(e){var n=sI.prepareVisualTypes(t[e]);a[e]=n})),n.each((function(e,u){o=e;var c=n.getRawDataItem(o);if(!c||!1!==c.visualMap)for(var h=r.call(i,e),d=t[h],p=a[h],f=0,g=p.length;f<g;f++){var m=p[f];d[m]&&d[m].applyVisual(e,s,l)}}))}(_B,f,i,o)}))})),function(e,t,n,r,i){if(!i)return;var o=e.getZr();if(o[bB])return;o[xB]||(o[xB]=TB);var a=cm(o,xB,n,t);a(e,r)}(t,r,i,o,n)}function TB(e,t){if(!e.isDisposed()){var n=e.getZr();n[bB]=!0,e.dispatchAction({type:"brushSelect",batch:t}),n[bB]=!1}}function MB(e,t,n,r){for(var i=0,o=t.length;i<o;i++){var a=t[i];if(e.brushSelector(r,n,a.selectors,a))return!0}}var CB={rect:function(e){return DB(e.range)},polygon:function(e){for(var t,n=e.range,r=0,i=n.length;r<i;r++){t=t||[[1/0,-1/0],[1/0,-1/0]];var o=n[r];o[0]<t[0][0]&&(t[0][0]=o[0]),o[0]>t[0][1]&&(t[0][1]=o[0]),o[1]<t[1][0]&&(t[1][0]=o[1]),o[1]>t[1][1]&&(t[1][1]=o[1])}return t&&DB(t)}};function DB(e){return new jt(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var AB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new BL(t.getZr())).on("brush",K(this._onBrush,this)).mount()},t.prototype.render=function(e,t,n,r){this.model=e,this._updateController(e,t,n,r)},t.prototype.updateTransform=function(e,t,n,r){wB(t),this._updateController(e,t,n,r)},t.prototype.updateVisual=function(e,t,n,r){this.updateTransform(e,t,n,r)},t.prototype.updateView=function(e,t,n,r){this._updateController(e,t,n,r)},t.prototype._updateController=function(e,t,n,r){(!r||r.$from!==e.id)&&this._brushController.setPanels(e.brushTargetManager.makePanelOpts(n)).enableBrush(e.brushOption).updateCovers(e.areas.slice())},t.prototype.dispose=function(){this._brushController.dispose()},t.prototype._onBrush=function(e){var t=this.model.id,n=this.model.brushTargetManager.setOutputRanges(e.areas,this.ecModel);(!e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:t,areas:O(n),$from:t}),e.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:t,areas:O(n),$from:t})},t.type="brush",t}(Kg),IB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.areas=[],n.brushOption={},n}return l(t,e),t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&gB(n,e,["inBrush","outOfBrush"]);var r=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:"#ddd"},r.hasOwnProperty("liftZ")||(r.liftZ=5)},t.prototype.setAreas=function(e){"production"!==process.env.NODE_ENV&&(me(J(e)),W(e,(function(e){me(e.brushType,"Illegal areas")}))),e&&(this.areas=j(e,(function(e){return EB(this.option,e)}),this))},t.prototype.setBrushOption=function(e){this.brushOption=EB(this.option,e),this.brushType=this.brushOption.brushType},t.type="brush",t.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],t.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},t}(tp);function EB(e,t){return R({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new Wh(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var LB=["rect","polygon","lineX","lineY","keep","clear"],NB=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.render=function(e,t,n){var r,i,o;t.eachComponent({mainType:"brush"},(function(e){r=e.brushType,i=e.brushOption.brushMode||"single",o=o||!!e.areas.length})),this._brushType=r,this._brushMode=i,W(e.get("type",!0),(function(t){e.setIconStatus(t,("keep"===t?"multiple"===i:"clear"===t?o:t===r)?"emphasis":"normal")}))},t.prototype.updateView=function(e,t,n){this.render(e,t,n)},t.prototype.getIcons=function(){var e=this.model,t=e.get("icon",!0),n={};return W(e.get("type",!0),(function(e){t[e]&&(n[e]=t[e])})),n},t.prototype.onclick=function(e,t,n){var r=this._brushType,i=this._brushMode;"clear"===n?(t.dispatchAction({type:"axisAreaSelect",intervals:[]}),t.dispatchAction({type:"brush",command:"clear",areas:[]})):t.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===n?r:r!==n&&n,brushMode:"keep"===n?"multiple"===i?"single":"multiple":i}})},t.getDefaultOption=function(e){return{show:!0,type:LB.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:e.getLocaleModel().get(["toolbox","brush","title"])}},t}(tV);var PB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:"box",ignoreSize:!0},n}return l(t,e),t.type="title",t.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},t}(tp),OB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.render=function(e,t,n){if(this.group.removeAll(),e.get("show")){var r=this.group,i=e.getModel("textStyle"),o=e.getModel("subtextStyle"),a=e.get("textAlign"),s=de(e.get("textBaseline"),e.get("textVerticalAlign")),l=new ll({style:wh(i,{text:e.get("text"),fill:i.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),c=e.get("subtext"),h=new ll({style:wh(o,{text:c,fill:o.getTextColor(),y:u.height+e.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=e.get("link"),p=e.get("sublink"),f=e.get("triggerEvent",!0);l.silent=!d&&!f,h.silent=!p&&!f,d&&l.on("click",(function(){Hd(d,"_"+e.get("target"))})),p&&h.on("click",(function(){Hd(p,"_"+e.get("subtarget"))})),bl(l).eventData=bl(h).eventData=f?{componentType:"title",componentIndex:e.componentIndex}:null,r.add(l),c&&r.add(h);var g=r.getBoundingRect(),m=e.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=Zd(m,{width:n.getWidth(),height:n.getHeight()},e.get("padding"));a||("middle"===(a=e.get("left")||e.get("right"))&&(a="center"),"right"===a?v.x+=v.width:"center"===a&&(v.x+=v.width/2)),s||("center"===(s=e.get("top")||e.get("bottom"))&&(s="middle"),"bottom"===s?v.y+=v.height:"middle"===s&&(v.y+=v.height/2),s=s||"top"),r.x=v.x,r.y=v.y,r.markRedraw();var y={align:a,verticalAlign:s};l.setStyle(y),h.setStyle(y),g=r.getBoundingRect();var _=v.margin,x=e.getItemStyle(["color","opacity"]);x.fill=e.get("backgroundColor");var b=new ol({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:e.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});r.add(b)}},t.type="title",t}(Kg);var RB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode="box",n}return l(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._initData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this._initData()},t.prototype.setCurrentIndex=function(e){null==e&&(e=this.option.currentIndex);var t=this._data.count();this.option.loop?e=(e%t+t)%t:(e>=t&&(e=t-1),e<0&&(e=0)),this.option.currentIndex=e},t.prototype.getCurrentIndex=function(){return this.option.currentIndex},t.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},t.prototype.setPlayState=function(e){this.option.autoPlay=!!e},t.prototype.getPlayState=function(){return!!this.option.autoPlay},t.prototype._initData=function(){var e,t=this.option,n=t.data||[],r=t.axisType,i=this._names=[];"category"===r?(e=[],W(n,(function(t,n){var r,o=qo(Wo(t),"");re(t)?(r=O(t)).value=n:r=n,e.push(r),i.push(o)}))):e=n;var o={category:"ordinal",time:"time",value:"number"}[r]||"number";(this._data=new R_([{name:"value",type:o}],this)).initData(e,i)},t.prototype.getData=function(){return this._data},t.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},t.type="timeline",t.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},t}(tp),kB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="timeline.slider",t.defaultOption=Yh(RB.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),t}(RB);H(kB,Gf.prototype);var zB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="timeline",t}(Kg),VB=function(e){function t(t,n,r,i){var o=e.call(this,t,n,r)||this;return o.type=i||"value",o}return l(t,e),t.prototype.getLabelModel=function(){return this.model.getModel("label")},t.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},t}(Ob),BB=Math.PI,FB=ta(),GB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(e,t){this.api=t},t.prototype.render=function(e,t,n){if(this.model=e,this.api=n,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var r=this._layout(e,n),i=this._createGroup("_mainGroup"),o=this._createGroup("_labelGroup"),a=this._axis=this._createAxis(r,e);e.formatTooltip=function(e){return Cg("nameValue",{noName:!0,value:a.scale.getLabel({value:e})})},W(["AxisLine","AxisTick","Control","CurrentPointer"],(function(t){this["_render"+t](r,i,a,e)}),this),this._renderAxisLabel(r,o,a,e),this._position(r,e)}this._doPlayStop(),this._updateTicksStatus()},t.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},t.prototype.dispose=function(){this._clearTimer()},t.prototype._layout=function(e,t){var n,r,i,o,a=e.get(["label","position"]),s=e.get("orient"),l=function(e,t){return Zd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()},e.get("padding"))}(e,t),u={horizontal:"center",vertical:(n=null==a||"auto"===a?"horizontal"===s?l.y+l.height/2<t.getHeight()/2?"-":"+":l.x+l.width/2<t.getWidth()/2?"+":"-":ee(a)?{horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[s][a]:a)>=0||"+"===n?"left":"right"},c={horizontal:n>=0||"+"===n?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:BB/2},d="vertical"===s?l.height:l.width,p=e.getModel("controlStyle"),f=p.get("show",!0),g=f?p.get("itemSize"):0,m=f?p.get("itemGap"):0,v=g+m,y=e.get(["label","rotate"])||0;y=y*BB/180;var _=p.get("position",!0),x=f&&p.get("showPlayBtn",!0),b=f&&p.get("showPrevBtn",!0),w=f&&p.get("showNextBtn",!0),S=0,T=d;"left"===_||"bottom"===_?(x&&(r=[0,0],S+=v),b&&(i=[S,0],S+=v),w&&(o=[T-g,0],T-=v)):(x&&(r=[T-g,0],T-=v),b&&(i=[0,0],S+=v),w&&(o=[T-g,0],T-=v));var M=[S,T];return e.get("inverse")&&M.reverse(),{viewRect:l,mainLength:d,orient:s,rotation:h[s],labelRotation:y,labelPosOpt:n,labelAlign:e.get(["label","align"])||u[s],labelBaseline:e.get(["label","verticalAlign"])||e.get(["label","baseline"])||c[s],playPosition:r,prevBtnPosition:i,nextBtnPosition:o,axisExtent:M,controlSize:g,controlGap:m}},t.prototype._position=function(e,t){var n=this._mainGroup,r=this._labelGroup,i=e.viewRect;if("vertical"===e.orient){var o=[1,0,0,1,0,0],a=i.x,s=i.y+i.height;Et(o,o,[-a,-s]),Lt(o,o,-BB/2),Et(o,o,[a,s]),(i=i.clone()).applyTransform(o)}var l=m(i),u=m(n.getBoundingRect()),c=m(r.getBoundingRect()),h=[n.x,n.y],d=[r.x,r.y];d[0]=h[0]=l[0][0];var p,f=e.labelPosOpt;null==f||ee(f)?(v(h,u,l,1,p="+"===f?0:1),v(d,c,l,1,1-p)):(v(h,u,l,1,p=f>=0?0:1),d[1]=h[1]+f);function g(e){e.originX=l[0][0]-e.x,e.originY=l[1][0]-e.y}function m(e){return[[e.x,e.x+e.width],[e.y,e.y+e.height]]}function v(e,t,n,r,i){e[r]+=n[r][i]-t[r][i]}n.setPosition(h),r.setPosition(d),n.rotation=r.rotation=e.rotation,g(n),g(r)},t.prototype._createAxis=function(e,t){var n=t.getData(),r=t.get("axisType"),i=function(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new ix({ordinalMeta:e.getCategories(),extent:[1/0,-1/0]});case"time":return new xx({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new ax}}(t,r);i.getTicks=function(){return n.mapArray(["value"],(function(e){return{value:e}}))};var o=n.getDataExtent("value");i.setExtent(o[0],o[1]),i.calcNiceTicks();var a=new VB("value",i,e.axisExtent,r);return a.model=t,a},t.prototype._createGroup=function(e){var t=this[e]=new Yi;return this.group.add(t),t},t.prototype._renderAxisLine=function(e,t,n,r){var i=n.getExtent();if(r.get(["lineStyle","show"])){var o=new pc({shape:{x1:i[0],y1:0,x2:i[1],y2:0},style:z({lineCap:"round"},r.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});t.add(o);var a=this._progressLine=new pc({shape:{x1:i[0],x2:this._currentPointer?this._currentPointer.x:i[0],y1:0,y2:0},style:V({lineCap:"round",lineWidth:o.style.lineWidth},r.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});t.add(a)}},t.prototype._renderAxisTick=function(e,t,n,r){var i=this,o=r.getData(),a=n.scale.getTicks();this._tickSymbols=[],W(a,(function(e){var a=n.dataToCoord(e.value),s=o.getItemModel(e.value),l=s.getModel("itemStyle"),u=s.getModel(["emphasis","itemStyle"]),c=s.getModel(["progress","itemStyle"]),h={x:a,y:0,onclick:K(i._changeTimeline,i,e.value)},d=HB(s,l,t,h);d.ensureState("emphasis").style=u.getItemStyle(),d.ensureState("progress").style=c.getItemStyle(),uu(d);var p=bl(d);s.get("tooltip")?(p.dataIndex=e.value,p.dataModel=r):p.dataIndex=p.dataModel=null,i._tickSymbols.push(d)}))},t.prototype._renderAxisLabel=function(e,t,n,r){var i=this;if(n.getLabelModel().get("show")){var o=r.getData(),a=n.getViewLabels();this._tickLabels=[],W(a,(function(r){var a=r.tickValue,s=o.getItemModel(a),l=s.getModel("label"),u=s.getModel(["emphasis","label"]),c=s.getModel(["progress","label"]),h=n.dataToCoord(r.tickValue),d=new ll({x:h,y:0,rotation:e.labelRotation-e.rotation,onclick:K(i._changeTimeline,i,a),silent:!1,style:wh(l,{text:r.formattedLabel,align:e.labelAlign,verticalAlign:e.labelBaseline})});d.ensureState("emphasis").style=wh(u),d.ensureState("progress").style=wh(c),t.add(d),uu(d),FB(d).dataIndex=a,i._tickLabels.push(d)}))}},t.prototype._renderControl=function(e,t,n,r){var i=e.controlSize,o=e.rotation,a=r.getModel("controlStyle").getItemStyle(),s=r.getModel(["emphasis","controlStyle"]).getItemStyle(),l=r.getPlayState(),u=r.get("inverse",!0);function c(e,n,l,u){if(e){var c=Ri(de(r.get(["controlStyle",n+"BtnSize"]),i),i),h=function(e,t,n,r){var i=r.style,o=uh(e.get(["controlStyle",t]),r||{},new jt(n[0],n[1],n[2],n[3]));i&&o.setStyle(i);return o}(r,n+"Icon",[0,-c/2,c,c],{x:e[0],y:e[1],originX:i/2,originY:0,rotation:u?-o:0,rectHover:!0,style:a,onclick:l});h.ensureState("emphasis").style=s,t.add(h),uu(h)}}c(e.nextBtnPosition,"next",K(this._changeTimeline,this,u?"-":"+")),c(e.prevBtnPosition,"prev",K(this._changeTimeline,this,u?"+":"-")),c(e.playPosition,l?"stop":"play",K(this._handlePlayClick,this,!l),!0)},t.prototype._renderCurrentPointer=function(e,t,n,r){var i=r.getData(),o=r.getCurrentIndex(),a=i.getItemModel(o).getModel("checkpointStyle"),s=this,l={onCreate:function(e){e.draggable=!0,e.drift=K(s._handlePointerDrag,s),e.ondragend=K(s._handlePointerDragend,s),UB(e,s._progressLine,o,n,r,!0)},onUpdate:function(e){UB(e,s._progressLine,o,n,r)}};this._currentPointer=HB(a,a,this._mainGroup,{},this._currentPointer,l)},t.prototype._handlePlayClick=function(e){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:e,from:this.uid})},t.prototype._handlePointerDrag=function(e,t,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},t.prototype._handlePointerDragend=function(e){this._pointerChangeTimeline([e.offsetX,e.offsetY],!0)},t.prototype._pointerChangeTimeline=function(e,t){var n=this._toAxisCoord(e)[0],r=so(this._axis.getExtent().slice());n>r[1]&&(n=r[1]),n<r[0]&&(n=r[0]),this._currentPointer.x=n,this._currentPointer.markRedraw();var i=this._progressLine;i&&(i.shape.x2=n,i.dirty());var o=this._findNearestTick(n),a=this.model;(t||o!==a.getCurrentIndex()&&a.get("realtime"))&&this._changeTimeline(o)},t.prototype._doPlayStop=function(){var e=this;this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout((function(){var t=e.model;e._changeTimeline(t.getCurrentIndex()+(t.get("rewind",!0)?-1:1))}),this.model.get("playInterval")))},t.prototype._toAxisCoord=function(e){return rh(e,this._mainGroup.getLocalTransform(),!0)},t.prototype._findNearestTick=function(e){var t,n=this.model.getData(),r=1/0,i=this._axis;return n.each(["value"],(function(n,o){var a=i.dataToCoord(n),s=Math.abs(a-e);s<r&&(r=s,t=o)})),t},t.prototype._clearTimer=function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},t.prototype._changeTimeline=function(e){var t=this.model.getCurrentIndex();"+"===e?e=t+1:"-"===e&&(e=t-1),this.api.dispatchAction({type:"timelineChange",currentIndex:e,from:this.uid})},t.prototype._updateTicksStatus=function(){var e=this.model.getCurrentIndex(),t=this._tickSymbols,n=this._tickLabels;if(t)for(var r=0;r<t.length;r++)t&&t[r]&&t[r].toggleState("progress",r<e);if(n)for(r=0;r<n.length;r++)n&&n[r]&&n[r].toggleState("progress",FB(n[r]).dataIndex<=e)},t.type="timeline.slider",t}(zB);function HB(e,t,n,r,i,o){var a=t.get("color");i?(i.setColor(a),n.add(i),o&&o.onUpdate(i)):((i=dv(e.get("symbol"),-1,-1,2,2,a)).setStyle("strokeNoScale",!0),n.add(i),o&&o.onCreate(i));var s=t.getItemStyle(["color"]);i.setStyle(s),r=R({rectHover:!0,z2:100},r,!0);var l=pv(e.get("symbolSize"));r.scaleX=l[0]/2,r.scaleY=l[1]/2;var u=fv(e.get("symbolOffset"),l);u&&(r.x=(r.x||0)+u[0],r.y=(r.y||0)+u[1]);var c=e.get("symbolRotate");return r.rotation=(c||0)*Math.PI/180||0,i.attr(r),i.updateTransform(),i}function UB(e,t,n,r,i,o){if(!e.dragging){var a=i.getModel("checkpointStyle"),s=r.dataToCoord(i.getData().get("value",n));if(o||!a.get("animation",!0))e.attr({x:s,y:0}),t&&t.attr({shape:{x2:s}});else{var l={duration:a.get("animationDuration",!0),easing:a.get("animationEasing",!0)};e.stopAnimation(null,!0),e.animateTo({x:s,y:0},l),t&&t.animateTo({shape:{x2:s}},l)}}}function WB(e){var t=e&&e.timeline;J(t)||(t=t?[t]:[]),W(t,(function(e){e&&function(e){var t=e.type,n={number:"value",time:"time"};n[t]&&(e.axisType=n[t],delete e.type);if(jB(e),XB(e,"controlPosition")){var r=e.controlStyle||(e.controlStyle={});XB(r,"position")||(r.position=e.controlPosition),"none"!==r.position||XB(r,"show")||(r.show=!1,delete r.position),delete e.controlPosition}W(e.data||[],(function(e){re(e)&&!J(e)&&(!XB(e,"value")&&XB(e,"name")&&(e.value=e.name),jB(e))}))}(e)}))}function jB(e){var t=e.itemStyle||(e.itemStyle={}),n=t.emphasis||(t.emphasis={}),r=e.label||e.label||{},i=r.normal||(r.normal={}),o={normal:1,emphasis:1};W(r,(function(e,t){o[t]||XB(i,t)||(i[t]=e)})),n.label&&!XB(r,"emphasis")&&(r.emphasis=n.label,delete n.label)}function XB(e,t){return e.hasOwnProperty(t)}function YB(e,t){if(!e)return!1;for(var n=J(e)?e:[e],r=0;r<n.length;r++)if(n[r]&&n[r][t])return!0;return!1}function ZB(e){Ho(e,"label",["show"])}var qB=ta(),KB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.createdBySelf=!1,n}return l(t,e),t.prototype.init=function(e,t,n){if("production"!==process.env.NODE_ENV&&"marker"===this.type)throw new Error("Marker component is abstract component. Use markLine, markPoint, markArea instead.");this.mergeDefaultAndTheme(e,n),this._mergeOption(e,n,!1,!0)},t.prototype.isAnimationEnabled=function(){if(d.node)return!1;var e=this.__hostSeries;return this.getShallow("animation")&&e&&e.isAnimationEnabled()},t.prototype.mergeOption=function(e,t){this._mergeOption(e,t,!1,!1)},t.prototype._mergeOption=function(e,t,n,r){var i=this.mainType;n||t.eachSeries((function(e){var n=e.get(this.mainType,!0),o=qB(e)[i];n&&n.data?(o?o._mergeOption(n,t,!0):(r&&ZB(n),W(n.data,(function(e){e instanceof Array?(ZB(e[0]),ZB(e[1])):ZB(e)})),z(o=this.createMarkerModelFromSeries(n,this,t),{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),o.__hostSeries=e),qB(e)[i]=o):qB(e)[i]=null}),this)},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.getRawValue(e),o=r.getName(e);return Cg("section",{header:this.name,blocks:[Cg("nameValue",{name:o,value:i,noName:!o,noValue:null==i})]})},t.prototype.getData=function(){return this._data},t.prototype.setData=function(e){this._data=e},t.prototype.getDataParams=function(e,t){var n=Gf.prototype.getDataParams.call(this,e,t),r=this.__hostSeries;return r&&(n.seriesId=r.id,n.seriesName=r.name,n.seriesType=r.subType),n},t.getMarkerModelFromSeries=function(e,t){return qB(e)[t]},t.type="marker",t.dependencies=["series","grid","polar","geo"],t}(tp);H(KB,Gf.prototype);var $B=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type="markPoint",t.defaultOption={z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},t}(KB);function JB(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}function QB(e,t,n,r,i,o){var a=[],s=U_(t,r)?t.getCalculationInfo("stackResultDimension"):r,l=oF(t,s,e),u=t.indicesOfNearest(s,l)[0];a[i]=t.get(n,u),a[o]=t.get(s,u);var c=t.get(r,u),h=lo(t.get(r,u));return(h=Math.min(h,20))>=0&&(a[o]=+a[o].toFixed(h)),[a,c]}var eF={min:$(QB,"min"),max:$(QB,"max"),average:$(QB,"average"),median:$(QB,"median")};function tF(e,t){if(t){var n=e.getData(),r=e.coordinateSystem,i=r&&r.dimensions;if(!function(e){return!isNaN(parseFloat(e.x))&&!isNaN(parseFloat(e.y))}(t)&&!J(t.coord)&&J(i)){var o=nF(t,n,r,e);if((t=O(t)).type&&eF[t.type]&&o.baseAxis&&o.valueAxis){var a=F(i,o.baseAxis.dim),s=F(i,o.valueAxis.dim),l=eF[t.type](n,o.baseDataDim,o.valueDataDim,a,s);t.coord=l[0],t.value=l[1]}else t.coord=[null!=t.xAxis?t.xAxis:t.radiusAxis,null!=t.yAxis?t.yAxis:t.angleAxis]}if(null!=t.coord&&J(i))for(var u=t.coord,c=0;c<2;c++)eF[u[c]]&&(u[c]=oF(n,n.mapDimension(i[c]),u[c]));else t.coord=[];return t}}function nF(e,t,n,r){var i={};return null!=e.valueIndex||null!=e.valueDim?(i.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,i.valueAxis=n.getAxis(function(e,t){var n=e.getData().getDimensionInfo(t);return n&&n.coordDim}(r,i.valueDataDim)),i.baseAxis=n.getOtherAxis(i.valueAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim)):(i.baseAxis=r.getBaseAxis(),i.valueAxis=n.getOtherAxis(i.baseAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim),i.valueDataDim=t.mapDimension(i.valueAxis.dim)),i}function rF(e,t){return!(e&&e.containData&&t.coord&&!JB(t))||e.containData(t.coord)}function iF(e,t){return e?function(e,n,r,i){return Xf(i<2?e.coord&&e.coord[i]:e.value,t[i])}:function(e,n,r,i){return Xf(e.value,t[i])}}function oF(e,t,n){if("average"===n){var r=0,i=0;return e.each(t,(function(e,t){isNaN(e)||(r+=e,i++)})),r/i}return"median"===n?e.getMedian(t):e.getDataExtent(t)["max"===n?1:0]}var aF=ta(),sF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.init=function(){this.markerGroupMap=Te()},t.prototype.render=function(e,t,n){var r=this,i=this.markerGroupMap;i.each((function(e){aF(e).keep=!1})),t.eachSeries((function(e){var i=KB.getMarkerModelFromSeries(e,r.type);i&&r.renderSeries(e,i,t,n)})),i.each((function(e){!aF(e).keep&&r.group.remove(e.group)}))},t.prototype.markKeep=function(e){aF(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;W(e,(function(e){var r=KB.getMarkerModelFromSeries(e,n.type);r&&r.getData().eachItemGraphicEl((function(e){e&&(t?Jl(e):Ql(e))}))}))},t.type="marker",t}(Kg);function lF(e,t,n){var r=t.coordinateSystem;e.each((function(i){var o,a=e.getItemModel(i),s=oo(a.get("x"),n.getWidth()),l=oo(a.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(t.getMarkerPosition)o=t.getMarkerPosition(e.getValues(e.dimensions,i));else if(r){var u=e.get(r.dimensions[0],i),c=e.get(r.dimensions[1],i);o=r.dataToPoint([u,c])}}else o=[s,l];isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),e.setItemLayout(i,o)}))}var uF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=KB.getMarkerModelFromSeries(e,"markPoint");t&&(lF(t.getData(),e,n),this.markerGroupMap.get(e.id).updateLayout())}),this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,o=e.id,a=e.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new qS),u=function(e,t,n){var r;r=e?j(e&&e.dimensions,(function(e){return z(z({},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})})):[{name:"value",type:"float"}];var i=new R_(r,n),o=j(n.get("data"),$(tF,t));e&&(o=Y(o,$(rF,e)));var a=iF(!!e,r);return i.initData(o,null,a),i}(i,e,t);t.setData(u),lF(t.getData(),e,r),u.each((function(e){var n=u.getItemModel(e),r=n.getShallow("symbol"),i=n.getShallow("symbolSize"),o=n.getShallow("symbolRotate"),s=n.getShallow("symbolOffset"),l=n.getShallow("symbolKeepAspect");if(Q(r)||Q(i)||Q(o)||Q(s)){var c=t.getRawValue(e),h=t.getDataParams(e);Q(r)&&(r=r(c,h)),Q(i)&&(i=i(c,h)),Q(o)&&(o=o(c,h)),Q(s)&&(s=s(c,h))}var d=n.getModel("itemStyle").getItemStyle(),p=Km(a,"color");d.fill||(d.fill=p),u.setItemVisual(e,{symbol:r,symbolSize:i,symbolRotate:o,symbolOffset:s,symbolKeepAspect:l,style:d})})),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl((function(e){e.traverse((function(e){bl(e).dataModel=t}))})),this.markKeep(l),l.group.silent=t.get("silent")||e.get("silent")},t.type="markPoint",t}(sF);var cF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type="markLine",t.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},t}(KB),hF=ta(),dF=function(e,t,n,r){var i,o=e.getData();if(J(r))i=r;else{var a=r.type;if("min"===a||"max"===a||"average"===a||"median"===a||null!=r.xAxis||null!=r.yAxis){var s=void 0,l=void 0;if(null!=r.yAxis||null!=r.xAxis)s=t.getAxis(null!=r.yAxis?"y":"x"),l=he(r.yAxis,r.xAxis);else{var u=nF(r,o,t,e);s=u.valueAxis,l=oF(o,W_(o,u.valueDataDim),a)}var c="x"===s.dim?0:1,h=1-c,d=O(r),p={coord:[]};d.type=null,d.coord=[],d.coord[h]=-1/0,p.coord[h]=1/0;var f=n.get("precision");f>=0&&ne(l)&&(l=+l.toFixed(Math.min(f,20))),d.coord[c]=p.coord[c]=l,i=[d,p,{type:a,valueIndex:r.valueIndex,value:l}]}else"production"!==process.env.NODE_ENV&&P("Invalid markLine data."),i=[]}var g=[tF(e,i[0]),tF(e,i[1]),z({},i[2])];return g[2].type=g[2].type||null,R(g[2],g[0]),R(g[2],g[1]),g};function pF(e){return!isNaN(e)&&!isFinite(e)}function fF(e,t,n,r){var i=1-e,o=r.dimensions[e];return pF(t[i])&&pF(n[i])&&t[e]===n[e]&&r.getAxis(o).containData(t[e])}function gF(e,t){if("cartesian2d"===e.type){var n=t[0].coord,r=t[1].coord;if(n&&r&&(fF(1,n,r,e)||fF(0,n,r,e)))return!0}return rF(e,t[0])&&rF(e,t[1])}function mF(e,t,n,r,i){var o,a=r.coordinateSystem,s=e.getItemModel(t),l=oo(s.get("x"),i.getWidth()),u=oo(s.get("y"),i.getHeight());if(isNaN(l)||isNaN(u)){if(r.getMarkerPosition)o=r.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=a.dimensions,h=e.get(c[0],t),d=e.get(c[1],t);o=a.dataToPoint([h,d])}if(uT(a,"cartesian2d")){var p=a.getAxis("x"),f=a.getAxis("y");c=a.dimensions;pF(e.get(c[0],t))?o[0]=p.toGlobalCoord(p.getExtent()[n?0:1]):pF(e.get(c[1],t))&&(o[1]=f.toGlobalCoord(f.getExtent()[n?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];e.setItemLayout(t,o)}var vF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=KB.getMarkerModelFromSeries(e,"markLine");if(t){var r=t.getData(),i=hF(t).from,o=hF(t).to;i.each((function(t){mF(i,t,!0,e,n),mF(o,t,!1,e,n)})),r.each((function(e){r.setItemLayout(e,[i.getItemLayout(e),o.getItemLayout(e)])})),this.markerGroupMap.get(e.id).updateLayout()}}),this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,o=e.id,a=e.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new bE);this.group.add(l.group);var u=function(e,t,n){var r;r=e?j(e&&e.dimensions,(function(e){return z(z({},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})})):[{name:"value",type:"float"}];var i=new R_(r,n),o=new R_(r,n),a=new R_([],n),s=j(n.get("data"),$(dF,t,e,n));e&&(s=Y(s,$(gF,e)));var l=iF(!!e,r);return i.initData(j(s,(function(e){return e[0]})),null,l),o.initData(j(s,(function(e){return e[1]})),null,l),a.initData(j(s,(function(e){return e[2]}))),a.hasItemOption=!0,{from:i,to:o,line:a}}(i,e,t),c=u.from,h=u.to,d=u.line;hF(t).from=c,hF(t).to=h,t.setData(d);var p=t.get("symbol"),f=t.get("symbolSize"),g=t.get("symbolRotate"),m=t.get("symbolOffset");function v(t,n,i){var o=t.getItemModel(n);mF(t,n,i,e,r);var s=o.getModel("itemStyle").getItemStyle();null==s.fill&&(s.fill=Km(a,"color")),t.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:de(o.get("symbolOffset",!0),m[i?0:1]),symbolRotate:de(o.get("symbolRotate",!0),g[i?0:1]),symbolSize:de(o.get("symbolSize"),f[i?0:1]),symbol:de(o.get("symbol",!0),p[i?0:1]),style:s})}J(p)||(p=[p,p]),J(f)||(f=[f,f]),J(g)||(g=[g,g]),J(m)||(m=[m,m]),u.from.each((function(e){v(c,e,!0),v(h,e,!1)})),d.each((function(e){var t=d.getItemModel(e).getModel("lineStyle").getLineStyle();d.setItemLayout(e,[c.getItemLayout(e),h.getItemLayout(e)]),null==t.stroke&&(t.stroke=c.getItemVisual(e,"style").fill),d.setItemVisual(e,{fromSymbolKeepAspect:c.getItemVisual(e,"symbolKeepAspect"),fromSymbolOffset:c.getItemVisual(e,"symbolOffset"),fromSymbolRotate:c.getItemVisual(e,"symbolRotate"),fromSymbolSize:c.getItemVisual(e,"symbolSize"),fromSymbol:c.getItemVisual(e,"symbol"),toSymbolKeepAspect:h.getItemVisual(e,"symbolKeepAspect"),toSymbolOffset:h.getItemVisual(e,"symbolOffset"),toSymbolRotate:h.getItemVisual(e,"symbolRotate"),toSymbolSize:h.getItemVisual(e,"symbolSize"),toSymbol:h.getItemVisual(e,"symbol"),style:t})})),l.updateData(d),u.line.eachItemGraphicEl((function(e){bl(e).dataModel=t,e.traverse((function(e){bl(e).dataModel=t}))})),this.markKeep(l),l.group.silent=t.get("silent")||e.get("silent")},t.type="markLine",t}(sF);var yF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type="markArea",t.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},t}(KB),_F=ta(),xF=function(e,t,n,r){var i=r[0],o=r[1];if(i&&o){var a=tF(e,i),s=tF(e,o),l=a.coord,u=s.coord;l[0]=he(l[0],-1/0),l[1]=he(l[1],-1/0),u[0]=he(u[0],1/0),u[1]=he(u[1],1/0);var c=k([{},a,s]);return c.coord=[a.coord,s.coord],c.x0=a.x,c.y0=a.y,c.x1=s.x,c.y1=s.y,c}};function bF(e){return!isNaN(e)&&!isFinite(e)}function wF(e,t,n,r){var i=1-e;return bF(t[i])&&bF(n[i])}function SF(e,t){var n=t.coord[0],r=t.coord[1],i={coord:n,x:t.x0,y:t.y0},o={coord:r,x:t.x1,y:t.y1};return uT(e,"cartesian2d")?!(!n||!r||!wF(1,n,r)&&!wF(0,n,r))||function(e,t,n){return!(e&&e.containZone&&t.coord&&n.coord&&!JB(t)&&!JB(n))||e.containZone(t.coord,n.coord)}(e,i,o):rF(e,i)||rF(e,o)}function TF(e,t,n,r,i){var o,a=r.coordinateSystem,s=e.getItemModel(t),l=oo(s.get(n[0]),i.getWidth()),u=oo(s.get(n[1]),i.getHeight());if(isNaN(l)||isNaN(u)){if(r.getMarkerPosition){var c=e.getValues(["x0","y0"],t),h=e.getValues(["x1","y1"],t),d=a.clampData(c),p=a.clampData(h),f=[];"x0"===n[0]?f[0]=d[0]>p[0]?h[0]:c[0]:f[0]=d[0]>p[0]?c[0]:h[0],"y0"===n[1]?f[1]=d[1]>p[1]?h[1]:c[1]:f[1]=d[1]>p[1]?c[1]:h[1],o=r.getMarkerPosition(f,n,!0)}else{var g=[y=e.get(n[0],t),_=e.get(n[1],t)];a.clampData&&a.clampData(g,g),o=a.dataToPoint(g,!0)}if(uT(a,"cartesian2d")){var m=a.getAxis("x"),v=a.getAxis("y"),y=e.get(n[0],t),_=e.get(n[1],t);bF(y)?o[0]=m.toGlobalCoord(m.getExtent()["x0"===n[0]?0:1]):bF(_)&&(o[1]=v.toGlobalCoord(v.getExtent()["y0"===n[1]?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];return o}var MF=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],CF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=KB.getMarkerModelFromSeries(e,"markArea");if(t){var r=t.getData();r.each((function(t){var i=j(MF,(function(i){return TF(r,t,i,e,n)}));r.setItemLayout(t,i),r.getItemGraphicEl(t).setShape("points",i)}))}}),this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,o=e.id,a=e.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,{group:new Yi});this.group.add(l.group),this.markKeep(l);var u=function(e,t,n){var r,i,o=["x0","y0","x1","y1"];if(e){var a=j(e&&e.dimensions,(function(e){var n=t.getData();return z(z({},n.getDimensionInfo(n.mapDimension(e))||{}),{name:e,ordinalMeta:null})}));i=j(o,(function(e,t){return{name:e,type:a[t%2].type}})),r=new R_(i,n)}else r=new R_(i=[{name:"value",type:"float"}],n);var s=j(n.get("data"),$(xF,t,e,n));e&&(s=Y(s,$(SF,e)));var l=e?function(e,t,n,r){return Xf(e.coord[Math.floor(r/2)][r%2],i[r])}:function(e,t,n,r){return Xf(e.value,i[r])};return r.initData(s,null,l),r.hasItemOption=!0,r}(i,e,t);t.setData(u),u.each((function(t){var n=j(MF,(function(n){return TF(u,t,n,e,r)})),o=i.getAxis("x").scale,s=i.getAxis("y").scale,l=o.getExtent(),c=s.getExtent(),h=[o.parse(u.get("x0",t)),o.parse(u.get("x1",t))],d=[s.parse(u.get("y0",t)),s.parse(u.get("y1",t))];so(h),so(d);var p=!!(l[0]>h[1]||l[1]<h[0]||c[0]>d[1]||c[1]<d[0]);u.setItemLayout(t,{points:n,allClipped:p});var f=u.getItemModel(t).getModel("itemStyle").getItemStyle(),g=Km(a,"color");f.fill||(f.fill=g,ee(f.fill)&&(f.fill=hr(f.fill,.4))),f.stroke||(f.stroke=g),u.setItemVisual(t,"style",f)})),u.diff(_F(l).data).add((function(e){var t=u.getItemLayout(e);if(!t.allClipped){var n=new lc({shape:{points:t.points}});u.setItemGraphicEl(e,n),l.group.add(n)}})).update((function(e,n){var r=_F(l).data.getItemGraphicEl(n),i=u.getItemLayout(e);i.allClipped?r&&l.group.remove(r):(r?Oc(r,{shape:{points:i.points}},t,e):r=new lc({shape:{points:i.points}}),u.setItemGraphicEl(e,r),l.group.add(r))})).remove((function(e){var t=_F(l).data.getItemGraphicEl(e);l.group.remove(t)})).execute(),u.eachItemGraphicEl((function(e,n){var r=u.getItemModel(n),i=u.getItemVisual(n,"style");e.useStyle(u.getItemVisual(n,"style")),xh(e,bh(r),{labelFetcher:t,labelDataIndex:n,defaultText:u.getName(n)||"",inheritColor:ee(i.fill)?hr(i.fill,1):"#000"}),fu(e,r),cu(e,null,null,r.get(["emphasis","disabled"])),bl(e).dataModel=t})),_F(l).data=u,l.group.silent=t.get("silent")||e.get("silent")},t.type="markArea",t}(sF);var DF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:"box",ignoreSize:!0},n}return l(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},t.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;!0===t&&(t=e.selector=["all","inverse"]),J(t)&&W(t,(function(e,r){ee(e)&&(e={type:e}),t[r]=R(e,function(e,t){return"all"===t?{type:"all",title:e.getLocaleModel().get(["legend","selector","all"])}:"inverse"===t?{type:"inverse",title:e.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(n,e.type))}))},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&"single"===this.get("selectedMode")){for(var t=!1,n=0;n<e.length;n++){var r=e[n].get("name");if(this.isSelected(r)){this.select(r),t=!0;break}}!t&&this.select(e[0].get("name"))}},t.prototype._updateData=function(e){var t=[],n=[];e.eachRawSeries((function(r){var i,o=r.name;if(n.push(o),r.legendVisualProvider){var a=r.legendVisualProvider.getAllNames();e.isSeriesFiltered(r)||(n=n.concat(a)),a.length?t=t.concat(a):i=!0}else i=!0;i&&Jo(r)&&t.push(r.name)})),this._availableNames=n;var r=this.get("data")||t,i=Te(),o=j(r,(function(e){return(ee(e)||ne(e))&&(e={name:e}),i.get(e.name)?null:(i.set(e.name,!0),new Wh(e,this,this.ecModel))}),this);this._data=Y(o,(function(e){return!!e}))},t.prototype.getData=function(){return this._data},t.prototype.select=function(e){var t=this.option.selected;"single"===this.get("selectedMode")&&W(this._data,(function(e){t[e.get("name")]=!1}));t[e]=!0},t.prototype.unSelect=function(e){"single"!==this.get("selectedMode")&&(this.option.selected[e]=!1)},t.prototype.toggleSelected=function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?"unSelect":"select"](e)},t.prototype.allSelect=function(){var e=this._data,t=this.option.selected;W(e,(function(e){t[e.get("name",!0)]=!0}))},t.prototype.inverseSelect=function(){var e=this._data,t=this.option.selected;W(e,(function(e){var n=e.get("name",!0);t.hasOwnProperty(n)||(t[n]=!0),t[n]=!t[n]}))},t.prototype.isSelected=function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&&F(this._availableNames,e)>=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}(tp),AF=$,IF=W,EF=Yi,LF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return l(t,e),t.prototype.init=function(){this.group.add(this._contentGroup=new EF),this.group.add(this._selectorGroup=new EF),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 r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var i=e.get("align"),o=e.get("orient");i&&"auto"!==i||(i="right"===e.get("left")&&"vertical"===o?"right":"left");var a=e.get("selector",!0),s=e.get("selectorPosition",!0);!a||s&&"auto"!==s||(s="horizontal"===o?"end":"start"),this.renderInner(i,e,t,n,a,o,s);var l=e.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},c=e.get("padding"),h=Zd(l,u,c),d=this.layoutInner(e,i,h,r,a,s),p=Zd(V({width:d.width,height:d.height},l),u,c);this.group.x=p.x-d.x,this.group.y=p.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=aV(d,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,r,i,o,a){var s=this.getContentGroup(),l=Te(),u=t.get("selectedMode"),c=[];n.eachRawSeries((function(e){!e.get("legendHoverLink")&&c.push(e.id)})),IF(t.getData(),(function(i,o){var a=i.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var h=new EF;return h.newline=!0,void s.add(h)}var d=n.getSeriesByName(a)[0];if(!l.get(a)){if(d){var p=d.getData(),f=p.getVisual("legendLineStyle")||{},g=p.getVisual("legendIcon"),m=p.getVisual("style"),v=this._createItem(d,a,o,i,t,e,f,m,g,u,r);v.on("click",AF(NF,a,null,r,c)).on("mouseover",AF(OF,d.name,null,r,c)).on("mouseout",AF(RF,d.name,null,r,c)),n.ssr&&v.eachChild((function(e){var t=bl(e);t.seriesIndex=d.seriesIndex,t.dataIndex=o,t.ssrType="legend"})),l.set(a,!0)}else n.eachRawSeries((function(s){if(!l.get(a)&&s.legendVisualProvider){var h=s.legendVisualProvider;if(!h.containName(a))return;var d=h.indexOfName(a),p=h.getItemVisual(d,"style"),f=h.getItemVisual(d,"legendIcon"),g=rr(p.fill);g&&0===g[3]&&(g[3]=.2,p=z(z({},p),{fill:dr(g,"rgba")}));var m=this._createItem(s,a,o,i,t,e,{},p,f,u,r);m.on("click",AF(NF,null,a,r,c)).on("mouseover",AF(OF,null,a,r,c)).on("mouseout",AF(RF,null,a,r,c)),n.ssr&&m.eachChild((function(e){var t=bl(e);t.seriesIndex=s.seriesIndex,t.dataIndex=o,t.ssrType="legend"})),l.set(a,!0)}}),this);"production"!==process.env.NODE_ENV&&(l.get(a)||console.warn(a+" series not exists. Legend data should be same with series name or data name."))}}),this),i&&this._createSelector(i,t,r,o,a)},t.prototype._createSelector=function(e,t,n,r,i){var o=this.getSelectorGroup();IF(e,(function(e){var r=e.type,i=new ll({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===r?"legendAllSelect":"legendInverseSelect"})}});o.add(i),xh(i,{normal:t.getModel("selectorLabel"),emphasis:t.getModel(["emphasis","selectorLabel"])},{defaultText:e.title}),uu(i)}))},t.prototype._createItem=function(e,t,n,r,i,o,a,s,l,u,c){var h=e.visualDrawType,d=i.get("itemWidth"),p=i.get("itemHeight"),f=i.isSelected(t),g=r.get("symbolRotate"),m=r.get("symbolKeepAspect"),v=r.get("icon"),y=function(e,t,n,r,i,o,a){function s(e,t){"auto"===e.lineWidth&&(e.lineWidth=t.lineWidth>0?2:0),IF(e,(function(n,r){"inherit"===e[r]&&(e[r]=t[r])}))}var l=t.getModel("itemStyle"),u=l.getItemStyle(),c=0===e.lastIndexOf("empty",0)?"fill":"stroke",h=l.getShallow("decal");u.decal=h&&"inherit"!==h?Bv(h,a):r.decal,"inherit"===u.fill&&(u.fill=r[i]);"inherit"===u.stroke&&(u.stroke=r[c]);"inherit"===u.opacity&&(u.opacity=("fill"===i?r:n).opacity);s(u,r);var d=t.getModel("lineStyle"),p=d.getLineStyle();if(s(p,n),"auto"===u.fill&&(u.fill=r.fill),"auto"===u.stroke&&(u.stroke=r.fill),"auto"===p.stroke&&(p.stroke=r.fill),!o){var f=t.get("inactiveBorderWidth"),g=u[c];u.lineWidth="auto"===f?r.lineWidth>0&&g?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),p.stroke=d.get("inactiveColor"),p.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}(l=v||l||"roundRect",r,a,s,h,f,c),_=new EF,x=r.getModel("textStyle");if(!Q(e.getLegendIcon)||v&&"inherit"!==v){var b="inherit"===v&&e.getData().getVisual("symbol")?"inherit"===g?e.getData().getVisual("symbolRotate"):g:0;_.add(function(e){var t=e.icon||"roundRect",n=dv(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);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);return n}({itemWidth:d,itemHeight:p,icon:l,iconRotate:b,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}))}else _.add(e.getLegendIcon({itemWidth:d,itemHeight:p,icon:l,iconRotate:g,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}));var w="left"===o?d+5:-5,S=o,T=i.get("formatter"),M=t;ee(T)&&T?M=T.replace("{name}",null!=t?t:""):Q(T)&&(M=T(t));var C=f?x.getTextColor():r.get("inactiveColor");_.add(new ll({style:wh(x,{text:M,x:w,y:p/2,fill:C,align:S,verticalAlign:"middle"},{inheritColor:C})}));var D=new ol({shape:_.getBoundingRect(),style:{fill:"transparent"}}),A=r.getModel("tooltip");return A.get("show")&&ph({el:D,componentModel:i,itemName:t,itemTooltipOption:A.option}),_.add(D),_.eachChild((function(e){e.silent=!0})),D.silent=!u,this.getContentGroup().add(_),uu(_),_.__legendDataIndex=n,_},t.prototype.layoutInner=function(e,t,n,r,i,o){var a=this.getContentGroup(),s=this.getSelectorGroup();Yd(e.get("orient"),a,e.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),i){Yd("horizontal",s,e.get("selectorItemGap",!0));var c=s.getBoundingRect(),h=[-c.x,-c.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:u[p]+=c[f]+d,h[1-p]+=l[g]/2-c[g]/2,s.x=h[0],s.y=h[1],a.x=u[0],a.y=u[1];var v={x:0,y:0};return v[f]=l[f]+d+c[f],v[g]=Math.max(l[g],c[g]),v[m]=Math.min(0,c[m]+h[1-p]),v}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(Kg);function NF(e,t,n,r){RF(e,t,n,r),n.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),OF(e,t,n,r)}function PF(e){for(var t,n=e.getZr().storage.getDisplayList(),r=0,i=n.length;r<i&&!(t=n[r].states.emphasis);)r++;return t&&t.hoverLayer}function OF(e,t,n,r){PF(n)||n.dispatchAction({type:"highlight",seriesName:e,name:t,excludeSeriesId:r})}function RF(e,t,n,r){PF(n)||n.dispatchAction({type:"downplay",seriesName:e,name:t,excludeSeriesId:r})}function kF(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.filterSeries((function(e){for(var n=0;n<t.length;n++)if(!t[n].isSelected(e.name))return!1;return!0}))}function zF(e,t,n){var r,i={},o="toggleSelected"===e;return n.eachComponent("legend",(function(n){o&&null!=r?n[r?"select":"unSelect"](t.name):"allSelect"===e||"inverseSelect"===e?n[e]():(n[e](t.name),r=n.isSelected(t.name)),W(n.getData(),(function(e){var t=e.get("name");if("\n"!==t&&""!==t){var r=n.isSelected(t);i.hasOwnProperty(t)?i[t]=i[t]&&r:i[t]=r}}))})),"allSelect"===e||"inverseSelect"===e?{selected:i}:{name:t.name,selected:i}}function VF(e){e.registerComponentModel(DF),e.registerComponentView(LF),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,kF),e.registerSubTypeDefaulter("legend",(function(){return"plain"})),function(e){e.registerAction("legendToggleSelect","legendselectchanged",$(zF,"toggleSelected")),e.registerAction("legendAllSelect","legendselectall",$(zF,"allSelect")),e.registerAction("legendInverseSelect","legendinverseselect",$(zF,"inverseSelect")),e.registerAction("legendSelect","legendselected",$(zF,"select")),e.registerAction("legendUnSelect","legendunselected",$(zF,"unSelect"))}(e)}var BF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(t,n,r){var i=Jd(t);e.prototype.init.call(this,t,n,r),FF(this,t,i)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),FF(this,this.option,t)},t.type="legend.scroll",t.defaultOption=Yh(DF.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),t}(DF);function FF(e,t,n){var r=[1,1];r[e.getOrient().index]=0,$d(t,n,{type:"box",ignoreSize:!!r})}var GF=Yi,HF=["width","height"],UF=["x","y"],WF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!0,n._currentIndex=0,n}return l(t,e),t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new GF),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new GF)},t.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},t.prototype.renderInner=function(t,n,r,i,o,a,s){var l=this;e.prototype.renderInner.call(this,t,n,r,i,o,a,s);var u=this._controllerGroup,c=n.get("pageIconSize",!0),h=J(c)?c:[c,c];p("pagePrev",0);var d=n.getModel("pageTextStyle");function p(e,t){var r=e+"DataIndex",o=uh(n.get("pageIcons",!0)[n.getOrient().name][t],{onclick:K(l._pageGo,l,r,n,i)},{x:-h[0]/2,y:-h[1]/2,width:h[0],height:h[1]});o.name=e,u.add(o)}u.add(new ll({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),p("pageNext",1)},t.prototype.layoutInner=function(e,t,n,r,i,o){var a=this.getSelectorGroup(),s=e.getOrient().index,l=HF[s],u=UF[s],c=HF[1-s],h=UF[1-s];i&&Yd("horizontal",a,e.get("selectorItemGap",!0));var d=e.get("selectorButtonGap",!0),p=a.getBoundingRect(),f=[-p.x,-p.y],g=O(n);i&&(g[l]=n[l]-p[l]-d);var m=this._layoutContentAndController(e,r,g,s,l,c,h,u);if(i){if("end"===o)f[s]+=m[l]+d;else{var v=p[l]+d;f[s]-=v,m[u]-=v}m[l]+=p[l]+d,f[1-s]+=m[h]+m[c]/2-p[c]/2,m[c]=Math.max(m[c],p[c]),m[h]=Math.min(m[h],p[h]+f[1-s]),a.x=f[0],a.y=f[1],a.markRedraw()}return m},t.prototype._layoutContentAndController=function(e,t,n,r,i,o,a,s){var l=this.getContentGroup(),u=this._containerGroup,c=this._controllerGroup;Yd(e.get("orient"),l,e.get("itemGap"),r?n.width:null,r?null:n.height),Yd("horizontal",c,e.get("pageButtonItemGap",!0));var h=l.getBoundingRect(),d=c.getBoundingRect(),p=this._showController=h[i]>n[i],f=[-h.x,-h.y];t||(f[r]=l[s]);var g=[0,0],m=[-d.x,-d.y],v=de(e.get("pageButtonGap",!0),e.get("itemGap",!0));p&&("end"===e.get("pageButtonPosition",!0)?m[r]+=n[i]-d[i]:g[r]+=d[i]+v);m[1-r]+=h[o]/2-d[o]/2,l.setPosition(f),u.setPosition(g),c.setPosition(m);var y={x:0,y:0};if(y[i]=p?n[i]:h[i],y[o]=Math.max(h[o],d[o]),y[a]=Math.min(0,d[a]+m[1-r]),u.__rectSize=n[i],p){var _={x:0,y:0};_[i]=Math.max(n[i]-d[i]-v,0),_[o]=y[o],u.setClipPath(new ol({shape:_})),u.__rectSize=_[i]}else c.eachChild((function(e){e.attr({invisible:!0,silent:!0})}));var x=this._getPageInfo(e);return null!=x.pageIndex&&Oc(l,{x:x.contentPosition[0],y:x.contentPosition[1]},p?e:null),this._updatePageInfoView(e,x),y},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];null!=r&&n.dispatchAction({type:"legendScroll",scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;W(["pagePrev","pageNext"],(function(r){var i=null!=t[r+"DataIndex"],o=n.childOfName(r);o&&(o.setStyle("fill",i?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),o.cursor=i?"pointer":"default")}));var r=n.childOfName("pageText"),i=e.get("pageFormatter"),o=t.pageIndex,a=null!=o?o+1:0,s=t.pageCount;r&&i&&r.setStyle("text",ee(i)?i.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):i({current:a,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get("scrollDataIndex",!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,o=HF[i],a=UF[i],s=this._findTargetItemIndex(t),l=n.children(),u=l[s],c=l.length,h=c?1:0,d={contentPosition:[n.x,n.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var p=y(u);d.contentPosition[i]=-p.s;for(var f=s+1,g=p,m=p,v=null;f<=c;++f)(!(v=y(l[f]))&&m.e>g.s+r||v&&!_(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(f=s-1,g=p,m=p,v=null;f>=-1;--f)(v=y(l[f]))&&_(m,v.s)||!(g.i<m.i)||(m=g,null==d.pagePrevDataIndex&&(d.pagePrevDataIndex=g.i),++d.pageCount,++d.pageIndex),g=v;return d;function y(e){if(e){var t=e.getBoundingRect(),n=t[a]+e[a];return{s:n,e:n+t[o],i:e.__legendDataIndex}}}function _(e,t){return e.e>=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){return this._showController?(this.getContentGroup().eachChild((function(r,i){var o=r.__legendDataIndex;null==n&&null!=o&&(n=i),o===e&&(t=i)})),null!=t?t:n):0;var t,n},t.type="legend.scroll",t}(LF);function jF(e){l_(VF),e.registerComponentModel(BF),e.registerComponentView(WF),function(e){e.registerAction("legendScroll","legendscroll",(function(e,t){var n=e.scrollDataIndex;null!=n&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},(function(e){e.setScrollDataIndex(n)}))}))}(e)}var XF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="dataZoom.inside",t.defaultOption=Yh(Uz.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(Uz),YF=ta();function ZF(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function qF(e,t){e.isDisposed()||e.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:t})}function KF(e,t,n,r){return e.coordinateSystem.containPoint([n,r])}function $F(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,(function(e,t){var n=YF(t),r=n.coordSysRecordMap||(n.coordSysRecordMap=Te());r.each((function(e){e.dataZoomInfoMap=null})),e.eachComponent({mainType:"dataZoom",subType:"inside"},(function(e){W(Gz(e).infoList,(function(n){var i=n.model.uid,o=r.get(i)||r.set(i,function(e,t){var n={model:t,containsPoint:$(KF,t),dispatchAction:$(qF,e),dataZoomInfoMap:null,controller:null},r=n.controller=new NC(e.getZr());return W(["pan","zoom","scrollMove"],(function(e){r.on(e,(function(t){var r=[];n.dataZoomInfoMap.each((function(i){if(t.isAvailableBehavior(i.model.option)){var o=(i.getRange||{})[e],a=o&&o(i.dzReferCoordSysInfo,n.model.mainType,n.controller,t);!i.model.get("disabled",!0)&&a&&r.push({dataZoomId:i.model.id,start:a[0],end:a[1]})}})),r.length&&n.dispatchAction(r)}))})),n}(t,n.model));(o.dataZoomInfoMap||(o.dataZoomInfoMap=Te())).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})}))})),r.each((function(e){var t,n=e.controller,i=e.dataZoomInfoMap;if(i){var o=i.keys()[0];null!=o&&(t=i.get(o))}if(t){var a=function(e){var t,n="type_",r={type_true:2,type_move:1,type_false:0,type_undefined:-1},i=!0;return e.each((function(e){var o=e.model,a=!o.get("disabled",!0)&&(!o.get("zoomLock",!0)||"move");r[n+a]>r[n+t]&&(t=a),i=i&&o.get("preventDefaultMouseMove",!0)})),{controlType:t,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!i}}}(i);n.enable(a.controlType,a.opt),n.setPointerChecker(e.containsPoint),cm(e,"dispatchAction",t.model.get("throttle",!0),"fixRate")}else ZF(r,e)}))}))}var JF=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return l(t,e),t.prototype.render=function(t,n,r){e.prototype.render.apply(this,arguments),t.noTarget()?this._clear():(this.range=t.getPercentRange(),function(e,t,n){YF(e).coordSysRecordMap.each((function(e){var r=e.dataZoomInfoMap.get(t.uid);r&&(r.getRange=n)}))}(r,t,{pan:K(QF.pan,this),zoom:K(QF.zoom,this),scrollMove:K(QF.scrollMove,this)}))},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){!function(e,t){for(var n=YF(e).coordSysRecordMap,r=n.keys(),i=0;i<r.length;i++){var o=r[i],a=n.get(o),s=a.dataZoomInfoMap;if(s){var l=t.uid;s.get(l)&&(s.removeKey(l),s.keys().length||ZF(n,a))}}}(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(Xz),QF={zoom:function(e,t,n,r){var i=this.range,o=i.slice(),a=e.axisModels[0];if(a){var s=tG[t](null,[r.originX,r.originY],a,n,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(o[1]-o[0])+o[0],u=Math.max(1/r.scale,0);o[0]=(o[0]-l)*u+l,o[1]=(o[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return fL(0,o,[0,100],0,c.minSpan,c.maxSpan),this.range=o,i[0]!==o[0]||i[1]!==o[1]?o:void 0}},pan:eG((function(e,t,n,r,i,o){var a=tG[r]([o.oldX,o.oldY],[o.newX,o.newY],t,i,n);return a.signal*(e[1]-e[0])*a.pixel/a.pixelLength})),scrollMove:eG((function(e,t,n,r,i,o){return tG[r]([0,0],[o.scrollDelta,o.scrollDelta],t,i,n).signal*(e[1]-e[0])*o.scrollDelta}))};function eG(e){return function(t,n,r,i){var o=this.range,a=o.slice(),s=t.axisModels[0];if(s)return fL(e(a,s,t,n,r,i),a,[0,100],"all"),this.range=a,o[0]!==a[0]||o[1]!==a[1]?a:void 0}}var tG={grid:function(e,t,n,r,i){var o=n.axis,a={},s=i.model.coordinateSystem.getRect();return e=e||[0,0],"x"===o.dim?(a.pixel=t[0]-e[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=o.inverse?1:-1):(a.pixel=t[1]-e[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=o.inverse?-1:1),a},polar:function(e,t,n,r,i){var o=n.axis,a={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),"radiusAxis"===n.mainType?(a.pixel=t[0]-e[0],a.pixelLength=l[1]-l[0],a.pixelStart=l[0],a.signal=o.inverse?1:-1):(a.pixel=t[1]-e[1],a.pixelLength=u[1]-u[0],a.pixelStart=u[0],a.signal=o.inverse?-1:1),a},singleAxis:function(e,t,n,r,i){var o=n.axis,a=i.model.coordinateSystem.getRect(),s={};return e=e||[0,0],"horizontal"===o.orient?(s.pixel=t[0]-e[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=o.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=o.inverse?-1:1),s}};function nG(e){Qz(e),e.registerComponentModel(XF),e.registerComponentView(JF),$F(e)}var rG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=Yh(Uz.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),t}(Uz),iG=ol,oG="horizontal",aG="vertical",sG=["line","bar","candlestick","scatter"],lG={easing:"cubicOut",duration:100,delay:0},uG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return l(t,e),t.prototype.init=function(e,t){this.api=t,this._onBrush=K(this._onBrush,this),this._onBrushEnd=K(this._onBrushEnd,this)},t.prototype.render=function(t,n,r,i){if(e.prototype.render.apply(this,arguments),cm(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),!1!==t.get("show")){if(t.noTarget())return this._clear(),void this.group.removeAll();i&&"dataZoom"===i.type&&i.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){hm(this,"_dispatchZoomAction");var e=this.api.getZr();e.off("mousemove",this._onBrush),e.off("mouseup",this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new Yi;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get("brushSelect")?7:0,r=this._findCoordRect(),i={width:t.getWidth(),height:t.getHeight()},o=this._orient===oG?{right:i.width-r.x-r.width,top:i.height-30-7-n,width:r.width,height:30}:{right:7,top:r.y,width:30,height:r.height},a=Jd(e.option);W(["right","top","width","height"],(function(e){"ph"===a[e]&&(a[e]=o[e])}));var s=Zd(a,i);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===aG&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get("inverse"),o=this._displayables.sliderGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(n!==oG||i?n===oG&&i?{scaleY:a?1:-1,scaleX:-1}:n!==aG||i?{scaleY:a?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:a?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:a?1:-1,scaleX:1});var s=e.getBoundingRect([o]);e.x=t.x-s.x,e.y=t.y-s.y,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,r=e.get("brushSelect");n.add(new iG({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40}));var i=new iG({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:K(this._onClickPanel,this)}),o=this.api.getZr();r?(i.on("mousedown",this._onBrushStart,this),i.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),n.add(i)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],e){var t=this._size,n=this._shadowSize||[],r=e.series,i=r.getRawData(),o=r.getShadowDim&&r.getShadowDim(),a=o&&i.getDimensionInfo(o)?r.getShadowDim():e.otherDim;if(null!=a){var s=this._shadowPolygonPts,l=this._shadowPolylinePts;if(i!==this._shadowData||a!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var u=i.getDataExtent(a),c=.3*(u[1]-u[0]);u=[u[0]-c,u[1]+c];var h,d=[0,t[1]],p=[0,t[0]],f=[[t[0],0],[0,0]],g=[],m=p[1]/(i.count()-1),v=0,y=Math.round(i.count()/t[0]);i.each([a],(function(e,t){if(y>0&&t%y)v+=m;else{var n=null==e||isNaN(e)||""===e,r=n?0:io(e,u,d,!0);n&&!h&&t?(f.push([f[f.length-1][0],0]),g.push([g[g.length-1][0],0])):!n&&h&&(f.push([v,0]),g.push([v,0])),f.push([v,r]),g.push([v,r]),v+=m,h=n}})),s=this._shadowPolygonPts=f,l=this._shadowPolylinePts=g}this._shadowData=i,this._shadowDim=a,this._shadowSize=[t[0],t[1]];for(var _=this.dataZoomModel,x=0;x<3;x++){var b=w(1===x);this._displayables.sliderGroup.add(b),this._displayables.dataShadowSegs.push(b)}}}function w(e){var t=_.getModel(e?"selectedDataBackground":"dataBackground"),n=new Yi,r=new lc({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),i=new cc({shape:{points:l},segmentIgnoreThreshold:1,style:t.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),n}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get("showDataShadow");if(!1!==t){var n,r=this.ecModel;return e.eachTargetAxis((function(i,o){W(e.getAxisProxy(i,o).getTargetSeriesModels(),(function(e){if(!(n||!0!==t&&F(sG,e.get("type"))<0)){var a,s=r.getComponent(Bz(i),o).axis,l=function(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}(i),u=e.coordinateSystem;null!=l&&u.getOtherAxis&&(a=u.getOtherAxis(s).inverse),l=e.getData().mapDimension(l),n={thisAxis:s,series:e,thisDim:i,otherDim:l,otherAxisInverse:a}}}),this)}),this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],r=t.handleLabels=[null,null],i=this._displayables.sliderGroup,o=this._size,a=this.dataZoomModel,s=this.api,l=a.get("borderRadius")||0,u=a.get("brushSelect"),c=t.filler=new iG({silent:u,style:{fill:a.get("fillerColor")},textConfig:{position:"inside"}});i.add(c),i.add(new iG({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:l},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),W([0,1],(function(t){var o=a.get("handleIcon");!uv[o]&&o.indexOf("path://")<0&&o.indexOf("image://")<0&&(o="path://"+o,"production"!==process.env.NODE_ENV&&Oo("handleIcon now needs 'path://' prefix when using a path string"));var s=dv(o,-1,0,2,2,null,!0);s.attr({cursor:cG(this._orient),draggable:!0,drift:K(this._onDragMove,this,t),ondragend:K(this._onDragEnd,this),onmouseover:K(this._showDataInfo,this,!0),onmouseout:K(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),u=a.get("handleSize");this._handleHeight=oo(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(a.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=a.getModel(["emphasis","handleStyle"]).getItemStyle(),uu(s);var c=a.get("handleColor");null!=c&&(s.style.fill=c),i.add(n[t]=s);var h=a.getModel("textStyle");e.add(r[t]=new ll({silent:!0,invisible:!0,style:wh(h,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:h.getTextColor(),font:h.getFont()}),z2:10}))}),this);var h=c;if(u){var d=oo(a.get("moveHandleSize"),o[1]),p=t.moveHandle=new ol({style:a.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:d}}),f=.8*d,g=t.moveHandleIcon=dv(a.get("moveHandleIcon"),-f/2,-f/2,f,f,"#fff",!0);g.silent=!0,g.y=o[1]+d/2-.5,p.ensureState("emphasis").style=a.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var m=Math.min(o[1]/2,Math.max(d,10));(h=t.moveZone=new ol({invisible:!0,shape:{y:o[1]-m,height:d+m}})).on("mouseover",(function(){s.enterEmphasis(p)})).on("mouseout",(function(){s.leaveEmphasis(p)})),i.add(p),i.add(g),i.add(h)}h.attr({draggable:!0,cursor:cG(this._orient),drift:K(this._onDragMove,this,"all"),ondragstart:K(this._showDataInfo,this,!0),ondragend:K(this._onDragEnd,this),onmouseover:K(this._showDataInfo,this,!0),onmouseout:K(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[io(e[0],[0,100],t,!0),io(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),o=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];fL(t,r,i,n.get("zoomLock")?"all":e,null!=o.minSpan?io(o.minSpan,a,i,!0):null,null!=o.maxSpan?io(o.maxSpan,a,i,!0):null);var s=this._range,l=this._range=so([io(r[0],i,a,!0),io(r[1],i,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,r=so(n.slice()),i=this._size;W([0,1],(function(e){var r=t.handles[e],o=this._handleHeight;r.attr({scaleX:o/2,scaleY:o/2,x:n[e]+(e?-1:1),y:i[1]/2-o/2})}),this),t.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var o={x:r[0],width:r[1]-r[0]};t.moveHandle&&(t.moveHandle.setShape(o),t.moveZone.setShape(o),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr("x",o.x+o.width/2));for(var a=t.dataShadowSegs,s=[0,r[0],r[1],i[0]],l=0;l<a.length;l++){var u=a[l],c=u.getClipPath();c||(c=new ol,u.setClipPath(c)),c.setShape({x:s[l],y:0,width:s[l+1]-s[l],height:i[1]})}this._updateDataInfo(e)},t.prototype._updateDataInfo=function(e){var t=this.dataZoomModel,n=this._displayables,r=n.handleLabels,i=this._orient,o=["",""];if(t.get("showDetail")){var a=t.findRepresentativeAxisProxy();if(a){var s=a.getAxisModel().axis,l=this._range,u=e?a.calculateDataWindow({start:l[0],end:l[1]}).valueWindow:a.getDataValueWindow();o=[this._formatLabel(u[0],s),this._formatLabel(u[1],s)]}}var c=so(this._handleEnds.slice());function h(e){var t=nh(n.handles[e].parent,this.group),a=ih(0===e?"right":"left",t),s=this._handleWidth/2+5,l=rh([c[e]+(0===e?-s:s),this._size[1]/2],t);r[e].setStyle({x:l[0],y:l[1],verticalAlign:i===oG?"middle":a,align:i===oG?a:"center",text:o[e]})}h.call(this,0),h.call(this,1)},t.prototype._formatLabel=function(e,t){var n=this.dataZoomModel,r=n.get("labelFormatter"),i=n.get("labelPrecision");null!=i&&"auto"!==i||(i=t.getPixelPrecision());var o=null==e||isNaN(e)?"":"category"===t.type||"time"===t.type?t.scale.getLabel({value:Math.round(e)}):e.toFixed(Math.min(i,20));return Q(r)?r(e,o):ee(r)?r.replace("{value}",o):o},t.prototype._showDataInfo=function(e){e=this._dragging||e;var t=this._displayables,n=t.handleLabels;n[0].attr("invisible",!e),n[1].attr("invisible",!e),t.moveHandle&&this.api[e?"enterEmphasis":"leaveEmphasis"](t.moveHandle,1)},t.prototype._onDragMove=function(e,t,n,r){this._dragging=!0,bt(r.event);var i=rh([t,n],this._displayables.sliderGroup.getLocalTransform(),!0),o=this._updateInterval(e,i[0]),a=this.dataZoomModel.get("realtime");this._updateView(!a),o&&a&&this._dispatchZoomAction(!0)},t.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction(!1)},t.prototype._onClickPanel=function(e){var t=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(n[0]<0||n[0]>t[0]||n[1]<0||n[1]>t[1])){var r=this._handleEnds,i=(r[0]+r[1])/2,o=this._updateInterval("all",n[0]-i);this._updateView(),o&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new kt(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr("ignore",!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var r=this._getViewExtent(),i=[0,100];this._range=so([io(n.x,r,i,!0),io(n.x+n.width,r,i,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(bt(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new iG({silent:!0,style:r.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(i)),i.attr("ignore",!1);var o=this._brushStart,a=this._displayables.sliderGroup,s=a.transformCoordToLocal(e,t),l=a.transformCoordToLocal(o.x,o.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),i.setShape({x:l[0],y:0,width:s[0]-l[0],height:u[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?lG:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=Gz(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var r=this.api.getWidth(),i=this.api.getHeight();e={x:.2*r,y:.2*i,width:.6*r,height:.6*i}}return e},t.type="dataZoom.slider",t}(Xz);function cG(e){return"vertical"===e?"ns-resize":"ew-resize"}function hG(e){e.registerComponentModel(rG),e.registerComponentView(uG),Qz(e)}var dG=function(e,t,n){var r=O((pG[e]||{})[t]);return n&&J(r)?r[r.length-1]:r},pG={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},fG=sI.mapVisual,gG=sI.eachVisual,mG=J,vG=W,yG=so,_G=io,xG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=["inRange","outOfRange"],n.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],n.layoutMode={type:"box",ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return l(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&gB(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=K(e,this),this.controllerVisuals=fB(this.option.controller,t,e),this.targetVisuals=fB(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this.option.seriesIndex,t=[];return null==e||"all"===e?this.ecModel.eachSeries((function(e,n){t.push(n)})):t=Go(e),t},t.prototype.eachTargetSeries=function(e,t){W(this.getTargetSeriesIndices(),(function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)}),this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries((function(n){n===e&&(t=!0)})),t},t.prototype.formatValueText=function(e,t,n){var r,i=this.option,o=i.precision,a=this.dataBound,s=i.formatter;n=n||["<",">"],J(e)&&(e=e.slice(),r=!0);var l=t?e:r?[u(e[0]),u(e[1])]:u(e);return ee(s)?s.replace("{value}",r?l[0]:l).replace("{value2}",r?l[1]:l):Q(s)?r?s(e[0],e[1]):s(e):r?e[0]===a[0]?n[0]+" "+l[1]:e[1]===a[1]?n[1]+" "+l[0]:l[0]+" - "+l[1]:l;function u(e){return e===a[0]?"min":e===a[1]?"max":(+e).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var e=this.option,t=yG([e.min,e.max]);this._dataExtent=t},t.prototype.getDataDimensionIndex=function(e){var t=this.option.dimension;if(null!=t)return e.getDimensionIndex(t);for(var n=e.dimensions,r=n.length-1;r>=0;r--){var i=n[r],o=e.getDimensionInfo(i);if(!o.isCalculationCoord)return o.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||(t.target={}),i=t.controller||(t.controller={});R(r,n),R(i,n);var o=this.isCategory();function a(n){mG(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get("gradientColor")}}a.call(this,r),a.call(this,i),function(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},vG(r,(function(e,t){if(sI.isValidType(t)){var n=dG(t,"inactive",o);null!=n&&(i[t]=n,"color"!==t||i.hasOwnProperty("opacity")||i.hasOwnProperty("colorAlpha")||(i.opacity=[0,0]))}})))}.call(this,r,"inRange","outOfRange"),function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get("inactiveColor"),i=this.getItemSymbol()||"roundRect";vG(this.stateList,(function(a){var s=this.itemSize,l=e[a];l||(l=e[a]={color:o?r:[r]}),null==l.symbol&&(l.symbol=t&&O(t)||(o?i:[i])),null==l.symbolSize&&(l.symbolSize=n&&O(n)||(o?s[0]:[s[0],s[0]])),l.symbol=fG(l.symbol,(function(e){return"none"===e?i:e}));var u=l.symbolSize;if(null!=u){var c=-1/0;gG(u,(function(e){e>c&&(c=e)})),l.symbolSize=fG(u,(function(e){return _G(e,[0,c],[0,s[0]],!0)}))}}),this)}.call(this,i)},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},t}(tp),bG=[20,140],wG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual((function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()})),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(null==t[0]||isNaN(t[0]))&&(t[0]=bG[0]),(null==t[1]||isNaN(t[1]))&&(t[1]=bG[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):J(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),W(this.stateList,(function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)}),this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=so((this.get("range")||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]<e[0]&&(t[0]=e[0]),t[1]<e[0]&&(t[1]=e[0]),t},t.prototype.getValueState=function(e){var t=this.option.range,n=this.getExtent();return(t[0]<=n[0]||t[0]<=e)&&(t[1]>=n[1]||e<=t[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries((function(n){var r=[],i=n.getData();i.each(this.getDataDimensionIndex(i),(function(t,n){e[0]<=t&&t<=e[1]&&r.push(n)}),this),t.push({seriesId:n.id,dataIndex:r})}),this),t},t.prototype.getVisualMeta=function(e){var t=SG(this,"outOfRange",this.getExtent()),n=SG(this,"inRange",this.option.range.slice()),r=[];function i(t,n){r.push({value:t,color:e(t,n)})}for(var o=0,a=0,s=n.length,l=t.length;a<l&&(!n.length||t[a]<=n[0]);a++)t[a]<n[o]&&i(t[a],"outOfRange");for(var u=1;o<s;o++,u=0)u&&r.length&&i(n[o],"outOfRange"),i(n[o],"inRange");for(u=1;a<l;a++)(!n.length||n[n.length-1]<t[a])&&(u&&(r.length&&i(r[r.length-1].value,"outOfRange"),u=0),i(t[a],"outOfRange"));var c=r.length;return{stops:r,outerColors:[c?r[0].color:"transparent",c?r[c-1].color:"transparent"]}},t.type="visualMap.continuous",t.defaultOption=Yh(xG.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:"#fff",borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}}),t}(xG);function SG(e,t,n){if(n[0]===n[1])return n.slice();for(var r=(n[1]-n[0])/200,i=n[0],o=[],a=0;a<=200&&i<n[1];a++)o.push(i),i+=r;return o.push(n[1]),o}var TG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.autoPositionValues={left:1,right:1,top:1,bottom:1},n}return l(t,e),t.prototype.init=function(e,t){this.ecModel=e,this.api=t},t.prototype.render=function(e,t,n,r){this.visualMapModel=e,!1!==e.get("show")?this.doRender(e,t,n,r):this.group.removeAll()},t.prototype.renderBackground=function(e){var t=this.visualMapModel,n=Od(t.get("padding")||0),r=e.getBoundingRect();e.add(new ol({z2:-1,silent:!0,shape:{x:r.x-n[3],y:r.y-n[0],width:r.width+n[3]+n[1],height:r.height+n[0]+n[2]},style:{fill:t.get("backgroundColor"),stroke:t.get("borderColor"),lineWidth:t.get("borderWidth")}}))},t.prototype.getControllerVisual=function(e,t,n){var r=(n=n||{}).forceState,i=this.visualMapModel,o={};if("color"===t){var a=i.get("contentColor");o.color=a}function s(e){return o[e]}function l(e,t){o[e]=t}var u=i.controllerVisuals[r||i.getValueState(e)];return W(sI.prepareVisualTypes(u),(function(r){var i=u[r];n.convertOpacityToAlpha&&"opacity"===r&&(r="colorAlpha",i=u.__alphaForOpacity),sI.dependsOn(r,t)&&i&&i.applyVisual(e,s,l)})),o[t]},t.prototype.positionGroup=function(e){var t=this.visualMapModel,n=this.api;qd(e,t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},t.prototype.doRender=function(e,t,n,r){},t.type="visualMap",t}(Kg),MG=[["left","right","width"],["top","bottom","height"]];function CG(e,t,n){var r=e.option,i=r.align;if(null!=i&&"auto"!==i)return i;for(var o={width:t.getWidth(),height:t.getHeight()},a="horizontal"===r.orient?1:0,s=MG[a],l=[0,null,10],u={},c=0;c<3;c++)u[MG[1-a][c]]=l[c],u[s[c]]=2===c?n[0]:r[s[c]];var h=[["x","width",3],["y","height",0]][a],d=Zd(u,o,r.padding);return s[(d.margin[h[2]]||0)+d[h[0]]+.5*d[h[1]]<.5*o[h[1]]?0:1]}function DG(e,t){return W(e||[],(function(e){null!=e.dataIndex&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey="visualMap"+(t?t.componentIndex:"")})),e}var AG=io,IG=W,EG=Math.min,LG=Math.max,NG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._shapes={},n._dataInterval=[],n._handleEnds=[],n._hoverLinkDataIndices=[],n}return l(t,e),t.prototype.init=function(t,n){e.prototype.init.call(this,t,n),this._hoverLinkFromSeriesMouseOver=K(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=K(this._hideIndicator,this)},t.prototype.doRender=function(e,t,n,r){r&&"selectDataRange"===r.type&&r.from===this.uid||this._buildView()},t.prototype._buildView=function(){this.group.removeAll();var e=this.visualMapModel,t=this.group;this._orient=e.get("orient"),this._useHandle=e.get("calculable"),this._resetInterval(),this._renderBar(t);var n=e.get("text");this._renderEndsText(t,n,0),this._renderEndsText(t,n,1),this._updateView(!0),this.renderBackground(t),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(t)},t.prototype._renderEndsText=function(e,t,n){if(t){var r=t[1-n];r=null!=r?r+"":"";var i=this.visualMapModel,o=i.get("textGap"),a=i.itemSize,s=this._shapes.mainGroup,l=this._applyTransform([a[0]/2,0===n?-o:a[1]+o],s),u=this._applyTransform(0===n?"bottom":"top",s),c=this._orient,h=this.visualMapModel.textStyleModel;this.group.add(new ll({style:wh(h,{x:l[0],y:l[1],verticalAlign:"horizontal"===c?"middle":u,align:"horizontal"===c?u:"center",text:r})}))}},t.prototype._renderBar=function(e){var t=this.visualMapModel,n=this._shapes,r=t.itemSize,i=this._orient,o=this._useHandle,a=CG(t,this.api,r),s=n.mainGroup=this._createBarGroup(a),l=new Yi;s.add(l),l.add(n.outOfRange=PG()),l.add(n.inRange=PG(null,o?RG(this._orient):null,K(this._dragHandle,this,"all",!1),K(this._dragHandle,this,"all",!0))),l.setClipPath(new ol({shape:{x:0,y:0,width:r[0],height:r[1],r:3}}));var u=t.textStyleModel.getTextRect("国"),c=LG(u.width,u.height);o&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(t,s,0,r,c,i),this._createHandle(t,s,1,r,c,i)),this._createIndicator(t,s,r,c,i),e.add(s)},t.prototype._createHandle=function(e,t,n,r,i,o){var a=K(this._dragHandle,this,n,!1),s=K(this._dragHandle,this,n,!0),l=Ri(e.get("handleSize"),r[0]),u=dv(e.get("handleIcon"),-l/2,-l/2,l,l,null,!0),c=RG(this._orient);u.attr({cursor:c,draggable:!0,drift:a,ondragend:s,onmousemove:function(e){bt(e.event)}}),u.x=r[0]/2,u.useStyle(e.getModel("handleStyle").getItemStyle()),u.setStyle({strokeNoScale:!0,strokeFirst:!0}),u.style.lineWidth*=2,u.ensureState("emphasis").style=e.getModel(["emphasis","handleStyle"]).getItemStyle(),gu(u,!0),t.add(u);var h=this.visualMapModel.textStyleModel,d=new ll({cursor:c,draggable:!0,drift:a,onmousemove:function(e){bt(e.event)},ondragend:s,style:wh(h,{x:0,y:0,text:""})});d.ensureState("blur").style={opacity:.1},d.stateTransition={duration:200},this.group.add(d);var p=[l,0],f=this._shapes;f.handleThumbs[n]=u,f.handleLabelPoints[n]=p,f.handleLabels[n]=d},t.prototype._createIndicator=function(e,t,n,r,i){var o=Ri(e.get("indicatorSize"),n[0]),a=dv(e.get("indicatorIcon"),-o/2,-o/2,o,o,null,!0);a.attr({cursor:"move",invisible:!0,silent:!0,x:n[0]/2});var s=e.getModel("indicatorStyle").getItemStyle();if(a instanceof Js){var l=a.style;a.useStyle(z({image:l.image,x:l.x,y:l.y,width:l.width,height:l.height},s))}else a.useStyle(s);t.add(a);var u=this.visualMapModel.textStyleModel,c=new ll({silent:!0,invisible:!0,style:wh(u,{x:0,y:0,text:""})});this.group.add(c);var h=[("horizontal"===i?r/2:6)+n[0]/2,0],d=this._shapes;d.indicator=a,d.indicatorLabel=c,d.indicatorLabelPoint=h,this._firstShowIndicator=!0},t.prototype._dragHandle=function(e,t,n,r){if(this._useHandle){if(this._dragging=!t,!t){var i=this._applyTransform([n,r],this._shapes.mainGroup,!0);this._updateInterval(e,i[1]),this._hideIndicator(),this._updateView()}t===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),t?!this._hovering&&this._clearHoverLinkToSeries():OG(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[e],!1)}},t.prototype._resetInterval=function(){var e=this.visualMapModel,t=this._dataInterval=e.getSelected(),n=e.getExtent(),r=[0,e.itemSize[1]];this._handleEnds=[AG(t[0],n,r,!0),AG(t[1],n,r,!0)]},t.prototype._updateInterval=function(e,t){t=t||0;var n=this.visualMapModel,r=this._handleEnds,i=[0,n.itemSize[1]];fL(t,r,i,e,0);var o=n.getExtent();this._dataInterval=[AG(r[0],i,o,!0),AG(r[1],i,o,!0)]},t.prototype._updateView=function(e){var t=this.visualMapModel,n=t.getExtent(),r=this._shapes,i=[0,t.itemSize[1]],o=e?i:this._handleEnds,a=this._createBarVisual(this._dataInterval,n,o,"inRange"),s=this._createBarVisual(n,n,i,"outOfRange");r.inRange.setStyle({fill:a.barColor}).setShape("points",a.barPoints),r.outOfRange.setStyle({fill:s.barColor}).setShape("points",s.barPoints),this._updateHandle(o,a)},t.prototype._createBarVisual=function(e,t,n,r){var i={forceState:r,convertOpacityToAlpha:!0},o=this._makeColorGradient(e,i),a=[this.getControllerVisual(e[0],"symbolSize",i),this.getControllerVisual(e[1],"symbolSize",i)],s=this._createBarPoints(n,a);return{barColor:new wc(0,0,0,1,o),barPoints:s,handlesColor:[o[0].color,o[o.length-1].color]}},t.prototype._makeColorGradient=function(e,t){var n=[],r=(e[1]-e[0])/100;n.push({color:this.getControllerVisual(e[0],"color",t),offset:0});for(var i=1;i<100;i++){var o=e[0]+r*i;if(o>e[1])break;n.push({color:this.getControllerVisual(o,"color",t),offset:i/100})}return n.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),n},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get("inverse");return new Yi("horizontal"!==t||n?"horizontal"===t&&n?{scaleX:"bottom"===e?-1:1,rotation:-Math.PI/2}:"vertical"!==t||n?{scaleX:"left"===e?1:-1}:{scaleX:"left"===e?1:-1,scaleY:-1}:{scaleX:"bottom"===e?1:-1,rotation:Math.PI/2})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,r=this.visualMapModel,i=n.handleThumbs,o=n.handleLabels,a=r.itemSize,s=r.getExtent();IG([0,1],(function(l){var u=i[l];u.setStyle("fill",t.handlesColor[l]),u.y=e[l];var c=AG(e[l],[0,a[1]],s,!0),h=this.getControllerVisual(c,"symbolSize");u.scaleX=u.scaleY=h/a[0],u.x=a[0]-h/2;var d=rh(n.handleLabelPoints[l],nh(u,this.group));o[l].setStyle({x:d[0],y:d[1],text:r.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})}),this)}},t.prototype._showIndicator=function(e,t,n,r){var i=this.visualMapModel,o=i.getExtent(),a=i.itemSize,s=[0,a[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var c=this.getControllerVisual(e,"color",{convertOpacityToAlpha:!0}),h=this.getControllerVisual(e,"symbolSize"),d=AG(e,o,s,!0),p=a[0]-h/2,f={x:u.x,y:u.y};u.y=d,u.x=p;var g=rh(l.indicatorLabelPoint,nh(u,this.group)),m=l.indicatorLabel;m.attr("invisible",!1);var v=this._applyTransform("left",l.mainGroup),y="horizontal"===this._orient;m.setStyle({text:(n||"")+i.formatValueText(t),verticalAlign:y?v:"middle",align:y?"center":v});var _={x:p,y:d,style:{fill:c}},x={style:{x:g[0],y:g[1]}};if(i.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var b={duration:100,easing:"cubicInOut",additive:!0};u.x=f.x,u.y=f.y,u.animateTo(_,b),m.animateTo(x,b)}else u.attr(_),m.attr(x);this._firstShowIndicator=!1;var w=this._shapes.handleLabels;if(w)for(var S=0;S<w.length;S++)this.api.enterBlur(w[S])}},t.prototype._enableHoverLinkToSeries=function(){var e=this;this._shapes.mainGroup.on("mousemove",(function(t){if(e._hovering=!0,!e._dragging){var n=e.visualMapModel.itemSize,r=e._applyTransform([t.offsetX,t.offsetY],e._shapes.mainGroup,!0,!0);r[1]=EG(LG(0,r[1]),n[1]),e._doHoverLinkToSeries(r[1],0<=r[0]&&r[0]<=n[0])}})).on("mouseout",(function(){e._hovering=!1,!e._dragging&&e._clearHoverLinkToSeries()}))},t.prototype._enableHoverLinkFromSeries=function(){var e=this.api.getZr();this.visualMapModel.option.hoverLink?(e.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),e.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},t.prototype._doHoverLinkToSeries=function(e,t){var n=this.visualMapModel,r=n.itemSize;if(n.option.hoverLink){var i=[0,r[1]],o=n.getExtent();e=EG(LG(i[0],e),i[1]);var a=function(e,t,n){var r=6,i=e.get("hoverLinkDataSize");i&&(r=AG(i,t,n,!0)/2);return r}(n,o,i),s=[e-a,e+a],l=AG(e,i,o,!0),u=[AG(s[0],i,o,!0),AG(s[1],i,o,!0)];s[0]<i[0]&&(u[0]=-1/0),s[1]>i[1]&&(u[1]=1/0),t&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",a):u[1]===1/0?this._showIndicator(l,u[0],"> ",a):this._showIndicator(l,l,"≈ ",a));var c=this._hoverLinkDataIndices,h=[];(t||OG(n))&&(h=this._hoverLinkDataIndices=n.findTargetDataIndices(u));var d=function(e,t){var n={},r={};return i(e||[],n),i(t||[],r,n),[o(n),o(r)];function i(e,t,n){for(var r=0,i=e.length;r<i;r++){var o=qo(e[r].seriesId,null);if(null==o)return;for(var a=Go(e[r].dataIndex),s=n&&n[o],l=0,u=a.length;l<u;l++){var c=a[l];s&&s[c]?s[c]=null:(t[o]||(t[o]={}))[c]=1}}}function o(e,t){var n=[];for(var r in e)if(e.hasOwnProperty(r)&&null!=e[r])if(t)n.push(+r);else{var i=o(e[r],!0);i.length&&n.push({seriesId:r,dataIndex:i})}return n}}(c,h);this._dispatchHighDown("downplay",DG(d[0],n)),this._dispatchHighDown("highlight",DG(d[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var t;if(ev(e.target,(function(e){var n=bl(e);if(null!=n.dataIndex)return t=n,!0}),!0),t){var n=this.ecModel.getSeriesByIndex(t.seriesIndex),r=this.visualMapModel;if(r.isTargetSeries(n)){var i=n.getData(t.dataType),o=i.getStore().get(r.getDataDimensionIndex(i),t.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n<t.length;n++)this.api.leaveBlur(t[n])},t.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var e=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",DG(e,this.visualMapModel)),e.length=0},t.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var e=this.api.getZr();e.off("mouseover",this._hoverLinkFromSeriesMouseOver),e.off("mouseout",this._hideIndicator)},t.prototype._applyTransform=function(e,t,n,r){var i=nh(t,r?null:this.group);return J(e)?rh(e,i,n):ih(e,i,n)},t.prototype._dispatchHighDown=function(e,t){t&&t.length&&this.api.dispatchAction({type:e,batch:t})},t.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},t.type="visualMap.continuous",t}(TG);function PG(e,t,n,r){return new lc({shape:{points:e},draggable:!!n,cursor:t,drift:n,onmousemove:function(e){bt(e.event)},ondragend:r})}function OG(e){var t=e.get("hoverLinkOnHandle");return!!(null==t?e.get("realtime"):t)}function RG(e){return"vertical"===e?"ns-resize":"ew-resize"}var kG={type:"selectDataRange",event:"dataRangeSelected",update:"update"},zG=function(e,t){t.eachComponent({mainType:"visualMap",query:e},(function(t){t.setSelected(e.selected)}))},VG=[{createOnAllSeries:!0,reset:function(e,t){var n=[];return t.eachComponent("visualMap",(function(t){var r,i,o,a,s,l=e.pipelineContext;!t.isTargetSeries(e)||l&&l.large||n.push((r=t.stateList,i=t.targetVisuals,o=K(t.getValueState,t),a=t.getDataDimensionIndex(e.getData()),s={},W(r,(function(e){var t=sI.prepareVisualTypes(i[e]);s[e]=t})),{progress:function(e,t){var n,r;function l(e){return qm(t,r,e)}function u(e,n){$m(t,r,e,n)}null!=a&&(n=t.getDimensionIndex(a));for(var c=t.getStore();null!=(r=e.next());){var h=t.getRawDataItem(r);if(!h||!1!==h.visualMap)for(var d=null!=a?c.get(n,r):r,p=o(d),f=i[p],g=s[p],m=0,v=g.length;m<v;m++){var y=g[m];f[y]&&f[y].applyVisual(d,l,u)}}}}))})),n}},{createOnAllSeries:!0,reset:function(e,t){var n=e.getData(),r=[];t.eachComponent("visualMap",(function(t){if(t.isTargetSeries(e)){var i=t.getVisualMeta(K(BG,null,e,t))||{stops:[],outerColors:[]},o=t.getDataDimensionIndex(n);o>=0&&(i.dimension=o,r.push(i))}})),e.getData().setVisual("visualMeta",r)}}];function BG(e,t,n,r){for(var i=t.targetVisuals[r],o=sI.prepareVisualTypes(i),a={color:Km(e.getData(),"color")},s=0,l=o.length;s<l;s++){var u=o[s],c=i["opacity"===u?"__alphaForOpacity":u];c&&c.applyVisual(n,h,d)}return a.color;function h(e){return a[e]}function d(e,t){a[e]=t}}var FG=W;function GG(e){var t=e&&e.visualMap;J(t)||(t=t?[t]:[]),FG(t,(function(e){if(e){HG(e,"splitList")&&!HG(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&J(t)&&FG(t,(function(e){re(e)&&(HG(e,"start")&&!HG(e,"min")&&(e.min=e.start),HG(e,"end")&&!HG(e,"max")&&(e.max=e.end))}))}}))}function HG(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var UG=!1;function WG(e){UG||(UG=!0,e.registerSubTypeDefaulter("visualMap",(function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"})),e.registerAction(kG,zG),W(VG,(function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)})),e.registerPreprocessor(GG))}function jG(e){e.registerComponentModel(wG),e.registerComponentView(NG),WG(e)}var XG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return l(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],YG[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual((function(e,t){"categories"===r?(e.mappingMethod="category",e.categories=O(i)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=j(this._pieceList,(function(e){return e=O(e),"inRange"!==t&&(e.visual=null),e})))}))},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=sI.listVisualTypes(),i=this.isCategory();function o(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}W(t.pieces,(function(e){W(r,(function(t){e.hasOwnProperty(t)&&(n[t]=1)}))})),W(n,(function(e,n){var r=!1;W(this.stateList,(function(e){r=r||o(t,e,n)||o(t.target,e,n)}),this),!r&&W(this.stateList,(function(e){(t[e]||(t[e]={}))[n]=dG(n,"inRange"===e?"active":"inactive",i)}))}),this),e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,W(r,(function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)}),this),"single"===n.selectedMode){var o=!1;W(r,(function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(o?i[n]=!1:o=!0)}),this)}},t.prototype.getItemSymbol=function(){return this.get("itemSymbol")},t.prototype.getSelectedMapKey=function(e){return"categories"===this._mode?e.value+"":e.index+""},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(e){this.option.selected=O(e)},t.prototype.getValueState=function(e){var t=sI.findPieceIndex(e,this._pieceList);return null!=t&&this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries((function(r){var i=[],o=r.getData();o.each(this.getDataDimensionIndex(o),(function(t,r){sI.findPieceIndex(t,n)===e&&i.push(r)}),this),t.push({seriesId:r.id,dataIndex:i})}),this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(null!=e.value)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(!this.isCategory()){var t=[],n=["",""],r=this,i=this._pieceList.slice();if(i.length){var o=i[0].interval[0];o!==-1/0&&i.unshift({interval:[-1/0,o]}),(o=i[i.length-1].interval[1])!==1/0&&i.push({interval:[o,1/0]})}else i.push({interval:[-1/0,1/0]});var a=-1/0;return W(i,(function(e){var t=e.interval;t&&(t[0]>a&&s([a,t[0]],"outOfRange"),s(t.slice()),a=t[1])}),this),{stops:t,outerColors:n}}function s(i,o){var a=r.getRepresentValue({interval:i});o||(o=r.getValueState(a));var s=e(a,o);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:t.push({value:i[0],color:s},{value:i[1],color:s})}},t.type="visualMap.piecewise",t.defaultOption=Yh(xG.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(xG),YG={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var o=(r[1]-r[0])/i;+o.toFixed(n)!==o&&n<5;)n++;t.precision=n,o=+o.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var a=0,s=r[0];a<i;s+=o,a++){var l=a===i-1?r[1]:s+o;e.push({interval:[s,l],close:[1,1]})}t.maxOpen&&e.push({interval:[r[1],1/0],close:[0,0]}),So(e),W(e,(function(e,t){e.index=t,e.text=this.formatValueText(e.interval)}),this)},categories:function(e){var t=this.option;W(t.categories,(function(t){e.push({text:this.formatValueText(t,!0),value:t})}),this),ZG(t,e)},pieces:function(e){var t=this.option;W(t.pieces,(function(t,n){re(t)||(t={value:t});var r={text:"",index:n};if(null!=t.label&&(r.text=t.label),t.hasOwnProperty("value")){var i=r.value=t.value;r.interval=[i,i],r.close=[1,1]}else{for(var o=r.interval=[],a=r.close=[0,0],s=[1,0,1],l=[-1/0,1/0],u=[],c=0;c<2;c++){for(var h=[["gte","gt","min"],["lte","lt","max"]][c],d=0;d<3&&null==o[c];d++)o[c]=t[h[d]],a[c]=s[d],u[c]=2===d;null==o[c]&&(o[c]=l[c])}u[0]&&o[1]===1/0&&(a[0]=0),u[1]&&o[0]===-1/0&&(a[1]=0),"production"!==process.env.NODE_ENV&&o[0]>o[1]&&console.warn("Piece "+n+"is illegal: "+o+" lower bound should not greater then uppper bound."),o[0]===o[1]&&a[0]&&a[1]&&(r.value=o[0])}r.visual=sI.retrieveVisuals(t),e.push(r)}),this),ZG(t,e),So(e),W(e,(function(e){var t=e.close,n=[["<","≤"][t[1]],[">","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,n)}),this)}};function ZG(e,t){var n=e.inverse;("vertical"===e.orient?!n:n)&&t.reverse()}var qG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return l(t,e),t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get("textGap"),r=t.textStyleModel,i=r.getFont(),o=r.getTextColor(),a=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),u=l.endsText,c=he(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],s,c,a),W(l.viewPieceList,(function(r){var l=r.piece,u=new Yi;u.onclick=K(this._onItemClick,this,l),this._enableHoverLink(u,r.indexInModelPieceList);var h=t.getRepresentValue(l);if(this._createItemSymbol(u,h,[0,0,s[0],s[1]]),c){var d=this.visualMapModel.getValueState(h);u.add(new ll({style:{x:"right"===a?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:a,font:i,fill:o,opacity:"outOfRange"===d?.5:1}}))}e.add(u)}),this),u&&this._renderEndsText(e,u[1],s,c,a),Yd(t.get("orient"),e,t.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on("mouseover",(function(){return r("highlight")})).on("mouseout",(function(){return r("downplay")}));var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:DG(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return CG(e,this.api,e.itemSize);var n=t.align;return n&&"auto"!==n||(n="left"),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var o=new Yi,a=this.visualMapModel.textStyleModel;o.add(new ll({style:wh(a,{x:r?"right"===i?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:r?i:"center",text:t})})),e.add(o)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=j(e.getPieceList(),(function(e,t){return{piece:e,indexInModelPieceList:t}})),n=e.get("text"),r=e.get("orient"),i=e.get("inverse");return("horizontal"===r?i:!i)?t.reverse():n&&(n=n.slice().reverse()),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n){e.add(dv(this.getControllerVisual(t,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(t,"color")))},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,r=n.selectedMode;if(r){var i=O(n.selected),o=t.getSelectedMapKey(e);"single"===r||!0===r?(i[o]=!0,W(i,(function(e,t){i[t]=t===o}))):i[o]=!i[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type="visualMap.piecewise",t}(TG);function KG(e){e.registerComponentModel(XG),e.registerComponentView(qG),WG(e)}var $G={label:{enabled:!0},decal:{show:!1}},JG=ta(),QG={};function eH(e,t){var n=e.getModel("aria");if(n.get("enabled")){var r=O($G);R(r.label,e.getLocaleModel().get("aria"),!1),R(n.option,r,!1),function(){if(n.getModel("decal").get("show")){var t=Te();e.eachSeries((function(e){if(!e.isColorBySeries()){var n=t.get(e.type);n||(n={},t.set(e.type,n)),JG(e).scope=n}})),e.eachRawSeries((function(t){if(!e.isSeriesFiltered(t))if(Q(t.enableAriaDecal))t.enableAriaDecal();else{var n=t.getData();if(t.isColorBySeries()){var r=Ep(t.ecModel,t.name,QG,e.getSeriesCount()),i=n.getVisual("decal");n.setVisual("decal",u(i,r))}else{var o=t.getRawData(),a={},s=JG(t).scope;n.each((function(e){var t=n.getRawIndex(e);a[t]=e}));var l=o.count();o.each((function(e){var r=a[e],i=o.getName(e)||e+"",c=Ep(t.ecModel,i,s,l),h=n.getItemVisual(r,"decal");n.setItemVisual(r,"decal",u(h,c))}))}}function u(e,t){var n=e?z(z({},t),e):t;return n.dirty=!0,n}}))}}(),function(){var r=t.getZr().dom;if(!r)return;var o=e.getLocaleModel().get("aria"),a=n.getModel("label");if(a.option=V(a.option,o),!a.get("enabled"))return;if(a.get("description"))return void r.setAttribute("aria-label",a.get("description"));var s,l=e.getSeriesCount(),u=a.get(["data","maxCount"])||10,c=a.get(["series","maxCount"])||10,h=Math.min(l,c);if(l<1)return;var d=function(){var t=e.get("title");t&&t.length&&(t=t[0]);return t&&t.text}();s=d?i(a.get(["general","withTitle"]),{title:d}):a.get(["general","withoutTitle"]);var p=[];s+=i(l>1?a.get(["series","multiple","prefix"]):a.get(["series","single","prefix"]),{seriesCount:l}),e.eachSeries((function(t,n){if(n<h){var r=void 0,o=t.get("name")?"withName":"withoutName";r=i(r=l>1?a.get(["series","multiple",o]):a.get(["series","single",o]),{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:(_=t.subType,x=e.getLocaleModel().get(["series","typeNames"]),x[_]||x.chart)});var s=t.getData();if(s.count()>u)r+=i(a.get(["data","partialData"]),{displayCnt:u});else r+=a.get(["data","allData"]);for(var c=a.get(["data","separator","middle"]),d=a.get(["data","separator","end"]),f=[],g=0;g<s.count();g++)if(g<u){var m=s.getName(g),v=s.getValues(g),y=a.get(["data",m?"withName":"withoutName"]);f.push(i(y,{name:m,value:v.join(c)}))}r+=f.join(c)+d,p.push(r)}var _,x}));var f=a.getModel(["series","multiple","separator"]),g=f.get("middle"),m=f.get("end");s+=p.join(g)+m,r.setAttribute("aria-label",s)}()}function i(e,t){if(!ee(e))return e;var n=e;return W(t,(function(e,t){n=n.replace(new RegExp("\\{\\s*"+t+"\\s*\\}","g"),e)})),n}}function tH(e){if(e&&e.aria){var t=e.aria;null!=t.show&&(t.enabled=t.show),t.label=t.label||{},W(["description","general","series","data"],(function(e){null!=t[e]&&(t.label[e]=t[e])}))}}var nH={value:"eq","<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},rH=function(){function e(e){if(null==(this._condVal=ee(e)?new RegExp(e):ue(e)?e:null)){var t="";"production"!==process.env.NODE_ENV&&(t=ko("Illegal regexp",e,"in")),zo(t)}}return e.prototype.evaluate=function(e){var t=typeof e;return ee(t)?this._condVal.test(e):!!ne(t)&&this._condVal.test(e+"")},e}(),iH=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),oH=function(){function e(){}return e.prototype.evaluate=function(){for(var e=this.children,t=0;t<e.length;t++)if(!e[t].evaluate())return!1;return!0},e}(),aH=function(){function e(){}return e.prototype.evaluate=function(){for(var e=this.children,t=0;t<e.length;t++)if(e[t].evaluate())return!0;return!1},e}(),sH=function(){function e(){}return e.prototype.evaluate=function(){return!this.child.evaluate()},e}(),lH=function(){function e(){}return e.prototype.evaluate=function(){for(var e=!!this.valueParser,t=(0,this.getValue)(this.valueGetterParam),n=e?this.valueParser(t):null,r=0;r<this.subCondList.length;r++)if(!this.subCondList[r].evaluate(e?n:t))return!1;return!0},e}();function uH(e,t){if(!0===e||!1===e){var n=new iH;return n.value=e,n}var r="";return hH(e)||("production"!==process.env.NODE_ENV&&(r=ko("Illegal config. Expect a plain object but actually",e)),zo(r)),e.and?cH("and",e,t):e.or?cH("or",e,t):e.not?function(e,t){var n=e.not,r="";"production"!==process.env.NODE_ENV&&(r=ko('"not" condition should only be `not: {}`.',"Illegal condition:",e));hH(n)||zo(r);var i=new sH;i.child=uH(n,t),i.child||zo(r);return i}(e,t):function(e,t){for(var n="",r=t.prepareGetValue(e),i=[],o=q(e),a=e.parser,s=a?Zf(a):null,l=0;l<o.length;l++){var u=o[l];if("parser"!==u&&!t.valueGetterAttrMap.get(u)){var c=Ae(nH,u)?nH[u]:u,h=e[u],d=s?s(h):h,p=Qf(c,d)||"reg"===c&&new rH(d);p||("production"!==process.env.NODE_ENV&&(n=ko('Illegal relational operation: "'+u+'" in condition:',e)),zo(n)),i.push(p)}}i.length||("production"!==process.env.NODE_ENV&&(n=ko("Relational condition must have at least one operator.","Illegal condition:",e)),zo(n));var f=new lH;return f.valueGetterParam=r,f.valueParser=s,f.getValue=t.getValue,f.subCondList=i,f}(e,t)}function cH(e,t,n){var r=t[e],i="";"production"!==process.env.NODE_ENV&&(i=ko('"and"/"or" condition should only be `'+e+": [...]` and must not be empty array.","Illegal condition:",t)),J(r)||zo(i),r.length||zo(i);var o="and"===e?new oH:new aH;return o.children=j(r,(function(e){return uH(e,n)})),o.children.length||zo(i),o}function hH(e){return re(e)&&!U(e)}var dH=function(){function e(e,t){this._cond=uH(e,t)}return e.prototype.evaluate=function(){return this._cond.evaluate()},e}();var pH={type:"echarts:filter",transform:function(e){for(var t,n,r,i=e.upstream,o=(n=e.config,r={valueGetterAttrMap:Te({dimension:!0}),prepareGetValue:function(e){var t="",n=e.dimension;Ae(e,"dimension")||("production"!==process.env.NODE_ENV&&(t=ko('Relation condition must has prop "dimension" specified.',"Illegal condition:",e)),zo(t));var r=i.getDimensionInfo(n);return r||("production"!==process.env.NODE_ENV&&(t=ko("Can not find dimension info via: "+n+".\n","Existing dimensions: ",i.cloneAllDimensionInfo(),".\n","Illegal condition:",e,".\n")),zo(t)),{dimIdx:r.index}},getValue:function(e){return i.retrieveValueFromItem(t,e.dimIdx)}},new dH(n,r)),a=[],s=0,l=i.count();s<l;s++)t=i.getRawDataItem(s),o.evaluate()&&a.push(t);return{data:a}}},fH="";"production"!==process.env.NODE_ENV&&(fH=["Valid config is like:",'{ dimension: "age", order: "asc" }','or [{ dimension: "age", order: "asc"], { dimension: "date", order: "desc" }]'].join(" "));var gH={type:"echarts:sort",transform:function(e){var t=e.upstream,n=e.config,r="",i=Go(n);i.length||("production"!==process.env.NODE_ENV&&(r="Empty `config` in sort transform."),zo(r));var o=[];W(i,(function(e){var n=e.dimension,i=e.order,a=e.parser,s=e.incomparable;if(null==n&&("production"!==process.env.NODE_ENV&&(r='Sort transform config must has "dimension" specified.'+fH),zo(r)),"asc"!==i&&"desc"!==i&&("production"!==process.env.NODE_ENV&&(r='Sort transform config must has "order" specified.'+fH),zo(r)),s&&"min"!==s&&"max"!==s){var l="";"production"!==process.env.NODE_ENV&&(l='incomparable must be "min" or "max" rather than "'+s+'".'),zo(l)}if("asc"!==i&&"desc"!==i){var u="";"production"!==process.env.NODE_ENV&&(u='order must be "asc" or "desc" rather than "'+i+'".'),zo(u)}var c=t.getDimensionInfo(n);c||("production"!==process.env.NODE_ENV&&(r=ko("Can not find dimension info via: "+n+".\n","Existing dimensions: ",t.cloneAllDimensionInfo(),".\n","Illegal config:",e,".\n")),zo(r));var h=a?Zf(a):null;a&&!h&&("production"!==process.env.NODE_ENV&&(r=ko("Invalid parser name "+a+".\n","Illegal config:",e,".\n")),zo(r)),o.push({dimIdx:c.index,parser:h,comparator:new $f(i,s)})}));var a=t.sourceFormat;a!==sp&&a!==lp&&("production"!==process.env.NODE_ENV&&(r='sourceFormat "'+a+'" is not supported yet'),zo(r));for(var s=[],l=0,u=t.count();l<u;l++)s.push(t.getRawDataItem(l));return s.sort((function(e,n){for(var r=0;r<o.length;r++){var i=o[r],a=t.retrieveValueFromItem(e,i.dimIdx),s=t.retrieveValueFromItem(n,i.dimIdx);i.parser&&(a=i.parser(a),s=i.parser(s));var l=i.comparator.evaluate(a,s);if(0!==l)return l}return 0})),{data:s}}};var mH=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataset",t}return l(t,e),t.prototype.init=function(t,n,r){e.prototype.init.call(this,t,n,r),this._sourceManager=new yg(this),_g(this)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),_g(this)},t.prototype.optionUpdated=function(){this._sourceManager.dirty()},t.prototype.getSourceManager=function(){return this._sourceManager},t.type="dataset",t.defaultOption={seriesLayoutBy:dp},t}(tp),vH=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataset",t}return l(t,e),t.type="dataset",t}(Kg);function yH(e){e.registerComponentModel(mH),e.registerComponentView(vH)}var _H=Ds.CMD;function xH(e,t){return Math.abs(e-t)<1e-5}function bH(e){var t,n,r,i,o,a=e.data,s=e.len(),l=[],u=0,c=0,h=0,d=0;function p(e,n){t&&t.length>2&&l.push(t),t=[e,n]}function f(e,n,r,i){xH(e,r)&&xH(n,i)||t.push(e,n,r,i,r,i)}function g(e,n,r,i,o,a){var s=Math.abs(n-e),l=4*Math.tan(s/4)/3,u=n<e?-1:1,c=Math.cos(e),h=Math.sin(e),d=Math.cos(n),p=Math.sin(n),f=c*o+r,g=h*a+i,m=d*o+r,v=p*a+i,y=o*l*u,_=a*l*u;t.push(f-y*h,g+_*c,m+y*p,v-_*d,m,v)}for(var m=0;m<s;){var v=a[m++],y=1===m;switch(y&&(h=u=a[m],d=c=a[m+1],v!==_H.L&&v!==_H.C&&v!==_H.Q||(t=[h,d])),v){case _H.M:u=h=a[m++],c=d=a[m++],p(h,d);break;case _H.L:f(u,c,n=a[m++],r=a[m++]),u=n,c=r;break;case _H.C:t.push(a[m++],a[m++],a[m++],a[m++],u=a[m++],c=a[m++]);break;case _H.Q:n=a[m++],r=a[m++],i=a[m++],o=a[m++],t.push(u+2/3*(n-u),c+2/3*(r-c),i+2/3*(n-i),o+2/3*(r-o),i,o),u=i,c=o;break;case _H.A:var _=a[m++],x=a[m++],b=a[m++],w=a[m++],S=a[m++],T=a[m++]+S;m+=1;var M=!a[m++];n=Math.cos(S)*b+_,r=Math.sin(S)*w+x,y?p(h=n,d=r):f(u,c,n,r),u=Math.cos(T)*b+_,c=Math.sin(T)*w+x;for(var C=(M?-1:1)*Math.PI/2,D=S;M?D>T:D<T;D+=C){g(D,M?Math.max(D+C,T):Math.min(D+C,T),_,x,b,w)}break;case _H.R:h=u=a[m++],d=c=a[m++],n=h+a[m++],r=d+a[m++],p(n,d),f(n,d,n,r),f(n,r,h,r),f(h,r,h,d),f(h,d,n,d);break;case _H.Z:t&&f(u,c,h,d),u=h,c=d}}return t&&t.length>2&&l.push(t),l}function wH(e,t,n,r,i,o,a,s,l,u){if(xH(e,n)&&xH(t,r)&&xH(i,a)&&xH(o,s))l.push(a,s);else{var c=2/u,h=c*c,d=a-e,p=s-t,f=Math.sqrt(d*d+p*p);d/=f,p/=f;var g=n-e,m=r-t,v=i-a,y=o-s,_=g*g+m*m,x=v*v+y*y;if(_<h&&x<h)l.push(a,s);else{var b=d*g+p*m,w=-d*v-p*y;if(_-b*b<h&&b>=0&&x-w*w<h&&w>=0)l.push(a,s);else{var S=[],T=[];En(e,n,i,a,.5,S),En(t,r,o,s,.5,T),wH(S[0],T[0],S[1],T[1],S[2],T[2],S[3],T[3],l,u),wH(S[4],T[4],S[5],T[5],S[6],T[6],S[7],T[7],l,u)}}}}function SH(e,t,n){var r=e[t],i=e[1-t],o=Math.abs(r/i),a=Math.ceil(Math.sqrt(o*n)),s=Math.floor(n/a);0===s&&(s=1,a=n);for(var l=[],u=0;u<a;u++)l.push(s);var c=n-a*s;if(c>0)for(u=0;u<c;u++)l[u%a]+=1;return l}function TH(e,t,n){for(var r=e.r0,i=e.r,o=e.startAngle,a=e.endAngle,s=Math.abs(a-o),l=s*i,u=i-r,c=l>Math.abs(u),h=SH([l,u],c?0:1,t),d=(c?s:u)/h.length,p=0;p<h.length;p++)for(var f=(c?u:s)/h[p],g=0;g<h[p];g++){var m={};c?(m.startAngle=o+d*p,m.endAngle=o+d*(p+1),m.r0=r+f*g,m.r=r+f*(g+1)):(m.startAngle=o+f*g,m.endAngle=o+f*(g+1),m.r0=r+d*p,m.r=r+d*(p+1)),m.clockwise=e.clockwise,m.cx=e.cx,m.cy=e.cy,n.push(m)}}function MH(e,t,n,r){return e*r-n*t}function CH(e,t,n,r,i,o,a,s){var l=n-e,u=r-t,c=a-i,h=s-o,d=MH(c,h,l,u);if(Math.abs(d)<1e-6)return null;var p=MH(e-i,t-o,c,h)/d;return p<0||p>1?null:new kt(p*l+e,p*u+t)}function DH(e,t,n){var r=new kt;kt.sub(r,n,t),r.normalize();var i=new kt;return kt.sub(i,e,t),i.dot(r)}function AH(e,t){var n=e[e.length-1];n&&n[0]===t[0]&&n[1]===t[1]||e.push(t)}function IH(e){var t=e.points,n=[],r=[];ns(t,n,r);var i=new jt(n[0],n[1],r[0]-n[0],r[1]-n[1]),o=i.width,a=i.height,s=i.x,l=i.y,u=new kt,c=new kt;return o>a?(u.x=c.x=s+o/2,u.y=l,c.y=l+a):(u.y=c.y=l+a/2,u.x=s,c.x=s+o),function(e,t,n){for(var r=e.length,i=[],o=0;o<r;o++){var a=e[o],s=e[(o+1)%r],l=CH(a[0],a[1],s[0],s[1],t.x,t.y,n.x,n.y);l&&i.push({projPt:DH(l,t,n),pt:l,idx:o})}if(i.length<2)return[{points:e},{points:e}];i.sort((function(e,t){return e.projPt-t.projPt}));var u=i[0],c=i[i.length-1];if(c.idx<u.idx){var h=u;u=c,c=h}var d=[u.pt.x,u.pt.y],p=[c.pt.x,c.pt.y],f=[d],g=[p];for(o=u.idx+1;o<=c.idx;o++)AH(f,e[o].slice());for(AH(f,p),AH(f,d),o=c.idx+1;o<=u.idx+r;o++)AH(g,e[o%r].slice());return AH(g,d),AH(g,p),[{points:f},{points:g}]}(t,u,c)}function EH(e,t,n,r){if(1===n)r.push(t);else{var i=Math.floor(n/2),o=e(t);EH(e,o[0],i,r),EH(e,o[1],n-i,r)}return r}function LH(e,t){t.setStyle(e.style),t.z=e.z,t.z2=e.z2,t.zlevel=e.zlevel}function NH(e,t){var n,r=[],i=e.shape;switch(e.type){case"rect":!function(e,t,n){for(var r=e.width,i=e.height,o=r>i,a=SH([r,i],o?0:1,t),s=o?"width":"height",l=o?"height":"width",u=o?"x":"y",c=o?"y":"x",h=e[s]/a.length,d=0;d<a.length;d++)for(var p=e[l]/a[d],f=0;f<a[d];f++){var g={};g[u]=d*h,g[c]=f*p,g[s]=h,g[l]=p,g.x+=e.x,g.y+=e.y,n.push(g)}}(i,t,r),n=ol;break;case"sector":TH(i,t,r),n=rc;break;case"circle":TH({r0:0,r:i.r,startAngle:0,endAngle:2*Math.PI,cx:i.cx,cy:i.cy},t,r),n=rc;break;default:var o=e.getComputedTransform(),a=o?Math.sqrt(Math.max(o[0]*o[0]+o[1]*o[1],o[2]*o[2]+o[3]*o[3])):1,s=j(function(e,t){var n=bH(e),r=[];t=t||1;for(var i=0;i<n.length;i++){var o=n[i],a=[],s=o[0],l=o[1];a.push(s,l);for(var u=2;u<o.length;){var c=o[u++],h=o[u++],d=o[u++],p=o[u++],f=o[u++],g=o[u++];wH(s,l,c,h,d,p,f,g,a,t),s=f,l=g}r.push(a)}return r}(e.getUpdatedPathProxy(),a),(function(e){return function(e){for(var t=[],n=0;n<e.length;)t.push([e[n++],e[n++]]);return t}(e)})),l=s.length;if(0===l)EH(IH,{points:s[0]},t,r);else if(l===t)for(var u=0;u<l;u++)r.push({points:s[u]});else{var c=0,h=j(s,(function(e){var t=[],n=[];ns(e,t,n);var r=(n[1]-t[1])*(n[0]-t[0]);return c+=r,{poly:e,area:r}}));h.sort((function(e,t){return t.area-e.area}));var d=t;for(u=0;u<l;u++){var p=h[u];if(d<=0)break;var f=u===l-1?d:Math.ceil(p.area/c*t);f<0||(EH(IH,{points:p.poly},f,r),d-=f)}}n=lc}if(!n)return function(e,t){for(var n=[],r=0;r<t;r++)n.push(Vu(e));return n}(e,t);var g=[];for(u=0;u<r.length;u++){var m=new n;m.setShape(r[u]),LH(e,m),g.push(m)}return g}function PH(e,t){var n=e.length,r=t.length;if(n===r)return[e,t];for(var i=[],o=[],a=n<r?e:t,s=Math.min(n,r),l=Math.abs(r-n)/6,u=(s-2)/6,c=Math.ceil(l/u)+1,h=[a[0],a[1]],d=l,p=2;p<s;){var f=a[p-2],g=a[p-1],m=a[p++],v=a[p++],y=a[p++],_=a[p++],x=a[p++],b=a[p++];if(d<=0)h.push(m,v,y,_,x,b);else{for(var w=Math.min(d,c-1)+1,S=1;S<=w;S++){var T=S/w;En(f,m,y,x,T,i),En(g,v,_,b,T,o),f=i[3],g=o[3],h.push(i[1],o[1],i[2],o[2],f,g),m=i[5],v=o[5],y=i[6],_=o[6]}d-=w-1}}return a===e?[h,t]:[e,h]}function OH(e,t){for(var n=e.length,r=e[n-2],i=e[n-1],o=[],a=0;a<t.length;)o[a++]=r,o[a++]=i;return o}function RH(e){for(var t=0,n=0,r=0,i=e.length,o=0,a=i-2;o<i;a=o,o+=2){var s=e[a],l=e[a+1],u=e[o],c=e[o+1],h=s*c-u*l;t+=h,n+=(s+u)*h,r+=(l+c)*h}return 0===t?[e[0]||0,e[1]||0]:[n/t/3,r/t/3,t]}function kH(e,t,n,r){for(var i=(e.length-2)/6,o=1/0,a=0,s=e.length,l=s-2,u=0;u<i;u++){for(var c=6*u,h=0,d=0;d<s;d+=2){var p=0===d?c:(c+d-2)%l+2,f=e[p]-n[0],g=e[p+1]-n[1],m=t[d]-r[0]-f,v=t[d+1]-r[1]-g;h+=m*m+v*v}h<o&&(o=h,a=u)}return a}function zH(e){for(var t=[],n=e.length,r=0;r<n;r+=2)t[r]=e[n-r-2],t[r+1]=e[n-r-1];return t}function VH(e){return e.__isCombineMorphing}var BH="__mOriginal_";function FH(e,t,n){var r=BH+t,i=e[r]||e[t];e[r]||(e[r]=e[t]);var o=n.replace,a=n.after,s=n.before;e[t]=function(){var e,t=arguments;return s&&s.apply(this,t),e=o?o.apply(this,t):i.apply(this,t),a&&a.apply(this,t),e}}function GH(e,t){var n=BH+t;e[n]&&(e[t]=e[n],e[n]=null)}function HH(e,t){for(var n=0;n<e.length;n++)for(var r=e[n],i=0;i<r.length;){var o=r[i],a=r[i+1];r[i++]=t[0]*o+t[2]*a+t[4],r[i++]=t[1]*o+t[3]*a+t[5]}}function UH(e,t){var n=e.getUpdatedPathProxy(),r=t.getUpdatedPathProxy(),i=function(e,t){for(var n,r,i,o=[],a=[],s=0;s<Math.max(e.length,t.length);s++){var l=e[s],u=t[s],c=void 0,h=void 0;l?u?(r=c=(n=PH(l,u))[0],i=h=n[1]):(h=OH(i||l,l),c=l):(c=OH(r||u,u),h=u),o.push(c),a.push(h)}return[o,a]}(bH(n),bH(r)),o=i[0],a=i[1],s=e.getComputedTransform(),l=t.getComputedTransform();s&&HH(o,s),l&&HH(a,l),FH(t,"updateTransform",{replace:function(){this.transform=null}}),t.transform=null;var u=function(e,t,n,r){for(var i,o=[],a=0;a<e.length;a++){var s=e[a],l=t[a],u=RH(s),c=RH(l);null==i&&(i=u[2]<0!=c[2]<0);var h=[],d=[],p=0,f=1/0,g=[],m=s.length;i&&(s=zH(s));for(var v=6*kH(s,l,u,c),y=m-2,_=0;_<y;_+=2){var x=(v+_)%y+2;h[_+2]=s[x]-u[0],h[_+3]=s[x+1]-u[1]}h[0]=s[v]-u[0],h[1]=s[v+1]-u[1];for(var b=r/n,w=-r/2;w<=r/2;w+=b){var S=Math.sin(w),T=Math.cos(w),M=0;for(_=0;_<s.length;_+=2){var C=h[_],D=h[_+1],A=l[_]-c[0],I=l[_+1]-c[1],E=A*T-I*S,L=A*S+I*T;g[_]=E,g[_+1]=L;var N=E-C,P=L-D;M+=N*N+P*P}if(M<f){f=M,p=w;for(var O=0;O<g.length;O++)d[O]=g[O]}}o.push({from:h,to:d,fromCp:u,toCp:c,rotation:-p})}return o}(o,a,10,Math.PI),c=[];FH(t,"buildPath",{replace:function(e){for(var n=t.__morphT,r=1-n,i=[],o=0;o<u.length;o++){var a=u[o],s=a.from,l=a.to,h=a.rotation*n,d=a.fromCp,p=a.toCp,f=Math.sin(h),g=Math.cos(h);qe(i,d,p,n);for(var m=0;m<s.length;m+=2){var v=s[m],y=s[m+1],_=v*r+(S=l[m])*n,x=y*r+(T=l[m+1])*n;c[m]=_*g-x*f+i[0],c[m+1]=_*f+x*g+i[1]}var b=c[0],w=c[1];e.moveTo(b,w);for(m=2;m<s.length;){var S=c[m++],T=c[m++],M=c[m++],C=c[m++],D=c[m++],A=c[m++];b===S&&w===T&&M===D&&C===A?e.lineTo(D,A):e.bezierCurveTo(S,T,M,C,D,A),b=D,w=A}}}})}function WH(e,t,n){if(!e||!t)return t;var r=n.done,i=n.during;return UH(e,t),t.__morphT=0,t.animateTo({__morphT:1},V({during:function(e){t.dirtyShape(),i&&i(e)},done:function(){GH(t,"buildPath"),GH(t,"updateTransform"),t.__morphT=-1,t.createPathProxy(),t.dirtyShape(),r&&r()}},n)),t}function jH(e,t,n,r,i,o){e=i===n?0:Math.round(32767*(e-n)/(i-n)),t=o===r?0:Math.round(32767*(t-r)/(o-r));for(var a,s=0,l=32768;l>0;l/=2){var u=0,c=0;(e&l)>0&&(u=1),(t&l)>0&&(c=1),s+=l*l*(3*u^c),0===c&&(1===u&&(e=l-1-e,t=l-1-t),a=e,e=t,t=a)}return s}function XH(e){var t=1/0,n=1/0,r=-1/0,i=-1/0,o=j(e,(function(e){var o=e.getBoundingRect(),a=e.getComputedTransform(),s=o.x+o.width/2+(a?a[4]:0),l=o.y+o.height/2+(a?a[5]:0);return t=Math.min(s,t),n=Math.min(l,n),r=Math.max(s,r),i=Math.max(l,i),[s,l]}));return j(o,(function(o,a){return{cp:o,z:jH(o[0],o[1],t,n,r,i),path:e[a]}})).sort((function(e,t){return e.z-t.z})).map((function(e){return e.path}))}function YH(e){return NH(e.path,e.count)}function ZH(e){return J(e[0])}function qH(e,t){for(var n=[],r=e.length,i=0;i<r;i++)n.push({one:e[i],many:[]});for(i=0;i<t.length;i++){var o=t[i].length,a=void 0;for(a=0;a<o;a++)n[a%r].many.push(t[i][a])}var s=0;for(i=r-1;i>=0;i--)if(!n[i].many.length){var l=n[s].many;if(l.length<=1){if(!s)return n;s=0}o=l.length;var u=Math.ceil(o/2);n[i].many=l.slice(u,o),n[s].many=l.slice(0,u),s++}return n}var KH={clone:function(e){for(var t=[],n=1-Math.pow(1-e.path.style.opacity,1/e.count),r=0;r<e.count;r++){var i=Vu(e.path);i.setStyle("opacity",n),t.push(i)}return t},split:null};function $H(e,t,n,r,i,o){if(e.length&&t.length){var a=Nc("update",r,i);if(a&&a.duration>0){var s,l,u=r.getModel("universalTransition").get("delay"),c=Object.assign({setToFinal:!0},a);ZH(e)&&(s=e,l=t),ZH(t)&&(s=t,l=e);for(var h=s?s===e:e.length>t.length,d=s?qH(l,s):qH(h?t:e,[h?e:t]),p=0,f=0;f<d.length;f++)p+=d[f].many.length;var g=0;for(f=0;f<d.length;f++)m(d[f],h,g,p),g+=d[f].many.length}}function m(e,t,r,i,a){var s=e.many,l=e.one;if(1!==s.length||a)for(var h=V({dividePath:KH[n],individualDelay:u&&function(e,t,n,o){return u(e+r,i)}},c),d=t?function(e,t,n){var r=[];!function e(t){for(var n=0;n<t.length;n++){var i=t[n];VH(i)?e(i.childrenRef()):i instanceof Ys&&r.push(i)}}(e);var i=r.length;if(!i)return{fromIndividuals:[],toIndividuals:[],count:0};var o=(n.dividePath||YH)({path:t,count:i});if(o.length!==i)return console.error("Invalid morphing: unmatched splitted path"),{fromIndividuals:[],toIndividuals:[],count:0};r=XH(r),o=XH(o);for(var a=n.done,s=n.during,l=n.individualDelay,u=new Mi,c=0;c<i;c++){var h=r[c],d=o[c];d.parent=t,d.copyTransform(u),l||UH(h,d)}function p(e){for(var t=0;t<o.length;t++)o[t].addSelfToZr(e)}function f(){t.__isCombineMorphing=!1,t.__morphT=-1,t.childrenRef=null,GH(t,"addSelfToZr"),GH(t,"removeSelfFromZr")}t.__isCombineMorphing=!0,t.childrenRef=function(){return o},FH(t,"addSelfToZr",{after:function(e){p(e)}}),FH(t,"removeSelfFromZr",{after:function(e){for(var t=0;t<o.length;t++)o[t].removeSelfFromZr(e)}});var g=o.length;if(l){var m=g,v=function(){0==--m&&(f(),a&&a())};for(c=0;c<g;c++){var y=l?V({delay:(n.delay||0)+l(c,g,r[c],o[c]),done:v},n):n;WH(r[c],o[c],y)}}else t.__morphT=0,t.animateTo({__morphT:1},V({during:function(e){for(var n=0;n<g;n++){var r=o[n];r.__morphT=t.__morphT,r.dirtyShape()}s&&s(e)},done:function(){f();for(var t=0;t<e.length;t++)GH(e[t],"updateTransform");a&&a()}},n));return t.__zr&&p(t.__zr),{fromIndividuals:r,toIndividuals:o,count:g}}(s,l,h):function(e,t,n){var r=t.length,i=[],o=n.dividePath||YH;if(VH(e)){!function e(t){for(var n=0;n<t.length;n++){var r=t[n];VH(r)?e(r.childrenRef()):r instanceof Ys&&i.push(r)}}(e.childrenRef());var a=i.length;if(a<r)for(var s=0,l=a;l<r;l++)i.push(Vu(i[s++%a]));i.length=r}else{i=o({path:e,count:r});var u=e.getComputedTransform();for(l=0;l<i.length;l++)i[l].setLocalTransform(u);if(i.length!==r)return console.error("Invalid morphing: unmatched splitted path"),{fromIndividuals:[],toIndividuals:[],count:0}}i=XH(i),t=XH(t);var c=n.individualDelay;for(l=0;l<r;l++){var h=c?V({delay:(n.delay||0)+c(l,r,i[l],t[l])},n):n;WH(i[l],t[l],h)}return{fromIndividuals:i,toIndividuals:t,count:t.length}}(l,s,h),p=d.fromIndividuals,f=d.toIndividuals,g=p.length,v=0;v<g;v++){y=u?V({delay:u(v,g)},c):c;o(p[v],f[v],t?s[v]:e.one,t?e.one:s[v],y)}else{var y,_=t?s[0]:l,x=t?l:s[0];if(VH(_))m({many:[_],one:x},!0,r,i,!0);else WH(_,x,y=u?V({delay:u(r,i)},c):c),o(_,x,_,x,y)}}}function JH(e){if(!e)return[];if(J(e)){for(var t=[],n=0;n<e.length;n++)t.push(JH(e[n]));return t}var r=[];return e.traverse((function(e){e instanceof Ys&&!e.disableMorphing&&!e.invisible&&!e.ignore&&r.push(e)})),r}var QH=ta();function eU(e,t,n,r){var i=function(e,t){for(var n=e.dimensions,r=0;r<n.length;r++){var i=e.getDimensionInfo(n[r]);if(i&&0===i.otherDims[t])return n[r]}}(e,r?"itemChildGroupId":"itemGroupId");if(i){var o=function(e,t,n){var r=e.getDimensionInfo(n),i=r&&r.ordinalMeta;if(r){var o=e.get(r.name,t);return i&&i.categories[o]||o+""}}(e,t,i);return o}var a=e.getRawDataItem(t),s=r?"childGroupId":"groupId";return a&&a[s]?a[s]+"":r?void 0:n||e.getId(t)}function tU(e){var t=[];return W(e,(function(e){var n=e.data,r=e.dataGroupId;if(n.count()>1e4)"production"!==process.env.NODE_ENV&&No("Universal transition is disabled on large data > 10k.");else for(var i=n.getIndices(),o=0;o<i.length;o++)t.push({data:n,groupId:eU(n,o,r,!1),childGroupId:eU(n,o,r,!0),divide:e.divide,dataIndex:o})})),t}function nU(e,t,n){e.traverse((function(e){e instanceof Ys&&Rc(e,{style:{opacity:0}},t,{dataIndex:n,isFrom:!0})}))}function rU(e){if(e.parent){var t=e.getComputedTransform();e.setLocalTransform(t),e.parent.remove(e)}}function iU(e){e.stopAnimation(),e.isGroup&&e.traverse((function(e){e.stopAnimation()}))}function oU(e,t,n){var r=Nc("update",n,t);r&&e.traverse((function(e){if(e instanceof ja){var t=function(e){return Lc(e).oldStyle}(e);t&&e.animateFrom({style:t},r)}}))}function aU(e,t,n){var r=tU(e),i=tU(t);function o(e,t,n,r,i){(n||e)&&t.animateFrom({style:n&&n!==e?z(z({},n.style),e.style):e.style},i)}var a=!1,s=0,l=Te(),u=Te();r.forEach((function(e){e.groupId&&l.set(e.groupId,!0),e.childGroupId&&u.set(e.childGroupId,!0)}));for(var c=0;c<i.length;c++){var h=i[c].groupId;if(u.get(h)){s=1;break}var d=i[c].childGroupId;if(d&&l.get(d)){s=2;break}}function p(e,t){return function(n){var r=n.data,i=n.dataIndex;return t?r.getId(i):e?1===s?n.childGroupId:n.groupId:2===s?n.childGroupId:n.groupId}}var f=function(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++){var i=e[r],o=t[r];if(i.data.getId(i.dataIndex)!==o.data.getId(o.dataIndex))return!1}return!0}(r,i),g={};if(!f)for(c=0;c<i.length;c++){var m=i[c],v=m.data.getItemGraphicEl(m.dataIndex);v&&(g[v.id]=!0)}function y(e,t){var n=r[t],s=i[e],l=s.data.hostModel,u=n.data.getItemGraphicEl(n.dataIndex),c=s.data.getItemGraphicEl(s.dataIndex);u!==c?u&&g[u.id]||c&&(iU(c),u?(iU(u),rU(u),a=!0,$H(JH(u),JH(c),s.divide,l,e,o)):nU(c,l,e)):c&&oU(c,s.dataIndex,l)}new h_(r,i,p(!0,f),p(!1,f),null,"multiple").update(y).updateManyToOne((function(e,t){var n=i[e],s=n.data,l=s.hostModel,u=s.getItemGraphicEl(n.dataIndex),c=Y(j(t,(function(e){return r[e].data.getItemGraphicEl(r[e].dataIndex)})),(function(e){return e&&e!==u&&!g[e.id]}));u&&(iU(u),c.length?(W(c,(function(e){iU(e),rU(e)})),a=!0,$H(JH(c),JH(u),n.divide,l,e,o)):nU(u,l,n.dataIndex))})).updateOneToMany((function(e,t){var n=r[t],s=n.data.getItemGraphicEl(n.dataIndex);if(!s||!g[s.id]){var l=Y(j(e,(function(e){return i[e].data.getItemGraphicEl(i[e].dataIndex)})),(function(e){return e&&e!==s})),u=i[e[0]].data.hostModel;l.length&&(W(l,(function(e){return iU(e)})),s?(iU(s),rU(s),a=!0,$H(JH(s),JH(l),n.divide,u,e[0],o)):W(l,(function(t){return nU(t,u,e[0])})))}})).updateManyToMany((function(e,t){new h_(t,e,(function(e){return r[e].data.getId(r[e].dataIndex)}),(function(e){return i[e].data.getId(i[e].dataIndex)})).update((function(n,r){y(e[n],t[r])})).execute()})).execute(),a&&W(t,(function(e){var t=e.data.hostModel,r=t&&n.getViewOfSeriesModel(t),i=Nc("update",t,0);r&&t.isAnimationEnabled()&&i&&i.duration>0&&r.group.traverse((function(e){e instanceof Ys&&!e.animators.length&&e.animateFrom({style:{opacity:0}},i)}))}))}function sU(e){var t=e.getModel("universalTransition").get("seriesKey");return t||e.id}function lU(e){return J(e)?e.sort().join(","):e}function uU(e){if(e.hostModel)return e.hostModel.getModel("universalTransition").get("divideShape")}function cU(e,t){for(var n=0;n<e.length;n++){if(null!=t.seriesIndex&&t.seriesIndex===e[n].seriesIndex||null!=t.seriesId&&t.seriesId===e[n].id)return n}}l_([FS]),l_([function(e){e.registerPainter("svg",NS)}]),l_([function(e){e.registerChartView(bT),e.registerSeriesModel(GS),e.registerLayout(wT("line",!0)),e.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,MT("line"))},function(e){e.registerChartView(RT),e.registerSeriesModel(DT),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,$(mx,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,vx("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,MT("bar")),e.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},(function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)}))}))},function(e){e.registerChartView(cM),e.registerSeriesModel(fM),Jm("pie",e.registerAction),e.registerLayout($(tM,"pie")),e.registerProcessor(rM("pie")),e.registerProcessor(function(e){return{seriesType:e,reset:function(e,t){var n=e.getData();n.filterSelf((function(e){var t=n.mapDimension("value"),r=n.get(t,e);return!(ne(r)&&!isNaN(r)&&r<0)}))}}}("pie"))},function(e){l_(fC),e.registerSeriesModel(gM),e.registerChartView(_M),e.registerLayout(wT("scatter"))},function(e){l_(AC),e.registerChartView(_C),e.registerSeriesModel(xC),e.registerLayout(gC),e.registerProcessor(rM("radar")),e.registerPreprocessor(yC)},function(e){l_(iA),e.registerChartView(BD),e.registerSeriesModel(FD),e.registerLayout(HD),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,GD),Jm("map",e.registerAction)},function(e){e.registerChartView(mA),e.registerSeriesModel(VA),e.registerLayout(FA),e.registerVisual(GA),function(e){e.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var n=e.dataIndex,r=t.getData().tree.getNodeByDataIndex(n);r.isExpand=!r.isExpand}))})),e.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},(function(e,t,n){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var r=tA(t.coordinateSystem,e,void 0,n);t.setCenter&&t.setCenter(r.center),t.setZoom&&t.setZoom(r.zoom)}))}))}(e)},function(e){e.registerSeriesModel(WA),e.registerChartView(rI),e.registerVisual(xI),e.registerLayout(PI),function(e){for(var t=0;t<HA.length;t++)e.registerAction({type:HA[t],update:"updateView"},Ie);e.registerAction({type:"treemapRootToNode",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"treemap",query:e},(function(t,n){var r=OA(e,["treemapZoomToNode","treemapRootToNode"],t);if(r){var i=t.getViewRoot();i&&(e.direction=kA(i,r.node)?"rollUp":"drillDown"),t.resetViewRoot(r.node)}}))}))}(e)},function(e){e.registerChartView(OE),e.registerSeriesModel(GE),e.registerProcessor(BI),e.registerVisual(FI),e.registerVisual(HI),e.registerLayout(JI),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,aE),e.registerLayout(lE),e.registerCoordinateSystem("graphView",{dimensions:WD.dimensions,create:uE}),e.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},Ie),e.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},Ie),e.registerAction(HE,(function(e,t,n){t.eachComponent({mainType:"series",query:e},(function(t){var r=tA(t.coordinateSystem,e,void 0,n);t.setCenter&&t.setCenter(r.center),t.setZoom&&t.setZoom(r.zoom)}))}))},function(e){e.registerChartView(XE),e.registerSeriesModel(YE)},function(e){e.registerChartView(KE),e.registerSeriesModel($E),e.registerLayout(JE),e.registerProcessor(rM("funnel"))},function(e){l_(TN),e.registerChartView(QE),e.registerSeriesModel(iL),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,sL)},function(e){e.registerChartView(DN),e.registerSeriesModel(IN),e.registerLayout(EN),e.registerVisual(HN),e.registerAction({type:"dragNode",event:"dragnode",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},(function(t){t.setNodePosition(e.dataIndex,[e.localX,e.localY])}))}))},function(e){e.registerSeriesModel(WN),e.registerChartView(jN),e.registerLayout(JN),e.registerTransform(QN)},function(e){e.registerChartView(tP),e.registerSeriesModel(dP),e.registerPreprocessor(pP),e.registerVisual(_P),e.registerLayout(xP)},function(e){e.registerChartView(TP),e.registerSeriesModel(MP),e.registerLayout(wT("effectScatter"))},function(e){e.registerChartView(PP),e.registerSeriesModel(zP),e.registerLayout(NP),e.registerVisual(BP)},function(e){e.registerChartView(HP),e.registerSeriesModel(UP)},function(e){e.registerChartView(YP),e.registerSeriesModel(hO),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,$(mx,"pictorialBar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,vx("pictorialBar"))},function(e){e.registerChartView(dO),e.registerSeriesModel(pO),e.registerLayout(fO),e.registerProcessor(rM("themeRiver"))},function(e){e.registerChartView(_O),e.registerSeriesModel(xO),e.registerLayout($(SO,"sunburst")),e.registerProcessor($(rM,"sunburst")),e.registerVisual(MO),function(e){e.registerAction({type:vO,update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,n){var r=OA(e,[vO],t);if(r){var i=t.getViewRoot();i&&(e.direction=kA(i,r.node)?"rollUp":"drillDown"),t.resetViewRoot(r.node)}}))})),e.registerAction({type:yO,update:"none"},(function(e,t,n){e=z({},e),t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t){var n=OA(e,[yO],t);n&&(e.dataIndex=n.node.dataIndex)})),"production"!==process.env.NODE_ENV&&Ro("sunburstHighlight","highlight"),n.dispatchAction(z(e,{type:"highlight"}))})),e.registerAction({type:"sunburstUnhighlight",update:"updateView"},(function(e,t,n){e=z({},e),"production"!==process.env.NODE_ENV&&Ro("sunburstUnhighlight","downplay"),n.dispatchAction(z(e,{type:"downplay"}))}))}(e)},function(e){e.registerChartView(wR),e.registerSeriesModel(IO)}]),l_((function(e){l_(fC),l_(Sk)})),l_((function(e){l_(Sk),nC.registerAxisPointerClass("PolarAxisPointer",Tk),e.registerCoordinateSystem("polar",Vk),e.registerComponentModel(Ck),e.registerComponentView(ez),DM(e,"angle",Ak,Jk),DM(e,"radius",Ik,Qk),e.registerComponentView(Uk),e.registerComponentView(Yk),e.registerLayout($($k,"bar"))})),l_(iA),l_((function(e){l_(Sk),nC.registerAxisPointerClass("SingleAxisPointer",fz),e.registerComponentView(yz),e.registerComponentView(iz),e.registerComponentModel(az),DM(e,"single",az,az.defaultOption),e.registerCoordinateSystem("single",hz)})),l_(TN),l_((function(e){e.registerComponentModel(_z),e.registerComponentView(bz),e.registerCoordinateSystem("calendar",Sz)})),l_((function(e){e.registerComponentModel(Iz),e.registerComponentView(Nz),e.registerPreprocessor((function(e){var t=e.graphic;J(t)?t[0]&&t[0].elements?e.graphic=[e.graphic[0]]:e.graphic=[{elements:t}]:t&&!t.elements&&(e.graphic=[{elements:[t]}])}))})),l_((function(e){e.registerComponentModel(oV),e.registerComponentView(sV),rV("saveAsImage",lV),rV("magicType",hV),rV("dataView",yV),rV("dataZoom",FV),rV("restore",SV),l_(eV)})),l_((function(e){l_(Sk),e.registerComponentModel(UV),e.registerComponentView(aB),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Ie),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Ie)})),l_(Sk),l_((function(e){e.registerComponentView(AB),e.registerComponentModel(IB),e.registerPreprocessor(hB),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,SB),e.registerAction({type:"brush",event:"brush",update:"updateVisual"},(function(e,t){t.eachComponent({mainType:"brush",query:e},(function(t){t.setAreas(e.areas)}))})),e.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},Ie),e.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},Ie),rV("brush",NB)})),l_((function(e){e.registerComponentModel(PB),e.registerComponentView(OB)})),l_((function(e){e.registerComponentModel(kB),e.registerComponentView(GB),e.registerSubTypeDefaulter("timeline",(function(){return"slider"})),function(e){e.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},(function(e,t,n){var r=t.getComponent("timeline");return r&&null!=e.currentIndex&&(r.setCurrentIndex(e.currentIndex),!r.get("loop",!0)&&r.isIndexMax()&&r.getPlayState()&&(r.setPlayState(!1),n.dispatchAction({type:"timelinePlayChange",playState:!1,from:e.from}))),t.resetOption("timeline",{replaceMerge:r.get("replaceMerge",!0)}),V({currentIndex:r.option.currentIndex},e)})),e.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},(function(e,t){var n=t.getComponent("timeline");n&&null!=e.playState&&n.setPlayState(e.playState)}))}(e),e.registerPreprocessor(WB)})),l_((function(e){e.registerComponentModel($B),e.registerComponentView(uF),e.registerPreprocessor((function(e){YB(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})}))})),l_((function(e){e.registerComponentModel(cF),e.registerComponentView(vF),e.registerPreprocessor((function(e){YB(e.series,"markLine")&&(e.markLine=e.markLine||{})}))})),l_((function(e){e.registerComponentModel(yF),e.registerComponentView(CF),e.registerPreprocessor((function(e){YB(e.series,"markArea")&&(e.markArea=e.markArea||{})}))})),l_((function(e){l_(VF),l_(jF)})),l_((function(e){l_(nG),l_(hG)})),l_(nG),l_(hG),l_((function(e){l_(jG),l_(KG)})),l_(jG),l_(KG),l_((function(e){e.registerPreprocessor(tH),e.registerVisual(e.PRIORITY.VISUAL.ARIA,eH)})),l_((function(e){e.registerTransform(pH),e.registerTransform(gH)})),l_(yH),l_((function(e){e.registerUpdateLifecycle("series:beforeupdate",(function(e,t,n){W(Go(n.seriesTransition),(function(e){W(Go(e.to),(function(e){for(var t=n.updatedSeries,r=0;r<t.length;r++)(null!=e.seriesIndex&&e.seriesIndex===t[r].seriesIndex||null!=e.seriesId&&e.seriesId===t[r].id)&&(t[r][Gg]=!0)}))}))})),e.registerUpdateLifecycle("series:transition",(function(e,t,n){var r=QH(t);if(r.oldSeries&&n.updatedSeries&&n.optionChanged){var i=n.seriesTransition;if(i)W(Go(i),(function(e){!function(e,t,n,r){var i=[],o=[];W(Go(e.from),(function(e){var n=cU(t.oldSeries,e);n>=0&&i.push({dataGroupId:t.oldDataGroupIds[n],data:t.oldData[n],divide:uU(t.oldData[n]),groupIdDim:e.dimension})})),W(Go(e.to),(function(e){var r=cU(n.updatedSeries,e);if(r>=0){var i=n.updatedSeries[r].getData();o.push({dataGroupId:t.oldDataGroupIds[r],data:i,divide:uU(i),groupIdDim:e.dimension})}})),i.length>0&&o.length>0&&aU(i,o,r)}(e,r,n,t)}));else{var o=function(e,t){var n=Te(),r=Te(),i=Te();function o(e){n.get(e)&&No("Duplicated seriesKey in universalTransition "+e)}return W(e.oldSeries,(function(t,n){var o=e.oldDataGroupIds[n],a=e.oldData[n],s=sU(t),l=lU(s);r.set(l,{dataGroupId:o,data:a}),J(s)&&W(s,(function(e){i.set(e,{key:l,dataGroupId:o,data:a})}))})),W(t.updatedSeries,(function(e){if(e.isUniversalTransitionEnabled()&&e.isAnimationEnabled()){var t=e.get("dataGroupId"),a=e.getData(),s=sU(e),l=lU(s),u=r.get(l);if(u)"production"!==process.env.NODE_ENV&&o(l),n.set(l,{oldSeries:[{dataGroupId:u.dataGroupId,divide:uU(u.data),data:u.data}],newSeries:[{dataGroupId:t,divide:uU(a),data:a}]});else if(J(s)){"production"!==process.env.NODE_ENV&&o(l);var c=[];W(s,(function(e){var t=r.get(e);t.data&&c.push({dataGroupId:t.dataGroupId,divide:uU(t.data),data:t.data})})),c.length&&n.set(l,{oldSeries:c,newSeries:[{dataGroupId:t,data:a,divide:uU(a)}]})}else{var h=i.get(s);if(h){var d=n.get(h.key);d||(d={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:uU(h.data)}],newSeries:[]},n.set(h.key,d)),d.newSeries.push({dataGroupId:t,data:a,divide:uU(a)})}}}})),n}(r,n);W(o.keys(),(function(e){var n=o.get(e);aU(n.oldSeries,n.newSeries,t)}))}W(n.updatedSeries,(function(e){e[Gg]&&(e[Gg]=!1)}))}for(var a=e.getSeries(),s=r.oldSeries=[],l=r.oldDataGroupIds=[],u=r.oldData=[],c=0;c<a.length;c++){var h=a[c].getData();h.count()<1e4&&(s.push(a[c]),l.push(a[c].get("dataGroupId")),u.push(h))}}))})),l_(xw);var hU=Object.freeze({__proto__:null,Axis:Ob,ChartView:em,ComponentModel:tp,ComponentView:Kg,List:R_,Model:Wh,PRIORITY:Zv,SeriesModel:Hg,color:mr,connect:function(e){if(J(e)){var t=e;e=null,W(t,(function(t){null!=t.group&&(e=t.group)})),e=e||"g_"+zy++,W(t,(function(t){t.group=e}))}return Ry[e]=!0,e},dataTool:{},dependencies:{zrender:"5.6.0"},disConnect:Gy,disconnect:Fy,dispose:function(e){ee(e)?e=Oy[e]:e instanceof Sy||(e=Hy(e)),e instanceof Sy&&!e.isDisposed()&&e.dispose()},env:d,extendChartView:function(e){var t=em.extend(e);return em.registerClass(t),t},extendComponentModel:function(e){var t=tp.extend(e);return tp.registerClass(t),t},extendComponentView:function(e){var t=Kg.extend(e);return Kg.registerClass(t),t},extendSeriesModel:function(e){var t=Hg.extend(e);return Hg.registerClass(t),t},format:bb,getCoordinateSystemDimensions:$y,getInstanceByDom:Hy,getInstanceById:function(e){return Oy[e]},getMap:i_,graphic:xb,helper:ib,init:By,innerDrawElementOnCanvas:Ov,matrix:Rt,number:yb,parseGeoJSON:vb,parseGeoJson:vb,registerAction:qy,registerCoordinateSystem:Ky,registerLayout:Jy,registerLoading:n_,registerLocale:ed,registerMap:r_,registerPostInit:Xy,registerPostUpdate:Yy,registerPreprocessor:Wy,registerProcessor:jy,registerTheme:Uy,registerTransform:o_,registerUpdateLifecycle:Zy,registerVisual:Qy,setCanvasCreator:function(e){"production"!==process.env.NODE_ENV&&Oo("setCanvasCreator is deprecated. Use setPlatformAPI({ createCanvas }) instead."),_({createCanvas:e})},setPlatformAPI:_,throttle:um,time:_b,use:l_,util:wb,vector:Qe,version:"5.5.1",zrUtil:Le,zrender:no});function dU(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pU,fU={exports:{}},gU={};var mU,vU={};
12
+ /**
13
+ * @license React
14
+ * react-jsx-runtime.development.js
15
+ *
16
+ * Copyright (c) Facebook, Inc. and its affiliates.
17
+ *
18
+ * This source code is licensed under the MIT license found in the
19
+ * LICENSE file in the root directory of this source tree.
20
+ */"production"===process.env.NODE_ENV?fU.exports=function(){if(pU)return gU;pU=1;var t=e,n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,l={},u=null,c=null;for(s in void 0!==r&&(u=""+r),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)i.call(t,s)&&!a.hasOwnProperty(s)&&(l[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps)void 0===l[s]&&(l[s]=t[s]);return{$$typeof:n,type:e,key:u,ref:c,props:l,_owner:o.current}}return gU.Fragment=r,gU.jsx=s,gU.jsxs=s,gU}():fU.exports=(mU||(mU=1,"production"!==process.env.NODE_ENV&&function(){var t,n=e,r=Symbol.for("react.element"),i=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),m=Symbol.iterator,v=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];!function(e,t,n){var r=v.ReactDebugCurrentFrame.getStackAddendum();""!==r&&(t+="%s",n=n.concat([r]));var i=n.map((function(e){return String(e)}));i.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,i)}("error",e,n)}function _(e){return e.displayName||"Context"}function x(e){if(null==e)return null;if("number"==typeof e.tag&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case o:return"Fragment";case i:return"Portal";case s:return"Profiler";case a:return"StrictMode";case h:return"Suspense";case d:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case u:return _(e)+".Consumer";case l:return _(e._context)+".Provider";case c:return function(e,t,n){var r=e.displayName;if(r)return r;var i=t.displayName||t.name||"";return""!==i?n+"("+i+")":n}(e,e.render,"ForwardRef");case p:var t=e.displayName||null;return null!==t?t:x(e.type)||"Memo";case f:var n=e,r=n._payload,g=n._init;try{return x(g(r))}catch(e){return null}}return null}t=Symbol.for("react.module.reference");var b,w,S,T,M,C,D,A=Object.assign,I=0;function E(){}E.__reactDisabledLog=!0;var L,N=v.ReactCurrentDispatcher;function P(e,t,n){if(void 0===L)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);L=r&&r[1]||""}return"\n"+L+e}var O,R=!1,k="function"==typeof WeakMap?WeakMap:Map;function z(e,t){if(!e||R)return"";var n,r=O.get(e);if(void 0!==r)return r;R=!0;var i,o=Error.prepareStackTrace;Error.prepareStackTrace=void 0,i=N.current,N.current=null,function(){if(0===I){b=console.log,w=console.info,S=console.warn,T=console.error,M=console.group,C=console.groupCollapsed,D=console.groupEnd;var e={configurable:!0,enumerable:!0,value:E,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}I++}();try{if(t){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(a,[])}catch(e){n=e}Reflect.construct(e,[],a)}else{try{a.call()}catch(e){n=e}e.call(a.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var s=t.stack.split("\n"),l=n.stack.split("\n"),u=s.length-1,c=l.length-1;u>=1&&c>=0&&s[u]!==l[c];)c--;for(;u>=1&&c>=0;u--,c--)if(s[u]!==l[c]){if(1!==u||1!==c)do{if(u--,--c<0||s[u]!==l[c]){var h="\n"+s[u].replace(" at new "," at ");return e.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",e.displayName)),"function"==typeof e&&O.set(e,h),h}}while(u>=1&&c>=0);break}}}finally{R=!1,N.current=i,function(){if(0==--I){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},e,{value:b}),info:A({},e,{value:w}),warn:A({},e,{value:S}),error:A({},e,{value:T}),group:A({},e,{value:M}),groupCollapsed:A({},e,{value:C}),groupEnd:A({},e,{value:D})})}I<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=o}var d=e?e.displayName||e.name:"",p=d?P(d):"";return"function"==typeof e&&O.set(e,p),p}function V(e,t,n){if(null==e)return"";if("function"==typeof e)return z(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return P(e);switch(e){case h:return P("Suspense");case d:return P("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case c:return z(e.render,!1);case p:return V(e.type,t,n);case f:var i=e,o=i._payload,a=i._init;try{return V(a(o),t,n)}catch(e){}}return""}O=new k;var B=Object.prototype.hasOwnProperty,F={},G=v.ReactDebugCurrentFrame;function H(e){if(e){var t=e._owner,n=V(e.type,e._source,t?t.type:null);G.setExtraStackFrame(n)}else G.setExtraStackFrame(null)}var U=Array.isArray;function W(e){return U(e)}function j(e){return""+e}function X(e){if(function(e){try{return j(e),!1}catch(e){return!0}}(e))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),j(e)}var Y,Z,q,K=v.ReactCurrentOwner,$={key:!0,ref:!0,__self:!0,__source:!0};function J(e,t,n,i,o){var a,s={},l=null,u=null;for(a in void 0!==n&&(X(n),l=""+n),function(e){if(B.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(X(t.key),l=""+t.key),function(e){if(B.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(u=t.ref,function(e,t){if("string"==typeof e.ref&&K.current&&t&&K.current.stateNode!==t){var n=x(K.current.type);q[n]||(y('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',x(K.current.type),e.ref),q[n]=!0)}}(t,o)),t)B.call(t,a)&&!$.hasOwnProperty(a)&&(s[a]=t[a]);if(e&&e.defaultProps){var c=e.defaultProps;for(a in c)void 0===s[a]&&(s[a]=c[a])}if(l||u){var h="function"==typeof e?e.displayName||e.name||"Unknown":e;l&&function(e,t){var n=function(){Y||(Y=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(s,h),u&&function(e,t){var n=function(){Z||(Z=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(s,h)}return function(e,t,n,i,o,a,s){var l={$$typeof:r,type:e,key:t,ref:n,props:s,_owner:a,_store:{}};return Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}(e,l,u,o,i,K.current,s)}q={};var Q,ee=v.ReactCurrentOwner,te=v.ReactDebugCurrentFrame;function ne(e){if(e){var t=e._owner,n=V(e.type,e._source,t?t.type:null);te.setExtraStackFrame(n)}else te.setExtraStackFrame(null)}function re(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}function ie(){if(ee.current){var e=x(ee.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}Q=!1;var oe={};function ae(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=ie();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!oe[n]){oe[n]=!0;var r="";e&&e._owner&&e._owner!==ee.current&&(r=" It was passed a child from "+x(e._owner.type)+"."),ne(e),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),ne(null)}}}function se(e,t){if("object"==typeof e)if(W(e))for(var n=0;n<e.length;n++){var r=e[n];re(r)&&ae(r,t)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var i=function(e){if(null===e||"object"!=typeof e)return null;var t=m&&e[m]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof i&&i!==e.entries)for(var o,a=i.call(e);!(o=a.next()).done;)re(o.value)&&ae(o.value,t)}}function le(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==c&&n.$$typeof!==p)return;t=n.propTypes}if(t){var r=x(n);!function(e,t,n,r,i){var o=Function.call.bind(B);for(var a in e)if(o(e,a)){var s=void 0;try{if("function"!=typeof e[a]){var l=Error((r||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}s=e[a](t,a,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){s=e}!s||s instanceof Error||(H(i),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,a,typeof s),H(null)),s instanceof Error&&!(s.message in F)&&(F[s.message]=!0,H(i),y("Failed %s type: %s",n,s.message),H(null))}}(t,e.props,"prop",r,e)}else void 0===n.PropTypes||Q||(Q=!0,y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",x(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var ue={};function ce(e,n,i,m,v,_){var b=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===s||e===a||e===h||e===d||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===p||e.$$typeof===l||e.$$typeof===u||e.$$typeof===c||e.$$typeof===t||void 0!==e.getModuleId)}(e);if(!b){var w,S="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(S+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),S+=ie(),null===e?w="null":W(e)?w="array":void 0!==e&&e.$$typeof===r?(w="<"+(x(e.type)||"Unknown")+" />",S=" Did you accidentally export a JSX literal instead of a component?"):w=typeof e,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",w,S)}var T=J(e,n,i,v,_);if(null==T)return T;if(b){var M=n.children;if(void 0!==M)if(m)if(W(M)){for(var C=0;C<M.length;C++)se(M[C],e);Object.freeze&&Object.freeze(M)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else se(M,e)}if(B.call(n,"key")){var D=x(e),A=Object.keys(n).filter((function(e){return"key"!==e})),I=A.length>0?"{key: someKey, "+A.join(": ..., ")+": ...}":"{key: someKey}";ue[D+I]||(y('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',I,D,A.length>0?"{"+A.join(": ..., ")+": ...}":"{}",D),ue[D+I]=!0)}return e===o?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){ne(e),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),ne(null);break}}null!==e.ref&&(ne(e),y("Invalid attribute `ref` supplied to `React.Fragment`."),ne(null))}(T):le(T),T}var he=function(e,t,n){return ce(e,t,n,!1)},de=function(e,t,n){return ce(e,t,n,!0)};vU.Fragment=o,vU.jsx=he,vU.jsxs=de}()),vU);var yU=fU.exports;function _U(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var xU=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,bU=_U((function(e){return xU.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),wU="-ms-",SU="-moz-",TU="-webkit-",MU="comm",CU="rule",DU="decl",AU="@keyframes",IU=Math.abs,EU=String.fromCharCode,LU=Object.assign;function NU(e){return e.trim()}function PU(e,t){return(e=t.exec(e))?e[0]:e}function OU(e,t,n){return e.replace(t,n)}function RU(e,t,n){return e.indexOf(t,n)}function kU(e,t){return 0|e.charCodeAt(t)}function zU(e,t,n){return e.slice(t,n)}function VU(e){return e.length}function BU(e){return e.length}function FU(e,t){return t.push(e),e}function GU(e,t){return e.filter((function(e){return!PU(e,t)}))}var HU=1,UU=1,WU=0,jU=0,XU=0,YU="";function ZU(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:HU,column:UU,length:a,return:"",siblings:s}}function qU(e,t){return LU(ZU("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function KU(e){for(;e.root;)e=qU(e.root,{children:[e]});FU(e,e.siblings)}function $U(){return XU=jU>0?kU(YU,--jU):0,UU--,10===XU&&(UU=1,HU--),XU}function JU(){return XU=jU<WU?kU(YU,jU++):0,UU++,10===XU&&(UU=1,HU++),XU}function QU(){return kU(YU,jU)}function eW(){return jU}function tW(e,t){return zU(YU,e,t)}function nW(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function rW(e){return NU(tW(jU-1,aW(91===e?e+2:40===e?e+1:e)))}function iW(e){for(;(XU=QU())&&XU<33;)JU();return nW(e)>2||nW(XU)>3?"":" "}function oW(e,t){for(;--t&&JU()&&!(XU<48||XU>102||XU>57&&XU<65||XU>70&&XU<97););return tW(e,eW()+(t<6&&32==QU()&&32==JU()))}function aW(e){for(;JU();)switch(XU){case e:return jU;case 34:case 39:34!==e&&39!==e&&aW(XU);break;case 40:41===e&&aW(e);break;case 92:JU()}return jU}function sW(e,t){for(;JU()&&e+XU!==57&&(e+XU!==84||47!==QU()););return"/*"+tW(t,jU-1)+"*"+EU(47===e?e:JU())}function lW(e){for(;!nW(QU());)JU();return tW(e,jU)}function uW(e){return function(e){return YU="",e}(cW("",null,null,null,[""],e=function(e){return HU=UU=1,WU=VU(YU=e),jU=0,[]}(e),0,[0],e))}function cW(e,t,n,r,i,o,a,s,l){for(var u=0,c=0,h=a,d=0,p=0,f=0,g=1,m=1,v=1,y=0,_="",x=i,b=o,w=r,S=_;m;)switch(f=y,y=JU()){case 40:if(108!=f&&58==kU(S,h-1)){-1!=RU(S+=OU(rW(y),"&","&\f"),"&\f",IU(u?s[u-1]:0))&&(v=-1);break}case 34:case 39:case 91:S+=rW(y);break;case 9:case 10:case 13:case 32:S+=iW(f);break;case 92:S+=oW(eW()-1,7);continue;case 47:switch(QU()){case 42:case 47:FU(dW(sW(JU(),eW()),t,n,l),l);break;default:S+="/"}break;case 123*g:s[u++]=VU(S)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+c:-1==v&&(S=OU(S,/\f/g,"")),p>0&&VU(S)-h&&FU(p>32?pW(S+";",r,n,h-1,l):pW(OU(S," ","")+";",r,n,h-2,l),l);break;case 59:S+=";";default:if(FU(w=hW(S,t,n,u,c,i,s,_,x=[],b=[],h,o),o),123===y)if(0===c)cW(S,t,w,w,x,o,h,s,b);else switch(99===d&&110===kU(S,3)?100:d){case 100:case 108:case 109:case 115:cW(e,w,w,r&&FU(hW(e,w,w,0,0,i,s,_,i,x=[],h,b),b),i,b,h,s,r?x:b);break;default:cW(S,w,w,w,[""],b,0,s,b)}}u=c=p=0,g=v=1,_=S="",h=a;break;case 58:h=1+VU(S),p=f;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==$U())continue;switch(S+=EU(y),y*g){case 38:v=c>0?1:(S+="\f",-1);break;case 44:s[u++]=(VU(S)-1)*v,v=1;break;case 64:45===QU()&&(S+=rW(JU())),d=QU(),c=h=VU(_=S+=lW(eW())),y++;break;case 45:45===f&&2==VU(S)&&(g=0)}}return o}function hW(e,t,n,r,i,o,a,s,l,u,c,h){for(var d=i-1,p=0===i?o:[""],f=BU(p),g=0,m=0,v=0;g<r;++g)for(var y=0,_=zU(e,d+1,d=IU(m=a[g])),x=e;y<f;++y)(x=NU(m>0?p[y]+" "+_:OU(_,/&\f/g,p[y])))&&(l[v++]=x);return ZU(e,t,n,0===i?CU:s,l,u,c,h)}function dW(e,t,n,r){return ZU(e,t,n,MU,EU(XU),zU(e,2,-2),0,r)}function pW(e,t,n,r,i){return ZU(e,t,n,DU,zU(e,0,r),zU(e,r+1,-1),r,i)}function fW(e,t,n){switch(function(e,t){return 45^kU(e,0)?(((t<<2^kU(e,0))<<2^kU(e,1))<<2^kU(e,2))<<2^kU(e,3):0}(e,t)){case 5103:return TU+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return TU+e+e;case 4789:return SU+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return TU+e+SU+e+wU+e+e;case 5936:switch(kU(e,t+11)){case 114:return TU+e+wU+OU(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return TU+e+wU+OU(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return TU+e+wU+OU(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return TU+e+wU+e+e;case 6165:return TU+e+wU+"flex-"+e+e;case 5187:return TU+e+OU(e,/(\w+).+(:[^]+)/,TU+"box-$1$2"+wU+"flex-$1$2")+e;case 5443:return TU+e+wU+"flex-item-"+OU(e,/flex-|-self/g,"")+(PU(e,/flex-|baseline/)?"":wU+"grid-row-"+OU(e,/flex-|-self/g,""))+e;case 4675:return TU+e+wU+"flex-line-pack"+OU(e,/align-content|flex-|-self/g,"")+e;case 5548:return TU+e+wU+OU(e,"shrink","negative")+e;case 5292:return TU+e+wU+OU(e,"basis","preferred-size")+e;case 6060:return TU+"box-"+OU(e,"-grow","")+TU+e+wU+OU(e,"grow","positive")+e;case 4554:return TU+OU(e,/([^-])(transform)/g,"$1"+TU+"$2")+e;case 6187:return OU(OU(OU(e,/(zoom-|grab)/,TU+"$1"),/(image-set)/,TU+"$1"),e,"")+e;case 5495:case 3959:return OU(e,/(image-set\([^]*)/,TU+"$1$`$1");case 4968:return OU(OU(e,/(.+:)(flex-)?(.*)/,TU+"box-pack:$3"+wU+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+TU+e+e;case 4200:if(!PU(e,/flex-|baseline/))return wU+"grid-column-align"+zU(e,t)+e;break;case 2592:case 3360:return wU+OU(e,"template-","")+e;case 4384:case 3616:return n&&n.some((function(e,n){return t=n,PU(e.props,/grid-\w+-end/)}))?~RU(e+(n=n[t].value),"span",0)?e:wU+OU(e,"-start","")+e+wU+"grid-row-span:"+(~RU(n,"span",0)?PU(n,/\d+/):+PU(n,/\d+/)-+PU(e,/\d+/))+";":wU+OU(e,"-start","")+e;case 4896:case 4128:return n&&n.some((function(e){return PU(e.props,/grid-\w+-start/)}))?e:wU+OU(OU(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return OU(e,/(.+)-inline(.+)/,TU+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(VU(e)-1-t>6)switch(kU(e,t+1)){case 109:if(45!==kU(e,t+4))break;case 102:return OU(e,/(.+:)(.+)-([^]+)/,"$1"+TU+"$2-$3$1"+SU+(108==kU(e,t+3)?"$3":"$2-$3"))+e;case 115:return~RU(e,"stretch",0)?fW(OU(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return OU(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,r,i,o,a,s){return wU+n+":"+r+s+(i?wU+n+"-span:"+(o?a:+a-+r)+s:"")+e}));case 4949:if(121===kU(e,t+6))return OU(e,":",":"+TU)+e;break;case 6444:switch(kU(e,45===kU(e,14)?18:11)){case 120:return OU(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+TU+(45===kU(e,14)?"inline-":"")+"box$3$1"+TU+"$2$3$1"+wU+"$2box$3")+e;case 100:return OU(e,":",":"+wU)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return OU(e,"scroll-","scroll-snap-")+e}return e}function gW(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function mW(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case DU:return e.return=e.return||e.value;case MU:return"";case AU:return e.return=e.value+"{"+gW(e.children,r)+"}";case CU:if(!VU(e.value=e.props.join(",")))return""}return VU(n=gW(e.children,r))?e.return=e.value+"{"+n+"}":""}function vW(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case DU:return void(e.return=fW(e.value,e.length,n));case AU:return gW([qU(e,{value:OU(e.value,"@","@"+TU)})],r);case CU:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,(function(t){switch(PU(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":KU(qU(e,{props:[OU(t,/:(read-\w+)/,":-moz-$1")]})),KU(qU(e,{props:[t]})),LU(e,{props:GU(n,r)});break;case"::placeholder":KU(qU(e,{props:[OU(t,/:(plac\w+)/,":"+TU+"input-$1")]})),KU(qU(e,{props:[OU(t,/:(plac\w+)/,":-moz-$1")]})),KU(qU(e,{props:[OU(t,/:(plac\w+)/,wU+"input-$1")]})),KU(qU(e,{props:[t]})),LU(e,{props:GU(n,r)})}return""}))}}var yW={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},_W="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",xW="active",bW="data-styled-version",wW="6.1.13",SW="/*!sc*/\n",TW="undefined"!=typeof window&&"HTMLElement"in window,MW=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),CW=/invalid hook call/i,DW=new Set,AW=function(e,n){if("production"!==process.env.NODE_ENV){var r=n?' with the id of "'.concat(n,'"'):"",i="The component ".concat(e).concat(r," has been created dynamically.\n")+"You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",o=console.error;try{var a=!0;console.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];CW.test(e)?(a=!1,DW.delete(i)):o.apply(void 0,c([e],t,!1))},t(),a&&!DW.has(i)&&(console.warn(i),DW.add(i))}catch(e){CW.test(e.message)&&DW.delete(i)}finally{console.error=o}}},IW=Object.freeze([]),EW=Object.freeze({});var LW=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),NW=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,PW=/(^-|-$)/g;function OW(e){return e.replace(NW,"-").replace(PW,"")}var RW=/(a)(d)/gi,kW=function(e){return String.fromCharCode(e+(e>25?39:97))};function zW(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=kW(t%52)+n;return(kW(t%52)+n).replace(RW,"$1-$2")}var VW,BW=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},FW=function(e){return BW(5381,e)};function GW(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function HW(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var UW="function"==typeof Symbol&&Symbol.for,WW=UW?Symbol.for("react.memo"):60115,jW=UW?Symbol.for("react.forward_ref"):60112,XW={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},YW={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},ZW={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},qW=((VW={})[jW]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},VW[WW]=ZW,VW);function KW(e){return("type"in(t=e)&&t.type.$$typeof)===WW?ZW:"$$typeof"in e?qW[e.$$typeof]:XW;var t}var $W=Object.defineProperty,JW=Object.getOwnPropertyNames,QW=Object.getOwnPropertySymbols,ej=Object.getOwnPropertyDescriptor,tj=Object.getPrototypeOf,nj=Object.prototype;function rj(e,t,n){if("string"!=typeof t){if(nj){var r=tj(t);r&&r!==nj&&rj(e,r,n)}var i=JW(t);QW&&(i=i.concat(QW(t)));for(var o=KW(e),a=KW(t),s=0;s<i.length;++s){var l=i[s];if(!(l in YW||n&&n[l]||a&&l in a||o&&l in o)){var u=ej(t,l);try{$W(e,l,u)}catch(e){}}}}return e}function ij(e){return"function"==typeof e}function oj(e){return"object"==typeof e&&"styledComponentId"in e}function aj(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function sj(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=e[r];return n}function lj(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function uj(e,t,n){if(void 0===n&&(n=!1),!n&&!lj(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=uj(e[r],t[r]);else if(lj(t))for(var r in t)e[r]=uj(e[r],t[r]);return e}function cj(e,t){Object.defineProperty(e,"toString",{value:t})}var hj="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function dj(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],i=1,o=e.length;i<o;i+=1)r.push(e[i]);return r.forEach((function(e){n=n.replace(/%[a-z]/,e)})),n}function pj(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(dj.apply(void 0,c([hj[e]],t,!1)).trim())}var fj=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)if((i<<=1)<0)throw pj(16,"".concat(e));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=r;o<i;o++)this.groupSizes[o]=0}for(var a=this.indexOfGroup(e+1),s=(o=0,t.length);o<s;o++)this.tag.insertRule(a,t[o])&&(this.groupSizes[e]++,a++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var i=n;i<r;i++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,o=r;o<i;o++)t+="".concat(this.tag.getRule(o)).concat(SW);return t},e}(),gj=1<<30,mj=new Map,vj=new Map,yj=1,_j=function(e){if(mj.has(e))return mj.get(e);for(;vj.has(yj);)yj++;var t=yj++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>gj))throw pj(16,"".concat(t));return mj.set(e,t),vj.set(t,e),t},xj=function(e,t){yj=t+1,mj.set(e,t),vj.set(t,e)},bj="style[".concat(_W,"][").concat(bW,'="').concat(wW,'"]'),wj=new RegExp("^".concat(_W,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Sj=function(e,t,n){for(var r,i=n.split(","),o=0,a=i.length;o<a;o++)(r=i[o])&&e.registerName(t,r)},Tj=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(SW),i=[],o=0,a=r.length;o<a;o++){var s=r[o].trim();if(s){var l=s.match(wj);if(l){var u=0|parseInt(l[1],10),c=l[2];0!==u&&(xj(c,u),Sj(e,c,l[3]),e.getTag().insertRules(u,i)),i.length=0}else i.push(s)}}},Mj=function(e){for(var t=document.querySelectorAll(bj),n=0,r=t.length;n<r;n++){var i=t[n];i&&i.getAttribute(_W)!==xW&&(Tj(e,i),i.parentNode&&i.parentNode.removeChild(i))}};var Cj=function(e){var t=document.head,n=e||t,r=document.createElement("style"),i=function(e){var t=Array.from(e.querySelectorAll("style[".concat(_W,"]")));return t[t.length-1]}(n),o=void 0!==i?i.nextSibling:null;r.setAttribute(_W,xW),r.setAttribute(bW,wW);var a="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},Dj=function(){function e(e){this.element=Cj(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var i=t[n];if(i.ownerNode===e)return i}throw pj(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),Aj=function(){function e(e){this.element=Cj(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),Ij=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),Ej=TW,Lj={isServer:!TW,useCSSOMInjection:!MW},Nj=function(){function e(e,t,n){void 0===e&&(e=EW),void 0===t&&(t={});var r=this;this.options=u(u({},Lj),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&TW&&Ej&&(Ej=!1,Mj(this)),cj(this,(function(){return function(e){for(var t=e.getTag(),n=t.length,r="",i=function(n){var i=function(e){return vj.get(e)}(n);if(void 0===i)return"continue";var o=e.names.get(i),a=t.getGroup(n);if(void 0===o||!o.size||0===a.length)return"continue";var s="".concat(_W,".g").concat(n,'[id="').concat(i,'"]'),l="";void 0!==o&&o.forEach((function(e){e.length>0&&(l+="".concat(e,","))})),r+="".concat(a).concat(s,'{content:"').concat(l,'"}').concat(SW)},o=0;o<n;o++)i(o);return r}(r)}))}return e.registerId=function(e){return _j(e)},e.prototype.rehydrate=function(){!this.server&&TW&&Mj(this)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(u(u({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new Ij(n):t?new Dj(n):new Aj(n)}(this.options),new fj(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(_j(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(_j(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(_j(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Pj=/&/g,Oj=/^\s*\/\/.*$/gm;function Rj(e,t){return e.map((function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map((function(e){return"".concat(t," ").concat(e)}))),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=Rj(e.children,t)),e}))}var kj=new Nj,zj=function(){var e,t,n,r=EW,i=r.options,o=void 0===i?EW:i,a=r.plugins,s=void 0===a?IW:a,l=function(n,r,i){return i.startsWith(t)&&i.endsWith(t)&&i.replaceAll(t,"").length>0?".".concat(e):n},u=s.slice();u.push((function(e){e.type===CU&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(Pj,t).replace(n,l))})),o.prefix&&u.push(vW),u.push(mW);var c=function(r,i,a,s){void 0===i&&(i=""),void 0===a&&(a=""),void 0===s&&(s="&"),e=s,t=i,n=new RegExp("\\".concat(t,"\\b"),"g");var l=r.replace(Oj,""),c=uW(a||i?"".concat(a," ").concat(i," { ").concat(l," }"):l);o.namespace&&(c=Rj(c,o.namespace));var h,d=[];return gW(c,function(e){var t=BU(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}(u.concat((h=function(e){return d.push(e)},function(e){e.root||(e=e.return)&&h(e)})))),d};return c.hash=s.length?s.reduce((function(e,t){return t.name||pj(15),BW(e,t.name)}),5381).toString():"",c}(),Vj=e.createContext({shouldForwardProp:void 0,styleSheet:kj,stylis:zj});function Bj(){return i(Vj)}Vj.Consumer,e.createContext(void 0);var Fj=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=zj);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,cj(this,(function(){throw pj(12,String(n.name))}))}return e.prototype.getName=function(e){return void 0===e&&(e=zj),this.name+e.hash},e}(),Gj=function(e){return e>="A"&&e<="Z"};function Hj(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;Gj(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var Uj=function(e){return null==e||!1===e||""===e},Wj=function(e){var t,n,r=[];for(var i in e){var o=e[i];e.hasOwnProperty(i)&&!Uj(o)&&(Array.isArray(o)&&o.isCss||ij(o)?r.push("".concat(Hj(i),":"),o,";"):lj(o)?r.push.apply(r,c(c(["".concat(i," {")],Wj(o),!1),["}"],!1)):r.push("".concat(Hj(i),": ").concat((t=i,null==(n=o)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in yW||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function jj(e,t,n,r){if(Uj(e))return[];if(oj(e))return[".".concat(e.styledComponentId)];if(ij(e)){if(!ij(o=e)||o.prototype&&o.prototype.isReactComponent||!t)return[e];var i=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof i||Array.isArray(i)||i instanceof Fj||lj(i)||null===i||console.error("".concat(GW(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),jj(i,t,n,r)}var o;return e instanceof Fj?n?(e.inject(n,r),[e.getName(r)]):[e]:lj(e)?Wj(e):Array.isArray(e)?Array.prototype.concat.apply(IW,e.map((function(e){return jj(e,t,n,r)}))):[e.toString()]}var Xj=FW(wW),Yj=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&function(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(ij(n)&&!oj(n))return!1}return!0}(e),this.componentId=t,this.baseHash=BW(Xj,t),this.baseStyle=n,Nj.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=aj(r,this.staticRulesId);else{var i=sj(jj(this.rules,e,t,n)),o=zW(BW(this.baseHash,i)>>>0);if(!t.hasNameForId(this.componentId,o)){var a=n(i,".".concat(o),void 0,this.componentId);t.insertRules(this.componentId,o,a)}r=aj(r,o),this.staticRulesId=o}else{for(var s=BW(this.baseHash,n.hash),l="",u=0;u<this.rules.length;u++){var c=this.rules[u];if("string"==typeof c)l+=c,"production"!==process.env.NODE_ENV&&(s=BW(s,c));else if(c){var h=sj(jj(c,e,t,n));s=BW(s,h+u),l+=h}}if(l){var d=zW(s>>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,n(l,".".concat(d),void 0,this.componentId)),r=aj(r,d)}}return r},e}(),Zj=e.createContext(void 0);Zj.Consumer;var qj={},Kj=new Set;function $j(t,i,o){var a=oj(t),s=t,l=!HW(t),c=i.attrs,h=void 0===c?IW:c,d=i.componentId,p=void 0===d?function(e,t){var n="string"!=typeof e?"sc":OW(e);qj[n]=(qj[n]||0)+1;var r="".concat(n,"-").concat(function(e){return zW(FW(e)>>>0)}(wW+n+qj[n]));return t?"".concat(t,"-").concat(r):r}(i.displayName,i.parentComponentId):d,f=i.displayName,g=void 0===f?function(e){return HW(e)?"styled.".concat(e):"Styled(".concat(GW(e),")")}(t):f,m=i.displayName&&i.componentId?"".concat(OW(i.displayName),"-").concat(i.componentId):i.componentId||p,v=a&&s.attrs?s.attrs.concat(h).filter(Boolean):h,y=i.shouldForwardProp;if(a&&s.shouldForwardProp){var _=s.shouldForwardProp;if(i.shouldForwardProp){var x=i.shouldForwardProp;y=function(e,t){return _(e,t)&&x(e,t)}}else y=_}var b=new Yj(o,m,a?s.componentStyle:void 0);function w(t,i){return function(t,i,o){var a=t.attrs,s=t.componentStyle,l=t.defaultProps,c=t.foldedComponentIds,h=t.styledComponentId,d=t.target,p=e.useContext(Zj),f=Bj(),g=t.shouldForwardProp||f.shouldForwardProp;"production"!==process.env.NODE_ENV&&n(h);var m=function(e,t,n){return void 0===n&&(n=EW),e.theme!==n.theme&&e.theme||t||n.theme}(i,p,l)||EW,v=function(e,t,n){for(var r,i=u(u({},t),{className:void 0,theme:n}),o=0;o<e.length;o+=1){var a=ij(r=e[o])?r(i):r;for(var s in a)i[s]="className"===s?aj(i[s],a[s]):"style"===s?u(u({},i[s]),a[s]):a[s]}return t.className&&(i.className=aj(i.className,t.className)),i}(a,i,m),y=v.as||d,_={};for(var x in v)void 0===v[x]||"$"===x[0]||"as"===x||"theme"===x&&v.theme===m||("forwardedAs"===x?_.as=v.forwardedAs:g&&!g(x,y)||(_[x]=v[x],g||"development"!==process.env.NODE_ENV||bU(x)||Kj.has(x)||!LW.has(y)||(Kj.add(x),console.warn('styled-components: it looks like an unknown prop "'.concat(x,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var b=function(e,t){var r=Bj(),i=e.generateAndInjectStyles(t,r.styleSheet,r.stylis);return"production"!==process.env.NODE_ENV&&n(i),i}(s,v);"production"!==process.env.NODE_ENV&&t.warnTooManyClasses&&t.warnTooManyClasses(b);var w=aj(c,h);return b&&(w+=" "+b),v.className&&(w+=" "+v.className),_[HW(y)&&!LW.has(y)?"class":"className"]=w,_.ref=o,r(y,_)}(S,t,i)}w.displayName=g;var S=e.forwardRef(w);return S.attrs=v,S.componentStyle=b,S.displayName=g,S.shouldForwardProp=y,S.foldedComponentIds=a?aj(s.foldedComponentIds,s.styledComponentId):"",S.styledComponentId=m,S.target=a?s.target:t,Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=a?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,i=t;r<i.length;r++)uj(e,i[r],!0);return e}({},s.defaultProps,e):e}}),"production"!==process.env.NODE_ENV&&(AW(g,m),S.warnTooManyClasses=function(e,t){var n={},r=!1;return function(i){if(!r&&(n[i]=!0,Object.keys(n).length>=200)){var o=t?' with the id of "'.concat(t,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(e).concat(o,".\n")+"Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),r=!0,n={}}}}(g,m)),cj(S,(function(){return".".concat(S.styledComponentId)})),l&&rj(S,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),S}function Jj(e,t){for(var n=[e[0]],r=0,i=t.length;r<i;r+=1)n.push(t[r],e[r+1]);return n}var Qj=function(e){return Object.assign(e,{isCss:!0})};function eX(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(ij(e)||lj(e))return Qj(jj(Jj(IW,c([e],t,!0))));var r=e;return 0===t.length&&1===r.length&&"string"==typeof r[0]?jj(r):Qj(jj(Jj(r,t)))}function tX(e,t,n){if(void 0===n&&(n=EW),!t)throw pj(1,t);var r=function(r){for(var i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];return e(t,n,eX.apply(void 0,c([r],i,!1)))};return r.attrs=function(r){return tX(e,t,u(u({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},r.withConfig=function(r){return tX(e,t,u(u({},n),r))},r}var nX=function(e){return tX($j,e)},rX=nX;LW.forEach((function(e){rX[e]=nX(e)})),"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");var iX="__sc-".concat(_W,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window[iX]||(window[iX]=0),1===window[iX]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window[iX]+=1);const oX=rX.div`
21
+ height: 100%;
22
+ `;var aX;!function(e){e[e.MINI_AREA=0]="MINI_AREA",e[e.AREA=1]="AREA",e[e.DUAL_LINE_BAR=2]="DUAL_LINE_BAR",e[e.STACK_DUAL_LINE_BAR=3]="STACK_DUAL_LINE_BAR",e[e.COLUMN=4]="COLUMN",e[e.STACK_COLUMN=5]="STACK_COLUMN",e[e.LINE=6]="LINE",e[e.BAR=7]="BAR",e[e.STACK_BAR=8]="STACK_BAR",e[e.FUNNEL=9]="FUNNEL",e[e.PIE=10]="PIE",e[e.CYCLE=11]="CYCLE",e[e.RADAR=12]="RADAR"}(aX||(aX={}));const sX=["#3D84FF","#00DCF0","#FCBC26","#00DB75","#BDB8FF","#40B4FF","#FFA101","#90ABE0","#6EE67A","#6B84FF","#FA6B69"],lX={grid:{top:24,left:0,right:12,bottom:32,containLabel:!0},color:sX,legend:{itemWidth:10,itemHeight:10,bottom:0,type:"scroll",icon:"circle"}};function uX(){return uX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uX.apply(null,arguments)}function cX(e,t){return cX=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cX(e,t)}function hX(e){return hX=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hX(e)}function dX(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dX=function(){return!!e})()}function pX(e){var t="function"==typeof Map?new Map:void 0;return pX=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(dX())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&cX(i,n.prototype),i}(e,arguments,hX(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),cX(n,e)},pX(e)}var fX={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function gX(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=t[0],o=[];for(r=1;r<t.length;r+=1)o.push(t[r]);return o.forEach((function(e){i=i.replace(/%[a-z]/,e)})),i}var mX=function(e){function t(t){var n;if("production"===process.env.NODE_ENV)n=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this;else{for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];n=e.call(this,gX.apply(void 0,[fX[t]].concat(i)))||this}return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,cX(e,t)}(t,e),t}(pX(Error));function vX(e){return Math.round(255*e)}function yX(e,t,n){return vX(e)+","+vX(t)+","+vX(n)}function _X(e,t,n,r){if(void 0===r&&(r=yX),0===t)return r(n,n,n);var i=(e%360+360)%360/60,o=(1-Math.abs(2*n-1))*t,a=o*(1-Math.abs(i%2-1)),s=0,l=0,u=0;i>=0&&i<1?(s=o,l=a):i>=1&&i<2?(s=a,l=o):i>=2&&i<3?(l=o,u=a):i>=3&&i<4?(l=a,u=o):i>=4&&i<5?(s=a,u=o):i>=5&&i<6&&(s=o,u=a);var c=n-o/2;return r(s+c,l+c,u+c)}var xX={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var bX=/^#[a-fA-F0-9]{6}$/,wX=/^#[a-fA-F0-9]{8}$/,SX=/^#[a-fA-F0-9]{3}$/,TX=/^#[a-fA-F0-9]{4}$/,MX=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,CX=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,DX=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,AX=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function IX(e){if("string"!=typeof e)throw new mX(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return xX[t]?"#"+xX[t]:e}(e);if(t.match(bX))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(wX)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(SX))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(TX)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var i=MX.exec(t);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var o=CX.exec(t.substring(0,50));if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10),alpha:parseFloat(""+o[4])>1?parseFloat(""+o[4])/100:parseFloat(""+o[4])};var a=DX.exec(t);if(a){var s="rgb("+_X(parseInt(""+a[1],10),parseInt(""+a[2],10)/100,parseInt(""+a[3],10)/100)+")",l=MX.exec(s);if(!l)throw new mX(4,t,s);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10)}}var u=AX.exec(t.substring(0,50));if(u){var c="rgb("+_X(parseInt(""+u[1],10),parseInt(""+u[2],10)/100,parseInt(""+u[3],10)/100)+")",h=MX.exec(c);if(!h)throw new mX(4,t,c);return{red:parseInt(""+h[1],10),green:parseInt(""+h[2],10),blue:parseInt(""+h[3],10),alpha:parseFloat(""+u[4])>1?parseFloat(""+u[4])/100:parseFloat(""+u[4])}}throw new mX(5)}function EX(e){return function(e){var t,n=e.red/255,r=e.green/255,i=e.blue/255,o=Math.max(n,r,i),a=Math.min(n,r,i),s=(o+a)/2;if(o===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var l=o-a,u=s>.5?l/(2-o-a):l/(o+a);switch(o){case n:t=(r-i)/l+(r<i?6:0);break;case r:t=(i-n)/l+2;break;default:t=(n-r)/l+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:u,lightness:s,alpha:e.alpha}:{hue:t,saturation:u,lightness:s}}(IX(e))}var LX=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function NX(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function PX(e){return NX(Math.round(255*e))}function OX(e,t,n){return LX("#"+PX(e)+PX(t)+PX(n))}function RX(e,t,n){return _X(e,t,n,OX)}function kX(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return LX("#"+NX(e)+NX(t)+NX(n));if("object"==typeof e&&void 0===t&&void 0===n)return LX("#"+NX(e.red)+NX(e.green)+NX(e.blue));throw new mX(6)}function zX(e,t,n,r){if("string"==typeof e&&"number"==typeof t){var i=IX(e);return"rgba("+i.red+","+i.green+","+i.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r)return r>=1?kX(e,t,n):"rgba("+e+","+t+","+n+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?kX(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new mX(7)}function VX(e){if("object"!=typeof e)throw new mX(8);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha}(e))return zX(e);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)}(e))return kX(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha}(e))return function(e,t,n,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r)return"rgba("+_X(e,t,n)+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?RX(e.hue,e.saturation,e.lightness):"rgba("+_X(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new mX(2)}(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)}(e))return function(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return RX(e,t,n);if("object"==typeof e&&void 0===t&&void 0===n)return RX(e.hue,e.saturation,e.lightness);throw new mX(1)}(e);throw new mX(8)}function BX(e,t,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=t?e.apply(this,r):BX(e,t,r)}}function FX(e){return BX(e,e.length,[])}function GX(e,t,n){return Math.max(e,Math.min(t,n))}FX((function(e,t){if("transparent"===t)return t;var n=EX(t);return VX(uX({},n,{hue:n.hue+parseFloat(e)}))})),FX((function(e,t){if("transparent"===t)return t;var n=EX(t);return VX(uX({},n,{lightness:GX(0,1,n.lightness-parseFloat(e))}))})),FX((function(e,t){if("transparent"===t)return t;var n=EX(t);return VX(uX({},n,{saturation:GX(0,1,n.saturation-parseFloat(e))}))})),FX((function(e,t){if("transparent"===t)return t;var n=EX(t);return VX(uX({},n,{lightness:GX(0,1,n.lightness+parseFloat(e))}))}));var HX=FX((function(e,t,n){if("transparent"===t)return n;if("transparent"===n)return t;if(0===e)return n;var r=IX(t),i=uX({},r,{alpha:"number"==typeof r.alpha?r.alpha:1}),o=IX(n),a=uX({},o,{alpha:"number"==typeof o.alpha?o.alpha:1}),s=i.alpha-a.alpha,l=2*parseFloat(e)-1,u=((l*s==-1?l:l+s)/(1+l*s)+1)/2,c=1-u;return zX({red:Math.floor(i.red*u+a.red*c),green:Math.floor(i.green*u+a.green*c),blue:Math.floor(i.blue*u+a.blue*c),alpha:i.alpha*parseFloat(e)+a.alpha*(1-parseFloat(e))})})),UX=HX;function WX(e){return Array.isArray(e)&&e.length>0}FX((function(e,t){if("transparent"===t)return t;var n=IX(t);return zX(uX({},n,{alpha:GX(0,1,(100*("number"==typeof n.alpha?n.alpha:1)+100*parseFloat(e))/100)}))})),FX((function(e,t){if("transparent"===t)return t;var n=EX(t);return VX(uX({},n,{saturation:GX(0,1,n.saturation+parseFloat(e))}))})),FX((function(e,t){return"transparent"===t?t:VX(uX({},EX(t),{hue:parseFloat(e)}))})),FX((function(e,t){return"transparent"===t?t:VX(uX({},EX(t),{lightness:parseFloat(e)}))})),FX((function(e,t){return"transparent"===t?t:VX(uX({},EX(t),{saturation:parseFloat(e)}))})),FX((function(e,t){return"transparent"===t?t:UX(parseFloat(e),"rgb(0, 0, 0)",t)})),FX((function(e,t){return"transparent"===t?t:UX(parseFloat(e),"rgb(255, 255, 255)",t)})),FX((function(e,t){if("transparent"===t)return t;var n=IX(t);return zX(uX({},n,{alpha:GX(0,1,+(100*("number"==typeof n.alpha?n.alpha:1)-100*parseFloat(e)).toFixed(2)/100)}))}));const jX=(e,t=2)=>"number"==typeof e?`${Number((100*e).toFixed(t))}%`:"-%";function XX(e){return Array.isArray(e)?[...new Set(e)]:[]}const YX=e=>Array.isArray(e)&&0!==e.length?e.reduce(((e,t)=>{const n=Number(t);return e+(Object.is(n,NaN)?0:n)}),0):0,ZX=e=>Array.isArray(e)?e.sort(((e,t)=>t.value-e.value)):e,qX=e=>{var t;return{boundaryGap:!0,axisTick:{alignWithLabel:!0},data:XX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.label))),axisLabel:{rotate:e.xAxisLabelRotate,formatter:t=>{const n=e.xAxisLabelLength;return"number"==typeof n&&t.length>n?`${t.slice(0,n)}...`:t}}}},KX=(e,t)=>(e.sort(((e,n)=>t.indexOf(e.label)-t.indexOf(n.label))),e);function $X(e,t){let n=null;return function(...r){clearTimeout(n),n=setTimeout((()=>{e.apply(globalThis,r)}),t)}}const JX=e=>"dark"===e.theme?"rgba(255, 255, 255, 0.7)":"rgba(0, 0, 0, 0.7)";function QX(e){const t=e.reduce(((e,t)=>{const{label:n,value:r}=t;return e[n]||(e[n]=0),r&&(e[n]+=Number(r)),e}),{});return Object.values(t).map((e=>parseFloat(e.toFixed(2))))}const eY=e=>{const t=(e=>{const{data:t,extraData:n,sort:r}=e;if(t&&r){const a=(i=[...t],"asc"===(o=r)?i.sort(((e,t)=>e.value-t.value)):"desc"===o&&i.sort(((e,t)=>t.value-e.value)),i),s=XX(a.map((e=>e.label))),l=KX(a,s),u=KX([...null!=n?n:[]],s);return Object.assign(Object.assign({},e),{data:l,extraData:u})}var i,o;return e})(e);switch(t.chartType){case aX.MINI_AREA:return(e=>{var t,n,r;const i=XX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type))),o=e.color;return{color:o,grid:{top:4,left:0,right:0,bottom:0,containLabel:!0},tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{show:!1},xAxis:{show:!1,boundaryGap:!1,data:XX(null===(n=e.data)||void 0===n?void 0:n.map((e=>e.label)))},yAxis:{show:!1,min:null===(r=e.yStart)||void 0===r?void 0:r[0]},series:[...i.map(((t,n)=>{var r,i;const a=null!==(r=null==o?void 0:o[n])&&void 0!==r?r:sX[n];return{name:t,type:"line",smooth:!0,lineStyle:{width:2},showSymbol:!1,areaStyle:{opacity:.8,color:new wc(0,0,0,1,[{offset:0,color:zX(a,.5)},{offset:1,color:"dark"===e.theme?zX("gray",.1):"#fff"}])},emphasis:{focus:"series"},data:null===(i=e.data)||void 0===i?void 0:i.filter((e=>e.type===t)).map((e=>e.value))}}))]}})(t);case aX.AREA:return(e=>{var t,n;const r=XX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:qX(e),yAxis:{min:null===(n=e.yStart)||void 0===n?void 0:n[0]},series:[...r.map(((t,n)=>{var r;return{name:t,type:"line",smooth:!0,lineStyle:{width:2},showSymbol:!1,areaStyle:{opacity:.8,color:new wc(0,0,0,1,[{offset:0,color:zX(sX[n],.5)},{offset:1,color:"dark"===e.theme?zX("gray",.1):"#fff"}])},emphasis:{focus:"series"},data:null===(r=e.data)||void 0===r?void 0:r.filter((e=>e.type===t)).map((e=>e.value))}}))]}})(t);case aX.LINE:return(e=>{var t,n;const r=XX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:qX(e),yAxis:{min:null===(n=e.yStart)||void 0===n?void 0:n[0]},series:r.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"line",smooth:!1,lineStyle:{width:2},showSymbol:!0,emphasis:{focus:"series"}},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"top"}}),{data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>e.value))})}))}})(t);case aX.COLUMN:return(e=>{var t,n;const r=XX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:Object.assign(Object.assign({},qX(e)),{axisPointer:{type:"shadow"}}),yAxis:{min:null===(n=e.yStart)||void 0===n?void 0:n[0]},series:r.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"bar",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"top"}}),{data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value,itemStyle:{borderRadius:e.value>0?[500,500,0,0]:[0,0,500,500]}})))})}))}})(t);case aX.STACK_COLUMN:return(e=>{var t,n;const r=XX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:Object.assign(Object.assign({},qX(e)),{axisPointer:{type:"shadow"}}),yAxis:{min:null===(n=e.yStart)||void 0===n?void 0:n[0]},series:r.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"bar",stack:"total",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"top"}}),{data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value})))})}))}})(t);case aX.BAR:return(e=>{var t,n,r;const i=XX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:{},yAxis:{data:XX(null===(n=e.data)||void 0===n?void 0:n.map((e=>e.label))),axisTick:{alignWithLabel:!0},axisPointer:{type:"shadow"},min:null===(r=e.yStart)||void 0===r?void 0:r[0],axisLabel:{rotate:e.xAxisLabelRotate,formatter:t=>{const n=e.xAxisLabelLength;return"number"==typeof n&&t.length>n?`${t.slice(0,n)}...`:t}}},series:i.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"bar",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"right"}}),{data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value,itemStyle:{borderRadius:[0,500,500,0]}})))})}))}})(t);case aX.STACK_BAR:return(e=>{var t,n,r;const i=XX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{grid:Object.assign({},e.showStackTotal&&{right:32}),tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll",data:i},xAxis:{},yAxis:{data:XX(null===(n=e.data)||void 0===n?void 0:n.map((e=>e.label))),axisTick:{alignWithLabel:!0},axisPointer:{type:"shadow"},min:null===(r=e.yStart)||void 0===r?void 0:r[0],axisLabel:{rotate:e.xAxisLabelRotate,formatter:t=>{const n=e.xAxisLabelLength;return"number"==typeof n&&t.length>n?`${t.slice(0,n)}...`:t}}},series:[...i.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"bar",stack:"total",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8},e.showLabel&&!e.showStackTotal&&{label:{show:!0,formatter:"{c}",position:"right"}}),{data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value})))})})),Object.assign(Object.assign({name:"总和",type:"bar",stack:"abc",barGap:"-100%",barMaxWidth:8,itemStyle:{normal:{color:"transparent"}},tooltip:{show:!1}},e.showStackTotal&&{label:{normal:{show:!0,position:"right",color:"#000"},formatter:t=>{var n;return String(Number(YX(null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.label===t.name)).map((e=>e.value))).toFixed(2)))}}}),{data:QX(e.data)})]}})(t);case aX.FUNNEL:return(e=>{var t,n;const r=null!==(n=null===(t=ZX(e.data))||void 0===t?void 0:t.map((t=>{var n;return{value:null!==(n=t.value)&&void 0!==n?n:0,name:e.reserveValueWithLabelType?t.label:t.type}})))&&void 0!==n?n:[],i={type:"funnel",minSize:"20%",left:10,top:24,width:"76%",sort:"descending",data:r};return{tooltip:{trigger:"item"},legend:{bottom:0,type:"scroll"},series:[Object.assign(Object.assign({},i),{label:{show:!0,position:"outer",formatter:"{c}"}}),Object.assign(Object.assign({},i),{emphasis:{label:{fontSize:20}},label:{show:!0,position:"inner",color:"#fff",formatter:e=>{const t=e.dataIndex;if(0===t)return"100%";const n=r[t-1].value;return jX(e.value/n)}}})]}})(t);case aX.DUAL_LINE_BAR:return(e=>{var t,n,r,i;const o=XX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type))),a=XX(null===(n=e.extraData)||void 0===n?void 0:n.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",crossStyle:{color:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:Object.assign(Object.assign({},qX(e)),{axisPointer:{type:"shadow"}}),yAxis:[{alignTicks:!0,min:null===(r=e.yStart)||void 0===r?void 0:r[0]},{alignTicks:!0,min:null===(i=e.yStart)||void 0===i?void 0:i[1]}],series:[...o.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"bar",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"top"}}),{data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value,itemStyle:{borderRadius:e.value>0?[500,500,0,0]:[0,0,500,500]}})))})})),...a.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"line",smooth:!0,yAxisIndex:1,showSymbol:!1},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"top"}}),{data:null===(n=e.extraData)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>e.value))})}))]}})(t);case aX.STACK_DUAL_LINE_BAR:return(e=>{var t,n,r,i;const o=XX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type))),a=XX(null===(n=e.extraData)||void 0===n?void 0:n.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",crossStyle:{color:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:Object.assign(Object.assign({},qX(e)),{axisPointer:{type:"shadow"}}),yAxis:[{alignTicks:!0,min:null===(r=e.yStart)||void 0===r?void 0:r[0]},{alignTicks:!0,min:null===(i=e.yStart)||void 0===i?void 0:i[1]}],series:[...o.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"bar",stack:"total",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"top"}}),{data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value})))})})),...a.map((t=>{var n;return Object.assign(Object.assign({name:t,type:"line",smooth:!0,yAxisIndex:1,showSymbol:!1},e.showLabel&&{label:{show:!0,formatter:"{c}",position:"top"}}),{data:null===(n=e.extraData)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>e.value))})}))]}})(t);case aX.PIE:return(e=>{var t,n;const r=YX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.value)));return{tooltip:{trigger:"item"},legend:{bottom:0,type:"scroll"},series:[{top:-30,type:"pie",radius:"50%",data:null===(n=ZX(e.data))||void 0===n?void 0:n.map((t=>({value:t.value,name:e.reserveValueWithLabelType?t.label:t.type}))),label:{show:!0,fontSize:12,color:JX(e),position:"outside",formatter:e=>jX(e.value/(r||1))},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}})(t);case aX.CYCLE:return(e=>{var t,n,r,i,o,a,s,l,u,c,h,d,p,f,g,m,v,y,_,x;const b=YX(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.value)));return{tooltip:{trigger:"item"},legend:{bottom:0,type:"scroll"},series:[{top:-30,type:"pie",radius:["60%","48%"],data:null===(n=ZX(e.data))||void 0===n?void 0:n.map((t=>({value:t.value,name:e.reserveValueWithLabelType?t.label:t.type}))),label:{show:!0,fontSize:12,color:JX(e),position:"outside",formatter:e=>jX(e.value/(b||1))},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],graphic:[{type:"text",left:"center",top:null!==(o=null===(i=null===(r=e.cycleCenterConfig)||void 0===r?void 0:r.content)||void 0===i?void 0:i.top)&&void 0!==o?o:76,style:{text:null!==(l=null===(s=null===(a=e.cycleCenterConfig)||void 0===a?void 0:a.content)||void 0===s?void 0:s.value)&&void 0!==l?l:Number(b.toFixed(2)).toString(),fill:"dark"===e.theme?"#fff":"#12161F",fontFamily:"roboto",fontSize:null!==(h=null===(c=null===(u=e.cycleCenterConfig)||void 0===u?void 0:u.content)||void 0===c?void 0:c.fontSize)&&void 0!==h?h:28,fontWeight:"bold"}},{type:"text",left:"center",top:null!==(f=null===(p=null===(d=e.cycleCenterConfig)||void 0===d?void 0:d.title)||void 0===p?void 0:p.top)&&void 0!==f?f:112,style:{text:null!==(v=null===(m=null===(g=e.cycleCenterConfig)||void 0===g?void 0:g.title)||void 0===m?void 0:m.value)&&void 0!==v?v:"总计",fill:"dark"===e.theme?"#fff":"#394252 ",fontSize:null!==(x=null===(_=null===(y=e.cycleCenterConfig)||void 0===y?void 0:y.title)||void 0===_?void 0:_.fontSize)&&void 0!==x?x:14}}]}})(t);case aX.RADAR:return(e=>{var t,n;const r=XX(null===(t=e.data)||void 0===t?void 0:t.map((t=>e.reserveValueWithLabelType?t.label:t.type)));return{tooltip:{trigger:"item"},legend:{bottom:0,type:"scroll"},radar:{shape:"circle",radius:"60%",indicator:XX(null===(n=e.data)||void 0===n?void 0:n.map((t=>e.reserveValueWithLabelType?t.type:t.label))).map((e=>({name:e}))),axisName:{color:"#5d677a"},splitArea:{areaStyle:{color:["transparent"]}},axisLine:{lineStyle:{color:"rgba(226, 229, 235, .3)"}},splitLine:{lineStyle:{color:"#e2e5eb",type:"dashed",dashOffset:1.5}}},series:[{type:"radar",data:r.map(((t,n)=>{var r;return{name:t,value:null===(r=e.data)||void 0===r?void 0:r.filter((n=>e.reserveValueWithLabelType?n.label:n.type===t)).map((e=>e.value)),areaStyle:{color:zX(sX[n],.2)},label:{show:e.reserveValueWithLabelType,formatter:e=>{var t;return null===(t=e.value)||void 0===t?void 0:t.toString()}}}})),emphasis:{lineStyle:{width:4}}}]}})(t);default:return{}}};var tY={color:["#3379ff","#00dcf0","#ffc94d","#00db75","#b8b3ff","#40b4ff","#ffa101","#90abe0","#6ee67a","#6b84ff","#fa6b69"],backgroundColor:"rgba(0,0,0,0)",textStyle:{},title:{textStyle:{color:"#272f3d"},subtextStyle:{color:"#394252"}},line:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:4,symbol:"emptyCircle",smooth:!1},radar:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:4,symbol:"emptyCircle",smooth:!1},bar:{itemStyle:{barBorderWidth:"0",barBorderColor:"#cccccc"}},pie:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},scatter:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},boxplot:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},parallel:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},sankey:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},funnel:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},gauge:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},candlestick:{itemStyle:{color:"#f15451",color0:"#00c267",borderColor:"#f15451",borderColor0:"#00c267",borderWidth:1}},graph:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"},lineStyle:{width:"1",color:"#dfe3eb"},symbolSize:4,symbol:"emptyCircle",smooth:!1,color:["#3379ff","#00dcf0","#ffc94d","#00db75","#b8b3ff","#40b4ff","#ffa101","#90abe0","#6ee67a","#6b84ff","#fa6b69"],label:{color:"#ffffff"}},map:{itemStyle:{areaColor:"#eee",borderColor:"#444",borderWidth:.5},label:{color:"#000"},emphasis:{itemStyle:{areaColor:"rgba(255,215,0,0.8)",borderColor:"#444",borderWidth:1},label:{color:"rgb(100,0,0)"}}},geo:{itemStyle:{areaColor:"#eee",borderColor:"#444",borderWidth:.5},label:{color:"#000"},emphasis:{itemStyle:{areaColor:"rgba(255,215,0,0.8)",borderColor:"#444",borderWidth:1},label:{color:"rgb(100,0,0)"}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:"#eef0f5"}},axisTick:{show:!0,lineStyle:{color:"#eef0f5"}},axisLabel:{show:!0,color:"#828b9e"},splitLine:{show:!1,lineStyle:{color:["#E0E6F1"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},valueAxis:{axisLine:{show:!1,lineStyle:{color:"#6E7079"}},axisTick:{show:!1,lineStyle:{color:"#6E7079"}},axisLabel:{show:!0,color:"#828b9e"},splitLine:{show:!0,lineStyle:{color:["#eef0f5"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},logAxis:{axisLine:{show:!1,lineStyle:{color:"#6E7079"}},axisTick:{show:!1,lineStyle:{color:"#6E7079"}},axisLabel:{show:!0,color:"#828b9e"},splitLine:{show:!0,lineStyle:{color:["#eef0f5"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},timeAxis:{axisLine:{show:!0,lineStyle:{color:"#eef0f5"}},axisTick:{show:!0,lineStyle:{color:"#eef0f5"}},axisLabel:{show:!0,color:"#828b9e"},splitLine:{show:!1,lineStyle:{color:["#E0E6F1"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},toolbox:{iconStyle:{borderColor:"#828c9e"},emphasis:{iconStyle:{borderColor:"#394252"}}},legend:{textStyle:{color:"#828b9e"}},tooltip:{axisPointer:{lineStyle:{color:"#ccd1db",width:"1"},crossStyle:{color:"#ccd1db",width:"1"}}},timeline:{lineStyle:{color:"#eef0f5",width:2},itemStyle:{color:"#eef0f5",borderWidth:"1"},controlStyle:{color:"#828c9e",borderColor:"#828c9e",borderWidth:1},checkpointStyle:{color:"#3379ff",borderColor:"#ffffff"},label:{color:"#b1b9c7"},emphasis:{itemStyle:{color:"#3379ff"},controlStyle:{color:"#828c9e",borderColor:"#828c9e",borderWidth:1},label:{color:"#b1b9c7"}}},visualMap:{color:["#062379","#2058d2","#3379ff","#a0cbff","#e8f4ff"]},dataZoom:{handleSize:"undefined%",textStyle:{}},markPoint:{label:{color:"#ffffff"},emphasis:{label:{color:"#ffffff"}}}},nY={color:["#5798ff","#00dcf0","#ffc94d","#00db75","#b8b3ff","#40b4ff","#ffa101","#90abe0","#6ee67a","#6b84ff","#fa6b69"],backgroundColor:"transparent",textStyle:{},title:{textStyle:{color:"#ffffff"},subtextStyle:{color:"#ffffff"}},line:{itemStyle:{borderWidth:"1"},lineStyle:{width:"2"},symbolSize:"6",symbol:"emptyCircle",smooth:!0},radar:{itemStyle:{borderWidth:"1"},lineStyle:{width:"2"},symbolSize:"6",symbol:"emptyCircle",smooth:!0},bar:{itemStyle:{barBorderWidth:"0",barBorderColor:"#cccccc"}},pie:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},scatter:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},boxplot:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},parallel:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},sankey:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},funnel:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},gauge:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},candlestick:{itemStyle:{color:"#f15451",color0:"#00c267",borderColor:"#f15451",borderColor0:"#00c267",borderWidth:1}},graph:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"},lineStyle:{width:"1",color:"#ffffff"},symbolSize:"6",symbol:"emptyCircle",smooth:!0,color:["#5798ff","#00dcf0","#ffc94d","#00db75","#b8b3ff","#40b4ff","#ffa101","#90abe0","#6ee67a","#6b84ff","#fa6b69"],label:{color:"#ffffff"}},map:{itemStyle:{areaColor:"#eee",borderColor:"#444",borderWidth:.5},label:{color:"#000"},emphasis:{itemStyle:{areaColor:"rgba(255,215,0,0.8)",borderColor:"#444",borderWidth:1},label:{color:"rgb(100,0,0)"}}},geo:{itemStyle:{areaColor:"#eee",borderColor:"#444",borderWidth:.5},label:{color:"#000"},emphasis:{itemStyle:{areaColor:"rgba(255,215,0,0.8)",borderColor:"#444",borderWidth:1},label:{color:"rgb(100,0,0)"}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:"rgba(255,255,255,0.12)"}},axisTick:{show:!0,lineStyle:{color:"rgba(255,255,255,0.12)"}},axisLabel:{show:!0,color:"rgba(255,255,255,0.5)"},splitLine:{show:!1,lineStyle:{color:["#E0E6F1"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},valueAxis:{axisLine:{show:!1,lineStyle:{color:"#6E7079"}},axisTick:{show:!1,lineStyle:{color:"#6E7079"}},axisLabel:{show:!0,color:"rgba(255,255,255,0.5)"},splitLine:{show:!0,lineStyle:{color:["rgba(255,255,255,0.12)"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},logAxis:{axisLine:{show:!1,lineStyle:{color:"#6E7079"}},axisTick:{show:!1,lineStyle:{color:"#6E7079"}},axisLabel:{show:!0,color:"rgba(255,255,255,0.5)"},splitLine:{show:!0,lineStyle:{color:["rgba(255,255,255,0.12)"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},timeAxis:{axisLine:{show:!0,lineStyle:{color:"rgba(255,255,255,0.12)"}},axisTick:{show:!0,lineStyle:{color:"rgba(255,255,255,0.12)"}},axisLabel:{show:!0,color:"rgba(255,255,255,0.5)"},splitLine:{show:!1,lineStyle:{color:["#E0E6F1"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},toolbox:{iconStyle:{borderColor:"#ffffff"},emphasis:{iconStyle:{borderColor:"#ffffff"}}},legend:{textStyle:{color:"#ffffff"}},tooltip:{axisPointer:{lineStyle:{color:"#ffffff",width:"1"},crossStyle:{color:"#ffffff",width:"1"}}},timeline:{lineStyle:{color:"#ffffff",width:2},itemStyle:{color:"#ffffff",borderWidth:"1"},controlStyle:{color:"#ffffff",borderColor:"#ffffff",borderWidth:1},checkpointStyle:{color:"#5798ff",borderColor:"#ffffff"},label:{color:"#ffffff"},emphasis:{itemStyle:{color:"#5798ff"},controlStyle:{color:"#ffffff",borderColor:"#ffffff",borderWidth:1},label:{color:"#ffffff"}}},visualMap:{color:["#062379","#2058d2","#3379ff","#a0cbff","#e8f4ff"]},dataZoom:{handleSize:"undefined%",textStyle:{}},markPoint:{label:{color:"#ffffff"},emphasis:{label:{color:"#ffffff"}}}},rY=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===iY}(e)}(e)};var iY="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function oY(e,t){return!1!==t.clone&&t.isMergeableObject(e)?cY((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function aY(e,t,n){return e.concat(t).map((function(e){return oY(e,n)}))}function sY(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function lY(e,t){try{return t in e}catch(e){return!1}}function uY(e,t,n){var r={};return n.isMergeableObject(e)&&sY(e).forEach((function(t){r[t]=oY(e[t],n)})),sY(t).forEach((function(i){(function(e,t){return lY(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(lY(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return cY;var n=t.customMerge(e);return"function"==typeof n?n:cY}(i,n)(e[i],t[i],n):r[i]=oY(t[i],n))})),r}function cY(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||aY,n.isMergeableObject=n.isMergeableObject||rY,n.cloneUnlessOtherwiseSpecified=oY;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):uY(e,t,n):oY(t,n)}cY.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return cY(e,n,t)}),{})};var hY=dU(cY);Uy("light",hY(tY,lX)),Uy("dark",hY(nY,lX));const dY={arrayMerge:(e,t)=>t},pY=e=>{const n=t(null),[r,i]=o();return a((()=>{var t;const r=By(n.current,null!==(t=e.theme)&&void 0!==t?t:"light");i(r);const o=$X(r.resize,500),a=()=>{o()};return globalThis.addEventListener("resize",a),()=>{globalThis.removeEventListener("resize",a)}}),[e.theme]),a((()=>{if(r){const{data:t,extraOption:n={},extraSeriesOption:i}=e;WX(t)||r.clear();const o=hY(((e,t)=>(WX(e.series)&&WX(t)&&t.forEach((t=>{e.series=e.series.map((e=>Object.assign(Object.assign({},e),e.name===t.name&&t)))})),e))(eY(e),i),n,dY);r.setOption(o);const a=setTimeout((()=>{r.resize()}),500);return()=>{clearTimeout(a)}}}),[r,e]),yU.jsx(oX,{ref:n,className:e.className,style:e.style})};function fY(e,t,n){"object"==typeof t&&(n=t,t=null);var r,i=this;if(!(e instanceof Function))for(var o in r=[],e)e.hasOwnProperty(o)&&r.push(o);var a=function(t){if(i.apply(this,arguments),e instanceof Function?gY(this,e.call(this,t)):function(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];e[i]=t[i]}}(this,e,r),this.constructor===a)for(var n=a.__initializers__,o=0;o<n.length;o++)n[o].apply(this,arguments)};a.__super__=i,i.__initializers__?a.__initializers__=i.__initializers__.slice():a.__initializers__=[],t&&a.__initializers__.push(t);var s=function(){};return s.prototype=i.prototype,a.prototype=new s,a.prototype.constructor=a,gY(a.prototype,n),a.extend=i.extend,a.derive=i.extend,a}function gY(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}l_([FS,yH]),l_(xw);var mY={extend:fY,derive:fY};function vY(e,t){this.action=e,this.context=t}var yY={trigger:function(e){if(this.hasOwnProperty("__handlers__")&&this.__handlers__.hasOwnProperty(e)){var t=this.__handlers__[e],n=t.length,r=-1,i=arguments;switch(i.length){case 1:for(;++r<n;)t[r].action.call(t[r].context);return;case 2:for(;++r<n;)t[r].action.call(t[r].context,i[1]);return;case 3:for(;++r<n;)t[r].action.call(t[r].context,i[1],i[2]);return;case 4:for(;++r<n;)t[r].action.call(t[r].context,i[1],i[2],i[3]);return;case 5:for(;++r<n;)t[r].action.call(t[r].context,i[1],i[2],i[3],i[4]);return;default:for(;++r<n;)t[r].action.apply(t[r].context,Array.prototype.slice.call(i,1));return}}},on:function(e,t,n){if(e&&t){var r=this.__handlers__||(this.__handlers__={});if(r[e]){if(this.has(e,t))return}else r[e]=[];var i=new vY(t,n||this);return r[e].push(i),this}},once:function(e,t,n){if(e&&t){var r=this;return this.on(e,(function n(){r.off(e,n),t.apply(this,arguments)}),n)}},before:function(e,t,n){if(e&&t)return e="before"+e,this.on(e,t,n)},after:function(e,t,n){if(e&&t)return e="after"+e,this.on(e,t,n)},success:function(e,t){return this.once("success",e,t)},error:function(e,t){return this.once("error",e,t)},off:function(e,t){var n=this.__handlers__||(this.__handlers__={});if(t){if(n[e]){for(var r=n[e],i=[],o=0;o<r.length;o++)t&&r[o].action!==t&&i.push(r[o]);n[e]=i}return this}n[e]=[]},has:function(e,t){var n=this.__handlers__;if(!n||!n[e])return!1;for(var r=n[e],i=0;i<r.length;i++)if(r[i].action===t)return!0}},_Y=0,xY=Array.prototype.forEach,bY={genGUID:function(){return++_Y},relative2absolute:function(e,t){if(!t||e.match(/^\//))return e;for(var n=e.split("/"),r=t.split("/"),i=n[0];"."===i||".."===i;)".."===i&&r.pop(),n.shift(),i=n[0];return r.join("/")+"/"+n.join("/")},extend:function(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},defaults:function(e,t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n]);return e},extendWithPropList:function(e,t,n){if(t)for(var r=0;r<n.length;r++){var i=n[r];e[i]=t[i]}return e},defaultsWithPropList:function(e,t,n){if(t)for(var r=0;r<n.length;r++){var i=n[r];null==e[i]&&(e[i]=t[i])}return e},each:function(e,t,n){if(e&&t)if(e.forEach&&e.forEach===xY)e.forEach(t,n);else if(e.length===+e.length)for(var r=0,i=e.length;r<i;r++)t.call(n,e[r],r,e);else for(var o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o,e)},isObject:function(e){return e===Object(e)},isArray:function(e){return Array.isArray(e)},isArrayLike:function(e){return!!e&&e.length===+e.length},clone:function(e){if(bY.isObject(e)){if(bY.isArray(e))return e.slice();if(bY.isArrayLike(e)){for(var t=new e.constructor(e.length),n=0;n<e.length;n++)t[n]=e[n];return t}return bY.extend({},e)}return e}},wY=function(){this.__uid__=bY.genGUID()};wY.__initializers__=[function(e){bY.extend(this,e)}],bY.extend(wY,mY),bY.extend(wY.prototype,yY);var SY=["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear","OES_standard_derivatives","OES_vertex_array_object","OES_element_index_uint","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","EXT_texture_filter_anisotropic","EXT_shader_texture_lod","WEBGL_draw_buffers","EXT_frag_depth","EXT_sRGB","ANGLE_instanced_arrays"],TY=["MAX_TEXTURE_SIZE","MAX_CUBE_MAP_TEXTURE_SIZE"];function MY(e){for(var t={},n={},r=0;r<SY.length;r++){o(SY[r])}for(r=0;r<TY.length;r++){var i=TY[r];n[i]=e.getParameter(e[i])}function o(n){if(e.getExtension){var r=e.getExtension(n);r||(r=e.getExtension("MOZ_"+n)),r||(r=e.getExtension("WEBKIT_"+n)),t[n]=r}}this.getExtension=function(e){return e in t||o(e),t[e]},this.getParameter=function(e){return n[e]}}var CY=256,DY=1024,AY=16384,IY=0,EY=1,LY=2,NY=3,PY=4,OY=5,RY=6,kY=35040,zY=35044,VY=35048,BY=1028,FY=1029,GY=1032,HY=2304,UY=2305,WY=5120,jY=5121,XY=5122,YY=5123,ZY=5124,qY=5125,KY=5126,$Y=6402,JY=6406,QY=6407,eZ=6408,tZ=6409,nZ=6410,rZ=9728,iZ=9729,oZ=9984,aZ=9985,sZ=9986,lZ=9987,uZ=3553,cZ=34067,hZ=10497,dZ=33071,pZ=33648,fZ=36160,gZ=36161,mZ=34041,vZ=36064,yZ=36096,_Z=36128,xZ=33306;var bZ,wZ={get:function(e){var t=new XMLHttpRequest;t.open("get",e.url),t.responseType=e.responseType||"text",e.onprogress&&(t.onprogress=function(t){if(t.lengthComputable){var n=t.loaded/t.total;e.onprogress(n,t.loaded,t.total)}else e.onprogress(null)}),t.onload=function(n){t.status>=400?e.onerror&&e.onerror():e.onload&&e.onload(t.response)},e.onerror&&(t.onerror=e.onerror),t.send(null)}},SZ={supportWebGL:function(){if(null==bZ)try{var e=document.createElement("canvas");if(!(e.getContext("webgl")||e.getContext("experimental-webgl")))throw new Error}catch(e){bZ=!1}return bZ}};SZ.Int8Array="undefined"==typeof Int8Array?Array:Int8Array,SZ.Uint8Array="undefined"==typeof Uint8Array?Array:Uint8Array,SZ.Uint16Array="undefined"==typeof Uint16Array?Array:Uint16Array,SZ.Uint32Array="undefined"==typeof Uint32Array?Array:Uint32Array,SZ.Int16Array="undefined"==typeof Int16Array?Array:Int16Array,SZ.Float32Array="undefined"==typeof Float32Array?Array:Float32Array,SZ.Float64Array="undefined"==typeof Float64Array?Array:Float64Array;var TZ={};"undefined"!=typeof window?TZ=window:"undefined"!=typeof global&&(TZ=global),SZ.requestAnimationFrame=TZ.requestAnimationFrame||TZ.msRequestAnimationFrame||TZ.mozRequestAnimationFrame||TZ.webkitRequestAnimationFrame||function(e){setTimeout(e,16)},SZ.createCanvas=function(){return document.createElement("canvas")},SZ.createImage=function(){return new TZ.Image},SZ.request={get:wZ.get},SZ.addEventListener=function(e,t,n,r){e.addEventListener(t,n,r)},SZ.removeEventListener=function(e,t,n){e.removeEventListener(t,n)};var MZ=function(){this.head=null,this.tail=null,this._length=0};MZ.prototype.insert=function(e){var t=new MZ.Entry(e);return this.insertEntry(t),t},MZ.prototype.insertAt=function(e,t){if(!(e<0)){for(var n=this.head,r=0;n&&r!=e;)n=n.next,r++;if(n){var i=new MZ.Entry(t),o=n.prev;o?(o.next=i,i.prev=o):this.head=i,i.next=n,n.prev=i}else this.insert(t)}},MZ.prototype.insertBeforeEntry=function(e,t){var n=new MZ.Entry(e),r=t.prev;r?(r.next=n,n.prev=r):this.head=n,n.next=t,t.prev=n,this._length++},MZ.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,this.tail=e):this.head=this.tail=e,this._length++},MZ.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._length--},MZ.prototype.removeAt=function(e){if(!(e<0)){for(var t=this.head,n=0;t&&n!=e;)t=t.next,n++;return t?(this.remove(t),t.value):void 0}},MZ.prototype.getHead=function(){if(this.head)return this.head.value},MZ.prototype.getTail=function(){if(this.tail)return this.tail.value},MZ.prototype.getAt=function(e){if(!(e<0)){for(var t=this.head,n=0;t&&n!=e;)t=t.next,n++;return t.value}},MZ.prototype.indexOf=function(e){for(var t=this.head,n=0;t;){if(t.value===e)return n;t=t.next,n++}},MZ.prototype.length=function(){return this._length},MZ.prototype.isEmpty=function(){return 0===this._length},MZ.prototype.forEach=function(e,t){for(var n=this.head,r=0,i=void 0!==t;n;)i?e.call(t,n.value,r):e(n.value,r),n=n.next,r++},MZ.prototype.clear=function(){this.tail=this.head=null,this._length=0},MZ.Entry=function(e){this.value=e,this.next=null,this.prev=null};var CZ=function(e){this._list=new MZ,this._map={},this._maxSize=e||10};CZ.prototype.setMaxSize=function(e){this._maxSize=e},CZ.prototype.put=function(e,t){if(!this._map.hasOwnProperty(e)){var n=this._list.length();if(n>=this._maxSize&&n>0){var r=this._list.head;this._list.remove(r),delete this._map[r.key]}var i=this._list.insert(t);i.key=e,this._map[e]=i}},CZ.prototype.get=function(e){var t=this._map[e];if(this._map.hasOwnProperty(e))return t!==this._list.tail&&(this._list.remove(t),this._list.insertEntry(t)),t.value},CZ.prototype.remove=function(e){var t=this._map[e];void 0!==t&&(delete this._map[e],this._list.remove(t))},CZ.prototype.clear=function(){this._list.clear(),this._map={}};var DZ={},AZ={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function IZ(e){return(e=Math.round(e))<0?0:e>255?255:e}function EZ(e){return e<0?0:e>1?1:e}function LZ(e){return e.length&&"%"===e.charAt(e.length-1)?IZ(parseFloat(e)/100*255):IZ(parseInt(e,10))}function NZ(e){return e.length&&"%"===e.charAt(e.length-1)?EZ(parseFloat(e)/100):EZ(parseFloat(e))}function PZ(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function OZ(e,t,n){return e+(t-e)*n}function RZ(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function kZ(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var zZ=new CZ(20),VZ=null;function BZ(e,t){VZ&&kZ(VZ,t),VZ=zZ.put(e,VZ||t.slice())}function FZ(e,t){var n=(parseFloat(e[0])%360+360)%360/360,r=NZ(e[1]),i=NZ(e[2]),o=i<=.5?i*(r+1):i+r-i*r,a=2*i-o;return RZ(t=t||[],IZ(255*PZ(a,o,n+1/3)),IZ(255*PZ(a,o,n)),IZ(255*PZ(a,o,n-1/3)),1),4===e.length&&(t[3]=e[3]),t}DZ.parse=function(e,t){if(e){t=t||[];var n=zZ.get(e);if(n)return kZ(t,n);var r,i=(e+="").replace(/ /g,"").toLowerCase();if(i in AZ)return kZ(t,AZ[i]),BZ(e,t),t;if("#"===i.charAt(0))return 4===i.length?(r=parseInt(i.substr(1),16))>=0&&r<=4095?(RZ(t,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1),BZ(e,t),t):void RZ(t,0,0,0,1):7===i.length?(r=parseInt(i.substr(1),16))>=0&&r<=16777215?(RZ(t,(16711680&r)>>16,(65280&r)>>8,255&r,1),BZ(e,t),t):void RZ(t,0,0,0,1):void 0;var o=i.indexOf("("),a=i.indexOf(")");if(-1!==o&&a+1===i.length){var s=i.substr(0,o),l=i.substr(o+1,a-(o+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return void RZ(t,0,0,0,1);u=NZ(l.pop());case"rgb":return 3!==l.length?void RZ(t,0,0,0,1):(RZ(t,LZ(l[0]),LZ(l[1]),LZ(l[2]),u),BZ(e,t),t);case"hsla":return 4!==l.length?void RZ(t,0,0,0,1):(l[3]=NZ(l[3]),FZ(l,t),BZ(e,t),t);case"hsl":return 3!==l.length?void RZ(t,0,0,0,1):(FZ(l,t),BZ(e,t),t);default:return}}RZ(t,0,0,0,1)}},DZ.parseToFloat=function(e,t){if(t=DZ.parse(e,t))return t[0]/=255,t[1]/=255,t[2]/=255,t},DZ.lift=function(e,t){var n=DZ.parse(e);if(n){for(var r=0;r<3;r++)n[r]=t<0?n[r]*(1-t)|0:(255-n[r])*t+n[r]|0;return DZ.stringify(n,4===n.length?"rgba":"rgb")}},DZ.toHex=function(e){var t=DZ.parse(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},DZ.fastLerp=function(e,t,n){if(t&&t.length&&e>=0&&e<=1){n=n||[];var r=e*(t.length-1),i=Math.floor(r),o=Math.ceil(r),a=t[i],s=t[o],l=r-i;return n[0]=IZ(OZ(a[0],s[0],l)),n[1]=IZ(OZ(a[1],s[1],l)),n[2]=IZ(OZ(a[2],s[2],l)),n[3]=EZ(OZ(a[3],s[3],l)),n}},DZ.fastMapToColor=DZ.fastLerp,DZ.lerp=function(e,t,n){if(t&&t.length&&e>=0&&e<=1){var r=e*(t.length-1),i=Math.floor(r),o=Math.ceil(r),a=DZ.parse(t[i]),s=DZ.parse(t[o]),l=r-i,u=DZ.stringify([IZ(OZ(a[0],s[0],l)),IZ(OZ(a[1],s[1],l)),IZ(OZ(a[2],s[2],l)),EZ(OZ(a[3],s[3],l))],"rgba");return n?{color:u,leftIndex:i,rightIndex:o,value:r}:u}},DZ.mapToColor=DZ.lerp,DZ.modifyHSL=function(e,t,n,r){if(e=DZ.parse(e))return e=function(e){if(e){var t,n,r=e[0]/255,i=e[1]/255,o=e[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),l=s-a,u=(s+a)/2;if(0===l)t=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var c=((s-r)/6+l/2)/l,h=((s-i)/6+l/2)/l,d=((s-o)/6+l/2)/l;r===s?t=d-h:i===s?t=1/3+c-d:o===s&&(t=2/3+h-c),t<0&&(t+=1),t>1&&(t-=1)}var p=[360*t,n,u];return null!=e[3]&&p.push(e[3]),p}}(e),null!=t&&(e[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=n&&(e[1]=NZ(n)),null!=r&&(e[2]=NZ(r)),DZ.stringify(FZ(e),"rgba")},DZ.modifyAlpha=function(e,t){if((e=DZ.parse(e))&&null!=t)return e[3]=EZ(t),DZ.stringify(e,"rgba")},DZ.stringify=function(e,t){if(e&&e.length){var n=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(n+=","+e[3]),t+"("+n+")"}};var GZ=DZ.parseToFloat,HZ={};function UZ(e){var t=Object.keys(e);t.sort();for(var n=[],r=0;r<t.length;r++){var i=t[r],o=e[i];null===o?n.push(i):n.push(i+" "+o.toString())}return n.join("\n")}var WZ,jZ=wY.extend((function(){return{name:"",depthTest:!0,depthMask:!0,transparent:!1,blend:null,autoUpdateTextureStatus:!0,uniforms:{},vertexDefines:{},fragmentDefines:{},_textureStatus:{},_enabledUniforms:null}}),(function(){this.name||(this.name="MATERIAL_"+this.__uid__),this.shader&&this.attachShader(this.shader,!0)}),{precision:"highp",setUniform:function(e,t){void 0===t&&console.warn('Uniform value "'+e+'" is undefined');var n=this.uniforms[e];n&&("string"==typeof t&&(t=GZ(t)||t),n.value=t,this.autoUpdateTextureStatus&&"t"===n.type&&(t?this.enableTexture(e):this.disableTexture(e)))},setUniforms:function(e){for(var t in e){var n=e[t];this.setUniform(t,n)}},isUniformEnabled:function(e){return this._enabledUniforms.indexOf(e)>=0},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(e,t){if("object"==typeof e)for(var n in e){var r=e[n];this.setUniform(n,r)}else this.setUniform(e,t)},get:function(e){var t=this.uniforms[e];if(t)return t.value},attachShader:function(e,t){var n=this.uniforms;this.uniforms=e.createUniforms(),this.shader=e;var r=this.uniforms;this._enabledUniforms=Object.keys(r),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter((function(e){var t=this.uniforms[e].type;return"t"===t||"tv"===t}),this);var i=this.vertexDefines,o=this.fragmentDefines;if(this.vertexDefines=bY.clone(e.vertexDefines),this.fragmentDefines=bY.clone(e.fragmentDefines),t){for(var a in n)r[a]&&(r[a].value=n[a].value);bY.defaults(this.vertexDefines,i),bY.defaults(this.fragmentDefines,o)}var s={};for(var l in e.textures)s[l]={shaderType:e.textures[l].shaderType,type:e.textures[l].type,enabled:!(!t||!this._textureStatus[l])&&this._textureStatus[l].enabled};this._textureStatus=s,this._programKey=""},clone:function(){var e=new this.constructor({name:this.name,shader:this.shader});for(var t in this.uniforms)e.uniforms[t].value=this.uniforms[t].value;return e.depthTest=this.depthTest,e.depthMask=this.depthMask,e.transparent=this.transparent,e.blend=this.blend,e.vertexDefines=bY.clone(this.vertexDefines),e.fragmentDefines=bY.clone(this.fragmentDefines),e.enableTexture(this.getEnabledTextures()),e.precision=this.precision,e},define:function(e,t,n){var r=this.vertexDefines,i=this.fragmentDefines;"vertex"!==e&&"fragment"!==e&&"both"!==e&&arguments.length<3&&(n=t,t=e,e="both"),n=null!=n?n:null,"vertex"!==e&&"both"!==e||r[t]!==n&&(r[t]=n,this._programKey=""),"fragment"!==e&&"both"!==e||i[t]!==n&&(i[t]=n,"both"!==e&&(this._programKey=""))},undefine:function(e,t){"vertex"!==e&&"fragment"!==e&&"both"!==e&&arguments.length<2&&(t=e,e="both"),"vertex"!==e&&"both"!==e||this.isDefined("vertex",t)&&(delete this.vertexDefines[t],this._programKey=""),"fragment"!==e&&"both"!==e||this.isDefined("fragment",t)&&(delete this.fragmentDefines[t],"both"!==e&&(this._programKey=""))},isDefined:function(e,t){switch(e){case"vertex":return void 0!==this.vertexDefines[t];case"fragment":return void 0!==this.fragmentDefines[t]}},getDefine:function(e,t){switch(e){case"vertex":return this.vertexDefines[t];case"fragment":return this.fragmentDefines[t]}},enableTexture:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.enableTexture(e[t]);else{var n=this._textureStatus[e];if(n)n.enabled||(n.enabled=!0,this._programKey="")}},enableTexturesAll:function(){var e=this._textureStatus;for(var t in e)e[t].enabled=!0;this._programKey=""},disableTexture:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.disableTexture(e[t]);else{var n=this._textureStatus[e];if(n)!n.enabled||(n.enabled=!1,this._programKey="")}},disableTexturesAll:function(){var e=this._textureStatus;for(var t in e)e[t].enabled=!1;this._programKey=""},isTextureEnabled:function(e){var t=this._textureStatus;return!!t[e]&&t[e].enabled},getEnabledTextures:function(){var e=[],t=this._textureStatus;for(var n in t)t[n].enabled&&e.push(n);return e},dirtyDefines:function(){this._programKey=""},getProgramKey:function(){return this._programKey||(this._programKey=function(e,t,n){n.sort();for(var r=[],i=0;i<n.length;i++){var o=n[i];r.push(o)}var a=UZ(e)+"\n"+UZ(t)+"\n"+r.join("\n");if(HZ[a])return HZ[a];var s=bY.genGUID();return HZ[a]=s,s}(this.vertexDefines,this.fragmentDefines,this.getEnabledTextures())),this._programKey}}),XZ=1e-6,YZ=Array,ZZ=Math.random,qZ={};qZ.create=function(){var e=new YZ(2);return e[0]=0,e[1]=0,e},qZ.clone=function(e){var t=new YZ(2);return t[0]=e[0],t[1]=e[1],t},qZ.fromValues=function(e,t){var n=new YZ(2);return n[0]=e,n[1]=t,n},qZ.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},qZ.set=function(e,t,n){return e[0]=t,e[1]=n,e},qZ.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},qZ.subtract=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},qZ.sub=qZ.subtract,qZ.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},qZ.mul=qZ.multiply,qZ.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},qZ.div=qZ.divide,qZ.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},qZ.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e},qZ.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},qZ.scaleAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},qZ.distance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)},qZ.dist=qZ.distance,qZ.squaredDistance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r},qZ.sqrDist=qZ.squaredDistance,qZ.length=function(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)},qZ.len=qZ.length,qZ.squaredLength=function(e){var t=e[0],n=e[1];return t*t+n*n},qZ.sqrLen=qZ.squaredLength,qZ.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},qZ.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e},qZ.normalize=function(e,t){var n=t[0],r=t[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e},qZ.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},qZ.cross=function(e,t,n){var r=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=r,e},qZ.lerp=function(e,t,n,r){var i=t[0],o=t[1];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e},qZ.random=function(e,t){t=t||1;var n=2*GLMAT_RANDOM()*Math.PI;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e},qZ.transformMat2=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e},qZ.transformMat2d=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e},qZ.transformMat3=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[3]*i+n[6],e[1]=n[1]*r+n[4]*i+n[7],e},qZ.transformMat4=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e},qZ.forEach=(WZ=qZ.create(),function(e,t,n,r,i,o){var a,s;for(t||(t=2),n||(n=0),s=r?Math.min(r*t+n,e.length):e.length,a=n;a<s;a+=t)WZ[0]=e[a],WZ[1]=e[a+1],i(WZ,WZ,o),e[a]=WZ[0],e[a+1]=WZ[1];return e});var KZ=function(e,t){e=e||0,t=t||0,this.array=qZ.fromValues(e,t),this._dirty=!0};if(KZ.prototype={constructor:KZ,add:function(e){return qZ.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t){return this.array[0]=e,this.array[1]=t,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this._dirty=!0,this},clone:function(){return new KZ(this.x,this.y)},copy:function(e){return qZ.copy(this.array,e.array),this._dirty=!0,this},cross:function(e,t){return qZ.cross(e.array,this.array,t.array),e._dirty=!0,this},dist:function(e){return qZ.dist(this.array,e.array)},distance:function(e){return qZ.distance(this.array,e.array)},div:function(e){return qZ.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return qZ.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return qZ.dot(this.array,e.array)},len:function(){return qZ.len(this.array)},length:function(){return qZ.length(this.array)},lerp:function(e,t,n){return qZ.lerp(this.array,e.array,t.array,n),this._dirty=!0,this},min:function(e){return qZ.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return qZ.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return qZ.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return qZ.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return qZ.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return qZ.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return qZ.random(this.array,e),this._dirty=!0,this},scale:function(e){return qZ.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return qZ.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return qZ.sqrDist(this.array,e.array)},squaredDistance:function(e){return qZ.squaredDistance(this.array,e.array)},sqrLen:function(){return qZ.sqrLen(this.array)},squaredLength:function(){return qZ.squaredLength(this.array)},sub:function(e){return qZ.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return qZ.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat2:function(e){return qZ.transformMat2(this.array,this.array,e.array),this._dirty=!0,this},transformMat2d:function(e){return qZ.transformMat2d(this.array,this.array,e.array),this._dirty=!0,this},transformMat3:function(e){return qZ.transformMat3(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return qZ.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},Object.defineProperty){var $Z=KZ.prototype;Object.defineProperty($Z,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),Object.defineProperty($Z,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}})}KZ.add=function(e,t,n){return qZ.add(e.array,t.array,n.array),e._dirty=!0,e},KZ.set=function(e,t,n){return qZ.set(e.array,t,n),e._dirty=!0,e},KZ.copy=function(e,t){return qZ.copy(e.array,t.array),e._dirty=!0,e},KZ.cross=function(e,t,n){return qZ.cross(e.array,t.array,n.array),e._dirty=!0,e},KZ.distance=KZ.dist=function(e,t){return qZ.distance(e.array,t.array)},KZ.div=function(e,t,n){return qZ.divide(e.array,t.array,n.array),e._dirty=!0,e},KZ.divide=KZ.div,KZ.dot=function(e,t){return qZ.dot(e.array,t.array)},KZ.len=function(e){return qZ.length(e.array)},KZ.lerp=function(e,t,n,r){return qZ.lerp(e.array,t.array,n.array,r),e._dirty=!0,e},KZ.min=function(e,t,n){return qZ.min(e.array,t.array,n.array),e._dirty=!0,e},KZ.max=function(e,t,n){return qZ.max(e.array,t.array,n.array),e._dirty=!0,e},KZ.mul=function(e,t,n){return qZ.multiply(e.array,t.array,n.array),e._dirty=!0,e},KZ.multiply=KZ.mul,KZ.negate=function(e,t){return qZ.negate(e.array,t.array),e._dirty=!0,e},KZ.normalize=function(e,t){return qZ.normalize(e.array,t.array),e._dirty=!0,e},KZ.random=function(e,t){return qZ.random(e.array,t),e._dirty=!0,e},KZ.scale=function(e,t,n){return qZ.scale(e.array,t.array,n),e._dirty=!0,e},KZ.scaleAndAdd=function(e,t,n,r){return qZ.scaleAndAdd(e.array,t.array,n.array,r),e._dirty=!0,e},KZ.squaredDistance=KZ.sqrDist=function(e,t){return qZ.sqrDist(e.array,t.array)},KZ.squaredLength=KZ.sqrLen=function(e){return qZ.sqrLen(e.array)},KZ.sub=function(e,t,n){return qZ.subtract(e.array,t.array,n.array),e._dirty=!0,e},KZ.subtract=KZ.sub,KZ.transformMat2=function(e,t,n){return qZ.transformMat2(e.array,t.array,n.array),e._dirty=!0,e},KZ.transformMat2d=function(e,t,n){return qZ.transformMat2d(e.array,t.array,n.array),e._dirty=!0,e},KZ.transformMat3=function(e,t,n){return qZ.transformMat3(e.array,t.array,n.array),e._dirty=!0,e},KZ.transformMat4=function(e,t,n){return qZ.transformMat4(e.array,t.array,n.array),e._dirty=!0,e};var JZ={};function QZ(e){for(var t=e.split("\n"),n=0,r=t.length;n<r;n++)t[n]=n+1+": "+t[n];return t.join("\n")}function eq(e,t,n){if(!e.getShaderParameter(t,e.COMPILE_STATUS))return[e.getShaderInfoLog(t),QZ(n)].join("\n")}var tq=new SZ.Float32Array(16),nq=wY.extend({uniformSemantics:{},attributes:{}},(function(){this._locations={},this._textureSlot=0,this._program=null}),{bind:function(e){this._textureSlot=0,e.gl.useProgram(this._program)},hasUniform:function(e){var t=this._locations[e];return null!=t},useTextureSlot:function(e,t,n){t&&(e.gl.activeTexture(e.gl.TEXTURE0+n),t.isRenderable()?t.bind(e):t.unbind(e))},currentTextureSlot:function(){return this._textureSlot},resetTextureSlot:function(e){this._textureSlot=e||0},takeCurrentTextureSlot:function(e,t){var n=this._textureSlot;return this.useTextureSlot(e,t,n),this._textureSlot++,n},setUniform:function(e,t,n,r){var i=this._locations[n];if(null==i)return!1;switch(t){case"m4":if(!(r instanceof Float32Array)){for(var o=0;o<r.length;o++)tq[o]=r[o];r=tq}e.uniformMatrix4fv(i,!1,r);break;case"2i":e.uniform2i(i,r[0],r[1]);break;case"2f":e.uniform2f(i,r[0],r[1]);break;case"3i":e.uniform3i(i,r[0],r[1],r[2]);break;case"3f":e.uniform3f(i,r[0],r[1],r[2]);break;case"4i":e.uniform4i(i,r[0],r[1],r[2],r[3]);break;case"4f":e.uniform4f(i,r[0],r[1],r[2],r[3]);break;case"1i":e.uniform1i(i,r);break;case"1f":e.uniform1f(i,r);break;case"1fv":e.uniform1fv(i,r);break;case"1iv":e.uniform1iv(i,r);break;case"2iv":e.uniform2iv(i,r);break;case"2fv":e.uniform2fv(i,r);break;case"3iv":e.uniform3iv(i,r);break;case"3fv":e.uniform3fv(i,r);break;case"4iv":e.uniform4iv(i,r);break;case"4fv":e.uniform4fv(i,r);break;case"m2":case"m2v":e.uniformMatrix2fv(i,!1,r);break;case"m3":case"m3v":e.uniformMatrix3fv(i,!1,r);break;case"m4v":if(Array.isArray(r)&&Array.isArray(r[0])){var a=new SZ.Float32Array(16*r.length),s=0;for(o=0;o<r.length;o++)for(var l=r[o],u=0;u<16;u++)a[s++]=l[u];e.uniformMatrix4fv(i,!1,a)}else e.uniformMatrix4fv(i,!1,r)}return!0},setUniformOfSemantic:function(e,t,n){var r=this.uniformSemantics[t];return!!r&&this.setUniform(e,r.type,r.symbol,n)},enableAttributes:function(e,t,n){var r,i=e.gl,o=this._program,a=this._locations;(r=n?n.__enabledAttributeList:JZ[e.__uid__])||(r=n?n.__enabledAttributeList=[]:JZ[e.__uid__]=[]);for(var s=[],l=0;l<t.length;l++){var u=t[l];if(this.attributes[u]){var c=a[u];if(null==c){if(-1===(c=i.getAttribLocation(o,u))){s[l]=-1;continue}a[u]=c}s[l]=c,r[c]?r[c]=2:r[c]=1}else s[l]=-1}for(l=0;l<r.length;l++)switch(r[l]){case 1:i.enableVertexAttribArray(l),r[l]=3;break;case 2:r[l]=3;break;case 3:i.disableVertexAttribArray(l),r[l]=0}return s},getAttribLocation:function(e,t){var n=this._locations,r=n[t];return null==r&&(r=e.getAttribLocation(this._program,t),n[t]=r),r},buildProgram:function(e,t,n,r){var i=e.createShader(e.VERTEX_SHADER),o=e.createProgram();e.shaderSource(i,n),e.compileShader(i);var a=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(a,r),e.compileShader(a);var s=eq(e,i,n);if(s)return s;if(s=eq(e,a,r))return s;if(e.attachShader(o,i),e.attachShader(o,a),t.attributeSemantics.POSITION)e.bindAttribLocation(o,0,t.attributeSemantics.POSITION.symbol);else{var l=Object.keys(this.attributes);e.bindAttribLocation(o,0,l[0])}if(e.linkProgram(o),e.deleteShader(i),e.deleteShader(a),this._program=o,this.vertexCode=n,this.fragmentCode=r,!e.getProgramParameter(o,e.LINK_STATUS))return"Could not link program\n"+e.getProgramInfoLog(o);for(var u=0;u<t.uniforms.length;u++){var c=t.uniforms[u];this._locations[c]=e.getUniformLocation(o,c)}}}),rq=/for\s*?\(int\s*?_idx_\s*\=\s*([\w-]+)\;\s*_idx_\s*<\s*([\w-]+);\s*_idx_\s*\+\+\s*\)\s*\{\{([\s\S]+?)(?=\}\})\}\}/g;function iq(e,t,n){var r={};for(var i in n)r[i+"_COUNT"]=n[i];return e.replace(rq,(function(e,n,i,o){var a="";isNaN(n)&&(n=n in t?t[n]:r[n]),isNaN(i)&&(i=i in t?t[i]:r[i]);for(var s=parseInt(n);s<parseInt(i);s++)a+="{"+o.replace(/float\s*\(\s*_idx_\s*\)/g,s.toFixed(1)).replace(/_idx_/g,s)+"}";return a}))}function oq(e,t,n){var r=[];if(t)for(var i in t){var o=t[i];o>0&&r.push("#define "+i.toUpperCase()+"_COUNT "+o)}if(n)for(var a=0;a<n.length;a++){var s=n[a];r.push("#define "+s.toUpperCase()+"_ENABLED")}for(var s in e){var l=e[s];null===l?r.push("#define "+s):r.push("#define "+s+" "+l.toString())}return r.join("\n")}function aq(e){this._renderer=e,this._cache={}}aq.prototype.getProgram=function(e,t,n){var r=this._cache,i=e.isSkinnedMesh&&e.isSkinnedMesh(),o=e.isInstancedMesh&&e.isInstancedMesh(),a="s"+t.shader.shaderID+"m"+t.getProgramKey();if(n&&(a+="se"+n.getProgramKey(e.lightGroup)),i&&(a+=",sk"+e.joints.length),o&&(a+=",is"),y=r[a])return y;var s=n?n.getLightsNumbers(e.lightGroup):{},l=this._renderer,u=l.gl,c=t.getEnabledTextures(),h="";if(i){var d={SKINNING:null,JOINT_COUNT:e.joints.length};e.joints.length>l.getMaxJointNumber()&&(d.USE_SKIN_MATRICES_TEXTURE=null),h+="\n"+oq(d)+"\n"}o&&(h+="\n#define INSTANCING\n");var p=h+oq(t.vertexDefines,s,c),f=h+oq(t.fragmentDefines,s,c),g=p+"\n"+t.shader.vertex,m=["OES_standard_derivatives","EXT_shader_texture_lod"].filter((function(e){return null!=l.getGLExtension(e)}));m.indexOf("EXT_shader_texture_lod")>=0&&(f+="\n#define SUPPORT_TEXTURE_LOD"),m.indexOf("OES_standard_derivatives")>=0&&(f+="\n#define SUPPORT_STANDARD_DERIVATIVES");var v,y,_=function(e){for(var t=[],n=0;n<e.length;n++)t.push("#extension GL_"+e[n]+" : enable");return t.join("\n")}(m)+"\n"+(["precision",v=t.precision,"float"].join(" ")+";\n"+["precision",v,"int"].join(" ")+";\n"+["precision",v,"sampler2D"].join(" ")+";\n\n")+f+"\n"+t.shader.fragment,x=iq(g,t.vertexDefines,s),b=iq(_,t.fragmentDefines,s);(y=new nq).uniformSemantics=t.shader.uniformSemantics,y.attributes=t.shader.attributes;var w=y.buildProgram(u,t.shader,x,b);return y.__error=w,r[a]=y,y};var sq=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g,lq=/attribute\s+(float|int|vec2|vec3|vec4)\s+([\s\S]*?);/g,uq=/#define\s+(\w+)?(\s+[\d-.]+)?\s*;?\s*\n/g,cq={bool:"1i",int:"1i",sampler2D:"t",samplerCube:"t",float:"1f",vec2:"2f",vec3:"3f",vec4:"4f",ivec2:"2i",ivec3:"3i",ivec4:"4i",mat2:"m2",mat3:"m3",mat4:"m4"};function hq(e){for(var t=[],n=0;n<e;n++)t[n]=0;return t}var dq={bool:function(){return!0},int:function(){return 0},float:function(){return 0},sampler2D:function(){return null},samplerCube:function(){return null},vec2:function(){return hq(2)},vec3:function(){return hq(3)},vec4:function(){return hq(4)},ivec2:function(){return hq(2)},ivec3:function(){return hq(3)},ivec4:function(){return hq(4)},mat2:function(){return hq(4)},mat3:function(){return hq(9)},mat4:function(){return hq(16)},array:function(){return[]}},pq=["POSITION","NORMAL","BINORMAL","TANGENT","TEXCOORD","TEXCOORD_0","TEXCOORD_1","COLOR","JOINT","WEIGHT"],fq=["SKIN_MATRIX","VIEWPORT_SIZE","VIEWPORT","DEVICEPIXELRATIO","WINDOW_SIZE","NEAR","FAR","TIME"],gq=["WORLD","VIEW","PROJECTION","WORLDVIEW","VIEWPROJECTION","WORLDVIEWPROJECTION","WORLDINVERSE","VIEWINVERSE","PROJECTIONINVERSE","WORLDVIEWINVERSE","VIEWPROJECTIONINVERSE","WORLDVIEWPROJECTIONINVERSE","WORLDTRANSPOSE","VIEWTRANSPOSE","PROJECTIONTRANSPOSE","WORLDVIEWTRANSPOSE","VIEWPROJECTIONTRANSPOSE","WORLDVIEWPROJECTIONTRANSPOSE","WORLDINVERSETRANSPOSE","VIEWINVERSETRANSPOSE","PROJECTIONINVERSETRANSPOSE","WORLDVIEWINVERSETRANSPOSE","VIEWPROJECTIONINVERSETRANSPOSE","WORLDVIEWPROJECTIONINVERSETRANSPOSE"],mq={vec4:4,vec3:3,vec2:2,float:1},vq={},yq={};function _q(e){return e.replace(/[ \t]*\/\/.*\n/g,"").replace(/[ \t]*\/\*[\s\S]*?\*\//g,"")}function xq(){console.error("Wrong uniform/attributes syntax")}function bq(e,t){for(var n=/[,=\(\):]/,r=t.replace(/:\s*\[\s*(.*)\s*\]/g,"="+e+"($1)").replace(/\s+/g,"").split(/(?=[,=\(\):])/g),i=[],o=0;o<r.length;o++)r[o].match(n)?i.push(r[o].charAt(0),r[o].slice(1)):i.push(r[o]);var a,s=0,l={},u=null;function c(e){e||xq();var t=e.match(/\[(.*?)\]/);a=e.replace(/\[(.*?)\]/,""),l[a]={},t&&(l[a].isArray=!0,l[a].arraySize=t[1])}c((r=i)[0]);for(o=1;o<r.length;o++){var h=r[o];if(h)if("="!==h)if(":"!==h)if(","!==h)if(")"!==h)if("("!==h)if(h.indexOf("vec")>=0){if(1!==s&&4!==s){xq();break}s=2,u=[]}else if(1!==s)if(4!==s)c(h),s=0;else{var d=h;pq.indexOf(d)>=0||fq.indexOf(d)>=0||gq.indexOf(d)>=0?l[a].semantic=d:"ignore"===d||"unconfigurable"===d?l[a].ignore=!0:l[a].value="bool"===e?"true"===d:parseFloat(d)}else l[a].value="bool"===e?"true"===h:parseFloat(h),u=null;else{if(2!==s){xq();break}if(!(u instanceof Array)){xq();break}u.push(+r[++o])}else l[a].value=new SZ.Float32Array(u),u=null,s=5;else if(2===s){if(!(u instanceof Array)){xq();break}u.push(+r[++o])}else s=5;else s=4;else{if(0!==s&&3!==s){xq();break}s=1}}return l}function wq(e,t){"object"==typeof e&&(t=e.fragment,e=e.vertex),e=_q(e),t=_q(t),this._shaderID=function(e,t){var n="vertex:"+e+"fragment:"+t;if(vq[n])return vq[n];var r=bY.genGUID();return vq[n]=r,yq[r]={vertex:e,fragment:t},r}(e,t),this._vertexCode=wq.parseImport(e),this._fragmentCode=wq.parseImport(t),this.attributeSemantics={},this.matrixSemantics={},this.uniformSemantics={},this.matrixSemanticKeys=[],this.uniformTemplates={},this.attributes={},this.textures={},this.vertexDefines={},this.fragmentDefines={},this._parseAttributes(),this._parseUniforms(),this._parseDefines()}wq.prototype={constructor:wq,createUniforms:function(){var e={};for(var t in this.uniformTemplates){var n=this.uniformTemplates[t];e[t]={type:n.type,value:n.value()}}return e},_parseImport:function(){this._vertexCode=wq.parseImport(this.vertex),this._fragmentCode=wq.parseImport(this.fragment)},_addSemanticUniform:function(e,t,n){if(pq.indexOf(n)>=0)this.attributeSemantics[n]={symbol:e,type:t};else if(gq.indexOf(n)>=0){var r=!1,i=n;n.match(/TRANSPOSE$/)&&(r=!0,i=n.slice(0,-9)),this.matrixSemantics[n]={symbol:e,type:t,isTranspose:r,semanticNoTranspose:i}}else fq.indexOf(n)>=0&&(this.uniformSemantics[n]={symbol:e,type:t})},_addMaterialUniform:function(e,t,n,r,i,o){o[e]={type:n,value:i?dq.array:r||dq[t],semantic:null}},_parseUniforms:function(){var e={},t=this,n="vertex";function r(e){return null!=e?function(){return e}:null}function i(i,o,a){var s=bq(o,a),l=[];for(var u in s){var c=s[u],h=c.semantic,d=u,p=cq[o],f=r(s[u].value);s[u].isArray&&(d+="["+s[u].arraySize+"]",p+="v"),l.push(d),t._uniformList.push(u),c.ignore||("sampler2D"!==o&&"samplerCube"!==o||(t.textures[u]={shaderType:n,type:o}),h?t._addSemanticUniform(u,p,h):t._addMaterialUniform(u,o,p,f,s[u].isArray,e))}return l.length>0?"uniform "+o+" "+l.join(",")+";\n":""}this._uniformList=[],this._vertexCode=this._vertexCode.replace(sq,i),n="fragment",this._fragmentCode=this._fragmentCode.replace(sq,i),t.matrixSemanticKeys=Object.keys(this.matrixSemantics),this.uniformTemplates=e},_parseAttributes:function(){var e={},t=this;this._vertexCode=this._vertexCode.replace(lq,(function(n,r,i){var o=bq(r,i),a=mq[r]||1,s=[];for(var l in o){var u=o[l].semantic;if(e[l]={type:"float",size:a,semantic:u||null},u){if(pq.indexOf(u)<0)throw new Error('Unkown semantic "'+u+'"');t.attributeSemantics[u]={symbol:l,type:r}}s.push(l)}return"attribute "+r+" "+s.join(",")+";\n"})),this.attributes=e},_parseDefines:function(){var e=this,t="vertex";function n(n,r,i){var o="vertex"===t?e.vertexDefines:e.fragmentDefines;return o[r]||(o[r]="false"!==i&&("true"===i||(i?isNaN(parseFloat(i))?i.trim():parseFloat(i):null))),""}this._vertexCode=this._vertexCode.replace(uq,n),t="fragment",this._fragmentCode=this._fragmentCode.replace(uq,n)},clone:function(){var e=yq[this._shaderID];return new wq(e.vertex,e.fragment)}},Object.defineProperty&&(Object.defineProperty(wq.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(wq.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(wq.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(wq.prototype,"uniforms",{get:function(){return this._uniformList}}));var Sq=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;wq.parseImport=function(e){return e=e.replace(Sq,(function(e,t,n){return(e=wq.source(n))?wq.parseImport(e):(console.error('Shader chunk "'+n+'" not existed in library'),"")}))};var Tq=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;wq.import=function(e){e.replace(Tq,(function(e,t,n,r){if(r=r.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"")){for(var i,o=n.split("."),a=wq.codes,s=0;s<o.length-1;)a[i=o[s++]]||(a[i]={}),a=a[i];a[i=o[s]]=r}return r}))},wq.codes={},wq.source=function(e){for(var t=e.split("."),n=wq.codes,r=0;n&&r<t.length;){n=n[t[r++]]}return"string"!=typeof n?(console.error('Shader "'+e+'" not existed in library'),""):n};var Mq="@export clay.prez.vertex\nuniform mat4 WVP : WORLDVIEWPROJECTION;\nattribute vec3 pos : POSITION;\nattribute vec2 uv : TEXCOORD_0;\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\n@import clay.chunk.skinning_header\n@import clay.chunk.instancing_header\nvarying vec2 v_Texcoord;\nvoid main()\n{\n vec4 P = vec4(pos, 1.0);\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = skinMatrixWS * P;\n#endif\n#ifdef INSTANCING\n @import clay.chunk.instancing_matrix\n P = instanceMat * P;\n#endif\n gl_Position = WVP * P;\n v_Texcoord = uv * uvRepeat + uvOffset;\n}\n@end\n@export clay.prez.fragment\nuniform sampler2D alphaMap;\nuniform float alphaCutoff: 0.0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n if (alphaCutoff > 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n gl_FragColor = vec4(0.0,0.0,0.0,1.0);\n}\n@end",Cq={create:function(){var e=new YZ(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},clone:function(e){var t=new YZ(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},transpose:function(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},invert:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],p=t[11],f=t[12],g=t[13],m=t[14],v=t[15],y=n*s-r*a,_=n*l-i*a,x=n*u-o*a,b=r*l-i*s,w=r*u-o*s,S=i*u-o*l,T=c*g-h*f,M=c*m-d*f,C=c*v-p*f,D=h*m-d*g,A=h*v-p*g,I=d*v-p*m,E=y*I-_*A+x*D+b*C-w*M+S*T;return E?(E=1/E,e[0]=(s*I-l*A+u*D)*E,e[1]=(i*A-r*I-o*D)*E,e[2]=(g*S-m*w+v*b)*E,e[3]=(d*w-h*S-p*b)*E,e[4]=(l*C-a*I-u*M)*E,e[5]=(n*I-i*C+o*M)*E,e[6]=(m*x-f*S-v*_)*E,e[7]=(c*S-d*x+p*_)*E,e[8]=(a*A-s*C+u*T)*E,e[9]=(r*C-n*A-o*T)*E,e[10]=(f*w-g*x+v*y)*E,e[11]=(h*x-c*w-p*y)*E,e[12]=(s*M-a*D-l*T)*E,e[13]=(n*D-r*M+i*T)*E,e[14]=(g*_-f*b-m*y)*E,e[15]=(c*b-h*_+d*y)*E,e):null},adjoint:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],p=t[11],f=t[12],g=t[13],m=t[14],v=t[15];return e[0]=s*(d*v-p*m)-h*(l*v-u*m)+g*(l*p-u*d),e[1]=-(r*(d*v-p*m)-h*(i*v-o*m)+g*(i*p-o*d)),e[2]=r*(l*v-u*m)-s*(i*v-o*m)+g*(i*u-o*l),e[3]=-(r*(l*p-u*d)-s*(i*p-o*d)+h*(i*u-o*l)),e[4]=-(a*(d*v-p*m)-c*(l*v-u*m)+f*(l*p-u*d)),e[5]=n*(d*v-p*m)-c*(i*v-o*m)+f*(i*p-o*d),e[6]=-(n*(l*v-u*m)-a*(i*v-o*m)+f*(i*u-o*l)),e[7]=n*(l*p-u*d)-a*(i*p-o*d)+c*(i*u-o*l),e[8]=a*(h*v-p*g)-c*(s*v-u*g)+f*(s*p-u*h),e[9]=-(n*(h*v-p*g)-c*(r*v-o*g)+f*(r*p-o*h)),e[10]=n*(s*v-u*g)-a*(r*v-o*g)+f*(r*u-o*s),e[11]=-(n*(s*p-u*h)-a*(r*p-o*h)+c*(r*u-o*s)),e[12]=-(a*(h*m-d*g)-c*(s*m-l*g)+f*(s*d-l*h)),e[13]=n*(h*m-d*g)-c*(r*m-i*g)+f*(r*d-i*h),e[14]=-(n*(s*m-l*g)-a*(r*m-i*g)+f*(r*l-i*s)),e[15]=n*(s*d-l*h)-a*(r*d-i*h)+c*(r*l-i*s),e},determinant:function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=e[11],p=e[12],f=e[13],g=e[14],m=e[15];return(t*a-n*o)*(h*m-d*g)-(t*s-r*o)*(c*m-d*f)+(t*l-i*o)*(c*g-h*f)+(n*s-r*a)*(u*m-d*p)-(n*l-i*a)*(u*g-h*p)+(r*l-i*s)*(u*f-c*p)},multiply:function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],p=t[10],f=t[11],g=t[12],m=t[13],v=t[14],y=t[15],_=n[0],x=n[1],b=n[2],w=n[3];return e[0]=_*r+x*s+b*h+w*g,e[1]=_*i+x*l+b*d+w*m,e[2]=_*o+x*u+b*p+w*v,e[3]=_*a+x*c+b*f+w*y,_=n[4],x=n[5],b=n[6],w=n[7],e[4]=_*r+x*s+b*h+w*g,e[5]=_*i+x*l+b*d+w*m,e[6]=_*o+x*u+b*p+w*v,e[7]=_*a+x*c+b*f+w*y,_=n[8],x=n[9],b=n[10],w=n[11],e[8]=_*r+x*s+b*h+w*g,e[9]=_*i+x*l+b*d+w*m,e[10]=_*o+x*u+b*p+w*v,e[11]=_*a+x*c+b*f+w*y,_=n[12],x=n[13],b=n[14],w=n[15],e[12]=_*r+x*s+b*h+w*g,e[13]=_*i+x*l+b*d+w*m,e[14]=_*o+x*u+b*p+w*v,e[15]=_*a+x*c+b*f+w*y,e},multiplyAffine:function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[4],s=t[5],l=t[6],u=t[8],c=t[9],h=t[10],d=t[12],p=t[13],f=t[14],g=n[0],m=n[1],v=n[2];return e[0]=g*r+m*a+v*u,e[1]=g*i+m*s+v*c,e[2]=g*o+m*l+v*h,g=n[4],m=n[5],v=n[6],e[4]=g*r+m*a+v*u,e[5]=g*i+m*s+v*c,e[6]=g*o+m*l+v*h,g=n[8],m=n[9],v=n[10],e[8]=g*r+m*a+v*u,e[9]=g*i+m*s+v*c,e[10]=g*o+m*l+v*h,g=n[12],m=n[13],v=n[14],e[12]=g*r+m*a+v*u+d,e[13]=g*i+m*s+v*c+p,e[14]=g*o+m*l+v*h+f,e}};Cq.mul=Cq.multiply,Cq.mulAffine=Cq.multiplyAffine,Cq.translate=function(e,t,n){var r,i,o,a,s,l,u,c,h,d,p,f,g=n[0],m=n[1],v=n[2];return t===e?(e[12]=t[0]*g+t[4]*m+t[8]*v+t[12],e[13]=t[1]*g+t[5]*m+t[9]*v+t[13],e[14]=t[2]*g+t[6]*m+t[10]*v+t[14],e[15]=t[3]*g+t[7]*m+t[11]*v+t[15]):(r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],p=t[10],f=t[11],e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=u,e[7]=c,e[8]=h,e[9]=d,e[10]=p,e[11]=f,e[12]=r*g+s*m+h*v+t[12],e[13]=i*g+l*m+d*v+t[13],e[14]=o*g+u*m+p*v+t[14],e[15]=a*g+c*m+f*v+t[15]),e},Cq.scale=function(e,t,n){var r=n[0],i=n[1],o=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},Cq.rotate=function(e,t,n,r){var i,o,a,s,l,u,c,h,d,p,f,g,m,v,y,_,x,b,w,S,T,M,C,D,A=r[0],I=r[1],E=r[2],L=Math.sqrt(A*A+I*I+E*E);return Math.abs(L)<XZ?null:(A*=L=1/L,I*=L,E*=L,i=Math.sin(n),a=1-(o=Math.cos(n)),s=t[0],l=t[1],u=t[2],c=t[3],h=t[4],d=t[5],p=t[6],f=t[7],g=t[8],m=t[9],v=t[10],y=t[11],_=A*A*a+o,x=I*A*a+E*i,b=E*A*a-I*i,w=A*I*a-E*i,S=I*I*a+o,T=E*I*a+A*i,M=A*E*a+I*i,C=I*E*a-A*i,D=E*E*a+o,e[0]=s*_+h*x+g*b,e[1]=l*_+d*x+m*b,e[2]=u*_+p*x+v*b,e[3]=c*_+f*x+y*b,e[4]=s*w+h*S+g*T,e[5]=l*w+d*S+m*T,e[6]=u*w+p*S+v*T,e[7]=c*w+f*S+y*T,e[8]=s*M+h*C+g*D,e[9]=l*M+d*C+m*D,e[10]=u*M+p*C+v*D,e[11]=c*M+f*C+y*D,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)},Cq.rotateX=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[4],a=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+u*r,e[5]=a*i+c*r,e[6]=s*i+h*r,e[7]=l*i+d*r,e[8]=u*i-o*r,e[9]=c*i-a*r,e[10]=h*i-s*r,e[11]=d*i-l*r,e},Cq.rotateY=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],l=t[3],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-u*r,e[1]=a*i-c*r,e[2]=s*i-h*r,e[3]=l*i-d*r,e[8]=o*r+u*i,e[9]=a*r+c*i,e[10]=s*r+h*i,e[11]=l*r+d*i,e},Cq.rotateZ=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],l=t[3],u=t[4],c=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+u*r,e[1]=a*i+c*r,e[2]=s*i+h*r,e[3]=l*i+d*r,e[4]=u*i-o*r,e[5]=c*i-a*r,e[6]=h*i-s*r,e[7]=d*i-l*r,e},Cq.fromRotationTranslation=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=r+r,l=i+i,u=o+o,c=r*s,h=r*l,d=r*u,p=i*l,f=i*u,g=o*u,m=a*s,v=a*l,y=a*u;return e[0]=1-(p+g),e[1]=h+y,e[2]=d-v,e[3]=0,e[4]=h-y,e[5]=1-(c+g),e[6]=f+m,e[7]=0,e[8]=d+v,e[9]=f-m,e[10]=1-(c+p),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e},Cq.fromQuat=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n+n,s=r+r,l=i+i,u=n*a,c=r*a,h=r*s,d=i*a,p=i*s,f=i*l,g=o*a,m=o*s,v=o*l;return e[0]=1-h-f,e[1]=c+v,e[2]=d-m,e[3]=0,e[4]=c-v,e[5]=1-u-f,e[6]=p+g,e[7]=0,e[8]=d+m,e[9]=p-g,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},Cq.frustum=function(e,t,n,r,i,o,a){var s=1/(n-t),l=1/(i-r),u=1/(o-a);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(i+r)*l,e[10]=(a+o)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=a*o*2*u,e[15]=0,e},Cq.perspective=function(e,t,n,r,i){var o=1/Math.tan(t/2),a=1/(r-i);return e[0]=o/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(i+r)*a,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*r*a,e[15]=0,e},Cq.ortho=function(e,t,n,r,i,o,a){var s=1/(t-n),l=1/(r-i),u=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*l,e[14]=(a+o)*u,e[15]=1,e},Cq.lookAt=function(e,t,n,r){var i,o,a,s,l,u,c,h,d,p,f=t[0],g=t[1],m=t[2],v=r[0],y=r[1],_=r[2],x=n[0],b=n[1],w=n[2];return Math.abs(f-x)<XZ&&Math.abs(g-b)<XZ&&Math.abs(m-w)<XZ?Cq.identity(e):(c=f-x,h=g-b,d=m-w,i=y*(d*=p=1/Math.sqrt(c*c+h*h+d*d))-_*(h*=p),o=_*(c*=p)-v*d,a=v*h-y*c,(p=Math.sqrt(i*i+o*o+a*a))?(i*=p=1/p,o*=p,a*=p):(i=0,o=0,a=0),s=h*a-d*o,l=d*i-c*a,u=c*o-h*i,(p=Math.sqrt(s*s+l*l+u*u))?(s*=p=1/p,l*=p,u*=p):(s=0,l=0,u=0),e[0]=i,e[1]=s,e[2]=c,e[3]=0,e[4]=o,e[5]=l,e[6]=h,e[7]=0,e[8]=a,e[9]=u,e[10]=d,e[11]=0,e[12]=-(i*f+o*g+a*m),e[13]=-(s*f+l*g+u*m),e[14]=-(c*f+h*g+d*m),e[15]=1,e)},Cq.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+Math.pow(e[6],2)+Math.pow(e[7],2)+Math.pow(e[8],2)+Math.pow(e[9],2)+Math.pow(e[10],2)+Math.pow(e[11],2)+Math.pow(e[12],2)+Math.pow(e[13],2)+Math.pow(e[14],2)+Math.pow(e[15],2))};var Dq={create:function(){var e=new YZ(3);return e[0]=0,e[1]=0,e[2]=0,e},clone:function(e){var t=new YZ(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},fromValues:function(e,t,n){var r=new YZ(3);return r[0]=e,r[1]=t,r[2]=n,r},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},set:function(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e},subtract:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}};Dq.sub=Dq.subtract,Dq.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e},Dq.mul=Dq.multiply,Dq.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e},Dq.div=Dq.divide,Dq.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e},Dq.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e},Dq.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e},Dq.scaleAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e},Dq.distance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(n*n+r*r+i*i)},Dq.dist=Dq.distance,Dq.squaredDistance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return n*n+r*r+i*i},Dq.sqrDist=Dq.squaredDistance,Dq.length=function(e){var t=e[0],n=e[1],r=e[2];return Math.sqrt(t*t+n*n+r*r)},Dq.len=Dq.length,Dq.squaredLength=function(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r},Dq.sqrLen=Dq.squaredLength,Dq.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},Dq.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e},Dq.normalize=function(e,t){var n=t[0],r=t[1],i=t[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o),e},Dq.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},Dq.cross=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],l=n[2];return e[0]=i*l-o*s,e[1]=o*a-r*l,e[2]=r*s-i*a,e},Dq.lerp=function(e,t,n,r){var i=t[0],o=t[1],a=t[2];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e[2]=a+r*(n[2]-a),e},Dq.random=function(e,t){t=t||1;var n=2*ZZ()*Math.PI,r=2*ZZ()-1,i=Math.sqrt(1-r*r)*t;return e[0]=Math.cos(n)*i,e[1]=Math.sin(n)*i,e[2]=r*t,e},Dq.transformMat4=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,e[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,e[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,e[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,e},Dq.transformMat3=function(e,t,n){var r=t[0],i=t[1],o=t[2];return e[0]=r*n[0]+i*n[3]+o*n[6],e[1]=r*n[1]+i*n[4]+o*n[7],e[2]=r*n[2]+i*n[5]+o*n[8],e},Dq.transformQuat=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],l=n[2],u=n[3],c=u*r+s*o-l*i,h=u*i+l*r-a*o,d=u*o+a*i-s*r,p=-a*r-s*i-l*o;return e[0]=c*u+p*-a+h*-l-d*-s,e[1]=h*u+p*-s+d*-a-c*-l,e[2]=d*u+p*-l+c*-s-h*-a,e},Dq.rotateX=function(e,t,n,r){var i=[],o=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e},Dq.rotateY=function(e,t,n,r){var i=[],o=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e},Dq.rotateZ=function(e,t,n,r){var i=[],o=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e},Dq.forEach=function(){var e=Dq.create();return function(t,n,r,i,o,a){var s,l;for(n||(n=3),r||(r=0),l=i?Math.min(i*n+r,t.length):t.length,s=r;s<l;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],o(e,e,a),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}}(),Dq.angle=function(e,t){var n=Dq.fromValues(e[0],e[1],e[2]),r=Dq.fromValues(t[0],t[1],t[2]);Dq.normalize(n,n),Dq.normalize(r,r);var i=Dq.dot(n,r);return i>1?0:Math.acos(i)},wq.import(Mq);var Aq=Cq.create,Iq={};function Eq(e){return e.material}function Lq(e,t,n){return t.uniforms[n].value}function Nq(e,t,n,r){return n!==r}function Pq(e){return!0}function Oq(){}var Rq={float:KY,byte:WY,ubyte:jY,short:XY,ushort:YY};function kq(e,t,n){this.availableAttributes=e,this.availableAttributeSymbols=t,this.indicesBuffer=n,this.vao=null}function zq(e){var t,n;this.bind=function(e){t||((t=SZ.createCanvas()).width=t.height=1,t.getContext("2d"));var r=e.gl,i=!n;i&&(n=r.createTexture()),r.bindTexture(r.TEXTURE_2D,n),i&&r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t)},this.unbind=function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},this.isRenderable=function(){return!0}}var Vq=wY.extend((function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,clearColor:[0,0,0,0],clearBit:17664,alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,throwError:!0,gl:null,viewport:{},maxJointNumber:20,__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}}),(function(){this.canvas||(this.canvas=SZ.createCanvas());var e=this.canvas;try{var t={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer};if(this.gl=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!this.gl)throw new Error;this._glinfo=new MY(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),this.gl.targetRenderer=this,this.resize()}catch(e){throw"Error creating WebGL Context "+e}this._programMgr=new aq(this),this._placeholderTexture=new zq}),{resize:function(e,t){var n=this.canvas,r=this.devicePixelRatio;null!=e?(n.style&&(n.style.width=e+"px",n.style.height=t+"px"),n.width=e*r,n.height=t*r,this._width=e,this._height=t):(this._width=n.width/r,this._height=n.height/r),this.setViewport(0,0,this._width,this._height)},getWidth:function(){return this._width},getHeight:function(){return this._height},getViewportAspect:function(){var e=this.viewport;return e.width/e.height},setDevicePixelRatio:function(e){this.devicePixelRatio=e,this.resize(this._width,this._height)},getDevicePixelRatio:function(){return this.devicePixelRatio},getGLExtension:function(e){return this._glinfo.getExtension(e)},getGLParameter:function(e){return this._glinfo.getParameter(e)},setViewport:function(e,t,n,r,i){if("object"==typeof e){var o=e;e=o.x,t=o.y,n=o.width,r=o.height,i=o.devicePixelRatio}i=i||this.devicePixelRatio,this.gl.viewport(e*i,t*i,n*i,r*i),this.viewport={x:e,y:t,width:n,height:r,devicePixelRatio:i}},saveViewport:function(){this._viewportStack.push(this.viewport)},restoreViewport:function(){this._viewportStack.length>0&&this.setViewport(this._viewportStack.pop())},saveClear:function(){this._clearStack.push({clearBit:this.clearBit,clearColor:this.clearColor})},restoreClear:function(){if(this._clearStack.length>0){var e=this._clearStack.pop();this.clearColor=e.clearColor,this.clearBit=e.clearBit}},bindSceneRendering:function(e){this._sceneRendering=e},render:function(e,t,n,r){var i=this.gl,o=this.clearColor;if(this.clearBit){i.colorMask(!0,!0,!0,!0),i.depthMask(!0);var a=this.viewport,s=!1,l=a.devicePixelRatio;(a.width!==this._width||a.height!==this._height||l&&l!==this.devicePixelRatio||a.x||a.y)&&(s=!0,i.enable(i.SCISSOR_TEST),i.scissor(a.x*l,a.y*l,a.width*l,a.height*l)),i.clearColor(o[0],o[1],o[2],o[3]),i.clear(this.clearBit),s&&i.disable(i.SCISSOR_TEST)}if(n||e.update(!1),e.updateLights(),t=t||e.getMainCamera()){t.update();var u=e.updateRenderList(t,!0);this._sceneRendering=e;var c=u.opaque,h=u.transparent,d=e.material;e.trigger("beforerender",this,e,t,u),r?(this.renderPreZ(c,e,t),i.depthFunc(i.LEQUAL)):i.depthFunc(i.LESS);for(var p=Aq(),f=Dq.create(),g=0;g<h.length;g++){var m=h[g];Cq.multiplyAffine(p,t.viewMatrix.array,m.worldTransform.array),Dq.transformMat4(f,m.position.array,p),m.__depth=f[2]}this.renderPass(c,t,{getMaterial:function(e){return d||e.material},sortCompare:this.opaqueSortCompare}),this.renderPass(h,t,{getMaterial:function(e){return d||e.material},sortCompare:this.transparentSortCompare}),e.trigger("afterrender",this,e,t,u),this._sceneRendering=null}else console.error("Can't find camera in the scene.")},getProgram:function(e,t,n){return t=t||e.material,this._programMgr.getProgram(e,t,n)},validateProgram:function(e){if(e.__error){var t=e.__error;if(Iq[e.__uid__])return;if(Iq[e.__uid__]=!0,this.throwError)throw new Error(t);this.trigger("error",t)}},updatePrograms:function(e,t,n){var r=n&&n.getMaterial||Eq;t=t||null;for(var i=0;i<e.length;i++){var o=e[i],a=r.call(this,o);if(i>0){var s=e[i-1],l=s.joints?s.joints.length:0;if((o.joints?o.joints.length:0)===l&&o.material===s.material&&o.lightGroup===s.lightGroup){o.__program=s.__program;continue}}var u=this._programMgr.getProgram(o,a,t);this.validateProgram(u),o.__program=u}},renderPass:function(e,t,n){this.trigger("beforerenderpass",this,e,t,n),(n=n||{}).getMaterial=n.getMaterial||Eq,n.getUniform=n.getUniform||Lq,n.isMaterialChanged=n.isMaterialChanged||Nq,n.beforeRender=n.beforeRender||Oq,n.afterRender=n.afterRender||Oq;var r=n.ifRender||Pq;this.updatePrograms(e,this._sceneRendering,n),n.sortCompare&&e.sort(n.sortCompare);var i=this.viewport,o=i.devicePixelRatio,a=[i.x*o,i.y*o,i.width*o,i.height*o],s=this.devicePixelRatio,l=this.__currentFrameBuffer?[this.__currentFrameBuffer.getTextureWidth(),this.__currentFrameBuffer.getTextureHeight()]:[this._width*s,this._height*s],u=[a[2],a[3]],c=Date.now();t?(Cq.copy(Bq.VIEW,t.viewMatrix.array),Cq.copy(Bq.PROJECTION,t.projectionMatrix.array),Cq.copy(Bq.VIEWINVERSE,t.worldTransform.array)):(Cq.identity(Bq.VIEW),Cq.identity(Bq.PROJECTION),Cq.identity(Bq.VIEWINVERSE)),Cq.multiply(Bq.VIEWPROJECTION,Bq.PROJECTION,Bq.VIEW),Cq.invert(Bq.PROJECTIONINVERSE,Bq.PROJECTION),Cq.invert(Bq.VIEWPROJECTIONINVERSE,Bq.VIEWPROJECTION);for(var h,d,p,f,g,m,v,y,_,x,b,w,S=this.gl,T=this._sceneRendering,M=null,C=0;C<e.length;C++){var D,A=e[C],I=null!=A.worldTransform;if(r(A)){I&&(D=A.isSkinnedMesh&&A.isSkinnedMesh()?A.offsetMatrix?A.offsetMatrix.array:Bq.IDENTITY:A.worldTransform.array);var E=A.geometry,L=n.getMaterial.call(this,A),N=A.__program,P=L.shader,O=E.__uid__+"-"+N.__uid__,R=O!==x;x=O,I&&(Cq.copy(Bq.WORLD,D),Cq.multiply(Bq.WORLDVIEWPROJECTION,Bq.VIEWPROJECTION,D),Cq.multiplyAffine(Bq.WORLDVIEW,Bq.VIEW,D),(P.matrixSemantics.WORLDINVERSE||P.matrixSemantics.WORLDINVERSETRANSPOSE)&&Cq.invert(Bq.WORLDINVERSE,D),(P.matrixSemantics.WORLDVIEWINVERSE||P.matrixSemantics.WORLDVIEWINVERSETRANSPOSE)&&Cq.invert(Bq.WORLDVIEWINVERSE,Bq.WORLDVIEW),(P.matrixSemantics.WORLDVIEWPROJECTIONINVERSE||P.matrixSemantics.WORLDVIEWPROJECTIONINVERSETRANSPOSE)&&Cq.invert(Bq.WORLDVIEWPROJECTIONINVERSE,Bq.WORLDVIEWPROJECTION)),A.beforeRender&&A.beforeRender(this),n.beforeRender.call(this,A,L,h);var k=N!==d;k?(N.bind(this),N.setUniformOfSemantic(S,"VIEWPORT",a),N.setUniformOfSemantic(S,"WINDOW_SIZE",l),t&&(N.setUniformOfSemantic(S,"NEAR",t.near),N.setUniformOfSemantic(S,"FAR",t.far)),N.setUniformOfSemantic(S,"DEVICEPIXELRATIO",o),N.setUniformOfSemantic(S,"TIME",c),N.setUniformOfSemantic(S,"VIEWPORT_SIZE",u),T&&T.setLightUniforms(N,A.lightGroup,this)):N=d,(k||n.isMaterialChanged(A,p,L,h))&&(L.depthTest!==f&&(L.depthTest?S.enable(S.DEPTH_TEST):S.disable(S.DEPTH_TEST),f=L.depthTest),L.depthMask!==g&&(S.depthMask(L.depthMask),g=L.depthMask),L.transparent!==_&&(L.transparent?S.enable(S.BLEND):S.disable(S.BLEND),_=L.transparent),L.transparent&&(L.blend?L.blend(S):(S.blendEquationSeparate(S.FUNC_ADD,S.FUNC_ADD),S.blendFuncSeparate(S.SRC_ALPHA,S.ONE_MINUS_SRC_ALPHA,S.ONE,S.ONE_MINUS_SRC_ALPHA))),w=this._bindMaterial(A,L,N,p||null,h||null,d||null,n.getUniform),h=L);var z=P.matrixSemanticKeys;if(I)for(var V=0;V<z.length;V++){var B=z[V],F=P.matrixSemantics[B],G=Bq[B];if(F.isTranspose){var H=Bq[F.semanticNoTranspose];Cq.transpose(G,H)}N.setUniform(S,F.type,F.symbol,G)}A.cullFace!==v&&(v=A.cullFace,S.cullFace(v)),A.frontFace!==y&&(y=A.frontFace,S.frontFace(y)),A.culling!==m&&((m=A.culling)?S.enable(S.CULL_FACE):S.disable(S.CULL_FACE)),this._updateSkeleton(A,N,w),R&&(b=this._bindVAO(M,P,E,N)),this._renderObject(A,b,N),n.afterRender(this,A),A.afterRender&&A.afterRender(this),d=N,p=A}}this.trigger("afterrenderpass",this,e,t,n)},getMaxJointNumber:function(){return this.maxJointNumber},_updateSkeleton:function(e,t,n){var r=this.gl,i=e.skeleton;if(i)if(i.update(),e.joints.length>this.getMaxJointNumber()){var o=i.getSubSkinMatricesTexture(e.__uid__,e.joints);t.useTextureSlot(this,o,n),t.setUniform(r,"1i","skinMatricesTexture",n),t.setUniform(r,"1f","skinMatricesTextureSize",o.width)}else{var a=i.getSubSkinMatrices(e.__uid__,e.joints);t.setUniformOfSemantic(r,"SKIN_MATRIX",a)}},_renderObject:function(e,t,n){var r=this.gl,i=e.geometry,o=e.mode;null==o&&(o=4);var a=null,s=e.isInstancedMesh&&e.isInstancedMesh();if(!s||(a=this.getGLExtension("ANGLE_instanced_arrays"))){var l;if(s&&(l=this._bindInstancedAttributes(e,n,a)),t.indicesBuffer){var u=this.getGLExtension("OES_element_index_uint")&&i.indices instanceof Uint32Array?r.UNSIGNED_INT:r.UNSIGNED_SHORT;s?a.drawElementsInstancedANGLE(o,t.indicesBuffer.count,u,0,e.getInstanceCount()):r.drawElements(o,t.indicesBuffer.count,u,0)}else s?a.drawArraysInstancedANGLE(o,0,i.vertexCount,e.getInstanceCount()):r.drawArrays(o,0,i.vertexCount);if(s)for(var c=0;c<l.length;c++)r.disableVertexAttribArray(l[c])}else console.warn("Device not support ANGLE_instanced_arrays extension")},_bindInstancedAttributes:function(e,t,n){for(var r=this.gl,i=e.getInstancedAttributesBuffers(this),o=[],a=0;a<i.length;a++){var s=i[a],l=t.getAttribLocation(r,s.symbol);if(!(l<0)){var u=Rq[s.type]||r.FLOAT;r.enableVertexAttribArray(l),r.bindBuffer(r.ARRAY_BUFFER,s.buffer),r.vertexAttribPointer(l,s.size,u,!1,0,0),n.vertexAttribDivisorANGLE(l,s.divisor),o.push(l)}}return o},_bindMaterial:function(e,t,n,r,i,o,a){for(var s=this.gl,l=o===n,u=n.currentTextureSlot(),c=t.getEnabledUniforms(),h=t.getTextureUniforms(),d=this._placeholderTexture,p=0;p<h.length;p++){var f=a(e,t,v=h[p]);if("t"===(m=t.uniforms[v].type)&&f)f.__slot=-1;else if("tv"===m)for(var g=0;g<f.length;g++)f[g]&&(f[g].__slot=-1)}d.__slot=-1;for(p=0;p<c.length;p++){var m,v=c[p],y=t.uniforms[v],_=(f=a(e,t,v),"t"===(m=y.type));if(_&&(f&&f.isRenderable()||(f=d)),i&&l){var x=a(r,i,v);if(_&&(x&&x.isRenderable()||(x=d)),x===f){if(_)n.takeCurrentTextureSlot(this,null);else if("tv"===m&&f)for(g=0;g<f.length;g++)n.takeCurrentTextureSlot(this,null);continue}}if(null!=f)if(_)if(f.__slot<0){var b=n.currentTextureSlot();n.setUniform(s,"1i",v,b)&&(n.takeCurrentTextureSlot(this,f),f.__slot=b)}else n.setUniform(s,"1i",v,f.__slot);else if(Array.isArray(f)){if(0===f.length)continue;if("tv"===m){if(!n.hasUniform(v))continue;var w=[];for(g=0;g<f.length;g++){var S=f[g];if(S.__slot<0){b=n.currentTextureSlot();w.push(b),n.takeCurrentTextureSlot(this,S),S.__slot=b}else w.push(S.__slot)}n.setUniform(s,"1iv",v,w)}else n.setUniform(s,y.type,v,f)}else n.setUniform(s,y.type,v,f)}var T=n.currentTextureSlot();return n.resetTextureSlot(u),T},_bindVAO:function(e,t,n,r){var i=!n.dynamic,o=this.gl,a=this.__uid__+"-"+r.__uid__,s=n.__vaoCache[a];if(!s){var l=n.getBufferChunks(this);if(!l||!l.length)return;for(var u=l[0],c=u.attributeBuffers,h=u.indicesBuffer,d=[],p=[],f=0;f<c.length;f++){var g,m=(w=c[f]).name,v=w.semantic;if(v){var y=t.attributeSemantics[v];g=y&&y.symbol}else g=m;g&&r.attributes[g]&&(d.push(w),p.push(g))}s=new kq(d,p,h),i&&(n.__vaoCache[a]=s)}var _=!0;e&&i&&(null==s.vao?s.vao=e.createVertexArrayOES():_=!1,e.bindVertexArrayOES(s.vao));d=s.availableAttributes,h=s.indicesBuffer;if(_){var x=r.enableAttributes(this,s.availableAttributeSymbols,e&&i&&s);for(f=0;f<d.length;f++){var b=x[f];if(-1!==b){var w,S=(w=d[f]).buffer,T=w.size,M=Rq[w.type]||o.FLOAT;o.bindBuffer(o.ARRAY_BUFFER,S),o.vertexAttribPointer(b,T,M,!1,0,0)}}n.isUseIndices()&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h.buffer)}return s},renderPreZ:function(e,t,n){var r=this.gl,i=this._prezMaterial||new jZ({shader:new wq(wq.source("clay.prez.vertex"),wq.source("clay.prez.fragment"))});this._prezMaterial=i,r.colorMask(!1,!1,!1,!1),r.depthMask(!0),this.renderPass(e,n,{ifRender:function(e){return!e.ignorePreZ},isMaterialChanged:function(e,t){var n=e.material,r=t.material;return n.get("diffuseMap")!==r.get("diffuseMap")||(n.get("alphaCutoff")||0)!==(r.get("alphaCutoff")||0)},getUniform:function(e,t,n){return"alphaMap"===n?e.material.get("diffuseMap"):"alphaCutoff"===n?e.material.isDefined("fragment","ALPHA_TEST")&&e.material.get("diffuseMap")&&e.material.get("alphaCutoff")||0:"uvRepeat"===n?e.material.get("uvRepeat"):"uvOffset"===n?e.material.get("uvOffset"):t.get(n)},getMaterial:function(){return i},sort:this.opaqueSortCompare}),r.colorMask(!0,!0,!0,!0),r.depthMask(!0)},disposeScene:function(e){this.disposeNode(e,!0,!0),e.dispose()},disposeNode:function(e,t,n){e.getParent()&&e.getParent().remove(e);var r={};e.traverse((function(e){var i=e.material;if(e.geometry&&t&&e.geometry.dispose(this),n&&i&&!r[i.__uid__]){for(var o=i.getTextureUniforms(),a=0;a<o.length;a++){var s=o[a],l=i.uniforms[s].value,u=i.uniforms[s].type;if(l)if("t"===u)l.dispose&&l.dispose(this);else if("tv"===u)for(var c=0;c<l.length;c++)l[c]&&l[c].dispose&&l[c].dispose(this)}r[i.__uid__]=!0}e.dispose&&e.dispose(this)}),this)},disposeGeometry:function(e){e.dispose(this)},disposeTexture:function(e){e.dispose(this)},disposeFrameBuffer:function(e){e.dispose(this)},dispose:function(){},screenToNDC:function(e,t,n){n||(n=new KZ),t=this._height-t;var r=this.viewport,i=n.array;return i[0]=(e-r.x)/r.width,i[0]=2*i[0]-1,i[1]=(t-r.y)/r.height,i[1]=2*i[1]-1,n}});Vq.opaqueSortCompare=Vq.prototype.opaqueSortCompare=function(e,t){return e.renderOrder===t.renderOrder?e.__program===t.__program?e.material===t.material?e.geometry.__uid__-t.geometry.__uid__:e.material.__uid__-t.material.__uid__:e.__program&&t.__program?e.__program.__uid__-t.__program.__uid__:0:e.renderOrder-t.renderOrder},Vq.transparentSortCompare=Vq.prototype.transparentSortCompare=function(e,t){return e.renderOrder===t.renderOrder?e.__depth===t.__depth?e.__program===t.__program?e.material===t.material?e.geometry.__uid__-t.geometry.__uid__:e.material.__uid__-t.material.__uid__:e.__program&&t.__program?e.__program.__uid__-t.__program.__uid__:0:e.__depth-t.__depth:e.renderOrder-t.renderOrder};var Bq={IDENTITY:Aq(),WORLD:Aq(),VIEW:Aq(),PROJECTION:Aq(),WORLDVIEW:Aq(),VIEWPROJECTION:Aq(),WORLDVIEWPROJECTION:Aq(),WORLDINVERSE:Aq(),VIEWINVERSE:Aq(),PROJECTIONINVERSE:Aq(),WORLDVIEWINVERSE:Aq(),VIEWPROJECTIONINVERSE:Aq(),WORLDVIEWPROJECTIONINVERSE:Aq(),WORLDTRANSPOSE:Aq(),VIEWTRANSPOSE:Aq(),PROJECTIONTRANSPOSE:Aq(),WORLDVIEWTRANSPOSE:Aq(),VIEWPROJECTIONTRANSPOSE:Aq(),WORLDVIEWPROJECTIONTRANSPOSE:Aq(),WORLDINVERSETRANSPOSE:Aq(),VIEWINVERSETRANSPOSE:Aq(),PROJECTIONINVERSETRANSPOSE:Aq(),WORLDVIEWINVERSETRANSPOSE:Aq(),VIEWPROJECTIONINVERSETRANSPOSE:Aq(),WORLDVIEWPROJECTIONINVERSETRANSPOSE:Aq()};Vq.COLOR_BUFFER_BIT=AY,Vq.DEPTH_BUFFER_BIT=CY,Vq.STENCIL_BUFFER_BIT=DY;var Fq=function(e,t,n){e=e||0,t=t||0,n=n||0,this.array=Dq.fromValues(e,t,n),this._dirty=!0};Fq.prototype={constructor:Fq,add:function(e){return Dq.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t,n){return this.array[0]=e,this.array[1]=t,this.array[2]=n,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this._dirty=!0,this},clone:function(){return new Fq(this.x,this.y,this.z)},copy:function(e){return Dq.copy(this.array,e.array),this._dirty=!0,this},cross:function(e,t){return Dq.cross(this.array,e.array,t.array),this._dirty=!0,this},dist:function(e){return Dq.dist(this.array,e.array)},distance:function(e){return Dq.distance(this.array,e.array)},div:function(e){return Dq.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return Dq.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return Dq.dot(this.array,e.array)},len:function(){return Dq.len(this.array)},length:function(){return Dq.length(this.array)},lerp:function(e,t,n){return Dq.lerp(this.array,e.array,t.array,n),this._dirty=!0,this},min:function(e){return Dq.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return Dq.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return Dq.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return Dq.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return Dq.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return Dq.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return Dq.random(this.array,e),this._dirty=!0,this},scale:function(e){return Dq.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return Dq.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return Dq.sqrDist(this.array,e.array)},squaredDistance:function(e){return Dq.squaredDistance(this.array,e.array)},sqrLen:function(){return Dq.sqrLen(this.array)},squaredLength:function(){return Dq.squaredLength(this.array)},sub:function(e){return Dq.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return Dq.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat3:function(e){return Dq.transformMat3(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return Dq.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},transformQuat:function(e){return Dq.transformQuat(this.array,this.array,e.array),this._dirty=!0,this},applyProjection:function(e){var t=this.array;if(0===(e=e.array)[15]){var n=-1/t[2];t[0]=e[0]*t[0]*n,t[1]=e[5]*t[1]*n,t[2]=(e[10]*t[2]+e[14])*n}else t[0]=e[0]*t[0]+e[12],t[1]=e[5]*t[1]+e[13],t[2]=e[10]*t[2]+e[14];return this._dirty=!0,this},eulerFromQuat:function(e,t){Fq.eulerFromQuat(this,e,t)},eulerFromMat3:function(e,t){Fq.eulerFromMat3(this,e,t)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var Gq=Object.defineProperty;if(Gq){var Hq=Fq.prototype;Gq(Hq,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),Gq(Hq,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),Gq(Hq,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}})}function Uq(e,t,n){return e<t?t:e>n?n:e}Fq.add=function(e,t,n){return Dq.add(e.array,t.array,n.array),e._dirty=!0,e},Fq.set=function(e,t,n,r){Dq.set(e.array,t,n,r),e._dirty=!0},Fq.copy=function(e,t){return Dq.copy(e.array,t.array),e._dirty=!0,e},Fq.cross=function(e,t,n){return Dq.cross(e.array,t.array,n.array),e._dirty=!0,e},Fq.distance=Fq.dist=function(e,t){return Dq.distance(e.array,t.array)},Fq.div=function(e,t,n){return Dq.divide(e.array,t.array,n.array),e._dirty=!0,e},Fq.divide=Fq.div,Fq.dot=function(e,t){return Dq.dot(e.array,t.array)},Fq.len=function(e){return Dq.length(e.array)},Fq.lerp=function(e,t,n,r){return Dq.lerp(e.array,t.array,n.array,r),e._dirty=!0,e},Fq.min=function(e,t,n){return Dq.min(e.array,t.array,n.array),e._dirty=!0,e},Fq.max=function(e,t,n){return Dq.max(e.array,t.array,n.array),e._dirty=!0,e},Fq.mul=function(e,t,n){return Dq.multiply(e.array,t.array,n.array),e._dirty=!0,e},Fq.multiply=Fq.mul,Fq.negate=function(e,t){return Dq.negate(e.array,t.array),e._dirty=!0,e},Fq.normalize=function(e,t){return Dq.normalize(e.array,t.array),e._dirty=!0,e},Fq.random=function(e,t){return Dq.random(e.array,t),e._dirty=!0,e},Fq.scale=function(e,t,n){return Dq.scale(e.array,t.array,n),e._dirty=!0,e},Fq.scaleAndAdd=function(e,t,n,r){return Dq.scaleAndAdd(e.array,t.array,n.array,r),e._dirty=!0,e},Fq.squaredDistance=Fq.sqrDist=function(e,t){return Dq.sqrDist(e.array,t.array)},Fq.squaredLength=Fq.sqrLen=function(e){return Dq.sqrLen(e.array)},Fq.sub=function(e,t,n){return Dq.subtract(e.array,t.array,n.array),e._dirty=!0,e},Fq.subtract=Fq.sub,Fq.transformMat3=function(e,t,n){return Dq.transformMat3(e.array,t.array,n.array),e._dirty=!0,e},Fq.transformMat4=function(e,t,n){return Dq.transformMat4(e.array,t.array,n.array),e._dirty=!0,e},Fq.transformQuat=function(e,t,n){return Dq.transformQuat(e.array,t.array,n.array),e._dirty=!0,e};var Wq=Math.atan2,jq=Math.asin,Xq=Math.abs;Fq.eulerFromQuat=function(e,t,n){e._dirty=!0,t=t.array;var r=e.array,i=t[0],o=t[1],a=t[2],s=t[3],l=i*i,u=o*o,c=a*a,h=s*s;switch(n=(n||"XYZ").toUpperCase()){case"XYZ":r[0]=Wq(2*(i*s-o*a),h-l-u+c),r[1]=jq(Uq(2*(i*a+o*s),-1,1)),r[2]=Wq(2*(a*s-i*o),h+l-u-c);break;case"YXZ":r[0]=jq(Uq(2*(i*s-o*a),-1,1)),r[1]=Wq(2*(i*a+o*s),h-l-u+c),r[2]=Wq(2*(i*o+a*s),h-l+u-c);break;case"ZXY":r[0]=jq(Uq(2*(i*s+o*a),-1,1)),r[1]=Wq(2*(o*s-a*i),h-l-u+c),r[2]=Wq(2*(a*s-i*o),h-l+u-c);break;case"ZYX":r[0]=Wq(2*(i*s+a*o),h-l-u+c),r[1]=jq(Uq(2*(o*s-i*a),-1,1)),r[2]=Wq(2*(i*o+a*s),h+l-u-c);break;case"YZX":r[0]=Wq(2*(i*s-a*o),h-l+u-c),r[1]=Wq(2*(o*s-i*a),h+l-u-c),r[2]=jq(Uq(2*(i*o+a*s),-1,1));break;case"XZY":r[0]=Wq(2*(i*s+o*a),h-l+u-c),r[1]=Wq(2*(i*a+o*s),h+l-u-c),r[2]=jq(Uq(2*(a*s-i*o),-1,1));break;default:console.warn("Unkown order: "+n)}return e},Fq.eulerFromMat3=function(e,t,n){var r=t.array,i=r[0],o=r[3],a=r[6],s=r[1],l=r[4],u=r[7],c=r[2],h=r[5],d=r[8],p=e.array;switch(n=(n||"XYZ").toUpperCase()){case"XYZ":p[1]=jq(Uq(a,-1,1)),Xq(a)<.99999?(p[0]=Wq(-u,d),p[2]=Wq(-o,i)):(p[0]=Wq(h,l),p[2]=0);break;case"YXZ":p[0]=jq(-Uq(u,-1,1)),Xq(u)<.99999?(p[1]=Wq(a,d),p[2]=Wq(s,l)):(p[1]=Wq(-c,i),p[2]=0);break;case"ZXY":p[0]=jq(Uq(h,-1,1)),Xq(h)<.99999?(p[1]=Wq(-c,d),p[2]=Wq(-o,l)):(p[1]=0,p[2]=Wq(s,i));break;case"ZYX":p[1]=jq(-Uq(c,-1,1)),Xq(c)<.99999?(p[0]=Wq(h,d),p[2]=Wq(s,i)):(p[0]=0,p[2]=Wq(-o,l));break;case"YZX":p[2]=jq(Uq(s,-1,1)),Xq(s)<.99999?(p[0]=Wq(-u,l),p[1]=Wq(-c,i)):(p[0]=0,p[1]=Wq(a,d));break;case"XZY":p[2]=jq(-Uq(o,-1,1)),Xq(o)<.99999?(p[0]=Wq(h,l),p[1]=Wq(a,i)):(p[0]=Wq(-u,d),p[1]=0);break;default:console.warn("Unkown order: "+n)}return e._dirty=!0,e},Object.defineProperties(Fq,{POSITIVE_X:{get:function(){return new Fq(1,0,0)}},NEGATIVE_X:{get:function(){return new Fq(-1,0,0)}},POSITIVE_Y:{get:function(){return new Fq(0,1,0)}},NEGATIVE_Y:{get:function(){return new Fq(0,-1,0)}},POSITIVE_Z:{get:function(){return new Fq(0,0,1)}},NEGATIVE_Z:{get:function(){return new Fq(0,0,-1)}},UP:{get:function(){return new Fq(0,1,0)}},ZERO:{get:function(){return new Fq}}});var Yq,Zq,qq,Kq,$q=1e-5,Jq=function(e,t){this.origin=e||new Fq,this.direction=t||new Fq};Jq.prototype={constructor:Jq,intersectPlane:function(e,t){var n=e.normal.array,r=e.distance,i=this.origin.array,o=this.direction.array,a=Dq.dot(n,o);if(0===a)return null;t||(t=new Fq);var s=(Dq.dot(n,i)-r)/a;return Dq.scaleAndAdd(t.array,i,o,-s),t._dirty=!0,t},mirrorAgainstPlane:function(e){var t=Dq.dot(e.normal.array,this.direction.array);Dq.scaleAndAdd(this.direction.array,this.direction.array,e.normal.array,2*-t),this.direction._dirty=!0},distanceToPoint:function(){var e=Dq.create();return function(t){Dq.sub(e,t,this.origin.array);var n=Dq.dot(e,this.direction.array);if(n<0)return Dq.distance(this.origin.array,t);var r=Dq.lenSquared(e);return Math.sqrt(r-n*n)}}(),intersectSphere:function(){var e=Dq.create();return function(t,n,r){var i=this.origin.array,o=this.direction.array;t=t.array,Dq.sub(e,t,i);var a=Dq.dot(e,o),s=Dq.squaredLength(e)-a*a,l=n*n;if(!(s>l)){var u=Math.sqrt(l-s),c=a-u,h=a+u;return r||(r=new Fq),c<0?h<0?null:(Dq.scaleAndAdd(r.array,i,o,h),r):(Dq.scaleAndAdd(r.array,i,o,c),r)}}}(),intersectBoundingBox:function(e,t){var n,r,i,o,a,s,l=this.direction.array,u=this.origin.array,c=e.min.array,h=e.max.array,d=1/l[0],p=1/l[1],f=1/l[2];if(d>=0?(n=(c[0]-u[0])*d,r=(h[0]-u[0])*d):(r=(c[0]-u[0])*d,n=(h[0]-u[0])*d),p>=0?(i=(c[1]-u[1])*p,o=(h[1]-u[1])*p):(o=(c[1]-u[1])*p,i=(h[1]-u[1])*p),n>o||i>r)return null;if((i>n||n!=n)&&(n=i),(o<r||r!=r)&&(r=o),f>=0?(a=(c[2]-u[2])*f,s=(h[2]-u[2])*f):(s=(c[2]-u[2])*f,a=(h[2]-u[2])*f),n>s||a>r)return null;if((a>n||n!=n)&&(n=a),(s<r||r!=r)&&(r=s),r<0)return null;var g=n>=0?n:r;return t||(t=new Fq),Dq.scaleAndAdd(t.array,u,l,g),t},intersectTriangle:(Yq=Dq.create(),Zq=Dq.create(),qq=Dq.create(),Kq=Dq.create(),function(e,t,n,r,i,o){var a=this.direction.array,s=this.origin.array;e=e.array,t=t.array,n=n.array,Dq.sub(Yq,t,e),Dq.sub(Zq,n,e),Dq.cross(Kq,Zq,a);var l=Dq.dot(Yq,Kq);if(r){if(l>-1e-5)return null}else if(l>-1e-5&&l<$q)return null;Dq.sub(qq,s,e);var u=Dq.dot(Kq,qq)/l;if(u<0||u>1)return null;Dq.cross(Kq,Yq,qq);var c=Dq.dot(a,Kq)/l;if(c<0||c>1||u+c>1)return null;Dq.cross(Kq,Yq,Zq);var h=-Dq.dot(qq,Kq)/l;return h<0?null:(i||(i=new Fq),o&&Fq.set(o,1-u-c,u,c),Dq.scaleAndAdd(i.array,s,a,h),i)}),applyTransform:function(e){Fq.add(this.direction,this.direction,this.origin),Fq.transformMat4(this.origin,this.origin,e),Fq.transformMat4(this.direction,this.direction,e),Fq.sub(this.direction,this.direction,this.origin),Fq.normalize(this.direction,this.direction)},copy:function(e){Fq.copy(this.origin,e.origin),Fq.copy(this.direction,e.direction)},clone:function(){var e=new Jq;return e.copy(this),e}};var Qq={create:function(){var e=new YZ(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},clone:function(e){var t=new YZ(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},fromValues:function(e,t,n,r){var i=new YZ(4);return i[0]=e,i[1]=t,i[2]=n,i[3]=r,i},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},set:function(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e},subtract:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}};Qq.sub=Qq.subtract,Qq.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e},Qq.mul=Qq.multiply,Qq.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e},Qq.div=Qq.divide,Qq.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e},Qq.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e},Qq.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e},Qq.scaleAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e},Qq.distance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],o=t[3]-e[3];return Math.sqrt(n*n+r*r+i*i+o*o)},Qq.dist=Qq.distance,Qq.squaredDistance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],o=t[3]-e[3];return n*n+r*r+i*i+o*o},Qq.sqrDist=Qq.squaredDistance,Qq.length=function(e){var t=e[0],n=e[1],r=e[2],i=e[3];return Math.sqrt(t*t+n*n+r*r+i*i)},Qq.len=Qq.length,Qq.squaredLength=function(e){var t=e[0],n=e[1],r=e[2],i=e[3];return t*t+n*n+r*r+i*i},Qq.sqrLen=Qq.squaredLength,Qq.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},Qq.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},Qq.normalize=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e[3]=t[3]*a),e},Qq.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},Qq.lerp=function(e,t,n,r){var i=t[0],o=t[1],a=t[2],s=t[3];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e[2]=a+r*(n[2]-a),e[3]=s+r*(n[3]-s),e},Qq.random=function(e,t){return t=t||1,e[0]=ZZ(),e[1]=ZZ(),e[2]=ZZ(),e[3]=ZZ(),Qq.normalize(e,e),Qq.scale(e,e,t),e},Qq.transformMat4=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,e[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,e[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,e[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,e},Qq.transformQuat=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],l=n[2],u=n[3],c=u*r+s*o-l*i,h=u*i+l*r-a*o,d=u*o+a*i-s*r,p=-a*r-s*i-l*o;return e[0]=c*u+p*-a+h*-l-d*-s,e[1]=h*u+p*-s+d*-a-c*-l,e[2]=d*u+p*-l+c*-s-h*-a,e},Qq.forEach=function(){var e=Qq.create();return function(t,n,r,i,o,a){var s,l;for(n||(n=4),r||(r=0),l=i?Math.min(i*n+r,t.length):t.length,s=r;s<l;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],o(e,e,a),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}}();var eK={create:function(){var e=new YZ(9);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromMat4:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},clone:function(e){var t=new YZ(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},transpose:function(e,t){if(e===t){var n=t[1],r=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=r,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},invert:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=c*a-s*u,d=-c*o+s*l,p=u*o-a*l,f=n*h+r*d+i*p;return f?(f=1/f,e[0]=h*f,e[1]=(-c*r+i*u)*f,e[2]=(s*r-i*a)*f,e[3]=d*f,e[4]=(c*n-i*l)*f,e[5]=(-s*n+i*o)*f,e[6]=p*f,e[7]=(-u*n+r*l)*f,e[8]=(a*n-r*o)*f,e):null},adjoint:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8];return e[0]=a*c-s*u,e[1]=i*u-r*c,e[2]=r*s-i*a,e[3]=s*l-o*c,e[4]=n*c-i*l,e[5]=i*o-n*s,e[6]=o*u-a*l,e[7]=r*l-n*u,e[8]=n*a-r*o,e},determinant:function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],u=e[8];return t*(u*o-a*l)+n*(-u*i+a*s)+r*(l*i-o*s)},multiply:function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=n[0],p=n[1],f=n[2],g=n[3],m=n[4],v=n[5],y=n[6],_=n[7],x=n[8];return e[0]=d*r+p*a+f*u,e[1]=d*i+p*s+f*c,e[2]=d*o+p*l+f*h,e[3]=g*r+m*a+v*u,e[4]=g*i+m*s+v*c,e[5]=g*o+m*l+v*h,e[6]=y*r+_*a+x*u,e[7]=y*i+_*s+x*c,e[8]=y*o+_*l+x*h,e}};eK.mul=eK.multiply,eK.translate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=n[0],p=n[1];return e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=d*r+p*a+u,e[7]=d*i+p*s+c,e[8]=d*o+p*l+h,e},eK.rotate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=Math.sin(n),p=Math.cos(n);return e[0]=p*r+d*a,e[1]=p*i+d*s,e[2]=p*o+d*l,e[3]=p*a-d*r,e[4]=p*s-d*i,e[5]=p*l-d*o,e[6]=u,e[7]=c,e[8]=h,e},eK.scale=function(e,t,n){var r=n[0],i=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},eK.fromMat2d=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},eK.fromQuat=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n+n,s=r+r,l=i+i,u=n*a,c=r*a,h=r*s,d=i*a,p=i*s,f=i*l,g=o*a,m=o*s,v=o*l;return e[0]=1-h-f,e[3]=c-v,e[6]=d+m,e[1]=c+v,e[4]=1-u-f,e[7]=p-g,e[2]=d-m,e[5]=p+g,e[8]=1-u-h,e},eK.normalFromMat4=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],p=t[11],f=t[12],g=t[13],m=t[14],v=t[15],y=n*s-r*a,_=n*l-i*a,x=n*u-o*a,b=r*l-i*s,w=r*u-o*s,S=i*u-o*l,T=c*g-h*f,M=c*m-d*f,C=c*v-p*f,D=h*m-d*g,A=h*v-p*g,I=d*v-p*m,E=y*I-_*A+x*D+b*C-w*M+S*T;return E?(E=1/E,e[0]=(s*I-l*A+u*D)*E,e[1]=(l*C-a*I-u*M)*E,e[2]=(a*A-s*C+u*T)*E,e[3]=(i*A-r*I-o*D)*E,e[4]=(n*I-i*C+o*M)*E,e[5]=(r*C-n*A-o*T)*E,e[6]=(g*S-m*w+v*b)*E,e[7]=(m*x-f*S-v*_)*E,e[8]=(f*w-g*x+v*y)*E,e):null},eK.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+Math.pow(e[6],2)+Math.pow(e[7],2)+Math.pow(e[8],2))};var tK,nK,rK,iK,oK={};oK.create=function(){var e=new YZ(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},oK.rotationTo=(tK=Dq.create(),nK=Dq.fromValues(1,0,0),rK=Dq.fromValues(0,1,0),function(e,t,n){var r=Dq.dot(t,n);return r<-.999999?(Dq.cross(tK,nK,t),Dq.length(tK)<1e-6&&Dq.cross(tK,rK,t),Dq.normalize(tK,tK),oK.setAxisAngle(e,tK,Math.PI),e):r>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(Dq.cross(tK,t,n),e[0]=tK[0],e[1]=tK[1],e[2]=tK[2],e[3]=1+r,oK.normalize(e,e))}),oK.setAxes=(iK=eK.create(),function(e,t,n,r){return iK[0]=n[0],iK[3]=n[1],iK[6]=n[2],iK[1]=r[0],iK[4]=r[1],iK[7]=r[2],iK[2]=-t[0],iK[5]=-t[1],iK[8]=-t[2],oK.normalize(e,oK.fromMat3(e,iK))}),oK.clone=Qq.clone,oK.fromValues=Qq.fromValues,oK.copy=Qq.copy,oK.set=Qq.set,oK.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},oK.setAxisAngle=function(e,t,n){n*=.5;var r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e},oK.add=Qq.add,oK.multiply=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],l=n[1],u=n[2],c=n[3];return e[0]=r*c+a*s+i*u-o*l,e[1]=i*c+a*l+o*s-r*u,e[2]=o*c+a*u+r*l-i*s,e[3]=a*c-r*s-i*l-o*u,e},oK.mul=oK.multiply,oK.scale=Qq.scale,oK.rotateX=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+a*s,e[1]=i*l+o*s,e[2]=o*l-i*s,e[3]=a*l-r*s,e},oK.rotateY=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l-o*s,e[1]=i*l+a*s,e[2]=o*l+r*s,e[3]=a*l-i*s,e},oK.rotateZ=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+i*s,e[1]=i*l-r*s,e[2]=o*l+a*s,e[3]=a*l-o*s,e},oK.calculateW=function(e,t){var n=t[0],r=t[1],i=t[2];return e[0]=n,e[1]=r,e[2]=i,e[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),e},oK.dot=Qq.dot,oK.lerp=Qq.lerp,oK.slerp=function(e,t,n,r){var i,o,a,s,l,u=t[0],c=t[1],h=t[2],d=t[3],p=n[0],f=n[1],g=n[2],m=n[3];return(o=u*p+c*f+h*g+d*m)<0&&(o=-o,p=-p,f=-f,g=-g,m=-m),1-o>1e-6?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,l=Math.sin(r*i)/a):(s=1-r,l=r),e[0]=s*u+l*p,e[1]=s*c+l*f,e[2]=s*h+l*g,e[3]=s*d+l*m,e},oK.invert=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-i*s,e[3]=o*s,e},oK.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},oK.length=Qq.length,oK.len=oK.length,oK.squaredLength=Qq.squaredLength,oK.sqrLen=oK.squaredLength,oK.normalize=Qq.normalize,oK.fromMat3=function(e,t){var n,r=t[0]+t[4]+t[8];if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(t[3*i+i]-t[3*o+o]-t[3*a+a]+1),e[i]=.5*n,n=.5/n,e[3]=(t[3*o+a]-t[3*a+o])*n,e[o]=(t[3*o+i]+t[3*i+o])*n,e[a]=(t[3*a+i]+t[3*i+a])*n}return e};var aK=function(){this._axisX=new Fq,this._axisY=new Fq,this._axisZ=new Fq,this.array=Cq.create(),this._dirty=!0};aK.prototype={constructor:aK,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},adjoint:function(){return Cq.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new aK).copy(this)},copy:function(e){return Cq.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return Cq.determinant(this.array)},fromQuat:function(e){return Cq.fromQuat(this.array,e.array),this._dirty=!0,this},fromRotationTranslation:function(e,t){return Cq.fromRotationTranslation(this.array,e.array,t.array),this._dirty=!0,this},fromMat2d:function(e){return aK.fromMat2d(this,e),this},frustum:function(e,t,n,r,i,o){return Cq.frustum(this.array,e,t,n,r,i,o),this._dirty=!0,this},identity:function(){return Cq.identity(this.array),this._dirty=!0,this},invert:function(){return Cq.invert(this.array,this.array),this._dirty=!0,this},lookAt:function(e,t,n){return Cq.lookAt(this.array,e.array,t.array,n.array),this._dirty=!0,this},mul:function(e){return Cq.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return Cq.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return Cq.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return Cq.multiply(this.array,e.array,this.array),this._dirty=!0,this},ortho:function(e,t,n,r,i,o){return Cq.ortho(this.array,e,t,n,r,i,o),this._dirty=!0,this},perspective:function(e,t,n,r){return Cq.perspective(this.array,e,t,n,r),this._dirty=!0,this},rotate:function(e,t){return Cq.rotate(this.array,this.array,e,t.array),this._dirty=!0,this},rotateX:function(e){return Cq.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return Cq.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return Cq.rotateZ(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return Cq.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return Cq.translate(this.array,this.array,e.array),this._dirty=!0,this},transpose:function(){return Cq.transpose(this.array,this.array),this._dirty=!0,this},decomposeMatrix:function(){var e=Dq.create(),t=Dq.create(),n=Dq.create(),r=eK.create();return function(i,o,a){var s=this.array;Dq.set(e,s[0],s[1],s[2]),Dq.set(t,s[4],s[5],s[6]),Dq.set(n,s[8],s[9],s[10]);var l=Dq.length(e),u=Dq.length(t),c=Dq.length(n);this.determinant()<0&&(l=-l),i&&i.set(l,u,c),a.set(s[12],s[13],s[14]),eK.fromMat4(r,s),r[0]/=l,r[1]/=l,r[2]/=l,r[3]/=u,r[4]/=u,r[5]/=u,r[6]/=c,r[7]/=c,r[8]/=c,oK.fromMat3(o.array,r),oK.normalize(o.array,o.array),o._dirty=!0,a._dirty=!0}}(),toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var sK=Object.defineProperty;if(sK){var lK=aK.prototype;sK(lK,"z",{get:function(){var e=this.array;return this._axisZ.set(e[8],e[9],e[10]),this._axisZ},set:function(e){var t=this.array;e=e.array,t[8]=e[0],t[9]=e[1],t[10]=e[2],this._dirty=!0}}),sK(lK,"y",{get:function(){var e=this.array;return this._axisY.set(e[4],e[5],e[6]),this._axisY},set:function(e){var t=this.array;e=e.array,t[4]=e[0],t[5]=e[1],t[6]=e[2],this._dirty=!0}}),sK(lK,"x",{get:function(){var e=this.array;return this._axisX.set(e[0],e[1],e[2]),this._axisX},set:function(e){var t=this.array;e=e.array,t[0]=e[0],t[1]=e[1],t[2]=e[2],this._dirty=!0}})}aK.adjoint=function(e,t){return Cq.adjoint(e.array,t.array),e._dirty=!0,e},aK.copy=function(e,t){return Cq.copy(e.array,t.array),e._dirty=!0,e},aK.determinant=function(e){return Cq.determinant(e.array)},aK.identity=function(e){return Cq.identity(e.array),e._dirty=!0,e},aK.ortho=function(e,t,n,r,i,o,a){return Cq.ortho(e.array,t,n,r,i,o,a),e._dirty=!0,e},aK.perspective=function(e,t,n,r,i){return Cq.perspective(e.array,t,n,r,i),e._dirty=!0,e},aK.lookAt=function(e,t,n,r){return Cq.lookAt(e.array,t.array,n.array,r.array),e._dirty=!0,e},aK.invert=function(e,t){return Cq.invert(e.array,t.array),e._dirty=!0,e},aK.mul=function(e,t,n){return Cq.mul(e.array,t.array,n.array),e._dirty=!0,e},aK.multiply=aK.mul,aK.fromQuat=function(e,t){return Cq.fromQuat(e.array,t.array),e._dirty=!0,e},aK.fromRotationTranslation=function(e,t,n){return Cq.fromRotationTranslation(e.array,t.array,n.array),e._dirty=!0,e},aK.fromMat2d=function(e,t){e._dirty=!0;t=t.array;return(e=e.array)[0]=t[0],e[4]=t[2],e[12]=t[4],e[1]=t[1],e[5]=t[3],e[13]=t[5],e},aK.rotate=function(e,t,n,r){return Cq.rotate(e.array,t.array,n,r.array),e._dirty=!0,e},aK.rotateX=function(e,t,n){return Cq.rotateX(e.array,t.array,n),e._dirty=!0,e},aK.rotateY=function(e,t,n){return Cq.rotateY(e.array,t.array,n),e._dirty=!0,e},aK.rotateZ=function(e,t,n){return Cq.rotateZ(e.array,t.array,n),e._dirty=!0,e},aK.scale=function(e,t,n){return Cq.scale(e.array,t.array,n.array),e._dirty=!0,e},aK.transpose=function(e,t){return Cq.transpose(e.array,t.array),e._dirty=!0,e},aK.translate=function(e,t,n){return Cq.translate(e.array,t.array,n.array),e._dirty=!0,e};var uK,cK=function(e,t,n,r){e=e||0,t=t||0,n=n||0,r=void 0===r?1:r,this.array=oK.fromValues(e,t,n,r),this._dirty=!0};cK.prototype={constructor:cK,add:function(e){return oK.add(this.array,this.array,e.array),this._dirty=!0,this},calculateW:function(){return oK.calculateW(this.array,this.array),this._dirty=!0,this},set:function(e,t,n,r){return this.array[0]=e,this.array[1]=t,this.array[2]=n,this.array[3]=r,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this.array[3]=e[3],this._dirty=!0,this},clone:function(){return new cK(this.x,this.y,this.z,this.w)},conjugate:function(){return oK.conjugate(this.array,this.array),this._dirty=!0,this},copy:function(e){return oK.copy(this.array,e.array),this._dirty=!0,this},dot:function(e){return oK.dot(this.array,e.array)},fromMat3:function(e){return oK.fromMat3(this.array,e.array),this._dirty=!0,this},fromMat4:(uK=eK.create(),function(e){return eK.fromMat4(uK,e.array),eK.transpose(uK,uK),oK.fromMat3(this.array,uK),this._dirty=!0,this}),identity:function(){return oK.identity(this.array),this._dirty=!0,this},invert:function(){return oK.invert(this.array,this.array),this._dirty=!0,this},len:function(){return oK.len(this.array)},length:function(){return oK.length(this.array)},lerp:function(e,t,n){return oK.lerp(this.array,e.array,t.array,n),this._dirty=!0,this},mul:function(e){return oK.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return oK.multiply(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return oK.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return oK.multiply(this.array,e.array,this.array),this._dirty=!0,this},normalize:function(){return oK.normalize(this.array,this.array),this._dirty=!0,this},rotateX:function(e){return oK.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return oK.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return oK.rotateZ(this.array,this.array,e),this._dirty=!0,this},rotationTo:function(e,t){return oK.rotationTo(this.array,e.array,t.array),this._dirty=!0,this},setAxes:function(e,t,n){return oK.setAxes(this.array,e.array,t.array,n.array),this._dirty=!0,this},setAxisAngle:function(e,t){return oK.setAxisAngle(this.array,e.array,t),this._dirty=!0,this},slerp:function(e,t,n){return oK.slerp(this.array,e.array,t.array,n),this._dirty=!0,this},sqrLen:function(){return oK.sqrLen(this.array)},squaredLength:function(){return oK.squaredLength(this.array)},fromEuler:function(e,t){return cK.fromEuler(this,e,t)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var hK=Object.defineProperty;if(hK){var dK=cK.prototype;hK(dK,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),hK(dK,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),hK(dK,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}}),hK(dK,"w",{get:function(){return this.array[3]},set:function(e){this.array[3]=e,this._dirty=!0}})}cK.add=function(e,t,n){return oK.add(e.array,t.array,n.array),e._dirty=!0,e},cK.set=function(e,t,n,r,i){oK.set(e.array,t,n,r,i),e._dirty=!0},cK.copy=function(e,t){return oK.copy(e.array,t.array),e._dirty=!0,e},cK.calculateW=function(e,t){return oK.calculateW(e.array,t.array),e._dirty=!0,e},cK.conjugate=function(e,t){return oK.conjugate(e.array,t.array),e._dirty=!0,e},cK.identity=function(e){return oK.identity(e.array),e._dirty=!0,e},cK.invert=function(e,t){return oK.invert(e.array,t.array),e._dirty=!0,e},cK.dot=function(e,t){return oK.dot(e.array,t.array)},cK.len=function(e){return oK.length(e.array)},cK.lerp=function(e,t,n,r){return oK.lerp(e.array,t.array,n.array,r),e._dirty=!0,e},cK.slerp=function(e,t,n,r){return oK.slerp(e.array,t.array,n.array,r),e._dirty=!0,e},cK.mul=function(e,t,n){return oK.multiply(e.array,t.array,n.array),e._dirty=!0,e},cK.multiply=cK.mul,cK.rotateX=function(e,t,n){return oK.rotateX(e.array,t.array,n),e._dirty=!0,e},cK.rotateY=function(e,t,n){return oK.rotateY(e.array,t.array,n),e._dirty=!0,e},cK.rotateZ=function(e,t,n){return oK.rotateZ(e.array,t.array,n),e._dirty=!0,e},cK.setAxisAngle=function(e,t,n){return oK.setAxisAngle(e.array,t.array,n),e._dirty=!0,e},cK.normalize=function(e,t){return oK.normalize(e.array,t.array),e._dirty=!0,e},cK.squaredLength=cK.sqrLen=function(e){return oK.sqrLen(e.array)},cK.fromMat3=function(e,t){return oK.fromMat3(e.array,t.array),e._dirty=!0,e},cK.setAxes=function(e,t,n,r){return oK.setAxes(e.array,t.array,n.array,r.array),e._dirty=!0,e},cK.rotationTo=function(e,t,n){return oK.rotationTo(e.array,t.array,n.array),e._dirty=!0,e},cK.fromEuler=function(e,t,n){e._dirty=!0,t=t.array;var r=e.array,i=Math.cos(t[0]/2),o=Math.cos(t[1]/2),a=Math.cos(t[2]/2),s=Math.sin(t[0]/2),l=Math.sin(t[1]/2),u=Math.sin(t[2]/2);switch(n=(n||"XYZ").toUpperCase()){case"XYZ":r[0]=s*o*a+i*l*u,r[1]=i*l*a-s*o*u,r[2]=i*o*u+s*l*a,r[3]=i*o*a-s*l*u;break;case"YXZ":r[0]=s*o*a+i*l*u,r[1]=i*l*a-s*o*u,r[2]=i*o*u-s*l*a,r[3]=i*o*a+s*l*u;break;case"ZXY":r[0]=s*o*a-i*l*u,r[1]=i*l*a+s*o*u,r[2]=i*o*u+s*l*a,r[3]=i*o*a-s*l*u;break;case"ZYX":r[0]=s*o*a-i*l*u,r[1]=i*l*a+s*o*u,r[2]=i*o*u-s*l*a,r[3]=i*o*a+s*l*u;break;case"YZX":r[0]=s*o*a+i*l*u,r[1]=i*l*a+s*o*u,r[2]=i*o*u-s*l*a,r[3]=i*o*a-s*l*u;break;case"XZY":r[0]=s*o*a-i*l*u,r[1]=i*l*a-s*o*u,r[2]=i*o*u+s*l*a,r[3]=i*o*a+s*l*u}};var pK,fK,gK,mK,vK,yK,_K=Dq.set,xK=Dq.copy,bK=function(e,t){this.min=e||new Fq(1/0,1/0,1/0),this.max=t||new Fq(-1/0,-1/0,-1/0),this.vertices=null};bK.prototype={constructor:bK,updateFromVertices:function(e){if(e.length>0){var t=this.min,n=this.max,r=t.array,i=n.array;xK(r,e[0]),xK(i,e[0]);for(var o=1;o<e.length;o++){var a=e[o];a[0]<r[0]&&(r[0]=a[0]),a[1]<r[1]&&(r[1]=a[1]),a[2]<r[2]&&(r[2]=a[2]),a[0]>i[0]&&(i[0]=a[0]),a[1]>i[1]&&(i[1]=a[1]),a[2]>i[2]&&(i[2]=a[2])}t._dirty=!0,n._dirty=!0}},union:function(e){var t=this.min,n=this.max;return Dq.min(t.array,t.array,e.min.array),Dq.max(n.array,n.array,e.max.array),t._dirty=!0,n._dirty=!0,this},intersection:function(e){var t=this.min,n=this.max;return Dq.max(t.array,t.array,e.min.array),Dq.min(n.array,n.array,e.max.array),t._dirty=!0,n._dirty=!0,this},intersectBoundingBox:function(e){var t=this.min.array,n=this.max.array,r=e.min.array,i=e.max.array;return!(t[0]>i[0]||t[1]>i[1]||t[2]>i[2]||n[0]<r[0]||n[1]<r[1]||n[2]<r[2])},containBoundingBox:function(e){var t=this.min.array,n=this.max.array,r=e.min.array,i=e.max.array;return t[0]<=r[0]&&t[1]<=r[1]&&t[2]<=r[2]&&n[0]>=i[0]&&n[1]>=i[1]&&n[2]>=i[2]},containPoint:function(e){var t=this.min.array,n=this.max.array,r=e.array;return t[0]<=r[0]&&t[1]<=r[1]&&t[2]<=r[2]&&n[0]>=r[0]&&n[1]>=r[1]&&n[2]>=r[2]},isFinite:function(){var e=this.min.array,t=this.max.array;return isFinite(e[0])&&isFinite(e[1])&&isFinite(e[2])&&isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])},applyTransform:function(e){this.transformFrom(this,e)},transformFrom:(pK=Dq.create(),fK=Dq.create(),gK=Dq.create(),mK=Dq.create(),vK=Dq.create(),yK=Dq.create(),function(e,t){var n=e.min.array,r=e.max.array,i=t.array;return pK[0]=i[0]*n[0],pK[1]=i[1]*n[0],pK[2]=i[2]*n[0],fK[0]=i[0]*r[0],fK[1]=i[1]*r[0],fK[2]=i[2]*r[0],gK[0]=i[4]*n[1],gK[1]=i[5]*n[1],gK[2]=i[6]*n[1],mK[0]=i[4]*r[1],mK[1]=i[5]*r[1],mK[2]=i[6]*r[1],vK[0]=i[8]*n[2],vK[1]=i[9]*n[2],vK[2]=i[10]*n[2],yK[0]=i[8]*r[2],yK[1]=i[9]*r[2],yK[2]=i[10]*r[2],n=this.min.array,r=this.max.array,n[0]=Math.min(pK[0],fK[0])+Math.min(gK[0],mK[0])+Math.min(vK[0],yK[0])+i[12],n[1]=Math.min(pK[1],fK[1])+Math.min(gK[1],mK[1])+Math.min(vK[1],yK[1])+i[13],n[2]=Math.min(pK[2],fK[2])+Math.min(gK[2],mK[2])+Math.min(vK[2],yK[2])+i[14],r[0]=Math.max(pK[0],fK[0])+Math.max(gK[0],mK[0])+Math.max(vK[0],yK[0])+i[12],r[1]=Math.max(pK[1],fK[1])+Math.max(gK[1],mK[1])+Math.max(vK[1],yK[1])+i[13],r[2]=Math.max(pK[2],fK[2])+Math.max(gK[2],mK[2])+Math.max(vK[2],yK[2])+i[14],this.min._dirty=!0,this.max._dirty=!0,this}),applyProjection:function(e){var t=this.min.array,n=this.max.array,r=e.array,i=t[0],o=t[1],a=t[2],s=n[0],l=n[1],u=t[2],c=n[0],h=n[1],d=n[2];if(1===r[15])t[0]=r[0]*i+r[12],t[1]=r[5]*o+r[13],n[2]=r[10]*a+r[14],n[0]=r[0]*c+r[12],n[1]=r[5]*h+r[13],t[2]=r[10]*d+r[14];else{var p=-1/a;t[0]=r[0]*i*p,t[1]=r[5]*o*p,n[2]=(r[10]*a+r[14])*p,p=-1/u,n[0]=r[0]*s*p,n[1]=r[5]*l*p,p=-1/d,t[2]=(r[10]*d+r[14])*p}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){var e=this.vertices;if(!e){e=[];for(var t=0;t<8;t++)e[t]=Dq.fromValues(0,0,0);this.vertices=e}var n=this.min.array,r=this.max.array;return _K(e[0],n[0],n[1],n[2]),_K(e[1],n[0],r[1],n[2]),_K(e[2],r[0],n[1],n[2]),_K(e[3],r[0],r[1],n[2]),_K(e[4],n[0],n[1],r[2]),_K(e[5],n[0],r[1],r[2]),_K(e[6],r[0],n[1],r[2]),_K(e[7],r[0],r[1],r[2]),this},copy:function(e){var t=this.min,n=this.max;return xK(t.array,e.min.array),xK(n.array,e.max.array),t._dirty=!0,n._dirty=!0,this},clone:function(){var e=new bK;return e.copy(this),e}};var wK,SK,TK=0,MK=wY.extend({name:"",position:null,rotation:null,scale:null,worldTransform:null,localTransform:null,autoUpdateLocalTransform:!0,_parent:null,_scene:null,_needsUpdateWorldTransform:!0,_inIterating:!1,__depth:0},(function(){this.name||(this.name=(this.type||"NODE")+"_"+TK++),this.position||(this.position=new Fq),this.rotation||(this.rotation=new cK),this.scale||(this.scale=new Fq(1,1,1)),this.worldTransform=new aK,this.localTransform=new aK,this._children=[]}),{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(e){var t=this._scene;if(t){var n=t._nodeRepository;delete n[this.name],n[e]=this}this.name=e},add:function(e){var t=e._parent;if(t!==this){t&&t.remove(e),e._parent=this,this._children.push(e);var n=this._scene;n&&n!==e.scene&&e.traverse(this._addSelfToScene,this),e._needsUpdateWorldTransform=!0}},remove:function(e){var t=this._children,n=t.indexOf(e);n<0||(t.splice(n,1),e._parent=null,this._scene&&e.traverse(this._removeSelfFromScene,this))},removeAll:function(){for(var e=this._children,t=0;t<e.length;t++)e[t]._parent=null,this._scene&&e[t].traverse(this._removeSelfFromScene,this);this._children=[]},getScene:function(){return this._scene},getParent:function(){return this._parent},_removeSelfFromScene:function(e){e._scene.removeFromScene(e),e._scene=null},_addSelfToScene:function(e){this._scene.addToScene(e),e._scene=this._scene},isAncestor:function(e){for(var t=e._parent;t;){if(t===this)return!0;t=t._parent}return!1},children:function(){return this._children.slice()},childAt:function(e){return this._children[e]},getChildByName:function(e){for(var t=this._children,n=0;n<t.length;n++)if(t[n].name===e)return t[n]},getDescendantByName:function(e){for(var t=this._children,n=0;n<t.length;n++){var r=t[n];if(r.name===e)return r;var i=r.getDescendantByName(e);if(i)return i}},queryNode:function(e){if(e){for(var t=e.split("/"),n=this,r=0;r<t.length;r++){var i=t[r];if(i){for(var o=!1,a=n._children,s=0;s<a.length;s++){var l=a[s];if(l.name===i){n=l,o=!0;break}}if(!o)return}}return n}},getPath:function(e){if(!this._parent)return"/";for(var t=this._parent,n=this.name;t._parent&&(n=t.name+"/"+n,t._parent!=e);)t=t._parent;return!t._parent&&e?null:n},traverse:function(e,t){e.call(t,this);for(var n=this._children,r=0,i=n.length;r<i;r++)n[r].traverse(e,t)},eachChild:function(e,t){for(var n=this._children,r=0,i=n.length;r<i;r++){var o=n[r];e.call(t,o,r)}},setLocalTransform:function(e){Cq.copy(this.localTransform.array,e.array),this.decomposeLocalTransform()},decomposeLocalTransform:function(e){var t=e?null:this.scale;this.localTransform.decomposeMatrix(t,this.rotation,this.position)},setWorldTransform:function(e){Cq.copy(this.worldTransform.array,e.array),this.decomposeWorldTransform()},decomposeWorldTransform:(wK=Cq.create(),function(e){var t=this.localTransform,n=this.worldTransform;this._parent?(Cq.invert(wK,this._parent.worldTransform.array),Cq.multiply(t.array,wK,n.array)):Cq.copy(t.array,n.array);var r=e?null:this.scale;t.decomposeMatrix(r,this.rotation,this.position)}),transformNeedsUpdate:function(){return this.position._dirty||this.rotation._dirty||this.scale._dirty},updateLocalTransform:function(){var e=this.position,t=this.rotation,n=this.scale;if(this.transformNeedsUpdate()){var r=this.localTransform.array;Cq.fromRotationTranslation(r,t.array,e.array),Cq.scale(r,r,n.array),t._dirty=!1,n._dirty=!1,e._dirty=!1,this._needsUpdateWorldTransform=!0}},_updateWorldTransformTopDown:function(){var e=this.localTransform.array,t=this.worldTransform.array;this._parent?Cq.multiplyAffine(t,this._parent.worldTransform.array,e):Cq.copy(t,e)},updateWorldTransform:function(){for(var e=this;e&&e.getParent()&&e.getParent().transformNeedsUpdate();)e=e.getParent();e.update()},update:function(e){this.autoUpdateLocalTransform?this.updateLocalTransform():e=!0,(e||this._needsUpdateWorldTransform)&&(this._updateWorldTransformTopDown(),e=!0,this._needsUpdateWorldTransform=!1);for(var t=this._children,n=0,r=t.length;n<r;n++)t[n].update(e)},getBoundingBox:function(){function e(e){return!e.invisible&&e.geometry}var t=new bK,n=new aK,r=new aK;return function(i,o){return o=o||new bK,this._parent?aK.invert(r,this._parent.worldTransform):aK.identity(r),this.traverse((function(e){e.geometry&&e.geometry.boundingBox&&(t.copy(e.geometry.boundingBox),aK.multiply(n,r,e.worldTransform),t.applyTransform(n),o.union(t))}),this,e),o}}(),getWorldPosition:function(e){this.transformNeedsUpdate()&&this.updateWorldTransform();var t=this.worldTransform.array;if(e){var n=e.array;return n[0]=t[12],n[1]=t[13],n[2]=t[14],e}return new Fq(t[12],t[13],t[14])},clone:function(){var e=new this.constructor,t=this._children;e.setName(this.name),e.position.copy(this.position),e.rotation.copy(this.rotation),e.scale.copy(this.scale);for(var n=0;n<t.length;n++)e.add(t[n].clone());return e},rotateAround:function(){var e=new Fq,t=new aK;return function(n,r,i){e.copy(this.position).subtract(n);var o=this.localTransform;o.identity(),o.translate(n),o.rotate(i,r),t.fromRotationTranslation(this.rotation,e),o.multiply(t),o.scale(this.scale),this.decomposeLocalTransform(),this._needsUpdateWorldTransform=!0}}(),lookAt:function(){var e=new aK;return function(t,n){e.lookAt(this.position,t,n||this.localTransform.y).invert(),this.setLocalTransform(e),this.target=t}}()}),CK=MK.extend({material:null,geometry:null,mode:PY,_renderInfo:null},{__program:null,lightGroup:0,renderOrder:0,culling:!0,cullFace:FY,frontFace:UY,frustumCulling:!0,receiveShadow:!0,castShadow:!0,ignorePicking:!1,ignorePreZ:!1,ignoreGBuffer:!1,isRenderable:function(){return this.geometry&&this.material&&this.material.shader&&!this.invisible&&this.geometry.vertexCount>0},beforeRender:function(e){},afterRender:function(e,t){},getBoundingBox:function(e,t){return t=MK.prototype.getBoundingBox.call(this,e,t),this.geometry&&this.geometry.boundingBox&&t.union(this.geometry.boundingBox),t},clone:(SK=["castShadow","receiveShadow","mode","culling","cullFace","frontFace","frustumCulling","renderOrder","lineWidth","ignorePicking","ignorePreZ","ignoreGBuffer"],function(){var e=MK.prototype.clone.call(this);e.geometry=this.geometry,e.material=this.material;for(var t=0;t<SK.length;t++){var n=SK[t];e[n]!==this[n]&&(e[n]=this[n])}return e})});CK.POINTS=IY,CK.LINES=EY,CK.LINE_LOOP=LY,CK.LINE_STRIP=NY,CK.TRIANGLES=PY,CK.TRIANGLE_STRIP=OY,CK.TRIANGLE_FAN=RY,CK.BACK=FY,CK.FRONT=BY,CK.FRONT_AND_BACK=GY,CK.CW=HY,CK.CCW=UY;var DK=wY.extend({scene:null,camera:null,renderer:null},(function(){this._ray=new Jq,this._ndc=new KZ}),{pick:function(e,t,n){return this.pickAll(e,t,[],n)[0]||null},pickAll:function(e,t,n,r){return this.renderer.screenToNDC(e,t,this._ndc),this.camera.castRay(this._ndc,this._ray),n=n||[],this._intersectNode(this.scene,n,r||!1),n.sort(this._intersectionCompareFunc),n},_intersectNode:function(e,t,n){e instanceof CK&&e.isRenderable()&&(e.ignorePicking&&!n||!(e.mode===PY&&e.geometry.isUseIndices()||e.geometry.pickByRay||e.geometry.pick)||this._intersectRenderable(e,t));for(var r=0;r<e._children.length;r++)this._intersectNode(e._children[r],t,n)},_intersectRenderable:function(){var e=new Fq,t=new Fq,n=new Fq,r=new Jq,i=new aK;return function(o,a){var s=o.isSkinnedMesh();r.copy(this._ray),aK.invert(i,o.worldTransform),s||r.applyTransform(i);var l=o.geometry,u=s?o.skeleton.boundingBox:l.boundingBox;if(!u||r.intersectBoundingBox(u))if(l.pick)l.pick(this._ndc.x,this._ndc.y,this.renderer,this.camera,o,a);else if(l.pickByRay)l.pickByRay(r,o,a);else{var c,h,d=o.cullFace===FY&&o.frontFace===UY||o.cullFace===BY&&o.frontFace===HY,p=l.indices,f=l.attributes.position,g=l.attributes.weight,m=l.attributes.joint,v=[];if(f&&f.value&&p){if(s){h=o.skeleton.getSubSkinMatrices(o.__uid__,o.joints);for(var y=0;y<o.joints.length;y++){v[y]=v[y]||[];for(var _=0;_<16;_++)v[y][_]=h[16*y+_]}var x=[],b=[],w=[],S=[],T=[],M=l.attributes.skinnedPosition;M&&M.value||(l.createAttribute("skinnedPosition","f",3),(M=l.attributes.skinnedPosition).init(l.vertexCount));for(y=0;y<l.vertexCount;y++){f.get(y,x),g.get(y,b),m.get(y,w),b[3]=1-b[0]-b[1]-b[2],Dq.set(S,0,0,0);for(_=0;_<4;_++)w[_]>=0&&b[_]>1e-4&&(Dq.transformMat4(T,x,v[w[_]]),Dq.scaleAndAdd(S,S,T,b[_]));M.set(y,S)}}for(y=0;y<p.length;y+=3){var C=p[y],D=p[y+1],A=p[y+2],I=s?l.attributes.skinnedPosition:f;if(I.get(C,e.array),I.get(D,t.array),I.get(A,n.array),c=d?r.intersectTriangle(e,t,n,o.culling):r.intersectTriangle(e,n,t,o.culling)){var E=new Fq;s?Fq.copy(E,c):Fq.transformMat4(E,c,o.worldTransform),a.push(new DK.Intersection(c,E,o,[C,D,A],y/3,Fq.dist(E,this._ray.origin)))}}}}}}(),_intersectionCompareFunc:function(e,t){return e.distance-t.distance}});DK.Intersection=function(e,t,n,r,i,o){this.point=e,this.pointWorld=t,this.target=n,this.triangle=r,this.triangleIndex=i,this.distance=o};var AK="__dt__",IK=function(){this._contextId=0,this._caches=[],this._context={}};IK.prototype={use:function(e,t){var n=this._caches;n[e]||(n[e]={},t&&(n[e]=t())),this._contextId=e,this._context=n[e]},put:function(e,t){this._context[e]=t},get:function(e){return this._context[e]},dirty:function(e){var t=AK+(e=e||"");this.put(t,!0)},dirtyAll:function(e){for(var t=AK+(e=e||""),n=this._caches,r=0;r<n.length;r++)n[r]&&(n[r][t]=!0)},fresh:function(e){var t=AK+(e=e||"");this.put(t,!1)},freshAll:function(e){for(var t=AK+(e=e||""),n=this._caches,r=0;r<n.length;r++)n[r]&&(n[r][t]=!1)},isDirty:function(e){var t=AK+(e=e||""),n=this._context;return!n.hasOwnProperty(t)||!0===n[t]},deleteContext:function(e){delete this._caches[e],this._context={}},delete:function(e){delete this._context[e]},clearAll:function(){this._caches={}},getContext:function(){return this._context},eachContext:function(e,t){Object.keys(this._caches).forEach((function(n){e&&e.call(t,n)}))},miss:function(e){return!this._context.hasOwnProperty(e)}},IK.prototype.constructor=IK;var EK=wY.extend({width:512,height:512,type:jY,format:eZ,wrapS:hZ,wrapT:hZ,minFilter:lZ,magFilter:iZ,useMipmap:!0,anisotropic:1,flipY:!0,sRGB:!0,unpackAlignment:4,premultiplyAlpha:!1,dynamic:!1,NPOT:!1,__used:0},(function(){this._cache=new IK}),{getWebGLTexture:function(e){var t=e.gl,n=this._cache;return n.use(e.__uid__),n.miss("webgl_texture")&&n.put("webgl_texture",t.createTexture()),this.dynamic?this.update(e):n.isDirty()&&(this.update(e),n.fresh()),n.get("webgl_texture")},bind:function(){},unbind:function(){},dirty:function(){this._cache&&this._cache.dirtyAll()},update:function(e){},updateCommon:function(e){var t=e.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,this.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,this.unpackAlignment),this.format===$Y&&(this.useMipmap=!1);var n=e.getGLExtension("EXT_sRGB");this.format!==EK.SRGB||n||(this.format=EK.RGB),this.format!==EK.SRGB_ALPHA||n||(this.format=EK.RGBA),this.NPOT=!this.isPowerOfTwo()},getAvailableWrapS:function(){return this.NPOT?dZ:this.wrapS},getAvailableWrapT:function(){return this.NPOT?dZ:this.wrapT},getAvailableMinFilter:function(){var e=this.minFilter;return this.NPOT||!this.useMipmap?e===oZ||e===sZ?rZ:e===lZ||e===aZ?iZ:e:e},getAvailableMagFilter:function(){return this.magFilter},nextHighestPowerOfTwo:function(e){--e;for(var t=1;t<32;t<<=1)e|=e>>t;return e+1},dispose:function(e){var t=this._cache;t.use(e.__uid__);var n=t.get("webgl_texture");n&&e.gl.deleteTexture(n),t.deleteContext(e.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(EK.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e}}),Object.defineProperty(EK.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e}}),EK.BYTE=WY,EK.UNSIGNED_BYTE=jY,EK.SHORT=XY,EK.UNSIGNED_SHORT=YY,EK.INT=ZY,EK.UNSIGNED_INT=qY,EK.FLOAT=KY,EK.HALF_FLOAT=36193,EK.UNSIGNED_INT_24_8_WEBGL=34042,EK.DEPTH_COMPONENT=$Y,EK.DEPTH_STENCIL=mZ,EK.ALPHA=JY,EK.RGB=QY,EK.RGBA=eZ,EK.LUMINANCE=tZ,EK.LUMINANCE_ALPHA=nZ,EK.SRGB=35904,EK.SRGB_ALPHA=35906,EK.COMPRESSED_RGB_S3TC_DXT1_EXT=33776,EK.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777,EK.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778,EK.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779,EK.NEAREST=rZ,EK.LINEAR=iZ,EK.NEAREST_MIPMAP_NEAREST=oZ,EK.LINEAR_MIPMAP_NEAREST=aZ,EK.NEAREST_MIPMAP_LINEAR=sZ,EK.LINEAR_MIPMAP_LINEAR=lZ,EK.REPEAT=hZ,EK.CLAMP_TO_EDGE=dZ,EK.MIRRORED_REPEAT=pZ;var LK=CK.extend({skeleton:null,joints:null},(function(){this.joints||(this.joints=[])}),{offsetMatrix:null,isInstancedMesh:function(){return!1},isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&this.joints.length>0)},clone:function(){var e=CK.prototype.clone.call(this);return e.skeleton=this.skeleton,this.joints&&(e.joints=this.joints.slice()),e}});LK.POINTS=IY,LK.LINES=EY,LK.LINE_LOOP=LY,LK.LINE_STRIP=NY,LK.TRIANGLES=PY,LK.TRIANGLE_STRIP=OY,LK.TRIANGLE_FAN=RY,LK.BACK=FY,LK.FRONT=BY,LK.FRONT_AND_BACK=GY,LK.CW=HY,LK.CCW=UY;var NK={isPowerOfTwo:function(e){return!(e&e-1)},nextPowerOfTwo:function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},nearestPowerOfTwo:function(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}},PK=NK.isPowerOfTwo;function OK(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}var RK=EK.extend((function(){return{image:null,pixels:null,mipmaps:[],convertToPOT:!1}}),{textureType:"texture2D",update:function(e){var t=e.gl;t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(e);var n=this.format,r=this.type,i=!(!this.convertToPOT||this.mipmaps.length||!this.image||this.wrapS!==EK.REPEAT&&this.wrapT!==EK.REPEAT||!this.NPOT);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,i?this.wrapS:this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,i?this.wrapT:this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,i?this.magFilter:this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,i?this.minFilter:this.getAvailableMinFilter());var o=e.getGLExtension("EXT_texture_filter_anisotropic");(o&&this.anisotropic>1&&t.texParameterf(t.TEXTURE_2D,o.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===r)&&(e.getGLExtension("OES_texture_half_float")||(r=KY));if(this.mipmaps.length)for(var a=this.width,s=this.height,l=0;l<this.mipmaps.length;l++){var u=this.mipmaps[l];this._updateTextureData(t,u,l,a,s,n,r,!1),a/=2,s/=2}else this._updateTextureData(t,this,0,this.width,this.height,n,r,i),!this.useMipmap||this.NPOT&&!i||t.generateMipmap(t.TEXTURE_2D);t.bindTexture(t.TEXTURE_2D,null)},_updateTextureData:function(e,t,n,r,i,o,a,s){if(t.image){var l=t.image;s&&(this._potCanvas=function(e,t){var n=OK(e.width),r=OK(e.height);return(t=t||document.createElement("canvas")).width=n,t.height=r,t.getContext("2d").drawImage(e.image,0,0,n,r),t}(this,this._potCanvas),l=this._potCanvas),e.texImage2D(e.TEXTURE_2D,n,o,o,a,l)}else o<=EK.COMPRESSED_RGBA_S3TC_DXT5_EXT&&o>=EK.COMPRESSED_RGB_S3TC_DXT1_EXT?e.compressedTexImage2D(e.TEXTURE_2D,n,o,r,i,0,t.pixels):e.texImage2D(e.TEXTURE_2D,n,o,r,i,0,o,a,t.pixels)},generateMipmap:function(e){var t=e.gl;this.useMipmap&&!this.NPOT&&(t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),t.generateMipmap(t.TEXTURE_2D))},isPowerOfTwo:function(){return PK(this.width)&&PK(this.height)},isRenderable:function(){return this.image?this.image.width>0&&this.image.height>0:!(!this.width||!this.height)},bind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,this.getWebGLTexture(e))},unbind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},load:function(e,t){var n=SZ.createImage();t&&(n.crossOrigin=t);var r=this;return n.onload=function(){r.dirty(),r.trigger("success",r)},n.onerror=function(){r.trigger("error",r)},n.src=e,this.image=n,this}});function kK(e){return{byte:SZ.Int8Array,ubyte:SZ.Uint8Array,short:SZ.Int16Array,ushort:SZ.Uint16Array}[e]||SZ.Float32Array}function zK(e){return"attr_"+e}function VK(e,t,n,r){switch(this.name=e,this.type=t,this.size=n,this.semantic=r||"",this.value=null,n){case 1:this.get=function(e){return this.value[e]},this.set=function(e,t){this.value[e]=t},this.copy=function(e,t){this.value[e]=this.value[e]};break;case 2:this.get=function(e,t){var n=this.value;return t[0]=n[2*e],t[1]=n[2*e+1],t},this.set=function(e,t){var n=this.value;n[2*e]=t[0],n[2*e+1]=t[1]},this.copy=function(e,t){var n=this.value;t*=2,n[e*=2]=n[t],n[e+1]=n[t+1]};break;case 3:this.get=function(e,t){var n=3*e,r=this.value;return t[0]=r[n],t[1]=r[n+1],t[2]=r[n+2],t},this.set=function(e,t){var n=3*e,r=this.value;r[n]=t[0],r[n+1]=t[1],r[n+2]=t[2]},this.copy=function(e,t){var n=this.value;t*=3,n[e*=3]=n[t],n[e+1]=n[t+1],n[e+2]=n[t+2]};break;case 4:this.get=function(e,t){var n=this.value,r=4*e;return t[0]=n[r],t[1]=n[r+1],t[2]=n[r+2],t[3]=n[r+3],t},this.set=function(e,t){var n=this.value,r=4*e;n[r]=t[0],n[r+1]=t[1],n[r+2]=t[2],n[r+3]=t[3]},this.copy=function(e,t){var n=this.value;t*=4,n[e*=4]=n[t],n[e+1]=n[t+1],n[e+2]=n[t+2],n[e+3]=n[t+3]}}}function BK(e,t,n,r,i){this.name=e,this.type=t,this.buffer=n,this.size=r,this.semantic=i,this.symbol="",this.needsRemove=!1}function FK(e){this.buffer=e,this.count=0}Object.defineProperty(RK.prototype,"width",{get:function(){return this.image?this.image.width:this._width},set:function(e){this.image?console.warn("Texture from image can't set width"):(this._width!==e&&this.dirty(),this._width=e)}}),Object.defineProperty(RK.prototype,"height",{get:function(){return this.image?this.image.height:this._height},set:function(e){this.image?console.warn("Texture from image can't set height"):(this._height!==e&&this.dirty(),this._height=e)}}),VK.prototype.init=function(e){if(!this.value||this.value.length!==e*this.size){var t=kK(this.type);this.value=new t(e*this.size)}},VK.prototype.fromArray=function(e){var t,n=kK(this.type);if(e[0]&&e[0].length){var r=0,i=this.size;t=new n(e.length*i);for(var o=0;o<e.length;o++)for(var a=0;a<i;a++)t[r++]=e[o][a]}else t=new n(e);this.value=t},VK.prototype.clone=function(e){var t=new VK(this.name,this.type,this.size,this.semantic);return e&&console.warn("todo"),t};var GK=wY.extend((function(){return{attributes:{},indices:null,dynamic:!0,_enabledAttributes:null,__used:0}}),(function(){this._cache=new IK,this._attributeList=Object.keys(this.attributes),this.__vaoCache={}}),{mainAttribute:"",pick:null,pickByRay:null,dirty:function(){for(var e=this.getEnabledAttributes(),t=0;t<e.length;t++)this.dirtyAttribute(e[t]);this.dirtyIndices(),this._enabledAttributes=null,this._cache.dirty("any")},dirtyIndices:function(){this._cache.dirtyAll("indices")},dirtyAttribute:function(e){this._cache.dirtyAll(zK(e)),this._cache.dirtyAll("attributes")},getTriangleIndices:function(e,t){if(e<this.triangleCount&&e>=0){t||(t=[]);var n=this.indices;return t[0]=n[3*e],t[1]=n[3*e+1],t[2]=n[3*e+2],t}},setTriangleIndices:function(e,t){var n=this.indices;n[3*e]=t[0],n[3*e+1]=t[1],n[3*e+2]=t[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(e){var t,n=this.vertexCount>65535?SZ.Uint32Array:SZ.Uint16Array;if(e[0]&&e[0].length){var r=0;t=new n(3*e.length);for(var i=0;i<e.length;i++)for(var o=0;o<3;o++)t[r++]=e[i][o]}else t=new n(e);this.indices=t},createAttribute:function(e,t,n,r){var i=new VK(e,t,n,r);return this.attributes[e]&&this.removeAttribute(e),this.attributes[e]=i,this._attributeList.push(e),i},removeAttribute:function(e){var t=this._attributeList,n=t.indexOf(e);return n>=0&&(t.splice(n,1),delete this.attributes[e],!0)},getAttribute:function(e){return this.attributes[e]},getEnabledAttributes:function(){var e=this._enabledAttributes,t=this._attributeList;if(e)return e;for(var n=[],r=this.vertexCount,i=0;i<t.length;i++){var o=t[i],a=this.attributes[o];a.value&&a.value.length===r*a.size&&n.push(o)}return this._enabledAttributes=n,n},getBufferChunks:function(e){var t=this._cache;t.use(e.__uid__);var n=t.isDirty("attributes"),r=t.isDirty("indices");if(n||r){this._updateBuffer(e.gl,n,r);for(var i=this.getEnabledAttributes(),o=0;o<i.length;o++)t.fresh(zK(i[o]));t.fresh("attributes"),t.fresh("indices")}return t.fresh("any"),t.get("chunks")},_updateBuffer:function(e,t,n){var r=this._cache,i=r.get("chunks"),o=!1;i||((i=[])[0]={attributeBuffers:[],indicesBuffer:null},r.put("chunks",i),o=!0);var a=i[0],s=a.attributeBuffers,l=a.indicesBuffer;if(t||o){var u=this.getEnabledAttributes(),c={};if(!o)for(var h=0;h<s.length;h++)c[s[h].name]=s[h];for(var d=0;d<u.length;d++){var p,f,g=u[d],m=this.attributes[g];o||(p=c[g]),f=p?p.buffer:e.createBuffer(),r.isDirty(zK(g))&&(e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferData(e.ARRAY_BUFFER,m.value,this.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW)),s[d]=new BK(g,m.type,f,m.size,m.semantic)}for(h=d;h<s.length;h++)e.deleteBuffer(s[h].buffer);s.length=d}this.isUseIndices()&&(n||o)&&(l||(l=new FK(e.createBuffer()),a.indicesBuffer=l),l.count=this.indices.length,e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,l.buffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices,this.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW))},dispose:function(e){var t=this._cache;t.use(e.__uid__);var n=t.get("chunks");if(n)for(var r=0;r<n.length;r++){for(var i=n[r],o=0;o<i.attributeBuffers.length;o++){var a=i.attributeBuffers[o];e.gl.deleteBuffer(a.buffer)}i.indicesBuffer&&e.gl.deleteBuffer(i.indicesBuffer.buffer)}if(this.__vaoCache){var s=e.getGLExtension("OES_vertex_array_object");for(var l in this.__vaoCache){var u=this.__vaoCache[l].vao;u&&s.deleteVertexArrayOES(u)}}this.__vaoCache={},t.deleteContext(e.__uid__)}});Object.defineProperty&&(Object.defineProperty(GK.prototype,"vertexCount",{enumerable:!1,get:function(){var e=this.attributes[this.mainAttribute];return e||(e=this.attributes[this._attributeList[0]]),e&&e.value?e.value.length/e.size:0}}),Object.defineProperty(GK.prototype,"triangleCount",{enumerable:!1,get:function(){var e=this.indices;return e?e.length/3:0}})),GK.STATIC_DRAW=zY,GK.DYNAMIC_DRAW=VY,GK.STREAM_DRAW=kY,GK.AttributeBuffer=BK,GK.IndicesBuffer=FK,GK.Attribute=VK;var HK=Dq.create,UK=Dq.add,WK=Dq.set,jK=GK.Attribute,XK=GK.extend((function(){return{attributes:{position:new jK("position","float",3,"POSITION"),texcoord0:new jK("texcoord0","float",2,"TEXCOORD_0"),texcoord1:new jK("texcoord1","float",2,"TEXCOORD_1"),normal:new jK("normal","float",3,"NORMAL"),tangent:new jK("tangent","float",4,"TANGENT"),color:new jK("color","float",4,"COLOR"),weight:new jK("weight","float",3,"WEIGHT"),joint:new jK("joint","float",4,"JOINT"),barycentric:new jK("barycentric","float",3,null)},boundingBox:null}}),{mainAttribute:"position",updateBoundingBox:function(){var e=this.boundingBox;e||(e=this.boundingBox=new bK);var t=this.attributes.position.value;if(t&&t.length){var n=e.min,r=e.max,i=n.array,o=r.array;Dq.set(i,t[0],t[1],t[2]),Dq.set(o,t[0],t[1],t[2]);for(var a=3;a<t.length;){var s=t[a++],l=t[a++],u=t[a++];s<i[0]&&(i[0]=s),l<i[1]&&(i[1]=l),u<i[2]&&(i[2]=u),s>o[0]&&(o[0]=s),l>o[1]&&(o[1]=l),u>o[2]&&(o[2]=u)}n._dirty=!0,r._dirty=!0}},generateVertexNormals:function(){if(this.vertexCount){var e=this.indices,t=this.attributes,n=t.position.value,r=t.normal.value;if(r&&r.length===n.length)for(var i=0;i<r.length;i++)r[i]=0;else r=t.normal.value=new SZ.Float32Array(n.length);for(var o,a,s,l=HK(),u=HK(),c=HK(),h=HK(),d=HK(),p=HK(),f=e?e.length:this.vertexCount,g=0;g<f;){e?(o=e[g++],a=e[g++],s=e[g++]):(o=g++,a=g++,s=g++),WK(l,n[3*o],n[3*o+1],n[3*o+2]),WK(u,n[3*a],n[3*a+1],n[3*a+2]),WK(c,n[3*s],n[3*s+1],n[3*s+2]),Dq.sub(h,l,u),Dq.sub(d,u,c),Dq.cross(p,h,d);for(i=0;i<3;i++)r[3*o+i]=r[3*o+i]+p[i],r[3*a+i]=r[3*a+i]+p[i],r[3*s+i]=r[3*s+i]+p[i]}for(i=0;i<r.length;)WK(p,r[i],r[i+1],r[i+2]),Dq.normalize(p,p),r[i++]=p[0],r[i++]=p[1],r[i++]=p[2];this.dirty()}},generateFaceNormals:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var e=this.indices,t=this.attributes,n=t.position.value,r=t.normal.value,i=HK(),o=HK(),a=HK(),s=HK(),l=HK(),u=HK();r||(r=t.normal.value=new Float32Array(n.length));for(var c,h,d,p=e?e.length:this.vertexCount,f=0;f<p;){e?(c=e[f++],h=e[f++],d=e[f++]):(c=f++,h=f++,d=f++),WK(i,n[3*c],n[3*c+1],n[3*c+2]),WK(o,n[3*h],n[3*h+1],n[3*h+2]),WK(a,n[3*d],n[3*d+1],n[3*d+2]),Dq.sub(s,i,o),Dq.sub(l,o,a),Dq.cross(u,s,l),Dq.normalize(u,u);for(var g=0;g<3;g++)r[3*c+g]=u[g],r[3*h+g]=u[g],r[3*d+g]=u[g]}this.dirty()}},generateTangents:function(){if(this.vertexCount){var e=this.vertexCount,t=this.attributes;t.tangent.value||(t.tangent.value=new Float32Array(4*e));var n=t.texcoord0.value,r=t.position.value,i=t.tangent.value,o=t.normal.value;if(n){for(var a=[],s=[],l=0;l<e;l++)a[l]=[0,0,0],s[l]=[0,0,0];var u,c,h,d=[0,0,0],p=[0,0,0],f=this.indices,g=f?f.length:this.vertexCount;for(l=0;l<g;){f?(u=f[l++],c=f[l++],h=f[l++]):(u=l++,c=l++,h=l++);var m=n[2*u],v=n[2*c],y=n[2*h],_=n[2*u+1],x=n[2*c+1],b=n[2*h+1],w=r[3*u],S=r[3*c],T=r[3*h],M=r[3*u+1],C=r[3*c+1],D=r[3*h+1],A=r[3*u+2],I=S-w,E=T-w,L=C-M,N=D-M,P=r[3*c+2]-A,O=r[3*h+2]-A,R=v-m,k=y-m,z=x-_,V=b-_,B=1/(R*V-z*k);d[0]=(V*I-z*E)*B,d[1]=(V*L-z*N)*B,d[2]=(V*P-z*O)*B,p[0]=(R*E-k*I)*B,p[1]=(R*N-k*L)*B,p[2]=(R*O-k*P)*B,UK(a[u],a[u],d),UK(a[c],a[c],d),UK(a[h],a[h],d),UK(s[u],s[u],p),UK(s[c],s[c],p),UK(s[h],s[h],p)}var F=HK(),G=HK(),H=HK();for(l=0;l<e;l++){H[0]=o[3*l],H[1]=o[3*l+1],H[2]=o[3*l+2];var U=a[l];Dq.scale(F,H,Dq.dot(H,U)),Dq.sub(F,U,F),Dq.normalize(F,F),Dq.cross(G,H,U),i[4*l]=F[0],i[4*l+1]=F[1],i[4*l+2]=F[2],i[4*l+3]=Dq.dot(G,s[l])<0?-1:1}this.dirty()}else console.warn("Geometry without texcoords can't generate tangents.")}},isUniqueVertex:function(){return!this.isUseIndices()||this.vertexCount===this.indices.length},generateUniqueVertex:function(){if(this.vertexCount&&this.indices){this.indices.length>65535&&(this.indices=new SZ.Uint32Array(this.indices));for(var e=this.attributes,t=this.indices,n=this.getEnabledAttributes(),r={},i=0;i<n.length;i++){r[l=n[i]]=e[l].value,e[l].init(this.indices.length)}for(var o=0,a=0;a<t.length;a++){var s=t[a];for(i=0;i<n.length;i++)for(var l,u=e[l=n[i]].value,c=e[l].size,h=0;h<c;h++)u[o*c+h]=r[l][s*c+h];t[a]=o,o++}this.dirty()}},generateBarycentric:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var e=this.attributes,t=e.barycentric.value,n=this.indices;if(!t||t.length!==3*n.length){t=e.barycentric.value=new Float32Array(3*n.length);for(var r=0;r<(n?n.length:this.vertexCount/3);)for(var i=0;i<3;i++){t[3*(n?n[r++]:3*r+i)+i]=1}this.dirty()}}},applyTransform:function(e){var t=this.attributes,n=t.position.value,r=t.normal.value,i=t.tangent.value;e=e.array;var o=Cq.create();Cq.invert(o,e),Cq.transpose(o,o);var a=Dq.transformMat4,s=Dq.forEach;s(n,3,0,null,a,e),r&&s(r,3,0,null,a,o),i&&s(i,4,0,null,a,o),this.boundingBox&&this.updateBoundingBox()},dispose:function(e){var t=this._cache;t.use(e.__uid__);var n=t.get("chunks");if(n)for(var r=0;r<n.length;r++){for(var i=n[r],o=0;o<i.attributeBuffers.length;o++){var a=i.attributeBuffers[o];e.gl.deleteBuffer(a.buffer)}i.indicesBuffer&&e.gl.deleteBuffer(i.indicesBuffer.buffer)}if(this.__vaoCache){var s=e.getGLExtension("OES_vertex_array_object");for(var l in this.__vaoCache){var u=this.__vaoCache[l].vao;u&&s.deleteVertexArrayOES(u)}}this.__vaoCache={},t.deleteContext(e.__uid__)}});XK.STATIC_DRAW=GK.STATIC_DRAW,XK.DYNAMIC_DRAW=GK.DYNAMIC_DRAW,XK.STREAM_DRAW=GK.STREAM_DRAW,XK.AttributeBuffer=GK.AttributeBuffer,XK.IndicesBuffer=GK.IndicesBuffer,XK.Attribute=jK;var YK="uniform vec3 ",ZK="uniform float ",qK="@export clay.header.",KK="@end",$K=":unconfigurable;",JK=[qK+"directional_light",YK+"directionalLightDirection[DIRECTIONAL_LIGHT_COUNT]"+$K,YK+"directionalLightColor[DIRECTIONAL_LIGHT_COUNT]"+$K,KK,qK+"ambient_light",YK+"ambientLightColor[AMBIENT_LIGHT_COUNT]"+$K,KK,qK+"ambient_sh_light",YK+"ambientSHLightColor[AMBIENT_SH_LIGHT_COUNT]"+$K,YK+"ambientSHLightCoefficients[AMBIENT_SH_LIGHT_COUNT * 9]"+$K,"vec3 calcAmbientSHLight(int idx, vec3 N) {\n int offset = 9 * idx;\n return ambientSHLightCoefficients[0]\n + ambientSHLightCoefficients[1] * N.x\n + ambientSHLightCoefficients[2] * N.y\n + ambientSHLightCoefficients[3] * N.z\n + ambientSHLightCoefficients[4] * N.x * N.z\n + ambientSHLightCoefficients[5] * N.z * N.y\n + ambientSHLightCoefficients[6] * N.y * N.x\n + ambientSHLightCoefficients[7] * (3.0 * N.z * N.z - 1.0)\n + ambientSHLightCoefficients[8] * (N.x * N.x - N.y * N.y);\n}",KK,qK+"ambient_cubemap_light",YK+"ambientCubemapLightColor[AMBIENT_CUBEMAP_LIGHT_COUNT]"+$K,"uniform samplerCube ambientCubemapLightCubemap[AMBIENT_CUBEMAP_LIGHT_COUNT]"+$K,"uniform sampler2D ambientCubemapLightBRDFLookup[AMBIENT_CUBEMAP_LIGHT_COUNT]"+$K,KK,qK+"point_light",YK+"pointLightPosition[POINT_LIGHT_COUNT]"+$K,ZK+"pointLightRange[POINT_LIGHT_COUNT]"+$K,YK+"pointLightColor[POINT_LIGHT_COUNT]"+$K,KK,qK+"spot_light",YK+"spotLightPosition[SPOT_LIGHT_COUNT]"+$K,YK+"spotLightDirection[SPOT_LIGHT_COUNT]"+$K,ZK+"spotLightRange[SPOT_LIGHT_COUNT]"+$K,ZK+"spotLightUmbraAngleCosine[SPOT_LIGHT_COUNT]"+$K,ZK+"spotLightPenumbraAngleCosine[SPOT_LIGHT_COUNT]"+$K,ZK+"spotLightFalloffFactor[SPOT_LIGHT_COUNT]"+$K,YK+"spotLightColor[SPOT_LIGHT_COUNT]"+$K,KK].join("\n");wq.import(JK);var QK,e$,t$,n$,r$=MK.extend((function(){return{color:[1,1,1],intensity:1,castShadow:!0,shadowResolution:512,group:0}}),{type:"",clone:function(){var e=MK.prototype.clone.call(this);return e.color=Array.prototype.slice.call(this.color),e.intensity=this.intensity,e.castShadow=this.castShadow,e.shadowResolution=this.shadowResolution,e}}),i$=function(e,t){this.normal=e||new Fq(0,1,0),this.distance=t||0};i$.prototype={constructor:i$,distanceToPoint:function(e){return Dq.dot(e.array,this.normal.array)-this.distance},projectPoint:function(e,t){t||(t=new Fq);var n=this.distanceToPoint(e);return Dq.scaleAndAdd(t.array,e.array,this.normal.array,-n),t._dirty=!0,t},normalize:function(){var e=1/Dq.len(this.normal.array);Dq.scale(this.normal.array,e),this.distance*=e},intersectFrustum:function(e){for(var t=e.vertices,n=this.normal.array,r=Dq.dot(t[0].array,n)>this.distance,i=1;i<8;i++)if(Dq.dot(t[i].array,n)>this.distance!=r)return!0},intersectLine:(n$=Dq.create(),function(e,t,n){var r=this.distanceToPoint(e),i=this.distanceToPoint(t);if(r>0&&i>0||r<0&&i<0)return null;var o=this.normal.array,a=this.distance,s=e.array;Dq.sub(n$,t.array,e.array),Dq.normalize(n$,n$);var l=Dq.dot(o,n$);if(0===l)return null;n||(n=new Fq);var u=(Dq.dot(o,s)-a)/l;return Dq.scaleAndAdd(n.array,s,n$,-u),n._dirty=!0,n}),applyTransform:(QK=Cq.create(),e$=Qq.create(),t$=Qq.create(),t$[3]=1,function(e){e=e.array,Dq.scale(t$,this.normal.array,this.distance),Qq.transformMat4(t$,t$,e),this.distance=Dq.dot(t$,this.normal.array),Cq.invert(QK,e),Cq.transpose(QK,QK),e$[3]=0,Dq.copy(e$,this.normal.array),Qq.transformMat4(e$,e$,QK),Dq.copy(this.normal.array,e$)}),copy:function(e){Dq.copy(this.normal.array,e.normal.array),this.normal._dirty=!0,this.distance=e.distance},clone:function(){var e=new i$;return e.copy(this),e}};var o$,a$=Dq.set,s$=Dq.copy,l$=Dq.transformMat4,u$=Math.min,c$=Math.max,h$=function(){this.planes=[];for(var e=0;e<6;e++)this.planes.push(new i$);this.boundingBox=new bK,this.vertices=[];for(e=0;e<8;e++)this.vertices[e]=Dq.fromValues(0,0,0)};h$.prototype={setFromProjection:function(e){var t=this.planes,n=e.array,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],u=n[6],c=n[7],h=n[8],d=n[9],p=n[10],f=n[11],g=n[12],m=n[13],v=n[14],y=n[15];a$(t[0].normal.array,a-r,c-s,f-h),t[0].distance=-(y-g),t[0].normalize(),a$(t[1].normal.array,a+r,c+s,f+h),t[1].distance=-(y+g),t[1].normalize(),a$(t[2].normal.array,a+i,c+l,f+d),t[2].distance=-(y+m),t[2].normalize(),a$(t[3].normal.array,a-i,c-l,f-d),t[3].distance=-(y-m),t[3].normalize(),a$(t[4].normal.array,a-o,c-u,f-p),t[4].distance=-(y-v),t[4].normalize(),a$(t[5].normal.array,a+o,c+u,f+p),t[5].distance=-(y+v),t[5].normalize();var _=this.boundingBox,x=this.vertices;if(0===y){var b=l/r,w=-v/(p-1),S=-v/(p+1),T=-S/l,M=-w/l;_.min.set(-T*b,-T,S),_.max.set(T*b,T,w),a$(x[0],-T*b,-T,S),a$(x[1],-T*b,T,S),a$(x[2],T*b,-T,S),a$(x[3],T*b,T,S),a$(x[4],-M*b,-M,w),a$(x[5],-M*b,M,w),a$(x[6],M*b,-M,w),a$(x[7],M*b,M,w)}else{var C=(-1-g)/r,D=(1-g)/r,A=(1-m)/l,I=(-1-m)/l,E=(-1-v)/p,L=(1-v)/p;_.min.set(Math.min(C,D),Math.min(I,A),Math.min(L,E)),_.max.set(Math.max(D,C),Math.max(A,I),Math.max(E,L));var N=_.min.array,P=_.max.array;a$(x[0],N[0],N[1],N[2]),a$(x[1],N[0],P[1],N[2]),a$(x[2],P[0],N[1],N[2]),a$(x[3],P[0],P[1],N[2]),a$(x[4],N[0],N[1],P[2]),a$(x[5],N[0],P[1],P[2]),a$(x[6],P[0],N[1],P[2]),a$(x[7],P[0],P[1],P[2])}},getTransformedBoundingBox:(o$=Dq.create(),function(e,t){var n=this.vertices,r=t.array,i=e.min,o=e.max,a=i.array,s=o.array,l=n[0];l$(o$,l,r),s$(a,o$),s$(s,o$);for(var u=1;u<8;u++)l=n[u],l$(o$,l,r),a[0]=u$(o$[0],a[0]),a[1]=u$(o$[1],a[1]),a[2]=u$(o$[2],a[2]),s[0]=c$(o$[0],s[0]),s[1]=c$(o$[1],s[1]),s[2]=c$(o$[2],s[2]);return i._dirty=!0,o._dirty=!0,e})};var d$,p$=MK.extend((function(){return{projectionMatrix:new aK,invProjectionMatrix:new aK,viewMatrix:new aK,frustum:new h$}}),(function(){this.update(!0)}),{update:function(e){MK.prototype.update.call(this,e),aK.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),aK.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(e){aK.copy(this.viewMatrix,e),aK.invert(this.worldTransform,e),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(e){aK.copy(this.projectionMatrix,e),aK.invert(this.invProjectionMatrix,e),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:(d$=Qq.create(),function(e,t){var n=void 0!==t?t:new Jq,r=e.array[0],i=e.array[1];return Qq.set(d$,r,i,-1,1),Qq.transformMat4(d$,d$,this.invProjectionMatrix.array),Qq.transformMat4(d$,d$,this.worldTransform.array),Dq.scale(n.origin.array,d$,1/d$[3]),Qq.set(d$,r,i,1,1),Qq.transformMat4(d$,d$,this.invProjectionMatrix.array),Qq.transformMat4(d$,d$,this.worldTransform.array),Dq.scale(d$,d$,1/d$[3]),Dq.sub(n.direction.array,d$,n.origin.array),Dq.normalize(n.direction.array,n.direction.array),n.direction._dirty=!0,n.origin._dirty=!0,n})}),f$=Cq.create(),g$=Cq.create(),m$={};function v$(e){var t=[],n=Object.keys(e);n.sort();for(var r=0;r<n.length;r++){var i=n[r];t.push(i+" "+e[i])}var o=t.join("\n");if(m$[o])return m$[o];var a=bY.genGUID();return m$[o]=a,a}function y$(){this.opaque=[],this.transparent=[],this._opaqueCount=0,this._transparentCount=0}y$.prototype.startCount=function(){this._opaqueCount=0,this._transparentCount=0},y$.prototype.add=function(e,t){t?this.transparent[this._transparentCount++]=e:this.opaque[this._opaqueCount++]=e},y$.prototype.endCount=function(){this.transparent.length=this._transparentCount,this.opaque.length=this._opaqueCount};var _$,x$,b$=MK.extend((function(){return{material:null,lights:[],viewBoundingBoxLastFrame:new bK,shadowUniforms:{},_cameraList:[],_lightUniforms:{},_previousLightNumber:{},_lightNumber:{},_lightProgramKeys:{},_nodeRepository:{},_renderLists:new CZ(20)}}),(function(){this._scene=this}),{addToScene:function(e){e instanceof p$?(this._cameraList.length>0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(e)):e instanceof r$&&this.lights.push(e),e.name&&(this._nodeRepository[e.name]=e)},removeFromScene:function(e){var t;e instanceof p$?(t=this._cameraList.indexOf(e))>=0&&this._cameraList.splice(t,1):e instanceof r$&&(t=this.lights.indexOf(e))>=0&&this.lights.splice(t,1),e.name&&delete this._nodeRepository[e.name]},getNode:function(e){return this._nodeRepository[e]},setMainCamera:function(e){var t=this._cameraList.indexOf(e);t>=0&&this._cameraList.splice(t,1),this._cameraList.unshift(e)},getMainCamera:function(){return this._cameraList[0]},getLights:function(){return this.lights},updateLights:function(){var e=this.lights;this._previousLightNumber=this._lightNumber;for(var t={},n=0;n<e.length;n++){var r=e[n];if(!r.invisible){var i=r.group;t[i]||(t[i]={}),t[i][r.type]=t[i][r.type]||0,t[i][r.type]++}}for(var o in this._lightNumber=t,t)this._lightProgramKeys[o]=v$(t[o]);this._updateLightUniforms()},cloneNode:function(e){var t=e.clone(),n={};return function e(t,r){n[t.__uid__]=r;for(var i=0;i<t._children.length;i++){e(t._children[i],r._children[i])}}(e,t),t.traverse((function(e){e.skeleton&&(e.skeleton=e.skeleton.clone(n)),e.material&&(e.material=e.material.clone())})),t},updateRenderList:function(e,t){var n=e.__uid__,r=this._renderLists.get(n);r||(r=new y$,this._renderLists.put(n,r)),r.startCount(),t&&(this.viewBoundingBoxLastFrame.min.set(1/0,1/0,1/0),this.viewBoundingBoxLastFrame.max.set(-1/0,-1/0,-1/0));var i=this.material&&this.material.transparent||!1;return this._doUpdateRenderList(this,e,i,r,t),r.endCount(),r},getRenderList:function(e){return this._renderLists.get(e.__uid__)},_doUpdateRenderList:function(e,t,n,r,i){if(!e.invisible)for(var o=0;o<e._children.length;o++){var a=e._children[o];if(a.isRenderable()){var s=a.isSkinnedMesh()?f$:a.worldTransform.array,l=a.geometry;Cq.multiplyAffine(g$,t.viewMatrix.array,s),(i&&!l.boundingBox||!this.isFrustumCulled(a,t,g$))&&r.add(a,a.material.transparent||n)}a._children.length>0&&this._doUpdateRenderList(a,t,n,r,i)}},isFrustumCulled:(_$=new bK,x$=new aK,function(e,t,n){var r=e.boundingBox;if(r||(r=e.skeleton&&e.skeleton.boundingBox?e.skeleton.boundingBox:e.geometry.boundingBox),!r)return!1;if(x$.array=n,_$.transformFrom(r,x$),e.castShadow&&this.viewBoundingBoxLastFrame.union(_$),e.frustumCulling){if(!_$.intersectBoundingBox(t.frustum.boundingBox))return!0;x$.array=t.projectionMatrix.array,_$.max.array[2]>0&&_$.min.array[2]<0&&(_$.max.array[2]=-1e-20),_$.applyProjection(x$);var i=_$.min.array,o=_$.max.array;if(o[0]<-1||i[0]>1||o[1]<-1||i[1]>1||o[2]<-1||i[2]>1)return!0}return!1}),_updateLightUniforms:function(){var e=this.lights;e.sort(w$);var t=this._lightUniforms;for(var n in t)for(var r in t[n])t[n][r].value.length=0;for(var i=0;i<e.length;i++){var o=e[i];if(!o.invisible){n=o.group;for(var r in o.uniformTemplates){var a=o.uniformTemplates[r],s=a.value(o);if(null!=s){t[n]||(t[n]={}),t[n][r]||(t[n][r]={type:"",value:[]});var l=t[n][r];switch(l.type=a.type+"v",a.type){case"1i":case"1f":case"t":l.value.push(s);break;case"2f":case"3f":case"4f":for(var u=0;u<s.length;u++)l.value.push(s[u]);break;default:console.error("Unkown light uniform type "+a.type)}}}}}},getLightGroups:function(){var e=[];for(var t in this._lightNumber)e.push(t);return e},getNumberChangedLightGroups:function(){var e=[];for(var t in this._lightNumber)this.isLightNumberChanged(t)&&e.push(t);return e},isLightNumberChanged:function(e){var t=this._previousLightNumber,n=this._lightNumber;for(var r in n[e]){if(!t[e])return!0;if(n[e][r]!==t[e][r])return!0}for(var r in t[e]){if(!n[e])return!0;if(n[e][r]!==t[e][r])return!0}return!1},getLightsNumbers:function(e){return this._lightNumber[e]},getProgramKey:function(e){return this._lightProgramKeys[e]},setLightUniforms:function(){function e(e,t,n){for(var r in e){var i=e[r];if("tv"===i.type){if(!t.hasUniform(r))continue;for(var o=[],a=0;a<i.value.length;a++){var s=i.value[a],l=t.takeCurrentTextureSlot(n,s);o.push(l)}t.setUniform(n.gl,"1iv",r,o)}else t.setUniform(n.gl,i.type,r,i.value)}}return function(t,n,r){e(this._lightUniforms[n],t,r),e(this.shadowUniforms,t,r)}}(),dispose:function(){this.material=null,this._opaqueList=[],this._transparentList=[],this.lights=[],this._lightUniforms={},this._lightNumber={},this._nodeRepository={}}});function w$(e,t){if(t.castShadow&&!e.castShadow)return!0}var S$=NK.isPowerOfTwo,T$=["px","nx","py","ny","pz","nz"],M$=EK.extend((function(){return{image:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},pixels:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},mipmaps:[]}}),{textureType:"textureCube",update:function(e){var t=e.gl;t.bindTexture(t.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),this.updateCommon(e);var n=this.format,r=this.type;t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_S,this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_T,this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var i=e.getGLExtension("EXT_texture_filter_anisotropic");(i&&this.anisotropic>1&&t.texParameterf(t.TEXTURE_CUBE_MAP,i.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===r)&&(e.getGLExtension("OES_texture_half_float")||(r=KY));if(this.mipmaps.length)for(var o=this.width,a=this.height,s=0;s<this.mipmaps.length;s++){var l=this.mipmaps[s];this._updateTextureData(t,l,s,o,a,n,r),o/=2,a/=2}else this._updateTextureData(t,this,0,this.width,this.height,n,r),!this.NPOT&&this.useMipmap&&t.generateMipmap(t.TEXTURE_CUBE_MAP);t.bindTexture(t.TEXTURE_CUBE_MAP,null)},_updateTextureData:function(e,t,n,r,i,o,a){for(var s=0;s<6;s++){var l=T$[s],u=t.image&&t.image[l];u?e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+s,n,o,o,a,u):e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+s,n,o,r,i,0,o,a,t.pixels&&t.pixels[l])}},generateMipmap:function(e){var t=e.gl;this.useMipmap&&!this.NPOT&&(t.bindTexture(t.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),t.generateMipmap(t.TEXTURE_CUBE_MAP))},bind:function(e){e.gl.bindTexture(e.gl.TEXTURE_CUBE_MAP,this.getWebGLTexture(e))},unbind:function(e){e.gl.bindTexture(e.gl.TEXTURE_CUBE_MAP,null)},isPowerOfTwo:function(){return this.image.px?S$(this.image.px.width)&&S$(this.image.px.height):S$(this.width)&&S$(this.height)},isRenderable:function(){return this.image.px?C$(this.image.px)&&C$(this.image.nx)&&C$(this.image.py)&&C$(this.image.ny)&&C$(this.image.pz)&&C$(this.image.nz):!(!this.width||!this.height)},load:function(e,t){var n=0,r=this;return bY.each(e,(function(e,i){var o=SZ.createImage();t&&(o.crossOrigin=t),o.onload=function(){0===--n&&(r.dirty(),r.trigger("success",r))},o.onerror=function(){n--},n++,o.src=e,r.image[i]=o})),this}});function C$(e){return e.width>0&&e.height>0}Object.defineProperty(M$.prototype,"width",{get:function(){return this.image&&this.image.px?this.image.px.width:this._width},set:function(e){this.image&&this.image.px?console.warn("Texture from image can't set width"):(this._width!==e&&this.dirty(),this._width=e)}}),Object.defineProperty(M$.prototype,"height",{get:function(){return this.image&&this.image.px?this.image.px.height:this._height},set:function(e){this.image&&this.image.px?console.warn("Texture from image can't set height"):(this._height!==e&&this.dirty(),this._height=e)}});var D$=p$.extend({fov:50,aspect:1,near:.1,far:2e3},{updateProjectionMatrix:function(){var e=this.fov/180*Math.PI;this.projectionMatrix.perspective(e,this.aspect,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array,t=2*Math.atan(1/e[5]);this.fov=t/Math.PI*180,this.aspect=e[5]/e[0],this.near=e[14]/(e[10]-1),this.far=e[14]/(e[10]+1)},clone:function(){var e=p$.prototype.clone.call(this);return e.fov=this.fov,e.aspect=this.aspect,e.near=this.near,e.far=this.far,e}}),A$="framebuffer",I$="renderbuffer",E$=I$+"_width",L$=I$+"_height",N$=I$+"_attached",P$="depthtexture_attached",O$=fZ,R$=gZ,k$=yZ,z$=vZ,V$=wY.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},(function(){this._cache=new IK,this._textures={}}),{getTextureWidth:function(){return this._width},getTextureHeight:function(){return this._height},bind:function(e){if(e.__currentFrameBuffer){if(e.__currentFrameBuffer===this)return;console.warn("Renderer already bound with another framebuffer. Unbind it first")}e.__currentFrameBuffer=this;var t=e.gl;t.bindFramebuffer(O$,this._getFrameBufferGL(e)),this._boundRenderer=e;var n=this._cache;n.put("viewport",e.viewport);var r,i,o=!1;for(var a in this._textures){o=!0;var s=this._textures[a];s&&(r=s.texture.width,i=s.texture.height,this._doAttach(e,s.texture,a,s.target))}this._width=r,this._height=i,!o&&this.depthBuffer&&console.error("Must attach texture before bind, or renderbuffer may have incorrect width and height."),this.viewport?e.setViewport(this.viewport):e.setViewport(0,0,r,i,1);var l=n.get("attached_textures");if(l)for(var a in l)if(!this._textures[a]){var u=l[a];this._doDetach(t,a,u)}if(!n.get(P$)&&this.depthBuffer){n.miss(I$)&&n.put(I$,t.createRenderbuffer());var c=n.get(I$);r===n.get(E$)&&i===n.get(L$)||(t.bindRenderbuffer(R$,c),t.renderbufferStorage(R$,t.DEPTH_COMPONENT16,r,i),n.put(E$,r),n.put(L$,i),t.bindRenderbuffer(R$,null)),n.get(N$)||(t.framebufferRenderbuffer(O$,k$,R$,c),n.put(N$,!0))}},unbind:function(e){e.__currentFrameBuffer=null,e.gl.bindFramebuffer(O$,null),this._boundRenderer=null,this._cache.use(e.__uid__);var t=this._cache.get("viewport");t&&e.setViewport(t),this.updateMipmap(e)},updateMipmap:function(e){var t=e.gl;for(var n in this._textures){var r=this._textures[n];if(r){var i=r.texture;if(!i.NPOT&&i.useMipmap&&i.minFilter===EK.LINEAR_MIPMAP_LINEAR){var o="textureCube"===i.textureType?cZ:uZ;t.bindTexture(o,i.getWebGLTexture(e)),t.generateMipmap(o),t.bindTexture(o,null)}}}},checkStatus:function(e){return e.checkFramebufferStatus(O$)},_getFrameBufferGL:function(e){var t=this._cache;return t.use(e.__uid__),t.miss(A$)&&t.put(A$,e.gl.createFramebuffer()),t.get(A$)},attach:function(e,t,n){if(!e.width)throw new Error("The texture attached to color buffer is not a valid.");t=t||z$,n=n||uZ;var r,i=this._boundRenderer;if(i&&i.gl){var o=this._cache;o.use(i.__uid__),r=o.get("attached_textures")}var a=this._textures[t];if(!a||a.target!==n||a.texture!==e||!r||null==r[t]){var s=!0;i&&(s=this._doAttach(i,e,t,n),this.viewport||i.setViewport(0,0,e.width,e.height,1)),s&&(this._textures[t]=this._textures[t]||{},this._textures[t].texture=e,this._textures[t].target=n)}},_doAttach:function(e,t,n,r){var i=e.gl,o=t.getWebGLTexture(e),a=this._cache.get("attached_textures");if(a&&a[n]){var s=a[n];if(s.texture===t&&s.target===r)return}var l=!0;if(((n=+n)===k$||n===xZ)&&(e.getGLExtension("WEBGL_depth_texture")||(console.error("Depth texture is not supported by the browser"),l=!1),t.format!==$Y&&t.format!==mZ&&(console.error("The texture attached to depth buffer is not a valid."),l=!1),l)){var u=this._cache.get(I$);u&&(i.framebufferRenderbuffer(O$,k$,R$,null),i.deleteRenderbuffer(u),this._cache.put(I$,!1)),this._cache.put(N$,!1),this._cache.put(P$,!0)}return i.framebufferTexture2D(O$,n,r,o,0),a||(a={},this._cache.put("attached_textures",a)),a[n]=a[n]||{},a[n].texture=t,a[n].target=r,l},_doDetach:function(e,t,n){e.framebufferTexture2D(O$,t,n,null,0);var r=this._cache.get("attached_textures");r&&r[t]&&(r[t]=null),t!==k$&&t!==xZ||this._cache.put(P$,!1)},detach:function(e,t){(this._textures[e]=null,this._boundRenderer)&&(this._cache.use(this._boundRenderer.__uid__),this._doDetach(this._boundRenderer.gl,e,t))},dispose:function(e){var t=e.gl,n=this._cache;n.use(e.__uid__);var r=n.get(I$);r&&t.deleteRenderbuffer(r);var i=n.get(A$);i&&t.deleteFramebuffer(i),n.deleteContext(e.__uid__),this._textures={}}});V$.DEPTH_ATTACHMENT=k$,V$.COLOR_ATTACHMENT0=z$,V$.STENCIL_ATTACHMENT=_Z,V$.DEPTH_STENCIL_ATTACHMENT=xZ;var B$=["px","nx","py","ny","pz","nz"],F$=wY.extend((function(){var e={position:new Fq,far:1e3,near:.1,texture:null,shadowMapPass:null},t=e._cameras={px:new D$({fov:90}),nx:new D$({fov:90}),py:new D$({fov:90}),ny:new D$({fov:90}),pz:new D$({fov:90}),nz:new D$({fov:90})};return t.px.lookAt(Fq.POSITIVE_X,Fq.NEGATIVE_Y),t.nx.lookAt(Fq.NEGATIVE_X,Fq.NEGATIVE_Y),t.py.lookAt(Fq.POSITIVE_Y,Fq.POSITIVE_Z),t.ny.lookAt(Fq.NEGATIVE_Y,Fq.NEGATIVE_Z),t.pz.lookAt(Fq.POSITIVE_Z,Fq.NEGATIVE_Y),t.nz.lookAt(Fq.NEGATIVE_Z,Fq.NEGATIVE_Y),e._frameBuffer=new V$,e}),{getCamera:function(e){return this._cameras[e]},render:function(e,t,n){var r=e.gl;n||t.update();for(var i=this.texture.width,o=2*Math.atan(i/(i-.5))/Math.PI*180,a=0;a<6;a++){var s=B$[a],l=this._cameras[s];if(Fq.copy(l.position,this.position),l.far=this.far,l.near=this.near,l.fov=o,this.shadowMapPass){l.update();var u=t.getBoundingBox();u.applyTransform(l.viewMatrix),t.viewBoundingBoxLastFrame.copy(u),this.shadowMapPass.render(e,t,l,!0)}this._frameBuffer.attach(this.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+a),this._frameBuffer.bind(e),e.render(t,l,!0),this._frameBuffer.unbind(e)}},dispose:function(e){this._frameBuffer.dispose(e)}}),G$=XK.extend({dynamic:!1,widthSegments:1,heightSegments:1},(function(){this.build()}),{build:function(){for(var e=this.heightSegments,t=this.widthSegments,n=this.attributes,r=[],i=[],o=[],a=[],s=0;s<=e;s++)for(var l=s/e,u=0;u<=t;u++){var c=u/t;if(r.push([2*c-1,2*l-1,0]),i&&i.push([c,l]),o&&o.push([0,0,1]),u<t&&s<e){var h=u+s*(t+1);a.push([h,h+1,h+t+1]),a.push([h+t+1,h+1,h+t+2])}}n.position.fromArray(r),n.texcoord0.fromArray(i),n.normal.fromArray(o),this.initIndicesFromArray(a),this.boundingBox=new bK,this.boundingBox.min.set(-1,-1,0),this.boundingBox.max.set(1,1,0)}}),H$=new aK,U$=XK.extend({dynamic:!1,widthSegments:1,heightSegments:1,depthSegments:1,inside:!1},(function(){this.build()}),{build:function(){var e={px:W$("px",this.depthSegments,this.heightSegments),nx:W$("nx",this.depthSegments,this.heightSegments),py:W$("py",this.widthSegments,this.depthSegments),ny:W$("ny",this.widthSegments,this.depthSegments),pz:W$("pz",this.widthSegments,this.heightSegments),nz:W$("nz",this.widthSegments,this.heightSegments)},t=["position","texcoord0","normal"],n=0,r=0;for(var i in e)n+=e[i].vertexCount,r+=e[i].indices.length;for(var o=0;o<t.length;o++)this.attributes[t[o]].init(n);this.indices=new SZ.Uint16Array(r);var a=0,s=0;for(var i in e){var l=e[i];for(o=0;o<t.length;o++)for(var u=t[o],c=l.attributes[u].value,h=l.attributes[u].size,d="normal"===u,p=0;p<c.length;p++){var f=c[p];this.inside&&d&&(f=-f),this.attributes[u].value[p+h*s]=f}var g=l.indices.length;for(p=0;p<l.indices.length;p++)this.indices[p+a]=s+l.indices[this.inside?g-p-1:p];a+=l.indices.length,s+=l.vertexCount}this.boundingBox=new bK,this.boundingBox.max.set(1,1,1),this.boundingBox.min.set(-1,-1,-1)}});function W$(e,t,n){H$.identity();var r=new G$({widthSegments:t,heightSegments:n});switch(e){case"px":aK.translate(H$,H$,Fq.POSITIVE_X),aK.rotateY(H$,H$,Math.PI/2);break;case"nx":aK.translate(H$,H$,Fq.NEGATIVE_X),aK.rotateY(H$,H$,-Math.PI/2);break;case"py":aK.translate(H$,H$,Fq.POSITIVE_Y),aK.rotateX(H$,H$,-Math.PI/2);break;case"ny":aK.translate(H$,H$,Fq.NEGATIVE_Y),aK.rotateX(H$,H$,Math.PI/2);break;case"pz":aK.translate(H$,H$,Fq.POSITIVE_Z);break;case"nz":aK.translate(H$,H$,Fq.NEGATIVE_Z),aK.rotateY(H$,H$,Math.PI)}return r.applyTransform(H$),r}wq.import("@export clay.skybox.vertex\n#define SHADER_NAME skybox\nuniform mat4 world : WORLD;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nvarying vec3 v_WorldPosition;\nvoid main()\n{\n v_WorldPosition = (world * vec4(position, 1.0)).xyz;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end\n@export clay.skybox.fragment\n#define PI 3.1415926\nuniform mat4 viewInverse : VIEWINVERSE;\n#ifdef EQUIRECTANGULAR\nuniform sampler2D environmentMap;\n#else\nuniform samplerCube environmentMap;\n#endif\nuniform float lod: 0.0;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\n@import clay.util.srgb\n@import clay.util.ACES\nvoid main()\n{\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n#ifdef EQUIRECTANGULAR\n float phi = acos(V.y);\n float theta = atan(-V.x, V.z) + PI * 0.5;\n vec2 uv = vec2(theta / 2.0 / PI, phi / PI);\n vec4 texel = decodeHDR(texture2D(environmentMap, fract(uv)));\n#else\n #if defined(LOD) || defined(SUPPORT_TEXTURE_LOD)\n vec4 texel = decodeHDR(textureCubeLodEXT(environmentMap, V, lod));\n #else\n vec4 texel = decodeHDR(textureCube(environmentMap, V));\n #endif\n#endif\n#ifdef SRGB_DECODE\n texel = sRGBToLinear(texel);\n#endif\n#ifdef TONEMAPPING\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n#ifdef SRGB_ENCODE\n texel = linearTosRGB(texel);\n#endif\n gl_FragColor = encodeHDR(vec4(texel.rgb, 1.0));\n}\n@end");var j$=LK.extend((function(){var e=new wq({vertex:wq.source("clay.skybox.vertex"),fragment:wq.source("clay.skybox.fragment")}),t=new jZ({shader:e,depthMask:!1});return{scene:null,geometry:new U$,material:t,environmentMap:null,culling:!1,_dummyCamera:new D$}}),(function(){var e=this.scene;e&&this.attachScene(e),this.environmentMap&&this.setEnvironmentMap(this.environmentMap)}),{attachScene:function(e){this.scene&&this.detachScene(),e.skybox=this,this.scene=e,e.on("beforerender",this._beforeRenderScene,this)},detachScene:function(){this.scene&&(this.scene.off("beforerender",this._beforeRenderScene),this.scene.skybox=null),this.scene=null},dispose:function(e){this.detachScene(),this.geometry.dispose(e)},setEnvironmentMap:function(e){"texture2D"===e.textureType?(this.material.define("EQUIRECTANGULAR"),e.minFilter=EK.LINEAR):this.material.undefine("EQUIRECTANGULAR"),this.material.set("environmentMap",e)},getEnvironmentMap:function(){return this.material.get("environmentMap")},_beforeRenderScene:function(e,t,n){this.renderSkybox(e,n)},renderSkybox:function(e,t){var n=this._dummyCamera;n.aspect=e.getViewportAspect(),n.fov=t.fov||50,n.updateProjectionMatrix(),aK.invert(n.invProjectionMatrix,n.projectionMatrix),n.worldTransform.copy(t.worldTransform),n.viewMatrix.copy(t.viewMatrix),this.position.copy(t.getWorldPosition()),this.update(),e.gl.disable(e.gl.BLEND),this.material.get("lod")>0?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),e.renderPass([this],n)}});function X$(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}var Y$=X$("DXT1"),Z$=X$("DXT3"),q$=X$("DXT5"),K$=function(e,t){var n=new Int32Array(e,0,31);if(542327876!==n[0])return null;if(4&!n(20))return null;var r,i,o=n(21),a=n[4],s=n[3],l=512&n[28],u=131072&n[2];switch(o){case Y$:r=8,i=EK.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Z$:r=16,i=EK.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case q$:r=16,i=EK.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var c=n[1]+4,h=l?6:1,d=1;u&&(d=Math.max(1,n[7]));for(var p=[],f=0;f<h;f++){var g=a,m=s;p[f]=new RK({width:g,height:m,format:i});for(var v=[],y=0;y<d;y++){var _=Math.max(4,g)/4*Math.max(4,m)/4*r,x=new Uint8Array(e,c,_);c+=_,g*=.5,m*=.5,v[y]=x}p[f].pixels=v[0],u&&(p[f].mipmaps=v)}if(!t)return p[0];t.width=p[0].width,t.height=p[0].height,t.format=p[0].format,t.pixels=p[0].pixels,t.mipmaps=p[0].mipmaps},$$=String.fromCharCode;function J$(e,t,n,r){if(e[3]>0){var i=Math.pow(2,e[3]-128-8+r);t[n+0]=e[0]*i,t[n+1]=e[1]*i,t[n+2]=e[2]*i}else t[n+0]=0,t[n+1]=0,t[n+2]=0;return t[n+3]=1,t}function Q$(e,t,n,r){for(var i,o,a=0,s=0,l=r;l>0;)if(e[s][0]=t[n++],e[s][1]=t[n++],e[s][2]=t[n++],e[s][3]=t[n++],1===e[s][0]&&1===e[s][1]&&1===e[s][2]){for(var u=e[s][3]<<a>>>0;u>0;u--)i=e[s-1],(o=e[s])[0]=i[0],o[1]=i[1],o[2]=i[2],o[3]=i[3],s++,l--;a+=8}else s++,l--,a=0;return n}function eJ(e,t,n,r){if(r<8|r>32767)return Q$(e,t,n,r);if(2!=(i=t[n++]))return Q$(e,t,n-1,r);if(e[0][1]=t[n++],e[0][2]=t[n++],i=t[n++],(e[0][2]<<8>>>0|i)>>>0!==r)return null;for(var i=0;i<4;i++)for(var o=0;o<r;){var a=t[n++];if(a>128){a=(127&a)>>>0;for(var s=t[n++];a--;)e[o++][i]=s}else for(;a--;)e[o++][i]=t[n++]}return n}var tJ=function(e,t,n){null==n&&(n=0);var r=new Uint8Array(e),i=r.length;if("#?"===function(e,t,n){for(var r="",i=t;i<n;i++)r+=$$(e[i]);return r}(r,0,2)){for(var o=2;o<i&&("\n"!==$$(r[o])||"\n"!==$$(r[o+1]));o++);if(!(o>=i)){o+=2;for(var a="";o<i;o++){var s=$$(r[o]);if("\n"===s)break;a+=s}var l=a.split(" "),u=parseInt(l[1]),c=parseInt(l[3]);if(c&&u){for(var h=o+1,d=[],p=0;p<c;p++){d[p]=[];for(var f=0;f<4;f++)d[p][f]=0}for(var g=new Float32Array(c*u*4),m=0,v=0;v<u;v++){if(!(h=eJ(d,r,h,c)))return null;for(p=0;p<c;p++)J$(d[p],g,m,n),m+=4}return t||(t=new RK),t.width=c,t.height=u,t.pixels=g,t.type=EK.FLOAT,t}}}},nJ={loadTexture:function(e,t,n,r){var i;if("function"==typeof t?(r=n=t,t={}):t=t||{},"string"==typeof e){if(e.match(/.hdr$/)||"hdr"===t.fileType)return i=new RK({width:0,height:0,sRGB:!1}),nJ._fetchTexture(e,(function(e){tJ(e,i,t.exposure),i.dirty(),n&&n(i)}),r),i;e.match(/.dds$/)||"dds"===t.fileType?(i=new RK({width:0,height:0}),nJ._fetchTexture(e,(function(e){K$(e,i),i.dirty(),n&&n(i)}),r)):((i=new RK).load(e),i.success(n),i.error(r))}else"object"==typeof e&&void 0!==e.px&&((i=new M$).load(e),i.success(n),i.error(r));return i},loadPanorama:function(e,t,n,r,i,o){var a=this;"function"==typeof r?(o=i=r,r={}):r=r||{},nJ.loadTexture(t,r,(function(t){t.flipY=r.flipY||!1,a.panoramaToCubeMap(e,t,n,r),t.dispose(e),i&&i(n)}),o)},panoramaToCubeMap:function(e,t,n,r){var i=new F$,o=new j$({scene:new b$});return o.setEnvironmentMap(t),(r=r||{}).encodeRGBM&&o.material.define("fragment","RGBM_ENCODE"),n.sRGB=t.sRGB,i.texture=n,i.render(e,o.scene),i.texture=null,i.dispose(e),n},heightToNormal:function(e,t){var n=document.createElement("canvas"),r=n.width=e.width,i=n.height=e.height,o=n.getContext("2d");o.drawImage(e,0,0,r,i),t=t||!1;for(var a=o.getImageData(0,0,r,i),s=o.createImageData(r,i),l=0;l<a.data.length;l+=4){if(t){var u=a.data[l],c=a.data[l+1],h=a.data[l+2];if(Math.abs(u-c)+Math.abs(c-h)>20)return console.warn("Given image is not a height map"),e}var d,p,f,g;l%(4*r)==0?(d=a.data[l],f=a.data[l+4]):l%(4*r)==4*(r-1)?(d=a.data[l-4],f=a.data[l]):(d=a.data[l-4],f=a.data[l+4]),l<4*r?(p=a.data[l],g=a.data[l+4*r]):l>r*(i-1)*4?(p=a.data[l-4*r],g=a.data[l]):(p=a.data[l-4*r],g=a.data[l+4*r]),s.data[l]=d-f+127,s.data[l+1]=p-g+127,s.data[l+2]=255,s.data[l+3]=255}return o.putImageData(s,0,0),n},isHeightImage:function(e,t,n){if(!e||!e.width||!e.height)return!1;var r=document.createElement("canvas"),i=r.getContext("2d"),o=t||32;n=n||20,r.width=r.height=o,i.drawImage(e,0,0,o,o);for(var a=i.getImageData(0,0,o,o),s=0;s<a.data.length;s+=4){var l=a.data[s],u=a.data[s+1],c=a.data[s+2];if(Math.abs(l-u)+Math.abs(u-c)>n)return!1}return!0},_fetchTexture:function(e,t,n){SZ.request.get({url:e,responseType:"arraybuffer",onload:t,onerror:n})},createChessboard:function(e,t,n,r){e=e||512,t=t||64,n=n||"black",r=r||"white";var i=Math.ceil(e/t),o=document.createElement("canvas");o.width=e,o.height=e;var a=o.getContext("2d");a.fillStyle=r,a.fillRect(0,0,e,e),a.fillStyle=n;for(var s=0;s<i;s++)for(var l=0;l<i;l++){(l%2?s%2:s%2-1)&&a.fillRect(s*t,l*t,t,t)}return new RK({image:o,anisotropic:8})},createBlank:function(e){var t=document.createElement("canvas");t.width=1,t.height=1;var n=t.getContext("2d");return n.fillStyle=e,n.fillRect(0,0,1,1),new RK({image:t})}},rJ=["mousedown","mouseup","mousemove","mouseover","mouseout","click","dblclick","contextmenu"];function iJ(e){return"_on"+e}var oJ=function(e){var t=this;this._texture=new RK({anisotropic:32,flipY:!1,surface:this,dispose:function(e){t.dispose(),RK.prototype.dispose.call(this,e)}}),rJ.forEach((function(e){this[iJ(e)]=function(t){t.triangle&&this._meshes.forEach((function(n){this.dispatchEvent(e,n,t.triangle,t.point)}),this)}}),this),this._meshes=[],e&&this.setECharts(e),this.onupdate=null};oJ.prototype={constructor:oJ,getTexture:function(){return this._texture},setECharts:function(e){this._chart=e;var t=e.getDom();if(t instanceof HTMLCanvasElement){var n=this,r=e.getZr(),i=r.__oldRefreshImmediately||r.refreshImmediately;r.refreshImmediately=function(){i.call(this),n._texture.dirty(),n.onupdate&&n.onupdate()},r.__oldRefreshImmediately=i}else console.error("ECharts must init on canvas if it is used as texture."),t=document.createElement("canvas");this._texture.image=t,this._texture.dirty(),this.onupdate&&this.onupdate()},dispatchEvent:function(){var e=new Fq,t=new Fq,n=new Fq,r=new KZ,i=new KZ,o=new KZ,a=new KZ,s=new Fq;return function(l,u,c,h){var d=u.geometry,p=d.attributes.position,f=d.attributes.texcoord0,g=Fq.dot,m=Fq.cross;p.get(c[0],e.array),p.get(c[1],t.array),p.get(c[2],n.array),f.get(c[0],r.array),f.get(c[1],i.array),f.get(c[2],o.array),m(s,t,n);var v=g(e,s),y=g(h,s)/v;m(s,n,e);var _=g(h,s)/v;m(s,e,t);var x=g(h,s)/v;KZ.scale(a,r,y),KZ.scaleAndAdd(a,a,i,_),KZ.scaleAndAdd(a,a,o,x);var b=a.x*this._chart.getWidth(),w=a.y*this._chart.getHeight();this._chart.getZr().handler.dispatch(l,{zrX:b,zrY:w})}}(),attachToMesh:function(e){this._meshes.indexOf(e)>=0||(rJ.forEach((function(t){e.on(t,this[iJ(t)],this)}),this),this._meshes.push(e))},detachFromMesh:function(e){var t=this._meshes.indexOf(e);t>=0&&this._meshes.splice(t,1),rJ.forEach((function(t){e.off(t,this[iJ(t)])}),this)},dispose:function(){this._meshes.forEach((function(e){this.detachFromMesh(e)}),this)}};var aJ=p$.extend({left:-1,right:1,near:-1,far:1,top:1,bottom:-1},{updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array;this.left=(-1-e[12])/e[0],this.right=(1-e[12])/e[0],this.top=(1-e[13])/e[5],this.bottom=(-1-e[13])/e[5],this.near=-(-1-e[14])/e[10],this.far=-(1-e[14])/e[10]},clone:function(){var e=p$.prototype.clone.call(this);return e.left=this.left,e.right=this.right,e.near=this.near,e.far=this.far,e.top=this.top,e.bottom=this.bottom,e}});wq.import("\n@export clay.compositor.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n v_Texcoord = texcoord;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end");var sJ=new G$,lJ=new LK({geometry:sJ,frustumCulling:!1}),uJ=new aJ,cJ=wY.extend((function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}}),(function(){var e=new wq(wq.source("clay.compositor.vertex"),this.fragment),t=new jZ({shader:e});t.enableTexturesAll(),this.material=t}),{setUniform:function(e,t){this.material.setUniform(e,t)},getUniform:function(e){var t=this.material.uniforms[e];if(t)return t.value},attachOutput:function(e,t){this.outputs||(this.outputs={}),t=t||vZ,this.outputs[t]=e},detachOutput:function(e){for(var t in this.outputs)this.outputs[t]===e&&(this.outputs[t]=null)},bind:function(e,t){if(this.outputs)for(var n in this.outputs){var r=this.outputs[n];r&&t.attach(r,n)}t&&t.bind(e)},unbind:function(e,t){t.unbind(e)},render:function(e,t){var n=e.gl;if(t){this.bind(e,t);var r=e.getGLExtension("EXT_draw_buffers");if(r&&this.outputs){var i=[];for(var o in this.outputs)(o=+o)>=n.COLOR_ATTACHMENT0&&o<=n.COLOR_ATTACHMENT0+8&&i.push(o);r.drawBuffersEXT(i)}}this.trigger("beforerender",this,e);var a=this.clearDepth?n.DEPTH_BUFFER_BIT:0;if(n.depthMask(!0),this.clearColor){a|=n.COLOR_BUFFER_BIT,n.colorMask(!0,!0,!0,!0);var s=this.clearColor;Array.isArray(s)&&n.clearColor(s[0],s[1],s[2],s[3])}n.clear(a),this.blendWithPrevious?(n.enable(n.BLEND),this.material.transparent=!0):(n.disable(n.BLEND),this.material.transparent=!1),this.renderQuad(e),this.trigger("afterrender",this,e),t&&this.unbind(e,t)},renderQuad:function(e){lJ.material=this.material,e.renderPass([lJ],uJ)},dispose:function(e){}}),hJ={},dJ=["px","nx","py","ny","pz","nz"];hJ.prefilterEnvironmentMap=function(e,t,n,r,i){i&&r||(r=hJ.generateNormalDistribution(),i=hJ.integrateBRDF(e,r));var o=(n=n||{}).width||64,a=n.height||64,s=n.type||t.type,l=new M$({width:o,height:a,type:s,flipY:!1,mipmaps:[]});l.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var u=Math.min(o,a),c=Math.log(u)/Math.log(2)+1,h=new jZ({shader:new wq({vertex:wq.source("clay.skybox.vertex"),fragment:"#define SHADER_NAME prefilter\n#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform mat4 viewInverse : VIEWINVERSE;\nuniform samplerCube environmentMap;\nuniform sampler2D normalDistribution;\nuniform float roughness : 0.5;\nvarying vec2 v_Texcoord;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvoid main() {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n vec3 N = V;\n vec3 prefilteredColor = vec3(0.0);\n float totalWeight = 0.0;\n float fMaxSampleNumber = float(SAMPLE_NUMBER);\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fMaxSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(dot(N, L), 0.0, 1.0);\n if (NoL > 0.0) {\n prefilteredColor += decodeHDR(textureCube(environmentMap, L)).rgb * NoL;\n totalWeight += NoL;\n }\n }\n gl_FragColor = encodeHDR(vec4(prefilteredColor / totalWeight, 1.0));\n}\n"})});h.set("normalDistribution",r),n.encodeRGBM&&h.define("fragment","RGBM_ENCODE"),n.decodeRGBM&&h.define("fragment","RGBM_DECODE");var d,p=new b$;if("texture2D"===t.textureType){var f=new M$({width:o,height:a,type:s===EK.FLOAT?EK.HALF_FLOAT:s});nJ.panoramaToCubeMap(e,t,f,{encodeRGBM:n.decodeRGBM}),t=f}(d=new j$({scene:p,material:h})).material.set("environmentMap",t);var g=new F$({texture:l});n.encodeRGBM&&(s=l.type=EK.UNSIGNED_BYTE);for(var m=new RK({width:o,height:a,type:s}),v=new V$({depthBuffer:!1}),y=SZ[s===EK.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],_=0;_<c;_++){l.mipmaps[_]={pixels:{}},d.material.set("roughness",_/(c-1));for(var x=m.width,b=2*Math.atan(x/(x-.5))/Math.PI*180,w=0;w<dJ.length;w++){var S=new y(m.width*m.height*4);v.attach(m),v.bind(e);var T=g.getCamera(dJ[w]);T.fov=b,e.render(p,T),e.gl.readPixels(0,0,m.width,m.height,EK.RGBA,s,S),v.unbind(e),l.mipmaps[_].pixels[dJ[w]]=S}m.width/=2,m.height/=2,m.dirty()}return v.dispose(e),m.dispose(e),d.dispose(e),r.dispose(e),{environmentMap:l,brdfLookup:i,normalDistribution:r,maxMipmapLevel:c}},hJ.integrateBRDF=function(e,t){t=t||hJ.generateNormalDistribution();var n=new V$({depthBuffer:!1}),r=new cJ({fragment:"#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform sampler2D normalDistribution;\nuniform vec2 viewportSize : [512, 256];\nconst vec3 N = vec3(0.0, 0.0, 1.0);\nconst float fSampleNumber = float(SAMPLE_NUMBER);\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nfloat G_Smith(float roughness, float NoV, float NoL) {\n float k = roughness * roughness / 2.0;\n float G1V = NoV / (NoV * (1.0 - k) + k);\n float G1L = NoL / (NoL * (1.0 - k) + k);\n return G1L * G1V;\n}\nvoid main() {\n vec2 uv = gl_FragCoord.xy / viewportSize;\n float NoV = uv.x;\n float roughness = uv.y;\n vec3 V;\n V.x = sqrt(1.0 - NoV * NoV);\n V.y = 0.0;\n V.z = NoV;\n float A = 0.0;\n float B = 0.0;\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(L.z, 0.0, 1.0);\n float NoH = clamp(H.z, 0.0, 1.0);\n float VoH = clamp(dot(V, H), 0.0, 1.0);\n if (NoL > 0.0) {\n float G = G_Smith(roughness, NoV, NoL);\n float G_Vis = G * VoH / (NoH * NoV);\n float Fc = pow(1.0 - VoH, 5.0);\n A += (1.0 - Fc) * G_Vis;\n B += Fc * G_Vis;\n }\n }\n gl_FragColor = vec4(vec2(A, B) / fSampleNumber, 0.0, 1.0);\n}\n"}),i=new RK({width:512,height:256,type:EK.HALF_FLOAT,wrapS:EK.CLAMP_TO_EDGE,wrapT:EK.CLAMP_TO_EDGE,minFilter:EK.NEAREST,magFilter:EK.NEAREST,useMipmap:!1});return r.setUniform("normalDistribution",t),r.setUniform("viewportSize",[512,256]),r.attachOutput(i),r.render(e,n),n.dispose(e),i},hJ.generateNormalDistribution=function(e,t){for(var n=new RK({width:e=e||256,height:t=t||1024,type:EK.FLOAT,minFilter:EK.NEAREST,magFilter:EK.NEAREST,wrapS:EK.CLAMP_TO_EDGE,wrapT:EK.CLAMP_TO_EDGE,useMipmap:!1}),r=new Float32Array(t*e*4),i=[],o=0;o<e;o++){for(var a=o/e,s=a*a,l=0;l<t;l++){var u=(l<<16|l>>>16)>>>0;u=(((16711935&(u=((252645135&(u=((858993459&(u=((1431655765&u)<<1|(2863311530&u)>>>1)>>>0))<<2|(3435973836&u)>>>2)>>>0))<<4|(4042322160&u)>>>4)>>>0))<<8|(4278255360&u)>>>8)>>>0)/4294967296;var c=Math.sqrt((1-u)/(1+(s*s-1)*u));i[l]=c}for(l=0;l<t;l++){var h=4*(l*e+o),d=(c=i[l],Math.sqrt(1-c*c)),p=l/t,f=2*Math.PI*p;r[h]=d*Math.cos(f),r[h+1]=c,r[h+2]=d*Math.sin(f),r[h+3]=1}}return n.pixels=r,n};var pJ=r$.extend({cubemap:null,castShadow:!1,_normalDistribution:null,_brdfLookup:null},{type:"AMBIENT_CUBEMAP_LIGHT",prefilter:function(e,t){if(e.getGLExtension("EXT_shader_texture_lod")){this._brdfLookup||(this._normalDistribution=hJ.generateNormalDistribution(),this._brdfLookup=hJ.integrateBRDF(e,this._normalDistribution));var n=this.cubemap;if(!n.__prefiltered){var r=hJ.prefilterEnvironmentMap(e,n,{encodeRGBM:!0,width:t,height:t},this._normalDistribution,this._brdfLookup);this.cubemap=r.environmentMap,this.cubemap.__prefiltered=!0,n.dispose(e)}}else console.warn("Device not support textureCubeLodEXT")},getBRDFLookup:function(){return this._brdfLookup},uniformTemplates:{ambientCubemapLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}},ambientCubemapLightCubemap:{type:"t",value:function(e){return e.cubemap}},ambientCubemapLightBRDFLookup:{type:"t",value:function(e){return e._brdfLookup}}}}),fJ=r$.extend({castShadow:!1,coefficients:[]},(function(){this._coefficientsTmpArr=new SZ.Float32Array(27)}),{type:"AMBIENT_SH_LIGHT",uniformTemplates:{ambientSHLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}},ambientSHLightCoefficients:{type:"3f",value:function(e){for(var t=e._coefficientsTmpArr,n=0;n<e.coefficients.length;n++)t[n]=e.coefficients[n];return t}}}}),gJ={},mJ=["px","nx","py","ny","pz","nz"];function vJ(e,t){var n=e[0],r=e[1],i=e[2];return 0===t?1:1===t?n:2===t?r:3===t?i:4===t?n*i:5===t?r*i:6===t?n*r:7===t?3*i*i-1:n*n-r*r}var yJ={px:[2,1,0,-1,-1,1],nx:[2,1,0,1,-1,-1],py:[0,2,1,1,-1,-1],ny:[0,2,1,1,1,1],pz:[0,1,2,-1,-1,-1],nz:[0,1,2,1,-1,1]};gJ.projectEnvironmentMap=function(e,t,n){var r;(n=n||{}).lod=n.lod||0;var i=new b$,o=64;"texture2D"===t.textureType||(o=t.image&&t.image.px?t.image.px.width:t.width),r=new j$({scene:i,environmentMap:t});var a=Math.ceil(o/Math.pow(2,n.lod)),s=Math.ceil(o/Math.pow(2,n.lod)),l=new RK({width:a,height:s}),u=new V$;r.material.define("fragment","RGBM_ENCODE"),n.decodeRGBM&&r.material.define("fragment","RGBM_DECODE"),r.material.set("lod",n.lod);for(var c=new F$({texture:l}),h={},d=0;d<mJ.length;d++){h[mJ[d]]=new Uint8Array(a*s*4);var p=c.getCamera(mJ[d]);p.fov=90,u.attach(l),u.bind(e),e.render(i,p),e.gl.readPixels(0,0,a,s,EK.RGBA,EK.UNSIGNED_BYTE,h[mJ[d]]),u.unbind(e)}return r.dispose(e),u.dispose(e),l.dispose(e),function(e,t,n,r){for(var i=new SZ.Float32Array(27),o=Dq.create(),a=Dq.create(),s=Dq.create(),l=0;l<9;l++){for(var u=Dq.create(),c=0;c<mJ.length;c++){for(var h=t[mJ[c]],d=Dq.create(),p=0,f=0,g=yJ[mJ[c]],m=0;m<r;m++)for(var v=0;v<n;v++){o[0]=v/(n-1)*2-1,o[1]=m/(r-1)*2-1,o[2]=-1,Dq.normalize(o,o),s[0]=o[g[0]]*g[3],s[1]=o[g[1]]*g[4],s[2]=o[g[2]]*g[5],a[0]=h[f++]/255,a[1]=h[f++]/255,a[2]=h[f++]/255;var y=h[f++]/255*8.12;a[0]*=y,a[1]*=y,a[2]*=y,Dq.scaleAndAdd(d,d,a,vJ(s,l)*-o[2]),p+=-o[2]}Dq.scaleAndAdd(u,u,d,1/p)}i[3*l]=u[0]/6,i[3*l+1]=u[1]/6,i[3*l+2]=u[2]/6}return i}(0,h,a,s)};var _J=function(){for(var e=0,t=arguments.length;e<t;e++)if(null!=arguments[e])return arguments[e]},xJ=function(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?J(t.dataIndex)?j(t.dataIndex,(function(t){return e.indexOfRawIndex(t)})):e.indexOfRawIndex(t.dataIndex):null!=t.name?J(t.name)?j(t.name,(function(t){return e.indexOfName(t)})):e.indexOfName(t.name):void 0},bJ=XK.extend({dynamic:!1,widthSegments:40,heightSegments:20,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI,radius:1},(function(){this.build()}),{build:function(){var e=this.heightSegments,t=this.widthSegments,n=this.attributes.position,r=this.attributes.texcoord0,i=this.attributes.normal,o=(t+1)*(e+1);n.init(o),r.init(o),i.init(o);var a,s,l,u,c,h,d,p,f,g,m,v=o>65535?Uint32Array:Uint16Array,y=this.indices=new v(t*e*6),_=this.radius,x=this.phiStart,b=this.phiLength,w=this.thetaStart,S=this.thetaLength,T=[],M=[],C=0,D=1/(_=this.radius);for(d=0;d<=e;d++)for(h=0;h<=t;h++)u=h/t,c=d/e,a=-_*Math.cos(x+u*b)*Math.sin(w+c*S),s=_*Math.cos(w+c*S),l=_*Math.sin(x+u*b)*Math.sin(w+c*S),T[0]=a,T[1]=s,T[2]=l,M[0]=u,M[1]=c,n.set(C,T),r.set(C,M),T[0]*=D,T[1]*=D,T[2]*=D,i.set(C,T),C++;var A=t+1,I=0;for(d=0;d<e;d++)for(h=0;h<t;h++)f=d*A+h,p=d*A+h+1,m=(d+1)*A+h+1,g=(d+1)*A+h,y[I++]=p,y[I++]=f,y[I++]=m,y[I++]=f,y[I++]=g,y[I++]=m;this.boundingBox=new bK,this.boundingBox.max.set(_,_,_),this.boundingBox.min.set(-_,-_,-_)}}),wJ=r$.extend({castShadow:!1},{type:"AMBIENT_LIGHT",uniformTemplates:{ambientLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}}}}),SJ=r$.extend({shadowBias:.001,shadowSlopeScale:2,shadowCascade:1,cascadeSplitLogFactor:.2},{type:"DIRECTIONAL_LIGHT",uniformTemplates:{directionalLightDirection:{type:"3f",value:function(e){return e.__dir=e.__dir||new Fq,e.__dir.copy(e.worldTransform.z).normalize().negate().array}},directionalLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}}},clone:function(){var e=r$.prototype.clone.call(this);return e.shadowBias=this.shadowBias,e.shadowSlopeScale=this.shadowSlopeScale,e}}),TJ=r$.extend({range:100,castShadow:!1},{type:"POINT_LIGHT",uniformTemplates:{pointLightPosition:{type:"3f",value:function(e){return e.getWorldPosition().array}},pointLightRange:{type:"1f",value:function(e){return e.range}},pointLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}}},clone:function(){var e=r$.prototype.clone.call(this);return e.range=this.range,e}}),MJ=r$.extend({range:20,umbraAngle:30,penumbraAngle:45,falloffFactor:2,shadowBias:.001,shadowSlopeScale:2},{type:"SPOT_LIGHT",uniformTemplates:{spotLightPosition:{type:"3f",value:function(e){return e.getWorldPosition().array}},spotLightRange:{type:"1f",value:function(e){return e.range}},spotLightUmbraAngleCosine:{type:"1f",value:function(e){return Math.cos(e.umbraAngle*Math.PI/180)}},spotLightPenumbraAngleCosine:{type:"1f",value:function(e){return Math.cos(e.penumbraAngle*Math.PI/180)}},spotLightFalloffFactor:{type:"1f",value:function(e){return e.falloffFactor}},spotLightDirection:{type:"3f",value:function(e){return e.__dir=e.__dir||new Fq,e.__dir.copy(e.worldTransform.z).negate().array}},spotLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}}},clone:function(){var e=r$.prototype.clone.call(this);return e.range=this.range,e.umbraAngle=this.umbraAngle,e.penumbraAngle=this.penumbraAngle,e.falloffFactor=this.falloffFactor,e.shadowBias=this.shadowBias,e.shadowSlopeScale=this.shadowSlopeScale,e}}),CJ=function(e,t,n,r){e=e||0,t=t||0,n=n||0,r=r||0,this.array=Qq.fromValues(e,t,n,r),this._dirty=!0};CJ.prototype={constructor:CJ,add:function(e){return Qq.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t,n,r){return this.array[0]=e,this.array[1]=t,this.array[2]=n,this.array[3]=r,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this.array[3]=e[3],this._dirty=!0,this},clone:function(){return new CJ(this.x,this.y,this.z,this.w)},copy:function(e){return Qq.copy(this.array,e.array),this._dirty=!0,this},dist:function(e){return Qq.dist(this.array,e.array)},distance:function(e){return Qq.distance(this.array,e.array)},div:function(e){return Qq.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return Qq.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return Qq.dot(this.array,e.array)},len:function(){return Qq.len(this.array)},length:function(){return Qq.length(this.array)},lerp:function(e,t,n){return Qq.lerp(this.array,e.array,t.array,n),this._dirty=!0,this},min:function(e){return Qq.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return Qq.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return Qq.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return Qq.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return Qq.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return Qq.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return Qq.random(this.array,e),this._dirty=!0,this},scale:function(e){return Qq.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return Qq.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return Qq.sqrDist(this.array,e.array)},squaredDistance:function(e){return Qq.squaredDistance(this.array,e.array)},sqrLen:function(){return Qq.sqrLen(this.array)},squaredLength:function(){return Qq.squaredLength(this.array)},sub:function(e){return Qq.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return Qq.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return Qq.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},transformQuat:function(e){return Qq.transformQuat(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var DJ=Object.defineProperty;if(DJ){var AJ=CJ.prototype;DJ(AJ,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),DJ(AJ,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),DJ(AJ,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}}),DJ(AJ,"w",{get:function(){return this.array[3]},set:function(e){this.array[3]=e,this._dirty=!0}})}CJ.add=function(e,t,n){return Qq.add(e.array,t.array,n.array),e._dirty=!0,e},CJ.set=function(e,t,n,r,i){Qq.set(e.array,t,n,r,i),e._dirty=!0},CJ.copy=function(e,t){return Qq.copy(e.array,t.array),e._dirty=!0,e},CJ.distance=CJ.dist=function(e,t){return Qq.distance(e.array,t.array)},CJ.div=function(e,t,n){return Qq.divide(e.array,t.array,n.array),e._dirty=!0,e},CJ.divide=CJ.div,CJ.dot=function(e,t){return Qq.dot(e.array,t.array)},CJ.len=function(e){return Qq.length(e.array)},CJ.lerp=function(e,t,n,r){return Qq.lerp(e.array,t.array,n.array,r),e._dirty=!0,e},CJ.min=function(e,t,n){return Qq.min(e.array,t.array,n.array),e._dirty=!0,e},CJ.max=function(e,t,n){return Qq.max(e.array,t.array,n.array),e._dirty=!0,e},CJ.mul=function(e,t,n){return Qq.multiply(e.array,t.array,n.array),e._dirty=!0,e},CJ.multiply=CJ.mul,CJ.negate=function(e,t){return Qq.negate(e.array,t.array),e._dirty=!0,e},CJ.normalize=function(e,t){return Qq.normalize(e.array,t.array),e._dirty=!0,e},CJ.random=function(e,t){return Qq.random(e.array,t),e._dirty=!0,e},CJ.scale=function(e,t,n){return Qq.scale(e.array,t.array,n),e._dirty=!0,e},CJ.scaleAndAdd=function(e,t,n,r){return Qq.scaleAndAdd(e.array,t.array,n.array,r),e._dirty=!0,e},CJ.squaredDistance=CJ.sqrDist=function(e,t){return Qq.sqrDist(e.array,t.array)},CJ.squaredLength=CJ.sqrLen=function(e){return Qq.sqrLen(e.array)},CJ.sub=function(e,t,n){return Qq.subtract(e.array,t.array,n.array),e._dirty=!0,e},CJ.subtract=CJ.sub,CJ.transformMat4=function(e,t,n){return Qq.transformMat4(e.array,t.array,n.array),e._dirty=!0,e},CJ.transformQuat=function(e,t,n){return Qq.transformQuat(e.array,t.array,n.array),e._dirty=!0,e};var IJ={create:function(){var e=new YZ(4);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},clone:function(e){var t=new YZ(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},transpose:function(e,t){if(e===t){var n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e},invert:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*o-i*r;return a?(a=1/a,e[0]=o*a,e[1]=-r*a,e[2]=-i*a,e[3]=n*a,e):null},adjoint:function(e,t){var n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e},determinant:function(e){return e[0]*e[3]-e[2]*e[1]},multiply:function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],l=n[1],u=n[2],c=n[3];return e[0]=r*s+o*l,e[1]=i*s+a*l,e[2]=r*u+o*c,e[3]=i*u+a*c,e}};IJ.mul=IJ.multiply,IJ.rotate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+o*s,e[1]=i*l+a*s,e[2]=r*-s+o*l,e[3]=i*-s+a*l,e},IJ.scale=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],l=n[1];return e[0]=r*s,e[1]=i*s,e[2]=o*l,e[3]=a*l,e},IJ.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2))},IJ.LDU=function(e,t,n,r){return e[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-e[2]*n[1],[e,t,n]};var EJ=function(){this.array=IJ.create(),this._dirty=!0};EJ.prototype={constructor:EJ,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},clone:function(){return(new EJ).copy(this)},copy:function(e){return IJ.copy(this.array,e.array),this._dirty=!0,this},adjoint:function(){return IJ.adjoint(this.array,this.array),this._dirty=!0,this},determinant:function(){return IJ.determinant(this.array)},identity:function(){return IJ.identity(this.array),this._dirty=!0,this},invert:function(){return IJ.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return IJ.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return IJ.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return IJ.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return IJ.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return IJ.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return IJ.scale(this.array,this.array,e.array),this._dirty=!0,this},transpose:function(){return IJ.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},EJ.adjoint=function(e,t){return IJ.adjoint(e.array,t.array),e._dirty=!0,e},EJ.copy=function(e,t){return IJ.copy(e.array,t.array),e._dirty=!0,e},EJ.determinant=function(e){return IJ.determinant(e.array)},EJ.identity=function(e){return IJ.identity(e.array),e._dirty=!0,e},EJ.invert=function(e,t){return IJ.invert(e.array,t.array),e._dirty=!0,e},EJ.mul=function(e,t,n){return IJ.mul(e.array,t.array,n.array),e._dirty=!0,e},EJ.multiply=EJ.mul,EJ.rotate=function(e,t,n){return IJ.rotate(e.array,t.array,n),e._dirty=!0,e},EJ.scale=function(e,t,n){return IJ.scale(e.array,t.array,n.array),e._dirty=!0,e},EJ.transpose=function(e,t){return IJ.transpose(e.array,t.array),e._dirty=!0,e};var LJ={create:function(){var e=new YZ(6);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},clone:function(e){var t=new YZ(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},invert:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=n*o-r*i;return l?(l=1/l,e[0]=o*l,e[1]=-r*l,e[2]=-i*l,e[3]=n*l,e[4]=(i*s-o*a)*l,e[5]=(r*a-n*s)*l,e):null},determinant:function(e){return e[0]*e[3]-e[1]*e[2]},multiply:function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=n[0],c=n[1],h=n[2],d=n[3],p=n[4],f=n[5];return e[0]=r*u+o*c,e[1]=i*u+a*c,e[2]=r*h+o*d,e[3]=i*h+a*d,e[4]=r*p+o*f+s,e[5]=i*p+a*f+l,e}};LJ.mul=LJ.multiply,LJ.rotate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=Math.sin(n),c=Math.cos(n);return e[0]=r*c+o*u,e[1]=i*c+a*u,e[2]=r*-u+o*c,e[3]=i*-u+a*c,e[4]=s,e[5]=l,e},LJ.scale=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=n[0],c=n[1];return e[0]=r*u,e[1]=i*u,e[2]=o*c,e[3]=a*c,e[4]=s,e[5]=l,e},LJ.translate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=n[0],c=n[1];return e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=r*u+o*c+s,e[5]=i*u+a*c+l,e},LJ.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+1)};var NJ=function(){this.array=LJ.create(),this._dirty=!0};NJ.prototype={constructor:NJ,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},clone:function(){return(new NJ).copy(this)},copy:function(e){return LJ.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return LJ.determinant(this.array)},identity:function(){return LJ.identity(this.array),this._dirty=!0,this},invert:function(){return LJ.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return LJ.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return LJ.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return LJ.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return LJ.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return LJ.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return LJ.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return LJ.translate(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},NJ.copy=function(e,t){return LJ.copy(e.array,t.array),e._dirty=!0,e},NJ.determinant=function(e){return LJ.determinant(e.array)},NJ.identity=function(e){return LJ.identity(e.array),e._dirty=!0,e},NJ.invert=function(e,t){return LJ.invert(e.array,t.array),e._dirty=!0,e},NJ.mul=function(e,t,n){return LJ.mul(e.array,t.array,n.array),e._dirty=!0,e},NJ.multiply=NJ.mul,NJ.rotate=function(e,t,n){return LJ.rotate(e.array,t.array,n),e._dirty=!0,e},NJ.scale=function(e,t,n){return LJ.scale(e.array,t.array,n.array),e._dirty=!0,e},NJ.translate=function(e,t,n){return LJ.translate(e.array,t.array,n.array),e._dirty=!0,e};var PJ=function(){this.array=eK.create(),this._dirty=!0};PJ.prototype={constructor:PJ,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},adjoint:function(){return eK.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new PJ).copy(this)},copy:function(e){return eK.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return eK.determinant(this.array)},fromMat2d:function(e){return eK.fromMat2d(this.array,e.array),this._dirty=!0,this},fromMat4:function(e){return eK.fromMat4(this.array,e.array),this._dirty=!0,this},fromQuat:function(e){return eK.fromQuat(this.array,e.array),this._dirty=!0,this},identity:function(){return eK.identity(this.array),this._dirty=!0,this},invert:function(){return eK.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return eK.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return eK.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return eK.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return eK.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return eK.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return eK.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return eK.translate(this.array,this.array,e.array),this._dirty=!0,this},normalFromMat4:function(e){return eK.normalFromMat4(this.array,e.array),this._dirty=!0,this},transpose:function(){return eK.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},PJ.adjoint=function(e,t){return eK.adjoint(e.array,t.array),e._dirty=!0,e},PJ.copy=function(e,t){return eK.copy(e.array,t.array),e._dirty=!0,e},PJ.determinant=function(e){return eK.determinant(e.array)},PJ.identity=function(e){return eK.identity(e.array),e._dirty=!0,e},PJ.invert=function(e,t){return eK.invert(e.array,t.array),e},PJ.mul=function(e,t,n){return eK.mul(e.array,t.array,n.array),e._dirty=!0,e},PJ.multiply=PJ.mul,PJ.fromMat2d=function(e,t){return eK.fromMat2d(e.array,t.array),e._dirty=!0,e},PJ.fromMat4=function(e,t){return eK.fromMat4(e.array,t.array),e._dirty=!0,e},PJ.fromQuat=function(e,t){return eK.fromQuat(e.array,t.array),e._dirty=!0,e},PJ.normalFromMat4=function(e,t){return eK.normalFromMat4(e.array,t.array),e._dirty=!0,e},PJ.rotate=function(e,t,n){return eK.rotate(e.array,t.array,n),e._dirty=!0,e},PJ.scale=function(e,t,n){return eK.scale(e.array,t.array,n.array),e._dirty=!0,e},PJ.transpose=function(e,t){return eK.transpose(e.array,t.array),e._dirty=!0,e},PJ.translate=function(e,t,n){return eK.translate(e.array,t.array,n.array),e._dirty=!0,e};var OJ={_animators:null,getAnimators:function(){return this._animators=this._animators||[],this._animators},animate:function(e,t){this._animators=this._animators||[];var n;if(e){for(var r=e.split("."),i=this,o=0,a=r.length;o<a;o++)i&&(i=i[r[o]]);i&&(n=i)}else n=this;if(null==n)throw new Error("Target "+e+" not exists");var s=this._animators,l=new Xr(n,t),u=this;return l.during((function(){u.__zr&&u.__zr.refresh()})).done((function(){var e=s.indexOf(l);e>=0&&s.splice(e,1)})),s.push(l),this.__zr&&this.__zr.animation.addAnimator(l),l},stopAnimation:function(e){this._animators=this._animators||[];for(var t=this._animators,n=t.length,r=0;r<n;r++)t[r].stop(e);return t.length=0,this},addAnimatorsToZr:function(e){if(this._animators)for(var t=0;t<this._animators.length;t++)e.animation.addAnimator(this._animators[t])},removeAnimatorsFromZr:function(e){if(this._animators)for(var t=0;t<this._animators.length;t++)e.animation.removeAnimator(this._animators[t])}},RJ="\n@export clay.util.rand\nhighp float rand(vec2 uv) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(uv.xy, vec2(a,b)), sn = mod(dt, 3.141592653589793);\n return fract(sin(sn) * c);\n}\n@end\n@export clay.util.calculate_attenuation\nuniform float attenuationFactor : 5.0;\nfloat lightAttenuation(float dist, float range)\n{\n float attenuation = 1.0;\n attenuation = dist*dist/(range*range+1.0);\n float att_s = attenuationFactor;\n attenuation = 1.0/(attenuation*att_s+1.0);\n att_s = 1.0/(att_s+1.0);\n attenuation = attenuation - att_s;\n attenuation /= 1.0 - att_s;\n return clamp(attenuation, 0.0, 1.0);\n}\n@end\n@export clay.util.edge_factor\n#ifdef SUPPORT_STANDARD_DERIVATIVES\nfloat edgeFactor(float width)\n{\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * width, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#else\nfloat edgeFactor(float width)\n{\n return 1.0;\n}\n#endif\n@end\n@export clay.util.encode_float\nvec4 encodeFloat(const in float depth)\n{\n const vec4 bitShifts = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);\n const vec4 bit_mask = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);\n vec4 res = fract(depth * bitShifts);\n res -= res.xxyz * bit_mask;\n return res;\n}\n@end\n@export clay.util.decode_float\nfloat decodeFloat(const in vec4 color)\n{\n const vec4 bitShifts = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);\n return dot(color, bitShifts);\n}\n@end\n@export clay.util.float\n@import clay.util.encode_float\n@import clay.util.decode_float\n@end\n@export clay.util.rgbm_decode\nvec3 RGBMDecode(vec4 rgbm, float range) {\n return range * rgbm.rgb * rgbm.a;\n}\n@end\n@export clay.util.rgbm_encode\nvec4 RGBMEncode(vec3 color, float range) {\n if (dot(color, color) == 0.0) {\n return vec4(0.0);\n }\n vec4 rgbm;\n color /= range;\n rgbm.a = clamp(max(max(color.r, color.g), max(color.b, 1e-6)), 0.0, 1.0);\n rgbm.a = ceil(rgbm.a * 255.0) / 255.0;\n rgbm.rgb = color / rgbm.a;\n return rgbm;\n}\n@end\n@export clay.util.rgbm\n@import clay.util.rgbm_decode\n@import clay.util.rgbm_encode\nvec4 decodeHDR(vec4 color)\n{\n#if defined(RGBM_DECODE) || defined(RGBM)\n return vec4(RGBMDecode(color, 8.12), 1.0);\n#else\n return color;\n#endif\n}\nvec4 encodeHDR(vec4 color)\n{\n#if defined(RGBM_ENCODE) || defined(RGBM)\n return RGBMEncode(color.xyz, 8.12);\n#else\n return color;\n#endif\n}\n@end\n@export clay.util.srgb\nvec4 sRGBToLinear(in vec4 value) {\n return vec4(mix(pow(value.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), value.rgb * 0.0773993808, vec3(lessThanEqual(value.rgb, vec3(0.04045)))), value.w);\n}\nvec4 linearTosRGB(in vec4 value) {\n return vec4(mix(pow(value.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), value.rgb * 12.92, vec3(lessThanEqual(value.rgb, vec3(0.0031308)))), value.w);\n}\n@end\n@export clay.chunk.skinning_header\n#ifdef SKINNING\nattribute vec3 weight : WEIGHT;\nattribute vec4 joint : JOINT;\n#ifdef USE_SKIN_MATRICES_TEXTURE\nuniform sampler2D skinMatricesTexture : ignore;\nuniform float skinMatricesTextureSize: ignore;\nmat4 getSkinMatrix(sampler2D tex, float idx) {\n float j = idx * 4.0;\n float x = mod(j, skinMatricesTextureSize);\n float y = floor(j / skinMatricesTextureSize) + 0.5;\n vec2 scale = vec2(skinMatricesTextureSize);\n return mat4(\n texture2D(tex, vec2(x + 0.5, y) / scale),\n texture2D(tex, vec2(x + 1.5, y) / scale),\n texture2D(tex, vec2(x + 2.5, y) / scale),\n texture2D(tex, vec2(x + 3.5, y) / scale)\n );\n}\nmat4 getSkinMatrix(float idx) {\n return getSkinMatrix(skinMatricesTexture, idx);\n}\n#else\nuniform mat4 skinMatrix[JOINT_COUNT] : SKIN_MATRIX;\nmat4 getSkinMatrix(float idx) {\n return skinMatrix[int(idx)];\n}\n#endif\n#endif\n@end\n@export clay.chunk.skin_matrix\nmat4 skinMatrixWS = getSkinMatrix(joint.x) * weight.x;\nif (weight.y > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.y) * weight.y;\n}\nif (weight.z > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.z) * weight.z;\n}\nfloat weightW = 1.0-weight.x-weight.y-weight.z;\nif (weightW > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.w) * weightW;\n}\n@end\n@export clay.chunk.instancing_header\n#ifdef INSTANCING\nattribute vec4 instanceMat1;\nattribute vec4 instanceMat2;\nattribute vec4 instanceMat3;\n#endif\n@end\n@export clay.chunk.instancing_matrix\nmat4 instanceMat = mat4(\n vec4(instanceMat1.xyz, 0.0),\n vec4(instanceMat2.xyz, 0.0),\n vec4(instanceMat3.xyz, 0.0),\n vec4(instanceMat1.w, instanceMat2.w, instanceMat3.w, 1.0)\n);\n@end\n@export clay.util.parallax_correct\nvec3 parallaxCorrect(in vec3 dir, in vec3 pos, in vec3 boxMin, in vec3 boxMax) {\n vec3 first = (boxMax - pos) / dir;\n vec3 second = (boxMin - pos) / dir;\n vec3 further = max(first, second);\n float dist = min(further.x, min(further.y, further.z));\n vec3 fixedPos = pos + dir * dist;\n vec3 boxCenter = (boxMax + boxMin) * 0.5;\n return normalize(fixedPos - boxCenter);\n}\n@end\n@export clay.util.clamp_sample\nvec4 clampSample(const in sampler2D texture, const in vec2 coord)\n{\n#ifdef STEREO\n float eye = step(0.5, coord.x) * 0.5;\n vec2 coordClamped = clamp(coord, vec2(eye, 0.0), vec2(0.5 + eye, 1.0));\n#else\n vec2 coordClamped = clamp(coord, vec2(0.0), vec2(1.0));\n#endif\n return texture2D(texture, coordClamped);\n}\n@end\n@export clay.util.ACES\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\n@end";function kJ(e){return e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof Image}Object.assign(MK.prototype,OJ),wq.import(RJ),wq.import(Mq),wq.import("\n@export ecgl.common.transformUniforms\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nuniform mat4 world : WORLD;\n@end\n\n@export ecgl.common.attributes\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 normal : NORMAL;\n@end\n\n@export ecgl.common.uv.header\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\nuniform vec2 detailUvRepeat : [1.0, 1.0];\nuniform vec2 detailUvOffset : [0.0, 0.0];\n\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n@export ecgl.common.uv.main\nv_Texcoord = texcoord * uvRepeat + uvOffset;\nv_DetailTexcoord = texcoord * detailUvRepeat + detailUvOffset;\n@end\n\n@export ecgl.common.uv.fragmentHeader\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n\n@export ecgl.common.albedo.main\n\n vec4 albedoTexel = vec4(1.0);\n#ifdef DIFFUSEMAP_ENABLED\n albedoTexel = texture2D(diffuseMap, v_Texcoord);\n #ifdef SRGB_DECODE\n albedoTexel = sRGBToLinear(albedoTexel);\n #endif\n#endif\n\n#ifdef DETAILMAP_ENABLED\n vec4 detailTexel = texture2D(detailMap, v_DetailTexcoord);\n #ifdef SRGB_DECODE\n detailTexel = sRGBToLinear(detailTexel);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, detailTexel.rgb, detailTexel.a);\n albedoTexel.a = detailTexel.a + (1.0 - detailTexel.a) * albedoTexel.a;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexHeader\n\n#ifdef WIREFRAME_QUAD\nattribute vec4 barycentric;\nvarying vec4 v_Barycentric;\n#elif defined(WIREFRAME_TRIANGLE)\nattribute vec3 barycentric;\nvarying vec3 v_Barycentric;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n v_Barycentric = barycentric;\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentHeader\n\nuniform float wireframeLineWidth : 1;\nuniform vec4 wireframeLineColor: [0, 0, 0, 0.5];\n\n#ifdef WIREFRAME_QUAD\nvarying vec4 v_Barycentric;\nfloat edgeFactor () {\n vec4 d = fwidth(v_Barycentric);\n vec4 a4 = smoothstep(vec4(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(min(a4.x, a4.y), a4.z), a4.w);\n}\n#elif defined(WIREFRAME_TRIANGLE)\nvarying vec3 v_Barycentric;\nfloat edgeFactor () {\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n if (wireframeLineWidth > 0.) {\n vec4 lineColor = wireframeLineColor;\n#ifdef SRGB_DECODE\n lineColor = sRGBToLinear(lineColor);\n#endif\n\n gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor()) * lineColor.a);\n }\n#endif\n@end\n\n\n\n\n@export ecgl.common.bumpMap.header\n\n#ifdef BUMPMAP_ENABLED\nuniform sampler2D bumpMap;\nuniform float bumpScale : 1.0;\n\n\nvec3 bumpNormal(vec3 surfPos, vec3 surfNormal, vec3 baseNormal)\n{\n vec2 dSTdx = dFdx(v_Texcoord);\n vec2 dSTdy = dFdy(v_Texcoord);\n\n float Hll = bumpScale * texture2D(bumpMap, v_Texcoord).x;\n float dHx = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdx).x - Hll;\n float dHy = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdy).x - Hll;\n\n vec3 vSigmaX = dFdx(surfPos);\n vec3 vSigmaY = dFdy(surfPos);\n vec3 vN = surfNormal;\n\n vec3 R1 = cross(vSigmaY, vN);\n vec3 R2 = cross(vN, vSigmaX);\n\n float fDet = dot(vSigmaX, R1);\n\n vec3 vGrad = sign(fDet) * (dHx * R1 + dHy * R2);\n return normalize(abs(fDet) * baseNormal - vGrad);\n\n}\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexHeader\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexMain\n\n#ifdef NORMALMAP_ENABLED\n if (dot(tangent, tangent) > 0.0) {\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n }\n#endif\n\n@end\n\n\n@export ecgl.common.normalMap.fragmentHeader\n\n#ifdef NORMALMAP_ENABLED\nuniform sampler2D normalMap;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.fragmentMain\n#ifdef NORMALMAP_ENABLED\n if (dot(v_Tangent, v_Tangent) > 0.0) {\n vec3 normalTexel = texture2D(normalMap, v_DetailTexcoord).xyz;\n if (dot(normalTexel, normalTexel) > 0.0) { N = normalTexel * 2.0 - 1.0;\n mat3 tbn = mat3(v_Tangent, v_Bitangent, v_Normal);\n N = normalize(tbn * N);\n }\n }\n#endif\n@end\n\n\n\n@export ecgl.common.vertexAnimation.header\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevNormal;\nuniform float percent;\n#endif\n\n@end\n\n@export ecgl.common.vertexAnimation.main\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n vec3 norm = mix(prevNormal, normal, percent);\n#else\n vec3 pos = position;\n vec3 norm = normal;\n#endif\n\n@end\n\n\n@export ecgl.common.ssaoMap.header\n#ifdef SSAOMAP_ENABLED\nuniform sampler2D ssaoMap;\nuniform vec4 viewport : VIEWPORT;\n#endif\n@end\n\n@export ecgl.common.ssaoMap.main\n float ao = 1.0;\n#ifdef SSAOMAP_ENABLED\n ao = texture2D(ssaoMap, (gl_FragCoord.xy - viewport.xy) / viewport.zw).r;\n#endif\n@end\n\n\n\n\n@export ecgl.common.diffuseLayer.header\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\nuniform float layerDiffuseIntensity[LAYER_DIFFUSEMAP_COUNT];\nuniform sampler2D layerDiffuseMap[LAYER_DIFFUSEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.header\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\nuniform float layerEmissionIntensity[LAYER_EMISSIVEMAP_COUNT];\nuniform sampler2D layerEmissiveMap[LAYER_EMISSIVEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.layers.header\n@import ecgl.common.diffuseLayer.header\n@import ecgl.common.emissiveLayer.header\n@end\n\n@export ecgl.common.diffuseLayer.main\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_DIFFUSEMAP_COUNT; _idx_++) {{\n float intensity = layerDiffuseIntensity[_idx_];\n vec4 texel2 = texture2D(layerDiffuseMap[_idx_], v_Texcoord);\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, texel2.rgb * intensity, texel2.a);\n albedoTexel.a = texel2.a + (1.0 - texel2.a) * albedoTexel.a;\n }}\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.main\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_EMISSIVEMAP_COUNT; _idx_++)\n {{\n vec4 texel2 = texture2D(layerEmissiveMap[_idx_], v_Texcoord) * layerEmissionIntensity[_idx_];\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n float intensity = layerEmissionIntensity[_idx_];\n gl_FragColor.rgb += texel2.rgb * texel2.a * intensity;\n }}\n#endif\n\n@end\n"),wq.import("@export ecgl.color.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\n@import ecgl.common.uv.header\n\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 position: POSITION;\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\n#ifdef ATMOSPHERE_ENABLED\nattribute vec3 normal: NORMAL;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nvarying vec3 v_Normal;\n#endif\n\nvoid main()\n{\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n @import ecgl.common.uv.main\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef ATMOSPHERE_ENABLED\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n@export ecgl.color.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\nvarying vec3 v_Normal;\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.layers.header\n\n@import ecgl.common.uv.fragmentHeader\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n\n}\n@end"),wq.import("/**\n * http: */\n\n@export ecgl.lambert.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n\n@import ecgl.common.attributes\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.vertexAnimation.header\n\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n}\n\n@end\n\n\n@export ecgl.lambert.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\n#endif\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n gl_FragColor *= sRGBToLinear(v_Color);\n #else\n gl_FragColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n diffuseColor += ambientLightColor[i] * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseColor += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n vec3 lightColor = directionalLightColor[i];\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n diffuseColor += lightColor * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor.rgb *= diffuseColor;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"),wq.import("@export ecgl.realistic.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@import ecgl.common.vertexAnimation.header\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n\n\n@export ecgl.realistic.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n#define PI 3.14159265358979\n#define ROUGHNESS_CHANEL 0\n#define METALNESS_CHANEL 1\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\n\nuniform sampler2D detailMap;\nuniform sampler2D metalnessMap;\nuniform sampler2D roughnessMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform float metalness : 0.0;\nuniform float roughness : 0.5;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\n#endif\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n@import clay.header.ambient_cubemap_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.normalMap.fragmentHeader\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import clay.util.rgbm\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n\nfloat D_Phong(float g, float ndh) {\n float a = pow(8192.0, g);\n return (a + 2.0) / 8.0 * pow(ndh, a);\n}\n\nvoid main()\n{\n vec4 albedoColor = color;\n\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n albedoColor *= sRGBToLinear(v_Color);\n #else\n albedoColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n albedoColor *= albedoTexel;\n\n float m = metalness;\n\n#ifdef METALNESSMAP_ENABLED\n float m2 = texture2D(metalnessMap, v_DetailTexcoord)[METALNESS_CHANEL];\n m = clamp(m2 + (m - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 baseColor = albedoColor.rgb;\n albedoColor.rgb = baseColor * (1.0 - m);\n vec3 specFactor = mix(vec3(0.04), baseColor, m);\n\n float g = 1.0 - roughness;\n\n#ifdef ROUGHNESSMAP_ENABLED\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 N = v_Normal;\n\n#ifdef DOUBLE_SIDED\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n@import ecgl.common.normalMap.fragmentMain\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseTerm = vec3(0.0);\n vec3 specularTerm = vec3(0.0);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n vec3 fresnelTerm = F_Schlick(ndv, specFactor);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += ambientLightColor[_idx_] * ambientFactor * ao;\n }}\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++)\n {{\n vec3 L = -directionalLightDirection[_idx_];\n vec3 lc = directionalLightColor[_idx_];\n\n vec3 H = normalize(L + V);\n float ndl = clamp(dot(N, normalize(L)), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[_idx_];\n }\n#endif\n\n vec3 li = lc * ndl * shadowContrib;\n\n diffuseTerm += li;\n specularTerm += li * fresnelTerm * D_Phong(g, ndh);\n }}\n#endif\n\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n vec3 L = reflect(-V, N);\n L = vec3(L.x, L[NORMAL_UP_AXIS], L[NORMAL_FRONT_AXIS]);\n float rough2 = clamp(1.0 - g, 0.0, 1.0);\n float bias2 = rough2 * 5.0;\n vec2 brdfParam2 = texture2D(ambientCubemapLightBRDFLookup[0], vec2(rough2, ndv)).xy;\n vec3 envWeight2 = specFactor * brdfParam2.x + brdfParam2.y;\n vec3 envTexel2;\n for(int _idx_ = 0; _idx_ < AMBIENT_CUBEMAP_LIGHT_COUNT; _idx_++)\n {{\n envTexel2 = RGBMDecode(textureCubeLodEXT(ambientCubemapLightCubemap[_idx_], L, bias2), 8.12);\n specularTerm += ambientCubemapLightColor[_idx_] * envTexel2 * envWeight2 * ao;\n }}\n#endif\n\n gl_FragColor.rgb = albedoColor.rgb * diffuseTerm + specularTerm;\n gl_FragColor.a = albedoColor.a;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n#ifdef SRGB_ENCODE\n gl_FragColor = linearTosRGB(gl_FragColor);\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"),wq.import("@export ecgl.hatching.vertex\n\n@import ecgl.realistic.vertex\n\n@end\n\n\n@export ecgl.hatching.fragment\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform vec4 color : [0.0, 0.0, 0.0, 1.0];\nuniform vec4 paperColor : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nuniform sampler2D hatch1;\nuniform sampler2D hatch2;\nuniform sampler2D hatch3;\nuniform sampler2D hatch4;\nuniform sampler2D hatch5;\nuniform sampler2D hatch6;\n\nfloat shade(in float tone) {\n vec4 c = vec4(1. ,1., 1., 1.);\n float step = 1. / 6.;\n vec2 uv = v_DetailTexcoord;\n if (tone <= step / 2.0) {\n c = mix(vec4(0.), texture2D(hatch6, uv), 12. * tone);\n }\n else if (tone <= step) {\n c = mix(texture2D(hatch6, uv), texture2D(hatch5, uv), 6. * tone);\n }\n if(tone > step && tone <= 2. * step){\n c = mix(texture2D(hatch5, uv), texture2D(hatch4, uv) , 6. * (tone - step));\n }\n if(tone > 2. * step && tone <= 3. * step){\n c = mix(texture2D(hatch4, uv), texture2D(hatch3, uv), 6. * (tone - 2. * step));\n }\n if(tone > 3. * step && tone <= 4. * step){\n c = mix(texture2D(hatch3, uv), texture2D(hatch2, uv), 6. * (tone - 3. * step));\n }\n if(tone > 4. * step && tone <= 5. * step){\n c = mix(texture2D(hatch2, uv), texture2D(hatch1, uv), 6. * (tone - 4. * step));\n }\n if(tone > 5. * step){\n c = mix(texture2D(hatch1, uv), vec4(1.), 6. * (tone - 5. * step));\n }\n\n return c.r;\n}\n\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n vec4 inkColor = sRGBToLinear(color);\n#else\n vec4 inkColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n inkColor *= sRGBToLinear(v_Color);\n #else\n inkColor *= v_Color;\n #endif\n#endif\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float tone = 0.0;\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n tone += dot(ambientLightColor[i], w) * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n tone += dot(calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_], w) * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n float lightTone = dot(directionalLightColor[i], w);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n tone += lightTone * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor = mix(inkColor, paperColor, shade(clamp(tone, 0.0, 1.0)));\n }\n@end\n"),wq.import("@export ecgl.sm.depth.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\n\nvoid main(){\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n v_ViewPosition = worldViewProjection * vec4(pos, 1.0);\n gl_Position = v_ViewPosition;\n\n v_Texcoord = texcoord;\n\n}\n@end\n\n\n\n@export ecgl.sm.depth.fragment\n\n@import clay.sm.depth.fragment\n\n@end");var zJ=b$.prototype.addToScene,VJ=b$.prototype.removeFromScene;b$.prototype.addToScene=function(e){if(zJ.call(this,e),this.__zr){var t=this.__zr;e.traverse((function(e){e.__zr=t,e.addAnimatorsToZr&&e.addAnimatorsToZr(t)}))}},b$.prototype.removeFromScene=function(e){VJ.call(this,e),e.traverse((function(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)}))},jZ.prototype.setTextureImage=function(e,t,n,r){if(this.shader){var i,o,a=n.getZr(),s=this;return s.autoUpdateTextureStatus=!1,s.disableTexture(e),(o=t)&&"none"!==o&&(i=BJ.loadTexture(t,n,r,(function(t){s.enableTexture(e),a&&a.refresh()})),s.set(e,i)),i}};var BJ={};BJ.Renderer=Vq,BJ.Node=MK,BJ.Mesh=LK,BJ.Shader=wq,BJ.Material=jZ,BJ.Texture=EK,BJ.Texture2D=RK,BJ.Geometry=XK,BJ.SphereGeometry=bJ,BJ.PlaneGeometry=G$,BJ.CubeGeometry=U$,BJ.AmbientLight=wJ,BJ.DirectionalLight=SJ,BJ.PointLight=TJ,BJ.SpotLight=MJ,BJ.PerspectiveCamera=D$,BJ.OrthographicCamera=aJ,BJ.Vector2=KZ,BJ.Vector3=Fq,BJ.Vector4=CJ,BJ.Quaternion=cK,BJ.Matrix2=EJ,BJ.Matrix2d=NJ,BJ.Matrix3=PJ,BJ.Matrix4=aK,BJ.Plane=i$,BJ.Ray=Jq,BJ.BoundingBox=bK,BJ.Frustum=h$;var FJ=null;function GJ(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}function HJ(e){if((e.wrapS===EK.REPEAT||e.wrapT===EK.REPEAT)&&e.image){var t=GJ(e.width),n=GJ(e.height);if(t!==e.width||n!==e.height){var r=document.createElement("canvas");r.width=t,r.height=n,r.getContext("2d").drawImage(e.image,0,0,t,n),e.image=r}}}BJ.loadTexture=function(e,t,n,r){"function"==typeof n&&(r=n,n={}),n=n||{};for(var i=Object.keys(n).sort(),o="",a=0;a<i.length;a++)o+=i[a]+"_"+n[i[a]]+"_";var s,l=t.__textureCache=t.__textureCache||new Wn(20);if((s=e).getZr&&s.setOption){var u=e.__textureid__;if(h=l.get(o+u))h.texture.surface.setECharts(e),r&&r(h.texture);else{var c=new oJ(e);c.onupdate=function(){t.getZr().refresh()},h={texture:c.getTexture()};for(a=0;a<i.length;a++)h.texture[i[a]]=n[i[a]];u=e.__textureid__||"__ecgl_ec__"+h.texture.__uid__,e.__textureid__=u,l.put(o+u,h),r&&r(h.texture)}return h.texture}if(kJ(e)){var h;u=e.__textureid__;if(!(h=l.get(o+u))){h={texture:new BJ.Texture2D({image:e})};for(a=0;a<i.length;a++)h.texture[i[a]]=n[i[a]];u=e.__textureid__||"__ecgl_image__"+h.texture.__uid__,e.__textureid__=u,l.put(o+u,h),HJ(h.texture),r&&r(h.texture)}return h.texture}if(h=l.get(o+e))h.callbacks?h.callbacks.push(r):r&&r(h.texture);else if(e.match(/.hdr$|^data:application\/octet-stream/)){h={callbacks:[r]};var d=nJ.loadTexture(e,{exposure:n.exposure,fileType:"hdr"},(function(){d.dirty(),h.callbacks.forEach((function(e){e&&e(d)})),h.callbacks=null}));h.texture=d,l.put(o+e,h)}else{for(d=new BJ.Texture2D({image:new Image}),a=0;a<i.length;a++)d[i[a]]=n[i[a]];h={texture:d,callbacks:[r]};var p=d.image;p.onload=function(){d.image=p,HJ(d),d.dirty(),h.callbacks.forEach((function(e){e&&e(d)})),h.callbacks=null},p.crossOrigin="Anonymous",p.src=e,d.image=null!==FJ?FJ:FJ=nJ.createBlank("rgba(255,255,255,0)").image,l.put(o+e,h)}return h.texture},BJ.createAmbientCubemap=function(e,t,n,r){var i=(e=e||{}).texture,o=_J(e.exposure,1),a=new pJ({intensity:_J(e.specularIntensity,1)}),s=new fJ({intensity:_J(e.diffuseIntensity,1),coefficients:[.844,.712,.691,-.037,.083,.167,.343,.288,.299,-.041,-.021,-.009,-.003,-.041,-.064,-.011,-.007,-.004,-.031,.034,.081,-.06,-.049,-.06,.046,.056,.05]});return a.cubemap=BJ.loadTexture(i,n,{exposure:o},(function(){if(a.cubemap.flipY=!1,"production"!==process.env.NODE_ENV)var e=Date.now();if(a.prefilter(t,32),"production"!==process.env.NODE_ENV){var n=Date.now()-e;console.log("Prefilter environment map: "+n+"ms")}s.coefficients=gJ.projectEnvironmentMap(t,a.cubemap,{lod:1}),r&&r()})),{specular:a,diffuse:s}},BJ.createBlankTexture=nJ.createBlank,BJ.isImage=kJ,BJ.additiveBlend=function(e){e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE)},BJ.parseColor=function(e,t){return e instanceof Array?(t||(t=[]),t[0]=e[0],t[1]=e[1],t[2]=e[2],e.length>3?t[3]=e[3]:t[3]=1,t):((t=rr(e||"#000",t)||[0,0,0,0])[0]/=255,t[1]/=255,t[2]/=255,t)},BJ.directionFromAlphaBeta=function(e,t){var n=e/180*Math.PI+Math.PI/2,r=-t/180*Math.PI+Math.PI/2,i=[],o=Math.sin(n);return i[0]=o*Math.cos(r),i[1]=-Math.cos(n),i[2]=o*Math.sin(r),i},BJ.getShadowResolution=function(e){var t=1024;switch(e){case"low":t=512;break;case"medium":break;case"high":t=2048;break;case"ultra":t=4096}return t},BJ.COMMON_SHADERS=["lambert","color","realistic","hatching","shadow"],BJ.createShader=function(e){"ecgl.shadow"===e&&(e="ecgl.displayShadow");var t=wq.source(e+".vertex"),n=wq.source(e+".fragment");t||console.error("Vertex shader of '%s' not exits",e),n||console.error("Fragment shader of '%s' not exits",e);var r=new wq(t,n);return r.name=e,r},BJ.createMaterial=function(e,t){t instanceof Array||(t=[t]);var n=BJ.createShader(e),r=new jZ({shader:n});return t.forEach((function(e){"string"==typeof e&&r.define(e)})),r},BJ.setMaterialFromModel=function(e,t,n,r){t.autoUpdateTextureStatus=!1;var i=n.getModel(e+"Material"),o=i.get("detailTexture"),a=_J(i.get("textureTiling"),1),s=_J(i.get("textureOffset"),0);"number"==typeof a&&(a=[a,a]),"number"==typeof s&&(s=[s,s]);var l=a[0]>1||a[1]>1?BJ.Texture.REPEAT:BJ.Texture.CLAMP_TO_EDGE,u={anisotropic:8,wrapS:l,wrapT:l};if("realistic"===e){var c=i.get("roughness"),h=i.get("metalness");null!=h?isNaN(h)&&(t.setTextureImage("metalnessMap",h,r,u),h=_J(i.get("metalnessAdjust"),.5)):h=0,null!=c?isNaN(c)&&(t.setTextureImage("roughnessMap",c,r,u),c=_J(i.get("roughnessAdjust"),.5)):c=.5;var d=i.get("normalTexture");t.setTextureImage("detailMap",o,r,u),t.setTextureImage("normalMap",d,r,u),t.set({roughness:c,metalness:h,detailUvRepeat:a,detailUvOffset:s})}else if("lambert"===e)t.setTextureImage("detailMap",o,r,u),t.set({detailUvRepeat:a,detailUvOffset:s});else if("color"===e)t.setTextureImage("detailMap",o,r,u),t.set({detailUvRepeat:a,detailUvOffset:s});else if("hatching"===e){var p=i.get("hatchingTextures")||[];p.length<6&&"production"!==process.env.NODE_ENV&&console.error("Invalid hatchingTextures.");for(var f=0;f<6;f++)t.setTextureImage("hatch"+(f+1),p[f],r,{anisotropic:8,wrapS:BJ.Texture.REPEAT,wrapT:BJ.Texture.REPEAT});t.set({detailUvRepeat:a,detailUvOffset:s})}},BJ.updateVertexAnimation=function(e,t,n,r){var i=r.get("animation"),o=r.get("animationDurationUpdate"),a=r.get("animationEasingUpdate"),s=n.shadowDepthMaterial;if(i&&t&&o>0&&t.geometry.vertexCount===n.geometry.vertexCount){n.material.define("vertex","VERTEX_ANIMATION"),n.ignorePreZ=!0,s&&s.define("vertex","VERTEX_ANIMATION");for(var l=0;l<e.length;l++)n.geometry.attributes[e[l][0]].value=t.geometry.attributes[e[l][1]].value;n.geometry.dirty(),n.__percent=0,n.material.set("percent",0),n.stopAnimation(),n.animate().when(o,{__percent:1}).during((function(){n.material.set("percent",n.__percent),s&&s.set("percent",n.__percent)})).done((function(){n.ignorePreZ=!1,n.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")})).start(a)}else n.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")};var UJ=function(e,t){this.id=e,this.zr=t;try{this.renderer=new Vq({clearBit:0,devicePixelRatio:t.painter.dpr,preserveDrawingBuffer:!0,premultipliedAlpha:!0}),this.renderer.resize(t.painter.getWidth(),t.painter.getHeight())}catch(e){return this.renderer=null,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute; left: 0; top: 0; right: 0; bottom: 0;",this.dom.className="ecgl-nowebgl",this.dom.innerHTML="Sorry, your browser does not support WebGL",void console.error(e)}this.onglobalout=this.onglobalout.bind(this),t.on("globalout",this.onglobalout),this.dom=this.renderer.canvas;var n=this.dom.style;n.position="absolute",n.left="0",n.top="0",this.views=[],this._picking=new DK({renderer:this.renderer}),this._viewsToDispose=[],this._accumulatingId=0,this._zrEventProxy=new ol({shape:{x:-1,y:-1,width:2,height:2},__isGLToZRProxy:!0}),this._backgroundColor=null,this._disposed=!1};function WJ(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)}UJ.prototype.setUnpainted=function(){},UJ.prototype.addView=function(e){if(e.layer!==this){var t=this._viewsToDispose.indexOf(e);t>=0&&this._viewsToDispose.splice(t,1),this.views.push(e),e.layer=this;var n=this.zr;e.scene.traverse((function(e){e.__zr=n,e.addAnimatorsToZr&&e.addAnimatorsToZr(n)}))}},UJ.prototype.removeView=function(e){if(e.layer===this){var t=this.views.indexOf(e);t>=0&&(this.views.splice(t,1),e.scene.traverse(WJ,this),e.layer=null,this._viewsToDispose.push(e))}},UJ.prototype.removeViewsAll=function(){this.views.forEach((function(e){e.scene.traverse(WJ,this),e.layer=null,this._viewsToDispose.push(e)}),this),this.views.length=0},UJ.prototype.resize=function(e,t){this.renderer.resize(e,t)},UJ.prototype.clear=function(){var e=this.renderer.gl,t=this._backgroundColor||[0,0,0,0];e.clearColor(t[0],t[1],t[2],t[3]),e.depthMask(!0),e.colorMask(!0,!0,!0,!0),e.clear(e.DEPTH_BUFFER_BIT|e.COLOR_BUFFER_BIT)},UJ.prototype.clearDepth=function(){var e=this.renderer.gl;e.clear(e.DEPTH_BUFFER_BIT)},UJ.prototype.clearColor=function(){var e=this.renderer.gl;e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},UJ.prototype.needsRefresh=function(){this.zr.refresh()},UJ.prototype.refresh=function(e){this._backgroundColor=e?BJ.parseColor(e):[0,0,0,0],this.renderer.clearColor=this._backgroundColor;for(var t=0;t<this.views.length;t++)this.views[t].prepareRender(this.renderer);this._doRender(!1),this._trackAndClean();for(t=0;t<this._viewsToDispose.length;t++)this._viewsToDispose[t].dispose(this.renderer);this._viewsToDispose.length=0,this._startAccumulating()},UJ.prototype.renderToCanvas=function(e){this._startAccumulating(!0),e.drawImage(this.dom,0,0,e.canvas.width,e.canvas.height)},UJ.prototype._doRender=function(e){this.clear(),this.renderer.saveViewport();for(var t=0;t<this.views.length;t++)this.views[t].render(this.renderer,e);this.renderer.restoreViewport()},UJ.prototype._stopAccumulating=function(){this._accumulatingId=0,clearTimeout(this._accumulatingTimeout)};var jJ=1;function XJ(e){for(var t=0;t<e.length;t++)e[t].__used__=0}function YJ(e,t){for(var n=0;n<t.length;n++)t[n].__used__||t[n].dispose(e)}function ZJ(e,t){e.__used__=e.__used__||0,e.__used__++,1===e.__used__&&t.push(e)}function qJ(e,t,n){var r,i;e.traverse((function(e){if(e.isRenderable()){var o=e.geometry,a=e.material;if(a!==r)for(var s=a.getTextureUniforms(),l=0;l<s.length;l++){var u=s[l],c=a.uniforms[u].value;if(c)if(c instanceof EK)ZJ(c,t);else if(c instanceof Array)for(var h=0;h<c.length;h++)c[h]instanceof EK&&ZJ(c[h],t)}o!==i&&ZJ(o,n),r=a,i=o}}));for(var o=0;o<e.lights.length;o++)e.lights[o].cubemap&&ZJ(e.lights[o].cubemap,t)}UJ.prototype._startAccumulating=function(e){var t=this;this._stopAccumulating();for(var n=!1,r=0;r<this.views.length;r++)n=this.views[r].needsAccumulate()||n;function i(r){if(t._accumulatingId&&r===t._accumulatingId){for(var o=!0,a=0;a<t.views.length;a++)o=t.views[a].isAccumulateFinished()&&n;o||(t._doRender(!0),e?i(r):dn((function(){i(r)})))}}n&&(this._accumulatingId=jJ++,e?i(t._accumulatingId):this._accumulatingTimeout=setTimeout((function(){i(t._accumulatingId)}),50))},UJ.prototype._trackAndClean=function(){var e=[],t=[];this._textureList&&(XJ(this._textureList),XJ(this._geometriesList));for(var n=0;n<this.views.length;n++)qJ(this.views[n].scene,e,t);this._textureList&&(YJ(this.renderer,this._textureList),YJ(this.renderer,this._geometriesList)),this._textureList=e,this._geometriesList=t},UJ.prototype.dispose=function(){this._disposed||(this._stopAccumulating(),this._textureList&&(XJ(this._textureList),XJ(this._geometriesList),YJ(this.renderer,this._textureList),YJ(this.renderer,this._geometriesList)),this.zr.off("globalout",this.onglobalout),this._disposed=!0)},UJ.prototype.onmousedown=function(e){if(!e.target||!e.target.__isGLToZRProxy){e=e.event;var t=this.pickObject(e.offsetX,e.offsetY);t&&(this._dispatchEvent("mousedown",e,t),this._dispatchDataEvent("mousedown",e,t)),this._downX=e.offsetX,this._downY=e.offsetY}},UJ.prototype.onmousemove=function(e){if(!e.target||!e.target.__isGLToZRProxy){e=e.event;var t=this.pickObject(e.offsetX,e.offsetY),n=t&&t.target,r=this._hovered;this._hovered=t,r&&n!==r.target&&(r.relatedTarget=n,this._dispatchEvent("mouseout",e,r),this.zr.setCursorStyle("default")),this._dispatchEvent("mousemove",e,t),t&&(this.zr.setCursorStyle("pointer"),r&&n===r.target||this._dispatchEvent("mouseover",e,t)),this._dispatchDataEvent("mousemove",e,t)}},UJ.prototype.onmouseup=function(e){if(!e.target||!e.target.__isGLToZRProxy){e=e.event;var t=this.pickObject(e.offsetX,e.offsetY);t&&(this._dispatchEvent("mouseup",e,t),this._dispatchDataEvent("mouseup",e,t)),this._upX=e.offsetX,this._upY=e.offsetY}},UJ.prototype.onclick=UJ.prototype.dblclick=function(e){if(!e.target||!e.target.__isGLToZRProxy){var t=this._upX-this._downX,n=this._upY-this._downY;if(!(Math.sqrt(t*t+n*n)>20)){e=e.event;var r=this.pickObject(e.offsetX,e.offsetY);r&&(this._dispatchEvent(e.type,e,r),this._dispatchDataEvent(e.type,e,r));var i=this._clickToSetFocusPoint(e);if(i)i.view.setDOFFocusOnPoint(i.distance)&&this.zr.refresh()}}},UJ.prototype._clickToSetFocusPoint=function(e){for(var t=this.renderer,n=t.viewport,r=this.views.length-1;r>=0;r--){var i=this.views[r];if(i.hasDOF()&&i.containPoint(e.offsetX,e.offsetY)){this._picking.scene=i.scene,this._picking.camera=i.camera,t.viewport=i.viewport;var o=this._picking.pick(e.offsetX,e.offsetY,!0);if(o)return o.view=i,o}}t.viewport=n},UJ.prototype.onglobalout=function(e){var t=this._hovered;t&&this._dispatchEvent("mouseout",e,{target:t.target})},UJ.prototype.pickObject=function(e,t){for(var n=[],r=this.renderer,i=r.viewport,o=0;o<this.views.length;o++){var a=this.views[o];a.containPoint(e,t)&&(this._picking.scene=a.scene,this._picking.camera=a.camera,r.viewport=a.viewport,this._picking.pickAll(e,t,n))}return r.viewport=i,n.sort((function(e,t){return e.distance-t.distance})),n[0]},UJ.prototype._dispatchEvent=function(e,t,n){n||(n={});var r=n.target;for(n.cancelBubble=!1,n.event=t,n.type=e,n.offsetX=t.offsetX,n.offsetY=t.offsetY;r&&(r.trigger(e,n),r=r.getParent(),!n.cancelBubble););this._dispatchToView(e,n)},UJ.prototype._dispatchDataEvent=function(e,t,n){var r=n&&n.target,i=r&&r.dataIndex,o=r&&r.seriesIndex,a=r&&r.eventData,s=!1,l=this._zrEventProxy;l.x=t.offsetX,l.y=t.offsetY,l.update();var u={target:l};const c=bl(l);"mousemove"===e&&(null!=i?i!==this._lastDataIndex&&(parseInt(this._lastDataIndex,10)>=0&&(c.dataIndex=this._lastDataIndex,c.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(u,"mouseout",t)),s=!0):null!=a&&a!==this._lastEventData&&(null!=this._lastEventData&&(c.eventData=this._lastEventData,this.zr.handler.dispatchToElement(u,"mouseout",t)),s=!0),this._lastEventData=a,this._lastDataIndex=i,this._lastSeriesIndex=o),c.eventData=a,c.dataIndex=i,c.seriesIndex=o,(null!=a||parseInt(i,10)>=0&&parseInt(o,10)>=0)&&(this.zr.handler.dispatchToElement(u,e,t),s&&this.zr.handler.dispatchToElement(u,"mouseover",t))},UJ.prototype._dispatchToView=function(e,t){for(var n=0;n<this.views.length;n++)this.views[n].containPoint(t.offsetX,t.offsetY)&&this.views[n].trigger(e,t)},Object.assign(UJ.prototype,yY);var KJ=["bar3D","line3D","map3D","scatter3D","surface","lines3D","scatterGL","scatter3D"];function $J(e,t){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var n=e[t].normal,r=e[t].emphasis;n&&(e[t]=n),r&&(e.emphasis=e.emphasis||{},e.emphasis[t]=r)}}function JJ(e){e&&(e instanceof Array||(e=[e]),W(e,(function(e){if(e.axisLabel){var t=e.axisLabel;Object.assign(t,t.textStyle),t.textStyle=null}})))}function QJ(e){this._layers={},this._zr=e}QJ.prototype.update=function(e,t){var n=this,r=t.getZr();if(r.getWidth()&&r.getHeight()){for(var i in this._layers)this._layers[i].removeViewsAll();e.eachComponent((function(n,r){if("series"!==n){var i=t.getViewOfComponentModel(r),s=r.coordinateSystem;if(i.__ecgl__){if(s){if(!s.viewGL)return void console.error("Can't find viewGL in coordinateSystem of component "+r.id);l=s.viewGL}else{if(!r.viewGL)return void console.error("Can't find viewGL of component "+r.id);l=s.viewGL}var l=s.viewGL,u=o(r);u.addView(l),i.afterRender&&i.afterRender(r,e,t,u),a(i.groupGL,r.get("silent"))}}})),e.eachSeries((function(n){var r=t.getViewOfSeriesModel(n),i=n.coordinateSystem;if(r.__ecgl__){if(i&&!i.viewGL&&!r.viewGL)return void console.error("Can't find viewGL of series "+r.id);var s=i&&i.viewGL||r.viewGL,l=o(n);l.addView(s),r.afterRender&&r.afterRender(n,e,t,l),a(r.groupGL,n.get("silent"))}}))}else console.warn("Dom has no width or height");function o(e){var t;r.setSleepAfterStill(0),t=(e.coordinateSystem&&e.coordinateSystem.model,e.get("zlevel"));var i=n._layers,o=i[t];if(!o){if(o=i[t]=new UJ("gl-"+t,r),r.painter.isSingleCanvas()){o.virtual=!0;var a=new Js({z:1e4,style:{image:o.renderer.canvas},silent:!0});o.__hostImage=a,r.add(a)}r.painter.insertLayer(t,o)}return o.__hostImage&&o.__hostImage.setStyle({width:o.renderer.getWidth(),height:o.renderer.getHeight()}),o}function a(e,t){e&&e.traverse((function(e){e.isRenderable&&e.isRenderable()&&(e.ignorePicking=null!=e.$ignorePicking?e.$ignorePicking:t)}))}},Xy((function(e){var t=e.getZr(),n=t.painter.dispose;t.painter.dispose=function(){"function"==typeof this.eachOtherLayer&&this.eachOtherLayer((function(e){e instanceof UJ&&e.dispose()})),n.call(this)},t.painter.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas)return this._layers[0].dom;var t=document.createElement("canvas"),n=e.pixelRatio||this.dpr;t.width=this.getWidth()*n,t.height=this.getHeight()*n;var r=t.getContext("2d");r.dpr=n,r.clearRect(0,0,t.width,t.height),e.backgroundColor&&(r.fillStyle=e.backgroundColor,r.fillRect(0,0,t.width,t.height));var i,o=this.storage.getDisplayList(!0),a={},s=this;function l(e,t){var n,i=s._zlevelList;null==e&&(e=-1/0);for(var o=0;o<i.length;o++){var a=i[o],l=s._layers[a];if(!l.__builtin__&&a>e&&a<t){n=l;break}}n&&n.renderToCanvas&&(r.save(),n.renderToCanvas(r),r.restore())}for(var u={ctx:r},c=0;c<o.length;c++){var h=o[c];h.zlevel!==i&&(l(i,h.zlevel),i=h.zlevel),this._doPaintEl(h,u,!0,null,a)}return l(i,1/0),t}})),Yy((function(e,t){var n=t.getZr();(n.__egl=n.__egl||new QJ(n)).update(e,t)})),Wy((function(e){W(e.series,(function(t){F(KJ,t.type)>=0&&(!function(e){$J(e,"itemStyle"),$J(e,"lineStyle"),$J(e,"areaStyle"),$J(e,"label")}(t),"mapbox"===t.coordinateSystem&&(t.coordinateSystem="mapbox3D",e.mapbox3D=e.mapbox))})),JJ(e.xAxis3D),JJ(e.yAxis3D),JJ(e.zAxis3D),JJ(e.grid3D),$J(e.geo3D)}));var eQ={defaultOption:{viewControl:{projection:"perspective",autoRotate:!1,autoRotateDirection:"cw",autoRotateSpeed:10,autoRotateAfterStill:3,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",distance:150,minDistance:40,maxDistance:400,orthographicSize:150,maxOrthographicSize:400,minOrthographicSize:20,center:[0,0,0],alpha:0,beta:0,minAlpha:-90,maxAlpha:90}},setView:function(e){e=e||{},this.option.viewControl=this.option.viewControl||{},null!=e.alpha&&(this.option.viewControl.alpha=e.alpha),null!=e.beta&&(this.option.viewControl.beta=e.beta),null!=e.distance&&(this.option.viewControl.distance=e.distance),null!=e.center&&(this.option.viewControl.center=e.center)}},tQ={defaultOption:{postEffect:{enable:!1,bloom:{enable:!0,intensity:.1},depthOfField:{enable:!1,focalRange:20,focalDistance:50,blurRadius:10,fstop:2.8,quality:"medium"},screenSpaceAmbientOcclusion:{enable:!1,radius:2,quality:"medium",intensity:1},screenSpaceReflection:{enable:!1,quality:"medium",maxRoughness:.8},colorCorrection:{enable:!0,exposure:0,brightness:0,contrast:1,saturation:1,lookupTexture:""},edge:{enable:!1},FXAA:{enable:!1}},temporalSuperSampling:{enable:"auto"}}},nQ={defaultOption:{light:{main:{shadow:!1,shadowQuality:"high",color:"#fff",intensity:1,alpha:0,beta:0},ambient:{color:"#fff",intensity:.2},ambientCubemap:{texture:null,exposure:1,diffuseIntensity:.5,specularIntensity:.5}}}},rQ=tp.extend({type:"grid3D",dependencies:["xAxis3D","yAxis3D","zAxis3D"],defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",boxWidth:100,boxHeight:100,boxDepth:100,axisPointer:{show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.8)",width:1},label:{show:!0,formatter:null,margin:8,textStyle:{fontSize:14,color:"#fff",backgroundColor:"rgba(0,0,0,0.5)",padding:3,borderRadius:3}}},axisLine:{show:!0,lineStyle:{color:"#333",width:2,type:"solid"}},axisTick:{show:!0,inside:!1,length:3,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,margin:8,textStyle:{fontSize:12}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},light:{main:{alpha:30,beta:40},ambient:{intensity:.4}},viewControl:{alpha:20,beta:40,autoRotate:!1,distance:200,minDistance:40,maxDistance:400}}});R(rQ.prototype,eQ),R(rQ.prototype,tQ),R(rQ.prototype,nQ);var iQ=_J,oQ={left:0,middle:1,right:2};function aQ(e){return e instanceof Array||(e=[e,e]),e}var sQ=wY.extend((function(){return{zr:null,viewGL:null,_center:new Fq,minDistance:.5,maxDistance:1.5,maxOrthographicSize:300,minOrthographicSize:30,minAlpha:-90,maxAlpha:90,minBeta:-1/0,maxBeta:1/0,autoRotateAfterStill:0,autoRotateDirection:"cw",autoRotateSpeed:60,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",_mode:"rotate",_camera:null,_needsUpdate:!1,_rotating:!1,_phi:0,_theta:0,_mouseX:0,_mouseY:0,_rotateVelocity:new KZ,_panVelocity:new KZ,_distance:500,_zoomSpeed:0,_stillTimeout:0,_animators:[]}}),(function(){["_mouseDownHandler","_mouseWheelHandler","_mouseMoveHandler","_mouseUpHandler","_pinchHandler","_contextMenuHandler","_update"].forEach((function(e){this[e]=this[e].bind(this)}),this)}),{init:function(){var e=this.zr;e&&(e.on("mousedown",this._mouseDownHandler),e.on("globalout",this._mouseUpHandler),e.on("mousewheel",this._mouseWheelHandler),e.on("pinch",this._pinchHandler),e.animation.on("frame",this._update),e.dom.addEventListener("contextmenu",this._contextMenuHandler))},dispose:function(){var e=this.zr;e&&(e.off("mousedown",this._mouseDownHandler),e.off("mousemove",this._mouseMoveHandler),e.off("mouseup",this._mouseUpHandler),e.off("mousewheel",this._mouseWheelHandler),e.off("pinch",this._pinchHandler),e.off("globalout",this._mouseUpHandler),e.dom.removeEventListener("contextmenu",this._contextMenuHandler),e.animation.off("frame",this._update)),this.stopAllAnimation()},getDistance:function(){return this._distance},setDistance:function(e){this._distance=e,this._needsUpdate=!0},getOrthographicSize:function(){return this._orthoSize},setOrthographicSize:function(e){this._orthoSize=e,this._needsUpdate=!0},getAlpha:function(){return this._theta/Math.PI*180},getBeta:function(){return-this._phi/Math.PI*180},getCenter:function(){return this._center.toArray()},setAlpha:function(e){e=Math.max(Math.min(this.maxAlpha,e),this.minAlpha),this._theta=e/180*Math.PI,this._needsUpdate=!0},setBeta:function(e){e=Math.max(Math.min(this.maxBeta,e),this.minBeta),this._phi=-e/180*Math.PI,this._needsUpdate=!0},setCenter:function(e){this._center.setArray(e)},setViewGL:function(e){this.viewGL=e},getCamera:function(){return this.viewGL.camera},setFromViewControlModel:function(e,t){var n=(t=t||{}).baseDistance||0,r=t.baseOrthoSize||1,i=e.get("projection");"perspective"!==i&&"orthographic"!==i&&"isometric"!==i&&("production"!==process.env.NODE_ENV&&console.error("Unkown projection type %s, use perspective projection instead.",i),i="perspective"),this._projection=i,this.viewGL.setProjection(i);var o=e.get("distance")+n,a=e.get("orthographicSize")+r;[["damping",.8],["autoRotate",!1],["autoRotateAfterStill",3],["autoRotateDirection","cw"],["autoRotateSpeed",10],["minDistance",30],["maxDistance",400],["minOrthographicSize",30],["maxOrthographicSize",300],["minAlpha",-90],["maxAlpha",90],["minBeta",-1/0],["maxBeta",1/0],["rotateSensitivity",1],["zoomSensitivity",1],["panSensitivity",1],["panMouseButton","left"],["rotateMouseButton","middle"]].forEach((function(t){this[t[0]]=iQ(e.get(t[0]),t[1])}),this),this.minDistance+=n,this.maxDistance+=n,this.minOrthographicSize+=r,this.maxOrthographicSize+=r;var s=e.ecModel,l={};["animation","animationDurationUpdate","animationEasingUpdate"].forEach((function(t){l[t]=iQ(e.get(t),s&&s.get(t))}));var u=iQ(t.alpha,e.get("alpha"))||0,c=iQ(t.beta,e.get("beta"))||0,h=iQ(t.center,e.get("center"))||[0,0,0];l.animation&&l.animationDurationUpdate>0&&this._notFirst?this.animateTo({alpha:u,beta:c,center:h,distance:o,orthographicSize:a,easing:l.animationEasingUpdate,duration:l.animationDurationUpdate}):(this.setDistance(o),this.setAlpha(u),this.setBeta(c),this.setCenter(h),this.setOrthographicSize(a)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){"production"!==process.env.NODE_ENV&&(null==oQ[this.panMouseButton]&&console.error("Unkown panMouseButton %s. It should be left|middle|right",this.panMouseButton),null==oQ[this.rotateMouseButton]&&console.error("Unkown rotateMouseButton %s. It should be left|middle|right",this.rotateMouseButton),"cw"!==this.autoRotateDirection&&"ccw"!==this.autoRotateDirection&&console.error("Unkown autoRotateDirection %s. It should be cw|ccw",this.autoRotateDirection))},animateTo:function(e){var t=this.zr,n=this,r={},i={};return null!=e.distance&&(r.distance=this.getDistance(),i.distance=e.distance),null!=e.orthographicSize&&(r.orthographicSize=this.getOrthographicSize(),i.orthographicSize=e.orthographicSize),null!=e.alpha&&(r.alpha=this.getAlpha(),i.alpha=e.alpha),null!=e.beta&&(r.beta=this.getBeta(),i.beta=e.beta),null!=e.center&&(r.center=this.getCenter(),i.center=e.center),this._addAnimator(t.animation.animate(r).when(e.duration||1e3,i).during((function(){null!=r.alpha&&n.setAlpha(r.alpha),null!=r.beta&&n.setBeta(r.beta),null!=r.distance&&n.setDistance(r.distance),null!=r.center&&n.setCenter(r.center),null!=r.orthographicSize&&n.setOrthographicSize(r.orthographicSize),n._needsUpdate=!0}))).start(e.easing||"linear")},stopAllAnimation:function(){for(var e=0;e<this._animators.length;e++)this._animators[e].stop();this._animators.length=0},update:function(){this._needsUpdate=!0,this._update(20)},_isAnimating:function(){return this._animators.length>0},_update:function(e){if(this._rotating){var t=("cw"===this.autoRotateDirection?1:-1)*this.autoRotateSpeed/180*Math.PI;this._phi-=t*e/1e3,this._needsUpdate=!0}else this._rotateVelocity.len()>0&&(this._needsUpdate=!0);(Math.abs(this._zoomSpeed)>.1||this._panVelocity.len()>0)&&(this._needsUpdate=!0),this._needsUpdate&&(e=Math.min(e,50),this._updateDistanceOrSize(e),this._updatePan(e),this._updateRotate(e),this._updateTransform(),this.getCamera().update(),this.zr&&this.zr.refresh(),this.trigger("update"),this._needsUpdate=!1)},_updateRotate:function(e){var t=this._rotateVelocity;this._phi=t.y*e/20+this._phi,this._theta=t.x*e/20+this._theta,this.setAlpha(this.getAlpha()),this.setBeta(this.getBeta()),this._vectorDamping(t,Math.pow(this.damping,e/16))},_updateDistanceOrSize:function(e){"perspective"===this._projection?this._setDistance(this._distance+this._zoomSpeed*e/20):this._setOrthoSize(this._orthoSize+this._zoomSpeed*e/20),this._zoomSpeed*=Math.pow(this.damping,e/16)},_setDistance:function(e){this._distance=Math.max(Math.min(e,this.maxDistance),this.minDistance)},_setOrthoSize:function(e){this._orthoSize=Math.max(Math.min(e,this.maxOrthographicSize),this.minOrthographicSize);var t=this.getCamera(),n=this._orthoSize,r=n/this.viewGL.viewport.height*this.viewGL.viewport.width;t.left=-r/2,t.right=r/2,t.top=n/2,t.bottom=-n/2},_updatePan:function(e){var t=this._panVelocity,n=this._distance,r=this.getCamera(),i=r.worldTransform.y,o=r.worldTransform.x;this._center.scaleAndAdd(o,-t.x*n/200).scaleAndAdd(i,-t.y*n/200),this._vectorDamping(t,0)},_updateTransform:function(){var e=this.getCamera(),t=new Fq,n=this._theta+Math.PI/2,r=this._phi+Math.PI/2,i=Math.sin(n);t.x=i*Math.cos(r),t.y=-Math.cos(n),t.z=i*Math.sin(r),e.position.copy(this._center).scaleAndAdd(t,this._distance),e.rotation.identity().rotateY(-this._phi).rotateX(-this._theta)},_startCountingStill:function(){clearTimeout(this._stillTimeout);var e=this.autoRotateAfterStill,t=this;!isNaN(e)&&e>0&&(this._stillTimeout=setTimeout((function(){t._rotating=!0}),1e3*e))},_vectorDamping:function(e,t){var n=e.len();(n*=t)<1e-4&&(n=0),e.normalize().scale(n)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var e=this.getCamera().worldTransform.z,t=Math.asin(e.y),n=Math.atan2(e.x,e.z);this._theta=t,this._phi=-n,this.setBeta(this.getBeta()),this.setAlpha(this.getAlpha()),this.getCamera().aspect?this._setDistance(this.getCamera().position.dist(this._center)):this._setOrthoSize(this.getCamera().top-this.getCamera().bottom)}},_mouseDownHandler:function(e){if(!e.target&&!this._isAnimating()){var t=e.offsetX,n=e.offsetY;this.viewGL&&!this.viewGL.containPoint(t,n)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),e.event.targetTouches?1===e.event.targetTouches.length&&(this._mode="rotate"):e.event.button===oQ[this.rotateMouseButton]?this._mode="rotate":e.event.button===oQ[this.panMouseButton]?this._mode="pan":this._mode="",this._rotateVelocity.set(0,0),this._rotating=!1,this.autoRotate&&this._startCountingStill(),this._mouseX=e.offsetX,this._mouseY=e.offsetY)}},_mouseMoveHandler:function(e){if(!(e.target&&e.target.__isGLToZRProxy||this._isAnimating())){var t=aQ(this.panSensitivity),n=aQ(this.rotateSensitivity);"rotate"===this._mode?(this._rotateVelocity.y=(e.offsetX-this._mouseX)/this.zr.getHeight()*2*n[0],this._rotateVelocity.x=(e.offsetY-this._mouseY)/this.zr.getWidth()*2*n[1]):"pan"===this._mode&&(this._panVelocity.x=(e.offsetX-this._mouseX)/this.zr.getWidth()*t[0]*400,this._panVelocity.y=(-e.offsetY+this._mouseY)/this.zr.getHeight()*t[1]*400),this._mouseX=e.offsetX,this._mouseY=e.offsetY,e.event.preventDefault()}},_mouseWheelHandler:function(e){if(!this._isAnimating()){var t=e.event.wheelDelta||-e.event.detail;this._zoomHandler(e,t)}},_pinchHandler:function(e){this._isAnimating()||(this._zoomHandler(e,e.pinchScale>1?1:-1),this._mode="")},_zoomHandler:function(e,t){if(0!==t){var n,r=e.offsetX,i=e.offsetY;if(!this.viewGL||this.viewGL.containPoint(r,i))n="perspective"===this._projection?Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(t>0?-1:1)*n*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&"rotate"===this._mode&&this._startCountingStill(),e.event.preventDefault()}},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return"right"===this.rotateMouseButton||"right"===this.panMouseButton},_contextMenuHandler:function(e){this._isRightMouseButtonUsed()&&e.preventDefault()},_addAnimator:function(e){var t=this._animators;return t.push(e),e.done((function(){var n=t.indexOf(e);n>=0&&t.splice(n,1)})),e}});Object.defineProperty(sQ.prototype,"autoRotate",{get:function(e){return this._autoRotate},set:function(e){this._autoRotate=e,this._rotating=e}});var lQ={convertToDynamicArray:function(e){e&&this.resetOffset();var t=this.attributes;for(var n in t)e||!t[n].value?t[n].value=[]:t[n].value=Array.prototype.slice.call(t[n].value);e||!this.indices?this.indices=[]:this.indices=Array.prototype.slice.call(this.indices)},convertToTypedArray:function(){var e=this.attributes;for(var t in e)e[t].value&&e[t].value.length>0?e[t].value=new Float32Array(e[t].value):e[t].value=null;this.indices&&this.indices.length>0&&(this.indices=this.vertexCount>65535?new Uint32Array(this.indices):new Uint16Array(this.indices)),this.dirty()}},uQ={vec2:qZ,vec3:Dq,vec4:Qq,mat2:IJ,mat2d:LJ,mat3:eK,mat4:Cq,quat:oK},cQ=uQ.vec3,hQ=[[0,0],[1,1]],dQ=XK.extend((function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new XK.Attribute("position","float",3,"POSITION"),positionPrev:new XK.Attribute("positionPrev","float",3),positionNext:new XK.Attribute("positionNext","float",3),prevPositionPrev:new XK.Attribute("prevPositionPrev","float",3),prevPosition:new XK.Attribute("prevPosition","float",3),prevPositionNext:new XK.Attribute("prevPositionNext","float",3),offset:new XK.Attribute("offset","float",1),color:new XK.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(e){var t=this.attributes;this.vertexCount!==e&&(t.position.init(e),t.color.init(e),this.useNativeLine||(t.positionPrev.init(e),t.positionNext.init(e),t.offset.init(e)),e>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(e){this.triangleCount!==e&&(this.indices=0===e?null:this.vertexCount>65535?new Uint32Array(3*e):new Uint16Array(3*e))},_getCubicCurveApproxStep:function(e,t,n,r){return 1/(cQ.dist(e,t)+cQ.dist(n,t)+cQ.dist(r,n)+1)*this.segmentScale},getCubicCurveVertexCount:function(e,t,n,r){var i=this._getCubicCurveApproxStep(e,t,n,r),o=Math.ceil(1/i);return this.useNativeLine?2*o:2*o+2},getCubicCurveTriangleCount:function(e,t,n,r){var i=this._getCubicCurveApproxStep(e,t,n,r),o=Math.ceil(1/i);return this.useNativeLine?0:2*o},getLineVertexCount:function(){return this.getPolylineVertexCount(hQ)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(hQ)},getPolylineVertexCount:function(e){var t;"number"==typeof e?t=e:t="number"!=typeof e[0]?e.length:e.length/3;return this.useNativeLine?2*(t-1):2*(t-1)+2},getPolylineTriangleCount:function(e){var t;"number"==typeof e?t=e:t="number"!=typeof e[0]?e.length:e.length/3;return this.useNativeLine?0:2*Math.max(t-1,0)},addCubicCurve:function(e,t,n,r,i,o){null==o&&(o=1);var a=e[0],s=e[1],l=e[2],u=t[0],c=t[1],h=t[2],d=n[0],p=n[1],f=n[2],g=r[0],m=r[1],v=r[2],y=this._getCubicCurveApproxStep(e,t,n,r),_=y*y,x=_*y,b=3*y,w=3*_,S=6*_,T=6*x,M=a-2*u+d,C=s-2*c+p,D=l-2*h+f,A=3*(u-d)-a+g,I=3*(c-p)-s+m,E=3*(h-f)-l+v,L=a,N=s,P=l,O=(u-a)*b+M*w+A*x,R=(c-s)*b+C*w+I*x,k=(h-l)*b+D*w+E*x,z=M*S+A*T,V=C*S+I*T,B=D*S+E*T,F=A*T,G=I*T,H=E*T,U=0,W=0,j=Math.ceil(1/y),X=new Float32Array(3*(j+1)),Y=(X=[],0);for(W=0;W<j+1;W++)X[Y++]=L,X[Y++]=N,X[Y++]=P,L+=O,N+=R,P+=k,O+=z,R+=V,k+=B,z+=F,V+=G,B+=H,(U+=y)>1&&(L=O>0?Math.min(L,g):Math.max(L,g),N=R>0?Math.min(N,m):Math.max(N,m),P=k>0?Math.min(P,v):Math.max(P,v));return this.addPolyline(X,i,o)},addLine:function(e,t,n,r){return this.addPolyline([e,t],n,r)},addPolyline:function(e,t,n,r,i){if(e.length){var o="number"!=typeof e[0];if(null==i&&(i=o?e.length:e.length/3),!(i<2)){null==r&&(r=0),null==n&&(n=1),this._itemVertexOffsets.push(this._vertexOffset);var a,s,l=(o="number"!=typeof e[0])?"number"!=typeof t[0]:t.length/4===i,u=this.attributes.position,c=this.attributes.positionPrev,h=this.attributes.positionNext,d=this.attributes.color,p=this.attributes.offset,f=this.indices,g=this._vertexOffset;n=Math.max(n,.01);for(var m=r;m<i;m++){if(o)a=e[m],s=l?t[m]:t;else{var v=3*m;if((a=a||[])[0]=e[v],a[1]=e[v+1],a[2]=e[v+2],l){var y=4*m;(s=s||[])[0]=t[y],s[1]=t[y+1],s[2]=t[y+2],s[3]=t[y+3]}else s=t}if(this.useNativeLine?m>1&&(u.copy(g,g-1),d.copy(g,g-1),g++):(m<i-1&&(c.set(g+2,a),c.set(g+3,a)),m>0&&(h.set(g-2,a),h.set(g-1,a)),u.set(g,a),u.set(g+1,a),d.set(g,s),d.set(g+1,s),p.set(g,n/2),p.set(g+1,-n/2),g+=2),this.useNativeLine)d.set(g,s),u.set(g,a),g++;else if(m>0){var _=3*this._triangleOffset;(f=this.indices)[_]=g-4,f[_+1]=g-3,f[_+2]=g-2,f[_+3]=g-3,f[_+4]=g-1,f[_+5]=g-2,this._triangleOffset+=2}}if(!this.useNativeLine){var x=this._vertexOffset,b=this._vertexOffset+2*i;c.copy(x,x+2),c.copy(x+1,x+3),h.copy(b-1,b-3),h.copy(b-2,b-4)}return this._vertexOffset=g,this._vertexOffset}}},setItemColor:function(e,t){for(var n=this._itemVertexOffsets[e],r=e<this._itemVertexOffsets.length-1?this._itemVertexOffsets[e+1]:this._vertexOffset,i=n;i<r;i++)this.attributes.color.set(i,t);this.dirty("color")},currentTriangleOffset:function(){return this._triangleOffset},currentVertexOffset:function(){return this._vertexOffset}});function pQ(e,t,n,r,i,o,a){this._zr=e,this._x=0,this._y=0,this._rowHeight=0,this.width=r,this.height=i,this.offsetX=t,this.offsetY=n,this.dpr=a,this.gap=o}function fQ(e){(e=e||{}).width=e.width||512,e.height=e.height||512,e.devicePixelRatio=e.devicePixelRatio||1,e.gap=null==e.gap?2:e.gap;var t=document.createElement("canvas");t.width=e.width*e.devicePixelRatio,t.height=e.height*e.devicePixelRatio,this._canvas=t,this._texture=new RK({image:t,flipY:!1});var n=this;this._zr=Ji(t);var r=this._zr.refreshImmediately;this._zr.refreshImmediately=function(){r.call(this),n._texture.dirty(),n.onupdate&&n.onupdate()},this._dpr=e.devicePixelRatio,this._coords={},this.onupdate=e.onupdate,this._gap=e.gap,this._textureAtlasNodes=[new pQ(this._zr,0,0,e.width,e.height,this._gap,this._dpr)],this._nodeWidth=e.width,this._nodeHeight=e.height,this._currentNodeIdx=0}function gQ(){}V(dQ.prototype,lQ),pQ.prototype={constructor:pQ,clear:function(){this._x=0,this._y=0,this._rowHeight=0},add:function(e,t,n){var r=e.getBoundingRect();null==t&&(t=r.width),null==n&&(n=r.height),t*=this.dpr,n*=this.dpr,this._fitElement(e,t,n);var i=this._x,o=this._y,a=this.width*this.dpr,s=this.height*this.dpr,l=this.gap;if(i+t+l>a&&(i=this._x=0,o+=this._rowHeight+l,this._y=o,this._rowHeight=0),this._x+=t+l,this._rowHeight=Math.max(this._rowHeight,n),o+n+l>s)return null;e.x+=this.offsetX*this.dpr+i,e.y+=this.offsetY*this.dpr+o,this._zr.add(e);var u=[this.offsetX/this.width,this.offsetY/this.height];return[[i/a+u[0],o/s+u[1]],[(i+t)/a+u[0],(o+n)/s+u[1]]]},_fitElement:function(e,t,n){var r=e.getBoundingRect(),i=t/r.width,o=n/r.height;e.x=-r.x*i,e.y=-r.y*o,e.scaleX=i,e.scaleY=o,e.update()}},fQ.prototype={clear:function(){for(var e=0;e<this._textureAtlasNodes.length;e++)this._textureAtlasNodes[e].clear();this._currentNodeIdx=0,this._zr.clear(),this._coords={}},getWidth:function(){return this._width},getHeight:function(){return this._height},getTexture:function(){return this._texture},getDevicePixelRatio:function(){return this._dpr},getZr:function(){return this._zr},_getCurrentNode:function(){return this._textureAtlasNodes[this._currentNodeIdx]},_expand:function(){if(this._currentNodeIdx++,this._textureAtlasNodes[this._currentNodeIdx])return this._textureAtlasNodes[this._currentNodeIdx];var e=4096/this._dpr,t=this._textureAtlasNodes.length,n=t*this._nodeWidth%e,r=Math.floor(t*this._nodeWidth/e)*this._nodeHeight;if(!(r>=e)){var i=(n+this._nodeWidth)*this._dpr,o=(r+this._nodeHeight)*this._dpr;try{this._zr.resize({width:i,height:o})}catch(e){this._canvas.width=i,this._canvas.height=o}var a=new pQ(this._zr,n,r,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(a),a}"production"!==process.env.NODE_ENV&&console.error("Too much labels. Some will be ignored.")},add:function(e,t,n){if(this._coords[e.id])return"production"!==process.env.NODE_ENV&&console.warn("Element already been add"),this._coords[e.id];var r=this._getCurrentNode().add(e,t,n);if(!r){var i=this._expand();if(!i)return;r=i.add(e,t,n)}return this._coords[e.id]=r,r},getCoordsScale:function(){var e=this._dpr;return[this._nodeWidth/this._canvas.width*e,this._nodeHeight/this._canvas.height*e]},getCoords:function(e){return this._coords[e]},dispose:function(){this._zr.dispose()}},gQ.prototype={constructor:gQ,setScene:function(e){this._scene=e,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(e){this._lightRoot=e,this.mainLight=new BJ.DirectionalLight({shadowBias:.005}),this.ambientLight=new BJ.AmbientLight,e.add(this.mainLight),e.add(this.ambientLight)},dispose:function(){this._lightRoot&&(this._lightRoot.remove(this.mainLight),this._lightRoot.remove(this.ambientLight))},updateLight:function(e){var t=this.mainLight,n=this.ambientLight,r=e.getModel("light"),i=r.getModel("main"),o=r.getModel("ambient");t.intensity=i.get("intensity"),n.intensity=o.get("intensity"),t.color=BJ.parseColor(i.get("color")).slice(0,3),n.color=BJ.parseColor(o.get("color")).slice(0,3);var a=i.get("alpha")||0,s=i.get("beta")||0;t.position.setArray(BJ.directionFromAlphaBeta(a,s)),t.lookAt(BJ.Vector3.ZERO),t.castShadow=i.get("shadow"),t.shadowResolution=BJ.getShadowResolution(i.get("shadowQuality"))},updateAmbientCubemap:function(e,t,n){var r=t.getModel("light.ambientCubemap"),i=r.get("texture");if(i){this._cubemapLightsCache=this._cubemapLightsCache||{};var o=this._cubemapLightsCache[i];if(!o){var a=this;o=this._cubemapLightsCache[i]=BJ.createAmbientCubemap(r.option,e,n,(function(){a._isSkyboxFromAmbientCubemap&&a._skybox.setEnvironmentMap(o.specular.cubemap),n.getZr().refresh()}))}this._lightRoot.add(o.diffuse),this._lightRoot.add(o.specular),this._currentCubemapLights=o}else this._currentCubemapLights&&(this._lightRoot.remove(this._currentCubemapLights.diffuse),this._lightRoot.remove(this._currentCubemapLights.specular),this._currentCubemapLights=null)},updateSkybox:function(e,t,n){var r=t.get("environment"),i=this;var o=(i._skybox=i._skybox||new j$,i._skybox);if(r&&"none"!==r)if("auto"===r)if(this._isSkyboxFromAmbientCubemap=!0,this._currentCubemapLights){var a=this._currentCubemapLights.specular.cubemap;o.setEnvironmentMap(a),this._scene&&o.attachScene(this._scene),o.material.set("lod",3)}else this._skybox&&this._skybox.detachScene();else if("object"==typeof r&&r.colorStops||"string"==typeof r&&rr(r)){this._isSkyboxFromAmbientCubemap=!1;var s=new BJ.Texture2D({anisotropic:8,flipY:!1});o.setEnvironmentMap(s);var l=s.image=document.createElement("canvas");l.width=l.height=16,Ov(l.getContext("2d"),new ol({shape:{x:0,y:0,width:16,height:16},style:{fill:r}})),o.attachScene(this._scene)}else{this._isSkyboxFromAmbientCubemap=!1;s=BJ.loadTexture(r,n,{anisotropic:8,flipY:!1});o.setEnvironmentMap(s),o.attachScene(this._scene)}else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var u=t.coordinateSystem;if(this._skybox)if(!u||!u.viewGL||"auto"===r||r.match&&r.match(/.hdr$/))this._skybox.material.undefine("fragment","SRGB_DECODE");else{var c=u.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[c]("fragment","SRGB_DECODE")}}};var mQ=uQ.vec3,vQ=XK.extend((function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new XK.Attribute("position","float",3,"POSITION"),normal:new XK.Attribute("normal","float",3,"NORMAL"),color:new XK.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(e){var t=this.attributes,n=this.getQuadVertexCount()*e,r=this.getQuadTriangleCount()*e;this.vertexCount!==n&&(t.position.init(n),t.normal.init(n),t.color.init(n)),this.triangleCount!==r&&(this.indices=n>65535?new Uint32Array(3*r):new Uint16Array(3*r))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:function(){var e=mQ.create(),t=mQ.create(),n=mQ.create(),r=[0,3,1,3,2,1];return function(i,o){var a=this.attributes.position,s=this.attributes.normal,l=this.attributes.color;mQ.sub(e,i[1],i[0]),mQ.sub(t,i[2],i[1]),mQ.cross(n,e,t),mQ.normalize(n,n);for(var u=0;u<4;u++)a.set(this._vertexOffset+u,i[u]),l.set(this._vertexOffset+u,o),s.set(this._vertexOffset+u,n);var c=3*this._faceOffset;for(u=0;u<6;u++)this.indices[c+u]=r[u]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2}}()});V(vQ.prototype,lQ);var yQ=_J,_Q={x:0,y:2,z:1};function xQ(e,t,n){this.rootNode=new BJ.Node;var r=new BJ.Mesh({geometry:new dQ({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:1}),i=new BJ.Mesh({geometry:new vQ,material:n,castShadow:!1,culling:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:0});this.rootNode.add(i),this.rootNode.add(r),this.faceInfo=e,this.plane=new BJ.Plane,this.linesMesh=r,this.quadsMesh=i}xQ.prototype.update=function(e,t,n){var r=e.coordinateSystem,i=[r.getAxis(this.faceInfo[0]),r.getAxis(this.faceInfo[1])],o=this.linesMesh.geometry,a=this.quadsMesh.geometry;o.convertToDynamicArray(!0),a.convertToDynamicArray(!0),this._updateSplitLines(o,i,e,n),this._udpateSplitAreas(a,i,e,n),o.convertToTypedArray(),a.convertToTypedArray();var s=r.getAxis(this.faceInfo[2]);!function(e,t,n,r){var i=[0,0,0],o=r<0?n.getExtentMin():n.getExtentMax();i[_Q[n.dim]]=o,e.position.setArray(i),e.rotation.identity(),t.distance=-Math.abs(o),t.normal.set(0,0,0),"x"===n.dim?(e.rotation.rotateY(r*Math.PI/2),t.normal.x=-r):"z"===n.dim?(e.rotation.rotateX(-r*Math.PI/2),t.normal.y=-r):(r>0&&e.rotation.rotateY(Math.PI),t.normal.z=-r)}(this.rootNode,this.plane,s,this.faceInfo[3])},xQ.prototype._updateSplitLines=function(e,t,n,r){var i=r.getDevicePixelRatio();t.forEach((function(r,o){var a=r.model,s=t[1-o].getExtent();if(!r.scale.isBlank()){var l=a.getModel("splitLine",n.getModel("splitLine"));if(l.get("show")){var u=l.getModel("lineStyle"),c=u.get("color"),h=yQ(u.get("opacity"),1),d=yQ(u.get("width"),1);c=J(c)?c:[c];for(var p=r.getTicksCoords({tickModel:l}),f=0,g=0;g<p.length;g++){var m=p[g].coord,v=BJ.parseColor(c[f%c.length]);v[3]*=h;var y=[0,0,0],_=[0,0,0];y[o]=_[o]=m,y[1-o]=s[0],_[1-o]=s[1],e.addLine(y,_,v,d*i),f++}}}}))},xQ.prototype._udpateSplitAreas=function(e,t,n,r){t.forEach((function(r,i){var o=r.model,a=t[1-i].getExtent();if(!r.scale.isBlank()){var s=o.getModel("splitArea",n.getModel("splitArea"));if(s.get("show")){var l=s.getModel("areaStyle"),u=l.get("color"),c=yQ(l.get("opacity"),1);u=J(u)?u:[u];for(var h=r.getTicksCoords({tickModel:s,clamp:!0}),d=0,p=[0,0,0],f=[0,0,0],g=0;g<h.length;g++){var m=h[g].coord,v=[0,0,0],y=[0,0,0];if(v[i]=y[i]=m,v[1-i]=a[0],y[1-i]=a[1],0!==g){var _=BJ.parseColor(u[d%u.length]);_[3]*=c,e.addQuad([p,v,y,f],_),p=v,f=y,d++}else p=v,f=y}}}}))};var bQ=[0,1,2,0,2,3],wQ=XK.extend((function(){return{attributes:{position:new XK.Attribute("position","float",3,"POSITION"),texcoord:new XK.Attribute("texcoord","float",2,"TEXCOORD_0"),offset:new XK.Attribute("offset","float",2),color:new XK.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setSpriteCount:function(e){this._spriteCount=e;var t=4*e,n=2*e;this.vertexCount!==t&&(this.attributes.position.init(t),this.attributes.offset.init(t),this.attributes.color.init(t)),this.triangleCount!==n&&(this.indices=t>65535?new Uint32Array(3*n):new Uint16Array(3*n))},setSpriteAlign:function(e,t,n,r,i){var o,a,s,l;switch(null==n&&(n="left"),null==r&&(r="top"),i=i||0,n){case"left":o=i,s=t[0]+i;break;case"center":case"middle":o=-t[0]/2,s=t[0]/2;break;case"right":o=-t[0]-i,s=-i}switch(r){case"bottom":a=i,l=t[1]+i;break;case"middle":a=-t[1]/2,l=t[1]/2;break;case"top":a=-t[1]-i,l=-i}var u=4*e,c=this.attributes.offset;c.set(u,[o,l]),c.set(u+1,[s,l]),c.set(u+2,[s,a]),c.set(u+3,[o,a])},addSprite:function(e,t,n,r,i,o){var a=this._vertexOffset;this.setSprite(this._vertexOffset/4,e,t,n,r,i,o);for(var s=0;s<bQ.length;s++)this.indices[3*this._faceOffset+s]=bQ[s]+a;return this._faceOffset+=2,this._vertexOffset+=4,a/4},setSprite:function(e,t,n,r,i,o,a){for(var s=4*e,l=this.attributes,u=0;u<4;u++)l.position.set(s+u,t);var c=l.texcoord;c.set(s,[r[0][0],r[0][1]]),c.set(s+1,[r[1][0],r[0][1]]),c.set(s+2,[r[1][0],r[1][1]]),c.set(s+3,[r[0][0],r[1][1]]),this.setSpriteAlign(e,n,i,o,a)}});V(wQ.prototype,lQ);BJ.Shader.import("@export ecgl.labels.vertex\n\nattribute vec3 position: POSITION;\nattribute vec2 texcoord: TEXCOORD_0;\nattribute vec2 offset;\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n vec4 proj = worldViewProjection * vec4(position, 1.0);\n\n vec2 screen = (proj.xy / abs(proj.w) + 1.0) * 0.5 * viewport.zw;\n\n screen += offset;\n\n proj.xy = (screen / viewport.zw - 0.5) * 2.0 * abs(proj.w);\n gl_Position = proj;\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n v_Texcoord = texcoord;\n}\n@end\n\n\n@export ecgl.labels.fragment\n\nuniform vec3 color : [1.0, 1.0, 1.0];\nuniform float alpha : 1.0;\nuniform sampler2D textureAtlas;\nuniform vec2 uvScale: [1.0, 1.0];\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\nvarying float v_Miter;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n gl_FragColor = vec4(color, alpha) * texture2D(textureAtlas, v_Texcoord * uvScale);\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n}\n\n@end");var SQ=BJ.Mesh.extend((function(){return{geometry:new wQ({dynamic:!0}),material:new BJ.Material({shader:BJ.createShader("ecgl.labels"),transparent:!0,depthMask:!1}),culling:!1,castShadow:!1,ignorePicking:!0}})),TQ=_J,MQ={x:0,y:2,z:1};function CQ(e,t){var n=new BJ.Mesh({geometry:new dQ({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,renderOrder:2}),r=new SQ;r.material.depthMask=!1;var i=new BJ.Node;i.add(n),i.add(r),this.rootNode=i,this.dim=e,this.linesMesh=n,this.labelsMesh=r,this.axisLineCoords=null,this.labelElements=[]}var DQ={x:"y",y:"x",z:"y"};CQ.prototype.update=function(e,t,n){var r=e.coordinateSystem.getAxis(this.dim),i=this.linesMesh.geometry,o=this.labelsMesh.geometry;i.convertToDynamicArray(!0),o.convertToDynamicArray(!0);var a=r.model,s=r.getExtent(),l=n.getDevicePixelRatio(),u=a.getModel("axisLine",e.getModel("axisLine")),c=a.getModel("axisTick",e.getModel("axisTick")),h=a.getModel("axisLabel",e.getModel("axisLabel")),d=u.get("lineStyle.color");if(u.get("show")){var p=u.getModel("lineStyle"),f=[0,0,0];(T=[0,0,0])[M=MQ[r.dim]]=s[0],f[M]=s[1],this.axisLineCoords=[T,f];var g=BJ.parseColor(d),m=TQ(p.get("width"),1),v=TQ(p.get("opacity"),1);g[3]*=v,i.addLine(T,f,g,m*l)}if(c.get("show")){var y=c.getModel("lineStyle"),_=BJ.parseColor(TQ(y.get("color"),d));m=TQ(y.get("width"),1);_[3]*=TQ(y.get("opacity"),1);for(var x=r.getTicksCoords(),b=c.get("length"),w=0;w<x.length;w++){var S=x[w].coord,T=[0,0,0],M=(f=[0,0,0],MQ[r.dim]),C=MQ[DQ[r.dim]];T[M]=f[M]=S,f[C]=b,i.addLine(T,f,_,m*l)}}this.labelElements=[];l=n.getDevicePixelRatio();if(h.get("show")){x=r.getTicksCoords();var D=a.get("data"),A=h.get("margin"),I=r.getViewLabels();for(w=0;w<I.length;w++){var E=I[w].tickValue,L=I[w].formattedLabel,N=I[w].rawLabel,P=(S=r.dataToCoord(E),[0,0,0]);M=MQ[r.dim],C=MQ[DQ[r.dim]];P[M]=P[M]=S,P[C]=A;var O=h;D&&D[E]&&D[E].textStyle&&(O=new Wh(D[E].textStyle,h,a.ecModel));var R=TQ(O.get("color"),d),k=new ll({style:wh(O,{text:L,fill:"function"==typeof R?R("category"===r.type?N:"value"===r.type?E+"":E,w):R,verticalAlign:"top",align:"left"})}),z=t.add(k),V=k.getBoundingRect();o.addSprite(P,[V.width*l,V.height*l],z),this.labelElements.push(k)}}if(a.get("name")){var B=a.getModel("nameTextStyle"),F=(P=[0,0,0],M=MQ[r.dim],C=MQ[DQ[r.dim]],TQ(B.get("color"),d)),G=B.get("borderColor");m=B.get("borderWidth");P[M]=P[M]=(s[0]+s[1])/2,P[C]=a.get("nameGap");k=new ll({style:wh(B,{text:a.get("name"),fill:F,stroke:G,lineWidth:m})}),z=t.add(k),V=k.getBoundingRect();o.addSprite(P,[V.width*l,V.height*l],z),k.__idx=this.labelElements.length,this.nameLabelElement=k}this.labelsMesh.material.set("textureAtlas",t.getTexture()),this.labelsMesh.material.set("uvScale",t.getCoordsScale()),i.convertToTypedArray(),o.convertToTypedArray()},CQ.prototype.setSpriteAlign=function(e,t,n){for(var r=n.getDevicePixelRatio(),i=this.labelsMesh.geometry,o=0;o<this.labelElements.length;o++){var a=this.labelElements[o].getBoundingRect();i.setSpriteAlign(o,[a.width*r,a.height*r],e,t)}var s=this.nameLabelElement;if(s){a=s.getBoundingRect();i.setSpriteAlign(s.__idx,[a.width*r,a.height*r],e,t),i.dirty()}this.textAlign=e,this.textVerticalAlign=t};var AQ="@export ecgl.lines3D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, 1.0);\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n}\n@end\n\n\n\n@export ecgl.lines3D.clipNear\n\nvec4 clipNear(vec4 p1, vec4 p2) {\n float n = (p1.w - near) / (p1.w - p2.w);\n return vec4(mix(p1.xy, p2.xy, n), -near, near);\n}\n\n@end\n\n@export ecgl.lines3D.expandLine\n#ifdef VERTEX_ANIMATION\n vec4 prevProj = worldViewProjection * vec4(mix(prevPositionPrev, positionPrev, percent), 1.0);\n vec4 currProj = worldViewProjection * vec4(mix(prevPosition, position, percent), 1.0);\n vec4 nextProj = worldViewProjection * vec4(mix(prevPositionNext, positionNext, percent), 1.0);\n#else\n vec4 prevProj = worldViewProjection * vec4(positionPrev, 1.0);\n vec4 currProj = worldViewProjection * vec4(position, 1.0);\n vec4 nextProj = worldViewProjection * vec4(positionNext, 1.0);\n#endif\n\n if (currProj.w < 0.0) {\n if (nextProj.w > 0.0) {\n currProj = clipNear(currProj, nextProj);\n }\n else if (prevProj.w > 0.0) {\n currProj = clipNear(currProj, prevProj);\n }\n }\n\n vec2 prevScreen = (prevProj.xy / abs(prevProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 currScreen = (currProj.xy / abs(currProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 nextScreen = (nextProj.xy / abs(nextProj.w) + 1.0) * 0.5 * viewport.zw;\n\n vec2 dir;\n float len = offset;\n if (position == positionPrev) {\n dir = normalize(nextScreen - currScreen);\n }\n else if (position == positionNext) {\n dir = normalize(currScreen - prevScreen);\n }\n else {\n vec2 dirA = normalize(currScreen - prevScreen);\n vec2 dirB = normalize(nextScreen - currScreen);\n\n vec2 tanget = normalize(dirA + dirB);\n\n float miter = 1.0 / max(dot(tanget, dirA), 0.5);\n len *= miter;\n dir = tanget;\n }\n\n dir = vec2(-dir.y, dir.x) * len;\n currScreen += dir;\n\n currProj.xy = (currScreen / viewport.zw - 0.5) * 2.0 * abs(currProj.w);\n@end\n\n\n@export ecgl.meshLines3D.vertex\n\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevPositionPrev;\nattribute vec3 prevPositionNext;\nuniform float percent : 1.0;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n}\n@end\n\n\n@export ecgl.meshLines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end",IQ=_J;BJ.Shader.import(AQ);var EQ={x:0,y:2,z:1},LQ=Kg.extend({type:"grid3D",__ecgl__:!0,init:function(e,t){var n=new BJ.Material({shader:BJ.createShader("ecgl.color"),depthMask:!1,transparent:!0}),r=new BJ.Material({shader:BJ.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});n.define("fragment","DOUBLE_SIDED"),n.define("both","VERTEX_COLOR"),this.groupGL=new BJ.Node,this._control=new sQ({zr:t.getZr()}),this._control.init(),this._faces=[["y","z","x",-1,"left"],["y","z","x",1,"right"],["x","y","z",-1,"bottom"],["x","y","z",1,"top"],["x","z","y",-1,"far"],["x","z","y",1,"near"]].map((function(e){var t=new xQ(e,r,n);return this.groupGL.add(t.rootNode),t}),this),this._axes=["x","y","z"].map((function(e){var t=new CQ(e,r);return this.groupGL.add(t.rootNode),t}),this);var i=t.getDevicePixelRatio();this._axisLabelSurface=new fQ({width:256,height:256,devicePixelRatio:i}),this._axisLabelSurface.onupdate=function(){t.getZr().refresh()},this._axisPointerLineMesh=new BJ.Mesh({geometry:new dQ({useNativeLine:!1}),material:r,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new fQ({width:128,height:128,devicePixelRatio:i}),this._axisPointerLabelsMesh=new SQ({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new BJ.Node,this._sceneHelper=new gQ,this._sceneHelper.initLight(this._lightRoot)},render:function(e,t,n){this._model=e,this._api=n;var r=e.coordinateSystem;r.viewGL.add(this._lightRoot),e.get("show")?r.viewGL.add(this.groupGL):r.viewGL.remove(this.groupGL);var i=this._control;i.setViewGL(r.viewGL);var o=e.getModel("viewControl");i.setFromViewControlModel(o,0),this._axisLabelSurface.clear(),i.off("update"),e.get("show")&&(this._faces.forEach((function(r){r.update(e,t,n)}),this),this._axes.forEach((function(t){t.update(e,this._axisLabelSurface,n)}),this)),i.on("update",this._onCameraChange.bind(this,e,n),this),this._sceneHelper.setScene(r.viewGL.scene),this._sceneHelper.updateLight(e),r.viewGL.setPostEffect(e.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._initMouseHandler(e)},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n)},showAxisPointer:function(e,t,n,r){this._doShowAxisPointer(),this._updateAxisPointer(r.value)},hideAxisPointer:function(e,t,n,r){this._doHideAxisPointer()},_initMouseHandler:function(e){var t=e.coordinateSystem.viewGL;e.get("show")&&e.get("axisPointer.show")?t.on("mousemove",this._updateAxisPointerOnMousePosition,this):t.off("mousemove",this._updateAxisPointerOnMousePosition)},_updateAxisPointerOnMousePosition:function(e){if(!e.target){for(var t,n=this._model.coordinateSystem,r=n.viewGL,i=r.castRay(e.offsetX,e.offsetY,new BJ.Ray),o=0;o<this._faces.length;o++){var a=this._faces[o];if(!a.rootNode.invisible){a.plane.normal.dot(r.camera.worldTransform.z)<0&&a.plane.normal.negate();var s=i.intersectPlane(a.plane);if(s){var l=n.getAxis(a.faceInfo[0]),u=n.getAxis(a.faceInfo[1]),c=EQ[a.faceInfo[0]],h=EQ[a.faceInfo[1]];l.contain(s.array[c])&&u.contain(s.array[h])&&(t=s)}}}if(t){var d=n.pointToData(t.array,[],!0);this._updateAxisPointer(d),this._doShowAxisPointer()}else this._doHideAxisPointer()}},_onCameraChange:function(e,t){e.get("show")&&(this._updateFaceVisibility(),this._updateAxisLinePosition());var n=this._control;t.dispatchAction({type:"grid3DChangeCamera",alpha:n.getAlpha(),beta:n.getBeta(),distance:n.getDistance(),center:n.getCenter(),from:this.uid,grid3DId:e.id})},_updateFaceVisibility:function(){var e=this._control.getCamera(),t=new BJ.Vector3;e.update();for(var n=0;n<this._faces.length/2;n++){for(var r=[],i=0;i<2;i++){this._faces[2*n+i].rootNode.getWorldPosition(t),t.transformMat4(e.viewMatrix),r[i]=t.z}var o=r[0]>r[1]?0:1,a=this._faces[2*n+o],s=this._faces[2*n+1-o];a.rootNode.invisible=!0,s.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var e=this._model.coordinateSystem,t=e.getAxis("x"),n=e.getAxis("y"),r=e.getAxis("z"),i=r.getExtentMax(),o=r.getExtentMin(),a=t.getExtentMin(),s=t.getExtentMax(),l=n.getExtentMax(),u=n.getExtentMin(),c=this._axes[0].rootNode,h=this._axes[1].rootNode,d=this._axes[2].rootNode,p=this._faces,f=p[4].rootNode.invisible?u:l,g=p[2].rootNode.invisible?i:o,m=p[0].rootNode.invisible?a:s,v=p[2].rootNode.invisible?i:o,y=p[0].rootNode.invisible?s:a,_=p[4].rootNode.invisible?u:l;c.rotation.identity(),h.rotation.identity(),d.rotation.identity(),p[4].rootNode.invisible&&(this._axes[0].flipped=!0,c.rotation.rotateX(Math.PI)),p[0].rootNode.invisible&&(this._axes[1].flipped=!0,h.rotation.rotateZ(Math.PI)),p[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),c.position.set(0,g,f),h.position.set(m,v,0),d.position.set(y,0,_),c.update(),h.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var e=this._control.getCamera(),t=[new BJ.Vector4,new BJ.Vector4],n=new BJ.Vector4;this.groupGL.getWorldPosition(n),n.w=1,n.transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),n.x/=n.w,n.y/=n.w,this._axes.forEach((function(r){var i=r.axisLineCoords;r.labelsMesh.geometry;for(var o=0;o<t.length;o++)t[o].setArray(i[o]),t[o].w=1,t[o].transformMat4(r.rootNode.worldTransform).transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),t[o].x/=t[o].w,t[o].y/=t[o].w;var a,s,l=t[1].x-t[0].x,u=t[1].y-t[0].y,c=(t[1].x+t[0].x)/2,h=(t[1].y+t[0].y)/2;Math.abs(u/l)<.5?(a="center",s=h>n.y?"bottom":"top"):(s="middle",a=c>n.x?"left":"right"),r.setSpriteAlign(a,s,this._api)}),this)},_doShowAxisPointer:function(){this._axisPointerLineMesh.invisible&&(this._axisPointerLineMesh.invisible=!1,this._axisPointerLabelsMesh.invisible=!1,this._api.getZr().refresh())},_doHideAxisPointer:function(){this._axisPointerLineMesh.invisible||(this._axisPointerLineMesh.invisible=!0,this._axisPointerLabelsMesh.invisible=!0,this._api.getZr().refresh())},_updateAxisPointer:function(e){var t=this._model.coordinateSystem,n=t.dataToPoint(e),r=this._axisPointerLineMesh.geometry,i=this._model.getModel("axisPointer"),o=this._api.getDevicePixelRatio();function a(e){return _J(e.model.get("axisPointer.show"),i.get("show"))}function s(e){var t=e.model.getModel("axisPointer",i).getModel("lineStyle"),n=BJ.parseColor(t.get("color")),r=IQ(t.get("width"),1),o=IQ(t.get("opacity"),1);return n[3]*=o,{color:n,lineWidth:r}}r.convertToDynamicArray(!0);for(var l=0;l<this._faces.length;l++){var u=this._faces[l];if(!u.rootNode.invisible){for(var c=u.faceInfo,h=c[3]<0?t.getAxis(c[2]).getExtentMin():t.getAxis(c[2]).getExtentMax(),d=EQ[c[2]],p=0;p<2;p++){var f=c[p],g=c[1-p],m=t.getAxis(f),v=t.getAxis(g);if(a(m)){var y=EQ[f],_=EQ[g];(w=[0,0,0])[y]=(b=[0,0,0])[y]=n[y],w[d]=b[d]=h,w[_]=v.getExtentMin(),b[_]=v.getExtentMax();var x=s(m);r.addLine(w,b,x.color,x.lineWidth*o)}}if(a(t.getAxis(c[2]))){var b,w=n.slice();(b=n.slice())[d]=h;x=s(t.getAxis(c[2]));r.addLine(w,b,x.color,x.lineWidth*o)}}}r.convertToTypedArray(),this._updateAxisPointerLabelsMesh(e),this._api.getZr().refresh()},_updateAxisPointerLabelsMesh:function(e){var t=this._model,n=this._axisPointerLabelsMesh,r=this._axisPointerLabelsSurface,i=t.coordinateSystem,o=t.getModel("axisPointer");n.geometry.convertToDynamicArray(!0),r.clear();var a={x:"y",y:"x",z:"y"};this._axes.forEach((function(t,s){var l=i.getAxis(t.dim),u=l.model.getModel("axisPointer",o),c=u.getModel("label"),h=u.get("lineStyle.color");if(c.get("show")&&u.get("show")){var d=e[s],p=c.get("formatter"),f=l.scale.getLabel({value:d});if(null!=p)f=p(f,e);else if("interval"===l.scale.type||"log"===l.scale.type){var g=uo(l.scale.getTicks()[0]);f=d.toFixed(g+2)}var m=c.get("color"),v=new ll({style:wh(c,{text:f,fill:m||h,align:"left",verticalAlign:"top"})}),y=r.add(v),_=v.getBoundingRect(),x=this._api.getDevicePixelRatio(),b=t.rootNode.position.toArray();b[EQ[a[t.dim]]]+=(t.flipped?-1:1)*c.get("margin"),b[EQ[t.dim]]=l.dataToCoord(e[s]),n.geometry.addSprite(b,[_.width*x,_.height*x],y,t.textAlign,t.textVerticalAlign)}}),this),r.getZr().refreshImmediately(),n.material.set("uvScale",r.getCoordsScale()),n.geometry.convertToTypedArray()},dispose:function(){this.groupGL.removeAll(),this._control.dispose(),this._axisLabelSurface.dispose(),this._axisPointerLabelsSurface.dispose()}});function NQ(e){IM.call(this,e),this.type="cartesian3D",this.dimensions=["x","y","z"],this.size=[0,0,0]}function PQ(e,t,n){Ob.call(this,e,t,n)}NQ.prototype={constructor:NQ,model:null,containPoint:function(e){return this.getAxis("x").contain(e[0])&&this.getAxis("y").contain(e[2])&&this.getAxis("z").contain(e[1])},containData:function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])&&this.getAxis("z").containData(e[2])},dataToPoint:function(e,t,n){return(t=t||[])[0]=this.getAxis("x").dataToCoord(e[0],n),t[2]=this.getAxis("y").dataToCoord(e[1],n),t[1]=this.getAxis("z").dataToCoord(e[2],n),t},pointToData:function(e,t,n){return(t=t||[])[0]=this.getAxis("x").coordToData(e[0],n),t[1]=this.getAxis("y").coordToData(e[2],n),t[2]=this.getAxis("z").coordToData(e[1],n),t}},G(NQ,IM),PQ.prototype={constructor:PQ,getExtentMin:function(){var e=this._extent;return Math.min(e[0],e[1])},getExtentMax:function(){var e=this._extent;return Math.max(e[0],e[1])},calculateCategoryInterval:function(){return Math.floor(this.scale.count()/8)}},G(PQ,Ob);var OQ=function(){this._pool={},this._allocatedTextures=[]};OQ.prototype={constructor:OQ,get:function(e){var t=zQ(e);this._pool.hasOwnProperty(t)||(this._pool[t]=[]);var n=this._pool[t];if(!n.length){var r=new RK(e);return this._allocatedTextures.push(r),r}return n.pop()},put:function(e){var t=zQ(e);this._pool.hasOwnProperty(t)||(this._pool[t]=[]),this._pool[t].push(e)},clear:function(e){for(var t=0;t<this._allocatedTextures.length;t++)this._allocatedTextures[t].dispose(e);this._pool={},this._allocatedTextures=[]}};var RQ={width:512,height:512,type:jY,format:eZ,wrapS:dZ,wrapT:dZ,minFilter:lZ,magFilter:iZ,useMipmap:!0,anisotropic:1,flipY:!0,unpackAlignment:4,premultiplyAlpha:!1},kQ=Object.keys(RQ);function zQ(e){bY.defaultsWithPropList(e,RQ,kQ),function(e){var t=(n=e.width,r=e.height,!(n&n-1||r&r-1));var n,r;e.format===$Y&&(e.useMipmap=!1);t&&e.useMipmap||(e.minFilter==oZ||e.minFilter==sZ?e.minFilter=rZ:e.minFilter!=lZ&&e.minFilter!=aZ||(e.minFilter=iZ));t||(e.wrapS=dZ,e.wrapT=dZ)}(e);for(var t="",n=0;n<kQ.length;n++){t+=e[kQ[n]].toString()}return t}var VQ=["px","nx","py","ny","pz","nz"];function BQ(e,t,n){return"alphaMap"===n?e.material.get("diffuseMap"):"alphaCutoff"===n?e.material.isDefined("fragment","ALPHA_TEST")&&e.material.get("diffuseMap")&&e.material.get("alphaCutoff")||0:"uvRepeat"===n?e.material.get("uvRepeat"):"uvOffset"===n?e.material.get("uvOffset"):t.get(n)}function FQ(e,t){var n=e.material,r=t.material;return n.get("diffuseMap")!==r.get("diffuseMap")||(n.get("alphaCutoff")||0)!==(r.get("alphaCutoff")||0)}wq.import("@export clay.sm.depth.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nuniform vec2 uvRepeat = vec2(1.0, 1.0);\nuniform vec2 uvOffset = vec2(0.0, 0.0);\n@import clay.chunk.skinning_header\n@import clay.chunk.instancing_header\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\nvoid main(){\n vec4 P = vec4(position, 1.0);\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = skinMatrixWS * P;\n#endif\n#ifdef INSTANCING\n @import clay.chunk.instancing_matrix\n P = instanceMat * P;\n#endif\n v_ViewPosition = worldViewProjection * P;\n gl_Position = v_ViewPosition;\n v_Texcoord = texcoord * uvRepeat + uvOffset;\n}\n@end\n@export clay.sm.depth.fragment\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\nuniform float bias : 0.001;\nuniform float slopeScale : 1.0;\nuniform sampler2D alphaMap;\nuniform float alphaCutoff: 0.0;\n@import clay.util.encode_float\nvoid main(){\n float depth = v_ViewPosition.z / v_ViewPosition.w;\n if (alphaCutoff > 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n#ifdef USE_VSM\n depth = depth * 0.5 + 0.5;\n float moment1 = depth;\n float moment2 = depth * depth;\n #ifdef SUPPORT_STANDARD_DERIVATIVES\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n moment2 += 0.25*(dx*dx+dy*dy);\n #endif\n gl_FragColor = vec4(moment1, moment2, 0.0, 1.0);\n#else\n #ifdef SUPPORT_STANDARD_DERIVATIVES\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n depth += sqrt(dx*dx + dy*dy) * slopeScale + bias;\n #else\n depth += bias;\n #endif\n gl_FragColor = encodeFloat(depth * 0.5 + 0.5);\n#endif\n}\n@end\n@export clay.sm.debug_depth\nuniform sampler2D depthMap;\nvarying vec2 v_Texcoord;\n@import clay.util.decode_float\nvoid main() {\n vec4 tex = texture2D(depthMap, v_Texcoord);\n#ifdef USE_VSM\n gl_FragColor = vec4(tex.rgb, 1.0);\n#else\n float depth = decodeFloat(tex);\n gl_FragColor = vec4(depth, depth, depth, 1.0);\n#endif\n}\n@end\n@export clay.sm.distance.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 world : WORLD;\nattribute vec3 position : POSITION;\n@import clay.chunk.skinning_header\nvarying vec3 v_WorldPosition;\nvoid main (){\n vec4 P = vec4(position, 1.0);\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = skinMatrixWS * P;\n#endif\n#ifdef INSTANCING\n @import clay.chunk.instancing_matrix\n P = instanceMat * P;\n#endif\n gl_Position = worldViewProjection * P;\n v_WorldPosition = (world * P).xyz;\n}\n@end\n@export clay.sm.distance.fragment\nuniform vec3 lightPosition;\nuniform float range : 100;\nvarying vec3 v_WorldPosition;\n@import clay.util.encode_float\nvoid main(){\n float dist = distance(lightPosition, v_WorldPosition);\n#ifdef USE_VSM\n gl_FragColor = vec4(dist, dist * dist, 0.0, 0.0);\n#else\n dist = dist / range;\n gl_FragColor = encodeFloat(dist);\n#endif\n}\n@end\n@export clay.plugin.shadow_map_common\n@import clay.util.decode_float\nfloat tapShadowMap(sampler2D map, vec2 uv, float z){\n vec4 tex = texture2D(map, uv);\n return step(z, decodeFloat(tex) * 2.0 - 1.0);\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize, vec2 scale) {\n float shadowContrib = tapShadowMap(map, uv, z);\n vec2 offset = vec2(1.0 / textureSize) * scale;\n#ifdef PCF_KERNEL_SIZE\n for (int _idx_ = 0; _idx_ < PCF_KERNEL_SIZE; _idx_++) {{\n shadowContrib += tapShadowMap(map, uv + offset * pcfKernel[_idx_], z);\n }}\n return shadowContrib / float(PCF_KERNEL_SIZE + 1);\n#else\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, -offset.y), z);\n return shadowContrib / 9.0;\n#endif\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize) {\n return pcf(map, uv, z, textureSize, vec2(1.0));\n}\nfloat chebyshevUpperBound(vec2 moments, float z){\n float p = 0.0;\n z = z * 0.5 + 0.5;\n if (z <= moments.x) {\n p = 1.0;\n }\n float variance = moments.y - moments.x * moments.x;\n variance = max(variance, 0.0000001);\n float mD = moments.x - z;\n float pMax = variance / (variance + mD * mD);\n pMax = clamp((pMax-0.4)/(1.0-0.4), 0.0, 1.0);\n return max(p, pMax);\n}\nfloat computeShadowContrib(\n sampler2D map, mat4 lightVPM, vec3 position, float textureSize, vec2 scale, vec2 offset\n) {\n vec4 posInLightSpace = lightVPM * vec4(position, 1.0);\n posInLightSpace.xyz /= posInLightSpace.w;\n float z = posInLightSpace.z;\n if(all(greaterThan(posInLightSpace.xyz, vec3(-0.99, -0.99, -1.0))) &&\n all(lessThan(posInLightSpace.xyz, vec3(0.99, 0.99, 1.0)))){\n vec2 uv = (posInLightSpace.xy+1.0) / 2.0;\n #ifdef USE_VSM\n vec2 moments = texture2D(map, uv * scale + offset).xy;\n return chebyshevUpperBound(moments, z);\n #else\n return pcf(map, uv * scale + offset, z, textureSize, scale);\n #endif\n }\n return 1.0;\n}\nfloat computeShadowContrib(sampler2D map, mat4 lightVPM, vec3 position, float textureSize) {\n return computeShadowContrib(map, lightVPM, position, textureSize, vec2(1.0), vec2(0.0));\n}\nfloat computeShadowContribOmni(samplerCube map, vec3 direction, float range)\n{\n float dist = length(direction);\n vec4 shadowTex = textureCube(map, direction);\n#ifdef USE_VSM\n vec2 moments = shadowTex.xy;\n float variance = moments.y - moments.x * moments.x;\n float mD = moments.x - dist;\n float p = variance / (variance + mD * mD);\n if(moments.x + 0.001 < dist){\n return clamp(p, 0.0, 1.0);\n }else{\n return 1.0;\n }\n#else\n return step(dist, (decodeFloat(shadowTex) + 0.0002) * range);\n#endif\n}\n@end\n@export clay.plugin.compute_shadow_map\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT) || defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT) || defined(POINT_LIGHT_SHADOWMAP_COUNT)\n#ifdef SPOT_LIGHT_SHADOWMAP_COUNT\nuniform sampler2D spotLightShadowMaps[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 spotLightMatrices[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float spotLightShadowMapSizes[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#ifdef DIRECTIONAL_LIGHT_SHADOWMAP_COUNT\n#if defined(SHADOW_CASCADE)\nuniform sampler2D directionalLightShadowMaps[1]:unconfigurable;\nuniform mat4 directionalLightMatrices[SHADOW_CASCADE]:unconfigurable;\nuniform float directionalLightShadowMapSizes[1]:unconfigurable;\nuniform float shadowCascadeClipsNear[SHADOW_CASCADE]:unconfigurable;\nuniform float shadowCascadeClipsFar[SHADOW_CASCADE]:unconfigurable;\n#else\nuniform sampler2D directionalLightShadowMaps[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 directionalLightMatrices[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float directionalLightShadowMapSizes[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#endif\n#ifdef POINT_LIGHT_SHADOWMAP_COUNT\nuniform samplerCube pointLightShadowMaps[POINT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\nuniform bool shadowEnabled : true;\n#ifdef PCF_KERNEL_SIZE\nuniform vec2 pcfKernel[PCF_KERNEL_SIZE];\n#endif\n@import clay.plugin.shadow_map_common\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfSpotLights(vec3 position, inout float shadowContribs[SPOT_LIGHT_COUNT] ) {\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < SPOT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n spotLightShadowMaps[_idx_], spotLightMatrices[_idx_], position,\n spotLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = SPOT_LIGHT_SHADOWMAP_COUNT; _idx_ < SPOT_LIGHT_COUNT; _idx_++){{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n#ifdef SHADOW_CASCADE\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float depth = (2.0 * gl_FragCoord.z - gl_DepthRange.near - gl_DepthRange.far)\n / (gl_DepthRange.far - gl_DepthRange.near);\n float shadowContrib;\n shadowContribs[0] = 1.0;\n for (int _idx_ = 0; _idx_ < SHADOW_CASCADE; _idx_++) {{\n if (\n depth >= shadowCascadeClipsNear[_idx_] &&\n depth <= shadowCascadeClipsFar[_idx_]\n ) {\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[0], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[0],\n vec2(1.0 / float(SHADOW_CASCADE), 1.0),\n vec2(float(_idx_) / float(SHADOW_CASCADE), 0.0)\n );\n shadowContribs[0] = shadowContrib;\n }\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#else\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[_idx_], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n#if defined(POINT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfPointLights(vec3 position, inout float shadowContribs[POINT_LIGHT_COUNT] ){\n vec3 lightPosition;\n vec3 direction;\n for(int _idx_ = 0; _idx_ < POINT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n lightPosition = pointLightPosition[_idx_];\n direction = position - lightPosition;\n shadowContribs[_idx_] = computeShadowContribOmni(pointLightShadowMaps[_idx_], direction, pointLightRange[_idx_]);\n }}\n for(int _idx_ = POINT_LIGHT_SHADOWMAP_COUNT; _idx_ < POINT_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n@end");var GQ,HQ,UQ,WQ,jQ,XQ,YQ,ZQ=wY.extend((function(){return{softShadow:ZQ.PCF,shadowBlur:1,lightFrustumBias:"auto",kernelPCF:new Float32Array([1,0,1,1,-1,1,0,1,-1,0,-1,-1,1,-1,0,-1]),precision:"highp",_lastRenderNotCastShadow:!1,_frameBuffer:new V$,_textures:{},_shadowMapNumber:{POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},_depthMaterials:{},_distanceMaterials:{},_receivers:[],_lightsCastShadow:[],_lightCameras:{},_lightMaterials:{},_texturePool:new OQ}}),(function(){this._gaussianPassH=new cJ({fragment:wq.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new cJ({fragment:wq.source("clay.compositor.gaussian_blur")}),this._gaussianPassH.setUniform("blurSize",this.shadowBlur),this._gaussianPassH.setUniform("blurDir",0),this._gaussianPassV.setUniform("blurSize",this.shadowBlur),this._gaussianPassV.setUniform("blurDir",1),this._outputDepthPass=new cJ({fragment:wq.source("clay.sm.debug_depth")})}),{render:function(e,t,n,r){n||(n=t.getMainCamera()),this.trigger("beforerender",this,e,t,n),this._renderShadowPass(e,t,n,r),this.trigger("afterrender",this,e,t,n)},renderDebug:function(e,t){e.saveClear();var n=e.viewport,r=0,i=t||n.width/4,o=i;for(var a in this.softShadow===ZQ.VSM?this._outputDepthPass.material.define("fragment","USE_VSM"):this._outputDepthPass.material.undefine("fragment","USE_VSM"),this._textures){var s=this._textures[a];e.setViewport(r,0,i*s.width/s.height,o),this._outputDepthPass.setUniform("depthMap",s),this._outputDepthPass.render(e),r+=i*s.width/s.height}e.setViewport(n),e.restoreClear()},_updateReceivers:function(e,t){if(t.receiveShadow?(this._receivers.push(t),t.material.set("shadowEnabled",1),t.material.set("pcfKernel",this.kernelPCF)):t.material.set("shadowEnabled",0),this.softShadow===ZQ.VSM)t.material.define("fragment","USE_VSM"),t.material.undefine("fragment","PCF_KERNEL_SIZE");else{t.material.undefine("fragment","USE_VSM");var n=this.kernelPCF;n&&n.length?t.material.define("fragment","PCF_KERNEL_SIZE",n.length/2):t.material.undefine("fragment","PCF_KERNEL_SIZE")}},_update:function(e,t){var n=this;t.traverse((function(t){t.isRenderable()&&n._updateReceivers(e,t)}));for(var r=0;r<t.lights.length;r++){var i=t.lights[r];i.castShadow&&!i.invisible&&this._lightsCastShadow.push(i)}},_renderShadowPass:function(e,t,n,r){for(var i in this._shadowMapNumber)this._shadowMapNumber[i]=0;this._lightsCastShadow.length=0,this._receivers.length=0;var o=e.gl;if(r||t.update(),n&&n.update(),t.updateLights(),this._update(e,t),this._lightsCastShadow.length||!this._lastRenderNotCastShadow){this._lastRenderNotCastShadow=0===this._lightsCastShadow,o.enable(o.DEPTH_TEST),o.depthMask(!0),o.disable(o.BLEND),o.clearColor(1,1,1,1);for(var a,s=[],l=[],u=[],c=[],h=[],d=[],p=0;p<this._lightsCastShadow.length;p++){var f=this._lightsCastShadow[p];if("DIRECTIONAL_LIGHT"===f.type){if(a){console.warn("Only one direectional light supported with shadow cascade");continue}if(f.shadowCascade>4){console.warn("Support at most 4 cascade");continue}f.shadowCascade>1&&(a=f),this.renderDirectionalLightShadow(e,t,n,f,h,c,u)}else"SPOT_LIGHT"===f.type?this.renderSpotLightShadow(e,t,f,l,s):"POINT_LIGHT"===f.type&&this.renderPointLightShadow(e,t,f,d);this._shadowMapNumber[f.type]++}for(var g in this._shadowMapNumber){var m=this._shadowMapNumber[g],v=g+"_SHADOWMAP_COUNT";for(p=0;p<this._receivers.length;p++){(y=this._receivers[p].material).fragmentDefines[v]!==m&&(m>0?y.define("fragment",v,m):y.isDefined("fragment",v)&&y.undefine("fragment",v))}}for(p=0;p<this._receivers.length;p++){var y=this._receivers[p].material;a?y.define("fragment","SHADOW_CASCADE",a.shadowCascade):y.undefine("fragment","SHADOW_CASCADE")}var _=t.shadowUniforms;if(u.length>0){var x=u.map(T);if(_.directionalLightShadowMaps={value:u,type:"tv"},_.directionalLightMatrices={value:c,type:"m4v"},_.directionalLightShadowMapSizes={value:x,type:"1fv"},a){var b=h.slice(),w=h.slice();b.pop(),w.shift(),b.reverse(),w.reverse(),c.reverse(),_.shadowCascadeClipsNear={value:b,type:"1fv"},_.shadowCascadeClipsFar={value:w,type:"1fv"}}}if(s.length>0){var S=s.map(T);(_=t.shadowUniforms).spotLightShadowMaps={value:s,type:"tv"},_.spotLightMatrices={value:l,type:"m4v"},_.spotLightShadowMapSizes={value:S,type:"1fv"}}d.length>0&&(_.pointLightShadowMaps={value:d,type:"tv"})}function T(e){return e.height}},renderDirectionalLightShadow:(GQ=new h$,HQ=new aK,UQ=new bK,WQ=new aK,jQ=new aK,XQ=new aK,YQ=new aK,function(e,t,n,r,i,o,a){var s=this._getDepthMaterial(r),l={getMaterial:function(e){return e.shadowDepthMaterial||s},isMaterialChanged:FQ,getUniform:BQ,ifRender:function(e){return e.castShadow},sortCompare:Vq.opaqueSortCompare};if(!t.viewBoundingBoxLastFrame.isFinite()){var u=t.getBoundingBox();t.viewBoundingBoxLastFrame.copy(u).applyTransform(n.viewMatrix)}var c=Math.min(-t.viewBoundingBoxLastFrame.min.z,n.far),h=Math.max(-t.viewBoundingBoxLastFrame.max.z,n.near),d=this._getDirectionalLightCamera(r,t,n),p=XQ.array;YQ.copy(d.projectionMatrix),Cq.invert(jQ.array,d.worldTransform.array),Cq.multiply(jQ.array,jQ.array,n.worldTransform.array),Cq.multiply(p,YQ.array,jQ.array);for(var f=[],g=n instanceof D$,m=(n.near+n.far)/(n.near-n.far),v=2*n.near*n.far/(n.near-n.far),y=0;y<=r.shadowCascade;y++){var _=h*Math.pow(c/h,y/r.shadowCascade),x=h+(c-h)*y/r.shadowCascade,b=_*r.cascadeSplitLogFactor+x*(1-r.cascadeSplitLogFactor);f.push(b),i.push(-(-b*m+v)/-b)}var w=this._getTexture(r,r.shadowCascade);a.push(w);var S=e.viewport,T=e.gl;for(this._frameBuffer.attach(w),this._frameBuffer.bind(e),T.clear(T.COLOR_BUFFER_BIT|T.DEPTH_BUFFER_BIT),y=0;y<r.shadowCascade;y++){var M=f[y],C=f[y+1];g?Cq.perspective(HQ.array,n.fov/180*Math.PI,n.aspect,M,C):Cq.ortho(HQ.array,n.left,n.right,n.bottom,n.top,M,C),GQ.setFromProjection(HQ),GQ.getTransformedBoundingBox(UQ,jQ),UQ.applyProjection(YQ);var D=UQ.min.array,A=UQ.max.array;D[0]=Math.max(D[0],-1),D[1]=Math.max(D[1],-1),A[0]=Math.min(A[0],1),A[1]=Math.min(A[1],1),WQ.ortho(D[0],A[0],D[1],A[1],1,-1),d.projectionMatrix.multiplyLeft(WQ);var I=r.shadowResolution||512;e.setViewport((r.shadowCascade-y-1)*I,0,I,I,1);var E=t.updateRenderList(d);e.renderPass(E.opaque,d,l),this.softShadow===ZQ.VSM&&this._gaussianFilter(e,w,w.width);var L=new aK;L.copy(d.viewMatrix).multiplyLeft(d.projectionMatrix),o.push(L.array),d.projectionMatrix.copy(YQ)}this._frameBuffer.unbind(e),e.setViewport(S)}),renderSpotLightShadow:function(e,t,n,r,i){var o=this._getTexture(n),a=this._getSpotLightCamera(n),s=e.gl;this._frameBuffer.attach(o),this._frameBuffer.bind(e),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT);var l=this._getDepthMaterial(n),u={getMaterial:function(e){return e.shadowDepthMaterial||l},isMaterialChanged:FQ,getUniform:BQ,ifRender:function(e){return e.castShadow},sortCompare:Vq.opaqueSortCompare},c=t.updateRenderList(a);e.renderPass(c.opaque,a,u),this._frameBuffer.unbind(e),this.softShadow===ZQ.VSM&&this._gaussianFilter(e,o,o.width);var h=new aK;h.copy(a.worldTransform).invert().multiplyLeft(a.projectionMatrix),i.push(o),r.push(h.array)},renderPointLightShadow:function(e,t,n,r){var i=this._getTexture(n),o=e.gl;r.push(i);var a=this._getDepthMaterial(n),s={getMaterial:function(e){return e.shadowDepthMaterial||a},getUniform:BQ,sortCompare:Vq.opaqueSortCompare},l={px:[],py:[],pz:[],nx:[],ny:[],nz:[]},u=new bK,c=n.getWorldPosition().array,h=new bK,d=n.range;h.min.setArray(c),h.max.setArray(c);var p=new Fq(d,d,d);h.max.add(p),h.min.sub(p);var f={px:!1,py:!1,pz:!1,nx:!1,ny:!1,nz:!1};t.traverse((function(e){if(e.isRenderable()&&e.castShadow){var t=e.geometry;if(!t.boundingBox){for(var n=0;n<VQ.length;n++)l[VQ[n]].push(e);return}if(u.transformFrom(t.boundingBox,e.worldTransform),!u.intersectBoundingBox(h))return;u.updateVertices();for(n=0;n<VQ.length;n++)f[VQ[n]]=!1;for(n=0;n<8;n++){var r=u.vertices[n],i=r[0]-c[0],o=r[1]-c[1],a=r[2]-c[2],s=Math.abs(i),d=Math.abs(o),p=Math.abs(a);s>d?s>p?f[i>0?"px":"nx"]=!0:f[a>0?"pz":"nz"]=!0:d>p?f[o>0?"py":"ny"]=!0:f[a>0?"pz":"nz"]=!0}for(n=0;n<VQ.length;n++)f[VQ[n]]&&l[VQ[n]].push(e)}}));for(var g=0;g<6;g++){var m=VQ[g],v=this._getPointLightCamera(n,m);this._frameBuffer.attach(i,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+g),this._frameBuffer.bind(e),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),e.renderPass(l[m],v,s)}this._frameBuffer.unbind(e)},_getDepthMaterial:function(e){var t=this._lightMaterials[e.__uid__],n="POINT_LIGHT"===e.type;if(!t){var r=n?"clay.sm.distance.":"clay.sm.depth.";t=new jZ({precision:this.precision,shader:new wq(wq.source(r+"vertex"),wq.source(r+"fragment"))}),this._lightMaterials[e.__uid__]=t}return null!=e.shadowSlopeScale&&t.setUniform("slopeScale",e.shadowSlopeScale),null!=e.shadowBias&&t.setUniform("bias",e.shadowBias),this.softShadow===ZQ.VSM?t.define("fragment","USE_VSM"):t.undefine("fragment","USE_VSM"),n&&(t.set("lightPosition",e.getWorldPosition().array),t.set("range",e.range)),t},_gaussianFilter:function(e,t,n){var r={width:n,height:n,type:EK.FLOAT},i=this._texturePool.get(r);this._frameBuffer.attach(i),this._frameBuffer.bind(e),this._gaussianPassH.setUniform("texture",t),this._gaussianPassH.setUniform("textureWidth",n),this._gaussianPassH.render(e),this._frameBuffer.attach(t),this._gaussianPassV.setUniform("texture",i),this._gaussianPassV.setUniform("textureHeight",n),this._gaussianPassV.render(e),this._frameBuffer.unbind(e),this._texturePool.put(i)},_getTexture:function(e,t){var n=e.__uid__,r=this._textures[n],i=e.shadowResolution||512;return t=t||1,r||((r="POINT_LIGHT"===e.type?new M$:new RK).width=i*t,r.height=i,this.softShadow===ZQ.VSM?(r.type=EK.FLOAT,r.anisotropic=4):(r.minFilter=rZ,r.magFilter=rZ,r.useMipmap=!1),this._textures[n]=r),r},_getPointLightCamera:function(e,t){this._lightCameras.point||(this._lightCameras.point={px:new D$,nx:new D$,py:new D$,ny:new D$,pz:new D$,nz:new D$});var n=this._lightCameras.point[t];switch(n.far=e.range,n.fov=90,n.position.set(0,0,0),t){case"px":n.lookAt(Fq.POSITIVE_X,Fq.NEGATIVE_Y);break;case"nx":n.lookAt(Fq.NEGATIVE_X,Fq.NEGATIVE_Y);break;case"py":n.lookAt(Fq.POSITIVE_Y,Fq.POSITIVE_Z);break;case"ny":n.lookAt(Fq.NEGATIVE_Y,Fq.NEGATIVE_Z);break;case"pz":n.lookAt(Fq.POSITIVE_Z,Fq.NEGATIVE_Y);break;case"nz":n.lookAt(Fq.NEGATIVE_Z,Fq.NEGATIVE_Y)}return e.getWorldPosition(n.position),n.update(),n},_getDirectionalLightCamera:function(){var e=new aK,t=new bK,n=new bK;return function(r,i,o){this._lightCameras.directional||(this._lightCameras.directional=new aJ);var a=this._lightCameras.directional;t.copy(i.viewBoundingBoxLastFrame),t.intersection(o.frustum.boundingBox),a.position.copy(t.min).add(t.max).scale(.5).transformMat4(o.worldTransform),a.rotation.copy(r.rotation),a.scale.copy(r.scale),a.updateWorldTransform(),aK.invert(e,a.worldTransform),aK.multiply(e,e,o.worldTransform),n.copy(t).applyTransform(e);var s=n.min.array,l=n.max.array;return a.position.set((s[0]+l[0])/2,(s[1]+l[1])/2,l[2]).transformMat4(a.worldTransform),a.near=0,a.far=-s[2]+l[2],isNaN(this.lightFrustumBias)?a.far*=4:a.far+=this.lightFrustumBias,a.left=s[0],a.right=l[0],a.top=l[1],a.bottom=s[1],a.update(!0),a}}(),_getSpotLightCamera:function(e){this._lightCameras.spot||(this._lightCameras.spot=new D$);var t=this._lightCameras.spot;return t.fov=2*e.penumbraAngle,t.far=e.range,t.worldTransform.copy(e.worldTransform),t.updateProjectionMatrix(),Cq.invert(t.viewMatrix.array,t.worldTransform.array),t},dispose:function(e){var t=e.gl||e;for(var n in this._frameBuffer&&this._frameBuffer.dispose(t),this._textures)this._textures[n].dispose(t);this._texturePool.clear(e.gl),this._depthMaterials={},this._distanceMaterials={},this._textures={},this._lightCameras={},this._shadowMapNumber={POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},this._meshMaterials={};for(var r=0;r<this._receivers.length;r++){var i=this._receivers[r];if(i.material){var o=i.material;o.undefine("fragment","POINT_LIGHT_SHADOW_COUNT"),o.undefine("fragment","DIRECTIONAL_LIGHT_SHADOW_COUNT"),o.undefine("fragment","AMBIENT_LIGHT_SHADOW_COUNT"),o.set("shadowEnabled",0)}}this._receivers=[],this._lightsCastShadow=[]}});ZQ.VSM=1,ZQ.PCF=2;var qQ=wY.extend((function(){return{name:"",inputLinks:{},outputLinks:{},_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}}),{updateParameter:function(e,t){var n,r,i=this.outputs[e],o=i.parameters,a=i._parametersCopy;if(a||(a=i._parametersCopy={}),o)for(var s in o)"width"!==s&&"height"!==s&&(a[s]=o[s]);return n=o.width instanceof Function?o.width.call(this,t):o.width,r=o.height instanceof Function?o.height.call(this,t):o.height,a.width===n&&a.height===r||this._outputTextures[e]&&this._outputTextures[e].dispose(t.gl),a.width=n,a.height=r,a},setParameter:function(e,t){},getParameter:function(e){},setParameters:function(e){for(var t in e)this.setParameter(t,e[t])},render:function(){},getOutput:function(e,t){if(null==t)return t=e,this._outputTextures[t];var n=this.outputs[t];return n?this._rendered?n.outputLastFrame?this._prevOutputTextures[t]:this._outputTextures[t]:this._rendering?(this._prevOutputTextures[t]||(this._prevOutputTextures[t]=this._compositor.allocateTexture(n.parameters||{})),this._prevOutputTextures[t]):(this.render(e),this._outputTextures[t]):void 0},removeReference:function(e){(this._outputReferences[e]--,0===this._outputReferences[e])&&(this.outputs[e].keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e]))},link:function(e,t,n){this.inputLinks[e]={node:t,pin:n},t.outputLinks[n]||(t.outputLinks[n]=[]),t.outputLinks[n].push({node:this,pin:e}),this.pass.material.enableTexture(e)},clear:function(){this.inputLinks={},this.outputLinks={}},updateReference:function(e){if(!this._rendering){for(var t in this._rendering=!0,this.inputLinks){var n=this.inputLinks[t];n.node.updateReference(n.pin)}this._rendering=!1}e&&this._outputReferences[e]++},beforeFrame:function(){for(var e in this._rendered=!1,this.outputLinks)this._outputReferences[e]=0},afterFrame:function(){for(var e in this.outputLinks){if(this._outputReferences[e]>0)this.outputs[e].keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e])}}}),KQ=wY.extend((function(){return{nodes:[]}}),{dirty:function(){this._dirty=!0},addNode:function(e){this.nodes.indexOf(e)>=0||(this.nodes.push(e),this._dirty=!0)},removeNode:function(e){"string"==typeof e&&(e=this.getNodeByName(e));var t=this.nodes.indexOf(e);t>=0&&(this.nodes.splice(t,1),this._dirty=!0)},getNodeByName:function(e){for(var t=0;t<this.nodes.length;t++)if(this.nodes[t].name===e)return this.nodes[t]},update:function(){for(var e=0;e<this.nodes.length;e++)this.nodes[e].clear();for(e=0;e<this.nodes.length;e++){var t=this.nodes[e];if(t.inputs)for(var n in t.inputs)if(t.inputs[n])if(!t.pass||t.pass.material.isUniformEnabled(n)){var r=t.inputs[n],i=this.findPin(r);i?t.link(n,i.node,i.pin):"string"==typeof r?console.warn("Node "+r+" not exist"):console.warn("Pin of "+r.node+"."+r.pin+" not exist")}else console.warn("Pin "+t.name+"."+n+" not used.")}},findPin:function(e){var t;if(("string"==typeof e||e instanceof qQ)&&(e={node:e}),"string"==typeof e.node)for(var n=0;n<this.nodes.length;n++){var r=this.nodes[n];r.name===e.node&&(t=r)}else t=e.node;if(t){var i=e.pin;if(i||t.outputs&&(i=Object.keys(t.outputs)[0]),t.outputs[i])return{node:t,pin:i}}}}),$Q=KQ.extend((function(){return{_outputs:[],_texturePool:new OQ,_frameBuffer:new V$({depthBuffer:!1})}}),{addNode:function(e){KQ.prototype.addNode.call(this,e),e._compositor=this},render:function(e,t){if(this._dirty){this.update(),this._dirty=!1,this._outputs.length=0;for(var n=0;n<this.nodes.length;n++)this.nodes[n].outputs||this._outputs.push(this.nodes[n])}for(n=0;n<this.nodes.length;n++)this.nodes[n].beforeFrame();for(n=0;n<this._outputs.length;n++)this._outputs[n].updateReference();for(n=0;n<this._outputs.length;n++)this._outputs[n].render(e,t);for(n=0;n<this.nodes.length;n++)this.nodes[n].afterFrame()},allocateTexture:function(e){return this._texturePool.get(e)},releaseTexture:function(e){this._texturePool.put(e)},getFrameBuffer:function(){return this._frameBuffer},dispose:function(e){this._texturePool.clear(e)}}),JQ=qQ.extend({name:"scene",scene:null,camera:null,autoUpdateScene:!0,preZ:!1},(function(){this.frameBuffer=new V$}),{render:function(e){this._rendering=!0;var t,n=e.gl;if(this.trigger("beforerender"),this.outputs){var r=this.frameBuffer;for(var i in this.outputs){var o=this.updateParameter(i,e),a=this.outputs[i],s=this._compositor.allocateTexture(o);this._outputTextures[i]=s,"string"==typeof(c=a.attachment||n.COLOR_ATTACHMENT0)&&(c=n[c]),r.attach(s,c)}r.bind(e);var l=e.getGLExtension("EXT_draw_buffers");if(l){var u=[];for(var c in this.outputs)(c=parseInt(c))>=n.COLOR_ATTACHMENT0&&c<=n.COLOR_ATTACHMENT0+8&&u.push(c);l.drawBuffersEXT(u)}e.saveClear(),e.clearBit=CY|AY,t=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),e.restoreClear(),r.unbind(e)}else t=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ);this.trigger("afterrender",t),this._rendering=!1,this._rendered=!0}}),QQ=qQ.extend((function(){return{texture:null,outputs:{color:{}}}}),(function(){}),{getOutput:function(e,t){return this.texture},beforeFrame:function(){},afterFrame:function(){}}),e0=qQ.extend((function(){return{name:"",inputs:{},outputs:null,shader:"",inputLinks:{},outputLinks:{},pass:null,_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}}),(function(){var e=new cJ({fragment:this.shader});this.pass=e}),{render:function(e,t){this.trigger("beforerender",e),this._rendering=!0;var n=e.gl;for(var r in this.inputLinks){var i=(h=this.inputLinks[r]).node.getOutput(e,h.pin);this.pass.setUniform(r,i)}if(this.outputs){this.pass.outputs={};var o={};for(var a in this.outputs){var s=this.updateParameter(a,e);isNaN(s.width)&&this.updateParameter(a,e);var l=this.outputs[a],u=this._compositor.allocateTexture(s);this._outputTextures[a]=u,"string"==typeof(c=l.attachment||n.COLOR_ATTACHMENT0)&&(c=n[c]),o[c]=u}for(var c in this._compositor.getFrameBuffer().bind(e),o)this._compositor.getFrameBuffer().attach(o[c],c);this.pass.render(e),this._compositor.getFrameBuffer().updateMipmap(e)}else this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(e),this.pass.render(e,t);for(var r in this.inputLinks){var h;(h=this.inputLinks[r]).node.removeReference(h.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",e)},updateParameter:function(e,t){var n,r,i=this.outputs[e],o=i.parameters,a=i._parametersCopy;if(a||(a=i._parametersCopy={}),o)for(var s in o)"width"!==s&&"height"!==s&&(a[s]=o[s]);return n="function"==typeof o.width?o.width.call(this,t):o.width,r="function"==typeof o.height?o.height.call(this,t):o.height,n=Math.ceil(n),r=Math.ceil(r),a.width===n&&a.height===r||this._outputTextures[e]&&this._outputTextures[e].dispose(t),a.width=n,a.height=r,a},setParameter:function(e,t){this.pass.setUniform(e,t)},getParameter:function(e){return this.pass.getUniform(e)},setParameters:function(e){for(var t in e)this.setParameter(t,e[t])},define:function(e,t){this.pass.material.define("fragment",e,t)},undefine:function(e){this.pass.material.undefine("fragment",e)},removeReference:function(e){(this._outputReferences[e]--,0===this._outputReferences[e])&&(this.outputs[e].keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e]))},clear:function(){qQ.prototype.clear.call(this),this.pass.material.disableTexturesAll()}}),t0="@export clay.compositor.kernel.gaussian_9\nfloat gaussianKernel[9];\ngaussianKernel[0] = 0.07;\ngaussianKernel[1] = 0.09;\ngaussianKernel[2] = 0.12;\ngaussianKernel[3] = 0.14;\ngaussianKernel[4] = 0.16;\ngaussianKernel[5] = 0.14;\ngaussianKernel[6] = 0.12;\ngaussianKernel[7] = 0.09;\ngaussianKernel[8] = 0.07;\n@end\n@export clay.compositor.kernel.gaussian_13\nfloat gaussianKernel[13];\ngaussianKernel[0] = 0.02;\ngaussianKernel[1] = 0.03;\ngaussianKernel[2] = 0.06;\ngaussianKernel[3] = 0.08;\ngaussianKernel[4] = 0.11;\ngaussianKernel[5] = 0.13;\ngaussianKernel[6] = 0.14;\ngaussianKernel[7] = 0.13;\ngaussianKernel[8] = 0.11;\ngaussianKernel[9] = 0.08;\ngaussianKernel[10] = 0.06;\ngaussianKernel[11] = 0.03;\ngaussianKernel[12] = 0.02;\n@end\n@export clay.compositor.gaussian_blur\n#define SHADER_NAME gaussian_blur\nuniform sampler2D texture;varying vec2 v_Texcoord;\nuniform float blurSize : 2.0;\nuniform vec2 textureSize : [512.0, 512.0];\nuniform float blurDir : 0.0;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main (void)\n{\n @import clay.compositor.kernel.gaussian_9\n vec2 off = blurSize / textureSize;\n off *= vec2(1.0 - blurDir, blurDir);\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n for (int i = 0; i < 9; i++) {\n float w = gaussianKernel[i];\n vec4 texel = decodeHDR(clampSample(texture, v_Texcoord + float(i - 4) * off));\n sum += texel * w;\n weightAll += w;\n }\n gl_FragColor = encodeHDR(sum / max(weightAll, 0.01));\n}\n@end\n",n0="\n@export clay.compositor.lut\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform sampler2D lookup;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n float blueColor = tex.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec4 newColor1 = texture2D(lookup, texPos1);\n vec4 newColor2 = texture2D(lookup, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n gl_FragColor = vec4(newColor.rgb, tex.w);\n}\n@end",r0="@export clay.compositor.output\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = tex.rgb;\n#ifdef OUTPUT_ALPHA\n gl_FragColor.a = tex.a;\n#else\n gl_FragColor.a = 1.0;\n#endif\n gl_FragColor = encodeHDR(gl_FragColor);\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end",i0="@export clay.compositor.bright\nuniform sampler2D texture;\nuniform float threshold : 1;\nuniform float scale : 1.0;\nuniform vec2 textureSize: [512, 512];\nvarying vec2 v_Texcoord;\nconst vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvec4 median(vec4 a, vec4 b, vec4 c)\n{\n return a + b + c - min(min(a, b), c) - max(max(a, b), c);\n}\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n#ifdef ANTI_FLICKER\n vec3 d = 1.0 / textureSize.xyx * vec3(1.0, 1.0, 0.0);\n vec4 s1 = decodeHDR(texture2D(texture, v_Texcoord - d.xz));\n vec4 s2 = decodeHDR(texture2D(texture, v_Texcoord + d.xz));\n vec4 s3 = decodeHDR(texture2D(texture, v_Texcoord - d.zy));\n vec4 s4 = decodeHDR(texture2D(texture, v_Texcoord + d.zy));\n texel = median(median(texel, s1, s2), s3, s4);\n#endif\n float lum = dot(texel.rgb , lumWeight);\n vec4 color;\n if (lum > threshold && texel.a > 0.0)\n {\n color = vec4(texel.rgb * scale, texel.a * scale);\n }\n else\n {\n color = vec4(0.0);\n }\n gl_FragColor = encodeHDR(color);\n}\n@end\n",o0="@export clay.compositor.downsample\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nfloat brightness(vec3 c)\n{\n return max(max(c.r, c.g), c.b);\n}\n@import clay.util.clamp_sample\nvoid main()\n{\n vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;\n#ifdef ANTI_FLICKER\n vec3 s1 = decodeHDR(clampSample(texture, v_Texcoord + d.xy)).rgb;\n vec3 s2 = decodeHDR(clampSample(texture, v_Texcoord + d.zy)).rgb;\n vec3 s3 = decodeHDR(clampSample(texture, v_Texcoord + d.xw)).rgb;\n vec3 s4 = decodeHDR(clampSample(texture, v_Texcoord + d.zw)).rgb;\n float s1w = 1.0 / (brightness(s1) + 1.0);\n float s2w = 1.0 / (brightness(s2) + 1.0);\n float s3w = 1.0 / (brightness(s3) + 1.0);\n float s4w = 1.0 / (brightness(s4) + 1.0);\n float oneDivideSum = 1.0 / (s1w + s2w + s3w + s4w);\n vec4 color = vec4(\n (s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * oneDivideSum,\n 1.0\n );\n#else\n vec4 color = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n color *= 0.25;\n#endif\n gl_FragColor = encodeHDR(color);\n}\n@end",a0="\n@export clay.compositor.upsample\n#define HIGH_QUALITY\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nuniform float sampleScale: 0.5;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main()\n{\n#ifdef HIGH_QUALITY\n vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord - d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord - d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord - d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord )) * 4.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n gl_FragColor = encodeHDR(s / 16.0);\n#else\n vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n gl_FragColor = encodeHDR(s / 4.0);\n#endif\n}\n@end",s0="@export clay.compositor.hdr.composite\n#define TONEMAPPING\nuniform sampler2D texture;\n#ifdef BLOOM_ENABLED\nuniform sampler2D bloom;\n#endif\n#ifdef LENSFLARE_ENABLED\nuniform sampler2D lensflare;\nuniform sampler2D lensdirt;\n#endif\n#ifdef LUM_ENABLED\nuniform sampler2D lum;\n#endif\n#ifdef LUT_ENABLED\nuniform sampler2D lut;\n#endif\n#ifdef COLOR_CORRECTION\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float saturation : 1.0;\n#endif\n#ifdef VIGNETTE\nuniform float vignetteDarkness: 1.0;\nuniform float vignetteOffset: 1.0;\n#endif\nuniform float exposure : 1.0;\nuniform float bloomIntensity : 0.25;\nuniform float lensflareIntensity : 1;\nvarying vec2 v_Texcoord;\n@import clay.util.srgb\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\nfloat eyeAdaption(float fLum)\n{\n return mix(0.2, fLum, 0.5);\n}\n#ifdef LUT_ENABLED\nvec3 lutTransform(vec3 color) {\n float blueColor = color.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec4 newColor1 = texture2D(lut, texPos1);\n vec4 newColor2 = texture2D(lut, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n return newColor.rgb;\n}\n#endif\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = vec4(0.0);\n vec4 originalTexel = vec4(0.0);\n#ifdef TEXTURE_ENABLED\n texel = decodeHDR(texture2D(texture, v_Texcoord));\n originalTexel = texel;\n#endif\n#ifdef BLOOM_ENABLED\n vec4 bloomTexel = decodeHDR(texture2D(bloom, v_Texcoord));\n texel.rgb += bloomTexel.rgb * bloomIntensity;\n texel.a += bloomTexel.a * bloomIntensity;\n#endif\n#ifdef LENSFLARE_ENABLED\n texel += decodeHDR(texture2D(lensflare, v_Texcoord)) * texture2D(lensdirt, v_Texcoord) * lensflareIntensity;\n#endif\n texel.a = min(texel.a, 1.0);\n#ifdef LUM_ENABLED\n float fLum = texture2D(lum, vec2(0.5, 0.5)).r;\n float adaptedLumDest = 3.0 / (max(0.1, 1.0 + 10.0*eyeAdaption(fLum)));\n float exposureBias = adaptedLumDest * exposure;\n#else\n float exposureBias = exposure;\n#endif\n#ifdef TONEMAPPING\n texel.rgb *= exposureBias;\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n texel = linearTosRGB(texel);\n#ifdef LUT_ENABLED\n texel.rgb = lutTransform(clamp(texel.rgb,vec3(0.0),vec3(1.0)));\n#endif\n#ifdef COLOR_CORRECTION\n texel.rgb = clamp(texel.rgb + vec3(brightness), 0.0, 1.0);\n texel.rgb = clamp((texel.rgb - vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n float lum = dot(texel.rgb, vec3(0.2125, 0.7154, 0.0721));\n texel.rgb = mix(vec3(lum), texel.rgb, saturation);\n#endif\n#ifdef VIGNETTE\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(vignetteOffset);\n texel.rgb = mix(texel.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));\n#endif\n gl_FragColor = encodeHDR(texel);\n#ifdef DEBUG\n #if DEBUG == 1\n gl_FragColor = encodeHDR(decodeHDR(texture2D(texture, v_Texcoord)));\n #elif DEBUG == 2\n gl_FragColor = encodeHDR(decodeHDR(texture2D(bloom, v_Texcoord)) * bloomIntensity);\n #elif DEBUG == 3\n gl_FragColor = encodeHDR(decodeHDR(texture2D(lensflare, v_Texcoord) * lensflareIntensity));\n #endif\n#endif\n if (originalTexel.a <= 0.01 && gl_FragColor.a > 1e-5) {\n gl_FragColor.a = dot(gl_FragColor.rgb, vec3(0.2125, 0.7154, 0.0721));\n }\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end",l0="@export clay.compositor.blend\n#define SHADER_NAME blend\n#ifdef TEXTURE1_ENABLED\nuniform sampler2D texture1;\nuniform float weight1 : 1.0;\n#endif\n#ifdef TEXTURE2_ENABLED\nuniform sampler2D texture2;\nuniform float weight2 : 1.0;\n#endif\n#ifdef TEXTURE3_ENABLED\nuniform sampler2D texture3;\nuniform float weight3 : 1.0;\n#endif\n#ifdef TEXTURE4_ENABLED\nuniform sampler2D texture4;\nuniform float weight4 : 1.0;\n#endif\n#ifdef TEXTURE5_ENABLED\nuniform sampler2D texture5;\nuniform float weight5 : 1.0;\n#endif\n#ifdef TEXTURE6_ENABLED\nuniform sampler2D texture6;\nuniform float weight6 : 1.0;\n#endif\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = vec4(0.0);\n#ifdef TEXTURE1_ENABLED\n tex += decodeHDR(texture2D(texture1, v_Texcoord)) * weight1;\n#endif\n#ifdef TEXTURE2_ENABLED\n tex += decodeHDR(texture2D(texture2, v_Texcoord)) * weight2;\n#endif\n#ifdef TEXTURE3_ENABLED\n tex += decodeHDR(texture2D(texture3, v_Texcoord)) * weight3;\n#endif\n#ifdef TEXTURE4_ENABLED\n tex += decodeHDR(texture2D(texture4, v_Texcoord)) * weight4;\n#endif\n#ifdef TEXTURE5_ENABLED\n tex += decodeHDR(texture2D(texture5, v_Texcoord)) * weight5;\n#endif\n#ifdef TEXTURE6_ENABLED\n tex += decodeHDR(texture2D(texture6, v_Texcoord)) * weight6;\n#endif\n gl_FragColor = encodeHDR(tex);\n}\n@end",u0="@export clay.compositor.fxaa\nuniform sampler2D texture;\nuniform vec4 viewport : VIEWPORT;\nvarying vec2 v_Texcoord;\n#define FXAA_REDUCE_MIN (1.0/128.0)\n#define FXAA_REDUCE_MUL (1.0/8.0)\n#define FXAA_SPAN_MAX 8.0\n@import clay.util.rgbm\nvoid main()\n{\n vec2 resolution = 1.0 / viewport.zw;\n vec3 rgbNW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbNE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ) ).xyz;\n vec4 rgbaM = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution ) );\n vec3 rgbM = rgbaM.xyz;\n float opacity = rgbaM.w;\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\n float lumaNW = dot( rgbNW, luma );\n float lumaNE = dot( rgbNE, luma );\n float lumaSW = dot( rgbSW, luma );\n float lumaSE = dot( rgbSE, luma );\n float lumaM = dot( rgbM, luma );\n float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );\n float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );\n vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );\n float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );\n dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * resolution;\n vec3 rgbA = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA *= 0.5;\n vec3 rgbB = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * -0.5 ) ).xyz;\n rgbB += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * 0.5 ) ).xyz;\n rgbB *= 0.25;\n rgbB += rgbA * 0.5;\n float lumaB = dot( rgbB, luma );\n if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) )\n {\n gl_FragColor = vec4( rgbA, opacity );\n }\n else {\n gl_FragColor = vec4( rgbB, opacity );\n }\n}\n@end";!function(e){e.import("@export clay.compositor.coloradjust\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float exposure : 0.0;\nuniform float gamma : 1.0;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = clamp(tex.rgb + vec3(brightness), 0.0, 1.0);\n color = clamp( (color-vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n color = clamp( color * pow(2.0, exposure), 0.0, 1.0);\n color = clamp( pow(color, vec3(gamma)), 0.0, 1.0);\n float luminance = dot( color, w );\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.brightness\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = tex.rgb + vec3(brightness);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.contrast\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float contrast : 1.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = (tex.rgb-vec3(0.5))*contrast+vec3(0.5);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.exposure\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float exposure : 0.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb * pow(2.0, exposure);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.gamma\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float gamma : 1.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = pow(tex.rgb, vec3(gamma));\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.saturation\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb;\n float luminance = dot(color, w);\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end"),e.import(t0),e.import("@export clay.compositor.hdr.log_lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n float luminance = dot(tex.rgb, w);\n luminance = log(luminance + 0.001);\n gl_FragColor = encodeHDR(vec4(vec3(luminance), 1.0));\n}\n@end\n@export clay.compositor.hdr.lum_adaption\nvarying vec2 v_Texcoord;\nuniform sampler2D adaptedLum;\nuniform sampler2D currentLum;\nuniform float frameTime : 0.02;\n@import clay.util.rgbm\nvoid main()\n{\n float fAdaptedLum = decodeHDR(texture2D(adaptedLum, vec2(0.5, 0.5))).r;\n float fCurrentLum = exp(encodeHDR(texture2D(currentLum, vec2(0.5, 0.5))).r);\n fAdaptedLum += (fCurrentLum - fAdaptedLum) * (1.0 - pow(0.98, 30.0 * frameTime));\n gl_FragColor = encodeHDR(vec4(vec3(fAdaptedLum), 1.0));\n}\n@end\n@export clay.compositor.lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord );\n float luminance = dot(tex.rgb, w);\n gl_FragColor = vec4(vec3(luminance), 1.0);\n}\n@end"),e.import(n0),e.import("@export clay.compositor.vignette\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float darkness: 1;\nuniform float offset: 1;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = texel.rgb;\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(offset);\n gl_FragColor = encodeHDR(vec4(mix(texel.rgb, vec3(1.0 - darkness), dot(uv, uv)), texel.a));\n}\n@end"),e.import(r0),e.import(i0),e.import(o0),e.import(a0),e.import(s0),e.import("@export clay.compositor.lensflare\n#define SAMPLE_NUMBER 8\nuniform sampler2D texture;\nuniform sampler2D lenscolor;\nuniform vec2 textureSize : [512, 512];\nuniform float dispersal : 0.3;\nuniform float haloWidth : 0.4;\nuniform float distortion : 1.0;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvec4 textureDistorted(\n in vec2 texcoord,\n in vec2 direction,\n in vec3 distortion\n) {\n return vec4(\n decodeHDR(texture2D(texture, texcoord + direction * distortion.r)).r,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.g)).g,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.b)).b,\n 1.0\n );\n}\nvoid main()\n{\n vec2 texcoord = -v_Texcoord + vec2(1.0); vec2 textureOffset = 1.0 / textureSize;\n vec2 ghostVec = (vec2(0.5) - texcoord) * dispersal;\n vec2 haloVec = normalize(ghostVec) * haloWidth;\n vec3 distortion = vec3(-textureOffset.x * distortion, 0.0, textureOffset.x * distortion);\n vec4 result = vec4(0.0);\n for (int i = 0; i < SAMPLE_NUMBER; i++)\n {\n vec2 offset = fract(texcoord + ghostVec * float(i));\n float weight = length(vec2(0.5) - offset) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n }\n result *= texture2D(lenscolor, vec2(length(vec2(0.5) - texcoord)) / length(vec2(0.5)));\n float weight = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n vec2 offset = fract(texcoord + haloVec);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n gl_FragColor = result;\n}\n@end"),e.import(l0),e.import(u0)}(wq);var c0=/^#source\((.*?)\)/;function h0(e,t){var n=new $Q;t=t||{};var r={textures:{},parameters:{}};for(var i in e.parameters){var o=e.parameters[i];r.parameters[i]=g0(o)}return function(e,t,n,r){if(!e.textures)return void r({});var i={},o=0,a=!1,s=n.textureRootPath;bY.each(e.textures,(function(e,t){var n,l=e.path,u=g0(e.parameters);if(Array.isArray(l)&&6===l.length)s&&(l=l.map((function(e){return bY.relative2absolute(e,s)}))),n=new M$(u);else{if("string"!=typeof l)return;s&&(l=bY.relative2absolute(l,s)),n=new RK(u)}n.load(l),o++,n.once("success",(function(){i[t]=n,0===--o&&(r(i),a=!0)}))})),0!==o||a||r(i)}(e,0,t,(function(i){r.textures=i,function(){for(var i=0;i<e.nodes.length;i++){var o=d0(e.nodes[i],r,t);o&&n.addNode(o)}}()})),n}function d0(e,t,n){var r,i,o,a,s=e.type||"filter";if("filter"===s){var l=e.shader.trim(),u=c0.exec(l);if(u?r=wq.source(u[1].trim()):"#"===l.charAt(0)&&(r=t.shaders[l.substr(1)]),r||(r=l),!r)return}if(e.inputs)for(var c in i={},e.inputs)"string"==typeof e.inputs[c]?i[c]=e.inputs[c]:i[c]={node:e.inputs[c].node,pin:e.inputs[c].pin};if(e.outputs)for(var c in o={},e.outputs){var h=e.outputs[c];o[c]={},null!=h.attachment&&(o[c].attachment=h.attachment),null!=h.keepLastFrame&&(o[c].keepLastFrame=h.keepLastFrame),null!=h.outputLastFrame&&(o[c].outputLastFrame=h.outputLastFrame),h.parameters&&(o[c].parameters=g0(h.parameters))}if(a="scene"===s?new JQ({name:e.name,scene:n.scene,camera:n.camera,outputs:o}):"texture"===s?new QQ({name:e.name,outputs:o}):new e0({name:e.name,shader:r,inputs:i,outputs:o})){if(e.parameters)for(var c in e.parameters){"string"==typeof(d=e.parameters[c])?"#"===(d=d.trim()).charAt(0)?d=t.textures[d.substr(1)]:a.on("beforerender",m0(c,v0(d))):"function"==typeof d&&a.on("beforerender",d),a.setParameter(c,d)}if(e.defines&&a.pass)for(var c in e.defines){var d=e.defines[c];a.pass.material.define("fragment",c,d)}}return a}function p0(e,t){return e}function f0(e,t){return t}function g0(e){var t={};if(!e)return t;["type","minFilter","magFilter","wrapS","wrapT","flipY","useMipmap"].forEach((function(n){var r=e[n];null!=r&&("string"==typeof r&&(r=EK[r]),t[n]=r)}));var n=e.scale||1;return["width","height"].forEach((function(r){if(null!=e[r]){var i=e[r];"string"==typeof i?(i=i.trim(),t[r]=function(e,t,n){return n=n||1,function(e){var r=e.getDevicePixelRatio(),i=e.getWidth()*n,o=e.getHeight()*n;return t(i,o,r)}}(0,v0(i),n)):t[r]=i}})),t.width||(t.width=p0),t.height||(t.height=f0),null!=e.useMipmap&&(t.useMipmap=e.useMipmap),t}function m0(e,t){return function(n){var r=n.getDevicePixelRatio(),i=n.getWidth(),o=n.getHeight(),a=t(i,o,r);this.setParameter(e,a)}}function v0(e){var t=/^expr\((.*)\)$/.exec(e);if(t)try{var n=new Function("width","height","dpr","return "+t[1]);return n(1,1),n}catch(e){throw new Error("Invalid expression.")}}function y0(e,t){for(var n=0,r=1/t,i=e;i>0;)n+=r*(i%t),i=Math.floor(i/t),r/=t;return n}function _0(e){for(var t=new Uint8Array(e*e*4),n=0,r=new Fq,i=0;i<e;i++)for(var o=0;o<e;o++)r.set(2*Math.random()-1,2*Math.random()-1,0).normalize(),t[n++]=255*(.5*r.x+.5),t[n++]=255*(.5*r.y+.5),t[n++]=0,t[n++]=255;return t}function x0(e){return new RK({pixels:_0(e),wrapS:EK.REPEAT,wrapT:EK.REPEAT,width:e,height:e})}function b0(e,t,n){var r=new Float32Array(3*e);t=t||0;for(var i=0;i<e;i++){var o=y0(i+t,2)*(n?1:2)*Math.PI,a=y0(i+t,3)*Math.PI,s=Math.random(),l=Math.cos(o)*Math.sin(a)*s,u=Math.cos(a)*s,c=Math.sin(o)*Math.sin(a)*s;r[3*i]=l,r[3*i+1]=u,r[3*i+2]=c}return r}function w0(e){e=e||{},this._ssaoPass=new cJ({fragment:wq.source("ecgl.ssao.estimate")}),this._blurPass=new cJ({fragment:wq.source("ecgl.ssao.blur")}),this._framebuffer=new V$({depthBuffer:!1}),this._ssaoTexture=new RK,this._blurTexture=new RK,this._blurTexture2=new RK,this._depthTex=e.depthTexture,this._normalTex=e.normalTexture,this.setNoiseSize(4),this.setKernelSize(e.kernelSize||12),null!=e.radius&&this.setParameter("radius",e.radius),null!=e.power&&this.setParameter("power",e.power),this._normalTex||(this._ssaoPass.material.disableTexture("normalTex"),this._blurPass.material.disableTexture("normalTex")),this._depthTex||this._blurPass.material.disableTexture("depthTex"),this._blurPass.material.setUniform("normalTex",this._normalTex),this._blurPass.material.setUniform("depthTex",this._depthTex)}wq.import("@export ecgl.ssao.estimate\n\nuniform sampler2D depthTex;\n\nuniform sampler2D normalTex;\n\nuniform sampler2D noiseTex;\n\nuniform vec2 depthTexSize;\n\nuniform vec2 noiseTexSize;\n\nuniform mat4 projection;\n\nuniform mat4 projectionInv;\n\nuniform mat4 viewInverseTranspose;\n\nuniform vec3 kernel[KERNEL_SIZE];\n\nuniform float radius : 1;\n\nuniform float power : 1;\n\nuniform float bias: 1e-2;\n\nuniform float intensity: 1.0;\n\nvarying vec2 v_Texcoord;\n\nfloat ssaoEstimator(in vec3 originPos, in mat3 kernelBasis) {\n float occlusion = 0.0;\n\n for (int i = 0; i < KERNEL_SIZE; i++) {\n vec3 samplePos = kernel[i];\n#ifdef NORMALTEX_ENABLED\n samplePos = kernelBasis * samplePos;\n#endif\n samplePos = samplePos * radius + originPos;\n\n vec4 texCoord = projection * vec4(samplePos, 1.0);\n texCoord.xy /= texCoord.w;\n\n vec4 depthTexel = texture2D(depthTex, texCoord.xy * 0.5 + 0.5);\n\n float sampleDepth = depthTexel.r * 2.0 - 1.0;\n if (projection[3][3] == 0.0) {\n sampleDepth = projection[3][2] / (sampleDepth * projection[2][3] - projection[2][2]);\n }\n else {\n sampleDepth = (sampleDepth - projection[3][2]) / projection[2][2];\n }\n \n float rangeCheck = smoothstep(0.0, 1.0, radius / abs(originPos.z - sampleDepth));\n occlusion += rangeCheck * step(samplePos.z, sampleDepth - bias);\n }\n#ifdef NORMALTEX_ENABLED\n occlusion = 1.0 - occlusion / float(KERNEL_SIZE);\n#else\n occlusion = 1.0 - clamp((occlusion / float(KERNEL_SIZE) - 0.6) * 2.5, 0.0, 1.0);\n#endif\n return pow(occlusion, power);\n}\n\nvoid main()\n{\n\n vec4 depthTexel = texture2D(depthTex, v_Texcoord);\n\n#ifdef NORMALTEX_ENABLED\n vec4 tex = texture2D(normalTex, v_Texcoord);\n if (dot(tex.rgb, tex.rgb) == 0.0) {\n gl_FragColor = vec4(1.0);\n return;\n }\n vec3 N = tex.rgb * 2.0 - 1.0;\n N = (viewInverseTranspose * vec4(N, 0.0)).xyz;\n\n vec2 noiseTexCoord = depthTexSize / vec2(noiseTexSize) * v_Texcoord;\n vec3 rvec = texture2D(noiseTex, noiseTexCoord).rgb * 2.0 - 1.0;\n vec3 T = normalize(rvec - N * dot(rvec, N));\n vec3 BT = normalize(cross(N, T));\n mat3 kernelBasis = mat3(T, BT, N);\n#else\n if (depthTexel.r > 0.99999) {\n gl_FragColor = vec4(1.0);\n return;\n }\n mat3 kernelBasis;\n#endif\n\n float z = depthTexel.r * 2.0 - 1.0;\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * projectedPos;\n\n vec3 position = p4.xyz / p4.w;\n\n float ao = ssaoEstimator(position, kernelBasis);\n ao = clamp(1.0 - (1.0 - ao) * intensity, 0.0, 1.0);\n gl_FragColor = vec4(vec3(ao), 1.0);\n}\n\n@end\n\n\n@export ecgl.ssao.blur\n#define SHADER_NAME SSAO_BLUR\n\nuniform sampler2D ssaoTexture;\n\n#ifdef NORMALTEX_ENABLED\nuniform sampler2D normalTex;\n#endif\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\nuniform int direction: 0.0;\n\n#ifdef DEPTHTEX_ENABLED\nuniform sampler2D depthTex;\nuniform mat4 projection;\nuniform float depthRange : 0.5;\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(depthTex, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n#endif\n\nvoid main()\n{\n float kernel[5];\n kernel[0] = 0.122581;\n kernel[1] = 0.233062;\n kernel[2] = 0.288713;\n kernel[3] = 0.233062;\n kernel[4] = 0.122581;\n\n vec2 off = vec2(0.0);\n if (direction == 0) {\n off[0] = blurSize / textureSize.x;\n }\n else {\n off[1] = blurSize / textureSize.y;\n }\n\n vec2 coord = v_Texcoord;\n\n float sum = 0.0;\n float weightAll = 0.0;\n\n#ifdef NORMALTEX_ENABLED\n vec3 centerNormal = texture2D(normalTex, v_Texcoord).rgb * 2.0 - 1.0;\n#endif\n#if defined(DEPTHTEX_ENABLED)\n float centerDepth = getLinearDepth(v_Texcoord);\n#endif\n\n for (int i = 0; i < 5; i++) {\n vec2 coord = clamp(v_Texcoord + vec2(float(i) - 2.0) * off, vec2(0.0), vec2(1.0));\n\n float w = kernel[i];\n#ifdef NORMALTEX_ENABLED\n vec3 normal = texture2D(normalTex, coord).rgb * 2.0 - 1.0;\n w *= clamp(dot(normal, centerNormal), 0.0, 1.0);\n#endif\n#ifdef DEPTHTEX_ENABLED\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(centerDepth - d) / depthRange, 0.0, 1.0));\n#endif\n\n weightAll += w;\n sum += texture2D(ssaoTexture, coord).r * w;\n }\n\n gl_FragColor = vec4(vec3(sum / weightAll), 1.0);\n}\n\n@end\n"),w0.prototype.setDepthTexture=function(e){this._depthTex=e},w0.prototype.setNormalTexture=function(e){this._normalTex=e,this._ssaoPass.material[e?"enableTexture":"disableTexture"]("normalTex"),this.setKernelSize(this._kernelSize)},w0.prototype.update=function(e,t,n){var r=e.getWidth(),i=e.getHeight(),o=this._ssaoPass,a=this._blurPass;o.setUniform("kernel",this._kernels[n%this._kernels.length]),o.setUniform("depthTex",this._depthTex),null!=this._normalTex&&o.setUniform("normalTex",this._normalTex),o.setUniform("depthTexSize",[this._depthTex.width,this._depthTex.height]);var s=new aK;aK.transpose(s,t.worldTransform),o.setUniform("projection",t.projectionMatrix.array),o.setUniform("projectionInv",t.invProjectionMatrix.array),o.setUniform("viewInverseTranspose",s.array);var l=this._ssaoTexture,u=this._blurTexture,c=this._blurTexture2;l.width=r/2,l.height=i/2,u.width=r,u.height=i,c.width=r,c.height=i,this._framebuffer.attach(l),this._framebuffer.bind(e),e.gl.clearColor(1,1,1,1),e.gl.clear(e.gl.COLOR_BUFFER_BIT),o.render(e),a.setUniform("textureSize",[r/2,i/2]),a.setUniform("projection",t.projectionMatrix.array),this._framebuffer.attach(u),a.setUniform("direction",0),a.setUniform("ssaoTexture",l),a.render(e),this._framebuffer.attach(c),a.setUniform("textureSize",[r,i]),a.setUniform("direction",1),a.setUniform("ssaoTexture",u),a.render(e),this._framebuffer.unbind(e);var h=e.clearColor;e.gl.clearColor(h[0],h[1],h[2],h[3])},w0.prototype.getTargetTexture=function(){return this._blurTexture2},w0.prototype.setParameter=function(e,t){"noiseTexSize"===e?this.setNoiseSize(t):"kernelSize"===e?this.setKernelSize(t):"intensity"===e?this._ssaoPass.material.set("intensity",t):this._ssaoPass.setUniform(e,t)},w0.prototype.setKernelSize=function(e){this._kernelSize=e,this._ssaoPass.material.define("fragment","KERNEL_SIZE",e),this._kernels=this._kernels||[];for(var t=0;t<30;t++)this._kernels[t]=b0(e,t*e,!!this._normalTex)},w0.prototype.setNoiseSize=function(e){var t=this._ssaoPass.getUniform("noiseTex");t?(t.data=_0(e),t.width=t.height=e,t.dirty()):(t=x0(e),this._ssaoPass.setUniform("noiseTex",x0(e))),this._ssaoPass.setUniform("noiseTexSize",[e,e])},w0.prototype.dispose=function(e){this._blurTexture.dispose(e),this._ssaoTexture.dispose(e),this._blurTexture2.dispose(e)};function S0(e){e=e||{},this._ssrPass=new cJ({fragment:wq.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new cJ({fragment:wq.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new cJ({fragment:wq.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blendPass=new cJ({fragment:wq.source("clay.compositor.blend")}),this._blendPass.material.disableTexturesAll(),this._blendPass.material.enableTexture(["texture1","texture2"]),this._ssrPass.setUniform("gBufferTexture1",e.normalTexture),this._ssrPass.setUniform("gBufferTexture2",e.depthTexture),this._blurPass1.setUniform("gBufferTexture1",e.normalTexture),this._blurPass1.setUniform("gBufferTexture2",e.depthTexture),this._blurPass2.setUniform("gBufferTexture1",e.normalTexture),this._blurPass2.setUniform("gBufferTexture2",e.depthTexture),this._blurPass2.material.define("fragment","VERTICAL"),this._blurPass2.material.define("fragment","BLEND"),this._ssrTexture=new RK({type:EK.HALF_FLOAT}),this._texture2=new RK({type:EK.HALF_FLOAT}),this._texture3=new RK({type:EK.HALF_FLOAT}),this._prevTexture=new RK({type:EK.HALF_FLOAT}),this._currentTexture=new RK({type:EK.HALF_FLOAT}),this._frameBuffer=new V$({depthBuffer:!1}),this._normalDistribution=null,this._totalSamples=256,this._samplePerFrame=4,this._ssrPass.material.define("fragment","SAMPLE_PER_FRAME",this._samplePerFrame),this._ssrPass.material.define("fragment","TOTAL_SAMPLES",this._totalSamples),this._downScale=1}wq.import("@export ecgl.ssr.main\n\n#define SHADER_NAME SSR\n#define MAX_ITERATION 20;\n#define SAMPLE_PER_FRAME 5;\n#define TOTAL_SAMPLES 128;\n\nuniform sampler2D sourceTexture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform sampler2D gBufferTexture3;\nuniform samplerCube specularCubemap;\nuniform float specularIntensity: 1;\n\nuniform mat4 projection;\nuniform mat4 projectionInv;\nuniform mat4 toViewSpace;\nuniform mat4 toWorldSpace;\n\nuniform float maxRayDistance: 200;\n\nuniform float pixelStride: 16;\nuniform float pixelStrideZCutoff: 50; \nuniform float screenEdgeFadeStart: 0.9; \nuniform float eyeFadeStart : 0.2; uniform float eyeFadeEnd: 0.8; \nuniform float minGlossiness: 0.2; uniform float zThicknessThreshold: 1;\n\nuniform float nearZ;\nuniform vec2 viewportSize : VIEWPORT_SIZE;\n\nuniform float jitterOffset: 0;\n\nvarying vec2 v_Texcoord;\n\n#ifdef DEPTH_DECODE\n@import clay.util.decode_float\n#endif\n\n#ifdef PHYSICALLY_CORRECT\nuniform sampler2D normalDistribution;\nuniform float sampleOffset: 0;\nuniform vec2 normalDistributionSize;\n\nvec3 transformNormal(vec3 H, vec3 N) {\n vec3 upVector = N.y > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvec3 importanceSampleNormalGGX(float i, float roughness, vec3 N) {\n float p = fract((i + sampleOffset) / float(TOTAL_SAMPLES));\n vec3 H = texture2D(normalDistribution,vec2(roughness, p)).rgb;\n return transformNormal(H, N);\n}\nfloat G_Smith(float g, float ndv, float ndl) {\n float roughness = 1.0 - g;\n float k = roughness * roughness / 2.0;\n float G1V = ndv / (ndv * (1.0 - k) + k);\n float G1L = ndl / (ndl * (1.0 - k) + k);\n return G1L * G1V;\n}\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n#endif\n\nfloat fetchDepth(sampler2D depthTexture, vec2 uv)\n{\n vec4 depthTexel = texture2D(depthTexture, uv);\n return depthTexel.r * 2.0 - 1.0;\n}\n\nfloat linearDepth(float depth)\n{\n if (projection[3][3] == 0.0) {\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n }\n else {\n return (depth - projection[3][2]) / projection[2][2];\n }\n}\n\nbool rayIntersectDepth(float rayZNear, float rayZFar, vec2 hitPixel)\n{\n if (rayZFar > rayZNear)\n {\n float t = rayZFar; rayZFar = rayZNear; rayZNear = t;\n }\n float cameraZ = linearDepth(fetchDepth(gBufferTexture2, hitPixel));\n return rayZFar <= cameraZ && rayZNear >= cameraZ - zThicknessThreshold;\n}\n\n\nbool traceScreenSpaceRay(\n vec3 rayOrigin, vec3 rayDir, float jitter,\n out vec2 hitPixel, out vec3 hitPoint, out float iterationCount\n)\n{\n float rayLength = ((rayOrigin.z + rayDir.z * maxRayDistance) > -nearZ)\n ? (-nearZ - rayOrigin.z) / rayDir.z : maxRayDistance;\n\n vec3 rayEnd = rayOrigin + rayDir * rayLength;\n\n vec4 H0 = projection * vec4(rayOrigin, 1.0);\n vec4 H1 = projection * vec4(rayEnd, 1.0);\n\n float k0 = 1.0 / H0.w, k1 = 1.0 / H1.w;\n\n vec3 Q0 = rayOrigin * k0, Q1 = rayEnd * k1;\n\n vec2 P0 = (H0.xy * k0 * 0.5 + 0.5) * viewportSize;\n vec2 P1 = (H1.xy * k1 * 0.5 + 0.5) * viewportSize;\n\n P1 += dot(P1 - P0, P1 - P0) < 0.0001 ? 0.01 : 0.0;\n vec2 delta = P1 - P0;\n\n bool permute = false;\n if (abs(delta.x) < abs(delta.y)) {\n permute = true;\n delta = delta.yx;\n P0 = P0.yx;\n P1 = P1.yx;\n }\n float stepDir = sign(delta.x);\n float invdx = stepDir / delta.x;\n\n vec3 dQ = (Q1 - Q0) * invdx;\n float dk = (k1 - k0) * invdx;\n\n vec2 dP = vec2(stepDir, delta.y * invdx);\n\n float strideScaler = 1.0 - min(1.0, -rayOrigin.z / pixelStrideZCutoff);\n float pixStride = 1.0 + strideScaler * pixelStride;\n\n dP *= pixStride; dQ *= pixStride; dk *= pixStride;\n\n vec4 pqk = vec4(P0, Q0.z, k0);\n vec4 dPQK = vec4(dP, dQ.z, dk);\n\n pqk += dPQK * jitter;\n float rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n float rayZNear;\n\n bool intersect = false;\n\n vec2 texelSize = 1.0 / viewportSize;\n\n iterationCount = 0.0;\n\n for (int i = 0; i < MAX_ITERATION; i++)\n {\n pqk += dPQK;\n\n rayZNear = rayZFar;\n rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n\n hitPixel = permute ? pqk.yx : pqk.xy;\n hitPixel *= texelSize;\n\n intersect = rayIntersectDepth(rayZNear, rayZFar, hitPixel);\n\n iterationCount += 1.0;\n\n dPQK *= 1.2;\n\n if (intersect) {\n break;\n }\n }\n\n Q0.xy += dQ.xy * iterationCount;\n Q0.z = pqk.z;\n hitPoint = Q0 / pqk.w;\n\n return intersect;\n}\n\nfloat calculateAlpha(\n float iterationCount, float reflectivity,\n vec2 hitPixel, vec3 hitPoint, float dist, vec3 rayDir\n)\n{\n float alpha = clamp(reflectivity, 0.0, 1.0);\n alpha *= 1.0 - (iterationCount / float(MAX_ITERATION));\n vec2 hitPixelNDC = hitPixel * 2.0 - 1.0;\n float maxDimension = min(1.0, max(abs(hitPixelNDC.x), abs(hitPixelNDC.y)));\n alpha *= 1.0 - max(0.0, maxDimension - screenEdgeFadeStart) / (1.0 - screenEdgeFadeStart);\n\n float _eyeFadeStart = eyeFadeStart;\n float _eyeFadeEnd = eyeFadeEnd;\n if (_eyeFadeStart > _eyeFadeEnd) {\n float tmp = _eyeFadeEnd;\n _eyeFadeEnd = _eyeFadeStart;\n _eyeFadeStart = tmp;\n }\n\n float eyeDir = clamp(rayDir.z, _eyeFadeStart, _eyeFadeEnd);\n alpha *= 1.0 - (eyeDir - _eyeFadeStart) / (_eyeFadeEnd - _eyeFadeStart);\n\n alpha *= 1.0 - clamp(dist / maxRayDistance, 0.0, 1.0);\n\n return alpha;\n}\n\n@import clay.util.rand\n\n@import clay.util.rgbm\n\nvoid main()\n{\n vec4 normalAndGloss = texture2D(gBufferTexture1, v_Texcoord);\n\n if (dot(normalAndGloss.rgb, vec3(1.0)) == 0.0) {\n discard;\n }\n\n float g = normalAndGloss.a;\n#if !defined(PHYSICALLY_CORRECT)\n if (g <= minGlossiness) {\n discard;\n }\n#endif\n\n float reflectivity = (g - minGlossiness) / (1.0 - minGlossiness);\n\n vec3 N = normalize(normalAndGloss.rgb * 2.0 - 1.0);\n N = normalize((toViewSpace * vec4(N, 0.0)).xyz);\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, fetchDepth(gBufferTexture2, v_Texcoord), 1.0);\n vec4 pos = projectionInv * projectedPos;\n vec3 rayOrigin = pos.xyz / pos.w;\n vec3 V = -normalize(rayOrigin);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n float iterationCount;\n float jitter = rand(fract(v_Texcoord + jitterOffset));\n\n#ifdef PHYSICALLY_CORRECT\n vec4 color = vec4(vec3(0.0), 1.0);\n vec4 albedoMetalness = texture2D(gBufferTexture3, v_Texcoord);\n vec3 albedo = albedoMetalness.rgb;\n float m = albedoMetalness.a;\n vec3 diffuseColor = albedo * (1.0 - m);\n vec3 spec = mix(vec3(0.04), albedo, m);\n\n float jitter2 = rand(fract(v_Texcoord)) * float(TOTAL_SAMPLES);\n\n for (int i = 0; i < SAMPLE_PER_FRAME; i++) {\n vec3 H = importanceSampleNormalGGX(float(i) + jitter2, 1.0 - g, N);\n vec3 rayDir = normalize(reflect(-V, H));\n#else\n vec3 rayDir = normalize(reflect(-V, N));\n#endif\n vec2 hitPixel;\n vec3 hitPoint;\n\n bool intersect = traceScreenSpaceRay(rayOrigin, rayDir, jitter, hitPixel, hitPoint, iterationCount);\n\n float dist = distance(rayOrigin, hitPoint);\n\n vec3 hitNormal = texture2D(gBufferTexture1, hitPixel).rgb * 2.0 - 1.0;\n hitNormal = normalize((toViewSpace * vec4(hitNormal, 0.0)).xyz);\n#ifdef PHYSICALLY_CORRECT\n float ndl = clamp(dot(N, rayDir), 0.0, 1.0);\n float vdh = clamp(dot(V, H), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n vec3 litTexel = vec3(0.0);\n if (dot(hitNormal, rayDir) < 0.0 && intersect) {\n litTexel = texture2D(sourceTexture, hitPixel).rgb;\n litTexel *= pow(clamp(1.0 - dist / 200.0, 0.0, 1.0), 3.0);\n\n }\n else {\n #ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n litTexel = RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, 0.0), 8.12).rgb * specularIntensity;\n#endif\n }\n color.rgb += ndl * litTexel * (\n F_Schlick(ndl, spec) * G_Smith(g, ndv, ndl) * vdh / (ndh * ndv + 0.001)\n );\n }\n color.rgb /= float(SAMPLE_PER_FRAME);\n#else\n #if !defined(SPECULARCUBEMAP_ENABLED)\n if (dot(hitNormal, rayDir) >= 0.0) {\n discard;\n }\n if (!intersect) {\n discard;\n }\n#endif\n float alpha = clamp(calculateAlpha(iterationCount, reflectivity, hitPixel, hitPoint, dist, rayDir), 0.0, 1.0);\n vec4 color = texture2D(sourceTexture, hitPixel);\n color.rgb *= alpha;\n\n#ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n alpha = alpha * (intersect ? 1.0 : 0.0);\n float bias = (1.0 -g) * 5.0;\n color.rgb += (1.0 - alpha)\n * RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, bias), 8.12).rgb\n * specularIntensity;\n#endif\n\n#endif\n\n gl_FragColor = encodeHDR(color);\n}\n@end\n\n@export ecgl.ssr.blur\n\nuniform sampler2D texture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform mat4 projection;\nuniform float depthRange : 0.05;\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\n#ifdef BLEND\n #ifdef SSAOTEX_ENABLED\nuniform sampler2D ssaoTex;\n #endif\nuniform sampler2D sourceTexture;\n#endif\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(gBufferTexture2, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n\n@import clay.util.rgbm\n\n\nvoid main()\n{\n @import clay.compositor.kernel.gaussian_9\n\n vec4 centerNTexel = texture2D(gBufferTexture1, v_Texcoord);\n float g = centerNTexel.a;\n float maxBlurSize = clamp(1.0 - g, 0.0, 1.0) * blurSize;\n#ifdef VERTICAL\n vec2 off = vec2(0.0, maxBlurSize / textureSize.y);\n#else\n vec2 off = vec2(maxBlurSize / textureSize.x, 0.0);\n#endif\n\n vec2 coord = v_Texcoord;\n\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n\n vec3 cN = centerNTexel.rgb * 2.0 - 1.0;\n float cD = getLinearDepth(v_Texcoord);\n for (int i = 0; i < 9; i++) {\n vec2 coord = clamp((float(i) - 4.0) * off + v_Texcoord, vec2(0.0), vec2(1.0));\n float w = gaussianKernel[i]\n * clamp(dot(cN, texture2D(gBufferTexture1, coord).rgb * 2.0 - 1.0), 0.0, 1.0);\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(cD - d) / depthRange, 0.0, 1.0));\n\n weightAll += w;\n sum += decodeHDR(texture2D(texture, coord)) * w;\n }\n\n#ifdef BLEND\n float aoFactor = 1.0;\n #ifdef SSAOTEX_ENABLED\n aoFactor = texture2D(ssaoTex, v_Texcoord).r;\n #endif\n gl_FragColor = encodeHDR(\n sum / weightAll * aoFactor + decodeHDR(texture2D(sourceTexture, v_Texcoord))\n );\n#else\n gl_FragColor = encodeHDR(sum / weightAll);\n#endif\n}\n\n@end"),S0.prototype.setAmbientCubemap=function(e,t){this._ssrPass.material.set("specularCubemap",e),this._ssrPass.material.set("specularIntensity",t);var n=e&&t;this._ssrPass.material[n?"enableTexture":"disableTexture"]("specularCubemap")},S0.prototype.update=function(e,t,n,r){var i=e.getWidth(),o=e.getHeight(),a=this._ssrTexture,s=this._texture2,l=this._texture3;a.width=this._prevTexture.width=this._currentTexture.width=i/this._downScale,a.height=this._prevTexture.height=this._currentTexture.height=o/this._downScale,s.width=l.width=i,s.height=l.height=o;var u=this._frameBuffer,c=this._ssrPass,h=this._blurPass1,d=this._blurPass2,p=this._blendPass,f=new aK,g=new aK;aK.transpose(f,t.worldTransform),aK.transpose(g,t.viewMatrix),c.setUniform("sourceTexture",n),c.setUniform("projection",t.projectionMatrix.array),c.setUniform("projectionInv",t.invProjectionMatrix.array),c.setUniform("toViewSpace",f.array),c.setUniform("toWorldSpace",g.array),c.setUniform("nearZ",t.near);var m=r/this._totalSamples*this._samplePerFrame;if(c.setUniform("jitterOffset",m),c.setUniform("sampleOffset",r*this._samplePerFrame),h.setUniform("textureSize",[a.width,a.height]),d.setUniform("textureSize",[i,o]),d.setUniform("sourceTexture",n),h.setUniform("projection",t.projectionMatrix.array),d.setUniform("projection",t.projectionMatrix.array),u.attach(a),u.bind(e),c.render(e),this._physicallyCorrect&&(u.attach(this._currentTexture),p.setUniform("texture1",this._prevTexture),p.setUniform("texture2",a),p.material.set({weight1:r>=1?.95:0,weight2:r>=1?.05:1}),p.render(e)),u.attach(s),h.setUniform("texture",this._physicallyCorrect?this._currentTexture:a),h.render(e),u.attach(l),d.setUniform("texture",s),d.render(e),u.unbind(e),this._physicallyCorrect){var v=this._prevTexture;this._prevTexture=this._currentTexture,this._currentTexture=v}},S0.prototype.getTargetTexture=function(){return this._texture3},S0.prototype.setParameter=function(e,t){"maxIteration"===e?this._ssrPass.material.define("fragment","MAX_ITERATION",t):this._ssrPass.setUniform(e,t)},S0.prototype.setPhysicallyCorrect=function(e){e?(this._normalDistribution||(this._normalDistribution=hJ.generateNormalDistribution(64,this._totalSamples)),this._ssrPass.material.define("fragment","PHYSICALLY_CORRECT"),this._ssrPass.material.set("normalDistribution",this._normalDistribution),this._ssrPass.material.set("normalDistributionSize",[64,this._totalSamples])):this._ssrPass.material.undefine("fragment","PHYSICALLY_CORRECT"),this._physicallyCorrect=e},S0.prototype.setSSAOTexture=function(e){var t=this._blurPass2;e?(t.material.enableTexture("ssaoTex"),t.material.set("ssaoTex",e)):t.material.disableTexture("ssaoTex")},S0.prototype.isFinished=function(e){return!this._physicallyCorrect||e>this._totalSamples/this._samplePerFrame},S0.prototype.dispose=function(e){this._ssrTexture.dispose(e),this._texture2.dispose(e),this._texture3.dispose(e),this._prevTexture.dispose(e),this._currentTexture.dispose(e),this._frameBuffer.dispose(e)};var T0=[0,0,-.321585265978,-.154972575841,.458126042375,.188473391593,.842080129861,.527766490688,.147304551086,-.659453822776,-.331943915203,-.940619700594,.0479226680259,.54812163202,.701581552186,-.709825561388,-.295436780218,.940589268233,-.901489676764,.237713156085,.973570876096,-.109899459384,-.866792314779,-.451805525005,.330975007087,.800048655954,-.344275183665,.381779221166,-.386139432542,-.437418421534,-.576478634965,-.0148463392551,.385798197415,-.262426961053,-.666302061145,.682427250835,-.628010632582,-.732836215494,.10163141741,-.987658134403,.711995289051,-.320024291314,.0296005138058,.950296523438,.0130612307608,-.351024443122,-.879596633704,-.10478487883,.435712737232,.504254490347,.779203817497,.206477676721,.388264289969,-.896736162545,-.153106280781,-.629203242522,-.245517550697,.657969239148,.126830499058,.26862328493,-.634888119007,-.302301223431,.617074219636,.779817204925];function M0(e,t,n,r,i){var o=e.gl;t.setUniform(o,"1i",n,i),o.activeTexture(o.TEXTURE0+i),r.isRenderable()?r.bind(e):r.unbind(e)}function C0(e,t,n,r,i){var o,a,s,l,u=e.gl;return function(i,c,h){if(!l||l.material!==i.material){var d=i.material,p=i.__program,f=d.get("roughness");null==f&&(f=1);var g=d.get("normalMap")||t,m=d.get("roughnessMap"),v=d.get("bumpMap"),y=d.get("uvRepeat"),_=d.get("uvOffset"),x=d.get("detailUvRepeat"),b=d.get("detailUvOffset"),w=!!v&&d.isTextureEnabled("bumpMap"),S=!!m&&d.isTextureEnabled("roughnessMap"),T=d.isDefined("fragment","DOUBLE_SIDED");v=v||n,m=m||r,h!==c?(c.set("normalMap",g),c.set("bumpMap",v),c.set("roughnessMap",m),c.set("useBumpMap",w),c.set("useRoughnessMap",S),c.set("doubleSide",T),null!=y&&c.set("uvRepeat",y),null!=_&&c.set("uvOffset",_),null!=x&&c.set("detailUvRepeat",x),null!=b&&c.set("detailUvOffset",b),c.set("roughness",f)):(p.setUniform(u,"1f","roughness",f),o!==g&&M0(e,p,"normalMap",g,0),a!==v&&v&&M0(e,p,"bumpMap",v,1),s!==m&&m&&M0(e,p,"roughnessMap",m,2),null!=y&&p.setUniform(u,"2f","uvRepeat",y),null!=_&&p.setUniform(u,"2f","uvOffset",_),null!=x&&p.setUniform(u,"2f","detailUvRepeat",x),null!=b&&p.setUniform(u,"2f","detailUvOffset",b),p.setUniform(u,"1i","useBumpMap",+w),p.setUniform(u,"1i","useRoughnessMap",+S),p.setUniform(u,"1i","doubleSide",+T)),o=g,a=v,s=m,l=i}}}function D0(e){this._depthTex=new RK({format:EK.DEPTH_COMPONENT,type:EK.UNSIGNED_INT}),this._normalTex=new RK({type:EK.HALF_FLOAT}),this._framebuffer=new V$,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,V$.DEPTH_ATTACHMENT),this._normalMaterial=new jZ({shader:new wq(wq.source("ecgl.normal.vertex"),wq.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=nJ.createBlank("#000"),this._defaultBumpMap=nJ.createBlank("#000"),this._defaultRoughessMap=nJ.createBlank("#000"),this._debugPass=new cJ({fragment:wq.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}function A0(e){e=e||{},this._edgePass=new cJ({fragment:wq.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",e.normalTexture),this._edgePass.setUniform("depthTexture",e.depthTexture),this._targetTexture=new RK({type:EK.HALF_FLOAT}),this._frameBuffer=new V$,this._frameBuffer.attach(this._targetTexture)}wq.import("@export ecgl.normal.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\n@import ecgl.common.normalMap.vertexHeader\n\n@import ecgl.common.vertexAnimation.header\n\nvoid main()\n{\n\n @import ecgl.common.vertexAnimation.main\n\n @import ecgl.common.uv.main\n\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n @import ecgl.common.normalMap.vertexMain\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n}\n\n\n@end\n\n\n@export ecgl.normal.fragment\n\n#define ROUGHNESS_CHANEL 0\n\nuniform bool useBumpMap;\nuniform bool useRoughnessMap;\nuniform bool doubleSide;\nuniform float roughness;\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n@import ecgl.common.normalMap.fragmentHeader\n@import ecgl.common.bumpMap.header\n\nuniform sampler2D roughnessMap;\n\nvoid main()\n{\n vec3 N = v_Normal;\n \n bool flipNormal = false;\n if (doubleSide) {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n flipNormal = true;\n }\n }\n\n @import ecgl.common.normalMap.fragmentMain\n\n if (useBumpMap) {\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n }\n\n float g = 1.0 - roughness;\n\n if (useRoughnessMap) {\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n }\n\n if (flipNormal) {\n N = -N;\n }\n\n gl_FragColor.rgb = (N.xyz + 1.0) * 0.5;\n gl_FragColor.a = g;\n}\n@end"),D0.prototype.getDepthTexture=function(){return this._depthTex},D0.prototype.getNormalTexture=function(){return this._normalTex},D0.prototype.update=function(e,t,n){var r=e.getWidth(),i=e.getHeight(),o=this._depthTex,a=this._normalTex,s=this._normalMaterial;o.width=r,o.height=i,a.width=r,a.height=i;var l=t.getRenderList(n).opaque;this._framebuffer.bind(e),e.gl.clearColor(0,0,0,0),e.gl.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.gl.disable(e.gl.BLEND),e.renderPass(l,n,{getMaterial:function(){return s},ifRender:function(e){return e.renderNormal},beforeRender:C0(e,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:e.opaqueSortCompare}),this._framebuffer.unbind(e)},D0.prototype.renderDebug=function(e){this._debugPass.render(e)},D0.prototype.dispose=function(e){this._depthTex.dispose(e),this._normalTex.dispose(e)},A0.prototype.update=function(e,t,n,r){var i=e.getWidth(),o=e.getHeight(),a=this._targetTexture;a.width=i,a.height=o;var s=this._frameBuffer;s.bind(e),this._edgePass.setUniform("projectionInv",t.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[i,o]),this._edgePass.setUniform("texture",n),this._edgePass.render(e),s.unbind(e)},A0.prototype.getTargetTexture=function(){return this._targetTexture},A0.prototype.setParameter=function(e,t){this._edgePass.setUniform(e,t)},A0.prototype.dispose=function(e){this._targetTexture.dispose(e),this._frameBuffer.dispose(e)};var I0={type:"compositor",nodes:[{name:"source",type:"texture",outputs:{color:{}}},{name:"source_half",shader:"#source(clay.compositor.downsample)",inputs:{texture:"source"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bright",shader:"#source(clay.compositor.bright)",inputs:{texture:"source_half"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{threshold:2,scale:4,textureSize:"expr([width * 1.0 / 2, height / 2])"}},{name:"bright_downsample_4",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 2, height / 2] )"}},{name:"bright_downsample_8",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 4, height / 4] )"}},{name:"bright_downsample_16",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 8, height / 8] )"}},{name:"bright_downsample_32",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 32)",height:"expr(height * 1.0 / 32)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 16, height / 16] )"}},{name:"bright_upsample_16_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_32"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 32, height / 32] )"}},{name:"bright_upsample_16_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_16_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_8_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_8_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_8_blur_v",texture2:"bright_upsample_16_blur_v"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_4_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_4_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_4_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_4_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_4_blur_v",texture2:"bright_upsample_8_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_2_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_2_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_2_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_2_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_2_blur_v",texture2:"bright_upsample_4_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_full_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_full_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_full_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bloom_composite",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_full_blur_v",texture2:"bright_upsample_2_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"coc",shader:"#source(ecgl.dof.coc)",outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{focalDist:50,focalRange:30}},{name:"dof_far_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"dof_near_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_NEARFIELD:null}},{name:"dof_coc_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"coc"},outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_COC:null}},{name:"dof_composite",shader:"#source(ecgl.dof.composite)",inputs:{original:"source",blurred:"dof_far_blur",nearfield:"dof_near_blur",coc:"coc",nearcoc:"dof_coc_blur"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}}},{name:"composite",shader:"#source(clay.compositor.hdr.composite)",inputs:{texture:"source",bloom:"bloom_composite"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},defines:{}},{name:"FXAA",shader:"#source(clay.compositor.fxaa)",inputs:{texture:"composite"}}]};function E0(e,t){return{color:{parameters:{width:e,height:t}}}}wq.import(t0),wq.import(n0),wq.import(r0),wq.import(i0),wq.import(o0),wq.import(a0),wq.import(s0),wq.import(l0),wq.import(u0),wq.import("@export ecgl.dof.coc\n\nuniform sampler2D depth;\n\nuniform float zNear: 0.1;\nuniform float zFar: 2000;\n\nuniform float focalDistance: 3;\nuniform float focalRange: 1;\nuniform float focalLength: 30;\nuniform float fstop: 2.8;\n\nvarying vec2 v_Texcoord;\n\n@import clay.util.encode_float\n\nvoid main()\n{\n float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;\n\n float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));\n\n float aperture = focalLength / fstop;\n\n float coc;\n\n float uppper = focalDistance + focalRange;\n float lower = focalDistance - focalRange;\n if (dist <= uppper && dist >= lower) {\n coc = 0.5;\n }\n else {\n float focalAdjusted = dist > uppper ? uppper : lower;\n\n coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));\n coc = clamp(coc, 0.0, 2.0) / 2.00001;\n\n if (dist < lower) {\n coc = -coc;\n }\n coc = coc * 0.5 + 0.5;\n }\n\n gl_FragColor = encodeFloat(coc);\n}\n@end\n\n\n@export ecgl.dof.composite\n\n#define DEBUG 0\n\nuniform sampler2D original;\nuniform sampler2D blurred;\nuniform sampler2D nearfield;\nuniform sampler2D coc;\nuniform sampler2D nearcoc;\nvarying vec2 v_Texcoord;\n\n@import clay.util.rgbm\n@import clay.util.float\n\nvoid main()\n{\n vec4 blurredColor = texture2D(blurred, v_Texcoord);\n vec4 originalColor = texture2D(original, v_Texcoord);\n\n float fCoc = decodeFloat(texture2D(coc, v_Texcoord));\n\n fCoc = abs(fCoc * 2.0 - 1.0);\n\n float weight = smoothstep(0.0, 1.0, fCoc);\n \n#ifdef NEARFIELD_ENABLED\n vec4 nearfieldColor = texture2D(nearfield, v_Texcoord);\n float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));\n fNearCoc = abs(fNearCoc * 2.0 - 1.0);\n\n gl_FragColor = encodeHDR(\n mix(\n nearfieldColor, mix(originalColor, blurredColor, weight),\n pow(1.0 - fNearCoc, 4.0)\n )\n );\n#else\n gl_FragColor = encodeHDR(mix(originalColor, blurredColor, weight));\n#endif\n\n}\n\n@end\n\n\n\n@export ecgl.dof.diskBlur\n\n#define POISSON_KERNEL_SIZE 16;\n\nuniform sampler2D texture;\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\n\nuniform float blurRadius : 10.0;\nuniform vec2 textureSize : [512.0, 512.0];\n\nuniform vec2 poissonKernel[POISSON_KERNEL_SIZE];\n\nuniform float percent;\n\nfloat nrand(const in vec2 n) {\n return fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n@import clay.util.rgbm\n@import clay.util.float\n\n\nvoid main()\n{\n vec2 offset = blurRadius / textureSize;\n\n float rnd = 6.28318 * nrand(v_Texcoord + 0.07 * percent );\n float cosa = cos(rnd);\n float sina = sin(rnd);\n vec4 basis = vec4(cosa, -sina, sina, cosa);\n\n#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)\n offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);\n#endif\n\n#ifdef BLUR_COC\n float cocSum = 0.0;\n#else\n vec4 color = vec4(0.0);\n#endif\n\n\n float weightSum = 0.0;\n\n for (int i = 0; i < POISSON_KERNEL_SIZE; i++) {\n vec2 ofs = poissonKernel[i];\n\n ofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));\n\n vec2 uv = v_Texcoord + ofs * offset;\n vec4 texel = texture2D(texture, uv);\n\n float w = 1.0;\n#ifdef BLUR_COC\n float fCoc = decodeFloat(texel) * 2.0 - 1.0;\n cocSum += clamp(fCoc, -1.0, 0.0) * w;\n#else\n texel = texel;\n #if !defined(BLUR_NEARFIELD)\n float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;\n w *= abs(fCoc);\n #endif\n texel.rgb *= texel.a;\n color += texel * w;\n#endif\n\n weightSum += w;\n }\n\n#ifdef BLUR_COC\n gl_FragColor = encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);\n#else\n color /= weightSum;\n color.rgb /= (color.a + 0.0001);\n gl_FragColor = color;\n#endif\n}\n\n@end"),wq.import("@export ecgl.edge\n\nuniform sampler2D texture;\n\nuniform sampler2D normalTexture;\nuniform sampler2D depthTexture;\n\nuniform mat4 projectionInv;\n\nuniform vec2 textureSize;\n\nuniform vec4 edgeColor: [0,0,0,0.8];\n\nvarying vec2 v_Texcoord;\n\nvec3 packColor(vec2 coord) {\n float z = texture2D(depthTexture, coord).r * 2.0 - 1.0;\n vec4 p = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * p;\n\n return vec3(\n texture2D(normalTexture, coord).rg,\n -p4.z / p4.w / 5.0\n );\n}\n\nvoid main() {\n vec2 cc = v_Texcoord;\n vec3 center = packColor(cc);\n\n float size = clamp(1.0 - (center.z - 10.0) / 100.0, 0.0, 1.0) * 0.5;\n float dx = size / textureSize.x;\n float dy = size / textureSize.y;\n\n vec2 coord;\n vec3 topLeft = packColor(cc+vec2(-dx, -dy));\n vec3 top = packColor(cc+vec2(0.0, -dy));\n vec3 topRight = packColor(cc+vec2(dx, -dy));\n vec3 left = packColor(cc+vec2(-dx, 0.0));\n vec3 right = packColor(cc+vec2(dx, 0.0));\n vec3 bottomLeft = packColor(cc+vec2(-dx, dy));\n vec3 bottom = packColor(cc+vec2(0.0, dy));\n vec3 bottomRight = packColor(cc+vec2(dx, dy));\n\n vec3 v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;\n vec3 h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;\n\n float edge = sqrt(dot(h, h) + dot(v, v));\n\n edge = smoothstep(0.8, 1.0, edge);\n\n gl_FragColor = mix(texture2D(texture, v_Texcoord), vec4(edgeColor.rgb, 1.0), edgeColor.a * edge);\n}\n@end");var L0=["composite","FXAA"];function N0(){this._width,this._height,this._dpr,this._sourceTexture=new RK({type:EK.HALF_FLOAT}),this._depthTexture=new RK({format:EK.DEPTH_COMPONENT,type:EK.UNSIGNED_INT}),this._framebuffer=new V$,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,V$.DEPTH_ATTACHMENT),this._normalPass=new D0,this._compositor=h0(I0);var e=this._compositor.getNodeByName("source");e.texture=this._sourceTexture;var t=this._compositor.getNodeByName("coc");this._sourceNode=e,this._cocNode=t,this._compositeNode=this._compositor.getNodeByName("composite"),this._fxaaNode=this._compositor.getNodeByName("FXAA"),this._dofBlurNodes=["dof_far_blur","dof_near_blur","dof_coc_blur"].map((function(e){return this._compositor.getNodeByName(e)}),this),this._dofBlurKernel=0,this._dofBlurKernelSize=new Float32Array(0),this._finalNodesChain=L0.map((function(e){return this._compositor.getNodeByName(e)}),this);var n={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new w0(n),this._ssrPass=new S0(n),this._edgePass=new A0(n)}function P0(e){for(var t=[],n=0;n<30;n++)t.push([y0(n,2),y0(n,3)]);this._haltonSequence=t,this._frame=0,this._sourceTex=new RK,this._sourceFb=new V$,this._sourceFb.attach(this._sourceTex),this._prevFrameTex=new RK,this._outputTex=new RK;var r=this._blendPass=new cJ({fragment:wq.source("clay.compositor.blend")});r.material.disableTexturesAll(),r.material.enableTexture(["texture1","texture2"]),this._blendFb=new V$({depthBuffer:!1}),this._outputPass=new cJ({fragment:wq.source("clay.compositor.output"),blendWithPrevious:!0}),this._outputPass.material.define("fragment","OUTPUT_ALPHA"),this._outputPass.material.blend=function(e){e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)}}function O0(e){e=e||"perspective",this.layer=null,this.scene=new b$,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(e),this._compositor=new N0,this._temporalSS=new P0,this._shadowMapPass=new ZQ;for(var t=[],n=0,r=0;r<30;r++){for(var i=[],o=0;o<6;o++)i.push(4*y0(n,2)-2),i.push(4*y0(n,3)-2),n++;t.push(i)}this._pcfKernels=t,this.scene.on("beforerender",(function(e,t,n){this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,n)}),this)}N0.prototype.resize=function(e,t,n){e*=n=n||1,t*=n;var r=this._sourceTexture,i=this._depthTexture;r.width=e,r.height=t,i.width=e,i.height=t;var o={getWidth:function(){return e},getHeight:function(){return t},getDevicePixelRatio:function(){return n}};function a(e,t){if("function"==typeof e[t]){var n=e[t].__original||e[t];e[t]=function(e){return n.call(this,o)},e[t].__original=n}}this._compositor.nodes.forEach((function(e){for(var t in e.outputs){var n=e.outputs[t].parameters;n&&(a(n,"width"),a(n,"height"))}for(var r in e.parameters)a(e.parameters,r)})),this._width=e,this._height=t,this._dpr=n},N0.prototype.getWidth=function(){return this._width},N0.prototype.getHeight=function(){return this._height},N0.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR},N0.prototype._getPrevNode=function(e){for(var t=L0.indexOf(e.name)-1,n=this._finalNodesChain[t];n&&!this._compositor.getNodeByName(n.name);)t-=1,n=this._finalNodesChain[t];return n},N0.prototype._getNextNode=function(e){for(var t=L0.indexOf(e.name)+1,n=this._finalNodesChain[t];n&&!this._compositor.getNodeByName(n.name);)t+=1,n=this._finalNodesChain[t];return n},N0.prototype._addChainNode=function(e){var t=this._getPrevNode(e),n=this._getNextNode(e);t&&(e.inputs.texture=t.name,n?(e.outputs=E0(this.getWidth.bind(this),this.getHeight.bind(this)),n.inputs.texture=e.name):e.outputs=null,this._compositor.addNode(e))},N0.prototype._removeChainNode=function(e){var t=this._getPrevNode(e),n=this._getNextNode(e);t&&(n?(t.outputs=E0(this.getWidth.bind(this),this.getHeight.bind(this)),n.inputs.texture=t.name):t.outputs=null,this._compositor.removeNode(e))},N0.prototype.updateNormal=function(e,t,n,r){this._ifRenderNormalPass()&&this._normalPass.update(e,t,n)},N0.prototype.updateSSAO=function(e,t,n,r){this._ssaoPass.update(e,n,r)},N0.prototype.enableSSAO=function(){this._enableSSAO=!0},N0.prototype.disableSSAO=function(){this._enableSSAO=!1},N0.prototype.enableSSR=function(){this._enableSSR=!0},N0.prototype.disableSSR=function(){this._enableSSR=!1},N0.prototype.getSSAOTexture=function(){return this._ssaoPass.getTargetTexture()},N0.prototype.getSourceFrameBuffer=function(){return this._framebuffer},N0.prototype.getSourceTexture=function(){return this._sourceTexture},N0.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)},N0.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)},N0.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()},N0.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()},N0.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()},N0.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()},N0.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0},N0.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1},N0.prototype.enableEdge=function(){this._enableEdge=!0},N0.prototype.disableEdge=function(){this._enableEdge=!1},N0.prototype.setBloomIntensity=function(e){this._compositeNode.setParameter("bloomIntensity",e)},N0.prototype.setSSAOParameter=function(e,t){switch(e){case"quality":var n={low:6,medium:12,high:32,ultra:62}[t]||12;this._ssaoPass.setParameter("kernelSize",n);break;case"radius":this._ssaoPass.setParameter(e,t),this._ssaoPass.setParameter("bias",t/200);break;case"intensity":this._ssaoPass.setParameter(e,t);break;default:"production"!==process.env.NODE_ENV&&console.warn("Unkown SSAO parameter "+e)}},N0.prototype.setDOFParameter=function(e,t){switch(e){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(e,t);break;case"blurRadius":for(var n=0;n<this._dofBlurNodes.length;n++)this._dofBlurNodes[n].setParameter("blurRadius",t);break;case"quality":var r={low:4,medium:8,high:16,ultra:32}[t]||8;this._dofBlurKernelSize=r;for(n=0;n<this._dofBlurNodes.length;n++)this._dofBlurNodes[n].pass.material.define("POISSON_KERNEL_SIZE",r);this._dofBlurKernel=new Float32Array(2*r);break;default:"production"!==process.env.NODE_ENV&&console.warn("Unkown DOF parameter "+e)}},N0.prototype.setSSRParameter=function(e,t){if(null!=t)switch(e){case"quality":var n={low:10,medium:15,high:30,ultra:80}[t]||20,r={low:32,medium:16,high:8,ultra:4}[t]||16;this._ssrPass.setParameter("maxIteration",n),this._ssrPass.setParameter("pixelStride",r);break;case"maxRoughness":this._ssrPass.setParameter("minGlossiness",Math.max(Math.min(1-t,1),0));break;case"physical":this.setPhysicallyCorrectSSR(t);break;default:console.warn("Unkown SSR parameter "+e)}},N0.prototype.setPhysicallyCorrectSSR=function(e){this._ssrPass.setPhysicallyCorrect(e)},N0.prototype.setEdgeColor=function(e){var t=BJ.parseColor(e);this._edgePass.setParameter("edgeColor",t)},N0.prototype.setExposure=function(e){this._compositeNode.setParameter("exposure",Math.pow(2,e))},N0.prototype.setColorLookupTexture=function(e,t){this._compositeNode.pass.material.setTextureImage("lut",this._enableColorCorrection?e:"none",t,{minFilter:BJ.Texture.NEAREST,magFilter:BJ.Texture.NEAREST,flipY:!1})},N0.prototype.setColorCorrection=function(e,t){this._compositeNode.setParameter(e,t)},N0.prototype.isSSREnabled=function(){return this._enableSSR},N0.prototype.composite=function(e,t,n,r,i){var o=this._sourceTexture,a=o;this._enableEdge&&(this._edgePass.update(e,n,o,i),o=a=this._edgePass.getTargetTexture()),this._enableSSR&&(this._ssrPass.update(e,n,o,i),a=this._ssrPass.getTargetTexture(),this._ssrPass.setSSAOTexture(this._enableSSAO?this._ssaoPass.getTargetTexture():null)),this._sourceNode.texture=a,this._cocNode.setParameter("depth",this._depthTexture);for(var s=this._dofBlurKernel,l=this._dofBlurKernelSize,u=i%Math.floor(T0.length/2/l),c=0;c<2*l;c++)s[c]=T0[c+u*l*2];for(c=0;c<this._dofBlurNodes.length;c++)this._dofBlurNodes[c].setParameter("percent",i/30),this._dofBlurNodes[c].setParameter("poissonKernel",s);this._cocNode.setParameter("zNear",n.near),this._cocNode.setParameter("zFar",n.far),this._compositor.render(e,r)},N0.prototype.dispose=function(e){this._sourceTexture.dispose(e),this._depthTexture.dispose(e),this._framebuffer.dispose(e),this._compositor.dispose(e),this._normalPass.dispose(e),this._ssaoPass.dispose(e)},P0.prototype={constructor:P0,jitterProjection:function(e,t){var n=e.viewport,r=n.devicePixelRatio||e.getDevicePixelRatio(),i=n.width*r,o=n.height*r,a=this._haltonSequence[this._frame%this._haltonSequence.length],s=new aK;s.array[12]=(2*a[0]-1)/i,s.array[13]=(2*a[1]-1)/o,aK.mul(t.projectionMatrix,s,t.projectionMatrix),aK.invert(t.invProjectionMatrix,t.projectionMatrix)},resetFrame:function(){this._frame=0},getFrame:function(){return this._frame},getSourceFrameBuffer:function(){return this._sourceFb},getOutputTexture:function(){return this._outputTex},resize:function(e,t){this._prevFrameTex.width=e,this._prevFrameTex.height=t,this._outputTex.width=e,this._outputTex.height=t,this._sourceTex.width=e,this._sourceTex.height=t,this._prevFrameTex.dirty(),this._outputTex.dirty(),this._sourceTex.dirty()},isFinished:function(){return this._frame>=this._haltonSequence.length},render:function(e,t,n){var r=this._blendPass;0===this._frame?(r.setUniform("weight1",0),r.setUniform("weight2",1)):(r.setUniform("weight1",.9),r.setUniform("weight2",.1)),r.setUniform("texture1",this._prevFrameTex),r.setUniform("texture2",t||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(e),r.render(e),this._blendFb.unbind(e),n||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(e));var i=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=i,this._frame++},dispose:function(e){this._sourceFb.dispose(e),this._blendFb.dispose(e),this._prevFrameTex.dispose(e),this._outputTex.dispose(e),this._sourceTex.dispose(e),this._outputPass.dispose(e),this._blendPass.dispose(e)}},O0.prototype.setProjection=function(e){var t=this.camera;t&&t.update(),"perspective"===e?this.camera instanceof D$||(this.camera=new D$,t&&this.camera.setLocalTransform(t.localTransform)):this.camera instanceof aJ||(this.camera=new aJ,t&&this.camera.setLocalTransform(t.localTransform)),this.camera.near=.1,this.camera.far=2e3},O0.prototype.setViewport=function(e,t,n,r,i){this.camera instanceof D$&&(this.camera.aspect=n/r),i=i||1,this.viewport.x=e,this.viewport.y=t,this.viewport.width=n,this.viewport.height=r,this.viewport.devicePixelRatio=i,this._compositor.resize(n*i,r*i),this._temporalSS.resize(n*i,r*i)},O0.prototype.containPoint=function(e,t){var n=this.viewport;return t=this.layer.renderer.getHeight()-t,e>=n.x&&t>=n.y&&e<=n.x+n.width&&t<=n.y+n.height};var R0=new KZ;function k0(e,t){var n=Zd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()});n.y=t.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,t.getDevicePixelRatio());var r=e.get("boxWidth"),i=e.get("boxHeight"),o=e.get("boxDepth");"production"!==process.env.NODE_ENV&&["x","y","z"].forEach((function(t){if(!this.getAxis(t))throw new Error("Grid"+e.id+" don't have "+t+"Axis")}),this),this.getAxis("x").setExtent(-r/2,r/2),this.getAxis("y").setExtent(o/2,-o/2),this.getAxis("z").setExtent(-i/2,i/2),this.size=[r,i,o]}function z0(e,t){var n={};e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();["x","y","z"].forEach((function(e){t.mapDimensionsAll(e,!0).forEach((function(r){!function(e,t){n[e]=n[e]||[1/0,-1/0],n[e][0]=Math.min(t[0],n[e][0]),n[e][1]=Math.max(t[1],n[e][1])}(e,t.getDataExtent(r,!0))}))}))}}),this),["xAxis3D","yAxis3D","zAxis3D"].forEach((function(t){e.eachComponent(t,(function(e){var r=t.charAt(0),i=e.getReferringComponents("grid3D").models[0],o=i.coordinateSystem;if(o===this){var a=o.getAxis(r);if(a)"production"!==process.env.NODE_ENV&&console.warn("Can't have two %s in one grid3D",t);else{(a=new PQ(r,nb(n[r]||[1/0,-1/0],e))).type=e.get("type");var s="category"===a.type;a.onBand=s&&e.get("boundaryGap"),a.inverse=e.get("inverse"),e.axis=a,a.model=e,a.getLabelModel=function(){return e.getModel("axisLabel",i.getModel("axisLabel"))},a.getTickModel=function(){return e.getModel("axisTick",i.getModel("axisTick"))},o.addAxis(a)}}}),this)}),this),this.resize(this.model,t)}O0.prototype.castRay=function(e,t,n){var r=this.layer.renderer,i=r.viewport;return r.viewport=this.viewport,r.screenToNDC(e,t,R0),this.camera.castRay(R0,n),r.viewport=i,n},O0.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this.scene.updateLights();var e=this.scene.updateRenderList(this.camera);this._needsSortProgressively=!1;for(var t=0;t<e.transparent.length;t++){var n=e.transparent[t].geometry;n.needsSortVerticesProgressively&&n.needsSortVerticesProgressively()&&(this._needsSortProgressively=!0),n.needsSortTrianglesProgressively&&n.needsSortTrianglesProgressively()&&(this._needsSortProgressively=!0)}this._frame=0,this._temporalSS.resetFrame()},O0.prototype.render=function(e,t){this._doRender(e,t,this._frame),this._frame++},O0.prototype.needsAccumulate=function(){return this.needsTemporalSS()||this._needsSortProgressively},O0.prototype.needsTemporalSS=function(){var e=this._enableTemporalSS;return"auto"===e&&(e=this._enablePostEffect),e},O0.prototype.hasDOF=function(){return this._enableDOF},O0.prototype.isAccumulateFinished=function(){return this.needsTemporalSS()?this._temporalSS.isFinished():this._frame>30},O0.prototype._doRender=function(e,t,n){var r=this.scene,i=this.camera;n=n||0,this._updateTransparent(e,r,i,n),t||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(e,r,i,!0)),this._updateShadowPCFKernel(n);var o,a=e.clearColor;(e.gl.clearColor(a[0],a[1],a[2],a[3]),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,i),this._compositor.updateNormal(e,r,i,this._temporalSS.getFrame())),this._updateSSAO(e,r,i,this._temporalSS.getFrame()),this._enablePostEffect)?((o=this._compositor.getSourceFrameBuffer()).bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),e.render(r,i,!0,!0),o.unbind(e),this.needsTemporalSS()&&t?(this._compositor.composite(e,r,i,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),this._compositor.composite(e,r,i,null,0))):this.needsTemporalSS()&&t?((o=this._temporalSS.getSourceFrameBuffer()).bind(e),e.saveClear(),e.clearBit=e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT,e.render(r,i,!0,!0),e.restoreClear(),o.unbind(e),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),e.render(r,i,!0,!0))},O0.prototype._updateTransparent=function(e,t,n,r){for(var i=new Fq,o=new aK,a=n.getWorldPosition(),s=t.getRenderList(n).transparent,l=0;l<s.length;l++){var u=s[l],c=u.geometry;aK.invert(o,u.worldTransform),Fq.transformMat4(i,a,o),c.needsSortTriangles&&c.needsSortTriangles()&&c.doSortTriangles(i,r),c.needsSortVertices&&c.needsSortVertices()&&c.doSortVertices(i,r)}},O0.prototype._updateSSAO=function(e,t,n){var r=this._enableSSAO&&this._enablePostEffect;r&&this._compositor.updateSSAO(e,t,n,this._temporalSS.getFrame());for(var i=t.getRenderList(n),o=0;o<i.opaque.length;o++){var a=i.opaque[o];a.renderNormal&&a.material[r?"enableTexture":"disableTexture"]("ssaoMap"),r&&a.material.set("ssaoMap",this._compositor.getSSAOTexture())}},O0.prototype._updateShadowPCFKernel=function(e){for(var t=this._pcfKernels[e%this._pcfKernels.length],n=this.scene.getRenderList(this.camera).opaque,r=0;r<n.length;r++)n[r].receiveShadow&&(n[r].material.set("pcfKernel",t),n[r].material.define("fragment","PCF_KERNEL_SIZE",t.length/2))},O0.prototype.dispose=function(e){this._compositor.dispose(e.gl),this._temporalSS.dispose(e.gl),this._shadowMapPass.dispose(e)},O0.prototype.setPostEffect=function(e,t){var n=this._compositor;this._enablePostEffect=e.get("enable");var r=e.getModel("bloom"),i=e.getModel("edge"),o=e.getModel("DOF",e.getModel("depthOfField")),a=e.getModel("SSAO",e.getModel("screenSpaceAmbientOcclusion")),s=e.getModel("SSR",e.getModel("screenSpaceReflection")),l=e.getModel("FXAA"),u=e.getModel("colorCorrection");r.get("enable")?n.enableBloom():n.disableBloom(),o.get("enable")?n.enableDOF():n.disableDOF(),s.get("enable")?n.enableSSR():n.disableSSR(),u.get("enable")?n.enableColorCorrection():n.disableColorCorrection(),i.get("enable")?n.enableEdge():n.disableEdge(),l.get("enable")?n.enableFXAA():n.disableFXAA(),this._enableDOF=o.get("enable"),this._enableSSAO=a.get("enable"),this._enableSSAO?n.enableSSAO():n.disableSSAO(),n.setBloomIntensity(r.get("intensity")),n.setEdgeColor(i.get("color")),n.setColorLookupTexture(u.get("lookupTexture"),t),n.setExposure(u.get("exposure")),["radius","quality","intensity"].forEach((function(e){n.setSSAOParameter(e,a.get(e))})),["quality","maxRoughness","physical"].forEach((function(e){n.setSSRParameter(e,s.get(e))})),["quality","focalDistance","focalRange","blurRadius","fstop"].forEach((function(e){n.setDOFParameter(e,o.get(e))})),["brightness","contrast","saturation"].forEach((function(e){n.setColorCorrection(e,u.get(e))}))},O0.prototype.setDOFFocusOnPoint=function(e){if(this._enablePostEffect){if(e>this.camera.far||e<this.camera.near)return;return this._compositor.setDOFParameter("focalDistance",e),!0}},O0.prototype.setTemporalSuperSampling=function(e){this._enableTemporalSS=e.get("enable")},O0.prototype.isLinearSpace=function(){return this._enablePostEffect},O0.prototype.setRootNode=function(e){if(this.rootNode!==e){for(var t=this.rootNode.children(),n=0;n<t.length;n++)e.add(t[n]);e!==this.scene&&this.scene.add(e),this.rootNode=e}},O0.prototype.add=function(e){this.rootNode.add(e)},O0.prototype.remove=function(e){this.rootNode.remove(e)},O0.prototype.removeAll=function(e){this.rootNode.removeAll(e)},Object.assign(O0.prototype,yY);var V0={dimensions:NQ.prototype.dimensions,create:function(e,t){var n=[];e.eachComponent("grid3D",(function(e){e.__viewGL=e.__viewGL||new O0;var t=new NQ;t.model=e,t.viewGL=e.__viewGL,e.coordinateSystem=t,n.push(t),t.resize=k0,t.update=z0}));var r=["xAxis3D","yAxis3D","zAxis3D"];return e.eachSeries((function(t){if("cartesian3D"===t.get("coordinateSystem")){if(null==(i=t.getReferringComponents("grid3D").models[0])){var n=function(e,t){return r.map((function(n){var r=e.getReferringComponents(n).models[0];if(null==r&&(r=t.getComponent(n)),"production"!==process.env.NODE_ENV&&!r)throw new Error(n+' "'+_J(e.get(n+"Index"),e.get(n+"Id"),0)+'" not found');return r}))}(t,e),i=n[0].getCoordSysModel();n.forEach((function(e){var t=e.getCoordSysModel();if("production"!==process.env.NODE_ENV){if(!t)throw new Error('grid3D "'+_J(e.get("gridIndex"),e.get("gridId"),0)+'" not found');if(t!==i)throw new Error("xAxis3D, yAxis3D, zAxis3D must use the same grid")}}))}var o=i.coordinateSystem;t.coordinateSystem=o}})),n}},B0=tp.extend({type:"cartesian3DAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid3D",index:this.option.gridIndex,id:this.option.gridId})[0]}});rb(B0);var F0={show:!0,grid3DIndex:0,inverse:!1,name:"",nameLocation:"middle",nameTextStyle:{fontSize:16},nameGap:20,axisPointer:{},axisLine:{},axisTick:{},axisLabel:{},splitArea:{}},G0=R({boundaryGap:!0,axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"},axisPointer:{label:{show:!1}}},F0),H0=R({boundaryGap:[0,0],splitNumber:5,axisPointer:{label:{}}},F0),U0=V({scale:!0,min:"dataMin",max:"dataMax"},H0),W0=V({logBase:10},H0);W0.scale=!0;var j0={categoryAxis3D:G0,valueAxis3D:H0,timeAxis3D:U0,logAxis3D:W0},X0=["value","category","time","log"];function Y0(e,t){return t.type||(t.data?"category":"value")}l_((function(e){e.registerComponentModel(rQ),e.registerComponentView(LQ),e.registerCoordinateSystem("grid3D",V0),["x","y","z"].forEach((function(t){!function(e,t,n,r,i){X0.forEach((function(o){var a=n.extend({type:t+"Axis3D."+o,__ordinalMeta:null,mergeDefaultAndTheme:function(e,n){R(e,n.getTheme().get(o+"Axis3D")),R(e,this.getDefaultOption()),e.type=r(t,e)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=Z_.createByAxisModel(this))},getCategories:function(){if("category"===this.option.type)return this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:R(O(j0[o+"Axis3D"]),i||{},!0)});e.registerComponentModel(a)})),e.registerSubTypeDefaulter(t+"Axis3D",$(r,t))}(e,t,B0,Y0,{name:t.toUpperCase()});const n=e.ComponentView.extend({type:t+"Axis3D"});e.registerComponentView(n)})),e.registerAction({type:"grid3DChangeCamera",event:"grid3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"grid3D",query:e},(function(t){t.setView(e)}))})),e.registerAction({type:"grid3DShowAxisPointer",event:"grid3dshowaxispointer",update:"grid3D:showAxisPointer"},(function(e,t){})),e.registerAction({type:"grid3DHideAxisPointer",event:"grid3dhideaxispointer",update:"grid3D:hideAxisPointer"},(function(e,t){}))}));var Z0={defaultOption:{shading:null,realisticMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},lambertMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},colorMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},hatchingMaterial:{textureTiling:1,textureOffset:0,paperColor:"#fff"}}},q0={getFilledRegions:function(e,t){var n,r=(e||[]).slice();if("string"==typeof t?n=(t=i_(t))&&t.geoJson:t&&t.features&&(n=t),!n)return"production"!==process.env.NODE_ENV&&(console.error("Map "+t+" not exists. You can download map file on http://echarts.baidu.com/download-map.html"),n.features||console.error("Invalid GeoJSON for map3D")),[];for(var i={},o=n.features,a=0;a<r.length;a++)i[r[a].name]=r[a];for(a=0;a<o.length;a++){var s=o[a].properties.name;i[s]||r.push({name:s})}return r},defaultOption:{show:!0,zlevel:-10,map:"",left:0,top:0,width:"100%",height:"100%",boxWidth:100,boxHeight:10,boxDepth:"auto",regionHeight:3,environment:"auto",groundPlane:{show:!1,color:"#aaa"},shading:"lambert",light:{main:{alpha:40,beta:30}},viewControl:{alpha:40,beta:0,distance:100,orthographicSize:60,minAlpha:5,minBeta:-80,maxBeta:80},label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}},K0=tp.extend({type:"geo3D",layoutMode:"box",coordinateSystem:null,optionUpdated:function(){var e=this.option;e.regions=this.getFilledRegions(e.regions,e.map);var t=k_(e.data||[],{coordDimensions:["value"],encodeDefine:this.get("encode"),dimensionsDefine:this.get("dimensions")}),n=new R_(t,this);n.initData(e.regions);var r={};n.each((function(e){var t=n.getName(e),i=n.getItemModel(e);r[t]=i})),this._regionModelMap=r,this._data=n},getData:function(){return this._data},getRegionModel:function(e){var t=this.getData().getName(e);return this._regionModelMap[t]||new Wh(null,this)},getRegionPolygonCoords:function(e){var t=this.getData().getName(e),n=this.coordinateSystem.getRegion(t);return n?n.geometries:[]},getFormattedLabel:function(e,t){var n=this._data.getName(e),r=this.getRegionModel(e),i=r.get("normal"===t?["label","formatter"]:["emphasis","label","formatter"]);null==i&&(i=r.get(["label","formatter"]));var o={name:n};if("function"==typeof i)return o.status=t,i(o);if("string"==typeof i){var a=o.seriesName;return i.replace("{a}",null!=a?a:"")}return n},defaultOption:{regions:[]}});function $0(e,t,n){n=n||2;var r,i,o,a,s,l,u,c=t&&t.length,h=c?t[0]*n:e.length,d=J0(e,0,h,n,!0),p=[];if(!d)return p;if(c&&(d=function(e,t,n,r){var i,o,a,s=[];for(i=0,o=t.length;i<o;i++)(a=J0(e,t[i]*r,i<o-1?t[i+1]*r:e.length,r,!1))===a.next&&(a.steiner=!0),s.push(l1(a));for(s.sort(o1),i=0;i<s.length;i++)a1(s[i],n),n=Q0(n,n.next);return n}(e,t,d,n)),e.length>80*n){r=o=e[0],i=a=e[1];for(var f=n;f<h;f+=n)(s=e[f])<r&&(r=s),(l=e[f+1])<i&&(i=l),s>o&&(o=s),l>a&&(a=l);u=Math.max(o-r,a-i)}return e1(d,p,n,r,i,u),p}function J0(e,t,n,r,i){var o,a;if(i===_1(e,t,n,r)>0)for(o=t;o<n;o+=r)a=m1(o,e[o],e[o+1],a);else for(o=n-r;o>=t;o-=r)a=m1(o,e[o],e[o+1],a);return a&&d1(a,a.next)&&(v1(a),a=a.next),a}function Q0(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!d1(r,r.next)&&0!==h1(r.prev,r,r.next))r=r.next;else{if(v1(r),(r=t=r.prev)===r.next)return null;n=!0}}while(n||r!==t);return t}function e1(e,t,n,r,i,o,a){if(e){!a&&o&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=s1(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,l,u=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t<u&&(s++,r=r.nextZ);t++);for(l=u;s>0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,u*=2}while(a>1)}(i)}(e,r,i,o);for(var s,l,u=e;e.prev!==e.next;)if(s=e.prev,l=e.next,o?n1(e,r,i,o):t1(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),v1(e),e=l.next,u=l.next;else if((e=l)===u){a?1===a?e1(e=r1(e,t,n),t,n,r,i,o,2):2===a&&i1(e,t,n,r,i,o):e1(Q0(e),t,n,r,i,o,1);break}}}function t1(e){var t=e.prev,n=e,r=e.next;if(h1(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(u1(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&h1(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function n1(e,t,n,r){var i=e.prev,o=e,a=e.next;if(h1(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,l=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,u=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=s1(s,l,t,n,r),d=s1(u,c,t,n,r),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&u1(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&h1(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&u1(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&h1(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function r1(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!d1(i,o)&&p1(i,r,r.next,o)&&f1(i,o)&&f1(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),v1(r),v1(r.next),r=e=o),r=r.next}while(r!==e);return r}function i1(e,t,n,r,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&c1(a,s)){var l=g1(a,s);return a=Q0(a,a.next),l=Q0(l,l.next),e1(a,t,n,r,i,o),void e1(l,t,n,r,i,o)}s=s.next}a=a.next}while(a!==e)}function o1(e,t){return e.x-t.x}function a1(e,t){if(t=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===a)return n.prev;var l,u=n,c=n.x,h=n.y,d=1/0;r=n.next;for(;r!==u;)i>=r.x&&r.x>=c&&i!==r.x&&u1(o<h?i:a,o,c,h,o<h?a:i,o,r.x,r.y)&&((l=Math.abs(o-r.y)/(i-r.x))<d||l===d&&r.x>n.x)&&f1(r,e)&&(n=r,d=l),r=r.next;return n}(e,t),t){var n=g1(t,e);Q0(n,n.next)}}function s1(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)/i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)/i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function l1(e){var t=e,n=e;do{t.x<n.x&&(n=t),t=t.next}while(t!==e);return n}function u1(e,t,n,r,i,o,a,s){return(i-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function c1(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&p1(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&f1(e,t)&&f1(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)}function h1(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function d1(e,t){return e.x===t.x&&e.y===t.y}function p1(e,t,n,r){return!!(d1(e,t)&&d1(n,r)||d1(e,r)&&d1(n,t))||h1(e,t,n)>0!=h1(e,t,r)>0&&h1(n,r,e)>0!=h1(n,r,t)>0}function f1(e,t){return h1(e.prev,e,e.next)<0?h1(e,t,e.next)>=0&&h1(e,e.prev,t)>=0:h1(e,t,e.prev)<0||h1(e,e.next,t)<0}function g1(e,t){var n=new y1(e.i,e.x,e.y),r=new y1(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function m1(e,t,n,r){var i=new y1(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function v1(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function y1(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _1(e,t,n,r){for(var i=0,o=t,a=n-r;o<n;o+=r)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}function x1(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b1(e,t,n,r,i){var o=n,a=e[t];x1(e,t,r);for(var s=n;s<r;s++)i(e[s],a)<0&&(x1(e,s,o),o++);return x1(e,r,o),o}function w1(e,t,n,r){if(n<r){var i=b1(e,Math.floor((n+r)/2),n,r,t);w1(e,t,n,i-1),w1(e,t,i+1,r)}}function S1(){this._parts=[]}R(K0.prototype,q0),R(K0.prototype,eQ),R(K0.prototype,tQ),R(K0.prototype,nQ),R(K0.prototype,Z0),$0.deviation=function(e,t,n,r){var i=t&&t.length,o=i?t[0]*n:e.length,a=Math.abs(_1(e,0,o,n));if(i)for(var s=0,l=t.length;s<l;s++){var u=t[s]*n,c=s<l-1?t[s+1]*n:e.length;a-=Math.abs(_1(e,u,c,n))}var h=0;for(s=0;s<r.length;s+=3){var d=r[s]*n,p=r[s+1]*n,f=r[s+2]*n;h+=Math.abs((e[d]-e[f])*(e[p+1]-e[d+1])-(e[d]-e[p])*(e[f+1]-e[d+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},S1.prototype.step=function(e,t,n){var r=e.length;if(0===n){this._parts=[],this._sorted=!1;var i=Math.floor(r/2);this._parts.push({pivot:i,left:0,right:r-1}),this._currentSortPartIdx=0}if(!this._sorted){var o=this._parts;if(0===o.length)return this._sorted=!0,!0;if(o.length<512){for(var a=0;a<o.length;a++)o[a].pivot=b1(e,o[a].pivot,o[a].left,o[a].right,t);var s=[];for(a=0;a<o.length;a++){var l=o[a].left;(u=o[a].pivot-1)>l&&s.push({pivot:Math.floor((u+l)/2),left:l,right:u});var u;l=o[a].pivot+1;(u=o[a].right)>l&&s.push({pivot:Math.floor((u+l)/2),left:l,right:u})}o=this._parts=s}else for(a=0;a<Math.floor(o.length/10);a++){var c=o.length-1-this._currentSortPartIdx;if(w1(e,t,o[c].left,o[c].right),this._currentSortPartIdx++,this._currentSortPartIdx===o.length)return this._sorted=!0,!0}return!1}},S1.sort=w1;var T1=uQ.vec3,M1=T1.create(),C1=T1.create(),D1=T1.create(),A1={needsSortTriangles:function(){return this.indices&&this.sortTriangles},needsSortTrianglesProgressively:function(){return this.needsSortTriangles()&&this.triangleCount>=2e4},doSortTriangles:function(e,t){var n=this.indices;if(0===t){var r=this.attributes.position;e=e.array;this._triangleZList&&this._triangleZList.length===this.triangleCount||(this._triangleZList=new Float32Array(this.triangleCount),this._sortedTriangleIndices=new Uint32Array(this.triangleCount),this._indicesTmp=new n.constructor(n.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var i,o=0,a=0;a<n.length;){r.get(n[a++],M1),r.get(n[a++],C1),r.get(n[a++],D1);var s=T1.sqrDist(M1,e),l=T1.sqrDist(C1,e),u=T1.sqrDist(D1,e),c=Math.min(s,l);c=Math.min(c,u),3===a?(i=c,c=0):c-=i,this._triangleZList[o++]=c}}var h=this._sortedTriangleIndices;for(a=0;a<h.length;a++)h[a]=a;if(this.triangleCount<2e4)0===t&&this._simpleSort(!0);else for(a=0;a<3;a++)this._progressiveQuickSort(3*t+a);var d=this._indicesTmp,p=this._triangleZListTmp,f=this._triangleZList;for(a=0;a<this.triangleCount;a++){var g=3*h[a],m=3*a;d[m++]=n[g++],d[m++]=n[g++],d[m]=n[g],p[a]=f[h[a]]}var v=this._indicesTmp;this._indicesTmp=this.indices,this.indices=v;v=this._triangleZListTmp;this._triangleZListTmp=this._triangleZList,this._triangleZList=v,this.dirtyIndices()},_simpleSort:function(e){var t=this._triangleZList,n=this._sortedTriangleIndices;function r(e,n){return t[n]-t[e]}e?Array.prototype.sort.call(n,r):S1.sort(n,r,0,n.length-1)},_progressiveQuickSort:function(e){var t=this._triangleZList,n=this._sortedTriangleIndices;this._quickSort=this._quickSort||new S1,this._quickSort.step(n,(function(e,n){return t[n]-t[e]}),e)}};function I1(e,t){const n=e.getItemVisual(t,"style");if(n){return n[e.getVisual("drawType")]}}function E1(e,t){const n=e.getItemVisual(t,"style");return n&&n.opacity}function L1(e,t,n){this._labelsMesh=new SQ,this._labelTextureSurface=new fQ({width:512,height:512,devicePixelRatio:n.getDevicePixelRatio(),onupdate:function(){n.getZr().refresh()}}),this._api=n,this._labelsMesh.material.set("textureAtlas",this._labelTextureSurface.getTexture())}L1.prototype.getLabelPosition=function(e,t,n){return[0,0,0]},L1.prototype.getLabelDistance=function(e,t,n){return 0},L1.prototype.getMesh=function(){return this._labelsMesh},L1.prototype.updateData=function(e,t,n){null==t&&(t=0),null==n&&(n=e.count()),this._labelsVisibilitiesBits&&this._labelsVisibilitiesBits.length===n-t||(this._labelsVisibilitiesBits=new Uint8Array(n-t));for(var r=["label","show"],i=["emphasis","label","show"],o=t;o<n;o++){var a=e.getItemModel(o),s=a.get(r),l=a.get(i);null==l&&(l=s);var u=(s?1:0)|(l?2:0);this._labelsVisibilitiesBits[o-t]=u}this._start=t,this._end=n,this._data=e},L1.prototype.updateLabels=function(e){if(this._data){for(var t=(e=e||[]).length>0,n={},r=0;r<e.length;r++)n[e[r]]=!0;this._labelsMesh.geometry.convertToDynamicArray(!0),this._labelTextureSurface.clear();for(var i=["label"],o=["emphasis","label"],a=this._data.hostModel,s=this._data,l=a.getModel(i),u=a.getModel(o,l),c={left:"right",right:"left",top:"center",bottom:"center"},h={left:"middle",right:"middle",top:"bottom",bottom:"top"},d=this._start;d<this._end;d++){var p=!1;if(t&&n[d]&&(p=!0),this._labelsVisibilitiesBits[d-this._start]&(p?2:1)){var f=s.getItemModel(d).getModel(p?o:i,p?u:l),g=f.get("distance")||0,m=f.get("position"),v=this._api.getDevicePixelRatio(),y=a.getFormattedLabel(d,p?"emphasis":"normal");if(null==y||""===y)return;var _=new ll({style:wh(f,{text:y,fill:f.get("color")||I1(s,d)||"#000",align:"left",verticalAlign:"top",opacity:_J(f.get("opacity"),E1(s,d),1)})}),x=_.getBoundingRect();x.height*=1.2;var b=this._labelTextureSurface.add(_),w=c[m]||"center",S=h[m]||"bottom";this._labelsMesh.geometry.addSprite(this.getLabelPosition(d,m,g),[x.width*v,x.height*v],b,w,S,this.getLabelDistance(d,m,g)*v)}}this._labelsMesh.material.set("uvScale",this._labelTextureSurface.getCoordsScale()),this._labelTextureSurface.getZr().refreshImmediately(),this._labelsMesh.geometry.convertToTypedArray(),this._labelsMesh.geometry.dirty()}},L1.prototype.dispose=function(){this._labelTextureSurface.dispose()};var N1=uQ.vec3;function P1(e){this.rootNode=new BJ.Node,this._triangulationResults={},this._shadersMap=BJ.COMMON_SHADERS.filter((function(e){return"shadow"!==e})).reduce((function(e,t){return e[t]=BJ.createShader("ecgl."+t),e}),{}),this._linesShader=BJ.createShader("ecgl.meshLines3D");var t={};BJ.COMMON_SHADERS.forEach((function(e){t[e]=new BJ.Material({shader:BJ.createShader("ecgl."+e)})})),this._groundMaterials=t,this._groundMesh=new BJ.Mesh({geometry:new BJ.PlaneGeometry({dynamic:!0}),castShadow:!1,renderNormal:!0,$ignorePicking:!0}),this._groundMesh.rotation.rotateX(-Math.PI/2),this._labelsBuilder=new L1(512,512,e),this._labelsBuilder.getMesh().renderOrder=100,this._labelsBuilder.getMesh().material.depthTest=!1,this.rootNode.add(this._labelsBuilder.getMesh()),this._initMeshes(),this._api=e}BJ.Shader.import(AQ),P1.prototype={constructor:P1,extrudeY:!0,update:function(e,t,n,r,i){var o=e.getData();null==r&&(r=0),null==i&&(i=o.count()),this._startIndex=r,this._endIndex=i-1,this._triangulation(e,r,i);var a=this._getShader(e.get("shading"));this._prepareMesh(e,a,n,r,i),this.rootNode.updateWorldTransform(),this._updateRegionMesh(e,n,r,i);var s=e.coordinateSystem;"geo3D"===s.type&&this._updateGroundPlane(e,s,n);var l=this;this._labelsBuilder.updateData(o,r,i),this._labelsBuilder.getLabelPosition=function(e,t,n){var r=o.getName(e),i=n;if("geo3D"===s.type){var a=s.getRegion(r);return a?(c=a.getCenter(),s.dataToPoint([c[0],c[1],i])):[NaN,NaN,NaN]}var u=l._triangulationResults[e-l._startIndex],c=l.extrudeY?[(u.max[0]+u.min[0])/2,u.max[1]+i,(u.max[2]+u.min[2])/2]:[(u.max[0]+u.min[0])/2,(u.max[1]+u.min[1])/2,u.max[2]+i]},this._data=o,this._labelsBuilder.updateLabels(),this._updateDebugWireframe(e),this._lastHoverDataIndex=0},_initMeshes:function(){var e=this;var t=function(){var t=new BJ.Mesh({name:"Polygon",material:new BJ.Material({shader:e._shadersMap.lambert}),geometry:new BJ.Geometry({sortTriangles:!0,dynamic:!0}),culling:!1,ignorePicking:!0,renderNormal:!0});return Object.assign(t.geometry,A1),t}(),n=new BJ.Mesh({material:new BJ.Material({shader:this._linesShader}),castShadow:!1,ignorePicking:!0,$ignorePicking:!0,geometry:new dQ({useNativeLine:!1})});this.rootNode.add(t),this.rootNode.add(n),t.material.define("both","VERTEX_COLOR"),t.material.define("fragment","DOUBLE_SIDED"),this._polygonMesh=t,this._linesMesh=n,this.rootNode.add(this._groundMesh)},_getShader:function(e){var t=this._shadersMap[e];return t||("production"!==process.env.NODE_ENV&&console.warn("Unkown shading "+e),t=this._shadersMap.lambert),t.__shading=e,t},_prepareMesh:function(e,t,n,r,i){for(var o=0,a=0,s=0,l=0,u=r;u<i;u++){var c=this._getRegionPolygonInfo(u),h=this._getRegionLinesInfo(u,e,this._linesMesh.geometry);o+=c.vertexCount,a+=c.triangleCount,s+=h.vertexCount,l+=h.triangleCount}var d=this._polygonMesh,p=d.geometry;["position","normal","texcoord0","color"].forEach((function(e){p.attributes[e].init(o)})),p.indices=o>65535?new Uint32Array(3*a):new Uint16Array(3*a),d.material.shader!==t&&d.material.attachShader(t,!0),BJ.setMaterialFromModel(t.__shading,d.material,e,n),s>0&&(this._linesMesh.geometry.resetOffset(),this._linesMesh.geometry.setVertexCount(s),this._linesMesh.geometry.setTriangleCount(l)),this._dataIndexOfVertex=new Uint32Array(o),this._vertexRangeOfDataIndex=new Uint32Array(2*(i-r))},_updateRegionMesh:function(e,t,n,r){for(var i=e.getData(),o=0,a=0,s=!1,l=this._polygonMesh,u=this._linesMesh,c=n;c<r;c++){var h=e.getRegionModel(c),d=h.getModel("itemStyle"),p=_J(I1(i,c),d.get("color"),"#fff"),f=_J(E1(i,c),d.get("opacity"),1),g=BJ.parseColor(p),m=BJ.parseColor(d.get("borderColor"));g[3]*=f,m[3]*=f;var v=g[3]<.99;l.material.set("color",[1,1,1,1]),s=s||v;for(var y=_J(h.get("height",!0),e.get("regionHeight")),_=this._updatePolygonGeometry(e,l.geometry,c,y,o,a,g),x=o;x<_.vertexOffset;x++)this._dataIndexOfVertex[x]=c;this._vertexRangeOfDataIndex[2*(c-n)]=o,this._vertexRangeOfDataIndex[2*(c-n)+1]=_.vertexOffset,o=_.vertexOffset,a=_.triangleOffset;var b=d.get("borderWidth"),w=b>0;w&&(b*=t.getDevicePixelRatio(),this._updateLinesGeometry(u.geometry,e,c,y,b,e.coordinateSystem.transform)),u.invisible=!w,u.material.set({color:m})}(l=this._polygonMesh).material.transparent=s,l.material.depthMask=!s,l.geometry.updateBoundingBox(),l.frontFace=this.extrudeY?BJ.Mesh.CCW:BJ.Mesh.CW,l.material.get("normalMap")&&l.geometry.generateTangents(),l.seriesIndex=e.seriesIndex,l.on("mousemove",this._onmousemove,this),l.on("mouseout",this._onmouseout,this)},_updateDebugWireframe:function(e){var t=e.getModel("debug.wireframe");if(t.get("show")){var n=BJ.parseColor(t.get("lineStyle.color")||"rgba(0,0,0,0.5)"),r=_J(t.get("lineStyle.width"),1),i=this._polygonMesh;i.geometry.generateBarycentric(),i.material.define("both","WIREFRAME_TRIANGLE"),i.material.set("wireframeLineColor",n),i.material.set("wireframeLineWidth",r)}},_onmousemove:function(e){var t=this._dataIndexOfVertex[e.triangle[0]];null==t&&(t=-1),t!==this._lastHoverDataIndex&&(this.downplay(this._lastHoverDataIndex),this.highlight(t),this._labelsBuilder.updateLabels([t])),this._lastHoverDataIndex=t,this._polygonMesh.dataIndex=t},_onmouseout:function(e){e.target&&(this.downplay(this._lastHoverDataIndex),this._lastHoverDataIndex=-1,this._polygonMesh.dataIndex=-1),this._labelsBuilder.updateLabels([])},_updateGroundPlane:function(e,t,n){var r=e.getModel("groundPlane",e);if(this._groundMesh.invisible=!r.get("show",!0),!this._groundMesh.invisible){var i=e.get("shading"),o=this._groundMaterials[i];o||("production"!==process.env.NODE_ENV&&console.warn("Unkown shading "+i),o=this._groundMaterials.lambert),BJ.setMaterialFromModel(i,o,r,n),o.get("normalMap")&&this._groundMesh.geometry.generateTangents(),this._groundMesh.material=o,this._groundMesh.material.set("color",BJ.parseColor(r.get("color"))),this._groundMesh.scale.set(t.size[0],t.size[2],1)}},_triangulation:function(e,t,n){this._triangulationResults=[];for(var r=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0],o=e.coordinateSystem,a=t;a<n;a++){for(var s=[],l=e.getRegionPolygonCoords(a),u=0;u<l.length;u++){var c=l[u].exterior,h=l[u].interiors,d=[],p=[];if(!(c.length<3)){for(var f=0,g=0;g<c.length;g++){var m=c[g];d[f++]=m[0],d[f++]=m[1]}for(g=0;g<h.length;g++)if(!(h[g].length<3)){for(var v=d.length/2,y=0;y<h[g].length;y++){m=h[g][y];d.push(m[0]),d.push(m[1])}p.push(v)}var _=$0(d,p),x=new Float64Array(d.length/2*3),b=[],w=[1/0,1/0,1/0],S=[-1/0,-1/0,-1/0],T=0;for(g=0;g<d.length;)N1.set(b,d[g++],0,d[g++]),o&&o.transform&&N1.transformMat4(b,b,o.transform),N1.min(w,w,b),N1.max(S,S,b),x[T++]=b[0],x[T++]=b[1],x[T++]=b[2];N1.min(r,r,w),N1.max(i,i,S),s.push({points:x,indices:_,min:w,max:S})}}this._triangulationResults.push(s)}this._geoBoundingBox=[r,i]},_getRegionPolygonInfo:function(e){for(var t=this._triangulationResults[e-this._startIndex],n=0,r=0,i=0;i<t.length;i++)n+=t[i].points.length/3,r+=t[i].indices.length/3;return{vertexCount:2*n+4*n,triangleCount:2*r+2*n}},_updatePolygonGeometry:function(e,t,n,r,i,o,a){var s=e.get("projectUVOnGround"),l=t.attributes.position,u=t.attributes.normal,c=t.attributes.texcoord0,h=t.attributes.color,d=this._triangulationResults[n-this._startIndex],p=h.value&&a,f=t.indices,g=this.extrudeY?1:2,m=this.extrudeY?2:1,v=[this.rootNode.worldTransform.x.len(),this.rootNode.worldTransform.y.len(),this.rootNode.worldTransform.z.len()],y=N1.mul([],this._geoBoundingBox[0],v),_=N1.mul([],this._geoBoundingBox[1],v),x=Math.max(_[0]-y[0],_[2]-y[2]);function b(e,t,n){var r=i;!function(e,t){for(var n=e.points,r=n.length,o=[],s=[],u=0;u<r;u+=3)o[0]=n[u],o[g]=t,o[m]=n[u+2],s[0]=(n[u]*v[0]-y[0])/x,s[1]=(n[u+2]*v[m]-y[2])/x,l.set(i,o),p&&h.set(i,a),c.set(i++,s)}(e,t);for(var s=e.indices.length,u=0;u<s;u++)f[3*o+u]=e.indices[u]+r;o+=e.indices.length/3}for(var w=this.extrudeY?[0,1,0]:[0,0,1],S=N1.negate([],w),T=0;T<d.length;T++){var M=i,C=d[T];b(C,0),b(C,r);for(var D=C.points.length/3,A=0;A<D;A++)u.set(M+A,S),u.set(M+A+D,w);var I=[0,3,1,1,3,2],E=[[],[],[],[]],L=[],N=[],P=[],O=[],R=0;for(A=0;A<D;A++){for(var k=(A+1)%D,z=(C.points[3*k]-C.points[3*A])*v[0],V=(C.points[3*k+2]-C.points[3*A+2])*v[m],B=Math.sqrt(z*z+V*V),F=0;F<4;F++){var G=0===F||3===F,H=3*(G?A:k);E[F][0]=C.points[H],E[F][g]=F>1?r:0,E[F][m]=C.points[H+2],l.set(i+F,E[F]),s?(O[0]=(C.points[H]*v[0]-y[0])/x,O[1]=(C.points[H+2]*v[m]-y[m])/x):(O[0]=(G?R:R+B)/x,O[1]=(E[F][g]*v[g]-y[g])/x),c.set(i+F,O)}N1.sub(L,E[1],E[0]),N1.sub(N,E[3],E[0]),N1.cross(P,L,N),N1.normalize(P,P);for(F=0;F<4;F++)u.set(i+F,P),p&&h.set(i+F,a);for(F=0;F<6;F++)f[3*o+F]=I[F]+i;i+=4,o+=2,R+=B}}return t.dirty(),{vertexOffset:i,triangleOffset:o}},_getRegionLinesInfo:function(e,t,n){var r=0,i=0;t.getRegionModel(e).getModel("itemStyle").get("borderWidth")>0&&t.getRegionPolygonCoords(e).forEach((function(e){var t=e.exterior,o=e.interiors;r+=n.getPolylineVertexCount(t),i+=n.getPolylineTriangleCount(t);for(var a=0;a<o.length;a++)r+=n.getPolylineVertexCount(o[a]),i+=n.getPolylineTriangleCount(o[a])}),this);return{vertexCount:r,triangleCount:i}},_updateLinesGeometry:function(e,t,n,r,i,o){function a(e){for(var t=new Float64Array(3*e.length),n=0,i=[],a=0;a<e.length;a++)i[0]=e[a][0],i[1]=r+.1,i[2]=e[a][1],o&&N1.transformMat4(i,i,o),t[n++]=i[0],t[n++]=i[1],t[n++]=i[2];return t}var s=[1,1,1,1];t.getRegionPolygonCoords(n).forEach((function(t){var n=t.exterior,r=t.interiors;e.addPolyline(a(n),s,i);for(var o=0;o<r.length;o++)e.addPolyline(a(r[o]),s,i)}))},highlight:function(e){var t=this._data;if(t){var n=t.getItemModel(e).getModel(["emphasis","itemStyle"]),r=n.get("color"),i=_J(n.get("opacity"),E1(t,e),1);if(null==r)r=or(I1(t,e),-.4);null==i&&(i=E1(t,e));var o=BJ.parseColor(r);o[3]*=i,this._setColorOfDataIndex(t,e,o)}},downplay:function(e){var t=this._data;if(t){var n=t.getItemModel(e),r=_J(I1(t,e),n.get(["itemStyle","color"]),"#fff"),i=_J(E1(t,e),n.get(["itemStyle","opacity"]),1),o=BJ.parseColor(r);o[3]*=i,this._setColorOfDataIndex(t,e,o)}},dispose:function(){this._labelsBuilder.dispose()},_setColorOfDataIndex:function(e,t,n){if(!(t<this._startIndex&&t>this._endIndex)){t-=this._startIndex;for(var r=this._vertexRangeOfDataIndex[2*t];r<this._vertexRangeOfDataIndex[2*t+1];r++)this._polygonMesh.geometry.attributes.color.set(r,n);this._polygonMesh.geometry.dirty(),this._api.getZr().refresh()}}};var O1=Kg.extend({type:"geo3D",__ecgl__:!0,init:function(e,t){this._geo3DBuilder=new P1(t),this.groupGL=new BJ.Node,this._lightRoot=new BJ.Node,this._sceneHelper=new gQ(this._lightRoot),this._sceneHelper.initLight(this._lightRoot),this._control=new sQ({zr:t.getZr()}),this._control.init()},render:function(e,t,n){this.groupGL.add(this._geo3DBuilder.rootNode);var r=e.coordinateSystem;if(r&&r.viewGL){r.viewGL.add(this._lightRoot),e.get("show")?r.viewGL.add(this.groupGL):r.viewGL.remove(this.groupGL);var i=this._control;i.setViewGL(r.viewGL);var o=e.getModel("viewControl");i.setFromViewControlModel(o,0),this._sceneHelper.setScene(r.viewGL.scene),this._sceneHelper.updateLight(e),r.viewGL.setPostEffect(e.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._geo3DBuilder.update(e,t,n,0,e.getData().count());var a=r.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse((function(e){e.material&&e.material[a]("fragment","SRGB_DECODE")})),i.off("update"),i.on("update",(function(){n.dispatchAction({type:"geo3DChangeCamera",alpha:i.getAlpha(),beta:i.getBeta(),distance:i.getDistance(),center:i.getCenter(),from:this.uid,geo3DId:e.id})})),i.update()}},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n)},dispose:function(){this._control.dispose(),this._geo3DBuilder.dispose()}}),R1={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};var k1=uQ.vec3,z1=uQ.mat4,V1=[mD,function(e,t){if("world"===e){var n=R1[t.name];if(n){var r=[n[0],n[1]];t.setCenter(r)}}}];function B1(e,t,n,r,i){this.name=e,this.map=t,this.regionHeight=0,this.regions=[],this._nameCoordMap={},this.loadGeoJson(n,r,i),this.transform=z1.identity(new Float64Array(16)),this.invTransform=z1.identity(new Float64Array(16)),this.extrudeY=!0,this.altitudeAxis}function F1(e,t){var n=Zd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()});n.y=t.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,t.getDevicePixelRatio());var r=this.getGeoBoundingRect(),i=r.width/r.height*(e.get("aspectScale")||.75),o=e.get("boxWidth"),a=e.get("boxDepth"),s=e.get("boxHeight");null==s&&(s=5),isNaN(o)&&isNaN(a)&&(o=100),isNaN(a)?a=o/i:isNaN(o)&&(o=a/i),this.setSize(o,s,a),this.regionHeight=e.get("regionHeight"),this.altitudeAxis&&this.altitudeAxis.setExtent(0,Math.max(s-this.regionHeight,0))}function G1(e,t){var n=[1/0,-1/0];if(e.eachSeries((function(e){if(e.coordinateSystem===this&&"series.map3D"!==e.type){var t=e.getData(),r=e.coordDimToDataDim("alt"),i=r&&r[0];if(i){var o=t.getDataExtent(i,!0);n[0]=Math.min(n[0],o[0]),n[1]=Math.max(n[1],o[1])}}}),this),n&&isFinite(n[1]-n[0])){var r=nb(n,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new Ob("altitude",r),this.resize(this.model,t)}}if(B1.prototype={constructor:B1,type:"geo3D",dimensions:["lng","lat","alt"],containPoint:function(){},loadGeoJson:function(e,t,n){var r=vb||vb;try{this.regions=e?r(e):[]}catch(e){throw"Invalid geoJson format\n"+e}t=t||{},n=n||{};for(var i=this.regions,o={},a=0;a<i.length;a++){var s=i[a].name;s=n[s]||s,i[a].name=s,o[s]=i[a],this.addGeoCoord(s,i[a].getCenter());var l=t[s];l&&i[a].transformTo(l.left,l.top,l.width,l.height)}this._regionsMap=o,this._geoRect=null,V1.forEach((function(e){e(this)}),this)},getGeoBoundingRect:function(){if(this._geoRect)return this._geoRect;for(var e,t=this.regions,n=0;n<t.length;n++){var r=t[n].getBoundingRect();(e=e||r.clone()).union(r)}return this._geoRect=e||new jt(0,0,0,0)},addGeoCoord:function(e,t){this._nameCoordMap[e]=t},getRegion:function(e){return this._regionsMap[e]},getRegionByCoord:function(e){for(var t=this.regions,n=0;n<t.length;n++)if(t[n].contain(e))return t[n]},setSize:function(e,t,n){this.size=[e,t,n];var r=this.getGeoBoundingRect(),i=e/r.width,o=-n/r.height,a=-e/2-r.x*i,s=n/2-r.y*o,l=this.extrudeY?[a,0,s]:[a,s,0],u=this.extrudeY?[i,1,o]:[i,o,1],c=this.transform;z1.identity(c),z1.translate(c,c,l),z1.scale(c,c,u),z1.invert(this.invTransform,c)},dataToPoint:function(e,t){t=t||[];var n=this.extrudeY?1:2,r=this.extrudeY?2:1,i=e[2];return isNaN(i)&&(i=0),t[0]=e[0],t[r]=e[1],this.altitudeAxis?t[n]=this.altitudeAxis.dataToCoord(i):t[n]=0,t[n]+=this.regionHeight,k1.transformMat4(t,t,this.transform),t},pointToData:function(e,t){}},"production"!==process.env.NODE_ENV)var H1=function(e){console.error("Map "+e+" not exists. You can download map file on http://echarts.baidu.com/download-map.html")};var U1=0,W1={dimensions:B1.prototype.dimensions,create:function(e,t){var n=[];if(!i_)throw new Error("geo3D component depends on geo component");function r(e,r){var i=W1.createGeo3D(e);e.__viewGL=e.__viewGL||new O0,i.viewGL=e.__viewGL,e.coordinateSystem=i,i.model=e,n.push(i),i.resize=F1,i.resize(e,t),i.update=G1}return e.eachComponent("geo3D",(function(e,t){r(e)})),e.eachSeriesByType("map3D",(function(e,t){var n=e.get("coordinateSystem");null==n&&(n="geo3D"),"geo3D"===n&&r(e)})),e.eachSeries((function(t){if("geo3D"===t.get("coordinateSystem")){if("series.map3D"===t.type)return;var n=t.getReferringComponents("geo3D").models[0];if(n||(n=e.getComponent("geo3D")),!n)throw new Error('geo "'+_J(t.get("geo3DIndex"),t.get("geo3DId"),0)+'" not found');t.coordinateSystem=n.coordinateSystem}})),n},createGeo3D:function(e){var t,n=e.get("map");if("string"==typeof n?(t=n,n=i_(n)):n&&n.features&&(n={geoJson:n}),"production"!==process.env.NODE_ENV&&(n||H1(n),!n.geoJson.features))throw new Error("Invalid GeoJSON for map3D");return null==t&&(t="GEO_ANONYMOUS_"+U1++),new B1(t+U1++,t,n&&n.geoJson,n&&n.specialAreas,e.get("nameMap"))}};function j1(e){e.registerComponentModel(K0),e.registerComponentView(O1),e.registerAction({type:"geo3DChangeCamera",event:"geo3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"geo3D",query:e},(function(t){t.setView(e)}))})),e.registerCoordinateSystem("geo3D",W1)}function X1(e,t){e.id=e.id||e.name||t+""}l_(j1);var Y1=tp.extend({type:"globe",layoutMode:"box",coordinateSystem:null,init:function(){Y1.superApply(this,"init",arguments),W(this.option.layers,(function(e,t){R(e,this.defaultLayerOption),X1(e,t)}),this)},mergeOption:function(e){var t=this.option.layers;function n(e){return X(e,(function(e,t,n){return X1(t,n),e[t.id]=t,e}),{})}if(this.option.layers=null,Y1.superApply(this,"mergeOption",arguments),t&&t.length){var r=n(e.layers),i=n(t);for(var o in r)i[o]?R(i[o],r[o],!0):t.push(e.layers[o]);this.option.layers=t}W(this.option.layers,(function(e){R(e,this.defaultLayerOption)}),this)},optionUpdated:function(){this.updateDisplacementHash()},defaultLayerOption:{show:!0,type:"overlay"},defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",baseColor:"#fff",baseTexture:"",heightTexture:"",displacementTexture:"",displacementScale:0,displacementQuality:"medium",globeRadius:100,globeOuterRadius:150,shading:"lambert",light:{main:{time:""}},atmosphere:{show:!1,offset:5,color:"#ffffff",glowPower:6,innerGlowPower:2},viewControl:{autoRotate:!0,panSensitivity:0,targetCoord:null},layers:[]},setDisplacementData:function(e,t,n){this.displacementData=e,this.displacementWidth=t,this.displacementHeight=n},getDisplacementTexture:function(){return this.get("displacementTexture")||this.get("heightTexture")},getDisplacemenScale:function(){var e=this.getDisplacementTexture(),t=this.get("displacementScale");return e&&"none"!==e||(t=0),t},hasDisplacement:function(){return this.getDisplacemenScale()>0},_displacementChanged:!0,_displacementScale:0,updateDisplacementHash:function(){var e=this.getDisplacementTexture(),t=this.getDisplacemenScale();this._displacementChanged=this._displacementTexture!==e||this._displacementScale!==t,this._displacementTexture=e,this._displacementScale=t},isDisplacementChanged:function(){return this._displacementChanged}});R(Y1.prototype,eQ),R(Y1.prototype,tQ),R(Y1.prototype,nQ),R(Y1.prototype,Z0);var Z1=Math.PI,q1=Math.sin,K1=Math.cos,$1=Math.tan,J1=Math.asin,Q1=Math.atan2,e2=Z1/180;var t2=23.4397*e2;function n2(e,t){return Q1(q1(e)*K1(t2)-$1(t)*q1(t2),K1(e))}function r2(e,t,n){return Q1(q1(e),K1(e)*q1(t)-$1(n)*K1(t))}function i2(e,t,n){return J1(q1(t)*q1(n)+K1(t)*K1(n)*K1(e))}function o2(e){var t,n,r=function(e){return e2*(357.5291+.98560028*e)}(e),i=function(e){return e+e2*(1.9148*q1(e)+.02*q1(2*e)+3e-4*q1(3*e))+102.9372*e2+Z1}(r);return{dec:(t=i,n=0,J1(q1(n)*K1(t2)+K1(n)*q1(t2)*q1(t))),ra:n2(i,0)}}var a2={};a2.getPosition=function(e,t,n){var r=e2*-n,i=e2*t,o=function(e){return function(e){return e.valueOf()/864e5-.5+2440588}(e)-2451545}(e),a=o2(o),s=function(e,t){return e2*(280.16+360.9856235*e)-t}(o,r)-a.ra;return{azimuth:r2(s,i,a.dec),altitude:i2(s,i,a.dec)}};BJ.Shader.import(RJ),BJ.Shader.import("@export ecgl.atmosphere.vertex\nattribute vec3 position: POSITION;\nattribute vec3 normal : NORMAL;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 normalMatrix : WORLDINVERSETRANSPOSE;\n\nvarying vec3 v_Normal;\n\nvoid main() {\n v_Normal = normalize((normalMatrix * vec4(normal, 0.0)).xyz);\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end\n\n\n@export ecgl.atmosphere.fragment\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform float glowPower;\nuniform vec3 glowColor;\n\nvarying vec3 v_Normal;\n\nvoid main() {\n float intensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor = vec4(glowColor, intensity * intensity);\n}\n@end");var s2=Kg.extend({type:"globe",__ecgl__:!0,_displacementScale:0,init:function(e,t){this.groupGL=new BJ.Node,this._sphereGeometry=new BJ.SphereGeometry({widthSegments:200,heightSegments:100,dynamic:!0}),this._overlayGeometry=new BJ.SphereGeometry({widthSegments:80,heightSegments:40}),this._planeGeometry=new BJ.PlaneGeometry,this._earthMesh=new BJ.Mesh({renderNormal:!0}),this._atmosphereMesh=new BJ.Mesh,this._atmosphereGeometry=new BJ.SphereGeometry({widthSegments:80,heightSegments:40}),this._atmosphereMaterial=new BJ.Material({shader:new BJ.Shader(BJ.Shader.source("ecgl.atmosphere.vertex"),BJ.Shader.source("ecgl.atmosphere.fragment")),transparent:!0}),this._atmosphereMesh.geometry=this._atmosphereGeometry,this._atmosphereMesh.material=this._atmosphereMaterial,this._atmosphereMesh.frontFace=BJ.Mesh.CW,this._lightRoot=new BJ.Node,this._sceneHelper=new gQ,this._sceneHelper.initLight(this._lightRoot),this.groupGL.add(this._atmosphereMesh),this.groupGL.add(this._earthMesh),this._control=new sQ({zr:t.getZr()}),this._control.init(),this._layerMeshes={}},render:function(e,t,n){var r=e.coordinateSystem,i=e.get("shading");r.viewGL.add(this._lightRoot),e.get("show")?r.viewGL.add(this.groupGL):r.viewGL.remove(this.groupGL),this._sceneHelper.setScene(r.viewGL.scene),r.viewGL.setPostEffect(e.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));var o=this._earthMesh;o.geometry=this._sphereGeometry;var a="ecgl."+i;o.material&&o.material.shader.name===a||(o.material=BJ.createMaterial(a)),BJ.setMaterialFromModel(i,o.material,e,n),["roughnessMap","metalnessMap","detailMap","normalMap"].forEach((function(e){var t=o.material.get(e);t&&(t.flipY=!1)})),o.material.set("color",BJ.parseColor(e.get("baseColor")));var s=.99*r.radius;if(o.scale.set(s,s,s),e.get("atmosphere.show")){o.material.define("both","ATMOSPHERE_ENABLED"),this._atmosphereMesh.invisible=!1,this._atmosphereMaterial.setUniforms({glowPower:e.get("atmosphere.glowPower")||6,glowColor:e.get("atmosphere.color")||"#ffffff"}),o.material.setUniforms({glowPower:e.get("atmosphere.innerGlowPower")||2,glowColor:e.get("atmosphere.color")||"#ffffff"});var l=e.get("atmosphere.offset")||5;this._atmosphereMesh.scale.set(s+l,s+l,s+l)}else o.material.undefine("both","ATMOSPHERE_ENABLED"),this._atmosphereMesh.invisible=!0;var u=o.material.setTextureImage("diffuseMap",e.get("baseTexture"),n,{flipY:!1,anisotropic:8});u&&u.surface&&u.surface.attachToMesh(o);var c=o.material.setTextureImage("bumpMap",e.get("heightTexture"),n,{flipY:!1,anisotropic:8});c&&c.surface&&c.surface.attachToMesh(o),o.material[e.get("postEffect.enable")?"define":"undefine"]("fragment","SRGB_DECODE"),this._updateLight(e,n),this._displaceVertices(e,n),this._updateViewControl(e,n),this._updateLayers(e,n)},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n)},_updateLayers:function(e,t){var n=e.coordinateSystem,r=e.get("layers"),i=n.radius,o=[],a=[],s=[],l=[];W(r,(function(e){var r=new Wh(e),u=r.get("type"),c=BJ.loadTexture(r.get("texture"),t,{flipY:!1,anisotropic:8});if(c.surface&&c.surface.attachToMesh(this._earthMesh),"blend"===u){var h=r.get("blendTo"),d=_J(r.get("intensity"),1);"emission"===h?(s.push(c),l.push(d)):(o.push(c),a.push(d))}else{var p=r.get("id"),f=this._layerMeshes[p];f||(f=this._layerMeshes[p]=new BJ.Mesh({geometry:this._overlayGeometry,castShadow:!1,ignorePicking:!0})),"lambert"===r.get("shading")?(f.material=f.__lambertMaterial||new BJ.Material({autoUpdateTextureStatus:!1,shader:BJ.createShader("ecgl.lambert"),transparent:!0,depthMask:!1}),f.__lambertMaterial=f.material):(f.material=f.__colorMaterial||new BJ.Material({autoUpdateTextureStatus:!1,shader:BJ.createShader("ecgl.color"),transparent:!0,depthMask:!1}),f.__colorMaterial=f.material),f.material.enableTexture("diffuseMap");var g=r.get("distance"),m=i+(null==g?n.radius/100:g);f.scale.set(m,m,m),i=m;var v=this._blankTexture||(this._blankTexture=BJ.createBlankTexture("rgba(255, 255, 255, 0)"));f.material.set("diffuseMap",v),BJ.loadTexture(r.get("texture"),t,{flipY:!1,anisotropic:8},(function(e){e.surface&&e.surface.attachToMesh(f),f.material.set("diffuseMap",e),t.getZr().refresh()})),r.get("show")?this.groupGL.add(f):this.groupGL.remove(f)}}),this);var u=this._earthMesh.material;u.define("fragment","LAYER_DIFFUSEMAP_COUNT",o.length),u.define("fragment","LAYER_EMISSIVEMAP_COUNT",s.length),u.set("layerDiffuseMap",o),u.set("layerDiffuseIntensity",a),u.set("layerEmissiveMap",s),u.set("layerEmissionIntensity",l);var c=e.getModel("debug.wireframe");if(c.get("show")){u.define("both","WIREFRAME_TRIANGLE");var h=BJ.parseColor(c.get("lineStyle.color")||"rgba(0,0,0,0.5)"),d=_J(c.get("lineStyle.width"),1);u.set("wireframeLineWidth",d),u.set("wireframeLineColor",h)}else u.undefine("both","WIREFRAME_TRIANGLE")},_updateViewControl:function(e,t){var n=e.coordinateSystem,r=e.getModel("viewControl");n.viewGL.camera;var i=this;var o=this._control;o.setViewGL(n.viewGL);var a,s,l=r.get("targetCoord");null!=l&&(s=l[0]+90,a=l[1]),o.setFromViewControlModel(r,{baseDistance:n.radius,alpha:a,beta:s}),o.off("update"),o.on("update",(function(){t.dispatchAction({type:"globeChangeCamera",alpha:o.getAlpha(),beta:o.getBeta(),distance:o.getDistance()-n.radius,center:o.getCenter(),from:i.uid,globeId:e.id})}))},_displaceVertices:function(e,t){var n=e.get("displacementQuality"),r=e.get("debug.wireframe.show"),i=e.coordinateSystem;if(e.isDisplacementChanged()||n!==this._displacementQuality||r!==this._showDebugWireframe){this._displacementQuality=n,this._showDebugWireframe=r;var o=this._sphereGeometry,a={low:100,medium:200,high:400,ultra:800}[n]||200,s=a/2;(o.widthSegments!==a||r)&&(o.widthSegments=a,o.heightSegments=s,o.build()),this._doDisplaceVertices(o,i),r&&o.generateBarycentric()}},_doDisplaceVertices:function(e,t){var n=e.attributes.position.value,r=e.attributes.texcoord0.value,i=e.__originalPosition;i&&i.length===n.length||((i=new Float32Array(n.length)).set(n),e.__originalPosition=i);for(var o=t.displacementWidth,a=t.displacementHeight,s=t.displacementData,l=0;l<e.vertexCount;l++){var u=3*l,c=2*l,h=i[u+1],d=i[u+2],p=i[u+3],f=r[c++],g=r[c++],m=Math.round(f*(o-1)),v=Math.round(g*(a-1)),y=s?s[v*o+m]:0;n[u+1]=h+h*y,n[u+2]=d+d*y,n[u+3]=p+p*y}e.generateVertexNormals(),e.dirty(),e.updateBoundingBox()},_updateLight:function(e,t){var n=this._earthMesh;this._sceneHelper.updateLight(e);var r=this._sceneHelper.mainLight,i=e.get("light.main.time")||new Date,o=a2.getPosition(yo(i),0,0),a=Math.cos(o.altitude);r.position.y=-a*Math.cos(o.azimuth),r.position.x=Math.sin(o.altitude),r.position.z=a*Math.sin(o.azimuth),r.lookAt(n.getWorldPosition())},dispose:function(e,t){this.groupGL.removeAll(),this._control.dispose()}}),l2=uQ.vec3;function u2(e){this.radius=e,this.viewGL=null,this.altitudeAxis,this.displacementData=null,this.displacementWidth,this.displacementHeight}function c2(e,t){var n=Zd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()});n.y=t.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,t.getDevicePixelRatio()),this.radius=e.get("globeRadius");var r=e.get("globeOuterRadius");this.altitudeAxis&&this.altitudeAxis.setExtent(0,r-this.radius)}function h2(e,t){var n=[1/0,-1/0];if(e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData(),r=e.coordDimToDataDim("alt"),i=r&&r[0];if(i){var o=t.getDataExtent(i,!0);n[0]=Math.min(n[0],o[0]),n[1]=Math.max(n[1],o[1])}}}),this),n&&isFinite(n[1]-n[0])){var r=nb(n,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new Ob("altitude",r),this.resize(this.model,t)}}u2.prototype={constructor:u2,dimensions:["lng","lat","alt"],type:"globe",containPoint:function(){},setDisplacementData:function(e,t,n){this.displacementData=e,this.displacementWidth=t,this.displacementHeight=n},_getDisplacementScale:function(e,t){var n=(e+180)/360*(this.displacementWidth-1),r=(90-t)/180*(this.displacementHeight-1),i=Math.round(n)+Math.round(r)*this.displacementWidth;return this.displacementData[i]},dataToPoint:function(e,t){var n=e[0],r=e[1],i=e[2]||0,o=this.radius;this.displacementData&&(o*=1+this._getDisplacementScale(n,r)),this.altitudeAxis&&(o+=this.altitudeAxis.dataToCoord(i)),n=n*Math.PI/180,r=r*Math.PI/180;var a=Math.cos(r)*o;return(t=t||[])[0]=-a*Math.cos(n+Math.PI),t[1]=Math.sin(r)*o,t[2]=a*Math.sin(n+Math.PI),t},pointToData:function(e,t){var n=e[0],r=e[1],i=e[2],o=l2.len(e);n/=o,r/=o,i/=o;var a=Math.asin(r),s=Math.atan2(i,-n);s<0&&(s=2*Math.PI+s);var l=180*a/Math.PI,u=180*s/Math.PI-180;return(t=t||[])[0]=u,t[1]=l,t[2]=o-this.radius,this.altitudeAxis&&(t[2]=this.altitudeAxis.coordToData(t[2])),t}};var d2={dimensions:u2.prototype.dimensions,create:function(e,t){var n=[];return e.eachComponent("globe",(function(e){e.__viewGL=e.__viewGL||new O0;var r=new u2;r.viewGL=e.__viewGL,e.coordinateSystem=r,r.model=e,n.push(r),r.resize=c2,r.resize(e,t),r.update=h2})),e.eachSeries((function(t){if("globe"===t.get("coordinateSystem")){var n=t.getReferringComponents("globe").models[0];if(n||(n=e.getComponent("globe")),!n)throw new Error('globe "'+_J(t.get("globe3DIndex"),t.get("globe3DId"),0)+'" not found');var r=n.coordinateSystem;t.coordinateSystem=r}})),e.eachComponent("globe",(function(e,n){var r=e.coordinateSystem,i=e.getDisplacementTexture(),o=e.getDisplacemenScale();if(e.isDisplacementChanged()){if(e.hasDisplacement()){var a=!0;BJ.loadTexture(i,t,(function(n){var r=function(e,t){var n=document.createElement("canvas"),r=n.getContext("2d"),i=e.width,o=e.height;n.width=i,n.height=o,r.drawImage(e,0,0,i,o);for(var a=r.getImageData(0,0,i,o).data,s=new Float32Array(a.length/4),l=0;l<a.length/4;l++){var u=a[4*l];s[l]=u/255*t}return{data:s,width:i,height:o}}(n.image,o);e.setDisplacementData(r.data,r.width,r.height),a||t.dispatchAction({type:"globeUpdateDisplacment"})})),a=!1}else r.setDisplacementData(null,0,0);r.setDisplacementData(e.displacementData,e.displacementWidth,e.displacementHeight)}})),n}};l_((function(e){e.registerComponentModel(Y1),e.registerComponentView(s2),e.registerCoordinateSystem("globe",d2),e.registerAction({type:"globeChangeCamera",event:"globecamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"globe",query:e},(function(t){t.setView(e)}))})),e.registerAction({type:"globeUpdateDisplacment",event:"globedisplacementupdated",update:"update"},(function(e,t){}))}));var p2=["zoom","center","pitch","bearing"],f2=tp.extend({type:"mapbox3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,style:"mapbox://styles/mapbox/light-v9",center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMapboxCameraOption:function(){var e=this;return p2.reduce((function(t,n){return t[n]=e.get(n),t}),{})},setMapboxCameraOption:function(e){null!=e&&p2.forEach((function(t){null!=e[t]&&(this.option[t]=e[t])}),this)},getMapbox:function(){return this._mapbox},setMapbox:function(e){this._mapbox=e}});function g2(e,t){if(this.id=e,this.zr=t,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute;left:0;right:0;top:0;bottom:0;",!mapboxgl)throw new Error("Mapbox GL library must be included. See https://www.mapbox.com/mapbox-gl-js/api/");this._mapbox=new mapboxgl.Map({container:this.dom}),this._initEvents()}R(f2.prototype,tQ),R(f2.prototype,nQ),g2.prototype.setUnpainted=function(){},g2.prototype.resize=function(){this._mapbox.resize()},g2.prototype.getMapbox=function(){return this._mapbox},g2.prototype.clear=function(){},g2.prototype.refresh=function(){this._mapbox.resize()};var m2=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel"];g2.prototype._initEvents=function(){var e=this._mapbox.getCanvasContainer();this._handlers=this._handlers||{contextmenu:function(e){return e.preventDefault(),!1}},m2.forEach((function(t){this._handlers[t]=function(t){var n={};for(var r in t)n[r]=t[r];n.bubbles=!1;var i=new t.constructor(t.type,n);e.dispatchEvent(i)},this.zr.dom.addEventListener(t,this._handlers[t])}),this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},g2.prototype.dispose=function(){m2.forEach((function(e){this.zr.dom.removeEventListener(e,this._handlers[e])}),this)};var v2="\n@export ecgl.displayShadow.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_WorldPosition;\n\nvarying vec3 v_Normal;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n\n v_WorldPosition = (world * vec4(position, 1.0)).xyz;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n\n@end\n\n\n@export ecgl.displayShadow.fragment\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform float roughness: 0.2;\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.ssaoMap.header\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n float shadow = 1.0;\n\n @import ecgl.common.ssaoMap.main\n\n#if defined(DIRECTIONAL_LIGHT_COUNT) && defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n for (int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++) {\n shadow = min(shadow, shadowContribsDir[i] * 0.5 + 0.5);\n }\n#endif\n\n shadow *= 0.5 + ao * 0.5;\n shadow = clamp(shadow, 0.0, 1.0);\n\n gl_FragColor = vec4(vec3(0.0), 1.0 - shadow);\n}\n\n@end";BJ.Shader.import(v2);var y2=Kg.extend({type:"mapbox3D",__ecgl__:!0,init:function(e,t){var n=t.getZr();this._zrLayer=new g2("mapbox3D",n),n.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new BJ.Node,this._sceneHelper=new gQ(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var r=this._zrLayer.getMapbox(),i=this._dispatchInteractAction.bind(this,t,r);["zoom","rotate","drag","pitch","rotate","move"].forEach((function(e){r.on(e,i)})),this._groundMesh=new BJ.Mesh({geometry:new BJ.PlaneGeometry,material:new BJ.Material({shader:new BJ.Shader({vertex:BJ.Shader.source("ecgl.displayShadow.vertex"),fragment:BJ.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},render:function(e,t,n){var r=this._zrLayer.getMapbox(),i=e.get("style"),o=JSON.stringify(i);o!==this._oldStyleStr&&i&&r.setStyle(i),this._oldStyleStr=o,r.setCenter(e.get("center")),r.setZoom(e.get("zoom")),r.setPitch(e.get("pitch")),r.setBearing(e.get("bearing")),e.setMapbox(r);var a=e.coordinateSystem;a.viewGL.scene.add(this._lightRoot),a.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(a.viewGL.scene),this._sceneHelper.updateLight(e),a.viewGL.setPostEffect(e.getModel("postEffect"),n),a.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._mapbox3DModel=e},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n),e.coordinateSystem.viewGL.scene.traverse((function(e){e.material&&(e.material.define("fragment","NORMAL_UP_AXIS",2),e.material.define("fragment","NORMAL_FRONT_AXIS",1))}))},updateCamera:function(e,t,n,r){e.coordinateSystem.setCameraOption(r),this._updateGroundMesh(),n.getZr().refresh()},_dispatchInteractAction:function(e,t,n){e.dispatchAction({type:"mapbox3DChangeCamera",pitch:t.getPitch(),zoom:t.getZoom(),center:t.getCenter().toArray(),bearing:t.getBearing(),mapbox3DId:this._mapbox3DModel&&this._mapbox3DModel.id})},_updateGroundMesh:function(){if(this._mapbox3DModel){var e=this._mapbox3DModel.coordinateSystem,t=e.dataToPoint(e.center);this._groundMesh.position.set(t[0],t[1],-.001);var n=new BJ.Plane(new BJ.Vector3(0,0,1),0),r=e.viewGL.camera.castRay(new BJ.Vector2(-1,-1)),i=e.viewGL.camera.castRay(new BJ.Vector2(1,1)),o=r.intersectPlane(n),a=i.intersectPlane(n),s=o.dist(a)/e.viewGL.rootNode.scale.x;this._groundMesh.scale.set(s,s,1)}},dispose:function(e,t){this._zrLayer&&this._zrLayer.dispose(),t.getZr().painter.delLayer(-1e3)}}),_2=uQ.mat4,x2=512,b2=.6435011087932844,w2=Math.PI,S2=.1;function T2(){this.width=0,this.height=0,this.altitudeScale=1,this.boxHeight="auto",this.altitudeExtent,this.bearing=0,this.pitch=0,this.center=[0,0],this._origin,this.zoom=0,this._initialZoom,this.maxPitch=60,this.zoomOffset=0}function M2(){T2.apply(this,arguments)}function C2(e,t,n){function r(e,t){var n=t.getWidth(),r=t.getHeight(),i=t.getDevicePixelRatio();this.viewGL.setViewport(0,0,n,r,i),this.width=n,this.height=r,this.altitudeScale=e.get("altitudeScale"),this.boxHeight=e.get("boxHeight")}function i(e,t){if("auto"!==this.model.get("boxHeight")){var n=[1/0,-1/0];e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData(),r=e.coordDimToDataDim("alt")[0];if(r){var i=t.getDataExtent(r,!0);n[0]=Math.min(n[0],i[0]),n[1]=Math.max(n[1],i[1])}}}),this),n&&isFinite(n[1]-n[0])&&(this.altitudeExtent=n)}}return{dimensions:t.prototype.dimensions,create:function(o,a){var s=[];return o.eachComponent(e,(function(e){var n=e.__viewGL;n||(n=e.__viewGL=new O0).setRootNode(new BJ.Node);var o=new t;o.viewGL=e.__viewGL,o.resize=r,o.resize(e,a),s.push(o),e.coordinateSystem=o,o.model=e,o.update=i})),o.eachSeries((function(t){if(t.get("coordinateSystem")===e){var n=t.getReferringComponents(e).models[0];if(n||(n=o.getComponent(e)),!n)throw new Error(e+' "'+_J(t.get(e+"Index"),t.get(e+"Id"),0)+'" not found');t.coordinateSystem=n.coordinateSystem}})),n&&n(s,o,a),s}}}T2.prototype={constructor:T2,dimensions:["lng","lat","alt"],containPoint:function(){},setCameraOption:function(e){this.bearing=e.bearing,this.pitch=e.pitch,this.center=e.center,this.zoom=e.zoom,this._origin||(this._origin=this.projectOnTileWithScale(this.center,x2)),null==this._initialZoom&&(this._initialZoom=this.zoom),this.updateTransform()},updateTransform:function(){if(this.height){var e=.5/Math.tan(b2/2)*this.height*S2,t=Math.max(Math.min(this.pitch,this.maxPitch),0)/180*Math.PI,n=b2/2,r=Math.PI/2+t,i=Math.sin(n)*e/Math.sin(Math.PI-r-n),o=1.1*(Math.cos(Math.PI/2-t)*i+e);this.pitch>50&&(o=1e3);var a=[];_2.perspective(a,b2,this.width/this.height,1,o),this.viewGL.camera.projectionMatrix.setArray(a),this.viewGL.camera.decomposeProjectionMatrix();a=_2.identity([]);var s=this.dataToPoint(this.center);_2.scale(a,a,[1,-1,1]),_2.translate(a,a,[0,0,-e]),_2.rotateX(a,a,t),_2.rotateZ(a,a,-this.bearing/180*Math.PI),_2.translate(a,a,[-s[0]*this.getScale()*S2,-s[1]*this.getScale()*S2,0]),this.viewGL.camera.viewMatrix.array=a;var l=[];_2.invert(l,a),this.viewGL.camera.worldTransform.array=l,this.viewGL.camera.decomposeWorldTransform();var u,c=x2*this.getScale();if(this.altitudeExtent&&!isNaN(this.boxHeight)){var h=this.altitudeExtent[1]-this.altitudeExtent[0];u=this.boxHeight/h*this.getScale()/Math.pow(2,this._initialZoom-this.zoomOffset)}else u=c/(2*Math.PI*6378e3*Math.abs(Math.cos(this.center[1]*(Math.PI/180))))*this.altitudeScale*S2;this.viewGL.rootNode.scale.set(this.getScale()*S2,this.getScale()*S2,u)}},getScale:function(){return Math.pow(2,this.zoom-this.zoomOffset)},projectOnTile:function(e,t){return this.projectOnTileWithScale(e,this.getScale()*x2,t)},projectOnTileWithScale:function(e,t,n){var r=e[0],i=e[1]*w2/180,o=t*(r*w2/180+w2)/(2*w2),a=t*(w2-Math.log(Math.tan(w2/4+.5*i)))/(2*w2);return(n=n||[])[0]=o,n[1]=a,n},unprojectFromTile:function(e,t){return this.unprojectOnTileWithScale(e,this.getScale()*x2,t)},unprojectOnTileWithScale:function(e,t,n){var r=e[0],i=e[1],o=r/t*(2*w2)-w2,a=2*(Math.atan(Math.exp(w2-i/t*(2*w2)))-w2/4);return(n=n||[])[0]=180*o/w2,n[1]=180*a/w2,n},dataToPoint:function(e,t){return(t=this.projectOnTileWithScale(e,x2,t))[0]-=this._origin[0],t[1]-=this._origin[1],t[2]=isNaN(e[2])?0:e[2],isNaN(e[2])||(t[2]=e[2],this.altitudeExtent&&(t[2]-=this.altitudeExtent[0])),t}},M2.prototype=new T2,M2.prototype.constructor=M2,M2.prototype.type="mapbox3D";var D2=C2("mapbox3D",M2,(function(e){e.forEach((function(e){e.setCameraOption(e.model.getMapboxCameraOption())}))}));l_((function(e){e.registerComponentModel(f2),e.registerComponentView(y2),e.registerCoordinateSystem("mapbox3D",D2),e.registerAction({type:"mapbox3DChangeCamera",event:"mapbox3dcamerachanged",update:"mapbox3D:updateCamera"},(function(e,t){t.eachComponent({mainType:"mapbox3D",query:e},(function(t){t.setMapboxCameraOption(e)}))}))}));var A2=["zoom","center","pitch","bearing"],I2=tp.extend({type:"maptalks3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,urlTemplate:"http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",attribution:'&copy; <a href="http://osm.org">OpenStreetMap</a> contributors, &copy; <a href="https://carto.com/">CARTO</a>',center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMaptalksCameraOption:function(){var e=this;return A2.reduce((function(t,n){return t[n]=e.get(n),t}),{})},setMaptalksCameraOption:function(e){null!=e&&A2.forEach((function(t){null!=e[t]&&(this.option[t]=e[t])}),this)},getMaptalks:function(){return this._maptalks},setMaptalks:function(e){this._maptalks=e}});function E2(e,t,n,r){if(this.id=e,this.zr=t,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute;left:0;right:0;top:0;bottom:0;",!maptalks)throw new Error("Maptalks library must be included. See https://maptalks.org");this._maptalks=new maptalks.Map(this.dom,{center:n,zoom:r,doubleClickZoom:!1,fog:!1}),this._initEvents()}R(I2.prototype,tQ),R(I2.prototype,nQ),E2.prototype.setUnpainted=function(){},E2.prototype.resize=function(){this._maptalks.checkSize()},E2.prototype.getMaptalks=function(){return this._maptalks},E2.prototype.clear=function(){},E2.prototype.refresh=function(){this._maptalks.checkSize()};var L2=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","DOMMouseScroll","touchstart","touchend","touchmove","touchcancel"];E2.prototype._initEvents=function(){var e=this.dom;this._handlers=this._handlers||{contextmenu:function(e){return e.preventDefault(),!1}},L2.forEach((function(t){this._handlers[t]=function(n){var r={};for(var i in n)r[i]=n[i];r.bubbles=!1;var o=new n.constructor(n.type,r);"mousewheel"===t||"DOMMouseScroll"===t?e.dispatchEvent(o):e.firstElementChild.dispatchEvent(o)},this.zr.dom.addEventListener(t,this._handlers[t])}),this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},E2.prototype.dispose=function(){L2.forEach((function(e){this.zr.dom.removeEventListener(e,this._handlers[e])}),this),this._maptalks.remove()},BJ.Shader.import(v2);var N2=Kg.extend({type:"maptalks3D",__ecgl__:!0,init:function(e,t){this._groundMesh=new BJ.Mesh({geometry:new BJ.PlaneGeometry,material:new BJ.Material({shader:new BJ.Shader({vertex:BJ.Shader.source("ecgl.displayShadow.vertex"),fragment:BJ.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},_initMaptalksLayer:function(e,t){var n=t.getZr();this._zrLayer=new E2("maptalks3D",n,e.get("center"),e.get("zoom")),n.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new BJ.Node,this._sceneHelper=new gQ(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var r=this._zrLayer.getMaptalks(),i=this._dispatchInteractAction.bind(this,t,r);["zoomend","zooming","zoomstart","dragrotating","pitch","pitchend","movestart","moving","moveend","resize","touchstart","touchmove","touchend","animating"].forEach((function(e){r.on(e,i)}))},render:function(e,t,n){this._zrLayer||this._initMaptalksLayer(e,n);var r=this._zrLayer.getMaptalks(),i=e.get("urlTemplate"),o=r.getBaseLayer();i!==this._oldUrlTemplate&&(o?o.setOptions({urlTemplate:i,attribution:e.get("attribution")}):(o=new maptalks.TileLayer("maptalks-echarts-gl-baselayer",{urlTemplate:i,subdomains:["a","b","c"],attribution:e.get("attribution")}),r.setBaseLayer(o))),this._oldUrlTemplate=i,r.setCenter(e.get("center")),r.setZoom(e.get("zoom"),{animation:!1}),r.setPitch(e.get("pitch")),r.setBearing(e.get("bearing")),e.setMaptalks(r);var a=e.coordinateSystem;a.viewGL.scene.add(this._lightRoot),a.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(a.viewGL.scene),this._sceneHelper.updateLight(e),a.viewGL.setPostEffect(e.getModel("postEffect"),n),a.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._maptalks3DModel=e},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n),e.coordinateSystem.viewGL.scene.traverse((function(e){e.material&&(e.material.define("fragment","NORMAL_UP_AXIS",2),e.material.define("fragment","NORMAL_FRONT_AXIS",1))}))},updateCamera:function(e,t,n,r){e.coordinateSystem.setCameraOption(r),this._updateGroundMesh(),n.getZr().refresh()},_dispatchInteractAction:function(e,t,n){var r;e.dispatchAction({type:"maptalks3DChangeCamera",pitch:t.getPitch(),zoom:(r=t.getResolution(),19-Math.log(r/P2)/Math.LN2+1),center:t.getCenter().toArray(),bearing:t.getBearing(),maptalks3DId:this._maptalks3DModel&&this._maptalks3DModel.id})},_updateGroundMesh:function(){if(this._maptalks3DModel){var e=this._maptalks3DModel.coordinateSystem,t=e.dataToPoint(e.center);this._groundMesh.position.set(t[0],t[1],-.001);var n=new BJ.Plane(new BJ.Vector3(0,0,1),0),r=e.viewGL.camera.castRay(new BJ.Vector2(-1,-1)),i=e.viewGL.camera.castRay(new BJ.Vector2(1,1)),o=r.intersectPlane(n),a=i.intersectPlane(n),s=o.dist(a)/e.viewGL.rootNode.scale.x;this._groundMesh.scale.set(s,s,1)}},dispose:function(e,t){this._zrLayer&&this._zrLayer.dispose(),t.getZr().painter.delLayer(-1e3)}});const P2=12756274*Math.PI/(256*Math.pow(2,20));function O2(){T2.apply(this,arguments),this.maxPitch=85,this.zoomOffset=1}O2.prototype=new T2,O2.prototype.constructor=O2,O2.prototype.type="maptalks3D";var R2=C2("maptalks3D",O2,(function(e){e.forEach((function(e){e.setCameraOption(e.model.getMaptalksCameraOption())}))}));l_((function(e){e.registerComponentModel(I2),e.registerComponentView(N2),e.registerCoordinateSystem("maptalks3D",R2),e.registerAction({type:"maptalks3DChangeCamera",event:"maptalks3dcamerachanged",update:"maptalks3D:updateCamera"},(function(e,t){t.eachComponent({mainType:"maptalks3D",query:e},(function(t){t.setMaptalksCameraOption(e)}))}))}));var k2=uQ.vec3,z2=tb.isDimensionStacked;function V2(e,t,n){for(var r=e.getDataExtent(t),i=e.getDataExtent(n),o=r[1]-r[0]||r[0],a=i[1]-i[0]||i[0],s=new Uint8Array(2500),l=0;l<e.count();l++){var u=e.get(t,l),c=e.get(n,l),h=Math.floor((u-r[0])/o*49),d=50*Math.floor((c-i[0])/a*49)+h;s[d]=s[d]||1}var p=0;for(l=0;l<s.length;l++)s[l]&&p++;return p/s.length}var B2=uQ.vec3,F2=tb.isDimensionStacked;function G2(e,t){var n=F2(e,t[2]);return{dimension:n?e.getCalculationInfo("stackResultDimension"):t[2],isStacked:n}}function H2(e){e.registerLayout((function(e,t){e.eachSeriesByType("bar3D",(function(e){var t=e.coordinateSystem,n=t&&t.type;if("globe"===n)!function(e,t){var n=e.getData(),r=e.get("minHeight")||0,i=e.get("barSize"),o=["lng","lat","alt"].map((function(t){return e.coordDimToDataDim(t)[0]}));if(null==i){var a=t.radius*Math.PI,s=V2(n,o[0],o[1]);i=[a/Math.sqrt(n.count()/s),a/Math.sqrt(n.count()/s)]}else J(i)||(i=[i,i]);var l=G2(n,o);n.each(o,(function(e,o,a,s){var u=n.get(l.dimension,s),c=l.isStacked?u-a:t.altitudeAxis.scale.getExtent()[0],h=Math.max(t.altitudeAxis.dataToCoord(a),r),d=t.dataToPoint([e,o,c]),p=t.dataToPoint([e,o,u]),f=B2.sub([],p,d);B2.normalize(f,f);var g=[i[0],h,i[1]];n.setItemLayout(s,[d,f,g])})),n.setLayout("orient",Fq.UP.array)}(e,t);else if("cartesian3D"===n)!function(e,t){var n=e.getData(),r=e.get("barSize");if(null==r){var i,o,a=t.size,s=t.getAxis("x"),l=t.getAxis("y");i="category"===s.type?.7*s.getBandWidth():.6*Math.round(a[0]/Math.sqrt(n.count())),o="category"===l.type?.7*l.getBandWidth():.6*Math.round(a[1]/Math.sqrt(n.count())),r=[i,o]}else J(r)||(r=[r,r]);var u=t.getAxis("z").scale.getExtent(),c=function(e){var t=e[0],n=e[1];return!(t>0&&n>0||t<0&&n<0)}(u),h=["x","y","z"].map((function(t){return e.coordDimToDataDim(t)[0]})),d=z2(n,h[2]),p=d?n.getCalculationInfo("stackResultDimension"):h[2];n.each(h,(function(e,i,o,a){var s=n.get(p,a),l=d?s-o:c?0:u[0],h=t.dataToPoint([e,i,l]),f=t.dataToPoint([e,i,s]),g=k2.dist(h,f),m=[0,f[1]<h[1]?-1:1,0];0===Math.abs(g)&&(g=.1);var v=[r[0],g,r[1]];n.setItemLayout(a,[h,m,v])})),n.setLayout("orient",[1,0,0])}(e,t);else if("geo3D"===n)!function(e,t){var n=e.getData(),r=e.get("barSize"),i=e.get("minHeight")||0,o=["lng","lat","alt"].map((function(t){return e.coordDimToDataDim(t)[0]}));if(null==r){var a=Math.min(t.size[0],t.size[2]),s=V2(n,o[0],o[1]);r=[a/Math.sqrt(n.count()/s),a/Math.sqrt(n.count()/s)]}else J(r)||(r=[r,r]);var l=[0,1,0],u=G2(n,o);n.each(o,(function(e,o,a,s){var c=n.get(u.dimension,s),h=u.isStacked?c-a:t.altitudeAxis.scale.getExtent()[0],d=Math.max(t.altitudeAxis.dataToCoord(a),i),p=t.dataToPoint([e,o,h]),f=[r[0],d,r[1]];n.setItemLayout(s,[p,l,f])})),n.setLayout("orient",[1,0,0])}(e,t);else if("mapbox3D"===n||"maptalks3D"===n)!function(e,t){var n=e.getData(),r=e.coordDimToDataDim("lng")[0],i=e.coordDimToDataDim("lat")[0],o=e.coordDimToDataDim("alt")[0],a=e.get("barSize"),s=e.get("minHeight")||0;if(null==a){var l=n.getDataExtent(r),u=n.getDataExtent(i),c=t.dataToPoint([l[0],u[0]]),h=t.dataToPoint([l[1],u[1]]),d=Math.min(Math.abs(c[0]-h[0]),Math.abs(c[1]-h[1]))||1,p=V2(n,r,i);a=[d/Math.sqrt(n.count()/p),d/Math.sqrt(n.count()/p)]}else J(a)||(a=[a,a]),a[0]/=t.getScale()/16,a[1]/=t.getScale()/16;var f=[0,0,1],g=[r,i,o],m=G2(n,g);n.each(g,(function(e,r,i,o){var l=n.get(m.dimension,o),u=m.isStacked?l-i:0,c=t.dataToPoint([e,r,u]),h=t.dataToPoint([e,r,l]),d=Math.max(h[2]-c[2],s),p=[a[0],d,a[1]];n.setItemLayout(o,[c,f,p])})),n.setLayout("orient",[1,0,0])}(e,t);else if("production"!==process.env.NODE_ENV)throw t?new Error("bar3D doesn't support coordinate system "+t.type):new Error("bar3D doesn't have coordinate system.")}))}))}var U2={};function W2(e,t,n){var r=e.getData(),i=e.getRawValue(t),o=J(i)?function(e){var i=[],o=function(e,t){var n=[];return W(e.dimensions,(function(r){var i=e.getDimensionInfo(r),o=i.otherDims[t];null!=o&&!1!==o&&(n[o]=i.name)})),n}(r,"tooltip");function a(e,t){var o=r.getDimensionInfo(t);if(o&&!1!==o.otherDims.tooltip){var a=o.type,s="- "+(o.tooltipName||o.name)+": "+("ordinal"===a?e+"":"time"===a?n?"":Fd("yyyy/MM/dd hh:mm:ss",e):Nd(e));s&&i.push(dt(s))}}return o.length?W(o,(function(e){a(r.get(e,t),e)})):W(e,a),"<br/>"+i.join("<br/>")}(i):dt(Nd(i)),a=r.getName(t),s=I1(r,t);re(s)&&s.colorStops&&(s=(s.colorStops[0]||{}).color);var l=Bd(s=s||"transparent"),u=e.name;return"\0-"===u&&(u=""),u=u?dt(u)+(n?": ":"<br/>"):"",n?l+u+o:u+l+(a?dt(a)+": "+o:o)}function j2(e,t,n){n=n||e.getSource();var r=t||$y(e.get("coordinateSystem"))||["x","y","z"],i=k_(n,{dimensionsDefine:n.dimensionsDefine||e.get("dimensions"),encodeDefine:n.encodeDefine||e.get("encode"),coordDimensions:r.map((function(t){var n=e.getReferringComponents(t+"Axis3D").models[0];return{type:n&&"category"===n.get("type")?"ordinal":"float",name:t}}))});"cartesian3D"===e.get("coordinateSystem")&&i.forEach((function(t){if(r.indexOf(t.coordDim)>=0){var n=e.getReferringComponents(t.coordDim+"Axis3D").models[0];n&&"category"===n.get("type")&&(t.ordinalMeta=n.getOrdinalMeta())}}));var o=tb.enableDataStack(e,i,{byIndex:!0,stackedCoordDimension:"z"}),a=new R_(i,e);return a.setCalculationInfo(o),a.initData(n),a}U2.getFormattedLabel=function(e,t,n,r,i){n=n||"normal";var o=e.getData(r).getItemModel(t),a=e.getDataParams(t,r);null!=i&&a.value instanceof Array&&(a.value=a.value[i]);var s,l=o.get("normal"===n?["label","formatter"]:["emphasis","label","formatter"]);return null==l&&(l=o.get(["label","formatter"])),"function"==typeof l?(a.status=n,s=l(a)):"string"==typeof l&&(s=Vd(l,a)),s},U2.normalizeToArray=function(e){return e instanceof Array?e:null==e?[]:[e]};var X2=Hg.extend({type:"series.bar3D",dependencies:["globe"],visualStyleAccessPathvisu:"itemStyle",getInitialData:function(e,t){return j2(this)},getFormattedLabel:function(e,t,n,r){var i=U2.getFormattedLabel(this,e,t,n,r);return null==i&&(i=this.getData().get("z",e)),i},formatTooltip:function(e){return W2(this,e)},defaultOption:{coordinateSystem:"cartesian3D",globeIndex:0,grid3DIndex:0,zlevel:-10,bevelSize:0,bevelSmoothness:2,onGridPlane:"xy",shading:"color",minHeight:0,itemStyle:{opacity:1},label:{show:!1,distance:2,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},emphasis:{label:{show:!0}},animationDurationUpdate:500}});R(X2.prototype,Z0);var Y2,Z2,q2,K2,$2,J2,Q2,e3,t3=uQ.vec3,n3=uQ.mat3,r3=XK.extend((function(){return{attributes:{position:new XK.Attribute("position","float",3,"POSITION"),normal:new XK.Attribute("normal","float",3,"NORMAL"),color:new XK.Attribute("color","float",4,"COLOR"),prevPosition:new XK.Attribute("prevPosition","float",3),prevNormal:new XK.Attribute("prevNormal","float",3)},dynamic:!0,enableNormal:!1,bevelSize:1,bevelSegments:0,_dataIndices:null,_vertexOffset:0,_triangleOffset:0}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0},setBarCount:function(e){var t=this.enableNormal,n=this.getBarVertexCount()*e,r=this.getBarTriangleCount()*e;this.vertexCount!==n&&(this.attributes.position.init(n),t?this.attributes.normal.init(n):this.attributes.normal.value=null,this.attributes.color.init(n)),this.triangleCount!==r&&(this.indices=n>65535?new Uint32Array(3*r):new Uint16Array(3*r),this._dataIndices=new Uint32Array(n))},getBarVertexCount:function(){var e=this.bevelSize>0?this.bevelSegments:0;return e>0?this._getBevelBarVertexCount(e):this.enableNormal?24:8},getBarTriangleCount:function(){var e=this.bevelSize>0?this.bevelSegments:0;return e>0?this._getBevelBarTriangleCount(e):12},_getBevelBarVertexCount:function(e){return 4*(e+1)*(e+1)*2},_getBevelBarTriangleCount:function(e){return(4*e+3+1)*(2*e+1)*2+4},setColor:function(e,t){for(var n=this.getBarVertexCount(),r=n*(e+1),i=n*e;i<r;i++)this.attributes.color.set(i,t);this.dirtyAttribute("color")},getDataIndexOfVertex:function(e){return this._dataIndices?this._dataIndices[e]:null},addBar:function(){for(var e=t3.create,t=t3.scaleAndAdd,n=e(),r=e(),i=e(),o=e(),a=e(),s=e(),l=e(),u=[],c=[],h=0;h<8;h++)u[h]=e();var d=[[0,1,5,4],[2,3,7,6],[4,5,6,7],[3,2,1,0],[0,4,7,3],[1,2,6,5]],p=[0,1,2,0,2,3],f=[];for(h=0;h<d.length;h++)for(var g=d[h],m=0;m<2;m++){for(var v=[],y=0;y<3;y++)v.push(g[p[3*m+y]]);f.push(v)}return function(e,h,g,m,v,y){var _=this._vertexOffset;if(this.bevelSize>0&&this.bevelSegments>0)this._addBevelBar(e,h,g,m,this.bevelSize,this.bevelSegments,v);else{t3.copy(i,h),t3.normalize(i,i),t3.cross(o,g,i),t3.normalize(o,o),t3.cross(r,i,o),t3.normalize(o,o),t3.negate(a,r),t3.negate(s,i),t3.negate(l,o),t(u[0],e,r,m[0]/2),t(u[0],u[0],o,m[2]/2),t(u[1],e,r,m[0]/2),t(u[1],u[1],l,m[2]/2),t(u[2],e,a,m[0]/2),t(u[2],u[2],l,m[2]/2),t(u[3],e,a,m[0]/2),t(u[3],u[3],o,m[2]/2),t(n,e,i,m[1]),t(u[4],n,r,m[0]/2),t(u[4],u[4],o,m[2]/2),t(u[5],n,r,m[0]/2),t(u[5],u[5],l,m[2]/2),t(u[6],n,a,m[0]/2),t(u[6],u[6],l,m[2]/2),t(u[7],n,a,m[0]/2),t(u[7],u[7],o,m[2]/2);var x=this.attributes;if(this.enableNormal){c[0]=r,c[1]=a,c[2]=i,c[3]=s,c[4]=o,c[5]=l;for(var b=this._vertexOffset,w=0;w<d.length;w++){for(var S=3*this._triangleOffset,T=0;T<6;T++)this.indices[S++]=b+p[T];b+=4,this._triangleOffset+=2}for(w=0;w<d.length;w++){var M=c[w];for(T=0;T<4;T++){var C=d[w][T];x.position.set(this._vertexOffset,u[C]),x.normal.set(this._vertexOffset,M),x.color.set(this._vertexOffset++,v)}}}else{for(w=0;w<f.length;w++){for(S=3*this._triangleOffset,T=0;T<3;T++)this.indices[S+T]=f[w][T]+this._vertexOffset;this._triangleOffset++}for(w=0;w<u.length;w++)x.position.set(this._vertexOffset,u[w]),x.color.set(this._vertexOffset++,v)}}var D=this._vertexOffset;for(w=_;w<D;w++)this._dataIndices[w]=y}}(),_addBevelBar:(Y2=t3.create(),Z2=t3.create(),q2=t3.create(),K2=n3.create(),$2=[],J2=[1,-1,-1,1],Q2=[1,1,-1,-1],e3=[2,0],function(e,t,n,r,i,o,a){t3.copy(Z2,t),t3.normalize(Z2,Z2),t3.cross(q2,n,Z2),t3.normalize(q2,q2),t3.cross(Y2,Z2,q2),t3.normalize(q2,q2),K2[0]=Y2[0],K2[1]=Y2[1],K2[2]=Y2[2],K2[3]=Z2[0],K2[4]=Z2[1],K2[5]=Z2[2],K2[6]=q2[0],K2[7]=q2[1],K2[8]=q2[2],i=Math.min(r[0],r[2])/2*i;for(var s=0;s<3;s++)$2[s]=Math.max(r[s]-2*i,0);var l=(r[0]-$2[0])/2,u=(r[1]-$2[1])/2,c=(r[2]-$2[2])/2,h=[],d=[],p=this._vertexOffset,f=[];for(s=0;s<2;s++){f[s]=f[s]=[];for(var g=0;g<=o;g++)for(var m=0;m<4;m++){(0===g&&0===s||1===s&&g===o)&&f[s].push(p);for(var v=0;v<=o;v++){var y=v/o*Math.PI/2+Math.PI/2*m,_=g/o*Math.PI/2+Math.PI/2*s;d[0]=l*Math.cos(y)*Math.sin(_),d[1]=u*Math.cos(_),d[2]=c*Math.sin(y)*Math.sin(_),h[0]=d[0]+J2[m]*$2[0]/2,h[1]=d[1]+u+e3[s]*$2[1]/2,h[2]=d[2]+Q2[m]*$2[2]/2,Math.abs(l-u)<1e-6&&Math.abs(u-c)<1e-6||(d[0]/=l*l,d[1]/=u*u,d[2]/=c*c),t3.normalize(d,d),t3.transformMat3(h,h,K2),t3.transformMat3(d,d,K2),t3.add(h,h,e),this.attributes.position.set(p,h),this.enableNormal&&this.attributes.normal.set(p,d),this.attributes.color.set(p,a),p++}}}var x=4*o+3,b=2*o+1,w=x+1;for(m=0;m<b;m++)for(s=0;s<=x;s++){var S=m*w+s+this._vertexOffset,T=m*w+(s+1)%w+this._vertexOffset,M=(m+1)*w+(s+1)%w+this._vertexOffset,C=(m+1)*w+s+this._vertexOffset;this.setTriangleIndices(this._triangleOffset++,[M,S,T]),this.setTriangleIndices(this._triangleOffset++,[M,C,S])}this.setTriangleIndices(this._triangleOffset++,[f[0][0],f[0][2],f[0][1]]),this.setTriangleIndices(this._triangleOffset++,[f[0][0],f[0][3],f[0][2]]),this.setTriangleIndices(this._triangleOffset++,[f[1][0],f[1][1],f[1][2]]),this.setTriangleIndices(this._triangleOffset++,[f[1][0],f[1][2],f[1][3]]),this._vertexOffset=p})});V(r3.prototype,lQ),V(r3.prototype,A1);var i3=uQ.vec3,o3=em.extend({type:"bar3D",__ecgl__:!0,init:function(e,t){this.groupGL=new BJ.Node,this._api=t,this._labelsBuilder=new L1(256,256,t);var n=this;this._labelsBuilder.getLabelPosition=function(e,t,r){if(n._data){var i=n._data.getItemLayout(e),o=i[0],a=i[1],s=i[2][1];return i3.scaleAndAdd([],o,a,r+s)}return[0,0]},this._labelsBuilder.getMesh().renderOrder=100},render:function(e,t,n){var r=this._prevBarMesh;this._prevBarMesh=this._barMesh,this._barMesh=r,this._barMesh||(this._barMesh=new BJ.Mesh({geometry:new r3,shadowDepthMaterial:new BJ.Material({shader:new BJ.Shader(BJ.Shader.source("ecgl.sm.depth.vertex"),BJ.Shader.source("ecgl.sm.depth.fragment"))}),culling:"cartesian3D"===e.coordinateSystem.type,renderOrder:10,renderNormal:!0})),this.groupGL.remove(this._prevBarMesh),this.groupGL.add(this._barMesh),this.groupGL.add(this._labelsBuilder.getMesh());var i=e.coordinateSystem;if(this._doRender(e,n),i&&i.viewGL){i.viewGL.add(this.groupGL);var o=i.viewGL.isLinearSpace()?"define":"undefine";this._barMesh.material[o]("fragment","SRGB_DECODE")}this._data=e.getData(),this._labelsBuilder.updateData(this._data),this._labelsBuilder.updateLabels(),this._updateAnimation(e)},_updateAnimation:function(e){BJ.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevBarMesh,this._barMesh,e)},_doRender:function(e,t){var n=e.getData(),r=e.get("shading"),i="color"!==r,o=this,a=this._barMesh,s="ecgl."+r;a.material&&a.material.shader.name===s||(a.material=BJ.createMaterial(s,["VERTEX_COLOR"])),BJ.setMaterialFromModel(r,a.material,e,t),a.geometry.enableNormal=i,a.geometry.resetOffset();var l=e.get("bevelSize"),u=e.get("bevelSmoothness");a.geometry.bevelSegments=u,a.geometry.bevelSize=l;var c=[],h=new Float32Array(4*n.count()),d=0,p=0,f=!1;n.each((function(e){if(n.hasValue(e)){var t=I1(n,e),r=E1(n,e);null==r&&(r=1),BJ.parseColor(t,c),c[3]*=r,h[d++]=c[0],h[d++]=c[1],h[d++]=c[2],h[d++]=c[3],c[3]>0&&(p++,c[3]<.99&&(f=!0))}})),a.geometry.setBarCount(p);var g=n.getLayout("orient"),m=this._barIndexOfData=new Int32Array(n.count());p=0;n.each((function(e){if(n.hasValue(e)){var t=n.getItemLayout(e),r=t[0],i=t[1],a=t[2],s=4*e;c[0]=h[s++],c[1]=h[s++],c[2]=h[s++],c[3]=h[s++],c[3]>0&&(o._barMesh.geometry.addBar(r,i,g,a,c,e),m[e]=p++)}else m[e]=-1})),a.geometry.dirty(),a.geometry.updateBoundingBox();var v=a.material;v.transparent=f,v.depthMask=!f,a.geometry.sortTriangles=f,this._initHandler(e,t)},_initHandler:function(e,t){var n=e.getData(),r=this._barMesh,i="cartesian3D"===e.coordinateSystem.type;r.seriesIndex=e.seriesIndex;var o=-1;r.off("mousemove"),r.off("mouseout"),r.on("mousemove",(function(e){var a=r.geometry.getDataIndexOfVertex(e.triangle[0]);a!==o&&(this._downplay(o),this._highlight(a),this._labelsBuilder.updateLabels([a]),i&&t.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get("x",a),n.get("y",a),n.get("z",a,!0)]})),o=a,r.dataIndex=a}),this),r.on("mouseout",(function(e){this._downplay(o),this._labelsBuilder.updateLabels(),o=-1,r.dataIndex=-1,i&&t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_highlight:function(e){var t=this._data;if(t){var n=this._barIndexOfData[e];if(!(n<0)){var r=t.getItemModel(e).getModel("emphasis.itemStyle"),i=r.get("color"),o=r.get("opacity");if(null==i)i=or(I1(t,e),-.4);null==o&&(o=E1(t,e));var a=BJ.parseColor(i);a[3]*=o,this._barMesh.geometry.setColor(n,a),this._api.getZr().refresh()}}},_downplay:function(e){var t=this._data;if(t){var n=this._barIndexOfData[e];if(!(n<0)){var r=I1(t,e),i=E1(t,e),o=BJ.parseColor(r);o[3]*=i,this._barMesh.geometry.setColor(n,o),this._api.getZr().refresh()}}},highlight:function(e,t,n,r){this._toggleStatus("highlight",e,t,n,r)},downplay:function(e,t,n,r){this._toggleStatus("downplay",e,t,n,r)},_toggleStatus:function(e,t,n,r,i){var o=t.getData(),a=xJ(o,i),s=this;null!=a?W(U2.normalizeToArray(a),(function(t){"highlight"===e?this._highlight(t):this._downplay(t)}),this):o.each((function(t){"highlight"===e?s._highlight(t):s._downplay(t)}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this._labelsBuilder.dispose(),this.groupGL.removeAll()}});l_((function(e){e.registerChartView(o3),e.registerSeriesModel(X2),H2(e),e.registerProcessor((function(e,t){e.eachSeriesByType("bar3d",(function(e){var t=e.getData();t.filterSelf((function(e){return t.hasValue(e)}))}))}))}));var a3=Hg.extend({type:"series.line3D",dependencies:["grid3D"],visualStyleAccessPath:"lineStyle",visualDrawType:"stroke",getInitialData:function(e,t){return j2(this)},formatTooltip:function(e){return W2(this,e)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,lineStyle:{width:2},animationDurationUpdate:500}}),s3=uQ.vec3;BJ.Shader.import(AQ);var l3=em.extend({type:"line3D",__ecgl__:!0,init:function(e,t){this.groupGL=new BJ.Node,this._api=t},render:function(e,t,n){var r=this._prevLine3DMesh;this._prevLine3DMesh=this._line3DMesh,this._line3DMesh=r,this._line3DMesh||(this._line3DMesh=new BJ.Mesh({geometry:new dQ({useNativeLine:!1,sortTriangles:!0}),material:new BJ.Material({shader:BJ.createShader("ecgl.meshLines3D")}),renderOrder:10}),this._line3DMesh.geometry.pick=this._pick.bind(this)),this.groupGL.remove(this._prevLine3DMesh),this.groupGL.add(this._line3DMesh);var i=e.coordinateSystem;if(i&&i.viewGL){i.viewGL.add(this.groupGL);var o=i.viewGL.isLinearSpace()?"define":"undefine";this._line3DMesh.material[o]("fragment","SRGB_DECODE")}this._doRender(e,n),this._data=e.getData(),this._camera=i.viewGL.camera,this.updateCamera(),this._updateAnimation(e)},updateCamera:function(){this._updateNDCPosition()},_doRender:function(e,t){var n=e.getData(),r=this._line3DMesh;r.geometry.resetOffset();var i=n.getLayout("points"),o=[],a=new Float32Array(i.length/3*4),s=0,l=!1;n.each((function(e){var t=I1(n,e),r=E1(n,e);null==r&&(r=1),BJ.parseColor(t,o),o[3]*=r,a[s++]=o[0],a[s++]=o[1],a[s++]=o[2],a[s++]=o[3],o[3]<.99&&(l=!0)})),r.geometry.setVertexCount(r.geometry.getPolylineVertexCount(i)),r.geometry.setTriangleCount(r.geometry.getPolylineTriangleCount(i)),r.geometry.addPolyline(i,a,_J(e.get("lineStyle.width"),1)),r.geometry.dirty(),r.geometry.updateBoundingBox();var u=r.material;u.transparent=l,u.depthMask=!l;var c=e.getModel("debug.wireframe");c.get("show")?(r.geometry.createAttribute("barycentric","float",3),r.geometry.generateBarycentric(),r.material.set("both","WIREFRAME_TRIANGLE"),r.material.set("wireframeLineColor",BJ.parseColor(c.get("lineStyle.color")||"rgba(0,0,0,0.5)")),r.material.set("wireframeLineWidth",_J(c.get("lineStyle.width"),1))):r.material.set("both","WIREFRAME_TRIANGLE"),this._points=i,this._initHandler(e,t)},_updateAnimation:function(e){BJ.updateVertexAnimation([["prevPosition","position"],["prevPositionPrev","positionPrev"],["prevPositionNext","positionNext"]],this._prevLine3DMesh,this._line3DMesh,e)},_initHandler:function(e,t){var n=e.getData(),r=e.coordinateSystem,i=this._line3DMesh,o=-1;i.seriesIndex=e.seriesIndex,i.off("mousemove"),i.off("mouseout"),i.on("mousemove",(function(e){var a=r.pointToData(e.point.array),s=n.indicesOfNearest("x",a[0])[0];s!==o&&(t.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get("x",s),n.get("y",s),n.get("z",s)]}),i.dataIndex=s),o=s}),this),i.on("mouseout",(function(e){o=-1,i.dataIndex=-1,t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_updateNDCPosition:function(){var e=new aK,t=this._camera;aK.multiply(e,t.projectionMatrix,t.viewMatrix);var n=this._positionNDC,r=this._points,i=r.length/3;n&&n.length/2===i||(n=this._positionNDC=new Float32Array(2*i));for(var o=[],a=0;a<i;a++){var s=3*a,l=2*a;o[0]=r[s],o[1]=r[s+1],o[2]=r[s+2],o[3]=1,s3.transformMat4(o,o,e.array),n[l]=o[0]/o[3],n[l+1]=o[1]/o[3]}},_pick:function(e,t,n,r,i,o){var a=this._positionNDC,s=this._data.hostModel.get("lineStyle.width"),l=-1,u=.5*n.viewport.width,c=.5*n.viewport.height;e=(e+1)*u,t=(t+1)*c;for(var h=1;h<a.length/2;h++){var d=(a[2*(h-1)]+1)*u,p=(a[2*(h-1)+1]+1)*c,f=(a[2*h]+1)*u,g=(a[2*h+1]+1)*c;if(As(d,p,f,g,s,e,t))l=(d-e)*(d-e)+(p-t)*(p-t)<(f-e)*(f-e)+(g-t)*(g-t)?h-1:h}if(l>=0){var m=3*l,v=new Fq(this._points[m],this._points[m+1],this._points[m+2]);o.push({dataIndex:l,point:v,pointWorld:v.clone(),target:this._line3DMesh,distance:this._camera.getWorldPosition().dist(v)})}},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}});l_((function(e){e.registerChartView(l3),e.registerSeriesModel(a3),e.registerLayout((function(e,t){e.eachSeriesByType("line3D",(function(e){var t=e.getData(),n=e.coordinateSystem;if(n){if("cartesian3D"!==n.type)return void("production"!==process.env.NODE_ENV&&console.error("line3D needs cartesian3D coordinateSystem"));var r=new Float32Array(3*t.count()),i=[],o=[],a=n.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]}));n&&t.each(a,(function(e,t,a,s){i[0]=e,i[1]=t,i[2]=a,n.dataToPoint(i,o),r[3*s]=o[0],r[3*s+1]=o[1],r[3*s+2]=o[2]})),t.setLayout("points",r)}}))}))}));var u3=Hg.extend({type:"series.scatter3D",dependencies:["globe","grid3D","geo3D"],visualStyleAccessPath:"itemStyle",hasSymbolVisual:!0,getInitialData:function(e,t){return j2(this)},getFormattedLabel:function(e,t,n,r){var i=U2.getFormattedLabel(this,e,t,n,r);if(null==i){var o=this.getData(),a=o.dimensions[o.dimensions.length-1];i=o.get(a,e)}return i},formatTooltip:function(e){return W2(this,e)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,progressive:1e5,progressiveThreshold:1e5,grid3DIndex:0,globeIndex:0,symbol:"circle",symbolSize:10,blendMode:"source-over",label:{show:!1,position:"right",distance:5,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},itemStyle:{opacity:.8},emphasis:{label:{show:!0}},animationDurationUpdate:500}});function c3(e,t,n){(t=t||document.createElement("canvas")).width=e,t.height=e;var r=t.getContext("2d");return n&&n(r),t}var h3={getMarginByStyle:function(e){var t=e.minMargin||0,n=0;e.stroke&&"none"!==e.stroke&&(n=null==e.lineWidth?1:e.lineWidth);var r=e.shadowBlur||0,i=e.shadowOffsetX||0,o=e.shadowOffsetY||0,a={};return a.left=Math.max(n/2,-i+r,t),a.right=Math.max(n/2,i+r,t),a.top=Math.max(n/2,-o+r,t),a.bottom=Math.max(n/2,o+r,t),a},createSymbolSprite:function(e,t,n,r){var i=function(e,t,n,r){J(t)||(t=[t,t]);var i=h3.getMarginByStyle(n,r),o=t[0]+i.left+i.right,a=t[1]+i.top+i.bottom,s=dv(e,0,0,t[0],t[1]),l=Math.max(o,a);s.x=i.left,s.y=i.top,o>a?s.y+=(l-a)/2:s.x+=(l-o)/2;var u=s.getBoundingRect();return s.x-=u.x,s.y-=u.y,s.setStyle(n),s.update(),s.__size=l,s}(e,t,n),o=h3.getMarginByStyle(n);return{image:c3(i.__size,r,(function(e){Ov(e,i)})),margin:o}},createSDFFromCanvas:function(e,t,n,r){return c3(t,r,(function(t){var r=e.getContext("2d").getImageData(0,0,e.width,e.height);t.putImageData(function(e,t,n){var r=t.width,i=t.height,o=e.canvas.width,a=e.canvas.height,s=r/o,l=i/a;function u(e){return e<128?1:-1}function c(e,o){var a=1/0;e=Math.floor(e*s);for(var c=(o=Math.floor(o*l))*r+e,h=u(t.data[4*c]),d=Math.max(o-n,0);d<Math.min(o+n,i);d++)for(var p=Math.max(e-n,0);p<Math.min(e+n,r);p++){c=d*r+p;var f=p-e,g=d-o;if(h!==u(t.data[4*c])){var m=f*f+g*g;m<a&&(a=m)}}return h*Math.sqrt(a)}for(var h=e.createImageData(o,a),d=0;d<a;d++)for(var p=0;p<o;p++){var f=c(p,d)/n*.5+.5,g=4*(d*o+p);h.data[g++]=255*(1-f),h.data[g++]=255*(1-f),h.data[g++]=255*(1-f),h.data[g++]=255}return h}(t,r,n),0,0)}))},createSimpleSprite:function(e,t){return c3(e,t,(function(t){var n=e/2;t.beginPath(),t.arc(n,n,60,0,2*Math.PI,!1),t.closePath();var r=t.createRadialGradient(n,n,0,n,n,n);r.addColorStop(0,"rgba(255, 255, 255, 1)"),r.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),r.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=r,t.fill()}))}},d3=uQ.vec3,p3={needsSortVertices:function(){return this.sortVertices},needsSortVerticesProgressively:function(){return this.needsSortVertices()&&this.vertexCount>=2e4},doSortVertices:function(e,t){var n=this.indices,r=d3.create();if(!n){n=this.indices=this.vertexCount>65535?new Uint32Array(this.vertexCount):new Uint16Array(this.vertexCount);for(var i=0;i<n.length;i++)n[i]=i}if(0===t){var o,a=this.attributes.position,s=(e=e.array,0);this._zList&&this._zList.length===this.vertexCount||(this._zList=new Float32Array(this.vertexCount));for(i=0;i<this.vertexCount;i++){a.get(i,r);var l=d3.sqrDist(r,e);isNaN(l)&&(l=1e7,s++),0===i?(o=l,l=0):l-=o,this._zList[i]=l}this._noneCount=s}if(this.vertexCount<2e4)0===t&&this._simpleSort(this._noneCount/this.vertexCount>.05);else for(i=0;i<3;i++)this._progressiveQuickSort(3*t+i);this.dirtyIndices()},_simpleSort:function(e){var t=this._zList,n=this.indices;function r(e,n){return t[n]-t[e]}e?Array.prototype.sort.call(n,r):S1.sort(n,r,0,n.length-1)},_progressiveQuickSort:function(e){var t=this._zList,n=this.indices;this._quickSort=this._quickSort||new S1,this._quickSort.step(n,(function(e,n){return t[n]-t[e]}),e)}},f3=uQ.vec4;BJ.Shader.import("@export ecgl.sdfSprite.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform float elapsedTime : 0;\n\nattribute vec3 position : POSITION;\n\n#ifdef VERTEX_SIZE\nattribute float size;\n#else\nuniform float u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_FillColor: COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute float prevSize;\nuniform float percent : 1.0;\n#endif\n\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvarying float v_Size;\n\nvoid main()\n{\n\n#ifdef POSITIONTEXTURE_ENABLED\n gl_Position = worldViewProjection * vec4(texture2D(positionTexture, position.xy).xy, -10.0, 1.0);\n#else\n\n #ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n #else\n vec3 pos = position;\n #endif\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n#endif\n\n#ifdef VERTEX_SIZE\n#ifdef VERTEX_ANIMATION\n v_Size = mix(prevSize, size, percent);\n#else\n v_Size = size;\n#endif\n#else\n v_Size = u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\n v_Color = a_FillColor;\n #endif\n\n gl_PointSize = v_Size;\n}\n\n@end\n\n@export ecgl.sdfSprite.fragment\n\nuniform vec4 color: [1, 1, 1, 1];\nuniform vec4 strokeColor: [1, 1, 1, 1];\nuniform float smoothing: 0.07;\n\nuniform float lineWidth: 0.0;\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\nvarying float v_Size;\n\nuniform sampler2D sprite;\n\n@import clay.util.srgb\n\nvoid main()\n{\n gl_FragColor = color;\n\n vec4 _strokeColor = strokeColor;\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n #endif\n\n#ifdef SPRITE_ENABLED\n float d = texture2D(sprite, gl_PointCoord).r;\n gl_FragColor.a *= smoothstep(0.5 - smoothing, 0.5 + smoothing, d);\n\n if (lineWidth > 0.0) {\n float sLineWidth = lineWidth / 2.0;\n\n float outlineMaxValue0 = 0.5 + sLineWidth;\n float outlineMaxValue1 = 0.5 + sLineWidth + smoothing;\n float outlineMinValue0 = 0.5 - sLineWidth - smoothing;\n float outlineMinValue1 = 0.5 - sLineWidth;\n\n if (d <= outlineMaxValue1 && d >= outlineMinValue0) {\n float a = _strokeColor.a;\n if (d <= outlineMinValue1) {\n a = a * smoothstep(outlineMinValue0, outlineMinValue1, d);\n }\n else {\n a = a * smoothstep(outlineMaxValue1, outlineMaxValue0, d);\n }\n gl_FragColor.rgb = mix(gl_FragColor.rgb * gl_FragColor.a, _strokeColor.rgb, a);\n gl_FragColor.a = gl_FragColor.a * (1.0 - a) + a;\n }\n }\n#endif\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(gl_FragColor);\n#endif\n}\n@end");var g3=BJ.Mesh.extend((function(){var e=new BJ.Geometry({dynamic:!0,attributes:{color:new BJ.Geometry.Attribute("color","float",4,"COLOR"),position:new BJ.Geometry.Attribute("position","float",3,"POSITION"),size:new BJ.Geometry.Attribute("size","float",1),prevPosition:new BJ.Geometry.Attribute("prevPosition","float",3),prevSize:new BJ.Geometry.Attribute("prevSize","float",1)}});Object.assign(e,p3);var t=new BJ.Material({shader:BJ.createShader("ecgl.sdfSprite"),transparent:!0,depthMask:!1});t.enableTexture("sprite"),t.define("both","VERTEX_COLOR"),t.define("both","VERTEX_SIZE");var n=new BJ.Texture2D({image:document.createElement("canvas"),flipY:!1});return t.set("sprite",n),e.pick=this._pick.bind(this),{geometry:e,material:t,mode:BJ.Mesh.POINTS,sizeScale:1}}),{_pick:function(e,t,n,r,i,o){var a=this._positionNDC;if(a)for(var s=n.viewport,l=2/s.width,u=2/s.height,c=this.geometry.vertexCount-1;c>=0;c--){var h,d=a[2*(h=this.geometry.indices?this.geometry.indices[c]:c)],p=a[2*h+1],f=this.geometry.attributes.size.get(h)/this.sizeScale/2;if(e>d-f*l&&e<d+f*l&&t>p-f*u&&t<p+f*u){var g=new BJ.Vector3,m=new BJ.Vector3;this.geometry.attributes.position.get(h,g.array),BJ.Vector3.transformMat4(m,g,this.worldTransform),o.push({vertexIndex:h,point:g,pointWorld:m,target:this,distance:m.distance(r.getWorldPosition())})}}},updateNDCPosition:function(e,t,n){var r=this._positionNDC,i=this.geometry;r&&r.length/2===i.vertexCount||(r=this._positionNDC=new Float32Array(2*i.vertexCount));for(var o=f3.create(),a=0;a<i.vertexCount;a++)i.attributes.position.get(a,o),o[3]=1,f3.transformMat4(o,o,e.array),f3.scale(o,o,1/o[3]),r[2*a]=o[0],r[2*a+1]=o[1]}});function m3(e,t){this.rootNode=new BJ.Node,this.is2D=e,this._labelsBuilder=new L1(256,256,t),this._labelsBuilder.getMesh().renderOrder=100,this.rootNode.add(this._labelsBuilder.getMesh()),this._api=t,this._spriteImageCanvas=document.createElement("canvas"),this._startDataIndex=0,this._endDataIndex=0,this._sizeScale=1}m3.prototype={constructor:m3,highlightOnMouseover:!0,update:function(e,t,n,r,i){var o=this._prevMesh;this._prevMesh=this._mesh,this._mesh=o;var a=e.getData();if(null==r&&(r=0),null==i&&(i=a.count()),this._startDataIndex=r,this._endDataIndex=i-1,!this._mesh){var s=this._prevMesh&&this._prevMesh.material;this._mesh=new g3({renderOrder:10,frustumCulling:!1}),s&&(this._mesh.material=s)}s=this._mesh.material;var l=this._mesh.geometry,u=l.attributes;this.rootNode.remove(this._prevMesh),this.rootNode.add(this._mesh),this._setPositionTextureToMesh(this._mesh,this._positionTexture);var c=this._getSymbolInfo(e,r,i),h=n.getDevicePixelRatio(),d=e.getModel("itemStyle").getItemStyle(),p=e.get("large"),f=1;c.maxSize>2?(f=this._updateSymbolSprite(e,d,c,h),s.enableTexture("sprite")):s.disableTexture("sprite"),u.position.init(i-r);var g=[];if(p){s.undefine("VERTEX_SIZE"),s.undefine("VERTEX_COLOR");var m=function(e){const t=e.getVisual("style");if(t)return t[e.getVisual("drawType")]}(a),v=function(e){return e.getVisual("style").opacity}(a);BJ.parseColor(m,g),g[3]*=v,s.set({color:g,u_Size:c.maxSize*this._sizeScale})}else s.set({color:[1,1,1,1]}),s.define("VERTEX_SIZE"),s.define("VERTEX_COLOR"),u.size.init(i-r),u.color.init(i-r),this._originalOpacity=new Float32Array(i-r);for(var y=a.getLayout("points"),_=u.position.value,x=0;x<i-r;x++){var b=3*x,w=2*x;if(this.is2D?(_[b]=y[w],_[b+1]=y[w+1],_[b+2]=-10):(_[b]=y[b],_[b+1]=y[b+1],_[b+2]=y[b+2]),!p){m=I1(a,x),v=E1(a,x);BJ.parseColor(m,g),g[3]*=v,u.color.set(x,g),g[3];var S=a.getItemVisual(x,"symbolSize");S=S instanceof Array?Math.max(S[0],S[1]):S,isNaN(S)&&(S=0),u.size.value[x]=S*f*this._sizeScale,this._originalOpacity[x]=g[3]}}this._mesh.sizeScale=f,l.updateBoundingBox(),l.dirty(),this._updateMaterial(e,d);var T=e.coordinateSystem;T&&T.viewGL&&s[T.viewGL.isLinearSpace()?"define":"undefine"]("fragment","SRGB_DECODE");p||this._updateLabelBuilder(e,r,i),this._updateHandler(e,t,n),this._updateAnimation(e),this._api=n},getPointsMesh:function(){return this._mesh},updateLabels:function(e){this._labelsBuilder.updateLabels(e)},hideLabels:function(){this.rootNode.remove(this._labelsBuilder.getMesh())},showLabels:function(){this.rootNode.add(this._labelsBuilder.getMesh())},dispose:function(){this._labelsBuilder.dispose()},_updateSymbolSprite:function(e,t,n,r){n.maxSize=Math.min(2*n.maxSize,200);var i,o,a=[];return n.aspect>1?(a[0]=n.maxSize,a[1]=n.maxSize/n.aspect):(a[1]=n.maxSize,a[0]=n.maxSize*n.aspect),a[0]=a[0]||1,a[1]=a[1]||1,this._symbolType===n.type&&(i=this._symbolSize,o=a,i&&o&&i[0]===o[0]&&i[1]===o[1])&&this._lineWidth===t.lineWidth||(h3.createSymbolSprite(n.type,a,{fill:"#fff",lineWidth:t.lineWidth,stroke:"transparent",shadowColor:"transparent",minMargin:Math.min(a[0]/2,10)},this._spriteImageCanvas),h3.createSDFFromCanvas(this._spriteImageCanvas,Math.min(this._spriteImageCanvas.width,32),20,this._mesh.material.get("sprite").image),this._symbolType=n.type,this._symbolSize=a,this._lineWidth=t.lineWidth),this._spriteImageCanvas.width/n.maxSize*r},_updateMaterial:function(e,t){var n="lighter"===e.get("blendMode")?BJ.additiveBlend:null,r=this._mesh.material;r.blend=n,r.set("lineWidth",t.lineWidth/20);var i=BJ.parseColor(t.stroke);r.set("strokeColor",i),r.transparent=!0,r.depthMask=!1,r.depthTest=!this.is2D,r.sortVertices=!this.is2D},_updateLabelBuilder:function(e,t,n){var r=e.getData(),i=this._mesh.geometry,o=i.attributes.position.value,a=(t=this._startDataIndex,this._mesh.sizeScale);this._labelsBuilder.updateData(r,t,n),this._labelsBuilder.getLabelPosition=function(e,n,r){var i=3*(e-t);return[o[i],o[i+1],o[i+2]]},this._labelsBuilder.getLabelDistance=function(e,n,r){return i.attributes.size.get(e-t)/a/2+r},this._labelsBuilder.updateLabels()},_updateAnimation:function(e){BJ.updateVertexAnimation([["prevPosition","position"],["prevSize","size"]],this._prevMesh,this._mesh,e)},_updateHandler:function(e,t,n){var r,i=e.getData(),o=this._mesh,a=this,s=-1,l=e.coordinateSystem&&"cartesian3D"===e.coordinateSystem.type;l&&(r=e.coordinateSystem.model),o.seriesIndex=e.seriesIndex,o.off("mousemove"),o.off("mouseout"),o.on("mousemove",(function(t){var u=t.vertexIndex+a._startDataIndex;u!==s&&(this.highlightOnMouseover&&(this.downplay(i,s),this.highlight(i,u),this._labelsBuilder.updateLabels([u])),l&&n.dispatchAction({type:"grid3DShowAxisPointer",value:[i.get(e.coordDimToDataDim("x")[0],u),i.get(e.coordDimToDataDim("y")[0],u),i.get(e.coordDimToDataDim("z")[0],u)],grid3DIndex:r.componentIndex})),o.dataIndex=u,s=u}),this),o.on("mouseout",(function(e){var t=e.vertexIndex+a._startDataIndex;this.highlightOnMouseover&&(this.downplay(i,t),this._labelsBuilder.updateLabels()),s=-1,o.dataIndex=-1,l&&n.dispatchAction({type:"grid3DHideAxisPointer",grid3DIndex:r.componentIndex})}),this)},updateLayout:function(e,t,n){var r=e.getData();if(this._mesh){var i=this._mesh.geometry.attributes.position.value,o=r.getLayout("points");if(this.is2D)for(var a=0;a<o.length/2;a++){var s=3*a,l=2*a;i[s]=o[l],i[s+1]=o[l+1],i[s+2]=-10}else for(a=0;a<o.length;a++)i[a]=o[a];this._mesh.geometry.dirty(),n.getZr().refresh()}},updateView:function(e){if(this._mesh){var t=new aK;aK.mul(t,e.viewMatrix,this._mesh.worldTransform),aK.mul(t,e.projectionMatrix,t),this._mesh.updateNDCPosition(t,this.is2D,this._api)}},highlight:function(e,t){if(!(t>this._endDataIndex||t<this._startDataIndex)){var n=e.getItemModel(t).getModel("emphasis.itemStyle"),r=n.get("color"),i=n.get("opacity");if(null==r)r=or(I1(e,t),-.4);null==i&&(i=E1(e,t));var o=BJ.parseColor(r);o[3]*=i,this._mesh.geometry.attributes.color.set(t-this._startDataIndex,o),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},downplay:function(e,t){if(!(t>this._endDataIndex||t<this._startDataIndex)){var n=I1(e,t),r=E1(e,t),i=BJ.parseColor(n);i[3]*=r,this._mesh.geometry.attributes.color.set(t-this._startDataIndex,i),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeOutAll:function(e){if(this._originalOpacity){for(var t=this._mesh.geometry,n=0;n<t.vertexCount;n++){var r=this._originalOpacity[n]*e;t.attributes.color.value[4*n+3]=r}t.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeInAll:function(){this.fadeOutAll(1)},setPositionTexture:function(e){this._mesh&&this._setPositionTextureToMesh(this._mesh,e),this._positionTexture=e},removePositionTexture:function(){this._positionTexture=null,this._mesh&&this._setPositionTextureToMesh(this._mesh,null)},setSizeScale:function(e){if(e!==this._sizeScale){if(this._mesh){var t=this._mesh.material.get("u_Size");this._mesh.material.set("u_Size",t/this._sizeScale*e);var n=this._mesh.geometry.attributes;if(n.size.value)for(var r=0;r<n.size.value.length;r++)n.size.value[r]=n.size.value[r]/this._sizeScale*e}this._sizeScale=e}},_setPositionTextureToMesh:function(e,t){t&&e.material.set("positionTexture",t),e.material[t?"enableTexture":"disableTexture"]("positionTexture")},_getSymbolInfo:function(e,t,n){if(e.get("large"))return(h=_J(e.get("symbolSize"),1))instanceof Array?(l=Math.max(h[0],h[1]),r=h[0]/h[1]):(l=h,r=1),{maxSize:h,type:e.get("symbol"),aspect:r};for(var r,i=e.getData(),o=!1,a=i.getItemVisual(0,"symbol")||"circle",s=!1,l=0,u=t;u<n;u++){var c,h=i.getItemVisual(u,"symbolSize"),d=i.getItemVisual(u,"symbol");if(h instanceof Array)c=h[0]/h[1],l=Math.max(Math.max(h[0],h[1]),l);else{if(isNaN(h))continue;c=1,l=Math.max(h,l)}"production"!==process.env.NODE_ENV&&(null!=r&&Math.abs(c-r)>.05&&(o=!0),d!==a&&(s=!0)),a=d,r=c}return"production"!==process.env.NODE_ENV&&(o&&console.warn("Different symbol width / height ratio will be ignored."),s&&console.warn("Different symbol type will be ignored.")),{maxSize:l,type:a,aspect:r}}};var v3=em.extend({type:"scatter3D",hasSymbolVisual:!0,__ecgl__:!0,init:function(e,t){this.groupGL=new BJ.Node,this._pointsBuilderList=[],this._currentStep=0},render:function(e,t,n){if(this.groupGL.removeAll(),e.getData().count()){var r=e.coordinateSystem;if(r&&r.viewGL){r.viewGL.add(this.groupGL),this._camera=r.viewGL.camera;var i=this._pointsBuilderList[0];i||(i=this._pointsBuilderList[0]=new m3(!1,n)),this._pointsBuilderList.length=1,this.groupGL.add(i.rootNode),i.update(e,t,n),i.updateView(r.viewGL.camera)}else if("production"!==process.env.NODE_ENV)throw new Error("Invalid coordinate system")}},incrementalPrepareRender:function(e,t,n){var r=e.coordinateSystem;if(r&&r.viewGL)r.viewGL.add(this.groupGL),this._camera=r.viewGL.camera;else if("production"!==process.env.NODE_ENV)throw new Error("Invalid coordinate system");this.groupGL.removeAll(),this._currentStep=0},incrementalRender:function(e,t,n,r){if(!(e.end<=e.start)){var i=this._pointsBuilderList[this._currentStep];i||(i=new m3(!1,r),this._pointsBuilderList[this._currentStep]=i),this.groupGL.add(i.rootNode),i.update(t,n,r,e.start,e.end),i.updateView(t.coordinateSystem.viewGL.camera),this._currentStep++}},updateCamera:function(){this._pointsBuilderList.forEach((function(e){e.updateView(this._camera)}),this)},highlight:function(e,t,n,r){this._toggleStatus("highlight",e,t,n,r)},downplay:function(e,t,n,r){this._toggleStatus("downplay",e,t,n,r)},_toggleStatus:function(e,t,n,r,i){var o=t.getData(),a=xJ(o,i),s="highlight"===e;null!=a?W(U2.normalizeToArray(a),(function(e){for(var t=0;t<this._pointsBuilderList.length;t++){var n=this._pointsBuilderList[t];s?n.highlight(o,e):n.downplay(o,e)}}),this):o.each((function(e){for(var t=0;t<this._pointsBuilderList.length;t++){var n=this._pointsBuilderList[t];s?n.highlight(o,e):n.downplay(o,e)}}))},dispose:function(){this._pointsBuilderList.forEach((function(e){e.dispose()})),this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});l_((function(e){e.registerChartView(v3),e.registerSeriesModel(u3),e.registerLayout({seriesType:"scatter3D",reset:function(e){var t=e.coordinateSystem;if(t){var n=t.dimensions;if(n.length<3)return void("production"!==process.env.NODE_ENV&&console.error("scatter3D needs 3D coordinateSystem"));var r=n.map((function(t){return e.coordDimToDataDim(t)[0]})),i=[],o=[];return{progress:function(e,n){for(var a=new Float32Array(3*(e.end-e.start)),s=e.start;s<e.end;s++){var l=3*(s-e.start);i[0]=n.get(r[0],s),i[1]=n.get(r[1],s),i[2]=n.get(r[2],s),t.dataToPoint(i,o),a[l]=o[0],a[l+1]=o[1],a[l+2]=o[2]}n.setLayout("points",a)}}}}})}));var y3=uQ.vec3,_3=uQ.vec2,x3=y3.normalize,b3=y3.cross,w3=y3.sub,S3=y3.add,T3=y3.create,M3=T3(),C3=T3(),D3=T3(),A3=T3(),I3=[],E3=[];function L3(e,t){_3.copy(I3,e[0]),_3.copy(E3,e[1]);var n=[],r=n[0]=T3(),i=n[1]=T3(),o=n[2]=T3(),a=n[3]=T3();t.dataToPoint(I3,r),t.dataToPoint(E3,a),x3(M3,r),w3(C3,a,r),x3(C3,C3),b3(D3,C3,M3),x3(D3,D3),b3(C3,M3,D3),S3(i,M3,C3),x3(i,i),x3(M3,a),w3(C3,r,a),x3(C3,C3),b3(D3,C3,M3),x3(D3,D3),b3(C3,M3,D3),S3(o,M3,C3),x3(o,o),S3(A3,r,a),x3(A3,A3);var s=y3.dot(r,A3),l=y3.dot(A3,i),u=(Math.max(y3.len(r),y3.len(a))-s)/l*2;return y3.scaleAndAdd(i,r,i,u),y3.scaleAndAdd(o,a,o,u),n}function N3(e,t){for(var n=new Float32Array(3*e.length),r=0,i=[],o=0;o<e.length;o++)t.dataToPoint(e[o],i),n[r++]=i[0],n[r++]=i[1],n[r++]=i[2];return n}function P3(e){var t=[];return e.each((function(n){var r=e.getItemModel(n),i=r.option instanceof Array?r.option:r.getShallow("coords",!0);if("production"!==process.env.NODE_ENV&&!(i instanceof Array&&i.length>0&&i[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(i)+". Lines must have 2d coords array in data item.");t.push(i)})),{coordsList:t}}function O3(e,t,n){var r=e.getData(),i=e.get("polyline"),o=P3(r);r.setLayout("lineType",i?"polyline":"cubicBezier"),r.each((function(e){var a=o.coordsList[e],s=i?N3(a,t):function(e,t,n){var r=[],i=r[0]=y3.create(),o=r[1]=y3.create(),a=r[2]=y3.create(),s=r[3]=y3.create();t.dataToPoint(e[0],i),t.dataToPoint(e[1],s);var l=y3.dist(i,s);return y3.lerp(o,i,s,.3),y3.lerp(a,i,s,.3),y3.scaleAndAdd(o,o,n,Math.min(.1*l,10)),y3.scaleAndAdd(a,a,n,Math.min(.1*l,10)),r}(a,t,n);r.setItemLayout(e,s)}))}function R3(e,t){e.eachSeriesByType("lines3D",(function(e){var t=e.coordinateSystem;"globe"===t.type?function(e,t){var n=e.getData(),r=e.get("polyline");n.setLayout("lineType",r?"polyline":"cubicBezier");var i=P3(n);n.each((function(e){var o=i.coordsList[e],a=r?N3:L3;n.setItemLayout(e,a(o,t))}))}(e,t):"geo3D"===t.type?O3(e,t,[0,1,0]):"mapbox3D"!==t.type&&"maptalks3D"!==t.type||O3(e,t,[0,0,1])}))}var k3=Hg.extend({type:"series.lines3D",dependencies:["globe"],visualStyleAccessPath:"lineStyle",visualDrawType:"stroke",getInitialData:function(e,t){var n=new R_(["value"],this);return n.hasItemOption=!1,n.initData(e.data,[],(function(e,t,r,i){if(e instanceof Array)return NaN;n.hasItemOption=!0;var o=e.value;return null!=o?o instanceof Array?o[i]:o:void 0})),n},defaultOption:{coordinateSystem:"globe",globeIndex:0,geo3DIndex:0,zlevel:-10,polyline:!1,effect:{show:!1,period:4,trailWidth:4,trailLength:.2,spotIntensity:6},silent:!0,blendMode:"source-over",lineStyle:{width:1,opacity:.5}}}),z3=uQ.vec3;BJ.Shader.import("@export ecgl.trail2.vertex\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute float dist;\nattribute float distAll;\nattribute float start;\n\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nuniform float speed : 0;\nuniform float trailLength: 0.3;\nuniform float time;\nuniform float period: 1000;\n\nuniform float spotSize: 1;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n\n#ifdef CONSTANT_SPEED\n float t = mod((speed * time + start) / distAll, 1. + trailLength) - trailLength;\n#else\n float t = mod((time + start) / period, 1. + trailLength) - trailLength;\n#endif\n\n float trailLen = distAll * trailLength;\n\n v_Percent = (dist - t * distAll) / trailLen;\n\n v_SpotPercent = spotSize / distAll;\n\n }\n@end\n\n\n@export ecgl.trail2.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform float spotIntensity: 5;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n if (v_Percent > 1.0 || v_Percent < 0.0) {\n discard;\n }\n\n float fade = v_Percent;\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n\n if (v_Percent > (1.0 - v_SpotPercent)) {\n gl_FragColor.rgb *= spotIntensity;\n }\n\n gl_FragColor.a *= fade;\n}\n\n@end");var V3=BJ.Mesh.extend((function(){var e=new BJ.Material({shader:new BJ.Shader(BJ.Shader.source("ecgl.trail2.vertex"),BJ.Shader.source("ecgl.trail2.fragment")),transparent:!0,depthMask:!1}),t=new dQ({dynamic:!0});return t.createAttribute("dist","float",1),t.createAttribute("distAll","float",1),t.createAttribute("start","float",1),{geometry:t,material:e,culling:!1,$ignorePicking:!0}}),{updateData:function(e,t,n){var r=e.hostModel,i=this.geometry,o=r.getModel("effect"),a=o.get("trailWidth")*t.getDevicePixelRatio(),s=o.get("trailLength"),l=r.get("effect.constantSpeed"),u=1e3*r.get("effect.period"),c=null!=l;"production"!==process.env.NODE_ENV&&(this.getScene()||console.error("TrailMesh must been add to scene before updateData")),c?this.material.set("speed",l/1e3):this.material.set("period",u),this.material[c?"define":"undefine"]("vertex","CONSTANT_SPEED");var h=r.get("polyline");i.trailLength=s,this.material.set("trailLength",s),i.resetOffset(),["position","positionPrev","positionNext"].forEach((function(e){i.attributes[e].value=n.attributes[e].value}));["dist","distAll","start","offset","color"].forEach((function(e){i.attributes[e].init(i.vertexCount)})),i.indices=n.indices;var d=[],p=o.get("trailColor"),f=o.get("trailOpacity"),g=null!=p,m=null!=f;this.updateWorldTransform();var v=this.worldTransform.x.len(),y=this.worldTransform.y.len(),_=this.worldTransform.z.len(),x=0,b=0;e.each((function(t){var r=e.getItemLayout(t),o=m?f:E1(e,t),s=I1(e,t);null==o&&(o=1),(d=BJ.parseColor(g?p:s,d))[3]*=o;for(var l=h?n.getPolylineVertexCount(r):n.getCubicCurveVertexCount(r[0],r[1],r[2],r[3]),w=0,S=[],T=[],M=x;M<x+l;M++)i.attributes.position.get(M,S),S[0]*=v,S[1]*=y,S[2]*=_,M>x&&(w+=z3.dist(S,T)),i.attributes.dist.set(M,w),z3.copy(T,S);b=Math.max(b,w);var C=Math.random()*(c?w:u);for(M=x;M<x+l;M++)i.attributes.distAll.set(M,w),i.attributes.start.set(M,C),i.attributes.offset.set(M,(n.attributes.offset.get(M)>0?1:-1)*a/2),i.attributes.color.set(M,d);x+=l})),this.material.set("spotSize",.1*b*s),this.material.set("spotIntensity",o.get("spotIntensity")),i.dirty()},setAnimationTime:function(e){this.material.set("time",e)}});BJ.Shader.import(AQ);var B3=em.extend({type:"lines3D",__ecgl__:!0,init:function(e,t){this.groupGL=new BJ.Node,this._meshLinesMaterial=new BJ.Material({shader:BJ.createShader("ecgl.meshLines3D"),transparent:!0,depthMask:!1}),this._linesMesh=new BJ.Mesh({geometry:new dQ,material:this._meshLinesMaterial,$ignorePicking:!0}),this._trailMesh=new V3},render:function(e,t,n){this.groupGL.add(this._linesMesh);var r=e.coordinateSystem,i=e.getData();if(r&&r.viewGL){r.viewGL.add(this.groupGL),this._updateLines(e,t,n);var o=r.viewGL.isLinearSpace()?"define":"undefine";this._linesMesh.material[o]("fragment","SRGB_DECODE"),this._trailMesh.material[o]("fragment","SRGB_DECODE")}var a=this._trailMesh;if(a.stopAnimation(),e.get("effect.show")){this.groupGL.add(a),a.updateData(i,n,this._linesMesh.geometry),a.__time=a.__time||0;var s=36e5;this._curveEffectsAnimator=a.animate("",{loop:!0}).when(s,{__time:s}).during((function(){a.setAnimationTime(a.__time)})).start()}else this.groupGL.remove(a),this._curveEffectsAnimator=null;this._linesMesh.material.blend=this._trailMesh.material.blend="lighter"===e.get("blendMode")?BJ.additiveBlend:null},pauseEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.pause()},resumeEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.resume()},toggleEffect:function(){var e=this._curveEffectsAnimator;e&&(e.isPaused()?e.resume():e.pause())},_updateLines:function(e,t,n){var r=e.getData(),i=e.coordinateSystem,o=this._linesMesh.geometry,a=e.get("polyline");o.expandLine=!0;var s=function(e){return null!=e.radius?e.radius:null!=e.size?Math.max(e.size[0],e.size[1],e.size[2]):100}(i);o.segmentScale=s/20;var l="lineStyle.width".split("."),u=n.getDevicePixelRatio();r.each((function(e){var t=r.getItemModel(e).get(l);null==t&&(t=1),r.setItemVisual(e,"lineWidth",t)})),o.useNativeLine=!1;var c=0,h=0;r.each((function(e){var t=r.getItemLayout(e);a?(c+=o.getPolylineVertexCount(t),h+=o.getPolylineTriangleCount(t)):(c+=o.getCubicCurveVertexCount(t[0],t[1],t[2],t[3]),h+=o.getCubicCurveTriangleCount(t[0],t[1],t[2],t[3]))})),o.setVertexCount(c),o.setTriangleCount(h),o.resetOffset();var d=[];r.each((function(e){var t=r.getItemLayout(e),n=I1(r,e),i=E1(r,e),s=r.getItemVisual(e,"lineWidth")*u;null==i&&(i=1),(d=BJ.parseColor(n,d))[3]*=i,a?o.addPolyline(t,d,s):o.addCubicCurve(t[0],t[1],t[2],t[3],d,s)})),o.dirty()},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}});function F3(e,t){for(var n=[],r=0;r<t.length;r++)n.push(e.dataToPoint(t[r]));return n}l_((function(e){e.registerChartView(B3),e.registerSeriesModel(k3),e.registerLayout(R3),e.registerAction({type:"lines3DPauseEffect",event:"lines3deffectpaused",update:"series.lines3D:pauseEffect"},(function(){})),e.registerAction({type:"lines3DResumeEffect",event:"lines3deffectresumed",update:"series.lines3D:resumeEffect"},(function(){})),e.registerAction({type:"lines3DToggleEffect",event:"lines3deffectchanged",update:"series.lines3D:toggleEffect"},(function(){}))}));var G3=Hg.extend({type:"series.polygons3D",getRegionModel:function(e){return this.getData().getItemModel(e)},getRegionPolygonCoords:function(e){var t=this.coordinateSystem,n=this.getData().getItemModel(e),r=n.option instanceof Array?n.option:n.getShallow("coords");n.get("multiPolygon")||(r=[r]);for(var i=[],o=0;o<r.length;o++){for(var a=[],s=1;s<r[o].length;s++)a.push(F3(t,r[o][s]));i.push({exterior:F3(t,r[o][0]),interiors:a})}return i},getInitialData:function(e){var t=new R_(["value"],this);return t.hasItemOption=!1,t.initData(e.data,[],(function(e,n,r,i){if(e instanceof Array)return NaN;t.hasItemOption=!0;var o=e.value;return null!=o?o instanceof Array?o[i]:o:void 0})),t},defaultOption:{show:!0,data:null,multiPolygon:!1,progressiveThreshold:1e3,progressive:1e3,zlevel:-10,label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}});R(G3.prototype,Z0);var H3=em.extend({type:"polygons3D",__ecgl__:!0,init:function(e,t){this.groupGL=new BJ.Node,this._geo3DBuilderList=[],this._currentStep=0},render:function(e,t,n){this.groupGL.removeAll();var r=e.coordinateSystem;r&&r.viewGL&&r.viewGL.add(this.groupGL);var i=this._geo3DBuilderList[0];i||((i=new P1(n)).extrudeY="mapbox3D"!==r.type&&"maptalks3D"!==r.type,this._geo3DBuilderList[0]=i),this._updateShaderDefines(r,i),i.update(e,t,n),this._geo3DBuilderList.length=1,this.groupGL.add(i.rootNode)},incrementalPrepareRender:function(e,t,n){this.groupGL.removeAll();var r=e.coordinateSystem;r&&r.viewGL&&r.viewGL.add(this.groupGL),this._currentStep=0},incrementalRender:function(e,t,n,r){var i=this._geo3DBuilderList[this._currentStep],o=t.coordinateSystem;i||((i=new P1(r)).extrudeY="mapbox3D"!==o.type&&"maptalks3D"!==o.type,this._geo3DBuilderList[this._currentStep]=i),i.update(t,n,r,e.start,e.end),this.groupGL.add(i.rootNode),this._updateShaderDefines(o,i),this._currentStep++},_updateShaderDefines:function(e,t){var n=e.viewGL.isLinearSpace()?"define":"undefine";t.rootNode.traverse((function(t){t.material&&(t.material[n]("fragment","SRGB_DECODE"),"mapbox3D"!==e.type&&"maptalks3D"!==e.type||(t.material.define("fragment","NORMAL_UP_AXIS",2),t.material.define("fragment","NORMAL_FRONT_AXIS",1)))}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll(),this._geo3DBuilderList.forEach((function(e){e.dispose()}))}});l_((function(e){e.registerChartView(H3),e.registerSeriesModel(G3)}));var U3=Hg.extend({type:"series.surface",dependencies:["globe","grid3D","geo3D"],visualStyleAccessPath:"itemStyle",formatTooltip:function(e){return W2(this,e)},getInitialData:function(e,t){var n=e.data;function r(e){return!(isNaN(e.min)||isNaN(e.max)||isNaN(e.step))}function i(e){var t=uo;return Math.max(t(e.min),t(e.max),t(e.step))+1}if(!n)if(e.parametric){var o=e.parametricEquation||{},a=o.u||{},s=o.v||{};["u","v"].forEach((function(e){r(o[e])||"production"!==process.env.NODE_ENV&&console.error("Invalid parametricEquation.%s",e)})),["x","y","z"].forEach((function(e){"function"==typeof o[e]||"production"!==process.env.NODE_ENV&&console.error("parametricEquation.%s needs to be function",e)}));var l=Math.floor((a.max+a.step-a.min)/a.step),u=Math.floor((s.max+s.step-s.min)/s.step);n=new Float32Array(l*u*5);var c=i(a),h=i(s);for(S=0,T=0;T<u;T++)for(M=0;M<l;M++){var d=M*a.step+a.min,p=T*s.step+s.min,f=ao(Math.min(d,a.max),c),g=ao(Math.min(p,s.max),h);C=o.x(f,g),D=o.y(f,g),E=o.z(f,g);n[S++]=C,n[S++]=D,n[S++]=E,n[S++]=f,n[S++]=g}}else{var m=e.equation||{},v=m.x||{},y=m.y||{};if(["x","y"].forEach((function(e){r(m[e])||"production"!==process.env.NODE_ENV&&console.error("Invalid equation.%s",e)})),"function"!=typeof m.z)return void("production"!==process.env.NODE_ENV&&console.error("equation.z needs to be function"));var _=Math.floor((v.max+v.step-v.min)/v.step),x=Math.floor((y.max+y.step-y.min)/y.step);n=new Float32Array(_*x*3);for(var b=i(v),w=i(y),S=0,T=0;T<x;T++)for(var M=0;M<_;M++){var C=M*v.step+v.min,D=T*y.step+y.min,A=ao(Math.min(C,v.max),b),I=ao(Math.min(D,y.max),w),E=m.z(A,I);n[S++]=A,n[S++]=I,n[S++]=E}}var L=["x","y","z"];return e.parametric&&L.push("u","v"),j2(this,L,n)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,shading:"lambert",parametric:!1,wireframe:{show:!0,lineStyle:{color:"rgba(0,0,0,0.5)",width:1}},equation:{x:{min:-1,max:1,step:.1},y:{min:-1,max:1,step:.1},z:null},parametricEquation:{u:{min:-1,max:1,step:.1},v:{min:-1,max:1,step:.1},x:null,y:null,z:null},dataShape:null,itemStyle:{},animationDurationUpdate:500}});R(U3.prototype,Z0);var W3=uQ.vec3;function j3(e){return isNaN(e[0])||isNaN(e[1])||isNaN(e[2])}var X3=em.extend({type:"surface",__ecgl__:!0,init:function(e,t){this.groupGL=new BJ.Node},render:function(e,t,n){var r=this._prevSurfaceMesh;this._prevSurfaceMesh=this._surfaceMesh,this._surfaceMesh=r,this._surfaceMesh||(this._surfaceMesh=this._createSurfaceMesh()),this.groupGL.remove(this._prevSurfaceMesh),this.groupGL.add(this._surfaceMesh);var i=e.coordinateSystem,o=e.get("shading"),a=e.getData(),s="ecgl."+o;if(this._surfaceMesh.material&&this._surfaceMesh.material.shader.name===s||(this._surfaceMesh.material=BJ.createMaterial(s,["VERTEX_COLOR","DOUBLE_SIDED"])),BJ.setMaterialFromModel(o,this._surfaceMesh.material,e,n),i&&i.viewGL){i.viewGL.add(this.groupGL);var l=i.viewGL.isLinearSpace()?"define":"undefine";this._surfaceMesh.material[l]("fragment","SRGB_DECODE")}var u=e.get("parametric"),c=e.get("dataShape");c||(c=this._getDataShape(a,u),"production"!==process.env.NODE_ENV&&e.get("data")&&console.warn("dataShape is not provided. Guess it is ",c));var h=e.getModel("wireframe"),d=h.get("lineStyle.width"),p=h.get("show")&&d>0;this._updateSurfaceMesh(this._surfaceMesh,e,c,p);var f=this._surfaceMesh.material;p?(f.define("WIREFRAME_QUAD"),f.set("wireframeLineWidth",d),f.set("wireframeLineColor",BJ.parseColor(h.get("lineStyle.color")))):f.undefine("WIREFRAME_QUAD"),this._initHandler(e,n),this._updateAnimation(e)},_updateAnimation:function(e){BJ.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,e)},_createSurfaceMesh:function(){var e=new BJ.Mesh({geometry:new BJ.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new BJ.Material({shader:new BJ.Shader(BJ.Shader.source("ecgl.sm.depth.vertex"),BJ.Shader.source("ecgl.sm.depth.fragment"))}),culling:!1,renderOrder:10,renderNormal:!0});return e.geometry.createAttribute("barycentric","float",4),e.geometry.createAttribute("prevPosition","float",3),e.geometry.createAttribute("prevNormal","float",3),Object.assign(e.geometry,A1),e},_initHandler:function(e,t){var n=e.getData(),r=this._surfaceMesh,i=e.coordinateSystem;r.seriesIndex=e.seriesIndex;var o=-1;r.off("mousemove"),r.off("mouseout"),r.on("mousemove",(function(e){var a=function(e,t){for(var n=1/0,i=-1,o=[],a=0;a<e.length;a++){r.geometry.attributes.position.get(e[a],o);var s=W3.dist(t.array,o);s<n&&(n=s,i=e[a])}return i}(e.triangle,e.point);if(a>=0){var s=[];r.geometry.attributes.position.get(a,s);for(var l=i.pointToData(s),u=1/0,c=-1,h=[],d=0;d<n.count();d++){h[0]=n.get("x",d),h[1]=n.get("y",d),h[2]=n.get("z",d);var p=W3.squaredDistance(h,l);p<u&&(c=d,u=p)}c!==o&&t.dispatchAction({type:"grid3DShowAxisPointer",value:l}),o=c,r.dataIndex=c}else r.dataIndex=-1}),this),r.on("mouseout",(function(e){o=-1,r.dataIndex=-1,t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_updateSurfaceMesh:function(e,t,n,r){var i=e.geometry,o=t.getData(),a=o.getLayout("points"),s=0;o.each((function(e){o.hasValue(e)||s++}));var l=s||r,u=i.attributes.position,c=i.attributes.normal,h=i.attributes.texcoord0,d=i.attributes.barycentric,p=i.attributes.color,f=n[0],g=n[1],m="color"!==t.get("shading");if(l){var v=(f-1)*(g-1)*4;u.init(v),r&&d.init(v)}else u.value=new Float32Array(a);p.init(i.vertexCount),h.init(i.vertexCount);var y=[0,3,1,1,3,2],_=[[1,1,0,0],[0,1,0,1],[1,0,0,1],[1,0,1,0]],x=i.indices=new(i.vertexCount>65535?Uint32Array:Uint16Array)((f-1)*(g-1)*6),b=function(e,t,n){n[1]=e*g+t,n[0]=e*g+t+1,n[3]=(e+1)*g+t+1,n[2]=(e+1)*g+t},w=!1;if(l){var S=[],T=[],M=0;m?c.init(i.vertexCount):c.value=null;for(var C=[[],[],[]],D=[],A=[],I=W3.create(),E=function(e,t,n){var r=3*t;return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n},L=new Float32Array(a.length),N=new Float32Array(a.length/3*4),P=0;P<o.count();P++)if(o.hasValue(P)){var O=BJ.parseColor(I1(o,P));null!=(j=E1(o,P))&&(O[3]*=j),O[3]<.99&&(w=!0);for(var R=0;R<4;R++)N[4*P+R]=O[R]}var k=[1e7,1e7,1e7];for(P=0;P<f-1;P++)for(var z=0;z<g-1;z++){var V=4*(P*(g-1)+z);b(P,z,S);var B=!1;for(R=0;R<4;R++)E(a,S[R],T),j3(T)&&(B=!0);for(R=0;R<4;R++)B?u.set(V+R,k):(E(a,S[R],T),u.set(V+R,T)),r&&d.set(V+R,_[R]);for(R=0;R<6;R++)x[M++]=y[R]+V;if(m&&!B)for(R=0;R<2;R++){for(var F=3*R,G=0;G<3;G++){E(a,W=S[y[F]+G],C[G])}W3.sub(D,C[0],C[1]),W3.sub(A,C[1],C[2]),W3.cross(I,D,A);for(G=0;G<3;G++){var H=3*S[y[F]+G];L[H]=L[H]+I[0],L[H+1]=L[H+1]+I[1],L[H+2]=L[H+2]+I[2]}}}if(m)for(P=0;P<L.length/3;P++)E(L,P,I),W3.normalize(I,I),L[3*P]=I[0],L[3*P+1]=I[1],L[3*P+2]=I[2];O=[];var U=[];for(P=0;P<f-1;P++)for(z=0;z<g-1;z++){V=4*(P*(g-1)+z);b(P,z,S);for(R=0;R<4;R++){for(G=0;G<4;G++)O[G]=N[4*S[R]+G];p.set(V+R,O),m&&(E(L,S[R],I),c.set(V+R,I));var W=S[R];U[0]=W%g/(g-1),U[1]=Math.floor(W/g)/(f-1),h.set(V+R,U)}0}}else{for(U=[],P=0;P<o.count();P++){U[0]=P%g/(g-1),U[1]=Math.floor(P/g)/(f-1);var j;O=BJ.parseColor(I1(o,P));null!=(j=E1(o,P))&&(O[3]*=j),O[3]<.99&&(w=!0),p.set(P,O),h.set(P,U)}S=[];var X=0;for(P=0;P<f-1;P++)for(z=0;z<g-1;z++){b(P,z,S);for(R=0;R<6;R++)x[X++]=S[y[R]]}m?i.generateVertexNormals():c.value=null}e.material.get("normalMap")&&i.generateTangents(),i.updateBoundingBox(),i.dirty(),e.material.transparent=w,e.material.depthMask=!w},_getDataShape:function(e,t){for(var n=-1/0,r=0,i=0,o=0,a=!1,s=t?"u":"x",l=e.count(),u=0;u<l;u++){var c=e.get(s,u);c<n&&(o&&o!==i&&"production"!==process.env.NODE_ENV&&(a=!0),o=i,i=0,r++),n=c,i++}if(r&&1!==i||(a=!0),!a)return[r+1,i];for(var h=Math.floor(Math.sqrt(l));h>0;){if(Math.floor(l/h)===l/h)return[h,l/h];h--}return[h=Math.floor(Math.sqrt(l)),h]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});function Y3(e,t){for(var n=[],r=0;r<t.length;r++)n.push(e.dataToPoint(t[r]));return n}l_((function(e){e.registerChartView(X3),e.registerSeriesModel(U3),e.registerLayout((function(e,t){e.eachSeriesByType("surface",(function(e){var t=e.coordinateSystem;t&&"cartesian3D"===t.type||"production"!==process.env.NODE_ENV&&console.error("Surface chart only support cartesian3D coordinateSystem");var n=e.getData(),r=new Float32Array(3*n.count()),i=[NaN,NaN,NaN];if(t&&"cartesian3D"===t.type){var o=t.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]}));n.each(o,(function(e,o,a,s){var l;l=n.hasValue(s)?t.dataToPoint([e,o,a]):i,r[3*s]=l[0],r[3*s+1]=l[1],r[3*s+2]=l[2]}))}n.setLayout("points",r)}))}))}));var Z3=Hg.extend({type:"series.map3D",layoutMode:"box",coordinateSystem:null,visualStyleAccessPath:"itemStyle",optionUpdated:function(e){e=e||{};var t=this.get("coordinateSystem");if(null!=t&&"geo3D"!==t){if("production"!==process.env.NODE_ENV){var n=[];["left","top","width","height","boxWidth","boxDepth","boxHeight","light","viewControl","postEffect","temporalSuperSampling","environment","groundPlane"].forEach((function(t){null!=e[t]&&n.push(t)})),n.length&&console.warn("Property %s in map3D series will be ignored if coordinate system is %s",n.join(", "),t)}this.get("groundPlane.show")&&(this.option.groundPlane.show=!1),this._geo=null}},getInitialData:function(e){e.data=this.getFilledRegions(e.data,e.map);var t=k_(e.data,{coordDimensions:["value"]}),n=new R_(t,this);n.initData(e.data);var r={};return n.each((function(e){var t=n.getName(e),i=n.getItemModel(e);r[t]=i})),this._regionModelMap=r,n},formatTooltip:function(e){return W2(this,e)},getRegionModel:function(e){var t=this.getData().getName(e);return this._regionModelMap[t]||new Wh(null,this)},getRegionPolygonCoords:function(e){var t=this.coordinateSystem,n=this.getData().getName(e);if(t.transform)return(r=t.getRegion(n))?r.geometries:[];this._geo||(this._geo=W1.createGeo3D(this));for(var r=this._geo.getRegion(n),i=[],o=0;o<r.geometries.length;o++){var a=r.geometries[o],s=[],l=Y3(t,a.exterior);if(s&&s.length)for(var u=0;u<a.interiors.length;u++)s.push(Y3(t,s[u]));i.push({interiors:s,exterior:l})}return i},getFormattedLabel:function(e,t){var n=U2.getFormattedLabel(this,e,t);return null==n&&(n=this.getData().getName(e)),n},defaultOption:{coordinateSystem:"geo3D",data:null}});R(Z3.prototype,q0),R(Z3.prototype,eQ),R(Z3.prototype,tQ),R(Z3.prototype,nQ),R(Z3.prototype,Z0);var q3=em.extend({type:"map3D",__ecgl__:!0,init:function(e,t){this._geo3DBuilder=new P1(t),this.groupGL=new BJ.Node},render:function(e,t,n){var r=e.coordinateSystem;if(r&&r.viewGL){if(this.groupGL.add(this._geo3DBuilder.rootNode),r.viewGL.add(this.groupGL),"geo3D"===r.type){this._sceneHelper||(this._sceneHelper=new gQ,this._sceneHelper.initLight(this.groupGL)),this._sceneHelper.setScene(r.viewGL.scene),this._sceneHelper.updateLight(e),r.viewGL.setPostEffect(e.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));var i=this._control;i||(i=this._control=new sQ({zr:n.getZr()}),this._control.init());var o=e.getModel("viewControl");i.setViewGL(r.viewGL),i.setFromViewControlModel(o,0),i.off("update"),i.on("update",(function(){n.dispatchAction({type:"map3DChangeCamera",alpha:i.getAlpha(),beta:i.getBeta(),distance:i.getDistance(),from:this.uid,map3DId:e.id})})),this._geo3DBuilder.extrudeY=!0}else this._control&&(this._control.dispose(),this._control=null),this._sceneHelper&&(this._sceneHelper.dispose(),this._sceneHelper=null),e.getData().getLayout("geo3D"),this._geo3DBuilder.extrudeY=!1;this._geo3DBuilder.update(e,t,n,0,e.getData().count());var a=r.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse((function(e){e.material&&e.material[a]("fragment","SRGB_DECODE")}))}},afterRender:function(e,t,n,r){var i=r.renderer,o=e.coordinateSystem;o&&"geo3D"===o.type&&(this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n))},dispose:function(){this.groupGL.removeAll(),this._control.dispose(),this._geo3DBuilder.dispose()}});l_((function(e){j1(e),e.registerChartView(q3),e.registerSeriesModel(Z3),e.registerAction({type:"map3DChangeCamera",event:"map3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"series",subType:"map3D",query:e},(function(t){t.setView(e)}))}))}));var K3=Hg.extend({type:"series.scatterGL",dependencies:["grid","polar","geo","singleAxis"],visualStyleAccessPath:"itemStyle",hasSymbolVisual:!0,getInitialData:function(){return eb(this)},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,progressive:1e5,progressiveThreshold:1e5,large:!1,symbol:"circle",symbolSize:10,zoomScale:0,blendMode:"source-over",itemStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}});function $3(e){this.viewGL=e}$3.prototype.reset=function(e,t){this._updateCamera(t.getWidth(),t.getHeight(),t.getDevicePixelRatio()),this._viewTransform=[1,0,0,1,0,0],this.updateTransform(e,t)},$3.prototype.updateTransform=function(e,t){var n=e.coordinateSystem;n.getRoamTransform&&(Pt(this._viewTransform,n.getRoamTransform()),this._setCameraTransform(this._viewTransform),t.getZr().refresh())},$3.prototype.dataToPoint=function(e,t,n){n=e.dataToPoint(t,null,n);var r=this._viewTransform;r&&Ke(n,n,r)},$3.prototype.removeTransformInPoint=function(e){return this._viewTransform&&Ke(e,e,this._viewTransform),e},$3.prototype.getZoom=function(){if(this._viewTransform){var e=this._viewTransform;return 1/Math.max(Math.sqrt(e[0]*e[0]+e[1]*e[1]),Math.sqrt(e[2]*e[2]+e[3]*e[3]))}return 1},$3.prototype._setCameraTransform=function(e){var t=this.viewGL.camera;t.position.set(e[4],e[5],0),t.scale.set(Math.sqrt(e[0]*e[0]+e[1]*e[1]),Math.sqrt(e[2]*e[2]+e[3]*e[3]),1)},$3.prototype._updateCamera=function(e,t,n){this.viewGL.setViewport(0,0,e,t,n);var r=this.viewGL.camera;r.left=r.top=0,r.bottom=t,r.right=e,r.near=0,r.far=100};var J3=em.extend({type:"scatterGL",__ecgl__:!0,init:function(e,t){this.groupGL=new BJ.Node,this.viewGL=new O0("orthographic"),this.viewGL.add(this.groupGL),this._pointsBuilderList=[],this._currentStep=0,this._sizeScale=1,this._glViewHelper=new $3(this.viewGL)},render:function(e,t,n){if(this.groupGL.removeAll(),this._glViewHelper.reset(e,n),e.getData().count()){var r=this._pointsBuilderList[0];r||(r=this._pointsBuilderList[0]=new m3(!0,n)),this._pointsBuilderList.length=1,this.groupGL.add(r.rootNode),this._removeTransformInPoints(e.getData().getLayout("points")),r.update(e,t,n),this.viewGL.setPostEffect(e.getModel("postEffect"),n)}},incrementalPrepareRender:function(e,t,n){this.groupGL.removeAll(),this._glViewHelper.reset(e,n),this._currentStep=0,this.viewGL.setPostEffect(e.getModel("postEffect"),n)},incrementalRender:function(e,t,n,r){if(!(e.end<=e.start)){var i=this._pointsBuilderList[this._currentStep];i||(i=new m3(!0,r),this._pointsBuilderList[this._currentStep]=i),this.groupGL.add(i.rootNode),this._removeTransformInPoints(t.getData().getLayout("points")),i.setSizeScale(this._sizeScale),i.update(t,n,r,e.start,e.end),r.getZr().refresh(),this._currentStep++}},updateTransform:function(e,t,n){if(e.coordinateSystem.getRoamTransform){this._glViewHelper.updateTransform(e,n);var r=this._glViewHelper.getZoom(),i=Math.max((e.get("zoomScale")||0)*(r-1)+1,0);this._sizeScale=i,this._pointsBuilderList.forEach((function(e){e.setSizeScale(i)}))}},_removeTransformInPoints:function(e){if(e)for(var t=[],n=0;n<e.length;n+=2)t[0]=e[n],t[1]=e[n+1],this._glViewHelper.removeTransformInPoint(t),e[n]=t[0],e[n+1]=t[1]},dispose:function(){this.groupGL.removeAll(),this._pointsBuilderList.forEach((function(e){e.dispose()}))},remove:function(){this.groupGL.removeAll()}});l_((function(e){e.registerChartView(J3),e.registerSeriesModel(K3),e.registerLayout({seriesType:"scatterGL",reset:function(e){var t,n=e.coordinateSystem,r=e.getData();if(n){var i=n.dimensions.map((function(e){return r.mapDimension(e)})).slice(0,2),o=[];1===i.length?t=function(e){for(var t=new Float32Array(2*(e.end-e.start)),o=e.start;o<e.end;o++){var a=2*(o-e.start),s=r.get(i[0],o),l=n.dataToPoint(s);t[a]=l[0],t[a+1]=l[1]}r.setLayout("points",t)}:2===i.length&&(t=function(e){for(var t=new Float32Array(2*(e.end-e.start)),a=e.start;a<e.end;a++){var s=2*(a-e.start),l=r.get(i[0],a),u=r.get(i[1],a);o[0]=l,o[1]=u,o=n.dataToPoint(o),t[s]=o[0],t[s+1]=o[1]}r.setLayout("points",t)})}return{progress:t}}})}));var Q3=Hg.extend({type:"series.graphGL",visualStyleAccessPath:"itemStyle",hasSymbolVisual:!0,init:function(e){Q3.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this._updateCategoriesData()},mergeOption:function(e){Q3.superApply(this,"mergeOption",arguments),this._updateCategoriesData()},getFormattedLabel:function(e,t,n,r){var i=U2.getFormattedLabel(this,e,t,n,r);if(null==i){var o=this.getData(),a=o.dimensions[o.dimensions.length-1];i=o.get(a,e)}return i},getInitialData:function(e,t){var n=e.edges||e.links||[],r=e.data||e.nodes||[],i=this;if(r&&n)return function(e,t,n,r,i){for(var o=new kE(r),a=0;a<e.length;a++)o.addNode(_J(e[a].id,e[a].name,a),a);var s,l=[],u=[],c=0;for(a=0;a<t.length;a++){var h=t[a],d=h.source,p=h.target;o.addEdge(d,p,c)&&(u.push(h),l.push(_J(h.id,d+" > "+p)),c++)}var f=k_(e,{coordDimensions:["value"]});(s=new R_(f,n)).initData(e);var g=new R_(["value"],n);return g.initData(u,l),i&&i(s,g),TA({mainData:s,struct:o,structAttr:"graph",datas:{node:s,edge:g},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}(r,n,this,!0,(function(e,n){e.wrapMethod("getItemModel",(function(e){const t=i._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));const r=t.getModel([]).getModel;function o(e,t){const n=r.call(this,e,t);return n.resolveParentPath=a,n}function a(e){if(e&&("label"===e[0]||"label"===e[1])){const t=e.slice();return"label"===e[0]?t[0]="edgeLabel":"label"===e[1]&&(t[1]="edgeLabel"),t}return e}n.wrapMethod("getItemModel",(function(e){return e.resolveParentPath=a,e.getModel=o,e}))})).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(e,t,n){if("edge"===n){var r=this.getData(),i=this.getDataParams(e,n),o=r.graph.getEdgeByIndex(e),a=r.getName(o.node1.dataIndex),s=r.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),l=dt(l.join(" > ")),i.value&&(l+=" : "+dt(i.value)),l}return Q3.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var e=(this.option.categories||[]).map((function(e){return null!=e.value?e:Object.assign({value:0},e)})),t=new R_(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e,!0)}))},setView:function(e){null!=e.zoom&&(this.option.zoom=e.zoom),null!=e.offset&&(this.option.offset=e.offset)},setNodePosition:function(e){for(var t=0;t<e.length/2;t++){var n=e[2*t],r=e[2*t+1],i=this.getData().getRawDataItem(t);i.x=n,i.y=r}},isAnimationEnabled:function(){return Q3.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:10,z:2,legendHoverLink:!0,layout:"forceAtlas2",forceAtlas2:{initLayout:null,GPU:!0,steps:1,maxSteps:1e3,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,edgeWeightInfluence:1,edgeWeight:[1,4],nodeWeight:[1,4],preventOverlap:!1,gravityCenter:null},focusNodeAdjacency:!0,focusNodeAdjacencyOn:"mouseover",left:"center",top:"center",symbol:"circle",symbolSize:5,roam:!1,center:null,zoom:1,label:{show:!1,formatter:"{b}",position:"right",distance:5,textStyle:{fontSize:14}},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{label:{show:!0}},animation:!1}}),e5=uQ.vec2,t5=[[0,0],[1,1]],n5=XK.extend((function(){return{segmentScale:4,dynamic:!0,useNativeLine:!0,attributes:{position:new XK.Attribute("position","float",2,"POSITION"),normal:new XK.Attribute("normal","float",2),offset:new XK.Attribute("offset","float",1),color:new XK.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(e){var t=this.attributes;this.vertexCount!==e&&(t.position.init(e),t.color.init(e),this.useNativeLine||(t.offset.init(e),t.normal.init(e)),e>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(e){this.triangleCount!==e&&(this.indices=0===e?null:this.vertexCount>65535?new Uint32Array(3*e):new Uint16Array(3*e))},_getCubicCurveApproxStep:function(e,t,n,r){return 1/(e5.dist(e,t)+e5.dist(n,t)+e5.dist(r,n)+1)*this.segmentScale},getCubicCurveVertexCount:function(e,t,n,r){var i=this._getCubicCurveApproxStep(e,t,n,r),o=Math.ceil(1/i);return this.useNativeLine?2*o:2*o+2},getCubicCurveTriangleCount:function(e,t,n,r){var i=this._getCubicCurveApproxStep(e,t,n,r),o=Math.ceil(1/i);return this.useNativeLine?0:2*o},getLineVertexCount:function(){return this.getPolylineVertexCount(t5)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(t5)},getPolylineVertexCount:function(e){var t;"number"==typeof e?t=e:t="number"!=typeof e[0]?e.length:e.length/2;return this.useNativeLine?2*(t-1):2*(t-1)+2},getPolylineTriangleCount:function(e){var t;"number"==typeof e?t=e:t="number"!=typeof e[0]?e.length:e.length/2;return this.useNativeLine?0:2*(t-1)},addCubicCurve:function(e,t,n,r,i,o){null==o&&(o=1);var a=e[0],s=e[1],l=t[0],u=t[1],c=n[0],h=n[1],d=r[0],p=r[1],f=this._getCubicCurveApproxStep(e,t,n,r),g=f*f,m=g*f,v=3*f,y=3*g,_=6*g,x=6*m,b=a-2*l+c,w=s-2*u+h,S=3*(l-c)-a+d,T=3*(u-h)-s+p,M=a,C=s,D=(l-a)*v+b*y+S*m,A=(u-s)*v+w*y+T*m,I=b*_+S*x,E=w*_+T*x,L=S*x,N=T*x,P=0,O=0,R=Math.ceil(1/f),k=new Float32Array(3*(R+1)),z=(k=[],0);for(O=0;O<R+1;O++)k[z++]=M,k[z++]=C,M+=D,C+=A,D+=I,A+=E,I+=L,E+=N,(P+=f)>1&&(M=D>0?Math.min(M,d):Math.max(M,d),C=A>0?Math.min(C,p):Math.max(C,p));this.addPolyline(k,i,o)},addLine:function(e,t,n,r){this.addPolyline([e,t],n,r)},addPolyline:function(){var e=e5.create(),t=e5.create(),n=e5.create(),r=e5.create(),i=[],o=[],a=[];return function(s,l,u,c,h){if(s.length){var d="number"!=typeof s[0];if(null==h&&(h=d?s.length:s.length/2),!(h<2)){null==c&&(c=0),null==u&&(u=1),this._itemVertexOffsets.push(this._vertexOffset);for(var p,f=d?"number"!=typeof l[0]:l.length/4===h,g=this.attributes.position,m=this.attributes.color,v=this.attributes.offset,y=this.attributes.normal,_=this.indices,x=this._vertexOffset,b=0;b<h;b++){if(d)i=s[b+c],p=f?l[b+c]:l;else{var w=2*b+c;if((i=i||[])[0]=s[w],i[1]=s[w+1],f){var S=4*b+c;(p=p||[])[0]=l[S],p[1]=l[S+1],p[2]=l[S+2],p[3]=l[S+3]}else p=l}if(this.useNativeLine)b>1&&(g.copy(x,x-1),m.copy(x,x-1),x++);else{var T;if(b<h-1){if(d)e5.copy(o,s[b+1]);else{w=2*(b+1)+c;(o=o||[])[0]=s[w],o[1]=s[w+1]}if(b>0){e5.sub(e,i,a),e5.sub(t,o,i),e5.normalize(e,e),e5.normalize(t,t),e5.add(r,e,t),e5.normalize(r,r);var M=u/2*Math.min(1/e5.dot(e,r),2);n[0]=-r[1],n[1]=r[0],T=M}else e5.sub(e,o,i),e5.normalize(e,e),n[0]=-e[1],n[1]=e[0],T=u/2}else e5.sub(e,i,a),e5.normalize(e,e),n[0]=-e[1],n[1]=e[0],T=u/2;y.set(x,n),y.set(x+1,n),v.set(x,T),v.set(x+1,-T),e5.copy(a,i),g.set(x,i),g.set(x+1,i),m.set(x,p),m.set(x+1,p),x+=2}if(this.useNativeLine)m.set(x,p),g.set(x,i),x++;else if(b>0){var C=3*this._faceOffset;(_=this.indices)[C]=x-4,_[C+1]=x-3,_[C+2]=x-2,_[C+3]=x-3,_[C+4]=x-1,_[C+5]=x-2,this._faceOffset+=2}}this._vertexOffset=x}}}}(),setItemColor:function(e,t){for(var n=this._itemVertexOffsets[e],r=e<this._itemVertexOffsets.length-1?this._itemVertexOffsets[e+1]:this._vertexOffset,i=n;i<r;i++)this.attributes.color.set(i,t);this.dirty("color")}});V(n5.prototype,lQ);BJ.Shader.import("@export ecgl.forceAtlas2.updateNodeRepulsion\n\n#define NODE_COUNT 0\n\nuniform sampler2D positionTex;\n\nuniform vec2 textureSize;\nuniform float gravity;\nuniform float scaling;\nuniform vec2 gravityCenter;\n\nuniform bool strongGravityMode;\nuniform bool preventOverlap;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, v_Texcoord);\n\n vec2 force = vec2(0.0);\n for (int i = 0; i < NODE_COUNT; i++) {\n vec2 uv = vec2(\n mod(float(i), textureSize.x) / (textureSize.x - 1.0),\n floor(float(i) / textureSize.x) / (textureSize.y - 1.0)\n );\n vec4 n1 = texture2D(positionTex, uv);\n\n vec2 dir = n0.xy - n1.xy;\n float d2 = dot(dir, dir);\n\n if (d2 > 0.0) {\n float factor = 0.0;\n if (preventOverlap) {\n float d = sqrt(d2);\n d = d - n0.w - n1.w;\n if (d > 0.0) {\n factor = scaling * n0.z * n1.z / (d * d);\n }\n else if (d < 0.0) {\n factor = scaling * 100.0 * n0.z * n1.z;\n }\n }\n else {\n factor = scaling * n0.z * n1.z / d2;\n }\n force += dir * factor;\n }\n }\n\n vec2 dir = gravityCenter - n0.xy;\n float d = 1.0;\n if (!strongGravityMode) {\n d = length(dir);\n }\n\n force += dir * n0.z * gravity / (d + 1.0);\n\n gl_FragColor = vec4(force, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.vertex\n\nattribute vec2 node1;\nattribute vec2 node2;\nattribute float weight;\n\nuniform sampler2D positionTex;\nuniform float edgeWeightInfluence;\nuniform bool preventOverlap;\nuniform bool linLogMode;\n\nuniform vec2 windowSize: WINDOW_SIZE;\n\nvarying vec2 v_Force;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, node1);\n vec4 n1 = texture2D(positionTex, node2);\n\n vec2 dir = n1.xy - n0.xy;\n float d = length(dir);\n float w;\n if (edgeWeightInfluence == 0.0) {\n w = 1.0;\n }\n else if (edgeWeightInfluence == 1.0) {\n w = weight;\n }\n else {\n w = pow(weight, edgeWeightInfluence);\n }\n vec2 offset = vec2(1.0 / windowSize.x, 1.0 / windowSize.y);\n vec2 scale = vec2((windowSize.x - 1.0) / windowSize.x, (windowSize.y - 1.0) / windowSize.y);\n vec2 pos = node1 * scale * 2.0 - 1.0;\n gl_Position = vec4(pos + offset, 0.0, 1.0);\n gl_PointSize = 1.0;\n\n float factor;\n if (preventOverlap) {\n d = d - n1.w - n0.w;\n }\n if (d <= 0.0) {\n v_Force = vec2(0.0);\n return;\n }\n\n if (linLogMode) {\n factor = w * log(d) / d;\n }\n else {\n factor = w;\n }\n v_Force = dir * factor;\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.fragment\n\nvarying vec2 v_Force;\n\nvoid main() {\n gl_FragColor = vec4(v_Force, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.vertex\n\nattribute vec2 node;\n\nvarying vec2 v_NodeUv;\n\nvoid main() {\n\n v_NodeUv = node;\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n gl_PointSize = 1.0;\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.fragment\n\nvarying vec2 v_NodeUv;\n\nuniform sampler2D positionTex;\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_NodeUv).rg;\n vec2 forcePrev = texture2D(forcePrevTex, v_NodeUv).rg;\n\n float mass = texture2D(positionTex, v_NodeUv).z;\n float swing = length(force - forcePrev) * mass;\n float traction = length(force + forcePrev) * 0.5 * mass;\n\n gl_FragColor = vec4(swing, traction, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcGlobalSpeed\n\nuniform sampler2D globalSpeedPrevTex;\nuniform sampler2D weightedSumTex;\nuniform float jitterTolerence;\n\nvoid main() {\n vec2 weightedSum = texture2D(weightedSumTex, vec2(0.5)).xy;\n float prevGlobalSpeed = texture2D(globalSpeedPrevTex, vec2(0.5)).x;\n float globalSpeed = jitterTolerence * jitterTolerence\n * weightedSum.y / weightedSum.x;\n if (prevGlobalSpeed > 0.0) {\n globalSpeed = min(globalSpeed / prevGlobalSpeed, 1.5) * prevGlobalSpeed;\n }\n gl_FragColor = vec4(globalSpeed, 0.0, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updatePosition\n\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\nuniform sampler2D positionTex;\nuniform sampler2D globalSpeedTex;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_Texcoord).xy;\n vec2 forcePrev = texture2D(forcePrevTex, v_Texcoord).xy;\n vec4 node = texture2D(positionTex, v_Texcoord);\n\n float globalSpeed = texture2D(globalSpeedTex, vec2(0.5)).r;\n float swing = length(force - forcePrev);\n float speed = 0.1 * globalSpeed / (0.1 + globalSpeed * sqrt(swing));\n\n float df = length(force);\n if (df > 0.0) {\n speed = min(df * speed, 10.0) / df;\n\n gl_FragColor = vec4(node.xy + speed * force, node.zw);\n }\n else {\n gl_FragColor = node;\n }\n}\n@end\n\n@export ecgl.forceAtlas2.edges.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 node;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nuniform sampler2D positionTex;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(\n texture2D(positionTex, node).xy, -10.0, 1.0\n );\n v_Color = a_Color;\n}\n@end\n\n@export ecgl.forceAtlas2.edges.fragment\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nvarying vec4 v_Color;\nvoid main() {\n gl_FragColor = color * v_Color;\n}\n@end");var r5={repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null};function i5(e){var t={type:BJ.Texture.FLOAT,minFilter:BJ.Texture.NEAREST,magFilter:BJ.Texture.NEAREST};this._positionSourceTex=new BJ.Texture2D(t),this._positionSourceTex.flipY=!1,this._positionTex=new BJ.Texture2D(t),this._positionPrevTex=new BJ.Texture2D(t),this._forceTex=new BJ.Texture2D(t),this._forcePrevTex=new BJ.Texture2D(t),this._weightedSumTex=new BJ.Texture2D(t),this._weightedSumTex.width=this._weightedSumTex.height=1,this._globalSpeedTex=new BJ.Texture2D(t),this._globalSpeedPrevTex=new BJ.Texture2D(t),this._globalSpeedTex.width=this._globalSpeedTex.height=1,this._globalSpeedPrevTex.width=this._globalSpeedPrevTex.height=1,this._nodeRepulsionPass=new cJ({fragment:BJ.Shader.source("ecgl.forceAtlas2.updateNodeRepulsion")}),this._positionPass=new cJ({fragment:BJ.Shader.source("ecgl.forceAtlas2.updatePosition")}),this._globalSpeedPass=new cJ({fragment:BJ.Shader.source("ecgl.forceAtlas2.calcGlobalSpeed")}),this._copyPass=new cJ({fragment:BJ.Shader.source("clay.compositor.output")});var n=function(e){e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE)};this._edgeForceMesh=new BJ.Mesh({geometry:new BJ.Geometry({attributes:{node1:new BJ.Geometry.Attribute("node1","float",2),node2:new BJ.Geometry.Attribute("node2","float",2),weight:new BJ.Geometry.Attribute("weight","float",1)},dynamic:!0,mainAttribute:"node1"}),material:new BJ.Material({transparent:!0,shader:BJ.createShader("ecgl.forceAtlas2.updateEdgeAttraction"),blend:n,depthMask:!1,depthText:!1}),mode:BJ.Mesh.POINTS}),this._weightedSumMesh=new BJ.Mesh({geometry:new BJ.Geometry({attributes:{node:new BJ.Geometry.Attribute("node","float",2)},dynamic:!0,mainAttribute:"node"}),material:new BJ.Material({transparent:!0,shader:BJ.createShader("ecgl.forceAtlas2.calcWeightedSum"),blend:n,depthMask:!1,depthText:!1}),mode:BJ.Mesh.POINTS}),this._framebuffer=new V$({depthBuffer:!1}),this._dummyCamera=new BJ.OrthographicCamera({left:-1,right:1,top:1,bottom:-1,near:0,far:100}),this._globalSpeed=0}i5.prototype.updateOption=function(e){for(var t in r5)this[t]=r5[t];var n=this._nodes.length;if(this.jitterTolerence=n>5e4?10:n>5e3?1:.1,this.scaling=n>100?2:10,e)for(var t in r5)null!=e[t]&&(this[t]=e[t]);if(this.repulsionByDegree)for(var r=this._positionSourceTex.pixels,i=0;i<this._nodes.length;i++)r[4*i+2]=(this._nodes[i].degree||0)+1},i5.prototype._updateGravityCenter=function(e){var t=this._nodes,n=this._edges;if(this.gravityCenter)this._gravityCenter=this.gravityCenter;else{for(var r=[1/0,1/0],i=[-1/0,-1/0],o=0;o<t.length;o++)r[0]=Math.min(t[o].x,r[0]),r[1]=Math.min(t[o].y,r[1]),i[0]=Math.max(t[o].x,i[0]),i[1]=Math.max(t[o].y,i[1]);this._gravityCenter=[.5*(r[0]+i[0]),.5*(r[1]+i[1])]}for(o=0;o<n.length;o++){var a=n[o].node1,s=n[o].node2;t[a].degree=(t[a].degree||0)+1,t[s].degree=(t[s].degree||0)+1}},i5.prototype.initData=function(e,t){this._nodes=e,this._edges=t,this._updateGravityCenter();var n=Math.ceil(Math.sqrt(e.length)),r=n,i=new Float32Array(n*r*4);this._resize(n,r);for(var o=0,a=0;a<e.length;a++){var s=e[a];i[o++]=s.x||0,i[o++]=s.y||0,i[o++]=s.mass||1,i[o++]=s.size||1}this._positionSourceTex.pixels=i;var l=this._edgeForceMesh.geometry,u=t.length;l.attributes.node1.init(2*u),l.attributes.node2.init(2*u),l.attributes.weight.init(2*u);var c=[];for(a=0;a<t.length;a++){var h=l.attributes,d=t[a].weight;null==d&&(d=1),h.node1.set(a,this.getNodeUV(t[a].node1,c)),h.node2.set(a,this.getNodeUV(t[a].node2,c)),h.weight.set(a,d),h.node1.set(a+u,this.getNodeUV(t[a].node2,c)),h.node2.set(a+u,this.getNodeUV(t[a].node1,c)),h.weight.set(a+u,d)}var p=this._weightedSumMesh.geometry;p.attributes.node.init(e.length);for(a=0;a<e.length;a++)p.attributes.node.set(a,this.getNodeUV(a,c));l.dirty(),p.dirty(),this._nodeRepulsionPass.material.define("fragment","NODE_COUNT",e.length),this._nodeRepulsionPass.material.setUniform("textureSize",[n,r]),this._inited=!1,this._frame=0},i5.prototype.getNodes=function(){return this._nodes},i5.prototype.getEdges=function(){return this._edges},i5.prototype.step=function(e){this._inited||(this._initFromSource(e),this._inited=!0),this._frame++,this._framebuffer.attach(this._forceTex),this._framebuffer.bind(e);var t=this._nodeRepulsionPass;t.setUniform("strongGravityMode",this.strongGravityMode),t.setUniform("gravity",this.gravity),t.setUniform("gravityCenter",this._gravityCenter),t.setUniform("scaling",this.scaling),t.setUniform("preventOverlap",this.preventOverlap),t.setUniform("positionTex",this._positionPrevTex),t.render(e);var n=this._edgeForceMesh;n.material.set("linLogMode",this.linLogMode),n.material.set("edgeWeightInfluence",this.edgeWeightInfluence),n.material.set("preventOverlap",this.preventOverlap),n.material.set("positionTex",this._positionPrevTex),e.gl.enable(e.gl.BLEND),e.renderPass([n],this._dummyCamera),this._framebuffer.attach(this._weightedSumTex),e.gl.clearColor(0,0,0,0),e.gl.clear(e.gl.COLOR_BUFFER_BIT),e.gl.enable(e.gl.BLEND);var r=this._weightedSumMesh;r.material.set("positionTex",this._positionPrevTex),r.material.set("forceTex",this._forceTex),r.material.set("forcePrevTex",this._forcePrevTex),e.renderPass([r],this._dummyCamera),this._framebuffer.attach(this._globalSpeedTex);var i=this._globalSpeedPass;i.setUniform("globalSpeedPrevTex",this._globalSpeedPrevTex),i.setUniform("weightedSumTex",this._weightedSumTex),i.setUniform("jitterTolerence",this.jitterTolerence),e.gl.disable(e.gl.BLEND),i.render(e);var o=this._positionPass;this._framebuffer.attach(this._positionTex),o.setUniform("globalSpeedTex",this._globalSpeedTex),o.setUniform("positionTex",this._positionPrevTex),o.setUniform("forceTex",this._forceTex),o.setUniform("forcePrevTex",this._forcePrevTex),o.render(e),this._framebuffer.unbind(e),this._swapTexture()},i5.prototype.update=function(e,t,n){null==t&&(t=1),t=Math.max(t,1);for(var r=0;r<t;r++)this.step(e);n&&n()},i5.prototype.getNodePositionTexture=function(){return this._inited?this._positionPrevTex:this._positionSourceTex},i5.prototype.getNodeUV=function(e,t){t=t||[];var n=this._positionTex.width,r=this._positionTex.height;return t[0]=e%n/(n-1),t[1]=Math.floor(e/n)/(r-1)||0,t},i5.prototype.getNodePosition=function(e,t){var n=this._positionArr,r=this._positionTex.width,i=this._positionTex.height,o=r*i;n&&n.length===4*o||(n=this._positionArr=new Float32Array(4*o)),this._framebuffer.bind(e),this._framebuffer.attach(this._positionPrevTex),e.gl.readPixels(0,0,r,i,e.gl.RGBA,e.gl.FLOAT,n),this._framebuffer.unbind(e),t||(t=new Float32Array(2*this._nodes.length));for(var a=0;a<this._nodes.length;a++)t[2*a]=n[4*a],t[2*a+1]=n[4*a+1];return t},i5.prototype.getTextureData=function(e,t){var n=this["_"+t+"Tex"],r=n.width,i=n.height;this._framebuffer.bind(e),this._framebuffer.attach(n);var o=new Float32Array(r*i*4);return e.gl.readPixels(0,0,r,i,e.gl.RGBA,e.gl.FLOAT,o),this._framebuffer.unbind(e),o},i5.prototype.getTextureSize=function(){return{width:this._positionTex.width,height:this._positionTex.height}},i5.prototype.isFinished=function(e){return this._frame>e},i5.prototype._swapTexture=function(){var e=this._positionPrevTex;this._positionPrevTex=this._positionTex,this._positionTex=e;e=this._forcePrevTex;this._forcePrevTex=this._forceTex,this._forceTex=e;e=this._globalSpeedPrevTex;this._globalSpeedPrevTex=this._globalSpeedTex,this._globalSpeedTex=e},i5.prototype._initFromSource=function(e){this._framebuffer.attach(this._positionPrevTex),this._framebuffer.bind(e),this._copyPass.setUniform("texture",this._positionSourceTex),this._copyPass.render(e),e.gl.clearColor(0,0,0,0),this._framebuffer.attach(this._forcePrevTex),e.gl.clear(e.gl.COLOR_BUFFER_BIT),this._framebuffer.attach(this._globalSpeedPrevTex),e.gl.clear(e.gl.COLOR_BUFFER_BIT),this._framebuffer.unbind(e)},i5.prototype._resize=function(e,t){["_positionSourceTex","_positionTex","_positionPrevTex","_forceTex","_forcePrevTex"].forEach((function(n){this[n].width=e,this[n].height=t,this[n].dirty()}),this)},i5.prototype.dispose=function(e){this._framebuffer.dispose(e),this._copyPass.dispose(e),this._nodeRepulsionPass.dispose(e),this._positionPass.dispose(e),this._globalSpeedPass.dispose(e),this._edgeForceMesh.geometry.dispose(e),this._weightedSumMesh.geometry.dispose(e),this._positionSourceTex.dispose(e),this._positionTex.dispose(e),this._positionPrevTex.dispose(e),this._forceTex.dispose(e),this._forcePrevTex.dispose(e),this._weightedSumTex.dispose(e),this._globalSpeedTex.dispose(e),this._globalSpeedPrevTex.dispose(e)};var o5=function(){var e=function(){return new Float32Array(2)},t=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)},n=function(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)},r=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},i=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},o=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},a=function(e,t){return e[0]=t[0],e[1]=t[1],e},s=function(e,t,n){return e[0]=t,e[1]=n,e};function l(){this.subRegions=[],this.nSubRegions=0,this.node=null,this.mass=0,this.centerOfMass=null,this.bbox=new Float32Array(4),this.size=0}var u=l.prototype;function c(){this.position=new Float32Array(2),this.force=e(),this.forcePrev=e(),this.mass=1,this.inDegree=0,this.outDegree=0}function h(e,t){this.source=e,this.target=t,this.weight=1}function d(){this.autoSettings=!0,this.barnesHutOptimize=!0,this.barnesHutTheta=1.5,this.repulsionByDegree=!0,this.linLogMode=!1,this.strongGravityMode=!1,this.gravity=1,this.scaling=1,this.edgeWeightInfluence=1,this.jitterTolerence=.1,this.preventOverlap=!1,this.dissuadeHubs=!1,this.rootRegion=new l,this.rootRegion.centerOfMass=e(),this.nodes=[],this.edges=[],this.bbox=new Float32Array(4),this.gravityCenter=null,this._massArr=null,this._swingingArr=null,this._sizeArr=null,this._globalSpeed=0}u.beforeUpdate=function(){for(var e=0;e<this.nSubRegions;e++)this.subRegions[e].beforeUpdate();this.mass=0,this.centerOfMass&&(this.centerOfMass[0]=0,this.centerOfMass[1]=0),this.nSubRegions=0,this.node=null},u.afterUpdate=function(){this.subRegions.length=this.nSubRegions;for(var e=0;e<this.nSubRegions;e++)this.subRegions[e].afterUpdate()},u.addNode=function(e){if(0===this.nSubRegions){if(null==this.node)return void(this.node=e);this._addNodeToSubRegion(this.node),this.node=null}this._addNodeToSubRegion(e),this._updateCenterOfMass(e)},u.findSubRegion=function(e,t){for(var n=0;n<this.nSubRegions;n++){var r=this.subRegions[n];if(r.contain(e,t))return r}},u.contain=function(e,t){return this.bbox[0]<=e&&this.bbox[2]>=e&&this.bbox[1]<=t&&this.bbox[3]>=t},u.setBBox=function(e,t,n,r){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=r,this.size=(n-e+r-t)/2},u._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new l,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},u._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),n=this.bbox;if(!t){var r=(n[0]+n[2])/2,i=(n[1]+n[3])/2,o=(n[2]-n[0])/2,a=(n[3]-n[1])/2,s=e.position[0]>=r?1:0,l=e.position[1]>=i?1:0;(t=this._newSubRegion()).setBBox(s*o+n[0],l*a+n[1],(s+1)*o+n[0],(l+1)*a+n[1])}t.addNode(e)},u._updateCenterOfMass=function(e){null==this.centerOfMass&&(this.centerOfMass=new Float32Array(2));var t=this.centerOfMass[0]*this.mass,n=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,n+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=n/this.mass};var p=d.prototype;p.initNodes=function(e,t,n){var r=t.length;this.nodes.length=0;for(var i=void 0!==n,o=0;o<r;o++){var a=new c;a.position[0]=e[2*o],a.position[1]=e[2*o+1],a.mass=t[o],i&&(a.size=n[o]),this.nodes.push(a)}this._massArr=t,this._swingingArr=new Float32Array(r),i&&(this._sizeArr=n)},p.initEdges=function(e,t){var n=e.length/2;this.edges.length=0;for(var r=0;r<n;r++){var i=e[2*r],o=e[2*r+1],a=this.nodes[i],s=this.nodes[o];if(!a||!s)return void console.error("Node not exists, try initNodes before initEdges");a.outDegree++,s.inDegree++;var l=new h(a,s);t&&(l.weight=t[r]),this.edges.push(l)}},p.updateSettings=function(){if(this.repulsionByDegree)for(var e=0;e<this.nodes.length;e++){(t=this.nodes[e]).mass=t.inDegree+t.outDegree+1}else for(e=0;e<this.nodes.length;e++){var t;(t=this.nodes[e]).mass=this._massArr[e]}},p.update=function(){var o=this.nodes.length;if(this.updateSettings(),this.updateBBox(),this.barnesHutOptimize){this.rootRegion.setBBox(this.bbox[0],this.bbox[1],this.bbox[2],this.bbox[3]),this.rootRegion.beforeUpdate();for(var l=0;l<o;l++)this.rootRegion.addNode(this.nodes[l]);this.rootRegion.afterUpdate()}for(l=0;l<o;l++){var u=this.nodes[l];a(u.forcePrev,u.force),s(u.force,0,0)}for(l=0;l<o;l++){var c=this.nodes[l];if(this.barnesHutOptimize)this.applyRegionToNodeRepulsion(this.rootRegion,c);else for(var h=l+1;h<o;h++){var d=this.nodes[h];this.applyNodeToNodeRepulsion(c,d,!1)}this.gravity>0&&(this.strongGravityMode?this.applyNodeStrongGravity(c):this.applyNodeGravity(c))}for(l=0;l<this.edges.length;l++)this.applyEdgeAttraction(this.edges[l]);var p=0,f=0,g=e();for(l=0;l<o;l++){u=this.nodes[l];p+=(v=t(u.force,u.forcePrev))*u.mass,i(g,u.force,u.forcePrev),f+=.5*n(g)*u.mass,this._swingingArr[l]=v}var m=this.jitterTolerence*this.jitterTolerence*f/p;this._globalSpeed>0&&(m=Math.min(m/this._globalSpeed,1.5)*this._globalSpeed),this._globalSpeed=m;for(l=0;l<o;l++){u=this.nodes[l];var v=this._swingingArr[l],y=.1*m/(1+m*Math.sqrt(v)),_=n(u.force);_>0&&(y=Math.min(_*y,10)/_,r(u.position,u.position,u.force,y))}},p.applyRegionToNodeRepulsion=function(){var t=e();return function(e,n){if(e.node)this.applyNodeToNodeRepulsion(e.node,n,!0);else{o(t,n.position,e.centerOfMass);var i=t[0]*t[0]+t[1]*t[1];if(i>this.barnesHutTheta*e.size*e.size){var a=this.scaling*n.mass*e.mass/i;r(n.force,n.force,t,a)}else for(var s=0;s<e.nSubRegions;s++)this.applyRegionToNodeRepulsion(e.subRegions[s],n)}}}(),p.applyNodeToNodeRepulsion=function(){var t=e();return function(e,n,i){if(e!=n){o(t,e.position,n.position);var a=t[0]*t[0]+t[1]*t[1];if(0!==a){var s;if(this.preventOverlap){var l=Math.sqrt(a);if((l=l-e.size-n.size)>0)s=this.scaling*e.mass*n.mass/(l*l);else{if(!(l<0))return;s=100*this.scaling*e.mass*n.mass}}else s=this.scaling*e.mass*n.mass/a;r(e.force,e.force,t,s),r(n.force,n.force,t,-s)}}}}(),p.applyEdgeAttraction=function(){var t=e();return function(e){var i=e.source,a=e.target;o(t,i.position,a.position);var s,l,u=n(t);s=0===this.edgeWeightInfluence?1:1===this.edgeWeightInfluence?e.weight:Math.pow(e.weight,this.edgeWeightInfluence),this.preventOverlap&&(u=u-i.size-a.size)<=0||(l=this.linLogMode?-s*Math.log(u+1)/(u+1):-s,r(i.force,i.force,t,l),r(a.force,a.force,t,-l))}}(),p.applyNodeGravity=function(){var t=e();return function(e){o(t,this.gravityCenter,e.position);var i=n(t);r(e.force,e.force,t,this.gravity*e.mass/(i+1))}}(),p.applyNodeStrongGravity=function(){var t=e();return function(e){o(t,this.gravityCenter,e.position),r(e.force,e.force,t,this.gravity*e.mass)}}(),p.updateBBox=function(){for(var e=1/0,t=1/0,n=-1/0,r=-1/0,i=0;i<this.nodes.length;i++){var o=this.nodes[i].position;e=Math.min(e,o[0]),t=Math.min(t,o[1]),n=Math.max(n,o[0]),r=Math.max(r,o[1])}this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=r},p.getGlobalSpeed=function(){return this._globalSpeed};var f=null;self.onmessage=function(e){switch(e.data.cmd){case"init":(f=new d).initNodes(e.data.nodesPosition,e.data.nodesMass,e.data.nodesSize),f.initEdges(e.data.edges,e.data.edgesWeight);break;case"updateConfig":if(f)for(var t in e.data.config)f[t]=e.data.config[t];break;case"update":var n=e.data.steps;if(f){for(var r=0;r<n;r++)f.update();var i=f.nodes.length,o=new Float32Array(2*i);for(r=0;r<i;r++){var a=f.nodes[r];o[2*r]=a.position[0],o[2*r+1]=a.position[1]}self.postMessage({buffer:o.buffer,globalSpeed:f.getGlobalSpeed()},[o.buffer])}else{var s=new Float32Array;self.postMessage({buffer:s.buffer,globalSpeed:f.getGlobalSpeed()},[s.buffer])}}}}.toString();o5=o5.slice(o5.indexOf("{")+1,o5.lastIndexOf("}"));var a5={barnesHutOptimize:!0,barnesHutTheta:1.5,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null},s5=function(e){for(var t in a5)this[t]=a5[t];if(e)for(var t in e)this[t]=e[t];this._nodes=[],this._edges=[],this._disposed=!1,this._positionTex=new RK({type:EK.FLOAT,flipY:!1,minFilter:EK.NEAREST,magFilter:EK.NEAREST})};s5.prototype.initData=function(e,t){var n=new Blob([o5]),r=window.URL.createObjectURL(n);this._worker=new Worker(r),this._worker.onmessage=this._$onupdate.bind(this),this._nodes=e,this._edges=t,this._frame=0;for(var i=e.length,o=t.length,a=new Float32Array(2*i),s=new Float32Array(i),l=new Float32Array(i),u=new Float32Array(2*o),c=new Float32Array(o),h=0;h<e.length;h++){var d=e[h];a[2*h]=d.x,a[2*h+1]=d.y,s[h]=null==d.mass?1:d.mass,l[h]=null==d.size?1:d.size}for(h=0;h<t.length;h++){var p=t[h],f=p.node1,g=p.node2;u[2*h]=f,u[2*h+1]=g,c[h]=null==p.weight?1:p.weight}var m=Math.ceil(Math.sqrt(e.length)),v=m,y=new Float32Array(m*v*4),_=this._positionTex;_.width=m,_.height=v,_.pixels=y,this._worker.postMessage({cmd:"init",nodesPosition:a,nodesMass:s,nodesSize:l,edges:u,edgesWeight:c}),this._globalSpeed=1/0},s5.prototype.updateOption=function(e){var t={};for(var n in a5)t[n]=a5[n];var r=this._nodes,i=this._edges,o=r.length;if(t.jitterTolerence=o>5e4?10:o>5e3?1:.1,t.scaling=o>100?2:10,t.barnesHutOptimize=o>1e3,e)for(var n in a5)null!=e[n]&&(t[n]=e[n]);if(!t.gravityCenter){for(var a=[1/0,1/0],s=[-1/0,-1/0],l=0;l<r.length;l++)a[0]=Math.min(r[l].x,a[0]),a[1]=Math.min(r[l].y,a[1]),s[0]=Math.max(r[l].x,s[0]),s[1]=Math.max(r[l].y,s[1]);t.gravityCenter=[.5*(a[0]+s[0]),.5*(a[1]+s[1])]}for(l=0;l<i.length;l++){var u=i[l].node1,c=i[l].node2;r[u].degree=(r[u].degree||0)+1,r[c].degree=(r[c].degree||0)+1}this._worker&&this._worker.postMessage({cmd:"updateConfig",config:t})},s5.prototype.update=function(e,t,n){null==t&&(t=1),t=Math.max(t,1),this._frame+=t,this._onupdate=n,this._worker&&this._worker.postMessage({cmd:"update",steps:Math.round(t)})},s5.prototype._$onupdate=function(e){if(!this._disposed){var t=new Float32Array(e.data.buffer);this._globalSpeed=e.data.globalSpeed,this._positionArr=t,this._updateTexture(t),this._onupdate&&this._onupdate()}},s5.prototype.getNodePositionTexture=function(){return this._positionTex},s5.prototype.getNodeUV=function(e,t){t=t||[];var n=this._positionTex.width,r=this._positionTex.height;return t[0]=e%n/(n-1),t[1]=Math.floor(e/n)/(r-1),t},s5.prototype.getNodes=function(){return this._nodes},s5.prototype.getEdges=function(){return this._edges},s5.prototype.isFinished=function(e){return this._frame>e},s5.prototype.getNodePosition=function(e,t){if(t||(t=new Float32Array(2*this._nodes.length)),this._positionArr)for(var n=0;n<this._positionArr.length;n++)t[n]=this._positionArr[n];return t},s5.prototype._updateTexture=function(e){for(var t=this._positionTex.pixels,n=0,r=0;r<e.length;)t[n++]=e[r++],t[n++]=e[r++],t[n++]=1,t[n++]=1;this._positionTex.dirty()},s5.prototype.dispose=function(e){this._disposed=!0,this._worker=null};var l5=wY.extend((function(){return{zr:null,viewGL:null,minZoom:.2,maxZoom:5,_needsUpdate:!1,_dx:0,_dy:0,_zoom:1}}),(function(){this._mouseDownHandler=this._mouseDownHandler.bind(this),this._mouseWheelHandler=this._mouseWheelHandler.bind(this),this._mouseMoveHandler=this._mouseMoveHandler.bind(this),this._mouseUpHandler=this._mouseUpHandler.bind(this),this._update=this._update.bind(this)}),{init:function(){var e=this.zr;e.on("mousedown",this._mouseDownHandler),e.on("mousewheel",this._mouseWheelHandler),e.on("globalout",this._mouseUpHandler),e.animation.on("frame",this._update)},setTarget:function(e){this._target=e},setZoom:function(e){this._zoom=Math.max(Math.min(e,this.maxZoom),this.minZoom),this._needsUpdate=!0},setOffset:function(e){this._dx=e[0],this._dy=e[1],this._needsUpdate=!0},getZoom:function(){return this._zoom},getOffset:function(){return[this._dx,this._dy]},_update:function(){if(this._target&&this._needsUpdate){var e=this._target,t=this._zoom;e.position.x=this._dx,e.position.y=this._dy,e.scale.set(t,t,t),this.zr.refresh(),this._needsUpdate=!1,this.trigger("update")}},_mouseDownHandler:function(e){if(!e.target){var t=e.offsetX,n=e.offsetY;if(!this.viewGL||this.viewGL.containPoint(t,n)){this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler);var r=this._convertPos(t,n);this._x=r.x,this._y=r.y}}},_convertPos:function(e,t){var n=this.viewGL.camera,r=this.viewGL.viewport;return{x:(e-r.x)/r.width*(n.right-n.left)+n.left,y:(t-r.y)/r.height*(n.bottom-n.top)+n.top}},_mouseMoveHandler:function(e){var t=this._convertPos(e.offsetX,e.offsetY);this._dx+=t.x-this._x,this._dy+=t.y-this._y,this._x=t.x,this._y=t.y,this._needsUpdate=!0},_mouseUpHandler:function(e){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_mouseWheelHandler:function(e){var t=(e=e.event).wheelDelta||-e.detail;if(0!==t){var n=e.offsetX,r=e.offsetY;if(!this.viewGL||this.viewGL.containPoint(n,r)){var i=t>0?1.1:.9,o=Math.max(Math.min(this._zoom*i,this.maxZoom),this.minZoom);i=o/this._zoom;var a=this._convertPos(n,r),s=(a.x-this._dx)*(i-1),l=(a.y-this._dy)*(i-1);this._dx-=s,this._dy-=l,this._zoom=o,this._needsUpdate=!0}}},dispose:function(){var e=this.zr;e.off("mousedown",this._mouseDownHandler),e.off("mousemove",this._mouseMoveHandler),e.off("mouseup",this._mouseUpHandler),e.off("mousewheel",this._mouseWheelHandler),e.off("globalout",this._mouseUpHandler),e.animation.off("frame",this._update)}}),u5=uQ.vec2;BJ.Shader.import("@export ecgl.lines2D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.vertex\n\nattribute vec2 position: POSITION;\nattribute vec2 normal;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n vec4 p2 = worldViewProjection * vec4(position + normal, -10.0, 1.0);\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n p2.xy /= p2.w;\n gl_Position.xy /= gl_Position.w;\n\n vec2 N = normalize(p2.xy - gl_Position.xy);\n gl_Position.xy += N * offset / viewport.zw * 2.0;\n\n gl_Position.xy *= gl_Position.w;\n\n v_Color = a_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n\n@end");var c5=1,h5=em.extend({type:"graphGL",__ecgl__:!0,init:function(e,t){this.groupGL=new BJ.Node,this.viewGL=new O0("orthographic"),this.viewGL.camera.left=this.viewGL.camera.right=0,this.viewGL.add(this.groupGL),this._pointsBuilder=new m3(!0,t),this._forceEdgesMesh=new BJ.Mesh({material:new BJ.Material({shader:BJ.createShader("ecgl.forceAtlas2.edges"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new BJ.Geometry({attributes:{node:new BJ.Geometry.Attribute("node","float",2),color:new BJ.Geometry.Attribute("color","float",4,"COLOR")},dynamic:!0,mainAttribute:"node"}),renderOrder:-1,mode:BJ.Mesh.LINES}),this._edgesMesh=new BJ.Mesh({material:new BJ.Material({shader:BJ.createShader("ecgl.meshLines2D"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new n5({useNativeLine:!1,dynamic:!0}),renderOrder:-1,culling:!1}),this._layoutId=0,this._control=new l5({zr:t.getZr(),viewGL:this.viewGL}),this._control.setTarget(this.groupGL),this._control.init(),this._clickHandler=this._clickHandler.bind(this)},render:function(e,t,n){this.groupGL.add(this._pointsBuilder.rootNode),this._model=e,this._api=n,this._initLayout(e,t,n),this._pointsBuilder.update(e,t,n),this._forceLayoutInstance instanceof i5||this.groupGL.remove(this._forceEdgesMesh),this._updateCamera(e,n),this._control.off("update"),this._control.on("update",(function(){n.dispatchAction({type:"graphGLRoam",seriesId:e.id,zoom:this._control.getZoom(),offset:this._control.getOffset()}),this._pointsBuilder.updateView(this.viewGL.camera)}),this),this._control.setZoom(_J(e.get("zoom"),1)),this._control.setOffset(e.get("offset")||[0,0]);var r=this._pointsBuilder.getPointsMesh();if(r.off("mousemove",this._mousemoveHandler),r.off("mouseout",this._mouseOutHandler,this),n.getZr().off("click",this._clickHandler),this._pointsBuilder.highlightOnMouseover=!0,e.get("focusNodeAdjacency")){var i=e.get("focusNodeAdjacencyOn");"click"===i?n.getZr().on("click",this._clickHandler):"mouseover"===i?(r.on("mousemove",this._mousemoveHandler,this),r.on("mouseout",this._mouseOutHandler,this),this._pointsBuilder.highlightOnMouseover=!1):"production"!==process.env.NODE_ENV&&console.warn("Unkown focusNodeAdjacencyOn value s"+i)}this._lastMouseOverDataIndex=-1},_clickHandler:function(e){if(!this._layouting){var t=this._pointsBuilder.getPointsMesh().dataIndex;t>=0?this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:t}):this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id})}},_mousemoveHandler:function(e){if(!this._layouting){var t=this._pointsBuilder.getPointsMesh().dataIndex;t>=0?t!==this._lastMouseOverDataIndex&&this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:t}):this._mouseOutHandler(e),this._lastMouseOverDataIndex=t}},_mouseOutHandler:function(e){this._layouting||(this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id}),this._lastMouseOverDataIndex=-1)},_updateForceEdgesGeometry:function(e,t){var n=this._forceEdgesMesh.geometry,r=t.getEdgeData(),i=0,o=this._forceLayoutInstance,a=2*r.count();n.attributes.node.init(a),n.attributes.color.init(a),r.each((function(t){var a=e[t];n.attributes.node.set(i,o.getNodeUV(a.node1)),n.attributes.node.set(i+1,o.getNodeUV(a.node2));var s=I1(r,a.dataIndex),l=BJ.parseColor(s);l[3]*=_J(E1(r,a.dataIndex),1),n.attributes.color.set(i,l),n.attributes.color.set(i+1,l),i+=2})),n.dirty()},_updateMeshLinesGeometry:function(){var e=this._model.getEdgeData(),t=this._edgesMesh.geometry,n=(e=this._model.getEdgeData(),this._model.getData().getLayout("points"));t.resetOffset(),t.setVertexCount(e.count()*t.getLineVertexCount()),t.setTriangleCount(e.count()*t.getLineTriangleCount());var r=[],i=[],o=["lineStyle","width"];this._originalEdgeColors=new Float32Array(4*e.count()),this._edgeIndicesMap=new Float32Array(e.count()),e.each((function(a){var s=e.graph.getEdgeByIndex(a),l=2*s.node1.dataIndex,u=2*s.node2.dataIndex;r[0]=n[l],r[1]=n[l+1],i[0]=n[u],i[1]=n[u+1];var c=I1(e,s.dataIndex),h=BJ.parseColor(c);h[3]*=_J(E1(e,s.dataIndex),1);var d=e.getItemModel(s.dataIndex),p=_J(d.get(o),1)*this._api.getDevicePixelRatio();t.addLine(r,i,h,p);for(var f=0;f<4;f++)this._originalEdgeColors[4*s.dataIndex+f]=h[f];this._edgeIndicesMap[s.dataIndex]=a}),this),t.dirty()},_updateForceNodesGeometry:function(e){for(var t=this._pointsBuilder.getPointsMesh(),n=[],r=0;r<e.count();r++)this._forceLayoutInstance.getNodeUV(r,n),t.geometry.attributes.position.set(r,n);t.geometry.dirty("position")},_initLayout:function(e,t,n){var r=e.get("layout"),i=e.getGraph(),o=Zd(e.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()});"force"===r&&("production"!==process.env.NODE_ENV&&console.warn("Currently only forceAtlas2 layout supported."),r="forceAtlas2"),this.stopLayout(e,t,n,{beforeLayout:!0});var a=e.getData(),s=e.getData();if("forceAtlas2"===r){var l=e.getModel("forceAtlas2"),u=this._forceLayoutInstance,c=[],h=[],d=a.getDataExtent("value"),p=s.getDataExtent("value"),f=_J(l.get("edgeWeight"),1),g=_J(l.get("nodeWeight"),1);"number"==typeof f&&(f=[f,f]),"number"==typeof g&&(g=[g,g]);var m=0,v={},y=new Float32Array(2*a.count());if(i.eachNode((function(e){var t,n,r=e.dataIndex,i=a.get("value",r);if(a.hasItemOption){var s=a.getItemModel(r);t=s.get("x"),n=s.get("y")}null==t&&(t=o.x+Math.random()*o.width,n=o.y+Math.random()*o.height),y[2*m]=t,y[2*m+1]=n,v[e.id]=m++;var l=io(i,d,g);isNaN(l)&&(l=isNaN(g[0])?1:g[0]),c.push({x:t,y:n,mass:l,size:a.getItemVisual(r,"symbolSize")})})),a.setLayout("points",y),i.eachEdge((function(e){var t=e.dataIndex,n=io(a.get("value",t),p,f);isNaN(n)&&(n=isNaN(f[0])?1:f[0]),h.push({node1:v[e.node1.id],node2:v[e.node2.id],weight:n,dataIndex:t})})),!u){var _=l.get("GPU");this._forceLayoutInstance&&((!_||this._forceLayoutInstance instanceof i5)&&(_||this._forceLayoutInstance instanceof s5)||(this._forceLayoutInstanceToDispose=this._forceLayoutInstance)),u=this._forceLayoutInstance=_?new i5:new s5}u.initData(c,h),u.updateOption(l.option),this._updateForceEdgesGeometry(u.getEdges(),e),this._updatePositionTexture(),n.dispatchAction({type:"graphGLStartLayout",from:this.uid})}else{y=new Float32Array(2*a.count()),m=0;i.eachNode((function(e){var t,n,r=e.dataIndex;if(a.hasItemOption){var i=a.getItemModel(r);t=i.get("x"),n=i.get("y")}y[m++]=t,y[m++]=n})),a.setLayout("points",y),this._updateAfterLayout(e,t,n)}},_updatePositionTexture:function(){var e=this._forceLayoutInstance.getNodePositionTexture();this._pointsBuilder.setPositionTexture(e),this._forceEdgesMesh.material.set("positionTex",e)},startLayout:function(e,t,n,r){if(!r||null==r.from||r.from===this.uid){var i=this.viewGL,o=(n=this._api,this._forceLayoutInstance),a=this._model.getData(),s=this._model.getModel("forceAtlas2");if(o){if(this.groupGL.remove(this._edgesMesh),this.groupGL.add(this._forceEdgesMesh),this._forceLayoutInstance){this._updateForceNodesGeometry(e.getData()),this._pointsBuilder.hideLabels();var l=this,u=this._layoutId=c5++,c=s.getShallow("maxSteps"),h=s.getShallow("steps"),d=0,p=Math.max(2*h,20),f=function(t){if(t===l._layoutId)return o.isFinished(c)?(n.dispatchAction({type:"graphGLStopLayout",from:l.uid}),void n.dispatchAction({type:"graphGLFinishLayout",points:a.getLayout("points"),from:l.uid})):void o.update(i.layer.renderer,h,(function(){l._updatePositionTexture(),(d+=h)>=p&&(l._syncNodePosition(e),d=0),n.getZr().refresh(),dn((function(){f(t)}))}))};dn((function(){l._forceLayoutInstanceToDispose&&(l._forceLayoutInstanceToDispose.dispose(i.layer.renderer),l._forceLayoutInstanceToDispose=null),f(u)})),this._layouting=!0}}else"production"!==process.env.NODE_ENV&&console.error("None layout don't have startLayout action")}},stopLayout:function(e,t,n,r){r&&null!=r.from&&r.from!==this.uid||(this._layoutId=0,this.groupGL.remove(this._forceEdgesMesh),this.groupGL.add(this._edgesMesh),this._forceLayoutInstance&&this.viewGL.layer&&(r&&r.beforeLayout||(this._syncNodePosition(e),this._updateAfterLayout(e,t,n)),this._api.getZr().refresh(),this._layouting=!1))},_syncNodePosition:function(e){var t=this._forceLayoutInstance.getNodePosition(this.viewGL.layer.renderer);e.getData().setLayout("points",t),e.setNodePosition(t)},_updateAfterLayout:function(e,t,n){this._updateMeshLinesGeometry(),this._pointsBuilder.removePositionTexture(),this._pointsBuilder.updateLayout(e,t,n),this._pointsBuilder.updateView(this.viewGL.camera),this._pointsBuilder.updateLabels(),this._pointsBuilder.showLabels()},focusNodeAdjacency:function(e,t,n,r){var i=this._model.getData();this._downplayAll();var o=r.dataIndex,a=i.graph,s=[],l=a.getNodeByIndex(o);s.push(l),l.edges.forEach((function(e){e.dataIndex<0||(e.node1!==l&&s.push(e.node1),e.node2!==l&&s.push(e.node2))}),this),this._pointsBuilder.fadeOutAll(.05),this._fadeOutEdgesAll(.05),s.forEach((function(e){this._pointsBuilder.highlight(i,e.dataIndex)}),this),this._pointsBuilder.updateLabels(s.map((function(e){return e.dataIndex})));var u=[];l.edges.forEach((function(e){e.dataIndex>=0&&(this._highlightEdge(e.dataIndex),u.push(e))}),this),this._focusNodes=s,this._focusEdges=u},unfocusNodeAdjacency:function(e,t,n,r){this._downplayAll(),this._pointsBuilder.fadeInAll(),this._fadeInEdgesAll(),this._pointsBuilder.updateLabels()},_highlightEdge:function(e){var t=this._model.getEdgeData().getItemModel(e),n=BJ.parseColor(t.get("emphasis.lineStyle.color")||t.get("lineStyle.color")),r=_J(t.get("emphasis.lineStyle.opacity"),t.get("lineStyle.opacity"),1);n[3]*=r,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],n)},_downplayAll:function(){this._focusNodes&&this._focusNodes.forEach((function(e){this._pointsBuilder.downplay(this._model.getData(),e.dataIndex)}),this),this._focusEdges&&this._focusEdges.forEach((function(e){this._downplayEdge(e.dataIndex)}),this)},_downplayEdge:function(e){var t=this._getColor(e,[]);this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],t)},_setEdgeFade:function(){var e=[];return function(t,n){this._getColor(t,e),e[3]*=n,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],e)}}(),_getColor:function(e,t){for(var n=0;n<4;n++)t[n]=this._originalEdgeColors[4*e+n];return t},_fadeOutEdgesAll:function(e){this._model.getData().graph.eachEdge((function(t){this._setEdgeFade(t.dataIndex,e)}),this)},_fadeInEdgesAll:function(){this._fadeOutEdgesAll(1)},_updateCamera:function(e,t){this.viewGL.setViewport(0,0,t.getWidth(),t.getHeight(),t.getDevicePixelRatio());for(var n=this.viewGL.camera,r=e.getData().getLayout("points"),i=u5.create(1/0,1/0),o=u5.create(-1/0,-1/0),a=[],s=0;s<r.length;)a[0]=r[s++],a[1]=r[s++],u5.min(i,i,a),u5.max(o,o,a);var l=(o[1]+i[1])/2,u=(o[0]+i[0])/2;if(!(u>n.left&&u<n.right&&l<n.bottom&&l>n.top)){var c=Math.max(o[0]-i[0],10),h=c/t.getWidth()*t.getHeight();c*=1.4,h*=1.4,i[0]-=.2*c,n.left=i[0],n.top=l-h/2,n.bottom=l+h/2,n.right=c+i[0],n.near=0,n.far=100}},dispose:function(){var e=this.viewGL.layer.renderer;this._forceLayoutInstance&&this._forceLayoutInstance.dispose(e),this.groupGL.removeAll(),this._layoutId=-1,this._pointsBuilder.dispose()},remove:function(){this.groupGL.removeAll(),this._control.dispose()}});function d5(e){return e instanceof Array||(e=[e,e]),e}l_((function(e){function t(){}e.registerChartView(h5),e.registerSeriesModel(Q3),e.registerVisual((function(e){const t={};e.eachSeriesByType("graphGL",(function(e){var n=e.getCategoriesData(),r=e.getData(),i={};n.each((function(r){var o=n.getName(r);i["ec-"+o]=r;var a=n.getItemModel(r),s=a.getModel("itemStyle").getItemStyle();s.fill||(s.fill=e.getColorFromPalette(o,t)),n.setItemVisual(r,"style",s);var l=["symbol","symbolSize","symbolKeepAspect"];for(let e=0;e<l.length;e++){var u=a.getShallow(l[e],!0);null!=u&&n.setItemVisual(r,l[e],u)}})),n.count()&&r.each((function(e){let t=r.getItemModel(e).getShallow("category");if(null!=t){"string"==typeof t&&(t=i["ec-"+t]);var o=n.getItemVisual(t,"style");z(r.ensureUniqueItemVisual(e,"style"),o);var a=["symbol","symbolSize","symbolKeepAspect"];for(let i=0;i<a.length;i++)r.setItemVisual(e,a[i],n.getItemVisual(t,a[i]))}}))}))})),e.registerVisual((function(e){e.eachSeriesByType("graphGL",(function(e){var t=e.getGraph(),n=e.getEdgeData(),r=d5(e.get("edgeSymbol")),i=d5(e.get("edgeSymbolSize"));n.setVisual("drawType","stroke"),n.setVisual("fromSymbol",r&&r[0]),n.setVisual("toSymbol",r&&r[1]),n.setVisual("fromSymbolSize",i&&i[0]),n.setVisual("toSymbolSize",i&&i[1]),n.setVisual("style",e.getModel("lineStyle").getLineStyle()),n.each((function(e){var r=n.getItemModel(e),i=t.getEdgeByIndex(e),o=d5(r.getShallow("symbol",!0)),a=d5(r.getShallow("symbolSize",!0)),s=r.getModel("lineStyle").getLineStyle(),l=n.ensureUniqueItemVisual(e,"style");switch(z(l,s),l.stroke){case"source":var u=i.node1.getVisual("style");l.stroke=u&&u.fill;break;case"target":u=i.node2.getVisual("style");l.stroke=u&&u.fill}o[0]&&i.setVisual("fromSymbol",o[0]),o[1]&&i.setVisual("toSymbol",o[1]),a[0]&&i.setVisual("fromSymbolSize",a[0]),a[1]&&i.setVisual("toSymbolSize",a[1])}))}))})),e.registerAction({type:"graphGLRoam",event:"graphglroam",update:"series.graphGL:roam"},(function(e,t){t.eachComponent({mainType:"series",query:e},(function(t){t.setView(e)}))})),e.registerAction({type:"graphGLStartLayout",event:"graphgllayoutstarted",update:"series.graphGL:startLayout"},t),e.registerAction({type:"graphGLStopLayout",event:"graphgllayoutstopped",update:"series.graphGL:stopLayout"},t),e.registerAction({type:"graphGLFocusNodeAdjacency",event:"graphGLFocusNodeAdjacency",update:"series.graphGL:focusNodeAdjacency"},t),e.registerAction({type:"graphGLUnfocusNodeAdjacency",event:"graphGLUnfocusNodeAdjacency",update:"series.graphGL:unfocusNodeAdjacency"},t)}));var p5=Hg.extend({type:"series.flowGL",dependencies:["geo","grid","bmap"],visualStyleAccessPath:"itemStyle",getInitialData:function(e,t){var n=this.get("coordinateSystem"),r="geo"===n?["lng","lat"]:$y(n)||["x","y"];if("production"!==process.env.NODE_ENV&&r.length>2)throw new Error("flowGL can only be used on 2d coordinate systems.");r.push("vx","vy");var i=k_(this.getSource(),{coordDimensions:r,encodeDefine:this.get("encode"),dimensionsDefine:this.get("dimensions")}),o=new R_(i,this);return o.initData(this.getSource()),o},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,supersampling:1,particleType:"point",particleDensity:128,particleSize:1,particleSpeed:1,particleTrail:2,colorTexture:null,gridWidth:"auto",gridHeight:"auto",itemStyle:{color:"#fff",opacity:.8}}}),f5=XK.extend((function(){return{dynamic:!0,attributes:{position:new XK.Attribute("position","float",3,"POSITION")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setLineCount:function(e){var t=this.attributes,n=4*e,r=2*e;this.vertexCount!==n&&t.position.init(n),this.triangleCount!==r&&(this.indices=0===r?null:this.vertexCount>65535?new Uint32Array(3*r):new Uint16Array(3*r))},addLine:function(e){var t=this._vertexOffset;this.attributes.position.set(t,[e[0],e[1],1]),this.attributes.position.set(t+1,[e[0],e[1],-1]),this.attributes.position.set(t+2,[e[0],e[1],2]),this.attributes.position.set(t+3,[e[0],e[1],-2]),this.setTriangleIndices(this._faceOffset++,[t,t+1,t+2]),this.setTriangleIndices(this._faceOffset++,[t+1,t+2,t+3]),this._vertexOffset+=4}});wq.import("@export ecgl.vfParticle.particle.fragment\n\nuniform sampler2D particleTexture;\nuniform sampler2D spawnTexture;\nuniform sampler2D velocityTexture;\n\nuniform float deltaTime;\nuniform float elapsedTime;\n\nuniform float speedScaling : 1.0;\n\nuniform vec2 textureSize;\nuniform vec4 region : [0, 0, 1, 1];\nuniform float firstFrameTime;\n\nvarying vec2 v_Texcoord;\n\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, v_Texcoord);\n bool spawn = false;\n if (p.w <= 0.0) {\n p = texture2D(spawnTexture, fract(v_Texcoord + elapsedTime / 10.0));\n p.w -= firstFrameTime;\n spawn = true;\n }\n vec2 v = texture2D(velocityTexture, fract(p.xy * region.zw + region.xy)).xy;\n v = (v - 0.5) * 2.0;\n p.z = length(v);\n p.xy += v * deltaTime / 10.0 * speedScaling;\n p.w -= deltaTime;\n\n if (spawn || p.xy != fract(p.xy)) {\n p.z = 0.0;\n }\n p.xy = fract(p.xy);\n\n gl_FragColor = p;\n}\n@end\n\n@export ecgl.vfParticle.renderPoints.vertex\n\n#define PI 3.1415926\n\nattribute vec2 texcoord : TEXCOORD_0;\n\nuniform sampler2D particleTexture;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nuniform float size : 1.0;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, texcoord);\n\n if (p.w > 0.0 && p.z > 1e-5) {\n gl_Position = worldViewProjection * vec4(p.xy * 2.0 - 1.0, 0.0, 1.0);\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n\n v_Mag = p.z;\n v_Uv = p.xy;\n\n gl_PointSize = size;\n}\n\n@end\n\n@export ecgl.vfParticle.renderPoints.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\nuniform sampler2D spriteTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n#ifdef SPRITETEXTURE_ENABLED\n gl_FragColor *= texture2D(spriteTexture, gl_PointCoord);\n if (color.a == 0.0) {\n discard;\n }\n#endif\n#ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.vertex\n\n#define PI 3.1415926\n\nattribute vec3 position : POSITION;\n\nuniform sampler2D particleTexture;\nuniform sampler2D prevParticleTexture;\n\nuniform float size : 1.0;\nuniform vec4 vp: VIEWPORT;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\n@import clay.util.rand\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, position.xy);\n vec4 p2 = texture2D(prevParticleTexture, position.xy);\n\n p.xy = p.xy * 2.0 - 1.0;\n p2.xy = p2.xy * 2.0 - 1.0;\n\n if (p.w > 0.0 && p.z > 1e-5) {\n vec2 dir = normalize(p.xy - p2.xy);\n vec2 norm = vec2(dir.y / vp.z, -dir.x / vp.w) * sign(position.z) * size;\n if (abs(position.z) == 2.0) {\n gl_Position = vec4(p.xy + norm, 0.0, 1.0);\n v_Uv = p.xy;\n v_Mag = p.z;\n }\n else {\n gl_Position = vec4(p2.xy + norm, 0.0, 1.0);\n v_Mag = p2.z;\n v_Uv = p2.xy;\n }\n gl_Position = worldViewProjection * gl_Position;\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n #ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n");var g5=function(){this.motionBlurFactor=.99,this.vectorFieldTexture=new RK({type:EK.FLOAT,flipY:!1}),this.particleLife=[5,20],this._particleType="point",this._particleSize=1,this.particleColor=[1,1,1,1],this.particleSpeedScaling=1,this._thisFrameTexture=null,this._particlePass=null,this._spawnTexture=null,this._particleTexture0=null,this._particleTexture1=null,this._particlePointsMesh=null,this._surfaceFrameBuffer=null,this._elapsedTime=0,this._scene=null,this._camera=null,this._lastFrameTexture=null,this._supersampling=1,this._downsampleTextures=[],this._width=512,this._height=512,this.init()};g5.prototype={constructor:g5,init:function(){var e={type:EK.FLOAT,minFilter:EK.NEAREST,magFilter:EK.NEAREST,useMipmap:!1};this._spawnTexture=new RK(e),this._particleTexture0=new RK(e),this._particleTexture1=new RK(e),this._frameBuffer=new V$({depthBuffer:!1}),this._particlePass=new cJ({fragment:wq.source("ecgl.vfParticle.particle.fragment")}),this._particlePass.setUniform("velocityTexture",this.vectorFieldTexture),this._particlePass.setUniform("spawnTexture",this._spawnTexture),this._downsamplePass=new cJ({fragment:wq.source("clay.compositor.downsample")});var t=new LK({renderOrder:10,material:new jZ({shader:new wq(wq.source("ecgl.vfParticle.renderPoints.vertex"),wq.source("ecgl.vfParticle.renderPoints.fragment"))}),mode:LK.POINTS,geometry:new XK({dynamic:!0,mainAttribute:"texcoord0"})}),n=new LK({renderOrder:10,material:new jZ({shader:new wq(wq.source("ecgl.vfParticle.renderLines.vertex"),wq.source("ecgl.vfParticle.renderLines.fragment"))}),geometry:new f5,culling:!1}),r=new LK({material:new jZ({shader:new wq(wq.source("ecgl.color.vertex"),wq.source("ecgl.color.fragment"))}),geometry:new G$});r.material.enableTexture("diffuseMap"),this._particlePointsMesh=t,this._particleLinesMesh=n,this._lastFrameFullQuadMesh=r,this._camera=new aJ,this._thisFrameTexture=new RK,this._lastFrameTexture=new RK},setParticleDensity:function(e,t){for(var n=new Float32Array(4*(e*t)),r=0,i=this.particleLife,o=0;o<e;o++)for(var a=0;a<t;a++,r++){n[4*r]=Math.random(),n[4*r+1]=Math.random(),n[4*r+2]=Math.random();var s=(i[1]-i[0])*Math.random()+i[0];n[4*r+3]=s}"line"===this._particleType?this._setLineGeometry(e,t):this._setPointsGeometry(e,t),this._spawnTexture.width=e,this._spawnTexture.height=t,this._spawnTexture.pixels=n,this._particleTexture0.width=this._particleTexture1.width=e,this._particleTexture0.height=this._particleTexture1.height=t,this._particlePass.setUniform("textureSize",[e,t])},_setPointsGeometry:function(e,t){var n=e*t,r=this._particlePointsMesh.geometry,i=r.attributes;i.texcoord0.init(n);for(var o=0,a=0;a<e;a++)for(var s=0;s<t;s++,o++)i.texcoord0.value[2*o]=a/e,i.texcoord0.value[2*o+1]=s/t;r.dirty()},_setLineGeometry:function(e,t){var n=e*t,r=this._getParticleMesh().geometry;r.setLineCount(n),r.resetOffset();for(var i=0;i<e;i++)for(var o=0;o<t;o++)r.addLine([i/e,o/t]);r.dirty()},_getParticleMesh:function(){return"line"===this._particleType?this._particleLinesMesh:this._particlePointsMesh},update:function(e,t,n,r){var i=this._getParticleMesh(),o=this._frameBuffer,a=this._particlePass;r&&this._updateDownsampleTextures(e,t),i.material.set("size",this._particleSize*this._supersampling),i.material.set("color",this.particleColor),a.setUniform("speedScaling",this.particleSpeedScaling),o.attach(this._particleTexture1),a.setUniform("firstFrameTime",r?(this.particleLife[1]+this.particleLife[0])/2:0),a.setUniform("particleTexture",this._particleTexture0),a.setUniform("deltaTime",n),a.setUniform("elapsedTime",this._elapsedTime),a.render(e,o),i.material.set("particleTexture",this._particleTexture1),i.material.set("prevParticleTexture",this._particleTexture0),o.attach(this._thisFrameTexture),o.bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT);var s=this._lastFrameFullQuadMesh;s.material.set("diffuseMap",this._lastFrameTexture),s.material.set("color",[1,1,1,this.motionBlurFactor]),this._camera.update(!0),e.renderPass([s,i],this._camera),o.unbind(e),this._downsample(e),this._swapTexture(),this._elapsedTime+=n},_downsample:function(e){var t=this._downsampleTextures;if(0!==t.length)for(var n=0,r=this._thisFrameTexture,i=t[n];i;)this._frameBuffer.attach(i),this._downsamplePass.setUniform("texture",r),this._downsamplePass.setUniform("textureSize",[r.width,r.height]),this._downsamplePass.render(e,this._frameBuffer),r=i,i=t[++n]},getSurfaceTexture:function(){var e=this._downsampleTextures;return e.length>0?e[e.length-1]:this._lastFrameTexture},setRegion:function(e){this._particlePass.setUniform("region",e)},resize:function(e,t){this._lastFrameTexture.width=e*this._supersampling,this._lastFrameTexture.height=t*this._supersampling,this._thisFrameTexture.width=e*this._supersampling,this._thisFrameTexture.height=t*this._supersampling,this._width=e,this._height=t},setParticleSize:function(e){var t=this._getParticleMesh();if(e<=2)return t.material.disableTexture("spriteTexture"),void(t.material.transparent=!1);this._spriteTexture||(this._spriteTexture=new RK),this._spriteTexture.image&&this._spriteTexture.image.width===e||(this._spriteTexture.image=function(e){var t=document.createElement("canvas");t.width=t.height=e;var n=t.getContext("2d");return n.fillStyle="#fff",n.arc(e/2,e/2,e/2,0,2*Math.PI),n.fill(),t}(e),this._spriteTexture.dirty()),t.material.transparent=!0,t.material.enableTexture("spriteTexture"),t.material.set("spriteTexture",this._spriteTexture),this._particleSize=e},setGradientTexture:function(e){var t=this._getParticleMesh().material;t[e?"enableTexture":"disableTexture"]("gradientTexture"),t.setUniform("gradientTexture",e)},setColorTextureImage:function(e,t){this._getParticleMesh().material.setTextureImage("colorTexture",e,t,{flipY:!0})},setParticleType:function(e){this._particleType=e},clearFrame:function(e){var t=this._frameBuffer;t.attach(this._lastFrameTexture),t.bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),t.unbind(e)},setSupersampling:function(e){this._supersampling=e,this.resize(this._width,this._height)},_updateDownsampleTextures:function(e,t){for(var n=this._downsampleTextures,r=Math.max(Math.floor(Math.log(this._supersampling/t.getDevicePixelRatio())/Math.log(2)),0),i=2,o=this._width*this._supersampling,a=this._height*this._supersampling,s=0;s<r;s++)n[s]=n[s]||new RK,n[s].width=o/i,n[s].height=a/i,i*=2;for(;s<n.length;s++)n[s].dispose(e);n.length=r},_swapTexture:function(){var e=this._particleTexture0;this._particleTexture0=this._particleTexture1,this._particleTexture1=e;e=this._thisFrameTexture;this._thisFrameTexture=this._lastFrameTexture,this._lastFrameTexture=e},dispose:function(e){e.disposeFrameBuffer(this._frameBuffer),e.disposeTexture(this.vectorFieldTexture),e.disposeTexture(this._spawnTexture),e.disposeTexture(this._particleTexture0),e.disposeTexture(this._particleTexture1),e.disposeTexture(this._thisFrameTexture),e.disposeTexture(this._lastFrameTexture),e.disposeGeometry(this._particleLinesMesh.geometry),e.disposeGeometry(this._particlePointsMesh.geometry),e.disposeGeometry(this._lastFrameFullQuadMesh.geometry),this._spriteTexture&&e.disposeTexture(this._spriteTexture),this._particlePass.dispose(e),this._downsamplePass.dispose(e),this._downsampleTextures.forEach((function(t){t.dispose(e)}))}};var m5=em.extend({type:"flowGL",__ecgl__:!0,init:function(e,t){this.viewGL=new O0("orthographic"),this.groupGL=new BJ.Node,this.viewGL.add(this.groupGL),this._particleSurface=new g5;var n=new BJ.Mesh({geometry:new BJ.PlaneGeometry,material:new BJ.Material({shader:new BJ.Shader({vertex:BJ.Shader.source("ecgl.color.vertex"),fragment:BJ.Shader.source("ecgl.color.fragment")}),transparent:!0})});n.material.enableTexture("diffuseMap"),this.groupGL.add(n),this._planeMesh=n},render:function(e,t,n){var r=this._particleSurface;r.setParticleType(e.get("particleType")),r.setSupersampling(e.get("supersampling")),this._updateData(e,n),this._updateCamera(n.getWidth(),n.getHeight(),n.getDevicePixelRatio());var i=_J(e.get("particleDensity"),128);r.setParticleDensity(i,i);var o=this._planeMesh,a=+new Date,s=this,l=!0;o.__percent=0,o.stopAnimation(),o.animate("",{loop:!0}).when(1e5,{__percent:1}).during((function(){var e=+new Date,t=Math.min(e-a,20);a+=t,s._renderer&&(r.update(s._renderer,n,t/1e3,l),o.material.set("diffuseMap",r.getSurfaceTexture())),l=!1})).start();var u=e.getModel("itemStyle"),c=BJ.parseColor(u.get("color"));c[3]*=_J(u.get("opacity"),1),o.material.set("color",c),r.setColorTextureImage(e.get("colorTexture"),n),r.setParticleSize(e.get("particleSize")),r.particleSpeedScaling=e.get("particleSpeed"),r.motionBlurFactor=1-Math.pow(.1,e.get("particleTrail"))},updateTransform:function(e,t,n){this._updateData(e,n)},afterRender:function(e,t,n,r){var i=r.renderer;this._renderer=i},_updateData:function(e,t){var n=e.coordinateSystem,r=n.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]})),i=e.getData(),o=i.getDataExtent(r[0]),a=i.getDataExtent(r[1]),s=e.get("gridWidth"),l=e.get("gridHeight");if(null==s||"auto"===s){var u=(o[1]-o[0])/(a[1]-a[0]);s=Math.round(Math.sqrt(u*i.count()))}null!=l&&"auto"!==l||(l=Math.ceil(i.count()/s));var c=this._particleSurface.vectorFieldTexture,h=c.pixels;if(h&&h.length===l*s*4)for(var d=0;d<h.length;d++)h[d]=0;else h=c.pixels=new Float32Array(s*l*4);var p=0,f=1/0,g=new Float32Array(2*i.count()),m=0,v=[[1/0,1/0],[-1/0,-1/0]];i.each([r[0],r[1],"vx","vy"],(function(e,t,r,i){var o=n.dataToPoint([e,t]);g[m++]=o[0],g[m++]=o[1],v[0][0]=Math.min(o[0],v[0][0]),v[0][1]=Math.min(o[1],v[0][1]),v[1][0]=Math.max(o[0],v[1][0]),v[1][1]=Math.max(o[1],v[1][1]);var a=Math.sqrt(r*r+i*i);p=Math.max(p,a),f=Math.min(f,a)})),i.each(["vx","vy"],(function(e,t,n){var r=Math.round((g[2*n]-v[0][0])/(v[1][0]-v[0][0])*(s-1)),i=4*((l-1-Math.round((g[2*n+1]-v[0][1])/(v[1][1]-v[0][1])*(l-1)))*s+r);h[i]=e/p*.5+.5,h[i+1]=t/p*.5+.5,h[i+3]=1})),c.width=s,c.height=l,"bmap"===e.get("coordinateSystem")&&this._fillEmptyPixels(c),c.dirty(),this._updatePlanePosition(v[0],v[1],e,t),this._updateGradientTexture(i.getVisual("visualMeta"),[f,p])},_fillEmptyPixels:function(e){var t=e.pixels,n=e.width,r=e.height;function i(e,i,o){e=Math.max(Math.min(e,n-1),0);var a=4*((i=Math.max(Math.min(i,r-1),0))*(n-1)+e);return 0!==t[a+3]&&(o[0]=t[a],o[1]=t[a+1],!0)}function o(e,t,n){n[0]=e[0]+t[0],n[1]=e[1]+t[1]}for(var a=[],s=[],l=[],u=[],c=[],h=0,d=0;d<r;d++)for(var p=0;p<n;p++){var f=4*(d*(n-1)+p);0===t[f+3]&&(h=a[0]=a[1]=0,i(p-1,d,s)&&(h++,o(s,a,a)),i(p+1,d,l)&&(h++,o(l,a,a)),i(p,d-1,u)&&(h++,o(u,a,a)),i(p,d+1,c)&&(h++,o(c,a,a)),a[0]/=h,a[1]/=h,t[f]=a[0],t[f+1]=a[1]),t[f+3]=1}},_updateGradientTexture:function(e,t){if(e&&e.length){this._gradientTexture=this._gradientTexture||new BJ.Texture2D({image:document.createElement("canvas")});var n=this._gradientTexture,r=n.image;r.width=200,r.height=1;var i=r.getContext("2d"),o=i.createLinearGradient(0,.5,r.width,.5);e[0].stops.forEach((function(e){var n;t[1]===t[0]?n=0:(n=e.value/t[1],n=Math.min(Math.max(n,0),1)),o.addColorStop(n,e.color)})),i.fillStyle=o,i.fillRect(0,0,r.width,r.height),n.dirty(),this._particleSurface.setGradientTexture(this._gradientTexture)}else this._particleSurface.setGradientTexture(null)},_updatePlanePosition:function(e,t,n,r){var i=this._limitInViewportAndFullFill(e,t,n,r);e=i.leftTop,t=i.rightBottom,this._particleSurface.setRegion(i.region),this._planeMesh.position.set((e[0]+t[0])/2,r.getHeight()-(e[1]+t[1])/2,0);var o=t[0]-e[0],a=t[1]-e[1];this._planeMesh.scale.set(o/2,a/2,1),this._particleSurface.resize(Math.max(Math.min(o,2048),1),Math.max(Math.min(a,2048),1)),this._renderer&&this._particleSurface.clearFrame(this._renderer)},_limitInViewportAndFullFill:function(e,t,n,r){var i=[Math.max(e[0],0),Math.max(e[1],0)],o=[Math.min(t[0],r.getWidth()),Math.min(t[1],r.getHeight())];if("bmap"===n.get("coordinateSystem")){var a=n.getData().getDataExtent(n.coordDimToDataDim("lng")[0]);Math.floor(a[1]-a[0])>=359&&(i[0]>0&&(i[0]=0),o[0]<r.getWidth()&&(o[0]=r.getWidth()))}var s=t[0]-e[0],l=t[1]-e[1],u=o[0]-i[0],c=o[1]-i[1];return{leftTop:i,rightBottom:o,region:[(i[0]-e[0])/s,1-c/l-(i[1]-e[1])/l,u/s,c/l]}},_updateCamera:function(e,t,n){this.viewGL.setViewport(0,0,e,t,n);var r=this.viewGL.camera;r.left=r.bottom=0,r.top=t,r.right=e,r.near=0,r.far=100,r.position.z=10},remove:function(){this._planeMesh.stopAnimation(),this.groupGL.removeAll()},dispose:function(){this._renderer&&this._particleSurface.dispose(this._renderer),this.groupGL.removeAll()}});l_((function(e){e.registerChartView(m5),e.registerSeriesModel(p5)}));var v5=Hg.extend({type:"series.linesGL",dependencies:["grid","geo"],visualStyleAccessPath:"lineStyle",visualDrawType:"stroke",streamEnabled:!0,init:function(e){var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),v5.superApply(this,"init",arguments)},mergeOption:function(e){var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),v5.superApply(this,"mergeOption",arguments)},appendData:function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=Me(this._flatCoords,t.flatCoords),this._flatCoordsOffset=Me(this._flatCoordsOffset,t.flatCoordsOffset)):(this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset),e.data=new Float32Array(t.count)),this.getRawData().appendData(e.data)},_getCoordsFromItemModel:function(e){var t=this.getData().getItemModel(e),n=t.option instanceof Array?t.option:t.getShallow("coords");if("production"!==process.env.NODE_ENV&&!(n instanceof Array&&n.length>0&&n[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(n)+". Lines must have 2d coords array in data item.");return n},getLineCoordsCount:function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},getLineCoords:function(e,t){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*e],r=this._flatCoordsOffset[2*e+1],i=0;i<r;i++)t[i]=t[i]||[],t[i][0]=this._flatCoords[n+2*i],t[i][1]=this._flatCoords[n+2*i+1];return r}var o=this._getCoordsFromItemModel(e);for(i=0;i<o.length;i++)t[i]=t[i]||[],t[i][0]=o[i][0],t[i][1]=o[i][1];return o.length},_processFlatCoordsArray:function(e){var t=0;if(this._flatCoords&&(t=this._flatCoords.length),"number"==typeof e[0]){for(var n=e.length,r=new Uint32Array(n),i=new Float64Array(n),o=0,a=0,s=0,l=0;l<n;){s++;var u=e[l++];r[a++]=o+t,r[a++]=u;for(var c=0;c<u;c++){var h=e[l++],d=e[l++];if(i[o++]=h,i[o++]=d,l>n&&"production"!==process.env.NODE_ENV)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(r.buffer,0,a),flatCoords:i,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},getInitialData:function(e,t){var n=new R_(["value"],this);return n.hasItemOption=!1,n.initData(e.data,[],(function(e,t,r,i){if(e instanceof Array)return NaN;n.hasItemOption=!0;var o=e.value;return null!=o?o instanceof Array?o[i]:o:void 0})),n},defaultOption:{coordinateSystem:"geo",zlevel:10,progressive:1e4,progressiveThreshold:5e4,blendMode:"source-over",lineStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}}),y5=em.extend({type:"linesGL",__ecgl__:!0,init:function(e,t){this.groupGL=new BJ.Node,this.viewGL=new O0("orthographic"),this.viewGL.add(this.groupGL),this._glViewHelper=new $3(this.viewGL),this._nativeLinesShader=BJ.createShader("ecgl.lines3D"),this._meshLinesShader=BJ.createShader("ecgl.meshLines3D"),this._linesMeshes=[],this._currentStep=0},render:function(e,t,n){this.groupGL.removeAll(),this._glViewHelper.reset(e,n);var r=this._linesMeshes[0];r||(r=this._linesMeshes[0]=this._createLinesMesh(e)),this._linesMeshes.length=1,this.groupGL.add(r),this._updateLinesMesh(e,r,0,e.getData().count()),this.viewGL.setPostEffect(e.getModel("postEffect"),n)},incrementalPrepareRender:function(e,t,n){this.groupGL.removeAll(),this._glViewHelper.reset(e,n),this._currentStep=0,this.viewGL.setPostEffect(e.getModel("postEffect"),n)},incrementalRender:function(e,t,n,r){var i=this._linesMeshes[this._currentStep];i||(i=this._createLinesMesh(t),this._linesMeshes[this._currentStep]=i),this._updateLinesMesh(t,i,e.start,e.end),this.groupGL.add(i),r.getZr().refresh(),this._currentStep++},updateTransform:function(e,t,n){e.coordinateSystem.getRoamTransform&&this._glViewHelper.updateTransform(e,n)},_createLinesMesh:function(e){return new BJ.Mesh({$ignorePicking:!0,material:new BJ.Material({shader:BJ.createShader("ecgl.lines3D"),transparent:!0,depthMask:!1,depthTest:!1}),geometry:new n5({segmentScale:10,useNativeLine:!0,dynamic:!1}),mode:BJ.Mesh.LINES,culling:!1})},_updateLinesMesh:function(e,t,n,r){var i=e.getData();t.material.blend="lighter"===e.get("blendMode")?BJ.additiveBlend:null;var o=e.get("lineStyle.curveness")||0,a=e.get("polyline"),s=t.geometry,l=e.coordinateSystem,u=_J(e.get("lineStyle.width"),1);u>1?(t.material.shader!==this._meshLinesShader&&t.material.attachShader(this._meshLinesShader),t.mode=BJ.Mesh.TRIANGLES):(t.material.shader!==this._nativeLinesShader&&t.material.attachShader(this._nativeLinesShader),t.mode=BJ.Mesh.LINES),n=n||0,r=r||i.count(),s.resetOffset();var c=0,h=0,d=[],p=[],f=[],g=[],m=[],v=.3,y=.7;function _(){p[0]=d[0]*y+g[0]*v-(d[1]-g[1])*o,p[1]=d[1]*y+g[1]*v-(g[0]-d[0])*o,f[0]=d[0]*v+g[0]*y-(d[1]-g[1])*o,f[1]=d[1]*v+g[1]*y-(g[0]-d[0])*o}if(a||0!==o)for(var x=n;x<r;x++)if(a){var b=e.getLineCoordsCount(x);c+=s.getPolylineVertexCount(b),h+=s.getPolylineTriangleCount(b)}else e.getLineCoords(x,m),this._glViewHelper.dataToPoint(l,m[0],d),this._glViewHelper.dataToPoint(l,m[1],g),_(),c+=s.getCubicCurveVertexCount(d,p,f,g),h+=s.getCubicCurveTriangleCount(d,p,f,g);else{var w=r-n;c+=w*s.getLineVertexCount(),h+=w*s.getLineVertexCount()}s.setVertexCount(c),s.setTriangleCount(h);var S=n,T=[];for(x=n;x<r;x++){BJ.parseColor(I1(i,S),T);var M=_J(E1(i,S),1);T[3]*=M;b=e.getLineCoords(x,m);for(var C=0;C<b;C++)this._glViewHelper.dataToPoint(l,m[C],m[C]);a?s.addPolyline(m,T,u,0,b):0!==o?(d=m[0],g=m[1],_(),s.addCubicCurve(d,p,f,g,T,u)):s.addPolyline(m,T,u,0,2),S++}},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});l_((function(e){e.registerChartView(y5),e.registerSeriesModel(v5)}));const _5=({className:e="",style:n={},extraOption:r={},lineStyles:i={},pointsStyles:s={},pointsData:l=[],linesData:u=[],globeOption:c={}})=>{const h=t(null),[d,p]=o();return a((()=>{const e=By(h.current);p(e);const t=$X(e.resize,500),n=()=>{t()};return globalThis.addEventListener("resize",n),()=>{globalThis.removeEventListener("resize",n)}}),[]),a((()=>{if(d){const e=[];e.push(Object.assign({type:"lines3D",name:"lines3D",effect:{show:!0,trailWidth:2,trailLength:.15,trailOpacity:1,trailColor:"rgb(30, 30, 60)"},lineStyle:{width:5,color:"rgb(50, 50, 150)",opacity:.3},blendMode:"lighter",data:u},i)),e.push(Object.assign({type:"scatter3D",coordinateSystem:"globe",zlevel:3,rippleEffect:{brushType:"stroke"},label:{fontSize:8,show:!0,position:"right",formatter:"{b}"},itemStyle:{normal:{color:"#f5f802"}},data:l},s)),d.setOption(Object.assign({backgroundColor:"#000",baseColor:"#000",shading:"realistic",globe:Object.assign({environment:"https://img.alicdn.com/imgextra/i2/O1CN017x8UE61p6wqej1Y0c_!!6000000005312-0-tps-2048-1024.jpg",heightTexture:"https://img.alicdn.com/imgextra/i2/O1CN01BB16kM1ILFttfdYZg_!!6000000000876-0-tps-4096-2048.jpg",baseTexture:"https://img.alicdn.com/imgextra/i4/O1CN01fs70Dq25ElSd8mU6C_!!6000000007495-0-tps-5400-2700.jpg",shading:"lambert",light:{ambient:{intensity:1},main:{intensity:.1}},viewControl:{autoRotate:!0,distance:2e3}},c),series:e},r));const t=setTimeout((()=>{d.resize()}),500);return()=>{clearTimeout(t)}}}),[d,r,c,i,u,l,s]),yU.jsx(oX,{ref:h,className:e,style:n})};export{_5 as EarthChart,pY as WinChart,aX as WinChartType,pY as default,hU as echarts};