1 |
- System.register(["./vendor-legacy.4c930df7.js"],(function(e){"use strict";var t;return{setters:[function(e){t=e.U,e.V}],execute:function(){var i,n,r,a,o,s,l,u={},h={},c={},d=2311,f=function(){return d++},p="object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?{browser:{},os:{},node:!1,wxa:!0,canvasSupported:!0,svgSupported:!1,touchEventsSupported:!0,domSupported:!1}:"undefined"==typeof document&&"undefined"!=typeof self?{browser:{},os:{},node:!1,worker:!0,canvasSupported:!0,domSupported:!1}:"undefined"==typeof navigator?{browser:{},os:{},node:!0,worker:!1,canvasSupported:!0,svgSupported:!0,domSupported:!1}:(i=navigator.userAgent,n={},r={},a=i.match(/Firefox\/([\d.]+)/),o=i.match(/MSIE\s([\d.]+)/)||i.match(/Trident\/.+?rv:(([\d.]+))/),s=i.match(/Edge\/([\d.]+)/),l=/micromessenger/i.test(i),a&&(r.firefox=!0,r.version=a[1]),o&&(r.ie=!0,r.version=o[1]),s&&(r.edge=!0,r.version=s[1]),l&&(r.weChat=!0),{browser:r,os:n,node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:"undefined"!=typeof SVGRect,touchEventsSupported:"ontouchstart"in window&&!r.ie&&!r.edge,pointerEventsSupported:"onpointerdown"in window&&(r.edge||r.ie&&r.version>=11),domSupported:"undefined"!=typeof document}),g={},m={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},v={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},y=Object.prototype.toString,_=Array.prototype,x=_.forEach,b=_.filter,w=_.slice,T=_.map,S=_.reduce,M={};function A(e){if(null==e||"object"!=typeof e)return e;var t=e,i=y.call(e);if("[object Array]"===i){if(!B(e)){t=[];for(var n=0,r=e.length;n<r;n++)t[n]=A(e[n])}}else if(v[i]){if(!B(e)){var a=e.constructor;if(e.constructor.from)t=a.from(e);else for(t=new a(e.length),n=0,r=e.length;n<r;n++)t[n]=A(e[n])}}else if(!m[i]&&!B(e)&&!k(e))for(var o in t={},e)e.hasOwnProperty(o)&&(t[o]=A(e[o]));return t}function I(e,t,i){if(!R(t)||!R(e))return i?A(t):e;for(var n in t)if(t.hasOwnProperty(n)){var r=e[n],a=t[n];!R(a)||!R(r)||N(a)||N(r)||k(a)||k(r)||O(a)||O(r)||B(a)||B(r)?!i&&n in e||(e[n]=A(t[n])):I(r,a,i)}return e}function C(e,t,i){for(var n in t)t.hasOwnProperty(n)&&(i?null!=t[n]:null==e[n])&&(e[n]=t[n]);return e}var D,E=function(){return M.createCanvas()};function L(e,t,i){if(e&&t)if(e.forEach&&e.forEach===x)e.forEach(t,i);else if(e.length===+e.length)for(var n=0,r=e.length;n<r;n++)t.call(i,e[n],n,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(i,e[a],a,e)}function P(e,t){var i=w.call(arguments,2);return function(){return e.apply(t,i.concat(w.call(arguments)))}}function N(e){return"[object Array]"===y.call(e)}function R(e){var t=typeof e;return"function"===t||!!e&&"object"===t}function O(e){return!!m[y.call(e)]}function k(e){return"object"==typeof e&&"number"==typeof e.nodeType&&"object"==typeof e.ownerDocument}M.createCanvas=function(){return document.createElement("canvas")};var z="__ec_primitive__";function B(e){return e[z]}function F(e){var t=N(e);this.data={};var i=this;function n(e,n){t?i.set(e,n):i.set(n,e)}e instanceof F?e.each(n):e&&L(e,n)}F.prototype={constructor:F,get:function(e){return this.data.hasOwnProperty(e)?this.data[e]:null},set:function(e,t){return this.data[e]=t},each:function(e,t){for(var i in void 0!==t&&(e=P(e,t)),this.data)this.data.hasOwnProperty(i)&&e(this.data[i],i)},removeKey:function(e){delete this.data[e]}},g.$override=function(e,t){"createCanvas"===e&&(D=null),M[e]=t},g.clone=A,g.merge=I,g.mergeAll=function(e,t){for(var i=e[0],n=1,r=e.length;n<r;n++)i=I(i,e[n],t);return i},g.extend=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},g.defaults=C,g.createCanvas=E,g.getContext=function(){return D||(D=E().getContext("2d")),D},g.indexOf=function(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i}return-1},g.inherits=function(e,t){var i=e.prototype;function n(){}for(var r in n.prototype=t.prototype,e.prototype=new n,i)i.hasOwnProperty(r)&&(e.prototype[r]=i[r]);e.prototype.constructor=e,e.superClass=t},g.mixin=function(e,t,i){C(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,i)},g.isArrayLike=function(e){if(e)return"string"!=typeof e&&"number"==typeof e.length},g.each=L,g.map=function(e,t,i){if(e&&t){if(e.map&&e.map===T)return e.map(t,i);for(var n=[],r=0,a=e.length;r<a;r++)n.push(t.call(i,e[r],r,e));return n}},g.reduce=function(e,t,i,n){if(e&&t){if(e.reduce&&e.reduce===S)return e.reduce(t,i,n);for(var r=0,a=e.length;r<a;r++)i=t.call(n,i,e[r],r,e);return i}},g.filter=function(e,t,i){if(e&&t){if(e.filter&&e.filter===b)return e.filter(t,i);for(var n=[],r=0,a=e.length;r<a;r++)t.call(i,e[r],r,e)&&n.push(e[r]);return n}},g.find=function(e,t,i){if(e&&t)for(var n=0,r=e.length;n<r;n++)if(t.call(i,e[n],n,e))return e[n]},g.bind=P,g.curry=function(e){var t=w.call(arguments,1);return function(){return e.apply(this,t.concat(w.call(arguments)))}},g.isArray=N,g.isFunction=function(e){return"function"==typeof e},g.isString=function(e){return"[object String]"===y.call(e)},g.isObject=R,g.isBuiltInObject=O,g.isTypedArray=function(e){return!!v[y.call(e)]},g.isDom=k,g.eqNaN=function(e){return e!=e},g.retrieve=function(e){for(var t=0,i=arguments.length;t<i;t++)if(null!=arguments[t])return arguments[t]},g.retrieve2=function(e,t){return null!=e?e:t},g.retrieve3=function(e,t,i){return null!=e?e:null!=t?t:i},g.slice=function(){return Function.call.apply(w,arguments)},g.normalizeCssArray=function(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},g.assert=function(e,t){if(!e)throw new Error(t)},g.trim=function(e){return null==e?null:"function"==typeof e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},g.setAsPrimitive=function(e){e[z]=!0},g.isPrimitive=B,g.createHashMap=function(e){return new F(e)},g.concatArray=function(e,t){for(var i=new e.constructor(e.length+t.length),n=0;n<e.length;n++)i[n]=e[n];var r=e.length;for(n=0;n<t.length;n++)i[n+r]=t[n];return i},g.noop=function(){};var V={},G="undefined"==typeof Float32Array?Array:Float32Array;function H(e){return Math.sqrt(W(e))}var U=H;function W(e){return e[0]*e[0]+e[1]*e[1]}var j=W;function X(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var Z=X;function q(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var Y=q;function K(){this.on("mousedown",this._dragStart,this),this.on("mousemove",this._drag,this),this.on("mouseup",this._dragEnd,this)}function Q(e,t){return{target:e,topTarget:t&&t.topTarget}}V.create=function(e,t){var i=new G(2);return null==e&&(e=0),null==t&&(t=0),i[0]=e,i[1]=t,i},V.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},V.clone=function(e){var t=new G(2);return t[0]=e[0],t[1]=e[1],t},V.set=function(e,t,i){return e[0]=t,e[1]=i,e},V.add=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e},V.scaleAndAdd=function(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e},V.sub=function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e},V.len=H,V.length=U,V.lenSquare=W,V.lengthSquare=j,V.mul=function(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e},V.div=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e},V.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},V.scale=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e},V.normalize=function(e,t){var i=H(t);return 0===i?(e[0]=0,e[1]=0):(e[0]=t[0]/i,e[1]=t[1]/i),e},V.distance=X,V.dist=Z,V.distanceSquare=q,V.distSquare=Y,V.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},V.lerp=function(e,t,i,n){return e[0]=t[0]+n*(i[0]-t[0]),e[1]=t[1]+n*(i[1]-t[1]),e},V.applyTransform=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[2]*r+i[4],e[1]=i[1]*n+i[3]*r+i[5],e},V.min=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e},V.max=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e},K.prototype={constructor:K,_dragStart:function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.dispatchToElement(Q(t,e),"dragstart",e.event))},_drag:function(e){var t=this._draggingTarget;if(t){var i=e.offsetX,n=e.offsetY,r=i-this._x,a=n-this._y;this._x=i,this._y=n,t.drift(r,a,e),this.dispatchToElement(Q(t,e),"drag",e.event);var o=this.findHover(i,n,t).target,s=this._dropTarget;this._dropTarget=o,t!==o&&(s&&o!==s&&this.dispatchToElement(Q(s,e),"dragleave",e.event),o&&o!==s&&this.dispatchToElement(Q(o,e),"dragenter",e.event))}},_dragEnd:function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.dispatchToElement(Q(t,e),"dragend",e.event),this._dropTarget&&this.dispatchToElement(Q(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null}};var J=K,$=Array.prototype.slice,ee=function(e){this._$handlers={},this._$eventProcessor=e};function te(e,t,i,n,r,a){var o=e._$handlers;if("function"==typeof i&&(r=n,n=i,i=null),!n||!t)return e;i=function(e,t){var i=e._$eventProcessor;return null!=t&&i&&i.normalizeQuery&&(t=i.normalizeQuery(t)),t}(e,i),o[t]||(o[t]=[]);for(var s=0;s<o[t].length;s++)if(o[t][s].h===n)return e;var l={h:n,one:a,query:i,ctx:r||e,callAtLast:n.zrEventfulCallAtLast},u=o[t].length-1,h=o[t][u];return h&&h.callAtLast?o[t].splice(u,0,l):o[t].push(l),e}ee.prototype={constructor:ee,one:function(e,t,i,n){return te(this,e,t,i,n,!0)},on:function(e,t,i,n){return te(this,e,t,i,n,!1)},isSilent:function(e){var t=this._$handlers;return!t[e]||!t[e].length},off:function(e,t){var i=this._$handlers;if(!e)return this._$handlers={},this;if(t){if(i[e]){for(var n=[],r=0,a=i[e].length;r<a;r++)i[e][r].h!==t&&n.push(i[e][r]);i[e]=n}i[e]&&0===i[e].length&&delete i[e]}else delete i[e];return this},trigger:function(e){var t=this._$handlers[e],i=this._$eventProcessor;if(t){var n=arguments,r=n.length;r>3&&(n=$.call(n,1));for(var a=t.length,o=0;o<a;){var s=t[o];if(i&&i.filter&&null!=s.query&&!i.filter(e,s.query))o++;else{switch(r){case 1:s.h.call(s.ctx);break;case 2:s.h.call(s.ctx,n[1]);break;case 3:s.h.call(s.ctx,n[1],n[2]);break;default:s.h.apply(s.ctx,n)}s.one?(t.splice(o,1),a--):o++}}}return i&&i.afterTrigger&&i.afterTrigger(e),this},triggerWithContext:function(e){var t=this._$handlers[e],i=this._$eventProcessor;if(t){var n=arguments,r=n.length;r>4&&(n=$.call(n,1,n.length-1));for(var a=n[n.length-1],o=t.length,s=0;s<o;){var l=t[s];if(i&&i.filter&&null!=l.query&&!i.filter(e,l.query))s++;else{switch(r){case 1:l.h.call(a);break;case 2:l.h.call(a,n[1]);break;case 3:l.h.call(a,n[1],n[2]);break;default:l.h.apply(a,n)}l.one?(t.splice(s,1),o--):s++}}}return i&&i.afterTrigger&&i.afterTrigger(e),this}};var ie=ee,ne={},re={},ae={},oe=Math.log(2);function se(e,t,i,n,r,a){var o=n+"-"+r,s=e.length;if(a.hasOwnProperty(o))return a[o];if(1===t){var l=Math.round(Math.log((1<<s)-1&~r)/oe);return e[i][l]}for(var u=n|1<<i,h=i+1;n&1<<h;)h++;for(var c=0,d=0,f=0;d<s;d++){var p=1<<d;p&r||(c+=(f%2?-1:1)*e[i][d]*se(e,t-1,h,u,r|p,a),f++)}return a[o]=c,c}ae.buildTransformer=function(e,t){var i=[[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]]],n={},r=se(i,8,0,0,0,n);if(0!==r){for(var a=[],o=0;o<8;o++)for(var s=0;s<8;s++)null==a[s]&&(a[s]=0),a[s]+=((o+s)%2?-1:1)*se(i,7,0===o?1:0,1<<o,1<<s,n)/r*t[o];return function(e,t,i){var n=t*a[6]+i*a[7]+1;e[0]=(t*a[0]+i*a[1]+a[2])/n,e[1]=(t*a[3]+i*a[4]+a[5])/n}}};var le=p,ue=ae.buildTransformer,he=[];function ce(e,t,i,n,r){if(t.getBoundingClientRect&&le.domSupported&&!de(t)){var a=t.___zrEVENTSAVED||(t.___zrEVENTSAVED={}),o=function(e,t){var i=t.markers;if(i)return i;i=t.markers=[];for(var n=["left","right"],r=["top","bottom"],a=0;a<4;a++){var o=document.createElement("div"),s=a%2,l=(a>>1)%2;o.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[s]+":0",r[l]+":0",n[1-s]+":auto",r[1-l]+":auto",""].join("!important;"),e.appendChild(o),i.push(o)}return i}(t,a),s=function(e,t,i){for(var n=i?"invTrans":"trans",r=t[n],a=t.srcCoords,o=!0,s=[],l=[],u=0;u<4;u++){var h=e[u].getBoundingClientRect(),c=2*u,d=h.left,f=h.top;s.push(d,f),o=o&&a&&d===a[c]&&f===a[c+1],l.push(e[u].offsetLeft,e[u].offsetTop)}return o&&r?r:(t.srcCoords=s,t[n]=i?ue(l,s):ue(s,l))}(o,a,r);if(s)return s(e,i,n),!0}return!1}function de(e){return"CANVAS"===e.nodeName.toUpperCase()}re.transformLocalCoord=function(e,t,i,n,r){return ce(he,t,n,r,!0)&&ce(e,i,he[0],he[1])},re.transformCoordWithViewport=ce,re.isCanvasEl=de;var fe=ie;ne.Dispatcher=fe;var pe=p,ge=re,me=ge.isCanvasEl,ve=ge.transformCoordWithViewport,ye="undefined"!=typeof window&&!!window.addEventListener,_e=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,xe=[];function be(e,t,i,n){return i=i||{},n||!pe.canvasSupported?we(e,t,i):pe.browser.firefox&&null!=t.layerX&&t.layerX!==t.offsetX?(i.zrX=t.layerX,i.zrY=t.layerY):null!=t.offsetX?(i.zrX=t.offsetX,i.zrY=t.offsetY):we(e,t,i),i}function we(e,t,i){if(pe.domSupported&&e.getBoundingClientRect){var n=t.clientX,r=t.clientY;if(me(e)){var a=e.getBoundingClientRect();return i.zrX=n-a.left,void(i.zrY=r-a.top)}if(ve(xe,e,n,r))return i.zrX=xe[0],void(i.zrY=xe[1])}i.zrX=i.zrY=0}function Te(e){return e||window.event}var Se=ye?function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0}:function(e){e.returnValue=!1,e.cancelBubble=!0};ne.clientToLocal=be,ne.getNativeEvent=Te,ne.normalizeEvent=function(e,t,i){if(null!=(t=Te(t)).zrX)return t;var n=t.type;if(n&&n.indexOf("touch")>=0){var r="touchend"!==n?t.targetTouches[0]:t.changedTouches[0];r&&be(e,r,t,i)}else be(e,t,t,i),t.zrDelta=t.wheelDelta?t.wheelDelta/120:-(t.detail||0)/3;var a=t.button;return null==t.which&&void 0!==a&&_e.test(t.type)&&(t.which=1&a?1:2&a?3:4&a?2:0),t},ne.addEventListener=function(e,t,i,n){ye?e.addEventListener(t,i,n):e.attachEvent("on"+t,i)},ne.removeEventListener=function(e,t,i,n){ye?e.removeEventListener(t,i,n):e.detachEvent("on"+t,i)},ne.stop=Se,ne.isMiddleOrRightButtonOnMouseUpDown=function(e){return 2===e.which||3===e.which},ne.notLeftMouse=function(e){return e.which>1};var Me=ne,Ae=function(){this._track=[]};function Ie(e){var t=e[1][0]-e[0][0],i=e[1][1]-e[0][1];return Math.sqrt(t*t+i*i)}Ae.prototype={constructor:Ae,recognize:function(e,t,i){return this._doTrack(e,t,i),this._recognize(e)},clear:function(){return this._track.length=0,this},_doTrack:function(e,t,i){var n=e.touches;if(n){for(var r={points:[],touches:[],target:t,event:e},a=0,o=n.length;a<o;a++){var s=n[a],l=Me.clientToLocal(i,s,{});r.points.push([l.zrX,l.zrY]),r.touches.push(s)}this._track.push(r)}},_recognize:function(e){for(var t in Ce)if(Ce.hasOwnProperty(t)){var i=Ce[t](this._track,e);if(i)return i}}};var Ce={pinch:function(e,t){var i=e.length;if(i){var n,r=(e[i-1]||{}).points,a=(e[i-2]||{}).points||r;if(a&&a.length>1&&r&&r.length>1){var o=Ie(r)/Ie(a);!isFinite(o)&&(o=1),t.pinchScale=o;var s=[((n=r)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];return t.pinchX=s[0],t.pinchY=s[1],{type:"pinch",target:e[0].target,event:t}}}}},De=g,Ee=V,Le=J,Pe=ie,Ne=ne,Re=Ae,Oe="silent";function ke(){Ne.stop(this.event)}function ze(){}ze.prototype.dispose=function(){};var Be=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Fe=function(e,t,i,n){Pe.call(this),this.storage=e,this.painter=t,this.painterRoot=n,i=i||new ze,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,this._gestureMgr,Le.call(this),this.setHandlerProxy(i)};function Ve(e,t,i){if(e[e.rectHover?"rectContain":"contain"](t,i)){for(var n,r=e;r;){if(r.clipPath&&!r.clipPath.contain(t,i))return!1;r.silent&&(n=!0),r=r.parent}return!n||Oe}return!1}function Ge(e,t,i){var n=e.painter;return t<0||t>n.getWidth()||i<0||i>n.getHeight()}Fe.prototype={constructor:Fe,setHandlerProxy:function(e){this.proxy&&this.proxy.dispose(),e&&(De.each(Be,(function(t){e.on&&e.on(t,this[t],this)}),this),e.handler=this),this.proxy=e},mousemove:function(e){var t=e.zrX,i=e.zrY,n=Ge(this,t,i),r=this._hovered,a=r.target;a&&!a.__zr&&(a=(r=this.findHover(r.x,r.y)).target);var o=this._hovered=n?{x:t,y:i}:this.findHover(t,i),s=o.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),a&&s!==a&&this.dispatchToElement(r,"mouseout",e),this.dispatchToElement(o,"mousemove",e),s&&s!==a&&this.dispatchToElement(o,"mouseover",e)},mouseout:function(e){var t=e.zrEventControl,i=e.zrIsToLocalDOM;"only_globalout"!==t&&this.dispatchToElement(this._hovered,"mouseout",e),"no_globalout"!==t&&!i&&this.trigger("globalout",{type:"globalout",event:e})},resize:function(e){this._hovered={}},dispatch:function(e,t){var i=this[e];i&&i.call(this,t)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},dispatchToElement:function(e,t,i){var n=(e=e||{}).target;if(!n||!n.silent){for(var r="on"+t,a=function(e,t,i){return{type:e,event:i,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:i.zrX,offsetY:i.zrY,gestureEvent:i.gestureEvent,pinchX:i.pinchX,pinchY:i.pinchY,pinchScale:i.pinchScale,wheelDelta:i.zrDelta,zrByTouch:i.zrByTouch,which:i.which,stop:ke}}(t,e,i);n&&(n[r]&&(a.cancelBubble=n[r].call(n,a)),n.trigger(t,a),n=n.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer((function(e){"function"==typeof e[r]&&e[r].call(e,a),e.trigger&&e.trigger(t,a)})))}},findHover:function(e,t,i){for(var n=this.storage.getDisplayList(),r={x:e,y:t},a=n.length-1;a>=0;a--){var o;if(n[a]!==i&&!n[a].ignore&&(o=Ve(n[a],e,t))&&(!r.topTarget&&(r.topTarget=n[a]),o!==Oe)){r.target=n[a];break}}return r},processGesture:function(e,t){this._gestureMgr||(this._gestureMgr=new Re);var i=this._gestureMgr;"start"===t&&i.clear();var n=i.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if("end"===t&&i.clear(),n){var r=n.type;e.gestureEvent=r,this.dispatchToElement({target:n.target},r,n.event)}}},De.each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(e){Fe.prototype[e]=function(t){var i,n,r=t.zrX,a=t.zrY,o=Ge(this,r,a);if("mouseup"===e&&o||(n=(i=this.findHover(r,a)).target),"mousedown"===e)this._downEl=n,this._downPoint=[t.zrX,t.zrY],this._upEl=n;else if("mouseup"===e)this._upEl=n;else if("click"===e){if(this._downEl!==this._upEl||!this._downPoint||Ee.dist(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,e,t)}})),De.mixin(Fe,Pe),De.mixin(Fe,Le);var He=Fe,Ue={},We="undefined"==typeof Float32Array?Array:Float32Array;function je(){var e=new We(6);return Xe(e),e}function Xe(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function Ze(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}Ue.create=je,Ue.identity=Xe,Ue.copy=Ze,Ue.mul=function(e,t,i){var n=t[0]*i[0]+t[2]*i[1],r=t[1]*i[0]+t[3]*i[1],a=t[0]*i[2]+t[2]*i[3],o=t[1]*i[2]+t[3]*i[3],s=t[0]*i[4]+t[2]*i[5]+t[4],l=t[1]*i[4]+t[3]*i[5]+t[5];return e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e},Ue.translate=function(e,t,i){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+i[0],e[5]=t[5]+i[1],e},Ue.rotate=function(e,t,i){var n=t[0],r=t[2],a=t[4],o=t[1],s=t[3],l=t[5],u=Math.sin(i),h=Math.cos(i);return e[0]=n*h+o*u,e[1]=-n*u+o*h,e[2]=r*h+s*u,e[3]=-r*u+h*s,e[4]=h*a+u*l,e[5]=h*l-u*a,e},Ue.scale=function(e,t,i){var n=i[0],r=i[1];return e[0]=t[0]*n,e[1]=t[1]*r,e[2]=t[2]*n,e[3]=t[3]*r,e[4]=t[4]*n,e[5]=t[5]*r,e},Ue.invert=function(e,t){var i=t[0],n=t[2],r=t[4],a=t[1],o=t[3],s=t[5],l=i*o-a*n;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-n*l,e[3]=i*l,e[4]=(n*s-o*r)*l,e[5]=(a*r-i*s)*l,e):null},Ue.clone=function(e){var t=je();return Ze(t,e),t};var qe=Ue,Ye=V,Ke=qe.identity,Qe=5e-5;function Je(e){return e>Qe||e<-5e-5}var $e=function(e){(e=e||{}).position||(this.position=[0,0]),null==e.rotation&&(this.rotation=0),e.scale||(this.scale=[1,1]),this.origin=this.origin||null},et=$e.prototype;et.transform=null,et.needLocalTransform=function(){return Je(this.rotation)||Je(this.position[0])||Je(this.position[1])||Je(this.scale[0]-1)||Je(this.scale[1]-1)};var tt=[];et.updateTransform=function(){var e=this.parent,t=e&&e.transform,i=this.needLocalTransform(),n=this.transform;if(i||t){n=n||qe.create(),i?this.getLocalTransform(n):Ke(n),t&&(i?qe.mul(n,e.transform,n):qe.copy(n,e.transform)),this.transform=n;var r=this.globalScaleRatio;if(null!=r&&1!==r){this.getGlobalScale(tt);var a=tt[0]<0?-1:1,o=tt[1]<0?-1:1,s=((tt[0]-a)*r+a)/tt[0]||0,l=((tt[1]-o)*r+o)/tt[1]||0;n[0]*=s,n[1]*=s,n[2]*=l,n[3]*=l}this.invTransform=this.invTransform||qe.create(),qe.invert(this.invTransform,n)}else n&&Ke(n)},et.getLocalTransform=function(e){return $e.getLocalTransform(this,e)},et.setTransform=function(e){var t=this.transform,i=e.dpr||1;t?e.setTransform(i*t[0],i*t[1],i*t[2],i*t[3],i*t[4],i*t[5]):e.setTransform(i,0,0,i,0,0)},et.restoreTransform=function(e){var t=e.dpr||1;e.setTransform(t,0,0,t,0,0)};var it=[],nt=qe.create();et.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],i=e[2]*e[2]+e[3]*e[3],n=this.position,r=this.scale;Je(t-1)&&(t=Math.sqrt(t)),Je(i-1)&&(i=Math.sqrt(i)),e[0]<0&&(t=-t),e[3]<0&&(i=-i),n[0]=e[4],n[1]=e[5],r[0]=t,r[1]=i,this.rotation=Math.atan2(-e[1]/i,e[0]/t)}},et.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(qe.mul(it,e.invTransform,t),t=it);var i=this.origin;i&&(i[0]||i[1])&&(nt[4]=i[0],nt[5]=i[1],qe.mul(it,t,nt),it[4]-=i[0],it[5]-=i[1],t=it),this.setLocalTransform(t)}},et.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)},et.transformCoordToLocal=function(e,t){var i=[e,t],n=this.invTransform;return n&&Ye.applyTransform(i,i,n),i},et.transformCoordToGlobal=function(e,t){var i=[e,t],n=this.transform;return n&&Ye.applyTransform(i,i,n),i},$e.getLocalTransform=function(e,t){Ke(t=t||[]);var i=e.origin,n=e.scale||[1,1],r=e.rotation||0,a=e.position||[0,0];return i&&(t[4]-=i[0],t[5]-=i[1]),qe.scale(t,t,n),r&&qe.rotate(t,t,r),i&&(t[4]+=i[0],t[5]+=i[1]),t[4]+=a[0],t[5]+=a[1],t};var rt=$e,at={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,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,i=.1,n=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=n*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.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-at.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*at.bounceIn(2*e):.5*at.bounceOut(2*e-1)+.5}},ot=at;function st(e){this._target=e.target,this._life=e.life||1e3,this._delay=e.delay||0,this._initialized=!1,this.loop=null!=e.loop&&e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart,this._pausedTime=0,this._paused=!1}st.prototype={constructor:st,step:function(e,t){if(this._initialized||(this._startTime=e+this._delay,this._initialized=!0),this._paused)this._pausedTime+=t;else{var i=(e-this._startTime-this._pausedTime)/this._life;if(!(i<0)){i=Math.min(i,1);var n=this.easing,r="string"==typeof n?ot[n]:n,a="function"==typeof r?r(i):i;return this.fire("frame",a),1===i?this.loop?(this.restart(e),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(e){var t=(e-this._startTime-this._pausedTime)%this._life;this._startTime=e-t+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(e,t){this[e="on"+e]&&this[e](this._target,t)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var lt=st,ut={},ht=function(){this.head=null,this.tail=null,this._len=0},ct=ht.prototype;ct.insert=function(e){var t=new dt(e);return this.insertEntry(t),t},ct.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++},ct.remove=function(e){var t=e.prev,i=e.next;t?t.next=i:this.head=i,i?i.prev=t:this.tail=t,e.next=e.prev=null,this._len--},ct.len=function(){return this._len},ct.clear=function(){this.head=this.tail=null,this._len=0};var dt=function(e){this.value=e,this.next,this.prev},ft=function(e){this._list=new ht,this._map={},this._maxSize=e||10,this._lastRemovedEntry=null},pt=ft.prototype;pt.put=function(e,t){var i=this._list,n=this._map,r=null;if(null==n[e]){var a=i.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=i.head;i.remove(s),delete n[s.key],r=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new dt(t),o.key=e,i.insertEntry(o),n[e]=o}return r},pt.get=function(e){var t=this._map[e],i=this._list;if(null!=t)return t!==i.tail&&(i.remove(t),i.insertEntry(t)),t.value},pt.clear=function(){this._list.clear(),this._map={}};var gt=ft,mt={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 vt(e){return(e=Math.round(e))<0?0:e>255?255:e}function yt(e){return e<0?0:e>1?1:e}function _t(e){return e.length&&"%"===e.charAt(e.length-1)?vt(parseFloat(e)/100*255):vt(parseInt(e,10))}function xt(e){return e.length&&"%"===e.charAt(e.length-1)?yt(parseFloat(e)/100):yt(parseFloat(e))}function bt(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function wt(e,t,i){return e+(t-e)*i}function Tt(e,t,i,n,r){return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e}function St(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var Mt=new gt(20),At=null;function It(e,t){At&&St(At,t),At=Mt.put(e,At||t.slice())}function Ct(e,t){if(e){t=t||[];var i=Mt.get(e);if(i)return St(t,i);var n,r=(e+="").replace(/ /g,"").toLowerCase();if(r in mt)return St(t,mt[r]),It(e,t),t;if("#"===r.charAt(0))return 4===r.length?(n=parseInt(r.substr(1),16))>=0&&n<=4095?(Tt(t,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),It(e,t),t):void Tt(t,0,0,0,1):7===r.length?(n=parseInt(r.substr(1),16))>=0&&n<=16777215?(Tt(t,(16711680&n)>>16,(65280&n)>>8,255&n,1),It(e,t),t):void Tt(t,0,0,0,1):void 0;var a=r.indexOf("("),o=r.indexOf(")");if(-1!==a&&o+1===r.length){var s=r.substr(0,a),l=r.substr(a+1,o-(a+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return void Tt(t,0,0,0,1);u=xt(l.pop());case"rgb":return 3!==l.length?void Tt(t,0,0,0,1):(Tt(t,_t(l[0]),_t(l[1]),_t(l[2]),u),It(e,t),t);case"hsla":return 4!==l.length?void Tt(t,0,0,0,1):(l[3]=xt(l[3]),Dt(l,t),It(e,t),t);case"hsl":return 3!==l.length?void Tt(t,0,0,0,1):(Dt(l,t),It(e,t),t);default:return}}Tt(t,0,0,0,1)}}function Dt(e,t){var i=(parseFloat(e[0])%360+360)%360/360,n=xt(e[1]),r=xt(e[2]),a=r<=.5?r*(n+1):r+n-r*n,o=2*r-a;return Tt(t=t||[],vt(255*bt(o,a,i+1/3)),vt(255*bt(o,a,i)),vt(255*bt(o,a,i-1/3)),1),4===e.length&&(t[3]=e[3]),t}function Et(e,t,i){if(t&&t.length&&e>=0&&e<=1){i=i||[];var n=e*(t.length-1),r=Math.floor(n),a=Math.ceil(n),o=t[r],s=t[a],l=n-r;return i[0]=vt(wt(o[0],s[0],l)),i[1]=vt(wt(o[1],s[1],l)),i[2]=vt(wt(o[2],s[2],l)),i[3]=yt(wt(o[3],s[3],l)),i}}var Lt=Et;function Pt(e,t,i){if(t&&t.length&&e>=0&&e<=1){var n=e*(t.length-1),r=Math.floor(n),a=Math.ceil(n),o=Ct(t[r]),s=Ct(t[a]),l=n-r,u=Rt([vt(wt(o[0],s[0],l)),vt(wt(o[1],s[1],l)),vt(wt(o[2],s[2],l)),yt(wt(o[3],s[3],l))],"rgba");return i?{color:u,leftIndex:r,rightIndex:a,value:n}:u}}var Nt=Pt;function Rt(e,t){if(e&&e.length){var i=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(i+=","+e[3]),t+"("+i+")"}}ut.parse=Ct,ut.lift=function(e,t){var i=Ct(e);if(i){for(var n=0;n<3;n++)i[n]=t<0?i[n]*(1-t)|0:(255-i[n])*t+i[n]|0,i[n]>255?i[n]=255:e[n]<0&&(i[n]=0);return Rt(i,4===i.length?"rgba":"rgb")}},ut.toHex=function(e){var t=Ct(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},ut.fastLerp=Et,ut.fastMapToColor=Lt,ut.lerp=Pt,ut.mapToColor=Nt,ut.modifyHSL=function(e,t,i,n){if(e=Ct(e))return e=function(e){if(e){var t,i,n=e[0]/255,r=e[1]/255,a=e[2]/255,o=Math.min(n,r,a),s=Math.max(n,r,a),l=s-o,u=(s+o)/2;if(0===l)t=0,i=0;else{i=u<.5?l/(s+o):l/(2-s-o);var h=((s-n)/6+l/2)/l,c=((s-r)/6+l/2)/l,d=((s-a)/6+l/2)/l;n===s?t=d-c:r===s?t=1/3+h-d:a===s&&(t=2/3+c-h),t<0&&(t+=1),t>1&&(t-=1)}var f=[360*t,i,u];return null!=e[3]&&f.push(e[3]),f}}(e),null!=t&&(e[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=i&&(e[1]=xt(i)),null!=n&&(e[2]=xt(n)),Rt(Dt(e),"rgba")},ut.modifyAlpha=function(e,t){if((e=Ct(e))&&null!=t)return e[3]=yt(t),Rt(e,"rgba")},ut.stringify=Rt;var Ot=lt,kt=ut,zt=g.isArrayLike,Bt=Array.prototype.slice;function Ft(e,t){return e[t]}function Vt(e,t,i){e[t]=i}function Gt(e,t,i){return(t-e)*i+e}function Ht(e,t,i){return i>.5?t:e}function Ut(e,t,i,n,r){var a=e.length;if(1===r)for(var o=0;o<a;o++)n[o]=Gt(e[o],t[o],i);else{var s=a&&e[0].length;for(o=0;o<a;o++)for(var l=0;l<s;l++)n[o][l]=Gt(e[o][l],t[o][l],i)}}function Wt(e,t,i){var n=e.length,r=t.length;if(n!==r)if(n>r)e.length=r;else for(var a=n;a<r;a++)e.push(1===i?t[a]:Bt.call(t[a]));var o=e[0]&&e[0].length;for(a=0;a<e.length;a++)if(1===i)isNaN(e[a])&&(e[a]=t[a]);else for(var s=0;s<o;s++)isNaN(e[a][s])&&(e[a][s]=t[a][s])}function jt(e,t,i){if(e===t)return!0;var n=e.length;if(n!==t.length)return!1;if(1===i){for(var r=0;r<n;r++)if(e[r]!==t[r])return!1}else{var a=e[0].length;for(r=0;r<n;r++)for(var o=0;o<a;o++)if(e[r][o]!==t[r][o])return!1}return!0}function Xt(e,t,i,n,r,a,o,s,l){var u=e.length;if(1===l)for(var h=0;h<u;h++)s[h]=Zt(e[h],t[h],i[h],n[h],r,a,o);else{var c=e[0].length;for(h=0;h<u;h++)for(var d=0;d<c;d++)s[h][d]=Zt(e[h][d],t[h][d],i[h][d],n[h][d],r,a,o)}}function Zt(e,t,i,n,r,a,o){var s=.5*(i-e),l=.5*(n-t);return(2*(t-i)+s+l)*o+(-3*(t-i)-2*s-l)*a+s*r+t}function qt(e){if(zt(e)){var t=e.length;if(zt(e[0])){for(var i=[],n=0;n<t;n++)i.push(Bt.call(e[n]));return i}return Bt.call(e)}return e}function Yt(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}function Kt(e,t,i,n,r,a){var o=e._getter,s=e._setter,l="spline"===t,u=n.length;if(u){var h,c=n[0].value,d=zt(c),f=!1,p=!1,g=d?function(e){var t=e[e.length-1].value;return zt(t&&t[0])?2:1}(n):0;n.sort((function(e,t){return e.time-t.time})),h=n[u-1].time;for(var m=[],v=[],y=n[0].value,_=!0,x=0;x<u;x++){m.push(n[x].time/h);var b=n[x].value;if(d&&jt(b,y,g)||!d&&b===y||(_=!1),y=b,"string"==typeof b){var w=kt.parse(b);w?(b=w,f=!0):p=!0}v.push(b)}if(a||!_){var T=v[u-1];for(x=0;x<u-1;x++)d?Wt(v[x],T,g):!isNaN(v[x])||isNaN(T)||p||f||(v[x]=T);d&&Wt(o(e._target,r),T,g);var S,M,A,I,C,D=0,E=0;if(f)var L=[0,0,0,0];var P=new Ot({target:e._target,life:h,loop:e._loop,delay:e._delay,onframe:function(e,t){var i;if(t<0)i=0;else if(t<E){for(i=Math.min(D+1,u-1);i>=0&&!(m[i]<=t);i--);i=Math.min(i,u-2)}else{for(i=D;i<u&&!(m[i]>t);i++);i=Math.min(i-1,u-2)}D=i,E=t;var n=m[i+1]-m[i];if(0!==n)if(S=(t-m[i])/n,l)if(A=v[i],M=v[0===i?i:i-1],I=v[i>u-2?u-1:i+1],C=v[i>u-3?u-1:i+2],d)Xt(M,A,I,C,S,S*S,S*S*S,o(e,r),g);else{if(f)a=Xt(M,A,I,C,S,S*S,S*S*S,L,1),a=Yt(L);else{if(p)return Ht(A,I,S);a=Zt(M,A,I,C,S,S*S,S*S*S)}s(e,r,a)}else if(d)Ut(v[i],v[i+1],S,o(e,r),g);else{var a;if(f)Ut(v[i],v[i+1],S,L,1),a=Yt(L);else{if(p)return Ht(v[i],v[i+1],S);a=Gt(v[i],v[i+1],S)}s(e,r,a)}},ondestroy:i});return t&&"spline"!==t&&(P.easing=t),P}}}var Qt=function(e,t,i,n){this._tracks={},this._target=e,this._loop=t||!1,this._getter=i||Ft,this._setter=n||Vt,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};Qt.prototype={when:function(e,t){var i=this._tracks;for(var n in t)if(t.hasOwnProperty(n)){if(!i[n]){i[n]=[];var r=this._getter(this._target,n);if(null==r)continue;0!==e&&i[n].push({time:0,value:qt(r)})}i[n].push({time:e,value:t[n]})}return this},during:function(e){return this._onframeList.push(e),this},pause:function(){for(var e=0;e<this._clipList.length;e++)this._clipList[e].pause();this._paused=!0},resume:function(){for(var e=0;e<this._clipList.length;e++)this._clipList[e].resume();this._paused=!1},isPaused:function(){return!!this._paused},_doneCallback:function(){this._tracks={},this._clipList.length=0;for(var e=this._doneList,t=e.length,i=0;i<t;i++)e[i].call(this)},start:function(e,t){var i,n=this,r=0,a=function(){--r||n._doneCallback()};for(var o in this._tracks)if(this._tracks.hasOwnProperty(o)){var s=Kt(this,e,a,this._tracks[o],o,t);s&&(this._clipList.push(s),r++,this.animation&&this.animation.addClip(s),i=s)}if(i){var l=i.onframe;i.onframe=function(e,t){l(e,t);for(var i=0;i<n._onframeList.length;i++)n._onframeList[i](e,t)}}return r||this._doneCallback(),this},stop:function(e){for(var t=this._clipList,i=this.animation,n=0;n<t.length;n++){var r=t[n];e&&r.onframe(this._target,1),i&&i.removeClip(r)}t.length=0},delay:function(e){return this._delay=e,this},done:function(e){return e&&this._doneList.push(e),this},getClips:function(){return this._clipList}};var Jt=Qt,$t={},ei=1;"undefined"!=typeof window&&(ei=Math.max(window.devicePixelRatio||1,1));var ti=ei;$t.debugMode=0,$t.devicePixelRatio=ti;var ii=function(){};1===$t.debugMode&&(ii=console.error);var ni=ii,ri=Jt,ai=ni,oi=g,si=oi.isString,li=oi.isFunction,ui=oi.isObject,hi=oi.isArrayLike,ci=oi.indexOf,di=function(){this.animators=[]};function fi(e,t,i,n,r,a,o,s){si(n)?(a=r,r=n,n=0):li(r)?(a=r,r="linear",n=0):li(n)?(a=n,n=0):li(i)?(a=i,i=500):i||(i=500),e.stopAnimation(),pi(e,"",e,t,i,n,s);var l=e.animators.slice(),u=l.length;function h(){--u||a&&a()}u||a&&a();for(var c=0;c<l.length;c++)l[c].done(h).start(r,o)}function pi(e,t,i,n,r,a,o){var s={},l=0;for(var u in n)n.hasOwnProperty(u)&&(null!=i[u]?ui(n[u])&&!hi(n[u])?pi(e,t?t+"."+u:u,i[u],n[u],r,a,o):(o?(s[u]=i[u],gi(e,t,u,n[u])):s[u]=n[u],l++):null==n[u]||o||gi(e,t,u,n[u]));l>0&&e.animate(t,!1).when(null==r?500:r,s).delay(a||0)}function gi(e,t,i,n){if(t){var r={};r[t]={},r[t][i]=n,e.attr(r)}else e.attr(i,n)}di.prototype={constructor:di,animate:function(e,t){var i,n=!1,r=this,a=this.__zr;if(e){var o=e.split("."),s=r;n="shape"===o[0];for(var l=0,u=o.length;l<u;l++)s&&(s=s[o[l]]);s&&(i=s)}else i=r;if(i){var h=r.animators,c=new ri(i,t);return c.during((function(e){r.dirty(n)})).done((function(){h.splice(ci(h,c),1)})),h.push(c),a&&a.animation.addAnimator(c),c}ai('Property "'+e+'" is not existed in element '+r.id)},stopAnimation:function(e){for(var t=this.animators,i=t.length,n=0;n<i;n++)t[n].stop(e);return t.length=0,this},animateTo:function(e,t,i,n,r,a){fi(this,e,t,i,n,r,a)},animateFrom:function(e,t,i,n,r,a){fi(this,e,t,i,n,r,a,!0)}};var mi=f,vi=ie,yi=rt,_i=di,xi=g,bi=function(e){yi.call(this,e),vi.call(this,e),_i.call(this,e),this.id=e.id||mi()};bi.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(e,t){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=t,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(e,t){},attrKV:function(e,t){if("position"===e||"scale"===e||"origin"===e){if(t){var i=this[e];i||(i=this[e]=[]),i[0]=t[0],i[1]=t[1]}}else this[e]=t},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(e,t){if("string"==typeof e)this.attrKV(e,t);else if(xi.isObject(e))for(var i in e)e.hasOwnProperty(i)&&this.attrKV(i,e[i]);return this.dirty(!1),this},setClipPath:function(e){var t=this.__zr;t&&e.addSelfToZr(t),this.clipPath&&this.clipPath!==e&&this.removeClipPath(),this.clipPath=e,e.__zr=t,e.__clipTarget=this,this.dirty(!1)},removeClipPath:function(){var e=this.clipPath;e&&(e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(e){this.__zr=e;var t=this.animators;if(t)for(var i=0;i<t.length;i++)e.animation.addAnimator(t[i]);this.clipPath&&this.clipPath.addSelfToZr(e)},removeSelfFromZr:function(e){this.__zr=null;var t=this.animators;if(t)for(var i=0;i<t.length;i++)e.animation.removeAnimator(t[i]);this.clipPath&&this.clipPath.removeSelfFromZr(e)}},xi.mixin(bi,_i),xi.mixin(bi,yi),xi.mixin(bi,vi);var wi,Ti,Si,Mi,Ai=bi,Ii=Ue,Ci=V.applyTransform,Di=Math.min,Ei=Math.max;function Li(e,t,i,n){i<0&&(e+=i,i=-i),n<0&&(t+=n,n=-n),this.x=e,this.y=t,this.width=i,this.height=n}Li.prototype={constructor:Li,union:function(e){var t=Di(e.x,this.x),i=Di(e.y,this.y);this.width=Ei(e.x+e.width,this.x+this.width)-t,this.height=Ei(e.y+e.height,this.y+this.height)-i,this.x=t,this.y=i},applyTransform:(wi=[],Ti=[],Si=[],Mi=[],function(e){if(e){wi[0]=Si[0]=this.x,wi[1]=Mi[1]=this.y,Ti[0]=Mi[0]=this.x+this.width,Ti[1]=Si[1]=this.y+this.height,Ci(wi,wi,e),Ci(Ti,Ti,e),Ci(Si,Si,e),Ci(Mi,Mi,e),this.x=Di(wi[0],Ti[0],Si[0],Mi[0]),this.y=Di(wi[1],Ti[1],Si[1],Mi[1]);var t=Ei(wi[0],Ti[0],Si[0],Mi[0]),i=Ei(wi[1],Ti[1],Si[1],Mi[1]);this.width=t-this.x,this.height=i-this.y}}),calculateTransform:function(e){var t=this,i=e.width/t.width,n=e.height/t.height,r=Ii.create();return Ii.translate(r,r,[-t.x,-t.y]),Ii.scale(r,r,[i,n]),Ii.translate(r,r,[e.x,e.y]),r},intersect:function(e){if(!e)return!1;e instanceof Li||(e=Li.create(e));var t=this,i=t.x,n=t.x+t.width,r=t.y,a=t.y+t.height,o=e.x,s=e.x+e.width,l=e.y,u=e.y+e.height;return!(n<o||s<i||a<l||u<r)},contain:function(e,t){var i=this;return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height},clone:function(){return new Li(this.x,this.y,this.width,this.height)},copy:function(e){this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},Li.create=function(e){return new Li(e.x,e.y,e.width,e.height)};var Pi=Li,Ni=g,Ri=Ai,Oi=Pi,ki=function(e){for(var t in e=e||{},Ri.call(this,e),e)e.hasOwnProperty(t)&&(this[t]=e[t]);this._children=[],this.__storage=null,this.__dirty=!0};ki.prototype={constructor:ki,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(e){return this._children[e]},childOfName:function(e){for(var t=this._children,i=0;i<t.length;i++)if(t[i].name===e)return t[i]},childCount:function(){return this._children.length},add:function(e){return e&&e!==this&&e.parent!==this&&(this._children.push(e),this._doAdd(e)),this},addBefore:function(e,t){if(e&&e!==this&&e.parent!==this&&t&&t.parent===this){var i=this._children,n=i.indexOf(t);n>=0&&(i.splice(n,0,e),this._doAdd(e))}return this},_doAdd:function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__storage,i=this.__zr;t&&t!==e.__storage&&(t.addToStorage(e),e instanceof ki&&e.addChildrenToStorage(t)),i&&i.refresh()},remove:function(e){var t=this.__zr,i=this.__storage,n=this._children,r=Ni.indexOf(n,e);return r<0||(n.splice(r,1),e.parent=null,i&&(i.delFromStorage(e),e instanceof ki&&e.delChildrenFromStorage(i)),t&&t.refresh()),this},removeAll:function(){var e,t,i=this._children,n=this.__storage;for(t=0;t<i.length;t++)e=i[t],n&&(n.delFromStorage(e),e instanceof ki&&e.delChildrenFromStorage(n)),e.parent=null;return i.length=0,this},eachChild:function(e,t){for(var i=this._children,n=0;n<i.length;n++){var r=i[n];e.call(t,r,n)}return this},traverse:function(e,t){for(var i=0;i<this._children.length;i++){var n=this._children[i];e.call(t,n),"group"===n.type&&n.traverse(e,t)}return this},addChildrenToStorage:function(e){for(var t=0;t<this._children.length;t++){var i=this._children[t];e.addToStorage(i),i instanceof ki&&i.addChildrenToStorage(e)}},delChildrenFromStorage:function(e){for(var t=0;t<this._children.length;t++){var i=this._children[t];e.delFromStorage(i),i instanceof ki&&i.delChildrenFromStorage(e)}},dirty:function(){return this.__dirty=!0,this.__zr&&this.__zr.refresh(),this},getBoundingRect:function(e){for(var t=null,i=new Oi(0,0,0,0),n=e||this._children,r=[],a=0;a<n.length;a++){var o=n[a];if(!o.ignore&&!o.invisible){var s=o.getBoundingRect(),l=o.getLocalTransform(r);l?(i.copy(s),i.applyTransform(l),(t=t||i.clone()).union(i)):(t=t||s.clone()).union(s)}}return t||i}},Ni.inherits(ki,Ri);var zi=ki;function Bi(e,t,i,n){var r=t+1;if(r===i)return 1;if(n(e[r++],e[t])<0){for(;r<i&&n(e[r],e[r-1])<0;)r++;!function(e,t,i){for(i--;t<i;){var n=e[t];e[t++]=e[i],e[i--]=n}}(e,t,r)}else for(;r<i&&n(e[r],e[r-1])>=0;)r++;return r-t}function Fi(e,t,i,n,r){for(n===t&&n++;n<i;n++){for(var a,o=e[n],s=t,l=n;s<l;)r(o,e[a=s+l>>>1])<0?l=a:s=a+1;var u=n-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]=o}}function Vi(e,t,i,n,r,a){var o=0,s=0,l=1;if(a(e,t[i+r])>0){for(s=n-r;l<s&&a(e,t[i+r+l])>0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}else{for(s=r+1;l<s&&a(e,t[i+r-l])<=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=o;o=r-l,l=r-u}for(o++;o<l;){var h=o+(l-o>>>1);a(e,t[i+h])>0?o=h+1:l=h}return l}function Gi(e,t,i,n,r,a){var o=0,s=0,l=1;if(a(e,t[i+r])<0){for(s=r+1;l<s&&a(e,t[i+r-l])<0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=o;o=r-l,l=r-u}else{for(s=n-r;l<s&&a(e,t[i+r+l])>=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}for(o++;o<l;){var h=o+(l-o>>>1);a(e,t[i+h])<0?l=h:o=h+1}return l}function Hi(e,t){var i,n,r=7,a=0,o=[];function s(s){var l=i[s],u=n[s],h=i[s+1],c=n[s+1];n[s]=u+c,s===a-3&&(i[s+1]=i[s+2],n[s+1]=n[s+2]),a--;var d=Gi(e[h],e,l,u,0,t);l+=d,0!=(u-=d)&&0!==(c=Vi(e[l+u-1],e,h,c,c-1,t))&&(u<=c?function(i,n,a,s){var l=0;for(l=0;l<n;l++)o[l]=e[i+l];var u=0,h=a,c=i;if(e[c++]=e[h++],0!=--s)if(1!==n){for(var d,f,p,g=r;;){d=0,f=0,p=!1;do{if(t(e[h],o[u])<0){if(e[c++]=e[h++],f++,d=0,0==--s){p=!0;break}}else if(e[c++]=o[u++],d++,f=0,1==--n){p=!0;break}}while((d|f)<g);if(p)break;do{if(0!==(d=Gi(e[h],o,u,n,0,t))){for(l=0;l<d;l++)e[c+l]=o[u+l];if(c+=d,u+=d,(n-=d)<=1){p=!0;break}}if(e[c++]=e[h++],0==--s){p=!0;break}if(0!==(f=Vi(o[u],e,h,s,0,t))){for(l=0;l<f;l++)e[c+l]=e[h+l];if(c+=f,h+=f,0==(s-=f)){p=!0;break}}if(e[c++]=o[u++],1==--n){p=!0;break}g--}while(d>=7||f>=7);if(p)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===n){for(l=0;l<s;l++)e[c+l]=e[h+l];e[c+s]=o[u]}else{if(0===n)throw new Error;for(l=0;l<n;l++)e[c+l]=o[u+l]}}else{for(l=0;l<s;l++)e[c+l]=e[h+l];e[c+s]=o[u]}else for(l=0;l<n;l++)e[c+l]=o[u+l]}(l,u,h,c):function(i,n,a,s){var l=0;for(l=0;l<s;l++)o[l]=e[a+l];var u=i+n-1,h=s-1,c=a+s-1,d=0,f=0;if(e[c--]=e[u--],0!=--n)if(1!==s){for(var p=r;;){var g=0,m=0,v=!1;do{if(t(o[h],e[u])<0){if(e[c--]=e[u--],g++,m=0,0==--n){v=!0;break}}else if(e[c--]=o[h--],m++,g=0,1==--s){v=!0;break}}while((g|m)<p);if(v)break;do{if(0!=(g=n-Gi(o[h],e,i,n,n-1,t))){for(n-=g,f=1+(c-=g),d=1+(u-=g),l=g-1;l>=0;l--)e[f+l]=e[d+l];if(0===n){v=!0;break}}if(e[c--]=o[h--],1==--s){v=!0;break}if(0!=(m=s-Vi(e[u],o,0,s,s-1,t))){for(s-=m,f=1+(c-=m),d=1+(h-=m),l=0;l<m;l++)e[f+l]=o[d+l];if(s<=1){v=!0;break}}if(e[c--]=e[u--],0==--n){v=!0;break}p--}while(g>=7||m>=7);if(v)break;p<0&&(p=0),p+=2}if((r=p)<1&&(r=1),1===s){for(f=1+(c-=n),d=1+(u-=n),l=n-1;l>=0;l--)e[f+l]=e[d+l];e[c]=o[h]}else{if(0===s)throw new Error;for(d=c-(s-1),l=0;l<s;l++)e[d+l]=o[l]}}else{for(f=1+(c-=n),d=1+(u-=n),l=n-1;l>=0;l--)e[f+l]=e[d+l];e[c]=o[h]}else for(d=c-(s-1),l=0;l<s;l++)e[d+l]=o[l]}(l,u,h,c))}i=[],n=[],this.mergeRuns=function(){for(;a>1;){var e=a-2;if(e>=1&&n[e-1]<=n[e]+n[e+1]||e>=2&&n[e-2]<=n[e]+n[e-1])n[e-1]<n[e+1]&&e--;else if(n[e]>n[e+1])break;s(e)}},this.forceMergeRuns=function(){for(;a>1;){var e=a-2;e>0&&n[e-1]<n[e+1]&&e--,s(e)}},this.pushRun=function(e,t){i[a]=e,n[a]=t,a+=1}}var Ui=function(e,t,i,n){i||(i=0),n||(n=e.length);var r=n-i;if(!(r<2)){var a=0;if(r<32)Fi(e,i,n,i+(a=Bi(e,i,n,t)),t);else{var o=new Hi(e,t),s=function(e){for(var t=0;e>=32;)t|=1&e,e>>=1;return e+t}(r);do{if((a=Bi(e,i,n,t))<s){var l=r;l>s&&(l=s),Fi(e,i,i+l,i+a,t),a=l}o.pushRun(i,a),o.mergeRuns(),r-=a,i+=a}while(0!==r);o.forceMergeRuns()}}},Wi=g,ji=p,Xi=zi,Zi=Ui;function qi(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var Yi=function(){this._roots=[],this._displayList=[],this._displayListLen=0};Yi.prototype={constructor:Yi,traverse:function(e,t){for(var i=0;i<this._roots.length;i++)this._roots[i].traverse(e,t)},getDisplayList:function(e,t){return t=t||!1,e&&this.updateDisplayList(t),this._displayList},updateDisplayList:function(e){this._displayListLen=0;for(var t=this._roots,i=this._displayList,n=0,r=t.length;n<r;n++)this._updateAndAddDisplayable(t[n],null,e);i.length=this._displayListLen,ji.canvasSupported&&Zi(i,qi)},_updateAndAddDisplayable:function(e,t,i){if(!e.ignore||i){e.beforeUpdate(),e.__dirty&&e.update(),e.afterUpdate();var n=e.clipPath;if(n){t=t?t.slice():[];for(var r=n,a=e;r;)r.parent=a,r.updateTransform(),t.push(r),a=r,r=r.clipPath}if(e.isGroup){for(var o=e._children,s=0;s<o.length;s++){var l=o[s];e.__dirty&&(l.__dirty=!0),this._updateAndAddDisplayable(l,t,i)}e.__dirty=!1}else e.__clipPaths=t,this._displayList[this._displayListLen++]=e}},addRoot:function(e){e.__storage!==this&&(e instanceof Xi&&e.addChildrenToStorage(this),this.addToStorage(e),this._roots.push(e))},delRoot:function(e){if(null==e){for(var t=0;t<this._roots.length;t++){var i=this._roots[t];i instanceof Xi&&i.delChildrenFromStorage(this)}return this._roots=[],this._displayList=[],void(this._displayListLen=0)}if(e instanceof Array){t=0;for(var n=e.length;t<n;t++)this.delRoot(e[t])}else{var r=Wi.indexOf(this._roots,e);r>=0&&(this.delFromStorage(e),this._roots.splice(r,1),e instanceof Xi&&e.delChildrenFromStorage(this))}},addToStorage:function(e){return e&&(e.__storage=this,e.dirty(!1)),this},delFromStorage:function(e){return e&&(e.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:qi};var Ki=Yi,Qi={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1},Ji=function(e,t,i){return Qi.hasOwnProperty(t)?i*e.dpr:i},$i={ContextCachedBy:{NONE:0,STYLE_BIND:1,PLAIN_TEXT:2},WILL_BE_RESTORED:9},en=Ji,tn=$i.ContextCachedBy,nn=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],rn=function(e){this.extendFrom(e,!1)};function an(e,t,i){var n=null==t.x?0:t.x,r=null==t.x2?1:t.x2,a=null==t.y?0:t.y,o=null==t.y2?0:t.y2;return t.global||(n=n*i.width+i.x,r=r*i.width+i.x,a=a*i.height+i.y,o=o*i.height+i.y),n=isNaN(n)?0:n,r=isNaN(r)?1:r,a=isNaN(a)?0:a,o=isNaN(o)?0:o,e.createLinearGradient(n,a,r,o)}function on(e,t,i){var n=i.width,r=i.height,a=Math.min(n,r),o=null==t.x?.5:t.x,s=null==t.y?.5:t.y,l=null==t.r?.5:t.r;return t.global||(o=o*n+i.x,s=s*r+i.y,l*=a),e.createRadialGradient(o,s,0,o,s,l)}for(var sn=rn.prototype={constructor:rn,fill:"#000",stroke:null,opacity:1,fillOpacity:null,strokeOpacity:null,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(e,t,i){var n=this,r=i&&i.style,a=!r||e.__attrCachedBy!==tn.STYLE_BIND;e.__attrCachedBy=tn.STYLE_BIND;for(var o=0;o<nn.length;o++){var s=nn[o],l=s[0];(a||n[l]!==r[l])&&(e[l]=en(e,l,n[l]||s[1]))}if((a||n.fill!==r.fill)&&(e.fillStyle=n.fill),(a||n.stroke!==r.stroke)&&(e.strokeStyle=n.stroke),(a||n.opacity!==r.opacity)&&(e.globalAlpha=null==n.opacity?1:n.opacity),(a||n.blend!==r.blend)&&(e.globalCompositeOperation=n.blend||"source-over"),this.hasStroke()){var u=n.lineWidth;e.lineWidth=u/(this.strokeNoScale&&t&&t.getLineScale?t.getLineScale():1)}},hasFill:function(){var e=this.fill;return null!=e&&"none"!==e},hasStroke:function(){var e=this.stroke;return null!=e&&"none"!==e&&this.lineWidth>0},extendFrom:function(e,t){if(e)for(var i in e)!e.hasOwnProperty(i)||!0!==t&&(!1===t?this.hasOwnProperty(i):null==e[i])||(this[i]=e[i])},set:function(e,t){"string"==typeof e?this[e]=t:this.extendFrom(e,!0)},clone:function(){var e=new this.constructor;return e.extendFrom(this,!0),e},getGradient:function(e,t,i){for(var n=("radial"===t.type?on:an)(e,t,i),r=t.colorStops,a=0;a<r.length;a++)n.addColorStop(r[a].offset,r[a].color);return n}},ln=0;ln<nn.length;ln++){var un=nn[ln];un[0]in sn||(sn[un[0]]=un[1])}rn.getGradient=sn.getGradient;var hn=rn,cn=function(e,t){this.image=e,this.repeat=t,this.type="pattern"};cn.prototype.getCanvasPattern=function(e){return e.createPattern(this.image,this.repeat||"repeat")};var dn=cn,fn=g,pn=$t.devicePixelRatio,gn=hn,mn=dn;function vn(){return!1}function yn(e,t,i){var n=fn.createCanvas(),r=t.getWidth(),a=t.getHeight(),o=n.style;return o&&(o.position="absolute",o.left=0,o.top=0,o.width=r+"px",o.height=a+"px",n.setAttribute("data-zr-dom-id",e)),n.width=r*i,n.height=a*i,n}var _n=function(e,t,i){var n;i=i||pn,"string"==typeof e?n=yn(e,t,i):fn.isObject(e)&&(e=(n=e).id),this.id=e,this.dom=n;var r=n.style;r&&(n.onselectstart=vn,r["-webkit-user-select"]="none",r["user-select"]="none",r["-webkit-touch-callout"]="none",r["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",r.padding=0,r.margin=0,r["border-width"]=0),this.domBack=null,this.ctxBack=null,this.painter=t,this.config=null,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.dpr=i};_n.prototype={constructor:_n,__dirty:!0,__used:!1,__drawIndex:0,__startIndex:0,__endIndex:0,incremental:!1,getElementCount:function(){return this.__endIndex-this.__startIndex},initContext:function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},createBackBuffer:function(){var e=this.dpr;this.domBack=yn("back-"+this.id,this.painter,e),this.ctxBack=this.domBack.getContext("2d"),1!==e&&this.ctxBack.scale(e,e)},resize:function(e,t){var i=this.dpr,n=this.dom,r=n.style,a=this.domBack;r&&(r.width=e+"px",r.height=t+"px"),n.width=e*i,n.height=t*i,a&&(a.width=e*i,a.height=t*i,1!==i&&this.ctxBack.scale(i,i))},clear:function(e,t){var i,n=this.dom,r=this.ctx,a=n.width,o=n.height,s=(t=t||this.clearColor,this.motionBlur&&!e),l=this.lastFrameAlpha,u=this.dpr;if(s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(n,0,0,a/u,o/u)),r.clearRect(0,0,a,o),t&&"transparent"!==t&&(t.colorStops?(i=t.__canvasGradient||gn.getGradient(r,t,{x:0,y:0,width:a,height:o}),t.__canvasGradient=i):t.image&&(i=mn.prototype.getCanvasPattern.call(t,r)),r.save(),r.fillStyle=i||t,r.fillRect(0,0,a,o),r.restore()),s){var h=this.domBack;r.save(),r.globalAlpha=l,r.drawImage(h,0,0,a,o),r.restore()}}};var xn=_n,bn="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){setTimeout(e,16)},wn={},Tn={},Sn={},Mn=new gt(50);function An(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var i=e.pending[t],n=i.cb;n&&n(this,i.cbPayload),i.hostEl.dirty()}e.pending.length=0}function In(e){return e&&e.width&&e.height}Sn.findExistImage=function(e){if("string"==typeof e){var t=Mn.get(e);return t&&t.image}return e},Sn.createOrUpdateImage=function(e,t,i,n,r){if(e){if("string"==typeof e){if(t&&t.__zrImageSrc===e||!i)return t;var a=Mn.get(e),o={hostEl:i,cb:n,cbPayload:r};return a?!In(t=a.image)&&a.pending.push(o):((t=new Image).onload=t.onerror=An,Mn.put(e,t.__cachedImgObj={image:t,pending:[o]}),t.src=t.__zrImageSrc=e),t}return e}return t},Sn.isImageReady=In;var Cn=Pi,Dn=Sn,En=g,Ln=En.getContext,Pn=En.extend,Nn=En.retrieve2,Rn=En.retrieve3,On=En.trim,kn={},zn=0,Bn=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,Fn="12px sans-serif",Vn={};function Gn(e,t){var i=e+":"+(t=t||Fn);if(kn[i])return kn[i];for(var n=(e+"").split("\n"),r=0,a=0,o=n.length;a<o;a++)r=Math.max(Kn(n[a],t).width,r);return zn>5e3&&(zn=0,kn={}),zn++,kn[i]=r,r}function Hn(e,t,i){return"right"===i?e-=t:"center"===i&&(e-=t/2),e}function Un(e,t,i){return"middle"===i?e-=t/2:"bottom"===i&&(e-=t),e}function Wn(e,t,i){var n=t.textPosition,r=t.textDistance,a=i.x,o=i.y;r=r||0;var s=i.height,l=i.width,u=s/2,h="left",c="top";switch(n){case"left":a-=r,o+=u,h="right",c="middle";break;case"right":a+=r+l,o+=u,c="middle";break;case"top":a+=l/2,o-=r,h="center",c="bottom";break;case"bottom":a+=l/2,o+=s+r,h="center";break;case"inside":a+=l/2,o+=u,h="center",c="middle";break;case"insideLeft":a+=r,o+=u,c="middle";break;case"insideRight":a+=l-r,o+=u,h="right",c="middle";break;case"insideTop":a+=l/2,o+=r,h="center";break;case"insideBottom":a+=l/2,o+=s-r,h="center",c="bottom";break;case"insideTopLeft":a+=r,o+=r;break;case"insideTopRight":a+=l-r,o+=r,h="right";break;case"insideBottomLeft":a+=r,o+=s-r,c="bottom";break;case"insideBottomRight":a+=l-r,o+=s-r,h="right",c="bottom"}return(e=e||{}).x=a,e.y=o,e.textAlign=h,e.textVerticalAlign=c,e}function jn(e,t,i,n,r){if(!t)return"";var a=(e+"").split("\n");r=Xn(t,i,n,r);for(var o=0,s=a.length;o<s;o++)a[o]=Zn(a[o],r);return a.join("\n")}function Xn(e,t,i,n){(n=Pn({},n)).font=t,i=Nn(i,"..."),n.maxIterations=Nn(n.maxIterations,2);var r=n.minChar=Nn(n.minChar,0);n.cnCharWidth=Gn("国",t);var a=n.ascCharWidth=Gn("a",t);n.placeholder=Nn(n.placeholder,"");for(var o=e=Math.max(0,e-1),s=0;s<r&&o>=a;s++)o-=a;var l=Gn(i,t);return l>o&&(i="",l=0),o=e-l,n.ellipsis=i,n.ellipsisWidth=l,n.contentWidth=o,n.containerWidth=e,n}function Zn(e,t){var i=t.containerWidth,n=t.font,r=t.contentWidth;if(!i)return"";var a=Gn(e,n);if(a<=i)return e;for(var o=0;;o++){if(a<=r||o>=t.maxIterations){e+=t.ellipsis;break}var s=0===o?qn(e,r,t.ascCharWidth,t.cnCharWidth):a>0?Math.floor(e.length*r/a):0;a=Gn(e=e.substr(0,s),n)}return""===e&&(e=t.placeholder),e}function qn(e,t,i,n){for(var r=0,a=0,o=e.length;a<o&&r<t;a++){var s=e.charCodeAt(a);r+=0<=s&&s<=127?i:n}return a}function Yn(e){return Gn("国",e)}function Kn(e,t){return Vn.measureText(e,t)}function Qn(e,t,i,n,r){null!=e&&(e+="");var a=Nn(n,Yn(t)),o=e?e.split("\n"):[],s=o.length*a,l=s,u=!0;if(i&&(l+=i[0]+i[2]),e&&r){u=!1;var h=r.outerHeight,c=r.outerWidth;if(null!=h&&l>h)e="",o=[];else if(null!=c)for(var d=Xn(c-(i?i[1]+i[3]:0),t,r.ellipsis,{minChar:r.minChar,placeholder:r.placeholder}),f=0,p=o.length;f<p;f++)o[f]=Zn(o[f],d)}return{lines:o,height:s,outerHeight:l,lineHeight:a,canCacheByTextString:u}}function Jn(e,t){var i={lines:[],width:0,height:0};if(null!=e&&(e+=""),!e)return i;for(var n,r=Bn.lastIndex=0;null!=(n=Bn.exec(e));){var a=n.index;a>r&&$n(i,e.substring(r,a)),$n(i,n[2],n[1]),r=Bn.lastIndex}r<e.length&&$n(i,e.substring(r,e.length));var o=i.lines,s=0,l=0,u=[],h=t.textPadding,c=t.truncate,d=c&&c.outerWidth,f=c&&c.outerHeight;h&&(null!=d&&(d-=h[1]+h[3]),null!=f&&(f-=h[0]+h[2]));for(var p=0;p<o.length;p++){for(var g=o[p],m=0,v=0,y=0;y<g.tokens.length;y++){var _=(D=g.tokens[y]).styleName&&t.rich[D.styleName]||{},x=D.textPadding=_.textPadding,b=D.font=_.font||t.font,w=D.textHeight=Nn(_.textHeight,Yn(b));if(x&&(w+=x[0]+x[2]),D.height=w,D.lineHeight=Rn(_.textLineHeight,t.textLineHeight,w),D.textAlign=_&&_.textAlign||t.textAlign,D.textVerticalAlign=_&&_.textVerticalAlign||"middle",null!=f&&s+D.lineHeight>f)return{lines:[],width:0,height:0};D.textWidth=Gn(D.text,b);var T=_.textWidth,S=null==T||"auto"===T;if("string"==typeof T&&"%"===T.charAt(T.length-1))D.percentWidth=T,u.push(D),T=0;else{if(S){T=D.textWidth;var M=_.textBackgroundColor,A=M&&M.image;A&&(A=Dn.findExistImage(A),Dn.isImageReady(A)&&(T=Math.max(T,A.width*w/A.height)))}var I=x?x[1]+x[3]:0;T+=I;var C=null!=d?d-v:null;null!=C&&C<T&&(!S||C<I?(D.text="",D.textWidth=T=0):(D.text=jn(D.text,C-I,b,c.ellipsis,{minChar:c.minChar}),D.textWidth=Gn(D.text,b),T=D.textWidth+I))}v+=D.width=T,_&&(m=Math.max(m,D.lineHeight))}g.width=v,g.lineHeight=m,s+=m,l=Math.max(l,v)}for(i.outerWidth=i.width=Nn(t.textWidth,l),i.outerHeight=i.height=Nn(t.textHeight,s),h&&(i.outerWidth+=h[1]+h[3],i.outerHeight+=h[0]+h[2]),p=0;p<u.length;p++){var D,E=(D=u[p]).percentWidth;D.width=parseInt(E,10)/100*l}return i}function $n(e,t,i){for(var n=""===t,r=t.split("\n"),a=e.lines,o=0;o<r.length;o++){var s=r[o],l={styleName:i,text:s,isLineHolder:!s&&!n};if(o)a.push({tokens:[l]});else{var u=(a[a.length-1]||(a[0]={tokens:[]})).tokens,h=u.length;1===h&&u[0].isLineHolder?u[0]=l:(s||!h||n)&&u.push(l)}}}Vn.measureText=function(e,t){var i=Ln();return i.font=t||Fn,i.measureText(e)},Tn.DEFAULT_FONT=Fn,Tn.$override=function(e,t){Vn[e]=t},Tn.getWidth=Gn,Tn.getBoundingRect=function(e,t,i,n,r,a,o,s){return o?function(e,t,i,n,r,a,o,s){var l=Jn(e,{rich:o,truncate:s,font:t,textAlign:i,textPadding:r,textLineHeight:a}),u=l.outerWidth,h=l.outerHeight,c=Hn(0,u,i),d=Un(0,h,n);return new Cn(c,d,u,h)}(e,t,i,n,r,a,o,s):function(e,t,i,n,r,a,o){var s=Qn(e,t,r,a,o),l=Gn(e,t);r&&(l+=r[1]+r[3]);var u=s.outerHeight,h=Hn(0,l,i),c=Un(0,u,n),d=new Cn(h,c,l,u);return d.lineHeight=s.lineHeight,d}(e,t,i,n,r,a,s)},Tn.adjustTextX=Hn,Tn.adjustTextY=Un,Tn.calculateTextPosition=Wn,Tn.adjustTextPositionOnRect=function(e,t,i){return Wn({},{textPosition:e,textDistance:i},t)},Tn.truncateText=jn,Tn.getLineHeight=Yn,Tn.measureText=Kn,Tn.parsePlainText=Qn,Tn.parseRichText=Jn,Tn.makeFont=function(e){var t=(e.fontSize||e.fontFamily)&&[e.fontStyle,e.fontWeight,(e.fontSize||12)+"px",e.fontFamily||"sans-serif"].join(" ");return t&&On(t)||e.textFont||e.font};var er={buildPath:function(e,t){var i,n,r,a,o,s=t.x,l=t.y,u=t.width,h=t.height,c=t.r;u<0&&(s+=u,u=-u),h<0&&(l+=h,h=-h),"number"==typeof c?i=n=r=a=c:c instanceof Array?1===c.length?i=n=r=a=c[0]:2===c.length?(i=r=c[0],n=a=c[1]):3===c.length?(i=c[0],n=a=c[1],r=c[2]):(i=c[0],n=c[1],r=c[2],a=c[3]):i=n=r=a=0,i+n>u&&(i*=u/(o=i+n),n*=u/o),r+a>u&&(r*=u/(o=r+a),a*=u/o),n+r>h&&(n*=h/(o=n+r),r*=h/o),i+a>h&&(i*=h/(o=i+a),a*=h/o),e.moveTo(s+i,l),e.lineTo(s+u-n,l),0!==n&&e.arc(s+u-n,l+n,n,-Math.PI/2,0),e.lineTo(s+u,l+h-r),0!==r&&e.arc(s+u-r,l+h-r,r,0,Math.PI/2),e.lineTo(s+a,l+h),0!==a&&e.arc(s+a,l+h-a,a,Math.PI/2,Math.PI),e.lineTo(s,l+i),0!==i&&e.arc(s+i,l+i,i,Math.PI,1.5*Math.PI)}},tr=g,ir=tr.retrieve2,nr=tr.retrieve3,rr=tr.each,ar=tr.normalizeCssArray,or=tr.isString,sr=tr.isObject,lr=Tn,ur=er,hr=Sn,cr=Ji,dr=$i,fr=dr.ContextCachedBy,pr=dr.WILL_BE_RESTORED,gr=lr.DEFAULT_FONT,mr={left:1,right:1,center:1},vr={top:1,bottom:1,middle:1},yr=[["textShadowBlur","shadowBlur",0],["textShadowOffsetX","shadowOffsetX",0],["textShadowOffsetY","shadowOffsetY",0],["textShadowColor","shadowColor","transparent"]],_r={},xr={};function br(e){if(e){e.font=lr.makeFont(e);var t=e.textAlign;"middle"===t&&(t="center"),e.textAlign=null==t||mr[t]?t:"left";var i=e.textVerticalAlign||e.textBaseline;"center"===i&&(i="middle"),e.textVerticalAlign=null==i||vr[i]?i:"top",e.textPadding&&(e.textPadding=ar(e.textPadding))}}function wr(e,t,i,n,r){if(i&&t.textRotation){var a=t.textOrigin;"center"===a?(n=i.width/2+i.x,r=i.height/2+i.y):a&&(n=a[0]+i.x,r=a[1]+i.y),e.translate(n,r),e.rotate(-t.textRotation),e.translate(-n,-r)}}function Tr(e,t,i,n,r,a,o,s){var l=n.rich[i.styleName]||{};l.text=i.text;var u=i.textVerticalAlign,h=a+r/2;"top"===u?h=a+i.height/2:"bottom"===u&&(h=a+r-i.height/2),!i.isLineHolder&&Sr(l)&&Mr(e,t,l,"right"===s?o-i.width:"center"===s?o-i.width/2:o,h-i.height/2,i.width,i.height);var c=i.textPadding;c&&(o=Pr(o,s,c),h-=i.height/2-c[2]-i.textHeight/2),Cr(t,"shadowBlur",nr(l.textShadowBlur,n.textShadowBlur,0)),Cr(t,"shadowColor",l.textShadowColor||n.textShadowColor||"transparent"),Cr(t,"shadowOffsetX",nr(l.textShadowOffsetX,n.textShadowOffsetX,0)),Cr(t,"shadowOffsetY",nr(l.textShadowOffsetY,n.textShadowOffsetY,0)),Cr(t,"textAlign",s),Cr(t,"textBaseline","middle"),Cr(t,"font",i.font||gr);var d=Dr(l.textStroke||n.textStroke,p),f=Er(l.textFill||n.textFill),p=ir(l.textStrokeWidth,n.textStrokeWidth);d&&(Cr(t,"lineWidth",p),Cr(t,"strokeStyle",d),t.strokeText(i.text,o,h)),f&&(Cr(t,"fillStyle",f),t.fillText(i.text,o,h))}function Sr(e){return!!(e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor)}function Mr(e,t,i,n,r,a,o){var s=i.textBackgroundColor,l=i.textBorderWidth,u=i.textBorderColor,h=or(s);if(Cr(t,"shadowBlur",i.textBoxShadowBlur||0),Cr(t,"shadowColor",i.textBoxShadowColor||"transparent"),Cr(t,"shadowOffsetX",i.textBoxShadowOffsetX||0),Cr(t,"shadowOffsetY",i.textBoxShadowOffsetY||0),h||l&&u){t.beginPath();var c=i.textBorderRadius;c?ur.buildPath(t,{x:n,y:r,width:a,height:o,r:c}):t.rect(n,r,a,o),t.closePath()}if(h)if(Cr(t,"fillStyle",s),null!=i.fillOpacity){var d=t.globalAlpha;t.globalAlpha=i.fillOpacity*i.opacity,t.fill(),t.globalAlpha=d}else t.fill();else if(sr(s)){var f=s.image;(f=hr.createOrUpdateImage(f,null,e,Ar,s))&&hr.isImageReady(f)&&t.drawImage(f,n,r,a,o)}l&&u&&(Cr(t,"lineWidth",l),Cr(t,"strokeStyle",u),null!=i.strokeOpacity?(d=t.globalAlpha,t.globalAlpha=i.strokeOpacity*i.opacity,t.stroke(),t.globalAlpha=d):t.stroke())}function Ar(e,t){t.image=e}function Ir(e,t,i,n){var r=i.x||0,a=i.y||0,o=i.textAlign,s=i.textVerticalAlign;if(n){var l=i.textPosition;if(l instanceof Array)r=n.x+Lr(l[0],n.width),a=n.y+Lr(l[1],n.height);else{var u=t&&t.calculateTextPosition?t.calculateTextPosition(_r,i,n):lr.calculateTextPosition(_r,i,n);r=u.x,a=u.y,o=o||u.textAlign,s=s||u.textVerticalAlign}var h=i.textOffset;h&&(r+=h[0],a+=h[1])}return(e=e||{}).baseX=r,e.baseY=a,e.textAlign=o,e.textVerticalAlign=s,e}function Cr(e,t,i){return e[t]=cr(e,t,i),e[t]}function Dr(e,t){return null==e||t<=0||"transparent"===e||"none"===e?null:e.image||e.colorStops?"#000":e}function Er(e){return null==e||"none"===e?null:e.image||e.colorStops?"#000":e}function Lr(e,t){return"string"==typeof e?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}function Pr(e,t,i){return"right"===t?e-i[1]:"center"===t?e+i[3]/2-i[1]/2:e+i[3]}wn.normalizeTextStyle=function(e){return br(e),rr(e.rich,br),e},wn.renderText=function(e,t,i,n,r,a){n.rich?function(e,t,i,n,r,a){a!==pr&&(t.__attrCachedBy=fr.NONE);var o=e.__textCotentBlock;o&&!e.__dirtyText||(o=e.__textCotentBlock=lr.parseRichText(i,n)),function(e,t,i,n,r){var a=i.width,o=i.outerWidth,s=i.outerHeight,l=n.textPadding,u=Ir(xr,e,n,r),h=u.baseX,c=u.baseY,d=u.textAlign,f=u.textVerticalAlign;wr(t,n,r,h,c);var p=lr.adjustTextX(h,o,d),g=lr.adjustTextY(c,s,f),m=p,v=g;l&&(m+=l[3],v+=l[0]);var y=m+a;Sr(n)&&Mr(e,t,n,p,g,o,s);for(var _=0;_<i.lines.length;_++){for(var x,b=i.lines[_],w=b.tokens,T=w.length,S=b.lineHeight,M=b.width,A=0,I=m,C=y,D=T-1;A<T&&(!(x=w[A]).textAlign||"left"===x.textAlign);)Tr(e,t,x,n,S,v,I,"left"),M-=x.width,I+=x.width,A++;for(;D>=0&&"right"===(x=w[D]).textAlign;)Tr(e,t,x,n,S,v,C,"right"),M-=x.width,C-=x.width,D--;for(I+=(a-(I-m)-(y-C)-M)/2;A<=D;)Tr(e,t,x=w[A],n,S,v,I+x.width/2,"center"),I+=x.width,A++;v+=S}}(e,t,o,n,r)}(e,t,i,n,r,a):function(e,t,i,n,r,a){var o,s=Sr(n),l=!1,u=t.__attrCachedBy===fr.PLAIN_TEXT;a!==pr?(a&&(o=a.style,l=!s&&u&&o),t.__attrCachedBy=s?fr.NONE:fr.PLAIN_TEXT):u&&(t.__attrCachedBy=fr.NONE);var h=n.font||gr;l&&h===(o.font||gr)||(t.font=h);var c=e.__computedFont;e.__styleFont!==h&&(e.__styleFont=h,c=e.__computedFont=t.font);var d=n.textPadding,f=n.textLineHeight,p=e.__textCotentBlock;p&&!e.__dirtyText||(p=e.__textCotentBlock=lr.parsePlainText(i,c,d,f,n.truncate));var g=p.outerHeight,m=p.lines,v=p.lineHeight,y=Ir(xr,e,n,r),_=y.baseX,x=y.baseY,b=y.textAlign||"left",w=y.textVerticalAlign;wr(t,n,r,_,x);var T=lr.adjustTextY(x,g,w),S=_,M=T;if(s||d){var A=lr.getWidth(i,c);d&&(A+=d[1]+d[3]);var I=lr.adjustTextX(_,A,b);s&&Mr(e,t,n,I,T,A,g),d&&(S=Pr(_,b,d),M+=d[0])}t.textAlign=b,t.textBaseline="middle",t.globalAlpha=n.opacity||1;for(var C=0;C<yr.length;C++){var D=yr[C],E=D[0],L=D[1],P=n[E];l&&P===o[E]||(t[L]=cr(t,L,P||D[2]))}M+=v/2;var N=n.textStrokeWidth,R=l?o.textStrokeWidth:null,O=!l||N!==R,k=!l||O||n.textStroke!==o.textStroke,z=Dr(n.textStroke,N),B=Er(n.textFill);if(z&&(O&&(t.lineWidth=N),k&&(t.strokeStyle=z)),B&&(l&&n.textFill===o.textFill||(t.fillStyle=B)),1===m.length)z&&t.strokeText(m[0],S,M),B&&t.fillText(m[0],S,M);else for(C=0;C<m.length;C++)z&&t.strokeText(m[C],S,M),B&&t.fillText(m[C],S,M),M+=v}(e,t,i,n,r,a)},wn.getBoxPosition=Ir,wn.getStroke=Dr,wn.getFill=Er,wn.parsePercent=Lr,wn.needDrawText=function(e,t){return null!=e&&(e||t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor||t.textPadding)};var Nr=wn,Rr=Pi,Or=$i.WILL_BE_RESTORED,kr=new Rr,zr=function(){};zr.prototype={constructor:zr,drawRectText:function(e,t){var i=this.style;t=i.textRect||t,this.__dirty&&Nr.normalizeTextStyle(i,!0);var n=i.text;if(null!=n&&(n+=""),Nr.needDrawText(n,i)){e.save();var r=this.transform;i.transformText?this.setTransform(e):r&&(kr.copy(t),kr.applyTransform(r),t=kr),Nr.renderText(this,e,n,i,t,Or),e.restore()}}};var Br=zr,Fr=g,Vr=hn,Gr=Ai,Hr=Br;function Ur(e){for(var t in e=e||{},Gr.call(this,e),e)e.hasOwnProperty(t)&&"style"!==t&&(this[t]=e[t]);this.style=new Vr(e.style,this),this._rect=null,this.__clipPaths=null}Ur.prototype={constructor:Ur,type:"displayable",__dirty:!0,invisible:!1,z:0,z2:0,zlevel:0,draggable:!1,dragging:!1,silent:!1,culling:!1,cursor:"pointer",rectHover:!1,progressive:!1,incremental:!1,globalScaleRatio:1,beforeBrush:function(e){},afterBrush:function(e){},brush:function(e,t){},getBoundingRect:function(){},contain:function(e,t){return this.rectContain(e,t)},traverse:function(e,t){e.call(t,this)},rectContain:function(e,t){var i=this.transformCoordToLocal(e,t);return this.getBoundingRect().contain(i[0],i[1])},dirty:function(){this.__dirty=this.__dirtyText=!0,this._rect=null,this.__zr&&this.__zr.refresh()},animateStyle:function(e){return this.animate("style",e)},attrKV:function(e,t){"style"!==e?Gr.prototype.attrKV.call(this,e,t):this.style.set(t)},setStyle:function(e,t){return this.style.set(e,t),this.dirty(!1),this},useStyle:function(e){return this.style=new Vr(e,this),this.dirty(!1),this},calculateTextPosition:null},Fr.inherits(Ur,Gr),Fr.mixin(Ur,Hr);var Wr=Ur,jr=Wr,Xr=Pi,Zr=g,qr=Sn;function Yr(e){jr.call(this,e)}Yr.prototype={constructor:Yr,type:"image",brush:function(e,t){var i=this.style,n=i.image;i.bind(e,this,t);var r=this._image=qr.createOrUpdateImage(n,this._image,this,this.onload);if(r&&qr.isImageReady(r)){var a=i.x||0,o=i.y||0,s=i.width,l=i.height,u=r.width/r.height;if(null==s&&null!=l?s=l*u:null==l&&null!=s?l=s/u:null==s&&null==l&&(s=r.width,l=r.height),this.setTransform(e),i.sWidth&&i.sHeight){var h=i.sx||0,c=i.sy||0;e.drawImage(r,h,c,i.sWidth,i.sHeight,a,o,s,l)}else if(i.sx&&i.sy){var d=s-(h=i.sx),f=l-(c=i.sy);e.drawImage(r,h,c,d,f,a,o,s,l)}else e.drawImage(r,a,o,s,l);null!=i.text&&(this.restoreTransform(e),this.drawRectText(e,this.getBoundingRect()))}},getBoundingRect:function(){var e=this.style;return this._rect||(this._rect=new Xr(e.x||0,e.y||0,e.width||0,e.height||0)),this._rect}},Zr.inherits(Yr,jr);var Kr=Yr,Qr=$t.devicePixelRatio,Jr=g,$r=ni,ea=Pi,ta=Ui,ia=xn,na=bn,ra=Kr,aa=p,oa=1e5,sa=314159,la=.01;function ua(e){return parseInt(e,10)}var ha=new ea(0,0,0,0),ca=new ea(0,0,0,0),da=function(e,t,i){this.type="canvas";var n=!e.nodeName||"CANVAS"===e.nodeName.toUpperCase();this._opts=i=Jr.extend({},i||{}),this.dpr=i.devicePixelRatio||Qr,this._singleCanvas=n,this.root=e;var r=e.style;r&&(r["-webkit-tap-highlight-color"]="transparent",r["-webkit-user-select"]=r["user-select"]=r["-webkit-touch-callout"]="none",e.innerHTML=""),this.storage=t;var a=this._zlevelList=[],o=this._layers={};if(this._layerConfig={},this._needsManuallyCompositing=!1,n){var s=e.width,l=e.height;null!=i.width&&(s=i.width),null!=i.height&&(l=i.height),this.dpr=i.devicePixelRatio||1,e.width=s*this.dpr,e.height=l*this.dpr,this._width=s,this._height=l;var u=new ia(e,this,this.dpr);u.__builtin__=!0,u.initContext(),o[314159]=u,u.zlevel=sa,a.push(sa),this._domRoot=e}else{this._width=this._getSize(0),this._height=this._getSize(1);var h=this._domRoot=function(e,t){var i=document.createElement("div");return i.style.cssText=["position:relative","width:"+e+"px","height:"+t+"px","padding:0","margin:0","border-width:0"].join(";")+";",i}(this._width,this._height);e.appendChild(h)}this._hoverlayer=null,this._hoverElements=[]};da.prototype={constructor:da,getType:function(){return"canvas"},isSingleCanvas:function(){return this._singleCanvas},getViewportRoot:function(){return this._domRoot},getViewportRootOffset:function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},refresh:function(e){var t=this.storage.getDisplayList(!0),i=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,e,this._redrawId);for(var n=0;n<i.length;n++){var r=i[n],a=this._layers[r];if(!a.__builtin__&&a.refresh){var o=0===n?this._backgroundColor:null;a.refresh(o)}}return this.refreshHover(),this},addHover:function(e,t){if(!e.__hoverMir){var i=new e.constructor({style:e.style,shape:e.shape,z:e.z,z2:e.z2,silent:e.silent});return i.__from=e,e.__hoverMir=i,t&&i.setStyle(t),this._hoverElements.push(i),i}},removeHover:function(e){var t=e.__hoverMir,i=this._hoverElements,n=Jr.indexOf(i,t);n>=0&&i.splice(n,1),e.__hoverMir=null},clearHover:function(e){for(var t=this._hoverElements,i=0;i<t.length;i++){var n=t[i].__from;n&&(n.__hoverMir=null)}t.length=0},refreshHover:function(){var e=this._hoverElements,t=e.length,i=this._hoverlayer;if(i&&i.clear(),t){ta(e,this.storage.displayableSortFunc),i||(i=this._hoverlayer=this.getLayer(oa));var n={};i.ctx.save();for(var r=0;r<t;){var a=e[r],o=a.__from;o&&o.__zr?(r++,o.invisible||(a.transform=o.transform,a.invTransform=o.invTransform,a.__clipPaths=o.__clipPaths,this._doPaintEl(a,i,!0,n))):(e.splice(r,1),o.__hoverMir=null,t--)}i.ctx.restore()}},getHoverLayer:function(){return this.getLayer(oa)},_paintList:function(e,t,i){if(this._redrawId===i){t=t||!1,this._updateLayerStatus(e);var n=this._doPaintList(e,t);if(this._needsManuallyCompositing&&this._compositeManually(),!n){var r=this;na((function(){r._paintList(e,t,i)}))}}},_compositeManually:function(){var e=this.getLayer(sa).ctx,t=this._domRoot.width,i=this._domRoot.height;e.clearRect(0,0,t,i),this.eachBuiltinLayer((function(n){n.virtual&&e.drawImage(n.dom,0,0,t,i)}))},_doPaintList:function(e,t){for(var i=[],n=0;n<this._zlevelList.length;n++){var r=this._zlevelList[n];(s=this._layers[r]).__builtin__&&s!==this._hoverlayer&&(s.__dirty||t)&&i.push(s)}for(var a=!0,o=0;o<i.length;o++){var s,l=(s=i[o]).ctx,u={};l.save();var h=t?s.__startIndex:s.__drawIndex,c=!t&&s.incremental&&Date.now,d=c&&Date.now(),f=s.zlevel===this._zlevelList[0]?this._backgroundColor:null;if(s.__startIndex===s.__endIndex)s.clear(!1,f);else if(h===s.__startIndex){var p=e[h];p.incremental&&p.notClear&&!t||s.clear(!1,f)}-1===h&&(console.error("For some unknown reason. drawIndex is -1"),h=s.__startIndex);for(var g=h;g<s.__endIndex;g++){var m=e[g];if(this._doPaintEl(m,s,t,u),m.__dirty=m.__dirtyText=!1,c&&Date.now()-d>15)break}s.__drawIndex=g,s.__drawIndex<s.__endIndex&&(a=!1),u.prevElClipPaths&&l.restore(),l.restore()}return aa.wxa&&Jr.each(this._layers,(function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()})),a},_doPaintEl:function(e,t,i,n){var r=t.ctx,a=e.transform;if((t.__dirty||i)&&!e.invisible&&0!==e.style.opacity&&(!a||a[0]||a[3])&&(!e.culling||!function(e,t,i){return ha.copy(e.getBoundingRect()),e.transform&&ha.applyTransform(e.transform),ca.width=t,ca.height=i,!ha.intersect(ca)}(e,this._width,this._height))){var o=e.__clipPaths,s=n.prevElClipPaths;s&&!function(e,t){if(e===t)return!1;if(!e||!t||e.length!==t.length)return!0;for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!0;return!1}(o,s)||(s&&(r.restore(),n.prevElClipPaths=null,n.prevEl=null),o&&(r.save(),function(e,t){for(var i=0;i<e.length;i++){var n=e[i];n.setTransform(t),t.beginPath(),n.buildPath(t,n.shape),t.clip(),n.restoreTransform(t)}}(o,r),n.prevElClipPaths=o)),e.beforeBrush&&e.beforeBrush(r),e.brush(r,n.prevEl||null),n.prevEl=e,e.afterBrush&&e.afterBrush(r)}},getLayer:function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=sa);var i=this._layers[e];return i||((i=new ia("zr_"+e,this,this.dpr)).zlevel=e,i.__builtin__=!0,this._layerConfig[e]?Jr.merge(i,this._layerConfig[e],!0):this._layerConfig[e-la]&&Jr.merge(i,this._layerConfig[e-la],!0),t&&(i.virtual=t),this.insertLayer(e,i),i.initContext()),i},insertLayer:function(e,t){var i=this._layers,n=this._zlevelList,r=n.length,a=null,o=-1,s=this._domRoot;if(i[e])$r("ZLevel "+e+" has been used already");else if(function(e){return!!e&&(!!e.__builtin__||"function"==typeof e.resize&&"function"==typeof e.refresh)}(t)){if(r>0&&e>n[0]){for(o=0;o<r-1&&!(n[o]<e&&n[o+1]>e);o++);a=i[n[o]]}if(n.splice(o+1,0,e),i[e]=t,!t.virtual)if(a){var l=a.dom;l.nextSibling?s.insertBefore(t.dom,l.nextSibling):s.appendChild(t.dom)}else s.firstChild?s.insertBefore(t.dom,s.firstChild):s.appendChild(t.dom)}else $r("Layer of zlevel "+e+" is not valid")},eachLayer:function(e,t){var i,n,r=this._zlevelList;for(n=0;n<r.length;n++)i=r[n],e.call(t,this._layers[i],i)},eachBuiltinLayer:function(e,t){var i,n,r,a=this._zlevelList;for(r=0;r<a.length;r++)n=a[r],(i=this._layers[n]).__builtin__&&e.call(t,i,n)},eachOtherLayer:function(e,t){var i,n,r,a=this._zlevelList;for(r=0;r<a.length;r++)n=a[r],(i=this._layers[n]).__builtin__||e.call(t,i,n)},getLayers:function(){return this._layers},_updateLayerStatus:function(e){function t(e){r&&(r.__endIndex!==e&&(r.__dirty=!0),r.__endIndex=e)}if(this.eachBuiltinLayer((function(e,t){e.__dirty=e.__used=!1})),this._singleCanvas)for(var i=1;i<e.length;i++)if((o=e[i]).zlevel!==e[i-1].zlevel||o.incremental){this._needsManuallyCompositing=!0;break}var n,r=null,a=0;for(i=0;i<e.length;i++){var o,s,l=(o=e[i]).zlevel;n!==l&&(n=l,a=0),o.incremental?((s=this.getLayer(l+.001,this._needsManuallyCompositing)).incremental=!0,a=1):s=this.getLayer(l+(a>0?la:0),this._needsManuallyCompositing),s.__builtin__||$r("ZLevel "+l+" has been used by unkown layer "+s.id),s!==r&&(s.__used=!0,s.__startIndex!==i&&(s.__dirty=!0),s.__startIndex=i,s.incremental?s.__drawIndex=-1:s.__drawIndex=i,t(i),r=s),o.__dirty&&(s.__dirty=!0,s.incremental&&s.__drawIndex<0&&(s.__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)}))},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(e){e.clear()},setBackgroundColor:function(e){this._backgroundColor=e},configLayer:function(e,t){if(t){var i=this._layerConfig;i[e]?Jr.merge(i[e],t,!0):i[e]=t;for(var n=0;n<this._zlevelList.length;n++){var r=this._zlevelList[n];if(r===e||r===e+la){var a=this._layers[r];Jr.merge(a,i[e],!0)}}}},delLayer:function(e){var t=this._layers,i=this._zlevelList,n=t[e];n&&(n.dom.parentNode.removeChild(n.dom),delete t[e],i.splice(Jr.indexOf(i,e),1))},resize:function(e,t){if(this._domRoot.style){var i=this._domRoot;i.style.display="none";var n=this._opts;if(null!=e&&(n.width=e),null!=t&&(n.height=t),e=this._getSize(0),t=this._getSize(1),i.style.display="",this._width!==e||t!==this._height){for(var r in i.style.width=e+"px",i.style.height=t+"px",this._layers)this._layers.hasOwnProperty(r)&&this._layers[r].resize(e,t);Jr.each(this._progressiveLayers,(function(i){i.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(sa).resize(e,t)}return this},clearLayer:function(e){var t=this._layers[e];t&&t.clear()},dispose:function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},getRenderedCanvas:function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[314159].dom;var t=new ia("image",this,e.pixelRatio||this.dpr);if(t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor),e.pixelRatio<=this.dpr){this.refresh();var i=t.dom.width,n=t.dom.height,r=t.ctx;this.eachLayer((function(e){e.__builtin__?r.drawImage(e.dom,0,0,i,n):e.renderToCanvas&&(t.ctx.save(),e.renderToCanvas(t.ctx),t.ctx.restore())}))}else for(var a={},o=this.storage.getDisplayList(!0),s=0;s<o.length;s++){var l=o[s];this._doPaintEl(l,t,!0,a)}return t.dom},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(e){var t=this._opts,i=["width","height"][e],n=["clientWidth","clientHeight"][e],r=["paddingLeft","paddingTop"][e],a=["paddingRight","paddingBottom"][e];if(null!=t[i]&&"auto"!==t[i])return parseFloat(t[i]);var o=this.root,s=document.defaultView.getComputedStyle(o);return(o[n]||ua(s[i])||ua(o.style[i]))-(ua(s[r])||0)-(ua(s[a])||0)|0},pathToImage:function(e,t){t=t||this.dpr;var i=document.createElement("canvas"),n=i.getContext("2d"),r=e.getBoundingRect(),a=e.style,o=a.shadowBlur*t,s=a.shadowOffsetX*t,l=a.shadowOffsetY*t,u=a.hasStroke()?a.lineWidth:0,h=Math.max(u/2,-s+o),c=Math.max(u/2,s+o),d=Math.max(u/2,-l+o),f=Math.max(u/2,l+o),p=r.width+h+c,g=r.height+d+f;i.width=p*t,i.height=g*t,n.scale(t,t),n.clearRect(0,0,p,g),n.dpr=t;var m={position:e.position,rotation:e.rotation,scale:e.scale};e.position=[h-r.x,d-r.y],e.rotation=0,e.scale=[1,1],e.updateTransform(),e&&e.brush(n);var v=new ra({style:{x:0,y:0,image:i}});return null!=m.position&&(v.position=e.position=m.position),null!=m.rotation&&(v.rotation=e.rotation=m.rotation),null!=m.scale&&(v.scale=e.scale=m.scale),v}};var fa=da,pa=g,ga=ne.Dispatcher,ma=bn,va=Jt,ya=function(e){e=e||{},this.stage=e.stage||{},this.onframe=e.onframe||function(){},this._clips=[],this._running=!1,this._time,this._pausedTime,this._pauseStart,this._paused=!1,ga.call(this)};ya.prototype={constructor:ya,addClip:function(e){this._clips.push(e)},addAnimator:function(e){e.animation=this;for(var t=e.getClips(),i=0;i<t.length;i++)this.addClip(t[i])},removeClip:function(e){var t=pa.indexOf(this._clips,e);t>=0&&this._clips.splice(t,1)},removeAnimator:function(e){for(var t=e.getClips(),i=0;i<t.length;i++)this.removeClip(t[i]);e.animation=null},_update:function(){for(var e=(new Date).getTime()-this._pausedTime,t=e-this._time,i=this._clips,n=i.length,r=[],a=[],o=0;o<n;o++){var s=i[o],l=s.step(e,t);l&&(r.push(l),a.push(s))}for(o=0;o<n;)i[o]._needsRemove?(i[o]=i[n-1],i.pop(),n--):o++;for(n=r.length,o=0;o<n;o++)a[o].fire(r[o]);this._time=e,this.onframe(t),this.trigger("frame",t),this.stage.update&&this.stage.update()},_startLoop:function(){var e=this;this._running=!0,ma((function t(){e._running&&(ma(t),!e._paused&&e._update())}))},start:function(){this._time=(new Date).getTime(),this._pausedTime=0,this._startLoop()},stop:function(){this._running=!1},pause:function(){this._paused||(this._pauseStart=(new Date).getTime(),this._paused=!0)},resume:function(){this._paused&&(this._pausedTime+=(new Date).getTime()-this._pauseStart,this._paused=!1)},clear:function(){this._clips=[]},isFinished:function(){return!this._clips.length},animate:function(e,t){var i=new va(e,(t=t||{}).loop,t.getter,t.setter);return this.addAnimator(i),i}},pa.mixin(ya,ga);var _a,xa,ba=ya,wa=ne,Ta=wa.addEventListener,Sa=wa.removeEventListener,Ma=wa.normalizeEvent,Aa=wa.getNativeEvent,Ia=g,Ca=ie,Da=p,Ea=Da.domSupported,La=(xa={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:_a=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:Ia.map(_a,(function(e){var t=e.replace("mouse","pointer");return xa.hasOwnProperty(t)?t:e}))}),Pa=["mousemove","mouseup"],Na=["pointermove","pointerup"];function Ra(e){return"mousewheel"===e&&Da.browser.firefox?"DOMMouseScroll":e}function Oa(e){var t=e.pointerType;return"pen"===t||"touch"===t}function ka(e){e&&(e.zrByTouch=!0)}function za(e,t){for(var i=t,n=!1;i&&9!==i.nodeType&&!(n=i.domBelongToZr||i!==t&&i===e.painterRoot);)i=i.parentNode;return n}function Ba(e,t){this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}var Fa=Ba.prototype;Fa.stopPropagation=Fa.stopImmediatePropagation=Fa.preventDefault=Ia.noop;var Va={mousedown:function(e){e=Ma(this.dom,e),this._mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=Ma(this.dom,e);var t=this._mayPointerCapture;!t||e.zrX===t[0]&&e.zrY===t[1]||Xa(this,!0),this.trigger("mousemove",e)},mouseup:function(e){e=Ma(this.dom,e),Xa(this,!1),this.trigger("mouseup",e)},mouseout:function(e){e=Ma(this.dom,e),this._pointerCapturing&&(e.zrEventControl="no_globalout");var t=e.toElement||e.relatedTarget;e.zrIsToLocalDOM=za(this,t),this.trigger("mouseout",e)},touchstart:function(e){ka(e=Ma(this.dom,e)),this._lastTouchMoment=new Date,this.handler.processGesture(e,"start"),Va.mousemove.call(this,e),Va.mousedown.call(this,e)},touchmove:function(e){ka(e=Ma(this.dom,e)),this.handler.processGesture(e,"change"),Va.mousemove.call(this,e)},touchend:function(e){ka(e=Ma(this.dom,e)),this.handler.processGesture(e,"end"),Va.mouseup.call(this,e),+new Date-this._lastTouchMoment<300&&Va.click.call(this,e)},pointerdown:function(e){Va.mousedown.call(this,e)},pointermove:function(e){Oa(e)||Va.mousemove.call(this,e)},pointerup:function(e){Va.mouseup.call(this,e)},pointerout:function(e){Oa(e)||Va.mouseout.call(this,e)}};Ia.each(["click","mousewheel","dblclick","contextmenu"],(function(e){Va[e]=function(t){t=Ma(this.dom,t),this.trigger(e,t)}}));var Ga={pointermove:function(e){Oa(e)||Ga.mousemove.call(this,e)},pointerup:function(e){Ga.mouseup.call(this,e)},mousemove:function(e){this.trigger("mousemove",e)},mouseup:function(e){var t=this._pointerCapturing;Xa(this,!1),this.trigger("mouseup",e),t&&(e.zrEventControl="only_globalout",this.trigger("mouseout",e))}};function Ha(e,t){var i=t.domHandlers;Da.pointerEventsSupported?Ia.each(La.pointer,(function(n){Wa(t,n,(function(t){i[n].call(e,t)}))})):(Da.touchEventsSupported&&Ia.each(La.touch,(function(n){Wa(t,n,(function(r){i[n].call(e,r),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)}))})),Ia.each(La.mouse,(function(n){Wa(t,n,(function(r){r=Aa(r),t.touching||i[n].call(e,r)}))})))}function Ua(e,t){function i(i){Wa(t,i,(function(n){n=Aa(n),za(e,n.target)||(n=function(e,t){return Ma(e.dom,new Ba(e,t),!0)}(e,n),t.domHandlers[i].call(e,n))}),{capture:!0})}Da.pointerEventsSupported?Ia.each(Na,i):Da.touchEventsSupported||Ia.each(Pa,i)}function Wa(e,t,i,n){e.mounted[t]=i,e.listenerOpts[t]=n,Ta(e.domTarget,Ra(t),i,n)}function ja(e){var t=e.mounted;for(var i in t)t.hasOwnProperty(i)&&Sa(e.domTarget,Ra(i),t[i],e.listenerOpts[i]);e.mounted={}}function Xa(e,t){if(e._mayPointerCapture=null,Ea&&e._pointerCapturing^t){e._pointerCapturing=t;var i=e._globalHandlerScope;t?Ua(e,i):ja(i)}}function Za(e,t){this.domTarget=e,this.domHandlers=t,this.mounted={},this.listenerOpts={},this.touchTimer=null,this.touching=!1}function qa(e,t){Ca.call(this),this.dom=e,this.painterRoot=t,this._localHandlerScope=new Za(e,Va),Ea&&(this._globalHandlerScope=new Za(document,Ga)),this._pointerCapturing=!1,this._mayPointerCapture=null,Ha(this,this._localHandlerScope)}var Ya=qa.prototype;Ya.dispose=function(){ja(this._localHandlerScope),Ea&&ja(this._globalHandlerScope)},Ya.setCursor=function(e){this.dom.style&&(this.dom.style.cursor=e||"default")},Ia.mixin(qa,Ca);var Ka=f,Qa=p,Ja=g,$a=He,eo=Ki,to=fa,io=ba,no=qa,ro=!Qa.canvasSupported,ao={canvas:to},oo={},so=function(e,t,i){i=i||{},this.dom=t,this.id=e;var n=this,r=new eo,a=i.renderer;if(ro){if(!ao.vml)throw new Error("You need to require 'zrender/vml/vml' to support IE8");a="vml"}else a&&ao[a]||(a="canvas");var o=new ao[a](t,r,i,e);this.storage=r,this.painter=o;var s=Qa.node||Qa.worker?null:new no(o.getViewportRoot(),o.root);this.handler=new $a(r,o,s,o.root),this.animation=new io({stage:{update:Ja.bind(this.flush,this)}}),this.animation.start(),this._needsRefresh;var l=r.delFromStorage,u=r.addToStorage;r.delFromStorage=function(e){l.call(r,e),e&&e.removeSelfFromZr(n)},r.addToStorage=function(e){u.call(r,e),e.addSelfToZr(n)}};so.prototype={constructor:so,getId:function(){return this.id},add:function(e){this.storage.addRoot(e),this._needsRefresh=!0},remove:function(e){this.storage.delRoot(e),this._needsRefresh=!0},configLayer:function(e,t){this.painter.configLayer&&this.painter.configLayer(e,t),this._needsRefresh=!0},setBackgroundColor:function(e){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this._needsRefresh=!0},refreshImmediately:function(){this._needsRefresh=this._needsRefreshHover=!1,this.painter.refresh(),this._needsRefresh=this._needsRefreshHover=!1},refresh:function(){this._needsRefresh=!0},flush:function(){var e;this._needsRefresh&&(e=!0,this.refreshImmediately()),this._needsRefreshHover&&(e=!0,this.refreshHoverImmediately()),e&&this.trigger("rendered")},addHover:function(e,t){if(this.painter.addHover){var i=this.painter.addHover(e,t);return this.refreshHover(),i}},removeHover:function(e){this.painter.removeHover&&(this.painter.removeHover(e),this.refreshHover())},clearHover:function(){this.painter.clearHover&&(this.painter.clearHover(),this.refreshHover())},refreshHover:function(){this._needsRefreshHover=!0},refreshHoverImmediately:function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.refreshHover()},resize:function(e){e=e||{},this.painter.resize(e.width,e.height),this.handler.resize()},clearAnimation:function(){this.animation.clear()},getWidth:function(){return this.painter.getWidth()},getHeight:function(){return this.painter.getHeight()},pathToImage:function(e,t){return this.painter.pathToImage(e,t)},setCursorStyle:function(e){this.handler.setCursorStyle(e)},findHover:function(e,t){return this.handler.findHover(e,t)},on:function(e,t,i){this.handler.on(e,t,i)},off:function(e,t){this.handler.off(e,t)},trigger:function(e,t){this.handler.trigger(e,t)},clear:function(){this.storage.delRoot(),this.painter.clear()},dispose:function(){var e;this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,e=this.id,delete oo[e]}},c.version="4.3.2",c.init=function(e,t){var i=new so(Ka(),e,t);return oo[i.id]=i,i},c.dispose=function(e){if(e)e.dispose();else{for(var t in oo)oo.hasOwnProperty(t)&&oo[t].dispose();oo={}}return this},c.getInstance=function(e){return oo[e]},c.registerPainter=function(e,t){ao[e]=t};var lo={},uo=g,ho=p,co=uo.each,fo=uo.isObject,po=uo.isArray,go="series\0";function mo(e){return e instanceof Array?e:null==e?[]:[e]}function vo(e){return fo(e)&&e.id&&0===(e.id+"").indexOf("\0_ec_\0")}var yo=0;function _o(e,t){return e&&e.hasOwnProperty(t)}lo.normalizeToArray=mo,lo.defaultEmphasis=function(e,t,i){if(e){e[t]=e[t]||{},e.emphasis=e.emphasis||{},e.emphasis[t]=e.emphasis[t]||{};for(var n=0,r=i.length;n<r;n++){var a=i[n];!e.emphasis[t].hasOwnProperty(a)&&e[t].hasOwnProperty(a)&&(e.emphasis[t][a]=e[t][a])}}},lo.TEXT_STYLE_OPTIONS=["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"],lo.getDataItemValue=function(e){return!fo(e)||po(e)||e instanceof Date?e:e.value},lo.isDataItemOption=function(e){return fo(e)&&!(e instanceof Array)},lo.mappingToExists=function(e,t){t=(t||[]).slice();var i=uo.map(e||[],(function(e,t){return{exist:e}}));return co(t,(function(e,n){if(fo(e)){for(var r=0;r<i.length;r++)if(!i[r].option&&null!=e.id&&i[r].exist.id===e.id+"")return i[r].option=e,void(t[n]=null);for(r=0;r<i.length;r++){var a=i[r].exist;if(!(i[r].option||null!=a.id&&null!=e.id||null==e.name||vo(e)||vo(a)||a.name!==e.name+""))return i[r].option=e,void(t[n]=null)}}})),co(t,(function(e,t){if(fo(e)){for(var n=0;n<i.length;n++){var r=i[n].exist;if(!i[n].option&&!vo(r)&&null==e.id){i[n].option=e;break}}n>=i.length&&i.push({option:e})}})),i},lo.makeIdAndName=function(e){var t=uo.createHashMap();co(e,(function(e,i){var n=e.exist;n&&t.set(n.id,e)})),co(e,(function(e,i){var n=e.option;uo.assert(!n||null==n.id||!t.get(n.id)||t.get(n.id)===e,"id duplicates: "+(n&&n.id)),n&&null!=n.id&&t.set(n.id,e),!e.keyInfo&&(e.keyInfo={})})),co(e,(function(e,i){var n=e.exist,r=e.option,a=e.keyInfo;if(fo(r)){if(a.name=null!=r.name?r.name+"":n?n.name:go+i,n)a.id=n.id;else if(null!=r.id)a.id=r.id+"";else{var o=0;do{a.id="\0"+a.name+"\0"+o++}while(t.get(a.id))}t.set(a.id,e)}}))},lo.isNameSpecified=function(e){var t=e.name;return!(!t||!t.indexOf(go))},lo.isIdInner=vo,lo.compressBatches=function(e,t){var i={},n={};return r(e||[],i),r(t||[],n,i),[a(i),a(n)];function r(e,t,i){for(var n=0,r=e.length;n<r;n++)for(var a=e[n].seriesId,o=mo(e[n].dataIndex),s=i&&i[a],l=0,u=o.length;l<u;l++){var h=o[l];s&&s[h]?s[h]=null:(t[a]||(t[a]={}))[h]=1}}function a(e,t){var i=[];for(var n in e)if(e.hasOwnProperty(n)&&null!=e[n])if(t)i.push(+n);else{var r=a(e[n],!0);r.length&&i.push({seriesId:n,dataIndex:r})}return i}},lo.queryDataIndex=function(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?uo.isArray(t.dataIndex)?uo.map(t.dataIndex,(function(t){return e.indexOfRawIndex(t)})):e.indexOfRawIndex(t.dataIndex):null!=t.name?uo.isArray(t.name)?uo.map(t.name,(function(t){return e.indexOfName(t)})):e.indexOfName(t.name):void 0},lo.makeInner=function(){var e="__\0ec_inner_"+yo+++"_"+Math.random().toFixed(5);return function(t){return t[e]||(t[e]={})}},lo.parseFinder=function(e,t,i){if(uo.isString(t)){var n={};n[t+"Index"]=0,t=n}var r=i&&i.defaultMainType;!r||_o(t,r+"Index")||_o(t,r+"Id")||_o(t,r+"Name")||(t[r+"Index"]=0);var a={};return co(t,(function(n,r){if(n=t[r],"dataIndex"!==r&&"dataIndexInside"!==r){var o=r.match(/^(\w+)(Index|Id|Name)$/)||[],s=o[1],l=(o[2]||"").toLowerCase();if(!(!s||!l||null==n||"index"===l&&"none"===n||i&&i.includeMainTypes&&uo.indexOf(i.includeMainTypes,s)<0)){var u={mainType:s};"index"===l&&"all"===n||(u[l]=n);var h=e.queryComponents(u);a[s+"Models"]=h,a[s+"Model"]=h[0]}}else a[r]=n})),a},lo.setAttribute=function(e,t,i){e.setAttribute?e.setAttribute(t,i):e[t]=i},lo.getAttribute=function(e,t){return e.getAttribute?e.getAttribute(t):e[t]},lo.getTooltipRenderMode=function(e){return"auto"===e?ho.domSupported?"html":"richText":e||"html"},lo.groupData=function(e,t){var i=uo.createHashMap(),n=[];return uo.each(e,(function(e){var r=t(e);(i.get(r)||(n.push(r),i.set(r,[]))).push(e)})),{keys:n,buckets:i}};var xo={},bo=g,wo="___EC__COMPONENT__CONTAINER___";function To(e){var t={main:"",sub:""};return e&&(e=e.split("."),t.main=e[0]||"",t.sub=e[1]||""),t}var So=0;function Mo(e,t){var i=bo.slice(arguments,2);return this.superClass.prototype[t].apply(e,i)}function Ao(e,t,i){return this.superClass.prototype[t].apply(e,i)}xo.parseClassType=To,xo.enableClassExtend=function(e,t){e.$constructor=e,e.extend=function(e){var t=this,i=function(){e.$constructor?e.$constructor.apply(this,arguments):t.apply(this,arguments)};return bo.extend(i.prototype,e),i.extend=this.extend,i.superCall=Mo,i.superApply=Ao,bo.inherits(i,this),i.superClass=t,i}},xo.enableClassCheck=function(e){var t=["__\0is_clz",So++,Math.random().toFixed(3)].join("_");e.prototype[t]=!0,e.isInstance=function(e){return!(!e||!e[t])}},xo.enableClassManagement=function(e,t){t=t||{};var i={};if(e.registerClass=function(e,t){if(t)if(function(e){bo.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}(t),(t=To(t)).sub){if(t.sub!==wo){var n=function(e){var t=i[e.main];return t&&t[wo]||((t=i[e.main]={})[wo]=!0),t}(t);n[t.sub]=e}}else i[t.main]=e;return e},e.getClass=function(e,t,n){var r=i[e];if(r&&r[wo]&&(r=t?r[t]:null),n&&!r)throw new Error(t?"Component "+e+"."+(t||"")+" not exists. Load it first.":e+".type should be specified.");return r},e.getClassesByMainType=function(e){e=To(e);var t=[],n=i[e.main];return n&&n[wo]?bo.each(n,(function(e,i){i!==wo&&t.push(e)})):t.push(n),t},e.hasClass=function(e){return e=To(e),!!i[e.main]},e.getAllClassMainTypes=function(){var e=[];return bo.each(i,(function(t,i){e.push(i)})),e},e.hasSubTypes=function(e){e=To(e);var t=i[e.main];return t&&t[wo]},e.parseClassType=To,t.registerWhenExtend){var n=e.extend;n&&(e.extend=function(t){var i=n.call(this,t);return e.registerClass(i,t.type)})}return e},xo.setReadOnly=function(e,t){};var Io=g,Co=function(e){for(var t=0;t<e.length;t++)e[t][1]||(e[t][1]=e[t][0]);return function(t,i,n){for(var r={},a=0;a<e.length;a++){var o=e[a][1];if(!(i&&Io.indexOf(i,o)>=0||n&&Io.indexOf(n,o)<0)){var s=t.getShallow(o);null!=s&&(r[e[a][0]]=s)}}return r}},Do=Co([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),Eo={getLineStyle:function(e){var t=Do(this,e);return t.lineDash=this.getLineDash(t.lineWidth),t},getLineDash:function(e){null==e&&(e=1);var t=this.get("type"),i=Math.max(e,2),n=4*e;return"solid"!==t&&null!=t&&("dashed"===t?[n,n]:[i,i])}},Lo=Co([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),Po={getAreaStyle:function(e,t){return Lo(this,e,t)}},No={},Ro={},Oo={},ko=V,zo=ko.create,Bo=ko.distSquare,Fo=Math.pow,Vo=Math.sqrt,Go=1e-8,Ho=1e-4,Uo=Vo(3),Wo=1/3,jo=zo(),Xo=zo(),Zo=zo();function qo(e){return e>-1e-8&&e<Go}function Yo(e){return e>Go||e<-1e-8}function Ko(e,t,i,n,r){var a=1-r;return a*a*(a*e+3*r*t)+r*r*(r*n+3*a*i)}function Qo(e,t,i,n){var r=1-n;return r*(r*e+2*n*t)+n*n*i}Oo.cubicAt=Ko,Oo.cubicDerivativeAt=function(e,t,i,n,r){var a=1-r;return 3*(((t-e)*a+2*(i-t)*r)*a+(n-i)*r*r)},Oo.cubicRootAt=function(e,t,i,n,r,a){var o=n+3*(t-i)-e,s=3*(i-2*t+e),l=3*(t-e),u=e-r,h=s*s-3*o*l,c=s*l-9*o*u,d=l*l-3*s*u,f=0;if(qo(h)&&qo(c))qo(s)?a[0]=0:(S=-l/s)>=0&&S<=1&&(a[f++]=S);else{var p=c*c-4*h*d;if(qo(p)){var g=c/h,m=-g/2;(S=-s/o+g)>=0&&S<=1&&(a[f++]=S),m>=0&&m<=1&&(a[f++]=m)}else if(p>0){var v=Vo(p),y=h*s+1.5*o*(-c+v),_=h*s+1.5*o*(-c-v);(S=(-s-((y=y<0?-Fo(-y,Wo):Fo(y,Wo))+(_=_<0?-Fo(-_,Wo):Fo(_,Wo))))/(3*o))>=0&&S<=1&&(a[f++]=S)}else{var x=(2*h*s-3*o*c)/(2*Vo(h*h*h)),b=Math.acos(x)/3,w=Vo(h),T=Math.cos(b),S=(-s-2*w*T)/(3*o),M=(m=(-s+w*(T+Uo*Math.sin(b)))/(3*o),(-s+w*(T-Uo*Math.sin(b)))/(3*o));S>=0&&S<=1&&(a[f++]=S),m>=0&&m<=1&&(a[f++]=m),M>=0&&M<=1&&(a[f++]=M)}}return f},Oo.cubicExtrema=function(e,t,i,n,r){var a=6*i-12*t+6*e,o=9*t+3*n-3*e-9*i,s=3*t-3*e,l=0;if(qo(o))Yo(a)&&(h=-s/a)>=0&&h<=1&&(r[l++]=h);else{var u=a*a-4*o*s;if(qo(u))r[0]=-a/(2*o);else if(u>0){var h,c=Vo(u),d=(-a-c)/(2*o);(h=(-a+c)/(2*o))>=0&&h<=1&&(r[l++]=h),d>=0&&d<=1&&(r[l++]=d)}}return l},Oo.cubicSubdivide=function(e,t,i,n,r,a){var o=(t-e)*r+e,s=(i-t)*r+t,l=(n-i)*r+i,u=(s-o)*r+o,h=(l-s)*r+s,c=(h-u)*r+u;a[0]=e,a[1]=o,a[2]=u,a[3]=c,a[4]=c,a[5]=h,a[6]=l,a[7]=n},Oo.cubicProjectPoint=function(e,t,i,n,r,a,o,s,l,u,h){var c,d,f,p,g,m=.005,v=1/0;jo[0]=l,jo[1]=u;for(var y=0;y<1;y+=.05)Xo[0]=Ko(e,i,r,o,y),Xo[1]=Ko(t,n,a,s,y),(p=Bo(jo,Xo))<v&&(c=y,v=p);v=1/0;for(var _=0;_<32&&!(m<Ho);_++)d=c-m,f=c+m,Xo[0]=Ko(e,i,r,o,d),Xo[1]=Ko(t,n,a,s,d),p=Bo(Xo,jo),d>=0&&p<v?(c=d,v=p):(Zo[0]=Ko(e,i,r,o,f),Zo[1]=Ko(t,n,a,s,f),g=Bo(Zo,jo),f<=1&&g<v?(c=f,v=g):m*=.5);return h&&(h[0]=Ko(e,i,r,o,c),h[1]=Ko(t,n,a,s,c)),Vo(v)},Oo.quadraticAt=Qo,Oo.quadraticDerivativeAt=function(e,t,i,n){return 2*((1-n)*(t-e)+n*(i-t))},Oo.quadraticRootAt=function(e,t,i,n,r){var a=e-2*t+i,o=2*(t-e),s=e-n,l=0;if(qo(a))Yo(o)&&(h=-s/o)>=0&&h<=1&&(r[l++]=h);else{var u=o*o-4*a*s;if(qo(u))(h=-o/(2*a))>=0&&h<=1&&(r[l++]=h);else if(u>0){var h,c=Vo(u),d=(-o-c)/(2*a);(h=(-o+c)/(2*a))>=0&&h<=1&&(r[l++]=h),d>=0&&d<=1&&(r[l++]=d)}}return l},Oo.quadraticExtremum=function(e,t,i){var n=e+i-2*t;return 0===n?.5:(e-t)/n},Oo.quadraticSubdivide=function(e,t,i,n,r){var a=(t-e)*n+e,o=(i-t)*n+t,s=(o-a)*n+a;r[0]=e,r[1]=a,r[2]=s,r[3]=s,r[4]=o,r[5]=i},Oo.quadraticProjectPoint=function(e,t,i,n,r,a,o,s,l){var u,h=.005,c=1/0;jo[0]=o,jo[1]=s;for(var d=0;d<1;d+=.05)Xo[0]=Qo(e,i,r,d),Xo[1]=Qo(t,n,a,d),(m=Bo(jo,Xo))<c&&(u=d,c=m);c=1/0;for(var f=0;f<32&&!(h<Ho);f++){var p=u-h,g=u+h;Xo[0]=Qo(e,i,r,p),Xo[1]=Qo(t,n,a,p);var m=Bo(Xo,jo);if(p>=0&&m<c)u=p,c=m;else{Zo[0]=Qo(e,i,r,g),Zo[1]=Qo(t,n,a,g);var v=Bo(Zo,jo);g<=1&&v<c?(u=g,c=v):h*=.5}}return l&&(l[0]=Qo(e,i,r,u),l[1]=Qo(t,n,a,u)),Vo(c)};var Jo={},$o=V,es=Oo,ts=Math.min,is=Math.max,ns=Math.sin,rs=Math.cos,as=2*Math.PI,os=$o.create(),ss=$o.create(),ls=$o.create(),us=[],hs=[];Jo.fromPoints=function(e,t,i){if(0!==e.length){var n,r=e[0],a=r[0],o=r[0],s=r[1],l=r[1];for(n=1;n<e.length;n++)r=e[n],a=ts(a,r[0]),o=is(o,r[0]),s=ts(s,r[1]),l=is(l,r[1]);t[0]=a,t[1]=s,i[0]=o,i[1]=l}},Jo.fromLine=function(e,t,i,n,r,a){r[0]=ts(e,i),r[1]=ts(t,n),a[0]=is(e,i),a[1]=is(t,n)},Jo.fromCubic=function(e,t,i,n,r,a,o,s,l,u){var h,c=es.cubicExtrema,d=es.cubicAt,f=c(e,i,r,o,us);for(l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0,h=0;h<f;h++){var p=d(e,i,r,o,us[h]);l[0]=ts(p,l[0]),u[0]=is(p,u[0])}for(f=c(t,n,a,s,hs),h=0;h<f;h++){var g=d(t,n,a,s,hs[h]);l[1]=ts(g,l[1]),u[1]=is(g,u[1])}l[0]=ts(e,l[0]),u[0]=is(e,u[0]),l[0]=ts(o,l[0]),u[0]=is(o,u[0]),l[1]=ts(t,l[1]),u[1]=is(t,u[1]),l[1]=ts(s,l[1]),u[1]=is(s,u[1])},Jo.fromQuadratic=function(e,t,i,n,r,a,o,s){var l=es.quadraticExtremum,u=es.quadraticAt,h=is(ts(l(e,i,r),1),0),c=is(ts(l(t,n,a),1),0),d=u(e,i,r,h),f=u(t,n,a,c);o[0]=ts(e,r,d),o[1]=ts(t,a,f),s[0]=is(e,r,d),s[1]=is(t,a,f)},Jo.fromArc=function(e,t,i,n,r,a,o,s,l){var u=$o.min,h=$o.max,c=Math.abs(r-a);if(c%as<1e-4&&c>1e-4)return s[0]=e-i,s[1]=t-n,l[0]=e+i,void(l[1]=t+n);if(os[0]=rs(r)*i+e,os[1]=ns(r)*n+t,ss[0]=rs(a)*i+e,ss[1]=ns(a)*n+t,u(s,os,ss),h(l,os,ss),(r%=as)<0&&(r+=as),(a%=as)<0&&(a+=as),r>a&&!o?a+=as:r<a&&o&&(r+=as),o){var d=a;a=r,r=d}for(var f=0;f<a;f+=Math.PI/2)f>r&&(ls[0]=rs(f)*i+e,ls[1]=ns(f)*n+t,u(s,ls,s),h(l,ls,l))};var cs=Oo,ds=V,fs=Jo,ps=Pi,gs=$t.devicePixelRatio,ms={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},vs=[],ys=[],_s=[],xs=[],bs=Math.min,ws=Math.max,Ts=Math.cos,Ss=Math.sin,Ms=Math.sqrt,As=Math.abs,Is="undefined"!=typeof Float32Array,Cs=function(e){this._saveData=!e,this._saveData&&(this.data=[]),this._ctx=null};Cs.prototype={constructor:Cs,_xi:0,_yi:0,_x0:0,_y0:0,_ux:0,_uy:0,_len:0,_lineDash:null,_dashOffset:0,_dashIdx:0,_dashSum:0,setScale:function(e,t,i){i=i||0,this._ux=As(i/gs/e)||0,this._uy=As(i/gs/t)||0},getContext:function(){return this._ctx},beginPath:function(e){return this._ctx=e,e&&e.beginPath(),e&&(this.dpr=e.dpr),this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this},moveTo:function(e,t){return this.addData(ms.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},lineTo:function(e,t){var i=As(e-this._xi)>this._ux||As(t-this._yi)>this._uy||this._len<5;return this.addData(ms.L,e,t),this._ctx&&i&&(this._needsDash()?this._dashedLineTo(e,t):this._ctx.lineTo(e,t)),i&&(this._xi=e,this._yi=t),this},bezierCurveTo:function(e,t,i,n,r,a){return this.addData(ms.C,e,t,i,n,r,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(e,t,i,n,r,a):this._ctx.bezierCurveTo(e,t,i,n,r,a)),this._xi=r,this._yi=a,this},quadraticCurveTo:function(e,t,i,n){return this.addData(ms.Q,e,t,i,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(e,t,i,n):this._ctx.quadraticCurveTo(e,t,i,n)),this._xi=i,this._yi=n,this},arc:function(e,t,i,n,r,a){return this.addData(ms.A,e,t,i,i,n,r-n,0,a?0:1),this._ctx&&this._ctx.arc(e,t,i,n,r,a),this._xi=Ts(r)*i+e,this._yi=Ss(r)*i+t,this},arcTo:function(e,t,i,n,r){return this._ctx&&this._ctx.arcTo(e,t,i,n,r),this},rect:function(e,t,i,n){return this._ctx&&this._ctx.rect(e,t,i,n),this.addData(ms.R,e,t,i,n),this},closePath:function(){this.addData(ms.Z);var e=this._ctx,t=this._x0,i=this._y0;return e&&(this._needsDash()&&this._dashedLineTo(t,i),e.closePath()),this._xi=t,this._yi=i,this},fill:function(e){e&&e.fill(),this.toStatic()},stroke:function(e){e&&e.stroke(),this.toStatic()},setLineDash:function(e){if(e instanceof Array){this._lineDash=e,this._dashIdx=0;for(var t=0,i=0;i<e.length;i++)t+=e[i];this._dashSum=t}return this},setLineDashOffset:function(e){return this._dashOffset=e,this},len:function(){return this._len},setData:function(e){var t=e.length;this.data&&this.data.length===t||!Is||(this.data=new Float32Array(t));for(var i=0;i<t;i++)this.data[i]=e[i];this._len=t},appendPath:function(e){e instanceof Array||(e=[e]);for(var t=e.length,i=0,n=this._len,r=0;r<t;r++)i+=e[r].len();for(Is&&this.data instanceof Float32Array&&(this.data=new Float32Array(n+i)),r=0;r<t;r++)for(var a=e[r].data,o=0;o<a.length;o++)this.data[n++]=a[o];this._len=n},addData:function(e){if(this._saveData){var t=this.data;this._len+arguments.length>t.length&&(this._expandData(),t=this.data);for(var i=0;i<arguments.length;i++)t[this._len++]=arguments[i];this._prevCmd=e}},_expandData:function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t<this._len;t++)e[t]=this.data[t];this.data=e}},_needsDash:function(){return this._lineDash},_dashedLineTo:function(e,t){var i,n,r=this._dashSum,a=this._dashOffset,o=this._lineDash,s=this._ctx,l=this._xi,u=this._yi,h=e-l,c=t-u,d=Ms(h*h+c*c),f=l,p=u,g=o.length;for(a<0&&(a=r+a),f-=(a%=r)*(h/=d),p-=a*(c/=d);h>0&&f<=e||h<0&&f>=e||0===h&&(c>0&&p<=t||c<0&&p>=t);)f+=h*(i=o[n=this._dashIdx]),p+=c*i,this._dashIdx=(n+1)%g,h>0&&f<l||h<0&&f>l||c>0&&p<u||c<0&&p>u||s[n%2?"moveTo":"lineTo"](h>=0?bs(f,e):ws(f,e),c>=0?bs(p,t):ws(p,t));h=f-e,c=p-t,this._dashOffset=-Ms(h*h+c*c)},_dashedBezierTo:function(e,t,i,n,r,a){var o,s,l,u,h,c=this._dashSum,d=this._dashOffset,f=this._lineDash,p=this._ctx,g=this._xi,m=this._yi,v=cs.cubicAt,y=0,_=this._dashIdx,x=f.length,b=0;for(d<0&&(d=c+d),d%=c,o=0;o<1;o+=.1)s=v(g,e,i,r,o+.1)-v(g,e,i,r,o),l=v(m,t,n,a,o+.1)-v(m,t,n,a,o),y+=Ms(s*s+l*l);for(;_<x&&!((b+=f[_])>d);_++);for(o=(b-d)/y;o<=1;)u=v(g,e,i,r,o),h=v(m,t,n,a,o),_%2?p.moveTo(u,h):p.lineTo(u,h),o+=f[_]/y,_=(_+1)%x;_%2!=0&&p.lineTo(r,a),s=r-u,l=a-h,this._dashOffset=-Ms(s*s+l*l)},_dashedQuadraticTo:function(e,t,i,n){var r=i,a=n;i=(i+2*e)/3,n=(n+2*t)/3,e=(this._xi+2*e)/3,t=(this._yi+2*t)/3,this._dashedBezierTo(e,t,i,n,r,a)},toStatic:function(){var e=this.data;e instanceof Array&&(e.length=this._len,Is&&(this.data=new Float32Array(e)))},getBoundingRect:function(){vs[0]=vs[1]=_s[0]=_s[1]=Number.MAX_VALUE,ys[0]=ys[1]=xs[0]=xs[1]=-Number.MAX_VALUE;for(var e=this.data,t=0,i=0,n=0,r=0,a=0;a<e.length;){var o=e[a++];switch(1===a&&(n=t=e[a],r=i=e[a+1]),o){case ms.M:t=n=e[a++],i=r=e[a++],_s[0]=n,_s[1]=r,xs[0]=n,xs[1]=r;break;case ms.L:fs.fromLine(t,i,e[a],e[a+1],_s,xs),t=e[a++],i=e[a++];break;case ms.C:fs.fromCubic(t,i,e[a++],e[a++],e[a++],e[a++],e[a],e[a+1],_s,xs),t=e[a++],i=e[a++];break;case ms.Q:fs.fromQuadratic(t,i,e[a++],e[a++],e[a],e[a+1],_s,xs),t=e[a++],i=e[a++];break;case ms.A:var s=e[a++],l=e[a++],u=e[a++],h=e[a++],c=e[a++],d=e[a++]+c;a+=1;var f=1-e[a++];1===a&&(n=Ts(c)*u+s,r=Ss(c)*h+l),fs.fromArc(s,l,u,h,c,d,f,_s,xs),t=Ts(d)*u+s,i=Ss(d)*h+l;break;case ms.R:n=t=e[a++],r=i=e[a++];var p=e[a++],g=e[a++];fs.fromLine(n,r,n+p,r+g,_s,xs);break;case ms.Z:t=n,i=r}ds.min(vs,vs,_s),ds.max(ys,ys,xs)}return 0===a&&(vs[0]=vs[1]=ys[0]=ys[1]=0),new ps(vs[0],vs[1],ys[0]-vs[0],ys[1]-vs[1])},rebuildPath:function(e){for(var t,i,n,r,a,o,s=this.data,l=this._ux,u=this._uy,h=this._len,c=0;c<h;){var d=s[c++];switch(1===c&&(t=n=s[c],i=r=s[c+1]),d){case ms.M:t=n=s[c++],i=r=s[c++],e.moveTo(n,r);break;case ms.L:a=s[c++],o=s[c++],(As(a-n)>l||As(o-r)>u||c===h-1)&&(e.lineTo(a,o),n=a,r=o);break;case ms.C:e.bezierCurveTo(s[c++],s[c++],s[c++],s[c++],s[c++],s[c++]),n=s[c-2],r=s[c-1];break;case ms.Q:e.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),n=s[c-2],r=s[c-1];break;case ms.A:var f=s[c++],p=s[c++],g=s[c++],m=s[c++],v=s[c++],y=s[c++],_=s[c++],x=s[c++],b=g>m?g:m,w=g>m?1:g/m,T=g>m?m/g:1,S=v+y;Math.abs(g-m)>.001?(e.translate(f,p),e.rotate(_),e.scale(w,T),e.arc(0,0,b,v,S,1-x),e.scale(1/w,1/T),e.rotate(-_),e.translate(-f,-p)):e.arc(f,p,b,v,S,1-x),1===c&&(t=Ts(v)*g+f,i=Ss(v)*m+p),n=Ts(S)*g+f,r=Ss(S)*m+p;break;case ms.R:t=n=s[c],i=r=s[c+1],e.rect(s[c++],s[c++],s[c++],s[c++]);break;case ms.Z:e.closePath(),n=t,r=i}}}},Cs.CMD=ms;var Ds=Cs,Es={},Ls={containStroke:function(e,t,i,n,r,a,o){if(0===r)return!1;var s=r,l=0;if(o>t+s&&o>n+s||o<t-s&&o<n-s||a>e+s&&a>i+s||a<e-s&&a<i-s)return!1;if(e===i)return Math.abs(a-e)<=s/2;var u=(l=(t-n)/(e-i))*a-o+(e*n-i*t)/(e-i);return u*u/(l*l+1)<=s/2*s/2}},Ps={},Ns=Oo;Ps.containStroke=function(e,t,i,n,r,a,o,s,l,u,h){if(0===l)return!1;var c=l;return!(h>t+c&&h>n+c&&h>a+c&&h>s+c||h<t-c&&h<n-c&&h<a-c&&h<s-c||u>e+c&&u>i+c&&u>r+c&&u>o+c||u<e-c&&u<i-c&&u<r-c&&u<o-c)&&Ns.cubicProjectPoint(e,t,i,n,r,a,o,s,u,h,null)<=c/2};var Rs={},Os=Oo.quadraticProjectPoint;Rs.containStroke=function(e,t,i,n,r,a,o,s,l){if(0===o)return!1;var u=o;return!(l>t+u&&l>n+u&&l>a+u||l<t-u&&l<n-u&&l<a-u||s>e+u&&s>i+u&&s>r+u||s<e-u&&s<i-u&&s<r-u)&&Os(e,t,i,n,r,a,s,l,null)<=u/2};var ks={},zs={},Bs=2*Math.PI;zs.normalizeRadian=function(e){return(e%=Bs)<0&&(e+=Bs),e};var Fs=zs.normalizeRadian,Vs=2*Math.PI;ks.containStroke=function(e,t,i,n,r,a,o,s,l){if(0===o)return!1;var u=o;s-=e,l-=t;var h=Math.sqrt(s*s+l*l);if(h-u>i||h+u<i)return!1;if(Math.abs(n-r)%Vs<1e-4)return!0;if(a){var c=n;n=Fs(r),r=Fs(c)}else n=Fs(n),r=Fs(r);n>r&&(r+=Vs);var d=Math.atan2(l,s);return d<0&&(d+=Vs),d>=n&&d<=r||d+Vs>=n&&d+Vs<=r};var Gs=function(e,t,i,n,r,a){if(a>t&&a>n||a<t&&a<n)return 0;if(n===t)return 0;var o=n<t?1:-1,s=(a-t)/(n-t);1!==s&&0!==s||(o=n<t?.5:-.5);var l=s*(i-e)+e;return l===r?1/0:l>r?o:0},Hs=Ds,Us=Ls,Ws=Ps,js=Rs,Xs=ks,Zs=zs.normalizeRadian,qs=Oo,Ys=Gs,Ks=Hs.CMD,Qs=2*Math.PI,Js=[-1,-1,-1],$s=[-1,-1];function el(e,t,i,n,r,a,o,s,l,u){if(u>t&&u>n&&u>a&&u>s||u<t&&u<n&&u<a&&u<s)return 0;var h,c=qs.cubicRootAt(t,n,a,s,u,Js);if(0===c)return 0;for(var d,f,p=0,g=-1,m=0;m<c;m++){var v=Js[m],y=0===v||1===v?.5:1;qs.cubicAt(e,i,r,o,v)<l||(g<0&&(g=qs.cubicExtrema(t,n,a,s,$s),$s[1]<$s[0]&&g>1&&(h=void 0,h=$s[0],$s[0]=$s[1],$s[1]=h),d=qs.cubicAt(t,n,a,s,$s[0]),g>1&&(f=qs.cubicAt(t,n,a,s,$s[1]))),2===g?v<$s[0]?p+=d<t?y:-y:v<$s[1]?p+=f<d?y:-y:p+=s<f?y:-y:v<$s[0]?p+=d<t?y:-y:p+=s<d?y:-y)}return p}function tl(e,t,i,n,r,a,o,s){if(s>t&&s>n&&s>a||s<t&&s<n&&s<a)return 0;var l=qs.quadraticRootAt(t,n,a,s,Js);if(0===l)return 0;var u=qs.quadraticExtremum(t,n,a);if(u>=0&&u<=1){for(var h=0,c=qs.quadraticAt(t,n,a,u),d=0;d<l;d++){var f=0===Js[d]||1===Js[d]?.5:1;qs.quadraticAt(e,i,r,Js[d])<o||(Js[d]<u?h+=c<t?f:-f:h+=a<c?f:-f)}return h}return f=0===Js[0]||1===Js[0]?.5:1,qs.quadraticAt(e,i,r,Js[0])<o?0:a<t?f:-f}function il(e,t,i,n,r,a,o,s){if((s-=t)>i||s<-i)return 0;var l=Math.sqrt(i*i-s*s);Js[0]=-l,Js[1]=l;var u=Math.abs(n-r);if(u<1e-4)return 0;if(u%Qs<1e-4){n=0,r=Qs;var h=a?1:-1;return o>=Js[0]+e&&o<=Js[1]+e?h:0}a?(l=n,n=Zs(r),r=Zs(l)):(n=Zs(n),r=Zs(r)),n>r&&(r+=Qs);for(var c=0,d=0;d<2;d++){var f=Js[d];if(f+e>o){var p=Math.atan2(s,f);h=a?1:-1,p<0&&(p=Qs+p),(p>=n&&p<=r||p+Qs>=n&&p+Qs<=r)&&(p>Math.PI/2&&p<1.5*Math.PI&&(h=-h),c+=h)}}return c}function nl(e,t,i,n,r){for(var a,o,s=0,l=0,u=0,h=0,c=0,d=0;d<e.length;){var f=e[d++];switch(f===Ks.M&&d>1&&(i||(s+=Ys(l,u,h,c,n,r))),1===d&&(h=l=e[d],c=u=e[d+1]),f){case Ks.M:l=h=e[d++],u=c=e[d++];break;case Ks.L:if(i){if(Us.containStroke(l,u,e[d],e[d+1],t,n,r))return!0}else s+=Ys(l,u,e[d],e[d+1],n,r)||0;l=e[d++],u=e[d++];break;case Ks.C:if(i){if(Ws.containStroke(l,u,e[d++],e[d++],e[d++],e[d++],e[d],e[d+1],t,n,r))return!0}else s+=el(l,u,e[d++],e[d++],e[d++],e[d++],e[d],e[d+1],n,r)||0;l=e[d++],u=e[d++];break;case Ks.Q:if(i){if(js.containStroke(l,u,e[d++],e[d++],e[d],e[d+1],t,n,r))return!0}else s+=tl(l,u,e[d++],e[d++],e[d],e[d+1],n,r)||0;l=e[d++],u=e[d++];break;case Ks.A:var p=e[d++],g=e[d++],m=e[d++],v=e[d++],y=e[d++],_=e[d++];d+=1;var x=1-e[d++],b=Math.cos(y)*m+p,w=Math.sin(y)*v+g;d>1?s+=Ys(l,u,b,w,n,r):(h=b,c=w);var T=(n-p)*v/m+p;if(i){if(Xs.containStroke(p,g,v,y,y+_,x,t,T,r))return!0}else s+=il(p,g,v,y,y+_,x,T,r);l=Math.cos(y+_)*m+p,u=Math.sin(y+_)*v+g;break;case Ks.R:if(h=l=e[d++],c=u=e[d++],b=h+e[d++],w=c+e[d++],i){if(Us.containStroke(h,c,b,c,t,n,r)||Us.containStroke(b,c,b,w,t,n,r)||Us.containStroke(b,w,h,w,t,n,r)||Us.containStroke(h,w,h,c,t,n,r))return!0}else s+=Ys(b,c,b,w,n,r),s+=Ys(h,w,h,c,n,r);break;case Ks.Z:if(i){if(Us.containStroke(l,u,h,c,t,n,r))return!0}else s+=Ys(l,u,h,c,n,r);l=h,u=c}}return i||(a=u,o=c,Math.abs(a-o)<1e-4)||(s+=Ys(l,u,h,c,n,r)||0),0!==s}Es.contain=function(e,t,i){return nl(e,0,!1,t,i)},Es.containStroke=function(e,t,i,n){return nl(e,t,!0,i,n)};var rl=Wr,al=g,ol=Ds,sl=Es,ll=dn.prototype.getCanvasPattern,ul=Math.abs,hl=new ol(!0);function cl(e){rl.call(this,e),this.path=null}cl.prototype={constructor:cl,type:"path",__dirtyPath:!0,strokeContainThreshold:5,segmentIgnoreThreshold:0,subPixelOptimize:!1,brush:function(e,t){var i,n=this.style,r=this.path||hl,a=n.hasStroke(),o=n.hasFill(),s=n.fill,l=n.stroke,u=o&&!!s.colorStops,h=a&&!!l.colorStops,c=o&&!!s.image,d=a&&!!l.image;n.bind(e,this,t),this.setTransform(e),this.__dirty&&(u&&(i=i||this.getBoundingRect(),this._fillGradient=n.getGradient(e,s,i)),h&&(i=i||this.getBoundingRect(),this._strokeGradient=n.getGradient(e,l,i))),u?e.fillStyle=this._fillGradient:c&&(e.fillStyle=ll.call(s,e)),h?e.strokeStyle=this._strokeGradient:d&&(e.strokeStyle=ll.call(l,e));var f=n.lineDash,p=n.lineDashOffset,g=!!e.setLineDash,m=this.getGlobalScale();if(r.setScale(m[0],m[1],this.segmentIgnoreThreshold),this.__dirtyPath||f&&!g&&a?(r.beginPath(e),f&&!g&&(r.setLineDash(f),r.setLineDashOffset(p)),this.buildPath(r,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(e.beginPath(),this.path.rebuildPath(e)),o)if(null!=n.fillOpacity){var v=e.globalAlpha;e.globalAlpha=n.fillOpacity*n.opacity,r.fill(e),e.globalAlpha=v}else r.fill(e);f&&g&&(e.setLineDash(f),e.lineDashOffset=p),a&&(null!=n.strokeOpacity?(v=e.globalAlpha,e.globalAlpha=n.strokeOpacity*n.opacity,r.stroke(e),e.globalAlpha=v):r.stroke(e)),f&&g&&e.setLineDash([]),null!=n.text&&(this.restoreTransform(e),this.drawRectText(e,this.getBoundingRect()))},buildPath:function(e,t,i){},createPathProxy:function(){this.path=new ol},getBoundingRect:function(){var e=this._rect,t=this.style,i=!e;if(i){var n=this.path;n||(n=this.path=new ol),this.__dirtyPath&&(n.beginPath(),this.buildPath(n,this.shape,!1)),e=n.getBoundingRect()}if(this._rect=e,t.hasStroke()){var r=this._rectWithStroke||(this._rectWithStroke=e.clone());if(this.__dirty||i){r.copy(e);var a=t.lineWidth,o=t.strokeNoScale?this.getLineScale():1;t.hasFill()||(a=Math.max(a,this.strokeContainThreshold||4)),o>1e-10&&(r.width+=a/o,r.height+=a/o,r.x-=a/o/2,r.y-=a/o/2)}return r}return e},contain:function(e,t){var i=this.transformCoordToLocal(e,t),n=this.getBoundingRect(),r=this.style;if(e=i[0],t=i[1],n.contain(e,t)){var a=this.path.data;if(r.hasStroke()){var o=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(r.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),sl.containStroke(a,o/s,e,t)))return!0}if(r.hasFill())return sl.contain(a,e,t)}return!1},dirty:function(e){null==e&&(e=!0),e&&(this.__dirtyPath=e,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(e){return this.animate("shape",e)},attrKV:function(e,t){"shape"===e?(this.setShape(t),this.__dirtyPath=!0,this._rect=null):rl.prototype.attrKV.call(this,e,t)},setShape:function(e,t){var i=this.shape;if(i){if(al.isObject(e))for(var n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);else i[e]=t;this.dirty(!0)}return this},getLineScale:function(){var e=this.transform;return e&&ul(e[0]-1)>1e-10&&ul(e[3]-1)>1e-10?Math.sqrt(ul(e[0]*e[3]-e[2]*e[1])):1}},cl.extend=function(e){var t=function(t){cl.call(this,t),e.style&&this.style.extendFrom(e.style,!1);var i=e.shape;if(i){this.shape=this.shape||{};var n=this.shape;for(var r in i)!n.hasOwnProperty(r)&&i.hasOwnProperty(r)&&(n[r]=i[r])}e.init&&e.init.call(this,t)};for(var i in al.inherits(t,cl),e)"style"!==i&&"shape"!==i&&(t.prototype[i]=e[i]);return t},al.inherits(cl,rl);var dl=cl,fl=Ds,pl=V.applyTransform,gl=fl.CMD,ml=[[],[],[]],vl=Math.sqrt,yl=Math.atan2,_l=function(e,t){var i,n,r,a,o,s=e.data,l=gl.M,u=gl.C,h=gl.L,c=gl.R,d=gl.A,f=gl.Q;for(r=0,a=0;r<s.length;){switch(i=s[r++],a=r,n=0,i){case l:case h:n=1;break;case u:n=3;break;case f:n=2;break;case d:var p=t[4],g=t[5],m=vl(t[0]*t[0]+t[1]*t[1]),v=vl(t[2]*t[2]+t[3]*t[3]),y=yl(-t[1]/v,t[0]/m);s[r]*=m,s[r++]+=p,s[r]*=v,s[r++]+=g,s[r++]*=m,s[r++]*=v,s[r++]+=y,s[r++]+=y,a=r+=2;break;case c:_[0]=s[r++],_[1]=s[r++],pl(_,_,t),s[a++]=_[0],s[a++]=_[1],_[0]+=s[r++],_[1]+=s[r++],pl(_,_,t),s[a++]=_[0],s[a++]=_[1]}for(o=0;o<n;o++){var _;(_=ml[o])[0]=s[r++],_[1]=s[r++],pl(_,_,t),s[a++]=_[0],s[a++]=_[1]}}},xl=dl,bl=Ds,wl=_l,Tl=Math.sqrt,Sl=Math.sin,Ml=Math.cos,Al=Math.PI,Il=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},Cl=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(Il(e)*Il(t))},Dl=function(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(Cl(e,t))};function El(e,t,i,n,r,a,o,s,l,u,h){var c=l*(Al/180),d=Ml(c)*(e-i)/2+Sl(c)*(t-n)/2,f=-1*Sl(c)*(e-i)/2+Ml(c)*(t-n)/2,p=d*d/(o*o)+f*f/(s*s);p>1&&(o*=Tl(p),s*=Tl(p));var g=(r===a?-1:1)*Tl((o*o*(s*s)-o*o*(f*f)-s*s*(d*d))/(o*o*(f*f)+s*s*(d*d)))||0,m=g*o*f/s,v=g*-s*d/o,y=(e+i)/2+Ml(c)*m-Sl(c)*v,_=(t+n)/2+Sl(c)*m+Ml(c)*v,x=Dl([1,0],[(d-m)/o,(f-v)/s]),b=[(d-m)/o,(f-v)/s],w=[(-1*d-m)/o,(-1*f-v)/s],T=Dl(b,w);Cl(b,w)<=-1&&(T=Al),Cl(b,w)>=1&&(T=0),0===a&&T>0&&(T-=2*Al),1===a&&T<0&&(T+=2*Al),h.addData(u,y,_,o,s,x,T,c,a)}var Ll=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Pl=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function Nl(e,t){var i=function(e){if(!e)return new bl;for(var t,i=0,n=0,r=i,a=n,o=new bl,s=bl.CMD,l=e.match(Ll),u=0;u<l.length;u++){for(var h,c=l[u],d=c.charAt(0),f=c.match(Pl)||[],p=f.length,g=0;g<p;g++)f[g]=parseFloat(f[g]);for(var m=0;m<p;){var v,y,_,x,b,w,T,S=i,M=n;switch(d){case"l":i+=f[m++],n+=f[m++],h=s.L,o.addData(h,i,n);break;case"L":i=f[m++],n=f[m++],h=s.L,o.addData(h,i,n);break;case"m":i+=f[m++],n+=f[m++],h=s.M,o.addData(h,i,n),r=i,a=n,d="l";break;case"M":i=f[m++],n=f[m++],h=s.M,o.addData(h,i,n),r=i,a=n,d="L";break;case"h":i+=f[m++],h=s.L,o.addData(h,i,n);break;case"H":i=f[m++],h=s.L,o.addData(h,i,n);break;case"v":n+=f[m++],h=s.L,o.addData(h,i,n);break;case"V":n=f[m++],h=s.L,o.addData(h,i,n);break;case"C":h=s.C,o.addData(h,f[m++],f[m++],f[m++],f[m++],f[m++],f[m++]),i=f[m-2],n=f[m-1];break;case"c":h=s.C,o.addData(h,f[m++]+i,f[m++]+n,f[m++]+i,f[m++]+n,f[m++]+i,f[m++]+n),i+=f[m-2],n+=f[m-1];break;case"S":v=i,y=n;var A=o.len(),I=o.data;t===s.C&&(v+=i-I[A-4],y+=n-I[A-3]),h=s.C,S=f[m++],M=f[m++],i=f[m++],n=f[m++],o.addData(h,v,y,S,M,i,n);break;case"s":v=i,y=n,A=o.len(),I=o.data,t===s.C&&(v+=i-I[A-4],y+=n-I[A-3]),h=s.C,S=i+f[m++],M=n+f[m++],i+=f[m++],n+=f[m++],o.addData(h,v,y,S,M,i,n);break;case"Q":S=f[m++],M=f[m++],i=f[m++],n=f[m++],h=s.Q,o.addData(h,S,M,i,n);break;case"q":S=f[m++]+i,M=f[m++]+n,i+=f[m++],n+=f[m++],h=s.Q,o.addData(h,S,M,i,n);break;case"T":v=i,y=n,A=o.len(),I=o.data,t===s.Q&&(v+=i-I[A-4],y+=n-I[A-3]),i=f[m++],n=f[m++],h=s.Q,o.addData(h,v,y,i,n);break;case"t":v=i,y=n,A=o.len(),I=o.data,t===s.Q&&(v+=i-I[A-4],y+=n-I[A-3]),i+=f[m++],n+=f[m++],h=s.Q,o.addData(h,v,y,i,n);break;case"A":_=f[m++],x=f[m++],b=f[m++],w=f[m++],T=f[m++],El(S=i,M=n,i=f[m++],n=f[m++],w,T,_,x,b,h=s.A,o);break;case"a":_=f[m++],x=f[m++],b=f[m++],w=f[m++],T=f[m++],El(S=i,M=n,i+=f[m++],n+=f[m++],w,T,_,x,b,h=s.A,o)}}"z"!==d&&"Z"!==d||(h=s.Z,o.addData(h),i=r,n=a),t=h}return o.toStatic(),o}(e);return(t=t||{}).buildPath=function(e){if(e.setData)e.setData(i.data),(t=e.getContext())&&e.rebuildPath(t);else{var t=e;i.rebuildPath(t)}},t.applyTransform=function(e){wl(i,e),this.dirty(!0)},t}Ro.createFromString=function(e,t){return new xl(Nl(e,t))},Ro.extendFromString=function(e,t){return xl.extend(Nl(e,t))},Ro.mergePath=function(e,t){for(var i=[],n=e.length,r=0;r<n;r++){var a=e[r];a.path||a.createPathProxy(),a.__dirtyPath&&a.buildPath(a.path,a.shape,!0),i.push(a.path)}var o=new xl(t);return o.createPathProxy(),o.buildPath=function(e){e.appendPath(i);var t=e.getContext();t&&e.rebuildPath(t)},o};var Rl=Wr,Ol=g,kl=Tn,zl=wn,Bl=$i.ContextCachedBy,Fl=function(e){Rl.call(this,e)};Fl.prototype={constructor:Fl,type:"text",brush:function(e,t){var i=this.style;this.__dirty&&zl.normalizeTextStyle(i,!0),i.fill=i.stroke=i.shadowBlur=i.shadowColor=i.shadowOffsetX=i.shadowOffsetY=null;var n=i.text;null!=n&&(n+=""),zl.needDrawText(n,i)?(this.setTransform(e),zl.renderText(this,e,n,i,null,t),this.restoreTransform(e)):e.__attrCachedBy=Bl.NONE},getBoundingRect:function(){var e=this.style;if(this.__dirty&&zl.normalizeTextStyle(e,!0),!this._rect){e.text;var t=kl.getBoundingRect(e.text+"",e.font,e.textAlign,e.textVerticalAlign,e.textPadding,e.textLineHeight,e.rich);if(t.x+=e.x||0,t.y+=e.y||0,zl.getStroke(e.textStroke,e.textStrokeWidth)){var i=e.textStrokeWidth;t.x-=i/2,t.y-=i/2,t.width+=i,t.height+=i}this._rect=t}return this._rect}},Ol.inherits(Fl,Rl);var Vl=Fl,Gl=dl.extend({type:"circle",shape:{cx:0,cy:0,r:0},buildPath:function(e,t,i){i&&e.moveTo(t.cx+t.r,t.cy),e.arc(t.cx,t.cy,t.r,0,2*Math.PI,!0)}}),Hl=p,Ul=[["shadowBlur",0],["shadowColor","#000"],["shadowOffsetX",0],["shadowOffsetY",0]],Wl=function(e){return Hl.browser.ie&&Hl.browser.version>=11?function(){var t,i=this.__clipPaths,n=this.style;if(i)for(var r=0;r<i.length;r++){var a=i[r],o=a&&a.shape,s=a&&a.type;if(o&&("sector"===s&&o.startAngle===o.endAngle||"rect"===s&&(!o.width||!o.height))){for(var l=0;l<Ul.length;l++)Ul[l][2]=n[Ul[l][0]],n[Ul[l][0]]=Ul[l][1];t=!0;break}}if(e.apply(this,arguments),t)for(l=0;l<Ul.length;l++)n[Ul[l][0]]=Ul[l][2]}:e},jl=dl,Xl=Wl,Zl=jl.extend({type:"sector",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},brush:Xl(jl.prototype.brush),buildPath:function(e,t){var i=t.cx,n=t.cy,r=Math.max(t.r0||0,0),a=Math.max(t.r,0),o=t.startAngle,s=t.endAngle,l=t.clockwise,u=Math.cos(o),h=Math.sin(o);e.moveTo(u*r+i,h*r+n),e.lineTo(u*a+i,h*a+n),e.arc(i,n,a,o,s,!l),e.lineTo(Math.cos(s)*r+i,Math.sin(s)*r+n),0!==r&&e.arc(i,n,r,s,o,l),e.closePath()}}),ql=dl.extend({type:"ring",shape:{cx:0,cy:0,r:0,r0:0},buildPath:function(e,t){var i=t.cx,n=t.cy,r=2*Math.PI;e.moveTo(i+t.r,n),e.arc(i,n,t.r,0,r,!1),e.moveTo(i+t.r0,n),e.arc(i,n,t.r0,0,r,!0)}}),Yl=ql,Kl={},Ql=V.distance;function Jl(e,t,i,n,r,a,o){var s=.5*(i-e),l=.5*(n-t);return(2*(t-i)+s+l)*o+(-3*(t-i)-2*s-l)*a+s*r+t}var $l=function(e,t){for(var i=e.length,n=[],r=0,a=1;a<i;a++)r+=Ql(e[a-1],e[a]);var o=r/2;for(o=o<i?i:o,a=0;a<o;a++){var s,l,u,h=a/(o-1)*(t?i:i-1),c=Math.floor(h),d=h-c,f=e[c%i];t?(s=e[(c-1+i)%i],l=e[(c+1)%i],u=e[(c+2)%i]):(s=e[0===c?c:c-1],l=e[c>i-2?i-1:c+1],u=e[c>i-3?i-1:c+2]);var p=d*d,g=d*p;n.push([Jl(s[0],f[0],l[0],u[0],d,p,g),Jl(s[1],f[1],l[1],u[1],d,p,g)])}return n},eu=V,tu=eu.min,iu=eu.max,nu=eu.scale,ru=eu.distance,au=eu.add,ou=eu.clone,su=eu.sub,lu=function(e,t,i,n){var r,a,o,s,l=[],u=[],h=[],c=[];if(n){o=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,f=e.length;d<f;d++)tu(o,o,e[d]),iu(s,s,e[d]);tu(o,o,n[0]),iu(s,s,n[1])}for(d=0,f=e.length;d<f;d++){var p=e[d];if(i)r=e[d?d-1:f-1],a=e[(d+1)%f];else{if(0===d||d===f-1){l.push(ou(e[d]));continue}r=e[d-1],a=e[d+1]}su(u,a,r),nu(u,u,t);var g=ru(p,r),m=ru(p,a),v=g+m;0!==v&&(g/=v,m/=v),nu(h,u,-g),nu(c,u,m);var y=au([],p,h),_=au([],p,c);n&&(iu(y,y,o),tu(y,y,s),iu(_,_,o),tu(_,_,s)),l.push(y),l.push(_)}return i&&l.push(l.shift()),l},uu=$l,hu=lu;Kl.buildPath=function(e,t,i){var n=t.points,r=t.smooth;if(n&&n.length>=2){if(r&&"spline"!==r){var a=hu(n,r,i,t.smoothConstraint);e.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(i?o:o-1);s++){var l=a[2*s],u=a[2*s+1],h=n[(s+1)%o];e.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{"spline"===r&&(n=uu(n,i)),e.moveTo(n[0][0],n[0][1]),s=1;for(var c=n.length;s<c;s++)e.lineTo(n[s][0],n[s][1])}i&&e.closePath()}};var cu=Kl,du=dl.extend({type:"polygon",shape:{points:null,smooth:!1,smoothConstraint:null},buildPath:function(e,t){cu.buildPath(e,t,!0)}}),fu=Kl,pu=dl.extend({type:"polyline",shape:{points:null,smooth:!1,smoothConstraint:null},style:{stroke:"#000",fill:null},buildPath:function(e,t){fu.buildPath(e,t,!1)}}),gu={},mu=Math.round;function vu(e,t,i){if(!t)return e;var n=mu(2*e);return(n+mu(t))%2==0?n/2:(n+(i?1:-1))/2}gu.subPixelOptimizeLine=function(e,t,i){if(t){var n=t.x1,r=t.x2,a=t.y1,o=t.y2;e.x1=n,e.x2=r,e.y1=a,e.y2=o;var s=i&&i.lineWidth;s&&(mu(2*n)===mu(2*r)&&(e.x1=e.x2=vu(n,s,!0)),mu(2*a)===mu(2*o)&&(e.y1=e.y2=vu(a,s,!0)))}},gu.subPixelOptimizeRect=function(e,t,i){if(t){var n=t.x,r=t.y,a=t.width,o=t.height;e.x=n,e.y=r,e.width=a,e.height=o;var s=i&&i.lineWidth;s&&(e.x=vu(n,s,!0),e.y=vu(r,s,!0),e.width=Math.max(vu(n+a,s,!1)-e.x,0===a?0:1),e.height=Math.max(vu(r+o,s,!1)-e.y,0===o?0:1))}},gu.subPixelOptimize=vu;var yu=dl,_u=er,xu=gu.subPixelOptimizeRect,bu={},wu=yu.extend({type:"rect",shape:{r:0,x:0,y:0,width:0,height:0},buildPath:function(e,t){var i,n,r,a;this.subPixelOptimize?(xu(bu,t,this.style),i=bu.x,n=bu.y,r=bu.width,a=bu.height,bu.r=t.r,t=bu):(i=t.x,n=t.y,r=t.width,a=t.height),t.r?_u.buildPath(e,t):e.rect(i,n,r,a),e.closePath()}}),Tu=dl,Su=gu.subPixelOptimizeLine,Mu={},Au=Tu.extend({type:"line",shape:{x1:0,y1:0,x2:0,y2:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i,n,r,a;this.subPixelOptimize?(Su(Mu,t,this.style),i=Mu.x1,n=Mu.y1,r=Mu.x2,a=Mu.y2):(i=t.x1,n=t.y1,r=t.x2,a=t.y2);var o=t.percent;0!==o&&(e.moveTo(i,n),o<1&&(r=i*(1-o)+r*o,a=n*(1-o)+a*o),e.lineTo(r,a))},pointAt:function(e){var t=this.shape;return[t.x1*(1-e)+t.x2*e,t.y1*(1-e)+t.y2*e]}}),Iu=dl,Cu=V,Du=Oo,Eu=Du.quadraticSubdivide,Lu=Du.cubicSubdivide,Pu=Du.quadraticAt,Nu=Du.cubicAt,Ru=Du.quadraticDerivativeAt,Ou=Du.cubicDerivativeAt,ku=[];function zu(e,t,i){var n=e.cpx2,r=e.cpy2;return null===n||null===r?[(i?Ou:Nu)(e.x1,e.cpx1,e.cpx2,e.x2,t),(i?Ou:Nu)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(i?Ru:Pu)(e.x1,e.cpx1,e.x2,t),(i?Ru:Pu)(e.y1,e.cpy1,e.y2,t)]}var Bu=Iu.extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i=t.x1,n=t.y1,r=t.x2,a=t.y2,o=t.cpx1,s=t.cpy1,l=t.cpx2,u=t.cpy2,h=t.percent;0!==h&&(e.moveTo(i,n),null==l||null==u?(h<1&&(Eu(i,o,r,h,ku),o=ku[1],r=ku[2],Eu(n,s,a,h,ku),s=ku[1],a=ku[2]),e.quadraticCurveTo(o,s,r,a)):(h<1&&(Lu(i,o,l,r,h,ku),o=ku[1],l=ku[2],r=ku[3],Lu(n,s,u,a,h,ku),s=ku[1],u=ku[2],a=ku[3]),e.bezierCurveTo(o,s,l,u,r,a)))},pointAt:function(e){return zu(this.shape,e,!1)},tangentAt:function(e){var t=zu(this.shape,e,!0);return Cu.normalize(t,t)}}),Fu=dl.extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i=t.cx,n=t.cy,r=Math.max(t.r,0),a=t.startAngle,o=t.endAngle,s=t.clockwise,l=Math.cos(a),u=Math.sin(a);e.moveTo(l*r+i,u*r+n),e.arc(i,n,r,a,o,!s)}}),Vu=dl,Gu=Vu.extend({type:"compound",shape:{paths:null},_updatePathDirty:function(){for(var e=this.__dirtyPath,t=this.shape.paths,i=0;i<t.length;i++)e=e||t[i].__dirtyPath;this.__dirtyPath=e,this.__dirty=this.__dirty||e},beforeBrush:function(){this._updatePathDirty();for(var e=this.shape.paths||[],t=this.getGlobalScale(),i=0;i<e.length;i++)e[i].path||e[i].createPathProxy(),e[i].path.setScale(t[0],t[1],e[i].segmentIgnoreThreshold)},buildPath:function(e,t){for(var i=t.paths||[],n=0;n<i.length;n++)i[n].buildPath(e,i[n].shape,!0)},afterBrush:function(){for(var e=this.shape.paths||[],t=0;t<e.length;t++)e[t].__dirtyPath=!1},getBoundingRect:function(){return this._updatePathDirty(),Vu.prototype.getBoundingRect.call(this)}}),Hu=Gu,Uu=function(e){this.colorStops=e||[]};Uu.prototype={constructor:Uu,addColorStop:function(e,t){this.colorStops.push({offset:e,color:t})}};var Wu=Uu,ju=g,Xu=Wu,Zu=function(e,t,i,n,r,a){this.x=null==e?0:e,this.y=null==t?0:t,this.x2=null==i?1:i,this.y2=null==n?0:n,this.type="linear",this.global=a||!1,Xu.call(this,r)};Zu.prototype={constructor:Zu},ju.inherits(Zu,Xu);var qu=Zu,Yu=g,Ku=Wu,Qu=function(e,t,i,n,r){this.x=null==e?.5:e,this.y=null==t?.5:t,this.r=null==i?.5:i,this.type="radial",this.global=r||!1,Ku.call(this,n)};Qu.prototype={constructor:Qu},Yu.inherits(Qu,Ku);var Ju=Qu,$u=g.inherits,eh=Wr,th=Pi;function ih(e){eh.call(this,e),this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.notClear=!0}ih.prototype.incremental=!0,ih.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.dirty(),this.notClear=!1},ih.prototype.addDisplayable=function(e,t){t?this._temporaryDisplayables.push(e):this._displayables.push(e),this.dirty()},ih.prototype.addDisplayables=function(e,t){t=t||!1;for(var i=0;i<e.length;i++)this.addDisplayable(e[i],t)},ih.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])},ih.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}},ih.prototype.brush=function(e,t){for(var i=this._cursor;i<this._displayables.length;i++)(n=this._displayables[i]).beforeBrush&&n.beforeBrush(e),n.brush(e,i===this._cursor?null:this._displayables[i-1]),n.afterBrush&&n.afterBrush(e);for(this._cursor=i,i=0;i<this._temporaryDisplayables.length;i++){var n;(n=this._temporaryDisplayables[i]).beforeBrush&&n.beforeBrush(e),n.brush(e,0===i?null:this._temporaryDisplayables[i-1]),n.afterBrush&&n.afterBrush(e)}this._temporaryDisplayables=[],this.notClear=!0};var nh=[];ih.prototype.getBoundingRect=function(){if(!this._rect){for(var e=new th(1/0,1/0,-1/0,-1/0),t=0;t<this._displayables.length;t++){var i=this._displayables[t],n=i.getBoundingRect().clone();i.needLocalTransform()&&n.applyTransform(i.getLocalTransform(nh)),e.union(n)}this._rect=e}return this._rect},ih.prototype.contain=function(e,t){var i=this.transformCoordToLocal(e,t);if(this.getBoundingRect().contain(i[0],i[1]))for(var n=0;n<this._displayables.length;n++)if(this._displayables[n].contain(e,t))return!0;return!1},$u(ih,eh);var rh=ih,ah=g,oh=Ro,sh=ut,lh=Ue,uh=V,hh=dl,ch=rt,dh=Kr;No.Image=dh;var fh=zi;No.Group=fh;var ph=Vl;No.Text=ph;var gh=Gl;No.Circle=gh;var mh=Zl;No.Sector=mh;var vh=Yl;No.Ring=vh;var yh=du;No.Polygon=yh;var _h=pu;No.Polyline=_h;var xh=wu;No.Rect=xh;var bh=Au;No.Line=bh;var wh=Bu;No.BezierCurve=wh;var Th=Fu;No.Arc=Th;var Sh=Hu;No.CompoundPath=Sh;var Mh=qu;No.LinearGradient=Mh;var Ah=Ju;No.RadialGradient=Ah;var Ih=Pi;No.BoundingRect=Ih;var Ch=rh;No.IncrementalDisplayable=Ch;var Dh=gu,Eh=Math.max,Lh=Math.min,Ph={},Nh="emphasis",Rh="normal",Oh=1,kh={},zh={};function Bh(e,t){zh[e]=t}function Fh(e,t,i,n){var r=oh.createFromString(e,t);return i&&("center"===n&&(i=Vh(i,r.getBoundingRect())),Hh(r,i)),r}function Vh(e,t){var i,n=t.width/t.height,r=e.height*n;return i=r<=e.width?e.height:(r=e.width)/n,{x:e.x+e.width/2-r/2,y:e.y+e.height/2-i/2,width:r,height:i}}var Gh=oh.mergePath;function Hh(e,t){if(e.applyTransform){var i=e.getBoundingRect().calculateTransform(t);e.applyTransform(i)}}var Uh=Dh.subPixelOptimize;function Wh(e){return null!=e&&"none"!==e}var jh=ah.createHashMap(),Xh=0;function Zh(e){var t=e.__hoverStl;if(t&&!e.__highlighted){var i=e.__zr,n=e.useHoverLayer&&i&&"canvas"===i.painter.type;if(e.__highlighted=n?"layer":"plain",!(e.isGroup||!i&&e.useHoverLayer)){var r=e,a=e.style;n&&(a=(r=i.addHover(e)).style),uc(a),n||function(e){if(e.__hoverStlDirty){e.__hoverStlDirty=!1;var t=e.__hoverStl;if(t){var i=e.__cachedNormalStl={};e.__cachedNormalZ2=e.z2;var n=e.style;for(var r in t)null!=t[r]&&(i[r]=n[r]);i.fill=n.fill,i.stroke=n.stroke}else e.__cachedNormalStl=e.__cachedNormalZ2=null}}(r),a.extendFrom(t),qh(a,t,"fill"),qh(a,t,"stroke"),lc(a),n||(e.dirty(!1),e.z2+=1)}}}function qh(e,t,i){!Wh(t[i])&&Wh(e[i])&&(e[i]=function(e){if("string"!=typeof e)return e;var t=jh.get(e);return t||(t=sh.lift(e,-.1),Xh<1e4&&(jh.set(e,t),Xh++)),t}(e[i]))}function Yh(e){var t=e.__highlighted;if(t&&(e.__highlighted=!1,!e.isGroup))if("layer"===t)e.__zr&&e.__zr.removeHover(e);else{var i=e.style,n=e.__cachedNormalStl;n&&(uc(i),e.setStyle(n),lc(i));var r=e.__cachedNormalZ2;null!=r&&e.z2-r==1&&(e.z2=r)}}function Kh(e,t,i){var n,r=Rh,a=Rh;e.__highlighted&&(r=Nh,n=!0),t(e,i),e.__highlighted&&(a=Nh,n=!0),e.isGroup&&e.traverse((function(e){!e.isGroup&&t(e,i)})),n&&e.__highDownOnUpdate&&e.__highDownOnUpdate(r,a)}function Qh(e,t){t=e.__hoverStl=!1!==t&&(e.hoverStyle||t||{}),e.__hoverStlDirty=!0,e.__highlighted&&(e.__cachedNormalStl=null,Yh(e),Zh(e))}function Jh(e){!ic(this,e)&&!this.__highByOuter&&Kh(this,Zh)}function $h(e){!ic(this,e)&&!this.__highByOuter&&Kh(this,Yh)}function ec(e){this.__highByOuter|=1<<(e||0),Kh(this,Zh)}function tc(e){!(this.__highByOuter&=~(1<<(e||0)))&&Kh(this,Yh)}function ic(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function nc(e,t){var i=!1===t;if(e.__highDownSilentOnTouch=e.highDownSilentOnTouch,e.__highDownOnUpdate=e.highDownOnUpdate,!i||e.__highDownDispatcher){var n=i?"off":"on";e[n]("mouseover",Jh)[n]("mouseout",$h),e[n]("emphasis",ec)[n]("normal",tc),e.__highByOuter=e.__highByOuter||0,e.__highDownDispatcher=!i}}function rc(e,t,i,n,r){return ac(e,t,n,r),i&&ah.extend(e,i),e}function ac(e,t,i,n){if((i=i||Ph).isRectText){var r;i.getTextPosition?r=i.getTextPosition(t,n):"outside"===(r=t.getShallow("position")||(n?null:"inside"))&&(r="top"),e.textPosition=r,e.textOffset=t.getShallow("offset");var a=t.getShallow("rotate");null!=a&&(a*=Math.PI/180),e.textRotation=a,e.textDistance=ah.retrieve2(t.getShallow("distance"),n?null:5)}var o,s=t.ecModel,l=s&&s.option.textStyle,u=function(e){for(var t;e&&e!==e.ecModel;){var i=(e.option||Ph).rich;if(i)for(var n in t=t||{},i)i.hasOwnProperty(n)&&(t[n]=1);e=e.parentModel}return t}(t);if(u)for(var h in o={},u)if(u.hasOwnProperty(h)){var c=t.getModel(["rich",h]);oc(o[h]={},c,l,i,n)}return e.rich=o,oc(e,t,l,i,n,!0),i.forceRich&&!i.textStyle&&(i.textStyle={}),e}function oc(e,t,i,n,r,a){i=!r&&i||Ph,e.textFill=sc(t.getShallow("color"),n)||i.color,e.textStroke=sc(t.getShallow("textBorderColor"),n)||i.textBorderColor,e.textStrokeWidth=ah.retrieve2(t.getShallow("textBorderWidth"),i.textBorderWidth),r||(a&&(e.insideRollbackOpt=n,lc(e)),null==e.textFill&&(e.textFill=n.autoColor)),e.fontStyle=t.getShallow("fontStyle")||i.fontStyle,e.fontWeight=t.getShallow("fontWeight")||i.fontWeight,e.fontSize=t.getShallow("fontSize")||i.fontSize,e.fontFamily=t.getShallow("fontFamily")||i.fontFamily,e.textAlign=t.getShallow("align"),e.textVerticalAlign=t.getShallow("verticalAlign")||t.getShallow("baseline"),e.textLineHeight=t.getShallow("lineHeight"),e.textWidth=t.getShallow("width"),e.textHeight=t.getShallow("height"),e.textTag=t.getShallow("tag"),a&&n.disableBox||(e.textBackgroundColor=sc(t.getShallow("backgroundColor"),n),e.textPadding=t.getShallow("padding"),e.textBorderColor=sc(t.getShallow("borderColor"),n),e.textBorderWidth=t.getShallow("borderWidth"),e.textBorderRadius=t.getShallow("borderRadius"),e.textBoxShadowColor=t.getShallow("shadowColor"),e.textBoxShadowBlur=t.getShallow("shadowBlur"),e.textBoxShadowOffsetX=t.getShallow("shadowOffsetX"),e.textBoxShadowOffsetY=t.getShallow("shadowOffsetY")),e.textShadowColor=t.getShallow("textShadowColor")||i.textShadowColor,e.textShadowBlur=t.getShallow("textShadowBlur")||i.textShadowBlur,e.textShadowOffsetX=t.getShallow("textShadowOffsetX")||i.textShadowOffsetX,e.textShadowOffsetY=t.getShallow("textShadowOffsetY")||i.textShadowOffsetY}function sc(e,t){return"auto"!==e?e:t&&t.autoColor?t.autoColor:null}function lc(e){var t,i=e.textPosition,n=e.insideRollbackOpt;if(n&&null==e.textFill){var r=n.autoColor,a=n.isRectText,o=n.useInsideStyle,s=!1!==o&&(!0===o||a&&i&&"string"==typeof i&&i.indexOf("inside")>=0),l=!s&&null!=r;(s||l)&&(t={textFill:e.textFill,textStroke:e.textStroke,textStrokeWidth:e.textStrokeWidth}),s&&(e.textFill="#fff",null==e.textStroke&&(e.textStroke=r,null==e.textStrokeWidth&&(e.textStrokeWidth=2))),l&&(e.textFill=r)}e.insideRollback=t}function uc(e){var t=e.insideRollback;t&&(e.textFill=t.textFill,e.textStroke=t.textStroke,e.textStrokeWidth=t.textStrokeWidth,e.insideRollback=null)}function hc(e,t,i,n,r,a){if("function"==typeof r&&(a=r,r=null),n&&n.isAnimationEnabled()){var o=e?"Update":"",s=n.getShallow("animationDuration"+o),l=n.getShallow("animationEasing"+o),u=n.getShallow("animationDelay"+o);"function"==typeof u&&(u=u(r,n.getAnimationDelayParams?n.getAnimationDelayParams(t,r):null)),"function"==typeof s&&(s=s(r)),s>0?t.animateTo(i,s,u||0,l,a,!!a):(t.stopAnimation(),t.attr(i),a&&a())}else t.stopAnimation(),t.attr(i),a&&a()}function cc(e,t,i,n,r){hc(!0,e,t,i,n,r)}function dc(e,t,i){return t&&!ah.isArrayLike(t)&&(t=ch.getLocalTransform(t)),i&&(t=lh.invert([],t)),uh.applyTransform([],e,t)}function fc(e,t,i,n,r,a,o,s){var l,u=i-e,h=n-t,c=o-r,d=s-a,f=pc(c,d,u,h);if((l=f)<=1e-6&&l>=-1e-6)return!1;var p=e-r,g=t-a,m=pc(p,g,u,h)/f;if(m<0||m>1)return!1;var v=pc(p,g,c,d)/f;return!(v<0||v>1)}function pc(e,t,i,n){return e*n-i*t}Bh("circle",gh),Bh("sector",mh),Bh("ring",vh),Bh("polygon",yh),Bh("polyline",_h),Bh("rect",xh),Bh("line",bh),Bh("bezierCurve",wh),Bh("arc",Th),No.Z2_EMPHASIS_LIFT=1,No.CACHED_LABEL_STYLE_PROPERTIES={color:"textFill",textBorderColor:"textStroke",textBorderWidth:"textStrokeWidth"},No.extendShape=function(e){return hh.extend(e)},No.extendPath=function(e,t){return oh.extendFromString(e,t)},No.registerShape=Bh,No.getShapeClass=function(e){if(zh.hasOwnProperty(e))return zh[e]},No.makePath=Fh,No.makeImage=function(e,t,i){var n=new dh({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if("center"===i){var r={width:e.width,height:e.height};n.setStyle(Vh(t,r))}}});return n},No.mergePath=Gh,No.resizePath=Hh,No.subPixelOptimizeLine=function(e){return Dh.subPixelOptimizeLine(e.shape,e.shape,e.style),e},No.subPixelOptimizeRect=function(e){return Dh.subPixelOptimizeRect(e.shape,e.shape,e.style),e},No.subPixelOptimize=Uh,No.setElementHoverStyle=Qh,No.setHoverStyle=function(e,t){nc(e,!0),Kh(e,Qh,t)},No.setAsHighDownDispatcher=nc,No.isHighDownDispatcher=function(e){return!(!e||!e.__highDownDispatcher)},No.getHighlightDigit=function(e){var t=kh[e];return null==t&&Oh<=32&&(t=kh[e]=Oh++),t},No.setLabelStyle=function(e,t,i,n,r,a,o){var s,l=(r=r||Ph).labelFetcher,u=r.labelDataIndex,h=r.labelDimIndex,c=r.labelProp,d=i.getShallow("show"),f=n.getShallow("show");(d||f)&&(l&&(s=l.getFormattedLabel(u,"normal",null,h,c)),null==s&&(s=ah.isFunction(r.defaultText)?r.defaultText(u,r):r.defaultText));var p=d?s:null,g=f?ah.retrieve2(l?l.getFormattedLabel(u,"emphasis",null,h,c):null,s):null;null==p&&null==g||(rc(e,i,a,r),rc(t,n,o,r,!0)),e.text=p,t.text=g},No.modifyLabelStyle=function(e,t,i){var n=e.style;t&&(uc(n),e.setStyle(t),lc(n)),n=e.__hoverStl,i&&n&&(uc(n),ah.extend(n,i),lc(n))},No.setTextStyle=rc,No.setText=function(e,t,i){var n,r={isRectText:!0};!1===i?n=!0:r.autoColor=i,ac(e,t,r,n)},No.getFont=function(e,t){var i=t&&t.getModel("textStyle");return ah.trim([e.fontStyle||i&&i.getShallow("fontStyle")||"",e.fontWeight||i&&i.getShallow("fontWeight")||"",(e.fontSize||i&&i.getShallow("fontSize")||12)+"px",e.fontFamily||i&&i.getShallow("fontFamily")||"sans-serif"].join(" "))},No.updateProps=cc,No.initProps=function(e,t,i,n,r){hc(!1,e,t,i,n,r)},No.getTransform=function(e,t){for(var i=lh.identity([]);e&&e!==t;)lh.mul(i,e.getLocalTransform(),i),e=e.parent;return i},No.applyTransform=dc,No.transformDirection=function(e,t,i){var n=0===t[4]||0===t[5]||0===t[0]?1:Math.abs(2*t[4]/t[0]),r=0===t[4]||0===t[5]||0===t[2]?1:Math.abs(2*t[4]/t[2]),a=["left"===e?-n:"right"===e?n:0,"top"===e?-r:"bottom"===e?r:0];return a=dc(a,t,i),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"},No.groupTransition=function(e,t,i,n){if(e&&t){var r,a=(r={},e.traverse((function(e){!e.isGroup&&e.anid&&(r[e.anid]=e)})),r);t.traverse((function(e){if(!e.isGroup&&e.anid){var t=a[e.anid];if(t){var n=o(e);e.attr(o(t)),cc(e,n,i,e.dataIndex)}}}))}function o(e){var t={position:uh.clone(e.position),rotation:e.rotation};return e.shape&&(t.shape=ah.extend({},e.shape)),t}},No.clipPointsByRect=function(e,t){return ah.map(e,(function(e){var i=e[0];i=Eh(i,t.x),i=Lh(i,t.x+t.width);var n=e[1];return n=Eh(n,t.y),[i,n=Lh(n,t.y+t.height)]}))},No.clipRectByRect=function(e,t){var i=Eh(e.x,t.x),n=Lh(e.x+e.width,t.x+t.width),r=Eh(e.y,t.y),a=Lh(e.y+e.height,t.y+t.height);if(n>=i&&a>=r)return{x:i,y:r,width:n-i,height:a-r}},No.createIcon=function(e,t,i){var n=(t=ah.extend({rectHover:!0},t)).style={strokeNoScale:!0};if(i=i||{x:-1,y:-1,width:2,height:2},e)return 0===e.indexOf("image://")?(n.image=e.slice(8),ah.defaults(n,i),new dh(t)):Fh(e.replace("path://",""),t,i,"center")},No.linePolygonIntersect=function(e,t,i,n,r){for(var a=0,o=r[r.length-1];a<r.length;a++){var s=r[a];if(fc(e,t,i,n,s[0],s[1],o[0],o[1]))return!0;o=s}},No.lineLineIntersect=fc;var gc=Tn,mc=No,vc=["textStyle","color"],yc={getTextColor:function(e){var t=this.ecModel;return this.getShallow("color")||(!e&&t?t.get(vc):null)},getFont:function(){return mc.getFont({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},getTextRect:function(e){return gc.getBoundingRect(e,this.getFont(),this.getShallow("align"),this.getShallow("verticalAlign")||this.getShallow("baseline"),this.getShallow("padding"),this.getShallow("lineHeight"),this.getShallow("rich"),this.getShallow("truncateText"))}},_c=yc,xc=Co([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["textPosition"],["textAlign"]]),bc={getItemStyle:function(e,t){var i=xc(this,e,t),n=this.getBorderLineDash();return n&&(i.lineDash=n),i},getBorderLineDash:function(){var e=this.get("borderType");return"solid"===e||null==e?null:"dashed"===e?[5,5]:[1,1]}},wc=g,Tc=p,Sc=lo.makeInner,Mc=xo,Ac=Mc.enableClassExtend,Ic=Mc.enableClassCheck,Cc=Eo,Dc=Po,Ec=_c,Lc=bc,Pc=wc.mixin,Nc=Sc();function Rc(e,t,i){this.parentModel=t,this.ecModel=i,this.option=e}function Oc(e,t,i){for(var n=0;n<t.length&&(!t[n]||null!=(e=e&&"object"==typeof e?e[t[n]]:null));n++);return null==e&&i&&(e=i.get(t)),e}function kc(e,t){var i=Nc(e).getParent;return i?i.call(e,t):e.parentModel}Rc.prototype={constructor:Rc,init:null,mergeOption:function(e){wc.merge(this.option,e,!0)},get:function(e,t){return null==e?this.option:Oc(this.option,this.parsePath(e),!t&&kc(this,e))},getShallow:function(e,t){var i=this.option,n=null==i?i:i[e],r=!t&&kc(this,e);return null==n&&r&&(n=r.getShallow(e)),n},getModel:function(e,t){var i;return new Rc(null==e?this.option:Oc(this.option,e=this.parsePath(e)),t=t||(i=kc(this,e))&&i.getModel(e),this.ecModel)},isEmpty:function(){return null==this.option},restoreData:function(){},clone:function(){return new(0,this.constructor)(wc.clone(this.option))},setReadOnly:function(e){},parsePath:function(e){return"string"==typeof e&&(e=e.split(".")),e},customizeGetParent:function(e){Nc(this).getParent=e},isAnimationEnabled:function(){if(!Tc.node){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}}},Ac(Rc),Ic(Rc),Pc(Rc,Cc),Pc(Rc,Dc),Pc(Rc,Ec),Pc(Rc,Lc);var zc=Rc,Bc={},Fc=g,Vc=xo.parseClassType,Gc=0;Bc.getUID=function(e){return[e||"",Gc++,Math.random().toFixed(5)].join("_")},Bc.enableSubTypeDefaulter=function(e){var t={};return e.registerSubTypeDefaulter=function(e,i){e=Vc(e),t[e.main]=i},e.determineSubType=function(i,n){var r=n.type;if(!r){var a=Vc(i).main;e.hasSubTypes(i)&&t[a]&&(r=t[a](n))}return r},e},Bc.enableTopologicalTravel=function(e,t){function i(e,t){return e[t]||(e[t]={predecessor:[],successor:[]}),e[t]}e.topologicalTravel=function(e,n,r,a){if(e.length){var o=function(e){var n={},r=[];return Fc.each(e,(function(a){var o=i(n,a),s=function(e,t){var i=[];return Fc.each(e,(function(e){Fc.indexOf(t,e)>=0&&i.push(e)})),i}(o.originalDeps=t(a),e);o.entryCount=s.length,0===o.entryCount&&r.push(a),Fc.each(s,(function(e){Fc.indexOf(o.predecessor,e)<0&&o.predecessor.push(e);var t=i(n,e);Fc.indexOf(t.successor,e)<0&&t.successor.push(a)}))})),{graph:n,noEntryList:r}}(n),s=o.graph,l=o.noEntryList,u={};for(Fc.each(e,(function(e){u[e]=!0}));l.length;){var h=l.pop(),c=s[h],d=!!u[h];d&&(r.call(a,h,c.originalDeps.slice()),delete u[h]),Fc.each(c.successor,d?p:f)}Fc.each(u,(function(){throw new Error("Circle dependency may exists")}))}function f(e){s[e].entryCount--,0===s[e].entryCount&&l.push(e)}function p(e){u[e]=!0,f(e)}}};var Hc={},Uc={},Wc=g,jc=1e-4,Xc=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function Zc(e){if(0===e)return 0;var t=Math.floor(Math.log(e)/Math.LN10);return e/Math.pow(10,t)>=10&&t++,t}Uc.linearMap=function(e,t,i,n){var r=t[1]-t[0],a=i[1]-i[0];if(0===r)return 0===a?i[0]:(i[0]+i[1])/2;if(n)if(r>0){if(e<=t[0])return i[0];if(e>=t[1])return i[1]}else{if(e>=t[0])return i[0];if(e<=t[1])return i[1]}else{if(e===t[0])return i[0];if(e===t[1])return i[1]}return(e-t[0])/r*a+i[0]},Uc.parsePercent=function(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"string"==typeof e?(i=e,i.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e;var i},Uc.round=function(e,t,i){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),i?e:+e},Uc.asc=function(e){return e.sort((function(e,t){return e-t})),e},Uc.getPrecision=function(e){if(e=+e,isNaN(e))return 0;for(var t=1,i=0;Math.round(e*t)/t!==e;)t*=10,i++;return i},Uc.getPrecisionSafe=function(e){var t=e.toString(),i=t.indexOf("e");if(i>0){var n=+t.slice(i+1);return n<0?-n:0}var r=t.indexOf(".");return r<0?0:t.length-1-r},Uc.getPixelPrecision=function(e,t){var i=Math.log,n=Math.LN10,r=Math.floor(i(e[1]-e[0])/n),a=Math.round(i(Math.abs(t[1]-t[0]))/n),o=Math.min(Math.max(-r+a,0),20);return isFinite(o)?o:20},Uc.getPercentWithPrecision=function(e,t,i){if(!e[t])return 0;var n=Wc.reduce(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===n)return 0;for(var r=Math.pow(10,i),a=Wc.map(e,(function(e){return(isNaN(e)?0:e)/n*r*100})),o=100*r,s=Wc.map(a,(function(e){return Math.floor(e)})),l=Wc.reduce(s,(function(e,t){return e+t}),0),u=Wc.map(a,(function(e,t){return e-s[t]}));l<o;){for(var h=Number.NEGATIVE_INFINITY,c=null,d=0,f=u.length;d<f;++d)u[d]>h&&(h=u[d],c=d);++s[c],u[c]=0,++l}return s[t]/r},Uc.MAX_SAFE_INTEGER=9007199254740991,Uc.remRadian=function(e){var t=2*Math.PI;return(e%t+t)%t},Uc.isRadianAroundZero=function(e){return e>-1e-4&&e<jc},Uc.parseDate=function(e){if(e instanceof Date)return e;if("string"==typeof e){var t=Xc.exec(e);if(!t)return new Date(NaN);if(t[8]){var i=+t[4]||0;return"Z"!==t[8].toUpperCase()&&(i-=t[8].slice(0,3)),new Date(Date.UTC(+t[1],+(t[2]||1)-1,+t[3]||1,i,+(t[5]||0),+t[6]||0,+t[7]||0))}return new Date(+t[1],+(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,+t[7]||0)}return null==e?new Date(NaN):new Date(Math.round(e))},Uc.quantity=function(e){return Math.pow(10,Zc(e))},Uc.quantityExponent=Zc,Uc.nice=function(e,t){var i=Zc(e),n=Math.pow(10,i),r=e/n;return e=(t?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*n,i>=-20?+e.toFixed(i<0?-i:0):e},Uc.quantile=function(e,t){var i=(e.length-1)*t+1,n=Math.floor(i),r=+e[n-1],a=i-n;return a?r+a*(e[n]-r):r},Uc.reformIntervals=function(e){e.sort((function(e,t){return s(e,t,0)?-1:1}));for(var t=-1/0,i=1,n=0;n<e.length;){for(var r=e[n].interval,a=e[n].close,o=0;o<2;o++)r[o]<=t&&(r[o]=t,a[o]=o?1:1-i),t=r[o],i=a[o];r[0]===r[1]&&a[0]*a[1]!=1?e.splice(n,1):n++}return e;function s(e,t,i){return e.interval[i]<t.interval[i]||e.interval[i]===t.interval[i]&&(e.close[i]-t.close[i]==(i?-1:1)||!i&&s(e,t,1))}},Uc.isNumeric=function(e){return e-parseFloat(e)>=0};var qc={},Yc=g,Kc=Tn,Qc=Uc,Jc=Yc.normalizeCssArray,$c=/([&<>"'])/g,ed={"&":"&","<":"<",">":">",'"':""","'":"'"};function td(e){return null==e?"":(e+"").replace($c,(function(e,t){return ed[t]}))}var id=["a","b","c","d","e","f","g"],nd=function(e,t){return"{"+e+(null==t?"":t)+"}"};function rd(e,t){return"0000".substr(0,t-(e+="").length)+e}var ad=Kc.truncateText;qc.addCommas=function(e){return isNaN(e)?"-":(e=(e+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")},qc.toCamelCase=function(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},qc.normalizeCssArray=Jc,qc.encodeHTML=td,qc.formatTpl=function(e,t,i){Yc.isArray(t)||(t=[t]);var n=t.length;if(!n)return"";for(var r=t[0].$vars||[],a=0;a<r.length;a++){var o=id[a];e=e.replace(nd(o),nd(o,0))}for(var s=0;s<n;s++)for(var l=0;l<r.length;l++){var u=t[s][r[l]];e=e.replace(nd(id[l],s),i?td(u):u)}return e},qc.formatTplSimple=function(e,t,i){return Yc.each(t,(function(t,n){e=e.replace("{"+n+"}",i?td(t):t)})),e},qc.getTooltipMarker=function(e,t){var i=(e=Yc.isString(e)?{color:e,extraCssText:t}:e||{}).color,n=e.type,r=(t=e.extraCssText,e.renderMode||"html"),a=e.markerId||"X";return i?"html"===r?"subItem"===n?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+td(i)+";"+(t||"")+'"></span>':'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:'+td(i)+";"+(t||"")+'"></span>':{renderMode:r,content:"{marker"+a+"|} ",style:{color:i}}:""},qc.formatTime=function(e,t,i){"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var n=Qc.parseDate(t),r=i?"UTC":"",a=n["get"+r+"FullYear"](),o=n["get"+r+"Month"]()+1,s=n["get"+r+"Date"](),l=n["get"+r+"Hours"](),u=n["get"+r+"Minutes"](),h=n["get"+r+"Seconds"](),c=n["get"+r+"Milliseconds"]();return e=e.replace("MM",rd(o,2)).replace("M",o).replace("yyyy",a).replace("yy",a%100).replace("dd",rd(s,2)).replace("d",s).replace("hh",rd(l,2)).replace("h",l).replace("mm",rd(u,2)).replace("m",u).replace("ss",rd(h,2)).replace("s",h).replace("SSS",rd(c,3))},qc.capitalFirst=function(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e},qc.truncateText=ad,qc.getTextBoundingRect=function(e){return Kc.getBoundingRect(e.text,e.font,e.textAlign,e.textVerticalAlign,e.textPadding,e.textLineHeight,e.rich,e.truncate)},qc.getTextRect=function(e,t,i,n,r,a,o,s){return Kc.getBoundingRect(e,t,i,n,r,s,a,o)},qc.windowOpen=function(e,t){if("_blank"===t||"blank"===t){var i=window.open();i.opener=null,i.location=e}else window.open(e,t)};var od=g,sd=Pi,ld=Uc.parsePercent,ud=qc,hd=od.each,cd=["left","right","top","bottom","width","height"],dd=[["width","left","right"],["height","top","bottom"]];function fd(e,t,i,n,r){var a=0,o=0;null==n&&(n=1/0),null==r&&(r=1/0);var s=0;t.eachChild((function(l,u){var h,c,d=l.position,f=l.getBoundingRect(),p=t.childAt(u+1),g=p&&p.getBoundingRect();if("horizontal"===e){var m=f.width+(g?-g.x+f.x:0);(h=a+m)>n||l.newline?(a=0,h=m,o+=s+i,s=f.height):s=Math.max(s,f.height)}else{var v=f.height+(g?-g.y+f.y:0);(c=o+v)>r||l.newline?(a+=s+i,o=0,c=v,s=f.width):s=Math.max(s,f.width)}l.newline||(d[0]=a,d[1]=o,"horizontal"===e?a=h+i:o=c+i)}))}var pd=fd,gd=od.curry(fd,"vertical"),md=od.curry(fd,"horizontal");function vd(e,t,i){i=ud.normalizeCssArray(i||0);var n=t.width,r=t.height,a=ld(e.left,n),o=ld(e.top,r),s=ld(e.right,n),l=ld(e.bottom,r),u=ld(e.width,n),h=ld(e.height,r),c=i[2]+i[0],d=i[1]+i[3],f=e.aspect;switch(isNaN(u)&&(u=n-s-d-a),isNaN(h)&&(h=r-l-c-o),null!=f&&(isNaN(u)&&isNaN(h)&&(f>n/r?u=.8*n:h=.8*r),isNaN(u)&&(u=f*h),isNaN(h)&&(h=u/f)),isNaN(a)&&(a=n-s-u-d),isNaN(o)&&(o=r-l-h-c),e.left||e.right){case"center":a=n/2-u/2-i[3];break;case"right":a=n-u-d}switch(e.top||e.bottom){case"middle":case"center":o=r/2-h/2-i[0];break;case"bottom":o=r-h-c}a=a||0,o=o||0,isNaN(u)&&(u=n-d-a-(s||0)),isNaN(h)&&(h=r-c-o-(l||0));var p=new sd(a+i[3],o+i[0],u,h);return p.margin=i,p}function yd(e,t){return t&&e&&hd(cd,(function(i){t.hasOwnProperty(i)&&(e[i]=t[i])})),e}Hc.LOCATION_PARAMS=cd,Hc.HV_NAMES=dd,Hc.box=pd,Hc.vbox=gd,Hc.hbox=md,Hc.getAvailableSize=function(e,t,i){var n=t.width,r=t.height,a=ld(e.x,n),o=ld(e.y,r),s=ld(e.x2,n),l=ld(e.y2,r);return(isNaN(a)||isNaN(parseFloat(e.x)))&&(a=0),(isNaN(s)||isNaN(parseFloat(e.x2)))&&(s=n),(isNaN(o)||isNaN(parseFloat(e.y)))&&(o=0),(isNaN(l)||isNaN(parseFloat(e.y2)))&&(l=r),i=ud.normalizeCssArray(i||0),{width:Math.max(s-a-i[1]-i[3],0),height:Math.max(l-o-i[0]-i[2],0)}},Hc.getLayoutRect=vd,Hc.positionElement=function(e,t,i,n,r){var a=!r||!r.hv||r.hv[0],o=!r||!r.hv||r.hv[1],s=r&&r.boundingMode||"all";if(a||o){var l;if("raw"===s)l="group"===e.type?new sd(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(l=e.getBoundingRect(),e.needLocalTransform()){var u=e.getLocalTransform();(l=l.clone()).applyTransform(u)}t=vd(od.defaults({width:l.width,height:l.height},t),i,n);var h=e.position,c=a?t.x-l.x:0,d=o?t.y-l.y:0;e.attr("position","raw"===s?[c,d]:[h[0]+c,h[1]+d])}},Hc.sizeCalculable=function(e,t){return null!=e[dd[t][0]]||null!=e[dd[t][1]]&&null!=e[dd[t][2]]},Hc.mergeLayoutParam=function(e,t,i){!od.isObject(i)&&(i={});var n=i.ignoreSize;!od.isArray(n)&&(n=[n,n]);var r=o(dd[0],0),a=o(dd[1],1);function o(i,r){var a={},o=0,u={},h=0;if(hd(i,(function(t){u[t]=e[t]})),hd(i,(function(e){s(t,e)&&(a[e]=u[e]=t[e]),l(a,e)&&o++,l(u,e)&&h++})),n[r])return l(t,i[1])?u[i[2]]=null:l(t,i[2])&&(u[i[1]]=null),u;if(2!==h&&o){if(o>=2)return a;for(var c=0;c<i.length;c++){var d=i[c];if(!s(a,d)&&s(e,d)){a[d]=e[d];break}}return a}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,i){hd(e,(function(e){t[e]=i[e]}))}u(dd[0],e,r),u(dd[1],e,a)},Hc.getLayoutParams=function(e){return yd({},e)},Hc.copyLayoutParams=yd;var _d={getBoxLayoutParams:function(){return{left:this.get("left"),top:this.get("top"),right:this.get("right"),bottom:this.get("bottom"),width:this.get("width"),height:this.get("height")}}},xd=g,bd=zc,wd=Bc,Td=xo,Sd=Td.enableClassManagement,Md=Td.parseClassType,Ad=lo.makeInner,Id=Hc,Cd=_d,Dd=Ad(),Ed=bd.extend({type:"component",id:"",name:"",mainType:"",subType:"",componentIndex:0,defaultOption:null,ecModel:null,dependentModels:[],uid:null,layoutMode:null,$constructor:function(e,t,i,n){bd.call(this,e,t,i,n),this.uid=wd.getUID("ec_cpt_model")},init:function(e,t,i,n){this.mergeDefaultAndTheme(e,i)},mergeDefaultAndTheme:function(e,t){var i=this.layoutMode,n=i?Id.getLayoutParams(e):{},r=t.getTheme();xd.merge(e,r.get(this.mainType)),xd.merge(e,this.getDefaultOption()),i&&Id.mergeLayoutParam(e,n,i)},mergeOption:function(e,t){xd.merge(this.option,e,!0);var i=this.layoutMode;i&&Id.mergeLayoutParam(this.option,e,i)},optionUpdated:function(e,t){},getDefaultOption:function(){var e=Dd(this);if(!e.defaultOption){for(var t=[],i=this.constructor;i;){var n=i.prototype.defaultOption;n&&t.push(n),i=i.superClass}for(var r={},a=t.length-1;a>=0;a--)r=xd.merge(r,t[a],!0);e.defaultOption=r}return e.defaultOption},getReferringComponents:function(e){return this.ecModel.queryComponents({mainType:e,index:this.get(e+"Index",!0),id:this.get(e+"Id",!0)})}});Sd(Ed,{registerWhenExtend:!0}),wd.enableSubTypeDefaulter(Ed),wd.enableTopologicalTravel(Ed,(function(e){var t=[];return xd.each(Ed.getClassesByMainType(e),(function(e){t=t.concat(e.prototype.dependencies||[])})),t=xd.map(t,(function(e){return Md(e).main})),"dataset"!==e&&xd.indexOf(t,"dataset")<=0&&t.unshift("dataset"),t})),xd.mixin(Ed,Cd);var Ld=Ed,Pd="";"undefined"!=typeof navigator&&(Pd=navigator.platform||"");var Nd={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],gradientColor:["#f6efa6","#d88273","#bf444c"],textStyle:{fontFamily:Pd.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,animation:"auto",animationDuration:1e3,animationDurationUpdate:300,animationEasing:"exponentialOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},Rd=lo,Od=Rd.makeInner,kd=Rd.normalizeToArray,zd=Od(),Bd={clearColorPalette:function(){zd(this).colorIdx=0,zd(this).colorNameMap={}},getColorFromPalette:function(e,t,i){var n=zd(t=t||this),r=n.colorIdx||0,a=n.colorNameMap=n.colorNameMap||{};if(a.hasOwnProperty(e))return a[e];var o=kd(this.get("color",!0)),s=this.get("colorLayer",!0),l=null!=i&&s?function(e,t){for(var i=e.length,n=0;n<i;n++)if(e[n].length>t)return e[n];return e[i-1]}(s,i):o;if((l=l||o)&&l.length){var u=l[r];return e&&(a[e]=u),n.colorIdx=(r+1)%l.length,u}}},Fd=Bd,Vd={},Gd={SOURCE_FORMAT_ORIGINAL:"original",SOURCE_FORMAT_ARRAY_ROWS:"arrayRows",SOURCE_FORMAT_OBJECT_ROWS:"objectRows",SOURCE_FORMAT_KEYED_COLUMNS:"keyedColumns",SOURCE_FORMAT_UNKNOWN:"unknown",SOURCE_FORMAT_TYPED_ARRAY:"typedArray",SERIES_LAYOUT_BY_COLUMN:"column",SERIES_LAYOUT_BY_ROW:"row"},Hd=g,Ud=Hd.createHashMap,Wd=Hd.isTypedArray,jd=xo.enableClassCheck,Xd=Gd,Zd=Xd.SOURCE_FORMAT_ORIGINAL,qd=Xd.SERIES_LAYOUT_BY_COLUMN,Yd=Xd.SOURCE_FORMAT_UNKNOWN,Kd=Xd.SOURCE_FORMAT_TYPED_ARRAY,Qd=Xd.SOURCE_FORMAT_KEYED_COLUMNS;function Jd(e){this.fromDataset=e.fromDataset,this.data=e.data||(e.sourceFormat===Qd?{}:[]),this.sourceFormat=e.sourceFormat||Yd,this.seriesLayoutBy=e.seriesLayoutBy||qd,this.dimensionsDefine=e.dimensionsDefine,this.encodeDefine=e.encodeDefine&&Ud(e.encodeDefine),this.startIndex=e.startIndex||0,this.dimensionsDetectCount=e.dimensionsDetectCount}Jd.seriesDataToSource=function(e){return new Jd({data:e,sourceFormat:Wd(e)?Kd:Zd,fromDataset:!1})},jd(Jd);var $d=Jd,ef=lo,tf=ef.makeInner,nf=ef.getDataItemValue,rf=g,af=rf.createHashMap,of=rf.each,sf=rf.map,lf=rf.isArray,uf=rf.isString,hf=rf.isObject,cf=rf.isTypedArray,df=rf.isArrayLike,ff=rf.extend;rf.assert;var pf=$d,gf=Gd,mf=gf.SOURCE_FORMAT_ORIGINAL,vf=gf.SOURCE_FORMAT_ARRAY_ROWS,yf=gf.SOURCE_FORMAT_OBJECT_ROWS,_f=gf.SOURCE_FORMAT_KEYED_COLUMNS,xf=gf.SOURCE_FORMAT_UNKNOWN,bf=gf.SOURCE_FORMAT_TYPED_ARRAY,wf=gf.SERIES_LAYOUT_BY_ROW,Tf={Must:1,Might:2,Not:3},Sf=tf();function Mf(e){if(e){var t=af();return sf(e,(function(e,i){if(null==(e=ff({},hf(e)?e:{name:e})).name)return e;e.name+="",null==e.displayName&&(e.displayName=e.name);var n=t.get(e.name);return n?e.name+="-"+n.count++:t.set(e.name,{count:1}),e}))}}function Af(e,t,i,n){if(null==n&&(n=1/0),t===wf)for(var r=0;r<i.length&&r<n;r++)e(i[r]?i[r][0]:null,r);else{var a=i[0]||[];for(r=0;r<a.length&&r<n;r++)e(a[r],r)}}function If(e){var t=e.option;if(!t.data)return e.ecModel.getComponent("dataset",t.datasetIndex||0)}function Cf(e,t,i,n,r,a){var o,s,l;if(cf(e))return Tf.Not;if(n){var u=n[a];hf(u)?(s=u.name,l=u.type):uf(u)&&(s=u)}if(null!=l)return"ordinal"===l?Tf.Must:Tf.Not;if(t===vf)if(i===wf){for(var h=e[a],c=0;c<(h||[]).length&&c<5;c++)if(null!=(o=g(h[r+c])))return o}else for(c=0;c<e.length&&c<5;c++){var d=e[r+c];if(d&&null!=(o=g(d[a])))return o}else if(t===yf){if(!s)return Tf.Not;for(c=0;c<e.length&&c<5;c++)if((f=e[c])&&null!=(o=g(f[s])))return o}else if(t===_f){if(!s)return Tf.Not;if(!(h=e[s])||cf(h))return Tf.Not;for(c=0;c<h.length&&c<5;c++)if(null!=(o=g(h[c])))return o}else if(t===mf)for(c=0;c<e.length&&c<5;c++){var f=e[c],p=nf(f);if(!lf(p))return Tf.Not;if(null!=(o=g(p[a])))return o}function g(e){var t=uf(e);return null!=e&&isFinite(e)&&""!==e?t?Tf.Might:Tf.Not:t&&"-"!==e?Tf.Must:void 0}return Tf.Not}Vd.BE_ORDINAL=Tf,Vd.detectSourceFormat=function(e){var t=e.option.source,i=xf;if(cf(t))i=bf;else if(lf(t)){0===t.length&&(i=vf);for(var n=0,r=t.length;n<r;n++){var a=t[n];if(null!=a){if(lf(a)){i=vf;break}if(hf(a)){i=yf;break}}}}else if(hf(t)){for(var o in t)if(t.hasOwnProperty(o)&&df(t[o])){i=_f;break}}else if(null!=t)throw new Error("Invalid data");Sf(e).sourceFormat=i},Vd.getSource=function(e){return Sf(e).source},Vd.resetSourceDefaulter=function(e){Sf(e).datasetMap=af()},Vd.prepareSource=function(e){var t=e.option,i=t.data,n=cf(i)?bf:mf,r=!1,a=t.seriesLayoutBy,o=t.sourceHeader,s=t.dimensions,l=If(e);if(l){var u=l.option;i=u.source,n=Sf(l).sourceFormat,r=!0,a=a||u.seriesLayoutBy,null==o&&(o=u.sourceHeader),s=s||u.dimensions}var h=function(e,t,i,n,r){if(!e)return{dimensionsDefine:Mf(r)};var a,o;if(t===vf)"auto"===n||null==n?Af((function(e){null!=e&&"-"!==e&&(uf(e)?null==o&&(o=1):o=0)}),i,e,10):o=n?1:0,r||1!==o||(r=[],Af((function(e,t){r[t]=null!=e?e:""}),i,e)),a=r?r.length:i===wf?e.length:e[0]?e[0].length:null;else if(t===yf)r||(r=function(e){for(var t,i=0;i<e.length&&!(t=e[i++]););if(t){var n=[];return of(t,(function(e,t){n.push(t)})),n}}(e));else if(t===_f)r||(r=[],of(e,(function(e,t){r.push(t)})));else if(t===mf){var s=nf(e[0]);a=lf(s)&&s.length||1}return{startIndex:o,dimensionsDefine:Mf(r),dimensionsDetectCount:a}}(i,n,a,o,s);Sf(e).source=new pf({data:i,fromDataset:r,seriesLayoutBy:a,sourceFormat:n,dimensionsDefine:h.dimensionsDefine,startIndex:h.startIndex,dimensionsDetectCount:h.dimensionsDetectCount,encodeDefine:t.encode})},Vd.makeSeriesEncodeForAxisCoordSys=function(e,t,i){var n={},r=If(t);if(!r||!e)return n;var a,o,s=[],l=[],u=t.ecModel,h=Sf(u).datasetMap,c=r.uid+"_"+i.seriesLayoutBy;e=e.slice(),of(e,(function(t,i){!hf(t)&&(e[i]={name:t}),"ordinal"===t.type&&null==a&&(a=i,o=p(e[i])),n[t.name]=[]}));var d=h.get(c)||h.set(c,{categoryWayDim:o,valueWayDim:0});function f(e,t,i){for(var n=0;n<i;n++)e.push(t+n)}function p(e){var t=e.dimsDef;return t?t.length:1}return of(e,(function(e,t){var i=e.name,r=p(e);if(null==a){var o=d.valueWayDim;f(n[i],o,r),f(l,o,r),d.valueWayDim+=r}else a===t?(f(n[i],0,r),f(s,0,r)):(o=d.categoryWayDim,f(n[i],o,r),f(l,o,r),d.categoryWayDim+=r)})),s.length&&(n.itemName=s),l.length&&(n.seriesName=l),n},Vd.makeSeriesEncodeForNameBased=function(e,t,i){var n={};if(!If(e))return n;var r,a=t.sourceFormat,o=t.dimensionsDefine;a!==yf&&a!==_f||of(o,(function(e,t){"name"===(hf(e)?e.name:e)&&(r=t)}));var s=function(){for(var e={},n={},s=[],l=0,u=Math.min(5,i);l<u;l++){var h=Cf(t.data,a,t.seriesLayoutBy,o,t.startIndex,l);s.push(h);var c=h===Tf.Not;if(c&&null==e.v&&l!==r&&(e.v=l),(null==e.n||e.n===e.v||!c&&s[e.n]===Tf.Not)&&(e.n=l),d(e)&&s[e.n]!==Tf.Not)return e;c||(h===Tf.Might&&null==n.v&&l!==r&&(n.v=l),null!=n.n&&n.n!==n.v||(n.n=l))}function d(e){return null!=e.v&&null!=e.n}return d(e)?e:d(n)?n:null}();if(s){n.value=s.v;var l=null!=r?r:s.n;n.itemName=[l],n.seriesName=[l]}return n},Vd.guessOrdinal=function(e,t){return Cf(e.data,e.sourceFormat,e.seriesLayoutBy,e.dimensionsDefine,e.startIndex,t)};var Df=g,Ef=Df.each,Lf=Df.filter,Pf=Df.map,Nf=Df.isArray,Rf=Df.indexOf,Of=Df.isObject,kf=Df.isString,zf=Df.createHashMap,Bf=Df.assert,Ff=Df.clone,Vf=Df.merge,Gf=Df.extend,Hf=Df.mixin,Uf=lo,Wf=zc,jf=Ld,Xf=Nd,Zf=Fd,qf=Vd.resetSourceDefaulter,Yf="\0_ec_inner",Kf=Wf.extend({init:function(e,t,i,n){i=i||{},this.option=null,this._theme=new Wf(i),this._optionManager=n},setOption:function(e,t){Bf(!(Yf in e),"please use chart.getOption()"),this._optionManager.setOption(e,t),this.resetOption(null)},resetOption:function(e){var t=!1,i=this._optionManager;if(!e||"recreate"===e){var n=i.mountOption("recreate"===e);this.option&&"recreate"!==e?(this.restoreData(),this.mergeOption(n)):Qf.call(this,n),t=!0}if("timeline"!==e&&"media"!==e||this.restoreData(),!e||"recreate"===e||"timeline"===e){var r=i.getTimelineOption(this);r&&(this.mergeOption(r),t=!0)}if(!e||"recreate"===e||"media"===e){var a=i.getMediaOption(this,this._api);a.length&&Ef(a,(function(e){this.mergeOption(e,t=!0)}),this)}return t},mergeOption:function(e){var t=this.option,i=this._componentsMap,n=[];qf(this),Ef(e,(function(e,i){null!=e&&(jf.hasClass(i)?i&&n.push(i):t[i]=null==t[i]?Ff(e):Vf(t[i],e,!0))})),jf.topologicalTravel(n,jf.getAllClassMainTypes(),(function(n,r){var a=Uf.normalizeToArray(e[n]),o=Uf.mappingToExists(i.get(n),a);Uf.makeIdAndName(o),Ef(o,(function(e,t){var i=e.option;Of(i)&&(e.keyInfo.mainType=n,e.keyInfo.subType=function(e,t,i){return t.type?t.type:i?i.subType:jf.determineSubType(e,t)}(n,i,e.exist))}));var s=function(e,t){Nf(t)||(t=t?[t]:[]);var i={};return Ef(t,(function(t){i[t]=(e.get(t)||[]).slice()})),i}(i,r);t[n]=[],i.set(n,[]),Ef(o,(function(e,r){var a=e.exist,o=e.option;if(Bf(Of(o)||a,"Empty component definition"),o){var l=jf.getClass(n,e.keyInfo.subType,!0);if(a&&a.constructor===l)a.name=e.keyInfo.name,a.mergeOption(o,this),a.optionUpdated(o,!1);else{var u=Gf({dependentModels:s,componentIndex:r},e.keyInfo);a=new l(o,this,this,u),Gf(a,u),a.init(o,this,this,u),a.optionUpdated(null,!0)}}else a.mergeOption({},this),a.optionUpdated({},!1);i.get(n)[r]=a,t[n][r]=a.option}),this),"series"===n&&Jf(this,i.get("series"))}),this),this._seriesIndicesMap=zf(this._seriesIndices=this._seriesIndices||[])},getOption:function(){var e=Ff(this.option);return Ef(e,(function(t,i){if(jf.hasClass(i)){for(var n=(t=Uf.normalizeToArray(t)).length-1;n>=0;n--)Uf.isIdInner(t[n])&&t.splice(n,1);e[i]=t}})),delete e["\0_ec_inner"],e},getTheme:function(){return this._theme},getComponent:function(e,t){var i=this._componentsMap.get(e);if(i)return i[t||0]},queryComponents:function(e){var t=e.mainType;if(!t)return[];var i,n=e.index,r=e.id,a=e.name,o=this._componentsMap.get(t);if(!o||!o.length)return[];if(null!=n)Nf(n)||(n=[n]),i=Lf(Pf(n,(function(e){return o[e]})),(function(e){return!!e}));else if(null!=r){var s=Nf(r);i=Lf(o,(function(e){return s&&Rf(r,e.id)>=0||!s&&e.id===r}))}else if(null!=a){var l=Nf(a);i=Lf(o,(function(e){return l&&Rf(a,e.name)>=0||!l&&e.name===a}))}else i=o.slice();return $f(i,e)},findComponents:function(e){var t,i,n,r,a,o=e.query,s=e.mainType,l=(i=s+"Index",n=s+"Id",r=s+"Name",!(t=o)||null==t[i]&&null==t[n]&&null==t[r]?null:{mainType:s,index:t[i],id:t[n],name:t[r]}),u=l?this.queryComponents(l):this._componentsMap.get(s);return a=$f(u,e),e.filter?Lf(a,e.filter):a},eachComponent:function(e,t,i){var n=this._componentsMap;if("function"==typeof e)i=t,t=e,n.each((function(e,n){Ef(e,(function(e,r){t.call(i,n,e,r)}))}));else if(kf(e))Ef(n.get(e),t,i);else if(Of(e)){var r=this.findComponents(e);Ef(r,t,i)}},getSeriesByName:function(e){var t=this._componentsMap.get("series");return Lf(t,(function(t){return t.name===e}))},getSeriesByIndex:function(e){return this._componentsMap.get("series")[e]},getSeriesByType:function(e){var t=this._componentsMap.get("series");return Lf(t,(function(t){return t.subType===e}))},getSeries:function(){return this._componentsMap.get("series").slice()},getSeriesCount:function(){return this._componentsMap.get("series").length},eachSeries:function(e,t){Ef(this._seriesIndices,(function(i){var n=this._componentsMap.get("series")[i];e.call(t,n,i)}),this)},eachRawSeries:function(e,t){Ef(this._componentsMap.get("series"),e,t)},eachSeriesByType:function(e,t,i){Ef(this._seriesIndices,(function(n){var r=this._componentsMap.get("series")[n];r.subType===e&&t.call(i,r,n)}),this)},eachRawSeriesByType:function(e,t,i){return Ef(this.getSeriesByType(e),t,i)},isSeriesFiltered:function(e){return null==this._seriesIndicesMap.get(e.componentIndex)},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(e,t){Jf(this,Lf(this._componentsMap.get("series"),e,t))},restoreData:function(e){var t=this._componentsMap;Jf(this,t.get("series"));var i=[];t.each((function(e,t){i.push(t)})),jf.topologicalTravel(i,jf.getAllClassMainTypes(),(function(i,n){Ef(t.get(i),(function(t){("series"!==i||!function(e,t){if(t){var i=t.seiresIndex,n=t.seriesId,r=t.seriesName;return null!=i&&e.componentIndex!==i||null!=n&&e.id!==n||null!=r&&e.name!==r}}(t,e))&&t.restoreData()}))}))}});function Qf(e){e=e,this.option={},this.option["\0_ec_inner"]=1,this._componentsMap=zf({series:[]}),this._seriesIndices,this._seriesIndicesMap,function(e,t){var i=e.color&&!e.colorLayer;Ef(t,(function(t,n){"colorLayer"===n&&i||jf.hasClass(n)||("object"==typeof t?e[n]=e[n]?Vf(e[n],t,!1):Ff(t):null==e[n]&&(e[n]=t))}))}(e,this._theme.option),Vf(e,Xf,!1),this.mergeOption(e)}function Jf(e,t){e._seriesIndicesMap=zf(e._seriesIndices=Pf(t,(function(e){return e.componentIndex}))||[])}function $f(e,t){return t.hasOwnProperty("subType")?Lf(e,(function(e){return e.subType===t.subType})):e}Hf(Kf,Zf);var ep=Kf,tp=g,ip=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"],np=function(e){tp.each(ip,(function(t){this[t]=tp.bind(e[t],e)}),this)},rp=g,ap={};function op(){this._coordinateSystems=[]}op.prototype={constructor:op,create:function(e,t){var i=[];rp.each(ap,(function(n,r){var a=n.create(e,t);i=i.concat(a||[])})),this._coordinateSystems=i},update:function(e,t){rp.each(this._coordinateSystems,(function(i){i.update&&i.update(e,t)}))},getCoordinateSystems:function(){return this._coordinateSystems.slice()}},op.register=function(e,t){ap[e]=t},op.get=function(e){return ap[e]};var sp=op,lp=g,up=lo,hp=Ld,cp=lp.each,dp=lp.clone,fp=lp.map,pp=lp.merge,gp=/^(min|max)?(.+)$/;function mp(e){this._api=e,this._timelineOptions=[],this._mediaList=[],this._mediaDefault,this._currentMediaIndices=[],this._optionBackup,this._newBaseOption}function vp(e,t,i){var n,r,a=[],o=[],s=e.timeline;if(e.baseOption&&(r=e.baseOption),(s||e.options)&&(r=r||{},a=(e.options||[]).slice()),e.media){r=r||{};var l=e.media;cp(l,(function(e){e&&e.option&&(e.query?o.push(e):n||(n=e))}))}return r||(r=e),r.timeline||(r.timeline=s),cp([r].concat(a).concat(lp.map(o,(function(e){return e.option}))),(function(e){cp(t,(function(t){t(e,i)}))})),{baseOption:r,timelineOptions:a,mediaDefault:n,mediaList:o}}function yp(e,t,i){var n={width:t,height:i,aspectratio:t/i},r=!0;return lp.each(e,(function(e,t){var i=t.match(gp);if(i&&i[1]&&i[2]){var a=i[1],o=i[2].toLowerCase();(function(e,t,i){return"min"===i?e>=t:"max"===i?e<=t:e===t})(n[o],e,a)||(r=!1)}})),r}mp.prototype={constructor:mp,setOption:function(e,t){e&&lp.each(up.normalizeToArray(e.series),(function(e){e&&e.data&&lp.isTypedArray(e.data)&&lp.setAsPrimitive(e.data)})),e=dp(e);var i,n,r=this._optionBackup,a=vp.call(this,e,t,!r);this._newBaseOption=a.baseOption,r?(i=r.baseOption,n=a.baseOption,cp(n=n||{},(function(e,t){if(null!=e){var n=i[t];if(hp.hasClass(t)){e=up.normalizeToArray(e),n=up.normalizeToArray(n);var r=up.mappingToExists(n,e);i[t]=fp(r,(function(e){return e.option&&e.exist?pp(e.exist,e.option,!0):e.exist||e.option}))}else i[t]=pp(n,e,!0)}})),a.timelineOptions.length&&(r.timelineOptions=a.timelineOptions),a.mediaList.length&&(r.mediaList=a.mediaList),a.mediaDefault&&(r.mediaDefault=a.mediaDefault)):this._optionBackup=a},mountOption:function(e){var t=this._optionBackup;return this._timelineOptions=fp(t.timelineOptions,dp),this._mediaList=fp(t.mediaList,dp),this._mediaDefault=dp(t.mediaDefault),this._currentMediaIndices=[],dp(e?t.baseOption:this._newBaseOption)},getTimelineOption:function(e){var t,i=this._timelineOptions;if(i.length){var n=e.getComponent("timeline");n&&(t=dp(i[n.getCurrentIndex()],!0))}return t},getMediaOption:function(e){var t,i,n=this._api.getWidth(),r=this._api.getHeight(),a=this._mediaList,o=this._mediaDefault,s=[],l=[];if(!a.length&&!o)return l;for(var u=0,h=a.length;u<h;u++)yp(a[u].query,n,r)&&s.push(u);return!s.length&&o&&(s=[-1]),s.length&&(t=s,i=this._currentMediaIndices,t.join(",")!==i.join(","))&&(l=fp(s,(function(e){return dp(-1===e?o.option:a[e].option)}))),this._currentMediaIndices=s,l}};var _p=mp,xp=g,bp=lo,wp=xp.each,Tp=xp.isObject,Sp=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Mp(e){var t=e&&e.itemStyle;if(t)for(var i=0,n=Sp.length;i<n;i++){var r=Sp[i],a=t.normal,o=t.emphasis;a&&a[r]&&(e[r]=e[r]||{},e[r].normal?xp.merge(e[r].normal,a[r]):e[r].normal=a[r],a[r]=null),o&&o[r]&&(e[r]=e[r]||{},e[r].emphasis?xp.merge(e[r].emphasis,o[r]):e[r].emphasis=o[r],o[r]=null)}}function Ap(e,t,i){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var n=e[t].normal,r=e[t].emphasis;n&&(i?(e[t].normal=e[t].emphasis=null,xp.defaults(e[t],n)):e[t]=n),r&&(e.emphasis=e.emphasis||{},e.emphasis[t]=r)}}function Ip(e){Ap(e,"itemStyle"),Ap(e,"lineStyle"),Ap(e,"areaStyle"),Ap(e,"label"),Ap(e,"labelLine"),Ap(e,"upperLabel"),Ap(e,"edgeLabel")}function Cp(e,t){var i=Tp(e)&&e[t],n=Tp(i)&&i.textStyle;if(n)for(var r=0,a=bp.TEXT_STYLE_OPTIONS.length;r<a;r++)t=bp.TEXT_STYLE_OPTIONS[r],n.hasOwnProperty(t)&&(i[t]=n[t])}function Dp(e){e&&(Ip(e),Cp(e,"label"),e.emphasis&&Cp(e.emphasis,"label"))}function Ep(e){return xp.isArray(e)?e:e?[e]:[]}function Lp(e){return(xp.isArray(e)?e[0]:e)||{}}var Pp=function(e,t){wp(Ep(e.series),(function(e){Tp(e)&&function(e){if(Tp(e)){Mp(e),Ip(e),Cp(e,"label"),Cp(e,"upperLabel"),Cp(e,"edgeLabel"),e.emphasis&&(Cp(e.emphasis,"label"),Cp(e.emphasis,"upperLabel"),Cp(e.emphasis,"edgeLabel")),(i=e.markPoint)&&(Mp(i),Dp(i)),(n=e.markLine)&&(Mp(n),Dp(n));var t=e.markArea;t&&Dp(t);var i,n,r=e.data;if("graph"===e.type){r=r||e.nodes;var a=e.links||e.edges;if(a&&!xp.isTypedArray(a))for(var o=0;o<a.length;o++)Dp(a[o]);xp.each(e.categories,(function(e){Ip(e)}))}if(r&&!xp.isTypedArray(r))for(o=0;o<r.length;o++)Dp(r[o]);if((i=e.markPoint)&&i.data){var s=i.data;for(o=0;o<s.length;o++)Dp(s[o])}if((n=e.markLine)&&n.data){var l=n.data;for(o=0;o<l.length;o++)xp.isArray(l[o])?(Dp(l[o][0]),Dp(l[o][1])):Dp(l[o])}"gauge"===e.type?(Cp(e,"axisLabel"),Cp(e,"title"),Cp(e,"detail")):"treemap"===e.type?(Ap(e.breadcrumb,"itemStyle"),xp.each(e.levels,(function(e){Ip(e)}))):"tree"===e.type&&Ip(e.leaves)}}(e)}));var i=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];t&&i.push("valueAxis","categoryAxis","logAxis","timeAxis"),wp(i,(function(t){wp(Ep(e[t]),(function(e){e&&(Cp(e,"axisLabel"),Cp(e.axisPointer,"label"))}))})),wp(Ep(e.parallel),(function(e){var t=e&&e.parallelAxisDefault;Cp(t,"axisLabel"),Cp(t&&t.axisPointer,"label")})),wp(Ep(e.calendar),(function(e){Ap(e,"itemStyle"),Cp(e,"dayLabel"),Cp(e,"monthLabel"),Cp(e,"yearLabel")})),wp(Ep(e.radar),(function(e){Cp(e,"name")})),wp(Ep(e.geo),(function(e){Tp(e)&&(Dp(e),wp(Ep(e.regions),(function(e){Dp(e)})))})),wp(Ep(e.timeline),(function(e){Dp(e),Ap(e,"label"),Ap(e,"itemStyle"),Ap(e,"controlStyle",!0);var t=e.data;xp.isArray(t)&&xp.each(t,(function(e){xp.isObject(e)&&(Ap(e,"label"),Ap(e,"itemStyle"))}))})),wp(Ep(e.toolbox),(function(e){Ap(e,"iconStyle"),wp(e.feature,(function(e){Ap(e,"iconStyle")}))})),Cp(Lp(e.axisPointer),"label"),Cp(Lp(e.tooltip).axisPointer,"label")},Np=g,Rp=Np.each,Op=Np.isArray,kp=Np.isObject,zp=Pp,Bp=lo.normalizeToArray;function Fp(e){Rp(Vp,(function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])}))}var Vp=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],Gp=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],Hp=function(e,t){zp(e,t),e.series=Bp(e.series),Rp(e.series,(function(e){if(kp(e)){var t=e.type;if("line"===t)null!=e.clipOverflow&&(e.clip=e.clipOverflow);else if("pie"===t||"gauge"===t)null!=e.clockWise&&(e.clockwise=e.clockWise);else if("gauge"===t){var i=function(e,t){t=t.split(",");for(var i=e,n=0;n<t.length&&null!=(i=i&&i[t[n]]);n++);return i}(e,"pointer.color");null!=i&&function(e,t,i,n){t=t.split(",");for(var r,a=e,o=0;o<t.length-1;o++)null==a[r=t[o]]&&(a[r]={}),a=a[r];(n||null==a[t[o]])&&(a[t[o]]=i)}(e,"itemStyle.color",i)}Fp(e)}})),e.dataRange&&(e.visualMap=e.dataRange),Rp(Gp,(function(t){var i=e[t];i&&(Op(i)||(i=[i]),Rp(i,(function(e){Fp(e)})))}))},Up=g,Wp=Up.createHashMap,jp=Up.each;function Xp(e){jp(e,(function(t,i){var n=[],r=[NaN,NaN],a=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,l=o.map(a,(function(a,l,u){var h,c,d=o.get(t.stackedDimension,u);if(isNaN(d))return r;s?c=o.getRawIndex(u):h=o.get(t.stackedByDimension,u);for(var f=NaN,p=i-1;p>=0;p--){var g=e[p];if(s||(c=g.data.rawIndexOf(g.stackedByDimension,h)),c>=0){var m=g.data.getByRawIndex(g.stackResultDimension,c);if(d>=0&&m>0||d<=0&&m<0){d+=m,f=m;break}}}return n[0]=d,n[1]=f,n}));o.hostModel.setData(l),t.data=l}))}var Zp=function(e){var t=Wp();e.eachSeries((function(e){var i=e.get("stack");if(i){var n=t.get(i)||t.set(i,[]),r=e.getData(),a={stackResultDimension:r.getCalculationInfo("stackResultDimension"),stackedOverDimension:r.getCalculationInfo("stackedOverDimension"),stackedDimension:r.getCalculationInfo("stackedDimension"),stackedByDimension:r.getCalculationInfo("stackedByDimension"),isStackedByIndex:r.getCalculationInfo("isStackedByIndex"),data:r,seriesModel:e};if(!a.stackedDimension||!a.isStackedByIndex&&!a.stackedByDimension)return;n.length&&r.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(a)}})),t.each(Xp)},qp={},Yp=g;Yp.isTypedArray;var Kp=Yp.extend;Yp.assert;var Qp=Yp.each,Jp=Yp.isObject,$p=lo,eg=$p.getDataItemValue,tg=$p.isDataItemOption,ig=Uc.parseDate,ng=$d,rg=Gd,ag=rg.SOURCE_FORMAT_TYPED_ARRAY,og=rg.SOURCE_FORMAT_ARRAY_ROWS,sg=rg.SOURCE_FORMAT_ORIGINAL,lg=rg.SOURCE_FORMAT_OBJECT_ROWS;function ug(e,t){ng.isInstance(e)||(e=ng.seriesDataToSource(e)),this._source=e;var i=this._data=e.data,n=e.sourceFormat;n===ag&&(this._offset=0,this._dimSize=t,this._data=i);var r=cg[n===og?n+"_"+e.seriesLayoutBy:n];Kp(this,r)}var hg=ug.prototype;hg.pure=!1,hg.persistent=!0,hg.getSource=function(){return this._source};var cg={arrayRows_column:{pure:!0,count:function(){return Math.max(0,this._data.length-this._source.startIndex)},getItem:function(e){return this._data[e+this._source.startIndex]},appendData:pg},arrayRows_row:{pure:!0,count:function(){var e=this._data[0];return e?Math.max(0,e.length-this._source.startIndex):0},getItem:function(e){e+=this._source.startIndex;for(var t=[],i=this._data,n=0;n<i.length;n++){var r=i[n];t.push(r?r[e]:null)}return t},appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},objectRows:{pure:!0,count:dg,getItem:fg,appendData:pg},keyedColumns:{pure:!0,count:function(){var e=this._source.dimensionsDefine[0].name,t=this._data[e];return t?t.length:0},getItem:function(e){for(var t=[],i=this._source.dimensionsDefine,n=0;n<i.length;n++){var r=this._data[i[n].name];t.push(r?r[e]:null)}return t},appendData:function(e){var t=this._data;Qp(e,(function(e,i){for(var n=t[i]||(t[i]=[]),r=0;r<(e||[]).length;r++)n.push(e[r])}))}},original:{count:dg,getItem:fg,appendData:pg},typedArray:{persistent:!1,pure:!0,count:function(){return this._data?this._data.length/this._dimSize:0},getItem:function(e,t){e-=this._offset,t=t||[];for(var i=this._dimSize*e,n=0;n<this._dimSize;n++)t[n]=this._data[i+n];return t},appendData:function(e){this._data=e},clean:function(){this._offset+=this.count(),this._data=null}}};function dg(){return this._data.length}function fg(e){return this._data[e]}function pg(e){for(var t=0;t<e.length;t++)this._data.push(e[t])}var gg={arrayRows:mg,objectRows:function(e,t,i,n){return null!=i?e[n]:e},keyedColumns:mg,original:function(e,t,i,n){var r=eg(e);return null!=i&&r instanceof Array?r[i]:r},typedArray:mg};function mg(e,t,i,n){return null!=i?e[i]:e}var vg={arrayRows:yg,objectRows:function(e,t,i,n){return _g(e[t],this._dimensionInfos[t])},keyedColumns:yg,original:function(e,t,i,n){var r=e&&(null==e.value?e:e.value);return!this._rawData.pure&&tg(e)&&(this.hasItemOption=!0),_g(r instanceof Array?r[n]:r,this._dimensionInfos[t])},typedArray:function(e,t,i,n){return e[n]}};function yg(e,t,i,n){return _g(e[n],this._dimensionInfos[t])}function _g(e,t){var i=t&&t.type;if("ordinal"===i){var n=t&&t.ordinalMeta;return n?n.parseAndCollect(e):e}return"time"===i&&"number"!=typeof e&&null!=e&&"-"!==e&&(e=+ig(e)),null==e||""===e?NaN:+e}qp.DefaultDataProvider=ug,qp.defaultDimValueGetters=vg,qp.retrieveRawValue=function(e,t,i){if(e){var n=e.getRawDataItem(t);if(null!=n){var r,a,o=e.getProvider().getSource().sourceFormat,s=e.getDimensionInfo(i);return s&&(r=s.name,a=s.index),gg[o](n,t,a,r)}}},qp.retrieveRawAttr=function(e,t,i){if(e){var n=e.getProvider().getSource().sourceFormat;if(n===sg||n===lg){var r=e.getRawDataItem(t);return n!==sg||Jp(r)||(r=null),r?r[i]:void 0}}};var xg=qp.retrieveRawValue,bg=qc,wg=bg.getTooltipMarker,Tg=bg.formatTpl,Sg=lo.getTooltipRenderMode,Mg=/\{@(.+?)\}/g,Ag={getDataParams:function(e,t){var i=this.getData(t),n=this.getRawValue(e,t),r=i.getRawIndex(e),a=i.getName(e),o=i.getRawDataItem(e),s=i.getItemVisual(e,"color"),l=i.getItemVisual(e,"borderColor"),u=this.ecModel.getComponent("tooltip"),h=u&&u.get("renderMode"),c=Sg(h),d=this.mainType,f="series"===d,p=i.userOutput;return{componentType:d,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:f?this.subType:null,seriesIndex:this.seriesIndex,seriesId:f?this.id:null,seriesName:f?this.name:null,name:a,dataIndex:r,data:o,dataType:t,value:n,color:s,borderColor:l,dimensionNames:p?p.dimensionNames:null,encode:p?p.encode:null,marker:wg({color:s,renderMode:c}),$vars:["seriesName","name","value"]}},getFormattedLabel:function(e,t,i,n,r){t=t||"normal";var a=this.getData(i),o=a.getItemModel(e),s=this.getDataParams(e,i);null!=n&&s.value instanceof Array&&(s.value=s.value[n]);var l=o.get("normal"===t?[r||"label","formatter"]:[t,r||"label","formatter"]);return"function"==typeof l?(s.status=t,s.dimensionIndex=n,l(s)):"string"==typeof l?Tg(l,s).replace(Mg,(function(t,i){var n=i.length;return"["===i.charAt(0)&&"]"===i.charAt(n-1)&&(i=+i.slice(1,n-1)),xg(a,e,i)})):void 0},getRawValue:function(e,t){return xg(this.getData(t),e)},formatTooltip:function(){}},Ig=Ag,Cg={},Dg=g;Dg.assert;var Eg=Dg.isArray;function Lg(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0,this.context}var Pg=Lg.prototype;Pg.perform=function(e){var t,i=this._upstream,n=e&&e.skip;if(this._dirty&&i){var r=this.context;r.data=r.outputData=i.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!n&&(t=this._plan(this.context));var a,o=h(this._modBy),s=this._modDataCount||0,l=h(e&&e.modBy),u=e&&e.modDataCount||0;function h(e){return!(e>=1)&&(e=1),e}o===l&&s===u||(t="reset"),(this._dirty||"reset"===t)&&(this._dirty=!1,a=function(e,t){var i,n;e._dueIndex=e._outputDueEnd=e._dueEnd=0,e._settedOutputEnd=null,!t&&e._reset&&((i=e._reset(e.context))&&i.progress&&(n=i.forceFirstProgress,i=i.progress),Eg(i)&&!i.length&&(i=null)),e._progress=i,e._modBy=e._modDataCount=null;var r=e._downstream;return r&&r.dirty(),n}(this,n)),this._modBy=l,this._modDataCount=u;var c=e&&e.step;if(this._dueEnd=i?i._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,f=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!n&&(a||d<f)){var p=this._progress;if(Eg(p))for(var g=0;g<p.length;g++)Rg(this,p[g],d,f,l,u);else Rg(this,p,d,f,l,u)}this._dueIndex=f;var m=null!=this._settedOutputEnd?this._settedOutputEnd:f;this._outputDueEnd=m}else this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()};var Ng=function(){var e,t,i,n,r,a={reset:function(l,u,h,c){t=l,e=u,i=h,n=c,r=Math.ceil(n/i),a.next=i>1&&n>0?s:o}};return a;function o(){return t<e?t++:null}function s(){var a=t%r*i+Math.ceil(t/r),o=t>=e?null:a<n?a:t;return t++,o}}();function Rg(e,t,i,n,r,a){Ng.reset(i,n,r,a),e._callingProgress=t,e._callingProgress({start:i,end:n,count:n-i,next:Ng.next},e.context)}Pg.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},Pg.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},Pg.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},Pg.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},Pg.getUpstream=function(){return this._upstream},Pg.getDownstream=function(){return this._downstream},Pg.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},Cg.createTask=function(e){return new Lg(e)};var Og=g,kg=p,zg=qc,Bg=zg.formatTime,Fg=zg.encodeHTML,Vg=zg.addCommas,Gg=zg.getTooltipMarker,Hg=lo,Ug=Ld,Wg=Fd,jg=Ig,Xg=Hc,Zg=Xg.getLayoutParams,qg=Xg.mergeLayoutParam,Yg=Cg.createTask,Kg=Vd,Qg=Kg.prepareSource,Jg=Kg.getSource,$g=qp.retrieveRawValue,em=Hg.makeInner(),tm=Ug.extend({type:"series.__base__",seriesIndex:0,coordinateSystem:null,defaultOption:null,legendVisualProvider:null,visualColorAccessPath:"itemStyle.color",visualBorderColorAccessPath:"itemStyle.borderColor",layoutMode:null,init:function(e,t,i,n){this.seriesIndex=this.componentIndex,this.dataTask=Yg({count:nm,reset:rm}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,i),Qg(this);var r=this.getInitialData(e,i);om(r,this),this.dataTask.context.data=r,em(this).dataBeforeProcessed=r,im(this)},mergeDefaultAndTheme:function(e,t){var i=this.layoutMode,n=i?Zg(e):{},r=this.subType;Ug.hasClass(r)&&(r+="Series"),Og.merge(e,t.getTheme().get(this.subType)),Og.merge(e,this.getDefaultOption()),Hg.defaultEmphasis(e,"label",["show"]),this.fillDataTextStyle(e.data),i&&qg(e,n,i)},mergeOption:function(e,t){e=Og.merge(this.option,e,!0),this.fillDataTextStyle(e.data);var i=this.layoutMode;i&&qg(this.option,e,i),Qg(this);var n=this.getInitialData(e,t);om(n,this),this.dataTask.dirty(),this.dataTask.context.data=n,em(this).dataBeforeProcessed=n,im(this)},fillDataTextStyle:function(e){if(e&&!Og.isTypedArray(e))for(var t=["show"],i=0;i<e.length;i++)e[i]&&e[i].label&&Hg.defaultEmphasis(e[i],"label",t)},getInitialData:function(){},appendData:function(e){this.getRawData().appendData(e.data)},getData:function(e){var t=lm(this);if(t){var i=t.context.data;return null==e?i:i.getLinkedData(e)}return em(this).data},setData:function(e){var t=lm(this);if(t){var i=t.context;i.data!==e&&t.modifyOutputEnd&&t.setOutputEnd(e.count()),i.outputData=e,t!==this.dataTask&&(i.data=e)}em(this).data=e},getSource:function(){return Jg(this)},getRawData:function(){return em(this).dataBeforeProcessed},getBaseAxis:function(){var e=this.coordinateSystem;return e&&e.getBaseAxis&&e.getBaseAxis()},formatTooltip:function(e,t,i,n){var r=this,a="html"===(n=n||"html")?"<br/>":"\n",o="richText"===n,s={},l=0;function u(e){return{renderMode:n,content:Fg(Vg(e)),style:s}}var h=this.getData(),c=h.mapDimension("defaultedTooltip",!0),d=c.length,f=this.getRawValue(e),p=Og.isArray(f),g=h.getItemVisual(e,"color");Og.isObject(g)&&g.colorStops&&(g=(g.colorStops[0]||{}).color),g=g||"transparent";var m=d>1||p&&!d?function(i){var a=Og.reduce(i,(function(e,t,i){var n=h.getDimensionInfo(i);return e|(n&&!1!==n.tooltip&&null!=n.displayName)}),0),u=[];function d(e,i){var c=h.getDimensionInfo(i);if(c&&!1!==c.otherDims.tooltip){var d=c.type,f="sub"+r.seriesIndex+"at"+l,p=Gg({color:g,type:"subItem",renderMode:n,markerId:f}),m="string"==typeof p?p:p.content,v=(a?m+Fg(c.displayName||"-")+": ":"")+Fg("ordinal"===d?e+"":"time"===d?t?"":Bg("yyyy/MM/dd hh:mm:ss",e):Vg(e));v&&u.push(v),o&&(s[f]=g,++l)}}c.length?Og.each(c,(function(t){d($g(h,e,t),t)})):Og.each(i,d);var f=a?o?"\n":"<br/>":"",p=f+u.join(f||", ");return{renderMode:n,content:p,style:s}}(f):u(d?$g(h,e,c[0]):p?f[0]:f),v=m.content,y=r.seriesIndex+"at"+l,_=Gg({color:g,type:"item",renderMode:n,markerId:y});s[y]=g,++l;var x=h.getName(e),b=this.name;Hg.isNameSpecified(this)||(b=""),b=b?Fg(b)+(t?": ":a):"";var w="string"==typeof _?_:_.content;return{html:t?w+b+v:b+w+(x?Fg(x)+": "+v:v),markers:s}},isAnimationEnabled:function(){if(kg.node)return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),e},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(e,t,i){var n=this.ecModel,r=Wg.getColorFromPalette.call(this,e,t,i);return r||(r=n.getColorFromPalette(e,t,i)),r},coordDimToDataDim:function(e){return this.getRawData().mapDimension(e,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});function im(e){var t=e.name;Hg.isNameSpecified(e)||(e.name=function(e){var t=e.getRawData(),i=t.mapDimension("seriesName",!0),n=[];return Og.each(i,(function(e){var i=t.getDimensionInfo(e);i.displayName&&n.push(i.displayName)})),n.join(" ")}(e)||t)}function nm(e){return e.model.getRawData().count()}function rm(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),am}function am(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function om(e,t){Og.each(e.CHANGABLE_METHODS,(function(i){e.wrapMethod(i,Og.curry(sm,t))}))}function sm(e){var t=lm(e);t&&t.setOutputEnd(this.count())}function lm(e){var t=(e.ecModel||{}).scheduler,i=t&&t.getPipeline(e.uid);if(i){var n=i.currentTask;if(n){var r=n.agentStubMap;r&&(n=r.get(e.uid))}return n}}Og.mixin(tm,jg),Og.mixin(tm,Wg);var um=tm,hm=zi,cm=Bc,dm=xo,fm=function(){this.group=new hm,this.uid=cm.getUID("viewComponent")},pm=fm.prototype={constructor:fm,init:function(e,t){},render:function(e,t,i,n){},dispose:function(){},filterForExposedEvent:null};pm.updateView=pm.updateLayout=pm.updateVisual=function(e,t,i,n){},dm.enableClassExtend(fm),dm.enableClassManagement(fm,{registerWhenExtend:!0});var gm=fm,mm=lo.makeInner,vm=function(){var e=mm();return function(t){var i=e(t),n=t.pipelineContext,r=i.large,a=i.progressiveRender,o=i.large=n&&n.large,s=i.progressiveRender=n&&n.progressiveRender;return!!(r^o||a^s)&&"reset"}},ym=g.each,_m=zi,xm=Bc,bm=xo,wm=lo,Tm=No,Sm=Cg.createTask,Mm=vm,Am=wm.makeInner(),Im=Mm();function Cm(){this.group=new _m,this.uid=xm.getUID("viewChart"),this.renderTask=Sm({plan:Pm,reset:Nm}),this.renderTask.context={view:this}}Cm.prototype={type:"chart",init:function(e,t){},render:function(e,t,i,n){},highlight:function(e,t,i,n){Lm(e.getData(),n,"emphasis")},downplay:function(e,t,i,n){Lm(e.getData(),n,"normal")},remove:function(e,t){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};var Dm=Cm.prototype;function Em(e,t,i){if(e&&(e.trigger(t,i),e.isGroup&&!Tm.isHighDownDispatcher(e)))for(var n=0,r=e.childCount();n<r;n++)Em(e.childAt(n),t,i)}function Lm(e,t,i){var n=wm.queryDataIndex(e,t),r=t&&null!=t.highlightKey?Tm.getHighlightDigit(t.highlightKey):null;null!=n?ym(wm.normalizeToArray(n),(function(t){Em(e.getItemGraphicEl(t),i,r)})):e.eachItemGraphicEl((function(e){Em(e,i,r)}))}function Pm(e){return Im(e.model)}function Nm(e){var t=e.model,i=e.ecModel,n=e.api,r=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=r&&Am(r).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return"render"!==l&&o[l](t,i,n,r),Rm[l]}Dm.updateView=Dm.updateLayout=Dm.updateVisual=function(e,t,i,n){this.render(e,t,i,n)},bm.enableClassExtend(Cm,["dispose"]),bm.enableClassManagement(Cm,{registerWhenExtend:!0}),Cm.markUpdateMethod=function(e,t){Am(e).updateMethod=t};var Rm={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)}}},Om=Cm,km={},zm="\0__throttleOriginMethod",Bm="\0__throttleRate",Fm="\0__throttleType";function Vm(e,t,i){var n,r,a,o,s,l=0,u=0,h=null;function c(){u=(new Date).getTime(),h=null,e.apply(a,o||[])}t=t||0;var d=function(){n=(new Date).getTime(),a=this,o=arguments;var e=s||t,d=s||i;s=null,r=n-(d?l:u)-e,clearTimeout(h),d?h=setTimeout(c,e):r>=0?c():h=setTimeout(c,-r),l=n};return d.clear=function(){h&&(clearTimeout(h),h=null)},d.debounceNextCall=function(e){s=e},d}km.throttle=Vm,km.createOrUpdate=function(e,t,i,n){var r=e[t];if(r){var a=r[zm]||r,o=r[Fm];if(r[Bm]!==i||o!==n){if(null==i||!n)return e[t]=a;(r=e[t]=Vm(a,i,"debounce"===n))[zm]=a,r[Fm]=n,r[Bm]=i}return r}},km.clear=function(e,t){var i=e[t];i&&i[zm]&&(e[t]=i[zm])};var Gm=Wu,Hm=g.isFunction,Um={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var i=e.getData(),n=(e.visualColorAccessPath||"itemStyle.color").split("."),r=e.get(n),a=!Hm(r)||r instanceof Gm?null:r;r&&!a||(r=e.getColorFromPalette(e.name,null,t.getSeriesCount())),i.setVisual("color",r);var o=(e.visualBorderColorAccessPath||"itemStyle.borderColor").split("."),s=e.get(o);if(i.setVisual("borderColor",s),!t.isSeriesFiltered(e))return a&&i.each((function(t){i.setItemVisual(t,"color",a(e.getDataParams(t)))})),{dataEach:i.hasItemOption?function(e,t){var i=e.getItemModel(t),r=i.get(n,!0),a=i.get(o,!0);null!=r&&e.setItemVisual(t,"color",r),null!=a&&e.setItemVisual(t,"borderColor",a)}:null}}},Wm=Um,jm={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:"旭日图"}},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:""}}}},Xm=g,Zm=jm,qm=qp.retrieveRawValue,Ym=function(e,t){var i=t.getModel("aria");if(i.get("show"))if(i.get("description"))e.setAttribute("aria-label",i.get("description"));else{var n=0;t.eachSeries((function(e,t){++n}),this);var r,a=i.get("data.maxCount")||10,o=i.get("series.maxCount")||10,s=Math.min(n,o);if(!(n<1)){var l=function(){var e=t.getModel("title").option;return e&&e.length&&(e=e[0]),e&&e.text}();r=l?h(c("general.withTitle"),{title:l}):c("general.withoutTitle");var u=[];r+=h(c(n>1?"series.multiple.prefix":"series.single.prefix"),{seriesCount:n}),t.eachSeries((function(e,t){if(t<s){var i,r=e.get("name"),o="series."+(n>1?"multiple":"single")+".";i=h(i=c(r?o+"withName":o+"withoutName"),{seriesId:e.seriesIndex,seriesName:e.get("name"),seriesType:(m=e.subType,Zm.series.typeNames[m]||"自定义图")});var l=e.getData();window.data=l,l.count()>a?i+=h(c("data.partialData"),{displayCnt:a}):i+=c("data.allData");for(var d=[],f=0;f<l.count();f++)if(f<a){var p=l.getName(f),g=qm(l,f);d.push(h(c(p?"data.withName":"data.withoutName"),{name:p,value:g}))}i+=d.join(c("data.separator.middle"))+c("data.separator.end"),u.push(i)}var m})),r+=u.join(c("series.multiple.separator.middle"))+c("series.multiple.separator.end"),e.setAttribute("aria-label",r)}}function h(e,t){if("string"!=typeof e)return e;var i=e;return Xm.each(t,(function(e,t){i=i.replace(new RegExp("\\{\\s*"+t+"\\s*\\}","g"),e)})),i}function c(e){var t=i.get(e);if(null==t){for(var n=e.split("."),r=Zm.aria,a=0;a<n.length;++a)r=r[n[a]];return r}return t}},Km=g,Qm=No,Jm=Tn,$m=Math.PI,ev=function(e,t){t=t||{},Km.defaults(t,{text:"loading",textColor:"#000",fontSize:"12px",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#c23531",spinnerRadius:10,lineWidth:5,zlevel:0});var i=new Qm.Group,n=new Qm.Rect({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});i.add(n);var r=t.fontSize+" sans-serif",a=new Qm.Rect({style:{fill:"none",text:t.text,font:r,textPosition:"right",textDistance:10,textFill:t.textColor},zlevel:t.zlevel,z:10001});if(i.add(a),t.showSpinner){var o=new Qm.Arc({shape:{startAngle:-$m/2,endAngle:-$m/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001});o.animateShape(!0).when(1e3,{endAngle:3*$m/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:3*$m/2}).delay(300).start("circularInOut"),i.add(o)}return i.resize=function(){var i=Jm.getWidth(t.text,r),s=t.showSpinner?t.spinnerRadius:0,l=(e.getWidth()-2*s-(t.showSpinner&&i?10:0)-i)/2-(t.showSpinner?0:i/2),u=e.getHeight()/2;t.showSpinner&&o.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),n.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},i.resize(),i},tv=g,iv=tv.each,nv=tv.map,rv=tv.isFunction,av=tv.createHashMap,ov=tv.noop,sv=Cg.createTask,lv=Bc.getUID,uv=ep,hv=np,cv=lo.normalizeToArray;function dv(e,t,i,n){this.ecInstance=e,this.api=t,this.unfinished,i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice(),this._allHandlers=i.concat(n),this._stageTaskMap=av()}var fv=dv.prototype;function pv(e,t,i,n,r){var a;function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}r=r||{},iv(t,(function(t,s){if(!r.visualType||r.visualType===t.visualType){var l=e._stageTaskMap.get(t.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each((function(e){o(r,e)&&(e.dirty(),c=!0)})),c&&h.dirty(),gv(h,n);var f=e.getPerformArgs(h,r.block);d.each((function(e){e.perform(f)})),a|=h.perform(f)}else u&&u.each((function(s,l){o(r,s)&&s.dirty();var u=e.getPerformArgs(s,r.block);u.skip=!t.performRawSeries&&i.isSeriesFiltered(s.context.model),gv(s,n),a|=s.perform(u)}))}})),e.unfinished|=a}fv.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each((function(e){var t=e.overallTask;t&&t.dirty()}))},fv.getPerformArgs=function(e,t){if(e.__pipeline){var i=this._pipelineMap.get(e.__pipeline.id),n=i.context,r=!t&&i.progressiveEnabled&&(!n||n.progressiveRender)&&e.__idxInPipeline>i.blockIndex?i.step:null,a=n&&n.modDataCount;return{step:r,modBy:null!=a?Math.ceil(a/r):null,modDataCount:a}}},fv.getPipeline=function(e){return this._pipelineMap.get(e)},fv.updateStreamModes=function(e,t){var i=this._pipelineMap.get(e.uid),n=e.getData().count(),r=i.progressiveEnabled&&t.incrementalPrepareRender&&n>=i.threshold,a=e.get("large")&&n>=e.get("largeThreshold"),o="mod"===e.get("progressiveChunkMode")?n:null;e.pipelineContext=i.context={progressiveRender:r,modDataCount:o,large:a}},fv.restorePipelines=function(e){var t=this,i=t._pipelineMap=av();e.eachSeries((function(e){var n=e.getProgressive(),r=e.uid;i.set(r,{id:r,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:n&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(n||700),count:0}),Mv(t,e,e.dataTask)}))},fv.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.ecInstance.getModel(),i=this.api;iv(this._allHandlers,(function(n){var r=e.get(n.uid)||e.set(n.uid,[]);n.reset&&function(e,t,i,n,r){var a=i.seriesTaskMap||(i.seriesTaskMap=av()),o=t.seriesType,s=t.getTargetSeries;function l(i){var o=i.uid,s=a.get(o)||a.set(o,sv({plan:xv,reset:bv,count:Sv}));s.context={model:i,ecModel:n,api:r,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:e},Mv(e,i,s)}t.createOnAllSeries?n.eachRawSeries(l):o?n.eachRawSeriesByType(o,l):s&&s(n,r).each(l);var u=e._pipelineMap;a.each((function(e,t){u.get(t)||(e.dispose(),a.removeKey(t))}))}(this,n,r,t,i),n.overallReset&&function(e,t,i,n,r){var a=i.overallTask=i.overallTask||sv({reset:mv});a.context={ecModel:n,api:r,overallReset:t.overallReset,scheduler:e};var o=a.agentStubMap=a.agentStubMap||av(),s=t.seriesType,l=t.getTargetSeries,u=!0,h=t.modifyOutputEnd;function c(t){var i=t.uid,n=o.get(i);n||(n=o.set(i,sv({reset:vv,onDirty:_v})),a.dirty()),n.context={model:t,overallProgress:u,modifyOutputEnd:h},n.agent=a,n.__block=u,Mv(e,t,n)}s?n.eachRawSeriesByType(s,c):l?l(n,r).each(c):(u=!1,iv(n.getSeries(),c));var d=e._pipelineMap;o.each((function(e,t){d.get(t)||(e.dispose(),a.dirty(),o.removeKey(t))}))}(this,n,r,t,i)}),this)},fv.prepareView=function(e,t,i,n){var r=e.renderTask,a=r.context;a.model=t,a.ecModel=i,a.api=n,r.__block=!e.incrementalPrepareRender,Mv(this,t,r)},fv.performDataProcessorTasks=function(e,t){pv(this,this._dataProcessorHandlers,e,t,{block:!0})},fv.performVisualTasks=function(e,t,i){pv(this,this._visualHandlers,e,t,i)},fv.performSeriesTasks=function(e){var t;e.eachSeries((function(e){t|=e.dataTask.perform()})),this.unfinished|=t},fv.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)}))};var gv=fv.updatePayload=function(e,t){"remain"!==t&&(e.context.payload=t)};function mv(e){e.overallReset(e.ecModel,e.api,e.payload)}function vv(e,t){return e.overallProgress&&yv}function yv(){this.agent.dirty(),this.getDownstream().dirty()}function _v(){this.agent&&this.agent.dirty()}function xv(e){return e.plan&&e.plan(e.model,e.ecModel,e.api,e.payload)}function bv(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=cv(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?nv(t,(function(e,t){return Tv(t)})):wv}var wv=Tv(0);function Tv(e){return function(t,i){var n=i.data,r=i.resetDefines[e];if(r&&r.dataEach)for(var a=t.start;a<t.end;a++)r.dataEach(n,a);else r&&r.progress&&r.progress(t,n)}}function Sv(e){return e.data.count()}function Mv(e,t,i){var n=t.uid,r=e._pipelineMap.get(n);!r.head&&(r.head=i),r.tail&&r.tail.pipe(i),r.tail=i,i.__idxInPipeline=r.count++,i.__pipeline=r}function Av(e){Iv=null;try{e(Cv,Dv)}catch(t){}return Iv}dv.wrapStageHandler=function(e,t){return rv(e)&&(e={overallReset:e,seriesType:Av(e)}),e.uid=lv("stageHandler"),t&&(e.visualType=t),e};var Iv,Cv={},Dv={};function Ev(e,t){for(var i in t.prototype)e[i]=ov}Ev(Cv,uv),Ev(Dv,hv),Cv.eachSeriesByType=Cv.eachRawSeriesByType=function(e){Iv=e},Cv.eachComponent=function(e){"series"===e.mainType&&e.subType&&(Iv=e.subType)};var Lv=dv,Pv=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],Nv={color:Pv,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],Pv]},Rv="#eee",Ov=function(){return{axisLine:{lineStyle:{color:Rv}},axisTick:{lineStyle:{color:Rv}},axisLabel:{textStyle:{color:Rv}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:Rv}}}},kv=["#dd6b66","#759aa0","#e69d87","#8dc1a9","#ea7e53","#eedd78","#73a373","#73b9bc","#7289ab","#91ca8c","#f49f42"],zv={color:kv,backgroundColor:"#333",tooltip:{axisPointer:{lineStyle:{color:Rv},crossStyle:{color:Rv},label:{color:"#000"}}},legend:{textStyle:{color:Rv}},textStyle:{color:Rv},title:{textStyle:{color:Rv}},toolbox:{iconStyle:{normal:{borderColor:Rv}}},dataZoom:{textStyle:{color:Rv}},visualMap:{textStyle:{color:Rv}},timeline:{lineStyle:{color:Rv},itemStyle:{normal:{color:kv[1]}},label:{normal:{textStyle:{color:Rv}}},controlStyle:{normal:{color:Rv,borderColor:Rv}}},timeAxis:Ov(),logAxis:Ov(),valueAxis:Ov(),categoryAxis:Ov(),line:{symbol:"circle"},graph:{color:kv},gauge:{title:{textStyle:{color:Rv}}},candlestick:{itemStyle:{normal:{color:"#FD1050",color0:"#0CF49B",borderColor:"#FD1050",borderColor0:"#0CF49B"}}}};zv.categoryAxis.splitLine.show=!1;var Bv=zv,Fv=Ld,Vv=gm,Gv=Vd.detectSourceFormat,Hv=Gd.SERIES_LAYOUT_BY_COLUMN;Fv.extend({type:"dataset",defaultOption:{seriesLayoutBy:Hv,sourceHeader:null,dimensions:null,source:null},optionUpdated:function(){Gv(this)}}),Vv.extend({type:"dataset"});var Uv={},Wv=dl.extend({type:"ellipse",shape:{cx:0,cy:0,rx:0,ry:0},buildPath:function(e,t){var i=.5522848,n=t.cx,r=t.cy,a=t.rx,o=t.ry,s=a*i,l=o*i;e.moveTo(n-a,r),e.bezierCurveTo(n-a,r-l,n-s,r-o,n,r-o),e.bezierCurveTo(n+s,r-o,n+a,r-l,n+a,r),e.bezierCurveTo(n+a,r+l,n+s,r+o,n,r+o),e.bezierCurveTo(n-s,r+o,n-a,r+l,n-a,r),e.closePath()}}),jv=zi,Xv=Kr,Zv=Vl,qv=Gl,Yv=wu,Kv=Wv,Qv=Au,Jv=dl,$v=du,ey=pu,ty=qu,iy=hn,ny=Ue,ry=Ro.createFromString,ay=g,oy=ay.isString,sy=ay.extend,ly=ay.defaults,uy=ay.trim,hy=ay.each,cy=/[\s,]+/;function dy(e){for(oy(e)&&(e=(new DOMParser).parseFromString(e,"text/xml")),9===e.nodeType&&(e=e.firstChild);"svg"!==e.nodeName.toLowerCase()||1!==e.nodeType;)e=e.nextSibling;return e}function fy(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}fy.prototype.parse=function(e,t){t=t||{};var i=dy(e);if(!i)throw new Error("Illegal svg");var n=new jv;this._root=n;var r=i.getAttribute("viewBox")||"",a=parseFloat(i.getAttribute("width")||t.width),o=parseFloat(i.getAttribute("height")||t.height);isNaN(a)&&(a=null),isNaN(o)&&(o=null),_y(i,n,null,!0);for(var s,l,u=i.firstChild;u;)this._parseNode(u,n),u=u.nextSibling;if(r){var h=uy(r).split(cy);h.length>=4&&(s={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(s&&null!=a&&null!=o&&(l=Sy(s,a,o),!t.ignoreViewBox)){var c=n;(n=new jv).add(c),c.scale=l.scale.slice(),c.position=l.position.slice()}return t.ignoreRootClip||null==a||null==o||n.setClipPath(new Yv({shape:{x:0,y:0,width:a,height:o}})),{root:n,width:a,height:o,viewBoxRect:s,viewBoxTransform:l}},fy.prototype._parseNode=function(e,t){var i,n,r=e.nodeName.toLowerCase();if("defs"===r?this._isDefine=!0:"text"===r&&(this._isText=!0),this._isDefine){if(n=gy[r]){var a=n.call(this,e),o=e.getAttribute("id");o&&(this._defs[o]=a)}}else(n=py[r])&&(i=n.call(this,e,t),t.add(i));for(var s=e.firstChild;s;)1===s.nodeType&&this._parseNode(s,i),3===s.nodeType&&this._isText&&this._parseText(s,i),s=s.nextSibling;"defs"===r?this._isDefine=!1:"text"===r&&(this._isText=!1)},fy.prototype._parseText=function(e,t){if(1===e.nodeType){var i=e.getAttribute("dx")||0,n=e.getAttribute("dy")||0;this._textX+=parseFloat(i),this._textY+=parseFloat(n)}var r=new Zv({style:{text:e.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});my(t,r),_y(e,r,this._defs);var a=r.style.fontSize;a&&a<9&&(r.style.fontSize=9,r.scale=r.scale||[1,1],r.scale[0]*=a/9,r.scale[1]*=a/9);var o=r.getBoundingRect();return this._textX+=o.width,t.add(r),r};var py={g:function(e,t){var i=new jv;return my(t,i),_y(e,i,this._defs),i},rect:function(e,t){var i=new Yv;return my(t,i),_y(e,i,this._defs),i.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)}),i},circle:function(e,t){var i=new qv;return my(t,i),_y(e,i,this._defs),i.setShape({cx:parseFloat(e.getAttribute("cx")||0),cy:parseFloat(e.getAttribute("cy")||0),r:parseFloat(e.getAttribute("r")||0)}),i},line:function(e,t){var i=new Qv;return my(t,i),_y(e,i,this._defs),i.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)}),i},ellipse:function(e,t){var i=new Kv;return my(t,i),_y(e,i,this._defs),i.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)}),i},polygon:function(e,t){var i=e.getAttribute("points");i&&(i=vy(i));var n=new $v({shape:{points:i||[]}});return my(t,n),_y(e,n,this._defs),n},polyline:function(e,t){var i=new Jv;my(t,i),_y(e,i,this._defs);var n=e.getAttribute("points");return n&&(n=vy(n)),new ey({shape:{points:n||[]}})},image:function(e,t){var i=new Xv;return my(t,i),_y(e,i,this._defs),i.setStyle({image:e.getAttribute("xlink:href"),x:e.getAttribute("x"),y:e.getAttribute("y"),width:e.getAttribute("width"),height:e.getAttribute("height")}),i},text:function(e,t){var i=e.getAttribute("x")||0,n=e.getAttribute("y")||0,r=e.getAttribute("dx")||0,a=e.getAttribute("dy")||0;this._textX=parseFloat(i)+parseFloat(r),this._textY=parseFloat(n)+parseFloat(a);var o=new jv;return my(t,o),_y(e,o,this._defs),o},tspan:function(e,t){var i=e.getAttribute("x"),n=e.getAttribute("y");null!=i&&(this._textX=parseFloat(i)),null!=n&&(this._textY=parseFloat(n));var r=e.getAttribute("dx")||0,a=e.getAttribute("dy")||0,o=new jv;return my(t,o),_y(e,o,this._defs),this._textX+=r,this._textY+=a,o},path:function(e,t){var i=e.getAttribute("d")||"",n=ry(i);return my(t,n),_y(e,n,this._defs),n}},gy={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||0,10),i=parseInt(e.getAttribute("y1")||0,10),n=parseInt(e.getAttribute("x2")||10,10),r=parseInt(e.getAttribute("y2")||0,10),a=new ty(t,i,n,r);return function(e,t){for(var i=e.firstChild;i;){if(1===i.nodeType){var n=i.getAttribute("offset");n=n.indexOf("%")>0?parseInt(n,10)/100:n?parseFloat(n):0;var r=i.getAttribute("stop-color")||"#000000";t.addColorStop(n,r)}i=i.nextSibling}}(e,a),a},radialgradient:function(e){}};function my(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),ly(t.__inheritedStyle,e.__inheritedStyle))}function vy(e){for(var t=uy(e).split(cy),i=[],n=0;n<t.length;n+=2){var r=parseFloat(t[n]),a=parseFloat(t[n+1]);i.push([r,a])}return i}var yy={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-align":"textAlign","alignment-baseline":"textBaseline"};function _y(e,t,i,n){var r=t.__inheritedStyle||{},a="text"===t.type;if(1===e.nodeType&&(function(e,t){var i=e.getAttribute("transform");if(i){i=i.replace(/,/g," ");var n=null,r=[];i.replace(wy,(function(e,t,i){r.push(t,i)}));for(var a=r.length-1;a>0;a-=2){var o=r[a],s=r[a-1];switch(n=n||ny.create(),s){case"translate":o=uy(o).split(cy),ny.translate(n,n,[parseFloat(o[0]),parseFloat(o[1]||0)]);break;case"scale":o=uy(o).split(cy),ny.scale(n,n,[parseFloat(o[0]),parseFloat(o[1]||o[0])]);break;case"rotate":o=uy(o).split(cy),ny.rotate(n,n,parseFloat(o[0]));break;case"skew":o=uy(o).split(cy),console.warn("Skew transform is not supported yet");break;case"matrix":o=uy(o).split(cy),n[0]=parseFloat(o[0]),n[1]=parseFloat(o[1]),n[2]=parseFloat(o[2]),n[3]=parseFloat(o[3]),n[4]=parseFloat(o[4]),n[5]=parseFloat(o[5])}}t.setLocalTransform(n)}}(e,t),sy(r,function(e){var t=e.getAttribute("style"),i={};if(!t)return i;var n,r={};for(Ty.lastIndex=0;null!=(n=Ty.exec(t));)r[n[1]]=n[2];for(var a in yy)yy.hasOwnProperty(a)&&null!=r[a]&&(i[yy[a]]=r[a]);return i}(e)),!n))for(var o in yy)if(yy.hasOwnProperty(o)){var s=e.getAttribute(o);null!=s&&(r[yy[o]]=s)}var l=a?"textFill":"fill",u=a?"textStroke":"stroke";t.style=t.style||new iy;var h=t.style;null!=r.fill&&h.set(l,by(r.fill,i)),null!=r.stroke&&h.set(u,by(r.stroke,i)),hy(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],(function(e){var t="lineWidth"===e&&a?"textStrokeWidth":e;null!=r[e]&&h.set(t,parseFloat(r[e]))})),r.textBaseline&&"auto"!==r.textBaseline||(r.textBaseline="alphabetic"),"alphabetic"===r.textBaseline&&(r.textBaseline="bottom"),"start"===r.textAlign&&(r.textAlign="left"),"end"===r.textAlign&&(r.textAlign="right"),hy(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign","textBaseline"],(function(e){null!=r[e]&&h.set(e,r[e])})),r.lineDash&&(t.style.lineDash=uy(r.lineDash).split(cy)),h[u]&&"none"!==h[u]&&(t[u]=!0),t.__inheritedStyle=r}var xy=/url\(\s*#(.*?)\)/;function by(e,t){var i=t&&e&&e.match(xy);return i?t[uy(i[1])]:e}var wy=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g,Ty=/([^\s:;]+)\s*:\s*([^:;]+)/g;function Sy(e,t,i){var n=t/e.width,r=i/e.height,a=Math.min(n,r);return{scale:[a,a],position:[-(e.x+e.width/2)*a+t/2,-(e.y+e.height/2)*a+i/2]}}Uv.parseXML=dy,Uv.makeViewBoxTransform=Sy,Uv.parseSVG=function(e,t){return(new fy).parse(e,t)};var My=g,Ay=My.createHashMap,Iy=My.isString,Cy=My.isArray,Dy=My.each;My.assert;var Ey=Uv.parseXML,Ly=Ay(),Py={registerMap:function(e,t,i){var n;return Cy(t)?n=t:t.svg?n=[{type:"svg",source:t.svg,specialAreas:t.specialAreas}]:(t.geoJson&&!t.features&&(i=t.specialAreas,t=t.geoJson),n=[{type:"geoJSON",source:t,specialAreas:i}]),Dy(n,(function(e){var t=e.type;"geoJson"===t&&(t=e.type="geoJSON"),(0,Ny[t])(e)})),Ly.set(e,n)},retrieveMap:function(e){return Ly.get(e)}},Ny={geoJSON:function(e){var t=e.source;e.geoJSON=Iy(t)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(t):new Function("return ("+t+");")():t},svg:function(e){e.svgXML=Ey(e.source)}},Ry=Py,Oy={},ky={};function zy(e){return e}function By(e,t,i,n,r){this._old=e,this._new=t,this._oldKeyGetter=i||zy,this._newKeyGetter=n||zy,this.context=r}function Fy(e,t,i,n,r){for(var a=0;a<e.length;a++){var o="_ec_"+r[n](e[a],a),s=t[o];null==s?(i.push(o),t[o]=a):(s.length||(t[o]=s=[s]),s.push(a))}}By.prototype={constructor:By,add:function(e){return this._add=e,this},update:function(e){return this._update=e,this},remove:function(e){return this._remove=e,this},execute:function(){var e=this._old,t=this._new,i={},n=[],r=[];for(Fy(e,{},n,"_oldKeyGetter",this),Fy(t,i,r,"_newKeyGetter",this),a=0;a<e.length;a++)null!=(s=i[o=n[a]])?((u=s.length)?(1===u&&(i[o]=null),s=s.shift()):i[o]=null,this._update&&this._update(s,a)):this._remove&&this._remove(a);for(var a=0;a<r.length;a++){var o=r[a];if(i.hasOwnProperty(o)){var s;if(null==(s=i[o]))continue;if(s.length)for(var l=0,u=s.length;l<u;l++)this._add&&this._add(s[l]);else this._add&&this._add(s)}}}};var Vy=By,Gy={},Hy=g,Uy=Hy.each,Wy=Hy.createHashMap;Hy.assert;var jy=Wy(["tooltip","label","itemName","itemId","seriesName"]);function Xy(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}Gy.OTHER_DIMENSIONS=jy,Gy.summarizeDimensions=function(e){var t={},i=t.encode={},n=Wy(),r=[],a=[],o=t.userOutput={dimensionNames:e.dimensions.slice(),encode:{}};Uy(e.dimensions,(function(t){var s,l=e.getDimensionInfo(t),u=l.coordDim;if(u){var h=l.coordDimIndex;Xy(i,u)[h]=t,l.isExtraCoord||(n.set(u,1),"ordinal"!==(s=l.type)&&"time"!==s&&(r[0]=t),Xy(o.encode,u)[h]=l.index),l.defaultTooltip&&a.push(t)}jy.each((function(e,t){var n=Xy(i,t),r=l.otherDims[t];null!=r&&!1!==r&&(n[r]=l.name)}))}));var s=[],l={};n.each((function(e,t){var n=i[t];l[t]=n[0],s=s.concat(n)})),t.dataDimsOnCoord=s,t.encodeFirstDimNotExtra=l;var u=i.label;u&&u.length&&(r=u.slice());var h=i.tooltip;return h&&h.length?a=h.slice():a.length||(a=r.slice()),i.defaultedLabel=r,i.defaultedTooltip=a,t},Gy.getDimensionTypeByAxis=function(e){return"category"===e?"ordinal":"time"===e?"time":"float"};var Zy=g,qy=function(e){null!=e&&Zy.extend(this,e),this.otherDims={}},Yy=g,Ky=zc,Qy=Vy,Jy=$d,$y=qp,e_=$y.defaultDimValueGetters,t_=$y.DefaultDataProvider,i_=Gy.summarizeDimensions,n_=qy,r_=Yy.isObject,a_="undefined",o_={float:typeof Float64Array===a_?Array:Float64Array,int:typeof Int32Array===a_?Array:Int32Array,ordinal:Array,number:Array,time:Array},s_=typeof Uint32Array===a_?Array:Uint32Array,l_=typeof Int32Array===a_?Array:Int32Array,u_=typeof Uint16Array===a_?Array:Uint16Array;function h_(e){return e._rawCount>65535?s_:u_}var c_=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_rawData","_chunkSize","_chunkCount","_dimValueGetter","_count","_rawCount","_nameDimIdx","_idDimIdx"],d_=["_extent","_approximateExtent","_rawExtent"];function f_(e,t){Yy.each(c_.concat(t.__wrappedMethods||[]),(function(i){t.hasOwnProperty(i)&&(e[i]=t[i])})),e.__wrappedMethods=t.__wrappedMethods,Yy.each(d_,(function(i){e[i]=Yy.clone(t[i])})),e._calculationInfo=Yy.extend(t._calculationInfo)}var p_=function(e,t){e=e||["x","y"];for(var i={},n=[],r={},a=0;a<e.length;a++){var o=e[a];Yy.isString(o)?o=new n_({name:o}):o instanceof n_||(o=new n_(o));var s=o.name;o.type=o.type||"float",o.coordDim||(o.coordDim=s,o.coordDimIndex=0),o.otherDims=o.otherDims||{},n.push(s),i[s]=o,o.index=a,o.createInvertedIndices&&(r[s]=[])}this.dimensions=n,this._dimensionInfos=i,this.hostModel=t,this.dataType,this._indices=null,this._count=0,this._rawCount=0,this._storage={},this._nameList=[],this._idList=[],this._optionModels=[],this._visual={},this._layout={},this._itemVisuals=[],this.hasItemVisual={},this._itemLayouts=[],this._graphicEls=[],this._chunkSize=1e5,this._chunkCount=0,this._rawData,this._rawExtent={},this._extent={},this._approximateExtent={},this._dimensionsSummary=i_(this),this._invertedIndicesMap=r,this._calculationInfo={},this.userOutput=this._dimensionsSummary.userOutput},g_=p_.prototype;function m_(e,t,i,n,r){var a=o_[t.type],o=n-1,s=t.name,l=e[s][o];if(l&&l.length<i){for(var u=new a(Math.min(r-o*i,i)),h=0;h<l.length;h++)u[h]=l[h];e[s][o]=u}for(var c=n*i;c<r;c+=i)e[s].push(new a(Math.min(r-c,i)))}function v_(e){var t=e._invertedIndicesMap;Yy.each(t,(function(i,n){var r=e._dimensionInfos[n].ordinalMeta;if(r){i=t[n]=new l_(r.categories.length);for(var a=0;a<i.length;a++)i[a]=-1;for(a=0;a<e._count;a++)i[e.get(n,a)]=a}}))}function y_(e,t,i){var n;if(null!=t){var r=e._chunkSize,a=Math.floor(i/r),o=i%r,s=e.dimensions[t],l=e._storage[s][a];if(l){n=l[o];var u=e._dimensionInfos[s].ordinalMeta;u&&u.categories.length&&(n=u.categories[n])}}return n}function __(e){return e}function x_(e){return e<this._count&&e>=0?this._indices[e]:-1}function b_(e,t){var i=e._idList[t];return null==i&&(i=y_(e,e._idDimIdx,t)),null==i&&(i="e\0\0"+t),i}function w_(e){return Yy.isArray(e)||(e=[e]),e}function T_(e,t){var i=e.dimensions,n=new p_(Yy.map(i,e.getDimensionInfo,e),e.hostModel);f_(n,e);for(var r=n._storage={},a=e._storage,o=0;o<i.length;o++){var s=i[o];a[s]&&(Yy.indexOf(t,s)>=0?(r[s]=S_(a[s]),n._rawExtent[s]=[1/0,-1/0],n._extent[s]=null):r[s]=a[s])}return n}function S_(e){for(var t,i,n=new Array(e.length),r=0;r<e.length;r++)n[r]=(t=e[r],i=void 0,(i=t.constructor)===Array?t.slice():new i(t));return n}g_.type="list",g_.hasItemOption=!0,g_.getDimension=function(e){return"number"!=typeof e&&(isNaN(e)||this._dimensionInfos.hasOwnProperty(e))||(e=this.dimensions[e]),e},g_.getDimensionInfo=function(e){return this._dimensionInfos[this.getDimension(e)]},g_.getDimensionsOnCoord=function(){return this._dimensionsSummary.dataDimsOnCoord.slice()},g_.mapDimension=function(e,t){var i=this._dimensionsSummary;if(null==t)return i.encodeFirstDimNotExtra[e];var n=i.encode[e];return!0===t?(n||[]).slice():n&&n[t]},g_.initData=function(e,t,i){(Jy.isInstance(e)||Yy.isArrayLike(e))&&(e=new t_(e,this.dimensions.length)),this._rawData=e,this._storage={},this._indices=null,this._nameList=t||[],this._idList=[],this._nameRepeatCount={},i||(this.hasItemOption=!1),this.defaultDimValueGetter=e_[this._rawData.getSource().sourceFormat],this._dimValueGetter=i=i||this.defaultDimValueGetter,this._dimValueGetterArrayRows=e_.arrayRows,this._rawExtent={},this._initDataFromProvider(0,e.count()),e.pure&&(this.hasItemOption=!1)},g_.getProvider=function(){return this._rawData},g_.appendData=function(e){var t=this._rawData,i=this.count();t.appendData(e);var n=t.count();t.persistent||(n+=i),this._initDataFromProvider(i,n)},g_.appendValues=function(e,t){for(var i=this._chunkSize,n=this._storage,r=this.dimensions,a=r.length,o=this._rawExtent,s=this.count(),l=s+Math.max(e.length,t?t.length:0),u=this._chunkCount,h=0;h<a;h++)o[v=r[h]]||(o[v]=[1/0,-1/0]),n[v]||(n[v]=[]),m_(n,this._dimensionInfos[v],i,u,l),this._chunkCount=n[v].length;for(var c=new Array(a),d=s;d<l;d++){for(var f=d-s,p=Math.floor(d/i),g=d%i,m=0;m<a;m++){var v=r[m],y=this._dimValueGetterArrayRows(e[f]||c,v,f,m);n[v][p][g]=y;var _=o[v];y<_[0]&&(_[0]=y),y>_[1]&&(_[1]=y)}t&&(this._nameList[d]=t[f])}this._rawCount=this._count=l,this._extent={},v_(this)},g_._initDataFromProvider=function(e,t){if(!(e>=t)){for(var i,n=this._chunkSize,r=this._rawData,a=this._storage,o=this.dimensions,s=o.length,l=this._dimensionInfos,u=this._nameList,h=this._idList,c=this._rawExtent,d=this._nameRepeatCount={},f=this._chunkCount,p=0;p<s;p++){c[b=o[p]]||(c[b]=[1/0,-1/0]);var g=l[b];0===g.otherDims.itemName&&(i=this._nameDimIdx=p),0===g.otherDims.itemId&&(this._idDimIdx=p),a[b]||(a[b]=[]),m_(a,g,n,f,t),this._chunkCount=a[b].length}for(var m=new Array(s),v=e;v<t;v++){m=r.getItem(v,m);for(var y=Math.floor(v/n),_=v%n,x=0;x<s;x++){var b,w=a[b=o[x]][y],T=this._dimValueGetter(m,b,v,x);w[_]=T;var S=c[b];T<S[0]&&(S[0]=T),T>S[1]&&(S[1]=T)}if(!r.pure){var M=u[v];if(m&&null==M)if(null!=m.name)u[v]=M=m.name;else if(null!=i){var A=o[i],I=a[A][y];if(I){M=I[_];var C=l[A].ordinalMeta;C&&C.categories.length&&(M=C.categories[M])}}var D=null==m?null:m.id;null==D&&null!=M&&(d[M]=d[M]||0,D=M,d[M]>0&&(D+="__ec__"+d[M]),d[M]++),null!=D&&(h[v]=D)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=t,this._extent={},v_(this)}},g_.count=function(){return this._count},g_.getIndices=function(){var e=this._indices;if(e){var t=e.constructor,i=this._count;if(t===Array){r=new t(i);for(var n=0;n<i;n++)r[n]=e[n]}else r=new t(e.buffer,0,i)}else{var r=new(t=h_(this))(this.count());for(n=0;n<r.length;n++)r[n]=n}return r},g_.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var i=this._storage;if(!i[e])return NaN;t=this.getRawIndex(t);var n=Math.floor(t/this._chunkSize),r=t%this._chunkSize;return i[e][n][r]},g_.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var i=this._storage[e];if(!i)return NaN;var n=Math.floor(t/this._chunkSize),r=t%this._chunkSize;return i[n][r]},g_._getFast=function(e,t){var i=Math.floor(t/this._chunkSize),n=t%this._chunkSize;return this._storage[e][i][n]},g_.getValues=function(e,t){var i=[];Yy.isArray(e)||(t=e,e=this.dimensions);for(var n=0,r=e.length;n<r;n++)i.push(this.get(e[n],t));return i},g_.hasValue=function(e){for(var t=this._dimensionsSummary.dataDimsOnCoord,i=0,n=t.length;i<n;i++)if(isNaN(this.get(t[i],e)))return!1;return!0},g_.getDataExtent=function(e){e=this.getDimension(e);var t=this._storage[e],i=[1/0,-1/0];if(!t)return i;var n,r=this.count();if(!this._indices)return this._rawExtent[e].slice();if(n=this._extent[e])return n.slice();for(var a=(n=i)[0],o=n[1],s=0;s<r;s++){var l=this._getFast(e,this.getRawIndex(s));l<a&&(a=l),l>o&&(o=l)}return n=[a,o],this._extent[e]=n,n},g_.getApproximateExtent=function(e){return e=this.getDimension(e),this._approximateExtent[e]||this.getDataExtent(e)},g_.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},g_.getCalculationInfo=function(e){return this._calculationInfo[e]},g_.setCalculationInfo=function(e,t){r_(e)?Yy.extend(this._calculationInfo,e):this._calculationInfo[e]=t},g_.getSum=function(e){var t=0;if(this._storage[e])for(var i=0,n=this.count();i<n;i++){var r=this.get(e,i);isNaN(r)||(t+=r)}return t},g_.getMedian=function(e){var t=[];this.each(e,(function(e,i){isNaN(e)||t.push(e)}));var i=[].concat(t).sort((function(e,t){return e-t})),n=this.count();return 0===n?0:n%2==1?i[(n-1)/2]:(i[n/2]+i[n/2-1])/2},g_.rawIndexOf=function(e,t){var i=(e&&this._invertedIndicesMap[e])[t];return null==i||isNaN(i)?-1:i},g_.indexOfName=function(e){for(var t=0,i=this.count();t<i;t++)if(this.getName(t)===e)return t;return-1},g_.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,i=t[e];if(null!=i&&i<this._count&&i===e)return e;for(var n=0,r=this._count-1;n<=r;){var a=(n+r)/2|0;if(t[a]<e)n=a+1;else{if(!(t[a]>e))return a;r=a-1}}return-1},g_.indicesOfNearest=function(e,t,i){var n=[];if(!this._storage[e])return n;null==i&&(i=1/0);for(var r=1/0,a=-1,o=0,s=0,l=this.count();s<l;s++){var u=t-this.get(e,s),h=Math.abs(u);h<=i&&((h<r||h===r&&u>=0&&a<0)&&(r=h,a=u,o=0),u===a&&(n[o++]=s))}return n.length=o,n},g_.getRawIndex=__,g_.getRawDataItem=function(e){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(e));for(var t=[],i=0;i<this.dimensions.length;i++){var n=this.dimensions[i];t.push(this.get(n,e))}return t},g_.getName=function(e){var t=this.getRawIndex(e);return this._nameList[t]||y_(this,this._nameDimIdx,t)||""},g_.getId=function(e){return b_(this,this.getRawIndex(e))},g_.each=function(e,t,i,n){if(this._count){"function"==typeof e&&(n=i,i=t,t=e,e=[]),i=i||n||this;for(var r=(e=Yy.map(w_(e),this.getDimension,this)).length,a=0;a<this.count();a++)switch(r){case 0:t.call(i,a);break;case 1:t.call(i,this.get(e[0],a),a);break;case 2:t.call(i,this.get(e[0],a),this.get(e[1],a),a);break;default:for(var o=0,s=[];o<r;o++)s[o]=this.get(e[o],a);s[o]=a,t.apply(i,s)}}},g_.filterSelf=function(e,t,i,n){if(this._count){"function"==typeof e&&(n=i,i=t,t=e,e=[]),i=i||n||this,e=Yy.map(w_(e),this.getDimension,this);for(var r=this.count(),a=new(h_(this))(r),o=[],s=e.length,l=0,u=e[0],h=0;h<r;h++){var c,d=this.getRawIndex(h);if(0===s)c=t.call(i,h);else if(1===s){var f=this._getFast(u,d);c=t.call(i,f,h)}else{for(var p=0;p<s;p++)o[p]=this._getFast(u,d);o[p]=h,c=t.apply(i,o)}c&&(a[l++]=d)}return l<r&&(this._indices=a),this._count=l,this._extent={},this.getRawIndex=this._indices?x_:__,this}},g_.selectRange=function(e){if(this._count){var t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i);var n=t.length;if(n){var r=this.count(),a=new(h_(this))(r),o=0,s=t[0],l=e[s][0],u=e[s][1],h=!1;if(!this._indices){var c=0;if(1===n){for(var d=this._storage[t[0]],f=0;f<this._chunkCount;f++)for(var p=d[f],g=Math.min(this._count-f*this._chunkSize,this._chunkSize),m=0;m<g;m++)((b=p[m])>=l&&b<=u||isNaN(b))&&(a[o++]=c),c++;h=!0}else if(2===n){d=this._storage[s];var v=this._storage[t[1]],y=e[t[1]][0],_=e[t[1]][1];for(f=0;f<this._chunkCount;f++){p=d[f];var x=v[f];for(g=Math.min(this._count-f*this._chunkSize,this._chunkSize),m=0;m<g;m++){var b=p[m],w=x[m];(b>=l&&b<=u||isNaN(b))&&(w>=y&&w<=_||isNaN(w))&&(a[o++]=c),c++}}h=!0}}if(!h)if(1===n)for(m=0;m<r;m++){var T=this.getRawIndex(m);((b=this._getFast(s,T))>=l&&b<=u||isNaN(b))&&(a[o++]=T)}else for(m=0;m<r;m++){var S=!0;for(T=this.getRawIndex(m),f=0;f<n;f++){var M=t[f];((b=this._getFast(i,T))<e[M][0]||b>e[M][1])&&(S=!1)}S&&(a[o++]=this.getRawIndex(m))}return o<r&&(this._indices=a),this._count=o,this._extent={},this.getRawIndex=this._indices?x_:__,this}}},g_.mapArray=function(e,t,i,n){"function"==typeof e&&(n=i,i=t,t=e,e=[]),i=i||n||this;var r=[];return this.each(e,(function(){r.push(t&&t.apply(this,arguments))}),i),r},g_.map=function(e,t,i,n){i=i||n||this;var r=T_(this,e=Yy.map(w_(e),this.getDimension,this));r._indices=this._indices,r.getRawIndex=r._indices?x_:__;for(var a=r._storage,o=[],s=this._chunkSize,l=e.length,u=this.count(),h=[],c=r._rawExtent,d=0;d<u;d++){for(var f=0;f<l;f++)h[f]=this.get(e[f],d);h[l]=d;var p=t&&t.apply(i,h);if(null!=p){"object"!=typeof p&&(o[0]=p,p=o);for(var g=this.getRawIndex(d),m=Math.floor(g/s),v=g%s,y=0;y<p.length;y++){var _=e[y],x=p[y],b=c[_],w=a[_];w&&(w[m][v]=x),x<b[0]&&(b[0]=x),x>b[1]&&(b[1]=x)}}}return r},g_.downSample=function(e,t,i,n){for(var r=T_(this,[e]),a=r._storage,o=[],s=Math.floor(1/t),l=a[e],u=this.count(),h=this._chunkSize,c=r._rawExtent[e],d=new(h_(this))(u),f=0,p=0;p<u;p+=s){s>u-p&&(s=u-p,o.length=s);for(var g=0;g<s;g++){var m=this.getRawIndex(p+g),v=Math.floor(m/h),y=m%h;o[g]=l[v][y]}var _=i(o),x=this.getRawIndex(Math.min(p+n(o,_)||0,u-1)),b=x%h;l[Math.floor(x/h)][b]=_,_<c[0]&&(c[0]=_),_>c[1]&&(c[1]=_),d[f++]=x}return r._count=f,r._indices=d,r.getRawIndex=x_,r},g_.getItemModel=function(e){var t=this.hostModel;return new Ky(this.getRawDataItem(e),t,t&&t.ecModel)},g_.diff=function(e){var t=this;return new Qy(e?e.getIndices():[],this.getIndices(),(function(t){return b_(e,t)}),(function(e){return b_(t,e)}))},g_.getVisual=function(e){var t=this._visual;return t&&t[e]},g_.setVisual=function(e,t){if(r_(e))for(var i in e)e.hasOwnProperty(i)&&this.setVisual(i,e[i]);else this._visual=this._visual||{},this._visual[e]=t},g_.setLayout=function(e,t){if(r_(e))for(var i in e)e.hasOwnProperty(i)&&this.setLayout(i,e[i]);else this._layout[e]=t},g_.getLayout=function(e){return this._layout[e]},g_.getItemLayout=function(e){return this._itemLayouts[e]},g_.setItemLayout=function(e,t,i){this._itemLayouts[e]=i?Yy.extend(this._itemLayouts[e]||{},t):t},g_.clearItemLayouts=function(){this._itemLayouts.length=0},g_.getItemVisual=function(e,t,i){var n=this._itemVisuals[e],r=n&&n[t];return null!=r||i?r:this.getVisual(t)},g_.setItemVisual=function(e,t,i){var n=this._itemVisuals[e]||{},r=this.hasItemVisual;if(this._itemVisuals[e]=n,r_(t))for(var a in t)t.hasOwnProperty(a)&&(n[a]=t[a],r[a]=!0);else n[t]=i,r[t]=!0},g_.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var M_=function(e){e.seriesIndex=this.seriesIndex,e.dataIndex=this.dataIndex,e.dataType=this.dataType};g_.setItemGraphicEl=function(e,t){var i=this.hostModel;t&&(t.dataIndex=e,t.dataType=this.dataType,t.seriesIndex=i&&i.seriesIndex,"group"===t.type&&t.traverse(M_,t)),this._graphicEls[e]=t},g_.getItemGraphicEl=function(e){return this._graphicEls[e]},g_.eachItemGraphicEl=function(e,t){Yy.each(this._graphicEls,(function(i,n){i&&e&&e.call(t,i,n)}))},g_.cloneShallow=function(e){if(!e){var t=Yy.map(this.dimensions,this.getDimensionInfo,this);e=new p_(t,this.hostModel)}if(e._storage=this._storage,f_(e,this),this._indices){var i=this._indices.constructor;e._indices=new i(this._indices)}else e._indices=null;return e.getRawIndex=e._indices?x_:__,e},g_.wrapMethod=function(e,t){var i=this[e];"function"==typeof i&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=i.apply(this,arguments);return t.apply(this,[e].concat(Yy.slice(arguments)))})},g_.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],g_.CHANGABLE_METHODS=["filterSelf","selectRange"];var A_=p_,I_=g,C_=I_.createHashMap,D_=I_.each,E_=I_.isString,L_=I_.defaults,P_=I_.extend,N_=I_.isObject,R_=I_.clone,O_=lo.normalizeToArray,k_=Vd,z_=k_.guessOrdinal,B_=k_.BE_ORDINAL,F_=$d,V_=Gy.OTHER_DIMENSIONS,G_=qy;function H_(e,t,i){if(i||null!=t.get(e)){for(var n=0;null!=t.get(e+n);)n++;e+=n}return t.set(e,!0),e}var U_=function(e,t,i){F_.isInstance(t)||(t=F_.seriesDataToSource(t)),i=i||{},e=(e||[]).slice();for(var n=(i.dimsDef||[]).slice(),r=C_(),a=C_(),o=[],s=function(e,t,i,n){var r=Math.max(e.dimensionsDetectCount||1,t.length,i.length,n||0);return D_(t,(function(e){var t=e.dimsDef;t&&(r=Math.max(r,t.length))})),r}(t,e,n,i.dimCount),l=0;l<s;l++){var u=n[l]=P_({},N_(n[l])?n[l]:{name:n[l]}),h=u.name,c=o[l]=new G_;null!=h&&null==r.get(h)&&(c.name=c.displayName=h,r.set(h,l)),null!=u.type&&(c.type=u.type),null!=u.displayName&&(c.displayName=u.displayName)}var d=i.encodeDef;!d&&i.encodeDefaulter&&(d=i.encodeDefaulter(t,s)),(d=C_(d)).each((function(e,t){if(1===(e=O_(e).slice()).length&&!E_(e[0])&&e[0]<0)d.set(t,!1);else{var i=d.set(t,[]);D_(e,(function(e,n){E_(e)&&(e=r.get(e)),null!=e&&e<s&&(i[n]=e,p(o[e],t,n))}))}}));var f=0;function p(e,t,i){null!=V_.get(t)?e.otherDims[t]=i:(e.coordDim=t,e.coordDimIndex=i,a.set(t,!0))}D_(e,(function(e,t){var i,n,r;if(E_(e))i=e,e={};else{i=e.name;var a=e.ordinalMeta;e.ordinalMeta=null,(e=R_(e)).ordinalMeta=a,n=e.dimsDef,r=e.otherDims,e.name=e.coordDim=e.coordDimIndex=e.dimsDef=e.otherDims=null}if(!1!==(s=d.get(i))){var s;if(!(s=O_(s)).length)for(var l=0;l<(n&&n.length||1);l++){for(;f<o.length&&null!=o[f].coordDim;)f++;f<o.length&&s.push(f++)}D_(s,(function(t,a){var s=o[t];if(p(L_(s,e),i,a),null==s.name&&n){var l=n[a];!N_(l)&&(l={name:l}),s.name=s.displayName=l.name,s.defaultTooltip=l.defaultTooltip}r&&L_(s.otherDims,r)}))}}));var g=i.generateCoord,m=i.generateCoordCount,v=null!=m;m=g?m||1:0;for(var y=g||"value",_=0;_<s;_++)null==(c=o[_]=o[_]||new G_).coordDim&&(c.coordDim=H_(y,a,v),c.coordDimIndex=0,(!g||m<=0)&&(c.isExtraCoord=!0),m--),null==c.name&&(c.name=H_(c.coordDim,r)),null!=c.type||z_(t,_,c.name)!==B_.Must&&(!c.isExtraCoord||null==c.otherDims.itemName&&null==c.otherDims.seriesName)||(c.type="ordinal");return o},W_=U_,j_=W_,X_=function(e,t){return j_((t=t||{}).coordDimensions||[],e,{dimsDef:t.dimensionsDefine||e.dimensionsDefine,encodeDef:t.encodeDefine||e.encodeDefine,dimCount:t.dimensionsCount,encodeDefaulter:t.encodeDefaulter,generateCoord:t.generateCoord,generateCoordCount:t.generateCoordCount})},Z_={},q_=g,Y_=q_.createHashMap;q_.retrieve;var K_=q_.each;function Q_(e){this.coordSysName=e,this.coordSysDims=[],this.axisMap=Y_(),this.categoryAxisMap=Y_(),this.firstCategoryDimIndex=null}var J_={cartesian2d:function(e,t,i,n){var r=e.getReferringComponents("xAxis")[0],a=e.getReferringComponents("yAxis")[0];t.coordSysDims=["x","y"],i.set("x",r),i.set("y",a),$_(r)&&(n.set("x",r),t.firstCategoryDimIndex=0),$_(a)&&(n.set("y",a),t.firstCategoryDimIndex,t.firstCategoryDimIndex=1)},singleAxis:function(e,t,i,n){var r=e.getReferringComponents("singleAxis")[0];t.coordSysDims=["single"],i.set("single",r),$_(r)&&(n.set("single",r),t.firstCategoryDimIndex=0)},polar:function(e,t,i,n){var r=e.getReferringComponents("polar")[0],a=r.findAxisModel("radiusAxis"),o=r.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],i.set("radius",a),i.set("angle",o),$_(a)&&(n.set("radius",a),t.firstCategoryDimIndex=0),$_(o)&&(n.set("angle",o),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},geo:function(e,t,i,n){t.coordSysDims=["lng","lat"]},parallel:function(e,t,i,n){var r=e.ecModel,a=r.getComponent("parallel",e.get("parallelIndex")),o=t.coordSysDims=a.dimensions.slice();K_(a.parallelAxisIndex,(function(e,a){var s=r.getComponent("parallelAxis",e),l=o[a];i.set(l,s),$_(s)&&null==t.firstCategoryDimIndex&&(n.set(l,s),t.firstCategoryDimIndex=a)}))}};function $_(e){return"category"===e.get("type")}Z_.getCoordSysInfoBySeries=function(e){var t=e.get("coordinateSystem"),i=new Q_(t),n=J_[t];if(n)return n(e,i,i.axisMap,i.categoryAxisMap),i};var ex={},tx=g,ix=tx.each,nx=tx.isString;function rx(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}ex.enableDataStack=function(e,t,i){var n,r,a,o,s=(i=i||{}).byIndex,l=i.stackedCoordDimension,u=!(!e||!e.get("stack"));if(ix(t,(function(e,i){nx(e)&&(t[i]=e={name:e}),u&&!e.isExtraCoord&&(s||n||!e.ordinalMeta||(n=e),r||"ordinal"===e.type||"time"===e.type||l&&l!==e.coordDim||(r=e))})),!r||s||n||(s=!0),r){a="__\0ecstackresult",o="__\0ecstackedover",n&&(n.createInvertedIndices=!0);var h=r.coordDim,c=r.type,d=0;ix(t,(function(e){e.coordDim===h&&d++})),t.push({name:a,coordDim:h,coordDimIndex:d,type:c,isExtraCoord:!0,isCalculationCoord:!0}),d++,t.push({name:o,coordDim:o,coordDimIndex:d,type:c,isExtraCoord:!0,isCalculationCoord:!0})}return{stackedDimension:r&&r.name,stackedByDimension:n&&n.name,isStackedByIndex:s,stackedOverDimension:o,stackResultDimension:a}},ex.isDimensionStacked=rx,ex.getStackedDimension=function(e,t){return rx(e,t)?e.getCalculationInfo("stackResultDimension"):t};var ax=g,ox=A_,sx=X_,lx=Gd.SOURCE_FORMAT_ORIGINAL,ux=Gy.getDimensionTypeByAxis,hx=lo.getDataItemValue,cx=sp,dx=Z_.getCoordSysInfoBySeries,fx=$d,px=ex.enableDataStack,gx=Vd.makeSeriesEncodeForAxisCoordSys,mx=function(e,t,i){i=i||{},fx.isInstance(e)||(e=fx.seriesDataToSource(e));var n,r=t.get("coordinateSystem"),a=cx.get(r),o=dx(t);o&&(n=ax.map(o.coordSysDims,(function(e){var t={name:e},i=o.axisMap.get(e);if(i){var n=i.get("type");t.type=ux(n)}return t}))),n||(n=a&&(a.getDimensionsInfo?a.getDimensionsInfo():a.dimensions.slice())||["x","y"]);var s,l,u=sx(e,{coordDimensions:n,generateCoord:i.generateCoord,encodeDefaulter:i.useEncodeDefaulter?ax.curry(gx,n,t):null});o&&ax.each(u,(function(e,t){var i=e.coordDim,n=o.categoryAxisMap.get(i);n&&(null==s&&(s=t),e.ordinalMeta=n.getOrdinalMeta()),null!=e.otherDims.itemName&&(l=!0)})),l||null==s||(u[s].otherDims.itemName=0);var h=px(t,u),c=new ox(u,t);c.setCalculationInfo(h);var d=null!=s&&function(e){if(e.sourceFormat===lx){var t=function(e){for(var t=0;t<e.length&&null==e[t];)t++;return e[t]}(e.data||[]);return null!=t&&!ax.isArray(hx(t))}}(e)?function(e,t,i,n){return n===s?i:this.defaultDimValueGetter(e,t,i,n)}:null;return c.hasItemOption=!1,c.initData(e,null,d),c},vx=mx,yx={},_x=xo;function xx(e){this._setting=e||{},this._extent=[1/0,-1/0],this._interval=0,this.init&&this.init.apply(this,arguments)}xx.prototype.parse=function(e){return e},xx.prototype.getSetting=function(e){return this._setting[e]},xx.prototype.contain=function(e){var t=this._extent;return e>=t[0]&&e<=t[1]},xx.prototype.normalize=function(e){var t=this._extent;return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])},xx.prototype.scale=function(e){var t=this._extent;return e*(t[1]-t[0])+t[0]},xx.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1])},xx.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},xx.prototype.getExtent=function(){return this._extent.slice()},xx.prototype.setExtent=function(e,t){var i=this._extent;isNaN(e)||(i[0]=e),isNaN(t)||(i[1]=t)},xx.prototype.isBlank=function(){return this._isBlank},xx.prototype.setBlank=function(e){this._isBlank=e},xx.prototype.getLabel=null,_x.enableClassExtend(xx),_x.enableClassManagement(xx,{registerWhenExtend:!0});var bx=xx,Tx=g,Sx=Tx.createHashMap,Mx=Tx.isObject,Ax=Tx.map;function Ix(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this._map}Ix.createByAxisModel=function(e){var t=e.option,i=t.data,n=i&&Ax(i,Ex);return new Ix({categories:n,needCollect:!n,deduplication:!1!==t.dedplication})};var Cx=Ix.prototype;function Dx(e){return e._map||(e._map=Sx(e.categories))}function Ex(e){return Mx(e)&&null!=e.value?e.value:e+""}Cx.getOrdinal=function(e){return Dx(this).get(e)},Cx.parseAndCollect=function(e){var t,i=this._needCollect;if("string"!=typeof e&&!i)return e;if(i&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var n=Dx(this);return null==(t=n.get(e))&&(i?(t=this.categories.length,this.categories[t]=e,n.set(e,t)):t=NaN),t};var Lx=Ix,Px=g,Nx=bx,Rx=Lx,Ox=Nx.prototype,kx=Nx.extend({type:"ordinal",init:function(e,t){e&&!Px.isArray(e)||(e=new Rx({categories:e})),this._ordinalMeta=e,this._extent=t||[0,e.categories.length-1]},parse:function(e){return"string"==typeof e?this._ordinalMeta.getOrdinal(e):Math.round(e)},contain:function(e){return e=this.parse(e),Ox.contain.call(this,e)&&null!=this._ordinalMeta.categories[e]},normalize:function(e){return Ox.normalize.call(this,this.parse(e))},scale:function(e){return Math.round(Ox.scale.call(this,e))},getTicks:function(){for(var e=[],t=this._extent,i=t[0];i<=t[1];)e.push(i),i++;return e},getLabel:function(e){if(!this.isBlank())return this._ordinalMeta.categories[e]},count:function(){return this._extent[1]-this._extent[0]+1},unionExtentFromData:function(e,t){this.unionExtent(e.getApproximateExtent(t))},getOrdinalMeta:function(){return this._ordinalMeta},niceTicks:Px.noop,niceExtent:Px.noop});kx.create=function(){return new kx};var zx=kx,Bx={},Fx=Uc,Vx=Fx.round;function Gx(e){return Fx.getPrecisionSafe(e)+2}function Hx(e,t,i){e[t]=Math.max(Math.min(e[t],i[1]),i[0])}function Ux(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),Hx(e,0,t),Hx(e,1,t),e[0]>e[1]&&(e[0]=e[1])}Bx.intervalScaleNiceTicks=function(e,t,i,n){var r={},a=e[1]-e[0],o=r.interval=Fx.nice(a/t,!0);null!=i&&o<i&&(o=r.interval=i),null!=n&&o>n&&(o=r.interval=n);var s=r.intervalPrecision=Gx(o);return Ux(r.niceTickExtent=[Vx(Math.ceil(e[0]/o)*o,s),Vx(Math.floor(e[1]/o)*o,s)],e),r},Bx.getIntervalPrecision=Gx,Bx.fixExtent=Ux;var Wx=Uc,jx=qc,Xx=bx,Zx=Bx,qx=Wx.round,Yx=Xx.extend({type:"interval",_interval:0,_intervalPrecision:2,setExtent:function(e,t){var i=this._extent;isNaN(e)||(i[0]=parseFloat(e)),isNaN(t)||(i[1]=parseFloat(t))},unionExtent:function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1]),Yx.prototype.setExtent.call(this,t[0],t[1])},getInterval:function(){return this._interval},setInterval:function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=Zx.getIntervalPrecision(e)},getTicks:function(e){var t=this._interval,i=this._extent,n=this._niceExtent,r=this._intervalPrecision,a=[];if(!t)return a;i[0]<n[0]&&(e?a.push(qx(n[0]-t,r)):a.push(i[0]));for(var o=n[0];o<=n[1]&&(a.push(o),(o=qx(o+t,r))!==a[a.length-1]);)if(a.length>1e4)return[];var s=a.length?a[a.length-1]:n[1];return i[1]>s&&(e?a.push(qx(s+t,r)):a.push(i[1])),a},getMinorTicks:function(e){for(var t=this.getTicks(!0),i=[],n=this.getExtent(),r=1;r<t.length;r++){for(var a=t[r],o=t[r-1],s=0,l=[],u=(a-o)/e;s<e-1;){var h=Wx.round(o+(s+1)*u);h>n[0]&&h<n[1]&&l.push(h),s++}i.push(l)}return i},getLabel:function(e,t){if(null==e)return"";var i=t&&t.precision;return null==i?i=Wx.getPrecisionSafe(e)||0:"auto"===i&&(i=this._intervalPrecision),e=qx(e,i,!0),jx.addCommas(e)},niceTicks:function(e,t,i){e=e||5;var n=this._extent,r=n[1]-n[0];if(isFinite(r)){r<0&&(r=-r,n.reverse());var a=Zx.intervalScaleNiceTicks(n,e,t,i);this._intervalPrecision=a.intervalPrecision,this._interval=a.interval,this._niceExtent=a.niceTickExtent}},niceExtent:function(e){var t=this._extent;if(t[0]===t[1])if(0!==t[0]){var i=t[0];e.fixMax||(t[1]+=i/2),t[0]-=i/2}else t[1]=1;var n=t[1]-t[0];isFinite(n)||(t[0]=0,t[1]=1),this.niceTicks(e.splitNumber,e.minInterval,e.maxInterval);var r=this._interval;e.fixMin||(t[0]=qx(Math.floor(t[0]/r)*r)),e.fixMax||(t[1]=qx(Math.ceil(t[1]/r)*r))}});Yx.create=function(){return new Yx};var Kx=Yx,Qx={},Jx=g,$x=Uc.parsePercent,eb=ex.isDimensionStacked,tb="__ec_stack_",ib="undefined"!=typeof Float32Array?Float32Array:Array;function nb(e){return e.get("stack")||tb+e.seriesIndex}function rb(e){return e.dim+e.index}function ab(e,t){var i=[];return t.eachSeriesByType(e,(function(e){hb(e)&&!cb(e)&&i.push(e)})),i}function ob(e){var t=function(e){var t={};Jx.each(e,(function(e){var i=e.coordinateSystem.getBaseAxis();if("time"===i.type||"value"===i.type)for(var n=e.getData(),r=i.dim+"_"+i.index,a=n.mapDimension(i.dim),o=0,s=n.count();o<s;++o){var l=n.get(a,o);t[r]?t[r].push(l):t[r]=[l]}}));var i=[];for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(r){r.sort((function(e,t){return e-t}));for(var a=null,o=1;o<r.length;++o){var s=r[o]-r[o-1];s>0&&(a=null===a?s:Math.min(a,s))}i[n]=a}}return i}(e),i=[];return Jx.each(e,(function(e){var n,r=e.coordinateSystem.getBaseAxis(),a=r.getExtent();if("category"===r.type)n=r.getBandWidth();else if("value"===r.type||"time"===r.type){var o=r.dim+"_"+r.index,s=t[o],l=Math.abs(a[1]-a[0]),u=r.scale.getExtent(),h=Math.abs(u[1]-u[0]);n=s?l/h*s:l}else{var c=e.getData();n=Math.abs(a[1]-a[0])/c.count()}var d=$x(e.get("barWidth"),n),f=$x(e.get("barMaxWidth"),n),p=$x(e.get("barMinWidth")||1,n),g=e.get("barGap"),m=e.get("barCategoryGap");i.push({bandWidth:n,barWidth:d,barMaxWidth:f,barMinWidth:p,barGap:g,barCategoryGap:m,axisKey:rb(r),stackId:nb(e)})})),sb(i)}function sb(e){var t={};Jx.each(e,(function(e,i){var n=e.axisKey,r=e.bandWidth,a=t[n]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},o=a.stacks;t[n]=a;var s=e.stackId;o[s]||a.autoWidthCount++,o[s]=o[s]||{width:0,maxWidth:0};var l=e.barWidth;l&&!o[s].width&&(o[s].width=l,l=Math.min(a.remainedWidth,l),a.remainedWidth-=l);var u=e.barMaxWidth;u&&(o[s].maxWidth=u);var h=e.barMinWidth;h&&(o[s].minWidth=h);var c=e.barGap;null!=c&&(a.gap=c);var d=e.barCategoryGap;null!=d&&(a.categoryGap=d)}));var i={};return Jx.each(t,(function(e,t){i[t]={};var n=e.stacks,r=e.bandWidth,a=$x(e.categoryGap,r),o=$x(e.gap,1),s=e.remainedWidth,l=e.autoWidthCount,u=(s-a)/(l+(l-1)*o);u=Math.max(u,0),Jx.each(n,(function(e){var t=e.maxWidth,i=e.minWidth;if(e.width)n=e.width,t&&(n=Math.min(n,t)),i&&(n=Math.max(n,i)),e.width=n,s-=n+o*n,l--;else{var n=u;t&&t<n&&(n=Math.min(t,s)),i&&i>n&&(n=i),n!==u&&(e.width=n,s-=n+o*n,l--)}})),u=(s-a)/(l+(l-1)*o),u=Math.max(u,0);var h,c=0;Jx.each(n,(function(e,t){e.width||(e.width=u),h=e,c+=e.width*(1+o)})),h&&(c-=h.width*o);var d=-c/2;Jx.each(n,(function(e,n){i[t][n]=i[t][n]||{bandWidth:r,offset:d,width:e.width},d+=e.width*(1+o)}))})),i}function lb(e,t,i){if(e&&t){var n=e[rb(t)];return null!=n&&null!=i&&(n=n[nb(i)]),n}}var ub={seriesType:"bar",plan:vm(),reset:function(e){if(hb(e)&&cb(e)){var t=e.getData(),i=e.coordinateSystem,n=i.grid.getRect(),r=i.getBaseAxis(),a=i.getOtherAxis(r),o=t.mapDimension(a.dim),s=t.mapDimension(r.dim),l=a.isHorizontal(),u=l?0:1,h=lb(ob([e]),r,e).width;return h>.5||(h=.5),{progress:function(e,t){for(var r,c=e.count,d=new ib(2*c),f=new ib(2*c),p=new ib(c),g=[],m=[],v=0,y=0;null!=(r=e.next());)m[u]=t.get(o,r),m[1-u]=t.get(s,r),g=i.dataToPoint(m,null,g),f[v]=l?n.x+n.width:g[0],d[v++]=g[0],f[v]=l?g[1]:n.y+n.height,d[v++]=g[1],p[y++]=r;t.setLayout({largePoints:d,largeDataIndices:p,largeBackgroundPoints:f,barWidth:h,valueAxisStart:db(0,a),backgroundStart:l?n.x:n.y,valueAxisHorizontal:l})}}}}};function hb(e){return e.coordinateSystem&&"cartesian2d"===e.coordinateSystem.type}function cb(e){return e.pipelineContext&&e.pipelineContext.large}function db(e,t,i){return t.toGlobalCoord(t.dataToCoord("log"===t.type?1:0))}Qx.getLayoutOnAxis=function(e){var t=[],i=e.axis,n="axis0";if("category"===i.type){for(var r=i.getBandWidth(),a=0;a<e.count;a++)t.push(Jx.defaults({bandWidth:r,axisKey:n,stackId:tb+a},e));var o=sb(t),s=[];for(a=0;a<e.count;a++){var l=o.axis0[tb+a];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}},Qx.prepareLayoutBarSeries=ab,Qx.makeColumnLayout=ob,Qx.retrieveColumnLayout=lb,Qx.layout=function(e,t){var i=ab(e,t),n=ob(i),r={},a={};Jx.each(i,(function(e){var t=e.getData(),i=e.coordinateSystem,o=i.getBaseAxis(),s=nb(e),l=n[rb(o)][s],u=l.offset,h=l.width,c=i.getOtherAxis(o),d=e.get("barMinHeight")||0;r[s]=r[s]||[],a[s]=a[s]||[],t.setLayout({bandWidth:l.bandWidth,offset:u,size:h});for(var f=t.mapDimension(c.dim),p=t.mapDimension(o.dim),g=eb(t,f),m=c.isHorizontal(),v=db(0,c),y=0,_=t.count();y<_;y++){var x,b,w,T,S,M=t.get(f,y),A=t.get(p,y),I=M>=0?"p":"n",C=v;g&&(r[s][A]||(r[s][A]={p:v,n:v}),C=r[s][A][I]),m?(x=C,b=(S=i.dataToPoint([M,A]))[1]+u,w=S[0]-v,T=h,Math.abs(w)<d&&(w=(w<0?-1:1)*d),isNaN(w)||g&&(r[s][A][I]+=w)):(x=(S=i.dataToPoint([A,M]))[0]+u,b=C,w=h,T=S[1]-v,Math.abs(T)<d&&(T=(T<=0?-1:1)*d),isNaN(T)||g&&(r[s][A][I]+=T)),t.setItemLayout(y,{x:x,y:b,width:w,height:T})}}),this)},Qx.largeLayout=ub;var fb=g,pb=Uc,gb=qc,mb=Bx,vb=Kx,yb=vb.prototype,_b=Math.ceil,xb=Math.floor,bb=1e3,wb=6e4,Tb=36e5,Sb=864e5,Mb=vb.extend({type:"time",getLabel:function(e){var t=this._stepLvl,i=new Date(e);return gb.formatTime(t[0],i,this.getSetting("useUTC"))},niceExtent:function(e){var t=this._extent;if(t[0]===t[1]&&(t[0]-=Sb,t[1]+=Sb),t[1]===-1/0&&t[0]===1/0){var i=new Date;t[1]=+new Date(i.getFullYear(),i.getMonth(),i.getDate()),t[0]=t[1]-Sb}this.niceTicks(e.splitNumber,e.minInterval,e.maxInterval);var n=this._interval;e.fixMin||(t[0]=pb.round(xb(t[0]/n)*n)),e.fixMax||(t[1]=pb.round(_b(t[1]/n)*n))},niceTicks:function(e,t,i){e=e||10;var n=this._extent,r=n[1]-n[0],a=r/e;null!=t&&a<t&&(a=t),null!=i&&a>i&&(a=i);var o=Ab.length,s=function(e,t,i,n){for(;i<n;){var r=i+n>>>1;e[r][1]<t?i=r+1:n=r}return i}(Ab,a,0,o),l=Ab[Math.min(s,o-1)],u=l[1];if("year"===l[0]){var h=r/u;u*=pb.nice(h/e,!0)}var c=this.getSetting("useUTC")?0:60*new Date(+n[0]||+n[1]).getTimezoneOffset()*1e3,d=[Math.round(_b((n[0]-c)/u)*u+c),Math.round(xb((n[1]-c)/u)*u+c)];mb.fixExtent(d,n),this._stepLvl=l,this._interval=u,this._niceExtent=d},parse:function(e){return+pb.parseDate(e)}});fb.each(["contain","normalize"],(function(e){Mb.prototype[e]=function(t){return yb[e].call(this,this.parse(t))}}));var Ab=[["hh:mm:ss",bb],["hh:mm:ss",5e3],["hh:mm:ss",1e4],["hh:mm:ss",15e3],["hh:mm:ss",3e4],["hh:mm\nMM-dd",wb],["hh:mm\nMM-dd",3e5],["hh:mm\nMM-dd",6e5],["hh:mm\nMM-dd",9e5],["hh:mm\nMM-dd",18e5],["hh:mm\nMM-dd",Tb],["hh:mm\nMM-dd",72e5],["hh:mm\nMM-dd",216e5],["hh:mm\nMM-dd",432e5],["MM-dd\nyyyy",Sb],["MM-dd\nyyyy",1728e5],["MM-dd\nyyyy",2592e5],["MM-dd\nyyyy",3456e5],["MM-dd\nyyyy",432e6],["MM-dd\nyyyy",5184e5],["week",6048e5],["MM-dd\nyyyy",864e6],["week",12096e5],["week",18144e5],["month",26784e5],["week",36288e5],["month",53568e5],["week",6048e6],["quarter",8208e6],["month",107136e5],["month",13392e6],["half-year",16416e6],["month",214272e5],["month",26784e6],["year",32832e6]];Mb.create=function(e){return new Mb({useUTC:e.ecModel.get("useUTC")})};var Ib=g,Cb=bx,Db=Uc,Eb=Kx,Lb=Cb.prototype,Pb=Eb.prototype,Nb=Db.getPrecisionSafe,Rb=Db.round,Ob=Math.floor,kb=Math.ceil,zb=Math.pow,Bb=Math.log,Fb=Cb.extend({type:"log",base:10,$constructor:function(){Cb.apply(this,arguments),this._originalScale=new Eb},getTicks:function(e){var t=this._originalScale,i=this._extent,n=t.getExtent();return Ib.map(Pb.getTicks.call(this,e),(function(e){var r=Db.round(zb(this.base,e));return r=e===i[0]&&t.__fixMin?Vb(r,n[0]):r,r=e===i[1]&&t.__fixMax?Vb(r,n[1]):r}),this)},getMinorTicks:Pb.getMinorTicks,getLabel:Pb.getLabel,scale:function(e){return e=Lb.scale.call(this,e),zb(this.base,e)},setExtent:function(e,t){var i=this.base;e=Bb(e)/Bb(i),t=Bb(t)/Bb(i),Pb.setExtent.call(this,e,t)},getExtent:function(){var e=this.base,t=Lb.getExtent.call(this);t[0]=zb(e,t[0]),t[1]=zb(e,t[1]);var i=this._originalScale,n=i.getExtent();return i.__fixMin&&(t[0]=Vb(t[0],n[0])),i.__fixMax&&(t[1]=Vb(t[1],n[1])),t},unionExtent:function(e){this._originalScale.unionExtent(e);var t=this.base;e[0]=Bb(e[0])/Bb(t),e[1]=Bb(e[1])/Bb(t),Lb.unionExtent.call(this,e)},unionExtentFromData:function(e,t){this.unionExtent(e.getApproximateExtent(t))},niceTicks:function(e){e=e||10;var t=this._extent,i=t[1]-t[0];if(!(i===1/0||i<=0)){var n=Db.quantity(i);for(e/i*n<=.5&&(n*=10);!isNaN(n)&&Math.abs(n)<1&&Math.abs(n)>0;)n*=10;var r=[Db.round(kb(t[0]/n)*n),Db.round(Ob(t[1]/n)*n)];this._interval=n,this._niceExtent=r}},niceExtent:function(e){Pb.niceExtent.call(this,e);var t=this._originalScale;t.__fixMin=e.fixMin,t.__fixMax=e.fixMax}});function Vb(e,t){return Rb(e,Nb(t))}Ib.each(["contain","normalize"],(function(e){Fb.prototype[e]=function(t){return t=Bb(t)/Bb(this.base),Lb[e].call(this,t)}})),Fb.create=function(){return new Fb};var Gb=Fb,Hb=g,Ub=zx,Wb=Kx,jb=bx,Xb=Uc,Zb=Qx,qb=Zb.prepareLayoutBarSeries,Yb=Zb.makeColumnLayout,Kb=Zb.retrieveColumnLayout,Qb=Pi;function Jb(e,t){var i,n,r,a=e.type,o=t.getMin(),s=t.getMax(),l=e.getExtent();"ordinal"===a?i=t.getCategories().length:(n=t.get("boundaryGap"),Hb.isArray(n)||(n=[n||0,n||0]),"boolean"==typeof n[0]&&(n=[0,0]),n[0]=Xb.parsePercent(n[0],1),n[1]=Xb.parsePercent(n[1],1),r=l[1]-l[0]||Math.abs(l[0])),"dataMin"===o?o=l[0]:"function"==typeof o&&(o=o({min:l[0],max:l[1]})),"dataMax"===s?s=l[1]:"function"==typeof s&&(s=s({min:l[0],max:l[1]}));var u=null!=o,h=null!=s;null==o&&(o="ordinal"===a?i?0:NaN:l[0]-n[0]*r),null==s&&(s="ordinal"===a?i?i-1:NaN:l[1]+n[1]*r),(null==o||!isFinite(o))&&(o=NaN),(null==s||!isFinite(s))&&(s=NaN),e.setBlank(Hb.eqNaN(o)||Hb.eqNaN(s)||"ordinal"===a&&!e.getOrdinalMeta().categories.length),t.getNeedCrossZero()&&(o>0&&s>0&&!u&&(o=0),o<0&&s<0&&!h&&(s=0));var c=t.ecModel;if(c&&"time"===a){var d,f=qb("bar",c);if(Hb.each(f,(function(e){d|=e.getBaseAxis()===t.axis})),d){var p=Yb(f),g=function(e,t,i,n){var r=i.axis.getExtent(),a=r[1]-r[0],o=Kb(n,i.axis);if(void 0===o)return{min:e,max:t};var s=1/0;Hb.each(o,(function(e){s=Math.min(e.offset,s)}));var l=-1/0;Hb.each(o,(function(e){l=Math.max(e.offset+e.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=t-e,c=h/(1-(s+l)/a)-h;return{min:e-=c*(s/u),max:t+=c*(l/u)}}(o,s,t,p);o=g.min,s=g.max}}return{extent:[o,s],fixMin:u,fixMax:h}}function $b(e){var t,i=e.getLabelModel().get("formatter"),n="category"===e.type?e.scale.getExtent()[0]:null;return"string"==typeof i?(t=i,i=function(i){return i=e.scale.getLabel(i),t.replace("{value}",null!=i?i:"")}):"function"==typeof i?function(t,r){return null!=n&&(r=t-n),i(ew(e,t),r)}:function(t){return e.scale.getLabel(t)}}function ew(e,t){return"category"===e.type?e.scale.getLabel(t):t}function tw(e,t){var i=t*Math.PI/180,n=e.plain(),r=n.width,a=n.height,o=r*Math.abs(Math.cos(i))+Math.abs(a*Math.sin(i)),s=r*Math.abs(Math.sin(i))+Math.abs(a*Math.cos(i));return new Qb(n.x,n.y,o,s)}function iw(e){var t=e.get("interval");return null==t?"auto":t}yx.getScaleExtent=Jb,yx.niceScaleExtent=function(e,t){var i=Jb(e,t),n=i.extent,r=t.get("splitNumber");"log"===e.type&&(e.base=t.get("logBase"));var a=e.type;e.setExtent(n[0],n[1]),e.niceExtent({splitNumber:r,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:"interval"===a||"time"===a?t.get("minInterval"):null,maxInterval:"interval"===a||"time"===a?t.get("maxInterval"):null});var o=t.get("interval");null!=o&&e.setInterval&&e.setInterval(o)},yx.createScaleByModel=function(e,t){if(t=t||e.get("type"))switch(t){case"category":return new Ub(e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),[1/0,-1/0]);case"value":return new Wb;default:return(jb.getClass(t)||Wb).create(e)}},yx.ifAxisCrossZero=function(e){var t=e.scale.getExtent(),i=t[0],n=t[1];return!(i>0&&n>0||i<0&&n<0)},yx.makeLabelFormatter=$b,yx.getAxisRawValue=ew,yx.estimateLabelUnionRect=function(e){var t=e.model,i=e.scale;if(t.get("axisLabel.show")&&!i.isBlank()){var n,r,a="category"===e.type,o=i.getExtent();r=a?i.count():(n=i.getTicks()).length;var s,l=e.getLabelModel(),u=$b(e),h=1;r>40&&(h=Math.ceil(r/40));for(var c=0;c<r;c+=h){var d=u(n?n[c]:o[0]+c),f=tw(l.getTextRect(d),l.get("rotate")||0);s?s.union(f):s=f}return s}},yx.getOptionCategoryInterval=iw,yx.shouldShowAllLabels=function(e){return"category"===e.type&&0===iw(e.getLabelModel())};var nw=g,rw={getMin:function(e){var t=this.option,i=e||null==t.rangeStart?t.min:t.rangeStart;return this.axis&&null!=i&&"dataMin"!==i&&"function"!=typeof i&&!nw.eqNaN(i)&&(i=this.axis.scale.parse(i)),i},getMax:function(e){var t=this.option,i=e||null==t.rangeEnd?t.max:t.rangeEnd;return this.axis&&null!=i&&"dataMax"!==i&&"function"!=typeof i&&!nw.eqNaN(i)&&(i=this.axis.scale.parse(i)),i},getNeedCrossZero:function(){var e=this.option;return null==e.rangeStart&&null==e.rangeEnd&&!e.scale},getCoordSysModel:nw.noop,setRange:function(e,t){this.option.rangeStart=e,this.option.rangeEnd=t},resetRange:function(){this.option.rangeStart=this.option.rangeEnd=null}},aw=rw,ow={},sw=g,lw=No,uw=Pi,hw=Tn.calculateTextPosition,cw=lw.extendShape({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var i=t.cx,n=t.cy,r=t.width/2,a=t.height/2;e.moveTo(i,n-a),e.lineTo(i+r,n+a),e.lineTo(i-r,n+a),e.closePath()}}),dw=lw.extendShape({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var i=t.cx,n=t.cy,r=t.width/2,a=t.height/2;e.moveTo(i,n-a),e.lineTo(i+r,n),e.lineTo(i,n+a),e.lineTo(i-r,n),e.closePath()}}),fw=lw.extendShape({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var i=t.x,n=t.y,r=t.width/5*3,a=Math.max(r,t.height),o=r/2,s=o*o/(a-o),l=n-a+o+s,u=Math.asin(s/o),h=Math.cos(u)*o,c=Math.sin(u),d=Math.cos(u),f=.6*o,p=.7*o;e.moveTo(i-h,l+s),e.arc(i,l,o,Math.PI-u,2*Math.PI+u),e.bezierCurveTo(i+h-c*f,l+s+d*f,i,n-p,i,n),e.bezierCurveTo(i,n-p,i-h+c*f,l+s+d*f,i-h,l+s),e.closePath()}}),pw=lw.extendShape({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var i=t.height,n=t.width,r=t.x,a=t.y,o=n/3*2;e.moveTo(r,a),e.lineTo(r+o,a+i),e.lineTo(r,a+i/4*3),e.lineTo(r-o,a+i),e.lineTo(r,a),e.closePath()}}),gw={line:lw.Line,rect:lw.Rect,roundRect:lw.Rect,square:lw.Rect,circle:lw.Circle,diamond:dw,pin:fw,arrow:pw,triangle:cw},mw={line:function(e,t,i,n,r){r.x1=e,r.y1=t+n/2,r.x2=e+i,r.y2=t+n/2},rect:function(e,t,i,n,r){r.x=e,r.y=t,r.width=i,r.height=n},roundRect:function(e,t,i,n,r){r.x=e,r.y=t,r.width=i,r.height=n,r.r=Math.min(i,n)/4},square:function(e,t,i,n,r){var a=Math.min(i,n);r.x=e,r.y=t,r.width=a,r.height=a},circle:function(e,t,i,n,r){r.cx=e+i/2,r.cy=t+n/2,r.r=Math.min(i,n)/2},diamond:function(e,t,i,n,r){r.cx=e+i/2,r.cy=t+n/2,r.width=i,r.height=n},pin:function(e,t,i,n,r){r.x=e+i/2,r.y=t+n/2,r.width=i,r.height=n},arrow:function(e,t,i,n,r){r.x=e+i/2,r.y=t+n/2,r.width=i,r.height=n},triangle:function(e,t,i,n,r){r.cx=e+i/2,r.cy=t+n/2,r.width=i,r.height=n}},vw={};sw.each(gw,(function(e,t){vw[t]=new e}));var yw=lw.extendShape({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,i){var n=hw(e,t,i),r=this.shape;return r&&"pin"===r.symbolType&&"inside"===t.textPosition&&(n.y=i.y+.4*i.height),n},buildPath:function(e,t,i){var n=t.symbolType;if("none"!==n){var r=vw[n];r||(r=vw[n="rect"]),mw[n](t.x,t.y,t.width,t.height,r.shape),r.buildPath(e,r.shape,i)}}});function _w(e,t){if("image"!==this.type){var i=this.style,n=this.shape;n&&"line"===n.symbolType?i.stroke=e:this.__isEmptyBrush?(i.stroke=e,i.fill=t||"#fff"):(i.fill&&(i.fill=e),i.stroke&&(i.stroke=e)),this.dirty(!1)}}ow.createSymbol=function(e,t,i,n,r,a,o){var s,l=0===e.indexOf("empty");return l&&(e=e.substr(5,1).toLowerCase()+e.substr(6)),(s=0===e.indexOf("image://")?lw.makeImage(e.slice(8),new uw(t,i,n,r),o?"center":"cover"):0===e.indexOf("path://")?lw.makePath(e.slice(7),{},new uw(t,i,n,r),o?"center":"cover"):new yw({shape:{symbolType:e,x:t,y:i,width:n,height:r}})).__isEmptyBrush=l,s.setColor=_w,s.setColor(a),s};var xw=g,bw=vx,ww=yx,Tw=aw,Sw=zc,Mw=Hc;Mw.getLayoutRect,ky.getLayoutRect=Mw.getLayoutRect;var Aw=ex,Iw=Aw.enableDataStack,Cw=Aw.isDimensionStacked,Dw=Aw.getStackedDimension,Ew=W_;ky.completeDimensions=Ew;var Lw=X_;ky.createDimensions=Lw;var Pw=ow;ky.createSymbol=Pw.createSymbol;var Nw={isDimensionStacked:Cw,enableDataStack:Iw,getStackedDimension:Dw};ky.createList=function(e){return bw(e.getSource(),e)},ky.dataStack=Nw,ky.createScale=function(e,t){var i=t;Sw.isInstance(t)||(i=new Sw(t),xw.mixin(i,Tw));var n=ww.createScaleByModel(i);return n.setExtent(e[0],e[1]),ww.niceScaleExtent(n,i),n},ky.mixinAxisModelCommonMethods=function(e){xw.mixin(e,Tw)};var Rw={},Ow=Gs;function kw(e,t){return Math.abs(e-t)<1e-8}Rw.contain=function(e,t,i){var n=0,r=e[0];if(!r)return!1;for(var a=1;a<e.length;a++){var o=e[a];n+=Ow(r[0],r[1],o[0],o[1],t,i),r=o}var s=e[0];return kw(r[0],s[0])&&kw(r[1],s[1])||(n+=Ow(r[0],r[1],s[0],s[1],t,i)),0!==n};var zw=Pi,Bw=Jo,Fw=V,Vw=Rw;function Gw(e,t,i){if(this.name=e,this.geometries=t,i)i=[i[0],i[1]];else{var n=this.getBoundingRect();i=[n.x+n.width/2,n.y+n.height/2]}this.center=i}Gw.prototype={constructor:Gw,properties:null,getBoundingRect:function(){var e=this._rect;if(e)return e;for(var t=Number.MAX_VALUE,i=[t,t],n=[-t,-t],r=[],a=[],o=this.geometries,s=0;s<o.length;s++)if("polygon"===o[s].type){var l=o[s].exterior;Bw.fromPoints(l,r,a),Fw.min(i,i,r),Fw.max(n,n,a)}return 0===s&&(i[0]=i[1]=n[0]=n[1]=0),this._rect=new zw(i[0],i[1],n[0]-i[0],n[1]-i[1])},contain:function(e){var t=this.getBoundingRect(),i=this.geometries;if(!t.contain(e[0],e[1]))return!1;e:for(var n=0,r=i.length;n<r;n++)if("polygon"===i[n].type){var a=i[n].exterior,o=i[n].interiors;if(Vw.contain(a,e[0],e[1])){for(var s=0;s<(o?o.length:0);s++)if(Vw.contain(o[s]))continue e;return!0}}return!1},transformTo:function(e,t,i,n){var r=this.getBoundingRect(),a=r.width/r.height;i?n||(n=i/a):i=a*n;for(var o=new zw(e,t,i,n),s=r.calculateTransform(o),l=this.geometries,u=0;u<l.length;u++)if("polygon"===l[u].type){for(var h=l[u].exterior,c=l[u].interiors,d=0;d<h.length;d++)Fw.applyTransform(h[d],h[d],s);for(var f=0;f<(c?c.length:0);f++)for(d=0;d<c[f].length;d++)Fw.applyTransform(c[f][d],c[f][d],s)}(r=this._rect).copy(o),this.center=[r.x+r.width/2,r.y+r.height/2]},cloneShallow:function(e){null==e&&(e=this.name);var t=new Gw(e,this.geometries,this.center);return t._rect=this._rect,t.transformTo=null,t}};var Hw=Gw,Uw=g,Ww=Hw;function jw(e,t,i){for(var n=[],r=t[0],a=t[1],o=0;o<e.length;o+=2){var s=e.charCodeAt(o)-64,l=e.charCodeAt(o+1)-64;s=s>>1^-(1&s),l=l>>1^-(1&l),r=s+=r,a=l+=a,n.push([s/i,l/i])}return n}var Xw=function(e,t){return function(e){if(!e.UTF8Encoding)return e;var t=e.UTF8Scale;null==t&&(t=1024);for(var i=e.features,n=0;n<i.length;n++)for(var r=i[n].geometry,a=r.coordinates,o=r.encodeOffsets,s=0;s<a.length;s++){var l=a[s];if("Polygon"===r.type)a[s]=jw(l,o[s],t);else if("MultiPolygon"===r.type)for(var u=0;u<l.length;u++){var h=l[u];l[u]=jw(h,o[s][u],t)}}e.UTF8Encoding=!1}(e),Uw.map(Uw.filter(e.features,(function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0})),(function(e){var i=e.properties,n=e.geometry,r=n.coordinates,a=[];"Polygon"===n.type&&a.push({type:"polygon",exterior:r[0],interiors:r.slice(1)}),"MultiPolygon"===n.type&&Uw.each(r,(function(e){e[0]&&a.push({type:"polygon",exterior:e[0],interiors:e.slice(1)})}));var o=new Ww(i[t||"name"],a,i.cp);return o.properties=i,o}))},Zw={},qw=g,Yw=Tn,Kw=lo.makeInner,Qw=yx,Jw=Qw.makeLabelFormatter,$w=Qw.getOptionCategoryInterval,eT=Qw.shouldShowAllLabels,tT=Kw();function iT(e,t){var i,n,r=nT(e,"labels"),a=$w(t),o=rT(r,a);return o||(qw.isFunction(a)?i=sT(e,a):(n="auto"===a?function(e){var t=tT(e).autoInterval;return null!=t?t:tT(e).autoInterval=e.calculateCategoryInterval()}(e):a,i=oT(e,n)),aT(r,a,{labels:i,labelCategoryInterval:n}))}function nT(e,t){return tT(e)[t]||(tT(e)[t]=[])}function rT(e,t){for(var i=0;i<e.length;i++)if(e[i].key===t)return e[i].value}function aT(e,t,i){return e.push({key:t,value:i}),i}function oT(e,t,i){var n=Jw(e),r=e.scale,a=r.getExtent(),o=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=a[0],h=r.count();0!==u&&l>1&&h/l>2&&(u=Math.round(Math.ceil(u/l)*l));var c=eT(e),d=o.get("showMinLabel")||c,f=o.get("showMaxLabel")||c;d&&u!==a[0]&&g(a[0]);for(var p=u;p<=a[1];p+=l)g(p);function g(e){s.push(i?e:{formattedLabel:n(e),rawLabel:r.getLabel(e),tickValue:e})}return f&&p-l!==a[1]&&g(a[1]),s}function sT(e,t,i){var n=e.scale,r=Jw(e),a=[];return qw.each(n.getTicks(),(function(e){var o=n.getLabel(e);t(e,o)&&a.push(i?e:{formattedLabel:r(e),rawLabel:o,tickValue:e})})),a}Zw.createAxisLabels=function(e){return"category"===e.type?function(e){var t=e.getLabelModel(),i=iT(e,t);return!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:i.labelCategoryInterval}:i}(e):function(e){var t=e.scale.getTicks(),i=Jw(e);return{labels:qw.map(t,(function(t,n){return{formattedLabel:i(t,n),rawLabel:e.scale.getLabel(t),tickValue:t}}))}}(e)},Zw.createAxisTicks=function(e,t){return"category"===e.type?function(e,t){var i,n,r=nT(e,"ticks"),a=$w(t),o=rT(r,a);if(o)return o;if(t.get("show")&&!e.scale.isBlank()||(i=[]),qw.isFunction(a))i=sT(e,a,!0);else if("auto"===a){var s=iT(e,e.getLabelModel());n=s.labelCategoryInterval,i=qw.map(s.labels,(function(e){return e.tickValue}))}else i=oT(e,n=a,!0);return aT(r,a,{ticks:i,tickCategoryInterval:n})}(e,t):{ticks:e.scale.getTicks()}},Zw.calculateCategoryInterval=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),i=Jw(e),n=(t.axisRotate-t.labelRotate)/180*Math.PI,r=e.scale,a=r.getExtent(),o=r.count();if(a[1]-a[0]<1)return 0;var s=1;o>40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=e.dataToCoord(l+1)-e.dataToCoord(l),h=Math.abs(u*Math.cos(n)),c=Math.abs(u*Math.sin(n)),d=0,f=0;l<=a[1];l+=s){var p,g,m=Yw.getBoundingRect(i(l),t.font,"center","top");p=1.3*m.width,g=1.3*m.height,d=Math.max(d,p,7),f=Math.max(f,g,7)}var v=d/h,y=f/c;isNaN(v)&&(v=1/0),isNaN(y)&&(y=1/0);var _=Math.max(0,Math.floor(Math.min(v,y))),x=tT(e.model),b=e.getExtent(),w=x.lastAutoInterval,T=x.lastTickCount;return null!=w&&null!=T&&Math.abs(w-_)<=1&&Math.abs(T-o)<=1&&w>_&&x.axisExtend0===b[0]&&x.axisExtend1===b[1]?_=w:(x.lastTickCount=o,x.lastAutoInterval=_,x.axisExtend0=b[0],x.axisExtend1=b[1]),_};var lT=g,uT=lT.each,hT=lT.map,cT=Uc,dT=cT.linearMap,fT=cT.getPixelPrecision,pT=cT.round,gT=Zw,mT=gT.createAxisTicks,vT=gT.createAxisLabels,yT=gT.calculateCategoryInterval,_T=[0,1],xT=function(e,t,i){this.dim=e,this.scale=t,this._extent=i||[0,0],this.inverse=!1,this.onBand=!1};function bT(e,t){var i=(e[1]-e[0])/t/2;e[0]+=i,e[1]-=i}xT.prototype={constructor:xT,contain:function(e){var t=this._extent,i=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return e>=i&&e<=n},containData:function(e){return this.scale.contain(e)},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(e){return fT(e||this.scale.getExtent(),this._extent)},setExtent:function(e,t){var i=this._extent;i[0]=e,i[1]=t},dataToCoord:function(e,t){var i=this._extent,n=this.scale;return e=n.normalize(e),this.onBand&&"ordinal"===n.type&&bT(i=i.slice(),n.count()),dT(e,_T,i,t)},coordToData:function(e,t){var i=this._extent,n=this.scale;this.onBand&&"ordinal"===n.type&&bT(i=i.slice(),n.count());var r=dT(e,i,_T,t);return this.scale.scale(r)},pointToData:function(e,t){},getTicksCoords:function(e){var t=(e=e||{}).tickModel||this.getTickModel(),i=mT(this,t).ticks,n=hT(i,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this);return function(e,t,i,n){var r=t.length;if(e.onBand&&!i&&r){var a,o,s=e.getExtent();if(1===r)t[0].coord=s[0],a=t[1]={coord:s[0]};else{var l=t[r-1].tickValue-t[0].tickValue,u=(t[r-1].coord-t[0].coord)/l;uT(t,(function(e){e.coord-=u/2})),o=1+e.scale.getExtent()[1]-t[r-1].tickValue,a={coord:t[r-1].coord+u*o},t.push(a)}var h=s[0]>s[1];c(t[0].coord,s[0])&&(n?t[0].coord=s[0]:t.shift()),n&&c(s[0],t[0].coord)&&t.unshift({coord:s[0]}),c(s[1],a.coord)&&(n?a.coord=s[1]:t.pop()),n&&c(a.coord,s[1])&&t.push({coord:s[1]})}function c(e,t){return e=pT(e),t=pT(t),h?e>t:e<t}}(this,n,t.get("alignWithLabel"),e.clamp),n},getMinorTicksCoords:function(){if("ordinal"===this.scale.type)return[];var e=this.model.getModel("minorTick").get("splitNumber");e>0&&e<100||(e=5);var t=this.scale.getMinorTicks(e);return hT(t,(function(e){return hT(e,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this)}),this)},getViewLabels:function(){return vT(this).labels},getLabelModel:function(){return this.model.getModel("axisLabel")},getTickModel:function(){return this.model.getModel("axisTick")},getBandWidth:function(){var e=this._extent,t=this.scale.getExtent(),i=t[1]-t[0]+(this.onBand?1:0);0===i&&(i=1);var n=Math.abs(e[1]-e[0]);return Math.abs(n)/i},isHorizontal:null,getRotate:null,calculateCategoryInterval:function(){return yT(this)}};var wT=xT,TT=c;Oy.zrender=TT;var ST=Ue;Oy.matrix=ST;var MT=V;Oy.vector=MT;var AT=g,IT=ut;Oy.color=IT;var CT=No,DT=Uc;Oy.number=DT;var ET=qc;Oy.format=ET;var LT=km;LT.throttle,Oy.throttle=LT.throttle;var PT=ky;Oy.helper=PT;var NT=Xw;Oy.parseGeoJSON=NT;var RT=A_;Oy.List=RT;var OT=zc;Oy.Model=OT;var kT=wT;Oy.Axis=kT;var zT=p;Oy.env=zT;var BT=NT,FT={};AT.each(["map","each","filter","indexOf","inherits","reduce","filter","bind","curry","isArray","isString","isObject","isFunction","extend","defaults","clone","merge"],(function(e){FT[e]=AT[e]}));var VT={};AT.each(["extendShape","extendPath","makePath","makeImage","mergePath","resizePath","createIcon","setHoverStyle","setLabelStyle","setTextStyle","setText","getFont","updateProps","initProps","getTransform","clipPointsByRect","clipRectByRect","registerShape","getShapeClass","Group","Image","Text","Circle","Sector","Ring","Polygon","Polyline","Rect","Line","BezierCurve","Arc","IncrementalDisplayable","CompoundPath","LinearGradient","RadialGradient","BoundingRect"],(function(e){VT[e]=CT[e]})),Oy.parseGeoJson=BT,Oy.util=FT,Oy.graphic=VT,function(e){var t=c,i=g,n=ut,r=p,a=Ui,o=ie,s=ep,l=np,u=sp,h=_p,d=Hp,f=Zp,m=Ld,v=um,y=gm,_=Om,x=No,b=lo,w=km.throttle,T=Wm,S=Ym,M=ev,A=Lv,I=Nv,C=Bv,D=Ry,E=i.assert,L=i.each,P=i.isFunction,N=i.isObject,R=m.parseClassType,O={PROCESSOR:{FILTER:1e3,SERIES_FILTER:800,STATISTIC:5e3},VISUAL:{LAYOUT:1e3,PROGRESSIVE_LAYOUT:1100,GLOBAL:2e3,CHART:3e3,POST_CHART_LAYOUT:3500,COMPONENT:4e3,BRUSH:5e3}},k="__flagInMainProcess",z=/^[a-zA-Z0-9_]+$/;function B(e,t){return function(i,n,r){t||!this._disposed?(i=i&&i.toLowerCase(),o.prototype[e].call(this,i,n,r)):this.id}}function F(){o.call(this)}function V(e,n,r){r=r||{},"string"==typeof n&&(n=ce[n]),this.id,this.group,this._dom=e;var s=this._zr=t.init(e,{renderer:r.renderer||"canvas",devicePixelRatio:r.devicePixelRatio,width:r.width,height:r.height});this._throttledZrFlush=w(i.bind(s.flush,s),17),(n=i.clone(n))&&d(n,!0),this._theme=n,this._chartsViews=[],this._chartsMap={},this._componentsViews=[],this._componentsMap={},this._coordSysMgr=new u;var h,c,f=this._api=(c=(h=this)._coordSysMgr,i.extend(new l(h),{getCoordinateSystems:i.bind(c.getCoordinateSystems,c),getComponentByElement:function(e){for(;e;){var t=e.__ecComponentInfo;if(null!=t)return h._model.getComponent(t.mainType,t.index);e=e.parent}}}));function p(e,t){return e.__prio-t.__prio}a(he,p),a(se,p),this._scheduler=new A(this,f,se,he),o.call(this,this._ecEventProcessor=new re),this._messageCenter=new F,this._initEvents(),this.resize=i.bind(this.resize,this),this._pendingActions=[],s.animation.on("frame",this._onframe,this),function(e,t){e.on("rendered",(function(){t.trigger("rendered"),!e.animation.isFinished()||t.__optionUpdated||t._scheduler.unfinished||t._pendingActions.length||t.trigger("finished")}))}(s,this),i.setAsPrimitive(this)}F.prototype.on=B("on",!0),F.prototype.off=B("off",!0),F.prototype.one=B("one",!0),i.mixin(F,o);var G=V.prototype;function H(e,t,i){if(this._disposed)this.id;else{var n,r=this._model,a=this._coordSysMgr.getCoordinateSystems();t=b.parseFinder(r,t);for(var o=0;o<a.length;o++){var s=a[o];if(s[e]&&null!=(n=s[e](r,t,i)))return n}}}G._onframe=function(){if(!this._disposed){var e=this._scheduler;if(this.__optionUpdated){var t=this.__optionUpdated.silent;this[k]=!0,W(this),U.update.call(this),this[k]=!1,this.__optionUpdated=!1,q.call(this,t),Y.call(this,t)}else if(e.unfinished){var i=1,n=this._model;this._api;e.unfinished=!1;do{var r=+new Date;e.performSeriesTasks(n),e.performDataProcessorTasks(n),X(this,n),e.performVisualTasks(n),$(this,this._model,0,"remain"),i-=+new Date-r}while(i>0&&e.unfinished);e.unfinished||this._zr.flush()}}},G.getDom=function(){return this._dom},G.getZr=function(){return this._zr},G.setOption=function(e,t,i){if(this._disposed)this.id;else{var n;if(N(t)&&(i=t.lazyUpdate,n=t.silent,t=t.notMerge),this[k]=!0,!this._model||t){var r=new h(this._api),a=this._theme,o=this._model=new s;o.scheduler=this._scheduler,o.init(null,null,a,r)}this._model.setOption(e,le),i?(this.__optionUpdated={silent:n},this[k]=!1):(W(this),U.update.call(this),this._zr.flush(),this.__optionUpdated=!1,this[k]=!1,q.call(this,n),Y.call(this,n))}},G.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},G.getModel=function(){return this._model},G.getOption=function(){return this._model&&this._model.getOption()},G.getWidth=function(){return this._zr.getWidth()},G.getHeight=function(){return this._zr.getHeight()},G.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},G.getRenderedCanvas=function(e){if(r.canvasSupported)return(e=e||{}).pixelRatio=e.pixelRatio||1,e.backgroundColor=e.backgroundColor||this._model.get("backgroundColor"),this._zr.painter.getRenderedCanvas(e)},G.getSvgDataURL=function(){if(r.svgSupported){var e=this._zr,t=e.storage.getDisplayList();return i.each(t,(function(e){e.stopAnimation(!0)})),e.painter.toDataURL()}},G.getDataURL=function(e){if(!this._disposed){var t=(e=e||{}).excludeComponents,i=this._model,n=[],r=this;L(t,(function(e){i.eachComponent({mainType:e},(function(e){var t=r._componentsMap[e.__viewId];t.group.ignore||(n.push(t),t.group.ignore=!0)}))}));var a="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.getRenderedCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return L(n,(function(e){e.group.ignore=!1})),a}this.id},G.getConnectedDataURL=function(e){if(this._disposed)this.id;else if(r.canvasSupported){var n="svg"===e.type,a=this.group,o=Math.min,s=Math.max,l=1/0;if(pe[a]){var u=l,h=l,c=-1/0,d=-1/0,f=[],p=e&&e.pixelRatio||1;i.each(fe,(function(t,r){if(t.group===a){var l=n?t.getZr().painter.getSvgDom().innerHTML:t.getRenderedCanvas(i.clone(e)),p=t.getDom().getBoundingClientRect();u=o(p.left,u),h=o(p.top,h),c=s(p.right,c),d=s(p.bottom,d),f.push({dom:l,left:p.left,top:p.top})}}));var g=(c*=p)-(u*=p),m=(d*=p)-(h*=p),v=i.createCanvas(),y=t.init(v,{renderer:n?"svg":"canvas"});if(y.resize({width:g,height:m}),n){var _="";return L(f,(function(e){var t=e.left-u,i=e.top-h;_+='<g transform="translate('+t+","+i+')">'+e.dom+"</g>"})),y.painter.getSvgRoot().innerHTML=_,e.connectedBackgroundColor&&y.painter.setBackgroundColor(e.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}return e.connectedBackgroundColor&&y.add(new x.Rect({shape:{x:0,y:0,width:g,height:m},style:{fill:e.connectedBackgroundColor}})),L(f,(function(e){var t=new x.Image({style:{x:e.left*p-u,y:e.top*p-h,image:e.dom}});y.add(t)})),y.refreshImmediately(),v.toDataURL("image/"+(e&&e.type||"png"))}return this.getDataURL(e)}},G.convertToPixel=i.curry(H,"convertToPixel"),G.convertFromPixel=i.curry(H,"convertFromPixel"),G.containPixel=function(e,t){if(!this._disposed){var n,r=this._model;return e=b.parseFinder(r,e),i.each(e,(function(e,r){r.indexOf("Models")>=0&&i.each(e,(function(e){var i=e.coordinateSystem;if(i&&i.containPoint)n|=!!i.containPoint(t);else if("seriesModels"===r){var a=this._chartsMap[e.__viewId];a&&a.containPoint&&(n|=a.containPoint(t,e))}}),this)}),this),!!n}this.id},G.getVisual=function(e,t){var i=this._model,n=(e=b.parseFinder(i,e,{defaultMainType:"series"})).seriesModel.getData(),r=e.hasOwnProperty("dataIndexInside")?e.dataIndexInside:e.hasOwnProperty("dataIndex")?n.indexOfRawIndex(e.dataIndex):null;return null!=r?n.getItemVisual(r,t):n.getVisual(t)},G.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},G.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]};var U={prepareAndUpdate:function(e){W(this),U.update.call(this,e)},update:function(e){var t=this._model,i=this._api,a=this._zr,o=this._coordSysMgr,s=this._scheduler;if(t){s.restoreData(t,e),s.performSeriesTasks(t),o.create(t,i),s.performDataProcessorTasks(t,e),X(this,t),o.update(t,i),Q(t),s.performVisualTasks(t,e),J(this,t,i,e);var l=t.get("backgroundColor")||"transparent";if(r.canvasSupported)a.setBackgroundColor(l);else{var u=n.parse(l);l=n.stringify(u,"rgb"),0===u[3]&&(l="transparent")}ee(t,i)}},updateTransform:function(e){var t=this._model,n=this,r=this._api;if(t){var a=[];t.eachComponent((function(i,o){var s=n.getViewOfComponentModel(o);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(o,t,r,e);l&&l.update&&a.push(s)}else a.push(s)}));var o=i.createHashMap();t.eachSeries((function(i){var a=n._chartsMap[i.__viewId];if(a.updateTransform){var s=a.updateTransform(i,t,r,e);s&&s.update&&o.set(i.uid,1)}else o.set(i.uid,1)})),Q(t),this._scheduler.performVisualTasks(t,e,{setDirty:!0,dirtyMap:o}),$(n,t,0,e,o),ee(t,this._api)}},updateView:function(e){var t=this._model;t&&(_.markUpdateMethod(e,"updateView"),Q(t),this._scheduler.performVisualTasks(t,e,{setDirty:!0}),J(this,this._model,this._api,e),ee(t,this._api))},updateVisual:function(e){U.update.call(this,e)},updateLayout:function(e){U.update.call(this,e)}};function W(e){var t=e._model,i=e._scheduler;i.restorePipelines(t),i.prepareStageTasks(),K(e,"component",t,i),K(e,"chart",t,i),i.plan()}function j(e,t,n,r,a){var o=e._model;if(r){var s={};s[r+"Id"]=n[r+"Id"],s[r+"Index"]=n[r+"Index"],s[r+"Name"]=n[r+"Name"];var l={mainType:r,query:s};a&&(l.subType=a);var u=n.excludeSeriesId;null!=u&&(u=i.createHashMap(b.normalizeToArray(u))),o&&o.eachComponent(l,(function(t){u&&null!=u.get(t.id)||h(e["series"===r?"_chartsMap":"_componentsMap"][t.__viewId])}),e)}else L(e._componentsViews.concat(e._chartsViews),h);function h(i){i&&i.__alive&&i[t]&&i[t](i.__model,o,e._api,n)}}function X(e,t){var i=e._chartsMap,n=e._scheduler;t.eachSeries((function(e){n.updateStreamModes(e,i[e.__viewId])}))}function Z(e,t){var n=e.type,r=e.escapeConnect,a=ae[n],o=a.actionInfo,s=(o.update||"update").split(":"),l=s.pop();s=null!=s[0]&&R(s[0]),this[k]=!0;var u=[e],h=!1;e.batch&&(h=!0,u=i.map(e.batch,(function(t){return(t=i.defaults(i.extend({},t),e)).batch=null,t})));var c,d=[],f="highlight"===n||"downplay"===n;L(u,(function(e){(c=(c=a.action(e,this._model,this._api))||i.extend({},e)).type=o.event||c.type,d.push(c),f?j(this,l,e,"series"):s&&j(this,l,e,s.main,s.sub)}),this),"none"===l||f||s||(this.__optionUpdated?(W(this),U.update.call(this,e),this.__optionUpdated=!1):U[l].call(this,e)),c=h?{type:o.event||n,escapeConnect:r,batch:d}:d[0],this[k]=!1,!t&&this._messageCenter.trigger(c.type,c)}function q(e){for(var t=this._pendingActions;t.length;){var i=t.shift();Z.call(this,i,e)}}function Y(e){!e&&this.trigger("updated")}function K(e,t,i,n){for(var r="component"===t,a=r?e._componentsViews:e._chartsViews,o=r?e._componentsMap:e._chartsMap,s=e._zr,l=e._api,u=0;u<a.length;u++)a[u].__alive=!1;function h(e){var t="_ec_"+e.id+"_"+e.type,u=o[t];if(!u){var h=R(e.type);(u=new(r?y.getClass(h.main,h.sub):_.getClass(h.sub))).init(i,l),o[t]=u,a.push(u),s.add(u.group)}e.__viewId=u.__id=t,u.__alive=!0,u.__model=e,u.group.__ecComponentInfo={mainType:e.mainType,index:e.componentIndex},!r&&n.prepareView(u,e,i,l)}for(r?i.eachComponent((function(e,t){"series"!==e&&h(t)})):i.eachSeries(h),u=0;u<a.length;){var c=a[u];c.__alive?u++:(!r&&c.renderTask.dispose(),s.remove(c.group),c.dispose(i,l),a.splice(u,1),delete o[c.__id],c.__id=c.group.__ecComponentInfo=null)}}function Q(e){e.clearColorPalette(),e.eachSeries((function(e){e.clearColorPalette()}))}function J(e,t,i,n){!function(e,t,i,n,r){L(r||e._componentsViews,(function(e){var r=e.__model;e.render(r,t,i,n),ne(r,e)}))}(e,t,i,n),L(e._chartsViews,(function(e){e.__alive=!1})),$(e,t,0,n),L(e._chartsViews,(function(e){e.__alive||e.remove(t,i)}))}function $(e,t,i,n,a){var o,s=e._scheduler;t.eachSeries((function(t){var i=e._chartsMap[t.__viewId];i.__alive=!0;var r=i.renderTask;s.updatePayload(r,n),a&&a.get(t.uid)&&r.dirty(),o|=r.perform(s.getPerformArgs(r)),i.group.silent=!!t.get("silent"),ne(t,i),function(e,t){var i=e.get("blendMode")||null;t.group.traverse((function(e){e.isGroup||e.style.blend!==i&&e.setStyle("blend",i),e.eachPendingDisplayable&&e.eachPendingDisplayable((function(e){e.setStyle("blend",i)}))}))}(t,i)})),s.unfinished|=o,function(e,t){var i=e._zr.storage,n=0;i.traverse((function(e){n++})),n>t.get("hoverLayerThreshold")&&!r.node&&t.eachSeries((function(t){if(!t.preventUsingHoverLayer){var i=e._chartsMap[t.__viewId];i.__alive&&i.group.traverse((function(e){e.useHoverLayer=!0}))}}))}(e,t),S(e._zr.dom,t)}function ee(e,t){L(ue,(function(i){i(e,t)}))}G.resize=function(e){if(this._disposed)this.id;else{this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var i=t.resetOption("media"),n=e&&e.silent;this[k]=!0,i&&W(this),U.update.call(this),this[k]=!1,q.call(this,n),Y.call(this,n)}}},G.showLoading=function(e,t){if(this._disposed)this.id;else if(N(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),de[e]){var i=de[e](this._api,t),n=this._zr;this._loadingFX=i,n.add(i)}},G.hideLoading=function(){this._disposed?this.id:(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},G.makeActionFromEvent=function(e){var t=i.extend({},e);return t.type=oe[e.type],t},G.dispatchAction=function(e,t){this._disposed?this.id:(N(t)||(t={silent:!!t}),ae[e.type]&&this._model&&(this[k]?this._pendingActions.push(e):(Z.call(this,e,t.silent),t.flush?this._zr.flush(!0):!1!==t.flush&&r.browser.weChat&&this._throttledZrFlush(),q.call(this,t.silent),Y.call(this,t.silent))))},G.appendData=function(e){if(this._disposed)this.id;else{var t=e.seriesIndex;this.getModel().getSeriesByIndex(t).appendData(e),this._scheduler.unfinished=!0}},G.on=B("on",!1),G.off=B("off",!1),G.one=B("one",!1);var te=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function ne(e,t){var i=e.get("z"),n=e.get("zlevel");t.group.traverse((function(e){"group"!==e.type&&(null!=i&&(e.z=i),null!=n&&(e.zlevel=n))}))}function re(){this.eventInfo}G._initEvents=function(){L(te,(function(e){var t=function(t){var n,r=this.getModel(),a=t.target;if("globalout"===e)n={};else if(a&&null!=a.dataIndex){var o=a.dataModel||r.getSeriesByIndex(a.seriesIndex);n=o&&o.getDataParams(a.dataIndex,a.dataType,a)||{}}else a&&a.eventData&&(n=i.extend({},a.eventData));if(n){var s=n.componentType,l=n.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=n.seriesIndex);var u=s&&null!=l&&r.getComponent(s,l),h=u&&this["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];n.event=t,n.type=e,this._ecEventProcessor.eventInfo={targetEl:a,packedEvent:n,model:u,view:h},this.trigger(e,n)}};t.zrEventfulCallAtLast=!0,this._zr.on(e,t,this)}),this),L(oe,(function(e,t){this._messageCenter.on(t,(function(e){this.trigger(t,e)}),this)}),this)},G.isDisposed=function(){return this._disposed},G.clear=function(){this._disposed?this.id:this.setOption({series:[]},!0)},G.dispose=function(){if(this._disposed)this.id;else{this._disposed=!0,b.setAttribute(this.getDom(),ve,"");var e=this._api,t=this._model;L(this._componentsViews,(function(i){i.dispose(t,e)})),L(this._chartsViews,(function(i){i.dispose(t,e)})),this._zr.dispose(),delete fe[this.id]}},i.mixin(V,o),re.prototype={constructor:re,normalizeQuery:function(e){var t={},n={},r={};if(i.isString(e)){var a=R(e);t.mainType=a.main||null,t.subType=a.sub||null}else{var o=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};i.each(e,(function(e,i){for(var a=!1,l=0;l<o.length;l++){var u=o[l],h=i.lastIndexOf(u);if(h>0&&h===i.length-u.length){var c=i.slice(0,h);"data"!==c&&(t.mainType=c,t[u.toLowerCase()]=e,a=!0)}}s.hasOwnProperty(i)&&(n[i]=e,a=!0),a||(r[i]=e)}))}return{cptQuery:t,dataQuery:n,otherQuery:r}},filter:function(e,t,i){var n=this.eventInfo;if(!n)return!0;var r=n.targetEl,a=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=t.cptQuery,u=t.dataQuery;return h(l,o,"mainType")&&h(l,o,"subType")&&h(l,o,"index","componentIndex")&&h(l,o,"name")&&h(l,o,"id")&&h(u,a,"name")&&h(u,a,"dataIndex")&&h(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,t.otherQuery,r,a));function h(e,t,i,n){return null==e[i]||t[n||i]===e[i]}},afterTrigger:function(){this.eventInfo=null}};var ae={},oe={},se=[],le=[],ue=[],he=[],ce={},de={},fe={},pe={},ge=new Date-0,me=new Date-0,ve="_echarts_instance_";function ye(e){pe[e]=!1}var _e=ye;function xe(e){return fe[b.getAttribute(e,ve)]}function be(e,t){ce[e]=t}function we(e){le.push(e)}function Te(e,t){Ae(se,e,t,1e3)}function Se(e,t,i){"function"==typeof t&&(i=t,t="");var n=N(e)?e.type:[e,e={event:t}][0];e.event=(e.event||n).toLowerCase(),t=e.event,E(z.test(n)&&z.test(t)),ae[n]||(ae[n]={action:i,actionInfo:e}),oe[t]=n}function Me(e,t){Ae(he,e,t,3e3,"visual")}function Ae(e,t,i,n,r){(P(t)||N(t))&&(i=t,t=n);var a=A.wrapStageHandler(i,r);return a.__prio=t,a.__raw=i,e.push(a),a}function Ie(e,t){de[e]=t}Me(2e3,T),we(d),Te(900,f),Ie("default",M),Se({type:"highlight",event:"highlight",update:"highlight"},i.noop),Se({type:"downplay",event:"downplay",update:"downplay"},i.noop),be("light",I),be("dark",C),e.version="4.9.0",e.dependencies={zrender:"4.3.2"},e.PRIORITY=O,e.init=function(e,t,i){var n=xe(e);if(n)return n;var r=new V(e,t,i);return r.id="ec_"+ge++,fe[r.id]=r,b.setAttribute(e,ve,r.id),function(e){var t="__connectUpdateStatus";function i(e,i){for(var n=0;n<e.length;n++)e[n][t]=i}L(oe,(function(n,r){e._messageCenter.on(r,(function(n){if(pe[e.group]&&0!==e[t]){if(n&&n.escapeConnect)return;var r=e.makeActionFromEvent(n),a=[];L(fe,(function(t){t!==e&&t.group===e.group&&a.push(t)})),i(a,0),L(a,(function(e){1!==e[t]&&e.dispatchAction(r)})),i(a,2)}}))}))}(r),r},e.connect=function(e){if(i.isArray(e)){var t=e;e=null,L(t,(function(t){null!=t.group&&(e=t.group)})),e=e||"g_"+me++,L(t,(function(t){t.group=e}))}return pe[e]=!0,e},e.disConnect=ye,e.disconnect=_e,e.dispose=function(e){"string"==typeof e?e=fe[e]:e instanceof V||(e=xe(e)),e instanceof V&&!e.isDisposed()&&e.dispose()},e.getInstanceByDom=xe,e.getInstanceById=function(e){return fe[e]},e.registerTheme=be,e.registerPreprocessor=we,e.registerProcessor=Te,e.registerPostUpdate=function(e){ue.push(e)},e.registerAction=Se,e.registerCoordinateSystem=function(e,t){u.register(e,t)},e.getCoordinateSystemDimensions=function(e){var t=u.get(e);if(t)return t.getDimensionsInfo?t.getDimensionsInfo():t.dimensions.slice()},e.registerLayout=function(e,t){Ae(he,e,t,1e3,"layout")},e.registerVisual=Me,e.registerLoading=Ie,e.extendComponentModel=function(e){return m.extend(e)},e.extendComponentView=function(e){return y.extend(e)},e.extendSeriesModel=function(e){return v.extend(e)},e.extendChartView=function(e){return _.extend(e)},e.setCanvasCreator=function(e){i.$override("createCanvas",e)},e.registerMap=function(e,t,i){D.registerMap(e,t,i)},e.getMap=function(e){var t=D.retrieveMap(e);return t&&t[0]&&{geoJson:t[0].geoJSON,specialAreas:t[0].specialAreas}},e.dataTool={};var Ce=Oy;!function(){for(var t in Ce)Ce.hasOwnProperty(t)&&(e[t]=Ce[t])}()}(h);var GT=vx;um.extend({type:"series.line",dependencies:["grid","polar"],getInitialData:function(e,t){return GT(this.getSource(),this,{useEncodeDefaulter:!0})},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,clip:!0,label:{position:"top"},lineStyle:{width:2,type:"solid"},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}});var HT={},UT=qp.retrieveRawValue;HT.getDefaultLabel=function(e,t){var i=e.mapDimension("defaultedLabel",!0),n=i.length;if(1===n)return UT(e,t,i[0]);if(n){for(var r=[],a=0;a<i.length;a++){var o=UT(e,t,i[a]);r.push(o)}return r.join(" ")}};var WT=g,jT=ow.createSymbol,XT=No,ZT=Uc.parsePercent,qT=HT.getDefaultLabel;function YT(e,t,i){XT.Group.call(this),this.updateData(e,t,i)}var KT=YT.prototype,QT=YT.getSymbolSize=function(e,t){var i=e.getItemVisual(t,"symbolSize");return i instanceof Array?i.slice():[+i,+i]};function JT(e){return[e[0]/2,e[1]/2]}function $T(e,t){this.parent.drift(e,t)}KT._createSymbol=function(e,t,i,n,r){this.removeAll();var a=t.getItemVisual(i,"color"),o=jT(e,-1,-1,2,2,a,r);o.attr({z2:100,culling:!0,scale:JT(n)}),o.drift=$T,this._symbolType=e,this.add(o)},KT.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(e)},KT.getSymbolPath=function(){return this.childAt(0)},KT.getScale=function(){return this.childAt(0).scale},KT.highlight=function(){this.childAt(0).trigger("emphasis")},KT.downplay=function(){this.childAt(0).trigger("normal")},KT.setZ=function(e,t){var i=this.childAt(0);i.zlevel=e,i.z=t},KT.setDraggable=function(e){var t=this.childAt(0);t.draggable=e,t.cursor=e?"move":t.cursor},KT.updateData=function(e,t,i){this.silent=!1;var n=e.getItemVisual(t,"symbol")||"circle",r=e.hostModel,a=QT(e,t),o=n!==this._symbolType;if(o){var s=e.getItemVisual(t,"symbolKeepAspect");this._createSymbol(n,e,t,a,s)}else(l=this.childAt(0)).silent=!1,XT.updateProps(l,{scale:JT(a)},r,t);if(this._updateCommon(e,t,a,i),o){var l=this.childAt(0),u=i&&i.fadeIn,h={scale:l.scale.slice()};u&&(h.style={opacity:l.style.opacity}),l.scale=[0,0],u&&(l.style.opacity=0),XT.initProps(l,h,r,t)}this._seriesModel=r};var eS=["itemStyle"],tS=["emphasis","itemStyle"],iS=["label"],nS=["emphasis","label"];function rS(e,t){if(!this.incremental&&!this.useHoverLayer)if("emphasis"===t){var i=this.__symbolOriginalScale,n=i[1]/i[0],r={scale:[Math.max(1.1*i[0],i[0]+3),Math.max(1.1*i[1],i[1]+3*n)]};this.animateTo(r,400,"elasticOut")}else"normal"===t&&this.animateTo({scale:this.__symbolOriginalScale},400,"elasticOut")}KT._updateCommon=function(e,t,i,n){var r=this.childAt(0),a=e.hostModel,o=e.getItemVisual(t,"color");"image"!==r.type?r.useStyle({strokeNoScale:!0}):r.setStyle({opacity:1,shadowBlur:null,shadowOffsetX:null,shadowOffsetY:null,shadowColor:null});var s=n&&n.itemStyle,l=n&&n.hoverItemStyle,u=n&&n.symbolOffset,h=n&&n.labelModel,c=n&&n.hoverLabelModel,d=n&&n.hoverAnimation,f=n&&n.cursorStyle;if(!n||e.hasItemOption){var p=n&&n.itemModel?n.itemModel:e.getItemModel(t);s=p.getModel(eS).getItemStyle(["color"]),l=p.getModel(tS).getItemStyle(),u=p.getShallow("symbolOffset"),h=p.getModel(iS),c=p.getModel(nS),d=p.getShallow("hoverAnimation"),f=p.getShallow("cursor")}else l=WT.extend({},l);var g=r.style,m=e.getItemVisual(t,"symbolRotate");r.attr("rotation",(m||0)*Math.PI/180||0),u&&r.attr("position",[ZT(u[0],i[0]),ZT(u[1],i[1])]),f&&r.attr("cursor",f),r.setColor(o,n&&n.symbolInnerColor),r.setStyle(s);var v=e.getItemVisual(t,"opacity");null!=v&&(g.opacity=v);var y=e.getItemVisual(t,"liftZ"),_=r.__z2Origin;null!=y?null==_&&(r.__z2Origin=r.z2,r.z2+=y):null!=_&&(r.z2=_,r.__z2Origin=null);var x=n&&n.useNameLabel;XT.setLabelStyle(g,l,h,c,{labelFetcher:a,labelDataIndex:t,defaultText:function(t,i){return x?e.getName(t):qT(e,t)},isRectText:!0,autoColor:o}),r.__symbolOriginalScale=JT(i),r.hoverStyle=l,r.highDownOnUpdate=d&&a.isAnimationEnabled()?rS:null,XT.setHoverStyle(r)},KT.fadeOut=function(e,t){var i=this.childAt(0);this.silent=i.silent=!0,(!t||!t.keepLabel)&&(i.style.text=null),XT.updateProps(i,{style:{opacity:0},scale:[0,0]},this._seriesModel,this.dataIndex,e)},WT.inherits(YT,XT.Group);var aS=YT,oS=No,sS=aS,lS=g.isObject;function uS(e){this.group=new oS.Group,this._symbolCtor=e||sS}var hS=uS.prototype;function cS(e,t,i,n){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(n.isIgnore&&n.isIgnore(i))&&!(n.clipShape&&!n.clipShape.contain(t[0],t[1]))&&"none"!==e.getItemVisual(i,"symbol")}function dS(e){return null==e||lS(e)||(e={isIgnore:e}),e||{}}function fS(e){var t=e.hostModel;return{itemStyle:t.getModel("itemStyle").getItemStyle(["color"]),hoverItemStyle:t.getModel("emphasis.itemStyle").getItemStyle(),symbolRotate:t.get("symbolRotate"),symbolOffset:t.get("symbolOffset"),hoverAnimation:t.get("hoverAnimation"),labelModel:t.getModel("label"),hoverLabelModel:t.getModel("emphasis.label"),cursorStyle:t.get("cursor")}}hS.updateData=function(e,t){t=dS(t);var i=this.group,n=e.hostModel,r=this._data,a=this._symbolCtor,o=fS(e);r||i.removeAll(),e.diff(r).add((function(n){var r=e.getItemLayout(n);if(cS(e,r,n,t)){var s=new a(e,n,o);s.attr("position",r),e.setItemGraphicEl(n,s),i.add(s)}})).update((function(s,l){var u=r.getItemGraphicEl(l),h=e.getItemLayout(s);cS(e,h,s,t)?(u?(u.updateData(e,s,o),oS.updateProps(u,{position:h},n)):(u=new a(e,s)).attr("position",h),i.add(u),e.setItemGraphicEl(s,u)):i.remove(u)})).remove((function(e){var t=r.getItemGraphicEl(e);t&&t.fadeOut((function(){i.remove(t)}))})).execute(),this._data=e},hS.isPersistent=function(){return!0},hS.updateLayout=function(){var e=this._data;e&&e.eachItemGraphicEl((function(t,i){var n=e.getItemLayout(i);t.attr("position",n)}))},hS.incrementalPrepareUpdate=function(e){this._seriesScope=fS(e),this._data=null,this.group.removeAll()},hS.incrementalUpdate=function(e,t,i){function n(e){e.isGroup||(e.incremental=e.useHoverLayer=!0)}i=dS(i);for(var r=e.start;r<e.end;r++){var a=t.getItemLayout(r);if(cS(t,a,r,i)){var o=new this._symbolCtor(t,r,this._seriesScope);o.traverse(n),o.attr("position",a),this.group.add(o),t.setItemGraphicEl(r,o)}}},hS.remove=function(e){var t=this.group,i=this._data;i&&e?i.eachItemGraphicEl((function(e){e.fadeOut((function(){t.remove(e)}))})):t.removeAll()};var pS=uS,gS={},mS=ex.isDimensionStacked,vS=g.map;gS.prepareDataCoordInfo=function(e,t,i){var n,r=e.getBaseAxis(),a=e.getOtherAxis(r),o=function(e,t){var i=0,n=e.scale.getExtent();return"start"===t?i=n[0]:"end"===t?i=n[1]:n[0]>0?i=n[0]:n[1]<0&&(i=n[1]),i}(a,i),s=r.dim,l=a.dim,u=t.mapDimension(l),h=t.mapDimension(s),c="x"===l||"radius"===l?1:0,d=vS(e.dimensions,(function(e){return t.mapDimension(e)})),f=t.getCalculationInfo("stackResultDimension");return(n|=mS(t,d[0]))&&(d[0]=f),(n|=mS(t,d[1]))&&(d[1]=f),{dataDimsForPoint:d,valueStart:o,valueAxisDim:l,baseAxisDim:s,stacked:!!n,valueDim:u,baseDim:h,baseDataOffset:c,stackedOverDimension:t.getCalculationInfo("stackedOverDimension")}},gS.getStackedOnPoint=function(e,t,i,n){var r=NaN;e.stacked&&(r=i.get(i.getCalculationInfo("stackedOverDimension"),n)),isNaN(r)&&(r=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=i.get(e.baseDim,n),o[1-a]=r,t.dataToPoint(o)};var yS=gS,_S=yS.prepareDataCoordInfo,xS=yS.getStackedOnPoint,bS=function(e,t,i,n,r,a,o,s){for(var l=function(e,t){var i=[];return t.diff(e).add((function(e){i.push({cmd:"+",idx:e})})).update((function(e,t){i.push({cmd:"=",idx:t,idx1:e})})).remove((function(e){i.push({cmd:"-",idx:e})})).execute(),i}(e,t),u=[],h=[],c=[],d=[],f=[],p=[],g=[],m=_S(r,t,o),v=_S(a,e,s),y=0;y<l.length;y++){var _=l[y],x=!0;switch(_.cmd){case"=":var b=e.getItemLayout(_.idx),w=t.getItemLayout(_.idx1);(isNaN(b[0])||isNaN(b[1]))&&(b=w.slice()),u.push(b),h.push(w),c.push(i[_.idx]),d.push(n[_.idx1]),g.push(t.getRawIndex(_.idx1));break;case"+":var T=_.idx;u.push(r.dataToPoint([t.get(m.dataDimsForPoint[0],T),t.get(m.dataDimsForPoint[1],T)])),h.push(t.getItemLayout(T).slice()),c.push(xS(m,r,t,T)),d.push(n[T]),g.push(t.getRawIndex(T));break;case"-":T=_.idx;var S=e.getRawIndex(T);S!==T?(u.push(e.getItemLayout(T)),h.push(a.dataToPoint([e.get(v.dataDimsForPoint[0],T),e.get(v.dataDimsForPoint[1],T)])),c.push(i[T]),d.push(xS(v,a,e,T)),g.push(S)):x=!1}x&&(f.push(_),p.push(p.length))}p.sort((function(e,t){return g[e]-g[t]}));var M=[],A=[],I=[],C=[],D=[];for(y=0;y<p.length;y++)T=p[y],M[y]=u[T],A[y]=h[T],I[y]=c[T],C[y]=d[T],D[y]=f[T];return{current:M,next:A,stackedOnCurrent:I,stackedOnNext:C,status:D}},wS={},TS=dl,SS=V,MS=Wl,AS=SS.min,IS=SS.max,CS=SS.scaleAndAdd,DS=SS.copy,ES=[],LS=[],PS=[];function NS(e){return isNaN(e[0])||isNaN(e[1])}function RS(e,t,i,n,r,a,o,s,l,u,h){return"none"!==u&&u?OS.apply(this,arguments):kS.apply(this,arguments)}function OS(e,t,i,n,r,a,o,s,l,u,h){for(var c=0,d=i,f=0;f<n;f++){var p=t[d];if(d>=r||d<0)break;if(NS(p)){if(h){d+=a;continue}break}if(d===i)e[a>0?"moveTo":"lineTo"](p[0],p[1]);else if(l>0){var g=t[c],m="y"===u?1:0,v=(p[m]-g[m])*l;DS(LS,g),LS[m]=g[m]+v,DS(PS,p),PS[m]=p[m]-v,e.bezierCurveTo(LS[0],LS[1],PS[0],PS[1],p[0],p[1])}else e.lineTo(p[0],p[1]);c=d,d+=a}return f}function kS(e,t,i,n,r,a,o,s,l,u,h){for(var c=0,d=i,f=0;f<n;f++){var p=t[d];if(d>=r||d<0)break;if(NS(p)){if(h){d+=a;continue}break}if(d===i)e[a>0?"moveTo":"lineTo"](p[0],p[1]),DS(LS,p);else if(l>0){var g=d+a,m=t[g];if(h)for(;m&&NS(t[g]);)m=t[g+=a];var v=.5,y=t[c];if(!(m=t[g])||NS(m))DS(PS,p);else{var _,x;if(NS(m)&&!h&&(m=p),SS.sub(ES,m,y),"x"===u||"y"===u){var b="x"===u?0:1;_=Math.abs(p[b]-y[b]),x=Math.abs(p[b]-m[b])}else _=SS.dist(p,y),x=SS.dist(p,m);CS(PS,p,ES,-l*(1-(v=x/(x+_))))}AS(LS,LS,s),IS(LS,LS,o),AS(PS,PS,s),IS(PS,PS,o),e.bezierCurveTo(LS[0],LS[1],PS[0],PS[1],p[0],p[1]),CS(LS,p,ES,l*v)}else e.lineTo(p[0],p[1]);c=d,d+=a}return f}function zS(e,t){var i=[1/0,1/0],n=[-1/0,-1/0];if(t)for(var r=0;r<e.length;r++){var a=e[r];a[0]<i[0]&&(i[0]=a[0]),a[1]<i[1]&&(i[1]=a[1]),a[0]>n[0]&&(n[0]=a[0]),a[1]>n[1]&&(n[1]=a[1])}return{min:t?i:n,max:t?n:i}}var BS=TS.extend({type:"ec-polyline",shape:{points:[],smooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},style:{fill:null,stroke:"#000"},brush:MS(TS.prototype.brush),buildPath:function(e,t){var i=t.points,n=0,r=i.length,a=zS(i,t.smoothConstraint);if(t.connectNulls){for(;r>0&&NS(i[r-1]);r--);for(;n<r&&NS(i[n]);n++);}for(;n<r;)n+=RS(e,i,n,r,r,1,a.min,a.max,t.smooth,t.smoothMonotone,t.connectNulls)+1}}),FS=TS.extend({type:"ec-polygon",shape:{points:[],stackedOnPoints:[],smooth:0,stackedOnSmooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},brush:MS(TS.prototype.brush),buildPath:function(e,t){var i=t.points,n=t.stackedOnPoints,r=0,a=i.length,o=t.smoothMonotone,s=zS(i,t.smoothConstraint),l=zS(n,t.smoothConstraint);if(t.connectNulls){for(;a>0&&NS(i[a-1]);a--);for(;r<a&&NS(i[r]);r++);}for(;r<a;){var u=RS(e,i,r,a,a,1,s.min,s.max,t.smooth,o,t.connectNulls);RS(e,n,r+u-1,u,a,-1,l.min,l.max,t.stackedOnSmooth,o,t.connectNulls),r+=u+1,e.closePath()}}});wS.Polyline=BS,wS.Polygon=FS;var VS={},GS=No,HS=Uc.round;function US(e,t,i){var n=e.getArea(),r=e.getBaseAxis().isHorizontal(),a=n.x,o=n.y,s=n.width,l=n.height,u=i.get("lineStyle.width")||2;a-=u/2,o-=u/2,s+=u,l+=u,a=Math.floor(a),s=Math.round(s);var h=new GS.Rect({shape:{x:a,y:o,width:s,height:l}});return t&&(h.shape[r?"width":"height"]=0,GS.initProps(h,{shape:{width:s,height:l}},i)),h}function WS(e,t,i){var n=e.getArea(),r=new GS.Sector({shape:{cx:HS(e.cx,1),cy:HS(e.cy,1),r0:HS(n.r0,1),r:HS(n.r,1),startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}});return t&&(r.shape.endAngle=n.startAngle,GS.initProps(r,{shape:{endAngle:n.endAngle}},i)),r}VS.createGridClipPath=US,VS.createPolarClipPath=WS,VS.createClipPath=function(e,t,i){return e?"polar"===e.type?WS(e,t,i):"cartesian2d"===e.type?US(e,t,i):null:null};var jS=g,XS=Jo.fromPoints,ZS=pS,qS=aS,YS=bS,KS=No,QS=lo,JS=wS,$S=JS.Polyline,eM=JS.Polygon,tM=Om,iM=gS,nM=iM.prepareDataCoordInfo,rM=iM.getStackedOnPoint,aM=VS,oM=aM.createGridClipPath,sM=aM.createPolarClipPath;function lM(e,t){if(e.length===t.length){for(var i=0;i<e.length;i++){var n=e[i],r=t[i];if(n[0]!==r[0]||n[1]!==r[1])return}return!0}}function uM(e,t){var i=[],n=[],r=[],a=[];return XS(e,i,n),XS(t,r,a),Math.max(Math.abs(i[0]-r[0]),Math.abs(i[1]-r[1]),Math.abs(n[0]-a[0]),Math.abs(n[1]-a[1]))}function hM(e){return"number"==typeof e?e:e?.5:0}function cM(e,t,i){for(var n=t.getBaseAxis(),r="x"===n.dim||"radius"===n.dim?0:1,a=[],o=0;o<e.length-1;o++){var s=e[o+1],l=e[o];a.push(l);var u=[];switch(i){case"end":u[r]=s[r],u[1-r]=l[1-r],a.push(u);break;case"middle":var h=(l[r]+s[r])/2,c=[];u[r]=c[r]=h,u[1-r]=l[1-r],c[1-r]=s[1-r],a.push(u),a.push(c);break;default:u[r]=l[r],u[1-r]=s[1-r],a.push(u)}}return e[o]&&a.push(e[o]),a}function dM(e,t,i){var n=e.get("showAllSymbol"),r="auto"===n;if(!n||r){var a=i.getAxesByScale("ordinal")[0];if(a&&(!r||!function(e,t){var i=e.getExtent(),n=Math.abs(i[1]-i[0])/e.scale.count();isNaN(n)&&(n=0);for(var r=t.count(),a=Math.max(1,Math.round(r/5)),o=0;o<r;o+=a)if(1.5*qS.getSymbolSize(t,o)[e.isHorizontal()?1:0]>n)return!1;return!0}(a,t))){var o=t.mapDimension(a.dim),s={};return jS.each(a.getViewLabels(),(function(e){s[e.tickValue]=1})),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function fM(e,t,i){if("cartesian2d"===e.type){var n=e.getBaseAxis().isHorizontal(),r=oM(e,t,i);if(!i.get("clip",!0)){var a=r.shape,o=Math.max(a.width,a.height);n?(a.y-=o,a.height+=2*o):(a.x-=o,a.width+=2*o)}return r}return sM(e,t,i)}tM.extend({type:"line",init:function(){var e=new KS.Group,t=new ZS;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e},render:function(e,t,i){var n=e.coordinateSystem,r=this.group,a=e.getData(),o=e.getModel("lineStyle"),s=e.getModel("areaStyle"),l=a.mapArray(a.getItemLayout),u="polar"===n.type,h=this._coordSys,c=this._symbolDraw,d=this._polyline,f=this._polygon,p=this._lineGroup,g=e.get("animation"),m=!s.isEmpty(),v=s.get("origin"),y=function(e,t,i){if(!i.valueDim)return[];for(var n=[],r=0,a=t.count();r<a;r++)n.push(rM(i,e,t,r));return n}(n,a,nM(n,a,v)),_=e.get("showSymbol"),x=_&&!u&&dM(e,a,n),b=this._data;b&&b.eachItemGraphicEl((function(e,t){e.__temp&&(r.remove(e),b.setItemGraphicEl(t,null))})),_||c.remove(),r.add(p);var w,T=!u&&e.get("step");n&&n.getArea&&e.get("clip",!0)&&(null!=(w=n.getArea()).width?(w.x-=.1,w.y-=.1,w.width+=.2,w.height+=.2):w.r0&&(w.r0-=.5,w.r1+=.5)),this._clipShapeForSymbol=w,d&&h.type===n.type&&T===this._step?(m&&!f?f=this._newPolygon(l,y,n,g):f&&!m&&(p.remove(f),f=this._polygon=null),p.setClipPath(fM(n,!1,e)),_&&c.updateData(a,{isIgnore:x,clipShape:w}),a.eachItemGraphicEl((function(e){e.stopAnimation(!0)})),lM(this._stackedOnPoints,y)&&lM(this._points,l)||(g?this._updateAnimation(a,y,n,i,T,v):(T&&(l=cM(l,n,T),y=cM(y,n,T)),d.setShape({points:l}),f&&f.setShape({points:l,stackedOnPoints:y})))):(_&&c.updateData(a,{isIgnore:x,clipShape:w}),T&&(l=cM(l,n,T),y=cM(y,n,T)),d=this._newPolyline(l,n,g),m&&(f=this._newPolygon(l,y,n,g)),p.setClipPath(fM(n,!0,e)));var S=function(e,t){var i=e.getVisual("visualMeta");if(i&&i.length&&e.count()&&"cartesian2d"===t.type){for(var n,r,a=i.length-1;a>=0;a--){var o=i[a].dimension,s=e.dimensions[o],l=e.getDimensionInfo(s);if("x"===(n=l&&l.coordDim)||"y"===n){r=i[a];break}}if(r){var u=t.getAxis(n),h=jS.map(r.stops,(function(e){return{coord:u.toGlobalCoord(u.dataToCoord(e.value)),color:e.color}})),c=h.length,d=r.outerColors.slice();c&&h[0].coord>h[c-1].coord&&(h.reverse(),d.reverse());var f=h[0].coord-10,p=h[c-1].coord+10,g=p-f;if(g<.001)return"transparent";jS.each(h,(function(e){e.offset=(e.coord-f)/g})),h.push({offset:c?h[c-1].offset:.5,color:d[1]||"transparent"}),h.unshift({offset:c?h[0].offset:.5,color:d[0]||"transparent"});var m=new KS.LinearGradient(0,0,0,0,h,!0);return m[n]=f,m[n+"2"]=p,m}}}(a,n)||a.getVisual("color");d.useStyle(jS.defaults(o.getLineStyle(),{fill:"none",stroke:S,lineJoin:"bevel"}));var M=e.get("smooth");if(M=hM(e.get("smooth")),d.setShape({smooth:M,smoothMonotone:e.get("smoothMonotone"),connectNulls:e.get("connectNulls")}),f){var A=a.getCalculationInfo("stackedOnSeries"),I=0;f.useStyle(jS.defaults(s.getAreaStyle(),{fill:S,opacity:.7,lineJoin:"bevel"})),A&&(I=hM(A.get("smooth"))),f.setShape({smooth:M,stackedOnSmooth:I,smoothMonotone:e.get("smoothMonotone"),connectNulls:e.get("connectNulls")})}this._data=a,this._coordSys=n,this._stackedOnPoints=y,this._points=l,this._step=T,this._valueOrigin=v},dispose:function(){},highlight:function(e,t,i,n){var r=e.getData(),a=QS.queryDataIndex(r,n);if(!(a instanceof Array)&&null!=a&&a>=0){var o=r.getItemGraphicEl(a);if(!o){var s=r.getItemLayout(a);if(!s)return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(s[0],s[1]))return;(o=new qS(r,a)).position=s,o.setZ(e.get("zlevel"),e.get("z")),o.ignore=isNaN(s[0])||isNaN(s[1]),o.__temp=!0,r.setItemGraphicEl(a,o),o.stopSymbolAnimation(!0),this.group.add(o)}o.highlight()}else tM.prototype.highlight.call(this,e,t,i,n)},downplay:function(e,t,i,n){var r=e.getData(),a=QS.queryDataIndex(r,n);if(null!=a&&a>=0){var o=r.getItemGraphicEl(a);o&&(o.__temp?(r.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else tM.prototype.downplay.call(this,e,t,i,n)},_newPolyline:function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new $S({shape:{points:e},silent:!0,z2:10}),this._lineGroup.add(t),this._polyline=t,t},_newPolygon:function(e,t){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new eM({shape:{points:e,stackedOnPoints:t},silent:!0}),this._lineGroup.add(i),this._polygon=i,i},_updateAnimation:function(e,t,i,n,r,a){var o=this._polyline,s=this._polygon,l=e.hostModel,u=YS(this._data,e,this._stackedOnPoints,t,this._coordSys,i,this._valueOrigin,a),h=u.current,c=u.stackedOnCurrent,d=u.next,f=u.stackedOnNext;if(r&&(h=cM(u.current,i,r),c=cM(u.stackedOnCurrent,i,r),d=cM(u.next,i,r),f=cM(u.stackedOnNext,i,r)),uM(h,d)>3e3||s&&uM(c,f)>3e3)return o.setShape({points:d}),void(s&&s.setShape({points:d,stackedOnPoints:f}));o.shape.__points=u.current,o.shape.points=h,KS.updateProps(o,{shape:{points:d}},l),s&&(s.setShape({points:h,stackedOnPoints:c}),KS.updateProps(s,{shape:{points:d,stackedOnPoints:f}},l));for(var p=[],g=u.status,m=0;m<g.length;m++)if("="===g[m].cmd){var v=e.getItemGraphicEl(g[m].idx1);v&&p.push({el:v,ptIdx:m})}o.animators&&o.animators.length&&o.animators[0].during((function(){for(var e=0;e<p.length;e++)p[e].el.attr("position",o.shape.__points[p[e].ptIdx])}))},remove:function(e){var t=this.group,i=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),i&&i.eachItemGraphicEl((function(e,n){e.__temp&&(t.remove(e),i.setItemGraphicEl(n,null))})),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._data=null}});var pM=g.isFunction,gM=function(e,t,i){return{seriesType:e,performRawSeries:!0,reset:function(e,n,r){var a=e.getData(),o=e.get("symbol"),s=e.get("symbolSize"),l=e.get("symbolKeepAspect"),u=e.get("symbolRotate"),h=pM(o),c=pM(s),d=pM(u),f=h||c||d,p=!h&&o?o:t,g=c?null:s;if(a.setVisual({legendSymbol:i||p,symbol:p,symbolSize:g,symbolKeepAspect:l,symbolRotate:u}),!n.isSeriesFiltered(e))return{dataEach:a.hasItemOption||f?function(t,i){if(f){var n=e.getRawValue(i),r=e.getDataParams(i);h&&t.setItemVisual(i,"symbol",o(n,r)),c&&t.setItemVisual(i,"symbolSize",s(n,r)),d&&t.setItemVisual(i,"symbolRotate",u(n,r))}if(t.hasItemOption){var a=t.getItemModel(i),l=a.getShallow("symbol",!0),p=a.getShallow("symbolSize",!0),g=a.getShallow("symbolRotate",!0),m=a.getShallow("symbolKeepAspect",!0);null!=l&&t.setItemVisual(i,"symbol",l),null!=p&&t.setItemVisual(i,"symbolSize",p),null!=g&&t.setItemVisual(i,"symbolRotate",g),null!=m&&t.setItemVisual(i,"symbolKeepAspect",m)}}:null}}}},mM=g.map,vM=vm,yM=ex.isDimensionStacked,_M=function(e){return{seriesType:e,plan:vM(),reset:function(e){var t=e.getData(),i=e.coordinateSystem,n=e.pipelineContext.large;if(i){var r=mM(i.dimensions,(function(e){return t.mapDimension(e)})).slice(0,2),a=r.length,o=t.getCalculationInfo("stackResultDimension");return yM(t,r[0])&&(r[0]=o),yM(t,r[1])&&(r[1]=o),a&&{progress:function(e,t){for(var o=e.end-e.start,s=n&&new Float32Array(o*a),l=e.start,u=0,h=[],c=[];l<e.end;l++){var d;if(1===a){var f=t.get(r[0],l);d=!isNaN(f)&&i.dataToPoint(f,null,c)}else{f=h[0]=t.get(r[0],l);var p=h[1]=t.get(r[1],l);d=!isNaN(f)&&!isNaN(p)&&i.dataToPoint(h,null,c)}n?(s[u++]=d?d[0]:NaN,s[u++]=d?d[1]:NaN):t.setItemLayout(l,d&&d.slice()||[NaN,NaN])}n&&t.setLayout("symbolPoints",s)}}}}}},xM={average:function(e){for(var t=0,i=0,n=0;n<e.length;n++)isNaN(e[n])||(t+=e[n],i++);return 0===i?NaN:t/i},sum:function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i]||0;return t},max:function(e){for(var t=-1/0,i=0;i<e.length;i++)e[i]>t&&(t=e[i]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,i=0;i<e.length;i++)e[i]<t&&(t=e[i]);return isFinite(t)?t:NaN},nearest:function(e){return e[0]}},bM=function(e,t){return Math.round(e.length/2)},wM=function(e){return{seriesType:e,modifyOutputEnd:!0,reset:function(e,t,i){var n=e.getData(),r=e.get("sampling"),a=e.coordinateSystem;if("cartesian2d"===a.type&&r){var o,s=a.getBaseAxis(),l=a.getOtherAxis(s),u=s.getExtent(),h=Math.abs(u[1]-u[0]),c=Math.round(n.count()/h);c>1&&("string"==typeof r?o=xM[r]:"function"==typeof r&&(o=r),o&&e.setData(n.downSample(n.mapDimension(l.dim),1/c,o,bM)))}}}},TM=g;function SM(e){return this._axes[e]}var MM=function(e){this._axes={},this._dimList=[],this.name=e||""};MM.prototype={constructor:MM,type:"cartesian",getAxis:function(e){return this._axes[e]},getAxes:function(){return TM.map(this._dimList,SM,this)},getAxesByScale:function(e){return e=e.toLowerCase(),TM.filter(this.getAxes(),(function(t){return t.scale.type===e}))},addAxis:function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},dataToCoord:function(e){return this._dataCoordConvert(e,"dataToCoord")},coordToData:function(e){return this._dataCoordConvert(e,"coordToData")},_dataCoordConvert:function(e,t){for(var i=this._dimList,n=e instanceof Array?[]:{},r=0;r<i.length;r++){var a=i[r],o=this._axes[a];n[a]=o[t](e[a])}return n}};var AM=g,IM=Pi,CM=MM;function DM(e){CM.call(this,e)}DM.prototype={constructor:DM,type:"cartesian2d",dimensions:["x","y"],getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},containPoint:function(e){var t=this.getAxis("x"),i=this.getAxis("y");return t.contain(t.toLocalCoord(e[0]))&&i.contain(i.toLocalCoord(e[1]))},containData:function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},dataToPoint:function(e,t,i){var n=this.getAxis("x"),r=this.getAxis("y");return(i=i||[])[0]=n.toGlobalCoord(n.dataToCoord(e[0])),i[1]=r.toGlobalCoord(r.dataToCoord(e[1])),i},clampData:function(e,t){var i=this.getAxis("x").scale,n=this.getAxis("y").scale,r=i.getExtent(),a=n.getExtent(),o=i.parse(e[0]),s=n.parse(e[1]);return(t=t||[])[0]=Math.min(Math.max(Math.min(r[0],r[1]),o),Math.max(r[0],r[1])),t[1]=Math.min(Math.max(Math.min(a[0],a[1]),s),Math.max(a[0],a[1])),t},pointToData:function(e,t){var i=this.getAxis("x"),n=this.getAxis("y");return(t=t||[])[0]=i.coordToData(i.toLocalCoord(e[0])),t[1]=n.coordToData(n.toLocalCoord(e[1])),t},getOtherAxis:function(e){return this.getAxis("x"===e.dim?"y":"x")},getArea:function(){var e=this.getAxis("x").getGlobalExtent(),t=this.getAxis("y").getGlobalExtent(),i=Math.min(e[0],e[1]),n=Math.min(t[0],t[1]),r=Math.max(e[0],e[1])-i,a=Math.max(t[0],t[1])-n;return new IM(i,n,r,a)}},AM.inherits(DM,CM);var EM=DM,LM=g,PM=wT,NM=function(e,t,i,n,r){PM.call(this,e,t,i),this.type=n||"value",this.position=r||"bottom"};NM.prototype={constructor:NM,index:0,getAxesOnZeroOf:null,model:null,isHorizontal:function(){var e=this.position;return"top"===e||"bottom"===e},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},getOtherAxis:function(){this.grid.getOtherAxis()},pointToData:function(e,t){return this.coordToData(this.toLocalCoord(e["x"===this.dim?0:1]),t)},toLocalCoord:null,toGlobalCoord:null},LM.inherits(NM,PM);var RM=NM,OM=g,kM={show:!0,zlevel: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:"#333",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:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},zM={};zM.categoryAxis=OM.merge({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},kM),zM.valueAxis=OM.merge({boundaryGap:[0,0],splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#eee",width:1}}},kM),zM.timeAxis=OM.defaults({scale:!0,min:"dataMin",max:"dataMax"},zM.valueAxis),zM.logAxis=OM.defaults({scale:!0,logBase:10},zM.valueAxis);var BM=zM,FM=g,VM=BM,GM=Ld,HM=Hc,UM=HM.getLayoutParams,WM=HM.mergeLayoutParam,jM=Lx,XM=["value","category","time","log"],ZM=function(e,t,i,n){FM.each(XM,(function(r){t.extend({type:e+"Axis."+r,mergeDefaultAndTheme:function(t,n){var a=this.layoutMode,o=a?UM(t):{},s=n.getTheme();FM.merge(t,s.get(r+"Axis")),FM.merge(t,this.getDefaultOption()),t.type=i(e,t),a&&WM(t,o,a)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=jM.createByAxisModel(this))},getCategories:function(e){var t=this.option;if("category"===t.type)return e?t.data:this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:FM.mergeAll([{},VM[r+"Axis"],n],!0)})})),GM.registerSubTypeDefaulter(e+"Axis",FM.curry(i,e))},qM=g,YM=ZM,KM=aw,QM=Ld.extend({type:"cartesian2dAxis",axis:null,init:function(){QM.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){QM.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){QM.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});function JM(e,t){return t.type||(t.data?"category":"value")}qM.merge(QM.prototype,KM);var $M={offset:0};YM("x",QM,JM,$M),YM("y",QM,JM,$M),Ld.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});var eA=g,tA=eA.isObject,iA=eA.each,nA=eA.map,rA=eA.indexOf;eA.retrieve;var aA=Hc.getLayoutRect,oA=yx,sA=oA.createScaleByModel,lA=oA.ifAxisCrossZero,uA=oA.niceScaleExtent,hA=oA.estimateLabelUnionRect,cA=EM,dA=RM,fA=sp,pA=ex.getStackedDimension;function gA(e,t,i){return e.getCoordSysModel()===t}function mA(e,t,i){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(e,t,i),this.model=e}var vA=mA.prototype;function yA(e,t,i,n){i.getAxesOnZeroOf=function(){return r?[r]:[]};var r,a=e[t],o=i.model,s=o.get("axisLine.onZero"),l=o.get("axisLine.onZeroAxisIndex");if(s){if(null!=l)_A(a[l])&&(r=a[l]);else for(var u in a)if(a.hasOwnProperty(u)&&_A(a[u])&&!n[h(a[u])]){r=a[u];break}r&&(n[h(r)]=!0)}function h(e){return e.dim+"_"+e.index}}function _A(e){return e&&"category"!==e.type&&"time"!==e.type&&lA(e)}vA.type="grid",vA.axisPointerEnabled=!0,vA.getRect=function(){return this._rect},vA.update=function(e,t){var i=this._axesMap;this._updateScale(e,this.model),iA(i.x,(function(e){uA(e.scale,e.model)})),iA(i.y,(function(e){uA(e.scale,e.model)}));var n={};iA(i.x,(function(e){yA(i,"y",e,n)})),iA(i.y,(function(e){yA(i,"x",e,n)})),this.resize(this.model,t)},vA.resize=function(e,t,i){var n=aA(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()});this._rect=n;var r=this._axesList;function a(){iA(r,(function(e){var t=e.isHorizontal(),i=t?[0,n.width]:[0,n.height],r=e.inverse?1:0;e.setExtent(i[r],i[1-r]),function(e,t){var i=e.getExtent(),n=i[0]+i[1];e.toGlobalCoord="x"===e.dim?function(e){return e+t}:function(e){return n-e+t},e.toLocalCoord="x"===e.dim?function(e){return e-t}:function(e){return n-e+t}}(e,t?n.x:n.y)}))}a(),!i&&e.get("containLabel")&&(iA(r,(function(e){if(!e.model.get("axisLabel.inside")){var t=hA(e);if(t){var i=e.isHorizontal()?"height":"width",r=e.model.get("axisLabel.margin");n[i]-=t[i]+r,"top"===e.position?n.y+=t.height+r:"left"===e.position&&(n.x+=t.width+r)}}})),a())},vA.getAxis=function(e,t){var i=this._axesMap[e];if(null!=i){if(null==t)for(var n in i)if(i.hasOwnProperty(n))return i[n];return i[t]}},vA.getAxes=function(){return this._axesList.slice()},vA.getCartesian=function(e,t){if(null!=e&&null!=t){var i="x"+e+"y"+t;return this._coordsMap[i]}tA(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var n=0,r=this._coordsList;n<r.length;n++)if(r[n].getAxis("x").index===e||r[n].getAxis("y").index===t)return r[n]},vA.getCartesians=function(){return this._coordsList.slice()},vA.convertToPixel=function(e,t,i){var n=this._findConvertTarget(e,t);return n.cartesian?n.cartesian.dataToPoint(i):n.axis?n.axis.toGlobalCoord(n.axis.dataToCoord(i)):null},vA.convertFromPixel=function(e,t,i){var n=this._findConvertTarget(e,t);return n.cartesian?n.cartesian.pointToData(i):n.axis?n.axis.coordToData(n.axis.toLocalCoord(i)):null},vA._findConvertTarget=function(e,t){var i,n,r=t.seriesModel,a=t.xAxisModel||r&&r.getReferringComponents("xAxis")[0],o=t.yAxisModel||r&&r.getReferringComponents("yAxis")[0],s=t.gridModel,l=this._coordsList;return r?(i=r.coordinateSystem,rA(l,i)<0&&(i=null)):a&&o?i=this.getCartesian(a.componentIndex,o.componentIndex):a?n=this.getAxis("x",a.componentIndex):o?n=this.getAxis("y",o.componentIndex):s&&s.coordinateSystem===this&&(i=this._coordsList[0]),{cartesian:i,axis:n}},vA.containPoint=function(e){var t=this._coordsList[0];if(t)return t.containPoint(e)},vA._initCartesian=function(e,t,i){var n={left:!1,right:!1,top:!1,bottom:!1},r={x:{},y:{}},a={x:0,y:0};if(t.eachComponent("xAxis",o("x"),this),t.eachComponent("yAxis",o("y"),this),!a.x||!a.y)return this._axesMap={},void(this._axesList=[]);function o(t){return function(i,o){if(gA(i,e)){var s=i.get("position");"x"===t?"top"!==s&&"bottom"!==s&&(s=n.bottom?"top":"bottom"):"left"!==s&&"right"!==s&&(s=n.left?"right":"left"),n[s]=!0;var l=new dA(t,sA(i),[0,0],i.get("type"),s),u="category"===l.type;l.onBand=u&&i.get("boundaryGap"),l.inverse=i.get("inverse"),i.axis=l,l.model=i,l.grid=this,l.index=o,this._axesList.push(l),r[t][o]=l,a[t]++}}}this._axesMap=r,iA(r.x,(function(t,i){iA(r.y,(function(n,r){var a="x"+i+"y"+r,o=new cA(a);o.grid=this,o.model=e,this._coordsMap[a]=o,this._coordsList.push(o),o.addAxis(t),o.addAxis(n)}),this)}),this)},vA._updateScale=function(e,t){function i(e,t,i){iA(e.mapDimension(t.dim,!0),(function(i){t.scale.unionExtentFromData(e,pA(e,i))}))}iA(this._axesList,(function(e){e.scale.setExtent(1/0,-1/0)})),e.eachSeries((function(e){if(wA(e)){var n=bA(e),r=n[0],a=n[1];if(!gA(r,t)||!gA(a,t))return;var o=this.getCartesian(r.componentIndex,a.componentIndex),s=e.getData(),l=o.getAxis("x"),u=o.getAxis("y");"list"===s.type&&(i(s,l),i(s,u))}}),this)},vA.getTooltipAxes=function(e){var t=[],i=[];return iA(this.getCartesians(),(function(n){var r=null!=e&&"auto"!==e?n.getAxis(e):n.getBaseAxis(),a=n.getOtherAxis(r);rA(t,r)<0&&t.push(r),rA(i,a)<0&&i.push(a)})),{baseAxes:t,otherAxes:i}};var xA=["xAxis","yAxis"];function bA(e,t){return nA(xA,(function(t){return e.getReferringComponents(t)[0]}))}function wA(e){return"cartesian2d"===e.get("coordinateSystem")}mA.create=function(e,t){var i=[];return e.eachComponent("grid",(function(n,r){var a=new mA(n,e,t);a.name="grid_"+r,a.resize(n,t,!0),n.coordinateSystem=a,i.push(a)})),e.eachSeries((function(e){if(wA(e)){var t=bA(e),i=t[0],n=t[1],r=i.getCoordSysModel().coordinateSystem;e.coordinateSystem=r.getCartesian(i.componentIndex,n.componentIndex)}})),i},mA.dimensions=mA.prototype.dimensions=cA.prototype.dimensions,fA.register("cartesian2d",mA);var TA=g,SA=TA.retrieve,MA=TA.defaults,AA=TA.extend,IA=TA.each,CA=qc,DA=No,EA=zc,LA=Uc,PA=LA.isRadianAroundZero,NA=LA.remRadian,RA=ow.createSymbol,OA=Ue,kA=V.applyTransform,zA=yx.shouldShowAllLabels,BA=Math.PI,FA=function(e,t){this.opt=t,this.axisModel=e,MA(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0}),this.group=new DA.Group;var i=new DA.Group({position:t.position.slice(),rotation:t.rotation});i.updateTransform(),this._transform=i.transform,this._dumbGroup=i};FA.prototype={constructor:FA,hasBuilder:function(e){return!!VA[e]},add:function(e){VA[e].call(this)},getGroup:function(){return this.group}};var VA={axisLine:function(){var e=this.opt,t=this.axisModel;if(t.get("axisLine.show")){var i=this.axisModel.axis.getExtent(),n=this._transform,r=[i[0],0],a=[i[1],0];n&&(kA(r,r,n),kA(a,a,n));var o=AA({lineCap:"round"},t.getModel("axisLine.lineStyle").getLineStyle());this.group.add(new DA.Line({anid:"line",subPixelOptimize:!0,shape:{x1:r[0],y1:r[1],x2:a[0],y2:a[1]},style:o,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1}));var s=t.get("axisLine.symbol"),l=t.get("axisLine.symbolSize"),u=t.get("axisLine.symbolOffset")||0;if("number"==typeof u&&(u=[u,u]),null!=s){"string"==typeof s&&(s=[s,s]),"string"!=typeof l&&"number"!=typeof l||(l=[l,l]);var h=l[0],c=l[1];IA([{rotate:e.rotation+Math.PI/2,offset:u[0],r:0},{rotate:e.rotation-Math.PI/2,offset:u[1],r:Math.sqrt((r[0]-a[0])*(r[0]-a[0])+(r[1]-a[1])*(r[1]-a[1]))}],(function(t,i){if("none"!==s[i]&&null!=s[i]){var n=RA(s[i],-h/2,-c/2,h,c,o.stroke,!0),a=t.r+t.offset,l=[r[0]+a*Math.cos(e.rotation),r[1]-a*Math.sin(e.rotation)];n.attr({rotation:t.rotate,position:l,silent:!0,z2:11}),this.group.add(n)}}),this)}}},axisTickLabel:function(){var e=this.axisModel,t=this.opt,i=function(e,t,i){var n=t.axis,r=t.getModel("axisTick");if(r.get("show")&&!n.scale.isBlank()){for(var a=r.getModel("lineStyle"),o=i.tickDirection*r.get("length"),s=ZA(n.getTicksCoords(),e._transform,o,MA(a.getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")}),"ticks"),l=0;l<s.length;l++)e.group.add(s[l]);return s}}(this,e,t),n=function(e,t,i){var n=t.axis;if(SA(i.axisLabelShow,t.get("axisLabel.show"))&&!n.scale.isBlank()){var r=t.getModel("axisLabel"),a=r.get("margin"),o=n.getViewLabels(),s=(SA(i.labelRotate,r.get("rotate"))||0)*BA/180,l=HA(i.rotation,s,i.labelDirection),u=t.getCategories&&t.getCategories(!0),h=[],c=UA(t),d=t.get("triggerEvent");return IA(o,(function(o,s){var f=o.tickValue,p=o.formattedLabel,g=o.rawLabel,m=r;u&&u[f]&&u[f].textStyle&&(m=new EA(u[f].textStyle,r,t.ecModel));var v=m.getTextColor()||t.get("axisLine.lineStyle.color"),y=[n.dataToCoord(f),i.labelOffset+i.labelDirection*a],_=new DA.Text({anid:"label_"+f,position:y,rotation:l.rotation,silent:c,z2:10});DA.setTextStyle(_.style,m,{text:p,textAlign:m.getShallow("align",!0)||l.textAlign,textVerticalAlign:m.getShallow("verticalAlign",!0)||m.getShallow("baseline",!0)||l.textVerticalAlign,textFill:"function"==typeof v?v("category"===n.type?g:"value"===n.type?f+"":f,s):v}),d&&(_.eventData=GA(t),_.eventData.targetType="axisLabel",_.eventData.value=g),e._dumbGroup.add(_),_.updateTransform(),h.push(_),e.group.add(_),_.decomposeTransform()})),h}}(this,e,t);!function(e,t,i){if(!zA(e.axis)){var n=e.get("axisLabel.showMinLabel"),r=e.get("axisLabel.showMaxLabel");i=i||[];var a=(t=t||[])[0],o=t[1],s=t[t.length-1],l=t[t.length-2],u=i[0],h=i[1],c=i[i.length-1],d=i[i.length-2];!1===n?(WA(a),WA(u)):jA(a,o)&&(n?(WA(o),WA(h)):(WA(a),WA(u))),!1===r?(WA(s),WA(c)):jA(l,s)&&(r?(WA(l),WA(d)):(WA(s),WA(c)))}}(e,n,i),function(e,t,i){var n=t.axis,r=t.getModel("minorTick");if(r.get("show")&&!n.scale.isBlank()){var a=n.getMinorTicksCoords();if(a.length)for(var o=r.getModel("lineStyle"),s=i.tickDirection*r.get("length"),l=MA(o.getLineStyle(),MA(t.getModel("axisTick").getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")})),u=0;u<a.length;u++)for(var h=ZA(a[u],e._transform,s,l,"minorticks_"+u),c=0;c<h.length;c++)e.group.add(h[c])}}(this,e,t)},axisName:function(){var e=this.opt,t=this.axisModel,i=SA(e.axisName,t.get("name"));if(i){var n,r,a=t.get("nameLocation"),o=e.nameDirection,s=t.getModel("nameTextStyle"),l=t.get("nameGap")||0,u=this.axisModel.axis.getExtent(),h=u[0]>u[1]?-1:1,c=["start"===a?u[0]-h*l:"end"===a?u[1]+h*l:(u[0]+u[1])/2,XA(a)?e.labelOffset+o*l:0],d=t.get("nameRotate");null!=d&&(d=d*BA/180),XA(a)?n=HA(e.rotation,null!=d?d:e.rotation,o):(n=function(e,t,i,n){var r,a,o=NA(i-e.rotation),s=n[0]>n[1],l="start"===t&&!s||"start"!==t&&s;return PA(o-BA/2)?(a=l?"bottom":"top",r="center"):PA(o-1.5*BA)?(a=l?"top":"bottom",r="center"):(a="middle",r=o<1.5*BA&&o>BA/2?l?"left":"right":l?"right":"left"),{rotation:o,textAlign:r,textVerticalAlign:a}}(e,a,d||0,u),null!=(r=e.axisNameAvailableWidth)&&(r=Math.abs(r/Math.sin(n.rotation)),!isFinite(r)&&(r=null)));var f=s.getFont(),p=t.get("nameTruncate",!0)||{},g=p.ellipsis,m=SA(e.nameTruncateMaxWidth,p.maxWidth,r),v=null!=g&&null!=m?CA.truncateText(i,m,f,g,{minChar:2,placeholder:p.placeholder}):i,y=t.get("tooltip",!0),_=t.mainType,x={componentType:_,name:i,$vars:["name"]};x[_+"Index"]=t.componentIndex;var b=new DA.Text({anid:"name",__fullText:i,__truncatedText:v,position:c,rotation:n.rotation,silent:UA(t),z2:1,tooltip:y&&y.show?AA({content:i,formatter:function(){return i},formatterParams:x},y):null});DA.setTextStyle(b.style,s,{text:v,textFont:f,textFill:s.getTextColor()||t.get("axisLine.lineStyle.color"),textAlign:s.get("align")||n.textAlign,textVerticalAlign:s.get("verticalAlign")||n.textVerticalAlign}),t.get("triggerEvent")&&(b.eventData=GA(t),b.eventData.targetType="axisName",b.eventData.name=i),this._dumbGroup.add(b),b.updateTransform(),this.group.add(b),b.decomposeTransform()}}},GA=FA.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},HA=FA.innerTextLayout=function(e,t,i){var n,r,a=NA(t-e);return PA(a)?(r=i>0?"top":"bottom",n="center"):PA(a-BA)?(r=i>0?"bottom":"top",n="center"):(r="middle",n=a>0&&a<BA?i>0?"right":"left":i>0?"left":"right"),{rotation:a,textAlign:n,textVerticalAlign:r}},UA=FA.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)};function WA(e){e&&(e.ignore=!0)}function jA(e,t,i){var n=e&&e.getBoundingRect().clone(),r=t&&t.getBoundingRect().clone();if(n&&r){var a=OA.identity([]);return OA.rotate(a,a,-e.rotation),n.applyTransform(OA.mul([],a,e.getLocalTransform())),r.applyTransform(OA.mul([],a,t.getLocalTransform())),n.intersect(r)}}function XA(e){return"middle"===e||"center"===e}function ZA(e,t,i,n,r){for(var a=[],o=[],s=[],l=0;l<e.length;l++){var u=e[l].coord;o[0]=u,o[1]=0,s[0]=u,s[1]=i,t&&(kA(o,o,t),kA(s,s,t));var h=new DA.Line({anid:r+"_"+e[l].tickValue,subPixelOptimize:!0,shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:n,z2:2,silent:!0});a.push(h)}return a}var qA=FA,YA={},KA=g,QA=zc,JA=KA.each,$A=KA.curry;function eI(e,t){return"all"===e||KA.isArray(e)&&KA.indexOf(e,t)>=0||e===t}function tI(e){var t=(e.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[nI(e)]}function iI(e){return!!e.get("handle.show")}function nI(e){return e.type+"||"+e.id}YA.collect=function(e,t){var i={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(e,t,i){var n=t.getComponent("tooltip"),r=t.getComponent("axisPointer"),a=r.get("link",!0)||[],o=[];JA(i.getCoordinateSystems(),(function(i){if(i.axisPointerEnabled){var s=nI(i.model),l=e.coordSysAxesInfo[s]={};e.coordSysMap[s]=i;var u=i.model.getModel("tooltip",n);if(JA(i.getAxes(),$A(f,!1,null)),i.getTooltipAxes&&n&&u.get("show")){var h="axis"===u.get("trigger"),c="cross"===u.get("axisPointer.type"),d=i.getTooltipAxes(u.get("axisPointer.axis"));(h||c)&&JA(d.baseAxes,$A(f,!c||"cross",h)),c&&JA(d.otherAxes,$A(f,"cross",!1))}}function f(n,s,h){var c=h.model.getModel("axisPointer",r),d=c.get("show");if(d&&("auto"!==d||n||iI(c))){null==s&&(s=c.get("triggerTooltip")),c=n?function(e,t,i,n,r,a){var o=t.getModel("axisPointer"),s={};JA(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],(function(e){s[e]=KA.clone(o.get(e))})),s.snap="category"!==e.type&&!!a,"cross"===o.get("type")&&(s.type="line");var l=s.label||(s.label={});if(null==l.show&&(l.show=!1),"cross"===r){var u=o.get("label.show");if(l.show=null==u||u,!a){var h=s.lineStyle=o.get("crossStyle");h&&KA.defaults(l,h.textStyle)}}return e.model.getModel("axisPointer",new QA(s,i,n))}(h,u,r,t,n,s):c;var f=c.get("snap"),p=nI(h.model),g=s||f||"category"===h.type,m=e.axesInfo[p]={key:p,axis:h,coordSys:i,axisPointerModel:c,triggerTooltip:s,involveSeries:g,snap:f,useHandle:iI(c),seriesModels:[]};l[p]=m,e.seriesInvolved|=g;var v=function(e,t){for(var i=t.model,n=t.dim,r=0;r<e.length;r++){var a=e[r]||{};if(eI(a[n+"AxisId"],i.id)||eI(a[n+"AxisIndex"],i.componentIndex)||eI(a[n+"AxisName"],i.name))return r}}(a,h);if(null!=v){var y=o[v]||(o[v]={axesInfo:{}});y.axesInfo[p]=m,y.mapper=a[v].mapper,m.linkGroup=y}}}}))}(i,e,t),i.seriesInvolved&&function(e,t){t.eachSeries((function(t){var i=t.coordinateSystem,n=t.get("tooltip.trigger",!0),r=t.get("tooltip.show",!0);i&&"none"!==n&&!1!==n&&"item"!==n&&!1!==r&&!1!==t.get("axisPointer.show",!0)&&JA(e.coordSysAxesInfo[nI(i.model)],(function(e){var n=e.axis;i.getAxis(n.dim)===n&&(e.seriesModels.push(t),null==e.seriesDataCount&&(e.seriesDataCount=0),e.seriesDataCount+=t.getData().count())}))}),this)}(i,e),i},YA.fixValue=function(e){var t=tI(e);if(t){var i=t.axisPointerModel,n=t.axis.scale,r=i.option,a=i.get("status"),o=i.get("value");null!=o&&(o=n.parse(o));var s=iI(i);null==a&&(r.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==o||o>l[1])&&(o=l[1]),o<l[0]&&(o=l[0]),r.value=o,s&&(r.status=t.axis.scale.isBlank()?"hide":"show")}},YA.getAxisInfo=tI,YA.getAxisPointerModel=function(e){var t=tI(e);return t&&t.axisPointerModel},YA.makeKey=nI;var rI=YA,aI=h.extendComponentView({type:"axis",_axisPointer:null,axisPointerClass:null,render:function(e,t,i,n){this.axisPointerClass&&rI.fixValue(e),aI.superApply(this,"render",arguments),oI(this,e,0,i,0,!0)},updateAxisPointer:function(e,t,i,n,r){oI(this,e,0,i,0,!1)},remove:function(e,t){var i=this._axisPointer;i&&i.remove(t),aI.superApply(this,"remove",arguments)},dispose:function(e,t){sI(this,t),aI.superApply(this,"dispose",arguments)}});function oI(e,t,i,n,r,a){var o=aI.getAxisPointerClass(e.axisPointerClass);if(o){var s=rI.getAxisPointerModel(t);s?(e._axisPointer||(e._axisPointer=new o)).render(t,s,n,a):sI(e,n)}}function sI(e,t,i){var n=e._axisPointer;n&&n.dispose(t,i),e._axisPointer=null}var lI=[];aI.registerAxisPointerClass=function(e,t){lI[e]=t},aI.getAxisPointerClass=function(e){return e&&lI[e]};var uI=aI,hI={},cI=g;hI.layout=function(e,t,i){i=i||{};var n=e.coordinateSystem,r=t.axis,a={},o=r.getAxesOnZeroOf()[0],s=r.position,l=o?"onZero":s,u=r.dim,h=n.getRect(),c=[h.x,h.x+h.width,h.y,h.y+h.height],d={left:0,right:1,top:0,bottom:1,onZero:2},f=t.get("offset")||0,p="x"===u?[c[2]-f,c[3]+f]:[c[0]-f,c[1]+f];if(o){var g=o.toGlobalCoord(o.dataToCoord(0));p[d.onZero]=Math.max(Math.min(g,p[1]),p[0])}a.position=["y"===u?p[d[l]]:c[0],"x"===u?p[d[l]]:c[3]],a.rotation=Math.PI/2*("x"===u?0:1),a.labelDirection=a.tickDirection=a.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],a.labelOffset=o?p[d[s]]-p[d.onZero]:0,t.get("axisTick.inside")&&(a.tickDirection=-a.tickDirection),cI.retrieve(i.labelInside,t.get("axisLabel.inside"))&&(a.labelDirection=-a.labelDirection);var m=t.get("axisLabel.rotate");return a.labelRotate="top"===l?-m:m,a.z2=1,a};var dI={},fI=g,pI=No;dI.rectCoordAxisBuildSplitArea=function(e,t,i,n){var r=i.axis;if(!r.scale.isBlank()){var a=i.getModel("splitArea"),o=a.getModel("areaStyle"),s=o.get("color"),l=n.coordinateSystem.getRect(),u=r.getTicksCoords({tickModel:a,clamp:!0});if(u.length){var h=s.length,c=e.__splitAreaColors,d=fI.createHashMap(),f=0;if(c)for(var p=0;p<u.length;p++){var g=c.get(u[p].tickValue);if(null!=g){f=(g+(h-1)*p)%h;break}}var m=r.toGlobalCoord(u[0].coord),v=o.getAreaStyle();for(s=fI.isArray(s)?s:[s],p=1;p<u.length;p++){var y,_,x,b,w=r.toGlobalCoord(u[p].coord);r.isHorizontal()?(y=m,_=l.y,x=w-y,b=l.height,m=y+x):(y=l.x,_=m,x=l.width,m=_+(b=w-_));var T=u[p-1].tickValue;null!=T&&d.set(T,f),t.add(new pI.Rect({anid:null!=T?"area_"+T:null,shape:{x:y,y:_,width:x,height:b},style:fI.defaults({fill:s[f]},v),silent:!0})),f=(f+1)%h}e.__splitAreaColors=d}}},dI.rectCoordAxisHandleRemove=function(e){e.__splitAreaColors=null};var gI=g,mI=No,vI=qA,yI=uI,_I=hI,xI=dI,bI=xI.rectCoordAxisBuildSplitArea,wI=xI.rectCoordAxisHandleRemove,TI=["axisLine","axisTickLabel","axisName"],SI=["splitArea","splitLine","minorSplitLine"],MI=yI.extend({type:"cartesianAxis",axisPointerClass:"CartesianAxisPointer",render:function(e,t,i,n){this.group.removeAll();var r=this._axisGroup;if(this._axisGroup=new mI.Group,this.group.add(this._axisGroup),e.get("show")){var a=e.getCoordSysModel(),o=_I.layout(a,e),s=new vI(e,o);gI.each(TI,s.add,s),this._axisGroup.add(s.getGroup()),gI.each(SI,(function(t){e.get(t+".show")&&this["_"+t](e,a)}),this),mI.groupTransition(r,this._axisGroup,e),MI.superCall(this,"render",e,t,i,n)}},remove:function(){wI(this)},_splitLine:function(e,t){var i=e.axis;if(!i.scale.isBlank()){var n=e.getModel("splitLine"),r=n.getModel("lineStyle"),a=r.get("color");a=gI.isArray(a)?a:[a];for(var o=t.coordinateSystem.getRect(),s=i.isHorizontal(),l=0,u=i.getTicksCoords({tickModel:n}),h=[],c=[],d=r.getLineStyle(),f=0;f<u.length;f++){var p=i.toGlobalCoord(u[f].coord);s?(h[0]=p,h[1]=o.y,c[0]=p,c[1]=o.y+o.height):(h[0]=o.x,h[1]=p,c[0]=o.x+o.width,c[1]=p);var g=l++%a.length,m=u[f].tickValue;this._axisGroup.add(new mI.Line({anid:null!=m?"line_"+u[f].tickValue:null,subPixelOptimize:!0,shape:{x1:h[0],y1:h[1],x2:c[0],y2:c[1]},style:gI.defaults({stroke:a[g]},d),silent:!0}))}}},_minorSplitLine:function(e,t){var i=e.axis,n=e.getModel("minorSplitLine").getModel("lineStyle"),r=t.coordinateSystem.getRect(),a=i.isHorizontal(),o=i.getMinorTicksCoords();if(o.length)for(var s=[],l=[],u=n.getLineStyle(),h=0;h<o.length;h++)for(var c=0;c<o[h].length;c++){var d=i.toGlobalCoord(o[h][c].coord);a?(s[0]=d,s[1]=r.y,l[0]=d,l[1]=r.y+r.height):(s[0]=r.x,s[1]=d,l[0]=r.x+r.width,l[1]=d),this._axisGroup.add(new mI.Line({anid:"minor_line_"+o[h][c].tickValue,subPixelOptimize:!0,shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:u,silent:!0}))}},_splitArea:function(e,t){bI(this,this._axisGroup,e,t)}});MI.extend({type:"xAxis"}),MI.extend({type:"yAxis"});var AI=h,II=g,CI=No;AI.extendComponentView({type:"grid",render:function(e,t){this.group.removeAll(),e.get("show")&&this.group.add(new CI.Rect({shape:e.coordinateSystem.getRect(),style:II.defaults({fill:e.get("backgroundColor")},e.getItemStyle()),silent:!0,z2:-1}))}}),AI.registerPreprocessor((function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})}));var DI=h,EI=gM,LI=_M,PI=wM;DI.registerVisual(EI("line","circle","line")),DI.registerLayout(LI("line")),DI.registerProcessor(DI.PRIORITY.PROCESSOR.STATISTIC,PI("line"));var NI=vx,RI=um.extend({type:"series.__base_bar__",getInitialData:function(e,t){return NI(this.getSource(),this,{useEncodeDefaulter:!0})},getMarkerPosition:function(e){var t=this.coordinateSystem;if(t){var i=t.dataToPoint(t.clampData(e)),n=this.getData(),r=n.getLayout("offset"),a=n.getLayout("size");return i[t.getBaseAxis().isHorizontal()?0:1]+=r+a/2,i}return[NaN,NaN]},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",itemStyle:{},emphasis:{}}});RI.extend({type:"series.bar",dependencies:["grid","polar"],brushSelector:"rect",getProgressive:function(){return!!this.get("large")&&this.get("progressive")},getProgressiveThreshold:function(){var e=this.get("progressiveThreshold"),t=this.get("largeThreshold");return t>e&&(e=t),e},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}}});var OI={},kI=No,zI=HT.getDefaultLabel;function BI(e,t){"outside"===e.textPosition&&(e.textPosition=t)}OI.setLabel=function(e,t,i,n,r,a,o){var s=i.getModel("label"),l=i.getModel("emphasis.label");kI.setLabelStyle(e,t,s,l,{labelFetcher:r,labelDataIndex:a,defaultText:zI(r.getData(),a),isRectText:!0,autoColor:n}),BI(e),BI(t)};var FI=Co([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["stroke","barBorderColor"],["lineWidth","barBorderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),VI={getBarItemStyle:function(e){var t=FI(this,e);if(this.getBorderLineDash){var i=this.getBorderLineDash();i&&(t.lineDash=i)}return t}},GI=(0,No.extendShape)({type:"sausage",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},buildPath:function(e,t){var i=t.cx,n=t.cy,r=Math.max(t.r0||0,0),a=Math.max(t.r,0),o=.5*(a-r),s=r+o,l=t.startAngle,u=t.endAngle,h=t.clockwise,c=Math.cos(l),d=Math.sin(l),f=Math.cos(u),p=Math.sin(u);(h?u-l<2*Math.PI:l-u<2*Math.PI)&&(e.moveTo(c*r+i,d*r+n),e.arc(c*s+i,d*s+n,o,-Math.PI+l,l,!h)),e.arc(i,n,a,l,u,!h),e.moveTo(f*a+i,p*a+n),e.arc(f*s+i,p*s+n,o,u-2*Math.PI,u-Math.PI,!h),0!==r&&(e.arc(i,n,r,u,l,h),e.moveTo(c*r+i,p*r+n)),e.closePath()}}),HI=h,UI=g,WI=No,jI=OI.setLabel,XI=zc,ZI=VI,qI=dl,YI=zi,KI=km.throttle,QI=VS.createClipPath,JI=GI,$I=["itemStyle","barBorderWidth"],eC=[0,0];UI.extend(XI.prototype,ZI),HI.extendChartView({type:"bar",render:function(e,t,i){this._updateDrawMode(e);var n=e.get("coordinateSystem");return"cartesian2d"!==n&&"polar"!==n||(this._isLargeDraw?this._renderLarge(e,t,i):this._renderNormal(e,t,i)),this.group},incrementalPrepareRender:function(e,t,i){this._clear(),this._updateDrawMode(e)},incrementalRender:function(e,t,i,n){this._incrementalRenderLarge(e,t)},_updateDrawMode:function(e){var t=e.pipelineContext.large;(null==this._isLargeDraw||t^this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},_renderNormal:function(e,t,i){var n,r=this.group,a=e.getData(),o=this._data,s=e.coordinateSystem,l=s.getBaseAxis();"cartesian2d"===s.type?n=l.isHorizontal():"polar"===s.type&&(n="angle"===l.dim);var u=e.isAnimationEnabled()?e:null,h=e.get("clip",!0),c=function(e,t){var i=e.getArea&&e.getArea();if("cartesian2d"===e.type){var n=e.getBaseAxis();if("category"!==n.type||!n.onBand){var r=t.getLayout("bandWidth");n.isHorizontal()?(i.x-=r,i.width+=2*r):(i.y-=r,i.height+=2*r)}}return i}(s,a);r.removeClipPath();var d=e.get("roundCap",!0),f=e.get("showBackground",!0),p=e.getModel("backgroundStyle"),g=p.get("barBorderRadius")||0,m=[],v=this._backgroundEls||[],y=function(e){var t=sC[s.type](a,e),i=function(e,t,i){return new("polar"===e.type?WI.Sector:WI.Rect)({shape:fC(t,i,e),silent:!0,z2:0})}(s,n,t);return i.useStyle(p.getBarItemStyle()),"cartesian2d"===s.type&&i.setShape("r",g),m[e]=i,i};a.diff(o).add((function(t){var i=a.getItemModel(t),o=sC[s.type](a,t,i);if(f&&y(t),a.hasValue(t)){if(h&&nC[s.type](c,o))return void r.remove(l);var l=rC[s.type](t,o,n,u,!1,d);a.setItemGraphicEl(t,l),r.add(l),uC(l,a,t,i,o,e,n,"polar"===s.type)}})).update((function(t,i){var l=a.getItemModel(t),_=sC[s.type](a,t,l);if(f){var x;0===v.length?x=y(i):((x=v[i]).useStyle(p.getBarItemStyle()),"cartesian2d"===s.type&&x.setShape("r",g),m[t]=x);var b=sC[s.type](a,t),w=fC(n,b,s);WI.updateProps(x,{shape:w},u,t)}var T=o.getItemGraphicEl(i);if(a.hasValue(t)){if(h&&nC[s.type](c,_))return void r.remove(T);T?WI.updateProps(T,{shape:_},u,t):T=rC[s.type](t,_,n,u,!0,d),a.setItemGraphicEl(t,T),r.add(T),uC(T,a,t,l,_,e,n,"polar"===s.type)}else r.remove(T)})).remove((function(e){var t=o.getItemGraphicEl(e);"cartesian2d"===s.type?t&&aC(e,u,t):t&&oC(e,u,t)})).execute();var _=this._backgroundGroup||(this._backgroundGroup=new YI);_.removeAll();for(var x=0;x<m.length;++x)_.add(m[x]);r.add(_),this._backgroundEls=m,this._data=a},_renderLarge:function(e,t,i){this._clear(),cC(e,this.group);var n=e.get("clip",!0)?QI(e.coordinateSystem,!1,e):null;n?this.group.setClipPath(n):this.group.removeClipPath()},_incrementalRenderLarge:function(e,t){this._removeBackground(),cC(t,this.group,!0)},dispose:UI.noop,remove:function(e){this._clear(e)},_clear:function(e){var t=this.group,i=this._data;e&&e.get("animation")&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl((function(t){"sector"===t.type?oC(t.dataIndex,e,t):aC(t.dataIndex,e,t)}))):t.removeAll(),this._data=null},_removeBackground:function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null}});var tC=Math.max,iC=Math.min,nC={cartesian2d:function(e,t){var i=t.width<0?-1:1,n=t.height<0?-1:1;i<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height);var r=tC(t.x,e.x),a=iC(t.x+t.width,e.x+e.width),o=tC(t.y,e.y),s=iC(t.y+t.height,e.y+e.height);t.x=r,t.y=o,t.width=a-r,t.height=s-o;var l=t.width<0||t.height<0;return i<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height),l},polar:function(e,t){var i=t.r0<=t.r?1:-1;if(i<0){var n=t.r;t.r=t.r0,t.r0=n}n=iC(t.r,e.r);var r=tC(t.r0,e.r0);t.r=n,t.r0=r;var a=n-r<0;return i<0&&(n=t.r,t.r=t.r0,t.r0=n),a}},rC={cartesian2d:function(e,t,i,n,r){var a=new WI.Rect({shape:UI.extend({},t),z2:1});if(a.name="item",n){var o=i?"height":"width",s={};a.shape[o]=0,s[o]=t[o],WI[r?"updateProps":"initProps"](a,{shape:s},n,e)}return a},polar:function(e,t,i,n,r,a){var o=t.startAngle<t.endAngle,s=new(!i&&a?JI:WI.Sector)({shape:UI.defaults({clockwise:o},t),z2:1});if(s.name="item",n){var l=i?"r":"endAngle",u={};s.shape[l]=i?0:t.startAngle,u[l]=t[l],WI[r?"updateProps":"initProps"](s,{shape:u},n,e)}return s}};function aC(e,t,i){i.style.text=null,WI.updateProps(i,{shape:{width:0}},t,e,(function(){i.parent&&i.parent.remove(i)}))}function oC(e,t,i){i.style.text=null,WI.updateProps(i,{shape:{r:i.shape.r0}},t,e,(function(){i.parent&&i.parent.remove(i)}))}var sC={cartesian2d:function(e,t,i){var n=e.getItemLayout(t),r=i?function(e,t){var i=e.get($I)||0,n=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),r=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(i,n,r)}(i,n):0,a=n.width>0?1:-1,o=n.height>0?1:-1;return{x:n.x+a*r/2,y:n.y+o*r/2,width:n.width-a*r,height:n.height-o*r}},polar:function(e,t,i){var n=e.getItemLayout(t);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle}}};function lC(e){return null!=e.startAngle&&null!=e.endAngle&&e.startAngle===e.endAngle}function uC(e,t,i,n,r,a,o,s){var l=t.getItemVisual(i,"color"),u=t.getItemVisual(i,"opacity"),h=t.getVisual("borderColor"),c=n.getModel("itemStyle"),d=n.getModel("emphasis.itemStyle").getBarItemStyle();s||e.setShape("r",c.get("barBorderRadius")||0),e.useStyle(UI.defaults({stroke:lC(r)?"none":h,fill:lC(r)?"none":l,opacity:u},c.getBarItemStyle()));var f=n.getShallow("cursor");f&&e.attr("cursor",f);var p=o?r.height>0?"bottom":"top":r.width>0?"left":"right";s||jI(e.style,d,n,l,a,i,p),lC(r)&&(d.fill=d.stroke="none"),WI.setHoverStyle(e,d)}var hC=qI.extend({type:"largeBar",shape:{points:[]},buildPath:function(e,t){for(var i=t.points,n=this.__startPoint,r=this.__baseDimIdx,a=0;a<i.length;a+=2)n[r]=i[a+r],e.moveTo(n[0],n[1]),e.lineTo(i[a],i[a+1])}});function cC(e,t,i){var n=e.getData(),r=[],a=n.getLayout("valueAxisHorizontal")?1:0;r[1-a]=n.getLayout("valueAxisStart");var o=n.getLayout("largeDataIndices"),s=n.getLayout("barWidth"),l=e.getModel("backgroundStyle");if(e.get("showBackground",!0)){var u=n.getLayout("largeBackgroundPoints"),h=[];h[1-a]=n.getLayout("backgroundStart");var c=new hC({shape:{points:u},incremental:!!i,__startPoint:h,__baseDimIdx:a,__largeDataIndices:o,__barWidth:s,silent:!0,z2:0});!function(e,t,i){var n=t.get("borderColor")||t.get("color"),r=t.getItemStyle(["color","borderColor"]);e.useStyle(r),e.style.fill=null,e.style.stroke=n,e.style.lineWidth=i.getLayout("barWidth")}(c,l,n),t.add(c)}var d=new hC({shape:{points:n.getLayout("largePoints")},incremental:!!i,__startPoint:r,__baseDimIdx:a,__largeDataIndices:o,__barWidth:s});t.add(d),function(e,t,i){var n=i.getVisual("borderColor")||i.getVisual("color"),r=t.getModel("itemStyle").getItemStyle(["color","borderColor"]);e.useStyle(r),e.style.fill=null,e.style.stroke=n,e.style.lineWidth=i.getLayout("barWidth")}(d,e,n),d.seriesIndex=e.seriesIndex,e.get("silent")||(d.on("mousedown",dC),d.on("mousemove",dC))}var dC=KI((function(e){var t=function(e,t,i){var n=e.__baseDimIdx,r=1-n,a=e.shape.points,o=e.__largeDataIndices,s=Math.abs(e.__barWidth/2),l=e.__startPoint[r];eC[0]=t,eC[1]=i;for(var u=eC[n],h=eC[1-n],c=u-s,d=u+s,f=0,p=a.length/2;f<p;f++){var g=2*f,m=a[g+n],v=a[g+r];if(m>=c&&m<=d&&(l<=v?h>=l&&h<=v:h>=v&&h<=l))return o[f]}return-1}(this,e.offsetX,e.offsetY);this.dataIndex=t>=0?t:null}),30,!1);function fC(e,t,i){var n,r="polar"===i.type;return n=r?i.getArea():i.grid.getRect(),r?{cx:n.cx,cy:n.cy,r0:e?n.r0:t.r0,r:e?n.r:t.r,startAngle:e?t.startAngle:0,endAngle:e?t.endAngle:2*Math.PI}:{x:e?t.x:n.x,y:e?n.y:t.y,width:e?t.width:n.width,height:e?n.height:t.height}}var pC=h,gC=g,mC=Qx,vC=mC.layout,yC=mC.largeLayout;pC.registerLayout(pC.PRIORITY.VISUAL.LAYOUT,gC.curry(vC,"bar")),pC.registerLayout(pC.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,yC),pC.registerVisual({seriesType:"bar",reset:function(e){e.getData().setVisual("legendSymbol","roundRect")}});var _C=X_,xC=A_,bC=g,wC=bC.extend,TC=bC.isArray,SC=function(e,t,i){t=TC(t)&&{coordDimensions:t}||wC({},t);var n=e.getSource(),r=_C(n,t),a=new xC(r,e);return a.initData(n,i),a},MC=g,AC={updateSelectedMap:function(e){this._targetList=MC.isArray(e)?e.slice():[],this._selectTargetMap=MC.reduce(e||[],(function(e,t){return e.set(t.name,t),e}),MC.createHashMap())},select:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);"single"===this.get("selectedMode")&&this._selectTargetMap.each((function(e){e.selected=!1})),i&&(i.selected=!0)},unSelect:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);i&&(i.selected=!1)},toggleSelected:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);if(null!=i)return this[i.selected?"unSelect":"select"](e,t),i.selected},isSelected:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);return i&&i.selected}},IC=function(e,t){this.getAllNames=function(){var e=t();return e.mapArray(e.getName)},this.containName=function(e){return t().indexOfName(e)>=0},this.indexOfName=function(t){return e().indexOfName(t)},this.getItemVisual=function(t,i){return e().getItemVisual(t,i)}},CC=h,DC=SC,EC=g,LC=lo,PC=Uc.getPercentWithPrecision,NC=AC,RC=qp.retrieveRawAttr,OC=Vd.makeSeriesEncodeForNameBased,kC=IC,zC=CC.extendSeriesModel({type:"series.pie",init:function(e){zC.superApply(this,"init",arguments),this.legendVisualProvider=new kC(EC.bind(this.getData,this),EC.bind(this.getRawData,this)),this.updateSelectedMap(this._createSelectableList()),this._defaultLabelLine(e)},mergeOption:function(e){zC.superCall(this,"mergeOption",e),this.updateSelectedMap(this._createSelectableList())},getInitialData:function(e,t){return DC(this,{coordDimensions:["value"],encodeDefaulter:EC.curry(OC,this)})},_createSelectableList:function(){for(var e=this.getRawData(),t=e.mapDimension("value"),i=[],n=0,r=e.count();n<r;n++)i.push({name:e.getName(n),value:e.get(t,n),selected:RC(e,n,"selected")});return i},getDataParams:function(e){var t=this.getData(),i=zC.superCall(this,"getDataParams",e),n=[];return t.each(t.mapDimension("value"),(function(e){n.push(e)})),i.percent=PC(n,e,t.hostModel.get("percentPrecision")),i.$vars.push("percent"),i},_defaultLabelLine:function(e){LC.defaultEmphasis(e,"labelLine",["show"]);var t=e.labelLine,i=e.emphasis.labelLine;t.show=t.show&&e.label.show,i.show=i.show&&e.emphasis.label.show},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,hoverOffset:10,avoidLabelOverlap:!0,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:!1,show:!0,position:"outer",alignTo:"none",margin:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1},animationType:"expansion",animationTypeUpdate:"transition",animationEasing:"cubicOut"}});EC.mixin(zC,NC);var BC=g,FC=No,VC=Om;function GC(e,t,i,n){var r=t.getData(),a=this.dataIndex,o=r.getName(a),s=t.get("selectedOffset");n.dispatchAction({type:"pieToggleSelect",from:e,name:o,seriesId:t.id}),r.each((function(e){HC(r.getItemGraphicEl(e),r.getItemLayout(e),t.isSelected(r.getName(e)),s,i)}))}function HC(e,t,i,n,r){var a=(t.startAngle+t.endAngle)/2,o=i?n:0,s=[Math.cos(a)*o,Math.sin(a)*o];r?e.animate().when(200,{position:s}).start("bounceOut"):e.attr("position",s)}function UC(e,t){FC.Group.call(this);var i=new FC.Sector({z2:2}),n=new FC.Polyline,r=new FC.Text;this.add(i),this.add(n),this.add(r),this.updateData(e,t,!0)}var WC=UC.prototype;WC.updateData=function(e,t,i){var n=this.childAt(0),r=this.childAt(1),a=this.childAt(2),o=e.hostModel,s=e.getItemModel(t),l=e.getItemLayout(t),u=BC.extend({},l);u.label=null;var h=o.getShallow("animationTypeUpdate");i?(n.setShape(u),"scale"===o.getShallow("animationType")?(n.shape.r=l.r0,FC.initProps(n,{shape:{r:l.r}},o,t)):(n.shape.endAngle=l.startAngle,FC.updateProps(n,{shape:{endAngle:l.endAngle}},o,t))):"expansion"===h?n.setShape(u):FC.updateProps(n,{shape:u},o,t);var c=e.getItemVisual(t,"color");n.useStyle(BC.defaults({lineJoin:"bevel",fill:c},s.getModel("itemStyle").getItemStyle())),n.hoverStyle=s.getModel("emphasis.itemStyle").getItemStyle();var d=s.getShallow("cursor");d&&n.attr("cursor",d),HC(this,e.getItemLayout(t),o.isSelected(e.getName(t)),o.get("selectedOffset"),o.get("animation"));var f=!i&&"transition"===h;this._updateLabel(e,t,f),this.highDownOnUpdate=o.get("silent")?null:function(e,t){var i=o.isAnimationEnabled()&&s.get("hoverAnimation");"emphasis"===t?(r.ignore=r.hoverIgnore,a.ignore=a.hoverIgnore,i&&(n.stopAnimation(!0),n.animateTo({shape:{r:l.r+o.get("hoverOffset")}},300,"elasticOut"))):(r.ignore=r.normalIgnore,a.ignore=a.normalIgnore,i&&(n.stopAnimation(!0),n.animateTo({shape:{r:l.r}},300,"elasticOut")))},FC.setHoverStyle(this)},WC._updateLabel=function(e,t,i){var n=this.childAt(1),r=this.childAt(2),a=e.hostModel,o=e.getItemModel(t),s=e.getItemLayout(t).label,l=e.getItemVisual(t,"color");if(!s||isNaN(s.x)||isNaN(s.y))r.ignore=r.normalIgnore=r.hoverIgnore=n.ignore=n.normalIgnore=n.hoverIgnore=!0;else{var u={points:s.linePoints||[[s.x,s.y],[s.x,s.y],[s.x,s.y]]},h={x:s.x,y:s.y};i?(FC.updateProps(n,{shape:u},a,t),FC.updateProps(r,{style:h},a,t)):(n.attr({shape:u}),r.attr({style:h})),r.attr({rotation:s.rotation,origin:[s.x,s.y],z2:10});var c=o.getModel("label"),d=o.getModel("emphasis.label"),f=o.getModel("labelLine"),p=o.getModel("emphasis.labelLine");l=e.getItemVisual(t,"color"),FC.setLabelStyle(r.style,r.hoverStyle={},c,d,{labelFetcher:e.hostModel,labelDataIndex:t,defaultText:s.text,autoColor:l,useInsideStyle:!!s.inside},{textAlign:s.textAlign,textVerticalAlign:s.verticalAlign,opacity:e.getItemVisual(t,"opacity")}),r.ignore=r.normalIgnore=!c.get("show"),r.hoverIgnore=!d.get("show"),n.ignore=n.normalIgnore=!f.get("show"),n.hoverIgnore=!p.get("show"),n.setStyle({stroke:l,opacity:e.getItemVisual(t,"opacity")}),n.setStyle(f.getModel("lineStyle").getLineStyle()),n.hoverStyle=p.getModel("lineStyle").getLineStyle();var g=f.get("smooth");g&&!0===g&&(g=.4),n.setShape({smooth:g})}},BC.inherits(UC,FC.Group),VC.extend({type:"pie",init:function(){var e=new FC.Group;this._sectorGroup=e},render:function(e,t,i,n){if(!n||n.from!==this.uid){var r=e.getData(),a=this._data,o=this.group,s=t.get("animation"),l=!a,u=e.get("animationType"),h=e.get("animationTypeUpdate"),c=BC.curry(GC,this.uid,e,s,i),d=e.get("selectedMode");if(r.diff(a).add((function(e){var t=new UC(r,e);l&&"scale"!==u&&t.eachChild((function(e){e.stopAnimation(!0)})),d&&t.on("click",c),r.setItemGraphicEl(e,t),o.add(t)})).update((function(e,t){var i=a.getItemGraphicEl(t);l||"transition"===h||i.eachChild((function(e){e.stopAnimation(!0)})),i.updateData(r,e),i.off("click"),d&&i.on("click",c),o.add(i),r.setItemGraphicEl(e,i)})).remove((function(e){var t=a.getItemGraphicEl(e);o.remove(t)})).execute(),s&&r.count()>0&&(l?"scale"!==u:"transition"!==h)){for(var f=r.getItemLayout(0),p=1;isNaN(f.startAngle)&&p<r.count();++p)f=r.getItemLayout(p);var g=Math.max(i.getWidth(),i.getHeight())/2,m=BC.bind(o.removeClipPath,o);o.setClipPath(this._createClipPath(f.cx,f.cy,g,f.startAngle,f.clockwise,m,e,l))}else o.removeClipPath();this._data=r}},dispose:function(){},_createClipPath:function(e,t,i,n,r,a,o,s){var l=new FC.Sector({shape:{cx:e,cy:t,r0:0,r:i,startAngle:n,endAngle:n,clockwise:r}});return(s?FC.initProps:FC.updateProps)(l,{shape:{endAngle:n+(r?1:-1)*Math.PI*2}},o,a),l},containPoint:function(e,t){var i=t.getData().getItemLayout(0);if(i){var n=e[0]-i.cx,r=e[1]-i.cy,a=Math.sqrt(n*n+r*r);return a<=i.r&&a>=i.r0}}});var jC=h,XC=g,ZC=function(e,t){XC.each(t,(function(t){t.update="updateView",jC.registerAction(t,(function(i,n){var r={};return n.eachComponent({mainType:"series",subType:e,query:i},(function(e){e[t.method]&&e[t.method](i.name,i.dataIndex);var n=e.getData();n.each((function(t){var i=n.getName(t);r[i]=e.isSelected(i)||!1}))})),{name:i.name,selected:r,seriesId:i.seriesId}}))}))},qC=g.createHashMap,YC=function(e){return{getTargetSeries:function(t){var i={},n=qC();return t.eachSeriesByType(e,(function(e){e.__paletteScope=i,n.set(e.uid,e)})),n},reset:function(e,t){var i=e.getRawData(),n={},r=e.getData();r.each((function(e){var t=r.getRawIndex(e);n[t]=e})),i.each((function(t){var a,o=n[t],s=null!=o&&r.getItemVisual(o,"color",!0),l=null!=o&&r.getItemVisual(o,"borderColor",!0);if(s&&l||(a=i.getItemModel(t)),!s){var u=a.get("itemStyle.color")||e.getColorFromPalette(i.getName(t)||t+"",e.__paletteScope,i.count());null!=o&&r.setItemVisual(o,"color",u)}if(!l){var h=a.get("itemStyle.borderColor");null!=o&&r.setItemVisual(o,"borderColor",h)}}))}}},KC=Tn,QC=Uc.parsePercent,JC=Math.PI/180;function $C(e,t,i,n,r,a,o,s,l,u){function h(t,i,n,r){for(var a=t;a<i&&!(e[a].y+n>l+o);a++)if(e[a].y+=n,a>t&&a+1<i&&e[a+1].y>e[a].y+e[a].height)return void c(a,n/2);c(i-1,n/2)}function c(t,i){for(var n=t;n>=0&&!(e[n].y-i<l)&&(e[n].y-=i,!(n>0&&e[n].y>e[n-1].y+e[n-1].height));n--);}function d(e,t,i,n,r,a){for(var o=t?Number.MAX_VALUE:0,s=0,l=e.length;s<l;s++)if("none"===e[s].labelAlignTo){var u=Math.abs(e[s].y-n),h=e[s].len,c=e[s].len2,d=u<r+h?Math.sqrt((r+h+c)*(r+h+c)-u*u):Math.abs(e[s].x-i);t&&d>=o&&(d=o-10),!t&&d<=o&&(d=o+10),e[s].x=i+d*a,o=d}}e.sort((function(e,t){return e.y-t.y}));for(var f,p=0,g=e.length,m=[],v=[],y=0;y<g;y++){if("outer"===e[y].position&&"labelLine"===e[y].labelAlignTo){var _=e[y].x-u;e[y].linePoints[1][0]+=_,e[y].x=u}(f=e[y].y-p)<0&&h(y,g,-f),p=e[y].y+e[y].height}for(o-p<0&&c(g-1,p-o),y=0;y<g;y++)e[y].y>=i?v.push(e[y]):m.push(e[y]);d(m,!1,t,i,n,r),d(v,!0,t,i,n,r)}function eD(e){return"center"===e.position}var tD=function(e,t,i,n,r,a){var o,s,l=e.getData(),u=[],h=!1,c=(e.get("minShowLabelAngle")||0)*JC;l.each((function(n){var a=l.getItemLayout(n),d=l.getItemModel(n),f=d.getModel("label"),p=f.get("position")||d.get("emphasis.label.position"),g=f.get("distanceToLabelLine"),m=f.get("alignTo"),v=QC(f.get("margin"),i),y=f.get("bleedMargin"),_=f.getFont(),x=d.getModel("labelLine"),b=x.get("length");b=QC(b,i);var w=x.get("length2");if(w=QC(w,i),!(a.angle<c)){var T,S,M,A,I=(a.startAngle+a.endAngle)/2,C=Math.cos(I),D=Math.sin(I);o=a.cx,s=a.cy;var E,L=e.getFormattedLabel(n,"normal")||l.getName(n),P=KC.getBoundingRect(L,_,A,"top"),N="inside"===p||"inner"===p;if("center"===p)T=a.cx,S=a.cy,A="center";else{var R=(N?(a.r+a.r0)/2*C:a.r*C)+o,O=(N?(a.r+a.r0)/2*D:a.r*D)+s;if(T=R+3*C,S=O+3*D,!N){var k=R+C*(b+t-a.r),z=O+D*(b+t-a.r),B=k+(C<0?-1:1)*w;T="edge"===m?C<0?r+v:r+i-v:B+(C<0?-g:g),S=z,M=[[R,O],[k,z],[B,z]]}A=N?"center":"edge"===m?C>0?"right":"left":C>0?"left":"right"}var F=f.get("rotate");E="number"==typeof F?F*(Math.PI/180):F?C<0?-I+Math.PI:-I:0,h=!!E,a.label={x:T,y:S,position:p,height:P.height,len:b,len2:w,linePoints:M,textAlign:A,verticalAlign:"middle",rotation:E,inside:N,labelDistance:g,labelAlignTo:m,labelMargin:v,bleedMargin:y,textRect:P,text:L,font:_},N||u.push(a.label)}})),!h&&e.get("avoidLabelOverlap")&&function(e,t,i,n,r,a,o,s){for(var l=[],u=[],h=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=0;d<e.length;d++)eD(e[d])||(e[d].x<t?(h=Math.min(h,e[d].x),l.push(e[d])):(c=Math.max(c,e[d].x),u.push(e[d])));for($C(u,t,i,n,1,0,a,0,s,c),$C(l,t,i,n,-1,0,a,0,s,h),d=0;d<e.length;d++){var f=e[d];if(!eD(f)){var p=f.linePoints;if(p){var g,m="edge"===f.labelAlignTo,v=f.textRect.width;(g=m?f.x<t?p[2][0]-f.labelDistance-o-f.labelMargin:o+r-f.labelMargin-p[2][0]-f.labelDistance:f.x<t?f.x-o-f.bleedMargin:o+r-f.x-f.bleedMargin)<f.textRect.width&&(f.text=KC.truncateText(f.text,g,f.font),"edge"===f.labelAlignTo&&(v=KC.getWidth(f.text,f.font)));var y=p[1][0]-p[2][0];m?f.x<t?p[2][0]=o+f.labelMargin+v+f.labelDistance:p[2][0]=o+r-f.labelMargin-v-f.labelDistance:(f.x<t?p[2][0]=f.x+f.labelDistance:p[2][0]=f.x-f.labelDistance,p[1][0]=p[2][0]+y),p[1][1]=p[2][1]=f.y}}}}(u,o,s,t,i,n,r,a)},iD=Uc,nD=iD.parsePercent,rD=iD.linearMap,aD=Hc,oD=tD,sD=g,lD=2*Math.PI,uD=Math.PI/180,hD=function(e,t,i,n){t.eachSeriesByType(e,(function(e){var t=e.getData(),n=t.mapDimension("value"),r=function(e,t){return aD.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,i),a=e.get("center"),o=e.get("radius");sD.isArray(o)||(o=[0,o]),sD.isArray(a)||(a=[a,a]);var s=nD(r.width,i.getWidth()),l=nD(r.height,i.getHeight()),u=Math.min(s,l),h=nD(a[0],s)+r.x,c=nD(a[1],l)+r.y,d=nD(o[0],u/2),f=nD(o[1],u/2),p=-e.get("startAngle")*uD,g=e.get("minAngle")*uD,m=0;t.each(n,(function(e){!isNaN(e)&&m++}));var v=t.getSum(n),y=Math.PI/(v||m)*2,_=e.get("clockwise"),x=e.get("roseType"),b=e.get("stillShowZeroSum"),w=t.getDataExtent(n);w[0]=0;var T=lD,S=0,M=p,A=_?1:-1;if(t.each(n,(function(e,i){var n;if(isNaN(e))t.setItemLayout(i,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:_,cx:h,cy:c,r0:d,r:x?NaN:f,viewRect:r});else{(n="area"!==x?0===v&&b?y:e*y:lD/m)<g?(n=g,T-=g):S+=e;var a=M+A*n;t.setItemLayout(i,{angle:n,startAngle:M,endAngle:a,clockwise:_,cx:h,cy:c,r0:d,r:x?rD(e,w,[d,f]):f,viewRect:r}),M=a}})),T<lD&&m)if(T<=.001){var I=lD/m;t.each(n,(function(e,i){if(!isNaN(e)){var n=t.getItemLayout(i);n.angle=I,n.startAngle=p+A*i*I,n.endAngle=p+A*(i+1)*I}}))}else y=T/S,M=p,t.each(n,(function(e,i){if(!isNaN(e)){var n=t.getItemLayout(i),r=n.angle===g?g:e*y;n.startAngle=M,n.endAngle=M+A*r,M+=A*r}}));oD(e,f,r.width,r.height,r.x,r.y)}))},cD=function(e){return{seriesType:e,reset:function(e,t){var i=t.findComponents({mainType:"legend"});if(i&&i.length){var n=e.getData();n.filterSelf((function(e){for(var t=n.getName(e),r=0;r<i.length;r++)if(!i[r].isSelected(t))return!1;return!0}))}}}},dD=h,fD=g,pD=YC,gD=hD,mD=cD;ZC("pie",[{type:"pieToggleSelect",event:"pieselectchanged",method:"toggleSelected"},{type:"pieSelect",event:"pieselected",method:"select"},{type:"pieUnSelect",event:"pieunselected",method:"unSelect"}]),dD.registerVisual(pD("pie")),dD.registerLayout(fD.curry(gD,"pie")),dD.registerProcessor(mD("pie"));var vD=vx;um.extend({type:"series.scatter",dependencies:["grid","polar","geo","singleAxis","calendar"],getInitialData:function(e,t){return vD(this.getSource(),this,{useEncodeDefaulter:!0})},brushSelector:"point",getProgressive:function(){var e=this.option.progressive;return null==e?this.option.large?5e3:this.get("progressive"):e},getProgressiveThreshold:function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?1e4:this.get("progressiveThreshold"):e},defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},clip:!0}});var yD=No,_D=ow.createSymbol,xD=rh,bD=yD.extendShape({shape:{points:null},symbolProxy:null,softClipShape:null,buildPath:function(e,t){var i=t.points,n=t.size,r=this.symbolProxy,a=r.shape;if(!((e.getContext?e.getContext():e)&&n[0]<4))for(var o=0;o<i.length;){var s=i[o++],l=i[o++];isNaN(s)||isNaN(l)||this.softClipShape&&!this.softClipShape.contain(s,l)||(a.x=s-n[0]/2,a.y=l-n[1]/2,a.width=n[0],a.height=n[1],r.buildPath(e,a,!0))}},afterBrush:function(e){var t=this.shape,i=t.points,n=t.size;if(n[0]<4){this.setTransform(e);for(var r=0;r<i.length;){var a=i[r++],o=i[r++];isNaN(a)||isNaN(o)||this.softClipShape&&!this.softClipShape.contain(a,o)||e.fillRect(a-n[0]/2,o-n[1]/2,n[0],n[1])}this.restoreTransform(e)}},findDataIndex:function(e,t){for(var i=this.shape,n=i.points,r=i.size,a=Math.max(r[0],4),o=Math.max(r[1],4),s=n.length/2-1;s>=0;s--){var l=2*s,u=n[l]-a/2,h=n[l+1]-o/2;if(e>=u&&t>=h&&e<=u+a&&t<=h+o)return s}return-1}});function wD(){this.group=new yD.Group}var TD=wD.prototype;TD.isPersistent=function(){return!this._incremental},TD.updateData=function(e,t){this.group.removeAll();var i=new bD({rectHover:!0,cursor:"default"});i.setShape({points:e.getLayout("symbolPoints")}),this._setCommon(i,e,!1,t),this.group.add(i),this._incremental=null},TD.updateLayout=function(e){if(!this._incremental){var t=e.getLayout("symbolPoints");this.group.eachChild((function(e){if(null!=e.startIndex){var i=2*(e.endIndex-e.startIndex),n=4*e.startIndex*2;t=new Float32Array(t.buffer,n,i)}e.setShape("points",t)}))}},TD.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>2e6?(this._incremental||(this._incremental=new xD({silent:!0})),this.group.add(this._incremental)):this._incremental=null},TD.incrementalUpdate=function(e,t,i){var n;this._incremental?(n=new bD,this._incremental.addDisplayable(n,!0)):((n=new bD({rectHover:!0,cursor:"default",startIndex:e.start,endIndex:e.end})).incremental=!0,this.group.add(n)),n.setShape({points:t.getLayout("symbolPoints")}),this._setCommon(n,t,!!this._incremental,i)},TD._setCommon=function(e,t,i,n){var r=t.hostModel;n=n||{};var a=t.getVisual("symbolSize");e.setShape("size",a instanceof Array?a:[a,a]),e.softClipShape=n.clipShape||null,e.symbolProxy=_D(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 s=t.getVisual("color");s&&e.setColor(s),i||(e.seriesIndex=r.seriesIndex,e.on("mousemove",(function(t){e.dataIndex=null;var i=e.findDataIndex(t.offsetX,t.offsetY);i>=0&&(e.dataIndex=i+(e.startIndex||0))})))},TD.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},TD._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var SD=pS,MD=wD,AD=_M;h.extendChartView({type:"scatter",render:function(e,t,i){var n=e.getData();this._updateSymbolDraw(n,e).updateData(n,{clipShape:this._getClipShape(e)}),this._finished=!0},incrementalPrepareRender:function(e,t,i){var n=e.getData();this._updateSymbolDraw(n,e).incrementalPrepareUpdate(n),this._finished=!1},incrementalRender:function(e,t,i){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},updateTransform:function(e,t,i){var n=e.getData();if(this.group.dirty(),!this._finished||n.count()>1e4||!this._symbolDraw.isPersistent())return{update:!0};var r=AD().reset(e);r.progress&&r.progress({start:0,end:n.count()},n),this._symbolDraw.updateLayout(n)},_getClipShape:function(e){var t=e.coordinateSystem,i=t&&t.getArea&&t.getArea();return e.get("clip",!0)?i:null},_updateSymbolDraw:function(e,t){var i=this._symbolDraw,n=t.pipelineContext.large;return i&&n===this._isLargeDraw||(i&&i.remove(),i=this._symbolDraw=n?new MD:new SD,this._isLargeDraw=n,this.group.removeAll()),this.group.add(i.group),i},remove:function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},dispose:function(){}});var ID=h,CD=gM,DD=_M;ID.registerVisual(CD("scatter","circle")),ID.registerLayout(DD("scatter"));var ED=wT;function LD(e,t,i){ED.call(this,e,t,i),this.type="value",this.angle=0,this.name="",this.model}g.inherits(LD,ED);var PD=g,ND=LD,RD=Kx,OD=Uc,kD=yx,zD=kD.getScaleExtent,BD=kD.niceScaleExtent,FD=sp,VD=Gb;function GD(e,t,i){this._model=e,this.dimensions=[],this._indicatorAxes=PD.map(e.getIndicatorModels(),(function(e,t){var i="indicator_"+t,n=new ND(i,"log"===e.get("axisType")?new VD:new RD);return n.name=e.get("name"),n.model=e,e.axis=n,this.dimensions.push(i),n}),this),this.resize(e,i),this.cx,this.cy,this.r,this.r0,this.startAngle}GD.prototype.getIndicatorAxes=function(){return this._indicatorAxes},GD.prototype.dataToPoint=function(e,t){var i=this._indicatorAxes[t];return this.coordToPoint(i.dataToCoord(e),t)},GD.prototype.coordToPoint=function(e,t){var i=this._indicatorAxes[t].angle;return[this.cx+e*Math.cos(i),this.cy-e*Math.sin(i)]},GD.prototype.pointToData=function(e){var t=e[0]-this.cx,i=e[1]-this.cy,n=Math.sqrt(t*t+i*i);t/=n,i/=n;for(var r,a=Math.atan2(-i,t),o=1/0,s=-1,l=0;l<this._indicatorAxes.length;l++){var u=this._indicatorAxes[l],h=Math.abs(a-u.angle);h<o&&(r=u,s=l,o=h)}return[s,+(r&&r.coordToData(n))]},GD.prototype.resize=function(e,t){var i=e.get("center"),n=t.getWidth(),r=t.getHeight(),a=Math.min(n,r)/2;this.cx=OD.parsePercent(i[0],n),this.cy=OD.parsePercent(i[1],r),this.startAngle=e.get("startAngle")*Math.PI/180;var o=e.get("radius");"string"!=typeof o&&"number"!=typeof o||(o=[0,o]),this.r0=OD.parsePercent(o[0],a),this.r=OD.parsePercent(o[1],a),PD.each(this._indicatorAxes,(function(e,t){e.setExtent(this.r0,this.r);var i=this.startAngle+t*Math.PI*2/this._indicatorAxes.length;i=Math.atan2(Math.sin(i),Math.cos(i)),e.angle=i}),this)},GD.prototype.update=function(e,t){var i=this._indicatorAxes,n=this._model;PD.each(i,(function(e){e.scale.setExtent(1/0,-1/0)})),e.eachSeriesByType("radar",(function(t,r){if("radar"===t.get("coordinateSystem")&&e.getComponent("radar",t.get("radarIndex"))===n){var a=t.getData();PD.each(i,(function(e){e.scale.unionExtentFromData(a,a.mapDimension(e.dim))}))}}),this);var r=n.get("splitNumber");function a(e){var t=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),i=e/t;return 2===i?i=5:i*=2,i*t}PD.each(i,(function(e,t){var i=zD(e.scale,e.model).extent;BD(e.scale,e.model);var n=e.model,o=e.scale,s=n.getMin(),l=n.getMax(),u=o.getInterval();if(null!=s&&null!=l)o.setExtent(+s,+l),o.setInterval((l-s)/r);else if(null!=s)do{h=s+u*r,o.setExtent(+s,h),o.setInterval(u),u=a(u)}while(h<i[1]&&isFinite(h)&&isFinite(i[1]));else if(null!=l)do{c=l-u*r,o.setExtent(c,+l),o.setInterval(u),u=a(u)}while(c>i[0]&&isFinite(c)&&isFinite(i[0]));else{o.getTicks().length-1>r&&(u=a(u));var h=Math.ceil(i[1]/u)*u,c=OD.round(h-u*r);o.setExtent(c,h),o.setInterval(u)}}))},GD.dimensions=[],GD.create=function(e,t){var i=[];return e.eachComponent("radar",(function(n){var r=new GD(n,e,t);i.push(r),n.coordinateSystem=r})),e.eachSeriesByType("radar",(function(e){"radar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("radarIndex")||0])})),i},FD.register("radar",GD);var HD=h,UD=g,WD=zc,jD=aw,XD=BM.valueAxis;function ZD(e,t){return UD.defaults({show:t},e)}HD.extendComponentModel({type:"radar",optionUpdated:function(){var e=this.get("boundaryGap"),t=this.get("splitNumber"),i=this.get("scale"),n=this.get("axisLine"),r=this.get("axisTick"),a=this.get("axisType"),o=this.get("axisLabel"),s=this.get("name"),l=this.get("name.show"),u=this.get("name.formatter"),h=this.get("nameGap"),c=this.get("triggerEvent"),d=UD.map(this.get("indicator")||[],(function(d){null!=d.max&&d.max>0&&!d.min?d.min=0:null!=d.min&&d.min<0&&!d.max&&(d.max=0);var f=s;if(null!=d.color&&(f=UD.defaults({color:d.color},s)),d=UD.merge(UD.clone(d),{boundaryGap:e,splitNumber:t,scale:i,axisLine:n,axisTick:r,axisType:a,axisLabel:o,name:d.text,nameLocation:"end",nameGap:h,nameTextStyle:f,triggerEvent:c},!1),l||(d.name=""),"string"==typeof u){var p=d.name;d.name=u.replace("{value}",null!=p?p:"")}else"function"==typeof u&&(d.name=u(d.name,d));var g=UD.extend(new WD(d,null,this.ecModel),jD);return g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this.getIndicatorModels=function(){return d}},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,name:{show:!0},boundaryGap:[0,0],splitNumber:5,nameGap:15,scale:!1,shape:"polygon",axisLine:UD.merge({lineStyle:{color:"#bbb"}},XD.axisLine),axisLabel:ZD(XD.axisLabel,!1),axisTick:ZD(XD.axisTick,!1),axisType:"interval",splitLine:ZD(XD.splitLine,!0),splitArea:ZD(XD.splitArea,!0),indicator:[]}});var qD=g,YD=qA,KD=No,QD=["axisLine","axisTickLabel","axisName"];h.extendComponentView({type:"radar",render:function(e,t,i){this.group.removeAll(),this._buildAxes(e),this._buildSplitLineAndArea(e)},_buildAxes:function(e){var t=e.coordinateSystem,i=t.getIndicatorAxes(),n=qD.map(i,(function(e){return new YD(e.model,{position:[t.cx,t.cy],rotation:e.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}));qD.each(n,(function(e){qD.each(QD,e.add,e),this.group.add(e.getGroup())}),this)},_buildSplitLineAndArea:function(e){var t=e.coordinateSystem,i=t.getIndicatorAxes();if(i.length){var n=e.get("shape"),r=e.getModel("splitLine"),a=e.getModel("splitArea"),o=r.getModel("lineStyle"),s=a.getModel("areaStyle"),l=r.get("show"),u=a.get("show"),h=o.get("color"),c=s.get("color");h=qD.isArray(h)?h:[h],c=qD.isArray(c)?c:[c];var d=[],f=[];if("circle"===n)for(var p=i[0].getTicksCoords(),g=t.cx,m=t.cy,v=0;v<p.length;v++)l&&d[M(d,h,v)].push(new KD.Circle({shape:{cx:g,cy:m,r:p[v].coord}})),u&&v<p.length-1&&f[M(f,c,v)].push(new KD.Ring({shape:{cx:g,cy:m,r0:p[v].coord,r:p[v+1].coord}}));else{var y,_=qD.map(i,(function(e,i){var n=e.getTicksCoords();return y=null==y?n.length-1:Math.min(n.length-1,y),qD.map(n,(function(e){return t.coordToPoint(e.coord,i)}))})),x=[];for(v=0;v<=y;v++){for(var b=[],w=0;w<i.length;w++)b.push(_[w][v]);b[0]&&b.push(b[0].slice()),l&&d[M(d,h,v)].push(new KD.Polyline({shape:{points:b}})),u&&x&&f[M(f,c,v-1)].push(new KD.Polygon({shape:{points:b.concat(x)}})),x=b.slice().reverse()}}var T=o.getLineStyle(),S=s.getAreaStyle();qD.each(f,(function(e,t){this.group.add(KD.mergePath(e,{style:qD.defaults({stroke:"none",fill:c[t%c.length]},S),silent:!0}))}),this),qD.each(d,(function(e,t){this.group.add(KD.mergePath(e,{style:qD.defaults({fill:"none",stroke:h[t%h.length]},T),silent:!0}))}),this)}function M(e,t,i){var n=i%t.length;return e[n]=e[n]||[],n}}});var JD=um,$D=SC,eE=g,tE=qc.encodeHTML,iE=IC,nE=JD.extend({type:"series.radar",dependencies:["radar"],init:function(e){nE.superApply(this,"init",arguments),this.legendVisualProvider=new iE(eE.bind(this.getData,this),eE.bind(this.getRawData,this))},getInitialData:function(e,t){return $D(this,{generateCoord:"indicator_",generateCoordCount:1/0})},formatTooltip:function(e,t,i,n){var r=this.getData(),a=this.coordinateSystem.getIndicatorAxes(),o=this.getData().getName(e),s="html"===n?"<br/>":"\n";return tE(""===o?this.name:o)+s+eE.map(a,(function(t,i){var n=r.get(r.mapDimension(t.dim),e);return tE(t.name+" : "+n)})).join(s)},getTooltipPosition:function(e){if(null!=e)for(var t=this.getData(),i=this.coordinateSystem,n=t.getValues(eE.map(i.dimensions,(function(e){return t.mapDimension(e)})),e,!0),r=0,a=n.length;r<a;r++)if(!isNaN(n[r])){var o=i.getIndicatorAxes();return i.coordToPoint(o[r].dataToCoord(n[r]),r)}},defaultOption:{zlevel:0,z:2,coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid"},label:{position:"top"},symbol:"emptyCircle",symbolSize:4}}),rE=No,aE=g,oE=ow;h.extendChartView({type:"radar",render:function(e,t,i){var n=e.coordinateSystem,r=this.group,a=e.getData(),o=this._data;function s(e,t){var i=e.getItemVisual(t,"symbol")||"circle",n=e.getItemVisual(t,"color");if("none"!==i){var r=function(e){return aE.isArray(e)||(e=[+e,+e]),e}(e.getItemVisual(t,"symbolSize")),a=oE.createSymbol(i,-1,-1,2,2,n),o=e.getItemVisual(t,"symbolRotate")||0;return a.attr({style:{strokeNoScale:!0},z2:100,scale:[r[0]/2,r[1]/2],rotation:o*Math.PI/180||0}),a}}function l(t,i,n,r,a,o){n.removeAll();for(var l=0;l<i.length-1;l++){var u=s(r,a);u&&(u.__dimIdx=l,t[l]?(u.attr("position",t[l]),rE[o?"initProps":"updateProps"](u,{position:i[l]},e,a)):u.attr("position",i[l]),n.add(u))}}function u(e){return aE.map(e,(function(e){return[n.cx,n.cy]}))}a.diff(o).add((function(t){var i=a.getItemLayout(t);if(i){var n=new rE.Polygon,r=new rE.Polyline,o={shape:{points:i}};n.shape.points=u(i),r.shape.points=u(i),rE.initProps(n,o,e,t),rE.initProps(r,o,e,t);var s=new rE.Group,h=new rE.Group;s.add(r),s.add(n),s.add(h),l(r.shape.points,i,h,a,t,!0),a.setItemGraphicEl(t,s)}})).update((function(t,i){var n=o.getItemGraphicEl(i),r=n.childAt(0),s=n.childAt(1),u=n.childAt(2),h={shape:{points:a.getItemLayout(t)}};h.shape.points&&(l(r.shape.points,h.shape.points,u,a,t,!1),rE.updateProps(r,h,e),rE.updateProps(s,h,e),a.setItemGraphicEl(t,n))})).remove((function(e){r.remove(o.getItemGraphicEl(e))})).execute(),a.eachItemGraphicEl((function(e,t){var i=a.getItemModel(t),n=e.childAt(0),o=e.childAt(1),s=e.childAt(2),l=a.getItemVisual(t,"color");r.add(e),n.useStyle(aE.defaults(i.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:l})),n.hoverStyle=i.getModel("emphasis.lineStyle").getLineStyle();var u=i.getModel("areaStyle"),h=i.getModel("emphasis.areaStyle"),c=u.isEmpty()&&u.parentModel.isEmpty(),d=h.isEmpty()&&h.parentModel.isEmpty();d=d&&c,o.ignore=c,o.useStyle(aE.defaults(u.getAreaStyle(),{fill:l,opacity:.7})),o.hoverStyle=h.getAreaStyle();var f=i.getModel("itemStyle").getItemStyle(["color"]),p=i.getModel("emphasis.itemStyle").getItemStyle(),g=i.getModel("label"),m=i.getModel("emphasis.label");s.eachChild((function(e){e.setStyle(f),e.hoverStyle=aE.clone(p);var i=a.get(a.dimensions[e.__dimIdx],t);(null==i||isNaN(i))&&(i=""),rE.setLabelStyle(e.style,e.hoverStyle,g,m,{labelFetcher:a.hostModel,labelDataIndex:t,labelDimIndex:e.__dimIdx,defaultText:i,autoColor:l,isRectText:!0})})),e.highDownOnUpdate=function(e,t){o.attr("ignore","emphasis"===t?d:c)},rE.setHoverStyle(e)})),this._data=a},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});var sE=g;function lE(e){return!isNaN(e[0])&&!isNaN(e[1])}function uE(e){return[e.cx,e.cy]}var hE=function(e){e.eachSeriesByType("radar",(function(e){var t=e.getData(),i=[],n=e.coordinateSystem;if(n){var r=n.getIndicatorAxes();sE.each(r,(function(e,a){t.each(t.mapDimension(r[a].dim),(function(e,t){i[t]=i[t]||[];var r=n.dataToPoint(e,a);i[t][a]=lE(r)?r:uE(n)}))})),t.each((function(e){var r=sE.find(i[e],(function(e){return lE(e)}))||uE(n);i[e].push(r.slice()),t.setItemLayout(e,i[e])}))}}))},cE=g,dE=h,fE=YC,pE=gM,gE=hE,mE=cD,vE=function(e){var t=e.polar;if(t){cE.isArray(t)||(t=[t]);var i=[];cE.each(t,(function(t,n){t.indicator?(t.type&&!t.shape&&(t.shape=t.type),e.radar=e.radar||[],cE.isArray(e.radar)||(e.radar=[e.radar]),e.radar.push(t)):i.push(t)})),e.polar=i}cE.each(e.series,(function(e){e&&"radar"===e.type&&e.polarIndex&&(e.radarIndex=e.polarIndex)}))};dE.registerVisual(fE("radar")),dE.registerVisual(pE("radar","circle")),dE.registerLayout(gE),dE.registerProcessor(mE("radar")),dE.registerPreprocessor(vE);for(var yE=g,_E=Hw,xE=[126,25],bE=[[[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]]],wE=0;wE<bE.length;wE++)for(var TE=0;TE<bE[wE].length;TE++)bE[wE][TE][0]/=10.5,bE[wE][TE][1]/=-14,bE[wE][TE][0]+=xE[0],bE[wE][TE][1]+=xE[1];var SE=function(e,t){"china"===e&&t.push(new _E("南海诸岛",yE.map(bE,(function(e){return{type:"polygon",exterior:e}})),xE))},ME={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]},AE=function(e,t){if("china"===e){var i=ME[t.name];if(i){var n=t.center;n[0]+=i[0]/10.5,n[1]+=-i[1]/14}}},IE={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]},CE=function(e,t){if("world"===e){var i=IE[t.name];if(i){var n=t.center;n[0]=i[0],n[1]=i[1]}}},DE=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]],EE=function(e,t){"china"===e&&"台湾"===t.name&&t.geometries.push({type:"polygon",exterior:DE[0]})},LE=g.each,PE=Xw,NE=lo.makeInner,RE=SE,OE=AE,kE=CE,zE=EE,BE=NE();function FE(e){for(var t,i=0;i<e.length;i++){var n=e[i].getBoundingRect();(t=t||n.clone()).union(n)}return t}var VE={load:function(e,t,i){var n=BE(t).parsed;if(n)return n;var r,a=t.specialAreas||{},o=t.geoJSON;try{r=o?PE(o,i):[]}catch(s){throw new Error("Invalid geoJson format\n"+s.message)}return RE(e,r),LE(r,(function(t){var i=t.name;OE(e,t),kE(e,t),zE(e,t);var n=a[i];n&&t.transformTo(n.left,n.top,n.width,n.height)})),BE(t).parsed={regions:r,boundingRect:FE(r)}}},GE=Uv,HE=GE.parseSVG,UE=GE.makeViewBoxTransform,WE=zi,jE=wu,XE=g,ZE=XE.assert,qE=XE.createHashMap,YE=Pi,KE=(0,lo.makeInner)(),QE={load:function(e,t){var i=KE(t).originRoot;if(i)return{root:i,boundingRect:KE(t).boundingRect};var n=JE(t);return KE(t).originRoot=n.root,KE(t).boundingRect=n.boundingRect,n},makeGraphic:function(e,t,i){var n=KE(t),r=n.rootMap||(n.rootMap=qE()),a=r.get(i);if(a)return a;var o=n.originRoot,s=n.boundingRect;return n.originRootHostKey?a=JE(t,s).root:(n.originRootHostKey=i,a=o),r.set(i,a)},removeGraphic:function(e,t,i){var n=KE(t),r=n.rootMap;r&&r.removeKey(i),i===n.originRootHostKey&&(n.originRootHostKey=null)}};function JE(e,t){var i,n,r=e.svgXML;try{n=(i=r&&HE(r,{ignoreViewBox:!0,ignoreRootClip:!0})||{}).root,ZE(null!=n)}catch(h){throw new Error("Invalid svg format\n"+h.message)}var a=i.width,o=i.height,s=i.viewBoxRect;if(t||(t=null==a||null==o?n.getBoundingRect():new YE(0,0,0,0),null!=a&&(t.width=a),null!=o&&(t.height=o)),s){var l=UE(s,t.width,t.height),u=n;(n=new WE).add(u),u.scale=l.scale,u.position=l.position}return n.setClipPath(new jE({shape:t.plain()})),{root:n,boundingRect:t}}var $E=QE,eL=g,tL=eL.each,iL=eL.createHashMap,nL=Ry,rL=Pi,aL={geoJSON:VE,svg:$E};function oL(e){return function(t,i){var n=sL(t),r=[];return tL(n,(function(n){var a=aL[n.type][e];a&&r.push(a(t,n,i))})),r}}function sL(e){return nL.retrieveMap(e)||[]}var lL={load:function(e,t,i){var n,r=[],a=iL(),o=iL(),s=sL(e);return tL(s,(function(s){var l=aL[s.type].load(e,s,i);tL(l.regions,(function(e){var i=e.name;t&&t.hasOwnProperty(i)&&(e=e.cloneShallow(i=t[i])),r.push(e),a.set(i,e),o.set(i,e.center)}));var u=l.boundingRect;u&&(n?n.union(u):n=u.clone())})),{regions:r,regionsMap:a,nameCoordMap:o,boundingRect:n||new rL(0,0,0,0)}},makeGraphic:oL("makeGraphic"),removeGraphic:oL("removeGraphic")},uL=g,hL=SC,cL=um,dL=qc,fL=dL.encodeHTML,pL=dL.addCommas,gL=AC,mL=qp.retrieveRawAttr,vL=lL,yL=Vd.makeSeriesEncodeForNameBased,_L=cL.extend({type:"series.map",dependencies:["geo"],layoutMode:"box",needsDrawMap:!1,seriesGroup:[],getInitialData:function(e){for(var t=hL(this,{coordDimensions:["value"],encodeDefaulter:uL.curry(yL,this)}),i=t.mapDimension("value"),n=uL.createHashMap(),r=[],a=[],o=0,s=t.count();o<s;o++){var l=t.getName(o);n.set(l,!0),r.push({name:l,value:t.get(i,o),selected:mL(t,o,"selected")})}var u=vL.load(this.getMapType(),this.option.nameMap,this.option.nameProperty);return uL.each(u.regions,(function(e){var t=e.name;n.get(t)||(r.push({name:t}),a.push(t))})),this.updateSelectedMap(r),t.appendValues([],a),t},getHostGeoModel:function(){var e=this.option.geoIndex;return null!=e?this.dependentModels.geo[e]:null},getMapType:function(){return(this.getHostGeoModel()||this).option.map},getRawValue:function(e){var t=this.getData();return t.get(t.mapDimension("value"),e)},getRegionModel:function(e){var t=this.getData();return t.getItemModel(t.indexOfName(e))},formatTooltip:function(e,t,i,n){for(var r=this.getData(),a=pL(this.getRawValue(e)),o=r.getName(e),s=this.seriesGroup,l=[],u=0;u<s.length;u++){var h=s[u].originalData.indexOfName(o),c=r.mapDimension("value");isNaN(s[u].originalData.get(c,h))||l.push(fL(s[u].name))}var d="html"===n?"<br/>":"\n";return l.join(", ")+d+fL(o+" : "+a)},getTooltipPosition:function(e){if(null!=e){var t=this.getData().getName(e),i=this.coordinateSystem,n=i.getRegion(t);return n&&i.dataToPoint(n.center)}},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},defaultOption:{zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:.75,showLegendSymbol:!0,dataRangeHoverLink:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,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)"}},nameProperty:"name"}});uL.mixin(_L,gL);var xL={},bL="\0_ec_interaction_mutex";function wL(e){return e[bL]||(e[bL]={})}h.registerAction({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},(function(){})),xL.take=function(e,t,i){wL(e)[t]=i},xL.release=function(e,t,i){var n=wL(e);n[t]===i&&(n[t]=null)},xL.isTaken=function(e,t){return!!wL(e)[t]};var TL=g,SL=ie,ML=ne,AL=xL;function IL(e){this.pointerChecker,this._zr=e,this._opt={};var t=TL.bind,i=t(CL,this),n=t(DL,this),r=t(EL,this),a=t(LL,this),o=t(PL,this);SL.call(this),this.setPointerChecker=function(e){this.pointerChecker=e},this.enable=function(t,s){this.disable(),this._opt=TL.defaults(TL.clone(s)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(e.on("mousedown",i),e.on("mousemove",n),e.on("mouseup",r)),!0!==t&&"scale"!==t&&"zoom"!==t||(e.on("mousewheel",a),e.on("pinch",o))},this.disable=function(){e.off("mousedown",i),e.off("mousemove",n),e.off("mouseup",r),e.off("mousewheel",a),e.off("pinch",o)},this.dispose=this.disable,this.isDragging=function(){return this._dragging},this.isPinching=function(){return this._pinching}}function CL(e){if(!(ML.isMiddleOrRightButtonOnMouseUpDown(e)||e.target&&e.target.draggable)){var t=e.offsetX,i=e.offsetY;this.pointerChecker&&this.pointerChecker(e,t,i)&&(this._x=t,this._y=i,this._dragging=!0)}}function DL(e){if(this._dragging&&OL("moveOnMouseMove",e,this._opt)&&"pinch"!==e.gestureEvent&&!AL.isTaken(this._zr,"globalPan")){var t=e.offsetX,i=e.offsetY,n=this._x,r=this._y,a=t-n,o=i-r;this._x=t,this._y=i,this._opt.preventDefaultMouseMove&&ML.stop(e.event),RL(this,"pan","moveOnMouseMove",e,{dx:a,dy:o,oldX:n,oldY:r,newX:t,newY:i})}}function EL(e){ML.isMiddleOrRightButtonOnMouseUpDown(e)||(this._dragging=!1)}function LL(e){var t=OL("zoomOnMouseWheel",e,this._opt),i=OL("moveOnMouseWheel",e,this._opt),n=e.wheelDelta,r=Math.abs(n),a=e.offsetX,o=e.offsetY;if(0!==n&&(t||i)){if(t){var s=r>3?1.4:r>1?1.2:1.1;NL(this,"zoom","zoomOnMouseWheel",e,{scale:n>0?s:1/s,originX:a,originY:o})}if(i){var l=Math.abs(n);NL(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(n>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:a,originY:o})}}}function PL(e){AL.isTaken(this._zr,"globalPan")||NL(this,"zoom",null,e,{scale:e.pinchScale>1?1.1:1/1.1,originX:e.pinchX,originY:e.pinchY})}function NL(e,t,i,n,r){e.pointerChecker&&e.pointerChecker(n,r.originX,r.originY)&&(ML.stop(n.event),RL(e,t,i,n,r))}function RL(e,t,i,n,r){r.isAvailableBehavior=TL.bind(OL,null,i,n),e.trigger(t,r)}function OL(e,t,i){var n=i[e];return!e||n&&(!TL.isString(n)||t.event[n+"Key"])}TL.mixin(IL,SL);var kL=IL,zL={updateViewOnPan:function(e,t,i){var n=e.target,r=n.position;r[0]+=t,r[1]+=i,n.dirty()},updateViewOnZoom:function(e,t,i,n){var r=e.target,a=e.zoomLimit,o=r.position,s=r.scale,l=e.zoom=e.zoom||1;if(l*=t,a){var u=a.min||0,h=a.max||1/0;l=Math.max(Math.min(h,l),u)}var c=l/e.zoom;e.zoom=l,o[0]-=(i-o[0])*(c-1),o[1]-=(n-o[1])*(c-1),s[0]*=c,s[1]*=c,r.dirty()}},BL={},FL={axisPointer:1,tooltip:1,brush:1};BL.onIrrelevantElement=function(e,t,i){var n=t.getComponentByElement(e.topTarget),r=n&&n.coordinateSystem;return n&&n!==i&&!FL[n.mainType]&&r&&r.model!==i};var VL=g,GL=kL,HL=zL,UL=BL.onIrrelevantElement,WL=No,jL=lL,XL=Bc.getUID,ZL=rt;function qL(e){var t=e.getItemStyle(),i=e.get("areaColor");return null!=i&&(t.fill=i),t}function YL(e,t){t.eachChild((function(t){VL.each(t.__regions,(function(i){t.trigger(e.isSelected(i.name)?"emphasis":"normal")}))}))}function KL(e,t){var i=new WL.Group;this.uid=XL("ec_map_draw"),this._controller=new GL(e.getZr()),this._controllerHost={target:t?i:null},this.group=i,this._updateGroup=t,this._mouseDownFlag,this._mapName,this._initialized,i.add(this._regionsGroup=new WL.Group),i.add(this._backgroundGroup=new WL.Group)}KL.prototype={constructor:KL,draw:function(e,t,i,n,r){var a="geo"===e.mainType,o=e.getData&&e.getData();a&&t.eachComponent({mainType:"series",subType:"map"},(function(t){o||t.getHostGeoModel()!==e||(o=t.getData())}));var s=e.coordinateSystem;this._updateBackground(s);var l,u=this._regionsGroup,h=this.group,c=s.getTransformInfo(),d=!u.childAt(0)||r;if(d)h.transform=c.roamTransform,h.decomposeTransform(),h.dirty();else{var f=new ZL;f.transform=c.roamTransform,f.decomposeTransform();var p={scale:f.scale,position:f.position};l=f.scale,WL.updateProps(h,p,e)}var g=c.rawScale,m=c.rawPosition;u.removeAll();var v=["itemStyle"],y=["emphasis","itemStyle"],_=["label"],x=["emphasis","label"],b=VL.createHashMap();VL.each(s.regions,(function(t){var i=b.get(t.name)||b.set(t.name,new WL.Group),n=new WL.CompoundPath({segmentIgnoreThreshold:1,shape:{paths:[]}});i.add(n);var r,s=(R=e.getRegionModel(t.name)||e).getModel(v),c=R.getModel(y),f=qL(s),p=qL(c),w=R.getModel(_),T=R.getModel(x);if(o){r=o.indexOfName(t.name);var S=o.getItemVisual(r,"color",!0);S&&(f.fill=S)}var M=function(e){return[e[0]*g[0]+m[0],e[1]*g[1]+m[1]]};VL.each(t.geometries,(function(e){if("polygon"===e.type){for(var t=[],i=0;i<e.exterior.length;++i)t.push(M(e.exterior[i]));for(n.shape.paths.push(new WL.Polygon({segmentIgnoreThreshold:1,shape:{points:t}})),i=0;i<(e.interiors?e.interiors.length:0);++i){for(var r=e.interiors[i],a=(t=[],0);a<r.length;++a)t.push(M(r[a]));n.shape.paths.push(new WL.Polygon({segmentIgnoreThreshold:1,shape:{points:t}}))}}})),n.setStyle(f),n.style.strokeNoScale=!0,n.culling=!0;var A=w.get("show"),I=T.get("show"),C=o&&isNaN(o.get(o.mapDimension("value"),r)),D=o&&o.getItemLayout(r);if(a||C&&(A||I)||D&&D.showLabel){var E,L=a?t.name:r;(!o||r>=0)&&(E=e);var P=new WL.Text({position:M(t.center.slice()),scale:[1/h.scale[0],1/h.scale[1]],z2:10,silent:!0});if(WL.setLabelStyle(P.style,P.hoverStyle={},w,T,{labelFetcher:E,labelDataIndex:L,defaultText:t.name,useInsideStyle:!1},{textAlign:"center",textVerticalAlign:"middle"}),!d){var N=[1/l[0],1/l[1]];WL.updateProps(P,{scale:N},e)}i.add(P)}if(o)o.setItemGraphicEl(r,i);else{var R=e.getRegionModel(t.name);n.eventData={componentType:"geo",componentIndex:e.componentIndex,geoIndex:e.componentIndex,name:t.name,region:R&&R.option||{}}}(i.__regions||(i.__regions=[])).push(t),i.highDownSilentOnTouch=!!e.get("selectedMode"),WL.setHoverStyle(i,p),u.add(i)})),this._updateController(e,t,i),function(e,t,i,n,r){i.off("click"),i.off("mousedown"),t.get("selectedMode")&&(i.on("mousedown",(function(){e._mouseDownFlag=!0})),i.on("click",(function(a){if(e._mouseDownFlag){e._mouseDownFlag=!1;for(var o=a.target;!o.__regions;)o=o.parent;if(o){var s={type:("geo"===t.mainType?"geo":"map")+"ToggleSelect",batch:VL.map(o.__regions,(function(e){return{name:e.name,from:r.uid}}))};s[t.mainType+"Id"]=t.id,n.dispatchAction(s),YL(t,i)}}})))}(this,e,u,i,n),YL(e,u)},remove:function(){this._regionsGroup.removeAll(),this._backgroundGroup.removeAll(),this._controller.dispose(),this._mapName&&jL.removeGraphic(this._mapName,this.uid),this._mapName=null,this._controllerHost={}},_updateBackground:function(e){var t=e.map;this._mapName!==t&&VL.each(jL.makeGraphic(t,this.uid),(function(e){this._backgroundGroup.add(e)}),this),this._mapName=t},_updateController:function(e,t,i){var n=e.coordinateSystem,r=this._controller,a=this._controllerHost;a.zoomLimit=e.get("scaleLimit"),a.zoom=n.getZoom(),r.enable(e.get("roam")||!1);var o=e.mainType;function s(){var t={type:"geoRoam",componentType:o};return t[o+"Id"]=e.id,t}r.off("pan").on("pan",(function(e){this._mouseDownFlag=!1,HL.updateViewOnPan(a,e.dx,e.dy),i.dispatchAction(VL.extend(s(),{dx:e.dx,dy:e.dy}))}),this),r.off("zoom").on("zoom",(function(e){if(this._mouseDownFlag=!1,HL.updateViewOnZoom(a,e.scale,e.originX,e.originY),i.dispatchAction(VL.extend(s(),{zoom:e.scale,originX:e.originX,originY:e.originY})),this._updateGroup){var t=this.group.scale;this._regionsGroup.traverse((function(e){"text"===e.type&&e.attr("scale",[1/t[0],1/t[1]])}))}}),this),r.setPointerChecker((function(t,r,a){return n.getViewRectAfterRoam().contain(r,a)&&!UL(t,i,e)}))}};var QL=KL,JL=g,$L=No,eP=QL,tP="__seriesMapHighDown";function iP(e){var t=this[tP];t&&t.recordVersion===this.__seriesMapCallKey&&nP(t,e)}function nP(e,t){var i=e.circle,n=e.labelModel,r=e.hoverLabelModel,a=e.emphasisText,o=e.normalText;t?(i.style.extendFrom($L.setTextStyle({},r,{text:r.get("show")?a:null},{isRectText:!0,useInsideStyle:!1},!0)),i.__mapOriginalZ2=i.z2,i.z2+=$L.Z2_EMPHASIS_LIFT):($L.setTextStyle(i.style,n,{text:n.get("show")?o:null,textPosition:n.getShallow("position")||"bottom"},{isRectText:!0,useInsideStyle:!1}),i.dirty(!1),null!=i.__mapOriginalZ2&&(i.z2=i.__mapOriginalZ2,i.__mapOriginalZ2=null))}h.extendChartView({type:"map",render:function(e,t,i,n){if(!n||"mapToggleSelect"!==n.type||n.from!==this.uid){var r=this.group;if(r.removeAll(),!e.getHostGeoModel()){if(n&&"geoRoam"===n.type&&"series"===n.componentType&&n.seriesId===e.id)(a=this._mapDraw)&&r.add(a.group);else if(e.needsDrawMap){var a=this._mapDraw||new eP(i,!0);r.add(a.group),a.draw(e,t,i,this,n),this._mapDraw=a}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;e.get("showLegendSymbol")&&t.getComponent("legend")&&this._renderSymbols(e,t,i)}}},remove:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},dispose:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},_renderSymbols:function(e,t,i){var n=e.originalData,r=this.group;n.each(n.mapDimension("value"),(function(t,i){if(!isNaN(t)){var a=n.getItemLayout(i);if(a&&a.point){var o=a.point,s=a.offset,l=new $L.Circle({style:{fill:e.getData().getVisual("color")},shape:{cx:o[0]+9*s,cy:o[1],r:3},silent:!0,z2:8+(s?0:$L.Z2_EMPHASIS_LIFT+1)});if(!s){var u=e.mainSeries.getData(),h=n.getName(i),c=u.indexOfName(h),d=n.getItemModel(i),f=d.getModel("label"),p=d.getModel("emphasis.label"),g=u.getItemGraphicEl(c),m=JL.retrieve2(e.getFormattedLabel(c,"normal"),h),v=JL.retrieve2(e.getFormattedLabel(c,"emphasis"),m),y=g[tP],_=Math.random();if(!y){y=g[tP]={};var x=JL.curry(iP,!0),b=JL.curry(iP,!1);g.on("mouseover",x).on("mouseout",b).on("emphasis",x).on("normal",b)}g.__seriesMapCallKey=_,JL.extend(y,{recordVersion:_,circle:l,labelModel:f,hoverLabelModel:p,emphasisText:v,normalText:m}),nP(y,!1)}r.add(l)}}}))}});var rP={updateCenterAndZoom:function(e,t,i){var n=e.getZoom(),r=e.getCenter(),a=t.zoom,o=e.dataToPoint(r);if(null!=t.dx&&null!=t.dy&&(o[0]-=t.dx,o[1]-=t.dy,r=e.pointToData(o),e.setCenter(r)),null!=a){if(i){var s=i.min||0,l=i.max||1/0;a=Math.max(Math.min(n*a,l),s)/n}e.scale[0]*=a,e.scale[1]*=a;var u=e.position,h=(t.originX-u[0])*(a-1),c=(t.originY-u[1])*(a-1);u[0]-=h,u[1]-=c,e.updateTransform(),r=e.pointToData(o),e.setCenter(r),e.setZoom(a*n)}return{center:e.getCenter(),zoom:e.getZoom()}}},aP=h,oP=g,sP=rP.updateCenterAndZoom;aP.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},(function(e,t){var i=e.componentType||"series";t.eachComponent({mainType:i,query:e},(function(t){var n=t.coordinateSystem;if("geo"===n.type){var r=sP(n,e,t.get("scaleLimit"));t.setCenter&&t.setCenter(r.center),t.setZoom&&t.setZoom(r.zoom),"series"===i&&oP.each(t.seriesGroup,(function(e){e.setCenter(r.center),e.setZoom(r.zoom)}))}}))}));var lP=g,uP=V,hP=Ue,cP=Pi,dP=rt,fP=uP.applyTransform;function pP(){dP.call(this)}function gP(e){this.name=e,this.zoomLimit,dP.call(this),this._roamTransformable=new pP,this._rawTransformable=new pP,this._center,this._zoom}function mP(e,t,i,n){var r=i.seriesModel,a=r?r.coordinateSystem:null;return a===this?a[e](n):null}lP.mixin(pP,dP),gP.prototype={constructor:gP,type:"view",dimensions:["x","y"],setBoundingRect:function(e,t,i,n){return this._rect=new cP(e,t,i,n),this._rect},getBoundingRect:function(){return this._rect},setViewRect:function(e,t,i,n){this.transformTo(e,t,i,n),this._viewRect=new cP(e,t,i,n)},transformTo:function(e,t,i,n){var r=this.getBoundingRect(),a=this._rawTransformable;a.transform=r.calculateTransform(new cP(e,t,i,n)),a.decomposeTransform(),this._updateTransform()},setCenter:function(e){e&&(this._center=e,this._updateCenterAndZoom())},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()},getDefaultCenter:function(){var e=this.getBoundingRect();return[e.x+e.width/2,e.y+e.height/2]},getCenter:function(){return this._center||this.getDefaultCenter()},getZoom:function(){return this._zoom||1},getRoamTransform:function(){return this._roamTransformable.getLocalTransform()},_updateCenterAndZoom:function(){var e=this._rawTransformable.getLocalTransform(),t=this._roamTransformable,i=this.getDefaultCenter(),n=this.getCenter(),r=this.getZoom();n=uP.applyTransform([],n,e),i=uP.applyTransform([],i,e),t.origin=n,t.position=[i[0]-n[0],i[1]-n[1]],t.scale=[r,r],this._updateTransform()},_updateTransform:function(){var e=this._roamTransformable,t=this._rawTransformable;t.parent=e,e.updateTransform(),t.updateTransform(),hP.copy(this.transform||(this.transform=[]),t.transform||hP.create()),this._rawTransform=t.getLocalTransform(),this.invTransform=this.invTransform||[],hP.invert(this.invTransform,this.transform),this.decomposeTransform()},getTransformInfo:function(){var e=this._roamTransformable.transform,t=this._rawTransformable;return{roamTransform:e?lP.slice(e):hP.create(),rawScale:lP.slice(t.scale),rawPosition:lP.slice(t.position)}},getViewRect:function(){return this._viewRect},getViewRectAfterRoam:function(){var e=this.getBoundingRect().clone();return e.applyTransform(this.transform),e},dataToPoint:function(e,t,i){var n=t?this._rawTransform:this.transform;return i=i||[],n?fP(i,e,n):uP.copy(i,e)},pointToData:function(e){var t=this.invTransform;return t?fP([],e,t):[e[0],e[1]]},convertToPixel:lP.curry(mP,"dataToPoint"),convertFromPixel:lP.curry(mP,"pointToData"),containPoint:function(e){return this.getViewRectAfterRoam().contain(e[0],e[1])}},lP.mixin(gP,dP);var vP=gP,yP=g,_P=Pi,xP=vP,bP=lL;function wP(e,t,i,n){xP.call(this,e),this.map=t;var r=bP.load(t,i);this._nameCoordMap=r.nameCoordMap,this._regionsMap=r.regionsMap,this._invertLongitute=null==n||n,this.regions=r.regions,this._rect=r.boundingRect}function TP(e,t,i,n){var r=i.geoModel,a=i.seriesModel,o=r?r.coordinateSystem:a?a.coordinateSystem||(a.getReferringComponents("geo")[0]||{}).coordinateSystem:null;return o===this?o[e](n):null}wP.prototype={constructor:wP,type:"geo",dimensions:["lng","lat"],containCoord:function(e){for(var t=this.regions,i=0;i<t.length;i++)if(t[i].contain(e))return!0;return!1},transformTo:function(e,t,i,n){var r=this.getBoundingRect(),a=this._invertLongitute;r=r.clone(),a&&(r.y=-r.y-r.height);var o=this._rawTransformable;if(o.transform=r.calculateTransform(new _P(e,t,i,n)),o.decomposeTransform(),a){var s=o.scale;s[1]=-s[1]}o.updateTransform(),this._updateTransform()},getRegion:function(e){return this._regionsMap.get(e)},getRegionByCoord:function(e){for(var t=this.regions,i=0;i<t.length;i++)if(t[i].contain(e))return t[i]},addGeoCoord:function(e,t){this._nameCoordMap.set(e,t)},getGeoCoord:function(e){return this._nameCoordMap.get(e)},getBoundingRect:function(){return this._rect},dataToPoint:function(e,t,i){if("string"==typeof e&&(e=this.getGeoCoord(e)),e)return xP.prototype.dataToPoint.call(this,e,t,i)},convertToPixel:yP.curry(TP,"dataToPoint"),convertFromPixel:yP.curry(TP,"pointToData")},yP.mixin(wP,xP);var SP=h,MP=g,AP=wP,IP=Hc,CP=Uc,DP=lL,EP=Ry;function LP(e,t){var i=e.get("boundingCoords");if(null!=i){var n=i[0],r=i[1];isNaN(n[0])||isNaN(n[1])||isNaN(r[0])||isNaN(r[1])||this.setBoundingRect(n[0],n[1],r[0]-n[0],r[1]-n[1])}var a,o=this.getBoundingRect(),s=e.get("layoutCenter"),l=e.get("layoutSize"),u=t.getWidth(),h=t.getHeight(),c=o.width/o.height*this.aspectScale,d=!1;if(s&&l&&(s=[CP.parsePercent(s[0],u),CP.parsePercent(s[1],h)],l=CP.parsePercent(l,Math.min(u,h)),isNaN(s[0])||isNaN(s[1])||isNaN(l)||(d=!0)),d){var f={};c>1?(f.width=l,f.height=l/c):(f.height=l,f.width=l*c),f.y=s[1]-f.height/2,f.x=s[0]-f.width/2}else(a=e.getBoxLayoutParams()).aspect=c,f=IP.getLayoutRect(a,{width:u,height:h});this.setViewRect(f.x,f.y,f.width,f.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function PP(e,t){MP.each(t.get("geoCoord"),(function(t,i){e.addGeoCoord(i,t)}))}var NP={dimensions:AP.prototype.dimensions,create:function(e,t){var i=[];e.eachComponent("geo",(function(e,n){var r=e.get("map"),a=e.get("aspectScale"),o=!0,s=EP.retrieveMap(r);s&&s[0]&&"svg"===s[0].type?(null==a&&(a=1),o=!1):null==a&&(a=.75);var l=new AP(r+n,r,e.get("nameMap"),o);l.aspectScale=a,l.zoomLimit=e.get("scaleLimit"),i.push(l),PP(l,e),e.coordinateSystem=l,l.model=e,l.resize=LP,l.resize(e,t)})),e.eachSeries((function(e){if("geo"===e.get("coordinateSystem")){var t=e.get("geoIndex")||0;e.coordinateSystem=i[t]}}));var n={};return e.eachSeriesByType("map",(function(e){if(!e.getHostGeoModel()){var t=e.getMapType();n[t]=n[t]||[],n[t].push(e)}})),MP.each(n,(function(e,n){var r=MP.map(e,(function(e){return e.get("nameMap")})),a=new AP(n,n,MP.mergeAll(r));a.zoomLimit=MP.retrieve.apply(null,MP.map(e,(function(e){return e.get("scaleLimit")}))),i.push(a),a.resize=LP,a.aspectScale=e[0].get("aspectScale"),a.resize(e[0],t),MP.each(e,(function(e){e.coordinateSystem=a,PP(a,e)}))})),i},getFilledRegions:function(e,t,i){for(var n=(e||[]).slice(),r=MP.createHashMap(),a=0;a<n.length;a++)r.set(n[a].name,n[a]);var o=DP.load(t,i);return MP.each(o.regions,(function(e){var t=e.name;!r.get(t)&&n.push({name:t})})),n}};SP.registerCoordinateSystem("geo",NP);var RP=NP,OP=g,kP=function(e){var t={};e.eachSeriesByType("map",(function(i){var n=i.getMapType();if(!i.getHostGeoModel()&&!t[n]){var r={};OP.each(i.seriesGroup,(function(t){var i=t.coordinateSystem,n=t.originalData;t.get("showLegendSymbol")&&e.getComponent("legend")&&n.each(n.mapDimension("value"),(function(e,t){var a=n.getName(t),o=i.getRegion(a);if(o&&!isNaN(e)){var s=r[a]||0,l=i.dataToPoint(o.center);r[a]=s+1,n.setItemLayout(t,{point:l,offset:s})}}))}));var a=i.getData();a.each((function(e){var t=a.getName(e),i=a.getItemLayout(e)||{};i.showLabel=!r[t],a.setItemLayout(e,i)})),t[n]=!0}}))},zP=function(e){e.eachSeriesByType("map",(function(e){var t=e.get("color"),i=e.getModel("itemStyle"),n=i.get("areaColor"),r=i.get("color")||t[e.seriesIndex%t.length];e.getData().setVisual({areaColor:n,color:r})}))},BP=g,FP=function(e){var t={};e.eachSeriesByType("map",(function(e){var i=e.getHostGeoModel(),n=i?"o"+i.id:"i"+e.getMapType();(t[n]=t[n]||[]).push(e)})),BP.each(t,(function(e,t){for(var i,n,r,a=(i=BP.map(e,(function(e){return e.getData()})),n=e[0].get("mapValueCalculation"),r={},BP.each(i,(function(e){e.each(e.mapDimension("value"),(function(t,i){var n="ec-"+e.getName(i);r[n]=r[n]||[],isNaN(t)||r[n].push(t)}))})),i[0].map(i[0].mapDimension("value"),(function(e,t){for(var a="ec-"+i[0].getName(t),o=0,s=1/0,l=-1/0,u=r[a].length,h=0;h<u;h++)s=Math.min(s,r[a][h]),l=Math.max(l,r[a][h]),o+=r[a][h];return 0===u?NaN:"min"===n?s:"max"===n?l:"average"===n?o/u:o}))),o=0;o<e.length;o++)e[o].originalData=e[o].getData();for(o=0;o<e.length;o++)e[o].seriesGroup=e,e[o].needsDrawMap=0===o&&!e[o].getHostGeoModel(),e[o].setData(a.cloneShallow()),e[o].mainSeries=e[0]}))},VP=g,GP=h,HP=kP,UP=zP,WP=FP,jP=function(e){VP.each(e.series,(function(e){e&&"map"===e.type&&(e.map=e.map||e.mapType,VP.defaults(e,e.mapLocation))}))},XP=ZC;GP.registerLayout(HP),GP.registerVisual(UP),GP.registerProcessor(GP.PRIORITY.PROCESSOR.STATISTIC,WP),GP.registerPreprocessor(jP),XP("map",[{type:"mapToggleSelect",event:"mapselectchanged",method:"toggleSelected"},{type:"mapSelect",event:"mapselected",method:"select"},{type:"mapUnSelect",event:"mapunselected",method:"unSelect"}]);var ZP=g,qP=ZP.each,YP="\0__link_datas",KP="\0__link_mainData";function QP(e,t){if((n=this)[KP]===n){var i=ZP.extend({},this[YP]);i[this.dataType]=t,tN(t,i,e)}else iN(t,this.dataType,this[KP],e);var n;return t}function JP(e,t){return e.struct&&e.struct.update(this),t}function $P(e,t){return qP(t[YP],(function(i,n){i!==t&&iN(i.cloneShallow(),n,t,e)})),t}function eN(e){var t=this[KP];return null==e||null==t?t:t[YP][e]}function tN(e,t,i){e[YP]={},qP(t,(function(t,n){iN(t,n,e,i)}))}function iN(e,t,i,n){i[YP][t]=e,e[KP]=i,e.dataType=t,n.struct&&(e[n.structAttr]=n.struct,n.struct[n.datasAttr[t]]=e),e.getLinkedData=eN}var nN=function(e){var t=e.mainData,i=e.datas;i||(i={main:t},e.datasAttr={main:"data"}),e.datas=e.mainData=null,tN(t,i,e),qP(i,(function(i){qP(t.TRANSFERABLE_METHODS,(function(t){i.wrapMethod(t,ZP.curry(QP,e))}))})),t.wrapMethod("cloneShallow",ZP.curry($P,e)),qP(t.CHANGABLE_METHODS,(function(i){t.wrapMethod(i,ZP.curry(JP,e))})),ZP.assert(i[t.dataType]===t)},rN=g,aN=nN,oN=A_,sN=X_,lN=function(e,t){this.name=e||"",this.depth=0,this.height=0,this.parentNode=null,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.hostTree=t};function uN(e){this.root,this.data,this._nodes=[],this.hostModel=e}lN.prototype={constructor:lN,isRemoved:function(){return this.dataIndex<0},eachNode:function(e,t,i){"function"==typeof e&&(i=t,t=e,e=null),e=e||{},rN.isString(e)&&(e={order:e});var n,r=e.order||"preorder",a=this[e.attr||"children"];"preorder"===r&&(n=t.call(i,this));for(var o=0;!n&&o<a.length;o++)a[o].eachNode(e,t,i);"postorder"===r&&t.call(i,this)},updateDepthAndHeight:function(e){var t=0;this.depth=e;for(var i=0;i<this.children.length;i++){var n=this.children[i];n.updateDepthAndHeight(e+1),n.height>t&&(t=n.height)}this.height=t+1},getNodeById:function(e){if(this.getId()===e)return this;for(var t=0,i=this.children,n=i.length;t<n;t++){var r=i[t].getNodeById(e);if(r)return r}},contains:function(e){if(e===this)return!0;for(var t=0,i=this.children,n=i.length;t<n;t++){var r=i[t].contains(e);if(r)return r}},getAncestors:function(e){for(var t=[],i=e?this:this.parentNode;i;)t.push(i),i=i.parentNode;return t.reverse(),t},getValue:function(e){var t=this.hostTree.data;return t.get(t.getDimension(e||"value"),this.dataIndex)},setLayout:function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},getLayout:function(){return this.hostTree.data.getItemLayout(this.dataIndex)},getModel:function(e){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(e)},setVisual:function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},getVisual:function(e,t){return this.hostTree.data.getItemVisual(this.dataIndex,e,t)},getRawIndex:function(){return this.hostTree.data.getRawIndex(this.dataIndex)},getId:function(){return this.hostTree.data.getId(this.dataIndex)},isAncestorOf:function(e){for(var t=e.parentNode;t;){if(t===this)return!0;t=t.parentNode}return!1},isDescendantOf:function(e){return e!==this&&e.isAncestorOf(this)}},uN.prototype={constructor:uN,type:"tree",eachNode:function(e,t,i){this.root.eachNode(e,t,i)},getNodeByDataIndex:function(e){var t=this.data.getRawIndex(e);return this._nodes[t]},getNodeByName:function(e){return this.root.getNodeByName(e)},update:function(){for(var e=this.data,t=this._nodes,i=0,n=t.length;i<n;i++)t[i].dataIndex=-1;for(i=0,n=e.count();i<n;i++)t[e.getRawIndex(i)].dataIndex=i},clearLayouts:function(){this.data.clearItemLayouts()}},uN.createTree=function(e,t,i){var n=new uN(t),r=[],a=1;!function e(t,i){var o=t.value;a=Math.max(a,rN.isArray(o)?o.length:1),r.push(t);var s=new lN(t.name,n);i?function(e,t){var i=t.children;e.parentNode!==t&&(i.push(e),e.parentNode=t)}(s,i):n.root=s,n._nodes.push(s);var l=t.children;if(l)for(var u=0;u<l.length;u++)e(l[u],s)}(e),n.root.updateDepthAndHeight(0);var o=sN(r,{coordDimensions:["value"],dimensionsCount:a}),s=new oN(o,t);return s.initData(r),i&&i(s),aN({mainData:s,struct:n,structAttr:"tree"}),n.update(),n};var hN=uN,cN=um,dN=hN,fN=qc.encodeHTML,pN=zc;cN.extend({type:"series.tree",layoutInfo:null,layoutMode:"box",getInitialData:function(e){var t={name:e.name,children:e.data},i=e.leaves||{},n=new pN(i,this,this.ecModel),r=dN.createTree(t,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var i=r.getNodeByDataIndex(t);return i.children.length&&i.isExpand||(e.parentModel=n),e}))})),a=0;r.eachNode("preorder",(function(e){e.depth>a&&(a=e.depth)}));var o=e.expandAndCollapse&&e.initialTreeDepth>=0?e.initialTreeDepth:a;return r.root.eachNode("preorder",(function(e){var t=e.hostTree.data.getRawDataItem(e.dataIndex);e.isExpand=t&&null!=t.collapsed?!t.collapsed:e.depth<=o})),r.data},getOrient:function(){var e=this.get("orient");return"horizontal"===e?e="LR":"vertical"===e&&(e="TB"),e},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},formatTooltip:function(e){for(var t=this.getData().tree,i=t.root.children[0],n=t.getNodeByDataIndex(e),r=n.getValue(),a=n.name;n&&n!==i;)a=n.parentNode.name+"."+a,n=n.parentNode;return fN(a+(isNaN(r)||null==r?"":" : "+r))},defaultOption:{zlevel:0,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",borderColor:"#c23531",borderWidth:1.5},label:{show:!0,color:"#555"},leaves:{label:{show:!0}},animationEasing:"linear",animationDuration:700,animationDurationUpdate:1e3}});var gN={},mN=Hc;function vN(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function yN(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function _N(e,t,i){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:i}function xN(e,t,i){var n=i/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=n,t.hierNode.shift+=i,t.hierNode.modifier+=i,t.hierNode.prelim+=i,e.hierNode.change+=n}function bN(e,t){return e.parentNode===t.parentNode?1:2}gN.init=function(e){e.hierNode={defaultAncestor:null,ancestor:e,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var t,i,n=[e];t=n.pop();)if(i=t.children,t.isExpand&&i.length)for(var r=i.length-1;r>=0;r--){var a=i[r];a.hierNode={defaultAncestor:null,ancestor:a,prelim:0,modifier:0,change:0,shift:0,i:r,thread:null},n.push(a)}},gN.firstWalk=function(e,t){var i=e.isExpand?e.children:[],n=e.parentNode.children,r=e.hierNode.i?n[e.hierNode.i-1]:null;if(i.length){!function(e){for(var t=e.children,i=t.length,n=0,r=0;--i>=0;){var a=t[i];a.hierNode.prelim+=n,a.hierNode.modifier+=n,r+=a.hierNode.change,n+=a.hierNode.shift+r}}(e);var a=(i[0].hierNode.prelim+i[i.length-1].hierNode.prelim)/2;r?(e.hierNode.prelim=r.hierNode.prelim+t(e,r),e.hierNode.modifier=e.hierNode.prelim-a):e.hierNode.prelim=a}else r&&(e.hierNode.prelim=r.hierNode.prelim+t(e,r));e.parentNode.hierNode.defaultAncestor=function(e,t,i,n){if(t){for(var r=e,a=e,o=a.parentNode.children[0],s=t,l=r.hierNode.modifier,u=a.hierNode.modifier,h=o.hierNode.modifier,c=s.hierNode.modifier;s=vN(s),a=yN(a),s&&a;){r=vN(r),o=yN(o),r.hierNode.ancestor=e;var d=s.hierNode.prelim+c-a.hierNode.prelim-u+n(s,a);d>0&&(xN(_N(s,e,i),e,d),u+=d,l+=d),c+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=r.hierNode.modifier,h+=o.hierNode.modifier}s&&!vN(r)&&(r.hierNode.thread=s,r.hierNode.modifier+=c-l),a&&!yN(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-h,i=e)}return i}(e,r,e.parentNode.hierNode.defaultAncestor||n[0],t)},gN.secondWalk=function(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier},gN.separation=function(e){return arguments.length?e:bN},gN.radialCoordinate=function(e,t){var i={};return e-=Math.PI/2,i.x=t*Math.cos(e),i.y=t*Math.sin(e),i},gN.getViewRect=function(e,t){return mN.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})};var wN=g,TN=No,SN=aS,MN=gN.radialCoordinate,AN=h,IN=Jo,CN=vP,DN=zL,EN=kL,LN=BL.onIrrelevantElement,PN=Uc.parsePercent,NN=TN.extendShape({shape:{parentPoint:[],childPoints:[],orient:"",forkPosition:""},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i=t.childPoints,n=i.length,r=t.parentPoint,a=i[0],o=i[n-1];if(1===n)return e.moveTo(r[0],r[1]),void e.lineTo(a[0],a[1]);var s=t.orient,l="TB"===s||"BT"===s?0:1,u=1-l,h=PN(t.forkPosition,1),c=[];c[l]=r[l],c[u]=r[u]+(o[u]-r[u])*h,e.moveTo(r[0],r[1]),e.lineTo(c[0],c[1]),e.moveTo(a[0],a[1]),c[l]=a[l],e.lineTo(c[0],c[1]),c[l]=o[l],e.lineTo(c[0],c[1]),e.lineTo(o[0],o[1]);for(var d=1;d<n-1;d++){var f=i[d];e.moveTo(f[0],f[1]),c[l]=f[l],e.lineTo(c[0],c[1])}}});function RN(e,t){var i=e.getItemLayout(t);return i&&!isNaN(i.x)&&!isNaN(i.y)&&"none"!==e.getItemVisual(t,"symbol")}function ON(e,t,i){return i.itemModel=t,i.itemStyle=t.getModel("itemStyle").getItemStyle(),i.hoverItemStyle=t.getModel("emphasis.itemStyle").getItemStyle(),i.lineStyle=t.getModel("lineStyle").getLineStyle(),i.labelModel=t.getModel("label"),i.hoverLabelModel=t.getModel("emphasis.label"),!1===e.isExpand&&0!==e.children.length?i.symbolInnerColor=i.itemStyle.fill:i.symbolInnerColor="#fff",i}function kN(e,t,i,n,r,a){var o=!i,s=e.tree.getNodeByDataIndex(t),l=s.getModel(),u=(a=ON(s,l,a),e.tree.root),h=s.parentNode===u?s:s.parentNode||s,c=e.getItemGraphicEl(h.dataIndex),d=h.getLayout(),f=c?{x:c.position[0],y:c.position[1],rawX:c.__radialOldRawX,rawY:c.__radialOldRawY}:d,p=s.getLayout();o?(i=new SN(e,t,a)).attr("position",[f.x,f.y]):i.updateData(e,t,a),i.__radialOldRawX=i.__radialRawX,i.__radialOldRawY=i.__radialRawY,i.__radialRawX=p.rawX,i.__radialRawY=p.rawY,n.add(i),e.setItemGraphicEl(t,i),TN.updateProps(i,{position:[p.x,p.y]},r);var g=i.getSymbolPath();if("radial"===a.layout){var m,v,y=u.children[0],_=y.getLayout(),x=y.children.length;if(p.x===_.x&&!0===s.isExpand){var b={};b.x=(y.children[0].getLayout().x+y.children[x-1].getLayout().x)/2,b.y=(y.children[0].getLayout().y+y.children[x-1].getLayout().y)/2,(m=Math.atan2(b.y-_.y,b.x-_.x))<0&&(m=2*Math.PI+m),(v=b.x<_.x)&&(m-=Math.PI)}else(m=Math.atan2(p.y-_.y,p.x-_.x))<0&&(m=2*Math.PI+m),0===s.children.length||0!==s.children.length&&!1===s.isExpand?(v=p.x<_.x)&&(m-=Math.PI):(v=p.x>_.x)||(m-=Math.PI);var w=v?"left":"right",T=a.labelModel.get("rotate"),S=T*(Math.PI/180);g.setStyle({textPosition:a.labelModel.get("position")||w,textRotation:null==T?-m:S,textOrigin:"center",verticalAlign:"middle"})}!function(e,t,i,n,r,a,o,s,l){var u=l.edgeShape,h=n.__edge;if("curve"===u)t.parentNode&&t.parentNode!==i&&(h||(h=n.__edge=new TN.BezierCurve({shape:BN(l,r,r),style:wN.defaults({opacity:0,strokeNoScale:!0},l.lineStyle)})),TN.updateProps(h,{shape:BN(l,a,o),style:wN.defaults({opacity:1},l.lineStyle)},e));else if("polyline"===u&&"orthogonal"===l.layout&&t!==i&&t.children&&0!==t.children.length&&!0===t.isExpand){for(var c=t.children,d=[],f=0;f<c.length;f++){var p=c[f].getLayout();d.push([p.x,p.y])}h||(h=n.__edge=new NN({shape:{parentPoint:[o.x,o.y],childPoints:[[o.x,o.y]],orient:l.orient,forkPosition:l.edgeForkPosition},style:wN.defaults({opacity:0,strokeNoScale:!0},l.lineStyle)})),TN.updateProps(h,{shape:{parentPoint:[o.x,o.y],childPoints:d},style:wN.defaults({opacity:1},l.lineStyle)},e)}s.add(h)}(r,s,u,i,f,d,p,n,a)}function zN(e,t,i,n,r,a){for(var o,s=e.tree.getNodeByDataIndex(t),l=e.tree.root,u=s.getModel(),h=(a=ON(s,u,a),s.parentNode===l?s:s.parentNode||s),c=a.edgeShape;null==(o=h.getLayout());)h=h.parentNode===l?h:h.parentNode||h;TN.updateProps(i,{position:[o.x+1,o.y+1]},r,(function(){n.remove(i),e.setItemGraphicEl(t,null)})),i.fadeOut(null,{keepLabel:!0});var d=e.getItemGraphicEl(h.dataIndex).__edge,f=i.__edge||(!1===h.isExpand||1===h.children.length?d:void 0);c=a.edgeShape,f&&("curve"===c?TN.updateProps(f,{shape:BN(a,o,o),style:{opacity:0}},r,(function(){n.remove(f)})):"polyline"===c&&"orthogonal"===a.layout&&TN.updateProps(f,{shape:{parentPoint:[o.x,o.y],childPoints:[[o.x,o.y]]},style:{opacity:0}},r,(function(){n.remove(f)})))}function BN(e,t,i){var n,r,a,o,s,l,u,h,c=e.orient;if("radial"===e.layout){s=t.rawX,u=t.rawY,l=i.rawX,h=i.rawY;var d=MN(s,u),f=MN(s,u+(h-u)*e.curvature),p=MN(l,h+(u-h)*e.curvature),g=MN(l,h);return{x1:d.x,y1:d.y,x2:g.x,y2:g.y,cpx1:f.x,cpy1:f.y,cpx2:p.x,cpy2:p.y}}return s=t.x,u=t.y,l=i.x,h=i.y,"LR"!==c&&"RL"!==c||(n=s+(l-s)*e.curvature,r=u,a=l+(s-l)*e.curvature,o=h),"TB"!==c&&"BT"!==c||(n=s,r=u+(h-u)*e.curvature,a=l,o=h+(u-h)*e.curvature),{x1:s,y1:u,x2:l,y2:h,cpx1:n,cpy1:r,cpx2:a,cpy2:o}}AN.extendChartView({type:"tree",init:function(e,t){this._oldTree,this._mainGroup=new TN.Group,this._controller=new EN(t.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},render:function(e,t,i,n){var r=e.getData(),a=e.layoutInfo,o=this._mainGroup,s=e.get("layout");"radial"===s?o.attr("position",[a.x+a.width/2,a.y+a.height/2]):o.attr("position",[a.x,a.y]),this._updateViewCoordSys(e,a,s),this._updateController(e,t,i);var l=this._data,u={expandAndCollapse:e.get("expandAndCollapse"),layout:s,edgeShape:e.get("edgeShape"),edgeForkPosition:e.get("edgeForkPosition"),orient:e.getOrient(),curvature:e.get("lineStyle.curveness"),symbolRotate:e.get("symbolRotate"),symbolOffset:e.get("symbolOffset"),hoverAnimation:e.get("hoverAnimation"),useNameLabel:!0,fadeIn:!0};r.diff(l).add((function(t){RN(r,t)&&kN(r,t,null,o,e,u)})).update((function(t,i){var n=l.getItemGraphicEl(i);RN(r,t)?kN(r,t,n,o,e,u):n&&zN(l,i,n,o,e,u)})).remove((function(t){var i=l.getItemGraphicEl(t);i&&zN(l,t,i,o,e,u)})).execute(),this._nodeScaleRatio=e.get("nodeScaleRatio"),this._updateNodeAndLinkScale(e),!0===u.expandAndCollapse&&r.eachItemGraphicEl((function(t,n){t.off("click").on("click",(function(){i.dispatchAction({type:"treeExpandAndCollapse",seriesId:e.id,dataIndex:n})}))})),this._data=r},_updateViewCoordSys:function(e){var t=e.getData(),i=[];t.each((function(e){var n=t.getItemLayout(e);!n||isNaN(n.x)||isNaN(n.y)||i.push([+n.x,+n.y])}));var n=[],r=[];IN.fromPoints(i,n,r);var a=this._min,o=this._max;r[0]-n[0]==0&&(n[0]=a?a[0]:n[0]-1,r[0]=o?o[0]:r[0]+1),r[1]-n[1]==0&&(n[1]=a?a[1]:n[1]-1,r[1]=o?o[1]:r[1]+1);var s=e.coordinateSystem=new CN;s.zoomLimit=e.get("scaleLimit"),s.setBoundingRect(n[0],n[1],r[0]-n[0],r[1]-n[1]),s.setCenter(e.get("center")),s.setZoom(e.get("zoom")),this.group.attr({position:s.position,scale:s.scale}),this._viewCoordSys=s,this._min=n,this._max=r},_updateController:function(e,t,i){var n=this._controller,r=this._controllerHost,a=this.group;n.setPointerChecker((function(t,n,r){var o=a.getBoundingRect();return o.applyTransform(a.transform),o.contain(n,r)&&!LN(t,i,e)})),n.enable(e.get("roam")),r.zoomLimit=e.get("scaleLimit"),r.zoom=e.coordinateSystem.getZoom(),n.off("pan").off("zoom").on("pan",(function(t){DN.updateViewOnPan(r,t.dx,t.dy),i.dispatchAction({seriesId:e.id,type:"treeRoam",dx:t.dx,dy:t.dy})}),this).on("zoom",(function(t){DN.updateViewOnZoom(r,t.scale,t.originX,t.originY),i.dispatchAction({seriesId:e.id,type:"treeRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),this._updateNodeAndLinkScale(e)}),this)},_updateNodeAndLinkScale:function(e){var t=e.getData(),i=this._getNodeGlobalScale(e),n=[i,i];t.eachItemGraphicEl((function(e,t){e.attr("scale",n)}))},_getNodeGlobalScale:function(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var i=this._nodeScaleRatio,n=t.scale,r=n&&n[0]||1;return((t.getZoom()-1)*i+1)/r},dispose:function(){this._controller&&this._controller.dispose(),this._controllerHost={}},remove:function(){this._mainGroup.removeAll(),this._data=null}});var FN=h,VN=rP.updateCenterAndZoom;FN.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var i=e.dataIndex,n=t.getData().tree.getNodeByDataIndex(i);n.isExpand=!n.isExpand}))})),FN.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var i=t.coordinateSystem,n=VN(i,e);t.setCenter&&t.setCenter(n.center),t.setZoom&&t.setZoom(n.zoom)}))}));var GN={eachAfter:function(e,t,i){for(var n,r=[e],a=[];n=r.pop();)if(a.push(n),n.isExpand){var o=n.children;if(o.length)for(var s=0;s<o.length;s++)r.push(o[s])}for(;n=a.pop();)t(n,i)},eachBefore:function(e,t){for(var i,n=[e];i=n.pop();)if(t(i),i.isExpand){var r=i.children;if(r.length)for(var a=r.length-1;a>=0;a--)n.push(r[a])}}},HN=GN,UN=HN.eachAfter,WN=HN.eachBefore,jN=gN,XN=jN.init,ZN=jN.firstWalk,qN=jN.secondWalk,YN=jN.separation,KN=jN.radialCoordinate,QN=jN.getViewRect,JN=function(e,t){e.eachSeriesByType("tree",(function(e){!function(e,t){var i=QN(e,t);e.layoutInfo=i;var n=e.get("layout"),r=0,a=0,o=null;"radial"===n?(r=2*Math.PI,a=Math.min(i.height,i.width)/2,o=YN((function(e,t){return(e.parentNode===t.parentNode?1:2)/e.depth}))):(r=i.width,a=i.height,o=YN());var s=e.getData().tree.root,l=s.children[0];if(l){XN(s),UN(l,ZN,o),s.hierNode.modifier=-l.hierNode.prelim,WN(l,qN);var u=l,h=l,c=l;WN(l,(function(e){var t=e.getLayout().x;t<u.getLayout().x&&(u=e),t>h.getLayout().x&&(h=e),e.depth>c.depth&&(c=e)}));var d=u===h?1:o(u,h)/2,f=d-u.getLayout().x,p=0,g=0,m=0,v=0;if("radial"===n)p=r/(h.getLayout().x+d+f),g=a/(c.depth-1||1),WN(l,(function(e){m=(e.getLayout().x+f)*p,v=(e.depth-1)*g;var t=KN(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=a/(h.getLayout().x+d+f),p=r/(c.depth-1||1),WN(l,(function(e){v=(e.getLayout().x+f)*g,m="LR"===y?(e.depth-1)*p:r-(e.depth-1)*p,e.setLayout({x:m,y:v},!0)}))):"TB"!==y&&"BT"!==y||(p=r/(h.getLayout().x+d+f),g=a/(c.depth-1||1),WN(l,(function(e){m=(e.getLayout().x+f)*p,v="TB"===y?(e.depth-1)*g:a-(e.depth-1)*g,e.setLayout({x:m,y:v},!0)})))}}}(e,t)}))},$N=h,eR=gM,tR=JN;$N.registerVisual(eR("tree","circle")),$N.registerLayout(tR);var iR={},nR=g;function rR(e){for(var t=[];e;)(e=e.parentNode)&&t.push(e);return t.reverse()}iR.retrieveTargetInfo=function(e,t,i){if(e&&nR.indexOf(t,e.type)>=0){var n=i.getData().tree.root,r=e.targetNode;if("string"==typeof r&&(r=n.getNodeById(r)),r&&n.contains(r))return{node:r};var a=e.targetNodeId;if(null!=a&&(r=n.getNodeById(a)))return{node:r}}},iR.getPathToRoot=rR,iR.aboveViewRoot=function(e,t){var i=rR(e);return nR.indexOf(i,t)>=0},iR.wrapTreePathInfo=function(e,t){for(var i=[];e;){var n=e.dataIndex;i.push({name:e.name,dataIndex:n,value:t.getRawValue(n)}),e=e.parentNode}return i.reverse(),i};var aR=g,oR=um,sR=hN,lR=zc,uR=qc,hR=uR.encodeHTML,cR=uR.addCommas,dR=iR.wrapTreePathInfo;function fR(e){var t=0;aR.each(e.children,(function(e){fR(e);var i=e.value;aR.isArray(i)&&(i=i[0]),t+=i}));var i=e.value;aR.isArray(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=t),i<0&&(i=0),aR.isArray(e.value)?e.value[0]=i:e.value=i}oR.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],preventUsingHoverLayer:!0,_viewRoot:null,defaultOption:{progressive:0,left:"center",top:"middle",right:null,bottom:null,width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,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)",borderColor:"rgba(255,255,255,0.7)",borderWidth:1,shadowColor:"rgba(150,150,150,1)",shadowBlur:3,shadowOffsetX:0,shadowOffsetY:0,textStyle:{color:"#fff"}},emphasis:{textStyle:{}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",ellipsis:!0},upperLabel:{show:!1,position:[0,"50%"],height:20,color:"#fff",ellipsis:!0,verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],color:"#fff",ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},getInitialData:function(e,t){var i={name:e.name,children:e.data};fR(i);var n=e.levels||[],r=this.designatedVisualItemStyle={},a=new lR({itemStyle:r},this,t);n=e.levels=function(e,t){var i,n=t.get("color");if(n)return e=e||[],aR.each(e,(function(e){var t=new lR(e),n=t.get("color");(t.get("itemStyle.color")||n&&"none"!==n)&&(i=!0)})),i||((e[0]||(e[0]={})).color=n.slice()),e}(n,t);var o=aR.map(n||[],(function(e){return new lR(e,a,t)}),this),s=sR.createTree(i,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var i=s.getNodeByDataIndex(t),n=o[i.depth];return e.parentModel=n||a,e}))}));return s.data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(e){var t=this.getData(),i=this.getRawValue(e),n=aR.isArray(i)?cR(i[0]):cR(i),r=t.getName(e);return hR(r+": "+n)},getDataParams:function(e){var t=oR.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return t.treePathInfo=dR(i,this),t},setLayoutInfo:function(e){this.layoutInfo=this.layoutInfo||{},aR.extend(this.layoutInfo,e)},mapIdToIndex:function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=aR.createHashMap(),this._idIndexMapCount=0);var i=t.get(e);return null==i&&t.set(e,i=this._idIndexMapCount++),i},getViewRoot:function(){return this._viewRoot},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)}});var pR=No,gR=Hc,mR=g,vR=iR.wrapTreePathInfo;function yR(e){this.group=new pR.Group,e.add(this.group)}function _R(e,t,i,n,r,a){var o=[[r?e:e-5,t],[e+i,t],[e+i,t+n],[r?e:e-5,t+n]];return!a&&o.splice(2,0,[e+i+5,t+n/2]),!r&&o.push([e,t+n/2]),o}function xR(e,t,i){e.eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.componentIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:i&&i.dataIndex,name:i&&i.name},treePathInfo:i&&vR(i,t)}}yR.prototype={constructor:yR,render:function(e,t,i,n){var r=e.getModel("breadcrumb"),a=this.group;if(a.removeAll(),r.get("show")&&i){var o=r.getModel("itemStyle"),s=o.getModel("textStyle"),l={pos:{left:r.get("left"),right:r.get("right"),top:r.get("top"),bottom:r.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:r.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,l,s),this._renderContent(e,l,o,s,n),gR.positionElement(a,l.pos,l.box)}},_prepare:function(e,t,i){for(var n=e;n;n=n.parentNode){var r=n.getModel().get("name"),a=i.getTextRect(r),o=Math.max(a.width+16,t.emptyItemWidth);t.totalWidth+=o+8,t.renderList.push({node:n,text:r,width:o})}},_renderContent:function(e,t,i,n,r){for(var a=0,o=t.emptyItemWidth,s=e.get("breadcrumb.height"),l=gR.getAvailableSize(t.pos,t.box),u=t.totalWidth,h=t.renderList,c=h.length-1;c>=0;c--){var d=h[c],f=d.node,p=d.width,g=d.text;u>l.width&&(u-=p-o,p=o,g=null);var m=new pR.Polygon({shape:{points:_R(a,0,p,s,c===h.length-1,0===c)},style:mR.defaults(i.getItemStyle(),{lineJoin:"bevel",text:g,textFill:n.getTextColor(),textFont:n.getFont()}),z:10,onclick:mR.curry(r,f)});this.group.add(m),xR(m,e,f),a+=p+8}},remove:function(){this.group.removeAll()}};var bR=yR,wR={},TR=g;wR.createWrap=function(){var e,t=[],i={};return{add:function(e,n,r,a,o){return TR.isString(a)&&(o=a,a=0),!i[e.id]&&(i[e.id]=1,t.push({el:e,target:n,time:r,delay:a,easing:o}),!0)},done:function(t){return e=t,this},start:function(){for(var n=t.length,r=0,a=t.length;r<a;r++){var o=t[r];o.el.animateTo(o.target,o.time,o.delay,o.easing,s)}return this;function s(){--n||(t.length=0,i={},e&&e())}}}};var SR=h,MR=g,AR=No,IR=Vy,CR=iR,DR=bR,ER=kL,LR=Pi,PR=Ue,NR=wR,RR=Co,OR=qc.windowOpen,kR=MR.bind,zR=AR.Group,BR=AR.Rect,FR=MR.each,VR=["label"],GR=["emphasis","label"],HR=["upperLabel"],UR=["emphasis","upperLabel"],WR=RR([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),jR=function(e){var t=WR(e);return t.stroke=t.fill=t.lineWidth=null,t};function XR(e,t,i,n,r,a,o,s,l,u){if(o){var h=o.getLayout(),c=e.getData();if(c.setItemGraphicEl(o.dataIndex,null),h&&h.isInView){var d=h.width,f=h.height,p=h.borderWidth,g=h.invisible,m=o.getRawIndex(),v=s&&s.getRawIndex(),y=o.viewChildren,_=h.upperHeight,x=y&&y.length,b=o.getModel("itemStyle"),w=o.getModel("emphasis.itemStyle"),T=E("nodeGroup",zR);if(T){if(l.add(T),T.attr("position",[h.x||0,h.y||0]),T.__tmNodeWidth=d,T.__tmNodeHeight=f,h.isAboveViewRoot)return T;var S=o.getModel(),M=E("background",BR,u,1);if(M&&function(t,i,n){if(i.dataIndex=o.dataIndex,i.seriesIndex=e.seriesIndex,i.setShape({x:0,y:0,width:d,height:f}),g)I(i);else{i.invisible=!1;var r=o.getVisual("borderColor",!0),a=w.get("borderColor"),s=jR(b);s.fill=r;var l=WR(w);if(l.fill=a,n){var u=d-2*p;C(s,l,r,u,_,{x:p,y:0,width:u,height:_})}else s.text=l.text=null;i.setStyle(s),AR.setElementHoverStyle(i,l)}t.add(i)}(T,M,x&&h.upperLabelHeight),x)AR.isHighDownDispatcher(T)&&AR.setAsHighDownDispatcher(T,!1),M&&(AR.setAsHighDownDispatcher(M,!0),c.setItemGraphicEl(o.dataIndex,M));else{var A=E("content",BR,u,2);A&&function(t,i){i.dataIndex=o.dataIndex,i.seriesIndex=e.seriesIndex;var n=Math.max(d-2*p,0),r=Math.max(f-2*p,0);if(i.culling=!0,i.setShape({x:p,y:p,width:n,height:r}),g)I(i);else{i.invisible=!1;var a=o.getVisual("color",!0),s=jR(b);s.fill=a;var l=WR(w);C(s,l,a,n,r),i.setStyle(s),AR.setElementHoverStyle(i,l)}t.add(i)}(T,A),M&&AR.isHighDownDispatcher(M)&&AR.setAsHighDownDispatcher(M,!1),AR.setAsHighDownDispatcher(T,!0),c.setItemGraphicEl(o.dataIndex,T)}return T}}}function I(e){!e.invisible&&a.push(e)}function C(t,i,n,r,a,s){var l=S.get("name"),u=S.getModel(s?HR:VR),c=S.getModel(s?UR:GR),d=u.getShallow("show");AR.setLabelStyle(t,i,u,c,{defaultText:d?l:null,autoColor:n,isRectText:!0,labelFetcher:e,labelDataIndex:o.dataIndex,labelProp:s?"upperLabel":"label"}),D(t,s,h),D(i,s,h),s&&(t.textRect=MR.clone(s)),t.truncate=d&&u.get("ellipsis")?{outerWidth:r,outerHeight:a,minChar:2}:null}function D(t,i,n){var r=t.text;if(!i&&n.isLeafRoot&&null!=r){var a=e.get("drillDownIcon",!0);t.text=a?a+" "+r:r}}function E(e,a,s,l){var u=null!=v&&i[e][v],h=r[e];return u?(i[e][v]=null,function(e,t,i){(e[m]={}).old="nodeGroup"===i?t.position.slice():MR.extend({},t.shape)}(h,u,e)):g||((u=new a({z:ZR(s,l)})).__tmDepth=s,u.__tmStorageName=e,function(e,t,i){var a=e[m]={},s=o.parentNode;if(s&&(!n||"drillDown"===n.direction)){var l=0,u=0,h=r.background[s.getRawIndex()];!n&&h&&h.old&&(l=h.old.width,u=h.old.height),a.old="nodeGroup"===i?[0,u]:{x:l,y:u,width:0,height:0}}a.fadein="nodeGroup"!==i}(h,0,e)),t[e][m]=u}}function ZR(e,t){var i=10*e+t;return(i-1)/i}SR.extendChartView({type:"treemap",init:function(e,t){this._containerGroup,this._storage={nodeGroup:[],background:[],content:[]},this._oldTree,this._breadcrumb,this._controller,this._state="ready"},render:function(e,t,i,n){var r=t.findComponents({mainType:"series",subType:"treemap",query:n});if(!(MR.indexOf(r,e)<0)){this.seriesModel=e,this.api=i,this.ecModel=t;var a=CR.retrieveTargetInfo(n,["treemapZoomToNode","treemapRootToNode"],e),o=n&&n.type,s=e.layoutInfo,l=!this._oldTree,u=this._storage,h="treemapRootToNode"===o&&a&&u?{rootNodeGroup:u.nodeGroup[a.node.getRawIndex()],direction:n.direction}:null,c=this._giveContainerGroup(s),d=this._doRender(c,e,h);l||o&&"treemapZoomToNode"!==o&&"treemapRootToNode"!==o?d.renderFinally():this._doAnimation(c,d,e,h),this._resetController(i),this._renderBreadcrumb(e,i,a)}},_giveContainerGroup:function(e){var t=this._containerGroup;return t||(t=this._containerGroup=new zR,this._initEvents(t),this.group.add(t)),t.attr("position",[e.x,e.y]),t},_doRender:function(e,t,i){var n=t.getData().tree,r=this._oldTree,a={nodeGroup:[],background:[],content:[]},o={nodeGroup:[],background:[],content:[]},s=this._storage,l=[],u=MR.curry(XR,t,o,s,i,a,l);!function e(t,i,n,r,a){function o(e){return e.getId()}function s(o,s){var l=null!=o?t[o]:null,h=null!=s?i[s]:null,c=u(l,h,n,a);c&&e(l&&l.viewChildren||[],h&&h.viewChildren||[],c,r,a+1)}r?(i=t,FR(t,(function(e,t){!e.isRemoved()&&s(t,t)}))):new IR(i,t,o,o).add(s).update(s).remove(MR.curry(s,null)).execute()}(n.root?[n.root]:[],r&&r.root?[r.root]:[],e,n===r||!r,0);var h=function(e){var t={nodeGroup:[],background:[],content:[]};return e&&FR(e,(function(e,i){var n=t[i];FR(e,(function(e){e&&(n.push(e),e.__tmWillDelete=1)}))})),t}(s);return this._oldTree=n,this._storage=o,{lastsForAnimation:a,willDeleteEls:h,renderFinally:function(){FR(h,(function(e){FR(e,(function(e){e.parent&&e.parent.remove(e)}))})),FR(l,(function(e){e.invisible=!0,e.dirty()}))}}},_doAnimation:function(e,t,i,n){if(i.get("animation")){var r=i.get("animationDurationUpdate"),a=i.get("animationEasing"),o=NR.createWrap();FR(t.willDeleteEls,(function(e,t){FR(e,(function(e,i){if(!e.invisible){var s,l=e.parent;if(n&&"drillDown"===n.direction)s=l===n.rootNodeGroup?{shape:{x:0,y:0,width:l.__tmNodeWidth,height:l.__tmNodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var u=0,h=0;l.__tmWillDelete||(u=l.__tmNodeWidth/2,h=l.__tmNodeHeight/2),s="nodeGroup"===t?{position:[u,h],style:{opacity:0}}:{shape:{x:u,y:h,width:0,height:0},style:{opacity:0}}}s&&o.add(e,s,r,a)}}))})),FR(this._storage,(function(e,i){FR(e,(function(e,n){var s=t.lastsForAnimation[i][n],l={};s&&("nodeGroup"===i?s.old&&(l.position=e.position.slice(),e.attr("position",s.old)):(s.old&&(l.shape=MR.extend({},e.shape),e.setShape(s.old)),s.fadein?(e.setStyle("opacity",0),l.style={opacity:1}):1!==e.style.opacity&&(l.style={opacity:1})),o.add(e,l,r,a))}))}),this),this._state="animating",o.done(kR((function(){this._state="ready",t.renderFinally()}),this)).start()}},_resetController:function(e){var t=this._controller;t||((t=this._controller=new ER(e.getZr())).enable(this.seriesModel.get("roam")),t.on("pan",kR(this._onPan,this)),t.on("zoom",kR(this._onZoom,this)));var i=new LR(0,0,e.getWidth(),e.getHeight());t.setPointerChecker((function(e,t,n){return i.contain(t,n)}))},_clearController:function(){var e=this._controller;e&&(e.dispose(),e=null)},_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 i=t.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+e.dx,y:i.y+e.dy,width:i.width,height:i.height}})}},_onZoom:function(e){var t=e.originX,i=e.originY;if("animating"!==this._state){var n=this.seriesModel.getData().tree.root;if(!n)return;var r=n.getLayout();if(!r)return;var a=new LR(r.x,r.y,r.width,r.height),o=this.seriesModel.layoutInfo;t-=o.x,i-=o.y;var s=PR.create();PR.translate(s,s,[-t,-i]),PR.scale(s,s,[e.scale,e.scale]),PR.translate(s,s,[t,i]),a.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:a.x,y:a.y,width:a.width,height:a.height}})}},_initEvents:function(e){e.on("click",(function(e){if("ready"===this._state){var t=this.seriesModel.get("nodeClick",!0);if(t){var i=this.findTarget(e.offsetX,e.offsetY);if(i){var n=i.node;if(n.getLayout().isLeafRoot)this._rootToNode(i);else if("zoomToNode"===t)this._zoomToNode(i);else if("link"===t){var r=n.hostTree.data.getItemModel(n.dataIndex),a=r.get("link",!0),o=r.get("target",!0)||"blank";a&&OR(a,o)}}}}}),this)},_renderBreadcrumb:function(e,t,i){i||(i=null!=e.get("leafDepth",!0)?{node:e.getViewRoot()}:this.findTarget(t.getWidth()/2,t.getHeight()/2))||(i={node:e.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new DR(this.group))).render(e,t,i.node,kR((function(t){"animating"!==this._state&&(CR.aboveViewRoot(e.getViewRoot(),t)?this._rootToNode({node:t}):this._zoomToNode({node:t}))}),this))},remove:function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},dispose:function(){this._clearController()},_zoomToNode:function(e){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},_rootToNode:function(e){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},findTarget:function(e,t){var i;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(n){var r=this._storage.background[n.getRawIndex()];if(r){var a=r.transformCoordToLocal(e,t),o=r.shape;if(!(o.x<=a[0]&&a[0]<=o.x+o.width&&o.y<=a[1]&&a[1]<=o.y+o.height))return!1;i={node:n,offsetX:a[0],offsetY:a[1]}}}),this),i}});for(var qR=h,YR=iR,KR=function(){},QR=["treemapZoomToNode","treemapRender","treemapMove"],JR=0;JR<QR.length;JR++)qR.registerAction({type:QR[JR],update:"updateView"},KR);qR.registerAction({type:"treemapRootToNode",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"treemap",query:e},(function(t,i){var n=YR.retrieveTargetInfo(e,["treemapZoomToNode","treemapRootToNode"],t);if(n){var r=t.getViewRoot();r&&(e.direction=YR.aboveViewRoot(r,n.node)?"rollUp":"drillDown"),t.resetViewRoot(n.node)}}))}));var $R=g,eO=ut,tO=Uc.linearMap,iO=$R.each,nO=$R.isObject,rO=-1,aO=function(e){var t=e.mappingMethod,i=e.type,n=this.option=$R.clone(e);this.type=i,this.mappingMethod=t,this._normalizeData=mO[t];var r=oO[i];this.applyVisual=r.applyVisual,this.getColorMapper=r.getColorMapper,this._doMap=r._doMap[t],"piecewise"===t?(sO(n),function(e){var t=e.pieceList;e.hasSpecialVisual=!1,$R.each(t,(function(t,i){t.originIndex=i,null!=t.visual&&(e.hasSpecialVisual=!0)}))}(n)):"category"===t?n.categories?function(e){var t=e.categories,i=e.visual,n=e.categoryMap={};if(iO(t,(function(e,t){n[e]=t})),!$R.isArray(i)){var r=[];$R.isObject(i)?iO(i,(function(e,t){var i=n[t];r[null!=i?i:rO]=e})):r[-1]=i,i=gO(e,r)}for(var a=t.length-1;a>=0;a--)null==i[a]&&(delete n[t[a]],t.pop())}(n):sO(n,!0):($R.assert("linear"!==t||n.dataExtent),sO(n))};aO.prototype={constructor:aO,mapValueToVisual:function(e){var t=this._normalizeData(e);return this._doMap(t,e)},getNormalizer:function(){return $R.bind(this._normalizeData,this)}};var oO=aO.visualHandlers={color:{applyVisual:hO("color"),getColorMapper:function(){var e=this.option;return $R.bind("category"===e.mappingMethod?function(e,t){return!t&&(e=this._normalizeData(e)),cO.call(this,e)}:function(t,i,n){var r=!!n;return!i&&(t=this._normalizeData(t)),n=eO.fastLerp(t,e.parsedVisual,n),r?n:eO.stringify(n,"rgba")},this)},_doMap:{linear:function(e){return eO.stringify(eO.fastLerp(e,this.option.parsedVisual),"rgba")},category:cO,piecewise:function(e,t){var i=pO.call(this,t);return null==i&&(i=eO.stringify(eO.fastLerp(e,this.option.parsedVisual),"rgba")),i},fixed:dO}},colorHue:lO((function(e,t){return eO.modifyHSL(e,t)})),colorSaturation:lO((function(e,t){return eO.modifyHSL(e,null,t)})),colorLightness:lO((function(e,t){return eO.modifyHSL(e,null,null,t)})),colorAlpha:lO((function(e,t){return eO.modifyAlpha(e,t)})),opacity:{applyVisual:hO("opacity"),_doMap:fO([0,1])},liftZ:{applyVisual:hO("liftZ"),_doMap:{linear:dO,category:dO,piecewise:dO,fixed:dO}},symbol:{applyVisual:function(e,t,i){var n=this.mapValueToVisual(e);if($R.isString(n))i("symbol",n);else if(nO(n))for(var r in n)n.hasOwnProperty(r)&&i(r,n[r])},_doMap:{linear:uO,category:cO,piecewise:function(e,t){var i=pO.call(this,t);return null==i&&(i=uO.call(this,e)),i},fixed:dO}},symbolSize:{applyVisual:hO("symbolSize"),_doMap:fO([0,1])}};function sO(e,t){var i=e.visual,n=[];$R.isObject(i)?iO(i,(function(e){n.push(e)})):null!=i&&n.push(i),t||1!==n.length||{color:1,symbol:1}.hasOwnProperty(e.type)||(n[1]=n[0]),gO(e,n)}function lO(e){return{applyVisual:function(t,i,n){t=this.mapValueToVisual(t),n("color",e(i("color"),t))},_doMap:fO([0,1])}}function uO(e){var t=this.option.visual;return t[Math.round(tO(e,[0,1],[0,t.length-1],!0))]||{}}function hO(e){return function(t,i,n){n(e,this.mapValueToVisual(t))}}function cO(e){var t=this.option.visual;return t[this.option.loop&&e!==rO?e%t.length:e]}function dO(){return this.option.visual[0]}function fO(e){return{linear:function(t){return tO(t,e,this.option.visual,!0)},category:cO,piecewise:function(t,i){var n=pO.call(this,i);return null==n&&(n=tO(t,e,this.option.visual,!0)),n},fixed:dO}}function pO(e){var t=this.option,i=t.pieceList;if(t.hasSpecialVisual){var n=i[aO.findPieceIndex(e,i)];if(n&&n.visual)return n.visual[this.type]}}function gO(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=$R.map(t,(function(e){return eO.parse(e)}))),t}var mO={linear:function(e){return tO(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,i=aO.findPieceIndex(e,t,!0);if(null!=i)return tO(i,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return null==t?rO:t},fixed:$R.noop};function vO(e,t,i){return e?t<=i:t<i}aO.listVisualTypes=function(){var e=[];return $R.each(oO,(function(t,i){e.push(i)})),e},aO.addVisualHandler=function(e,t){oO[e]=t},aO.isValidType=function(e){return oO.hasOwnProperty(e)},aO.eachVisual=function(e,t,i){$R.isObject(e)?$R.each(e,t,i):t.call(i,e)},aO.mapVisual=function(e,t,i){var n,r=$R.isArray(e)?[]:$R.isObject(e)?{}:(n=!0,null);return aO.eachVisual(e,(function(e,a){var o=t.call(i,e,a);n?r=o:r[a]=o})),r},aO.retrieveVisuals=function(e){var t,i={};return e&&iO(oO,(function(n,r){e.hasOwnProperty(r)&&(i[r]=e[r],t=!0)})),t?i:null},aO.prepareVisualTypes=function(e){if(nO(e)){var t=[];iO(e,(function(e,i){t.push(i)})),e=t}else{if(!$R.isArray(e))return[];e=e.slice()}return e.sort((function(e,t){return"color"===t&&"color"!==e&&0===e.indexOf("color")?1:-1})),e},aO.dependsOn=function(e,t){return"color"===t?!(!e||0!==e.indexOf(t)):e===t},aO.findPieceIndex=function(e,t,i){for(var n,r=1/0,a=0,o=t.length;a<o;a++){var s=t[a].value;if(null!=s){if(s===e||"string"==typeof s&&s===e+"")return a;i&&c(s,a)}}for(a=0,o=t.length;a<o;a++){var l=t[a],u=l.interval,h=l.close;if(u){if(u[0]===-1/0){if(vO(h[1],e,u[1]))return a}else if(u[1]===1/0){if(vO(h[0],u[0],e))return a}else if(vO(h[0],u[0],e)&&vO(h[1],e,u[1]))return a;i&&c(u[0],a),i&&c(u[1],a)}}if(i)return e===1/0?t.length-1:e===-1/0?0:n;function c(t,i){var a=Math.abs(t-e);a<r&&(r=a,n=i)}};var yO=aO,_O=yO,xO=ut,bO=g,wO=bO.isArray;function TO(e,t,i,n){var r=e.getModel(),a=e.getLayout();if(a&&!a.invisible&&a.isInView){var o,s=e.getModel("itemStyle"),l=function(e,t,i){var n=bO.extend({},t),r=i.designatedVisualItemStyle;return bO.each(["color","colorAlpha","colorSaturation"],(function(i){r[i]=t[i];var a=e.get(i);r[i]=null,null!=a&&(n[i]=a)})),n}(s,t,n),u=s.get("borderColor"),h=s.get("borderColorSaturation");null!=h&&(u=function(e,t){return null!=t?xO.modifyHSL(t,null,null,e):null}(h,o=SO(l))),e.setVisual("borderColor",u);var c=e.viewChildren;if(c&&c.length){var d=function(e,t,i,n,r,a){if(a&&a.length){var o=AO(t,"color")||null!=r.color&&"none"!==r.color&&(AO(t,"colorAlpha")||AO(t,"colorSaturation"));if(o){var s=t.get("visualMin"),l=t.get("visualMax"),u=i.dataExtent.slice();null!=s&&s<u[0]&&(u[0]=s),null!=l&&l>u[1]&&(u[1]=l);var h=t.get("colorMappingBy"),c={type:o.name,dataExtent:u,visual:o.range};"color"!==c.type||"index"!==h&&"id"!==h?c.mappingMethod="linear":(c.mappingMethod="category",c.loop=!0);var d=new _O(c);return d.__drColorMappingBy=h,d}}}(0,r,a,0,l,c);bO.each(c,(function(e,t){if(e.depth>=i.length||e===i[e.depth]){var a=function(e,t,i,n,r,a){var o=bO.extend({},t);if(r){var s=r.type,l="color"===s&&r.__drColorMappingBy,u="index"===l?n:"id"===l?a.mapIdToIndex(i.getId()):i.getValue(e.get("visualDimension"));o[s]=r.mapValueToVisual(u)}return o}(r,l,e,t,d,n);TO(e,a,i,n)}}))}else o=SO(l),e.setVisual("color",o)}}function SO(e){var t=MO(e,"color");if(t){var i=MO(e,"colorAlpha"),n=MO(e,"colorSaturation");return n&&(t=xO.modifyHSL(t,null,null,n)),i&&(t=xO.modifyAlpha(t,i)),t}}function MO(e,t){var i=e[t];if(null!=i&&"none"!==i)return i}function AO(e,t){var i=e.get(t);return wO(i)&&i.length?{name:t,range:i}:null}var IO={seriesType:"treemap",reset:function(e,t,i,n){var r=e.getData().tree.root;r.isRemoved()||TO(r,{},e.getViewRoot().getAncestors(),e)}},CO=g,DO=Pi,EO=Uc,LO=EO.parsePercent,PO=EO.MAX_SAFE_INTEGER,NO=Hc,RO=iR,OO=Math.max,kO=Math.min,zO=CO.retrieve,BO=CO.each,FO=["itemStyle","borderWidth"],VO=["itemStyle","gapWidth"],GO=["upperLabel","show"],HO=["upperLabel","height"],UO={seriesType:"treemap",reset:function(e,t,i,n){var r=i.getWidth(),a=i.getHeight(),o=e.option,s=NO.getLayoutRect(e.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()}),l=o.size||[],u=LO(zO(s.width,l[0]),r),h=LO(zO(s.height,l[1]),a),c=n&&n.type,d=RO.retrieveTargetInfo(n,["treemapZoomToNode","treemapRootToNode"],e),f="treemapRender"===c||"treemapMove"===c?n.rootRect:null,p=e.getViewRoot(),g=RO.getPathToRoot(p);if("treemapMove"!==c){var m="treemapZoomToNode"===c?function(e,t,i,n,r){var a,o=(t||{}).node,s=[n,r];if(!o||o===i)return s;for(var l=n*r,u=l*e.option.zoomToNodeRatio;a=o.parentNode;){for(var h=0,c=a.children,d=0,f=c.length;d<f;d++)h+=c[d].getValue();var p=o.getValue();if(0===p)return s;u*=h/p;var g=a.getModel(),m=g.get(FO);(u+=4*m*m+(3*m+Math.max(m,qO(g)))*Math.pow(u,.5))>PO&&(u=PO),o=a}u<l&&(u=l);var v=Math.pow(u/l,.5);return[n*v,r*v]}(e,d,p,u,h):f?[f.width,f.height]:[u,h],v=o.sort;v&&"asc"!==v&&"desc"!==v&&(v="desc");var y={squareRatio:o.squareRatio,sort:v,leafDepth:o.leafDepth};p.hostTree.clearLayouts();var _={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};p.setLayout(_),WO(p,y,!1,0),_=p.getLayout(),BO(g,(function(e,t){var i=(g[t+1]||p).getValue();e.setLayout(CO.extend({dataExtent:[i,i],borderWidth:0,upperHeight:0},_))}))}var x=e.getData().tree.root;x.setLayout(function(e,t,i){if(t)return{x:t.x,y:t.y};var n={x:0,y:0};if(!i)return n;var r=i.node,a=r.getLayout();if(!a)return n;for(var o=[a.width/2,a.height/2],s=r;s;){var l=s.getLayout();o[0]+=l.x,o[1]+=l.y,s=s.parentNode}return{x:e.width/2-o[0],y:e.height/2-o[1]}}(s,f,d),!0),e.setLayoutInfo(s),ZO(x,new DO(-s.x,-s.y,r,a),g,p,0)}};function WO(e,t,i,n){var r,a;if(!e.isRemoved()){var o=e.getLayout();r=o.width,a=o.height;var s=(f=e.getModel()).get(FO),l=f.get(VO)/2,u=qO(f),h=Math.max(s,u),c=s-l,d=h-l,f=e.getModel();e.setLayout({borderWidth:s,upperHeight:h,upperLabelHeight:u},!0);var p=(r=OO(r-2*c,0))*(a=OO(a-c-d,0)),g=function(e,t,i,n,r,a){var o=e.children||[],s=n.sort;"asc"!==s&&"desc"!==s&&(s=null);var l=null!=n.leafDepth&&n.leafDepth<=a;if(r&&!l)return e.viewChildren=[];o=CO.filter(o,(function(e){return!e.isRemoved()})),function(e,t){t&&e.sort((function(e,i){var n="asc"===t?e.getValue()-i.getValue():i.getValue()-e.getValue();return 0===n?"asc"===t?e.dataIndex-i.dataIndex:i.dataIndex-e.dataIndex:n}))}(o,s);var u=function(e,t,i){for(var n=0,r=0,a=t.length;r<a;r++)n+=t[r].getValue();var o=e.get("visualDimension");if(t&&t.length)if("value"===o&&i)s=[t[t.length-1].getValue(),t[0].getValue()],"asc"===i&&s.reverse();else{var s=[1/0,-1/0];BO(t,(function(e){var t=e.getValue(o);t<s[0]&&(s[0]=t),t>s[1]&&(s[1]=t)}))}else s=[NaN,NaN];return{sum:n,dataExtent:s}}(t,o,s);if(0===u.sum)return e.viewChildren=[];if(u.sum=function(e,t,i,n,r){if(!n)return i;for(var a=e.get("visibleMin"),o=r.length,s=o,l=o-1;l>=0;l--){var u=r["asc"===n?o-l-1:l].getValue();u/i*t<a&&(s=l,i-=u)}return"asc"===n?r.splice(0,o-s):r.splice(s,o-s),i}(t,i,u.sum,s,o),0===u.sum)return e.viewChildren=[];for(var h=0,c=o.length;h<c;h++){var d=o[h].getValue()/u.sum*i;o[h].setLayout({area:d})}return l&&(o.length&&e.setLayout({isLeafRoot:!0},!0),o.length=0),e.viewChildren=o,e.setLayout({dataExtent:u.dataExtent},!0),o}(e,f,p,t,i,n);if(g.length){var m={x:c,y:d,width:r,height:a},v=kO(r,a),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 T=jO(_,v,t.squareRatio);T<=y?(x++,y=T):(_.area-=_.pop().getLayout().area,XO(_,v,m,l,!1),v=kO(m.width,m.height),_.length=_.area=0,y=1/0)}if(_.length&&XO(_,v,m,l,!0),!i){var S=f.get("childrenVisibleMin");null!=S&&p<S&&(i=!0)}for(x=0,b=g.length;x<b;x++)WO(g[x],t,i,n+1)}}}function jO(e,t,i){for(var n,r=0,a=1/0,o=0,s=e.length;o<s;o++)(n=e[o].getLayout().area)&&(n<a&&(a=n),n>r&&(r=n));var l=e.area*e.area,u=t*t*i;return l?OO(u*r/l,l/(u*a)):1/0}function XO(e,t,i,n,r){var a=t===i.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=i[s[a]],h=t?e.area/t:0;(r||h>i[l[o]])&&(h=i[l[o]]);for(var c=0,d=e.length;c<d;c++){var f=e[c],p={},g=h?f.getLayout().area/h:0,m=p[l[o]]=OO(h-2*n,0),v=i[s[a]]+i[l[a]]-u,y=c===d-1||v<g?v:g,_=p[l[a]]=OO(y-2*n,0);p[s[o]]=i[s[o]]+kO(n,m/2),p[s[a]]=u+kO(n,_/2),u+=y,f.setLayout(p,!0)}i[s[o]]+=h,i[l[o]]-=h}function ZO(e,t,i,n,r){var a=e.getLayout(),o=i[r],s=o&&o===e;if(!(o&&!s||r===i.length&&e!==n)){e.setLayout({isInView:!0,invisible:!s&&!t.intersect(a),isAboveViewRoot:s},!0);var l=new DO(t.x-a.x,t.y-a.y,t.width,t.height);BO(e.viewChildren||[],(function(e){ZO(e,l,i,n,r+1)}))}}function qO(e){return e.get(GO)?e.get(HO):0}var YO=h,KO=IO,QO=UO;YO.registerVisual(KO),YO.registerLayout(QO);var JO=g,$O=xo.enableClassCheck;function ek(e){return"_EC_"+e}var tk=function(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData},ik=tk.prototype;function nk(e,t){this.id=null==e?"":e,this.inEdges=[],this.outEdges=[],this.edges=[],this.hostGraph,this.dataIndex=null==t?-1:t}function rk(e,t,i){this.node1=e,this.node2=t,this.dataIndex=null==i?-1:i}ik.type="graph",ik.isDirected=function(){return this._directed},ik.addNode=function(e,t){e=null==e?""+t:""+e;var i=this._nodesMap;if(!i[ek(e)]){var n=new nk(e,t);return n.hostGraph=this,this.nodes.push(n),i[ek(e)]=n,n}},ik.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},ik.getNodeById=function(e){return this._nodesMap[ek(e)]},ik.addEdge=function(e,t,i){var n=this._nodesMap,r=this._edgesMap;if("number"==typeof e&&(e=this.nodes[e]),"number"==typeof t&&(t=this.nodes[t]),nk.isInstance(e)||(e=n[ek(e)]),nk.isInstance(t)||(t=n[ek(t)]),e&&t){var a=e.id+"-"+t.id,o=new rk(e,t,i);return o.hostGraph=this,this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),r[a]=o,o}},ik.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},ik.getEdge=function(e,t){nk.isInstance(e)&&(e=e.id),nk.isInstance(t)&&(t=t.id);var i=this._edgesMap;return this._directed?i[e+"-"+t]:i[e+"-"+t]||i[t+"-"+e]},ik.eachNode=function(e,t){for(var i=this.nodes,n=i.length,r=0;r<n;r++)i[r].dataIndex>=0&&e.call(t,i[r],r)},ik.eachEdge=function(e,t){for(var i=this.edges,n=i.length,r=0;r<n;r++)i[r].dataIndex>=0&&i[r].node1.dataIndex>=0&&i[r].node2.dataIndex>=0&&e.call(t,i[r],r)},ik.breadthFirstTraverse=function(e,t,i,n){if(nk.isInstance(t)||(t=this._nodesMap[ek(t)]),t){for(var r="out"===i?"outEdges":"in"===i?"inEdges":"edges",a=0;a<this.nodes.length;a++)this.nodes[a].__visited=!1;if(!e.call(n,t,null))for(var o=[t];o.length;){var s=o.shift(),l=s[r];for(a=0;a<l.length;a++){var u=l[a],h=u.node1===s?u.node2:u.node1;if(!h.__visited){if(e.call(n,h,s))return;o.push(h),h.__visited=!0}}}}},ik.update=function(){for(var e=this.data,t=this.edgeData,i=this.nodes,n=this.edges,r=0,a=i.length;r<a;r++)i[r].dataIndex=-1;for(r=0,a=e.count();r<a;r++)i[e.getRawIndex(r)].dataIndex=r;for(t.filterSelf((function(e){var i=n[t.getRawIndex(e)];return i.node1.dataIndex>=0&&i.node2.dataIndex>=0})),r=0,a=n.length;r<a;r++)n[r].dataIndex=-1;for(r=0,a=t.count();r<a;r++)n[t.getRawIndex(r)].dataIndex=r},ik.clone=function(){for(var e=new tk(this._directed),t=this.nodes,i=this.edges,n=0;n<t.length;n++)e.addNode(t[n].id,t[n].dataIndex);for(n=0;n<i.length;n++){var r=i[n];e.addEdge(r.node1.id,r.node2.id,r.dataIndex)}return e},nk.prototype={constructor:nk,degree:function(){return this.edges.length},inDegree:function(){return this.inEdges.length},outDegree:function(){return this.outEdges.length},getModel:function(e){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(e)}},rk.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)};var ak=function(e,t){return{getValue:function(i){var n=this[e][t];return n.get(n.getDimension(i||"value"),this.dataIndex)},setVisual:function(i,n){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,i,n)},getVisual:function(i,n){return this[e][t].getItemVisual(this.dataIndex,i,n)},setLayout:function(i,n){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,i,n)},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)}}};JO.mixin(nk,ak("hostGraph","data")),JO.mixin(rk,ak("hostGraph","edgeData")),tk.Node=nk,tk.Edge=rk,$O(nk),$O(rk);var ok=g,sk=A_,lk=tk,uk=nN,hk=X_,ck=sp,dk=vx,fk=function(e,t,i,n,r){for(var a=new lk(n),o=0;o<e.length;o++)a.addNode(ok.retrieve(e[o].id,e[o].name,o),o);var s=[],l=[],u=0;for(o=0;o<t.length;o++){var h=t[o],c=h.source,d=h.target;a.addEdge(c,d,u)&&(l.push(h),s.push(ok.retrieve(h.id,c+" > "+d)),u++)}var f,p=i.get("coordinateSystem");if("cartesian2d"===p||"polar"===p)f=dk(e,i);else{var g=ck.get(p),m=g&&"view"!==g.type&&g.dimensions||[];ok.indexOf(m,"value")<0&&m.concat(["value"]);var v=hk(e,{coordDimensions:m});(f=new sk(v,i)).initData(e)}var y=new sk(["value"],i);return y.initData(l,s),r&&r(f,y),uk({mainData:f,struct:a,structAttr:"graph",datas:{node:f,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a},pk={},gk=g,mk="--\x3e",vk=function(e){return e.get("autoCurveness")||null},yk=function(e,t){var i=vk(e),n=20,r=[];if("number"==typeof i)n=i;else if(gk.isArray(i))return void(e.__curvenessList=i);t>n&&(n=t);var a=n%2?n+2:n+3;r=[];for(var o=0;o<a;o++)r.push((o%2?o+1:o)/10*(o%2?-1:1));e.__curvenessList=r},_k=function(e,t,i){var n=[e.id,e.dataIndex].join("."),r=[t.id,t.dataIndex].join(".");return[i.uid,n,r].join(mk)},xk=function(e){var t=e.split(mk);return[t[0],t[2],t[1]].join(mk)},bk=function(e,t){var i=t.__edgeMap;return i[e]?i[e].length:0};pk.initCurvenessList=function(e){vk(e)&&(e.__curvenessList=[],e.__edgeMap={},yk(e))},pk.createEdgeMapForCurveness=function(e,t,i,n){if(vk(i)){var r=_k(e,t,i),a=i.__edgeMap,o=a[xk(r)];a[r]&&!o?a[r].isForward=!0:o&&a[r]&&(o.isForward=!0,a[r].isForward=!1),a[r]=a[r]||[],a[r].push(n)}},pk.getCurvenessForEdge=function(e,t,i,n){var r=vk(t),a=gk.isArray(r);if(!r)return null;var o=function(e,t){var i=_k(e.node1,e.node2,t);return t.__edgeMap[i]}(e,t);if(!o)return null;for(var s=-1,l=0;l<o.length;l++)if(o[l]===i){s=l;break}var u=function(e,t){return bk(_k(e.node1,e.node2,t),t)+bk(_k(e.node2,e.node1,t),t)}(e,t);yk(t,u),e.lineStyle=e.lineStyle||{};var h=_k(e.node1,e.node2,t),c=t.__curvenessList,d=a||u%2?0:1;if(o.isForward)return c[d+s];var f=xk(h),p=bk(f,t),g=c[s+p+d];return n?a?r&&0===r[0]?(p+d)%2?g:-g:((p%2?0:1)+d)%2?g:-g:(p+d)%2?g:-g:c[s+p+d]};var wk=h,Tk=A_,Sk=g,Mk=lo.defaultEmphasis,Ak=zc,Ik=qc.encodeHTML,Ck=fk,Dk=IC,Ek=pk,Lk=Ek.initCurvenessList,Pk=Ek.createEdgeMapForCurveness,Nk=wk.extendSeriesModel({type:"series.graph",init:function(e){Nk.superApply(this,"init",arguments);var t=this;function i(){return t._categoriesData}this.legendVisualProvider=new Dk(i,i),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},mergeOption:function(e){Nk.superApply(this,"mergeOption",arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},mergeDefaultAndTheme:function(e){Nk.superApply(this,"mergeDefaultAndTheme",arguments),Mk(e,["edgeLabel"],["show"])},getInitialData:function(e,t){var i=e.edges||e.links||[],n=e.data||e.nodes||[],r=this;if(n&&i){Lk(this);var a=Ck(n,i,this,!0,(function(e,i){e.wrapMethod("getItemModel",(function(e){var t=r._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));var n=r.getModel("edgeLabel"),a=new Ak({label:n.option},n.parentModel,t),o=r.getModel("emphasis.edgeLabel"),s=new Ak({emphasis:{label:o.option}},o.parentModel,t);function l(e){return(e=this.parsePath(e))&&"label"===e[0]?a:e&&"emphasis"===e[0]&&"label"===e[1]?s:this.parentModel}i.wrapMethod("getItemModel",(function(e){return e.customizeGetParent(l),e}))}));return Sk.each(a.edges,(function(e){Pk(e.node1,e.node2,this,e.dataIndex)}),this),a.data}},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(e,t,i){if("edge"===i){var n=this.getData(),r=this.getDataParams(e,i),a=n.graph.getEdgeByIndex(e),o=n.getName(a.node1.dataIndex),s=n.getName(a.node2.dataIndex),l=[];return null!=o&&l.push(o),null!=s&&l.push(s),l=Ik(l.join(" > ")),r.value&&(l+=" : "+Ik(r.value)),l}return Nk.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var e=Sk.map(this.option.categories||[],(function(e){return null!=e.value?e:Sk.extend({value:0},e)})),t=new Tk(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e,!0)}))},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},isAnimationEnabled:function(){return Nk.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,hoverAnimation:!0,layout:null,focusNodeAdjacency:!1,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:{label:{show:!0}}}}),Rk=No,Ok=V,kk=Rk.Line.prototype,zk=Rk.BezierCurve.prototype;function Bk(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}var Fk=Rk.extendShape({type:"ec-line",style:{stroke:"#000",fill:null},shape:{x1:0,y1:0,x2:0,y2:0,percent:1,cpx1:null,cpy1:null},buildPath:function(e,t){this[Bk(t)?"_buildPathLine":"_buildPathCurve"](e,t)},_buildPathLine:kk.buildPath,_buildPathCurve:zk.buildPath,pointAt:function(e){return this[Bk(this.shape)?"_pointAtLine":"_pointAtCurve"](e)},_pointAtLine:kk.pointAt,_pointAtCurve:zk.pointAt,tangentAt:function(e){var t=this.shape,i=Bk(t)?[t.x2-t.x1,t.y2-t.y1]:this._tangentAtCurve(e);return Ok.normalize(i,i)},_tangentAtCurve:zk.tangentAt}),Vk=g,Gk=V,Hk=ow,Uk=Fk,Wk=No,jk=Uc.round,Xk=["fromSymbol","toSymbol"];function Zk(e){return"_"+e+"Type"}function qk(e,t,i){var n=t.getItemVisual(i,e);if(n&&"none"!==n){var r=t.getItemVisual(i,"color"),a=t.getItemVisual(i,e+"Size"),o=t.getItemVisual(i,e+"Rotate");Vk.isArray(a)||(a=[a,a]);var s=Hk.createSymbol(n,-a[0]/2,-a[1]/2,a[0],a[1],r);return s.__specifiedRotation=null==o||isNaN(o)?void 0:+o*Math.PI/180||0,s.name=e,s}}function Yk(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 i=t[2];i?(e.cpx1=i[0],e.cpy1=i[1]):(e.cpx1=NaN,e.cpy1=NaN)}function Kk(e,t,i){Wk.Group.call(this),this._createLine(e,t,i)}var Qk=Kk.prototype;Qk.beforeUpdate=function(){var e=this,t=e.childOfName("fromSymbol"),i=e.childOfName("toSymbol"),n=e.childOfName("label");if(t||i||!n.ignore){for(var r=1,a=this.parent;a;)a.scale&&(r/=a.scale[0]),a=a.parent;var o=e.childOfName("line");if(this.__dirty||o.__dirty){var s,l=o.shape.percent,u=o.pointAt(0),h=o.pointAt(l),c=Gk.sub([],h,u);if(Gk.normalize(c,c),t){if(t.attr("position",u),null==(s=t.__specifiedRotation)){var d=o.tangentAt(0);t.attr("rotation",Math.PI/2-Math.atan2(d[1],d[0]))}else t.attr("rotation",s);t.attr("scale",[r*l,r*l])}if(i)i.attr("position",h),null==(s=i.__specifiedRotation)?(d=o.tangentAt(1),i.attr("rotation",-Math.PI/2-Math.atan2(d[1],d[0]))):i.attr("rotation",s),i.attr("scale",[r*l,r*l]);if(!n.ignore){var f,p,g,m;n.attr("position",h);var v=n.__labelDistance,y=v[0]*r,_=v[1]*r,x=l/2,b=[(d=o.tangentAt(x))[1],-d[0]],w=o.pointAt(x);b[1]>0&&(b[0]=-b[0],b[1]=-b[1]);var T,S=d[0]<0?-1:1;if("start"!==n.__position&&"end"!==n.__position){var M=-Math.atan2(d[1],d[0]);h[0]<u[0]&&(M=Math.PI+M),n.attr("rotation",M)}switch(n.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":T=-_,g="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":T=_,g="top";break;default:T=0,g="middle"}switch(n.__position){case"end":f=[c[0]*y+h[0],c[1]*_+h[1]],p=c[0]>.8?"left":c[0]<-.8?"right":"center",g=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":f=[-c[0]*y+u[0],-c[1]*_+u[1]],p=c[0]>.8?"right":c[0]<-.8?"left":"center",g=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":f=[y*S+u[0],u[1]+T],p=d[0]<0?"right":"left",m=[-y*S,-T];break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":f=[w[0],w[1]+T],p="center",m=[0,-T];break;case"insideEndTop":case"insideEnd":case"insideEndBottom":f=[-y*S+h[0],h[1]+T],p=d[0]>=0?"right":"left",m=[y*S,-T]}n.attr({style:{textVerticalAlign:n.__verticalAlign||g,textAlign:n.__textAlign||p},position:f,scale:[r,r],origin:m})}}}},Qk._createLine=function(e,t,i){var n=e.hostModel,r=function(e){var t=new Uk({name:"line",subPixelOptimize:!0});return Yk(t.shape,e),t}(e.getItemLayout(t));r.shape.percent=0,Wk.initProps(r,{shape:{percent:1}},n,t),this.add(r);var a=new Wk.Text({name:"label",lineLabelOriginalOpacity:1});this.add(a),Vk.each(Xk,(function(i){var n=qk(i,e,t);this.add(n),this[Zk(i)]=e.getItemVisual(t,i)}),this),this._updateCommonStl(e,t,i)},Qk.updateData=function(e,t,i){var n=e.hostModel,r=this.childOfName("line"),a=e.getItemLayout(t),o={shape:{}};Yk(o.shape,a),Wk.updateProps(r,o,n,t),Vk.each(Xk,(function(i){var n=e.getItemVisual(t,i),r=Zk(i);if(this[r]!==n){this.remove(this.childOfName(i));var a=qk(i,e,t);this.add(a)}this[r]=n}),this),this._updateCommonStl(e,t,i)},Qk._updateCommonStl=function(e,t,i){var n=e.hostModel,r=this.childOfName("line"),a=i&&i.lineStyle,o=i&&i.hoverLineStyle,s=i&&i.labelModel,l=i&&i.hoverLabelModel;if(!i||e.hasItemOption){var u=e.getItemModel(t);a=u.getModel("lineStyle").getLineStyle(),o=u.getModel("emphasis.lineStyle").getLineStyle(),s=u.getModel("label"),l=u.getModel("emphasis.label")}var h=e.getItemVisual(t,"color"),c=Vk.retrieve3(e.getItemVisual(t,"opacity"),a.opacity,1);r.useStyle(Vk.defaults({strokeNoScale:!0,fill:"none",stroke:h,opacity:c},a)),r.hoverStyle=o,Vk.each(Xk,(function(e){var t=this.childOfName(e);t&&(t.setColor(h),t.setStyle({opacity:c}))}),this);var d,f,p=s.getShallow("show"),g=l.getShallow("show"),m=this.childOfName("label");if((p||g)&&(d=h||"#000",null==(f=n.getFormattedLabel(t,"normal",e.dataType)))){var v=n.getRawValue(t);f=null==v?e.getName(t):isFinite(v)?jk(v):v}var y=p?f:null,_=g?Vk.retrieve2(n.getFormattedLabel(t,"emphasis",e.dataType),f):null,x=m.style;if(null!=y||null!=_){Wk.setTextStyle(m.style,s,{text:y},{autoColor:d}),m.__textAlign=x.textAlign,m.__verticalAlign=x.textVerticalAlign,m.__position=s.get("position")||"middle";var b=s.get("distance");Vk.isArray(b)||(b=[b,b]),m.__labelDistance=b}m.hoverStyle=null!=_?{text:_,textFill:l.getTextColor(!0),fontStyle:l.getShallow("fontStyle"),fontWeight:l.getShallow("fontWeight"),fontSize:l.getShallow("fontSize"),fontFamily:l.getShallow("fontFamily")}:{text:null},m.ignore=!p&&!g,Wk.setHoverStyle(this)},Qk.highlight=function(){this.trigger("emphasis")},Qk.downplay=function(){this.trigger("normal")},Qk.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},Qk.setLinePoints=function(e){var t=this.childOfName("line");Yk(t.shape,e),t.dirty()},Vk.inherits(Kk,Wk.Group);var Jk=Kk,$k=No,ez=Jk;function tz(e){this._ctor=e||ez,this.group=new $k.Group}var iz=tz.prototype;function nz(e){var t=e.hostModel;return{lineStyle:t.getModel("lineStyle").getLineStyle(),hoverLineStyle:t.getModel("emphasis.lineStyle").getLineStyle(),labelModel:t.getModel("label"),hoverLabelModel:t.getModel("emphasis.label")}}function rz(e){return isNaN(e[0])||isNaN(e[1])}function az(e){return!rz(e[0])&&!rz(e[1])}iz.isPersistent=function(){return!0},iz.updateData=function(e){var t=this,i=t.group,n=t._lineData;t._lineData=e,n||i.removeAll();var r=nz(e);e.diff(n).add((function(i){!function(e,t,i,n){if(az(t.getItemLayout(i))){var r=new e._ctor(t,i,n);t.setItemGraphicEl(i,r),e.group.add(r)}}(t,e,i,r)})).update((function(i,a){!function(e,t,i,n,r,a){var o=t.getItemGraphicEl(n);az(i.getItemLayout(r))?(o?o.updateData(i,r,a):o=new e._ctor(i,r,a),i.setItemGraphicEl(r,o),e.group.add(o)):e.group.remove(o)}(t,n,e,a,i,r)})).remove((function(e){i.remove(n.getItemGraphicEl(e))})).execute()},iz.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl((function(t,i){t.updateLayout(e,i)}),this)},iz.incrementalPrepareUpdate=function(e){this._seriesScope=nz(e),this._lineData=null,this.group.removeAll()},iz.incrementalUpdate=function(e,t){function i(e){e.isGroup||function(e){return e.animators&&e.animators.length>0}(e)||(e.incremental=e.useHoverLayer=!0)}for(var n=e.start;n<e.end;n++)if(az(t.getItemLayout(n))){var r=new this._ctor(t,n,this._seriesScope);r.traverse(i),this.group.add(r),t.setItemGraphicEl(n,r)}},iz.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},iz._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var oz=tz,sz={getNodeGlobalScale:function(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var i=e.option.nodeScaleRatio,n=t.scale,r=n&&n[0]||1;return((t.getZoom()-1)*i+1)/r},getSymbolSize:function(e){var t=e.getVisual("symbolSize");return t instanceof Array&&(t=(t[0]+t[1])/2),+t}},lz=Oo,uz=V,hz=sz.getSymbolSize,cz=[],dz=[],fz=[],pz=lz.quadraticAt,gz=uz.distSquare,mz=Math.abs;function vz(e,t,i){for(var n,r=e[0],a=e[1],o=e[2],s=1/0,l=i*i,u=.1,h=.1;h<=.9;h+=.1)cz[0]=pz(r[0],a[0],o[0],h),cz[1]=pz(r[1],a[1],o[1],h),(f=mz(gz(cz,t)-l))<s&&(s=f,n=h);for(var c=0;c<32;c++){var d=n+u;dz[0]=pz(r[0],a[0],o[0],n),dz[1]=pz(r[1],a[1],o[1],n),fz[0]=pz(r[0],a[0],o[0],d),fz[1]=pz(r[1],a[1],o[1],d);var f=gz(dz,t)-l;if(mz(f)<.01)break;var p=gz(fz,t)-l;u/=2,f<0?p>=0?n+=u:n-=u:p>=0?n-=u:n+=u}return n}var yz=function(e,t){var i=[],n=lz.quadraticSubdivide,r=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge((function(e,s){var l=e.getLayout(),u=e.getVisual("fromSymbol"),h=e.getVisual("toSymbol");l.__original||(l.__original=[uz.clone(l[0]),uz.clone(l[1])],l[2]&&l.__original.push(uz.clone(l[2])));var c=l.__original;if(null!=l[2]){if(uz.copy(r[0],c[0]),uz.copy(r[1],c[2]),uz.copy(r[2],c[1]),u&&"none"!==u){var d=hz(e.node1),f=vz(r,c[0],d*t);n(r[0][0],r[1][0],r[2][0],f,i),r[0][0]=i[3],r[1][0]=i[4],n(r[0][1],r[1][1],r[2][1],f,i),r[0][1]=i[3],r[1][1]=i[4]}h&&"none"!==h&&(d=hz(e.node2),f=vz(r,c[1],d*t),n(r[0][0],r[1][0],r[2][0],f,i),r[1][0]=i[1],r[2][0]=i[2],n(r[0][1],r[1][1],r[2][1],f,i),r[1][1]=i[1],r[2][1]=i[2]),uz.copy(l[0],r[0]),uz.copy(l[1],r[2]),uz.copy(l[2],r[1])}else uz.copy(a[0],c[0]),uz.copy(a[1],c[1]),uz.sub(o,a[1],a[0]),uz.normalize(o,o),u&&"none"!==u&&(d=hz(e.node1),uz.scaleAndAdd(a[0],a[0],o,d*t)),h&&"none"!==h&&(d=hz(e.node2),uz.scaleAndAdd(a[1],a[1],o,-d*t)),uz.copy(l[0],a[0]),uz.copy(l[1],a[1])}))},_z=h,xz=g,bz=pS,wz=oz,Tz=kL,Sz=zL,Mz=BL.onIrrelevantElement,Az=No,Iz=yz,Cz=sz.getNodeGlobalScale,Dz="__focusNodeAdjacency",Ez="__unfocusNodeAdjacency",Lz=["itemStyle","opacity"],Pz=["lineStyle","opacity"];function Nz(e,t){var i=e.getVisual("opacity");return null!=i?i:e.getModel().get(t)}function Rz(e,t,i){var n=e.getGraphicEl(),r=Nz(e,t);null!=i&&(null==r&&(r=1),r*=i),n.downplay&&n.downplay(),n.traverse((function(e){if(!e.isGroup){var t=e.lineLabelOriginalOpacity;null!=t&&null==i||(t=r),e.setStyle("opacity",t)}}))}function Oz(e,t){var i=Nz(e,t),n=e.getGraphicEl();n.traverse((function(e){!e.isGroup&&e.setStyle("opacity",i)})),n.highlight&&n.highlight()}_z.extendChartView({type:"graph",init:function(e,t){var i=new bz,n=new wz,r=this.group;this._controller=new Tz(t.getZr()),this._controllerHost={target:r},r.add(i.group),r.add(n.group),this._symbolDraw=i,this._lineDraw=n,this._firstRender=!0},render:function(e,t,i){var n=this,r=e.coordinateSystem;this._model=e;var a=this._symbolDraw,o=this._lineDraw,s=this.group;if("view"===r.type){var l={position:r.position,scale:r.scale};this._firstRender?s.attr(l):Az.updateProps(s,l,e)}Iz(e.getGraph(),Cz(e));var u=e.getData();a.updateData(u);var h=e.getEdgeData();o.updateData(h),this._updateNodeAndLinkScale(),this._updateController(e,t,i),clearTimeout(this._layoutTimeout);var c=e.forceLayout,d=e.get("force.layoutAnimation");c&&this._startForceLayoutIteration(c,d),u.eachItemGraphicEl((function(t,r){var a=u.getItemModel(r);t.off("drag").off("dragend");var o=a.get("draggable");o&&t.on("drag",(function(){c&&(c.warmUp(),!this._layouting&&this._startForceLayoutIteration(c,d),c.setFixed(r),u.setItemLayout(r,t.position))}),this).on("dragend",(function(){c&&c.setUnfixed(r)}),this),t.setDraggable(o&&c),t[Dz]&&t.off("mouseover",t[Dz]),t[Ez]&&t.off("mouseout",t[Ez]),a.get("focusNodeAdjacency")&&(t.on("mouseover",t[Dz]=function(){n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,dataIndex:t.dataIndex})}),t.on("mouseout",t[Ez]=function(){n._dispatchUnfocus(i)}))}),this),u.graph.eachEdge((function(t){var r=t.getGraphicEl();r[Dz]&&r.off("mouseover",r[Dz]),r[Ez]&&r.off("mouseout",r[Ez]),t.getModel().get("focusNodeAdjacency")&&(r.on("mouseover",r[Dz]=function(){n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,edgeDataIndex:t.dataIndex})}),r.on("mouseout",r[Ez]=function(){n._dispatchUnfocus(i)}))}));var f="circular"===e.get("layout")&&e.get("circular.rotateLabel"),p=u.getLayout("cx"),g=u.getLayout("cy");u.eachItemGraphicEl((function(e,t){var i=u.getItemModel(t).get("label.rotate")||0,n=e.getSymbolPath();if(f){var r=u.getItemLayout(t),a=Math.atan2(r[1]-g,r[0]-p);a<0&&(a=2*Math.PI+a);var o=r[0]<p;o&&(a-=Math.PI);var s=o?"left":"right";Az.modifyLabelStyle(n,{textRotation:-a,textPosition:s,textOrigin:"center"},{textPosition:s})}else Az.modifyLabelStyle(n,{textRotation:i*=Math.PI/180})})),this._firstRender=!1},dispose:function(){this._controller&&this._controller.dispose(),this._controllerHost={},this._clearTimer()},_dispatchUnfocus:function(e,t){var i=this;this._clearTimer(),this._unfocusDelayTimer=setTimeout((function(){i._unfocusDelayTimer=null,e.dispatchAction({type:"unfocusNodeAdjacency",seriesId:i._model.id})}),500)},_clearTimer:function(){this._unfocusDelayTimer&&(clearTimeout(this._unfocusDelayTimer),this._unfocusDelayTimer=null)},focusNodeAdjacency:function(e,t,i,n){var r=e.getData().graph,a=n.dataIndex,o=n.edgeDataIndex,s=r.getNodeByIndex(a),l=r.getEdgeByIndex(o);(s||l)&&(r.eachNode((function(e){Rz(e,Lz,.1)})),r.eachEdge((function(e){Rz(e,Pz,.1)})),s&&(Oz(s,Lz),xz.each(s.edges,(function(e){e.dataIndex<0||(Oz(e,Pz),Oz(e.node1,Lz),Oz(e.node2,Lz))}))),l&&(Oz(l,Pz),Oz(l.node1,Lz),Oz(l.node2,Lz)))},unfocusNodeAdjacency:function(e,t,i,n){var r=e.getData().graph;r.eachNode((function(e){Rz(e,Lz)})),r.eachEdge((function(e){Rz(e,Pz)}))},_startForceLayoutIteration:function(e,t){var i=this;!function n(){e.step((function(e){i.updateLayout(i._model),(i._layouting=!e)&&(t?i._layoutTimeout=setTimeout(n,16):n())}))}()},_updateController:function(e,t,i){var n=this._controller,r=this._controllerHost,a=this.group;n.setPointerChecker((function(t,n,r){var o=a.getBoundingRect();return o.applyTransform(a.transform),o.contain(n,r)&&!Mz(t,i,e)})),"view"===e.coordinateSystem.type?(n.enable(e.get("roam")),r.zoomLimit=e.get("scaleLimit"),r.zoom=e.coordinateSystem.getZoom(),n.off("pan").off("zoom").on("pan",(function(t){Sz.updateViewOnPan(r,t.dx,t.dy),i.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){Sz.updateViewOnZoom(r,t.scale,t.originX,t.originY),i.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),this._updateNodeAndLinkScale(),Iz(e.getGraph(),Cz(e)),this._lineDraw.updateLayout()}),this)):n.disable()},_updateNodeAndLinkScale:function(){var e=this._model,t=e.getData(),i=Cz(e),n=[i,i];t.eachItemGraphicEl((function(e,t){e.attr("scale",n)}))},updateLayout:function(e){Iz(e.getGraph(),Cz(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},remove:function(e,t){this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()}});var kz=h;kz.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},(function(){})),kz.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},(function(){}));var zz=h,Bz=rP.updateCenterAndZoom;zz.registerAction({type:"graphRoam",event:"graphRoam",update:"none"},(function(e,t){t.eachComponent({mainType:"series",query:e},(function(t){var i=t.coordinateSystem,n=Bz(i,e);t.setCenter&&t.setCenter(n.center),t.setZoom&&t.setZoom(n.zoom)}))}));var Fz=function(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.eachSeriesByType("graph",(function(e){var i=e.getCategoriesData(),n=e.getGraph().data,r=i.mapArray(i.getName);n.filterSelf((function(e){var i=n.getItemModel(e).getShallow("category");if(null!=i){"number"==typeof i&&(i=r[i]);for(var a=0;a<t.length;a++)if(!t[a].isSelected(i))return!1}return!0}))}),this)},Vz=function(e){var t={};e.eachSeriesByType("graph",(function(e){var i=e.getCategoriesData(),n=e.getData(),r={};i.each((function(n){var a=i.getName(n);r["ec-"+a]=n;var o=i.getItemModel(n),s=o.get("itemStyle.color")||e.getColorFromPalette(a,t);i.setItemVisual(n,"color",s);for(var l=["opacity","symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++){var h=o.getShallow(l[u],!0);null!=h&&i.setItemVisual(n,l[u],h)}})),i.count()&&n.each((function(e){var t=n.getItemModel(e).getShallow("category");if(null!=t){"string"==typeof t&&(t=r["ec-"+t]);for(var a=["color","opacity","symbol","symbolSize","symbolKeepAspect"],o=0;o<a.length;o++)null==n.getItemVisual(e,a[o],!0)&&n.setItemVisual(e,a[o],i.getItemVisual(t,a[o]))}}))}))};function Gz(e){return e instanceof Array||(e=[e,e]),e}var Hz=function(e){e.eachSeriesByType("graph",(function(e){var t=e.getGraph(),i=e.getEdgeData(),n=Gz(e.get("edgeSymbol")),r=Gz(e.get("edgeSymbolSize")),a="lineStyle.color".split("."),o="lineStyle.opacity".split(".");i.setVisual("fromSymbol",n&&n[0]),i.setVisual("toSymbol",n&&n[1]),i.setVisual("fromSymbolSize",r&&r[0]),i.setVisual("toSymbolSize",r&&r[1]),i.setVisual("color",e.get(a)),i.setVisual("opacity",e.get(o)),i.each((function(e){var n=i.getItemModel(e),r=t.getEdgeByIndex(e),s=Gz(n.getShallow("symbol",!0)),l=Gz(n.getShallow("symbolSize",!0)),u=n.get(a),h=n.get(o);switch(u){case"source":u=r.node1.getVisual("color");break;case"target":u=r.node2.getVisual("color")}s[0]&&r.setVisual("fromSymbol",s[0]),s[1]&&r.setVisual("toSymbol",s[1]),l[0]&&r.setVisual("fromSymbolSize",l[0]),l[1]&&r.setVisual("toSymbolSize",l[1]),r.setVisual("color",u),r.setVisual("opacity",h)}))}))},Uz={},Wz=V,jz=g,Xz=pk.getCurvenessForEdge;function Zz(e,t){e.eachEdge((function(e,i){var n=jz.retrieve3(e.getModel().get("lineStyle.curveness"),-Xz(e,t,i,!0),0),r=Wz.clone(e.node1.getLayout()),a=Wz.clone(e.node2.getLayout()),o=[r,a];+n&&o.push([(r[0]+a[0])/2-(r[1]-a[1])*n,(r[1]+a[1])/2-(a[0]-r[0])*n]),e.setLayout(o)}))}Uz.simpleLayout=function(e){var t=e.coordinateSystem;if(!t||"view"===t.type){var i=e.getGraph();i.eachNode((function(e){var t=e.getModel();e.setLayout([+t.get("x"),+t.get("y")])})),Zz(i,e)}},Uz.simpleLayoutEdge=Zz;var qz=g.each,Yz=Uz,Kz=Yz.simpleLayout,Qz=Yz.simpleLayoutEdge,Jz=function(e,t){e.eachSeriesByType("graph",(function(e){var t=e.get("layout"),i=e.coordinateSystem;if(i&&"view"!==i.type){var n=e.getData(),r=[];qz(i.dimensions,(function(e){r=r.concat(n.mapDimension(e,!0))}));for(var a=0;a<n.count();a++){for(var o=[],s=!1,l=0;l<r.length;l++){var u=n.get(r[l],a);isNaN(u)||(s=!0),o.push(u)}s?n.setItemLayout(a,i.dataToPoint(o)):n.setItemLayout(a,[NaN,NaN])}Qz(n.graph,e)}else t&&"none"!==t||Kz(e)}))},$z={},eB=V,tB=sz,iB=tB.getSymbolSize,nB=tB.getNodeGlobalScale,rB=g,aB=pk.getCurvenessForEdge,oB=Math.PI,sB=[],lB={value:function(e,t,i,n,r,a,o,s){var l=0,u=n.getSum("value"),h=2*Math.PI/(u||s);i.eachNode((function(e){var t=e.getValue("value"),i=h*(u?t:1)/2;l+=i,e.setLayout([r*Math.cos(l)+a,r*Math.sin(l)+o]),l+=i}))},symbolSize:function(e,t,i,n,r,a,o,s){var l=0;sB.length=s;var u=nB(e);i.eachNode((function(e){var t=iB(e);isNaN(t)&&(t=2),t<0&&(t=0),t*=u;var i=Math.asin(t/2/r);isNaN(i)&&(i=oB/2),sB[e.dataIndex]=i,l+=2*i}));var h=(2*oB-l)/s/2,c=0;i.eachNode((function(e){var t=h+sB[e.dataIndex];c+=t,e.setLayout([r*Math.cos(c)+a,r*Math.sin(c)+o]),c+=t}))}};$z.circularLayout=function(e,t){var i=e.coordinateSystem;if(!i||"view"===i.type){var n=i.getBoundingRect(),r=e.getData(),a=r.graph,o=n.width/2+n.x,s=n.height/2+n.y,l=Math.min(n.width,n.height)/2,u=r.count();r.setLayout({cx:o,cy:s}),u&&(lB[t](e,i,a,r,l,o,s,u),a.eachEdge((function(t,i){var n,r=rB.retrieve3(t.getModel().get("lineStyle.curveness"),aB(t,e,i),0),a=eB.clone(t.node1.getLayout()),l=eB.clone(t.node2.getLayout()),u=(a[0]+l[0])/2,h=(a[1]+l[1])/2;+r&&(n=[o*(r*=3)+u*(1-r),s*r+h*(1-r)]),t.setLayout([a,l,n])})))}};var uB=$z.circularLayout,hB=function(e){e.eachSeriesByType("graph",(function(e){"circular"===e.get("layout")&&uB(e,"symbolSize")}))},cB={},dB=V,fB=dB.scaleAndAdd;cB.forceLayout=function(e,t,i){for(var n=i.rect,r=n.width,a=n.height,o=[n.x+r/2,n.y+a/2],s=null==i.gravity?.1:i.gravity,l=0;l<e.length;l++){var u=e[l];u.p||(u.p=dB.create(r*(Math.random()-.5)+o[0],a*(Math.random()-.5)+o[1])),u.pp=dB.clone(u.p),u.edges=null}var h=null==i.friction?.6:i.friction,c=h;return{warmUp:function(){c=.8*h},setFixed:function(t){e[t].fixed=!0},setUnfixed:function(t){e[t].fixed=!1},step:function(i){for(var n=[],r=e.length,a=0;a<t.length;a++){var l=t[a];if(!l.ignoreForceLayout){var u=l.n1,h=l.n2;dB.sub(n,h.p,u.p);var d=dB.len(n)-l.d,f=h.w/(u.w+h.w);isNaN(f)&&(f=0),dB.normalize(n,n),!u.fixed&&fB(u.p,u.p,n,f*d*c),!h.fixed&&fB(h.p,h.p,n,-(1-f)*d*c)}}for(a=0;a<r;a++)(v=e[a]).fixed||(dB.sub(n,o,v.p),fB(v.p,v.p,n,s*c));for(a=0;a<r;a++){u=e[a];for(var p=a+1;p<r;p++){h=e[p],dB.sub(n,h.p,u.p),0===(d=dB.len(n))&&(dB.set(n,Math.random()-.5,Math.random()-.5),d=1);var g=(u.rep+h.rep)/d/d;!u.fixed&&fB(u.pp,u.pp,n,g),!h.fixed&&fB(h.pp,h.pp,n,-g)}}var m=[];for(a=0;a<r;a++){var v;(v=e[a]).fixed||(dB.sub(m,v.p,v.pp),fB(v.p,v.p,m,c),dB.copy(v.pp,v.p))}c*=.992,i&&i(e,t,c<.01)}}};var pB=cB.forceLayout,gB=Uz.simpleLayout,mB=$z.circularLayout,vB=Uc.linearMap,yB=V,_B=g,xB=pk.getCurvenessForEdge,bB=function(e){e.eachSeriesByType("graph",(function(e){if(!(c=e.coordinateSystem)||"view"===c.type)if("force"===e.get("layout")){var t=e.preservedPoints||{},i=e.getGraph(),n=i.data,r=i.edgeData,a=e.getModel("force"),o=a.get("initLayout");e.preservedPoints?n.each((function(e){var i=n.getId(e);n.setItemLayout(e,t[i]||[NaN,NaN])})):o&&"none"!==o?"circular"===o&&mB(e,"value"):gB(e);var s=n.getDataExtent("value"),l=r.getDataExtent("value"),u=a.get("repulsion"),h=a.get("edgeLength");_B.isArray(u)||(u=[u,u]),_B.isArray(h)||(h=[h,h]),h=[h[1],h[0]];var c,d=n.mapArray("value",(function(e,t){var i=n.getItemLayout(t),r=vB(e,s,u);return isNaN(r)&&(r=(u[0]+u[1])/2),{w:r,rep:r,fixed:n.getItemModel(t).get("fixed"),p:!i||isNaN(i[0])||isNaN(i[1])?null:i}})),f=r.mapArray("value",(function(t,n){var r=i.getEdgeByIndex(n),a=vB(t,l,h);isNaN(a)&&(a=(h[0]+h[1])/2);var o=r.getModel(),s=_B.retrieve3(o.get("lineStyle.curveness"),-xB(r,e,n,!0),0);return{n1:d[r.node1.dataIndex],n2:d[r.node2.dataIndex],d:a,curveness:s,ignoreForceLayout:o.get("ignoreForceLayout")}})),p=(c=e.coordinateSystem).getBoundingRect(),g=pB(d,f,{rect:p,gravity:a.get("gravity"),friction:a.get("friction")}),m=g.step;g.step=function(e){for(var r=0,a=d.length;r<a;r++)d[r].fixed&&yB.copy(d[r].p,i.getNodeByIndex(r).getLayout());m((function(r,a,o){for(var s=0,l=r.length;s<l;s++)r[s].fixed||i.getNodeByIndex(s).setLayout(r[s].p),t[n.getId(s)]=r[s].p;for(s=0,l=a.length;s<l;s++){var u=a[s],h=i.getEdgeByIndex(s),c=u.n1.p,d=u.n2.p,f=h.getLayout();(f=f?f.slice():[])[0]=f[0]||[],f[1]=f[1]||[],yB.copy(f[0],c),yB.copy(f[1],d),+u.curveness&&(f[2]=[(c[0]+d[0])/2-(c[1]-d[1])*u.curveness,(c[1]+d[1])/2-(d[0]-c[0])*u.curveness]),h.setLayout(f)}e&&e(o)}))},e.forceLayout=g,e.preservedPoints=t,g.step()}else e.forceLayout=null}))},wB=vP,TB=Hc.getLayoutRect,SB=Jo,MB=function(e,t){var i=[];return e.eachSeriesByType("graph",(function(e){var n=e.get("coordinateSystem");if(!n||"view"===n){var r=e.getData(),a=r.mapArray((function(e){var t=r.getItemModel(e);return[+t.get("x"),+t.get("y")]})),o=[],s=[];SB.fromPoints(a,o,s),s[0]-o[0]==0&&(s[0]+=1,o[0]-=1),s[1]-o[1]==0&&(s[1]+=1,o[1]-=1);var l=(s[0]-o[0])/(s[1]-o[1]),u=function(e,t,i){var n=e.getBoxLayoutParams();return n.aspect=i,TB(n,{width:t.getWidth(),height:t.getHeight()})}(e,t,l);isNaN(l)&&(o=[u.x,u.y],s=[u.x+u.width,u.y+u.height]);var h=s[0]-o[0],c=s[1]-o[1],d=u.width,f=u.height,p=e.coordinateSystem=new wB;p.zoomLimit=e.get("scaleLimit"),p.setBoundingRect(o[0],o[1],h,c),p.setViewRect(u.x,u.y,d,f),p.setCenter(e.get("center")),p.setZoom(e.get("zoom")),i.push(p)}})),i},AB=h,IB=Fz,CB=gM,DB=Vz,EB=Hz,LB=Jz,PB=hB,NB=bB,RB=MB;AB.registerProcessor(IB),AB.registerVisual(CB("graph","circle",null)),AB.registerVisual(DB),AB.registerVisual(EB),AB.registerLayout(LB),AB.registerLayout(AB.PRIORITY.VISUAL.POST_CHART_LAYOUT,PB),AB.registerLayout(NB),AB.registerCoordinateSystem("graphView",{create:RB});var OB=SC;um.extend({type:"series.gauge",getInitialData:function(e,t){return OB(this,["value"])},defaultOption:{zlevel:0,z:2,center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#91c7ae"],[.8,"#63869e"],[1,"#c23531"]],width:30}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,distance:5,color:"auto"},pointer:{show:!0,length:"80%",width:8},itemStyle:{color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],color:"#333",fontSize:15},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"auto",fontSize:30}}});var kB=dl.extend({type:"echartsGaugePointer",shape:{angle:0,width:10,r:10,x:0,y:0},buildPath:function(e,t){var i=Math.cos,n=Math.sin,r=t.r,a=t.width,o=t.angle,s=t.x-i(o)*a*(a>=r/3?1:2),l=t.y-n(o)*a*(a>=r/3?1:2);o=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+i(o)*a,t.y+n(o)*a),e.lineTo(t.x+i(t.angle)*r,t.y+n(t.angle)*r),e.lineTo(t.x-i(o)*a,t.y-n(o)*a),e.lineTo(s,l)}}),zB=kB,BB=No,FB=Om,VB=Uc,GB=VB.parsePercent,HB=VB.round,UB=VB.linearMap;function WB(e,t){return t&&("string"==typeof t?e=t.replace("{value}",null!=e?e:""):"function"==typeof t&&(e=t(e))),e}var jB=2*Math.PI;FB.extend({type:"gauge",render:function(e,t,i){this.group.removeAll();var n=e.get("axisLine.lineStyle.color"),r=function(e,t){var i=e.get("center"),n=t.getWidth(),r=t.getHeight(),a=Math.min(n,r);return{cx:GB(i[0],t.getWidth()),cy:GB(i[1],t.getHeight()),r:GB(e.get("radius"),a/2)}}(e,i);this._renderMain(e,t,i,n,r)},dispose:function(){},_renderMain:function(e,t,i,n,r){for(var a=this.group,o=e.getModel("axisLine"),s=o.getModel("lineStyle"),l=e.get("clockwise"),u=-e.get("startAngle")/180*Math.PI,h=((g=-e.get("endAngle")/180*Math.PI)-u)%jB,c=u,d=s.get("width"),f=o.get("show"),p=0;f&&p<n.length;p++){var g=u+h*Math.min(Math.max(n[p][0],0),1),m=new BB.Sector({shape:{startAngle:c,endAngle:g,cx:r.cx,cy:r.cy,clockwise:l,r0:r.r-d,r:r.r},silent:!0});m.setStyle({fill:n[p][1]}),m.setStyle(s.getLineStyle(["color","borderWidth","borderColor"])),a.add(m),c=g}var v=function(e){if(e<=0)return n[0][1];for(var t=0;t<n.length;t++)if(n[t][0]>=e&&(0===t?0:n[t-1][0])<e)return n[t][1];return n[t-1][1]};if(!l){var y=u;u=g,g=y}this._renderTicks(e,t,i,v,r,u,g,l),this._renderPointer(e,t,i,v,r,u,g,l),this._renderTitle(e,t,i,v,r),this._renderDetail(e,t,i,v,r)},_renderTicks:function(e,t,i,n,r,a,o,s){for(var l=this.group,u=r.cx,h=r.cy,c=r.r,d=+e.get("min"),f=+e.get("max"),p=e.getModel("splitLine"),g=e.getModel("axisTick"),m=e.getModel("axisLabel"),v=e.get("splitNumber"),y=g.get("splitNumber"),_=GB(p.get("length"),c),x=GB(g.get("length"),c),b=a,w=(o-a)/v,T=w/y,S=p.getModel("lineStyle").getLineStyle(),M=g.getModel("lineStyle").getLineStyle(),A=0;A<=v;A++){var I=Math.cos(b),C=Math.sin(b);if(p.get("show")){var D=new BB.Line({shape:{x1:I*c+u,y1:C*c+h,x2:I*(c-_)+u,y2:C*(c-_)+h},style:S,silent:!0});"auto"===S.stroke&&D.setStyle({stroke:n(A/v)}),l.add(D)}if(m.get("show")){var E=WB(HB(A/v*(f-d)+d),m.get("formatter")),L=m.get("distance"),P=n(A/v);l.add(new BB.Text({style:BB.setTextStyle({},m,{text:E,x:I*(c-_-L)+u,y:C*(c-_-L)+h,textVerticalAlign:C<-.4?"top":C>.4?"bottom":"middle",textAlign:I<-.4?"left":I>.4?"right":"center"},{autoColor:P}),silent:!0}))}if(g.get("show")&&A!==v){for(var N=0;N<=y;N++){I=Math.cos(b),C=Math.sin(b);var R=new BB.Line({shape:{x1:I*c+u,y1:C*c+h,x2:I*(c-x)+u,y2:C*(c-x)+h},silent:!0,style:M});"auto"===M.stroke&&R.setStyle({stroke:n((A+N/y)/v)}),l.add(R),b+=T}b-=T}else b+=w}},_renderPointer:function(e,t,i,n,r,a,o,s){var l=this.group,u=this._data;if(e.get("pointer.show")){var h=[+e.get("min"),+e.get("max")],c=[a,o],d=e.getData(),f=d.mapDimension("value");d.diff(u).add((function(t){var i=new zB({shape:{angle:a}});BB.initProps(i,{shape:{angle:UB(d.get(f,t),h,c,!0)}},e),l.add(i),d.setItemGraphicEl(t,i)})).update((function(t,i){var n=u.getItemGraphicEl(i);BB.updateProps(n,{shape:{angle:UB(d.get(f,t),h,c,!0)}},e),l.add(n),d.setItemGraphicEl(t,n)})).remove((function(e){var t=u.getItemGraphicEl(e);l.remove(t)})).execute(),d.eachItemGraphicEl((function(e,t){var i=d.getItemModel(t),a=i.getModel("pointer");e.setShape({x:r.cx,y:r.cy,width:GB(a.get("width"),r.r),r:GB(a.get("length"),r.r)}),e.useStyle(i.getModel("itemStyle").getItemStyle()),"auto"===e.style.fill&&e.setStyle("fill",n(UB(d.get(f,t),h,[0,1],!0))),BB.setHoverStyle(e,i.getModel("emphasis.itemStyle").getItemStyle())})),this._data=d}else u&&u.eachItemGraphicEl((function(e){l.remove(e)}))},_renderTitle:function(e,t,i,n,r){var a=e.getData(),o=a.mapDimension("value"),s=e.getModel("title");if(s.get("show")){var l=s.get("offsetCenter"),u=r.cx+GB(l[0],r.r),h=r.cy+GB(l[1],r.r),c=+e.get("min"),d=+e.get("max"),f=e.getData().get(o,0),p=n(UB(f,[c,d],[0,1],!0));this.group.add(new BB.Text({silent:!0,style:BB.setTextStyle({},s,{x:u,y:h,text:a.getName(0),textAlign:"center",textVerticalAlign:"middle"},{autoColor:p,forceRich:!0})}))}},_renderDetail:function(e,t,i,n,r){var a=e.getModel("detail"),o=+e.get("min"),s=+e.get("max");if(a.get("show")){var l=a.get("offsetCenter"),u=r.cx+GB(l[0],r.r),h=r.cy+GB(l[1],r.r),c=GB(a.get("width"),r.r),d=GB(a.get("height"),r.r),f=e.getData(),p=f.get(f.mapDimension("value"),0),g=n(UB(p,[o,s],[0,1],!0));this.group.add(new BB.Text({silent:!0,style:BB.setTextStyle({},a,{x:u,y:h,text:WB(p,a.get("formatter")),textWidth:isNaN(c)?null:c,textHeight:isNaN(d)?null:d,textAlign:"center",textVerticalAlign:"middle"},{autoColor:g,forceRich:!0})}))}}});var XB=h,ZB=g,qB=SC,YB=lo.defaultEmphasis,KB=Vd.makeSeriesEncodeForNameBased,QB=IC,JB=XB.extendSeriesModel({type:"series.funnel",init:function(e){JB.superApply(this,"init",arguments),this.legendVisualProvider=new QB(ZB.bind(this.getData,this),ZB.bind(this.getRawData,this)),this._defaultLabelLine(e)},getInitialData:function(e,t){return qB(this,{coordDimensions:["value"],encodeDefaulter:ZB.curry(KB,this)})},_defaultLabelLine:function(e){YB(e,"labelLine",["show"]);var t=e.labelLine,i=e.emphasis.labelLine;t.show=t.show&&e.label.show,i.show=i.show&&e.emphasis.label.show},getDataParams:function(e){var t=this.getData(),i=JB.superCall(this,"getDataParams",e),n=t.mapDimension("value"),r=t.getSum(n);return i.percent=r?+(t.get(n,e)/r*100).toFixed(2):0,i.$vars.push("percent"),i},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,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,type:"solid"}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}}}}),$B=No,eF=g,tF=Om;function iF(e,t){$B.Group.call(this);var i=new $B.Polygon,n=new $B.Polyline,r=new $B.Text;this.add(i),this.add(n),this.add(r),this.highDownOnUpdate=function(e,t){"emphasis"===t?(n.ignore=n.hoverIgnore,r.ignore=r.hoverIgnore):(n.ignore=n.normalIgnore,r.ignore=r.normalIgnore)},this.updateData(e,t,!0)}var nF=iF.prototype,rF=["itemStyle","opacity"];nF.updateData=function(e,t,i){var n=this.childAt(0),r=e.hostModel,a=e.getItemModel(t),o=e.getItemLayout(t),s=e.getItemModel(t).get(rF);s=null==s?1:s,n.useStyle({}),i?(n.setShape({points:o.points}),n.setStyle({opacity:0}),$B.initProps(n,{style:{opacity:s}},r,t)):$B.updateProps(n,{style:{opacity:s},shape:{points:o.points}},r,t);var l=a.getModel("itemStyle"),u=e.getItemVisual(t,"color");n.setStyle(eF.defaults({lineJoin:"round",fill:u},l.getItemStyle(["opacity"]))),n.hoverStyle=l.getModel("emphasis").getItemStyle(),this._updateLabel(e,t),$B.setHoverStyle(this)},nF._updateLabel=function(e,t){var i=this.childAt(1),n=this.childAt(2),r=e.hostModel,a=e.getItemModel(t),o=e.getItemLayout(t).label,s=e.getItemVisual(t,"color");$B.updateProps(i,{shape:{points:o.linePoints||o.linePoints}},r,t),$B.updateProps(n,{style:{x:o.x,y:o.y}},r,t),n.attr({rotation:o.rotation,origin:[o.x,o.y],z2:10});var l=a.getModel("label"),u=a.getModel("emphasis.label"),h=a.getModel("labelLine"),c=a.getModel("emphasis.labelLine");s=e.getItemVisual(t,"color"),$B.setLabelStyle(n.style,n.hoverStyle={},l,u,{labelFetcher:e.hostModel,labelDataIndex:t,defaultText:e.getName(t),autoColor:s,useInsideStyle:!!o.inside},{textAlign:o.textAlign,textVerticalAlign:o.verticalAlign}),n.ignore=n.normalIgnore=!l.get("show"),n.hoverIgnore=!u.get("show"),i.ignore=i.normalIgnore=!h.get("show"),i.hoverIgnore=!c.get("show"),i.setStyle({stroke:s}),i.setStyle(h.getModel("lineStyle").getLineStyle()),i.hoverStyle=c.getModel("lineStyle").getLineStyle()},eF.inherits(iF,$B.Group),tF.extend({type:"funnel",render:function(e,t,i){var n=e.getData(),r=this._data,a=this.group;n.diff(r).add((function(e){var t=new iF(n,e);n.setItemGraphicEl(e,t),a.add(t)})).update((function(e,t){var i=r.getItemGraphicEl(t);i.updateData(n,e),a.add(i),n.setItemGraphicEl(e,i)})).remove((function(e){var t=r.getItemGraphicEl(e);a.remove(t)})).execute(),this._data=n},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});var aF=Hc,oF=Uc,sF=oF.parsePercent,lF=oF.linearMap,uF=function(e,t,i){e.eachSeriesByType("funnel",(function(e){var i=e.getData(),n=i.mapDimension("value"),r=e.get("sort"),a=function(e,t){return aF.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t),o=function(e,t){for(var i=e.mapDimension("value"),n=e.mapArray(i,(function(e){return e})),r=[],a="ascending"===t,o=0,s=e.count();o<s;o++)r[o]=o;return"function"==typeof t?r.sort(t):"none"!==t&&r.sort((function(e,t){return a?n[e]-n[t]:n[t]-n[e]})),r}(i,r),s=e.get("orient"),l=a.width,u=a.height,h=a.x,c=a.y,d="horizontal"===s?[sF(e.get("minSize"),u),sF(e.get("maxSize"),u)]:[sF(e.get("minSize"),l),sF(e.get("maxSize"),l)],f=i.getDataExtent(n),p=e.get("min"),g=e.get("max");null==p&&(p=Math.min(f[0],0)),null==g&&(g=f[1]);var m=e.get("funnelAlign"),v=e.get("gap"),y=(("horizontal"===s?l:u)-v*(i.count()-1))/i.count(),_=function(e,t){if("horizontal"===s){var r,a=i.get(n,e)||0,o=lF(a,[p,g],d,!0);switch(m){case"top":r=c;break;case"center":r=c+(u-o)/2;break;case"bottom":r=c+(u-o)}return[[t,r],[t,r+o]]}a=i.get(n,e)||0;var f,v=lF(a,[p,g],d,!0);switch(m){case"left":f=h;break;case"center":f=h+(l-v)/2;break;case"right":f=h+l-v}return[[f,t],[f+v,t]]};"ascending"===r&&(y=-y,v=-v,"horizontal"===s?h+=l:c+=u,o=o.reverse());for(var x=0;x<o.length;x++){var b=o[x],w=o[x+1],T=i.getItemModel(b);if("horizontal"===s){var S=T.get("itemStyle.width");null==S?S=y:(S=sF(S,l),"ascending"===r&&(S=-S));var M=_(b,h),A=_(w,h+S);h+=S+v,i.setItemLayout(b,{points:M.concat(A.slice().reverse())})}else{var I=T.get("itemStyle.height");null==I?I=y:(I=sF(I,u),"ascending"===r&&(I=-I)),M=_(b,"horizontal"===s?h:c),A=_(w,"horizontal"===s?h+S:c+I),c+=I+v,i.setItemLayout(b,{points:M.concat(A.slice().reverse())})}}!function(e){e.each((function(t){var i,n,r,a,o=e.getItemModel(t),s=o.getModel("label").get("position"),l=o.get("orient"),u=o.getModel("labelLine"),h=e.getItemLayout(t),c=h.points,d="inner"===s||"inside"===s||"center"===s||"insideLeft"===s||"insideRight"===s;if(d)"insideLeft"===s?(n=(c[0][0]+c[3][0])/2+5,r=(c[0][1]+c[3][1])/2,i="left"):"insideRight"===s?(n=(c[1][0]+c[2][0])/2-5,r=(c[1][1]+c[2][1])/2,i="right"):(n=(c[0][0]+c[1][0]+c[2][0]+c[3][0])/4,r=(c[0][1]+c[1][1]+c[2][1]+c[3][1])/4,i="center"),a=[[n,r],[n,r]];else{var f,p,g,m,v=u.get("length");"left"===s?(f=(c[3][0]+c[0][0])/2,p=(c[3][1]+c[0][1])/2,n=(g=f-v)-5,i="right"):"right"===s?(f=(c[1][0]+c[2][0])/2,p=(c[1][1]+c[2][1])/2,n=(g=f+v)+5,i="left"):"top"===s?(f=(c[3][0]+c[0][0])/2,r=(m=(p=(c[3][1]+c[0][1])/2)-v)-5,i="center"):"bottom"===s?(f=(c[1][0]+c[2][0])/2,r=(m=(p=(c[1][1]+c[2][1])/2)+v)+5,i="center"):"rightTop"===s?(f="horizontal"===l?c[3][0]:c[1][0],p="horizontal"===l?c[3][1]:c[1][1],"horizontal"===l?(r=(m=p-v)-5,i="center"):(n=(g=f+v)+5,i="top")):"rightBottom"===s?(f=c[2][0],p=c[2][1],"horizontal"===l?(r=(m=p+v)+5,i="center"):(n=(g=f+v)+5,i="bottom")):"leftTop"===s?(f=c[0][0],p="horizontal"===l?c[0][1]:c[1][1],"horizontal"===l?(r=(m=p-v)-5,i="center"):(n=(g=f-v)-5,i="right")):"leftBottom"===s?(f="horizontal"===l?c[1][0]:c[3][0],p="horizontal"===l?c[1][1]:c[2][1],"horizontal"===l?(r=(m=p+v)+5,i="center"):(n=(g=f-v)-5,i="right")):(f=(c[1][0]+c[2][0])/2,p=(c[1][1]+c[2][1])/2,"horizontal"===l?(r=(m=p+v)+5,i="center"):(n=(g=f+v)+5,i="left")),"horizontal"===l?n=g=f:r=m=p,a=[[f,p],[g,m]]}h.label={linePoints:a,x:n,y:r,verticalAlign:"middle",textAlign:i,inside:d}}))}(i)}))},hF=h,cF=YC,dF=uF,fF=cD;hF.registerVisual(cF("funnel")),hF.registerLayout(dF),hF.registerProcessor(fF("funnel"));var pF=g,gF=lo,mF=function(e){!function(e){if(!e.parallel){var t=!1;pF.each(e.series,(function(e){e&&"parallel"===e.type&&(t=!0)})),t&&(e.parallel=[{}])}}(e),function(e){var t=gF.normalizeToArray(e.parallelAxis);pF.each(t,(function(t){if(pF.isObject(t)){var i=t.parallelIndex||0,n=gF.normalizeToArray(e.parallel)[i];n&&n.parallelAxisDefault&&pF.merge(t,n.parallelAxisDefault,!1)}}))}(e)},vF=g,yF=wT,_F=function(e,t,i,n,r){yF.call(this,e,t,i),this.type=n||"value",this.axisIndex=r};function xF(e,t){var i=e[t]-e[1-t];return{span:Math.abs(i),sign:i>0?-1:i<0?1:t?-1:1}}function bF(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}_F.prototype={constructor:_F,model:null,isHorizontal:function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")}},vF.inherits(_F,yF);var wF=function(e,t,i,n,r,a){e=e||0;var o=i[1]-i[0];if(null!=r&&(r=bF(r,[0,o])),null!=a&&(a=Math.max(a,null!=r?r:0)),"all"===n){var s=Math.abs(t[1]-t[0]);s=bF(s,[0,o]),r=a=bF(s,[r,a]),n=0}t[0]=bF(t[0],i),t[1]=bF(t[1],i);var l=xF(t,n);t[n]+=e;var u=r||0,h=i.slice();l.sign<0?h[0]+=u:h[1]-=u,t[n]=bF(t[n],h);var c=xF(t,n);return null!=r&&(c.sign!==l.sign||c.span<r)&&(t[1-n]=t[n]+l.sign*r),c=xF(t,n),null!=a&&c.span>a&&(t[1-n]=t[n]+c.sign*a),t},TF=g,SF=Ue,MF=Hc,AF=yx,IF=_F,CF=No,DF=Uc,EF=wF,LF=TF.each,PF=Math.min,NF=Math.max,RF=Math.floor,OF=Math.ceil,kF=DF.round,zF=Math.PI;function BF(e,t,i){this._axesMap=TF.createHashMap(),this._axesLayout={},this.dimensions=e.dimensions,this._rect,this._model=e,this._init(e,t,i)}function FF(e,t){return PF(NF(e,t[0]),t[1])}function VF(e,t){var i=t.layoutLength/(t.axisCount-1);return{position:i*e,axisNameAvailableWidth:i,axisLabelShow:!0}}function GF(e,t){var i,n,r=t.layoutLength,a=t.axisExpandWidth,o=t.axisCount,s=t.axisCollapseWidth,l=t.winInnerIndices,u=s,h=!1;return e<l[0]?(i=e*s,n=s):e<=l[1]?(i=t.axisExpandWindow0Pos+e*a-t.axisExpandWindow[0],u=a,h=!0):(i=r-(o-1-e)*s,n=s),{position:i,axisNameAvailableWidth:u,axisLabelShow:h,nameTruncateMaxWidth:n}}BF.prototype={type:"parallel",constructor:BF,_init:function(e,t,i){var n=e.dimensions,r=e.parallelAxisIndex;LF(n,(function(e,i){var n=r[i],a=t.getComponent("parallelAxis",n),o=this._axesMap.set(e,new IF(e,AF.createScaleByModel(a),[0,0],a.get("type"),n)),s="category"===o.type;o.onBand=s&&a.get("boundaryGap"),o.inverse=a.get("inverse"),a.axis=o,o.model=a,o.coordinateSystem=a.coordinateSystem=this}),this)},update:function(e,t){this._updateAxesFromSeries(this._model,e)},containPoint:function(e){var t=this._makeLayoutInfo(),i=t.axisBase,n=t.layoutBase,r=t.pixelDimIndex,a=e[1-r],o=e[r];return a>=i&&a<=i+t.axisLength&&o>=n&&o<=n+t.layoutLength},getModel:function(){return this._model},_updateAxesFromSeries:function(e,t){t.eachSeries((function(i){if(e.contains(i,t)){var n=i.getData();LF(this.dimensions,(function(e){var t=this._axesMap.get(e);t.scale.unionExtentFromData(n,n.mapDimension(e)),AF.niceScaleExtent(t.scale,t.model)}),this)}}),this)},resize:function(e,t){this._rect=MF.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},getRect:function(){return this._rect},_makeLayoutInfo:function(){var e,t=this._model,i=this._rect,n=["x","y"],r=["width","height"],a=t.get("layout"),o="horizontal"===a?0:1,s=i[r[o]],l=[0,s],u=this.dimensions.length,h=FF(t.get("axisExpandWidth"),l),c=FF(t.get("axisExpandCount")||0,[0,u]),d=t.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,f=t.get("axisExpandWindow");f?(e=FF(f[1]-f[0],l),f[1]=f[0]+e):(e=FF(h*(c-1),l),(f=[h*(t.get("axisExpandCenter")||RF(u/2))-e/2])[1]=f[0]+e);var p=(s-e)/(u-c);p<3&&(p=0);var g=[RF(kF(f[0]/h,1))+1,OF(kF(f[1]/h,1))-1],m=p/h*f[0];return{layout:a,pixelDimIndex:o,layoutBase:i[n[o]],layoutLength:s,axisBase:i[n[1-o]],axisLength:i[r[1-o]],axisExpandable:d,axisExpandWidth:h,axisCollapseWidth:p,axisExpandWindow:f,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},_layoutAxes:function(){var e=this._rect,t=this._axesMap,i=this.dimensions,n=this._makeLayoutInfo(),r=n.layout;t.each((function(e){var t=[0,n.axisLength],i=e.inverse?1:0;e.setExtent(t[i],t[1-i])})),LF(i,(function(t,i){var a=(n.axisExpandable?GF:VF)(i,n),o={horizontal:{x:a.position,y:n.axisLength},vertical:{x:0,y:a.position}},s={horizontal:zF/2,vertical:0},l=[o[r].x+e.x,o[r].y+e.y],u=s[r],h=SF.create();SF.rotate(h,h,u),SF.translate(h,h,l),this._axesLayout[t]={position:l,rotation:u,transform:h,axisNameAvailableWidth:a.axisNameAvailableWidth,axisLabelShow:a.axisLabelShow,nameTruncateMaxWidth:a.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},getAxis:function(e){return this._axesMap.get(e)},dataToPoint:function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},eachActiveState:function(e,t,i,n){null==i&&(i=0),null==n&&(n=e.count());var r=this._axesMap,a=this.dimensions,o=[],s=[];TF.each(a,(function(t){o.push(e.mapDimension(t)),s.push(r.get(t).model)}));for(var l=this.hasAxisBrushed(),u=i;u<n;u++){var h;if(l){h="active";for(var c=e.getValues(o,u),d=0,f=a.length;d<f;d++)if("inactive"===s[d].getActiveState(c[d])){h="inactive";break}}else h="normal";t(h,u)}},hasAxisBrushed:function(){for(var e=this.dimensions,t=this._axesMap,i=!1,n=0,r=e.length;n<r;n++)"normal"!==t.get(e[n]).model.getActiveState()&&(i=!0);return i},axisCoordToPoint:function(e,t){var i=this._axesLayout[t];return CF.applyTransform([e,0],i.transform)},getAxisLayout:function(e){return TF.clone(this._axesLayout[e])},getSlidedAxisExpandWindow:function(e){var t=this._makeLayoutInfo(),i=t.pixelDimIndex,n=t.axisExpandWindow.slice(),r=n[1]-n[0],a=[0,t.axisExpandWidth*(t.axisCount-1)];if(!this.containPoint(e))return{behavior:"none",axisExpandWindow:n};var o,s=e[i]-t.layoutBase-t.axisExpandWindow0Pos,l="slide",u=t.axisCollapseWidth,h=this._model.get("axisExpandSlideTriggerArea"),c=null!=h[0];return u?(c&&u&&s<r*h[0]?(l="jump",o=s-r*h[2]):c&&u&&s>r*(1-h[0])?(l="jump",o=s-r*(1-h[2])):(o=s-r*h[1])>=0&&(o=s-r*(1-h[1]))<=0&&(o=0),(o*=t.axisExpandWidth/u)?EF(o,n,a,"all"):l="none"):(r=n[1]-n[0],(n=[NF(0,a[1]*s/r-r/2)])[1]=PF(a[1],n[0]+r),n[0]=n[1]-r),{axisExpandWindow:n,behavior:l}}};var HF=BF;sp.register("parallel",{create:function(e,t){var i=[];return e.eachComponent("parallel",(function(n,r){var a=new HF(n,e,t);a.name="parallel_"+r,a.resize(n,t),n.coordinateSystem=a,a.model=n,i.push(a)})),e.eachSeries((function(t){if("parallel"===t.get("coordinateSystem")){var i=e.queryComponents({mainType:"parallel",index:t.get("parallelIndex"),id:t.get("parallelId")})[0];t.coordinateSystem=i.coordinateSystem}})),i}});var UF=g,WF=Co,jF=ZM,XF=Uc,ZF=aw,qF=Ld.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return WF([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(e){var t=this.activeIntervals=UF.clone(e);if(t)for(var i=t.length-1;i>=0;i--)XF.asc(t[i])},getActiveState:function(e){var t=this.activeIntervals;if(!t.length)return"normal";if(null==e||isNaN(e))return"inactive";if(1===t.length){var i=t[0];if(i[0]<=e&&e<=i[1])return"active"}else for(var n=0,r=t.length;n<r;n++)if(t[n][0]<=e&&e<=t[n][1])return"active";return"inactive"}});UF.merge(qF.prototype,ZF),jF("parallel",qF,(function(e,t){return t.type||(t.data?"category":"value")}),{type:"value",dim:null,areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10});var YF=g,KF=Ld;KF.extend({type:"parallel",dependencies:["parallelAxis"],coordinateSystem:null,dimensions:null,parallelAxisIndex:null,layoutMode:"box",defaultOption:{zlevel:0,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},init:function(){KF.prototype.init.apply(this,arguments),this.mergeOption({})},mergeOption:function(e){var t=this.option;e&&YF.merge(t,e,!0),this._initDimensions()},contains:function(e,t){var i=e.get("parallelIndex");return null!=i&&t.getComponent("parallel",i)===this},setAxisExpand:function(e){YF.each(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(t){e.hasOwnProperty(t)&&(this.option[t]=e[t])}),this)},_initDimensions:function(){var e=this.dimensions=[],t=this.parallelAxisIndex=[],i=YF.filter(this.dependentModels.parallelAxis,(function(e){return(e.get("parallelIndex")||0)===this.componentIndex}),this);YF.each(i,(function(i){e.push("dim"+i.get("dim")),t.push(i.componentIndex)}))}});var QF=h;QF.registerAction({type:"axisAreaSelect",event:"axisAreaSelected"},(function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},(function(t){t.axis.model.setActiveIntervals(e.intervals)}))})),QF.registerAction("parallelAxisExpand",(function(e,t){t.eachComponent({mainType:"parallel",query:e},(function(t){t.setAxisExpand(e)}))}));var JF=g,$F=ie,eV=No,tV=xL,iV=Vy,nV=JF.curry,rV=JF.each,aV=JF.map,oV=Math.min,sV=Math.max,lV=Math.pow,uV="globalPan",hV={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},cV={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},dV={brushStyle:{lineWidth:2,stroke:"rgba(0,0,0,0.3)",fill:"rgba(0,0,0,0.1)"},transformable:!0,brushMode:"single",removeOnClick:!1},fV=0;function pV(e){$F.call(this),this._zr=e,this.group=new eV.Group,this._brushType,this._brushOption,this._panels,this._track=[],this._dragging,this._covers=[],this._creatingCover,this._creatingPanel,this._enableGlobalPan,this._uid="brushController_"+fV++,this._handlers={},rV(GV,(function(e,t){this._handlers[t]=JF.bind(e,this)}),this)}function gV(e,t){var i=UV[t.brushType].createCover(e,t);return i.__brushOption=t,yV(i,t),e.group.add(i),i}function mV(e,t){var i=xV(t);return i.endCreating&&(i.endCreating(e,t),yV(t,t.__brushOption)),t}function vV(e,t){var i=t.__brushOption;xV(t).updateCoverShape(e,t,i.range,i)}function yV(e,t){var i=t.z;null==i&&(i=1e4),e.traverse((function(e){e.z=i,e.z2=i}))}function _V(e,t){xV(t).updateCommon(e,t),vV(e,t)}function xV(e){return UV[e.__brushOption.brushType]}function bV(e,t,i){var n,r=e._panels;if(!r)return!0;var a=e._transform;return rV(r,(function(e){e.isTargetByCursor(t,i,a)&&(n=e)})),n}function wV(e,t){var i=e._panels;if(!i)return!0;var n=t.__brushOption.panelId;return null==n||i[n]}function TV(e){var t=e._covers,i=t.length;return rV(t,(function(t){e.group.remove(t)}),e),t.length=0,!!i}function SV(e,t){var i=aV(e._covers,(function(e){var t=e.__brushOption,i=JF.clone(t.range);return{brushType:t.brushType,panelId:t.panelId,range:i}}));e.trigger("brush",i,{isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function MV(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function AV(e,t,i,n){var r=new eV.Group;return r.add(new eV.Rect({name:"main",style:EV(i),silent:!0,draggable:!0,cursor:"move",drift:nV(e,t,r,"nswe"),ondragend:nV(SV,t,{isEnd:!0})})),rV(n,(function(i){r.add(new eV.Rect({name:i,style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:nV(e,t,r,i),ondragend:nV(SV,t,{isEnd:!0})}))})),r}function IV(e,t,i,n){var r=n.brushStyle.lineWidth||0,a=sV(r,6),o=i[0][0],s=i[1][0],l=o-r/2,u=s-r/2,h=i[0][1],c=i[1][1],d=h-a+r/2,f=c-a+r/2,p=h-o,g=c-s,m=p+r,v=g+r;DV(e,t,"main",o,s,p,g),n.transformable&&(DV(e,t,"w",l,u,a,v),DV(e,t,"e",d,u,a,v),DV(e,t,"n",l,u,m,a),DV(e,t,"s",l,f,m,a),DV(e,t,"nw",l,u,a,a),DV(e,t,"ne",d,u,a,a),DV(e,t,"sw",l,f,a,a),DV(e,t,"se",d,f,a,a))}function CV(e,t){var i=t.__brushOption,n=i.transformable,r=t.childAt(0);r.useStyle(EV(i)),r.attr({silent:!n,cursor:n?"move":"default"}),rV(["w","e","n","s","se","sw","ne","nw"],(function(i){var r=t.childOfName(i),a=PV(e,i);r&&r.attr({silent:!n,invisible:!n,cursor:n?cV[a]+"-resize":null})}))}function DV(e,t,i,n,r,a,o){var s=t.childOfName(i);s&&s.setShape(function(e){var t=oV(e[0][0],e[1][0]),i=oV(e[0][1],e[1][1]),n=sV(e[0][0],e[1][0]),r=sV(e[0][1],e[1][1]);return{x:t,y:i,width:n-t,height:r-i}}(kV(e,t,[[n,r],[n+a,r+o]])))}function EV(e){return JF.defaults({strokeNoScale:!0},e.brushStyle)}function LV(e,t,i,n){var r=[oV(e,i),oV(t,n)],a=[sV(e,i),sV(t,n)];return[[r[0],a[0]],[r[1],a[1]]]}function PV(e,t){if(t.length>1)return("e"===(i=[PV(e,(t=t.split(""))[0]),PV(e,t[1])])[0]||"w"===i[0])&&i.reverse(),i.join("");var i=eV.transformDirection({w:"left",e:"right",n:"top",s:"bottom"}[t],function(e){return eV.getTransform(e.group)}(e));return{left:"w",right:"e",top:"n",bottom:"s"}[i]}function NV(e,t,i,n,r,a,o,s){var l=n.__brushOption,u=e(l.range),h=OV(i,a,o);rV(r.split(""),(function(e){var t=hV[e];u[t[0]][t[1]]+=h[t[0]]})),l.range=t(LV(u[0][0],u[1][0],u[0][1],u[1][1])),_V(i,n),SV(i,{isEnd:!1})}function RV(e,t,i,n,r){var a=t.__brushOption.range,o=OV(e,i,n);rV(a,(function(e){e[0]+=o[0],e[1]+=o[1]})),_V(e,t),SV(e,{isEnd:!1})}function OV(e,t,i){var n=e.group,r=n.transformCoordToLocal(t,i),a=n.transformCoordToLocal(0,0);return[r[0]-a[0],r[1]-a[1]]}function kV(e,t,i){var n=wV(e,t);return n&&!0!==n?n.clipPath(i,e._transform):JF.clone(i)}function zV(e){var t=e.event;t.preventDefault&&t.preventDefault()}function BV(e,t,i){return e.childOfName("main").contain(t,i)}function FV(e,t,i,n){var r,a=e._creatingCover,o=e._creatingPanel,s=e._brushOption;if(e._track.push(i.slice()),function(e){var t=e._track;if(!t.length)return!1;var i=t[t.length-1],n=t[0],r=i[0]-n[0],a=i[1]-n[1];return lV(r*r+a*a,.5)>6}(e)||a){if(o&&!a){"single"===s.brushMode&&TV(e);var l=JF.clone(s);l.brushType=VV(l.brushType,o),l.panelId=!0===o?null:o.panelId,a=e._creatingCover=gV(e,l),e._covers.push(a)}if(a){var u=UV[VV(e._brushType,o)];a.__brushOption.range=u.getCreatingRange(kV(e,a,e._track)),n&&(mV(e,a),u.updateCommon(e,a)),vV(e,a),r={isEnd:n}}}else n&&"single"===s.brushMode&&s.removeOnClick&&bV(e,t,i)&&TV(e)&&(r={isEnd:n,removeOnClick:!0});return r}function VV(e,t){return"auto"===e?t.defaultBrushType:e}pV.prototype={constructor:pV,enableBrush:function(e){var t,i;return this._brushType&&(i=(t=this)._zr,tV.release(i,uV,t._uid),function(e,t){rV(t,(function(t,i){e.off(i,t)}))}(i,t._handlers),t._brushType=t._brushOption=null),e.brushType&&function(e,t){var i=e._zr;e._enableGlobalPan||tV.take(i,uV,e._uid),function(e,t){rV(t,(function(t,i){e.on(i,t)}))}(i,e._handlers),e._brushType=t.brushType,e._brushOption=JF.merge(JF.clone(dV),t,!0)}(this,e),this},setPanels:function(e){if(e&&e.length){var t=this._panels={};JF.each(e,(function(e){t[e.panelId]=JF.clone(e)}))}else this._panels=null;return this},mount:function(e){e=e||{},this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({position:e.position||[0,0],rotation:e.rotation||0,scale:e.scale||[1,1]}),this._transform=t.getLocalTransform(),this},eachCover:function(e,t){rV(this._covers,e,t)},updateCovers:function(e){e=JF.map(e,(function(e){return JF.merge(JF.clone(dV),e,!0)}));var t=this._covers,i=this._covers=[],n=this,r=this._creatingCover;return new iV(t,e,(function(e,t){return a(e.__brushOption,t)}),a).add(o).update(o).remove((function(e){t[e]!==r&&n.group.remove(t[e])})).execute(),this;function a(e,t){return(null!=e.id?e.id:"\0-brush-index-"+t)+"-"+e.brushType}function o(a,o){var s=e[a];if(null!=o&&t[o]===r)i[a]=t[o];else{var l=i[a]=null!=o?(t[o].__brushOption=s,t[o]):mV(n,gV(n,s));_V(n,l)}}},unmount:function(){return this.enableBrush(!1),TV(this),this._zr.remove(this.group),this},dispose:function(){this.unmount(),this.off()}},JF.mixin(pV,$F);var GV={mousedown:function(e){if(this._dragging)HV(this,e);else if(!e.target||!e.target.draggable){zV(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=bV(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,i=e.offsetY,n=this.group.transformCoordToLocal(t,i);if(function(e,t,i){if(e._brushType&&!function(e,t,i){var n=e._zr;return t<0||t>n.getWidth()||i<0||i>n.getHeight()}(e,t)){var n=e._zr,r=e._covers,a=bV(e,t,i);if(!e._dragging)for(var o=0;o<r.length;o++){var s=r[o].__brushOption;if(a&&(!0===a||s.panelId===a.panelId)&&UV[s.brushType].contain(r[o],i[0],i[1]))return}a&&n.setCursorStyle("crosshair")}}(this,e,n),this._dragging){zV(e);var r=FV(this,e,n,!1);r&&SV(this,r)}},mouseup:function(e){HV(this,e)}};function HV(e,t){if(e._dragging){zV(t);var i=t.offsetX,n=t.offsetY,r=e.group.transformCoordToLocal(i,n),a=FV(e,t,r,!0);e._dragging=!1,e._track=[],e._creatingCover=null,a&&SV(e,a)}}var UV={lineX:WV(0),lineY:WV(1),rect:{createCover:function(e,t){return AV(nV(NV,(function(e){return e}),(function(e){return e})),e,t,["w","e","n","s","se","sw","ne","nw"])},getCreatingRange:function(e){var t=MV(e);return LV(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,i,n){IV(e,t,i,n)},updateCommon:CV,contain:BV},polygon:{createCover:function(e,t){var i=new eV.Group;return i.add(new eV.Polyline({name:"main",style:EV(t),silent:!0})),i},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new eV.Polygon({name:"main",draggable:!0,drift:nV(RV,e,t),ondragend:nV(SV,e,{isEnd:!0})}))},updateCoverShape:function(e,t,i,n){t.childAt(0).setShape({points:kV(e,t,i)})},updateCommon:CV,contain:BV}};function WV(e){return{createCover:function(t,i){return AV(nV(NV,(function(t){var i=[t,[0,100]];return e&&i.reverse(),i}),(function(t){return t[e]})),t,i,[["w","e"],["n","s"]][e])},getCreatingRange:function(t){var i=MV(t);return[oV(i[0][e],i[1][e]),sV(i[0][e],i[1][e])]},updateCoverShape:function(t,i,n,r){var a,o=wV(t,i);if(!0!==o&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(e,t._transform);else{var s=t._zr;a=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[n,a];e&&l.reverse(),IV(t,i,l,r)},updateCommon:CV,contain:BV}}var jV=pV,XV={},ZV=Pi,qV=BL.onIrrelevantElement,YV=No;function KV(e){return ZV.create(e)}XV.makeRectPanelClipPath=function(e){return e=KV(e),function(t,i){return YV.clipPointsByRect(t,e)}},XV.makeLinearBrushOtherExtent=function(e,t){return e=KV(e),function(i){var n=null!=t?t:i,r=n?e.width:e.height,a=n?e.x:e.y;return[a,a+(r||0)]}},XV.makeRectIsTargetByCursor=function(e,t,i){return e=KV(e),function(n,r,a){return e.contain(r[0],r[1])&&!qV(n,t,i)}};var QV=g,JV=qA,$V=jV,eG=XV,tG=No,iG=["axisLine","axisTickLabel","axisName"],nG=h.extendComponentView({type:"parallelAxis",init:function(e,t){nG.superApply(this,"init",arguments),(this._brushController=new $V(t.getZr())).on("brush",QV.bind(this._onBrush,this))},render:function(e,t,i,n){if(!function(e,t,i){return i&&"axisAreaSelect"===i.type&&t.findComponents({mainType:"parallelAxis",query:i})[0]===e}(e,t,n)){this.axisModel=e,this.api=i,this.group.removeAll();var r=this._axisGroup;if(this._axisGroup=new tG.Group,this.group.add(this._axisGroup),e.get("show")){var a=function(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}(e,t),o=a.coordinateSystem,s=e.getAreaSelectStyle(),l=s.width,u=e.axis.dim,h=o.getAxisLayout(u),c=QV.extend({strokeContainThreshold:l},h),d=new JV(e,c);QV.each(iG,d.add,d),this._axisGroup.add(d.getGroup()),this._refreshBrushController(c,s,e,a,l,i);var f=n&&!1===n.animation?null:e;tG.groupTransition(r,this._axisGroup,f)}}},_refreshBrushController:function(e,t,i,n,r,a){var o=i.axis.getExtent(),s=o[1]-o[0],l=Math.min(30,.1*Math.abs(s)),u=tG.BoundingRect.create({x:o[0],y:-r/2,width:s,height:r});u.x-=l,u.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:e.rotation,position:e.position}).setPanels([{panelId:"pl",clipPath:eG.makeRectPanelClipPath(u),isTargetByCursor:eG.makeRectIsTargetByCursor(u,a,n),getLinearBrushOtherExtent:eG.makeLinearBrushOtherExtent(u,0)}]).enableBrush({brushType:"lineX",brushStyle:t,removeOnClick:!0}).updateCovers(function(e){var t=e.axis;return QV.map(e.activeIntervals,(function(e){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(e[0],!0),t.dataToCoord(e[1],!0)]}}))}(i))},_onBrush:function(e,t){var i=this.axisModel,n=i.axis,r=QV.map(e,(function(e){return[n.coordToData(e.range[0],!0),n.coordToData(e.range[1],!0)]}));(!i.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:r})},dispose:function(){this._brushController.dispose()}}),rG=h,aG=g,oG=km,sG=mF;rG.extendComponentView({type:"parallel",render:function(e,t,i){this._model=e,this._api=i,this._handlers||(this._handlers={},aG.each(lG,(function(e,t){i.getZr().on(t,this._handlers[t]=aG.bind(e,this))}),this)),oG.createOrUpdate(this,"_throttledDispatchExpand",e.get("axisExpandRate"),"fixRate")},dispose:function(e,t){aG.each(this._handlers,(function(e,i){t.getZr().off(i,e)})),this._handlers=null},_throttledDispatchExpand:function(e){this._dispatchExpand(e)},_dispatchExpand:function(e){e&&this._api.dispatchAction(aG.extend({type:"parallelAxisExpand"},e))}});var lG={mousedown:function(e){uG(this,"click")&&(this._mouseDownPoint=[e.offsetX,e.offsetY])},mouseup:function(e){var t=this._mouseDownPoint;if(uG(this,"click")&&t){var i=[e.offsetX,e.offsetY];if(Math.pow(t[0]-i[0],2)+Math.pow(t[1]-i[1],2)>5)return;var n=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);"none"!==n.behavior&&this._dispatchExpand({axisExpandWindow:n.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!this._mouseDownPoint&&uG(this,"mousemove")){var t=this._model,i=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),n=i.behavior;"jump"===n&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===n?null:{axisExpandWindow:i.axisExpandWindow,animation:"jump"===n&&null})}}};function uG(e,t){var i=e._model;return i.get("axisExpandable")&&i.get("axisExpandTriggerOn")===t}rG.registerPreprocessor(sG);var hG=g,cG=hG.each,dG=hG.createHashMap,fG=vx;um.extend({type:"series.parallel",dependencies:["parallel"],visualColorAccessPath:"lineStyle.color",getInitialData:function(e,t){var i=this.getSource();return function(e,t){if(!e.encodeDefine){var i=t.ecModel.getComponent("parallel",t.get("parallelIndex"));if(i){var n=e.encodeDefine=dG();cG(i.dimensions,(function(e){var t=+e.replace("dim","");n.set(e,t)}))}}}(i,this),fG(i,this)},getRawIndicesByActiveState:function(e){var t=this.coordinateSystem,i=this.getData(),n=[];return t.eachActiveState(i,(function(t,r){e===t&&n.push(i.getRawIndex(r))})),n},defaultOption:{zlevel:0,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"}});var pG=No;function gG(e,t,i,n){for(var r,a=[],o=0;o<i.length;o++){var s=i[o],l=e.get(e.mapDimension(s),t);r=l,("category"===n.getAxis(s).type?null==r:null==r||isNaN(r))||a.push(n.dataToPoint(l,s))}return a}function mG(e,t,i,n,r){var a=gG(e,i,n,r),o=new pG.Polyline({shape:{points:a},silent:!0,z2:10});return t.add(o),e.setItemGraphicEl(i,o),o}function vG(e){var t=e.get("smooth",!0);return!0===t&&(t=.3),{lineStyle:e.getModel("lineStyle").getLineStyle(),smooth:null!=t?t:.3}}function yG(e,t,i,n){var r=n.lineStyle;t.hasItemOption&&(r=t.getItemModel(i).getModel("lineStyle").getLineStyle()),e.useStyle(r);var a=e.style;a.fill=null,a.stroke=t.getItemVisual(i,"color"),a.opacity=t.getItemVisual(i,"opacity"),n.smooth&&(e.shape.smooth=n.smooth)}Om.extend({type:"parallel",init:function(){this._dataGroup=new pG.Group,this.group.add(this._dataGroup),this._data,this._initialized},render:function(e,t,i,n){var r=this._dataGroup,a=e.getData(),o=this._data,s=e.coordinateSystem,l=s.dimensions,u=vG(e);if(a.diff(o).add((function(e){yG(mG(a,r,e,l,s),a,e,u)})).update((function(t,i){var r=o.getItemGraphicEl(i),h=gG(a,t,l,s);a.setItemGraphicEl(t,r);var c=n&&!1===n.animation?null:e;pG.updateProps(r,{shape:{points:h}},c,t),yG(r,a,t,u)})).remove((function(e){var t=o.getItemGraphicEl(e);r.remove(t)})).execute(),!this._initialized){this._initialized=!0;var h=function(e,t,i){var n=e.model,r=e.getRect(),a=new pG.Rect({shape:{x:r.x,y:r.y,width:r.width,height:r.height}}),o="horizontal"===n.get("layout")?"width":"height";return a.setShape(o,0),pG.initProps(a,{shape:{width:r.width,height:r.height}},t,i),a}(s,e,(function(){setTimeout((function(){r.removeClipPath()}))}));r.setClipPath(h)}this._data=a},incrementalPrepareRender:function(e,t,i){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},incrementalRender:function(e,t,i){for(var n=t.getData(),r=t.coordinateSystem,a=r.dimensions,o=vG(t),s=e.start;s<e.end;s++){var l=mG(n,this._dataGroup,s,a,r);l.incremental=!0,yG(l,n,s,o)}},dispose:function(){},remove:function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null}});var _G=["lineStyle","normal","opacity"],xG={seriesType:"parallel",reset:function(e,t,i){var n=e.getModel("itemStyle"),r=e.getModel("lineStyle"),a=t.get("color"),o=r.get("color")||n.get("color")||a[e.seriesIndex%a.length],s=e.get("inactiveOpacity"),l=e.get("activeOpacity"),u=e.getModel("lineStyle").getLineStyle(),h=e.coordinateSystem,c=e.getData(),d={normal:u.opacity,active:l,inactive:s};return c.setVisual("color",o),{progress:function(e,t){h.eachActiveState(t,(function(e,i){var n=d[e];if("normal"===e&&t.hasItemOption){var r=t.getItemModel(i).get(_G,!0);null!=r&&(n=r)}t.setItemVisual(i,"opacity",n)}),e.start,e.end)}}}};h.registerVisual(xG);var bG=um,wG=fk,TG=qc.encodeHTML,SG=zc,MG=bG.extend({type:"series.sankey",layoutInfo:null,levelModels:null,getInitialData:function(e,t){for(var i=e.edges||e.links,n=e.data||e.nodes,r=e.levels,a=this.levelModels={},o=0;o<r.length;o++)null!=r[o].depth&&r[o].depth>=0&&(a[r[o].depth]=new SG(r[o],this,t));if(n&&i){var s=wG(n,i,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e,t){return e.customizeGetParent((function(e){var i=this.parentModel,n=i.getData().getItemLayout(t).depth;return i.levelModels[n]||this.parentModel})),e})),t.wrapMethod("getItemModel",(function(e,t){return e.customizeGetParent((function(e){var i=this.parentModel,n=i.getGraph().getEdgeByIndex(t).node1.getLayout().depth;return i.levelModels[n]||this.parentModel})),e}))}));return s.data}},setNodePosition:function(e,t){var i=this.option.data[e];i.localX=t[0],i.localY=t[1]},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},formatTooltip:function(e,t,i){if("edge"===i){var n=this.getDataParams(e,i),r=n.data,a=r.source+" -- "+r.target;return n.value&&(a+=" : "+n.value),TG(a)}if("node"===i){var o=this.getGraph().getNodeByIndex(e).getLayout().value,s=this.getDataParams(e,i).data.name;return o&&(a=s+" : "+o),TG(a)}return MG.superCall(this,"formatTooltip",e,t)},optionUpdated:function(){var e=this.option;!0===e.focusNodeAdjacency&&(e.focusNodeAdjacency="allEdges")},getDataParams:function(e,t){var i=MG.superCall(this,"getDataParams",e,t);if(null==i.value&&"node"===t){var n=this.getGraph().getNodeByIndex(e).getLayout().value;i.value=n}return i},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",layout:null,left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,focusNodeAdjacency:!1,layoutIterations:32,label:{show:!0,position:"right",color:"#000",fontSize:12},levels:[],nodeAlign:"justify",itemStyle:{borderWidth:1,borderColor:"#333"},lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},animationEasing:"linear",animationDuration:1e3}}),AG=No,IG=h,CG=g,DG=["itemStyle","opacity"],EG=["emphasis","itemStyle","opacity"],LG=["lineStyle","opacity"],PG=["emphasis","lineStyle","opacity"];function NG(e,t){return e.getVisual("opacity")||e.getModel().get(t)}function RG(e,t,i){var n=e.getGraphicEl(),r=NG(e,t);null!=i&&(null==r&&(r=1),r*=i),n.downplay&&n.downplay(),n.traverse((function(e){"group"!==e.type&&e.setStyle("opacity",r)}))}function OG(e,t){var i=NG(e,t),n=e.getGraphicEl();n.traverse((function(e){"group"!==e.type&&e.setStyle("opacity",i)})),n.highlight&&n.highlight()}var kG=AG.extendShape({shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,cpx2:0,cpy2:0,extent:0,orient:""},buildPath:function(e,t){var i=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+i,t.y2),e.bezierCurveTo(t.cpx2+i,t.cpy2,t.cpx1+i,t.cpy1,t.x1+i,t.y1)):(e.lineTo(t.x2,t.y2+i),e.bezierCurveTo(t.cpx2,t.cpy2+i,t.cpx1,t.cpy1+i,t.x1,t.y1+i)),e.closePath()},highlight:function(){this.trigger("emphasis")},downplay:function(){this.trigger("normal")}});IG.extendChartView({type:"sankey",_model:null,_focusAdjacencyDisabled:!1,render:function(e,t,i){var n=this,r=e.getGraph(),a=this.group,o=e.layoutInfo,s=o.width,l=o.height,u=e.getData(),h=e.getData("edge"),c=e.get("orient");this._model=e,a.removeAll(),a.attr("position",[o.x,o.y]),r.eachEdge((function(t){var i=new kG;i.dataIndex=t.dataIndex,i.seriesIndex=e.seriesIndex,i.dataType="edge";var n,r,o,u,d,f,p,g,m=t.getModel("lineStyle"),v=m.get("curveness"),y=t.node1.getLayout(),_=t.node1.getModel(),x=_.get("localX"),b=_.get("localY"),w=t.node2.getLayout(),T=t.node2.getModel(),S=T.get("localX"),M=T.get("localY"),A=t.getLayout();switch(i.shape.extent=Math.max(1,A.dy),i.shape.orient=c,"vertical"===c?(n=(null!=x?x*s:y.x)+A.sy,r=(null!=b?b*l:y.y)+y.dy,o=(null!=S?S*s:w.x)+A.ty,d=n,f=r*(1-v)+(u=null!=M?M*l:w.y)*v,p=o,g=r*v+u*(1-v)):(n=(null!=x?x*s:y.x)+y.dx,r=(null!=b?b*l:y.y)+A.sy,d=n*(1-v)+(o=null!=S?S*s:w.x)*v,f=r,p=n*v+o*(1-v),g=u=(null!=M?M*l:w.y)+A.ty),i.setShape({x1:n,y1:r,x2:o,y2:u,cpx1:d,cpy1:f,cpx2:p,cpy2:g}),i.setStyle(m.getItemStyle()),i.style.fill){case"source":i.style.fill=t.node1.getVisual("color");break;case"target":i.style.fill=t.node2.getVisual("color")}AG.setHoverStyle(i,t.getModel("emphasis.lineStyle").getItemStyle()),a.add(i),h.setItemGraphicEl(t.dataIndex,i)})),r.eachNode((function(t){var i=t.getLayout(),n=t.getModel(),r=n.get("localX"),o=n.get("localY"),h=n.getModel("label"),c=n.getModel("emphasis.label"),d=new AG.Rect({shape:{x:null!=r?r*s:i.x,y:null!=o?o*l:i.y,width:i.dx,height:i.dy},style:n.getModel("itemStyle").getItemStyle()}),f=t.getModel("emphasis.itemStyle").getItemStyle();AG.setLabelStyle(d.style,f,h,c,{labelFetcher:e,labelDataIndex:t.dataIndex,defaultText:t.id,isRectText:!0}),d.setStyle("fill",t.getVisual("color")),AG.setHoverStyle(d,f),a.add(d),u.setItemGraphicEl(t.dataIndex,d),d.dataType="node"})),u.eachItemGraphicEl((function(t,r){var a=u.getItemModel(r);a.get("draggable")&&(t.drift=function(t,a){n._focusAdjacencyDisabled=!0,this.shape.x+=t,this.shape.y+=a,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:e.id,dataIndex:u.getRawIndex(r),localX:this.shape.x/s,localY:this.shape.y/l})},t.ondragend=function(){n._focusAdjacencyDisabled=!1},t.draggable=!0,t.cursor="move"),t.highlight=function(){this.trigger("emphasis")},t.downplay=function(){this.trigger("normal")},t.focusNodeAdjHandler&&t.off("mouseover",t.focusNodeAdjHandler),t.unfocusNodeAdjHandler&&t.off("mouseout",t.unfocusNodeAdjHandler),a.get("focusNodeAdjacency")&&(t.on("mouseover",t.focusNodeAdjHandler=function(){n._focusAdjacencyDisabled||(n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,dataIndex:t.dataIndex}))}),t.on("mouseout",t.unfocusNodeAdjHandler=function(){n._focusAdjacencyDisabled||n._dispatchUnfocus(i)}))})),h.eachItemGraphicEl((function(t,r){var a=h.getItemModel(r);t.focusNodeAdjHandler&&t.off("mouseover",t.focusNodeAdjHandler),t.unfocusNodeAdjHandler&&t.off("mouseout",t.unfocusNodeAdjHandler),a.get("focusNodeAdjacency")&&(t.on("mouseover",t.focusNodeAdjHandler=function(){n._focusAdjacencyDisabled||(n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,edgeDataIndex:t.dataIndex}))}),t.on("mouseout",t.unfocusNodeAdjHandler=function(){n._focusAdjacencyDisabled||n._dispatchUnfocus(i)}))})),!this._data&&e.get("animation")&&a.setClipPath(function(e,t,i){var n=new AG.Rect({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return AG.initProps(n,{shape:{width:e.width+20}},t,i),n}(a.getBoundingRect(),e,(function(){a.removeClipPath()}))),this._data=e.getData()},dispose:function(){this._clearTimer()},_dispatchUnfocus:function(e){var t=this;this._clearTimer(),this._unfocusDelayTimer=setTimeout((function(){t._unfocusDelayTimer=null,e.dispatchAction({type:"unfocusNodeAdjacency",seriesId:t._model.id})}),500)},_clearTimer:function(){this._unfocusDelayTimer&&(clearTimeout(this._unfocusDelayTimer),this._unfocusDelayTimer=null)},focusNodeAdjacency:function(e,t,i,n){var r=e.getData(),a=r.graph,o=n.dataIndex,s=r.getItemModel(o),l=n.edgeDataIndex;if(null!=o||null!=l){var u=a.getNodeByIndex(o),h=a.getEdgeByIndex(l);if(a.eachNode((function(e){RG(e,DG,.1)})),a.eachEdge((function(e){RG(e,LG,.1)})),u){OG(u,EG);var c=s.get("focusNodeAdjacency");"outEdges"===c?CG.each(u.outEdges,(function(e){e.dataIndex<0||(OG(e,PG),OG(e.node2,EG))})):"inEdges"===c?CG.each(u.inEdges,(function(e){e.dataIndex<0||(OG(e,PG),OG(e.node1,EG))})):"allEdges"===c&&CG.each(u.edges,(function(e){e.dataIndex<0||(OG(e,PG),e.node1!==u&&OG(e.node1,EG),e.node2!==u&&OG(e.node2,EG))}))}h&&(OG(h,PG),OG(h.node1,EG),OG(h.node2,EG))}},unfocusNodeAdjacency:function(e,t,i,n){var r=e.getGraph();r.eachNode((function(e){RG(e,DG)})),r.eachEdge((function(e){RG(e,LG)}))}}),h.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])}))}));var zG=Hc,BG=g,FG=lo.groupData;function VG(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return null!=t.depth&&t.depth>=0}function GG(e,t,i,n,r){var a="vertical"===r?"x":"y";BG.each(e,(function(e){var o,s,l;e.sort((function(e,t){return e.getLayout()[a]-t.getLayout()[a]}));for(var u=0,h=e.length,c="vertical"===r?"dx":"dy",d=0;d<h;d++)(l=u-(s=e[d]).getLayout()[a])>0&&(o=s.getLayout()[a]+l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),u=s.getLayout()[a]+s.getLayout()[c]+t;if((l=u-t-("vertical"===r?n:i))>0)for(o=s.getLayout()[a]-l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0),u=o,d=h-2;d>=0;--d)(l=(s=e[d]).getLayout()[a]+s.getLayout()[c]+t-u)>0&&(o=s.getLayout()[a]-l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),u=s.getLayout()[a]}))}function HG(e,t,i){BG.each(e.slice().reverse(),(function(e){BG.each(e,(function(e){if(e.outEdges.length){var n=YG(e.outEdges,UG,i)/YG(e.outEdges,qG,i);if(isNaN(n)){var r=e.outEdges.length;n=r?YG(e.outEdges,WG,i)/r:0}if("vertical"===i){var a=e.getLayout().x+(n-ZG(e,i))*t;e.setLayout({x:a},!0)}else{var o=e.getLayout().y+(n-ZG(e,i))*t;e.setLayout({y:o},!0)}}}))}))}function UG(e,t){return ZG(e.node2,t)*e.getValue()}function WG(e,t){return ZG(e.node2,t)}function jG(e,t){return ZG(e.node1,t)*e.getValue()}function XG(e,t){return ZG(e.node1,t)}function ZG(e,t){return"vertical"===t?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function qG(e){return e.getValue()}function YG(e,t,i){for(var n=0,r=e.length,a=-1;++a<r;){var o=+t.call(e,e[a],i);isNaN(o)||(n+=o)}return n}function KG(e,t,i){BG.each(e,(function(e){BG.each(e,(function(e){if(e.inEdges.length){var n=YG(e.inEdges,jG,i)/YG(e.inEdges,qG,i);if(isNaN(n)){var r=e.inEdges.length;n=r?YG(e.inEdges,XG,i)/r:0}if("vertical"===i){var a=e.getLayout().x+(n-ZG(e,i))*t;e.setLayout({x:a},!0)}else{var o=e.getLayout().y+(n-ZG(e,i))*t;e.setLayout({y:o},!0)}}}))}))}var QG=function(e,t,i){e.eachSeriesByType("sankey",(function(e){var i=e.get("nodeWidth"),n=e.get("nodeGap"),r=function(e,t){return zG.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t);e.layoutInfo=r;var a=r.width,o=r.height,s=e.getGraph(),l=s.nodes,u=s.edges;!function(e){BG.each(e,(function(e){var t=YG(e.outEdges,qG),i=YG(e.inEdges,qG),n=e.getValue()||0,r=Math.max(t,i,n);e.setLayout({value:r},!0)}))}(l),function(e,t,i,n,r,a,o,s,l){(function(e,t,i,n,r,a,o){for(var s=[],l=[],u=[],h=[],c=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]);for(var f=-1;u.length;){for(var p=0;p<u.length;p++){var g=u[p],m=g.hostGraph.data.getRawDataItem(g.dataIndex),v=null!=m.depth&&m.depth>=0;v&&m.depth>f&&(f=m.depth),g.setLayout({depth:v?m.depth:c},!0),"vertical"===a?g.setLayout({dy:i},!0):g.setLayout({dx:i},!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)]&&h.indexOf(x)<0&&h.push(x)}}++c,u=h,h=[]}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=f>c-1?f:c-1;o&&"left"!==o&&function(e,t,i,n){if("right"===t){for(var r=[],a=e,o=0;a.length;){for(var s=0;s<a.length;s++){var l=a[s];l.setLayout({skNodeHeight:o},!0);for(var u=0;u<l.inEdges.length;u++){var h=l.inEdges[u];r.indexOf(h.node1)<0&&r.push(h.node1)}}a=r,r=[],++o}BG.each(e,(function(e){VG(e)||e.setLayout({depth:Math.max(0,n-e.getLayout().skNodeHeight)},!0)}))}else"justify"===t&&function(e,t){BG.each(e,(function(e){VG(e)||e.outEdges.length||e.setLayout({depth:t},!0)}))}(e,n)}(e,o,0,b),function(e,t,i){BG.each(e,(function(e){var n=e.getLayout().depth*t;"vertical"===i?e.setLayout({y:n},!0):e.setLayout({x:n},!0)}))}(e,"vertical"===a?(r-i)/b:(n-i)/b,a)})(e,t,i,r,a,s,l),function(e,t,i,n,r,a,o){var s=function(e,t){var i=[],n="vertical"===t?"y":"x",r=FG(e,(function(e){return e.getLayout()[n]}));return r.keys.sort((function(e,t){return e-t})),BG.each(r.keys,(function(e){i.push(r.buckets.get(e))})),i}(e,o);(function(e,t,i,n,r,a){var o=1/0;BG.each(e,(function(e){var t=e.length,s=0;BG.each(e,(function(e){s+=e.getLayout().value}));var l="vertical"===a?(n-(t-1)*r)/s:(i-(t-1)*r)/s;l<o&&(o=l)})),BG.each(e,(function(e){BG.each(e,(function(e,t){var i=e.getLayout().value*o;"vertical"===a?(e.setLayout({x:t},!0),e.setLayout({dx:i},!0)):(e.setLayout({y:t},!0),e.setLayout({dy:i},!0))}))})),BG.each(t,(function(e){var t=+e.getValue()*o;e.setLayout({dy:t},!0)}))})(s,t,i,n,r,o),GG(s,r,i,n,o);for(var l=1;a>0;a--)HG(s,l*=.99,o),GG(s,r,i,n,o),KG(s,l,o),GG(s,r,i,n,o)}(e,t,a,r,n,o,s),function(e,t){var i="vertical"===t?"x":"y";BG.each(e,(function(e){e.outEdges.sort((function(e,t){return e.node2.getLayout()[i]-t.node2.getLayout()[i]})),e.inEdges.sort((function(e,t){return e.node1.getLayout()[i]-t.node1.getLayout()[i]}))})),BG.each(e,(function(e){var t=0,i=0;BG.each(e.outEdges,(function(e){e.setLayout({sy:t},!0),t+=e.getLayout().dy})),BG.each(e.inEdges,(function(e){e.setLayout({ty:i},!0),i+=e.getLayout().dy}))}))}(e,s)}(l,u,i,n,a,o,0!==BG.filter(l,(function(e){return 0===e.getLayout().value})).length?0:e.get("layoutIterations"),e.get("orient"),e.get("nodeAlign"))}))},JG=yO,$G=g,eH=h,tH=QG,iH=function(e,t){e.eachSeriesByType("sankey",(function(e){var t=e.getGraph().nodes;if(t.length){var i=1/0,n=-1/0;$G.each(t,(function(e){var t=e.getLayout().value;t<i&&(i=t),t>n&&(n=t)})),$G.each(t,(function(t){var r=new JG({type:"color",mappingMethod:"linear",dataExtent:[i,n],visual:e.get("color")}).mapValueToVisual(t.getLayout().value),a=t.getModel().get("itemStyle.color");null!=a?t.setVisual("color",a):t.setVisual("color",r)}))}}))};eH.registerLayout(tH),eH.registerVisual(iH);var nH={},rH=SC,aH=g,oH=Gy.getDimensionTypeByAxis,sH=Vd.makeSeriesEncodeForAxisCoordSys,lH={_baseAxisDim:null,getInitialData:function(e,t){var i,n,r=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),o=r.get("type"),s=a.get("type");"category"===o?(e.layout="horizontal",i=r.getOrdinalMeta(),n=!0):"category"===s?(e.layout="vertical",i=a.getOrdinalMeta(),n=!0):e.layout=e.layout||"horizontal";var l=["x","y"],u="horizontal"===e.layout?0:1,h=this._baseAxisDim=l[u],c=l[1-u],d=[r,a],f=d[u].get("type"),p=d[1-u].get("type"),g=e.data;if(g&&n){var m=[];aH.each(g,(function(e,t){var i;e.value&&aH.isArray(e.value)?(i=e.value.slice(),e.value.unshift(t)):aH.isArray(e)?(i=e.slice(),e.unshift(t)):i=e,m.push(i)})),e.data=m}var v=this.defaultValueDimensions,y=[{name:h,type:oH(f),ordinalMeta:i,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:c,type:oH(p),dimsDef:v.slice()}];return rH(this,{coordDimensions:y,dimensionsCount:v.length+1,encodeDefaulter:aH.curry(sH,y,this)})},getBaseAxis:function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis}};nH.seriesModelMixin=lH;var uH=g,hH=um,cH=nH.seriesModelMixin,dH=hH.extend({type:"series.boxplot",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:2,shadowOffsetY:2,shadowColor:"rgba(0,0,0,0.4)"}},animationEasing:"elasticOut",animationDuration:800}});uH.mixin(dH,cH,!0);var fH=g,pH=No,gH=dl,mH=["itemStyle"],vH=["emphasis","itemStyle"];Om.extend({type:"boxplot",render:function(e,t,i){var n=e.getData(),r=this.group,a=this._data;this._data||r.removeAll();var o="horizontal"===e.get("layout")?1:0;n.diff(a).add((function(e){if(n.hasValue(e)){var t=_H(n.getItemLayout(e),n,e,o,!0);n.setItemGraphicEl(e,t),r.add(t)}})).update((function(e,t){var i=a.getItemGraphicEl(t);if(n.hasValue(e)){var s=n.getItemLayout(e);i?xH(s,i,n,e):i=_H(s,n,e,o),r.add(i),n.setItemGraphicEl(e,i)}else r.remove(i)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&r.remove(t)})).execute(),this._data=n},remove:function(e){var t=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl((function(e){e&&t.remove(e)}))},dispose:fH.noop});var yH=gH.extend({type:"boxplotBoxPath",shape:{},buildPath:function(e,t){var i=t.points,n=0;for(e.moveTo(i[n][0],i[n][1]),n++;n<4;n++)e.lineTo(i[n][0],i[n][1]);for(e.closePath();n<i.length;n++)e.moveTo(i[n][0],i[n][1]),n++,e.lineTo(i[n][0],i[n][1])}});function _H(e,t,i,n,r){var a=e.ends,o=new yH({shape:{points:r?bH(a,n,e):a}});return xH(e,o,t,i,r),o}function xH(e,t,i,n,r){var a=i.hostModel;(0,pH[r?"initProps":"updateProps"])(t,{shape:{points:e.ends}},a,n);var o=i.getItemModel(n),s=o.getModel(mH),l=i.getItemVisual(n,"color"),u=s.getItemStyle(["borderColor"]);u.stroke=l,u.strokeNoScale=!0,t.useStyle(u),t.z2=100;var h=o.getModel(vH).getItemStyle();pH.setHoverStyle(t,h)}function bH(e,t,i){return fH.map(e,(function(e){return(e=e.slice())[t]=i.initBaseline,e}))}var wH=["itemStyle","borderColor"],TH=function(e,t){var i=e.get("color");e.eachRawSeriesByType("boxplot",(function(t){var n=i[t.seriesIndex%i.length],r=t.getData();r.setVisual({legendSymbol:"roundRect",color:t.get(wH)||n}),e.isSeriesFiltered(t)||r.each((function(e){var t=r.getItemModel(e);r.setItemVisual(e,{color:t.get(wH,!0)})}))}))},SH=g,MH=Uc.parsePercent,AH=SH.each,IH=function(e){var t=function(e){var t=[],i=[];return e.eachSeriesByType("boxplot",(function(e){var n=e.getBaseAxis(),r=SH.indexOf(i,n);r<0&&(r=i.length,i[r]=n,t[r]={axis:n,seriesModels:[]}),t[r].seriesModels.push(e)})),t}(e);AH(t,(function(e){var t=e.seriesModels;t.length&&(function(e){var t,i,n=e.axis,r=e.seriesModels,a=r.length,o=e.boxWidthList=[],s=e.boxOffsetList=[],l=[];if("category"===n.type)i=n.getBandWidth();else{var u=0;AH(r,(function(e){u=Math.max(u,e.getData().count())})),t=n.getExtent(),Math.abs(t[1]-t[0])}AH(r,(function(e){var t=e.get("boxWidth");SH.isArray(t)||(t=[t,t]),l.push([MH(t[0],i)||0,MH(t[1],i)||0])}));var h=.8*i-2,c=h/a*.3,d=(h-c*(a-1))/a,f=d/2-h/2;AH(r,(function(e,t){s.push(f),f+=c+d,o.push(Math.min(Math.max(d,l[t][0]),l[t][1]))}))}(e),AH(t,(function(t,i){!function(e,t,i){var n=e.coordinateSystem,r=e.getData(),a=i/2,o="horizontal"===e.get("layout")?0:1,s=1-o,l=["x","y"],u=r.mapDimension(l[o]),h=r.mapDimension(l[s],!0);if(!(null==u||h.length<5))for(var c=0;c<r.count();c++){var d=r.get(u,c),f=_(d,h[2],c),p=_(d,h[0],c),g=_(d,h[1],c),m=_(d,h[3],c),v=_(d,h[4],c),y=[];x(y,g,0),x(y,m,1),y.push(p,g,v,m),b(y,p),b(y,v),b(y,f),r.setItemLayout(c,{initBaseline:f[s],ends:y})}function _(e,i,a){var l,u=r.get(i,a),h=[];return h[o]=e,h[s]=u,isNaN(e)||isNaN(u)?l=[NaN,NaN]:(l=n.dataToPoint(h))[o]+=t,l}function x(e,t,i){var n=t.slice(),r=t.slice();n[o]+=a,r[o]-=a,i?e.push(n,r):e.push(r,n)}function b(e,t){var i=t.slice(),n=t.slice();i[o]-=a,n[o]+=a,e.push(i,n)}}(t,e.boxOffsetList[i],e.boxWidthList[i])})))}))},CH=h,DH=TH,EH=IH;CH.registerVisual(DH),CH.registerLayout(EH);var LH=g,PH=um,NH=nH.seriesModelMixin,RH=PH.extend({type:"series.candlestick",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,clip:!0,itemStyle:{color:"#c23531",color0:"#314656",borderWidth:1,borderColor:"#c23531",borderColor0:"#314656"},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationUpdate:!1,animationEasing:"linear",animationDuration:300},getShadowDim:function(){return"open"},brushSelector:function(e,t,i){var n=t.getItemLayout(e);return n&&i.rect(n.brushRect)}});LH.mixin(RH,NH,!0);var OH=g,kH=Om,zH=No,BH=dl,FH=VS.createClipPath,VH=["itemStyle"],GH=["emphasis","itemStyle"],HH=["color","color0","borderColor","borderColor0"];kH.extend({type:"candlestick",render:function(e,t,i){this.group.removeClipPath(),this._updateDrawMode(e),this._isLargeDraw?this._renderLarge(e):this._renderNormal(e)},incrementalPrepareRender:function(e,t,i){this._clear(),this._updateDrawMode(e)},incrementalRender:function(e,t,i,n){this._isLargeDraw?this._incrementalRenderLarge(e,t):this._incrementalRenderNormal(e,t)},_updateDrawMode:function(e){var t=e.pipelineContext.large;(null==this._isLargeDraw||t^this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},_renderNormal:function(e){var t=e.getData(),i=this._data,n=this.group,r=t.getLayout("isSimpleBox"),a=e.get("clip",!0),o=e.coordinateSystem,s=o.getArea&&o.getArea();this._data||n.removeAll(),t.diff(i).add((function(i){if(t.hasValue(i)){var o,l=t.getItemLayout(i);if(a&&jH(s,l))return;o=WH(l,0,!0),zH.initProps(o,{shape:{points:l.ends}},e,i),XH(o,t,i,r),n.add(o),t.setItemGraphicEl(i,o)}})).update((function(o,l){var u=i.getItemGraphicEl(l);if(t.hasValue(o)){var h=t.getItemLayout(o);a&&jH(s,h)?n.remove(u):(u?zH.updateProps(u,{shape:{points:h.ends}},e,o):u=WH(h),XH(u,t,o,r),n.add(u),t.setItemGraphicEl(o,u))}else n.remove(u)})).remove((function(e){var t=i.getItemGraphicEl(e);t&&n.remove(t)})).execute(),this._data=t},_renderLarge:function(e){this._clear(),YH(e,this.group);var t=e.get("clip",!0)?FH(e.coordinateSystem,!1,e):null;t?this.group.setClipPath(t):this.group.removeClipPath()},_incrementalRenderNormal:function(e,t){for(var i,n=t.getData(),r=n.getLayout("isSimpleBox");null!=(i=e.next());){var a;XH(a=WH(n.getItemLayout(i)),n,i,r),a.incremental=!0,this.group.add(a)}},_incrementalRenderLarge:function(e,t){YH(t,this.group,!0)},remove:function(e){this._clear()},_clear:function(){this.group.removeAll(),this._data=null},dispose:OH.noop});var UH=BH.extend({type:"normalCandlestickBox",shape:{},buildPath:function(e,t){var i=t.points;this.__simpleBox?(e.moveTo(i[4][0],i[4][1]),e.lineTo(i[6][0],i[6][1])):(e.moveTo(i[0][0],i[0][1]),e.lineTo(i[1][0],i[1][1]),e.lineTo(i[2][0],i[2][1]),e.lineTo(i[3][0],i[3][1]),e.closePath(),e.moveTo(i[4][0],i[4][1]),e.lineTo(i[5][0],i[5][1]),e.moveTo(i[6][0],i[6][1]),e.lineTo(i[7][0],i[7][1]))}});function WH(e,t,i){var n=e.ends;return new UH({shape:{points:i?ZH(n,e):n},z2:100})}function jH(e,t){for(var i=!0,n=0;n<t.ends.length;n++)if(e.contain(t.ends[n][0],t.ends[n][1])){i=!1;break}return i}function XH(e,t,i,n){var r=t.getItemModel(i),a=r.getModel(VH),o=t.getItemVisual(i,"color"),s=t.getItemVisual(i,"borderColor")||o,l=a.getItemStyle(HH);e.useStyle(l),e.style.strokeNoScale=!0,e.style.fill=o,e.style.stroke=s,e.__simpleBox=n;var u=r.getModel(GH).getItemStyle();zH.setHoverStyle(e,u)}function ZH(e,t){return OH.map(e,(function(e){return(e=e.slice())[1]=t.initBaseline,e}))}var qH=BH.extend({type:"largeCandlestickBox",shape:{},buildPath:function(e,t){for(var i=t.points,n=0;n<i.length;)if(this.__sign===i[n++]){var r=i[n++];e.moveTo(r,i[n++]),e.lineTo(r,i[n++])}else n+=3}});function YH(e,t,i){var n=e.getData(),r=n.getLayout("largePoints"),a=new qH({shape:{points:r},__sign:1});t.add(a);var o=new qH({shape:{points:r},__sign:-1});t.add(o),KH(1,a,e,n),KH(-1,o,e,n),i&&(a.incremental=!0,o.incremental=!0)}function KH(e,t,i,n){var r=e>0?"P":"N",a=n.getVisual("borderColor"+r)||n.getVisual("color"+r),o=i.getModel(VH).getItemStyle(HH);t.useStyle(o),t.style.fill=null,t.style.stroke=a}var QH=g,JH=function(e){e&&QH.isArray(e.series)&&QH.each(e.series,(function(e){QH.isObject(e)&&"k"===e.type&&(e.type="candlestick")}))},$H=["itemStyle","borderColor"],eU=["itemStyle","borderColor0"],tU=["itemStyle","color"],iU=["itemStyle","color0"],nU={seriesType:"candlestick",plan:vm(),performRawSeries:!0,reset:function(e,t){if(e.getData().setVisual({legendSymbol:"roundRect",colorP:i(1,e),colorN:i(-1,e),borderColorP:n(1,e),borderColorN:n(-1,e)}),!t.isSeriesFiltered(e))return!e.pipelineContext.large&&{progress:function(e,t){for(var r;null!=(r=e.next());){var a=t.getItemModel(r),o=t.getItemLayout(r).sign;t.setItemVisual(r,{color:i(o,a),borderColor:n(o,a)})}}};function i(e,t){return t.get(e>0?tU:iU)}function n(e,t){return t.get(e>0?$H:eU)}}},rU=nU,aU=No.subPixelOptimize,oU=vm,sU=Uc.parsePercent,lU=g.retrieve2,uU="undefined"!=typeof Float32Array?Float32Array:Array,hU={seriesType:"candlestick",plan:oU(),reset:function(e){var t=e.coordinateSystem,i=e.getData(),n=function(e,t){var i,n=e.getBaseAxis(),r="category"===n.type?n.getBandWidth():(i=n.getExtent(),Math.abs(i[1]-i[0])/t.count()),a=sU(lU(e.get("barMaxWidth"),r),r),o=sU(lU(e.get("barMinWidth"),1),r),s=e.get("barWidth");return null!=s?sU(s,r):Math.max(Math.min(r/2,a),o)}(e,i),r=["x","y"],a=i.mapDimension(r[0]),o=i.mapDimension(r[1],!0),s=o[0],l=o[1],u=o[2],h=o[3];if(i.setLayout({candleWidth:n,isSimpleBox:n<=1.3}),!(null==a||o.length<4))return{progress:e.pipelineContext.large?function(e,i){for(var n,r,o=new uU(4*e.count),c=0,d=[],f=[];null!=(r=e.next());){var p=i.get(a,r),g=i.get(s,r),m=i.get(l,r),v=i.get(u,r),y=i.get(h,r);isNaN(p)||isNaN(v)||isNaN(y)?(o[c++]=NaN,c+=3):(o[c++]=cU(i,r,g,m,l),d[0]=p,d[1]=v,n=t.dataToPoint(d,null,f),o[c++]=n?n[0]:NaN,o[c++]=n?n[1]:NaN,d[1]=y,n=t.dataToPoint(d,null,f),o[c++]=n?n[1]:NaN)}i.setLayout("largePoints",o)}:function(e,i){for(var r;null!=(r=e.next());){var o=i.get(a,r),c=i.get(s,r),d=i.get(l,r),f=i.get(u,r),p=i.get(h,r),g=Math.min(c,d),m=Math.max(c,d),v=w(g,o),y=w(m,o),_=w(f,o),x=w(p,o),b=[];T(b,y,0),T(b,v,1),b.push(M(x),M(y),M(_),M(v)),i.setItemLayout(r,{sign:cU(i,r,c,d,l),initBaseline:c>d?y[1]:v[1],ends:b,brushRect:S(f,p,o)})}function w(e,i){var n=[];return n[0]=i,n[1]=e,isNaN(i)||isNaN(e)?[NaN,NaN]:t.dataToPoint(n)}function T(e,t,i){var r=t.slice(),a=t.slice();r[0]=aU(r[0]+n/2,1,!1),a[0]=aU(a[0]-n/2,1,!0),i?e.push(r,a):e.push(a,r)}function S(e,t,i){var r=w(e,i),a=w(t,i);return r[0]-=n/2,a[0]-=n/2,{x:r[0],y:r[1],width:n,height:a[1]-r[1]}}function M(e){return e[0]=aU(e[0],1),e}}}}};function cU(e,t,i,n,r){return i>n?-1:i<n?1:t>0?e.get(r,t-1)<=n?1:-1:1}var dU=h,fU=JH,pU=rU,gU=hU;dU.registerPreprocessor(fU),dU.registerVisual(pU),dU.registerLayout(gU);var mU=vx;um.extend({type:"series.effectScatter",dependencies:["grid","polar"],getInitialData:function(e,t){return mU(this.getSource(),this,{useEncodeDefaulter:!0})},brushSelector:"point",defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",rippleEffect:{period:4,scale:2.5,brushType:"fill"},symbolSize:10}});var vU=g,yU=ow.createSymbol,_U=No.Group,xU=Uc.parsePercent,bU=aS;function wU(e,t){var i=t.rippleEffectColor||t.color;e.eachChild((function(e){e.attr({z:t.z,zlevel:t.zlevel,style:{stroke:"stroke"===t.brushType?i:null,fill:"fill"===t.brushType?i:null}})}))}function TU(e,t){_U.call(this);var i=new bU(e,t),n=new _U;this.add(i),this.add(n),n.beforeUpdate=function(){this.attr(i.getScale())},this.updateData(e,t)}var SU=TU.prototype;SU.stopEffectAnimation=function(){this.childAt(1).removeAll()},SU.startEffectAnimation=function(e){for(var t=e.symbolType,i=e.color,n=this.childAt(1),r=0;r<3;r++){var a=yU(t,-1,-1,2,2,i);a.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scale:[.5,.5]});var o=-r/3*e.period+e.effectOffset;a.animate("",!0).when(e.period,{scale:[e.rippleScale/2,e.rippleScale/2]}).delay(o).start(),a.animateStyle(!0).when(e.period,{opacity:0}).delay(o).start(),n.add(a)}wU(n,e)},SU.updateEffectAnimation=function(e){for(var t=this._effectCfg,i=this.childAt(1),n=["symbolType","period","rippleScale"],r=0;r<n.length;r++){var a=n[r];if(t[a]!==e[a])return this.stopEffectAnimation(),void this.startEffectAnimation(e)}wU(i,e)},SU.highlight=function(){this.trigger("emphasis")},SU.downplay=function(){this.trigger("normal")},SU.updateData=function(e,t){var i=e.hostModel;this.childAt(0).updateData(e,t);var n=this.childAt(1),r=e.getItemModel(t),a=e.getItemVisual(t,"symbol"),o=function(e){return vU.isArray(e)||(e=[+e,+e]),e}(e.getItemVisual(t,"symbolSize")),s=e.getItemVisual(t,"color");n.attr("scale",o),n.traverse((function(e){e.attr({fill:s})}));var l=r.getShallow("symbolOffset");if(l){var u=n.position;u[0]=xU(l[0],o[0]),u[1]=xU(l[1],o[1])}var h=e.getItemVisual(t,"symbolRotate");n.rotation=(h||0)*Math.PI/180||0;var c={};if(c.showEffectOn=i.get("showEffectOn"),c.rippleScale=r.get("rippleEffect.scale"),c.brushType=r.get("rippleEffect.brushType"),c.period=1e3*r.get("rippleEffect.period"),c.effectOffset=t/e.count(),c.z=r.getShallow("z")||0,c.zlevel=r.getShallow("zlevel")||0,c.symbolType=a,c.color=s,c.rippleEffectColor=r.get("rippleEffect.color"),this.off("mouseover").off("mouseout").off("emphasis").off("normal"),"render"===c.showEffectOn)this._effectCfg?this.updateEffectAnimation(c):this.startEffectAnimation(c),this._effectCfg=c;else{this._effectCfg=null,this.stopEffectAnimation();var d=this.childAt(0),f=function(){d.highlight(),"render"!==c.showEffectOn&&this.startEffectAnimation(c)},p=function(){d.downplay(),"render"!==c.showEffectOn&&this.stopEffectAnimation()};this.on("mouseover",f,this).on("mouseout",p,this).on("emphasis",f,this).on("normal",p,this)}this._effectCfg=c},SU.fadeOut=function(e){this.off("mouseover").off("mouseout").off("emphasis").off("normal"),e&&e()},vU.inherits(TU,_U);var MU=pS,AU=TU,IU=Ue,CU=_M;h.extendChartView({type:"effectScatter",init:function(){this._symbolDraw=new MU(AU)},render:function(e,t,i){var n=e.getData(),r=this._symbolDraw;r.updateData(n),this.group.add(r.group)},updateTransform:function(e,t,i){var n=e.getData();this.group.dirty();var r=CU().reset(e);r.progress&&r.progress({start:0,end:n.count()},n),this._symbolDraw.updateLayout(n)},_updateGroupTransform:function(e){var t=e.coordinateSystem;t&&t.getRoamTransform&&(this.group.transform=IU.clone(t.getRoamTransform()),this.group.decomposeTransform())},remove:function(e,t){this._symbolDraw&&this._symbolDraw.remove(t)},dispose:function(){}});var DU=h,EU=gM,LU=_M;DU.registerVisual(EU("effectScatter","circle")),DU.registerLayout(LU("effectScatter"));var PU=um,NU=A_,RU=g,OU=RU.concatArray,kU=RU.mergeAll,zU=RU.map,BU=qc.encodeHTML,FU="undefined"==typeof Uint32Array?Array:Uint32Array,VU="undefined"==typeof Float64Array?Array:Float64Array;function GU(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=zU(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),kU([t,e[0],e[1]])})))}var HU=PU.extend({type:"series.lines",dependencies:["grid","polar"],visualColorAccessPath:"lineStyle.color",init:function(e){e.data=e.data||[],GU(e);var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),HU.superApply(this,"init",arguments)},mergeOption:function(e){if(GU(e),e.data){var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count))}HU.superApply(this,"mergeOption",arguments)},appendData:function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=OU(this._flatCoords,t.flatCoords),this._flatCoordsOffset=OU(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);return t.option instanceof Array?t.option:t.getShallow("coords")},getLineCoordsCount:function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},getLineCoords:function(e,t){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[2*e],n=this._flatCoordsOffset[2*e+1],r=0;r<n;r++)t[r]=t[r]||[],t[r][0]=this._flatCoords[i+2*r],t[r][1]=this._flatCoords[i+2*r+1];return n}var a=this._getCoordsFromItemModel(e);for(r=0;r<a.length;r++)t[r]=t[r]||[],t[r][0]=a[r][0],t[r][1]=a[r][1];return a.length},_processFlatCoordsArray:function(e){var t=0;if(this._flatCoords&&(t=this._flatCoords.length),"number"==typeof e[0]){for(var i=e.length,n=new FU(i),r=new VU(i),a=0,o=0,s=0,l=0;l<i;){s++;var u=e[l++];n[o++]=a+t,n[o++]=u;for(var h=0;h<u;h++){var c=e[l++],d=e[l++];r[a++]=c,r[a++]=d}}return{flatCoordsOffset:new Uint32Array(n.buffer,0,o),flatCoords:r,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},getInitialData:function(e,t){var i=new NU(["value"],this);return i.hasItemOption=!1,i.initData(e.data,[],(function(e,t,n,r){if(e instanceof Array)return NaN;i.hasItemOption=!0;var a=e.value;return null!=a?a instanceof Array?a[r]:a:void 0})),i},formatTooltip:function(e){var t=this.getData().getItemModel(e),i=t.get("name");if(i)return i;var n=t.get("fromName"),r=t.get("toName"),a=[];return null!=n&&a.push(n),null!=r&&a.push(r),BU(a.join(" > "))},preventIncremental:function(){return!!this.get("effect.show")},getProgressive:function(){var e=this.option.progressive;return null==e?this.option.large?1e4:this.get("progressive"):e},getProgressiveThreshold:function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?2e4:this.get("progressiveThreshold"):e},defaultOption:{coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!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}}}),UU=No,WU=Jk,jU=g,XU=ow.createSymbol,ZU=V,qU=Oo;function YU(e,t,i){UU.Group.call(this),this.add(this.createLine(e,t,i)),this._updateEffectSymbol(e,t)}var KU=YU.prototype;KU.createLine=function(e,t,i){return new WU(e,t,i)},KU._updateEffectSymbol=function(e,t){var i=e.getItemModel(t).getModel("effect"),n=i.get("symbolSize"),r=i.get("symbol");jU.isArray(n)||(n=[n,n]);var a=i.get("color")||e.getItemVisual(t,"color"),o=this.childAt(1);this._symbolType!==r&&(this.remove(o),(o=XU(r,-.5,-.5,1,1,a)).z2=100,o.culling=!0,this.add(o)),o&&(o.setStyle("shadowColor",a),o.setStyle(i.getItemStyle(["color"])),o.attr("scale",n),o.setColor(a),o.attr("scale",n),this._symbolType=r,this._symbolScale=n,this._updateEffectAnimation(e,i,t))},KU._updateEffectAnimation=function(e,t,i){var n=this.childAt(1);if(n){var r=this,a=e.getItemLayout(i),o=1e3*t.get("period"),s=t.get("loop"),l=t.get("constantSpeed"),u=jU.retrieve(t.get("delay"),(function(t){return t/e.count()*o/3})),h="function"==typeof u;if(n.ignore=!0,this.updateAnimationPoints(n,a),l>0&&(o=this.getLineLength(n)/l*1e3),o!==this._period||s!==this._loop){n.stopAnimation();var c=u;h&&(c=u(i)),n.__t>0&&(c=-o*n.__t),n.__t=0;var d=n.animate("",s).when(o,{__t:1}).delay(c).during((function(){r.updateSymbolPosition(n)}));s||d.done((function(){r.remove(n)})),d.start()}this._period=o,this._loop=s}},KU.getLineLength=function(e){return ZU.dist(e.__p1,e.__cp1)+ZU.dist(e.__cp1,e.__p2)},KU.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]},KU.updateData=function(e,t,i){this.childAt(0).updateData(e,t,i),this._updateEffectSymbol(e,t)},KU.updateSymbolPosition=function(e){var t=e.__p1,i=e.__p2,n=e.__cp1,r=e.__t,a=e.position,o=[a[0],a[1]],s=qU.quadraticAt,l=qU.quadraticDerivativeAt;a[0]=s(t[0],n[0],i[0],r),a[1]=s(t[1],n[1],i[1],r);var u=l(t[0],n[0],i[0],r),h=l(t[1],n[1],i[1],r);if(e.rotation=-Math.atan2(h,u)-Math.PI/2,"line"===this._symbolType||"rect"===this._symbolType||"roundRect"===this._symbolType)if(void 0!==e.__lastT&&e.__lastT<e.__t){var c=1.05*ZU.dist(o,a);e.attr("scale",[e.scale[0],c]),1===r&&(a[0]=o[0]+(a[0]-o[0])/2,a[1]=o[1]+(a[1]-o[1])/2)}else 1===e.__lastT?(c=2*ZU.dist(t,a),e.attr("scale",[e.scale[0],c])):e.attr("scale",this._symbolScale);e.__lastT=e.__t,e.ignore=!1},KU.updateLayout=function(e,t){this.childAt(0).updateLayout(e,t);var i=e.getItemModel(t).getModel("effect");this._updateEffectAnimation(e,i,t)},jU.inherits(YU,UU.Group);var QU=YU,JU=No,$U=g;function eW(e,t,i){JU.Group.call(this),this._createPolyline(e,t,i)}var tW=eW.prototype;tW._createPolyline=function(e,t,i){var n=e.getItemLayout(t),r=new JU.Polyline({shape:{points:n}});this.add(r),this._updateCommonStl(e,t,i)},tW.updateData=function(e,t,i){var n=e.hostModel,r=this.childAt(0),a={shape:{points:e.getItemLayout(t)}};JU.updateProps(r,a,n,t),this._updateCommonStl(e,t,i)},tW._updateCommonStl=function(e,t,i){var n=this.childAt(0),r=e.getItemModel(t),a=e.getItemVisual(t,"color"),o=i&&i.lineStyle,s=i&&i.hoverLineStyle;i&&!e.hasItemOption||(o=r.getModel("lineStyle").getLineStyle(),s=r.getModel("emphasis.lineStyle").getLineStyle()),n.useStyle($U.defaults({strokeNoScale:!0,fill:"none",stroke:a},o)),n.hoverStyle=s,JU.setHoverStyle(this)},tW.updateLayout=function(e,t){this.childAt(0).setShape("points",e.getItemLayout(t))},$U.inherits(eW,JU.Group);var iW=eW,nW=iW,rW=g,aW=QU,oW=V;function sW(e,t,i){aW.call(this,e,t,i),this._lastFrame=0,this._lastFramePercent=0}var lW=sW.prototype;lW.createLine=function(e,t,i){return new nW(e,t,i)},lW.updateAnimationPoints=function(e,t){this._points=t;for(var i=[0],n=0,r=1;r<t.length;r++){var a=t[r-1],o=t[r];n+=oW.dist(a,o),i.push(n)}if(0!==n){for(r=0;r<i.length;r++)i[r]/=n;this._offsets=i,this._length=n}},lW.getLineLength=function(e){return this._length},lW.updateSymbolPosition=function(e){var t=e.__t,i=this._points,n=this._offsets,r=i.length;if(n){var a=this._lastFrame;if(t<this._lastFramePercent){for(o=Math.min(a+1,r-1);o>=0&&!(n[o]<=t);o--);o=Math.min(o,r-2)}else{for(var o=a;o<r&&!(n[o]>t);o++);o=Math.min(o-1,r-2)}oW.lerp(e.position,i[o],i[o+1],(t-n[o])/(n[o+1]-n[o]));var s=i[o+1][0]-i[o][0],l=i[o+1][1]-i[o][1];e.rotation=-Math.atan2(l,s)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=t,e.ignore=!1}},rW.inherits(sW,aW);var uW=sW,hW=No,cW=rh,dW=Ls,fW=Rs,pW=hW.extendShape({shape:{polyline:!1,curveness:0,segs:[]},buildPath:function(e,t){var i=t.segs,n=t.curveness;if(t.polyline)for(var r=0;r<i.length;){var a=i[r++];if(a>0){e.moveTo(i[r++],i[r++]);for(var o=1;o<a;o++)e.lineTo(i[r++],i[r++])}}else for(r=0;r<i.length;){var s=i[r++],l=i[r++],u=i[r++],h=i[r++];if(e.moveTo(s,l),n>0){var c=(s+u)/2-(l-h)*n,d=(l+h)/2-(u-s)*n;e.quadraticCurveTo(c,d,u,h)}else e.lineTo(u,h)}},findDataIndex:function(e,t){var i=this.shape,n=i.segs,r=i.curveness;if(i.polyline)for(var a=0,o=0;o<n.length;){var s=n[o++];if(s>0)for(var l=n[o++],u=n[o++],h=1;h<s;h++){var c=n[o++],d=n[o++];if(dW.containStroke(l,u,c,d))return a}a++}else for(a=0,o=0;o<n.length;){if(l=n[o++],u=n[o++],c=n[o++],d=n[o++],r>0){var f=(l+c)/2-(u-d)*r,p=(u+d)/2-(c-l)*r;if(fW.containStroke(l,u,f,p,c,d))return a}else if(dW.containStroke(l,u,c,d))return a;a++}return-1}});function gW(){this.group=new hW.Group}var mW=gW.prototype;mW.isPersistent=function(){return!this._incremental},mW.updateData=function(e){this.group.removeAll();var t=new pW({rectHover:!0,cursor:"default"});t.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(t,e),this.group.add(t),this._incremental=null},mW.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>5e5?(this._incremental||(this._incremental=new cW({silent:!0})),this.group.add(this._incremental)):this._incremental=null},mW.incrementalUpdate=function(e,t){var i=new pW;i.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(i,t,!!this._incremental),this._incremental?this._incremental.addDisplayable(i,!0):(i.rectHover=!0,i.cursor="default",i.__startIndex=e.start,this.group.add(i))},mW.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},mW._setCommon=function(e,t,i){var n=t.hostModel;e.setShape({polyline:n.get("polyline"),curveness:n.get("lineStyle.curveness")}),e.useStyle(n.getModel("lineStyle").getLineStyle()),e.style.strokeNoScale=!0;var r=t.getVisual("color");r&&e.setStyle("stroke",r),e.setStyle("fill"),i||(e.seriesIndex=n.seriesIndex,e.on("mousemove",(function(t){e.dataIndex=null;var i=e.findDataIndex(t.offsetX,t.offsetY);i>0&&(e.dataIndex=i+e.__startIndex)})))},mW._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var vW=gW,yW={seriesType:"lines",plan:vm(),reset:function(e){var t=e.coordinateSystem,i=e.get("polyline"),n=e.pipelineContext.large;return{progress:function(r,a){var o=[];if(n){var s,l=r.end-r.start;if(i){for(var u=0,h=r.start;h<r.end;h++)u+=e.getLineCoordsCount(h);s=new Float32Array(l+2*u)}else s=new Float32Array(4*l);var c=0,d=[];for(h=r.start;h<r.end;h++){var f=e.getLineCoords(h,o);i&&(s[c++]=f);for(var p=0;p<f;p++)d=t.dataToPoint(o[p],!1,d),s[c++]=d[0],s[c++]=d[1]}a.setLayout("linesPoints",s)}else for(h=r.start;h<r.end;h++){var g=a.getItemModel(h),m=(f=e.getLineCoords(h,o),[]);if(i)for(var v=0;v<f;v++)m.push(t.dataToPoint(o[v]));else{m[0]=t.dataToPoint(o[0]),m[1]=t.dataToPoint(o[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])}a.setItemLayout(h,m)}}}}},_W=yW,xW=h,bW=oz,wW=QU,TW=Jk,SW=iW,MW=uW,AW=vW,IW=_W,CW=VS.createClipPath;function DW(e){return e instanceof Array||(e=[e,e]),e}xW.extendChartView({type:"lines",init:function(){},render:function(e,t,i){var n=e.getData(),r=this._updateLineDraw(n,e),a=e.get("zlevel"),o=e.get("effect.trailLength"),s=i.getZr(),l="svg"===s.painter.getType();l||s.painter.getLayer(a).clear(!0),null==this._lastZlevel||l||s.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(e)&&o&&(l||s.configLayer(a,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(o/10+.9,1),0)})),r.updateData(n);var u=e.get("clip",!0)&&CW(e.coordinateSystem,!1,e);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=a,this._finished=!0},incrementalPrepareRender:function(e,t,i){var n=e.getData();this._updateLineDraw(n,e).incrementalPrepareUpdate(n),this._clearLayer(i),this._finished=!1},incrementalRender:function(e,t,i){this._lineDraw.incrementalUpdate(e,t.getData()),this._finished=e.end===t.getData().count()},updateTransform:function(e,t,i){var n=e.getData(),r=e.pipelineContext;if(!this._finished||r.large||r.progressiveRender)return{update:!0};var a=IW.reset(e);a.progress&&a.progress({start:0,end:n.count()},n),this._lineDraw.updateLayout(),this._clearLayer(i)},_updateLineDraw:function(e,t){var i=this._lineDraw,n=this._showEffect(t),r=!!t.get("polyline"),a=t.pipelineContext.large;return i&&n===this._hasEffet&&r===this._isPolyline&&a===this._isLargeDraw||(i&&i.remove(),i=this._lineDraw=a?new AW:new bW(r?n?MW:SW:n?wW:TW),this._hasEffet=n,this._isPolyline=r,this._isLargeDraw=a,this.group.removeAll()),this.group.add(i.group),i},_showEffect:function(e){return!!e.get("effect.show")},_clearLayer:function(e){var t=e.getZr();"svg"===t.painter.getType()||null==this._lastZlevel||t.painter.getLayer(this._lastZlevel).clear(!0)},remove:function(e,t){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(t)},dispose:function(){}});var EW="lineStyle.opacity".split("."),LW=h,PW=_W,NW={seriesType:"lines",reset:function(e,t,i){var n=DW(e.get("symbol")),r=DW(e.get("symbolSize")),a=e.getData();return a.setVisual("fromSymbol",n&&n[0]),a.setVisual("toSymbol",n&&n[1]),a.setVisual("fromSymbolSize",r&&r[0]),a.setVisual("toSymbolSize",r&&r[1]),a.setVisual("opacity",e.get(EW)),{dataEach:a.hasItemOption?function(e,t){var i=e.getItemModel(t),n=DW(i.getShallow("symbol",!0)),r=DW(i.getShallow("symbolSize",!0)),a=i.get(EW);n[0]&&e.setItemVisual(t,"fromSymbol",n[0]),n[1]&&e.setItemVisual(t,"toSymbol",n[1]),r[0]&&e.setItemVisual(t,"fromSymbolSize",r[0]),r[1]&&e.setItemVisual(t,"toSymbolSize",r[1]),e.setItemVisual(t,"opacity",a)}:null}}};LW.registerLayout(PW),LW.registerVisual(NW);var RW=vx,OW=sp;um.extend({type:"series.heatmap",getInitialData:function(e,t){return RW(this.getSource(),this,{generateCoord:"value"})},preventIncremental:function(){var e=OW.get(this.get("coordinateSystem"));if(e&&e.dimensions)return"lng"===e.dimensions[0]&&"lat"===e.dimensions[1]},defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0}});var kW=g;function zW(){var e=kW.createCanvas();this.canvas=e,this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={}}zW.prototype={update:function(e,t,i,n,r,a){var o=this._getBrush(),s=this._getGradient(e,r,"inRange"),l=this._getGradient(e,r,"outOfRange"),u=this.pointSize+this.blurSize,h=this.canvas,c=h.getContext("2d"),d=e.length;h.width=t,h.height=i;for(var f=0;f<d;++f){var p=e[f],g=p[0],m=p[1],v=n(p[2]);c.globalAlpha=v,c.drawImage(o,g-u,m-u)}if(!h.width||!h.height)return h;for(var y=c.getImageData(0,0,h.width,h.height),_=y.data,x=0,b=_.length,w=this.minOpacity,T=this.maxOpacity-w;x<b;){v=_[x+3]/256;var S=4*Math.floor(255*v);if(v>0){var M=a(v)?s:l;v>0&&(v=v*T+w),_[x++]=M[S],_[x++]=M[S+1],_[x++]=M[S+2],_[x++]=M[S+3]*v*256}else x+=4}return c.putImageData(y,0,0),h},_getBrush:function(){var e=this._brushCanvas||(this._brushCanvas=kW.createCanvas()),t=this.pointSize+this.blurSize,i=2*t;e.width=i,e.height=i;var n=e.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-t,t,this.pointSize,0,2*Math.PI,!0),n.closePath(),n.fill(),e},_getGradient:function(e,t,i){for(var n=this._gradientPixels,r=n[i]||(n[i]=new Uint8ClampedArray(1024)),a=[0,0,0,0],o=0,s=0;s<256;s++)t[i](s/255,!0,a),r[o++]=a[0],r[o++]=a[1],r[o++]=a[2],r[o++]=a[3];return r}};var BW=No,FW=zW,VW=g;h.extendChartView({type:"heatmap",render:function(e,t,i){var n;t.eachComponent("visualMap",(function(t){t.eachTargetSeries((function(i){i===e&&(n=t)}))})),this.group.removeAll(),this._incrementalDisplayable=null;var r=e.coordinateSystem;"cartesian2d"===r.type||"calendar"===r.type?this._renderOnCartesianAndCalendar(e,i,0,e.getData().count()):function(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}(r)&&this._renderOnGeo(r,e,n,i)},incrementalPrepareRender:function(e,t,i){this.group.removeAll()},incrementalRender:function(e,t,i,n){t.coordinateSystem&&this._renderOnCartesianAndCalendar(t,n,e.start,e.end,!0)},_renderOnCartesianAndCalendar:function(e,t,i,n,r){var a,o,s=e.coordinateSystem;if("cartesian2d"===s.type){var l=s.getAxis("x"),u=s.getAxis("y");a=l.getBandWidth(),o=u.getBandWidth()}for(var h=this.group,c=e.getData(),d="itemStyle",f="emphasis.itemStyle",p="label",g="emphasis.label",m=e.getModel(d).getItemStyle(["color"]),v=e.getModel(f).getItemStyle(),y=e.getModel(p),_=e.getModel(g),x=s.type,b="cartesian2d"===x?[c.mapDimension("x"),c.mapDimension("y"),c.mapDimension("value")]:[c.mapDimension("time"),c.mapDimension("value")],w=i;w<n;w++){var T;if("cartesian2d"===x){if(isNaN(c.get(b[2],w)))continue;var S=s.dataToPoint([c.get(b[0],w),c.get(b[1],w)]);T=new BW.Rect({shape:{x:Math.floor(Math.round(S[0])-a/2),y:Math.floor(Math.round(S[1])-o/2),width:Math.ceil(a),height:Math.ceil(o)},style:{fill:c.getItemVisual(w,"color"),opacity:c.getItemVisual(w,"opacity")}})}else{if(isNaN(c.get(b[1],w)))continue;T=new BW.Rect({z2:1,shape:s.dataToRect([c.get(b[0],w)]).contentShape,style:{fill:c.getItemVisual(w,"color"),opacity:c.getItemVisual(w,"opacity")}})}var M=c.getItemModel(w);c.hasItemOption&&(m=M.getModel(d).getItemStyle(["color"]),v=M.getModel(f).getItemStyle(),y=M.getModel(p),_=M.getModel(g));var A=e.getRawValue(w),I="-";A&&null!=A[2]&&(I=A[2]),BW.setLabelStyle(m,v,y,_,{labelFetcher:e,labelDataIndex:w,defaultText:I,isRectText:!0}),T.setStyle(m),BW.setHoverStyle(T,c.hasItemOption?v:VW.extend({},v)),T.incremental=r,r&&(T.useHoverLayer=!0),h.add(T),c.setItemGraphicEl(w,T)}},_renderOnGeo:function(e,t,i,n){var r=i.targetVisuals.inRange,a=i.targetVisuals.outOfRange,o=t.getData(),s=this._hmLayer||this._hmLayer||new FW;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 h=Math.max(l.x,0),c=Math.max(l.y,0),d=Math.min(l.width+l.x,n.getWidth()),f=Math.min(l.height+l.y,n.getHeight()),p=d-h,g=f-c,m=[o.mapDimension("lng"),o.mapDimension("lat"),o.mapDimension("value")],v=o.mapArray(m,(function(t,i,n){var r=e.dataToPoint([t,i]);return r[0]-=h,r[1]-=c,r.push(n),r})),y=i.getExtent(),_="visualMap.continuous"===i.type?function(e,t){var i=e[1]-e[0];return t=[(t[0]-e[0])/i,(t[1]-e[0])/i],function(e){return e>=t[0]&&e<=t[1]}}(y,i.option.range):function(e,t,i){var n=e[1]-e[0],r=(t=VW.map(t,(function(t){return{interval:[(t.interval[0]-e[0])/n,(t.interval[1]-e[0])/n]}}))).length,a=0;return function(e){for(var n=a;n<r;n++)if((o=t[n].interval)[0]<=e&&e<=o[1]){a=n;break}if(n===r)for(n=a-1;n>=0;n--){var o;if((o=t[n].interval)[0]<=e&&e<=o[1]){a=n;break}}return n>=0&&n<r&&i[n]}}(y,i.getPieceList(),i.option.selected);s.update(v,p,g,r.color.getNormalizer(),{inRange:r.color.getColorMapper(),outOfRange:a.color.getColorMapper()},_);var x=new BW.Image({style:{width:p,height:g,x:h,y:c,image:s.canvas},silent:!0});this.group.add(x)},dispose:function(){}});var GW=RI.extend({type:"series.pictorialBar",dependencies:["grid"],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%",progressive:0,hoverAnimation:!1},getInitialData:function(e){return e.stack=null,GW.superApply(this,"getInitialData",arguments)}}),HW=h,UW=g,WW=No,jW=ow.createSymbol,XW=Uc,ZW=XW.parsePercent,qW=XW.isNumeric,YW=OI.setLabel,KW=["itemStyle","borderWidth"],QW=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],JW=new WW.Circle;function $W(e,t,i,n){var r=e.getItemLayout(t),a=i.get("symbolRepeat"),o=i.get("symbolClip"),s=i.get("symbolPosition")||"start",l=(i.get("symbolRotate")||0)*Math.PI/180||0,u=i.get("symbolPatternSize")||2,h=i.isAnimationEnabled(),c={dataIndex:t,layout:r,itemModel:i,symbolType:e.getItemVisual(t,"symbol")||"circle",color:e.getItemVisual(t,"color"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:i.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:h?i:null,hoverAnimation:h&&i.get("hoverAnimation"),z2:i.getShallow("z",!0)||0};!function(e,t,i,n,r){var a,o=n.valueDim,s=e.get("symbolBoundingData"),l=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),h=1-+(i[o.wh]<=0);if(UW.isArray(s)){var c=[ej(l,s[0])-u,ej(l,s[1])-u];c[1]<c[0]&&c.reverse(),a=c[h]}else a=null!=s?ej(l,s)-u:t?n.coordSysExtent[o.index][h]-u:i[o.wh];r.boundingLength=a,t&&(r.repeatCutLength=i[o.wh]),r.pxSign=a>0?1:a<0?-1:0}(i,a,r,n,c),function(e,t,i,n,r,a,o,s,l,u){var h=l.valueDim,c=l.categoryDim,d=Math.abs(i[c.wh]),f=e.getItemVisual(t,"symbolSize");UW.isArray(f)?f=f.slice():(null==f&&(f="100%"),f=[f,f]),f[c.index]=ZW(f[c.index],d),f[h.index]=ZW(f[h.index],n?d:Math.abs(a)),u.symbolSize=f,(u.symbolScale=[f[0]/s,f[1]/s])[h.index]*=(l.isHorizontal?-1:1)*o}(e,t,r,a,0,c.boundingLength,c.pxSign,u,n,c),function(e,t,i,n,r){var a=e.get(KW)||0;a&&(JW.attr({scale:t.slice(),rotation:i}),JW.updateTransform(),a/=JW.getLineScale(),a*=t[n.valueDim.index]),r.valueLineWidth=a}(i,c.symbolScale,l,n,c);var d=c.symbolSize,f=i.get("symbolOffset");return UW.isArray(f)&&(f=[ZW(f[0],d[0]),ZW(f[1],d[1])]),function(e,t,i,n,r,a,o,s,l,u,h,c){var d=h.categoryDim,f=h.valueDim,p=c.pxSign,g=Math.max(t[f.index]+s,0),m=g;if(n){var v=Math.abs(l),y=UW.retrieve(e.get("symbolMargin"),"15%")+"",_=!1;y.lastIndexOf("!")===y.length-1&&(_=!0,y=y.slice(0,y.length-1)),y=ZW(y,t[f.index]);var x=Math.max(g+2*y,0),b=_?0:2*y,w=qW(n),T=w?n:mj((v+b)/x);x=g+2*(y=(v-T*g)/2/(_?T:T-1)),b=_?0:2*y,w||"fixed"===n||(T=u?mj((Math.abs(u)+b)/x):0),m=T*x-b,c.repeatTimes=T,c.symbolMargin=y}var S=p*(m/2),M=c.pathPosition=[];M[d.index]=i[d.wh]/2,M[f.index]="start"===o?S:"end"===o?l-S:l/2,a&&(M[0]+=a[0],M[1]+=a[1]);var A=c.bundlePosition=[];A[d.index]=i[d.xy],A[f.index]=i[f.xy];var I=c.barRectShape=UW.extend({},i);I[f.wh]=p*Math.max(Math.abs(i[f.wh]),Math.abs(M[f.index]+S)),I[d.wh]=i[d.wh];var C=c.clipShape={};C[d.xy]=-i[d.xy],C[d.wh]=h.ecSize[d.wh],C[f.xy]=0,C[f.wh]=i[f.wh]}(i,d,r,a,0,f,s,c.valueLineWidth,c.boundingLength,c.repeatCutLength,n,c),c}function ej(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function tj(e){var t=e.symbolPatternSize,i=jW(e.symbolType,-t/2,-t/2,t,t,e.color);return i.attr({culling:!0}),"image"!==i.type&&i.setStyle({strokeNoScale:!0}),i}function ij(e,t,i,n){var r=e.__pictorialBundle,a=i.symbolSize,o=i.valueLineWidth,s=i.pathPosition,l=t.valueDim,u=i.repeatTimes||0,h=0,c=a[t.valueDim.index]+o+2*i.symbolMargin;for(fj(e,(function(e){e.__pictorialAnimationIndex=h,e.__pictorialRepeatTimes=u,h<u?pj(e,null,p(h),i,n):pj(e,null,{scale:[0,0]},i,n,(function(){r.remove(e)})),uj(e,i),h++}));h<u;h++){var d=tj(i);d.__pictorialAnimationIndex=h,d.__pictorialRepeatTimes=u,r.add(d);var f=p(h);pj(d,{position:f.position,scale:[0,0]},{scale:f.scale,rotation:f.rotation},i,n),d.on("mouseover",g).on("mouseout",m),uj(d,i)}function p(e){var t=s.slice(),n=i.pxSign,r=e;return("start"===i.symbolRepeatDirection?n>0:n<0)&&(r=u-1-e),t[l.index]=c*(r-u/2+.5)+s[l.index],{position:t,scale:i.symbolScale.slice(),rotation:i.rotation}}function g(){fj(e,(function(e){e.trigger("emphasis")}))}function m(){fj(e,(function(e){e.trigger("normal")}))}}function nj(e,t,i,n){var r=e.__pictorialBundle,a=e.__pictorialMainPath;a?pj(a,null,{position:i.pathPosition.slice(),scale:i.symbolScale.slice(),rotation:i.rotation},i,n):(a=e.__pictorialMainPath=tj(i),r.add(a),pj(a,{position:i.pathPosition.slice(),scale:[0,0],rotation:i.rotation},{scale:i.symbolScale.slice()},i,n),a.on("mouseover",(function(){this.trigger("emphasis")})).on("mouseout",(function(){this.trigger("normal")}))),uj(a,i)}function rj(e,t,i){var n=UW.extend({},t.barRectShape),r=e.__pictorialBarRect;r?pj(r,null,{shape:n},t,i):(r=e.__pictorialBarRect=new WW.Rect({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),e.add(r))}function aj(e,t,i,n){if(i.symbolClip){var r=e.__pictorialClipPath,a=UW.extend({},i.clipShape),o=t.valueDim,s=i.animationModel,l=i.dataIndex;if(r)WW.updateProps(r,{shape:a},s,l);else{a[o.wh]=0,r=new WW.Rect({shape:a}),e.__pictorialBundle.setClipPath(r),e.__pictorialClipPath=r;var u={};u[o.wh]=i.clipShape[o.wh],WW[n?"updateProps":"initProps"](r,{shape:u},s,l)}}}function oj(e,t){var i=e.getItemModel(t);return i.getAnimationDelayParams=sj,i.isAnimationEnabled=lj,i}function sj(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function lj(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function uj(e,t){e.off("emphasis").off("normal");var i=t.symbolScale.slice();t.hoverAnimation&&e.on("emphasis",(function(){this.animateTo({scale:[1.1*i[0],1.1*i[1]]},400,"elasticOut")})).on("normal",(function(){this.animateTo({scale:i.slice()},400,"elasticOut")}))}function hj(e,t,i,n){var r=new WW.Group,a=new WW.Group;return r.add(a),r.__pictorialBundle=a,a.attr("position",i.bundlePosition.slice()),i.symbolRepeat?ij(r,t,i):nj(r,0,i),rj(r,i,n),aj(r,t,i,n),r.__pictorialShapeStr=dj(e,i),r.__pictorialSymbolMeta=i,r}function cj(e,t,i,n){var r=n.__pictorialBarRect;r&&(r.style.text=null);var a=[];fj(n,(function(e){a.push(e)})),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(i=null),UW.each(a,(function(e){WW.updateProps(e,{scale:[0,0]},i,t,(function(){n.parent&&n.parent.remove(n)}))})),e.setItemGraphicEl(t,null)}function dj(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function fj(e,t,i){UW.each(e.__pictorialBundle.children(),(function(n){n!==e.__pictorialBarRect&&t.call(i,n)}))}function pj(e,t,i,n,r,a){t&&e.attr(t),n.symbolClip&&!r?i&&e.attr(i):i&&WW[r?"updateProps":"initProps"](e,i,n.animationModel,n.dataIndex,a)}function gj(e,t,i){var n=i.color,r=i.dataIndex,a=i.itemModel,o=a.getModel("itemStyle").getItemStyle(["color"]),s=a.getModel("emphasis.itemStyle").getItemStyle(),l=a.getShallow("cursor");fj(e,(function(e){e.setColor(n),e.setStyle(UW.defaults({fill:n,opacity:i.opacity},o)),WW.setHoverStyle(e,s),l&&(e.cursor=l),e.z2=i.z2}));var u={},h=t.valueDim.posDesc[+(i.boundingLength>0)],c=e.__pictorialBarRect;YW(c.style,u,a,n,t.seriesModel,r,h),WW.setHoverStyle(c,u)}function mj(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}HW.extendChartView({type:"pictorialBar",render:function(e,t,i){var n=this.group,r=e.getData(),a=this._data,o=e.coordinateSystem,s=!!o.getBaseAxis().isHorizontal(),l=o.grid.getRect(),u={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:e,coordSys:o,coordSysExtent:[[l.x,l.x+l.width],[l.y,l.y+l.height]],isHorizontal:s,valueDim:QW[+s],categoryDim:QW[1-s]};return r.diff(a).add((function(e){if(r.hasValue(e)){var t=oj(r,e),i=$W(r,e,t,u),a=hj(r,u,i);r.setItemGraphicEl(e,a),n.add(a),gj(a,u,i)}})).update((function(e,t){var i=a.getItemGraphicEl(t);if(r.hasValue(e)){var o=oj(r,e),s=$W(r,e,o,u),l=dj(r,s);i&&l!==i.__pictorialShapeStr&&(n.remove(i),r.setItemGraphicEl(e,null),i=null),i?function(e,t,i){var n=i.animationModel,r=i.dataIndex,a=e.__pictorialBundle;WW.updateProps(a,{position:i.bundlePosition.slice()},n,r),i.symbolRepeat?ij(e,t,i,!0):nj(e,0,i,!0),rj(e,i,!0),aj(e,t,i,!0)}(i,u,s):i=hj(r,u,s,!0),r.setItemGraphicEl(e,i),i.__pictorialSymbolMeta=s,n.add(i),gj(i,u,s)}else n.remove(i)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&cj(a,e,t.__pictorialSymbolMeta.animationModel,t)})).execute(),this._data=r,this.group},dispose:UW.noop,remove:function(e,t){var i=this.group,n=this._data;e.get("animation")?n&&n.eachItemGraphicEl((function(t){cj(n,t.dataIndex,e,t)})):i.removeAll()}});var vj=h,yj=g,_j=Qx.layout,xj=gM;vj.registerLayout(yj.curry(_j,"pictorialBar")),vj.registerVisual(xj("pictorialBar","roundRect"));var bj=g,wj=wT,Tj=function(e,t,i,n,r){wj.call(this,e,t,i),this.type=n||"value",this.position=r||"bottom",this.orient=null};Tj.prototype={constructor:Tj,model:null,isHorizontal:function(){var e=this.position;return"top"===e||"bottom"===e},pointToData:function(e,t){return this.coordinateSystem.pointToData(e,t)[0]},toGlobalCoord:null,toLocalCoord:null},bj.inherits(Tj,wj);var Sj=Tj,Mj=yx,Aj=Hc.getLayoutRect,Ij=g.each;function Cj(e,t,i){this.dimension="single",this.dimensions=["single"],this._axis=null,this._rect,this._init(e,t,i),this.model=e}Cj.prototype={type:"singleAxis",axisPointerEnabled:!0,constructor:Cj,_init:function(e,t,i){var n=this.dimension,r=new Sj(n,Mj.createScaleByModel(e),[0,0],e.get("type"),e.get("position")),a="category"===r.type;r.onBand=a&&e.get("boundaryGap"),r.inverse=e.get("inverse"),r.orient=e.get("orient"),e.axis=r,r.model=e,r.coordinateSystem=this,this._axis=r},update:function(e,t){e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();Ij(t.mapDimension(this.dimension,!0),(function(e){this._axis.scale.unionExtentFromData(t,e)}),this),Mj.niceScaleExtent(this._axis.scale,this._axis.model)}}),this)},resize:function(e,t){this._rect=Aj({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()},getRect:function(){return this._rect},_adjustAxis:function(){var e=this._rect,t=this._axis,i=t.isHorizontal(),n=i?[0,e.width]:[0,e.height],r=t.reverse?1:0;t.setExtent(n[r],n[1-r]),this._updateAxisTransform(t,i?e.x:e.y)},_updateAxisTransform:function(e,t){var i=e.getExtent(),n=i[0]+i[1],r=e.isHorizontal();e.toGlobalCoord=r?function(e){return e+t}:function(e){return n-e+t},e.toLocalCoord=r?function(e){return e-t}:function(e){return n-e+t}},getAxis:function(){return this._axis},getBaseAxis:function(){return this._axis},getAxes:function(){return[this._axis]},getTooltipAxes:function(){return{baseAxes:[this.getAxis()]}},containPoint:function(e){var t=this.getRect(),i=this.getAxis();return"horizontal"===i.orient?i.contain(i.toLocalCoord(e[0]))&&e[1]>=t.y&&e[1]<=t.y+t.height:i.contain(i.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},pointToData:function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e["horizontal"===t.orient?0:1]))]},dataToPoint:function(e){var t=this.getAxis(),i=this.getRect(),n=[],r="horizontal"===t.orient?0:1;return e instanceof Array&&(e=e[0]),n[r]=t.toGlobalCoord(t.dataToCoord(+e)),n[1-r]=0===r?i.y+i.height/2:i.x+i.width/2,n}};var Dj=Cj;sp.register("single",{create:function(e,t){var i=[];return e.eachComponent("singleAxis",(function(n,r){var a=new Dj(n,e,t);a.name="single_"+r,a.resize(n,t),n.coordinateSystem=a,i.push(a)})),e.eachSeries((function(t){if("singleAxis"===t.get("coordinateSystem")){var i=e.queryComponents({mainType:"singleAxis",index:t.get("singleAxisIndex"),id:t.get("singleAxisId")})[0];t.coordinateSystem=i&&i.coordinateSystem}})),i},dimensions:Dj.prototype.dimensions});var Ej={},Lj=g;Ej.layout=function(e,t){t=t||{};var i=e.coordinateSystem,n=e.axis,r={},a=n.position,o=n.orient,s=i.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]}};r.position=["vertical"===o?u.vertical[a]:l[0],"horizontal"===o?u.horizontal[a]:l[3]],r.rotation=Math.PI/2*{horizontal:0,vertical:1}[o],r.labelDirection=r.tickDirection=r.nameDirection={top:-1,bottom:1,right:1,left:-1}[a],e.get("axisTick.inside")&&(r.tickDirection=-r.tickDirection),Lj.retrieve(t.labelInside,e.get("axisLabel.inside"))&&(r.labelDirection=-r.labelDirection);var h=t.rotate;return null==h&&(h=e.get("axisLabel.rotate")),r.labelRotation="top"===a?-h:h,r.z2=1,r};var Pj=g,Nj=qA,Rj=No,Oj=Ej,kj=uI,zj=dI,Bj=zj.rectCoordAxisBuildSplitArea,Fj=zj.rectCoordAxisHandleRemove,Vj=["axisLine","axisTickLabel","axisName"],Gj=["splitArea","splitLine"],Hj=kj.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(e,t,i,n){var r=this.group;r.removeAll();var a=this._axisGroup;this._axisGroup=new Rj.Group;var o=Oj.layout(e),s=new Nj(e,o);Pj.each(Vj,s.add,s),r.add(this._axisGroup),r.add(s.getGroup()),Pj.each(Gj,(function(t){e.get(t+".show")&&this["_"+t](e)}),this),Rj.groupTransition(a,this._axisGroup,e),Hj.superCall(this,"render",e,t,i,n)},remove:function(){Fj(this)},_splitLine:function(e){var t=e.axis;if(!t.scale.isBlank()){var i=e.getModel("splitLine"),n=i.getModel("lineStyle"),r=n.get("width"),a=n.get("color");a=a instanceof Array?a:[a];for(var o=e.coordinateSystem.getRect(),s=t.isHorizontal(),l=[],u=0,h=t.getTicksCoords({tickModel:i}),c=[],d=[],f=0;f<h.length;++f){var p=t.toGlobalCoord(h[f].coord);s?(c[0]=p,c[1]=o.y,d[0]=p,d[1]=o.y+o.height):(c[0]=o.x,c[1]=p,d[0]=o.x+o.width,d[1]=p);var g=u++%a.length;l[g]=l[g]||[],l[g].push(new Rj.Line({subPixelOptimize:!0,shape:{x1:c[0],y1:c[1],x2:d[0],y2:d[1]},style:{lineWidth:r},silent:!0}))}for(f=0;f<l.length;++f)this.group.add(Rj.mergePath(l[f],{style:{stroke:a[f%a.length],lineDash:n.getLineDash(r),lineWidth:r},silent:!0}))}},_splitArea:function(e){Bj(this,this._axisGroup,e,e)}}),Uj=g,Wj=ZM,jj=aw,Xj=Ld.extend({type:"singleAxis",layoutMode:"box",axis:null,coordinateSystem:null,getCoordSysModel:function(){return this}});Uj.merge(Xj.prototype,jj),Wj("single",Xj,(function(e,t){return t.type||(t.data?"category":"value")}),{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}}});var Zj=g,qj=lo,Yj=function(e,t){var i,n=[],r=e.seriesIndex;if(null==r||!(i=t.getSeriesByIndex(r)))return{point:[]};var a=i.getData(),o=qj.queryDataIndex(a,e);if(null==o||o<0||Zj.isArray(o))return{point:[]};var s=a.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)n=i.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)n=l.dataToPoint(a.getValues(Zj.map(l.dimensions,(function(e){return a.mapDimension(e)})),o,!0))||[];else if(s){var u=s.getBoundingRect().clone();u.applyTransform(s.transform),n=[u.x+u.width/2,u.y+u.height/2]}return{point:n,el:s}},Kj=g,Qj=lo.makeInner,Jj=YA,$j=Yj,eX=Kj.each,tX=Kj.curry,iX=Qj();function nX(e,t,i,n,r){var a=e.axis;if(!a.scale.isBlank()&&a.containData(t))if(e.involveSeries){var o=function(e,t){var i=t.axis,n=i.dim,r=e,a=[],o=Number.MAX_VALUE,s=-1;return eX(t.seriesModels,(function(t,l){var u,h,c=t.getData().mapDimension(n,!0);if(t.getAxisTooltipData){var d=t.getAxisTooltipData(c,e,i);h=d.dataIndices,u=d.nestestValue}else{if(!(h=t.getData().indicesOfNearest(c[0],e,"category"===i.type?.5:null)).length)return;u=t.getData().get(c[0],h[0])}if(null!=u&&isFinite(u)){var f=e-u,p=Math.abs(f);p<=o&&((p<o||f>=0&&s<0)&&(o=p,s=f,r=u,a.length=0),eX(h,(function(e){a.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})})))}})),{payloadBatch:a,snapToValue:r}}(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&null==r.seriesIndex&&Kj.extend(r,s[0]),!n&&e.snap&&a.containData(l)&&null!=l&&(t=l),i.showPointer(e,t,s,r),i.showTooltip(e,o,l)}else i.showPointer(e,t)}function rX(e,t,i,n){e[t.key]={value:i,payloadBatch:n}}function aX(e,t,i,n){var r=i.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(t.triggerTooltip&&r.length){var l=t.coordSys.model,u=Jj.makeKey(l),h=e.map[u];h||(h=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(h)),h.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get("label.precision"),formatter:s.get("label.formatter")},seriesDataIndices:r.slice()})}}function oX(e){var t=e.axis.model,i={},n=i.axisDim=e.axis.dim;return i.axisIndex=i[n+"AxisIndex"]=t.componentIndex,i.axisName=i[n+"AxisName"]=t.name,i.axisId=i[n+"AxisId"]=t.id,i}function sX(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}var lX=function(e,t,i){var n=e.currTrigger,r=[e.x,e.y],a=e,o=e.dispatchAction||Kj.bind(i.dispatchAction,i),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){sX(r)&&(r=$j({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=sX(r),u=a.axesInfo,h=s.axesInfo,c="leave"===n||sX(r),d={},f={},p={list:[],map:{}},g={showPointer:tX(rX,f),showTooltip:tX(aX,p)};eX(s.coordSysMap,(function(e,t){var i=l||e.containPoint(r);eX(s.coordSysAxesInfo[t],(function(e,t){var n=e.axis,a=function(e,t){for(var i=0;i<(e||[]).length;i++){var n=e[i];if(t.axis.dim===n.axisDim&&t.axis.model.componentIndex===n.axisIndex)return n}}(u,e);if(!c&&i&&(!u||a)){var o=a&&a.value;null!=o||l||(o=n.pointToData(r)),null!=o&&nX(e,o,g,!1,d)}}))}));var m={};return eX(h,(function(e,t){var i=e.linkGroup;i&&!f[t]&&eX(i.axesInfo,(function(t,n){var r=f[n];if(t!==e&&r){var a=r.value;i.mapper&&(a=e.axis.scale.parse(i.mapper(a,oX(t),oX(e)))),m[e.key]=a}}))})),eX(m,(function(e,t){nX(h[t],e,g,!0,d)})),function(e,t,i){var n=i.axesInfo=[];eX(t,(function(t,i){var r=t.axisPointerModel.option,a=e[i];a?(!t.useHandle&&(r.status="show"),r.value=a.value,r.seriesDataIndices=(a.payloadBatch||[]).slice()):!t.useHandle&&(r.status="hide"),"show"===r.status&&n.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:r.value})}))}(f,h,d),function(e,t,i,n){if(!sX(t)&&e.list.length){var r=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:i.tooltipOption,position:i.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:e.list})}else n({type:"hideTip"})}(p,r,e,o),function(e,t,i){var n=i.getZr(),r="axisPointerLastHighlights",a=iX(n)[r]||{},o=iX(n)[r]={};eX(e,(function(e,t){var i=e.axisPointerModel.option;"show"===i.status&&eX(i.seriesDataIndices,(function(e){var t=e.seriesIndex+" | "+e.dataIndex;o[t]=e}))}));var s=[],l=[];Kj.each(a,(function(e,t){!o[t]&&l.push(e)})),Kj.each(o,(function(e,t){!a[t]&&s.push(e)})),l.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,batch:l}),s.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,batch:s})}(h,0,i),d}};h.extendComponentModel({type:"axisPointer",coordSysAxesInfo:null,defaultOption:{show:"auto",triggerOn:null,zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#aaa",width:1,type:"solid"},shadowStyle:{color:"rgba(150,150,150,0.3)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,shadowBlur:3,shadowColor:"#aaa"},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}}});var uX={},hX=g,cX=p,dX=(0,lo.makeInner)(),fX=hX.each;function pX(e,t,i){e.handler("leave",null,i)}function gX(e,t,i,n){t.handler(e,i,n)}uX.register=function(e,t,i){if(!cX.node){var n=t.getZr();dX(n).records||(dX(n).records={}),function(e,t){function i(i,n){e.on(i,(function(i){var r=function(e){var t={showTip:[],hideTip:[]},i=function(n){var r=t[n.type];r?r.push(n):(n.dispatchAction=i,e.dispatchAction(n))};return{dispatchAction:i,pendings:t}}(t);fX(dX(e).records,(function(e){e&&n(e,i,r.dispatchAction)})),function(e,t){var i,n=e.showTip.length,r=e.hideTip.length;n?i=e.showTip[n-1]:r&&(i=e.hideTip[r-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}(r.pendings,t)}))}dX(e).initialized||(dX(e).initialized=!0,i("click",hX.curry(gX,"click")),i("mousemove",hX.curry(gX,"mousemove")),i("globalout",pX))}(n,t),(dX(n).records[e]||(dX(n).records[e]={})).handler=i}},uX.unregister=function(e,t){if(!cX.node){var i=t.getZr();(dX(i).records||{})[e]&&(dX(i).records[e]=null)}};var mX=uX,vX=h.extendComponentView({type:"axisPointer",render:function(e,t,i){var n=t.getComponent("tooltip"),r=e.get("triggerOn")||n&&n.get("triggerOn")||"mousemove|click";mX.register("axisPointer",i,(function(e,t,i){"none"!==r&&("leave"===e||r.indexOf(e)>=0)&&i({type:"updateAxisPointer",currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})}))},remove:function(e,t){mX.unregister(t.getZr(),"axisPointer"),vX.superApply(this._model,"remove",arguments)},dispose:function(e,t){mX.unregister("axisPointer",t),vX.superApply(this._model,"dispose",arguments)}}),yX=g,_X=xo,xX=No,bX=YA,wX=ne,TX=km,SX=(0,lo.makeInner)(),MX=yX.clone,AX=yX.bind;function IX(){}function CX(e,t,i,n){DX(SX(i).lastProp,n)||(SX(i).lastProp=n,t?xX.updateProps(i,n,e):(i.stopAnimation(),i.attr(n)))}function DX(e,t){if(yX.isObject(e)&&yX.isObject(t)){var i=!0;return yX.each(t,(function(t,n){i=i&&DX(e[n],t)})),!!i}return e===t}function EX(e,t){e[t.get("label.show")?"show":"hide"]()}function LX(e){return{position:e.position.slice(),rotation:e.rotation||0}}function PX(e,t,i){var n=t.get("z"),r=t.get("zlevel");e&&e.traverse((function(e){"group"!==e.type&&(null!=n&&(e.z=n),null!=r&&(e.zlevel=r),e.silent=i)}))}IX.prototype={_group:null,_lastGraphicKey:null,_handle:null,_dragging:!1,_lastValue:null,_lastStatus:null,_payloadInfo:null,animationThreshold:15,render:function(e,t,i,n){var r=t.get("value"),a=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=i,n||this._lastValue!==r||this._lastStatus!==a){this._lastValue=r,this._lastStatus=a;var o=this._group,s=this._handle;if(!a||"hide"===a)return o&&o.hide(),void(s&&s.hide());o&&o.show(),s&&s.show();var l={};this.makeElOption(l,r,e,t,i);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=u;var h=this._moveAnimation=this.determineAnimation(e,t);if(o){var c=yX.curry(CX,t,h);this.updatePointerEl(o,l,c,t),this.updateLabelEl(o,l,c,t)}else o=this._group=new xX.Group,this.createPointerEl(o,l,e,t),this.createLabelEl(o,l,e,t),i.getZr().add(o);PX(o,t,!0),this._renderHandle(r)}},remove:function(e){this.clear(e)},dispose:function(e){this.clear(e)},determineAnimation:function(e,t){var i=t.get("animation"),n=e.axis,r="category"===n.type,a=t.get("snap");if(!a&&!r)return!1;if("auto"===i||null==i){var o=this.animationThreshold;if(r&&n.getBandWidth()>o)return!0;if(a){var s=bX.getAxisInfo(e).seriesDataCount,l=n.getExtent();return Math.abs(l[0]-l[1])/s>o}return!1}return!0===i},makeElOption:function(e,t,i,n,r){},createPointerEl:function(e,t,i,n){var r=t.pointer;if(r){var a=SX(e).pointerEl=new xX[r.type](MX(t.pointer));e.add(a)}},createLabelEl:function(e,t,i,n){if(t.label){var r=SX(e).labelEl=new xX.Rect(MX(t.label));e.add(r),EX(r,n)}},updatePointerEl:function(e,t,i){var n=SX(e).pointerEl;n&&t.pointer&&(n.setStyle(t.pointer.style),i(n,{shape:t.pointer.shape}))},updateLabelEl:function(e,t,i,n){var r=SX(e).labelEl;r&&(r.setStyle(t.label.style),i(r,{shape:t.label.shape,position:t.label.position}),EX(r,n))},_renderHandle:function(e){if(!this._dragging&&this.updateHandleTransform){var t,i=this._axisPointerModel,n=this._api.getZr(),r=this._handle,a=i.getModel("handle"),o=i.get("status");if(!a.get("show")||!o||"hide"===o)return r&&n.remove(r),void(this._handle=null);this._handle||(t=!0,r=this._handle=xX.createIcon(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){wX.stop(e.event)},onmousedown:AX(this._onHandleDragMove,this,0,0),drift:AX(this._onHandleDragMove,this),ondragend:AX(this._onHandleDragEnd,this)}),n.add(r)),PX(r,i,!1),r.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=a.get("size");yX.isArray(s)||(s=[s,s]),r.attr("scale",[s[0]/2,s[1]/2]),TX.createOrUpdate(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},_moveHandleToValue:function(e,t){CX(this._axisPointerModel,!t&&this._moveAnimation,this._handle,LX(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(e,t){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(LX(i),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(LX(n)),SX(i).lastProp=null,this._doDispatchAxisPointer()}},_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}]})}},_onHandleDragEnd:function(e){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},getHandleTransform:null,updateHandleTransform:null,clear:function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),i=this._group,n=this._handle;t&&i&&(this._lastGraphicKey=null,i&&t.remove(i),n&&t.remove(n),this._group=null,this._handle=null,this._payloadInfo=null)},doClear:function(){},buildLabel:function(e,t,i){return{x:e[i=i||0],y:e[1-i],width:t[i],height:t[1-i]}}},IX.prototype.constructor=IX,_X.enableClassExtend(IX);var NX=IX,RX={},OX=g,kX=No,zX=Tn,BX=qc,FX=Ue,VX=yx,GX=qA;function HX(e,t,i,n,r){var a=UX(i.get("value"),t.axis,t.ecModel,i.get("seriesDataIndices"),{precision:i.get("label.precision"),formatter:i.get("label.formatter")}),o=i.getModel("label"),s=BX.normalizeCssArray(o.get("padding")||0),l=o.getFont(),u=zX.getBoundingRect(a,l),h=r.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],f=r.align;"right"===f&&(h[0]-=c),"center"===f&&(h[0]-=c/2);var p=r.verticalAlign;"bottom"===p&&(h[1]-=d),"middle"===p&&(h[1]-=d/2),function(e,t,i,n){var r=n.getWidth(),a=n.getHeight();e[0]=Math.min(e[0]+t,r)-t,e[1]=Math.min(e[1]+i,a)-i,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}(h,c,d,n);var g=o.get("backgroundColor");g&&"auto"!==g||(g=t.get("axisLine.lineStyle.color")),e.label={shape:{x:0,y:0,width:c,height:d,r:o.get("borderRadius")},position:h.slice(),style:{text:a,textFont:l,textFill:o.getTextColor(),textPosition:"inside",textPadding:s,fill:g,stroke:o.get("borderColor")||"transparent",lineWidth:o.get("borderWidth")||0,shadowBlur:o.get("shadowBlur"),shadowColor:o.get("shadowColor"),shadowOffsetX:o.get("shadowOffsetX"),shadowOffsetY:o.get("shadowOffsetY")},z2:10}}function UX(e,t,i,n,r){e=t.scale.parse(e);var a=t.scale.getLabel(e,{precision:r.precision}),o=r.formatter;if(o){var s={value:VX.getAxisRawValue(t,e),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};OX.each(n,(function(e){var t=i.getSeriesByIndex(e.seriesIndex),n=e.dataIndexInside,r=t&&t.getDataParams(n);r&&s.seriesData.push(r)})),OX.isString(o)?a=o.replace("{value}",a):OX.isFunction(o)&&(a=o(s))}return a}function WX(e,t,i){var n=FX.create();return FX.rotate(n,n,i.rotation),FX.translate(n,n,i.position),kX.applyTransform([e.dataToCoord(t),(i.labelOffset||0)+(i.labelDirection||1)*(i.labelMargin||0)],n)}RX.buildElStyle=function(e){var t,i=e.get("type"),n=e.getModel(i+"Style");return"line"===i?(t=n.getLineStyle()).fill=null:"shadow"===i&&((t=n.getAreaStyle()).stroke=null),t},RX.buildLabelElOption=HX,RX.getValueLabel=UX,RX.getTransformedPosition=WX,RX.buildCartesianSingleLabelElOption=function(e,t,i,n,r,a){var o=GX.innerTextLayout(i.rotation,0,i.labelDirection);i.labelMargin=r.get("label.margin"),HX(t,n,r,a,{position:WX(n.axis,e,i),align:o.textAlign,verticalAlign:o.textVerticalAlign})},RX.makeLineShape=function(e,t,i){return{x1:e[i=i||0],y1:e[1-i],x2:t[i],y2:t[1-i]}},RX.makeRectShape=function(e,t,i){return{x:e[i=i||0],y:e[1-i],width:t[i],height:t[1-i]}},RX.makeSectorShape=function(e,t,i,n,r,a){return{cx:e,cy:t,r0:i,r:n,startAngle:r,endAngle:a,clockwise:!0}};var jX=RX,XX=hI,ZX=uI,qX=NX.extend({makeElOption:function(e,t,i,n,r){var a=i.axis,o=a.grid,s=n.get("type"),l=YX(o,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(t,!0));if(s&&"none"!==s){var h=jX.buildElStyle(n),c=KX[s](a,u,l);c.style=h,e.graphicKey=c.type,e.pointer=c}var d=XX.layout(o.model,i);jX.buildCartesianSingleLabelElOption(t,e,d,i,n,r)},getHandleTransform:function(e,t,i){var n=XX.layout(t.axis.grid.model,t,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:jX.getTransformedPosition(t.axis,e,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(e,t,i,n){var r=i.axis,a=r.grid,o=r.getGlobalExtent(!0),s=YX(a,r).getOtherAxis(r).getGlobalExtent(),l="x"===r.dim?0:1,u=e.position;u[l]+=t[l],u[l]=Math.min(o[1],u[l]),u[l]=Math.max(o[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];return c[l]=u[l],{position:u,rotation:e.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}}});function YX(e,t){var i={};return i[t.dim+"AxisIndex"]=t.index,e.getCartesian(i)}var KX={line:function(e,t,i){return{type:"Line",subPixelOptimize:!0,shape:jX.makeLineShape([t,i[0]],[t,i[1]],QX(e))}},shadow:function(e,t,i){var n=Math.max(1,e.getBandWidth()),r=i[1]-i[0];return{type:"Rect",shape:jX.makeRectShape([t-n/2,i[0]],[n,r],QX(e))}}};function QX(e){return"x"===e.dim?0:1}ZX.registerAxisPointerClass("CartesianAxisPointer",qX);var JX=h,$X=g,eZ=YA,tZ=lX;JX.registerPreprocessor((function(e){if(e){(!e.axisPointer||0===e.axisPointer.length)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!$X.isArray(t)&&(e.axisPointer.link=[t])}})),JX.registerProcessor(JX.PRIORITY.PROCESSOR.STATISTIC,(function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=eZ.collect(e,t)})),JX.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},tZ);var iZ=RX,nZ=Ej,rZ=uI,aZ=["x","y"],oZ=["width","height"],sZ=NX.extend({makeElOption:function(e,t,i,n,r){var a=i.axis,o=a.coordinateSystem,s=hZ(o,1-uZ(a)),l=o.dataToPoint(t)[0],u=n.get("type");if(u&&"none"!==u){var h=iZ.buildElStyle(n),c=lZ[u](a,l,s);c.style=h,e.graphicKey=c.type,e.pointer=c}var d=nZ.layout(i);iZ.buildCartesianSingleLabelElOption(t,e,d,i,n,r)},getHandleTransform:function(e,t,i){var n=nZ.layout(t,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:iZ.getTransformedPosition(t.axis,e,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(e,t,i,n){var r=i.axis,a=r.coordinateSystem,o=uZ(r),s=hZ(a,o),l=e.position;l[o]+=t[o],l[o]=Math.min(s[1],l[o]),l[o]=Math.max(s[0],l[o]);var u=hZ(a,1-o),h=(u[1]+u[0])/2,c=[h,h];return c[o]=l[o],{position:l,rotation:e.rotation,cursorPoint:c,tooltipOption:{verticalAlign:"middle"}}}}),lZ={line:function(e,t,i){return{type:"Line",subPixelOptimize:!0,shape:iZ.makeLineShape([t,i[0]],[t,i[1]],uZ(e))}},shadow:function(e,t,i){var n=e.getBandWidth(),r=i[1]-i[0];return{type:"Rect",shape:iZ.makeRectShape([t-n/2,i[0]],[n,r],uZ(e))}}};function uZ(e){return e.isHorizontal()?0:1}function hZ(e,t){var i=e.getRect();return[i[aZ[t]],i[aZ[t]]+i[oZ[t]]]}rZ.registerAxisPointerClass("SingleAxisPointer",sZ),h.extendComponentView({type:"single"});var cZ=um,dZ=X_,fZ=Gy.getDimensionTypeByAxis,pZ=A_,gZ=g,mZ=lo.groupData,vZ=qc.encodeHTML,yZ=IC,_Z=cZ.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(e){_Z.superApply(this,"init",arguments),this.legendVisualProvider=new yZ(gZ.bind(this.getData,this),gZ.bind(this.getRawData,this))},fixData:function(e){var t=e.length,i={},n=mZ(e,(function(e){return i.hasOwnProperty(e[0])||(i[e[0]]=-1),e[2]})),r=[];n.buckets.each((function(e,t){r.push({name:t,dataList:e})}));for(var a=r.length,o=0;o<a;++o){for(var s=r[o].name,l=0;l<r[o].dataList.length;++l){var u=r[o].dataList[l][0];i[u]=o}for(var u in i)i.hasOwnProperty(u)&&i[u]!==o&&(i[u]=o,e[t]=[],e[t][0]=u,e[t][1]=0,e[t][2]=s,t++)}return e},getInitialData:function(e,t){for(var i=t.queryComponents({mainType:"singleAxis",index:this.get("singleAxisIndex"),id:this.get("singleAxisId")})[0].get("type"),n=gZ.filter(e.data,(function(e){return void 0!==e[2]})),r=this.fixData(n||[]),a=[],o=this.nameMap=gZ.createHashMap(),s=0,l=0;l<r.length;++l)a.push(r[l][2]),o.get(r[l][2])||(o.set(r[l][2],s),s++);var u=dZ(r,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:fZ(i)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}),h=new pZ(u,this);return h.initData(r),h},getLayerSeries:function(){for(var e=this.getData(),t=e.count(),i=[],n=0;n<t;++n)i[n]=n;var r=e.mapDimension("single"),a=mZ(i,(function(t){return e.get("name",t)})),o=[];return a.buckets.each((function(t,i){t.sort((function(t,i){return e.get(r,t)-e.get(r,i)})),o.push({name:i,indices:t})})),o},getAxisTooltipData:function(e,t,i){gZ.isArray(e)||(e=e?[e]:[]);for(var n,r=this.getData(),a=this.getLayerSeries(),o=[],s=a.length,l=0;l<s;++l){for(var u=Number.MAX_VALUE,h=-1,c=a[l].indices.length,d=0;d<c;++d){var f=r.get(e[0],a[l].indices[d]),p=Math.abs(f-t);p<=u&&(n=f,u=p,h=a[l].indices[d])}o.push(h)}return{dataIndices:o,nestestValue:n}},formatTooltip:function(e){var t=this.getData(),i=t.getName(e),n=t.get(t.mapDimension("value"),e);return(isNaN(n)||null==n)&&(n="-"),vZ(i+" : "+n)},defaultOption:{zlevel:0,z:2,coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",color:"#000",fontSize:11},emphasis:{label:{show:!0}}}}),xZ=h,bZ=wS.Polygon,wZ=No,TZ=g,SZ=TZ.bind,MZ=TZ.extend,AZ=Vy;xZ.extendChartView({type:"themeRiver",init:function(){this._layers=[]},render:function(e,t,i){var n=e.getData(),r=this.group,a=e.getLayerSeries(),o=n.getLayout("layoutInfo"),s=o.rect,l=o.boundaryGap;function u(e){return e.name}r.attr("position",[0,s.y+l[0]]);var h=new AZ(this._layersSeries||[],a,u,u),c={};function d(t,i,o){var s=this._layers;if("remove"!==t){for(var l,u,h,d=[],f=[],p=a[i].indices,g=0;g<p.length;g++){var m=n.getItemLayout(p[g]),v=m.x,y=m.y0,_=m.y;d.push([v,y]),f.push([v,y+_]),l=n.getItemVisual(p[g],"color")}var x=n.getItemLayout(p[0]),b=n.getItemModel(p[g-1]),w=b.getModel("label"),T=w.get("margin");if("add"===t){var S=c[i]=new wZ.Group;u=new bZ({shape:{points:d,stackedOnPoints:f,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),h=new wZ.Text({style:{x:x.x-T,y:x.y0+x.y/2}}),S.add(u),S.add(h),r.add(S),u.setClipPath(function(e,t,i){var n=new wZ.Rect({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return wZ.initProps(n,{shape:{width:e.width+20,height:e.height+20}},t,i),n}(u.getBoundingRect(),e,(function(){u.removeClipPath()})))}else S=s[o],u=S.childAt(0),h=S.childAt(1),r.add(S),c[i]=S,wZ.updateProps(u,{shape:{points:d,stackedOnPoints:f}},e),wZ.updateProps(h,{style:{x:x.x-T,y:x.y0+x.y/2}},e);var M=b.getModel("emphasis.itemStyle"),A=b.getModel("itemStyle");wZ.setTextStyle(h.style,w,{text:w.get("show")?e.getFormattedLabel(p[g-1],"normal")||n.getName(p[g-1]):null,textVerticalAlign:"middle"}),u.setStyle(MZ({fill:l},A.getItemStyle(["color"]))),wZ.setHoverStyle(u,M.getItemStyle())}else r.remove(s[i])}h.add(SZ(d,this,"add")).update(SZ(d,this,"update")).remove(SZ(d,this,"remove")).execute(),this._layersSeries=a,this._layers=c},dispose:function(){}});var IZ=g,CZ=Uc;function DZ(e,t,i){if(e.count())for(var n,r=t.coordinateSystem,a=t.getLayerSeries(),o=e.mapDimension("single"),s=e.mapDimension("value"),l=IZ.map(a,(function(t){return IZ.map(t.indices,(function(t){var i=r.dataToPoint(e.get(o,t));return i[1]=e.get(s,t),i}))})),u=function(e){for(var t=e.length,i=e[0].length,n=[],r=[],a=0,o={},s=0;s<i;++s){for(var l=0,u=0;l<t;++l)u+=e[l][s][1];u>a&&(a=u),n.push(u)}for(var h=0;h<i;++h)r[h]=(a-n[h])/2;a=0;for(var c=0;c<i;++c){var d=n[c]+r[c];d>a&&(a=d)}return o.y0=r,o.max=a,o}(l),h=u.y0,c=i/u.max,d=a.length,f=a[0].indices.length,p=0;p<f;++p){n=h[p]*c,e.setItemLayout(a[0].indices[p],{layerIndex:0,x:l[0][p][0],y0:n,y:l[0][p][1]*c});for(var g=1;g<d;++g)n+=l[g-1][p][1]*c,e.setItemLayout(a[g].indices[p],{layerIndex:g,x:l[g][p][0],y0:n,y:l[g][p][1]*c})}}var EZ=function(e,t){e.eachSeriesByType("themeRiver",(function(e){var t=e.getData(),i=e.coordinateSystem,n={},r=i.getRect();n.rect=r;var a=e.get("boundaryGap"),o=i.getAxis();n.boundaryGap=a,"horizontal"===o.orient?(a[0]=CZ.parsePercent(a[0],r.height),a[1]=CZ.parsePercent(a[1],r.height),DZ(t,e,r.height-a[0]-a[1])):(a[0]=CZ.parsePercent(a[0],r.width),a[1]=CZ.parsePercent(a[1],r.width),DZ(t,e,r.width-a[0]-a[1])),t.setLayout("layoutInfo",n)}))},LZ=g.createHashMap,PZ=function(e){e.eachSeriesByType("themeRiver",(function(e){var t=e.getData(),i=e.getRawData(),n=e.get("color"),r=LZ();t.each((function(e){r.set(t.getRawIndex(e),e)})),i.each((function(a){var o=i.getName(a),s=n[(e.nameMap.get(o)-1)%n.length];i.setItemVisual(a,"color",s);var l=r.get(a);null!=l&&t.setItemVisual(l,"color",s)}))}))},NZ=h,RZ=EZ,OZ=PZ,kZ=cD;NZ.registerLayout(RZ),NZ.registerVisual(OZ),NZ.registerProcessor(kZ("themeRiver"));var zZ=g,BZ=um,FZ=hN,VZ=zc,GZ=iR.wrapTreePathInfo;function HZ(e){var t=0;zZ.each(e.children,(function(e){HZ(e);var i=e.value;zZ.isArray(i)&&(i=i[0]),t+=i}));var i=e.value;zZ.isArray(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=t),i<0&&(i=0),zZ.isArray(e.value)?e.value[0]=i:e.value=i}BZ.extend({type:"series.sunburst",_viewRoot:null,getInitialData:function(e,t){var i={name:e.name,children:e.data};HZ(i);var n=zZ.map(e.levels||[],(function(e){return new VZ(e,this,t)}),this),r=FZ.createTree(i,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var i=r.getNodeByDataIndex(t),a=n[i.depth];return a&&(e.parentModel=a),e}))}));return r.data},optionUpdated:function(){this.resetViewRoot()},getDataParams:function(e){var t=BZ.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return t.treePathInfo=GZ(i,this),t},defaultOption:{zlevel:0,z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,percentPrecision:2,stillShowZeroSum:!0,highlightPolicy:"descendant",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},highlight:{itemStyle:{opacity:1}},downplay:{itemStyle:{opacity:.5},label:{opacity:.6}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicOut",data:[],levels:[],sort:"desc"},getViewRoot:function(){return this._viewRoot},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)}});var UZ=g,WZ=No,jZ="none",XZ="ancestor",ZZ="self";function qZ(e,t,i){WZ.Group.call(this);var n=new WZ.Sector({z2:2});n.seriesIndex=t.seriesIndex;var r=new WZ.Text({z2:4,silent:e.getModel("label").get("silent")});function a(){r.ignore=r.hoverIgnore}function o(){r.ignore=r.normalIgnore}this.add(n),this.add(r),this.updateData(!0,e,"normal",t,i),this.on("emphasis",a).on("normal",o).on("mouseover",a).on("mouseout",o)}var YZ=qZ.prototype;YZ.updateData=function(e,t,i,n,r){this.node=t,t.piece=this,n=n||this._seriesModel,r=r||this._ecModel;var a=this.childAt(0);a.dataIndex=t.dataIndex;var o=t.getModel(),s=t.getLayout(),l=UZ.extend({},s);l.label=null;var u=function(e,t,i){var n=e.getVisual("color"),r=e.getVisual("visualMeta");r&&0!==r.length||(n=null);var a=e.getModel("itemStyle").get("color");if(a)return a;if(n)return n;if(0===e.depth)return i.option.color[0];var o=i.option.color.length;return a=i.option.color[function(e){for(var t=e;t.depth>1;)t=t.parentNode;var i=e.getAncestors()[0];return UZ.indexOf(i.children,t)}(e)%o],a}(t,0,r);!function(e,t,i){t.getData().setItemVisual(e.dataIndex,"color",i)}(t,n,u);var h,c=o.getModel("itemStyle").getItemStyle();if("normal"===i)h=c;else{var d=o.getModel(i+".itemStyle").getItemStyle();h=UZ.merge(d,c)}h=UZ.defaults({lineJoin:"bevel",fill:h.fill||u},h),e?(a.setShape(l),a.shape.r=s.r0,WZ.updateProps(a,{shape:{r:s.r}},n,t.dataIndex),a.useStyle(h)):"object"==typeof h.fill&&h.fill.type||"object"==typeof a.style.fill&&a.style.fill.type?(WZ.updateProps(a,{shape:l},n),a.useStyle(h)):WZ.updateProps(a,{shape:l,style:h},n),this._updateLabel(n,u,i);var f=o.getShallow("cursor");if(f&&a.attr("cursor",f),e){var p=n.getShallow("highlightPolicy");this._initEvents(a,t,n,p)}this._seriesModel=n||this._seriesModel,this._ecModel=r||this._ecModel,WZ.setHoverStyle(this)},YZ.onEmphasis=function(e){var t=this;this.node.hostTree.root.eachNode((function(i){var n,r,a;i.piece&&(t.node===i?i.piece.updateData(!1,i,"emphasis"):(n=i,r=t.node,(a=e)!==jZ&&(a===ZZ?n===r:a===XZ?n===r||n.isAncestorOf(r):n===r||n.isDescendantOf(r))?i.piece.childAt(0).trigger("highlight"):e!==jZ&&i.piece.childAt(0).trigger("downplay")))}))},YZ.onNormal=function(){this.node.hostTree.root.eachNode((function(e){e.piece&&e.piece.updateData(!1,e,"normal")}))},YZ.onHighlight=function(){this.updateData(!1,this.node,"highlight")},YZ.onDownplay=function(){this.updateData(!1,this.node,"downplay")},YZ._updateLabel=function(e,t,i){var n=this.node.getModel(),r=n.getModel("label"),a="normal"===i||"emphasis"===i?r:n.getModel(i+".label"),o=n.getModel("emphasis.label"),s=a.get("formatter")?i:"normal",l=UZ.retrieve(e.getFormattedLabel(this.node.dataIndex,s,null,null,"label"),this.node.name);!1===S("show")&&(l="");var u=this.node.getLayout(),h=a.get("minAngle");null==h&&(h=r.get("minAngle")),h=h/180*Math.PI;var c=u.endAngle-u.startAngle;null!=h&&Math.abs(c)<h&&(l="");var d=this.childAt(1);WZ.setLabelStyle(d.style,d.hoverStyle||{},r,o,{defaultText:a.getShallow("show")?l:null,autoColor:t,useInsideStyle:!0});var f,p=(u.startAngle+u.endAngle)/2,g=Math.cos(p),m=Math.sin(p),v=S("position"),y=S("distance")||0,_=S("align");"outside"===v?(f=u.r+y,_=p>Math.PI/2?"right":"left"):_&&"center"!==_?"left"===_?(f=u.r0+y,p>Math.PI/2&&(_="right")):"right"===_&&(f=u.r-y,p>Math.PI/2&&(_="left")):(f=(u.r+u.r0)/2,_="center"),d.attr("style",{text:l,textAlign:_,textVerticalAlign:S("verticalAlign")||"middle",opacity:S("opacity")});var x=f*g+u.cx,b=f*m+u.cy;d.attr("position",[x,b]);var w=S("rotate"),T=0;function S(e){var t=a.get(e);return null==t?r.get(e):t}"radial"===w?(T=-p)<-Math.PI/2&&(T+=Math.PI):"tangential"===w?(T=Math.PI/2-p)>Math.PI/2?T-=Math.PI:T<-Math.PI/2&&(T+=Math.PI):"number"==typeof w&&(T=w*Math.PI/180),d.attr("rotation",T)},YZ._initEvents=function(e,t,i,n){e.off("mouseover").off("mouseout").off("emphasis").off("normal");var r=this,a=function(){r.onEmphasis(n)},o=function(){r.onNormal()};i.isAnimationEnabled()&&e.on("mouseover",a).on("mouseout",o).on("emphasis",a).on("normal",o).on("downplay",(function(){r.onDownplay()})).on("highlight",(function(){r.onHighlight()}))},UZ.inherits(qZ,WZ.Group);var KZ=g,QZ=Om,JZ=qZ,$Z=Vy,eq=qc.windowOpen;QZ.extend({type:"sunburst",init:function(){},render:function(e,t,i,n){var r=this;this.seriesModel=e,this.api=i,this.ecModel=t;var a=e.getData(),o=a.tree.root,s=e.getViewRoot(),l=this.group,u=e.get("renderLabelForZeroData"),h=[];s.eachNode((function(e){h.push(e)}));var c=this._oldChildren||[];if(function(i,n){function r(e){return e.getId()}function s(r,s){!function(i,n){if(u||!i||i.getValue()||(i=null),i!==o&&n!==o)if(n&&n.piece)i?(n.piece.updateData(!1,i,"normal",e,t),a.setItemGraphicEl(i.dataIndex,n.piece)):(s=n)&&s.piece&&(l.remove(s.piece),s.piece=null);else if(i){var r=new JZ(i,e,t);l.add(r),a.setItemGraphicEl(i.dataIndex,r)}var s}(null==r?null:i[r],null==s?null:n[s])}0===i.length&&0===n.length||new $Z(n,i,r,r).add(s).update(s).remove(KZ.curry(s,null)).execute()}(h,c),function(i,n){if(n.depth>0){r.virtualPiece?r.virtualPiece.updateData(!1,i,"normal",e,t):(r.virtualPiece=new JZ(i,e,t),l.add(r.virtualPiece)),n.piece._onclickEvent&&n.piece.off("click",n.piece._onclickEvent);var a=function(e){r._rootToNode(n.parentNode)};n.piece._onclickEvent=a,r.virtualPiece.on("click",a)}else r.virtualPiece&&(l.remove(r.virtualPiece),r.virtualPiece=null)}(o,s),n&&n.highlight&&n.highlight.piece){var d=e.getShallow("highlightPolicy");n.highlight.piece.onEmphasis(d)}else if(n&&n.unhighlight){var f=this.virtualPiece;!f&&o.children.length&&(f=o.children[0].piece),f&&f.onNormal()}this._initEvents(),this._oldChildren=h},dispose:function(){},_initEvents:function(){var e=this,t=function(t){var i=!1;e.seriesModel.getViewRoot().eachNode((function(n){if(!i&&n.piece&&n.piece.childAt(0)===t.target){var r=n.getModel().get("nodeClick");if("rootToNode"===r)e._rootToNode(n);else if("link"===r){var a=n.getModel(),o=a.get("link");if(o){var s=a.get("target",!0)||"_blank";eq(o,s)}}i=!0}}))};this.group._onclickEvent&&this.group.off("click",this.group._onclickEvent),this.group.on("click",t),this.group._onclickEvent=t},_rootToNode:function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:"sunburstRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},containPoint:function(e,t){var i=t.getData().getItemLayout(0);if(i){var n=e[0]-i.cx,r=e[1]-i.cy,a=Math.sqrt(n*n+r*r);return a<=i.r&&a>=i.r0}}});var tq=h,iq=iR,nq="sunburstRootToNode";tq.registerAction({type:nq,update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){var n=iq.retrieveTargetInfo(e,[nq],t);if(n){var r=t.getViewRoot();r&&(e.direction=iq.aboveViewRoot(r,n.node)?"rollUp":"drillDown"),t.resetViewRoot(n.node)}}))}));var rq="sunburstHighlight";tq.registerAction({type:rq,update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){var n=iq.retrieveTargetInfo(e,[rq],t);n&&(e.highlight=n.node)}))})),tq.registerAction({type:"sunburstUnhighlight",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){e.unhighlight=!0}))}));var aq=Uc.parsePercent,oq=g,sq=Math.PI/180;function lq(e,t){var i=e.children||[];e.children=function(e,t){if("function"==typeof t)return e.sort(t);var i="asc"===t;return e.sort((function(e,t){var n=(e.getValue()-t.getValue())*(i?1:-1);return 0===n?(e.dataIndex-t.dataIndex)*(i?-1:1):n}))}(i,t),i.length&&oq.each(e.children,(function(e){lq(e,t)}))}var uq=function(e,t,i,n){t.eachSeriesByType(e,(function(e){var t=e.get("center"),n=e.get("radius");oq.isArray(n)||(n=[0,n]),oq.isArray(t)||(t=[t,t]);var r=i.getWidth(),a=i.getHeight(),o=Math.min(r,a),s=aq(t[0],r),l=aq(t[1],a),u=aq(n[0],o/2),h=aq(n[1],o/2),c=-e.get("startAngle")*sq,d=e.get("minAngle")*sq,f=e.getData().tree.root,p=e.getViewRoot(),g=p.depth,m=e.get("sort");null!=m&&lq(p,m);var v=0;oq.each(p.children,(function(e){!isNaN(e.getValue())&&v++}));var y=p.getValue(),_=Math.PI/(y||v)*2,x=p.depth>0,b=p.height-(x?-1:1),w=(h-u)/(b||1),T=e.get("clockwise"),S=e.get("stillShowZeroSum"),M=T?1:-1,A=function(e,t){if(e){var i=t;if(e!==f){var n=e.getValue(),r=0===y&&S?_:n*_;r<d&&(r=d),i=t+M*r;var a=e.depth-g-(x?-1:1),h=u+w*a,c=u+w*(a+1),p=e.getModel();null!=p.get("r0")&&(h=aq(p.get("r0"),o/2)),null!=p.get("r")&&(c=aq(p.get("r"),o/2)),e.setLayout({angle:r,startAngle:t,endAngle:i,clockwise:T,cx:s,cy:l,r0:h,r:c})}if(e.children&&e.children.length){var m=0;oq.each(e.children,(function(e){m+=A(e,t+m)}))}return i-t}};if(x){var I=u,C=u+w,D=2*Math.PI;f.setLayout({angle:D,startAngle:c,endAngle:c+D,clockwise:T,cx:s,cy:l,r0:I,r:C})}A(p,c)}))},hq=h,cq=g,dq=YC,fq=uq,pq=cD;hq.registerVisual(cq.curry(dq,"sunburst")),hq.registerLayout(cq.curry(fq,"sunburst")),hq.registerProcessor(cq.curry(pq,"sunburst"));var gq=g;function mq(e,t){return t=t||[0,0],gq.map(["x","y"],(function(i,n){var r=this.getAxis(i),a=t[n],o=e[n]/2;return"category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(a-o)-r.dataToCoord(a+o))}),this)}var vq=function(e){var t=e.grid.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:gq.bind(mq,e)}}},yq=g;function _q(e,t){return t=t||[0,0],yq.map([0,1],(function(i){var n=t[i],r=e[i]/2,a=[],o=[];return a[i]=n-r,o[i]=n+r,a[1-i]=o[1-i]=t[1-i],Math.abs(this.dataToPoint(a)[i]-this.dataToPoint(o)[i])}),this)}var xq=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:yq.bind(_q,e)}}},bq=g;function wq(e,t){var i=this.getAxis(),n=t instanceof Array?t[0]:t,r=(e instanceof Array?e[0]:e)/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(n-r)-i.dataToCoord(n+r))}var Tq=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:bq.bind(wq,e)}}},Sq=g;function Mq(e,t){return Sq.map(["Radius","Angle"],(function(i,n){var r=this["get"+i+"Axis"](),a=t[n],o=e[n]/2,s="dataTo"+i,l="category"===r.type?r.getBandWidth():Math.abs(r[s](a-o)-r[s](a+o));return"Angle"===i&&(l=l*Math.PI/180),l}),this)}var Aq=function(e){var t=e.getRadiusAxis(),i=e.getAngleAxis(),n=t.getExtent();return n[0]>n[1]&&n.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:n[1],r0:n[0]},api:{coord:Sq.bind((function(n){var r=t.dataToRadius(n[0]),a=i.dataToAngle(n[1]),o=e.coordToPoint([r,a]);return o.push(r,a*Math.PI/180),o})),size:Sq.bind(Mq,e)}}},Iq=function(e){var t=e.getRect(),i=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:i.start,end:i.end,weeks:i.weeks,dayCount:i.allDay}},api:{coord:function(t,i){return e.dataToPoint(t,i)}}}},Cq=g,Dq=No,Eq=HT.getDefaultLabel,Lq=vx,Pq=Qx.getLayoutOnAxis,Nq=Vy,Rq=um,Oq=zc,kq=Om,zq=VS.createClipPath,Bq=vq,Fq=xq,Vq=Tq,Gq=Aq,Hq=Iq,Uq=Dq.CACHED_LABEL_STYLE_PROPERTIES,Wq=["itemStyle"],jq=["emphasis","itemStyle"],Xq=["label"],Zq=["emphasis","label"],qq={cartesian2d:Bq,geo:Fq,singleAxis:Vq,polar:Gq,calendar:Hq};function Yq(e,t,i,n,r){null==i[e]||r||(t[e]=i[e],i[e]=n[e])}function Kq(e,t,i,n){var r=e.get("renderItem"),a=e.coordinateSystem,o={};a&&(o=a.prepareCustoms?a.prepareCustoms():qq[a.type](a));var s,l,u,h,c,d=Cq.defaults({getWidth:n.getWidth,getHeight:n.getHeight,getZr:n.getZr,getDevicePixelRatio:n.getDevicePixelRatio,value:function(e,i){return null==i&&(i=s),t.get(t.getDimension(e||0),i)},style:function(i,n){null==n&&(n=s),g(n);var r=l.getModel(Wq).getItemStyle();null!=c&&(r.fill=c);var a=t.getItemVisual(n,"opacity");null!=a&&(r.opacity=a);var o=i?iY(i,u):u;return Dq.setTextStyle(r,o,null,{autoColor:c,isRectText:!0}),r.text=o.getShallow("show")?Cq.retrieve2(e.getFormattedLabel(n,"normal"),Eq(t,n)):null,i&&nY(r,i),r},styleEmphasis:function(i,n){null==n&&(n=s),g(n);var r=l.getModel(jq).getItemStyle(),a=i?iY(i,h):h;return Dq.setTextStyle(r,a,null,{isRectText:!0},!0),r.text=a.getShallow("show")?Cq.retrieve3(e.getFormattedLabel(n,"emphasis"),e.getFormattedLabel(n,"normal"),Eq(t,n)):null,i&&nY(r,i),r},visual:function(e,i){return null==i&&(i=s),t.getItemVisual(i,e)},barLayout:function(e){if(a.getBaseAxis){var t=a.getBaseAxis();return Pq(Cq.defaults({axis:t},e),n)}},currentSeriesIndices:function(){return i.getCurrentSeriesIndices()},font:function(e){return Dq.getFont(e,i)}},o.api||{}),f={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:o.coordSys,dataInsideLength:t.count(),encode:Qq(e.getData())},p=!0;return function(e,i){return s=e,p=!0,r&&r(Cq.defaults({dataIndexInside:e,dataIndex:t.getRawIndex(e),actionType:i?i.type:null},f),d)};function g(e){null==e&&(e=s),p&&(l=t.getItemModel(e),u=l.getModel(Xq),h=l.getModel(Zq),c=t.getItemVisual(e,"color"),p=!1)}}function Qq(e){var t={};return Cq.each(e.dimensions,(function(i,n){var r=e.getDimensionInfo(i);if(!r.isExtraCoord){var a=r.coordDim;(t[a]=t[a]||[])[r.coordDimIndex]=n}})),t}function Jq(e,t,i,n,r,a){return(e=$q(e,t,i,n,r,a,!0))&&a.setItemGraphicEl(t,e),e}function $q(e,t,i,n,r,a,o){var s,l=!i,u=(i=i||{}).type,h=i.shape,c=i.style;if(e&&(l||null!=u&&u!==e.__customGraphicType||"path"===u&&(s=h)&&(s.hasOwnProperty("pathData")||s.hasOwnProperty("d"))&&aY(h)!==e.__customPathData||"image"===u&&oY(c,"image")&&c.image!==e.__customImagePath||"text"===u&&oY(h,"text")&&c.text!==e.__customText)&&(r.remove(e),e=null),!l){var d=!e;return!e&&(e=function(e){var t,i=e.type;if("path"===i){var n=e.shape,r=null!=n.width&&null!=n.height?{x:n.x||0,y:n.y||0,width:n.width,height:n.height}:null,a=aY(n);(t=Dq.makePath(a,null,r,n.layout||"center")).__customPathData=a}else if("image"===i)(t=new Dq.Image({})).__customImagePath=e.style.image;else if("text"===i)(t=new Dq.Text({})).__customText=e.style.text;else if("group"===i)t=new Dq.Group;else{if("compoundPath"===i)throw new Error('"compoundPath" is not supported yet.');t=new(Dq.getShapeClass(i))}return t.__customGraphicType=i,t.name=e.name,t}(i)),function(e,t,i,n,r,a,o){var s={},l=i.style||{};if(i.shape&&(s.shape=Cq.clone(i.shape)),i.position&&(s.position=i.position.slice()),i.scale&&(s.scale=i.scale.slice()),i.origin&&(s.origin=i.origin.slice()),i.rotation&&(s.rotation=i.rotation),"image"===e.type&&i.style){var u=s.style={};Cq.each(["x","y","width","height"],(function(t){Yq(t,u,l,e.style,a)}))}if("text"===e.type&&i.style&&(u=s.style={},Cq.each(["x","y"],(function(t){Yq(t,u,l,e.style,a)})),!l.hasOwnProperty("textFill")&&l.fill&&(l.textFill=l.fill),!l.hasOwnProperty("textStroke")&&l.stroke&&(l.textStroke=l.stroke)),"group"!==e.type&&(e.useStyle(l),a)){e.style.opacity=0;var h=l.opacity;null==h&&(h=1),Dq.initProps(e,{style:{opacity:h}},n,t)}a?e.attr(s):Dq.updateProps(e,s,n,t),i.hasOwnProperty("z2")&&e.attr("z2",i.z2||0),i.hasOwnProperty("silent")&&e.attr("silent",i.silent),i.hasOwnProperty("invisible")&&e.attr("invisible",i.invisible),i.hasOwnProperty("ignore")&&e.attr("ignore",i.ignore),i.hasOwnProperty("info")&&e.attr("info",i.info);var c=i.styleEmphasis;Dq.setElementHoverStyle(e,c),o&&Dq.setAsHighDownDispatcher(e,!1!==c)}(e,t,i,n,0,d,o),"group"===u&&function(e,t,i,n,r){var a=i.children,o=a?a.length:0,s=i.$mergeChildren,l="byName"===s||i.diffChildrenByName,u=!1===s;if(o||l||u){if(l)return h={oldChildren:e.children()||[],newChildren:a||[],dataIndex:t,animatableModel:n,group:e,data:r},void new Nq(h.oldChildren,h.newChildren,eY,eY,h).add(tY).update(tY).remove(rY).execute();var h;u&&e.removeAll();for(var c=0;c<o;c++)a[c]&&$q(e.childAt(c),t,a[c],n,e,r)}}(e,t,i,n,a),r.add(e),e}}function eY(e,t){var i=e&&e.name;return null!=i?i:"e\0\0"+t}function tY(e,t){var i=this.context,n=null!=e?i.newChildren[e]:null;$q(null!=t?i.oldChildren[t]:null,i.dataIndex,n,i.animatableModel,i.group,i.data)}function iY(e,t){var i=new Oq({},t);return Cq.each(Uq,(function(t,n){e.hasOwnProperty(t)&&(i.option[n]=e[t])})),i}function nY(e,t){for(var i in t)!t.hasOwnProperty(i)&&Uq.hasOwnProperty(i)||(e[i]=t[i])}function rY(e){var t=this.context,i=t.oldChildren[e];i&&t.group.remove(i)}function aY(e){return e&&(e.pathData||e.d)}function oY(e,t){return e&&e.hasOwnProperty(t)}Rq.extend({type:"series.custom",dependencies:["grid","polar","geo","singleAxis","calendar"],defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,useTransform:!0,clip:!1},getInitialData:function(e,t){return Lq(this.getSource(),this)},getDataParams:function(e,t,i){var n=Rq.prototype.getDataParams.apply(this,arguments);return i&&(n.info=i.info),n}}),kq.extend({type:"custom",_data:null,render:function(e,t,i,n){var r=this._data,a=e.getData(),o=this.group,s=Kq(e,a,t,i);a.diff(r).add((function(t){Jq(null,t,s(t,n),e,o,a)})).update((function(t,i){Jq(r.getItemGraphicEl(i),t,s(t,n),e,o,a)})).remove((function(e){var t=r.getItemGraphicEl(e);t&&o.remove(t)})).execute();var l=e.get("clip",!0)?zq(e.coordinateSystem,!1,e):null;l?o.setClipPath(l):o.removeClipPath(),this._data=a},incrementalPrepareRender:function(e,t,i){this.group.removeAll(),this._data=null},incrementalRender:function(e,t,i,n,r){var a=t.getData(),o=Kq(t,a,i,n);function s(e){e.isGroup||(e.incremental=!0,e.useHoverLayer=!0)}for(var l=e.start;l<e.end;l++)Jq(null,l,o(l,r),t,this.group,a).traverse(s)},dispose:Cq.noop,filterForExposedEvent:function(e,t,i,n){var r=t.element;if(null==r||i.name===r)return!0;for(;(i=i.parent)&&i!==this.group;)if(i.name===r)return!0;return!1}});var sY=g,lY=Uc.parsePercent,uY=ex.isDimensionStacked;function hY(e){return e.get("stack")||"__ec_stack_"+e.seriesIndex}function cY(e,t){return t.dim+e.model.componentIndex}var dY=function(e,t,i){var n={},r=function(e,t){var i={};sY.each(e,(function(e,t){var n=e.getData(),r=e.coordinateSystem,a=r.getBaseAxis(),o=cY(r,a),s=a.getExtent(),l="category"===a.type?a.getBandWidth():Math.abs(s[1]-s[0])/n.count(),u=i[o]||{bandWidth:l,remainedWidth:l,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},h=u.stacks;i[o]=u;var c=hY(e);h[c]||u.autoWidthCount++,h[c]=h[c]||{width:0,maxWidth:0};var d=lY(e.get("barWidth"),l),f=lY(e.get("barMaxWidth"),l),p=e.get("barGap"),g=e.get("barCategoryGap");d&&!h[c].width&&(d=Math.min(u.remainedWidth,d),h[c].width=d,u.remainedWidth-=d),f&&(h[c].maxWidth=f),null!=p&&(u.gap=p),null!=g&&(u.categoryGap=g)}));var n={};return sY.each(i,(function(e,t){n[t]={};var i=e.stacks,r=e.bandWidth,a=lY(e.categoryGap,r),o=lY(e.gap,1),s=e.remainedWidth,l=e.autoWidthCount,u=(s-a)/(l+(l-1)*o);u=Math.max(u,0),sY.each(i,(function(e,t){var i=e.maxWidth;i&&i<u&&(i=Math.min(i,s),e.width&&(i=Math.min(i,e.width)),s-=i,e.width=i,l--)})),u=(s-a)/(l+(l-1)*o),u=Math.max(u,0);var h,c=0;sY.each(i,(function(e,t){e.width||(e.width=u),h=e,c+=e.width*(1+o)})),h&&(c-=h.width*o);var d=-c/2;sY.each(i,(function(e,i){n[t][i]=n[t][i]||{offset:d,width:e.width},d+=e.width*(1+o)}))})),n}(sY.filter(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(),i=e.coordinateSystem,a=i.getBaseAxis(),o=cY(i,a),s=hY(e),l=r[o][s],u=l.offset,h=l.width,c=i.getOtherAxis(a),d=e.coordinateSystem.cx,f=e.coordinateSystem.cy,p=e.get("barMinHeight")||0,g=e.get("barMinAngle")||0;n[s]=n[s]||[];for(var m=t.mapDimension(c.dim),v=t.mapDimension(a.dim),y=uY(t,m),_="radius"!==a.dim||!e.get("roundCap",!0),x="radius"===c.dim?c.dataToRadius(0):c.dataToAngle(0),b=0,w=t.count();b<w;b++){var T,S,M,A,I=t.get(m,b),C=t.get(v,b),D=I>=0?"p":"n",E=x;if(y&&(n[s][C]||(n[s][C]={p:x,n:x}),E=n[s][C][D]),"radius"===c.dim){var L=c.dataToRadius(I)-x,P=a.dataToAngle(C);Math.abs(L)<p&&(L=(L<0?-1:1)*p),T=E,S=E+L,A=(M=P-u)-h,y&&(n[s][C][D]=S)}else{var N=c.dataToAngle(I,_)-x,R=a.dataToRadius(C);Math.abs(N)<g&&(N=(N<0?-1:1)*g),S=(T=R+u)+h,M=E,A=E+N,y&&(n[s][C][D]=A)}t.setItemLayout(b,{cx:d,cy:f,r0:T,r:S,startAngle:-M*Math.PI/180,endAngle:-A*Math.PI/180})}}}),this)},fY=dY,pY=g,gY=wT;function mY(e,t){gY.call(this,"radius",e,t),this.type="category"}mY.prototype={constructor:mY,pointToData:function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},dataToRadius:gY.prototype.dataToCoord,radiusToData:gY.prototype.coordToData},pY.inherits(mY,gY);var vY=mY,yY=g,_Y=Tn,xY=wT,bY=(0,lo.makeInner)();function wY(e,t){t=t||[0,360],xY.call(this,"angle",e,t),this.type="category"}wY.prototype={constructor:wY,pointToData:function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},dataToAngle:xY.prototype.dataToCoord,angleToData:xY.prototype.coordToData,calculateCategoryInterval:function(){var e=this,t=e.getLabelModel(),i=e.scale,n=i.getExtent(),r=i.count();if(n[1]-n[0]<1)return 0;var a=n[0],o=e.dataToCoord(a+1)-e.dataToCoord(a),s=Math.abs(o),l=_Y.getBoundingRect(a,t.getFont(),"center","top"),u=Math.max(l.height,7)/s;isNaN(u)&&(u=1/0);var h=Math.max(0,Math.floor(u)),c=bY(e.model),d=c.lastAutoInterval,f=c.lastTickCount;return null!=d&&null!=f&&Math.abs(d-h)<=1&&Math.abs(f-r)<=1&&d>h?h=d:(c.lastTickCount=r,c.lastAutoInterval=h),h}},yY.inherits(wY,xY);var TY=vY,SY=wY,MY=function(e){this.name=e||"",this.cx=0,this.cy=0,this._radiusAxis=new TY,this._angleAxis=new SY,this._radiusAxis.polar=this._angleAxis.polar=this};MY.prototype={type:"polar",axisPointerEnabled:!0,constructor:MY,dimensions:["radius","angle"],model:null,containPoint:function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},containData:function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},getAxis:function(e){return this["_"+e+"Axis"]},getAxes:function(){return[this._radiusAxis,this._angleAxis]},getAxesByScale:function(e){var t=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===e&&t.push(i),n.scale.type===e&&t.push(n),t},getAngleAxis:function(){return this._angleAxis},getRadiusAxis:function(){return this._radiusAxis},getOtherAxis:function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},getTooltipAxes:function(e){var t=null!=e&&"auto"!==e?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},dataToPoint:function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},pointToData:function(e,t){var i=this.pointToCoord(e);return[this._radiusAxis.radiusToData(i[0],t),this._angleAxis.angleToData(i[1],t)]},pointToCoord:function(e){var t=e[0]-this.cx,i=e[1]-this.cy,n=this.getAngleAxis(),r=n.getExtent(),a=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);n.inverse?a=o-360:o=a+360;var s=Math.sqrt(t*t+i*i);t/=s,i/=s;for(var l=Math.atan2(-i,t)/Math.PI*180,u=l<a?1:-1;l<a||l>o;)l+=360*u;return[s,l]},coordToPoint:function(e){var t=e[0],i=e[1]/180*Math.PI;return[Math.cos(i)*t+this.cx,-Math.sin(i)*t+this.cy]},getArea:function(){var e=this.getAngleAxis(),t=this.getRadiusAxis().getExtent().slice();t[0]>t[1]&&t.reverse();var i=e.getExtent(),n=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:t[0],r:t[1],startAngle:-i[0]*n,endAngle:-i[1]*n,clockwise:e.inverse,contain:function(e,t){var i=e-this.cx,n=t-this.cy,r=i*i+n*n,a=this.r,o=this.r0;return r<=a*a&&r>=o*o}}}};var AY=MY,IY=g,CY=ZM,DY=aw,EY=Ld.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});IY.merge(EY.prototype,DY);var LY={splitNumber:5};function PY(e,t){return t.type||(t.data?"category":"value")}CY("angle",EY,PY,{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}}),CY("radius",EY,PY,LY),h.extendComponentModel({type:"polar",dependencies:["polarAxis","angleAxis"],coordinateSystem:null,findAxisModel:function(e){var t;return this.ecModel.eachComponent(e,(function(e){e.getCoordSysModel()===this&&(t=e)}),this),t},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"80%"}});var NY=g,RY=AY,OY=Uc.parsePercent,kY=yx,zY=kY.createScaleByModel,BY=kY.niceScaleExtent,FY=sp,VY=ex.getStackedDimension;function GY(e,t){var i=this,n=i.getAngleAxis(),r=i.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),r.scale.setExtent(1/0,-1/0),e.eachSeries((function(e){if(e.coordinateSystem===i){var t=e.getData();NY.each(t.mapDimension("radius",!0),(function(e){r.scale.unionExtentFromData(t,VY(t,e))})),NY.each(t.mapDimension("angle",!0),(function(e){n.scale.unionExtentFromData(t,VY(t,e))}))}})),BY(n.scale,n.model),BY(r.scale,r.model),"category"===n.type&&!n.onBand){var a=n.getExtent(),o=360/n.scale.count();n.inverse?a[1]+=o:a[1]-=o,n.setExtent(a[0],a[1])}}function HY(e,t){if(e.type=t.get("type"),e.scale=zY(t),e.onBand=t.get("boundaryGap")&&"category"===e.type,e.inverse=t.get("inverse"),"angleAxis"===t.mainType){e.inverse^=t.get("clockwise");var i=t.get("startAngle");e.setExtent(i,i+(e.inverse?-360:360))}t.axis=e,e.model=t}var UY={dimensions:RY.prototype.dimensions,create:function(e,t){var i=[];return e.eachComponent("polar",(function(e,n){var r=new RY(n);r.update=GY;var a=r.getRadiusAxis(),o=r.getAngleAxis(),s=e.findAxisModel("radiusAxis"),l=e.findAxisModel("angleAxis");HY(a,s),HY(o,l),function(e,t,i){var n=t.get("center"),r=i.getWidth(),a=i.getHeight();e.cx=OY(n[0],r),e.cy=OY(n[1],a);var o=e.getRadiusAxis(),s=Math.min(r,a)/2,l=t.get("radius");null==l?l=[0,"100%"]:NY.isArray(l)||(l=[0,l]),l=[OY(l[0],s),OY(l[1],s)],o.inverse?o.setExtent(l[1],l[0]):o.setExtent(l[0],l[1])}(r,e,t),i.push(r),e.coordinateSystem=r,r.model=e})),e.eachSeries((function(t){if("polar"===t.get("coordinateSystem")){var i=e.queryComponents({mainType:"polar",index:t.get("polarIndex"),id:t.get("polarId")})[0];t.coordinateSystem=i.coordinateSystem}})),i}};FY.register("polar",UY);var WY=g,jY=No,XY=zc,ZY=qA,qY=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function YY(e,t,i){t[1]>t[0]&&(t=t.slice().reverse());var n=e.coordToPoint([t[0],i]),r=e.coordToPoint([t[1],i]);return{x1:n[0],y1:n[1],x2:r[0],y2:r[1]}}function KY(e){return e.getRadiusAxis().inverse?0:1}function QY(e){var t=e[0],i=e[e.length-1];t&&i&&Math.abs(Math.abs(t.coord-i.coord)-360)<1e-4&&e.pop()}uI.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(e,t){if(this.group.removeAll(),e.get("show")){var i=e.axis,n=i.polar,r=n.getRadiusAxis().getExtent(),a=i.getTicksCoords(),o=i.getMinorTicksCoords(),s=WY.map(i.getViewLabels(),(function(e){return(e=WY.clone(e)).coord=i.dataToCoord(e.tickValue),e}));QY(s),QY(a),WY.each(qY,(function(t){!e.get(t+".show")||i.scale.isBlank()&&"axisLine"!==t||this["_"+t](e,n,a,o,r,s)}),this)}},_axisLine:function(e,t,i,n,r){var a,o=e.getModel("axisLine.lineStyle"),s=KY(t),l=s?0:1;(a=0===r[l]?new jY.Circle({shape:{cx:t.cx,cy:t.cy,r:r[s]},style:o.getLineStyle(),z2:1,silent:!0}):new jY.Ring({shape:{cx:t.cx,cy:t.cy,r:r[s],r0:r[l]},style:o.getLineStyle(),z2:1,silent:!0})).style.fill=null,this.group.add(a)},_axisTick:function(e,t,i,n,r){var a=e.getModel("axisTick"),o=(a.get("inside")?-1:1)*a.get("length"),s=r[KY(t)],l=WY.map(i,(function(e){return new jY.Line({shape:YY(t,[s,s+o],e.coord)})}));this.group.add(jY.mergePath(l,{style:WY.defaults(a.getModel("lineStyle").getLineStyle(),{stroke:e.get("axisLine.lineStyle.color")})}))},_minorTick:function(e,t,i,n,r){if(n.length){for(var a=e.getModel("axisTick"),o=e.getModel("minorTick"),s=(a.get("inside")?-1:1)*o.get("length"),l=r[KY(t)],u=[],h=0;h<n.length;h++)for(var c=0;c<n[h].length;c++)u.push(new jY.Line({shape:YY(t,[l,l+s],n[h][c].coord)}));this.group.add(jY.mergePath(u,{style:WY.defaults(o.getModel("lineStyle").getLineStyle(),WY.defaults(a.getLineStyle(),{stroke:e.get("axisLine.lineStyle.color")}))}))}},_axisLabel:function(e,t,i,n,r,a){var o=e.getCategories(!0),s=e.getModel("axisLabel"),l=s.get("margin"),u=e.get("triggerEvent");WY.each(a,(function(i,n){var a=s,h=i.tickValue,c=r[KY(t)],d=t.coordToPoint([c+l,i.coord]),f=t.cx,p=t.cy,g=Math.abs(d[0]-f)/c<.3?"center":d[0]>f?"left":"right",m=Math.abs(d[1]-p)/c<.3?"middle":d[1]>p?"top":"bottom";o&&o[h]&&o[h].textStyle&&(a=new XY(o[h].textStyle,s,s.ecModel));var v=new jY.Text({silent:ZY.isLabelSilent(e)});this.group.add(v),jY.setTextStyle(v.style,a,{x:d[0],y:d[1],textFill:a.getTextColor()||e.get("axisLine.lineStyle.color"),text:i.formattedLabel,textAlign:g,textVerticalAlign:m}),u&&(v.eventData=ZY.makeAxisEventDataBase(e),v.eventData.targetType="axisLabel",v.eventData.value=i.rawLabel)}),this)},_splitLine:function(e,t,i,n,r){var a=e.getModel("splitLine").getModel("lineStyle"),o=a.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=0;u<i.length;u++){var h=s++%o.length;l[h]=l[h]||[],l[h].push(new jY.Line({shape:YY(t,r,i[u].coord)}))}for(u=0;u<l.length;u++)this.group.add(jY.mergePath(l[u],{style:WY.defaults({stroke:o[u%o.length]},a.getLineStyle()),silent:!0,z:e.get("z")}))},_minorSplitLine:function(e,t,i,n,r){if(n.length){for(var a=e.getModel("minorSplitLine").getModel("lineStyle"),o=[],s=0;s<n.length;s++)for(var l=0;l<n[s].length;l++)o.push(new jY.Line({shape:YY(t,r,n[s][l].coord)}));this.group.add(jY.mergePath(o,{style:a.getLineStyle(),silent:!0,z:e.get("z")}))}},_splitArea:function(e,t,i,n,r){if(i.length){var a=e.getModel("splitArea").getModel("areaStyle"),o=a.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=Math.PI/180,h=-i[0].coord*u,c=Math.min(r[0],r[1]),d=Math.max(r[0],r[1]),f=e.get("clockwise"),p=1;p<i.length;p++){var g=s++%o.length;l[g]=l[g]||[],l[g].push(new jY.Sector({shape:{cx:t.cx,cy:t.cy,r0:c,r:d,startAngle:h,endAngle:-i[p].coord*u,clockwise:f},silent:!0})),h=-i[p].coord*u}for(p=0;p<l.length;p++)this.group.add(jY.mergePath(l[p],{style:WY.defaults({fill:o[p%o.length]},a.getAreaStyle()),silent:!0}))}}});var JY=g,$Y=No,eK=qA,tK=["axisLine","axisTickLabel","axisName"],iK=["splitLine","splitArea","minorSplitLine"];uI.extend({type:"radiusAxis",axisPointerClass:"PolarAxisPointer",render:function(e,t){if(this.group.removeAll(),e.get("show")){var i=e.axis,n=i.polar,r=n.getAngleAxis(),a=i.getTicksCoords(),o=i.getMinorTicksCoords(),s=r.getExtent()[0],l=i.getExtent(),u=function(e,t,i){return{position:[e.cx,e.cy],rotation:i/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:t.getModel("axisLabel").get("rotate"),z2:1}}(n,e,s),h=new eK(e,u);JY.each(tK,h.add,h),this.group.add(h.getGroup()),JY.each(iK,(function(t){e.get(t+".show")&&!i.scale.isBlank()&&this["_"+t](e,n,s,l,a,o)}),this)}},_splitLine:function(e,t,i,n,r){var a=e.getModel("splitLine").getModel("lineStyle"),o=a.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=0;u<r.length;u++){var h=s++%o.length;l[h]=l[h]||[],l[h].push(new $Y.Circle({shape:{cx:t.cx,cy:t.cy,r:r[u].coord}}))}for(u=0;u<l.length;u++)this.group.add($Y.mergePath(l[u],{style:JY.defaults({stroke:o[u%o.length],fill:null},a.getLineStyle()),silent:!0}))},_minorSplitLine:function(e,t,i,n,r,a){if(a.length){for(var o=e.getModel("minorSplitLine").getModel("lineStyle"),s=[],l=0;l<a.length;l++)for(var u=0;u<a[l].length;u++)s.push(new $Y.Circle({shape:{cx:t.cx,cy:t.cy,r:a[l][u].coord}}));this.group.add($Y.mergePath(s,{style:JY.defaults({fill:null},o.getLineStyle()),silent:!0}))}},_splitArea:function(e,t,i,n,r){if(r.length){var a=e.getModel("splitArea").getModel("areaStyle"),o=a.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=r[0].coord,h=1;h<r.length;h++){var c=s++%o.length;l[c]=l[c]||[],l[c].push(new $Y.Sector({shape:{cx:t.cx,cy:t.cy,r0:u,r:r[h].coord,startAngle:0,endAngle:2*Math.PI},silent:!0})),u=r[h].coord}for(h=0;h<l.length;h++)this.group.add($Y.mergePath(l[h],{style:JY.defaults({fill:o[h%o.length]},a.getAreaStyle()),silent:!0}))}}});var nK=qc,rK=No,aK=RX,oK=Ue,sK=qA,lK=uI,uK=NX.extend({makeElOption:function(e,t,i,n,r){var a=i.axis;"angle"===a.dim&&(this.animationThreshold=Math.PI/18);var o,s=a.polar,l=s.getOtherAxis(a).getExtent();o=a["dataTo"+nK.capitalFirst(a.dim)](t);var u=n.get("type");if(u&&"none"!==u){var h=aK.buildElStyle(n),c=hK[u](a,s,o,l,h);c.style=h,e.graphicKey=c.type,e.pointer=c}var d=function(e,t,i,n,r){var a=t.axis,o=a.dataToCoord(e),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,h,c=n.getRadiusAxis().getExtent();if("radius"===a.dim){var d=oK.create();oK.rotate(d,d,s),oK.translate(d,d,[n.cx,n.cy]),l=rK.applyTransform([o,-r],d);var f=t.getModel("axisLabel").get("rotate")||0,p=sK.innerTextLayout(s,f*Math.PI/180,-1);u=p.textAlign,h=p.textVerticalAlign}else{var g=c[1];l=n.coordToPoint([g+r,o]);var m=n.cx,v=n.cy;u=Math.abs(l[0]-m)/g<.3?"center":l[0]>m?"left":"right",h=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:h}}(t,i,0,s,n.get("label.margin"));aK.buildLabelElOption(e,i,n,r,d)}}),hK={line:function(e,t,i,n,r){return"angle"===e.dim?{type:"Line",shape:aK.makeLineShape(t.coordToPoint([n[0],i]),t.coordToPoint([n[1],i]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r:i}}},shadow:function(e,t,i,n,r){var a=Math.max(1,e.getBandWidth()),o=Math.PI/180;return"angle"===e.dim?{type:"Sector",shape:aK.makeSectorShape(t.cx,t.cy,n[0],n[1],(-i-a/2)*o,(a/2-i)*o)}:{type:"Sector",shape:aK.makeSectorShape(t.cx,t.cy,i-a/2,i+a/2,0,2*Math.PI)}}};lK.registerAxisPointerClass("PolarAxisPointer",uK);var cK=h,dK=g,fK=fY;cK.registerLayout(dK.curry(fK,"bar")),cK.extendComponentView({type:"polar"});var pK=g,gK=lo,mK=Ld,vK=zc,yK=AC,_K=RP,xK=mK.extend({type:"geo",coordinateSystem:null,layoutMode:"box",init:function(e){mK.prototype.init.apply(this,arguments),gK.defaultEmphasis(e,"label",["show"])},optionUpdated:function(){var e=this.option,t=this;e.regions=_K.getFilledRegions(e.regions,e.map,e.nameMap),this._optionModelMap=pK.reduce(e.regions||[],(function(e,i){return i.name&&e.set(i.name,new vK(i,t)),e}),pK.createHashMap()),this.updateSelectedMap(e.regions)},defaultOption:{zlevel:0,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",color:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},getRegionModel:function(e){return this._optionModelMap.get(e)||new vK(null,this,this.ecModel)},getFormattedLabel:function(e,t){t=t||"normal";var i=this.getRegionModel(e).get(("normal"===t?"":t+".")+"label.formatter"),n={name:e};return"function"==typeof i?(n.status=t,i(n)):"string"==typeof i?i.replace("{a}",null!=e?e:""):void 0},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e}});pK.mixin(xK,yK);var bK=QL;h.extendComponentView({type:"geo",init:function(e,t){var i=new bK(t,!0);this._mapDraw=i,this.group.add(i.group)},render:function(e,t,i,n){if(!n||"geoToggleSelect"!==n.type||n.from!==this.uid){var r=this._mapDraw;e.get("show")?r.draw(e,t,i,this,n):this._mapDraw.group.removeAll(),this.group.silent=e.get("silent")}},dispose:function(){this._mapDraw&&this._mapDraw.remove()}});var wK=h,TK=g;function SK(e,t){t.update="updateView",wK.registerAction(t,(function(t,i){var n={};return i.eachComponent({mainType:"geo",query:t},(function(i){i[e](t.name);var r=i.coordinateSystem;TK.each(r.regions,(function(e){n[e.name]=i.isSelected(e.name)||!1}))})),{selected:n,name:t.name}}))}SK("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),SK("select",{type:"geoSelect",event:"geoselected"}),SK("unSelect",{type:"geoUnSelect",event:"geounselected"});var MK=g,AK=Hc,IK=Uc,CK=sp,DK=864e5;function EK(e,t,i){this._model=e}function LK(e,t,i,n){var r=i.calendarModel,a=i.seriesModel,o=r?r.coordinateSystem:a?a.coordinateSystem:null;return o===this?o[e](n):null}EK.prototype={constructor:EK,type:"calendar",dimensions:["time","value"],getDimensionsInfo:function(){return[{name:"time",type:"time"},"value"]},getRangeInfo:function(){return this._rangeInfo},getModel:function(){return this._model},getRect:function(){return this._rect},getCellWidth:function(){return this._sw},getCellHeight:function(){return this._sh},getOrient:function(){return this._orient},getFirstDayOfWeek:function(){return this._firstDayOfWeek},getDateInfo:function(e){var t=(e=IK.parseDate(e)).getFullYear(),i=e.getMonth()+1;i=i<10?"0"+i:i;var n=e.getDate();n=n<10?"0"+n:n;var r=e.getDay();return{y:t,m:i,d:n,day:r=Math.abs((r+7-this.getFirstDayOfWeek())%7),time:e.getTime(),formatedDate:t+"-"+i+"-"+n,date:e}},getNextNDay:function(e,t){return 0===(t=t||0)||(e=new Date(this.getDateInfo(e).time)).setDate(e.getDate()+t),this.getDateInfo(e)},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 i=this._rangeInfo.weeks||1,n=["width","height"],r=this._model.get("cellSize").slice(),a=this._model.getBoxLayoutParams(),o="horizontal"===this._orient?[i,7]:[7,i];MK.each([0,1],(function(e){u(r,e)&&(a[n[e]]=r[e]*o[e])}));var s={width:t.getWidth(),height:t.getHeight()},l=this._rect=AK.getLayoutRect(a,s);function u(e,t){return null!=e[t]&&"auto"!==e[t]}MK.each([0,1],(function(e){u(r,e)||(r[e]=l[n[e]]/o[e])})),this._sw=r[0],this._sh=r[1]},dataToPoint:function(e,t){MK.isArray(e)&&(e=e[0]),null==t&&(t=!0);var i=this.getDateInfo(e),n=this._rangeInfo,r=i.formatedDate;if(t&&!(i.time>=n.start.time&&i.time<n.end.time+DK))return[NaN,NaN];var a=i.day,o=this._getRangeInfo([n.start.time,r]).nthWeek;return"vertical"===this._orient?[this._rect.x+a*this._sw+this._sw/2,this._rect.y+o*this._sh+this._sh/2]:[this._rect.x+o*this._sw+this._sw/2,this._rect.y+a*this._sh+this._sh/2]},pointToData:function(e){var t=this.pointToDate(e);return t&&t.time},dataToRect:function(e,t){var i=this.dataToPoint(e,t);return{contentShape:{x:i[0]-(this._sw-this._lineWidth)/2,y:i[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:i,tl:[i[0]-this._sw/2,i[1]-this._sh/2],tr:[i[0]+this._sw/2,i[1]-this._sh/2],br:[i[0]+this._sw/2,i[1]+this._sh/2],bl:[i[0]-this._sw/2,i[1]+this._sh/2]}},pointToDate:function(e){var t=Math.floor((e[0]-this._rect.x)/this._sw)+1,i=Math.floor((e[1]-this._rect.y)/this._sh)+1,n=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(i,t-1,n):this._getDateByWeeksAndDay(t,i-1,n)},convertToPixel:MK.curry(LK,"dataToPoint"),convertFromPixel:MK.curry(LK,"pointToData"),_initRangeOption:function(){var e=this._model.get("range"),t=e;if(MK.isArray(t)&&1===t.length&&(t=t[0]),/^\d{4}$/.test(t)&&(e=[t+"-01-01",t+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(t)){var i=this.getDateInfo(t),n=i.date;n.setMonth(n.getMonth()+1);var r=this.getNextNDay(n,-1);e=[i.formatedDate,r.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(t)&&(e=[t,t]);var a=this._getRangeInfo(e);return a.start.time>a.end.time&&e.reverse(),e},_getRangeInfo:function(e){var t;(e=[this.getDateInfo(e[0]),this.getDateInfo(e[1])])[0].time>e[1].time&&(t=!0,e.reverse());var i=Math.floor(e[1].time/DK)-Math.floor(e[0].time/DK)+1,n=new Date(e[0].time),r=n.getDate(),a=e[1].date.getDate();n.setDate(r+i-1);var o=n.getDate();if(o!==a)for(var s=n.getTime()-e[1].time>0?1:-1;(o=n.getDate())!==a&&(n.getTime()-e[1].time)*s>0;)i-=s,n.setDate(o-s);var l=Math.floor((i+e[0].day+6)/7),u=t?1-l:l-1;return t&&e.reverse(),{range:[e[0].formatedDate,e[1].formatedDate],start:e[0],end:e[1],allDay:i,weeks:l,nthWeek:u,fweek:e[0].day,lweek:e[1].day}},_getDateByWeeksAndDay:function(e,t,i){var n=this._getRangeInfo(i);if(e>n.weeks||0===e&&t<n.fweek||e===n.weeks&&t>n.lweek)return!1;var r=7*(e-1)-n.fweek+t,a=new Date(n.start.time);return a.setDate(n.start.d+r),this.getDateInfo(a)}},EK.dimensions=EK.prototype.dimensions,EK.getDimensionsInfo=EK.prototype.getDimensionsInfo,EK.create=function(e,t){var i=[];return e.eachComponent("calendar",(function(n){var r=new EK(n,e,t);i.push(r),n.coordinateSystem=r})),e.eachSeries((function(e){"calendar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("calendarIndex")||0])})),i},CK.register("calendar",EK);var PK=g,NK=Ld,RK=Hc,OK=RK.getLayoutParams,kK=RK.sizeCalculable,zK=RK.mergeLayoutParam,BK=NK.extend({type:"calendar",coordinateSystem:null,defaultOption:{zlevel:0,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%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},init:function(e,t,i,n){var r=OK(e);BK.superApply(this,"init",arguments),FK(e,r)},mergeOption:function(e,t){BK.superApply(this,"mergeOption",arguments),FK(this.option,e)}});function FK(e,t){var i=e.cellSize;PK.isArray(i)?1===i.length&&(i[1]=i[0]):i=e.cellSize=[i,i];var n=PK.map([0,1],(function(e){return kK(t,e)&&(i[e]="auto"),null!=i[e]&&"auto"!==i[e]}));zK(e,t,{type:"box",ignoreSize:n})}var VK=g,GK=No,HK=qc,UK=Uc,WK={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},jK={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]};h.extendComponentView({type:"calendar",_tlpoints:null,_blpoints:null,_firstDayOfMonth:null,_firstDayPoints:null,render:function(e,t,i){var n=this.group;n.removeAll();var r=e.coordinateSystem,a=r.getRangeInfo(),o=r.getOrient();this._renderDayRect(e,a,n),this._renderLines(e,a,o,n),this._renderYearText(e,a,o,n),this._renderMonthText(e,o,n),this._renderWeekText(e,a,o,n)},_renderDayRect:function(e,t,i){for(var n=e.coordinateSystem,r=e.getModel("itemStyle").getItemStyle(),a=n.getCellWidth(),o=n.getCellHeight(),s=t.start.time;s<=t.end.time;s=n.getNextNDay(s,1).time){var l=n.dataToRect([s],!1).tl,u=new GK.Rect({shape:{x:l[0],y:l[1],width:a,height:o},cursor:"default",style:r});i.add(u)}},_renderLines:function(e,t,i,n){var r=this,a=e.coordinateSystem,o=e.getModel("splitLine.lineStyle").getLineStyle(),s=e.get("splitLine.show"),l=o.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=t.start,h=0;u.time<=t.end.time;h++){d(u.formatedDate),0===h&&(u=a.getDateInfo(t.start.y+"-"+t.start.m));var c=u.date;c.setMonth(c.getMonth()+1),u=a.getDateInfo(c)}function d(t){r._firstDayOfMonth.push(a.getDateInfo(t)),r._firstDayPoints.push(a.dataToRect([t],!1).tl);var l=r._getLinePointsOfOneWeek(e,t,i);r._tlpoints.push(l[0]),r._blpoints.push(l[l.length-1]),s&&r._drawSplitline(l,o,n)}d(a.getNextNDay(t.end.time,1).formatedDate),s&&this._drawSplitline(r._getEdgesPoints(r._tlpoints,l,i),o,n),s&&this._drawSplitline(r._getEdgesPoints(r._blpoints,l,i),o,n)},_getEdgesPoints:function(e,t,i){var n=[e[0].slice(),e[e.length-1].slice()],r="horizontal"===i?0:1;return n[0][r]=n[0][r]-t/2,n[1][r]=n[1][r]+t/2,n},_drawSplitline:function(e,t,i){var n=new GK.Polyline({z2:20,shape:{points:e},style:t});i.add(n)},_getLinePointsOfOneWeek:function(e,t,i){var n=e.coordinateSystem;t=n.getDateInfo(t);for(var r=[],a=0;a<7;a++){var o=n.getNextNDay(t.time,a),s=n.dataToRect([o.time],!1);r[2*o.day]=s.tl,r[2*o.day+1]=s["horizontal"===i?"bl":"tr"]}return r},_formatterLabel:function(e,t){return"string"==typeof e&&e?HK.formatTplSimple(e,t):"function"==typeof e?e(t):t.nameMap},_yearTextPositionControl:function(e,t,i,n,r){t=t.slice();var a=["center","bottom"];"bottom"===n?(t[1]+=r,a=["center","top"]):"left"===n?t[0]-=r:"right"===n?(t[0]+=r,a=["center","top"]):t[1]-=r;var o=0;return"left"!==n&&"right"!==n||(o=Math.PI/2),{rotation:o,position:t,style:{textAlign:a[0],textVerticalAlign:a[1]}}},_renderYearText:function(e,t,i,n){var r=e.getModel("yearLabel");if(r.get("show")){var a=r.get("margin"),o=r.get("position");o||(o="horizontal"!==i?"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,h="horizontal"===i?0:1,c={top:[l,s[h][1]],bottom:[l,s[1-h][1]],left:[s[1-h][0],u],right:[s[h][0],u]},d=t.start.y;+t.end.y>+t.start.y&&(d=d+"-"+t.end.y);var f=r.get("formatter"),p={start:t.start.y,end:t.end.y,nameMap:d},g=this._formatterLabel(f,p),m=new GK.Text({z2:30});GK.setTextStyle(m.style,r,{text:g}),m.attr(this._yearTextPositionControl(m,c[o],i,o,a)),n.add(m)}},_monthTextPositionControl:function(e,t,i,n,r){var a="left",o="top",s=e[0],l=e[1];return"horizontal"===i?(l+=r,t&&(a="center"),"start"===n&&(o="bottom")):(s+=r,t&&(o="middle"),"start"===n&&(a="right")),{x:s,y:l,textAlign:a,textVerticalAlign:o}},_renderMonthText:function(e,t,i){var n=e.getModel("monthLabel");if(n.get("show")){var r=n.get("nameMap"),a=n.get("margin"),o=n.get("position"),s=n.get("align"),l=[this._tlpoints,this._blpoints];VK.isString(r)&&(r=WK[r.toUpperCase()]||[]);var u="start"===o?0:1,h="horizontal"===t?0:1;a="start"===o?-a:a;for(var c="center"===s,d=0;d<l[u].length-1;d++){var f=l[u][d].slice(),p=this._firstDayOfMonth[d];if(c){var g=this._firstDayPoints[d];f[h]=(g[h]+l[0][d+1][h])/2}var m=n.get("formatter"),v=r[+p.m-1],y={yyyy:p.y,yy:(p.y+"").slice(2),MM:p.m,M:+p.m,nameMap:v},_=this._formatterLabel(m,y),x=new GK.Text({z2:30});VK.extend(GK.setTextStyle(x.style,n,{text:_}),this._monthTextPositionControl(f,c,t,o,a)),i.add(x)}}},_weekTextPositionControl:function(e,t,i,n,r){var a="center",o="middle",s=e[0],l=e[1],u="start"===i;return"horizontal"===t?(s=s+n+(u?1:-1)*r[0]/2,a=u?"right":"left"):(l=l+n+(u?1:-1)*r[1]/2,o=u?"bottom":"top"),{x:s,y:l,textAlign:a,textVerticalAlign:o}},_renderWeekText:function(e,t,i,n){var r=e.getModel("dayLabel");if(r.get("show")){var a=e.coordinateSystem,o=r.get("position"),s=r.get("nameMap"),l=r.get("margin"),u=a.getFirstDayOfWeek();VK.isString(s)&&(s=jK[s.toUpperCase()]||[]);var h=a.getNextNDay(t.end.time,7-t.lweek).time,c=[a.getCellWidth(),a.getCellHeight()];l=UK.parsePercent(l,c["horizontal"===i?0:1]),"start"===o&&(h=a.getNextNDay(t.start.time,-(7+t.fweek)).time,l=-l);for(var d=0;d<7;d++){var f,p=a.getNextNDay(h,d),g=a.dataToRect([p.time],!1).center;f=Math.abs((d+u)%7);var m=new GK.Text({z2:30});VK.extend(GK.setTextStyle(m.style,r,{text:s[f]}),this._weekTextPositionControl(g,i,o,l,c)),n.add(m)}}}});var XK=h,ZK=g,qK=lo,YK=No,KK=Hc,QK=Uc.parsePercent,JK={path:null,compoundPath:null,group:YK.Group,image:YK.Image,text:YK.Text};XK.registerPreprocessor((function(e){var t=e.graphic;ZK.isArray(t)?t[0]&&t[0].elements?e.graphic=[e.graphic[0]]:e.graphic=[{elements:t}]:t&&!t.elements&&(e.graphic=[{elements:[t]}])}));var $K=XK.extendComponentModel({type:"graphic",defaultOption:{elements:[],parentId:null},_elOptionsToUpdate:null,mergeOption:function(e){var t=this.option.elements;this.option.elements=null,$K.superApply(this,"mergeOption",arguments),this.option.elements=t},optionUpdated:function(e,t){var i=this.option,n=(t?i:e).elements,r=i.elements=t?[]:i.elements,a=[];this._flatten(n,a);var o=qK.mappingToExists(r,a);qK.makeIdAndName(o);var s=this._elOptionsToUpdate=[];ZK.each(o,(function(e,t){var i=e.option;i&&(s.push(i),function(e,t){var i=e.exist;if(t.id=e.keyInfo.id,!t.type&&i&&(t.type=i.type),null==t.parentId){var n=t.parentOption;n?t.parentId=n.id:i&&(t.parentId=i.parentId)}t.parentOption=null}(e,i),function(e,t,i){var n=ZK.extend({},i),r=e[t],a=i.$action||"merge";"merge"===a?r?(ZK.merge(r,n,!0),KK.mergeLayoutParam(r,n,{ignoreSize:!0}),KK.copyLayoutParams(i,r)):e[t]=n:"replace"===a?e[t]=n:"remove"===a&&r&&(e[t]=null)}(r,t,i),function(e,t){e&&(e.hv=t.hv=[iQ(t,["left","right"]),iQ(t,["top","bottom"])],"group"===e.type&&(null==e.width&&(e.width=t.width=0),null==e.height&&(e.height=t.height=0)))}(r[t],i))}),this);for(var l=r.length-1;l>=0;l--)null==r[l]?r.splice(l,1):delete r[l].$action},_flatten:function(e,t,i){ZK.each(e,(function(e){if(e){i&&(e.parentOption=i),t.push(e);var n=e.children;"group"===e.type&&n&&this._flatten(n,t,e),delete e.children}}),this)},useElOptionsToUpdate:function(){var e=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,e}});function eQ(e,t,i,n){var r=i.type,a=new(JK.hasOwnProperty(r)?JK[r]:YK.getShapeClass(r))(i);t.add(a),n.set(e,a),a.__ecGraphicId=e}function tQ(e,t){var i=e&&e.parent;i&&("group"===e.type&&e.traverse((function(e){tQ(e,t)})),t.removeKey(e.__ecGraphicId),i.remove(e))}function iQ(e,t){var i;return ZK.each(t,(function(t){null!=e[t]&&"auto"!==e[t]&&(i=!0)})),i}XK.extendComponentView({type:"graphic",init:function(e,t){this._elMap=ZK.createHashMap(),this._lastGraphicModel},render:function(e,t,i){e!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=e,this._updateElements(e),this._relocate(e,i)},_updateElements:function(e){var t=e.useElOptionsToUpdate();if(t){var i=this._elMap,n=this.group;ZK.each(t,(function(t){var r=t.$action,a=t.id,o=i.get(a),s=t.parentId,l=null!=s?i.get(s):n,u=t.style;"text"===t.type&&u&&(t.hv&&t.hv[1]&&(u.textVerticalAlign=u.textBaseline=null),!u.hasOwnProperty("textFill")&&u.fill&&(u.textFill=u.fill),!u.hasOwnProperty("textStroke")&&u.stroke&&(u.textStroke=u.stroke));var h=function(e){return e=ZK.extend({},e),ZK.each(["id","parentId","$action","hv","bounding"].concat(KK.LOCATION_PARAMS),(function(t){delete e[t]})),e}(t);r&&"merge"!==r?"replace"===r?(tQ(o,i),eQ(a,l,h,i)):"remove"===r&&tQ(o,i):o?o.attr(h):eQ(a,l,h,i);var c=i.get(a);c&&(c.__ecGraphicWidthOption=t.width,c.__ecGraphicHeightOption=t.height,function(e,t,i){var n=e.eventData;e.silent||e.ignore||n||(n=e.eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name}),n&&(n.info=e.info)}(c,e))}))}},_relocate:function(e,t){for(var i=e.option.elements,n=this.group,r=this._elMap,a=t.getWidth(),o=t.getHeight(),s=0;s<i.length;s++){var l=i[s];if((h=r.get(l.id))&&h.isGroup){var u=(c=h.parent)===n;h.__ecGraphicWidth=QK(h.__ecGraphicWidthOption,u?a:c.__ecGraphicWidth)||0,h.__ecGraphicHeight=QK(h.__ecGraphicHeightOption,u?o:c.__ecGraphicHeight)||0}}for(s=i.length-1;s>=0;s--){var h;if(l=i[s],h=r.get(l.id)){var c,d=(c=h.parent)===n?{width:a,height:o}:{width:c.__ecGraphicWidth,height:c.__ecGraphicHeight};KK.positionElement(h,l,d,null,{hv:l.hv,boundingMode:l.bounding})}}},_clear:function(){var e=this._elMap;e.each((function(t){tQ(t,e)})),this._elMap=ZK.createHashMap()},dispose:function(){this._clear()}});var nQ={},rQ={};nQ.register=function(e,t){rQ[e]=t},nQ.get=function(e){return rQ[e]};var aQ=g,oQ=nQ,sQ=h.extendComponentModel({type:"toolbox",layoutMode:{type:"box",ignoreSize:!0},optionUpdated:function(){sQ.superApply(this,"optionUpdated",arguments),aQ.each(this.option.feature,(function(e,t){var i=oQ.get(t);i&&aQ.merge(e,i.defaultOption)}))},defaultOption:{show:!0,z:6,zlevel:0,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}}}),lQ={},uQ=Hc,hQ=uQ.getLayoutRect,cQ=uQ.box,dQ=uQ.positionElement,fQ=qc,pQ=No;lQ.layout=function(e,t,i){var n=t.getBoxLayoutParams(),r=t.get("padding"),a={width:i.getWidth(),height:i.getHeight()},o=hQ(n,a,r);cQ(t.get("orient"),e,t.get("itemGap"),o.width,o.height),dQ(e,n,a,r)},lQ.makeBackground=function(e,t){var i=fQ.normalizeCssArray(t.get("padding")),n=t.getItemStyle(["color","opacity"]);return n.fill=t.get("backgroundColor"),e=new pQ.Rect({shape:{x:e.x-i[3],y:e.y-i[0],width:e.width+i[1]+i[3],height:e.height+i[0]+i[2],r:t.get("borderRadius")},style:n,silent:!0,z2:-1})};var gQ=g,mQ=Tn,vQ=nQ,yQ=No,_Q=zc,xQ=Vy,bQ=lQ;h.extendComponentView({type:"toolbox",render:function(e,t,i,n){var r=this.group;if(r.removeAll(),e.get("show")){var a=+e.get("itemSize"),o=e.get("feature")||{},s=this._features||(this._features={}),l=[];gQ.each(o,(function(e,t){l.push(t)})),new xQ(this._featureNames||[],l).add(u).update(u).remove(gQ.curry(u,null)).execute(),this._featureNames=l,bQ.layout(r,e,i),r.add(bQ.makeBackground(r.getBoundingRect(),e)),r.eachChild((function(e){var t=e.__title,n=e.hoverStyle;if(n&&t){var o=mQ.getBoundingRect(t,mQ.makeFont(n)),s=e.position[0]+r.position[0],l=!1;e.position[1]+r.position[1]+a+o.height>i.getHeight()&&(n.textPosition="top",l=!0);var u=l?-5-o.height:a+8;s+o.width/2>i.getWidth()?(n.textPosition=["100%",u],n.textAlign="right"):s-o.width/2<0&&(n.textPosition=[0,u],n.textAlign="left")}}))}function u(u,h){var c,d=l[u],f=l[h],p=o[d],g=new _Q(p,e,e.ecModel);if(n&&null!=n.newTitle&&n.featureName===d&&(p.title=n.newTitle),d&&!f){if(function(e){return 0===e.indexOf("my")}(d))c={model:g,onclick:g.option.onclick,featureName:d};else{var m=vQ.get(d);if(!m)return;c=new m(g,t,i)}s[d]=c}else{if(!(c=s[f]))return;c.model=g,c.ecModel=t,c.api=i}d||!f?g.get("show")&&!c.unusable?(function(n,o,s){var l=n.getModel("iconStyle"),u=n.getModel("emphasis.iconStyle"),h=o.getIcons?o.getIcons():n.get("icon"),c=n.get("title")||{};if("string"==typeof h){var d=h,f=c;c={},(h={})[s]=d,c[s]=f}var p=n.iconPaths={};gQ.each(h,(function(s,h){var d=yQ.createIcon(s,{},{x:-a/2,y:-a/2,width:a,height:a});d.setStyle(l.getItemStyle()),d.hoverStyle=u.getItemStyle(),d.setStyle({text:c[h],textAlign:u.get("textAlign"),textBorderRadius:u.get("textBorderRadius"),textPadding:u.get("textPadding"),textFill:null});var f=e.getModel("tooltip");f&&f.get("show")&&d.attr("tooltip",gQ.extend({content:c[h],formatter:f.get("formatter",!0)||function(){return c[h]},formatterParams:{componentType:"toolbox",name:h,title:c[h],$vars:["name","title"]},position:f.get("position",!0)||"bottom"},f.option)),yQ.setHoverStyle(d),e.get("showTitle")&&(d.__title=c[h],d.on("mouseover",(function(){var t=u.getItemStyle(),i="vertical"===e.get("orient")?null==e.get("right")?"right":"left":null==e.get("bottom")?"bottom":"top";d.setStyle({textFill:u.get("textFill")||t.fill||t.stroke||"#000",textBackgroundColor:u.get("textBackgroundColor"),textPosition:u.get("textPosition")||i})})).on("mouseout",(function(){d.setStyle({textFill:null,textBackgroundColor:null})}))),d.trigger(n.get("iconStatus."+h)||"normal"),r.add(d),d.on("click",gQ.bind(o.onclick,o,t,i,h)),p[h]=d}))}(g,c,d),g.setIconStatus=function(e,t){var i=this.option,n=this.iconPaths;i.iconStatus=i.iconStatus||{},i.iconStatus[e]=t,n[e]&&n[e].trigger(t)},c.render&&c.render(g,t,i,n)):c.remove&&c.remove(t,i):c.dispose&&c.dispose(t,i)}},updateView:function(e,t,i,n){gQ.each(this._features,(function(e){e.updateView&&e.updateView(e.model,t,i,n)}))},remove:function(e,t){gQ.each(this._features,(function(i){i.remove&&i.remove(e,t)})),this.group.removeAll()},dispose:function(e,t){gQ.each(this._features,(function(i){i.dispose&&i.dispose(e,t)}))}});var wQ=p,TQ=nQ,SQ=jm.toolbox.saveAsImage;function MQ(e){this.model=e}MQ.defaultOption={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:SQ.title,type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:SQ.lang.slice()},MQ.prototype.unusable=!wQ.canvasSupported,MQ.prototype.onclick=function(e,t){var i=this.model,n=i.get("name")||e.get("title.0.text")||"echarts",r="svg"===t.getZr().painter.getType()?"svg":i.get("type",!0)||"png",a=t.getConnectedDataURL({type:r,backgroundColor:i.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")});if("function"!=typeof MouseEvent||wQ.browser.ie||wQ.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var o=atob(a.split(",")[1]),s=o.length,l=new Uint8Array(s);s--;)l[s]=o.charCodeAt(s);var u=new Blob([l]);window.navigator.msSaveOrOpenBlob(u,n+"."+r)}else{var h=i.get("lang"),c='<body style="margin:0;"><img src="'+a+'" style="max-width:100%;" title="'+(h&&h[0]||"")+'" /></body>';window.open().document.write(c)}else{var d=document.createElement("a");d.download=n+"."+r,d.target="_blank",d.href=a;var f=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});d.dispatchEvent(f)}},TQ.register("saveAsImage",MQ);var AQ=h,IQ=g,CQ=nQ,DQ=jm.toolbox.magicType,EQ="__ec_magicType_stack__";function LQ(e){this.model=e}LQ.defaultOption={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:IQ.clone(DQ.title),option:{},seriesIndex:{}};var PQ=LQ.prototype;PQ.getIcons=function(){var e=this.model,t=e.get("icon"),i={};return IQ.each(e.get("type"),(function(e){t[e]&&(i[e]=t[e])})),i};var NQ={line:function(e,t,i,n){if("bar"===e)return IQ.merge({id:t,type:"line",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.line")||{},!0)},bar:function(e,t,i,n){if("line"===e)return IQ.merge({id:t,type:"bar",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.bar")||{},!0)},stack:function(e,t,i,n){var r=i.get("stack")===EQ;if("line"===e||"bar"===e)return n.setIconStatus("stack",r?"normal":"emphasis"),IQ.merge({id:t,stack:r?"":EQ},n.get("option.stack")||{},!0)}},RQ=[["line","bar"],["stack"]];PQ.onclick=function(e,t,i){var n=this.model,r=n.get("seriesIndex."+i);if(NQ[i]){var a,o={series:[]};IQ.each(RQ,(function(e){IQ.indexOf(e,i)>=0&&IQ.each(e,(function(e){n.setIconStatus(e,"normal")}))})),n.setIconStatus(i,"emphasis"),e.eachComponent({mainType:"series",query:null==r?null:{seriesIndex:r}},(function(t){var r=t.subType,a=t.id,s=NQ[i](r,a,t,n);s&&(IQ.defaults(s,t.option),o.series.push(s));var l=t.coordinateSystem;if(l&&"cartesian2d"===l.type&&("line"===i||"bar"===i)){var u=l.getAxesByScale("ordinal")[0];if(u){var h=u.dim+"Axis",c=e.queryComponents({mainType:h,index:t.get(name+"Index"),id:t.get(name+"Id")})[0].componentIndex;o[h]=o[h]||[];for(var d=0;d<=c;d++)o[h][c]=o[h][c]||{};o[h][c].boundaryGap="bar"===i}}})),"stack"===i&&(a=o.series&&o.series[0]&&o.series[0].stack===EQ?IQ.merge({stack:DQ.title.tiled},DQ.title):IQ.clone(DQ.title)),t.dispatchAction({type:"changeMagicType",currentType:i,newOption:o,newTitle:a,featureName:"magicType"})}},AQ.registerAction({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(e,t){t.mergeOption(e.newOption)})),CQ.register("magicType",LQ);var OQ=h,kQ=g,zQ=ne,BQ=nQ,FQ=jm.toolbox.dataView,VQ=new Array(60).join("-"),GQ="\t";function HQ(e){return kQ.map(e,(function(e){var t=e.getRawData(),i=[e.name],n=[];return t.each(t.dimensions,(function(){for(var e=arguments.length,r=arguments[e-1],a=t.getName(r),o=0;o<e-1;o++)n[o]=arguments[o];i.push((a?a+GQ:"")+n.join(GQ))})),i.join("\n")})).join("\n\n"+VQ+"\n\n")}function UQ(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var WQ=new RegExp("[\t]+","g");function jQ(e,t){var i=e.split(new RegExp("\n*"+VQ+"\n*","g")),n={series:[]};return kQ.each(i,(function(e,i){if(function(e){if(e.slice(0,e.indexOf("\n")).indexOf(GQ)>=0)return!0}(e)){var r=function(e){for(var t=e.split(/\n+/g),i=UQ(t.shift()).split(WQ),n=[],r=kQ.map(i,(function(e){return{name:e,data:[]}})),a=0;a<t.length;a++){var o=UQ(t[a]).split(WQ);n.push(o.shift());for(var s=0;s<o.length;s++)r[s]&&(r[s].data[a]=o[s])}return{series:r,categories:n}}(e),a=t[i],o=a.axisDim+"Axis";a&&(n[o]=n[o]||[],n[o][a.axisIndex]={data:r.categories},n.series=n.series.concat(r.series))}else r=function(e){for(var t=e.split(/\n+/g),i=UQ(t.shift()),n=[],r=0;r<t.length;r++){var a=UQ(t[r]);if(a){var o,s=a.split(WQ),l="",u=!1;isNaN(s[0])?(u=!0,l=s[0],s=s.slice(1),n[r]={name:l,value:[]},o=n[r].value):o=n[r]=[];for(var h=0;h<s.length;h++)o.push(+s[h]);1===o.length&&(u?n[r].value=o[0]:n[r]=o[0])}}return{name:i,data:n}}(e),n.series.push(r)})),n}function XQ(e){this._dom=null,this.model=e}function ZQ(e,t){return kQ.map(e,(function(e,i){var n=t&&t[i];if(kQ.isObject(n)&&!kQ.isArray(n)){kQ.isObject(e)&&!kQ.isArray(e)||(e={value:e});var r=null!=n.name&&null==e.name;return e=kQ.defaults(e,n),r&&delete e.name,e}return e}))}XQ.defaultOption={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:kQ.clone(FQ.title),lang:kQ.clone(FQ.lang),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"},XQ.prototype.onclick=function(e,t){var i=t.getDom(),n=this.model;this._dom&&i.removeChild(this._dom);var r=document.createElement("div");r.style.cssText="position:absolute;left:5px;top:5px;bottom:5px;right:5px;",r.style.backgroundColor=n.get("backgroundColor")||"#fff";var a=document.createElement("h4"),o=n.get("lang")||[];a.innerHTML=o[0]||n.get("title"),a.style.cssText="margin: 10px 20px;",a.style.color=n.get("textColor");var s=document.createElement("div"),l=document.createElement("textarea");s.style.cssText="display:block;width:100%;overflow:auto;";var u=n.get("optionToContent"),h=n.get("contentToOption"),c=function(e){var t,i,n=function(e){var t={},i=[],n=[];return e.eachRawSeries((function(e){var r=e.coordinateSystem;if(!r||"cartesian2d"!==r.type&&"polar"!==r.type)i.push(e);else{var a=r.getBaseAxis();if("category"===a.type){var o=a.dim+"_"+a.index;t[o]||(t[o]={categoryAxis:a,valueAxis:r.getOtherAxis(a),series:[]},n.push({axisDim:a.dim,axisIndex:a.index})),t[o].series.push(e)}else i.push(e)}})),{seriesGroupByCategoryAxis:t,other:i,meta:n}}(e);return{value:kQ.filter([(t=n.seriesGroupByCategoryAxis,i=[],kQ.each(t,(function(e,t){var n=e.categoryAxis,r=e.valueAxis.dim,a=[" "].concat(kQ.map(e.series,(function(e){return e.name}))),o=[n.model.getCategories()];kQ.each(e.series,(function(e){var t=e.getRawData();o.push(e.getRawData().mapArray(t.mapDimension(r),(function(e){return e})))}));for(var s=[a.join(GQ)],l=0;l<o[0].length;l++){for(var u=[],h=0;h<o.length;h++)u.push(o[h][l]);s.push(u.join(GQ))}i.push(s.join("\n"))})),i.join("\n\n"+VQ+"\n\n")),HQ(n.other)],(function(e){return e.replace(/[\n\t\s]/g,"")})).join("\n\n"+VQ+"\n\n"),meta:n.meta}}(e);if("function"==typeof u){var d=u(t.getOption());"string"==typeof d?s.innerHTML=d:kQ.isDom(d)&&s.appendChild(d)}else s.appendChild(l),l.readOnly=n.get("readOnly"),l.style.cssText="width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;",l.style.color=n.get("textColor"),l.style.borderColor=n.get("textareaBorderColor"),l.style.backgroundColor=n.get("textareaColor"),l.value=c.value;var f=c.meta,p=document.createElement("div");p.style.cssText="position:absolute;bottom:0;left:0;right:0;";var g="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",m=document.createElement("div"),v=document.createElement("div");g+=";background-color:"+n.get("buttonColor"),g+=";color:"+n.get("buttonTextColor");var y=this;function _(){i.removeChild(r),y._dom=null}zQ.addEventListener(m,"click",_),zQ.addEventListener(v,"click",(function(){var e;try{e="function"==typeof h?h(s,t.getOption()):jQ(l.value,f)}catch(i){throw _(),new Error("Data view format error "+i)}e&&t.dispatchAction({type:"changeDataView",newOption:e}),_()})),m.innerHTML=o[1],v.innerHTML=o[2],v.style.cssText=g,m.style.cssText=g,!n.get("readOnly")&&p.appendChild(v),p.appendChild(m),r.appendChild(a),r.appendChild(s),r.appendChild(p),s.style.height=i.clientHeight-80+"px",i.appendChild(r),this._dom=r},XQ.prototype.remove=function(e,t){this._dom&&t.getDom().removeChild(this._dom)},XQ.prototype.dispose=function(e,t){this.remove(e,t)},BQ.register("dataView",XQ),OQ.registerAction({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},(function(e,t){var i=[];kQ.each(e.newOption.series,(function(e){var n=t.getSeriesByName(e.name)[0];if(n){var r=n.get("data");i.push({name:e.name,data:ZQ(e.data,r)})}else i.push(kQ.extend({type:"scatter"},e))})),t.mergeOption(kQ.defaults({series:i},e.newOption))}));var qQ=g,YQ=No,KQ=lo,QQ=XV,JQ=qQ.each,$Q=qQ.indexOf,eJ=qQ.curry,tJ=["dataToPoint","pointToData"],iJ=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"];function nJ(e,t,i){var n=this._targetInfoList=[],r={},a=oJ(t,e);JQ(sJ,(function(e,t){(!i||!i.include||$Q(i.include,t)>=0)&&e(a,n,r)}))}var rJ=nJ.prototype;function aJ(e){return e[0]>e[1]&&e.reverse(),e}function oJ(e,t){return KQ.parseFinder(e,t,{includeMainTypes:iJ})}rJ.setOutputRanges=function(e,t){this.matchOutputRanges(e,t,(function(e,t,i){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var n=hJ[e.brushType](0,i,t);e.__rangeOffset={offset:dJ[e.brushType](n.values,e.range,[1,1]),xyMinMax:n.xyMinMax}}}))},rJ.matchOutputRanges=function(e,t,i){JQ(e,(function(e){var n=this.findTargetInfo(e,t);n&&!0!==n&&qQ.each(n.coordSyses,(function(n){var r=hJ[e.brushType](1,n,e.range);i(e,r.values,n,t)}))}),this)},rJ.setInputRanges=function(e,t){JQ(e,(function(e){var i,n,r,a,o,s=this.findTargetInfo(e,t);if(e.range=e.range||[],s&&!0!==s){e.panelId=s.panelId;var l=hJ[e.brushType](0,s.coordSys,e.coordRange),u=e.__rangeOffset;e.range=u?dJ[e.brushType](l.values,u.offset,(i=l.xyMinMax,n=u.xyMinMax,r=pJ(i),a=pJ(n),o=[r[0]/a[0],r[1]/a[1]],isNaN(o[0])&&(o[0]=1),isNaN(o[1])&&(o[1]=1),o)):l.values}}),this)},rJ.makePanelOpts=function(e,t){return qQ.map(this._targetInfoList,(function(i){var n=i.getPanelRect();return{panelId:i.panelId,defaultBrushType:t&&t(i),clipPath:QQ.makeRectPanelClipPath(n),isTargetByCursor:QQ.makeRectIsTargetByCursor(n,e,i.coordSysModel),getLinearBrushOtherExtent:QQ.makeLinearBrushOtherExtent(n)}}))},rJ.controlSeries=function(e,t,i){var n=this.findTargetInfo(e,i);return!0===n||n&&$Q(n.coordSyses,t.coordinateSystem)>=0},rJ.findTargetInfo=function(e,t){for(var i=this._targetInfoList,n=oJ(t,e),r=0;r<i.length;r++){var a=i[r],o=e.panelId;if(o){if(a.panelId===o)return a}else for(r=0;r<lJ.length;r++)if(lJ[r](n,a))return a}return!0};var sJ={grid:function(e,t){var i=e.xAxisModels,n=e.yAxisModels,r=e.gridModels,a=qQ.createHashMap(),o={},s={};(i||n||r)&&(JQ(i,(function(e){var t=e.axis.grid.model;a.set(t.id,t),o[t.id]=!0})),JQ(n,(function(e){var t=e.axis.grid.model;a.set(t.id,t),s[t.id]=!0})),JQ(r,(function(e){a.set(e.id,e),o[e.id]=!0,s[e.id]=!0})),a.each((function(e){var r=e.coordinateSystem,a=[];JQ(r.getCartesians(),(function(e,t){($Q(i,e.getAxis("x").model)>=0||$Q(n,e.getAxis("y").model)>=0)&&a.push(e)})),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:a[0],coordSyses:a,getPanelRect:uJ.grid,xAxisDeclared:o[e.id],yAxisDeclared:s[e.id]})})))},geo:function(e,t){JQ(e.geoModels,(function(e){var i=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:i,coordSyses:[i],getPanelRect:uJ.geo})}))}},lJ=[function(e,t){var i=e.xAxisModel,n=e.yAxisModel,r=e.gridModel;return!r&&i&&(r=i.axis.grid.model),!r&&n&&(r=n.axis.grid.model),r&&r===t.gridModel},function(e,t){var i=e.geoModel;return i&&i===t.geoModel}],uJ={grid:function(){return this.coordSys.grid.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(YQ.getTransform(e)),t}},hJ={lineX:eJ(cJ,0),lineY:eJ(cJ,1),rect:function(e,t,i){var n=t[tJ[e]]([i[0][0],i[1][0]]),r=t[tJ[e]]([i[0][1],i[1][1]]),a=[aJ([n[0],r[0]]),aJ([n[1],r[1]])];return{values:a,xyMinMax:a}},polygon:function(e,t,i){var n=[[1/0,-1/0],[1/0,-1/0]];return{values:qQ.map(i,(function(i){var r=t[tJ[e]](i);return n[0][0]=Math.min(n[0][0],r[0]),n[1][0]=Math.min(n[1][0],r[1]),n[0][1]=Math.max(n[0][1],r[0]),n[1][1]=Math.max(n[1][1],r[1]),r})),xyMinMax:n}}};function cJ(e,t,i,n){var r=i.getAxis(["x","y"][e]),a=aJ(qQ.map([0,1],(function(e){return t?r.coordToData(r.toLocalCoord(n[e])):r.toGlobalCoord(r.dataToCoord(n[e]))}))),o=[];return o[e]=a,o[1-e]=[NaN,NaN],{values:a,xyMinMax:o}}var dJ={lineX:eJ(fJ,0),lineY:eJ(fJ,1),rect:function(e,t,i){return[[e[0][0]-i[0]*t[0][0],e[0][1]-i[0]*t[0][1]],[e[1][0]-i[1]*t[1][0],e[1][1]-i[1]*t[1][1]]]},polygon:function(e,t,i){return qQ.map(e,(function(e,n){return[e[0]-i[0]*t[n][0],e[1]-i[1]*t[n][1]]}))}};function fJ(e,t,i,n){return[t[0]-n[e]*i[0],t[1]-n[e]*i[1]]}function pJ(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var gJ=nJ,mJ={},vJ=g.each,yJ="\0_ec_hist_store";function _J(e){var t=e[yJ];return t||(t=e[yJ]=[{}]),t}mJ.push=function(e,t){var i=_J(e);vJ(t,(function(t,n){for(var r=i.length-1;r>=0&&!i[r][n];r--);if(r<0){var a=e.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(a){var o=a.getPercentRange();i[0][n]={dataZoomId:n,start:o[0],end:o[1]}}}})),i.push(t)},mJ.pop=function(e){var t=_J(e),i=t[t.length-1];t.length>1&&t.pop();var n={};return vJ(i,(function(e,i){for(var r=t.length-1;r>=0;r--)if(e=t[r][i]){n[i]=e;break}})),n},mJ.clear=function(e){e[yJ]=null},mJ.count=function(e){return _J(e).length},Ld.registerSubTypeDefaulter("dataZoom",(function(){return"slider"}));var xJ={},bJ=g,wJ=qc,TJ=["cartesian2d","polar","singleAxis"];function SJ(e,t){e=e.slice();var i=bJ.map(e,wJ.capitalFirst);t=(t||[]).slice();var n=bJ.map(t,wJ.capitalFirst);return function(r,a){bJ.each(e,(function(e,o){for(var s={name:e,capital:i[o]},l=0;l<t.length;l++)s[t[l]]=e+n[l];r.call(a,s)}))}}var MJ=SJ(["x","y","z","radius","angle","single"],["axisIndex","axis","index","id"]);xJ.isCoordSupported=function(e){return bJ.indexOf(TJ,e)>=0},xJ.createNameEach=SJ,xJ.eachAxisDim=MJ,xJ.createLinkedNodesFinder=function(e,t,i){return function(r){var a,o={nodes:[],records:{}};if(t((function(e){o.records[e.name]={}})),!r)return o;n(r,o);do{a=!1,e(s)}while(a);function s(e){!function(e,t){return bJ.indexOf(t.nodes,e)>=0}(e,o)&&function(e,n){var r=!1;return t((function(t){bJ.each(i(e,t)||[],(function(e){n.records[t.name][e]&&(r=!0)}))})),r}(e,o)&&(n(e,o),a=!0)}return o};function n(e,n){n.nodes.push(e),t((function(t){bJ.each(i(e,t)||[],(function(e){n.records[t.name][e]=!0}))}))}};var AJ=g,IJ=Uc,CJ=xJ,DJ=wF,EJ=AJ.each,LJ=IJ.asc,PJ=function(e,t,i,n){this._dimName=e,this._axisIndex=t,this._valueWindow,this._percentWindow,this._dataExtent,this._minMaxSpan,this.ecModel=n,this._dataZoomModel=i};function NJ(e,t){var i=e.getAxisModel(),n=e._percentWindow,r=e._valueWindow;if(n){var a=IJ.getPixelPrecision(r,[0,500]);a=Math.min(a,20);var o=t||0===n[0]&&100===n[1];i.setRange(o?null:+r[0].toFixed(a),o?null:+r[1].toFixed(a))}}PJ.prototype={constructor:PJ,hostedBy:function(e){return this._dataZoomModel===e},getDataValueWindow:function(){return this._valueWindow.slice()},getDataPercentWindow:function(){return this._percentWindow.slice()},getTargetSeriesModels:function(){var e=[],t=this.ecModel;return t.eachSeries((function(i){if(CJ.isCoordSupported(i.get("coordinateSystem"))){var n=this._dimName,r=t.queryComponents({mainType:n+"Axis",index:i.get(n+"AxisIndex"),id:i.get(n+"AxisId")})[0];this._axisIndex===(r&&r.componentIndex)&&e.push(i)}}),this),e},getAxisModel:function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},getOtherAxisModel:function(){var e,t,i,n=this._dimName,r=this.ecModel,a=this.getAxisModel();return"x"===n||"y"===n?(t="gridIndex",e="x"===n?"y":"x"):(t="polarIndex",e="angle"===n?"radius":"angle"),r.eachComponent(e+"Axis",(function(e){(e.get(t)||0)===(a.get(t)||0)&&(i=e)})),i},getMinMaxSpan:function(){return AJ.clone(this._minMaxSpan)},calculateDataWindow:function(e){var t,i=this._dataExtent,n=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),a=[0,100],o=[],s=[];EJ(["start","end"],(function(l,u){var h=e[l],c=e[l+"Value"];"percent"===r[u]?(null==h&&(h=a[u]),c=n.parse(IJ.linearMap(h,a,i))):(t=!0,c=null==c?i[u]:n.parse(c),h=IJ.linearMap(c,i,a)),s[u]=c,o[u]=h})),LJ(s),LJ(o);var l=this._minMaxSpan;function u(e,t,i,r,a){var o=a?"Span":"ValueSpan";DJ(0,e,i,"all",l["min"+o],l["max"+o]);for(var s=0;s<2;s++)t[s]=IJ.linearMap(e[s],i,r,!0),a&&(t[s]=n.parse(t[s]))}return t?u(s,o,i,a,!1):u(o,s,a,i,!0),{valueWindow:s,percentWindow:o}},reset:function(e){if(e===this._dataZoomModel){var t=this.getTargetSeriesModels();this._dataExtent=(n=this,r=this._dimName,a=[1/0,-1/0],EJ(t,(function(e){var t=e.getData();t&&EJ(t.mapDimension(r,!0),(function(e){var i=t.getApproximateExtent(e);i[0]<a[0]&&(a[0]=i[0]),i[1]>a[1]&&(a[1]=i[1])}))})),a[1]<a[0]&&(a=[NaN,NaN]),function(e,t){var i=e.getAxisModel(),n=i.getMin(!0),r="category"===i.get("type"),a=r&&i.getCategories().length;null!=n&&"dataMin"!==n&&"function"!=typeof n?t[0]=n:r&&(t[0]=a>0?0:NaN);var o=i.getMax(!0);null!=o&&"dataMax"!==o&&"function"!=typeof o?t[1]=o:r&&(t[1]=a>0?a-1:NaN),i.get("scale",!0)||(t[0]>0&&(t[0]=0),t[1]<0&&(t[1]=0))}(n,a),a),function(e){var t=e._minMaxSpan={},i=e._dataZoomModel,n=e._dataExtent;EJ(["min","max"],(function(r){var a=i.get(r+"Span"),o=i.get(r+"ValueSpan");null!=o&&(o=e.getAxisModel().axis.scale.parse(o)),null!=o?a=IJ.linearMap(n[0]+o,n,[0,100],!0):null!=a&&(o=IJ.linearMap(a,[0,100],n,!0)-n[0]),t[r+"Span"]=a,t[r+"ValueSpan"]=o}))}(this);var i=this.calculateDataWindow(e.settledOption);this._valueWindow=i.valueWindow,this._percentWindow=i.percentWindow,NJ(this)}var n,r,a},restore:function(e){e===this._dataZoomModel&&(this._valueWindow=this._percentWindow=null,NJ(this,!0))},filterData:function(e,t){if(e===this._dataZoomModel){var i=this._dimName,n=this.getTargetSeriesModels(),r=e.get("filterMode"),a=this._valueWindow;"none"!==r&&EJ(n,(function(e){var t=e.getData(),n=t.mapDimension(i,!0);n.length&&("weakFilter"===r?t.filterSelf((function(e){for(var i,r,o,s=0;s<n.length;s++){var l=t.get(n[s],e),u=!isNaN(l),h=l<a[0],c=l>a[1];if(u&&!h&&!c)return!0;u&&(o=!0),h&&(i=!0),c&&(r=!0)}return o&&i&&r})):EJ(n,(function(i){if("empty"===r)e.setData(t=t.map(i,(function(e){return function(e){return e>=a[0]&&e<=a[1]}(e)?e:NaN})));else{var n={};n[i]=a,t.selectRange(n)}})),EJ(n,(function(e){t.setApproximateExtent(a,e)})))}))}}};var RJ=h,OJ=g,kJ=p,zJ=lo,BJ=xJ,FJ=PJ,VJ=OJ.each,GJ=BJ.eachAxisDim,HJ=RJ.extendComponentModel({type:"dataZoom",dependencies:["xAxis","yAxis","zAxis","radiusAxis","angleAxis","singleAxis","series"],defaultOption:{zlevel:0,z:4,orient:null,xAxisIndex:null,yAxisIndex:null,filterMode:"filter",throttle:null,start:0,end:100,startValue:null,endValue:null,minSpan:null,maxSpan:null,minValueSpan:null,maxValueSpan:null,rangeMode:null},init:function(e,t,i){this._dataIntervalByAxis={},this._dataInfo={},this._axisProxies={},this.textStyleModel,this._autoThrottle=!0,this._rangePropMode=["percent","percent"];var n=UJ(e);this.settledOption=n,this.mergeDefaultAndTheme(e,i),this.doInit(n)},mergeOption:function(e){var t=UJ(e);OJ.merge(this.option,e,!0),OJ.merge(this.settledOption,t,!0),this.doInit(t)},doInit:function(e){var t=this.option;kJ.canvasSupported||(t.realtime=!1),this._setDefaultThrottle(e),WJ(this,e);var i=this.settledOption;VJ([["start","startValue"],["end","endValue"]],(function(e,n){"value"===this._rangePropMode[n]&&(t[e[0]]=i[e[0]]=null)}),this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var e=this._axisProxies;this.eachTargetAxis((function(t,i,n,r){var a=this.dependentModels[t.axis][i],o=a.__dzAxisProxy||(a.__dzAxisProxy=new FJ(t.name,i,this,r));e[t.name+"_"+i]=o}),this)},_resetTarget:function(){var e=this.option,t=this._judgeAutoMode();GJ((function(t){var i=t.axisIndex;e[i]=zJ.normalizeToArray(e[i])}),this),"axisIndex"===t?this._autoSetAxisIndex():"orient"===t&&this._autoSetOrient()},_judgeAutoMode:function(){var e=this.option,t=!1;GJ((function(i){null!=e[i.axisIndex]&&(t=!0)}),this);var i=e.orient;return null==i&&t?"orient":t?void 0:(null==i&&(e.orient="horizontal"),"axisIndex")},_autoSetAxisIndex:function(){var e=!0,t=this.get("orient",!0),i=this.option,n=this.dependentModels;if(e){var r="vertical"===t?"y":"x";n[r+"Axis"].length?(i[r+"AxisIndex"]=[0],e=!1):VJ(n.singleAxis,(function(n){e&&n.get("orient",!0)===t&&(i.singleAxisIndex=[n.componentIndex],e=!1)}))}e&&GJ((function(t){if(e){var n=[],r=this.dependentModels[t.axis];if(r.length&&!n.length)for(var a=0,o=r.length;a<o;a++)"category"===r[a].get("type")&&n.push(a);i[t.axisIndex]=n,n.length&&(e=!1)}}),this),e&&this.ecModel.eachSeries((function(e){this._isSeriesHasAllAxesTypeOf(e,"value")&&GJ((function(t){var n=i[t.axisIndex],r=e.get(t.axisIndex),a=e.get(t.axisId);r=e.ecModel.queryComponents({mainType:t.axis,index:r,id:a})[0].componentIndex,OJ.indexOf(n,r)<0&&n.push(r)}))}),this)},_autoSetOrient:function(){var e;this.eachTargetAxis((function(t){!e&&(e=t.name)}),this),this.option.orient="y"===e?"vertical":"horizontal"},_isSeriesHasAllAxesTypeOf:function(e,t){var i=!0;return GJ((function(n){var r=e.get(n.axisIndex),a=this.dependentModels[n.axis][r];a&&a.get("type")===t||(i=!1)}),this),i},_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}},getFirstTargetAxisModel:function(){var e;return GJ((function(t){if(null==e){var i=this.get(t.axisIndex);i.length&&(e=this.dependentModels[t.axis][i[0]])}}),this),e},eachTargetAxis:function(e,t){var i=this.ecModel;GJ((function(n){VJ(this.get(n.axisIndex),(function(r){e.call(t,n,r,this,i)}),this)}),this)},getAxisProxy:function(e,t){return this._axisProxies[e+"_"+t]},getAxisModel:function(e,t){var i=this.getAxisProxy(e,t);return i&&i.getAxisModel()},setRawRange:function(e){var t=this.option,i=this.settledOption;VJ([["start","startValue"],["end","endValue"]],(function(n){null==e[n[0]]&&null==e[n[1]]||(t[n[0]]=i[n[0]]=e[n[0]],t[n[1]]=i[n[1]]=e[n[1]])}),this),WJ(this,e)},setCalculatedRange:function(e){var t=this.option;VJ(["start","startValue","end","endValue"],(function(i){t[i]=e[i]}))},getPercentRange:function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},getValueRange:function(e,t){if(null!=e||null!=t)return this.getAxisProxy(e,t).getDataValueWindow();var i=this.findRepresentativeAxisProxy();return i?i.getDataValueWindow():void 0},findRepresentativeAxisProxy:function(e){if(e)return e.__dzAxisProxy;var t=this._axisProxies;for(var i in t)if(t.hasOwnProperty(i)&&t[i].hostedBy(this))return t[i];for(var i in t)if(t.hasOwnProperty(i)&&!t[i].hostedBy(this))return t[i]},getRangePropMode:function(){return this._rangePropMode.slice()}});function UJ(e){var t={};return VJ(["start","end","startValue","endValue","throttle"],(function(i){e.hasOwnProperty(i)&&(t[i]=e[i])})),t}function WJ(e,t){var i=e._rangePropMode,n=e.get("rangeMode");VJ([["start","startValue"],["end","endValue"]],(function(e,r){var a=null!=t[e[0]],o=null!=t[e[1]];a&&!o?i[r]="percent":!a&&o?i[r]="value":n?i[r]=n[r]:a&&(i[r]="percent")}))}var jJ=HJ,XJ=gm.extend({type:"dataZoom",render:function(e,t,i,n){this.dataZoomModel=e,this.ecModel=t,this.api=i},getTargetCoordInfo:function(){var e=this.dataZoomModel,t=this.ecModel,i={};return e.eachTargetAxis((function(e,n){var r=t.getComponent(e.axis,n);if(r){var a=r.getCoordSysModel();a&&function(e,t,i,n){for(var r,a=0;a<i.length;a++)if(i[a].model===e){r=i[a];break}r||i.push(r={model:e,axisModels:[],coordIndex:n}),r.axisModels.push(t)}(a,r,i[a.mainType]||(i[a.mainType]=[]),a.componentIndex)}}),this),i}}),ZJ=XJ;jJ.extend({type:"dataZoom.select"}),ZJ.extend({type:"dataZoom.select"});var qJ=h,YJ=g,KJ=YJ.createHashMap,QJ=YJ.each;qJ.registerProcessor({getTargetSeries:function(e){var t=KJ();return e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(e,i,n){var r=n.getAxisProxy(e.name,i);QJ(r.getTargetSeriesModels(),(function(e){t.set(e.uid,e)}))}))})),t},modifyOutputEnd:!0,overallReset:function(e,t){e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(e,i,n){n.getAxisProxy(e.name,i).reset(n,t)})),e.eachTargetAxis((function(e,i,n){n.getAxisProxy(e.name,i).filterData(n,t)}))})),e.eachComponent("dataZoom",(function(e){var t=e.findRepresentativeAxisProxy(),i=t.getDataPercentWindow(),n=t.getDataValueWindow();e.setCalculatedRange({start:i[0],end:i[1],startValue:n[0],endValue:n[1]})}))}});var JJ=g,$J=xJ;h.registerAction("dataZoom",(function(e,t){var i=$J.createLinkedNodesFinder(JJ.bind(t.eachComponent,t,"dataZoom"),$J.eachAxisDim,(function(e,t){return e.get(t.axisIndex)})),n=[];t.eachComponent({mainType:"dataZoom",query:e},(function(e,t){n.push.apply(n,i(e).nodes)})),JJ.each(n,(function(t,i){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})}))}));var e$=h,t$=g,i$=jV,n$=gJ,r$=mJ,a$=wF,o$=nQ,s$=jm.toolbox.dataZoom,l$=t$.each;function u$(e,t,i){(this._brushController=new i$(i.getZr())).on("brush",t$.bind(this._onBrush,this)).mount(),this._isZoomActive}u$.defaultOption={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:t$.clone(s$.title),brushStyle:{borderWidth:0,color:"rgba(0,0,0,0.2)"}};var h$=u$.prototype;h$.render=function(e,t,i,n){this.model=e,this.ecModel=t,this.api=i,function(e,t,i,n,r){var a=i._isZoomActive;n&&"takeGlobalCursor"===n.type&&(a="dataZoomSelect"===n.key&&n.dataZoomSelectActive),i._isZoomActive=a,e.setIconStatus("zoom",a?"emphasis":"normal");var o=new n$(d$(e.option),t,{include:["grid"]});i._brushController.setPanels(o.makePanelOpts(r,(function(e){return e.xAxisDeclared&&!e.yAxisDeclared?"lineX":!e.xAxisDeclared&&e.yAxisDeclared?"lineY":"rect"}))).enableBrush(!!a&&{brushType:"auto",brushStyle:e.getModel("brushStyle").getItemStyle()})}(e,t,this,n,i),function(e,t){e.setIconStatus("back",r$.count(t)>1?"emphasis":"normal")}(e,t)},h$.onclick=function(e,t,i){c$[i].call(this)},h$.remove=function(e,t){this._brushController.unmount()},h$.dispose=function(e,t){this._brushController.dispose()};var c$={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(r$.pop(this.ecModel))}};function d$(e){var t={};return t$.each(["xAxisIndex","yAxisIndex"],(function(i){t[i]=e[i],null==t[i]&&(t[i]="all"),(!1===t[i]||"none"===t[i])&&(t[i]=[])})),t}h$._onBrush=function(e,t){if(t.isEnd&&e.length){var i={},n=this.ecModel;this._brushController.updateCovers([]),new n$(d$(this.model.option),n,{include:["grid"]}).matchOutputRanges(e,n,(function(e,t,i){if("cartesian2d"===i.type){var n=e.brushType;"rect"===n?(r("x",i,t[0]),r("y",i,t[1])):r({lineX:"x",lineY:"y"}[n],i,t)}})),r$.push(n,i),this._dispatchZoomAction(i)}function r(e,t,r){var a=t.getAxis(e),o=a.model,s=function(e,t,i){var n;return i.eachComponent({mainType:"dataZoom",subType:"select"},(function(i){i.getAxisModel(e,t.componentIndex)&&(n=i)})),n}(e,o,n),l=s.findRepresentativeAxisProxy(o).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(r=a$(0,r.slice(),a.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(i[s.id]={dataZoomId:s.id,startValue:r[0],endValue:r[1]})}},h$._dispatchZoomAction=function(e){var t=[];l$(e,(function(e,i){t.push(t$.clone(e))})),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},o$.register("dataZoom",u$),e$.registerPreprocessor((function(e){if(e){var t=e.dataZoom||(e.dataZoom=[]);t$.isArray(t)||(e.dataZoom=t=[t]);var i=e.toolbox;if(i&&(t$.isArray(i)&&(i=i[0]),i&&i.feature)){var n=i.feature.dataZoom;r("xAxis",n),r("yAxis",n)}}function r(i,n){if(n){var r=i+"Index",a=n[r];null==a||"all"===a||t$.isArray(a)||(a=!1===a||"none"===a?[]:[a]),o=function(e,o){if(null==a||"all"===a||-1!==t$.indexOf(a,o)){var s={type:"select",$fromToolbox:!0,filterMode:n.filterMode||"filter",id:"\0_ec_\0toolbox-dataZoom_"+i+o};s[r]=o,t.push(s)}},s=e[i],t$.isArray(s)||(s=s?[s]:[]),l$(s,o)}var o,s}}));var f$=h,p$=mJ,g$=nQ,m$=jm.toolbox.restore;function v$(e){this.model=e}v$.defaultOption={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:m$.title},v$.prototype.onclick=function(e,t,i){p$.clear(e),t.dispatchAction({type:"restore",from:this.uid})},g$.register("restore",v$),f$.registerAction({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(e,t){t.resetOption("recreate")})),h.extendComponentModel({type:"tooltip",dependencies:["axisPointer"],defaultOption:{zlevel:0,z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:!1,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(50,50,50,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#fff",fontSize:14}}});var y$=g,_$=ut,x$=ne,b$=re,w$=p,T$=qc,S$=y$.each,M$=T$.toCamelCase,A$=["","-webkit-","-moz-","-o-"];function I$(e){var t,i,n,r=[],a=e.get("transitionDuration"),o=e.get("backgroundColor"),s=e.getModel("textStyle"),l=e.get("padding");return a&&r.push((n="left "+(t=a)+"s "+(i="cubic-bezier(0.23, 1, 0.32, 1)")+",top "+t+"s "+i,y$.map(A$,(function(e){return e+"transition:"+n})).join(";"))),o&&(w$.canvasSupported?r.push("background-Color:"+o):(r.push("background-Color:#"+_$.toHex(o)),r.push("filter:alpha(opacity=70)"))),S$(["width","color","radius"],(function(t){var i="border-"+t,n=M$(i),a=e.get(n);null!=a&&r.push(i+":"+a+("color"===t?"":"px"))})),r.push(function(e){var t=[],i=e.get("fontSize"),n=e.getTextColor();n&&t.push("color:"+n),t.push("font:"+e.getFont());var r=e.get("lineHeight");null==r&&(r=Math.round(3*i/2)),i&&t.push("line-height:"+r+"px");var a=e.get("textShadowColor"),o=e.get("textShadowBlur")||0,s=e.get("textShadowOffsetX")||0,l=e.get("textShadowOffsetY")||0;return o&&t.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),S$(["decoration","align"],(function(i){var n=e.get(i);n&&t.push("text-"+i+":"+n)})),t.join(";")}(s)),null!=l&&r.push("padding:"+T$.normalizeCssArray(l).join("px ")+"px"),r.join(";")+";"}function C$(e,t,i,n,r){var a=t&&t.painter;if(i){var o=a&&a.getViewportRoot();o&&b$.transformLocalCoord(e,o,document.body,n,r)}else{e[0]=n,e[1]=r;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}function D$(e,t,i){if(w$.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var r=this._zr=t.getZr(),a=this._appendToBody=i&&i.appendToBody;this._styleCoord=[0,0,0,0],C$(this._styleCoord,r,a,t.getWidth()/2,t.getHeight()/2),a?document.body.appendChild(n):e.appendChild(n),this._container=e,this._show=!1,this._hideTimeout;var o=this;n.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},n.onmousemove=function(e){if(e=e||window.event,!o._enterable){var t=r.handler,i=r.painter.getViewportRoot();x$.normalizeEvent(i,e,!0),t.dispatch("mousemove",e)}},n.onmouseleave=function(){o._enterable&&o._show&&o.hideLater(o._hideDelay),o._inContent=!1}}D$.prototype={constructor:D$,_enterable:!0,update:function(e){var t=this._container,i=t.currentStyle||document.defaultView.getComputedStyle(t),n=t.style;"absolute"!==n.position&&"absolute"!==i.position&&(n.position="relative"),e.get("alwaysShowContent")&&this._moveTooltipIfResized()},_moveTooltipIfResized:function(){var e=this._styleCoord[2],t=this._styleCoord[3],i=e*this._zr.getWidth(),n=t*this._zr.getHeight();this.moveTo(i,n)},show:function(e){clearTimeout(this._hideTimeout);var t=this.el,i=this._styleCoord;t.style.cssText="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+I$(e)+";left:"+i[0]+"px;top:"+i[1]+"px;"+(e.get("extraCssText")||""),t.style.display=t.innerHTML?"block":"none",t.style.pointerEvents=this._enterable?"auto":"none",this._show=!0},setContent:function(e){this.el.innerHTML=null==e?"":e},setEnterable:function(e){this._enterable=e},getSize:function(){var e=this.el;return[e.clientWidth,e.clientHeight]},moveTo:function(e,t){var i=this._styleCoord;C$(i,this._zr,this._appendToBody,e,t);var n=this.el.style;n.left=i[0]+"px",n.top=i[1]+"px"},hide:function(){this.el.style.display="none",this._show=!1},hideLater:function(e){!this._show||this._inContent&&this._enterable||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(y$.bind(this.hide,this),e)):this.hide())},isShow:function(){return this._show},dispose:function(){this.el.parentNode.removeChild(this.el)},getOuterSize:function(){var e=this.el.clientWidth,t=this.el.clientHeight;if(document.defaultView&&document.defaultView.getComputedStyle){var i=document.defaultView.getComputedStyle(this.el);i&&(e+=parseInt(i.borderLeftWidth,10)+parseInt(i.borderRightWidth,10),t+=parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10))}return{width:e,height:t}}};var E$=D$,L$=g,P$=Vl,N$=No;function R$(e,t,i,n){e[0]=i,e[1]=n,e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}function O$(e){var t=this._zr=e.getZr();this._styleCoord=[0,0,0,0],R$(this._styleCoord,t,e.getWidth()/2,e.getHeight()/2),this._show=!1,this._hideTimeout}O$.prototype={constructor:O$,_enterable:!0,update:function(e){e.get("alwaysShowContent")&&this._moveTooltipIfResized()},_moveTooltipIfResized:function(){var e=this._styleCoord[2],t=this._styleCoord[3],i=e*this._zr.getWidth(),n=t*this._zr.getHeight();this.moveTo(i,n)},show:function(e){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.attr("show",!0),this._show=!0},setContent:function(e,t,i){this.el&&this._zr.remove(this.el);for(var n={},r=e,a="{marker",o=r.indexOf(a);o>=0;){var s=r.indexOf("|}"),l=r.substr(o+a.length,s-o-a.length);l.indexOf("sub")>-1?n["marker"+l]={textWidth:4,textHeight:4,textBorderRadius:2,textBackgroundColor:t[l],textOffset:[3,0]}:n["marker"+l]={textWidth:10,textHeight:10,textBorderRadius:5,textBackgroundColor:t[l]},o=(r=r.substr(s+1)).indexOf("{marker")}var u=i.getModel("textStyle"),h=u.get("fontSize"),c=i.get("textLineHeight");null==c&&(c=Math.round(3*h/2)),this.el=new P$({style:N$.setTextStyle({},u,{rich:n,text:e,textBackgroundColor:i.get("backgroundColor"),textBorderRadius:i.get("borderRadius"),textFill:i.get("textStyle.color"),textPadding:i.get("padding"),textLineHeight:c}),z:i.get("z")}),this._zr.add(this.el);var d=this;this.el.on("mouseover",(function(){d._enterable&&(clearTimeout(d._hideTimeout),d._show=!0),d._inContent=!0})),this.el.on("mouseout",(function(){d._enterable&&d._show&&d.hideLater(d._hideDelay),d._inContent=!1}))},setEnterable:function(e){this._enterable=e},getSize:function(){var e=this.el.getBoundingRect();return[e.width,e.height]},moveTo:function(e,t){if(this.el){var i=this._styleCoord;R$(i,this._zr,e,t),this.el.attr("position",[i[0],i[1]])}},hide:function(){this.el&&this.el.hide(),this._show=!1},hideLater:function(e){!this._show||this._inContent&&this._enterable||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(L$.bind(this.hide,this),e)):this.hide())},isShow:function(){return this._show},dispose:function(){clearTimeout(this._hideTimeout),this.el&&this._zr.remove(this.el)},getOuterSize:function(){var e=this.getSize();return{width:e[0],height:e[1]}}};var k$=h,z$=g,B$=p,F$=E$,V$=O$,G$=qc,H$=Uc,U$=No,W$=Yj,j$=Hc,X$=zc,Z$=uX,q$=yx,Y$=RX,K$=lo.getTooltipRenderMode,Q$=z$.bind,J$=z$.each,$$=H$.parsePercent,e0=new U$.Rect({shape:{x:-1,y:-1,width:2,height:2}});function t0(e){for(var t=e.pop();e.length;){var i=e.pop();i&&(X$.isInstance(i)&&(i=i.get("tooltip",!0)),"string"==typeof i&&(i={formatter:i}),t=new X$(i,t,t.ecModel))}return t}function i0(e,t){return e.dispatchAction||z$.bind(t.dispatchAction,t)}function n0(e){return"center"===e||"middle"===e}k$.extendComponentView({type:"tooltip",init:function(e,t){if(!B$.node){var i,n=e.getComponent("tooltip"),r=n.get("renderMode");this._renderMode=K$(r),"html"===this._renderMode?(i=new F$(t.getDom(),t,{appendToBody:n.get("appendToBody",!0)}),this._newLine="<br/>"):(i=new V$(t),this._newLine="\n"),this._tooltipContent=i}},render:function(e,t,i){if(!B$.node){this.group.removeAll(),this._tooltipModel=e,this._ecModel=t,this._api=i,this._lastDataByCoordSys=null,this._alwaysShowContent=e.get("alwaysShowContent");var n=this._tooltipContent;n.update(e),n.setEnterable(e.get("enterable")),this._initGlobalListener(),this._keepShow()}},_initGlobalListener:function(){var e=this._tooltipModel.get("triggerOn");Z$.register("itemTooltip",this._api,Q$((function(t,i,n){"none"!==e&&(e.indexOf(t)>=0?this._tryShow(i,n):"leave"===t&&this._hide(n))}),this))},_keepShow:function(){var e=this._tooltipModel,t=this._ecModel,i=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==e.get("triggerOn")){var n=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!i.isDisposed()&&n.manuallyShowTip(e,t,i,{x:n._lastX,y:n._lastY})}))}},manuallyShowTip:function(e,t,i,n){if(n.from!==this.uid&&!B$.node){var r=i0(n,i);this._ticket="";var a=n.dataByCoordSys;if(n.tooltip&&null!=n.x&&null!=n.y){var o=e0;o.position=[n.x,n.y],o.update(),o.tooltip=n.tooltip,this._tryShow({offsetX:n.x,offsetY:n.y,target:o},r)}else if(a)this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,dataByCoordSys:n.dataByCoordSys,tooltipOption:n.tooltipOption},r);else if(null!=n.seriesIndex){if(this._manuallyAxisShowTip(e,t,i,n))return;var s=W$(n,t),l=s.point[0],u=s.point[1];null!=l&&null!=u&&this._tryShow({offsetX:l,offsetY:u,position:n.position,target:s.el},r)}else null!=n.x&&null!=n.y&&(i.dispatchAction({type:"updateAxisPointer",x:n.x,y:n.y}),this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,target:i.getZr().findHover(n.x,n.y).target},r))}},manuallyHideTip:function(e,t,i,n){var r=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,n.from!==this.uid&&this._hide(i0(n,i))},_manuallyAxisShowTip:function(e,t,i,n){var r=n.seriesIndex,a=n.dataIndex,o=t.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=a&&null!=o){var s=t.getSeriesByIndex(r);if(s&&"axis"===(e=t0([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model,e])).get("trigger"))return i.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:a,position:n.position}),!0}},_tryShow:function(e,t){var i=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var n=e.dataByCoordSys;n&&n.length?this._showAxisTooltip(n,e):i&&null!=i.dataIndex?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(e,i,t)):i&&i.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(e,i,t)):(this._lastDataByCoordSys=null,this._hide(t))}},_showOrMove:function(e,t){var i=e.get("showDelay");t=z$.bind(t,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(t,i):t()},_showAxisTooltip:function(e,t){var i=this._ecModel,n=this._tooltipModel,r=[t.offsetX,t.offsetY],a=[],o=[],s=t0([t.tooltipOption,n]),l=this._renderMode,u=this._newLine,h={};J$(e,(function(e){J$(e.dataByAxis,(function(e){var t=i.getComponent(e.axisDim+"Axis",e.axisIndex),n=e.value,r=[];if(t&&null!=n){var s=Y$.getValueLabel(n,t.axis,i,e.seriesDataIndices,e.valueLabelOpt);z$.each(e.seriesDataIndices,(function(a){var u=i.getSeriesByIndex(a.seriesIndex),c=a.dataIndexInside,d=u&&u.getDataParams(c);if(d.axisDim=e.axisDim,d.axisIndex=e.axisIndex,d.axisType=e.axisType,d.axisId=e.axisId,d.axisValue=q$.getAxisRawValue(t.axis,n),d.axisValueLabel=s,d){o.push(d);var f,p=u.formatTooltip(c,!0,null,l);if(z$.isObject(p)){f=p.html;var g=p.markers;z$.merge(h,g)}else f=p;r.push(f)}}));var c=s;"html"!==l?a.push(r.join(u)):a.push((c?G$.encodeHTML(c)+u:"")+r.join(u))}}))}),this),a.reverse(),a=a.join(this._newLine+this._newLine);var c=t.position;this._showOrMove(s,(function(){this._updateContentNotChangedOnAxis(e)?this._updatePosition(s,c,r[0],r[1],this._tooltipContent,o):this._showTooltipContent(s,a,o,Math.random(),r[0],r[1],c,void 0,h)}))},_showSeriesItemTooltip:function(e,t,i){var n=this._ecModel,r=t.seriesIndex,a=n.getSeriesByIndex(r),o=t.dataModel||a,s=t.dataIndex,l=t.dataType,u=o.getData(l),h=t0([u.getItemModel(s),o,a&&(a.coordinateSystem||{}).model,this._tooltipModel]),c=h.get("trigger");if(null==c||"item"===c){var d,f,p=o.getDataParams(s,l),g=o.formatTooltip(s,!1,l,this._renderMode);z$.isObject(g)?(d=g.html,f=g.markers):(d=g,f=null);var m="item_"+o.name+"_"+s;this._showOrMove(h,(function(){this._showTooltipContent(h,d,p,m,e.offsetX,e.offsetY,e.position,e.target,f)})),i({type:"showTip",dataIndexInside:s,dataIndex:u.getRawIndex(s),seriesIndex:r,from:this.uid})}},_showComponentItemTooltip:function(e,t,i){var n=t.tooltip;"string"==typeof n&&(n={content:n,formatter:n});var r=new X$(n,this._tooltipModel,this._ecModel),a=r.get("content"),o=Math.random();this._showOrMove(r,(function(){this._showTooltipContent(r,a,r.get("formatterParams")||{},o,e.offsetX,e.offsetY,e.position,t)})),i({type:"showTip",from:this.uid})},_showTooltipContent:function(e,t,i,n,r,a,o,s,l){if(this._ticket="",e.get("showContent")&&e.get("show")){var u=this._tooltipContent,h=e.get("formatter");o=o||e.get("position");var c=t;if(h&&"string"==typeof h)c=G$.formatTpl(h,i,!0);else if("function"==typeof h){var d=Q$((function(t,n){t===this._ticket&&(u.setContent(n,l,e),this._updatePosition(e,o,r,a,u,i,s))}),this);this._ticket=n,c=h(i,n,d)}u.setContent(c,l,e),u.show(e),this._updatePosition(e,o,r,a,u,i,s)}},_updatePosition:function(e,t,i,n,r,a,o){var s=this._api.getWidth(),l=this._api.getHeight();t=t||e.get("position");var u=r.getSize(),h=e.get("align"),c=e.get("verticalAlign"),d=o&&o.getBoundingRect().clone();if(o&&d.applyTransform(o.transform),"function"==typeof t&&(t=t([i,n],a,r.el,d,{viewSize:[s,l],contentSize:u.slice()})),z$.isArray(t))i=$$(t[0],s),n=$$(t[1],l);else if(z$.isObject(t)){t.width=u[0],t.height=u[1];var f=j$.getLayoutRect(t,{width:s,height:l});i=f.x,n=f.y,h=null,c=null}else if("string"==typeof t&&o){var p=function(e,t,i){var n=i[0],r=i[1],a=5,o=0,s=0,l=t.width,u=t.height;switch(e){case"inside":o=t.x+l/2-n/2,s=t.y+u/2-r/2;break;case"top":o=t.x+l/2-n/2,s=t.y-r-a;break;case"bottom":o=t.x+l/2-n/2,s=t.y+u+a;break;case"left":o=t.x-n-a,s=t.y+u/2-r/2;break;case"right":o=t.x+l+a,s=t.y+u/2-r/2}return[o,s]}(t,d,u);i=p[0],n=p[1]}else p=function(e,t,i,n,r,a,o){var s=i.getOuterSize(),l=s.width,u=s.height;return null!=a&&(e+l+a>n?e-=l+a:e+=a),null!=o&&(t+u+o>r?t-=u+o:t+=o),[e,t]}(i,n,r,s,l,h?null:20,c?null:20),i=p[0],n=p[1];h&&(i-=n0(h)?u[0]/2:"right"===h?u[0]:0),c&&(n-=n0(c)?u[1]/2:"bottom"===c?u[1]:0),e.get("confine")&&(p=function(e,t,i,n,r){var a=i.getOuterSize(),o=a.width,s=a.height;return e=Math.min(e+o,n)-o,t=Math.min(t+s,r)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}(i,n,r,s,l),i=p[0],n=p[1]),r.moveTo(i,n)},_updateContentNotChangedOnAxis:function(e){var t=this._lastDataByCoordSys,i=!!t&&t.length===e.length;return i&&J$(t,(function(t,n){var r=t.dataByAxis||{},a=(e[n]||{}).dataByAxis||[];(i&=r.length===a.length)&&J$(r,(function(e,t){var n=a[t]||{},r=e.seriesDataIndices||[],o=n.seriesDataIndices||[];(i&=e.value===n.value&&e.axisType===n.axisType&&e.axisId===n.axisId&&r.length===o.length)&&J$(r,(function(e,t){var n=o[t];i&=e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}))}))})),this._lastDataByCoordSys=e,!!i},_hide:function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},dispose:function(e,t){B$.node||(this._tooltipContent.dispose(),Z$.unregister("itemTooltip",t))}});var r0=h;r0.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},(function(){})),r0.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},(function(){}));var a0=g,o0=["rect","polygon","keep","clear"],s0=function(e,t){var i=e&&e.brush;if(a0.isArray(i)||(i=i?[i]:[]),i.length){var n=[];a0.each(i,(function(e){var t=e.hasOwnProperty("toolbox")?e.toolbox:[];t instanceof Array&&(n=n.concat(t))}));var r=e&&e.toolbox;a0.isArray(r)&&(r=r[0]),r||(r={feature:{}},e.toolbox=[r]);var a=r.feature||(r.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,n),function(e){var t={};a0.each(e,(function(e){t[e]=1})),e.length=0,a0.each(t,(function(t,i){e.push(i)}))}(s),t&&!s.length&&s.push.apply(s,o0)}},l0={},u0={},h0=g,c0=yO,d0=h0.each;function f0(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!0}u0.createVisualMappings=function(e,t,i){var n={};return d0(t,(function(t){var r,a=n[t]=((r=function(){}).prototype.__hidden=r.prototype,new r);d0(e[t],(function(e,n){if(c0.isValidType(n)){var r={type:n,visual:e};i&&i(r,t),a[n]=new c0(r),"opacity"===n&&((r=h0.clone(r)).type="colorAlpha",a.__hidden.__alphaForOpacity=new c0(r))}}))})),n},u0.replaceVisualOption=function(e,t,i){var n;h0.each(i,(function(e){t.hasOwnProperty(e)&&f0(t[e])&&(n=!0)})),n&&h0.each(i,(function(i){t.hasOwnProperty(i)&&f0(t[i])?e[i]=h0.clone(t[i]):delete e[i]}))},u0.applyVisual=function(e,t,i,n,r,a){var o,s={};function l(e){return i.getItemVisual(o,e)}function u(e,t){i.setItemVisual(o,e,t)}function h(e,h){o=null==a?e:h;var c=i.getRawDataItem(o);if(!c||!1!==c.visualMap)for(var d=n.call(r,e),f=t[d],p=s[d],g=0,m=p.length;g<m;g++){var v=p[g];f[v]&&f[v].applyVisual(e,l,u)}}h0.each(e,(function(e){var i=c0.prepareVisualTypes(t[e]);s[e]=i})),null==a?i.each(h):i.each([a],h)},u0.incrementalApplyVisual=function(e,t,i,n){var r={};return h0.each(e,(function(e){var i=c0.prepareVisualTypes(t[e]);r[e]=i})),{progress:function(e,a){function o(e){return a.getItemVisual(l,e)}function s(e,t){a.setItemVisual(l,e,t)}var l;for(null!=n&&(n=a.getDimension(n));null!=(l=e.next());){var u=a.getRawDataItem(l);if(!u||!1!==u.visualMap)for(var h=null!=n?a.get(n,l,!0):l,c=i(h),d=t[c],f=r[c],p=0,g=f.length;p<g;p++){var m=f[p];d[m]&&d[m].applyVisual(h,o,s)}}}}};var p0=Rw,g0=Pi,m0=No.linePolygonIntersect,v0={lineX:y0(0),lineY:y0(1),rect:{point:function(e,t,i){return e&&i.boundingRect.contain(e[0],e[1])},rect:function(e,t,i){return e&&i.boundingRect.intersect(e)}},polygon:{point:function(e,t,i){return e&&i.boundingRect.contain(e[0],e[1])&&p0.contain(i.range,e[0],e[1])},rect:function(e,t,i){var n=i.range;if(!e||n.length<=1)return!1;var r=e.x,a=e.y,o=e.width,s=e.height,l=n[0];return!!(p0.contain(n,r,a)||p0.contain(n,r+o,a)||p0.contain(n,r,a+s)||p0.contain(n,r+o,a+s)||g0.create(e).contain(l[0],l[1])||m0(r,a,r+o,a,n)||m0(r,a,r,a+s,n)||m0(r+o,a,r+o,a+s,n)||m0(r,a+s,r+o,a+s,n))||void 0}}};function y0(e){var t=["x","y"],i=["width","height"];return{point:function(t,i,n){if(t){var r=n.range;return _0(t[e],r)}},rect:function(n,r,a){if(n){var o=a.range,s=[n[t[e]],n[t[e]]+n[i[e]]];return s[1]<s[0]&&s.reverse(),_0(s[0],o)||_0(s[1],o)||_0(o[0],s)||_0(o[1],s)}}}}function _0(e,t){return t[0]<=e&&e<=t[1]}var x0=h,b0=g,w0=Pi,T0=u0,S0=v0,M0=km,A0=gJ,I0=["inBrush","outOfBrush"],C0="__ecBrushSelect",D0="__ecInBrushSelectEvent",E0=x0.PRIORITY.VISUAL.BRUSH;function L0(e){e.eachComponent({mainType:"brush"},(function(t){(t.brushTargetManager=new A0(t.option,e)).setInputRanges(t.areas,e)}))}function P0(e,t){if(!e.isDisposed()){var i=e.getZr();i[D0]=!0,e.dispatchAction({type:"brushSelect",batch:t}),i[D0]=!1}}function N0(e,t,i,n){for(var r=0,a=t.length;r<a;r++){var o=t[r];if(e[o.brushType](n,i,o.selectors,o))return!0}}function R0(e){var t=e.brushSelector;if(b0.isString(t)){var i=[];return b0.each(S0,(function(e,n){i[n]=function(i,n,r,a){var o=n.getItemLayout(i);return e[t](o,r,a)}})),i}if(b0.isFunction(t)){var n={};return b0.each(S0,(function(e,i){n[i]=t})),n}return t}x0.registerLayout(E0,(function(e,t,i){e.eachComponent({mainType:"brush"},(function(e){i&&"takeGlobalCursor"===i.type&&e.setBrushOption("brush"===i.key?i.brushOption:{brushType:!1})})),L0(e)})),x0.registerVisual(E0,(function(e,t,i){var n,r,a=[];e.eachComponent({mainType:"brush"},(function(t,i){var o={brushId:t.id,brushIndex:i,brushName:t.name,areas:b0.clone(t.areas),selected:[]};a.push(o);var s=t.option,l=s.brushLink,u=[],h=[],c=[],d=0;i||(n=s.throttleType,r=s.throttleDelay);var f=b0.map(t.areas,(function(e){return function(e){var t=e.selectors={};return b0.each(S0[e.brushType],(function(i,n){t[n]=function(n){return i(n,t,e)}})),e}(b0.defaults({boundingRect:O0[e.brushType](e)},e))})),p=T0.createVisualMappings(t.option,I0,(function(e){e.mappingMethod="fixed"}));function g(e){return"all"===l||u[e]}function m(e){return!!e.length}b0.isArray(l)&&b0.each(l,(function(e){u[e]=1})),e.eachSeries((function(i,n){var r=c[n]=[];"parallel"===i.subType?function(e,t){var i=e.coordinateSystem;d|=i.hasAxisBrushed(),g(t)&&i.eachActiveState(e.getData(),(function(e,t){"active"===e&&(h[t]=1)}))}(i,n):function(i,n,r){var a=R0(i);if(a&&!function(e,t){var i=e.option.seriesIndex;return null!=i&&"all"!==i&&(b0.isArray(i)?b0.indexOf(i,t)<0:t!==i)}(t,n)&&(b0.each(f,(function(n){a[n.brushType]&&t.brushTargetManager.controlSeries(n,i,e)&&r.push(n),d|=m(r)})),g(n)&&m(r))){var o=i.getData();o.each((function(e){N0(a,r,o,e)&&(h[e]=1)}))}}(i,n,r)})),e.eachSeries((function(e,t){var i={seriesId:e.id,seriesIndex:t,seriesName:e.name,dataIndex:[]};o.selected.push(i);var n=R0(e),r=c[t],a=e.getData(),s=g(t)?function(e){return h[e]?(i.dataIndex.push(a.getRawIndex(e)),"inBrush"):"outOfBrush"}:function(e){return N0(n,r,a,e)?(i.dataIndex.push(a.getRawIndex(e)),"inBrush"):"outOfBrush"};(g(t)?d:m(r))&&T0.applyVisual(I0,p,a,s)}))})),function(e,t,i,n,r){if(r){var a=e.getZr();a[D0]||(a.__ecBrushSelect||(a.__ecBrushSelect=P0),M0.createOrUpdate(a,C0,i,t)(e,n))}}(t,n,r,a,i)}));var O0={lineX:b0.noop,lineY:b0.noop,rect:function(e){return k0(e.range)},polygon:function(e){for(var t,i=e.range,n=0,r=i.length;n<r;n++){t=t||[[1/0,-1/0],[1/0,-1/0]];var a=i[n];a[0]<t[0][0]&&(t[0][0]=a[0]),a[0]>t[0][1]&&(t[0][1]=a[0]),a[1]<t[1][0]&&(t[1][0]=a[1]),a[1]>t[1][1]&&(t[1][1]=a[1])}return t&&k0(t)}};function k0(e){return new w0(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}l0.layoutCovers=L0;var z0=g,B0=u0,F0=zc,V0=["#ddd"];function G0(e,t){return z0.merge({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new F0(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}h.extendComponentModel({type:"brush",dependencies:["geo","grid","xAxis","yAxis","parallel","series"],defaultOption:{toolbox:null,brushLink:null,seriesIndex:"all",geoIndex:null,xAxisIndex:null,yAxisIndex:null,brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(120,140,180,0.3)",borderColor:"rgba(120,140,180,0.8)"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},areas:[],brushType:null,brushOption:{},coordInfoList:[],optionUpdated:function(e,t){var i=this.option;!t&&B0.replaceVisualOption(i,e,["inBrush","outOfBrush"]);var n=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:V0},n.hasOwnProperty("liftZ")||(n.liftZ=5)},setAreas:function(e){e&&(this.areas=z0.map(e,(function(e){return G0(this.option,e)}),this))},setBrushOption:function(e){this.brushOption=G0(this.option,e),this.brushType=this.brushOption.brushType}});var H0=h,U0=g,W0=jV,j0=l0.layoutCovers;function X0(e,t,i,n){(!n||n.$from!==e.id)&&this._brushController.setPanels(e.brushTargetManager.makePanelOpts(i)).enableBrush(e.brushOption).updateCovers(e.areas.slice())}H0.extendComponentView({type:"brush",init:function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new W0(t.getZr())).on("brush",U0.bind(this._onBrush,this)).mount()},render:function(e){return this.model=e,X0.apply(this,arguments)},updateTransform:function(e,t){return j0(t),X0.apply(this,arguments)},updateView:X0,dispose:function(){this._brushController.dispose()},_onBrush:function(e,t){var i=this.model.id;this.model.brushTargetManager.setOutputRanges(e,this.ecModel),(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:i,areas:U0.clone(e),$from:i}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:i,areas:U0.clone(e),$from:i})}});var Z0=h;Z0.registerAction({type:"brush",event:"brush"},(function(e,t){t.eachComponent({mainType:"brush",query:e},(function(t){t.setAreas(e.areas)}))})),Z0.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},(function(){})),Z0.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},(function(){}));var q0=g,Y0=nQ,K0=jm.toolbox.brush;function Q0(e,t,i){this.model=e,this.ecModel=t,this.api=i,this._brushType,this._brushMode}Q0.defaultOption={show:!0,type:["rect","polygon","lineX","lineY","keep","clear"],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:q0.clone(K0.title)};var J0=Q0.prototype;J0.render=J0.updateView=function(e,t,i){var n,r,a;t.eachComponent({mainType:"brush"},(function(e){n=e.brushType,r=e.brushOption.brushMode||"single",a|=e.areas.length})),this._brushType=n,this._brushMode=r,q0.each(e.get("type",!0),(function(t){e.setIconStatus(t,("keep"===t?"multiple"===r:"clear"===t?a:t===n)?"emphasis":"normal")}))},J0.getIcons=function(){var e=this.model,t=e.get("icon",!0),i={};return q0.each(e.get("type",!0),(function(e){t[e]&&(i[e]=t[e])})),i},J0.onclick=function(e,t,i){var n=this._brushType,r=this._brushMode;"clear"===i?(t.dispatchAction({type:"axisAreaSelect",intervals:[]}),t.dispatchAction({type:"brush",command:"clear",areas:[]})):t.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===i?n:n!==i&&i,brushMode:"keep"===i?"multiple"===r?"single":"multiple":r}})},Y0.register("brush",Q0),h.registerPreprocessor(s0);var $0=g,e1=h,t1=No,i1=Hc.getLayoutRect,n1=qc.windowOpen;e1.extendComponentModel({type:"title",layoutMode:{type:"box",ignoreSize:!0},defaultOption:{zlevel:0,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:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}}}),e1.extendComponentView({type:"title",render:function(e,t,i){if(this.group.removeAll(),e.get("show")){var n=this.group,r=e.getModel("textStyle"),a=e.getModel("subtextStyle"),o=e.get("textAlign"),s=$0.retrieve2(e.get("textBaseline"),e.get("textVerticalAlign")),l=new t1.Text({style:t1.setTextStyle({},r,{text:e.get("text"),textFill:r.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=e.get("subtext"),c=new t1.Text({style:t1.setTextStyle({},a,{text:h,textFill:a.getTextColor(),y:u.height+e.get("itemGap"),textVerticalAlign:"top"},{disableBox:!0}),z2:10}),d=e.get("link"),f=e.get("sublink"),p=e.get("triggerEvent",!0);l.silent=!d&&!p,c.silent=!f&&!p,d&&l.on("click",(function(){n1(d,"_"+e.get("target"))})),f&&c.on("click",(function(){n1(f,"_"+e.get("subtarget"))})),l.eventData=c.eventData=p?{componentType:"title",componentIndex:e.componentIndex}:null,n.add(l),h&&n.add(c);var g=n.getBoundingRect(),m=e.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=i1(m,{width:i.getWidth(),height:i.getHeight()},e.get("padding"));o||("middle"===(o=e.get("left")||e.get("right"))&&(o="center"),"right"===o?v.x+=v.width:"center"===o&&(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"),n.attr("position",[v.x,v.y]);var y={textAlign:o,textVerticalAlign:s};l.setStyle(y),c.setStyle(y),g=n.getBoundingRect();var _=v.margin,x=e.getItemStyle(["color","opacity"]);x.fill=e.get("backgroundColor");var b=new t1.Rect({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});n.add(b)}}});var r1=g;function a1(e){var t=e.itemStyle||(e.itemStyle={}),i=t.emphasis||(t.emphasis={}),n=e.label||e.label||{},r=n.normal||(n.normal={}),a={normal:1,emphasis:1};r1.each(n,(function(e,t){a[t]||o1(r,t)||(r[t]=e)})),i.label&&!o1(n,"emphasis")&&(n.emphasis=i.label,delete i.label)}function o1(e,t){return e.hasOwnProperty(t)}var s1=function(e){var t=e&&e.timeline;r1.isArray(t)||(t=t?[t]:[]),r1.each(t,(function(e){e&&function(e){var t=e.type,i={number:"value",time:"time"};if(i[t]&&(e.axisType=i[t],delete e.type),a1(e),o1(e,"controlPosition")){var n=e.controlStyle||(e.controlStyle={});o1(n,"position")||(n.position=e.controlPosition),"none"!==n.position||o1(n,"show")||(n.show=!1,delete n.position),delete e.controlPosition}r1.each(e.data||[],(function(e){r1.isObject(e)&&!r1.isArray(e)&&(!o1(e,"value")&&o1(e,"name")&&(e.value=e.name),a1(e))}))}(e)}))};Ld.registerSubTypeDefaulter("timeline",(function(){return"slider"}));var l1=h,u1=g;l1.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},(function(e,t){var i=t.getComponent("timeline");return i&&null!=e.currentIndex&&(i.setCurrentIndex(e.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.setPlayState(!1)),t.resetOption("timeline"),u1.defaults({currentIndex:i.option.currentIndex},e)})),l1.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},(function(e,t){var i=t.getComponent("timeline");i&&null!=e.playState&&i.setPlayState(e.playState)}));var h1=g,c1=A_,d1=lo,f1=Ld.extend({type:"timeline",layoutMode:"box",defaultOption:{zlevel:0,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:[]},init:function(e,t,i){this._data,this._names,this.mergeDefaultAndTheme(e,i),this._initData()},mergeOption:function(e){f1.superApply(this,"mergeOption",arguments),this._initData()},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},getCurrentIndex:function(){return this.option.currentIndex},isIndexMax:function(){return this.getCurrentIndex()>=this._data.count()-1},setPlayState:function(e){this.option.autoPlay=!!e},getPlayState:function(){return!!this.option.autoPlay},_initData:function(){var e=this.option,t=e.data||[],i=e.axisType,n=this._names=[];if("category"===i){var r=[];h1.each(t,(function(e,t){var i,a=d1.getDataItemValue(e);h1.isObject(e)?(i=h1.clone(e)).value=t:i=t,r.push(i),h1.isString(a)||null!=a&&!isNaN(a)||(a=""),n.push(a+"")})),t=r}var a={category:"ordinal",time:"time"}[i]||"number";(this._data=new c1([{name:"value",type:a}],this)).initData(t,n)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}}),p1=g,g1=Ig,m1=f1.extend({type:"timeline.slider",defaultOption:{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"emptyCircle",symbolSize:10,lineStyle:{show:!0,width:2,color:"#304654"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#304654"},itemStyle:{color:"#304654",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:13,color:"#c23531",borderWidth:5,borderColor:"rgba(194,53,49, 0.5)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:22,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:"path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",prevIcon:"path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",color:"#304654",borderColor:"#304654",borderWidth:1},emphasis:{label:{show:!0,color:"#c23531"},itemStyle:{color:"#c23531"},controlStyle:{color:"#c23531",borderColor:"#c23531",borderWidth:2}},data:[]}});p1.mixin(m1,g1);var v1=gm.extend({type:"timeline"}),y1=g,_1=wT,x1=function(e,t,i,n){_1.call(this,e,t,i),this.type=n||"value",this.model=null};x1.prototype={constructor:x1,getLabelModel:function(){return this.model.getModel("label")},isHorizontal:function(){return"horizontal"===this.model.get("orient")}},y1.inherits(x1,_1);var b1=g,w1=Pi,T1=Ue,S1=No,M1=Hc,A1=v1,I1=x1,C1=ow.createSymbol,D1=yx,E1=Uc,L1=qc.encodeHTML,P1=b1.bind,N1=b1.each,R1=Math.PI;function O1(e,t,i,n,r,a){var o=t.get("color");if(r)r.setColor(o),i.add(r),a&&a.onUpdate(r);else{var s=e.get("symbol");(r=C1(s,-1,-1,2,2,o)).setStyle("strokeNoScale",!0),i.add(r),a&&a.onCreate(r)}var l=t.getItemStyle(["color","symbol","symbolSize"]);r.setStyle(l),n=b1.merge({rectHover:!0,z2:100},n,!0);var u=e.get("symbolSize");(u=u instanceof Array?u.slice():[+u,+u])[0]/=2,u[1]/=2,n.scale=u;var h=e.get("symbolOffset");if(h){var c=n.position=n.position||[0,0];c[0]+=E1.parsePercent(h[0],u[0]),c[1]+=E1.parsePercent(h[1],u[1])}var d=e.get("symbolRotate");return n.rotation=(d||0)*Math.PI/180||0,r.attr(n),r.updateTransform(),r}function k1(e,t,i,n,r){if(!e.dragging){var a=n.getModel("checkpointStyle"),o=i.dataToCoord(n.getData().get(["value"],t));r||!a.get("animation",!0)?e.attr({position:[o,0]}):(e.stopAnimation(!0),e.animateTo({position:[o,0]},a.get("animationDuration",!0),a.get("animationEasing",!0)))}}A1.extend({type:"timeline.slider",init:function(e,t){this.api=t,this._axis,this._viewRect,this._timer,this._currentPointer,this._mainGroup,this._labelGroup},render:function(e,t,i,n){if(this.model=e,this.api=i,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var r=this._layout(e,i),a=this._createGroup("mainGroup"),o=this._createGroup("labelGroup"),s=this._axis=this._createAxis(r,e);e.formatTooltip=function(e){return L1(s.scale.getLabel(e))},N1(["AxisLine","AxisTick","Control","CurrentPointer"],(function(t){this["_render"+t](r,a,s,e)}),this),this._renderAxisLabel(r,o,s,e),this._position(r,e)}this._doPlayStop()},remove:function(){this._clearTimer(),this.group.removeAll()},dispose:function(){this._clearTimer()},_layout:function(e,t){var i=e.get("label.position"),n=e.get("orient"),r=function(e,t){return M1.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()},e.get("padding"))}(e,t);null==i||"auto"===i?i="horizontal"===n?r.y+r.height/2<t.getHeight()/2?"-":"+":r.x+r.width/2<t.getWidth()/2?"+":"-":isNaN(i)&&(i={horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[n][i]);var a,o,s,l,u={horizontal:"center",vertical:i>=0||"+"===i?"left":"right"},h={horizontal:i>=0||"+"===i?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:R1/2},d="vertical"===n?r.height:r.width,f=e.getModel("controlStyle"),p=f.get("show",!0),g=p?f.get("itemSize"):0,m=p?f.get("itemGap"):0,v=g+m,y=e.get("label.rotate")||0;y=y*R1/180;var _=f.get("position",!0),x=p&&f.get("showPlayBtn",!0),b=p&&f.get("showPrevBtn",!0),w=p&&f.get("showNextBtn",!0),T=0,S=d;return"left"===_||"bottom"===_?(x&&(a=[0,0],T+=v),b&&(o=[T,0],T+=v),w&&(s=[S-g,0],S-=v)):(x&&(a=[S-g,0],S-=v),b&&(o=[0,0],T+=v),w&&(s=[S-g,0],S-=v)),l=[T,S],e.get("inverse")&&l.reverse(),{viewRect:r,mainLength:d,orient:n,rotation:c[n],labelRotation:y,labelPosOpt:i,labelAlign:e.get("label.align")||u[n],labelBaseline:e.get("label.verticalAlign")||e.get("label.baseline")||h[n],playPosition:a,prevBtnPosition:o,nextBtnPosition:s,axisExtent:l,controlSize:g,controlGap:m}},_position:function(e,t){var i=this._mainGroup,n=this._labelGroup,r=e.viewRect;if("vertical"===e.orient){var a=T1.create(),o=r.x,s=r.y+r.height;T1.translate(a,a,[-o,-s]),T1.rotate(a,a,-R1/2),T1.translate(a,a,[o,s]),(r=r.clone()).applyTransform(a)}var l=m(r),u=m(i.getBoundingRect()),h=m(n.getBoundingRect()),c=i.position,d=n.position;d[0]=c[0]=l[0][0];var f,p=e.labelPosOpt;function g(e){var t=e.position;e.origin=[l[0][0]-t[0],l[1][0]-t[1]]}function m(e){return[[e.x,e.x+e.width],[e.y,e.y+e.height]]}function v(e,t,i,n,r){e[n]+=i[n][r]-t[n][r]}isNaN(p)?(v(c,u,l,1,f="+"===p?0:1),v(d,h,l,1,1-f)):(v(c,u,l,1,f=p>=0?0:1),d[1]=c[1]+p),i.attr("position",c),n.attr("position",d),i.rotation=n.rotation=e.rotation,g(i),g(n)},_createAxis:function(e,t){var i=t.getData(),n=t.get("axisType"),r=D1.createScaleByModel(t,n);r.getTicks=function(){return i.mapArray(["value"],(function(e){return e}))};var a=i.getDataExtent("value");r.setExtent(a[0],a[1]),r.niceTicks();var o=new I1("value",r,e.axisExtent,n);return o.model=t,o},_createGroup:function(e){var t=this["_"+e]=new S1.Group;return this.group.add(t),t},_renderAxisLine:function(e,t,i,n){var r=i.getExtent();n.get("lineStyle.show")&&t.add(new S1.Line({shape:{x1:r[0],y1:0,x2:r[1],y2:0},style:b1.extend({lineCap:"round"},n.getModel("lineStyle").getLineStyle()),silent:!0,z2:1}))},_renderAxisTick:function(e,t,i,n){var r=n.getData(),a=i.scale.getTicks();N1(a,(function(e){var a=i.dataToCoord(e),o=r.getItemModel(e),s=o.getModel("itemStyle"),l=o.getModel("emphasis.itemStyle"),u={position:[a,0],onclick:P1(this._changeTimeline,this,e)},h=O1(o,s,t,u);S1.setHoverStyle(h,l.getItemStyle()),o.get("tooltip")?(h.dataIndex=e,h.dataModel=n):h.dataIndex=h.dataModel=null}),this)},_renderAxisLabel:function(e,t,i,n){if(i.getLabelModel().get("show")){var r=n.getData(),a=i.getViewLabels();N1(a,(function(n){var a=n.tickValue,o=r.getItemModel(a),s=o.getModel("label"),l=o.getModel("emphasis.label"),u=i.dataToCoord(n.tickValue),h=new S1.Text({position:[u,0],rotation:e.labelRotation-e.rotation,onclick:P1(this._changeTimeline,this,a),silent:!1});S1.setTextStyle(h.style,s,{text:n.formattedLabel,textAlign:e.labelAlign,textVerticalAlign:e.labelBaseline}),t.add(h),S1.setHoverStyle(h,S1.setTextStyle({},l))}),this)}},_renderControl:function(e,t,i,n){var r=e.controlSize,a=e.rotation,o=n.getModel("controlStyle").getItemStyle(),s=n.getModel("emphasis.controlStyle").getItemStyle(),l=[0,-r/2,r,r],u=n.getPlayState(),h=n.get("inverse",!0);function c(e,i,u,h){if(e){var c=function(e,t,i,n){var r=n.style,a=S1.createIcon(e.get(t),n||{},new w1(i[0],i[1],i[2],i[3]));return r&&a.setStyle(r),a}(n,i,l,{position:e,origin:[r/2,0],rotation:h?-a:0,rectHover:!0,style:o,onclick:u});t.add(c),S1.setHoverStyle(c,s)}}c(e.nextBtnPosition,"controlStyle.nextIcon",P1(this._changeTimeline,this,h?"-":"+")),c(e.prevBtnPosition,"controlStyle.prevIcon",P1(this._changeTimeline,this,h?"+":"-")),c(e.playPosition,"controlStyle."+(u?"stopIcon":"playIcon"),P1(this._handlePlayClick,this,!u),!0)},_renderCurrentPointer:function(e,t,i,n){var r=n.getData(),a=n.getCurrentIndex(),o=r.getItemModel(a).getModel("checkpointStyle"),s=this,l={onCreate:function(e){e.draggable=!0,e.drift=P1(s._handlePointerDrag,s),e.ondragend=P1(s._handlePointerDragend,s),k1(e,a,i,n,!0)},onUpdate:function(e){k1(e,a,i,n)}};this._currentPointer=O1(o,o,this._mainGroup,{},this._currentPointer,l)},_handlePlayClick:function(e){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:e,from:this.uid})},_handlePointerDrag:function(e,t,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},_handlePointerDragend:function(e){this._pointerChangeTimeline([e.offsetX,e.offsetY],!0)},_pointerChangeTimeline:function(e,t){var i=this._toAxisCoord(e)[0],n=this._axis,r=E1.asc(n.getExtent().slice());i>r[1]&&(i=r[1]),i<r[0]&&(i=r[0]),this._currentPointer.position[0]=i,this._currentPointer.dirty();var a=this._findNearestTick(i),o=this.model;(t||a!==o.getCurrentIndex()&&o.get("realtime"))&&this._changeTimeline(a)},_doPlayStop:function(){this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout(P1((function(){var e=this.model;this._changeTimeline(e.getCurrentIndex()+(e.get("rewind",!0)?-1:1))}),this),this.model.get("playInterval")))},_toAxisCoord:function(e){var t=this._mainGroup.getLocalTransform();return S1.applyTransform(e,t,!0)},_findNearestTick:function(e){var t,i=this.model.getData(),n=1/0,r=this._axis;return i.each(["value"],(function(i,a){var o=r.dataToCoord(i),s=Math.abs(o-e);s<n&&(n=s,t=a)})),t},_clearTimer:function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},_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})}}),h.registerPreprocessor(s1);var z1=h,B1=g,F1=p,V1=lo,G1=qc,H1=Ig,U1=G1.addCommas,W1=G1.encodeHTML;function j1(e){V1.defaultEmphasis(e,"label",["show"])}var X1=z1.extendComponentModel({type:"marker",dependencies:["series","grid","polar","geo"],init:function(e,t,i){this.mergeDefaultAndTheme(e,i),this._mergeOption(e,i,!1,!0)},isAnimationEnabled:function(){if(F1.node)return!1;var e=this.__hostSeries;return this.getShallow("animation")&&e&&e.isAnimationEnabled()},mergeOption:function(e,t){this._mergeOption(e,t,!1,!1)},_mergeOption:function(e,t,i,n){var r=this.constructor,a=this.mainType+"Model";i||t.eachSeries((function(e){var i=e.get(this.mainType,!0),o=e[a];i&&i.data?(o?o._mergeOption(i,t,!0):(n&&j1(i),B1.each(i.data,(function(e){e instanceof Array?(j1(e[0]),j1(e[1])):j1(e)})),o=new r(i,this,t),B1.extend(o,{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),o.__hostSeries=e),e[a]=o):e[a]=null}),this)},formatTooltip:function(e,t,i,n){var r=this.getData(),a=this.getRawValue(e),o=B1.isArray(a)?B1.map(a,U1).join(", "):U1(a),s=r.getName(e),l=W1(this.name);return(null!=a||s)&&(l+="html"===n?"<br/>":"\n"),s&&(l+=W1(s),null!=a&&(l+=" : ")),null!=a&&(l+=W1(o)),l},getData:function(){return this._data},setData:function(e){this._data=e}});B1.mixin(X1,H1);var Z1=X1;Z1.extend({type:"markPoint",defaultOption:{zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}}});var q1={},Y1=g,K1=Uc,Q1=ex.isDimensionStacked,J1=Y1.indexOf;function $1(e,t,i,n,r,a){var o=[],s=Q1(t,n)?t.getCalculationInfo("stackResultDimension"):n,l=n2(t,s,e),u=t.indicesOfNearest(s,l)[0];o[r]=t.get(i,u),o[a]=t.get(s,u);var h=t.get(n,u),c=K1.getPrecision(t.get(n,u));return(c=Math.min(c,20))>=0&&(o[a]=+o[a].toFixed(c)),[o,h]}var e2=Y1.curry,t2={min:e2($1,"min"),max:e2($1,"max"),average:e2($1,"average")};function i2(e,t,i,n){var r={};return null!=e.valueIndex||null!=e.valueDim?(r.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,r.valueAxis=i.getAxis(function(e,t){var i=e.getData(),n=i.dimensions;t=i.getDimension(t);for(var r=0;r<n.length;r++){var a=i.getDimensionInfo(n[r]);if(a.name===t)return a.coordDim}}(n,r.valueDataDim)),r.baseAxis=i.getOtherAxis(r.valueAxis),r.baseDataDim=t.mapDimension(r.baseAxis.dim)):(r.baseAxis=n.getBaseAxis(),r.valueAxis=i.getOtherAxis(r.baseAxis),r.baseDataDim=t.mapDimension(r.baseAxis.dim),r.valueDataDim=t.mapDimension(r.valueAxis.dim)),r}function n2(e,t,i){if("average"===i){var n=0,r=0;return e.each(t,(function(e,t){isNaN(e)||(n+=e,r++)})),n/r}return"median"===i?e.getMedian(t):e.getDataExtent(t,!0)["max"===i?1:0]}q1.dataTransform=function(e,t){var i=e.getData(),n=e.coordinateSystem;if(t&&!function(e){return!isNaN(parseFloat(e.x))&&!isNaN(parseFloat(e.y))}(t)&&!Y1.isArray(t.coord)&&n){var r=n.dimensions,a=i2(t,i,n,e);if((t=Y1.clone(t)).type&&t2[t.type]&&a.baseAxis&&a.valueAxis){var o=J1(r,a.baseAxis.dim),s=J1(r,a.valueAxis.dim),l=t2[t.type](i,a.baseDataDim,a.valueDataDim,o,s);t.coord=l[0],t.value=l[1]}else{for(var u=[null!=t.xAxis?t.xAxis:t.radiusAxis,null!=t.yAxis?t.yAxis:t.angleAxis],h=0;h<2;h++)t2[u[h]]&&(u[h]=n2(i,i.mapDimension(r[h]),u[h]));t.coord=u}}return t},q1.getAxisInfo=i2,q1.dataFilter=function(e,t){return!(e&&e.containData&&t.coord&&!function(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}(t))||e.containData(t.coord)},q1.dimValueGetter=function(e,t,i,n){return n<2?e.coord&&e.coord[n]:e.value},q1.numCalculate=n2;var r2=g,a2=h.extendComponentView({type:"marker",init:function(){this.markerGroupMap=r2.createHashMap()},render:function(e,t,i){var n=this.markerGroupMap;n.each((function(e){e.__keep=!1}));var r=this.type+"Model";t.eachSeries((function(e){var n=e[r];n&&this.renderSeries(e,n,t,i)}),this),n.each((function(e){!e.__keep&&this.group.remove(e.group)}),this)},renderSeries:function(){}}),o2=g,s2=pS,l2=Uc,u2=A_,h2=q1;function c2(e,t,i){var n=t.coordinateSystem;e.each((function(r){var a,o=e.getItemModel(r),s=l2.parsePercent(o.get("x"),i.getWidth()),l=l2.parsePercent(o.get("y"),i.getHeight());if(isNaN(s)||isNaN(l)){if(t.getMarkerPosition)a=t.getMarkerPosition(e.getValues(e.dimensions,r));else if(n){var u=e.get(n.dimensions[0],r),h=e.get(n.dimensions[1],r);a=n.dataToPoint([u,h])}}else a=[s,l];isNaN(s)||(a[0]=s),isNaN(l)||(a[1]=l),e.setItemLayout(r,a)}))}a2.extend({type:"markPoint",updateTransform:function(e,t,i){t.eachSeries((function(e){var t=e.markPointModel;t&&(c2(t.getData(),e,i),this.markerGroupMap.get(e.id).updateLayout(t))}),this)},renderSeries:function(e,t,i,n){var r=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,new s2),u=function(e,t,i){var n;n=e?o2.map(e&&e.dimensions,(function(e){var i=t.getData().getDimensionInfo(t.getData().mapDimension(e))||{};return o2.defaults({name:e},i)})):[{name:"value",type:"float"}];var r=new u2(n,i),a=o2.map(i.get("data"),o2.curry(h2.dataTransform,t));return e&&(a=o2.filter(a,o2.curry(h2.dataFilter,e))),r.initData(a,null,e?h2.dimValueGetter:function(e){return e.value}),r}(r,e,t);t.setData(u),c2(t.getData(),e,n),u.each((function(e){var i=u.getItemModel(e),n=i.getShallow("symbol"),r=i.getShallow("symbolSize"),a=i.getShallow("symbolRotate"),s=o2.isFunction(n),l=o2.isFunction(r),h=o2.isFunction(a);if(s||l||h){var c=t.getRawValue(e),d=t.getDataParams(e);s&&(n=n(c,d)),l&&(r=r(c,d)),h&&(a=a(c,d))}u.setItemVisual(e,{symbol:n,symbolSize:r,symbolRotate:a,color:i.get("itemStyle.color")||o.getVisual("color")})})),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl((function(e){e.traverse((function(e){e.dataModel=t}))})),l.__keep=!0,l.group.silent=t.get("silent")||e.get("silent")}}),h.registerPreprocessor((function(e){e.markPoint=e.markPoint||{}})),Z1.extend({type:"markLine",defaultOption:{zlevel:0,z:5,symbol:["circle","arrow"],symbolSize:[8,16],precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"}});var d2=g,f2=A_,p2=Uc,g2=q1,m2=oz,v2=a2,y2=ex.getStackedDimension,_2=function(e,t,i,n){var r=e.getData(),a=n.type;if(!d2.isArray(n)&&("min"===a||"max"===a||"average"===a||"median"===a||null!=n.xAxis||null!=n.yAxis)){var o,s;if(null!=n.yAxis||null!=n.xAxis)o=t.getAxis(null!=n.yAxis?"y":"x"),s=d2.retrieve(n.yAxis,n.xAxis);else{var l=g2.getAxisInfo(n,r,t,e);o=l.valueAxis;var u=y2(r,l.valueDataDim);s=g2.numCalculate(r,u,a)}var h="x"===o.dim?0:1,c=1-h,d=d2.clone(n),f={};d.type=null,d.coord=[],f.coord=[],d.coord[c]=-1/0,f.coord[c]=1/0;var p=i.get("precision");p>=0&&"number"==typeof s&&(s=+s.toFixed(Math.min(p,20))),d.coord[h]=f.coord[h]=s,n=[d,f,{type:a,valueIndex:n.valueIndex,value:s}]}return(n=[g2.dataTransform(e,n[0]),g2.dataTransform(e,n[1]),d2.extend({},n[2])])[2].type=n[2].type||"",d2.merge(n[2],n[0]),d2.merge(n[2],n[1]),n};function x2(e){return!isNaN(e)&&!isFinite(e)}function b2(e,t,i,n){var r=1-e,a=n.dimensions[e];return x2(t[r])&&x2(i[r])&&t[e]===i[e]&&n.getAxis(a).containData(t[e])}function w2(e,t){if("cartesian2d"===e.type){var i=t[0].coord,n=t[1].coord;if(i&&n&&(b2(1,i,n,e)||b2(0,i,n,e)))return!0}return g2.dataFilter(e,t[0])&&g2.dataFilter(e,t[1])}function T2(e,t,i,n,r){var a,o=n.coordinateSystem,s=e.getItemModel(t),l=p2.parsePercent(s.get("x"),r.getWidth()),u=p2.parsePercent(s.get("y"),r.getHeight());if(isNaN(l)||isNaN(u)){if(n.getMarkerPosition)a=n.getMarkerPosition(e.getValues(e.dimensions,t));else{var h=o.dimensions,c=e.get(h[0],t),d=e.get(h[1],t);a=o.dataToPoint([c,d])}if("cartesian2d"===o.type){var f=o.getAxis("x"),p=o.getAxis("y");h=o.dimensions,x2(e.get(h[0],t))?a[0]=f.toGlobalCoord(f.getExtent()[i?0:1]):x2(e.get(h[1],t))&&(a[1]=p.toGlobalCoord(p.getExtent()[i?0:1]))}isNaN(l)||(a[0]=l),isNaN(u)||(a[1]=u)}else a=[l,u];e.setItemLayout(t,a)}v2.extend({type:"markLine",updateTransform:function(e,t,i){t.eachSeries((function(e){var t=e.markLineModel;if(t){var n=t.getData(),r=t.__from,a=t.__to;r.each((function(t){T2(r,t,!0,e,i),T2(a,t,!1,e,i)})),n.each((function(e){n.setItemLayout(e,[r.getItemLayout(e),a.getItemLayout(e)])})),this.markerGroupMap.get(e.id).updateLayout()}}),this)},renderSeries:function(e,t,i,n){var r=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,new m2);this.group.add(l.group);var u=function(e,t,i){var n;n=e?d2.map(e&&e.dimensions,(function(e){var i=t.getData().getDimensionInfo(t.getData().mapDimension(e))||{};return d2.defaults({name:e},i)})):[{name:"value",type:"float"}];var r=new f2(n,i),a=new f2(n,i),o=new f2([],i),s=d2.map(i.get("data"),d2.curry(_2,t,e,i));e&&(s=d2.filter(s,d2.curry(w2,e)));var l=e?g2.dimValueGetter:function(e){return e.value};return r.initData(d2.map(s,(function(e){return e[0]})),null,l),a.initData(d2.map(s,(function(e){return e[1]})),null,l),o.initData(d2.map(s,(function(e){return e[2]}))),o.hasItemOption=!0,{from:r,to:a,line:o}}(r,e,t),h=u.from,c=u.to,d=u.line;t.__from=h,t.__to=c,t.setData(d);var f=t.get("symbol"),p=t.get("symbolSize");function g(t,i,r){var a=t.getItemModel(i);T2(t,i,r,e,n),t.setItemVisual(i,{symbolRotate:a.get("symbolRotate"),symbolSize:a.get("symbolSize")||p[r?0:1],symbol:a.get("symbol",!0)||f[r?0:1],color:a.get("itemStyle.color")||o.getVisual("color")})}d2.isArray(f)||(f=[f,f]),"number"==typeof p&&(p=[p,p]),u.from.each((function(e){g(h,e,!0),g(c,e,!1)})),d.each((function(e){var t=d.getItemModel(e).get("lineStyle.color");d.setItemVisual(e,{color:t||h.getItemVisual(e,"color")}),d.setItemLayout(e,[h.getItemLayout(e),c.getItemLayout(e)]),d.setItemVisual(e,{fromSymbolRotate:h.getItemVisual(e,"symbolRotate"),fromSymbolSize:h.getItemVisual(e,"symbolSize"),fromSymbol:h.getItemVisual(e,"symbol"),toSymbolRotate:c.getItemVisual(e,"symbolRotate"),toSymbolSize:c.getItemVisual(e,"symbolSize"),toSymbol:c.getItemVisual(e,"symbol")})})),l.updateData(d),u.line.eachItemGraphicEl((function(e,i){e.traverse((function(e){e.dataModel=t}))})),l.__keep=!0,l.group.silent=t.get("silent")||e.get("silent")}}),h.registerPreprocessor((function(e){e.markLine=e.markLine||{}})),Z1.extend({type:"markArea",defaultOption:{zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}}});var S2=g,M2=ut,A2=A_,I2=Uc,C2=No,D2=q1,E2=function(e,t,i,n){var r=D2.dataTransform(e,n[0]),a=D2.dataTransform(e,n[1]),o=S2.retrieve,s=r.coord,l=a.coord;s[0]=o(s[0],-1/0),s[1]=o(s[1],-1/0),l[0]=o(l[0],1/0),l[1]=o(l[1],1/0);var u=S2.mergeAll([{},r,a]);return u.coord=[r.coord,a.coord],u.x0=r.x,u.y0=r.y,u.x1=a.x,u.y1=a.y,u};function L2(e){return!isNaN(e)&&!isFinite(e)}function P2(e,t,i,n){var r=1-e;return L2(t[r])&&L2(i[r])}function N2(e,t){var i=t.coord[0],n=t.coord[1];return!("cartesian2d"!==e.type||!i||!n||!P2(1,i,n)&&!P2(0,i,n))||D2.dataFilter(e,{coord:i,x:t.x0,y:t.y0})||D2.dataFilter(e,{coord:n,x:t.x1,y:t.y1})}function R2(e,t,i,n,r){var a,o=n.coordinateSystem,s=e.getItemModel(t),l=I2.parsePercent(s.get(i[0]),r.getWidth()),u=I2.parsePercent(s.get(i[1]),r.getHeight());if(isNaN(l)||isNaN(u)){if(n.getMarkerPosition)a=n.getMarkerPosition(e.getValues(i,t));else{var h=[f=e.get(i[0],t),p=e.get(i[1],t)];o.clampData&&o.clampData(h,h),a=o.dataToPoint(h,!0)}if("cartesian2d"===o.type){var c=o.getAxis("x"),d=o.getAxis("y"),f=e.get(i[0],t),p=e.get(i[1],t);L2(f)?a[0]=c.toGlobalCoord(c.getExtent()["x0"===i[0]?0:1]):L2(p)&&(a[1]=d.toGlobalCoord(d.getExtent()["y0"===i[1]?0:1]))}isNaN(l)||(a[0]=l),isNaN(u)||(a[1]=u)}else a=[l,u];return a}var O2=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];a2.extend({type:"markArea",updateTransform:function(e,t,i){t.eachSeries((function(e){var t=e.markAreaModel;if(t){var n=t.getData();n.each((function(t){var r=S2.map(O2,(function(r){return R2(n,t,r,e,i)}));n.setItemLayout(t,r),n.getItemGraphicEl(t).setShape("points",r)}))}}),this)},renderSeries:function(e,t,i,n){var r=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,{group:new C2.Group});this.group.add(l.group),l.__keep=!0;var u=function(e,t,i){var n,r,a=["x0","y0","x1","y1"];e?(n=S2.map(e&&e.dimensions,(function(e){var i=t.getData(),n=i.getDimensionInfo(i.mapDimension(e))||{};return S2.defaults({name:e},n)})),r=new A2(S2.map(a,(function(e,t){return{name:e,type:n[t%2].type}})),i)):r=new A2(n=[{name:"value",type:"float"}],i);var o=S2.map(i.get("data"),S2.curry(E2,t,e,i));e&&(o=S2.filter(o,S2.curry(N2,e)));var s=e?function(e,t,i,n){return e.coord[Math.floor(n/2)][n%2]}:function(e){return e.value};return r.initData(o,null,s),r.hasItemOption=!0,r}(r,e,t);t.setData(u),u.each((function(t){var i=S2.map(O2,(function(i){return R2(u,t,i,e,n)})),a=!0;S2.each(O2,(function(e){if(a){var i=u.get(e[0],t),n=u.get(e[1],t);(L2(i)||r.getAxis("x").containData(i))&&(L2(n)||r.getAxis("y").containData(n))&&(a=!1)}})),u.setItemLayout(t,{points:i,allClipped:a}),u.setItemVisual(t,{color:o.getVisual("color")})})),u.diff(l.__data).add((function(e){var t=u.getItemLayout(e);if(!t.allClipped){var i=new C2.Polygon({shape:{points:t.points}});u.setItemGraphicEl(e,i),l.group.add(i)}})).update((function(e,i){var n=l.__data.getItemGraphicEl(i),r=u.getItemLayout(e);r.allClipped?n&&l.group.remove(n):(n?C2.updateProps(n,{shape:{points:r.points}},t,e):n=new C2.Polygon({shape:{points:r.points}}),u.setItemGraphicEl(e,n),l.group.add(n))})).remove((function(e){var t=l.__data.getItemGraphicEl(e);l.group.remove(t)})).execute(),u.eachItemGraphicEl((function(e,i){var n=u.getItemModel(i),r=n.getModel("label"),a=n.getModel("emphasis.label"),o=u.getItemVisual(i,"color");e.useStyle(S2.defaults(n.getModel("itemStyle").getItemStyle(),{fill:M2.modifyAlpha(o,.4),stroke:o})),e.hoverStyle=n.getModel("emphasis.itemStyle").getItemStyle(),C2.setLabelStyle(e.style,e.hoverStyle,r,a,{labelFetcher:t,labelDataIndex:i,defaultText:u.getName(i)||"",isRectText:!0,autoColor:o}),C2.setHoverStyle(e,{}),e.dataModel=t})),l.__data=u,l.group.silent=t.get("silent")||e.get("silent")}}),h.registerPreprocessor((function(e){e.markArea=e.markArea||{}}));var k2=h,z2=g,B2=zc,F2=lo.isNameSpecified,V2=jm.legend.selector,G2={all:{type:"all",title:z2.clone(V2.all)},inverse:{type:"inverse",title:z2.clone(V2.inverse)}},H2=k2.extendComponentModel({type:"legend.plain",dependencies:["series"],layoutMode:{type:"box",ignoreSize:!0},init:function(e,t,i){this.mergeDefaultAndTheme(e,i),e.selected=e.selected||{},this._updateSelector(e)},mergeOption:function(e){H2.superCall(this,"mergeOption",e),this._updateSelector(e)},_updateSelector:function(e){var t=e.selector;!0===t&&(t=e.selector=["all","inverse"]),z2.isArray(t)&&z2.each(t,(function(e,i){z2.isString(e)&&(e={type:e}),t[i]=z2.merge(e,G2[e.type])}))},optionUpdated:function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&"single"===this.get("selectedMode")){for(var t=!1,i=0;i<e.length;i++){var n=e[i].get("name");if(this.isSelected(n)){this.select(n),t=!0;break}}!t&&this.select(e[0].get("name"))}},_updateData:function(e){var t=[],i=[];e.eachRawSeries((function(n){var r,a=n.name;if(i.push(a),n.legendVisualProvider){var o=n.legendVisualProvider.getAllNames();e.isSeriesFiltered(n)||(i=i.concat(o)),o.length?t=t.concat(o):r=!0}else r=!0;r&&F2(n)&&t.push(n.name)})),this._availableNames=i;var n=this.get("data")||t,r=z2.map(n,(function(e){return"string"!=typeof e&&"number"!=typeof e||(e={name:e}),new B2(e,this,this.ecModel)}),this);this._data=r},getData:function(){return this._data},select:function(e){var t=this.option.selected;if("single"===this.get("selectedMode")){var i=this._data;z2.each(i,(function(e){t[e.get("name")]=!1}))}t[e]=!0},unSelect:function(e){"single"!==this.get("selectedMode")&&(this.option.selected[e]=!1)},toggleSelected:function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?"unSelect":"select"](e)},allSelect:function(){var e=this._data,t=this.option.selected;z2.each(e,(function(e){t[e.get("name",!0)]=!0}))},inverseSelect:function(){var e=this._data,t=this.option.selected;z2.each(e,(function(e){var i=e.get("name",!0);t.hasOwnProperty(i)||(t[i]=!0),t[i]=!t[i]}))},isSelected:function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&&z2.indexOf(this._availableNames,e)>=0},getOrient:function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},defaultOption:{zlevel:0,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,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",itemStyle:{borderWidth:0},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}}}),U2=H2,W2=h,j2=g;function X2(e,t,i){var n,r={},a="toggleSelected"===e;return i.eachComponent("legend",(function(i){a&&null!=n?i[n?"select":"unSelect"](t.name):"allSelect"===e||"inverseSelect"===e?i[e]():(i[e](t.name),n=i.isSelected(t.name));var o=i.getData();j2.each(o,(function(e){var t=e.get("name");if("\n"!==t&&""!==t){var n=i.isSelected(t);r.hasOwnProperty(t)?r[t]=r[t]&&n:r[t]=n}}))})),"allSelect"===e||"inverseSelect"===e?{selected:r}:{name:t.name,selected:r}}W2.registerAction("legendToggleSelect","legendselectchanged",j2.curry(X2,"toggleSelected")),W2.registerAction("legendAllSelect","legendselectall",j2.curry(X2,"allSelect")),W2.registerAction("legendInverseSelect","legendinverseselect",j2.curry(X2,"inverseSelect")),W2.registerAction("legendSelect","legendselected",j2.curry(X2,"select")),W2.registerAction("legendUnSelect","legendunselected",j2.curry(X2,"unSelect"));var Z2=h,q2=g,Y2=ow.createSymbol,K2=No,Q2=lQ.makeBackground,J2=Hc,$2=q2.curry,e3=q2.each,t3=K2.Group,i3=Z2.extendComponentView({type:"legend.plain",newlineDisabled:!1,init:function(){this.group.add(this._contentGroup=new t3),this._backgroundEl,this.group.add(this._selectorGroup=new t3),this._isFirstRender=!0},getContentGroup:function(){return this._contentGroup},getSelectorGroup:function(){return this._selectorGroup},render:function(e,t,i){var n=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var r=e.get("align"),a=e.get("orient");r&&"auto"!==r||(r="right"===e.get("left")&&"vertical"===a?"right":"left");var o=e.get("selector",!0),s=e.get("selectorPosition",!0);!o||s&&"auto"!==s||(s="horizontal"===a?"end":"start"),this.renderInner(r,e,t,i,o,a,s);var l=e.getBoxLayoutParams(),u={width:i.getWidth(),height:i.getHeight()},h=e.get("padding"),c=J2.getLayoutRect(l,u,h),d=this.layoutInner(e,r,c,n,o,s),f=J2.getLayoutRect(q2.defaults({width:d.width,height:d.height},l),u,h);this.group.attr("position",[f.x-d.x,f.y-d.y]),this.group.add(this._backgroundEl=Q2(d,e))}},resetInner:function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},renderInner:function(e,t,i,n,r,a,o){var s=this.getContentGroup(),l=q2.createHashMap(),u=t.get("selectedMode"),h=[];i.eachRawSeries((function(e){!e.get("legendHoverLink")&&h.push(e.id)})),e3(t.getData(),(function(r,a){var o=r.get("name");if(this.newlineDisabled||""!==o&&"\n"!==o){var c=i.getSeriesByName(o)[0];if(!l.get(o))if(c){var d=c.getData(),f=d.getVisual("color"),p=d.getVisual("borderColor");"function"==typeof f&&(f=f(c.getDataParams(0))),"function"==typeof p&&(p=p(c.getDataParams(0)));var g=d.getVisual("legendSymbol")||"roundRect",m=d.getVisual("symbol");this._createItem(o,a,r,t,g,m,e,f,p,u).on("click",$2(r3,o,null,n,h)).on("mouseover",$2(a3,c.name,null,n,h)).on("mouseout",$2(o3,c.name,null,n,h)),l.set(o,!0)}else i.eachRawSeries((function(i){if(!l.get(o)&&i.legendVisualProvider){var s=i.legendVisualProvider;if(!s.containName(o))return;var c=s.indexOfName(o),d=s.getItemVisual(c,"color"),f=s.getItemVisual(c,"borderColor");this._createItem(o,a,r,t,"roundRect",null,e,d,f,u).on("click",$2(r3,null,o,n,h)).on("mouseover",$2(a3,null,o,n,h)).on("mouseout",$2(o3,null,o,n,h)),l.set(o,!0)}}),this)}else s.add(new t3({newline:!0}))}),this),r&&this._createSelector(r,t,n,a,o)},_createSelector:function(e,t,i,n,r){var a=this.getSelectorGroup();e3(e,(function(e){!function(e){var n=e.type,r=new K2.Text({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:"all"===n?"legendAllSelect":"legendInverseSelect"})}});a.add(r);var o=t.getModel("selectorLabel"),s=t.getModel("emphasis.selectorLabel");K2.setLabelStyle(r.style,r.hoverStyle={},o,s,{defaultText:e.title,isRectText:!1}),K2.setHoverStyle(r)}(e)}))},_createItem:function(e,t,i,n,r,a,o,s,l,u){var h=n.get("itemWidth"),c=n.get("itemHeight"),d=n.get("inactiveColor"),f=n.get("inactiveBorderColor"),p=n.get("symbolKeepAspect"),g=n.getModel("itemStyle"),m=n.isSelected(e),v=new t3,y=i.getModel("textStyle"),_=i.get("icon"),x=i.getModel("tooltip"),b=x.parentModel,w=Y2(r=_||r,0,0,h,c,m?s:d,null==p||p);if(v.add(n3(w,r,g,l,f,m)),!_&&a&&(a!==r||"none"===a)){var T=.8*c;"none"===a&&(a="circle");var S=Y2(a,(h-T)/2,(c-T)/2,T,T,m?s:d,null==p||p);v.add(n3(S,a,g,l,f,m))}var M="left"===o?h+5:-5,A=o,I=n.get("formatter"),C=e;"string"==typeof I&&I?C=I.replace("{name}",null!=e?e:""):"function"==typeof I&&(C=I(e)),v.add(new K2.Text({style:K2.setTextStyle({},y,{text:C,x:M,y:c/2,textFill:m?y.getTextColor():d,textAlign:A,textVerticalAlign:"middle"})}));var D=new K2.Rect({shape:v.getBoundingRect(),invisible:!0,tooltip:x.get("show")?q2.extend({content:e,formatter:b.get("formatter",!0)||function(){return e},formatterParams:{componentType:"legend",legendIndex:n.componentIndex,name:e,$vars:["name"]}},x.option):null});return v.add(D),v.eachChild((function(e){e.silent=!0})),D.silent=!u,this.getContentGroup().add(v),K2.setHoverStyle(v),v.__legendDataIndex=t,v},layoutInner:function(e,t,i,n,r,a){var o=this.getContentGroup(),s=this.getSelectorGroup();J2.box(e.get("orient"),o,e.get("itemGap"),i.width,i.height);var l=o.getBoundingRect(),u=[-l.x,-l.y];if(r){J2.box("horizontal",s,e.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],d=e.get("selectorButtonGap",!0),f=e.getOrient().index,p=0===f?"width":"height",g=0===f?"height":"width",m=0===f?"y":"x";"end"===a?c[f]+=l[p]+d:u[f]+=h[p]+d,c[1-f]+=l[g]/2-h[g]/2,s.attr("position",c),o.attr("position",u);var v={x:0,y:0};return v[p]=l[p]+d+h[p],v[g]=Math.max(l[g],h[g]),v[m]=Math.min(0,h[m]+c[1-f]),v}return o.attr("position",u),this.group.getBoundingRect()},remove:function(){this.getContentGroup().removeAll(),this._isFirstRender=!0}});function n3(e,t,i,n,r,a){var o;return"line"!==t&&t.indexOf("empty")<0?(o=i.getItemStyle(),e.style.stroke=n,a||(o.stroke=r)):o=i.getItemStyle(["borderWidth","borderColor"]),e.setStyle(o)}function r3(e,t,i,n){o3(e,t,i,n),i.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),a3(e,t,i,n)}function a3(e,t,i,n){var r=i.getZr().storage.getDisplayList()[0];r&&r.useHoverLayer||i.dispatchAction({type:"highlight",seriesName:e,name:t,excludeSeriesId:n})}function o3(e,t,i,n){var r=i.getZr().storage.getDisplayList()[0];r&&r.useHoverLayer||i.dispatchAction({type:"downplay",seriesName:e,name:t,excludeSeriesId:n})}var s3=i3,l3=function(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.filterSeries((function(e){for(var i=0;i<t.length;i++)if(!t[i].isSelected(e.name))return!1;return!0}))},u3=h,h3=l3,c3=Ld;u3.registerProcessor(u3.PRIORITY.PROCESSOR.SERIES_FILTER,h3),c3.registerSubTypeDefaulter("legend",(function(){return"plain"}));var d3=U2,f3=Hc,p3=f3.mergeLayoutParam,g3=f3.getLayoutParams,m3=d3.extend({type:"legend.scroll",setScrollDataIndex:function(e){this.option.scrollDataIndex=e},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},init:function(e,t,i,n){var r=g3(e);m3.superCall(this,"init",e,t,i,n),v3(this,e,r)},mergeOption:function(e,t){m3.superCall(this,"mergeOption",e,t),v3(this,this.option,e)}});function v3(e,t,i){var n=[1,1];n[e.getOrient().index]=0,p3(t,i,{type:"box",ignoreSize:n})}var y3=g,_3=No,x3=Hc,b3=s3,w3=_3.Group,T3=["width","height"],S3=["x","y"],M3=b3.extend({type:"legend.scroll",newlineDisabled:!0,init:function(){M3.superCall(this,"init"),this._currentIndex=0,this.group.add(this._containerGroup=new w3),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new w3),this._showController},resetInner:function(){M3.superCall(this,"resetInner"),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},renderInner:function(e,t,i,n,r,a,o){var s=this;M3.superCall(this,"renderInner",e,t,i,n,r,a,o);var l=this._controllerGroup,u=t.get("pageIconSize",!0);y3.isArray(u)||(u=[u,u]),c("pagePrev",0);var h=t.getModel("pageTextStyle");function c(e,i){var r=e+"DataIndex",a=_3.createIcon(t.get("pageIcons",!0)[t.getOrient().name][i],{onclick:y3.bind(s._pageGo,s,r,t,n)},{x:-u[0]/2,y:-u[1]/2,width:u[0],height:u[1]});a.name=e,l.add(a)}l.add(new _3.Text({name:"pageText",style:{textFill:h.getTextColor(),font:h.getFont(),textVerticalAlign:"middle",textAlign:"center"},silent:!0})),c("pageNext",1)},layoutInner:function(e,t,i,n,r,a){var o=this.getSelectorGroup(),s=e.getOrient().index,l=T3[s],u=S3[s],h=T3[1-s],c=S3[1-s];r&&x3.box("horizontal",o,e.get("selectorItemGap",!0));var d=e.get("selectorButtonGap",!0),f=o.getBoundingRect(),p=[-f.x,-f.y],g=y3.clone(i);r&&(g[l]=i[l]-f[l]-d);var m=this._layoutContentAndController(e,n,g,s,l,h,c);if(r){if("end"===a)p[s]+=m[l]+d;else{var v=f[l]+d;p[s]-=v,m[u]-=v}m[l]+=f[l]+d,p[1-s]+=m[c]+m[h]/2-f[h]/2,m[h]=Math.max(m[h],f[h]),m[c]=Math.min(m[c],f[c]+p[1-s]),o.attr("position",p)}return m},_layoutContentAndController:function(e,t,i,n,r,a,o){var s=this.getContentGroup(),l=this._containerGroup,u=this._controllerGroup;x3.box(e.get("orient"),s,e.get("itemGap"),n?i.width:null,n?null:i.height),x3.box("horizontal",u,e.get("pageButtonItemGap",!0));var h=s.getBoundingRect(),c=u.getBoundingRect(),d=this._showController=h[r]>i[r],f=[-h.x,-h.y];t||(f[n]=s.position[n]);var p=[0,0],g=[-c.x,-c.y],m=y3.retrieve2(e.get("pageButtonGap",!0),e.get("itemGap",!0));d&&("end"===e.get("pageButtonPosition",!0)?g[n]+=i[r]-c[r]:p[n]+=c[r]+m),g[1-n]+=h[a]/2-c[a]/2,s.attr("position",f),l.attr("position",p),u.attr("position",g);var v={x:0,y:0};if(v[r]=d?i[r]:h[r],v[a]=Math.max(h[a],c[a]),v[o]=Math.min(0,c[o]+g[1-n]),l.__rectSize=i[r],d){var y={x:0,y:0};y[r]=Math.max(i[r]-c[r]-m,0),y[a]=v[a],l.setClipPath(new _3.Rect({shape:y})),l.__rectSize=y[r]}else u.eachChild((function(e){e.attr({invisible:!0,silent:!0})}));var _=this._getPageInfo(e);return null!=_.pageIndex&&_3.updateProps(s,{position:_.contentPosition},!!d&&e),this._updatePageInfoView(e,_),v},_pageGo:function(e,t,i){var n=this._getPageInfo(t)[e];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:t.id})},_updatePageInfoView:function(e,t){var i=this._controllerGroup;y3.each(["pagePrev","pageNext"],(function(n){var r=null!=t[n+"DataIndex"],a=i.childOfName(n);a&&(a.setStyle("fill",r?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),a.cursor=r?"pointer":"default")}));var n=i.childOfName("pageText"),r=e.get("pageFormatter"),a=t.pageIndex,o=null!=a?a+1:0,s=t.pageCount;n&&r&&n.setStyle("text",y3.isString(r)?r.replace("{current}",o).replace("{total}",s):r({current:o,total:s}))},_getPageInfo:function(e){var t=e.get("scrollDataIndex",!0),i=this.getContentGroup(),n=this._containerGroup.__rectSize,r=e.getOrient().index,a=T3[r],o=S3[r],s=this._findTargetItemIndex(t),l=i.children(),u=l[s],h=l.length,c=h?1:0,d={contentPosition:i.position.slice(),pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var f=y(u);d.contentPosition[r]=-f.s;for(var p=s+1,g=f,m=f,v=null;p<=h;++p)(!(v=y(l[p]))&&m.e>g.s+n||v&&!_(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(p=s-1,g=f,m=f,v=null;p>=-1;--p)(v=y(l[p]))&&_(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(),i=t[o]+e.position[r];return{s:i,e:i+t[a],i:e.__legendDataIndex}}}function _(e,t){return e.e>=t&&e.s<=t+n}},_findTargetItemIndex:function(e){return this._showController?(this.getContentGroup().eachChild((function(n,r){var a=n.__legendDataIndex;null==i&&null!=a&&(i=r),a===e&&(t=r)})),null!=t?t:i):0;var t,i}});h.registerAction("legendScroll","legendscroll",(function(e,t){var i=e.scrollDataIndex;null!=i&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},(function(e){e.setScrollDataIndex(i)}))})),jJ.extend({type:"dataZoom.slider",layoutMode:"box",defaultOption:{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#2f4554",width:.5,opacity:.3},areaStyle:{color:"rgba(47,69,84,0.3)",opacity:.3}},borderColor:"#ddd",fillerColor:"rgba(167,183,204,0.4)",handleIcon:"M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",handleSize:"100%",handleStyle:{color:"#a7b7cc"},labelPrecision:null,labelFormatter:null,showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#333"}}});var A3=g,I3=ne,C3=No,D3=km,E3=ZJ,L3=Uc,P3=Hc,N3=wF,R3=C3.Rect,O3=L3.linearMap,k3=L3.asc,z3=A3.bind,B3=A3.each,F3="horizontal",V3="vertical",G3=["line","bar","candlestick","scatter"],H3=E3.extend({type:"dataZoom.slider",init:function(e,t){this._displayables={},this._orient,this._range,this._handleEnds,this._size,this._handleWidth,this._handleHeight,this._location,this._dragging,this._dataShadowInfo,this.api=t},render:function(e,t,i,n){H3.superApply(this,"render",arguments),D3.createOrUpdate(this,"_dispatchZoomAction",this.dataZoomModel.get("throttle"),"fixRate"),this._orient=e.get("orient"),!1!==this.dataZoomModel.get("show")?(n&&"dataZoom"===n.type&&n.from===this.uid||this._buildView(),this._updateView()):this.group.removeAll()},remove:function(){H3.superApply(this,"remove",arguments),D3.clear(this,"_dispatchZoomAction")},dispose:function(){H3.superApply(this,"dispose",arguments),D3.clear(this,"_dispatchZoomAction")},_buildView:function(){var e=this.group;e.removeAll(),this._resetLocation(),this._resetInterval();var t=this._displayables.barGroup=new C3.Group;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},_resetLocation:function(){var e=this.dataZoomModel,t=this.api,i=this._findCoordRect(),n={width:t.getWidth(),height:t.getHeight()},r=this._orient===F3?{right:n.width-i.x-i.width,top:n.height-30-7,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},a=P3.getLayoutParams(e.option);A3.each(["right","top","width","height"],(function(e){"ph"===a[e]&&(a[e]=r[e])}));var o=P3.getLayoutRect(a,n,e.padding);this._location={x:o.x,y:o.y},this._size=[o.width,o.height],this._orient===V3&&this._size.reverse()},_positionGroup:function(){var e=this.group,t=this._location,i=this._orient,n=this.dataZoomModel.getFirstTargetAxisModel(),r=n&&n.get("inverse"),a=this._displayables.barGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(i!==F3||r?i===F3&&r?{scale:o?[-1,1]:[-1,-1]}:i!==V3||r?{scale:o?[-1,-1]:[-1,1],rotation:Math.PI/2}:{scale:o?[1,-1]:[1,1],rotation:Math.PI/2}:{scale:o?[1,1]:[1,-1]});var s=e.getBoundingRect([a]);e.attr("position",[t.x-s.x,t.y-s.y])},_getViewExtent:function(){return[0,this._size[0]]},_renderBackground:function(){var e=this.dataZoomModel,t=this._size,i=this._displayables.barGroup;i.add(new R3({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40})),i.add(new R3({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:A3.bind(this._onClickPanelClick,this)}))},_renderDataShadow:function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(e){var t=this._size,i=e.series,n=i.getRawData(),r=i.getShadowDim?i.getShadowDim():e.otherDim;if(null!=r){var a=n.getDataExtent(r),o=.3*(a[1]-a[0]);a=[a[0]-o,a[1]+o];var s,l=[0,t[1]],u=[0,t[0]],h=[[t[0],0],[0,0]],c=[],d=u[1]/(n.count()-1),f=0,p=Math.round(n.count()/t[0]);n.each([r],(function(e,t){if(p>0&&t%p)f+=d;else{var i=null==e||isNaN(e)||""===e,n=i?0:O3(e,a,l,!0);i&&!s&&t?(h.push([h[h.length-1][0],0]),c.push([c[c.length-1][0],0])):!i&&s&&(h.push([f,0]),c.push([f,0])),h.push([f,n]),c.push([f,n]),f+=d,s=i}}));var g=this.dataZoomModel;this._displayables.barGroup.add(new C3.Polygon({shape:{points:h},style:A3.defaults({fill:g.get("dataBackgroundColor")},g.getModel("dataBackground.areaStyle").getAreaStyle()),silent:!0,z2:-20})),this._displayables.barGroup.add(new C3.Polyline({shape:{points:c},style:g.getModel("dataBackground.lineStyle").getLineStyle(),silent:!0,z2:-19}))}}},_prepareDataShadowInfo:function(){var e=this.dataZoomModel,t=e.get("showDataShadow");if(!1!==t){var i,n=this.ecModel;return e.eachTargetAxis((function(r,a){var o=e.getAxisProxy(r.name,a).getTargetSeriesModels();A3.each(o,(function(e){if(!(i||!0!==t&&A3.indexOf(G3,e.get("type"))<0)){var o,s=n.getComponent(r.axis,a).axis,l={x:"y",y:"x",radius:"angle",angle:"radius"}[r.name],u=e.coordinateSystem;null!=l&&u.getOtherAxis&&(o=u.getOtherAxis(s).inverse),l=e.getData().mapDimension(l),i={thisAxis:s,series:e,thisDim:r.name,otherDim:l,otherAxisInverse:o}}}),this)}),this),i}},_renderHandle:function(){var e=this._displayables,t=e.handles=[],i=e.handleLabels=[],n=this._displayables.barGroup,r=this._size,a=this.dataZoomModel;n.add(e.filler=new R3({draggable:!0,cursor:U3(this._orient),drift:z3(this._onDragMove,this,"all"),ondragstart:z3(this._showDataInfo,this,!0),ondragend:z3(this._onDragEnd,this),onmouseover:z3(this._showDataInfo,this,!0),onmouseout:z3(this._showDataInfo,this,!1),style:{fill:a.get("fillerColor"),textPosition:"inside"}})),n.add(new R3({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:r[0],height:r[1]},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),B3([0,1],(function(e){var r=C3.createIcon(a.get("handleIcon"),{cursor:U3(this._orient),draggable:!0,drift:z3(this._onDragMove,this,e),ondragend:z3(this._onDragEnd,this),onmouseover:z3(this._showDataInfo,this,!0),onmouseout:z3(this._showDataInfo,this,!1)},{x:-1,y:0,width:2,height:2}),o=r.getBoundingRect();this._handleHeight=L3.parsePercent(a.get("handleSize"),this._size[1]),this._handleWidth=o.width/o.height*this._handleHeight,r.setStyle(a.getModel("handleStyle").getItemStyle());var s=a.get("handleColor");null!=s&&(r.style.fill=s),n.add(t[e]=r);var l=a.textStyleModel;this.group.add(i[e]=new C3.Text({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textVerticalAlign:"middle",textAlign:"center",textFill:l.getTextColor(),textFont:l.getFont()},z2:10}))}),this)},_resetInterval:function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[O3(e[0],[0,100],t,!0),O3(e[1],[0,100],t,!0)]},_updateInterval:function(e,t){var i=this.dataZoomModel,n=this._handleEnds,r=this._getViewExtent(),a=i.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];N3(t,n,r,i.get("zoomLock")?"all":e,null!=a.minSpan?O3(a.minSpan,o,r,!0):null,null!=a.maxSpan?O3(a.maxSpan,o,r,!0):null);var s=this._range,l=this._range=k3([O3(n[0],r,o,!0),O3(n[1],r,o,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},_updateView:function(e){var t=this._displayables,i=this._handleEnds,n=k3(i.slice()),r=this._size;B3([0,1],(function(e){var n=t.handles[e],a=this._handleHeight;n.attr({scale:[a/2,a/2],position:[i[e],r[1]/2-a/2]})}),this),t.filler.setShape({x:n[0],y:0,width:n[1]-n[0],height:r[1]}),this._updateDataInfo(e)},_updateDataInfo:function(e){var t=this.dataZoomModel,i=this._displayables,n=i.handleLabels,r=this._orient,a=["",""];if(t.get("showDetail")){var o=t.findRepresentativeAxisProxy();if(o){var s=o.getAxisModel().axis,l=this._range,u=e?o.calculateDataWindow({start:l[0],end:l[1]}).valueWindow:o.getDataValueWindow();a=[this._formatLabel(u[0],s),this._formatLabel(u[1],s)]}}var h=k3(this._handleEnds.slice());function c(e){var t=C3.getTransform(i.handles[e].parent,this.group),o=C3.transformDirection(0===e?"right":"left",t),s=this._handleWidth/2+5,l=C3.applyTransform([h[e]+(0===e?-s:s),this._size[1]/2],t);n[e].setStyle({x:l[0],y:l[1],textVerticalAlign:r===F3?"middle":o,textAlign:r===F3?o:"center",text:a[e]})}c.call(this,0),c.call(this,1)},_formatLabel:function(e,t){var i=this.dataZoomModel,n=i.get("labelFormatter"),r=i.get("labelPrecision");null!=r&&"auto"!==r||(r=t.getPixelPrecision());var a=null==e||isNaN(e)?"":"category"===t.type||"time"===t.type?t.scale.getLabel(Math.round(e)):e.toFixed(Math.min(r,20));return A3.isFunction(n)?n(e,a):A3.isString(n)?n.replace("{value}",a):a},_showDataInfo:function(e){e=this._dragging||e;var t=this._displayables.handleLabels;t[0].attr("invisible",!e),t[1].attr("invisible",!e)},_onDragMove:function(e,t,i,n){this._dragging=!0,I3.stop(n.event);var r=this._displayables.barGroup.getLocalTransform(),a=C3.applyTransform([t,i],r,!0),o=this._updateInterval(e,a[0]),s=this.dataZoomModel.get("realtime");this._updateView(!s),o&&s&&this._dispatchZoomAction()},_onDragEnd:function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction()},_onClickPanelClick:function(e){var t=this._size,i=this._displayables.barGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(i[0]<0||i[0]>t[0]||i[1]<0||i[1]>t[1])){var n=this._handleEnds,r=(n[0]+n[1])/2,a=this._updateInterval("all",i[0]-r);this._updateView(),a&&this._dispatchZoomAction()}},_dispatchZoomAction:function(){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:e[0],end:e[1]})},_findCoordRect:function(){var e;if(B3(this.getTargetCoordInfo(),(function(t){if(!e&&t.length){var i=t[0].model.coordinateSystem;e=i.getRect&&i.getRect()}})),!e){var t=this.api.getWidth(),i=this.api.getHeight();e={x:.2*t,y:.2*i,width:.6*t,height:.6*i}}return e}});function U3(e){return"vertical"===e?"ns-resize":"ew-resize"}jJ.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}});var W3={},j3=g,X3=kL,Z3=km,q3="\0_ec_dataZoom_roams";function Y3(e){var t=e.getZr();return t[q3]||(t[q3]={})}function K3(e){j3.each(e,(function(t,i){t.count||(t.controller.dispose(),delete e[i])}))}function Q3(e,t){e.dispatchAction({type:"dataZoom",batch:t})}W3.register=function(e,t){var i=Y3(e),n=t.dataZoomId,r=t.coordId;j3.each(i,(function(e,i){var a=e.dataZoomInfos;a[n]&&j3.indexOf(t.allCoordIds,r)<0&&(delete a[n],e.count--)})),K3(i);var a=i[r];a||((a=i[r]={coordId:r,dataZoomInfos:{},count:0}).controller=function(e,t){var i=new X3(e.getZr());return j3.each(["pan","zoom","scrollMove"],(function(e){i.on(e,(function(i){var n=[];j3.each(t.dataZoomInfos,(function(r){if(i.isAvailableBehavior(r.dataZoomModel.option)){var a=(r.getRange||{})[e],o=a&&a(t.controller,i);!r.dataZoomModel.get("disabled",!0)&&o&&n.push({dataZoomId:r.dataZoomId,start:o[0],end:o[1]})}})),n.length&&t.dispatchAction(n)}))})),i}(e,a),a.dispatchAction=j3.curry(Q3,e)),!a.dataZoomInfos[n]&&a.count++,a.dataZoomInfos[n]=t;var o,s,l,u,h,c=(o=a.dataZoomInfos,l="type_",u={type_true:2,type_move:1,type_false:0,type_undefined:-1},h=!0,j3.each(o,(function(e){var t=e.dataZoomModel,i=!t.get("disabled",!0)&&(!t.get("zoomLock",!0)||"move");u[l+i]>u[l+s]&&(s=i),h&=t.get("preventDefaultMouseMove",!0)})),{controlType:s,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!h}});a.controller.enable(c.controlType,c.opt),a.controller.setPointerChecker(t.containsPoint),Z3.createOrUpdate(a,"dispatchAction",t.dataZoomModel.get("throttle",!0),"fixRate")},W3.unregister=function(e,t){var i=Y3(e);j3.each(i,(function(e){e.controller.dispose();var i=e.dataZoomInfos;i[t]&&(delete i[t],e.count--)})),K3(i)},W3.generateCoordId=function(e){return e.type+"\0_"+e.id};var J3=g,$3=ZJ,e5=wF,t5=W3,i5=J3.bind,n5=$3.extend({type:"dataZoom.inside",init:function(e,t){this._range},render:function(e,t,i,n){n5.superApply(this,"render",arguments),this._range=e.getPercentRange(),J3.each(this.getTargetCoordInfo(),(function(t,n){var r=J3.map(t,(function(e){return t5.generateCoordId(e.model)}));J3.each(t,(function(t){var a=t.model,o={};J3.each(["pan","zoom","scrollMove"],(function(e){o[e]=i5(r5[e],this,t,n)}),this),t5.register(i,{coordId:t5.generateCoordId(a),allCoordIds:r,containsPoint:function(e,t,i){return a.coordinateSystem.containPoint([t,i])},dataZoomId:e.id,dataZoomModel:e,getRange:o})}),this)}),this)},dispose:function(){t5.unregister(this.api,this.dataZoomModel.id),n5.superApply(this,"dispose",arguments),this._range=null}}),r5={zoom:function(e,t,i,n){var r=this._range,a=r.slice(),o=e.axisModels[0];if(o){var s=o5[t](null,[n.originX,n.originY],o,i,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/n.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return e5(0,a,[0,100],0,h.minSpan,h.maxSpan),this._range=a,r[0]!==a[0]||r[1]!==a[1]?a:void 0}},pan:a5((function(e,t,i,n,r,a){var o=o5[n]([a.oldX,a.oldY],[a.newX,a.newY],t,r,i);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength})),scrollMove:a5((function(e,t,i,n,r,a){return o5[n]([0,0],[a.scrollDelta,a.scrollDelta],t,r,i).signal*(e[1]-e[0])*a.scrollDelta}))};function a5(e){return function(t,i,n,r){var a=this._range,o=a.slice(),s=t.axisModels[0];if(s){var l=e(o,s,t,i,n,r);return e5(l,o,[0,100],"all"),this._range=o,a[0]!==o[0]||a[1]!==o[1]?o:void 0}}}var o5={grid:function(e,t,i,n,r){var a=i.axis,o={},s=r.model.coordinateSystem.getRect();return e=e||[0,0],"x"===a.dim?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,i,n,r){var a=i.axis,o={},s=r.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),"radiusAxis"===i.mainType?(o.pixel=t[0]-e[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,i,n,r){var a=i.axis,o=r.model.coordinateSystem.getRect(),s={};return e=e||[0,0],"horizontal"===a.orient?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}},s5=g,l5=s5.each;function u5(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var h5=function(e){var t=e&&e.visualMap;s5.isArray(t)||(t=t?[t]:[]),l5(t,(function(e){if(e){u5(e,"splitList")&&!u5(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&s5.isArray(t)&&l5(t,(function(e){s5.isObject(e)&&(u5(e,"start")&&!u5(e,"min")&&(e.min=e.start),u5(e,"end")&&!u5(e,"max")&&(e.max=e.end))}))}}))};Ld.registerSubTypeDefaulter("visualMap",(function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"}));var c5=h,d5=g,f5=u0,p5=yO,g5=c5.PRIORITY.VISUAL.COMPONENT;function m5(e,t,i,n){for(var r=t.targetVisuals[n],a=p5.prepareVisualTypes(r),o={color:e.getData().getVisual("color")},s=0,l=a.length;s<l;s++){var u=a[s],h=r["opacity"===u?"__alphaForOpacity":u];h&&h.applyVisual(i,c,d)}return o.color;function c(e){return o[e]}function d(e,t){o[e]=t}}c5.registerVisual(g5,{createOnAllSeries:!0,reset:function(e,t){var i=[];return t.eachComponent("visualMap",(function(t){var n=e.pipelineContext;!t.isTargetSeries(e)||n&&n.large||i.push(f5.incrementalApplyVisual(t.stateList,t.targetVisuals,d5.bind(t.getValueState,t),t.getDataDimension(e.getData())))})),i}}),c5.registerVisual(g5,{createOnAllSeries:!0,reset:function(e,t){var i=e.getData(),n=[];t.eachComponent("visualMap",(function(t){if(t.isTargetSeries(e)){var r=t.getVisualMeta(d5.bind(m5,null,e,t))||{stops:[],outerColors:[]},a=t.getDataDimension(i),o=i.getDimensionInfo(a);null!=o&&(r.dimension=o.index,n.push(r))}})),e.getData().setVisual("visualMeta",n)}});var v5=g,y5={get:function(e,t,i){var n=v5.clone((_5[e]||{})[t]);return i&&v5.isArray(n)?n[n.length-1]:n}},_5={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]}},x5=y5,b5=h,w5=g,T5=p,S5=x5,M5=yO,A5=u0,I5=lo,C5=Uc,D5=M5.mapVisual,E5=M5.eachVisual,L5=w5.isArray,P5=w5.each,N5=C5.asc,R5=C5.linearMap,O5=w5.noop,k5=b5.extendComponentModel({type:"visualMap",dependencies:["series"],stateList:["inRange","outOfRange"],replacableOptionKeys:["inRange","outOfRange","target","controller","color"],dataBound:[-1/0,1/0],layoutMode:{type:"box",ignoreSize:!0},defaultOption:{show:!0,zlevel:0,z:4,seriesIndex:"all",min:0,max:200,dimension:null,inRange:null,outOfRange:null,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,color:null,formatter:null,text:null,textStyle:{color:"#333"}},init:function(e,t,i){this._dataExtent,this.targetVisuals={},this.controllerVisuals={},this.textStyleModel,this.itemSize,this.mergeDefaultAndTheme(e,i)},optionUpdated:function(e,t){var i=this.option;T5.canvasSupported||(i.realtime=!1),!t&&A5.replaceVisualOption(i,e,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},resetVisual:function(e){var t=this.stateList;e=w5.bind(e,this),this.controllerVisuals=A5.createVisualMappings(this.option.controller,t,e),this.targetVisuals=A5.createVisualMappings(this.option.target,t,e)},getTargetSeriesIndices:function(){var e=this.option.seriesIndex,t=[];return null==e||"all"===e?this.ecModel.eachSeries((function(e,i){t.push(i)})):t=I5.normalizeToArray(e),t},eachTargetSeries:function(e,t){w5.each(this.getTargetSeriesIndices(),(function(i){e.call(t,this.ecModel.getSeriesByIndex(i))}),this)},isTargetSeries:function(e){var t=!1;return this.eachTargetSeries((function(i){i===e&&(t=!0)})),t},formatValueText:function(e,t,i){var n,r,a=this.option,o=a.precision,s=this.dataBound,l=a.formatter;return i=i||["<",">"],w5.isArray(e)&&(e=e.slice(),n=!0),r=t?e:n?[u(e[0]),u(e[1])]:u(e),w5.isString(l)?l.replace("{value}",n?r[0]:r).replace("{value2}",n?r[1]:r):w5.isFunction(l)?n?l(e[0],e[1]):l(e):n?e[0]===s[0]?i[0]+" "+r[1]:e[1]===s[1]?i[1]+" "+r[0]:r[0]+" - "+r[1]:r;function u(e){return e===s[0]?"min":e===s[1]?"max":(+e).toFixed(Math.min(o,20))}},resetExtent:function(){var e=this.option,t=N5([e.min,e.max]);this._dataExtent=t},getDataDimension:function(e){var t=this.option.dimension,i=e.dimensions;if(null!=t||i.length){if(null!=t)return e.getDimension(t);for(var n=e.dimensions,r=n.length-1;r>=0;r--){var a=n[r];if(!e.getDimensionInfo(a).isCalculationCoord)return a}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){var e=this.ecModel,t=this.option,i={inRange:t.inRange,outOfRange:t.outOfRange},n=t.target||(t.target={}),r=t.controller||(t.controller={});w5.merge(n,i),w5.merge(r,i);var a=this.isCategory();function o(i){L5(t.color)&&!i.inRange&&(i.inRange={color:t.color.slice().reverse()}),i.inRange=i.inRange||{color:e.get("gradientColor")},P5(this.stateList,(function(e){var t=i[e];if(w5.isString(t)){var n=S5.get(t,"active",a);n?(i[e]={},i[e][t]=n):delete i[e]}}),this)}o.call(this,n),o.call(this,r),function(e,t,i){var n=e[t],r=e[i];n&&!r&&(r=e[i]={},P5(n,(function(e,t){if(M5.isValidType(t)){var i=S5.get(t,"inactive",a);null!=i&&(r[t]=i,"color"!==t||r.hasOwnProperty("opacity")||r.hasOwnProperty("colorAlpha")||(r.opacity=[0,0]))}})))}.call(this,n,"inRange","outOfRange"),function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,i=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,n=this.get("inactiveColor");P5(this.stateList,(function(r){var o=this.itemSize,s=e[r];s||(s=e[r]={color:a?n:[n]}),null==s.symbol&&(s.symbol=t&&w5.clone(t)||(a?"roundRect":["roundRect"])),null==s.symbolSize&&(s.symbolSize=i&&w5.clone(i)||(a?o[0]:[o[0],o[0]])),s.symbol=D5(s.symbol,(function(e){return"none"===e||"square"===e?"roundRect":e}));var l=s.symbolSize;if(null!=l){var u=-1/0;E5(l,(function(e){e>u&&(u=e)})),s.symbolSize=D5(l,(function(e){return R5(e,[0,u],[0,o[0]],!0)}))}}),this)}.call(this,r)},resetItemSize:function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},isCategory:function(){return!!this.option.categories},setSelected:O5,getValueState:O5,getVisualMeta:O5}),z5=k5,B5=g,F5=z5,V5=Uc,G5=[20,140],H5=F5.extend({type:"visualMap.continuous",defaultOption:{align:"auto",calculable:!1,range:null,realtime:!0,itemHeight:null,itemWidth:null,hoverLink:!0,hoverLinkDataSize:null,hoverLinkOnHandle:null},optionUpdated:function(e,t){H5.superApply(this,"optionUpdated",arguments),this.resetExtent(),this.resetVisual((function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()})),this._resetRange()},resetItemSize:function(){H5.superApply(this,"resetItemSize",arguments);var e=this.itemSize;"horizontal"===this._orient&&e.reverse(),(null==e[0]||isNaN(e[0]))&&(e[0]=G5[0]),(null==e[1]||isNaN(e[1]))&&(e[1]=G5[1])},_resetRange:function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):B5.isArray(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},completeVisualOption:function(){F5.prototype.completeVisualOption.apply(this,arguments),B5.each(this.stateList,(function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=0)}),this)},setSelected:function(e){this.option.range=e.slice(),this._resetRange()},getSelected:function(){var e=this.getExtent(),t=V5.asc((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},getValueState:function(e){var t=this.option.range,i=this.getExtent();return(t[0]<=i[0]||t[0]<=e)&&(t[1]>=i[1]||e<=t[1])?"inRange":"outOfRange"},findTargetDataIndices:function(e){var t=[];return this.eachTargetSeries((function(i){var n=[],r=i.getData();r.each(this.getDataDimension(r),(function(t,i){e[0]<=t&&t<=e[1]&&n.push(i)}),this),t.push({seriesId:i.id,dataIndex:n})}),this),t},getVisualMeta:function(e){var t=U5(0,0,this.getExtent()),i=U5(0,0,this.option.range.slice()),n=[];function r(t,i){n.push({value:t,color:e(t,i)})}for(var a=0,o=0,s=i.length,l=t.length;o<l&&(!i.length||t[o]<=i[0]);o++)t[o]<i[a]&&r(t[o],"outOfRange");for(var u=1;a<s;a++,u=0)u&&n.length&&r(i[a],"outOfRange"),r(i[a],"inRange");for(u=1;o<l;o++)(!i.length||i[i.length-1]<t[o])&&(u&&(n.length&&r(n[n.length-1].value,"outOfRange"),u=0),r(t[o],"outOfRange"));var h=n.length;return{stops:n,outerColors:[h?n[0].color:"transparent",h?n[h-1].color:"transparent"]}}});function U5(e,t,i){if(i[0]===i[1])return i.slice();for(var n=(i[1]-i[0])/200,r=i[0],a=[],o=0;o<=200&&r<i[1];o++)a.push(r),r+=n;return a.push(i[1]),a}var W5=g,j5=No,X5=qc,Z5=Hc,q5=yO,Y5=h.extendComponentView({type:"visualMap",autoPositionValues:{left:1,right:1,top:1,bottom:1},init:function(e,t){this.ecModel=e,this.api=t,this.visualMapModel},render:function(e,t,i,n){this.visualMapModel=e,!1!==e.get("show")?this.doRender.apply(this,arguments):this.group.removeAll()},renderBackground:function(e){var t=this.visualMapModel,i=X5.normalizeCssArray(t.get("padding")||0),n=e.getBoundingRect();e.add(new j5.Rect({z2:-1,silent:!0,shape:{x:n.x-i[3],y:n.y-i[0],width:n.width+i[3]+i[1],height:n.height+i[0]+i[2]},style:{fill:t.get("backgroundColor"),stroke:t.get("borderColor"),lineWidth:t.get("borderWidth")}}))},getControllerVisual:function(e,t,i){var n=(i=i||{}).forceState,r=this.visualMapModel,a={};if("symbol"===t&&(a.symbol=r.get("itemSymbol")),"color"===t){var o=r.get("contentColor");a.color=o}function s(e){return a[e]}function l(e,t){a[e]=t}var u=r.controllerVisuals[n||r.getValueState(e)],h=q5.prepareVisualTypes(u);return W5.each(h,(function(n){var r=u[n];i.convertOpacityToAlpha&&"opacity"===n&&(n="colorAlpha",r=u.__alphaForOpacity),q5.dependsOn(n,t)&&r&&r.applyVisual(e,s,l)})),a[t]},positionGroup:function(e){var t=this.visualMapModel,i=this.api;Z5.positionElement(e,t.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()})},doRender:W5.noop}),K5=Y5,Q5={},J5=g,$5=Hc.getLayoutRect;Q5.getItemAlign=function(e,t,i){var n=e.option,r=n.align;if(null!=r&&"auto"!==r)return r;for(var a={width:t.getWidth(),height:t.getHeight()},o="horizontal"===n.orient?1:0,s=[["left","right","width"],["top","bottom","height"]],l=s[o],u=[0,null,10],h={},c=0;c<3;c++)h[s[1-o][c]]=u[c],h[l[c]]=2===c?i[0]:n[l[c]];var d=[["x","width",3],["y","height",0]][o],f=$5(h,a,n.padding);return l[(f.margin[d[2]]||0)+f[d[0]]+.5*f[d[1]]<.5*a[d[1]]?0:1]},Q5.makeHighDownBatch=function(e,t){return J5.each(e||[],(function(e){null!=e.dataIndex&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey="visualMap"+(t?t.componentIndex:"")})),e};var e4=g,t4=qu,i4=ne,n4=K5,r4=No,a4=wF,o4=Q5,s4=lo,l4=Uc.linearMap,u4=e4.each,h4=Math.min,c4=Math.max,d4=n4.extend({type:"visualMap.continuous",init:function(){d4.superApply(this,"init",arguments),this._shapes={},this._dataInterval=[],this._handleEnds=[],this._orient,this._useHandle,this._hoverLinkDataIndices=[],this._dragging,this._hovering},doRender:function(e,t,i,n){n&&"selectDataRange"===n.type&&n.from===this.uid||this._buildView()},_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 i=e.get("text");this._renderEndsText(t,i,0),this._renderEndsText(t,i,1),this._updateView(!0),this.renderBackground(t),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(t)},_renderEndsText:function(e,t,i){if(t){var n=t[1-i];n=null!=n?n+"":"";var r=this.visualMapModel,a=r.get("textGap"),o=r.itemSize,s=this._shapes.barGroup,l=this._applyTransform([o[0]/2,0===i?-a:o[1]+a],s),u=this._applyTransform(0===i?"bottom":"top",s),h=this._orient,c=this.visualMapModel.textStyleModel;this.group.add(new r4.Text({style:{x:l[0],y:l[1],textVerticalAlign:"horizontal"===h?"middle":u,textAlign:"horizontal"===h?u:"center",text:n,textFont:c.getFont(),textFill:c.getTextColor()}}))}},_renderBar:function(e){var t=this.visualMapModel,i=this._shapes,n=t.itemSize,r=this._orient,a=this._useHandle,o=o4.getItemAlign(t,this.api,n),s=i.barGroup=this._createBarGroup(o);s.add(i.outOfRange=f4()),s.add(i.inRange=f4(null,a?g4(this._orient):null,e4.bind(this._dragHandle,this,"all",!1),e4.bind(this._dragHandle,this,"all",!0)));var l=t.textStyleModel.getTextRect("国"),u=c4(l.width,l.height);a&&(i.handleThumbs=[],i.handleLabels=[],i.handleLabelPoints=[],this._createHandle(s,0,n,u,r,o),this._createHandle(s,1,n,u,r,o)),this._createIndicator(s,n,u,r),e.add(s)},_createHandle:function(e,t,i,n,r){var a=e4.bind(this._dragHandle,this,t,!1),o=e4.bind(this._dragHandle,this,t,!0),s=f4(function(e,t){return 0===e?[[0,0],[t,0],[t,-t]]:[[0,0],[t,0],[t,t]]}(t,n),g4(this._orient),a,o);s.position[0]=i[0],e.add(s);var l=this.visualMapModel.textStyleModel,u=new r4.Text({draggable:!0,drift:a,onmousemove:function(e){i4.stop(e.event)},ondragend:o,style:{x:0,y:0,text:"",textFont:l.getFont(),textFill:l.getTextColor()}});this.group.add(u);var h=["horizontal"===r?n/2:1.5*n,"horizontal"===r?0===t?-1.5*n:1.5*n:0===t?-n/2:n/2],c=this._shapes;c.handleThumbs[t]=s,c.handleLabelPoints[t]=h,c.handleLabels[t]=u},_createIndicator:function(e,t,i,n){var r=f4([[0,0]],"move");r.position[0]=t[0],r.attr({invisible:!0,silent:!0}),e.add(r);var a=this.visualMapModel.textStyleModel,o=new r4.Text({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textFont:a.getFont(),textFill:a.getTextColor()}});this.group.add(o);var s=["horizontal"===n?i/2:9,0],l=this._shapes;l.indicator=r,l.indicatorLabel=o,l.indicatorLabelPoint=s},_dragHandle:function(e,t,i,n){if(this._useHandle){if(this._dragging=!t,!t){var r=this._applyTransform([i,n],this._shapes.barGroup,!0);this._updateInterval(e,r[1]),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():p4(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[e],!1)}},_resetInterval:function(){var e=this.visualMapModel,t=this._dataInterval=e.getSelected(),i=e.getExtent(),n=[0,e.itemSize[1]];this._handleEnds=[l4(t[0],i,n,!0),l4(t[1],i,n,!0)]},_updateInterval:function(e,t){t=t||0;var i=this.visualMapModel,n=this._handleEnds,r=[0,i.itemSize[1]];a4(t,n,r,e,0);var a=i.getExtent();this._dataInterval=[l4(n[0],r,a,!0),l4(n[1],r,a,!0)]},_updateView:function(e){var t=this.visualMapModel,i=t.getExtent(),n=this._shapes,r=[0,t.itemSize[1]],a=e?r:this._handleEnds,o=this._createBarVisual(this._dataInterval,i,a,"inRange"),s=this._createBarVisual(i,i,r,"outOfRange");n.inRange.setStyle({fill:o.barColor,opacity:o.opacity}).setShape("points",o.barPoints),n.outOfRange.setStyle({fill:s.barColor,opacity:s.opacity}).setShape("points",s.barPoints),this._updateHandle(a,o)},_createBarVisual:function(e,t,i,n){var r={forceState:n,convertOpacityToAlpha:!0},a=this._makeColorGradient(e,r),o=[this.getControllerVisual(e[0],"symbolSize",r),this.getControllerVisual(e[1],"symbolSize",r)],s=this._createBarPoints(i,o);return{barColor:new t4(0,0,0,1,a),barPoints:s,handlesColor:[a[0].color,a[a.length-1].color]}},_makeColorGradient:function(e,t){var i=[],n=(e[1]-e[0])/100;i.push({color:this.getControllerVisual(e[0],"color",t),offset:0});for(var r=1;r<100;r++){var a=e[0]+n*r;if(a>e[1])break;i.push({color:this.getControllerVisual(a,"color",t),offset:r/100})}return i.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),i},_createBarPoints:function(e,t){var i=this.visualMapModel.itemSize;return[[i[0]-t[0],e[0]],[i[0],e[0]],[i[0],e[1]],[i[0]-t[1],e[1]]]},_createBarGroup:function(e){var t=this._orient,i=this.visualMapModel.get("inverse");return new r4.Group("horizontal"!==t||i?"horizontal"===t&&i?{scale:"bottom"===e?[-1,1]:[1,1],rotation:-Math.PI/2}:"vertical"!==t||i?{scale:"left"===e?[1,1]:[-1,1]}:{scale:"left"===e?[1,-1]:[-1,-1]}:{scale:"bottom"===e?[1,1]:[-1,1],rotation:Math.PI/2})},_updateHandle:function(e,t){if(this._useHandle){var i=this._shapes,n=this.visualMapModel,r=i.handleThumbs,a=i.handleLabels;u4([0,1],(function(o){var s=r[o];s.setStyle("fill",t.handlesColor[o]),s.position[1]=e[o];var l=r4.applyTransform(i.handleLabelPoints[o],r4.getTransform(s,this.group));a[o].setStyle({x:l[0],y:l[1],text:n.formatValueText(this._dataInterval[o]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===o?"bottom":"top":"left",i.barGroup)})}),this)}},_showIndicator:function(e,t,i,n){var r=this.visualMapModel,a=r.getExtent(),o=r.itemSize,s=[0,o[1]],l=l4(e,a,s,!0),u=this._shapes,h=u.indicator;if(h){h.position[1]=l,h.attr("invisible",!1),h.setShape("points",function(e,t,i,n){return e?[[0,-h4(t,c4(i,0))],[6,0],[0,h4(t,c4(n-i,0))]]:[[0,0],[5,-5],[5,5]]}(!!i,n,l,o[1]));var c=this.getControllerVisual(e,"color",{convertOpacityToAlpha:!0});h.setStyle("fill",c);var d=r4.applyTransform(u.indicatorLabelPoint,r4.getTransform(h,this.group)),f=u.indicatorLabel;f.attr("invisible",!1);var p=this._applyTransform("left",u.barGroup),g=this._orient;f.setStyle({text:(i||"")+r.formatValueText(t),textVerticalAlign:"horizontal"===g?p:"middle",textAlign:"horizontal"===g?"center":p,x:d[0],y:d[1]})}},_enableHoverLinkToSeries:function(){var e=this;this._shapes.barGroup.on("mousemove",(function(t){if(e._hovering=!0,!e._dragging){var i=e.visualMapModel.itemSize,n=e._applyTransform([t.offsetX,t.offsetY],e._shapes.barGroup,!0,!0);n[1]=h4(c4(0,n[1]),i[1]),e._doHoverLinkToSeries(n[1],0<=n[0]&&n[0]<=i[0])}})).on("mouseout",(function(){e._hovering=!1,!e._dragging&&e._clearHoverLinkToSeries()}))},_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()},_doHoverLinkToSeries:function(e,t){var i=this.visualMapModel,n=i.itemSize;if(i.option.hoverLink){var r=[0,n[1]],a=i.getExtent();e=h4(c4(r[0],e),r[1]);var o=function(e,t,i){var n=6,r=e.get("hoverLinkDataSize");return r&&(n=l4(r,t,i,!0)/2),n}(i,a,r),s=[e-o,e+o],l=l4(e,r,a,!0),u=[l4(s[0],r,a,!0),l4(s[1],r,a,!0)];s[0]<r[0]&&(u[0]=-1/0),s[1]>r[1]&&(u[1]=1/0),t&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",o):u[1]===1/0?this._showIndicator(l,u[0],"> ",o):this._showIndicator(l,l,"≈ ",o));var h=this._hoverLinkDataIndices,c=[];(t||p4(i))&&(c=this._hoverLinkDataIndices=i.findTargetDataIndices(u));var d=s4.compressBatches(h,c);this._dispatchHighDown("downplay",o4.makeHighDownBatch(d[0],i)),this._dispatchHighDown("highlight",o4.makeHighDownBatch(d[1],i))}},_hoverLinkFromSeriesMouseOver:function(e){var t=e.target,i=this.visualMapModel;if(t&&null!=t.dataIndex){var n=this.ecModel.getSeriesByIndex(t.seriesIndex);if(i.isTargetSeries(n)){var r=n.getData(t.dataType),a=r.get(i.getDataDimension(r),t.dataIndex,!0);isNaN(a)||this._showIndicator(a,a)}}},_hideIndicator:function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0)},_clearHoverLinkToSeries:function(){this._hideIndicator();var e=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",o4.makeHighDownBatch(e,this.visualMapModel)),e.length=0},_clearHoverLinkFromSeries:function(){this._hideIndicator();var e=this.api.getZr();e.off("mouseover",this._hoverLinkFromSeriesMouseOver),e.off("mouseout",this._hideIndicator)},_applyTransform:function(e,t,i,n){var r=r4.getTransform(t,n?null:this.group);return r4[e4.isArray(e)?"applyTransform":"transformDirection"](e,r,i)},_dispatchHighDown:function(e,t){t&&t.length&&this.api.dispatchAction({type:e,batch:t})},dispose:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},remove:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()}});function f4(e,t,i,n){return new r4.Polygon({shape:{points:e},draggable:!!i,cursor:t,drift:i,onmousemove:function(e){i4.stop(e.event)},ondragend:n})}function p4(e){var t=e.get("hoverLinkOnHandle");return!!(null==t?e.get("realtime"):t)}function g4(e){return"vertical"===e?"ns-resize":"ew-resize"}h.registerAction({type:"selectDataRange",event:"dataRangeSelected",update:"update"},(function(e,t){t.eachComponent({mainType:"visualMap",query:e},(function(t){t.setSelected(e.selected)}))})),h.registerPreprocessor(h5);var m4=g,v4=z5,y4=yO,_4=x5,x4=Uc.reformIntervals,b4=v4.extend({type:"visualMap.piecewise",defaultOption:{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieceList:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0,showLabel:null},optionUpdated:function(e,t){b4.superApply(this,"optionUpdated",arguments),this._pieceList=[],this.resetExtent();var i=this._mode=this._determineMode();w4[this._mode].call(this),this._resetSelected(e,t);var n=this.option.categories;this.resetVisual((function(e,t){"categories"===i?(e.mappingMethod="category",e.categories=m4.clone(n)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=m4.map(this._pieceList,(function(e){return e=m4.clone(e),"inRange"!==t&&(e.visual=null),e})))}))},completeVisualOption:function(){var e=this.option,t={},i=y4.listVisualTypes(),n=this.isCategory();function r(e,t,i){return e&&e[t]&&(m4.isObject(e[t])?e[t].hasOwnProperty(i):e[t]===i)}m4.each(e.pieces,(function(e){m4.each(i,(function(i){e.hasOwnProperty(i)&&(t[i]=1)}))})),m4.each(t,(function(t,i){var a=0;m4.each(this.stateList,(function(t){a|=r(e,t,i)||r(e.target,t,i)}),this),!a&&m4.each(this.stateList,(function(t){(e[t]||(e[t]={}))[i]=_4.get(i,"inRange"===t?"active":"inactive",n)}))}),this),v4.prototype.completeVisualOption.apply(this,arguments)},_resetSelected:function(e,t){var i=this.option,n=this._pieceList,r=(t?i:e).selected||{};if(i.selected=r,m4.each(n,(function(e,t){var i=this.getSelectedMapKey(e);r.hasOwnProperty(i)||(r[i]=!0)}),this),"single"===i.selectedMode){var a=!1;m4.each(n,(function(e,t){var i=this.getSelectedMapKey(e);r[i]&&(a?r[i]=!1:a=!0)}),this)}},getSelectedMapKey:function(e){return"categories"===this._mode?e.value+"":e.index+""},getPieceList:function(){return this._pieceList},_determineMode:function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},setSelected:function(e){this.option.selected=m4.clone(e)},getValueState:function(e){var t=y4.findPieceIndex(e,this._pieceList);return null!=t&&this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?"inRange":"outOfRange"},findTargetDataIndices:function(e){var t=[];return this.eachTargetSeries((function(i){var n=[],r=i.getData();r.each(this.getDataDimension(r),(function(t,i){y4.findPieceIndex(t,this._pieceList)===e&&n.push(i)}),this),t.push({seriesId:i.id,dataIndex:n})}),this),t},getRepresentValue:function(e){var t;if(this.isCategory())t=e.value;else if(null!=e.value)t=e.value;else{var i=e.interval||[];t=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return t},getVisualMeta:function(e){if(!this.isCategory()){var t=[],i=[],n=this,r=this._pieceList.slice();if(r.length){var a=r[0].interval[0];a!==-1/0&&r.unshift({interval:[-1/0,a]}),(a=r[r.length-1].interval[1])!==1/0&&r.push({interval:[a,1/0]})}else r.push({interval:[-1/0,1/0]});var o=-1/0;return m4.each(r,(function(e){var t=e.interval;t&&(t[0]>o&&s([o,t[0]],"outOfRange"),s(t.slice()),o=t[1])}),this),{stops:t,outerColors:i}}function s(r,a){var o=n.getRepresentValue({interval:r});a||(a=n.getValueState(o));var s=e(o,a);r[0]===-1/0?i[0]=s:r[1]===1/0?i[1]=s:t.push({value:r[0],color:s},{value:r[1],color:s})}}}),w4={splitNumber:function(){var e=this.option,t=this._pieceList,i=Math.min(e.precision,20),n=this.getExtent(),r=e.splitNumber;r=Math.max(parseInt(r,10),1),e.splitNumber=r;for(var a=(n[1]-n[0])/r;+a.toFixed(i)!==a&&i<5;)i++;e.precision=i,a=+a.toFixed(i),e.minOpen&&t.push({interval:[-1/0,n[0]],close:[0,0]});for(var o=0,s=n[0];o<r;s+=a,o++){var l=o===r-1?n[1]:s+a;t.push({interval:[s,l],close:[1,1]})}e.maxOpen&&t.push({interval:[n[1],1/0],close:[0,0]}),x4(t),m4.each(t,(function(e,t){e.index=t,e.text=this.formatValueText(e.interval)}),this)},categories:function(){var e=this.option;m4.each(e.categories,(function(e){this._pieceList.push({text:this.formatValueText(e,!0),value:e})}),this),T4(e,this._pieceList)},pieces:function(){var e=this.option,t=this._pieceList;m4.each(e.pieces,(function(e,i){m4.isObject(e)||(e={value:e});var n={text:"",index:i};if(null!=e.label&&(n.text=e.label),e.hasOwnProperty("value")){var r=n.value=e.value;n.interval=[r,r],n.close=[1,1]}else{for(var a=n.interval=[],o=n.close=[0,0],s=[1,0,1],l=[-1/0,1/0],u=[],h=0;h<2;h++){for(var c=[["gte","gt","min"],["lte","lt","max"]][h],d=0;d<3&&null==a[h];d++)a[h]=e[c[d]],o[h]=s[d],u[h]=2===d;null==a[h]&&(a[h]=l[h])}u[0]&&a[1]===1/0&&(o[0]=0),u[1]&&a[0]===-1/0&&(o[1]=0),a[0]===a[1]&&o[0]&&o[1]&&(n.value=a[0])}n.visual=y4.retrieveVisuals(e),t.push(n)}),this),T4(e,t),x4(t),m4.each(t,(function(e){var t=e.close,i=[["<","≤"][t[1]],[">","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,i)}),this)}};function T4(e,t){var i=e.inverse;("vertical"===e.orient?!i:i)&&t.reverse()}var S4=g,M4=K5,A4=No,I4=ow.createSymbol,C4=Hc,D4=Q5;M4.extend({type:"visualMap.piecewise",doRender:function(){var e=this.group;e.removeAll();var t=this.visualMapModel,i=t.get("textGap"),n=t.textStyleModel,r=n.getFont(),a=n.getTextColor(),o=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),u=l.endsText,h=S4.retrieve(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],s,h,o),S4.each(l.viewPieceList,(function(n){var l=n.piece,u=new A4.Group;u.onclick=S4.bind(this._onItemClick,this,l),this._enableHoverLink(u,n.indexInModelPieceList);var c=t.getRepresentValue(l);if(this._createItemSymbol(u,c,[0,0,s[0],s[1]]),h){var d=this.visualMapModel.getValueState(c);u.add(new A4.Text({style:{x:"right"===o?-i:s[0]+i,y:s[1]/2,text:l.text,textVerticalAlign:"middle",textAlign:o,textFont:r,textFill:a,opacity:"outOfRange"===d?.5:1}}))}e.add(u)}),this),u&&this._renderEndsText(e,u[1],s,h,o),C4.box(t.get("orient"),e,t.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},_enableHoverLink:function(e,t){function i(e){var i=this.visualMapModel;i.option.hoverLink&&this.api.dispatchAction({type:e,batch:D4.makeHighDownBatch(i.findTargetDataIndices(t),i)})}e.on("mouseover",S4.bind(i,this,"highlight")).on("mouseout",S4.bind(i,this,"downplay"))},_getItemAlign:function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return D4.getItemAlign(e,this.api,e.itemSize);var i=t.align;return i&&"auto"!==i||(i="left"),i},_renderEndsText:function(e,t,i,n,r){if(t){var a=new A4.Group,o=this.visualMapModel.textStyleModel;a.add(new A4.Text({style:{x:n?"right"===r?i[0]:0:i[0]/2,y:i[1]/2,textVerticalAlign:"middle",textAlign:n?r:"center",text:t,textFont:o.getFont(),textFill:o.getTextColor()}})),e.add(a)}},_getViewData:function(){var e=this.visualMapModel,t=S4.map(e.getPieceList(),(function(e,t){return{piece:e,indexInModelPieceList:t}})),i=e.get("text"),n=e.get("orient"),r=e.get("inverse");return("horizontal"===n?r:!r)?t.reverse():i&&(i=i.slice().reverse()),{viewPieceList:t,endsText:i}},_createItemSymbol:function(e,t,i){e.add(I4(this.getControllerVisual(t,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(t,"color")))},_onItemClick:function(e){var t=this.visualMapModel,i=t.option,n=S4.clone(i.selected),r=t.getSelectedMapKey(e);"single"===i.selectedMode?(n[r]=!0,S4.each(n,(function(e,t){n[t]=t===r}))):n[r]=!n[r],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:n})}}),h.registerPreprocessor(h5);var E4,L4={},P4=p,N4="urn:schemas-microsoft-com:vml",R4="undefined"==typeof window?null:window,O4=!1,k4=R4&&R4.document;if(k4&&!P4.canvasSupported)try{!k4.namespaces.zrvml&&k4.namespaces.add("zrvml",N4),E4=function(e){return k4.createElement("<zrvml:"+e+' class="zrvml">')}}catch(m9){E4=function(e){return k4.createElement("<"+e+' xmlns="'+N4+'" class="zrvml">')}}L4.doc=k4,L4.createNode=function(e){return E4(e)},L4.initVML=function(){if(!O4&&k4){O4=!0;var e=k4.styleSheets;e.length<31?k4.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):e[0].addRule(".zrvml","behavior:url(#default#VML)")}};var z4=p,B4=V.applyTransform,F4=Pi,V4=ut,G4=Tn,H4=wn,U4=Br,W4=Wr,j4=Kr,X4=Vl,Z4=dl,q4=Ds,Y4=Wu,K4=L4,Q4=q4.CMD,J4=Math.round,$4=Math.sqrt,e6=Math.abs,t6=Math.cos,i6=Math.sin,n6=Math.max;if(!z4.canvasSupported){var r6=",",a6="progid:DXImageTransform.Microsoft",o6=21600,s6=o6/2,l6=function(e){e.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",e.coordsize=o6+","+o6,e.coordorigin="0,0"},u6=function(e,t,i){return"rgb("+[e,t,i].join(",")+")"},h6=function(e,t){t&&e&&t.parentNode!==e&&e.appendChild(t)},c6=function(e,t){t&&e&&t.parentNode===e&&e.removeChild(t)},d6=function(e,t,i){return 1e5*(parseFloat(e)||0)+1e3*(parseFloat(t)||0)+i},f6=H4.parsePercent,p6=function(e,t,i){var n=V4.parse(t);i=+i,isNaN(i)&&(i=1),n&&(e.color=u6(n[0],n[1],n[2]),e.opacity=i*n[3])},g6=function(e){var t=V4.parse(e);return[u6(t[0],t[1],t[2]),t[3]]},m6=function(e,t,i,n){var r="fill"===t,a=e.getElementsByTagName(t)[0];null!=i[t]&&"none"!==i[t]&&(r||!r&&i.lineWidth)?(e[r?"filled":"stroked"]="true",i[t]instanceof Y4&&c6(e,a),a||(a=K4.createNode(t)),r?function(e,t,i){var n=t.fill;if(null!=n)if(n instanceof Y4){var r,a=0,o=[0,0],s=0,l=1,u=i.getBoundingRect(),h=u.width,c=u.height;if("linear"===n.type){r="gradient";var d=i.transform,f=[n.x*h,n.y*c],p=[n.x2*h,n.y2*c];d&&(B4(f,f,d),B4(p,p,d));var g=p[0]-f[0],m=p[1]-f[1];(a=180*Math.atan2(g,m)/Math.PI)<0&&(a+=360),a<1e-6&&(a=0)}else{r="gradientradial",f=[n.x*h,n.y*c],d=i.transform;var v=i.scale,y=h,_=c;o=[(f[0]-u.x)/y,(f[1]-u.y)/_],d&&B4(f,f,d),y/=v[0]*o6,_/=v[1]*o6;var x=n6(y,_);s=0/x,l=2*n.r/x-s}var b=n.colorStops.slice();b.sort((function(e,t){return e.offset-t.offset}));for(var w=b.length,T=[],S=[],M=0;M<w;M++){var A=b[M],I=g6(A.color);S.push(A.offset*l+s+" "+I[0]),0!==M&&M!==w-1||T.push(I)}if(w>=2){var C=T[0][0],D=T[1][0],E=T[0][1]*t.opacity,L=T[1][1]*t.opacity;e.type=r,e.method="none",e.focus="100%",e.angle=a,e.color=C,e.color2=D,e.colors=S.join(","),e.opacity=L,e.opacity2=E}"radial"===r&&(e.focusposition=o.join(","))}else p6(e,n,t.opacity)}(a,i,n):function(e,t){t.lineDash&&(e.dashstyle=t.lineDash.join(" ")),null==t.stroke||t.stroke instanceof Y4||p6(e,t.stroke,t.opacity)}(a,i),h6(e,a)):(e[r?"filled":"stroked"]="false",c6(e,a))},v6=[[],[],[]];Z4.prototype.brushVML=function(e){var t=this.style,i=this._vmlEl;i||(i=K4.createNode("shape"),l6(i),this._vmlEl=i),m6(i,"fill",t,this),m6(i,"stroke",t,this);var n=this.transform,r=null!=n,a=i.getElementsByTagName("stroke")[0];if(a){var o=t.lineWidth;if(r&&!t.strokeNoScale){var s=n[0]*n[3]-n[1]*n[2];o*=$4(e6(s))}a.weight=o+"px"}var l=this.path||(this.path=new q4);this.__dirtyPath&&(l.beginPath(),l.subPixelOptimize=!1,this.buildPath(l,this.shape),l.toStatic(),this.__dirtyPath=!1),i.path=function(e,t){var i,n,r,a,o,s,l=Q4.M,u=Q4.C,h=Q4.L,c=Q4.A,d=Q4.Q,f=[],p=e.data,g=e.len();for(a=0;a<g;){switch(n="",i=0,r=p[a++]){case l:n=" m ",i=1,o=p[a++],s=p[a++],v6[0][0]=o,v6[0][1]=s;break;case h:n=" l ",i=1,o=p[a++],s=p[a++],v6[0][0]=o,v6[0][1]=s;break;case d:case u:n=" c ",i=3;var m,v,y=p[a++],_=p[a++],x=p[a++],b=p[a++];r===d?(m=x,v=b,x=(x+2*y)/3,b=(b+2*_)/3,y=(o+2*y)/3,_=(s+2*_)/3):(m=p[a++],v=p[a++]),v6[0][0]=y,v6[0][1]=_,v6[1][0]=x,v6[1][1]=b,v6[2][0]=m,v6[2][1]=v,o=m,s=v;break;case c:var w=0,T=0,S=1,M=1,A=0;t&&(w=t[4],T=t[5],S=$4(t[0]*t[0]+t[1]*t[1]),M=$4(t[2]*t[2]+t[3]*t[3]),A=Math.atan2(-t[1]/M,t[0]/S));var I=p[a++],C=p[a++],D=p[a++],E=p[a++],L=p[a++]+A,P=p[a++]+L+A;a++;var N=p[a++],R=I+t6(L)*D,O=C+i6(L)*E,k=(y=I+t6(P)*D,_=C+i6(P)*E,N?" wa ":" at ");Math.abs(R-y)<1e-4&&(Math.abs(P-L)>.01?N&&(R+=270/o6):Math.abs(O-C)<1e-4?N&&R<I||!N&&R>I?_-=270/o6:_+=270/o6:N&&O<C||!N&&O>C?y+=270/o6:y-=270/o6),f.push(k,J4(((I-D)*S+w)*o6-s6),r6,J4(((C-E)*M+T)*o6-s6),r6,J4(((I+D)*S+w)*o6-s6),r6,J4(((C+E)*M+T)*o6-s6),r6,J4((R*S+w)*o6-s6),r6,J4((O*M+T)*o6-s6),r6,J4((y*S+w)*o6-s6),r6,J4((_*M+T)*o6-s6)),o=y,s=_;break;case Q4.R:var z=v6[0],B=v6[1];z[0]=p[a++],z[1]=p[a++],B[0]=z[0]+p[a++],B[1]=z[1]+p[a++],t&&(B4(z,z,t),B4(B,B,t)),z[0]=J4(z[0]*o6-s6),B[0]=J4(B[0]*o6-s6),z[1]=J4(z[1]*o6-s6),B[1]=J4(B[1]*o6-s6),f.push(" m ",z[0],r6,z[1]," l ",B[0],r6,z[1]," l ",B[0],r6,B[1]," l ",z[0],r6,B[1]);break;case Q4.Z:f.push(" x ")}if(i>0){f.push(n);for(var F=0;F<i;F++){var V=v6[F];t&&B4(V,V,t),f.push(J4(V[0]*o6-s6),r6,J4(V[1]*o6-s6),F<i-1?r6:"")}}}return f.join("")}(l,this.transform),i.style.zIndex=d6(this.zlevel,this.z,this.z2),h6(e,i),null!=t.text?this.drawRectText(e,this.getBoundingRect()):this.removeRectText(e)},Z4.prototype.onRemove=function(e){c6(e,this._vmlEl),this.removeRectText(e)},Z4.prototype.onAdd=function(e){h6(e,this._vmlEl),this.appendRectText(e)},j4.prototype.brushVML=function(e){var t,i,n,r=this.style,a=r.image;if("object"==typeof(n=a)&&n.tagName&&"IMG"===n.tagName.toUpperCase()){var o=a.src;if(o===this._imageSrc)t=this._imageWidth,i=this._imageHeight;else{var s=a.runtimeStyle,l=s.width,u=s.height;s.width="auto",s.height="auto",t=a.width,i=a.height,s.width=l,s.height=u,this._imageSrc=o,this._imageWidth=t,this._imageHeight=i}a=o}else a===this._imageSrc&&(t=this._imageWidth,i=this._imageHeight);if(a){var h=r.x||0,c=r.y||0,d=r.width,f=r.height,p=r.sWidth,g=r.sHeight,m=r.sx||0,v=r.sy||0,y=p&&g,_=this._vmlEl;_||(_=K4.doc.createElement("div"),l6(_),this._vmlEl=_);var x,b=_.style,w=!1,T=1,S=1;if(this.transform&&(x=this.transform,T=$4(x[0]*x[0]+x[1]*x[1]),S=$4(x[2]*x[2]+x[3]*x[3]),w=x[1]||x[2]),w){var M=[h,c],A=[h+d,c],I=[h,c+f],C=[h+d,c+f];B4(M,M,x),B4(A,A,x),B4(I,I,x),B4(C,C,x);var D=n6(M[0],A[0],I[0],C[0]),E=n6(M[1],A[1],I[1],C[1]),L=[];L.push("M11=",x[0]/T,r6,"M12=",x[2]/S,r6,"M21=",x[1]/T,r6,"M22=",x[3]/S,r6,"Dx=",J4(h*T+x[4]),r6,"Dy=",J4(c*S+x[5])),b.padding="0 "+J4(D)+"px "+J4(E)+"px 0",b.filter=a6+".Matrix("+L.join("")+", SizingMethod=clip)"}else x&&(h=h*T+x[4],c=c*S+x[5]),b.filter="",b.left=J4(h)+"px",b.top=J4(c)+"px";var P=this._imageEl,N=this._cropEl;P||(P=K4.doc.createElement("div"),this._imageEl=P);var R=P.style;if(y){if(t&&i)R.width=J4(T*t*d/p)+"px",R.height=J4(S*i*f/g)+"px";else{var O=new Image,k=this;O.onload=function(){O.onload=null,t=O.width,i=O.height,R.width=J4(T*t*d/p)+"px",R.height=J4(S*i*f/g)+"px",k._imageWidth=t,k._imageHeight=i,k._imageSrc=a},O.src=a}N||((N=K4.doc.createElement("div")).style.overflow="hidden",this._cropEl=N);var z=N.style;z.width=J4((d+m*d/p)*T),z.height=J4((f+v*f/g)*S),z.filter=a6+".Matrix(Dx="+-m*d/p*T+",Dy="+-v*f/g*S+")",N.parentNode||_.appendChild(N),P.parentNode!==N&&N.appendChild(P)}else R.width=J4(T*d)+"px",R.height=J4(S*f)+"px",_.appendChild(P),N&&N.parentNode&&(_.removeChild(N),this._cropEl=null);var B="",F=r.opacity;F<1&&(B+=".Alpha(opacity="+J4(100*F)+") "),B+=a6+".AlphaImageLoader(src="+a+", SizingMethod=scale)",R.filter=B,_.style.zIndex=d6(this.zlevel,this.z,this.z2),h6(e,_),null!=r.text&&this.drawRectText(e,this.getBoundingRect())}},j4.prototype.onRemove=function(e){c6(e,this._vmlEl),this._vmlEl=null,this._cropEl=null,this._imageEl=null,this.removeRectText(e)},j4.prototype.onAdd=function(e){h6(e,this._vmlEl),this.appendRectText(e)};var y6,_6="normal",x6={},b6=0,w6=document.createElement("div");G4.$override("measureText",(function(e,t){var i=K4.doc;y6||((y6=i.createElement("div")).style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",K4.doc.body.appendChild(y6));try{y6.style.font=t}catch(n){}return y6.innerHTML="",y6.appendChild(i.createTextNode(e)),{width:y6.offsetWidth}}));for(var T6=new F4,S6=function(e,t,i,n){var r=this.style;this.__dirty&&H4.normalizeTextStyle(r,!0);var a=r.text;if(null!=a&&(a+=""),a){if(r.rich){var o=G4.parseRichText(a,r);a=[];for(var s=0;s<o.lines.length;s++){for(var l=o.lines[s].tokens,u=[],h=0;h<l.length;h++)u.push(l[h].text);a.push(u.join(""))}a=a.join("\n")}var c,d,f=r.textAlign,p=r.textVerticalAlign,g=function(e){var t=x6[e];if(!t){b6>100&&(b6=0,x6={});var i,n=w6.style;try{n.font=e,i=n.fontFamily.split(",")[0]}catch(m9){}t={style:n.fontStyle||_6,variant:n.fontVariant||_6,weight:n.fontWeight||_6,size:0|parseFloat(n.fontSize||12),family:i||"Microsoft YaHei"},x6[e]=t,b6++}return t}(r.font),m=g.style+" "+g.variant+" "+g.weight+" "+g.size+'px "'+g.family+'"';i=i||G4.getBoundingRect(a,m,f,p,r.textPadding,r.textLineHeight);var v=this.transform;if(v&&!n&&(T6.copy(t),T6.applyTransform(v),t=T6),n)c=t.x,d=t.y;else{var y=r.textPosition;if(y instanceof Array)c=t.x+f6(y[0],t.width),d=t.y+f6(y[1],t.height),f=f||"left";else{var _=this.calculateTextPosition?this.calculateTextPosition({},r,t):G4.calculateTextPosition({},r,t);c=_.x,d=_.y,f=f||_.textAlign,p=p||_.textVerticalAlign}}c=G4.adjustTextX(c,i.width,f),d=G4.adjustTextY(d,i.height,p),d+=i.height/2;var x,b,w,T=K4.createNode,S=this._textVmlEl;S?b=(x=(w=S.firstChild).nextSibling).nextSibling:(S=T("line"),x=T("path"),b=T("textpath"),w=T("skew"),b.style["v-text-align"]="left",l6(S),x.textpathok=!0,b.on=!0,S.from="0 0",S.to="1000 0.05",h6(S,w),h6(S,x),h6(S,b),this._textVmlEl=S);var M=[c,d],A=S.style;v&&n?(B4(M,M,v),w.on=!0,w.matrix=v[0].toFixed(3)+r6+v[2].toFixed(3)+r6+v[1].toFixed(3)+r6+v[3].toFixed(3)+",0,0",w.offset=(J4(M[0])||0)+","+(J4(M[1])||0),w.origin="0 0",A.left="0px",A.top="0px"):(w.on=!1,A.left=J4(c)+"px",A.top=J4(d)+"px"),b.string=String(a).replace(/&/g,"&").replace(/"/g,""");try{b.style.font=m}catch(m9){}m6(S,"fill",{fill:r.textFill,opacity:r.opacity},this),m6(S,"stroke",{stroke:r.textStroke,opacity:r.opacity,lineDash:r.lineDash||null},this),S.style.zIndex=d6(this.zlevel,this.z,this.z2),h6(e,S)}},M6=function(e){c6(e,this._textVmlEl),this._textVmlEl=null},A6=function(e){h6(e,this._textVmlEl)},I6=[U4,W4,j4,Z4,X4],C6=0;C6<I6.length;C6++){var D6=I6[C6].prototype;D6.drawRectText=S6,D6.removeRectText=M6,D6.appendRectText=A6}X4.prototype.brushVML=function(e){var t=this.style;null!=t.text?this.drawRectText(e,{x:t.x||0,y:t.y||0,width:0,height:0},this.getBoundingRect(),!0):this.removeRectText(e)},X4.prototype.onRemove=function(e){this.removeRectText(e)},X4.prototype.onAdd=function(e){this.appendRectText(e)}}var E6=ni,L6=L4,P6=g.each;function N6(e){return parseInt(e,10)}function R6(e,t){L6.initVML(),this.root=e,this.storage=t;var i=document.createElement("div"),n=document.createElement("div");i.style.cssText="display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",n.style.cssText="position:absolute;left:0;top:0;",e.appendChild(i),this._vmlRoot=n,this._vmlViewport=i,this.resize();var r=t.delFromStorage,a=t.addToStorage;t.delFromStorage=function(e){r.call(t,e),e&&e.onRemove&&e.onRemove(n)},t.addToStorage=function(e){e.onAdd&&e.onAdd(n),a.call(t,e)},this._firstPaint=!0}R6.prototype={constructor:R6,getType:function(){return"vml"},getViewportRoot:function(){return this._vmlViewport},getViewportRootOffset:function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},refresh:function(){var e=this.storage.getDisplayList(!0,!0);this._paintList(e)},_paintList:function(e){for(var t=this._vmlRoot,i=0;i<e.length;i++){var n=e[i];n.invisible||n.ignore?(n.__alreadyNotVisible||n.onRemove(t),n.__alreadyNotVisible=!0):(n.__alreadyNotVisible&&n.onAdd(t),n.__alreadyNotVisible=!1,n.__dirty&&(n.beforeBrush&&n.beforeBrush(),(n.brushVML||n.brush).call(n,t),n.afterBrush&&n.afterBrush())),n.__dirty=!1}this._firstPaint&&(this._vmlViewport.appendChild(t),this._firstPaint=!1)},resize:function(e,t){if(e=null==e?this._getWidth():e,t=null==t?this._getHeight():t,this._width!==e||this._height!==t){this._width=e,this._height=t;var i=this._vmlViewport.style;i.width=e+"px",i.height=t+"px"}},dispose:function(){this.root.innerHTML="",this._vmlRoot=this._vmlViewport=this.storage=null},getWidth:function(){return this._width},getHeight:function(){return this._height},clear:function(){this._vmlViewport&&this.root.removeChild(this._vmlViewport)},_getWidth:function(){var e=this.root,t=e.currentStyle;return(e.clientWidth||N6(t.width))-N6(t.paddingLeft)-N6(t.paddingRight)|0},_getHeight:function(){var e=this.root,t=e.currentStyle;return(e.clientHeight||N6(t.height))-N6(t.paddingTop)-N6(t.paddingBottom)|0}},P6(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],(function(e){var t;R6.prototype[e]=(t=e,function(){E6('In IE8.0 VML mode painter not support method "'+t+'"')})}));var O6=R6;(0,c.registerPainter)("vml",O6);var k6={},z6={createElement:function(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}},B6=z6.createElement,F6=Pi,V6=Ue,G6=Tn,H6=wn,U6=Vl,W6=Ds.CMD,j6=Array.prototype.join,X6="none",Z6=Math.round,q6=Math.sin,Y6=Math.cos,K6=Math.PI,Q6=2*Math.PI,J6=180/K6,$6=1e-4;function e8(e){return Z6(1e4*e)/1e4}function t8(e){return e<$6&&e>-1e-4}function i8(e,t){t&&n8(e,"transform","matrix("+j6.call(t,",")+")")}function n8(e,t,i){(!i||"linear"!==i.type&&"radial"!==i.type)&&e.setAttribute(t,i)}function r8(e,t,i,n){if(function(e,t){var i=t?e.textFill:e.fill;return null!=i&&i!==X6}(t,i)){var r=i?t.textFill:t.fill;n8(e,"fill",r="transparent"===r?X6:r),n8(e,"fill-opacity",null!=t.fillOpacity?t.fillOpacity*t.opacity:t.opacity)}else n8(e,"fill",X6);if(function(e,t){var i=t?e.textStroke:e.stroke;return null!=i&&i!==X6}(t,i)){var a=i?t.textStroke:t.stroke;n8(e,"stroke",a="transparent"===a?X6:a),n8(e,"stroke-width",(i?t.textStrokeWidth:t.lineWidth)/(!i&&t.strokeNoScale?n.getLineScale():1)),n8(e,"paint-order",i?"stroke":"fill"),n8(e,"stroke-opacity",null!=t.strokeOpacity?t.strokeOpacity:t.opacity),t.lineDash?(n8(e,"stroke-dasharray",t.lineDash.join(",")),n8(e,"stroke-dashoffset",Z6(t.lineDashOffset||0))):n8(e,"stroke-dasharray",""),t.lineCap&&n8(e,"stroke-linecap",t.lineCap),t.lineJoin&&n8(e,"stroke-linejoin",t.lineJoin),t.miterLimit&&n8(e,"stroke-miterlimit",t.miterLimit)}else n8(e,"stroke",X6)}var a8={brush:function(e){var t=e.style,i=e.__svgEl;i||(i=B6("path"),e.__svgEl=i),e.path||e.createPathProxy();var n=e.path;if(e.__dirtyPath){n.beginPath(),n.subPixelOptimize=!1,e.buildPath(n,e.shape),e.__dirtyPath=!1;var r=function(e){for(var t=[],i=e.data,n=e.len(),r=0;r<n;){var a="",o=0;switch(i[r++]){case W6.M:a="M",o=2;break;case W6.L:a="L",o=2;break;case W6.Q:a="Q",o=4;break;case W6.C:a="C",o=6;break;case W6.A:var s=i[r++],l=i[r++],u=i[r++],h=i[r++],c=i[r++],d=i[r++],f=i[r++],p=i[r++],g=Math.abs(d),m=t8(g-Q6)||(p?d>=Q6:-d>=Q6),v=d>0?d%Q6:d%Q6+Q6,y=!1;y=!!m||!t8(g)&&v>=K6==!!p;var _=e8(s+u*Y6(c)),x=e8(l+h*q6(c));m&&(d=p?Q6-1e-4:1e-4-Q6,y=!0,9===r&&t.push("M",_,x));var b=e8(s+u*Y6(c+d)),w=e8(l+h*q6(c+d));t.push("A",e8(u),e8(h),Z6(f*J6),+y,+p,b,w);break;case W6.Z:a="Z";break;case W6.R:b=e8(i[r++]),w=e8(i[r++]);var T=e8(i[r++]),S=e8(i[r++]);t.push("M",b,w,"L",b+T,w,"L",b+T,w+S,"L",b,w+S,"L",b,w)}a&&t.push(a);for(var M=0;M<o;M++)t.push(e8(i[r++]))}return t.join(" ")}(n);r.indexOf("NaN")<0&&n8(i,"d",r)}r8(i,t,!1,e),i8(i,e.transform),null!=t.text?d8(e,e.getBoundingRect()):p8(e)}},o8={brush:function(e){var t=e.style,i=t.image;if(i instanceof HTMLImageElement&&(i=i.src),i){var n=t.x||0,r=t.y||0,a=t.width,o=t.height,s=e.__svgEl;s||(s=B6("image"),e.__svgEl=s),i!==e.__imageSrc&&(function(e,t,i){e.setAttributeNS("http://www.w3.org/1999/xlink",t,i)}(s,"href",i),e.__imageSrc=i),n8(s,"width",a),n8(s,"height",o),n8(s,"x",n),n8(s,"y",r),i8(s,e.transform),null!=t.text?d8(e,e.getBoundingRect()):p8(e)}}},s8={},l8=new F6,u8={},h8=[],c8={left:"start",right:"end",center:"middle",middle:"middle"},d8=function(e,t){var i=e.style,n=e.transform,r=e instanceof U6||i.transformText;e.__dirty&&H6.normalizeTextStyle(i,!0);var a=i.text;if(null!=a&&(a+=""),H6.needDrawText(a,i)){null==a&&(a=""),!r&&n&&(l8.copy(t),l8.applyTransform(n),t=l8);var o=e.__textSvgEl;o||(o=B6("text"),e.__textSvgEl=o);var s=o.style,l=i.font||G6.DEFAULT_FONT,u=o.__computedFont;l!==o.__styleFont&&(s.font=o.__styleFont=l,u=o.__computedFont=s.font);var h=i.textPadding,c=i.textLineHeight,d=e.__textCotentBlock;d&&!e.__dirtyText||(d=e.__textCotentBlock=G6.parsePlainText(a,u,h,c,i.truncate));var f=d.outerHeight,p=d.lineHeight;H6.getBoxPosition(u8,e,i,t);var g=u8.baseX,m=u8.baseY,v=u8.textAlign||"left",y=u8.textVerticalAlign;!function(e,t,i,n,r,a,o){V6.identity(h8),t&&i&&V6.copy(h8,i);var s=n.textRotation;if(r&&s){var l=n.textOrigin;"center"===l?(a=r.width/2+r.x,o=r.height/2+r.y):l&&(a=l[0]+r.x,o=l[1]+r.y),h8[4]-=a,h8[5]-=o,V6.rotate(h8,h8,s),h8[4]+=a,h8[5]+=o}i8(e,h8)}(o,r,n,i,t,g,m);var _=g,x=G6.adjustTextY(m,f,y);h&&(_=function(e,t,i){return"right"===t?e-i[1]:"center"===t?e+i[3]/2-i[1]/2:e+i[3]}(g,v,h),x+=h[0]),x+=p/2,r8(o,i,!0,e);var b=d.canCacheByTextString,w=e.__tspanList||(e.__tspanList=[]),T=w.length;if(b&&e.__canCacheByTextString&&e.__text===a){if(e.__dirtyText&&T)for(var S=0;S<T;++S)f8(w[S],v,_,x+S*p)}else{e.__text=a,e.__canCacheByTextString=b;var M=d.lines,A=M.length;for(S=0;S<A;S++){var I=w[S],C=M[S];I?I.__zrText!==C&&(I.innerHTML="",I.appendChild(document.createTextNode(C))):(I=w[S]=B6("tspan"),o.appendChild(I),I.appendChild(document.createTextNode(C))),f8(I,v,_,x+S*p)}if(T>A){for(;S<T;S++)o.removeChild(w[S]);w.length=A}}}};function f8(e,t,i,n){n8(e,"dominant-baseline","middle"),n8(e,"text-anchor",c8[t]),n8(e,"x",i),n8(e,"y",n)}function p8(e){e&&e.__textSvgEl&&(e.__textSvgEl.parentNode&&e.__textSvgEl.parentNode.removeChild(e.__textSvgEl),e.__textSvgEl=null,e.__tspanList=[],e.__text=null)}function g8(){}function m8(e,t,i,n){for(var r=0,a=t.length,o=0,s=0;r<a;r++){var l=t[r];if(l.removed){for(u=[],h=s;h<s+l.count;h++)u.push(h);l.indices=u,s+=l.count}else{for(var u=[],h=o;h<o+l.count;h++)u.push(h);l.indices=u,o+=l.count,l.added||(s+=l.count)}}return t}function v8(e){return{newPos:e.newPos,components:e.components.slice(0)}}s8.drawRectText=d8,s8.brush=function(e){null!=e.style.text?d8(e,!1):p8(e)},k6.path=a8,k6.image=o8,k6.text=s8,g8.prototype={diff:function(e,t,i){i||(i=function(e,t){return e===t}),this.equals=i;var n=this;e=e.slice();var r=(t=t.slice()).length,a=e.length,o=1,s=r+a,l=[{newPos:-1,components:[]}],u=this.extractCommon(l[0],t,e,0);if(l[0].newPos+1>=r&&u+1>=a){for(var h=[],c=0;c<t.length;c++)h.push(c);return[{indices:h,count:t.length}]}function d(){for(var i=-1*o;i<=o;i+=2){var s,u=l[i-1],h=l[i+1],c=(h?h.newPos:0)-i;u&&(l[i-1]=void 0);var d=u&&u.newPos+1<r,f=h&&0<=c&&c<a;if(d||f){if(!d||f&&u.newPos<h.newPos?(s=v8(h),n.pushComponent(s.components,void 0,!0)):((s=u).newPos++,n.pushComponent(s.components,!0,void 0)),c=n.extractCommon(s,t,e,i),s.newPos+1>=r&&c+1>=a)return m8(0,s.components);l[i]=s}else l[i]=void 0}o++}for(;o<=s;){var f=d();if(f)return f}},pushComponent:function(e,t,i){var n=e[e.length-1];n&&n.added===t&&n.removed===i?e[e.length-1]={count:n.count+1,added:t,removed:i}:e.push({count:1,added:t,removed:i})},extractCommon:function(e,t,i,n){for(var r=t.length,a=i.length,o=e.newPos,s=o-n,l=0;o+1<r&&s+1<a&&this.equals(t[o+1],i[s+1]);)o++,s++,l++;return l&&e.components.push({count:l}),e.newPos=o,s},tokenize:function(e){return e.slice()},join:function(e){return e.slice()}};var y8=new g8,_8=function(e,t,i){return y8.diff(e,t,i)},x8=z6.createElement,b8=g,w8=dl,T8=Kr,S8=Vl,M8=k6,A8=M8.path,I8=M8.image,C8=M8.text;function D8(e,t,i,n,r){this._zrId=e,this._svgRoot=t,this._tagNames="string"==typeof i?[i]:i,this._markLabel=n,this._domName=r||"_dom",this.nextId=0}D8.prototype.createElement=x8,D8.prototype.getDefs=function(e){var t=this._svgRoot,i=this._svgRoot.getElementsByTagName("defs");return 0===i.length?e?((i=t.insertBefore(this.createElement("defs"),t.firstChild)).contains||(i.contains=function(e){var t=i.children;if(!t)return!1;for(var n=t.length-1;n>=0;--n)if(t[n]===e)return!0;return!1}),i):null:i[0]},D8.prototype.update=function(e,t){if(e){var i=this.getDefs(!1);if(e[this._domName]&&i.contains(e[this._domName]))"function"==typeof t&&t(e);else{var n=this.add(e);n&&(e[this._domName]=n)}}},D8.prototype.addDom=function(e){this.getDefs(!0).appendChild(e)},D8.prototype.removeDom=function(e){var t=this.getDefs(!1);t&&e[this._domName]&&(t.removeChild(e[this._domName]),e[this._domName]=null)},D8.prototype.getDoms=function(){var e=this.getDefs(!1);if(!e)return[];var t=[];return b8.each(this._tagNames,(function(i){var n=e.getElementsByTagName(i);t=t.concat([].slice.call(n))})),t},D8.prototype.markAllUnused=function(){var e=this.getDoms(),t=this;b8.each(e,(function(e){e[t._markLabel]="0"}))},D8.prototype.markUsed=function(e){e&&(e[this._markLabel]="1")},D8.prototype.removeUnused=function(){var e=this.getDefs(!1);if(e){var t=this.getDoms(),i=this;b8.each(t,(function(t){"1"!==t[i._markLabel]&&e.removeChild(t)}))}},D8.prototype.getSvgProxy=function(e){return e instanceof w8?A8:e instanceof T8?I8:e instanceof S8?C8:A8},D8.prototype.getTextSvgElement=function(e){return e.__textSvgEl},D8.prototype.getSvgElement=function(e){return e.__svgEl};var E8=D8,L8=E8,P8=g,N8=ni,R8=ut;function O8(e,t){L8.call(this,e,t,["linearGradient","radialGradient"],"__gradient_in_use__")}P8.inherits(O8,L8),O8.prototype.addWithoutUpdate=function(e,t){if(t&&t.style){var i=this;P8.each(["fill","stroke"],(function(n){if(t.style[n]&&("linear"===t.style[n].type||"radial"===t.style[n].type)){var r,a=t.style[n],o=i.getDefs(!0);a._dom?(r=a._dom,o.contains(a._dom)||i.addDom(r)):r=i.add(a),i.markUsed(t);var s=r.getAttribute("id");e.setAttribute(n,"url(#"+s+")")}}))}},O8.prototype.add=function(e){var t;if("linear"===e.type)t=this.createElement("linearGradient");else{if("radial"!==e.type)return N8("Illegal gradient type."),null;t=this.createElement("radialGradient")}return e.id=e.id||this.nextId++,t.setAttribute("id","zr"+this._zrId+"-gradient-"+e.id),this.updateDom(e,t),this.addDom(t),t},O8.prototype.update=function(e){var t=this;L8.prototype.update.call(this,e,(function(){var i=e.type,n=e._dom.tagName;"linear"===i&&"linearGradient"===n||"radial"===i&&"radialGradient"===n?t.updateDom(e,e._dom):(t.removeDom(e),t.add(e))}))},O8.prototype.updateDom=function(e,t){if("linear"===e.type)t.setAttribute("x1",e.x),t.setAttribute("y1",e.y),t.setAttribute("x2",e.x2),t.setAttribute("y2",e.y2);else{if("radial"!==e.type)return void N8("Illegal gradient type.");t.setAttribute("cx",e.x),t.setAttribute("cy",e.y),t.setAttribute("r",e.r)}e.global?t.setAttribute("gradientUnits","userSpaceOnUse"):t.setAttribute("gradientUnits","objectBoundingBox"),t.innerHTML="";for(var i=e.colorStops,n=0,r=i.length;n<r;++n){var a=this.createElement("stop");a.setAttribute("offset",100*i[n].offset+"%");var o=i[n].color;if(o.indexOf("rgba")>-1){var s=R8.parse(o)[3],l=R8.toHex(o);a.setAttribute("stop-color","#"+l),a.setAttribute("stop-opacity",s)}else a.setAttribute("stop-color",i[n].color);t.appendChild(a)}e._dom=t},O8.prototype.markUsed=function(e){if(e.style){var t=e.style.fill;t&&t._dom&&L8.prototype.markUsed.call(this,t._dom),(t=e.style.stroke)&&t._dom&&L8.prototype.markUsed.call(this,t._dom)}};var k8=O8,z8=E8,B8=g,F8=Ue;function V8(e,t){z8.call(this,e,t,"clipPath","__clippath_in_use__")}B8.inherits(V8,z8),V8.prototype.update=function(e){var t=this.getSvgElement(e);t&&this.updateDom(t,e.__clipPaths,!1);var i=this.getTextSvgElement(e);i&&this.updateDom(i,e.__clipPaths,!0),this.markUsed(e)},V8.prototype.updateDom=function(e,t,i){if(t&&t.length>0){var n,r,a=this.getDefs(!0),o=t[0],s=i?"_textDom":"_dom";o[s]?(r=o[s].getAttribute("id"),n=o[s],a.contains(n)||a.appendChild(n)):(r="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(n=this.createElement("clipPath")).setAttribute("id",r),a.appendChild(n),o[s]=n);var l=this.getSvgProxy(o);if(o.transform&&o.parent.invTransform&&!i){var u=Array.prototype.slice.call(o.transform);F8.mul(o.transform,o.parent.invTransform,o.transform),l.brush(o),o.transform=u}else l.brush(o);var h=this.getSvgElement(o);n.innerHTML="",n.appendChild(h.cloneNode()),e.setAttribute("clip-path","url(#"+r+")"),t.length>1&&this.updateDom(n,t.slice(1),i)}else e&&e.setAttribute("clip-path","none")},V8.prototype.markUsed=function(e){var t=this;e.__clipPaths&&B8.each(e.__clipPaths,(function(e){e._dom&&z8.prototype.markUsed.call(t,e._dom),e._textDom&&z8.prototype.markUsed.call(t,e._textDom)}))};var G8=V8,H8=E8;function U8(e,t){H8.call(this,e,t,["filter"],"__filter_in_use__","_shadowDom")}function W8(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY||e.textShadowBlur||e.textShadowOffsetX||e.textShadowOffsetY)}g.inherits(U8,H8),U8.prototype.addWithoutUpdate=function(e,t){if(t&&W8(t.style)){var i;t._shadowDom?(i=t._shadowDom,this.getDefs(!0).contains(t._shadowDom)||this.addDom(i)):i=this.add(t),this.markUsed(t);var n=i.getAttribute("id");e.style.filter="url(#"+n+")"}},U8.prototype.add=function(e){var t=this.createElement("filter");return e._shadowDomId=e._shadowDomId||this.nextId++,t.setAttribute("id","zr"+this._zrId+"-shadow-"+e._shadowDomId),this.updateDom(e,t),this.addDom(t),t},U8.prototype.update=function(e,t){if(W8(t.style)){var i=this;H8.prototype.update.call(this,t,(function(){i.updateDom(t,t._shadowDom)}))}else this.remove(e,t)},U8.prototype.remove=function(e,t){null!=t._shadowDomId&&(this.removeDom(e),e.style.filter="")},U8.prototype.updateDom=function(e,t){var i=t.getElementsByTagName("feDropShadow");i=0===i.length?this.createElement("feDropShadow"):i[0];var n,r,a,o,s=e.style,l=e.scale&&e.scale[0]||1,u=e.scale&&e.scale[1]||1;if(s.shadowBlur||s.shadowOffsetX||s.shadowOffsetY)n=s.shadowOffsetX||0,r=s.shadowOffsetY||0,a=s.shadowBlur,o=s.shadowColor;else{if(!s.textShadowBlur)return void this.removeDom(t,s);n=s.textShadowOffsetX||0,r=s.textShadowOffsetY||0,a=s.textShadowBlur,o=s.textShadowColor}i.setAttribute("dx",n/l),i.setAttribute("dy",r/u),i.setAttribute("flood-color",o);var h=a/2/l+" "+a/2/u;i.setAttribute("stdDeviation",h),t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width",Math.ceil(a/2*200)+"%"),t.setAttribute("height",Math.ceil(a/2*200)+"%"),t.appendChild(i),e._shadowDom=t},U8.prototype.markUsed=function(e){e._shadowDom&&H8.prototype.markUsed.call(this,e._shadowDom)};var j8=U8,X8=z6.createElement,Z8=g,q8=ni,Y8=dl,K8=Kr,Q8=Vl,J8=_8,$8=k8,e9=G8,t9=j8,i9=k6,n9=i9.path,r9=i9.image,a9=i9.text;function o9(e){return parseInt(e,10)}function s9(e,t){return t&&e&&t.parentNode!==e}function l9(e,t,i){if(s9(e,t)&&i){var n=i.nextSibling;n?e.insertBefore(t,n):e.appendChild(t)}}function u9(e,t){if(s9(e,t)){var i=e.firstChild;i?e.insertBefore(t,i):e.appendChild(t)}}function h9(e,t){t&&e&&t.parentNode===e&&e.removeChild(t)}function c9(e){return e.__textSvgEl}function d9(e){return e.__svgEl}var f9=function(e,t,i,n){this.root=e,this.storage=t,this._opts=i=Z8.extend({},i||{});var r=X8("svg");r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("version","1.1"),r.setAttribute("baseProfile","full"),r.style.cssText="user-select:none;position:absolute;left:0;top:0;";var a=X8("g");r.appendChild(a);var o=X8("g");r.appendChild(o),this.gradientManager=new $8(n,o),this.clipPathManager=new e9(n,o),this.shadowManager=new t9(n,o);var s=document.createElement("div");s.style.cssText="overflow:hidden;position:relative",this._svgDom=r,this._svgRoot=o,this._backgroundRoot=a,this._viewport=s,e.appendChild(s),s.appendChild(r),this.resize(i.width,i.height),this._visibleList=[]};f9.prototype={constructor:f9,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getSvgDom:function(){return this._svgDom},getSvgRoot:function(){return this._svgRoot},getViewportRootOffset:function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},refresh:function(){var e=this.storage.getDisplayList(!0);this._paintList(e)},setBackgroundColor:function(e){this._backgroundRoot&&this._backgroundNode&&this._backgroundRoot.removeChild(this._backgroundNode);var t=X8("rect");t.setAttribute("width",this.getWidth()),t.setAttribute("height",this.getHeight()),t.setAttribute("x",0),t.setAttribute("y",0),t.setAttribute("id",0),t.style.fill=e,this._backgroundRoot.appendChild(t),this._backgroundNode=t},_paintList:function(e){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var t,i,n=this._svgRoot,r=this._visibleList,a=e.length,o=[];for(t=0;t<a;t++){var s=e[t],l=(i=s)instanceof Y8?n9:i instanceof K8?r9:i instanceof Q8?a9:n9,u=d9(s)||c9(s);s.invisible||(s.__dirty&&(l&&l.brush(s),this.clipPathManager.update(s),s.style&&(this.gradientManager.update(s.style.fill),this.gradientManager.update(s.style.stroke),this.shadowManager.update(u,s)),s.__dirty=!1),o.push(s))}var h,c=J8(r,o);for(t=0;t<c.length;t++)if((p=c[t]).removed)for(var d=0;d<p.count;d++){u=d9(s=r[p.indices[d]]);var f=c9(s);h9(n,u),h9(n,f)}for(t=0;t<c.length;t++){var p;if((p=c[t]).added)for(d=0;d<p.count;d++)u=d9(s=o[p.indices[d]]),f=c9(s),h?l9(n,u,h):u9(n,u),u?l9(n,f,u):h?l9(n,f,h):u9(n,f),l9(n,f,u),h=f||u||h,this.gradientManager.addWithoutUpdate(u||f,s),this.shadowManager.addWithoutUpdate(u||f,s),this.clipPathManager.markUsed(s);else if(!p.removed)for(d=0;d<p.count;d++)u=d9(s=o[p.indices[d]]),f=c9(s),u=d9(s),f=c9(s),this.gradientManager.markUsed(s),this.gradientManager.addWithoutUpdate(u||f,s),this.shadowManager.markUsed(s),this.shadowManager.addWithoutUpdate(u||f,s),this.clipPathManager.markUsed(s),f&&l9(n,f,u),h=u||f||h}this.gradientManager.removeUnused(),this.clipPathManager.removeUnused(),this.shadowManager.removeUnused(),this._visibleList=o},_getDefs:function(e){var t,i=this._svgDom;return 0===(t=i.getElementsByTagName("defs")).length?e?((t=i.insertBefore(X8("defs"),i.firstChild)).contains||(t.contains=function(e){var i=t.children;if(!i)return!1;for(var n=i.length-1;n>=0;--n)if(i[n]===e)return!0;return!1}),t):null:t[0]},resize:function(e,t){var i=this._viewport;i.style.display="none";var n=this._opts;if(null!=e&&(n.width=e),null!=t&&(n.height=t),e=this._getSize(0),t=this._getSize(1),i.style.display="",this._width!==e||this._height!==t){this._width=e,this._height=t;var r=i.style;r.width=e+"px",r.height=t+"px";var a=this._svgDom;a.setAttribute("width",e),a.setAttribute("height",t)}this._backgroundNode&&(this._backgroundNode.setAttribute("width",e),this._backgroundNode.setAttribute("height",t))},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(e){var t=this._opts,i=["width","height"][e],n=["clientWidth","clientHeight"][e],r=["paddingLeft","paddingTop"][e],a=["paddingRight","paddingBottom"][e];if(null!=t[i]&&"auto"!==t[i])return parseFloat(t[i]);var o=this.root,s=document.defaultView.getComputedStyle(o);return(o[n]||o9(s[i])||o9(o.style[i]))-(o9(s[r])||0)-(o9(s[a])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._backgroundRoot=this._svgDom=this._backgroundNode=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},toDataURL:function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(this._svgDom.outerHTML.replace(/></g,">\n\r<"))}},Z8.each(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","pathToImage"],(function(e){var t;f9.prototype[e]=(t=e,function(){q8('In SVG mode painter not support method "'+t+'"')})}));var p9,g9=f9;(0,c.registerPainter)("svg",g9),function(e){var t=h;!function(){for(var i in t){if(null==t||!t.hasOwnProperty(i)||"default"===i||"__esModule"===i)return;e[i]=t[i]}}();var i=Oy;!function(){for(var t in i){if(null==i||!i.hasOwnProperty(t)||"default"===t||"__esModule"===t)return;e[t]=i[t]}}()}(u),e("e",t(u)),p9=function(e){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=106)}([function(t,i){t.exports=e},function(e,t,i){var n=i(40),r=i(52),a=i(5),o=i(4),s=i(8),l=i(19),u=i(35),h=i(15),c=i(0),d=i.n(c),f=i(36),p=i(60),g=i.n(p),m=i(61),v=i(124),y=i(125),_=i(129),x=i(130),b=i(2),w=i(132),T=i(43),S=i(76),M=i(133),A=i(134),I=i(135),C=i(136),D=i(41),E=i(37),L=i(26),P=i(3),N=i(137),R=i(56),O=i(138),k=i(139),z=i(140),B=i(9),F=i(74),V=i(54),G=i(18),H=i(59),U=i(141),W=i(146),j=i(71),X=i(147),Z=i(148),q=i(149),Y=i(150),K=i(151),Q=i(152);function J(e){return e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof Image}d.a.util.extend(u.a.prototype,U.a),s.a.import(W.a),s.a.import(j.a),s.a.import(X.a),s.a.import(Z.a),s.a.import(q.a),s.a.import(Y.a),s.a.import(K.a),s.a.import(Q.a);var $=f.a.prototype.addToScene,ee=f.a.prototype.removeFromScene;f.a.prototype.addToScene=function(e){if($.call(this,e),this.__zr){var t=this.__zr;e.traverse((function(e){e.__zr=t,e.addAnimatorsToZr&&e.addAnimatorsToZr(t)}))}},f.a.prototype.removeFromScene=function(e){ee.call(this,e),e.traverse((function(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)}))},l.a.prototype.setTextureImage=function(e,t,i,n){if(this.shader){var r,a,o=i.getZr(),s=this;return s.autoUpdateTextureStatus=!1,s.disableTexture(e),(a=t)&&"none"!==a&&(r=te.loadTexture(t,i,n,(function(t){s.enableTexture(e),o&&o.refresh()})),s.set(e,r)),r}};var te={};te.Renderer=r.a,te.Node=u.a,te.Mesh=n.a,te.Shader=s.a,te.Material=l.a,te.Texture=o.a,te.Texture2D=a.a,te.Geometry=h.a,te.SphereGeometry=w.a,te.PlaneGeometry=T.a,te.CubeGeometry=S.a,te.AmbientLight=M.a,te.DirectionalLight=A.a,te.PointLight=I.a,te.SpotLight=C.a,te.PerspectiveCamera=D.a,te.OrthographicCamera=E.a,te.Vector2=L.a,te.Vector3=P.a,te.Vector4=N.a,te.Quaternion=R.a,te.Matrix2=O.a,te.Matrix2d=k.a,te.Matrix3=z.a,te.Matrix4=B.a,te.Plane=F.a,te.Ray=V.a,te.BoundingBox=G.a,te.Frustum=H.a;var ie=m.a.createBlank("rgba(255,255,255,0)").image;function ne(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}function re(e){if((e.wrapS===o.a.REPEAT||e.wrapT===o.a.REPEAT)&&e.image){var t=ne(e.width),i=ne(e.height);if(t!==e.width||i!==e.height){var n=document.createElement("canvas");n.width=t,n.height=i,n.getContext("2d").drawImage(e.image,0,0,t,i),e.image=n}}}te.loadTexture=function(e,t,i,n){"function"==typeof i&&(n=i,i={}),i=i||{};for(var r=Object.keys(i).sort(),a="",o=0;o<r.length;o++)a+=r[o]+"_"+i[r[o]]+"_";var s,l=t.__textureCache=t.__textureCache||new g.a(20);if((s=e).getZr&&s.setOption){var u=e.__textureid__;if(c=l.get(a+u))c.texture.surface.setECharts(e),n&&n(c.texture);else{var h=new v.a(e);for(h.onupdate=function(){t.getZr().refresh()},c={texture:h.getTexture()},o=0;o<r.length;o++)c.texture[r[o]]=i[r[o]];u=e.__textureid__||"__ecgl_ec__"+c.texture.__uid__,e.__textureid__=u,l.put(a+u,c),n&&n(c.texture)}return c.texture}if(J(e)){var c;if(u=e.__textureid__,!(c=l.get(a+u))){for(c={texture:new te.Texture2D({image:e})},o=0;o<r.length;o++)c.texture[r[o]]=i[r[o]];u=e.__textureid__||"__ecgl_image__"+c.texture.__uid__,e.__textureid__=u,l.put(a+u,c),re(c.texture),n&&n(c.texture)}return c.texture}if(c=l.get(a+e))c.callbacks?c.callbacks.push(n):n&&n(c.texture);else if(e.match(/.hdr$|^data:application\/octet-stream/)){c={callbacks:[n]};var d=m.a.loadTexture(e,{exposure:i.exposure,fileType:"hdr"},(function(){d.dirty(),c.callbacks.forEach((function(e){e&&e(d)})),c.callbacks=null}));c.texture=d,l.put(a+e,c)}else{for(d=new te.Texture2D({image:new Image}),o=0;o<r.length;o++)d[r[o]]=i[r[o]];c={texture:d,callbacks:[n]};var f=d.image;f.onload=function(){d.image=f,re(d),d.dirty(),c.callbacks.forEach((function(e){e&&e(d)})),c.callbacks=null},f.src=e,d.image=ie,l.put(a+e,c)}return c.texture},te.createAmbientCubemap=function(e,t,i,n){var r=(e=e||{}).texture,a=b.a.firstNotNull(e.exposure,1),o=new y.a({intensity:b.a.firstNotNull(e.specularIntensity,1)}),s=new _.a({intensity:b.a.firstNotNull(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 o.cubemap=te.loadTexture(r,i,{exposure:a},(function(){o.cubemap.flipY=!1;var e=Date.now();o.prefilter(t,32);var i=Date.now()-e;console.log("Prefilter environment map: "+i+"ms"),s.coefficients=x.a.projectEnvironmentMap(t,o.cubemap,{lod:1}),n&&n()})),{specular:o,diffuse:s}},te.createBlankTexture=m.a.createBlank,te.isImage=J,te.additiveBlend=function(e){e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE)},te.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=d.a.color.parse(e||"#000",t)||[0,0,0,0])[0]/=255,t[1]/=255,t[2]/=255,t)},te.directionFromAlphaBeta=function(e,t){var i=e/180*Math.PI+Math.PI/2,n=-t/180*Math.PI+Math.PI/2,r=[],a=Math.sin(i);return r[0]=a*Math.cos(n),r[1]=-Math.cos(i),r[2]=a*Math.sin(n),r},te.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},te.COMMON_SHADERS=["lambert","color","realistic","hatching"],te.createShader=function(e){var t=s.a.source(e+".vertex"),i=s.a.source(e+".fragment");t||console.error("Vertex shader of '%s' not exits",e),i||console.error("Fragment shader of '%s' not exits",e);var n=new s.a(t,i);return n.name=e,n},te.createMaterial=function(e,t){t instanceof Array||(t=[t]);var i=te.createShader(e),n=new l.a({shader:i});return t.forEach((function(e){"string"==typeof e&&n.define(e)})),n},te.setMaterialFromModel=function(e,t,i,n){t.autoUpdateTextureStatus=!1;var r=i.getModel(e+"Material"),a=r.get("detailTexture"),o=b.a.firstNotNull(r.get("textureTiling"),1),s=b.a.firstNotNull(r.get("textureOffset"),0);"number"==typeof o&&(o=[o,o]),"number"==typeof s&&(s=[s,s]);var l=o[0]>1||o[1]>1?te.Texture.REPEAT:te.Texture.CLAMP_TO_EDGE,u={anisotropic:8,wrapS:l,wrapT:l};if("realistic"===e){var h=r.get("roughness"),c=r.get("metalness");null!=c?isNaN(c)&&(t.setTextureImage("metalnessMap",c,n,u),c=b.a.firstNotNull(r.get("metalnessAdjust"),.5)):c=0,null!=h?isNaN(h)&&(t.setTextureImage("roughnessMap",h,n,u),h=b.a.firstNotNull(r.get("roughnessAdjust"),.5)):h=.5;var d=r.get("normalTexture");t.setTextureImage("detailMap",a,n,u),t.setTextureImage("normalMap",d,n,u),t.set({roughness:h,metalness:c,detailUvRepeat:o,detailUvOffset:s})}else if("lambert"===e)t.setTextureImage("detailMap",a,n,u),t.set({detailUvRepeat:o,detailUvOffset:s});else if("color"===e)t.setTextureImage("detailMap",a,n,u),t.set({detailUvRepeat:o,detailUvOffset:s});else if("hatching"===e){var f=r.get("hatchingTextures")||[];f.length<6&&console.error("Invalid hatchingTextures.");for(var p=0;p<6;p++)t.setTextureImage("hatch"+(p+1),f[p],n,{anisotropic:8,wrapS:te.Texture.REPEAT,wrapT:te.Texture.REPEAT});t.set({detailUvRepeat:o,detailUvOffset:s})}},te.updateVertexAnimation=function(e,t,i,n){var r=n.get("animation"),a=n.get("animationDurationUpdate"),o=n.get("animationEasingUpdate"),s=i.shadowDepthMaterial;if(r&&t&&a>0&&t.geometry.vertexCount===i.geometry.vertexCount){i.material.define("vertex","VERTEX_ANIMATION"),i.ignorePreZ=!0,s&&s.define("vertex","VERTEX_ANIMATION");for(var l=0;l<e.length;l++)i.geometry.attributes[e[l][0]].value=t.geometry.attributes[e[l][1]].value;i.geometry.dirty(),i.__percent=0,i.material.set("percent",0),i.stopAnimation(),i.animate().when(a,{__percent:1}).during((function(){i.material.set("percent",i.__percent),s&&s.set("percent",i.__percent)})).done((function(){i.ignorePreZ=!1,i.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")})).start(o)}else i.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")},t.a=te},function(e,t,i){var n=i(0),r=i.n(n),a={firstNotNull:function(){for(var e=0,t=arguments.length;e<t;e++)if(null!=arguments[e])return arguments[e]},queryDataIndex:function(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?r.a.util.isArray(t.dataIndex)?r.a.util.map(t.dataIndex,(function(t){return e.indexOfRawIndex(t)})):e.indexOfRawIndex(t.dataIndex):null!=t.name?r.a.util.isArray(t.name)?r.a.util.map(t.name,(function(t){return e.indexOfName(t)})):e.indexOfName(t.name):void 0}};t.a=a},function(e,t,i){var n=i(12),r=function(e,t,i){e=e||0,t=t||0,i=i||0,this.array=n.a.fromValues(e,t,i),this._dirty=!0};r.prototype={constructor:r,add:function(e){return n.a.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t,i){return this.array[0]=e,this.array[1]=t,this.array[2]=i,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 r(this.x,this.y,this.z)},copy:function(e){return n.a.copy(this.array,e.array),this._dirty=!0,this},cross:function(e,t){return n.a.cross(this.array,e.array,t.array),this._dirty=!0,this},dist:function(e){return n.a.dist(this.array,e.array)},distance:function(e){return n.a.distance(this.array,e.array)},div:function(e){return n.a.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return n.a.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return n.a.dot(this.array,e.array)},len:function(){return n.a.len(this.array)},length:function(){return n.a.length(this.array)},lerp:function(e,t,i){return n.a.lerp(this.array,e.array,t.array,i),this._dirty=!0,this},min:function(e){return n.a.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return n.a.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return n.a.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return n.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return n.a.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return n.a.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return n.a.random(this.array,e),this._dirty=!0,this},scale:function(e){return n.a.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return n.a.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return n.a.sqrDist(this.array,e.array)},squaredDistance:function(e){return n.a.squaredDistance(this.array,e.array)},sqrLen:function(){return n.a.sqrLen(this.array)},squaredLength:function(){return n.a.squaredLength(this.array)},sub:function(e){return n.a.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return n.a.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat3:function(e){return n.a.transformMat3(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return n.a.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},transformQuat:function(e){return n.a.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 i=-1/t[2];t[0]=e[0]*t[0]*i,t[1]=e[5]*t[1]*i,t[2]=(e[10]*t[2]+e[14])*i}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){r.eulerFromQuat(this,e,t)},eulerFromMat3:function(e,t){r.eulerFromMat3(this,e,t)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var a=Object.defineProperty;if(a){var o=r.prototype;a(o,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),a(o,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),a(o,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}})}function s(e,t,i){return e<t?t:e>i?i:e}r.add=function(e,t,i){return n.a.add(e.array,t.array,i.array),e._dirty=!0,e},r.set=function(e,t,i,r){n.a.set(e.array,t,i,r),e._dirty=!0},r.copy=function(e,t){return n.a.copy(e.array,t.array),e._dirty=!0,e},r.cross=function(e,t,i){return n.a.cross(e.array,t.array,i.array),e._dirty=!0,e},r.distance=r.dist=function(e,t){return n.a.distance(e.array,t.array)},r.divide=r.div=function(e,t,i){return n.a.divide(e.array,t.array,i.array),e._dirty=!0,e},r.dot=function(e,t){return n.a.dot(e.array,t.array)},r.len=function(e){return n.a.length(e.array)},r.lerp=function(e,t,i,r){return n.a.lerp(e.array,t.array,i.array,r),e._dirty=!0,e},r.min=function(e,t,i){return n.a.min(e.array,t.array,i.array),e._dirty=!0,e},r.max=function(e,t,i){return n.a.max(e.array,t.array,i.array),e._dirty=!0,e},r.multiply=r.mul=function(e,t,i){return n.a.multiply(e.array,t.array,i.array),e._dirty=!0,e},r.negate=function(e,t){return n.a.negate(e.array,t.array),e._dirty=!0,e},r.normalize=function(e,t){return n.a.normalize(e.array,t.array),e._dirty=!0,e},r.random=function(e,t){return n.a.random(e.array,t),e._dirty=!0,e},r.scale=function(e,t,i){return n.a.scale(e.array,t.array,i),e._dirty=!0,e},r.scaleAndAdd=function(e,t,i,r){return n.a.scaleAndAdd(e.array,t.array,i.array,r),e._dirty=!0,e},r.squaredDistance=r.sqrDist=function(e,t){return n.a.sqrDist(e.array,t.array)},r.squaredLength=r.sqrLen=function(e){return n.a.sqrLen(e.array)},r.subtract=r.sub=function(e,t,i){return n.a.subtract(e.array,t.array,i.array),e._dirty=!0,e},r.transformMat3=function(e,t,i){return n.a.transformMat3(e.array,t.array,i.array),e._dirty=!0,e},r.transformMat4=function(e,t,i){return n.a.transformMat4(e.array,t.array,i.array),e._dirty=!0,e},r.transformQuat=function(e,t,i){return n.a.transformQuat(e.array,t.array,i.array),e._dirty=!0,e};var l=Math.atan2,u=Math.asin,h=Math.abs;r.eulerFromQuat=function(e,t,i){e._dirty=!0,t=t.array;var n=e.array,r=t[0],a=t[1],o=t[2],h=t[3],c=r*r,d=a*a,f=o*o,p=h*h;switch(i=(i||"XYZ").toUpperCase()){case"XYZ":n[0]=l(2*(r*h-a*o),p-c-d+f),n[1]=u(s(2*(r*o+a*h),-1,1)),n[2]=l(2*(o*h-r*a),p+c-d-f);break;case"YXZ":n[0]=u(s(2*(r*h-a*o),-1,1)),n[1]=l(2*(r*o+a*h),p-c-d+f),n[2]=l(2*(r*a+o*h),p-c+d-f);break;case"ZXY":n[0]=u(s(2*(r*h+a*o),-1,1)),n[1]=l(2*(a*h-o*r),p-c-d+f),n[2]=l(2*(o*h-r*a),p-c+d-f);break;case"ZYX":n[0]=l(2*(r*h+o*a),p-c-d+f),n[1]=u(s(2*(a*h-r*o),-1,1)),n[2]=l(2*(r*a+o*h),p+c-d-f);break;case"YZX":n[0]=l(2*(r*h-o*a),p-c+d-f),n[1]=l(2*(a*h-r*o),p+c-d-f),n[2]=u(s(2*(r*a+o*h),-1,1));break;case"XZY":n[0]=l(2*(r*h+a*o),p-c+d-f),n[1]=l(2*(r*o+a*h),p+c-d-f),n[2]=u(s(2*(o*h-r*a),-1,1));break;default:console.warn("Unkown order: "+i)}return e},r.eulerFromMat3=function(e,t,i){var n=t.array,r=n[0],a=n[3],o=n[6],c=n[1],d=n[4],f=n[7],p=n[2],g=n[5],m=n[8],v=e.array;switch(i=(i||"XYZ").toUpperCase()){case"XYZ":v[1]=u(s(o,-1,1)),h(o)<.99999?(v[0]=l(-f,m),v[2]=l(-a,r)):(v[0]=l(g,d),v[2]=0);break;case"YXZ":v[0]=u(-s(f,-1,1)),h(f)<.99999?(v[1]=l(o,m),v[2]=l(c,d)):(v[1]=l(-p,r),v[2]=0);break;case"ZXY":v[0]=u(s(g,-1,1)),h(g)<.99999?(v[1]=l(-p,m),v[2]=l(-a,d)):(v[1]=0,v[2]=l(c,r));break;case"ZYX":v[1]=u(-s(p,-1,1)),h(p)<.99999?(v[0]=l(g,m),v[2]=l(c,r)):(v[0]=0,v[2]=l(-a,d));break;case"YZX":v[2]=u(s(c,-1,1)),h(c)<.99999?(v[0]=l(-f,d),v[1]=l(-p,r)):(v[0]=0,v[1]=l(o,m));break;case"XZY":v[2]=u(-s(a,-1,1)),h(a)<.99999?(v[0]=l(g,d),v[1]=l(o,r)):(v[0]=l(-f,m),v[1]=0);break;default:console.warn("Unkown order: "+i)}return e._dirty=!0,e},Object.defineProperties(r,{POSITIVE_X:{get:function(){return new r(1,0,0)}},NEGATIVE_X:{get:function(){return new r(-1,0,0)}},POSITIVE_Y:{get:function(){return new r(0,1,0)}},NEGATIVE_Y:{get:function(){return new r(0,-1,0)}},POSITIVE_Z:{get:function(){return new r(0,0,1)}},NEGATIVE_Z:{get:function(){return new r(0,0,-1)}},UP:{get:function(){return new r(0,1,0)}},ZERO:{get:function(){return new r}}}),t.a=r},function(e,t,i){var n=i(7),r=i(11),a=i(57),o=n.a.extend({width:512,height:512,type:r.a.UNSIGNED_BYTE,format:r.a.RGBA,wrapS:r.a.REPEAT,wrapT:r.a.REPEAT,minFilter:r.a.LINEAR_MIPMAP_LINEAR,magFilter:r.a.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,sRGB:!0,unpackAlignment:4,premultiplyAlpha:!1,dynamic:!1,NPOT:!1,__used:0},(function(){this._cache=new a.a}),{getWebGLTexture:function(e){var t=e.gl,i=this._cache;return i.use(e.__uid__),i.miss("webgl_texture")&&i.put("webgl_texture",t.createTexture()),this.dynamic?this.update(e):i.isDirty()&&(this.update(e),i.fresh()),i.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===r.a.DEPTH_COMPONENT&&(this.useMipmap=!1);var i=e.getGLExtension("EXT_sRGB");this.format!==o.SRGB||i||(this.format=o.RGB),this.format!==o.SRGB_ALPHA||i||(this.format=o.RGBA),this.NPOT=!this.isPowerOfTwo()},getAvailableWrapS:function(){return this.NPOT?r.a.CLAMP_TO_EDGE:this.wrapS},getAvailableWrapT:function(){return this.NPOT?r.a.CLAMP_TO_EDGE:this.wrapT},getAvailableMinFilter:function(){var e=this.minFilter;return this.NPOT||!this.useMipmap?e===r.a.NEAREST_MIPMAP_NEAREST||e===r.a.NEAREST_MIPMAP_LINEAR?r.a.NEAREST:e===r.a.LINEAR_MIPMAP_LINEAR||e===r.a.LINEAR_MIPMAP_NEAREST?r.a.LINEAR: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 i=t.get("webgl_texture");i&&e.gl.deleteTexture(i),t.deleteContext(e.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(o.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e}}),Object.defineProperty(o.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e}}),o.BYTE=r.a.BYTE,o.UNSIGNED_BYTE=r.a.UNSIGNED_BYTE,o.SHORT=r.a.SHORT,o.UNSIGNED_SHORT=r.a.UNSIGNED_SHORT,o.INT=r.a.INT,o.UNSIGNED_INT=r.a.UNSIGNED_INT,o.FLOAT=r.a.FLOAT,o.HALF_FLOAT=36193,o.UNSIGNED_INT_24_8_WEBGL=34042,o.DEPTH_COMPONENT=r.a.DEPTH_COMPONENT,o.DEPTH_STENCIL=r.a.DEPTH_STENCIL,o.ALPHA=r.a.ALPHA,o.RGB=r.a.RGB,o.RGBA=r.a.RGBA,o.LUMINANCE=r.a.LUMINANCE,o.LUMINANCE_ALPHA=r.a.LUMINANCE_ALPHA,o.SRGB=35904,o.SRGB_ALPHA=35906,o.COMPRESSED_RGB_S3TC_DXT1_EXT=33776,o.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777,o.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778,o.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779,o.NEAREST=r.a.NEAREST,o.LINEAR=r.a.LINEAR,o.NEAREST_MIPMAP_NEAREST=r.a.NEAREST_MIPMAP_NEAREST,o.LINEAR_MIPMAP_NEAREST=r.a.LINEAR_MIPMAP_NEAREST,o.NEAREST_MIPMAP_LINEAR=r.a.NEAREST_MIPMAP_LINEAR,o.LINEAR_MIPMAP_LINEAR=r.a.LINEAR_MIPMAP_LINEAR,o.REPEAT=r.a.REPEAT,o.CLAMP_TO_EDGE=r.a.CLAMP_TO_EDGE,o.MIRRORED_REPEAT=r.a.MIRRORED_REPEAT,t.a=o},function(e,t,i){var n=i(4),r=i(11),a=i(14),o=i(73).a.isPowerOfTwo;function s(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}var l=n.a.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 i=this.format,a=this.type,o=!(!this.convertToPOT||this.mipmaps.length||!this.image||this.wrapS!==n.a.REPEAT&&this.wrapT!==n.a.REPEAT||!this.NPOT);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,o?this.wrapS:this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,o?this.wrapT:this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,o?this.magFilter:this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,o?this.minFilter:this.getAvailableMinFilter());var s=e.getGLExtension("EXT_texture_filter_anisotropic");if(s&&this.anisotropic>1&&t.texParameterf(t.TEXTURE_2D,s.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===a&&(e.getGLExtension("OES_texture_half_float")||(a=r.a.FLOAT)),this.mipmaps.length)for(var l=this.width,u=this.height,h=0;h<this.mipmaps.length;h++){var c=this.mipmaps[h];this._updateTextureData(t,c,h,l,u,i,a,!1),l/=2,u/=2}else this._updateTextureData(t,this,0,this.width,this.height,i,a,o),!this.useMipmap||this.NPOT&&!o||t.generateMipmap(t.TEXTURE_2D);t.bindTexture(t.TEXTURE_2D,null)},_updateTextureData:function(e,t,i,r,a,o,l,u){if(t.image){var h=t.image;u&&(this._potCanvas=function(e,t){var i=s(e.width),n=s(e.height);return(t=t||document.createElement("canvas")).width=i,t.height=n,t.getContext("2d").drawImage(e.image,0,0,i,n),t}(this,this._potCanvas),h=this._potCanvas),e.texImage2D(e.TEXTURE_2D,i,o,o,l,h)}else o<=n.a.COMPRESSED_RGBA_S3TC_DXT5_EXT&&o>=n.a.COMPRESSED_RGB_S3TC_DXT1_EXT?e.compressedTexImage2D(e.TEXTURE_2D,i,o,r,a,0,t.pixels):e.texImage2D(e.TEXTURE_2D,i,o,r,a,0,o,l,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 o(this.width)&&o(this.height)},isRenderable:function(){return this.image?"CANVAS"===this.image.nodeName||"VIDEO"===this.image.nodeName||this.image.complete:!(!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 i=a.a.createImage();t&&(i.crossOrigin=t);var n=this;return i.onload=function(){n.dirty(),n.trigger("success",n),i.onload=null},i.onerror=function(){n.trigger("error",n),i.onerror=null},i.src=e,this.image=i,this}});Object.defineProperty(l.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(l.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)}}),t.a=l},function(e,t,i){var n=i(161);t.a=n.a},function(e,t,i){var n=i(110),r=i(53),a=i(23),o=function(){this.__uid__=a.a.genGUID()};o.__initializers__=[function(e){a.a.extend(this,e)}],a.a.extend(o,n.a),a.a.extend(o.prototype,r.a),t.a=o},function(e,t,i){var n=i(23),r=i(14),a=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g,o=/attribute\s+(float|int|vec2|vec3|vec4)\s+([\s\S]*?);/g,s=/#define\s+(\w+)?(\s+[\d-.]+)?\s*;?\s*\n/g,l={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 u(e){for(var t=[],i=0;i<e;i++)t[i]=0;return t}var h={bool:function(){return!0},int:function(){return 0},float:function(){return 0},sampler2D:function(){return null},samplerCube:function(){return null},vec2:function(){return u(2)},vec3:function(){return u(3)},vec4:function(){return u(4)},ivec2:function(){return u(2)},ivec3:function(){return u(3)},ivec4:function(){return u(4)},mat2:function(){return u(4)},mat3:function(){return u(9)},mat4:function(){return u(16)},array:function(){return[]}},c=["POSITION","NORMAL","BINORMAL","TANGENT","TEXCOORD","TEXCOORD_0","TEXCOORD_1","COLOR","JOINT","WEIGHT"],d=["SKIN_MATRIX","VIEWPORT_SIZE","VIEWPORT","DEVICEPIXELRATIO","WINDOW_SIZE","NEAR","FAR","TIME"],f=["WORLD","VIEW","PROJECTION","WORLDVIEW","VIEWPROJECTION","WORLDVIEWPROJECTION","WORLDINVERSE","VIEWINVERSE","PROJECTIONINVERSE","WORLDVIEWINVERSE","VIEWPROJECTIONINVERSE","WORLDVIEWPROJECTIONINVERSE","WORLDTRANSPOSE","VIEWTRANSPOSE","PROJECTIONTRANSPOSE","WORLDVIEWTRANSPOSE","VIEWPROJECTIONTRANSPOSE","WORLDVIEWPROJECTIONTRANSPOSE","WORLDINVERSETRANSPOSE","VIEWINVERSETRANSPOSE","PROJECTIONINVERSETRANSPOSE","WORLDVIEWINVERSETRANSPOSE","VIEWPROJECTIONINVERSETRANSPOSE","WORLDVIEWPROJECTIONINVERSETRANSPOSE"],p={vec4:4,vec3:3,vec2:2,float:1},g={},m={};function v(e){return e.replace(/[ \t]*\/\/.*\n/g,"").replace(/[ \t]*\/\*[\s\S]*?\*\//g,"")}function y(){console.error("Wrong uniform/attributes syntax")}function _(e,t){for(var i=/[,=\(\):]/,n=t.replace(/:\s*\[\s*(.*)\s*\]/g,"="+e+"($1)").replace(/\s+/g,"").split(/(?=[,=\(\):])/g),a=[],o=0;o<n.length;o++)n[o].match(i)?a.push(n[o].charAt(0),n[o].slice(1)):a.push(n[o]);var s,l=0,u={},h=null;function p(e){e||y();var t=e.match(/\[(.*?)\]/);s=e.replace(/\[(.*?)\]/,""),u[s]={},t&&(u[s].isArray=!0,u[s].arraySize=t[1])}for(p((n=a)[0]),o=1;o<n.length;o++){var g=n[o];if(g)if("="!==g)if(":"!==g)if(","!==g)if(")"!==g)if("("!==g)if(g.indexOf("vec")>=0){if(1!==l&&4!==l){y();break}l=2,h=[]}else if(1!==l)if(4!==l)p(g),l=0;else{var m=g;c.indexOf(m)>=0||d.indexOf(m)>=0||f.indexOf(m)>=0?u[s].semantic=m:"ignore"===m||"unconfigurable"===m?u[s].ignore=!0:u[s].value="bool"===e?"true"===m:parseFloat(m)}else u[s].value="bool"===e?"true"===g:parseFloat(g),h=null;else{if(2!==l){y();break}if(!(h instanceof Array)){y();break}h.push(+n[++o])}else u[s].value=new r.a.Float32Array(h),h=null,l=5;else if(2===l){if(!(h instanceof Array)){y();break}h.push(+n[++o])}else l=5;else l=4;else{if(0!==l&&3!==l){y();break}l=1}}return u}function x(e,t){"object"==typeof e&&(t=e.fragment,e=e.vertex),e=v(e),t=v(t),this._shaderID=function(e,t){var i="vertex:"+e+"fragment:"+t;if(g[i])return g[i];var r=n.a.genGUID();return g[i]=r,m[r]={vertex:e,fragment:t},r}(e,t),this._vertexCode=x.parseImport(e),this._fragmentCode=x.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()}x.prototype={constructor:x,createUniforms:function(){var e={};for(var t in this.uniformTemplates){var i=this.uniformTemplates[t];e[t]={type:i.type,value:i.value()}}return e},_parseImport:function(){this._vertexCode=x.parseImport(this.vertex),this._fragmentCode=x.parseImport(this.fragment)},_addSemanticUniform:function(e,t,i){if(c.indexOf(i)>=0)this.attributeSemantics[i]={symbol:e,type:t};else if(f.indexOf(i)>=0){var n=!1,r=i;i.match(/TRANSPOSE$/)&&(n=!0,r=i.slice(0,-9)),this.matrixSemantics[i]={symbol:e,type:t,isTranspose:n,semanticNoTranspose:r}}else d.indexOf(i)>=0&&(this.uniformSemantics[i]={symbol:e,type:t})},_addMaterialUniform:function(e,t,i,n,r,a){a[e]={type:i,value:r?h.array:n||h[t],semantic:null}},_parseUniforms:function(){var e={},t=this;function i(e){return null!=e?function(){return e}:null}function n(n,r,a){var o=_(r,a),s=[];for(var u in o){var h=o[u],c=h.semantic,d=u,f=l[r],p=i(o[u].value);o[u].isArray&&(d+="["+o[u].arraySize+"]",f+="v"),s.push(d),t._uniformList.push(u),h.ignore||("sampler2D"!==r&&"samplerCube"!==r||(t.textures[u]={shaderType:"fragment",type:r}),c?t._addSemanticUniform(u,f,c):t._addMaterialUniform(u,r,f,p,o[u].isArray,e))}return s.length>0?"uniform "+r+" "+s.join(",")+";\n":""}this._uniformList=[],this._vertexCode=this._vertexCode.replace(a,n),this._fragmentCode=this._fragmentCode.replace(a,n),t.matrixSemanticKeys=Object.keys(this.matrixSemantics),this.uniformTemplates=e},_parseAttributes:function(){var e={},t=this;this._vertexCode=this._vertexCode.replace(o,(function(i,n,r){var a=_(n,r),o=p[n]||1,s=[];for(var l in a){var u=a[l].semantic;if(e[l]={type:"float",size:o,semantic:u||null},u){if(c.indexOf(u)<0)throw new Error('Unkown semantic "'+u+'"');t.attributeSemantics[u]={symbol:l,type:n}}s.push(l)}return"attribute "+n+" "+s.join(",")+";\n"})),this.attributes=e},_parseDefines:function(){var e=this;function t(t,i,n){var r=e.fragmentDefines;return r[i]||(r[i]="false"!==n&&("true"===n||(n?isNaN(parseFloat(n))?n.trim():parseFloat(n):null))),""}this._vertexCode=this._vertexCode.replace(s,t),this._fragmentCode=this._fragmentCode.replace(s,t)},clone:function(){var e=m[this._shaderID];return new x(e.vertex,e.fragment)}},Object.defineProperty&&(Object.defineProperty(x.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(x.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(x.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(x.prototype,"uniforms",{get:function(){return this._uniformList}}));var b=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;x.parseImport=function(e){return e=e.replace(b,(function(e,t,i){return(e=x.source(i))?x.parseImport(e):(console.error('Shader chunk "'+i+'" not existed in library'),"")}))};var w=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;x.import=function(e){e.replace(w,(function(e,t,i,n){if(n=n.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"")){for(var r,a=i.split("."),o=x.codes,s=0;s<a.length-1;)o[r=a[s++]]||(o[r]={}),o=o[r];o[r=a[s]]=n}return n}))},x.codes={},x.source=function(e){for(var t=e.split("."),i=x.codes,n=0;i&&n<t.length;)i=i[t[n++]];return"string"!=typeof i?(console.error('Shader "'+e+'" not existed in library'),""):i},t.a=x},function(e,t,i){var n,r,a,o,s=i(21),l=i(12),u=i(55),h=i(34),c=i(3),d=function(){this._axisX=new c.a,this._axisY=new c.a,this._axisZ=new c.a,this.array=s.a.create(),this._dirty=!0};d.prototype={constructor:d,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 s.a.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new d).copy(this)},copy:function(e){return s.a.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return s.a.determinant(this.array)},fromQuat:function(e){return s.a.fromQuat(this.array,e.array),this._dirty=!0,this},fromRotationTranslation:function(e,t){return s.a.fromRotationTranslation(this.array,e.array,t.array),this._dirty=!0,this},fromMat2d:function(e){return d.fromMat2d(this,e),this},frustum:function(e,t,i,n,r,a){return s.a.frustum(this.array,e,t,i,n,r,a),this._dirty=!0,this},identity:function(){return s.a.identity(this.array),this._dirty=!0,this},invert:function(){return s.a.invert(this.array,this.array),this._dirty=!0,this},lookAt:function(e,t,i){return s.a.lookAt(this.array,e.array,t.array,i.array),this._dirty=!0,this},mul:function(e){return s.a.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return s.a.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return s.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return s.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},ortho:function(e,t,i,n,r,a){return s.a.ortho(this.array,e,t,i,n,r,a),this._dirty=!0,this},perspective:function(e,t,i,n){return s.a.perspective(this.array,e,t,i,n),this._dirty=!0,this},rotate:function(e,t){return s.a.rotate(this.array,this.array,e,t.array),this._dirty=!0,this},rotateX:function(e){return s.a.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return s.a.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return s.a.rotateZ(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return s.a.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return s.a.translate(this.array,this.array,e.array),this._dirty=!0,this},transpose:function(){return s.a.transpose(this.array,this.array),this._dirty=!0,this},decomposeMatrix:(n=l.a.create(),r=l.a.create(),a=l.a.create(),o=h.a.create(),function(e,t,i){var s=this.array;l.a.set(n,s[0],s[1],s[2]),l.a.set(r,s[4],s[5],s[6]),l.a.set(a,s[8],s[9],s[10]);var c=l.a.length(n),d=l.a.length(r),f=l.a.length(a);this.determinant()<0&&(c=-c),e&&e.set(c,d,f),i.set(s[12],s[13],s[14]),h.a.fromMat4(o,s),o[0]/=c,o[1]/=c,o[2]/=c,o[3]/=d,o[4]/=d,o[5]/=d,o[6]/=f,o[7]/=f,o[8]/=f,u.a.fromMat3(t.array,o),u.a.normalize(t.array,t.array),t._dirty=!0,i._dirty=!0}),toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var f=Object.defineProperty;if(f){var p=d.prototype;f(p,"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}}),f(p,"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}}),f(p,"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}})}d.adjoint=function(e,t){return s.a.adjoint(e.array,t.array),e._dirty=!0,e},d.copy=function(e,t){return s.a.copy(e.array,t.array),e._dirty=!0,e},d.determinant=function(e){return s.a.determinant(e.array)},d.identity=function(e){return s.a.identity(e.array),e._dirty=!0,e},d.ortho=function(e,t,i,n,r,a,o){return s.a.ortho(e.array,t,i,n,r,a,o),e._dirty=!0,e},d.perspective=function(e,t,i,n,r){return s.a.perspective(e.array,t,i,n,r),e._dirty=!0,e},d.lookAt=function(e,t,i,n){return s.a.lookAt(e.array,t.array,i.array,n.array),e._dirty=!0,e},d.invert=function(e,t){return s.a.invert(e.array,t.array),e._dirty=!0,e},d.multiply=d.mul=function(e,t,i){return s.a.mul(e.array,t.array,i.array),e._dirty=!0,e},d.fromQuat=function(e,t){return s.a.fromQuat(e.array,t.array),e._dirty=!0,e},d.fromRotationTranslation=function(e,t,i){return s.a.fromRotationTranslation(e.array,t.array,i.array),e._dirty=!0,e},d.fromMat2d=function(e,t){return e._dirty=!0,t=t.array,(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},d.rotate=function(e,t,i,n){return s.a.rotate(e.array,t.array,i,n.array),e._dirty=!0,e},d.rotateX=function(e,t,i){return s.a.rotateX(e.array,t.array,i),e._dirty=!0,e},d.rotateY=function(e,t,i){return s.a.rotateY(e.array,t.array,i),e._dirty=!0,e},d.rotateZ=function(e,t,i){return s.a.rotateZ(e.array,t.array,i),e._dirty=!0,e},d.scale=function(e,t,i){return s.a.scale(e.array,t.array,i.array),e._dirty=!0,e},d.transpose=function(e,t){return s.a.transpose(e.array,t.array),e._dirty=!0,e},d.translate=function(e,t,i){return s.a.translate(e.array,t.array,i.array),e._dirty=!0,e},t.a=d},function(e,t,i){var n=i(7),r=i(4);i(27);var a=i(11),o=i(57),s="framebuffer",l="renderbuffer",u="renderbuffer_width",h="renderbuffer_height",c="renderbuffer_attached",d="depthtexture_attached",f=a.a.FRAMEBUFFER,p=a.a.RENDERBUFFER,g=a.a.DEPTH_ATTACHMENT,m=a.a.COLOR_ATTACHMENT0,v=n.a.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},(function(){this._cache=new o.a,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(f,this._getFrameBufferGL(e)),this._boundRenderer=e;var i=this._cache;i.put("viewport",e.viewport);var n,r,a=!1;for(var o in this._textures){a=!0;var s=this._textures[o];s&&(n=s.texture.width,r=s.texture.height,this._doAttach(e,s.texture,o,s.target))}this._width=n,this._height=r,!a&&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,n,r,1);var m=i.get("attached_textures");if(m)for(var o in m)if(!this._textures[o]){var v=m[o];this._doDetach(t,o,v)}if(!i.get(d)&&this.depthBuffer){i.miss(l)&&i.put(l,t.createRenderbuffer());var y=i.get(l);n===i.get(u)&&r===i.get(h)||(t.bindRenderbuffer(p,y),t.renderbufferStorage(p,t.DEPTH_COMPONENT16,n,r),i.put(u,n),i.put(h,r),t.bindRenderbuffer(p,null)),i.get(c)||(t.framebufferRenderbuffer(f,g,p,y),i.put(c,!0))}},unbind:function(e){e.__currentFrameBuffer=null,e.gl.bindFramebuffer(f,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 i in this._textures){var n=this._textures[i];if(n){var o=n.texture;if(!o.NPOT&&o.useMipmap&&o.minFilter===r.a.LINEAR_MIPMAP_LINEAR){var s="textureCube"===o.textureType?a.a.TEXTURE_CUBE_MAP:a.a.TEXTURE_2D;t.bindTexture(s,o.getWebGLTexture(e)),t.generateMipmap(s),t.bindTexture(s,null)}}}},checkStatus:function(e){return e.checkFramebufferStatus(f)},_getFrameBufferGL:function(e){var t=this._cache;return t.use(e.__uid__),t.miss(s)&&t.put(s,e.gl.createFramebuffer()),t.get(s)},attach:function(e,t,i){if(!e.width)throw new Error("The texture attached to color buffer is not a valid.");t=t||m,i=i||a.a.TEXTURE_2D;var n,r=this._boundRenderer;if(r&&r.gl){var o=this._cache;o.use(r.__uid__),n=o.get("attached_textures")}var s=this._textures[t];if(!s||s.target!==i||s.texture!==e||!n||null==n[t]){var l=!0;r&&(l=this._doAttach(r,e,t,i),this.viewport||r.setViewport(0,0,e.width,e.height,1)),l&&(this._textures[t]=this._textures[t]||{},this._textures[t].texture=e,this._textures[t].target=i)}},_doAttach:function(e,t,i,n){var r=e.gl,o=t.getWebGLTexture(e),s=this._cache.get("attached_textures");if(s&&s[i]){var u=s[i];if(u.texture===t&&u.target===n)return}var h=!0;if(((i=+i)===g||i===a.a.DEPTH_STENCIL_ATTACHMENT)&&(e.getGLExtension("WEBGL_depth_texture")||(console.error("Depth texture is not supported by the browser"),h=!1),t.format!==a.a.DEPTH_COMPONENT&&t.format!==a.a.DEPTH_STENCIL&&(console.error("The texture attached to depth buffer is not a valid."),h=!1),h)){var m=this._cache.get(l);m&&(r.framebufferRenderbuffer(f,g,p,null),r.deleteRenderbuffer(m),this._cache.put(l,!1)),this._cache.put(c,!1),this._cache.put(d,!0)}return r.framebufferTexture2D(f,i,n,o,0),s||(s={},this._cache.put("attached_textures",s)),s[i]=s[i]||{},s[i].texture=t,s[i].target=n,h},_doDetach:function(e,t,i){e.framebufferTexture2D(f,t,i,null,0);var n=this._cache.get("attached_textures");n&&n[t]&&(n[t]=null),t!==g&&t!==a.a.DEPTH_STENCIL_ATTACHMENT||this._cache.put(d,!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,i=this._cache;i.use(e.__uid__);var n=i.get(l);n&&t.deleteRenderbuffer(n);var r=i.get(s);r&&t.deleteFramebuffer(r),i.deleteContext(e.__uid__),this._textures={}}});v.DEPTH_ATTACHMENT=g,v.COLOR_ATTACHMENT0=m,v.STENCIL_ATTACHMENT=a.a.STENCIL_ATTACHMENT,v.DEPTH_STENCIL_ATTACHMENT=a.a.DEPTH_STENCIL_ATTACHMENT,t.a=v},function(e,t,i){t.a={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444}},function(e,t,i){var n,r=i(20),a={create:function(){var e=new r.a(3);return e[0]=0,e[1]=0,e[2]=0,e},clone:function(e){var t=new r.a(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},fromValues:function(e,t,i){var n=new r.a(3);return n[0]=e,n[1]=t,n[2]=i,n},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},set:function(e,t,i,n){return e[0]=t,e[1]=i,e[2]=n,e},add:function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e},subtract:function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e}};a.sub=a.subtract,a.multiply=function(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e[2]=t[2]*i[2],e},a.mul=a.multiply,a.divide=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e[2]=t[2]/i[2],e},a.div=a.divide,a.min=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e[2]=Math.min(t[2],i[2]),e},a.max=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e},a.scale=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e},a.scaleAndAdd=function(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e[2]=t[2]+i[2]*n,e},a.distance=function(e,t){var i=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(i*i+n*n+r*r)},a.dist=a.distance,a.squaredDistance=function(e,t){var i=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2];return i*i+n*n+r*r},a.sqrDist=a.squaredDistance,a.length=function(e){var t=e[0],i=e[1],n=e[2];return Math.sqrt(t*t+i*i+n*n)},a.len=a.length,a.squaredLength=function(e){var t=e[0],i=e[1],n=e[2];return t*t+i*i+n*n},a.sqrLen=a.squaredLength,a.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},a.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e},a.normalize=function(e,t){var i=t[0],n=t[1],r=t[2],a=i*i+n*n+r*r;return a>0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e},a.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},a.cross=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=i[0],s=i[1],l=i[2];return e[0]=r*l-a*s,e[1]=a*o-n*l,e[2]=n*s-r*o,e},a.lerp=function(e,t,i,n){var r=t[0],a=t[1],o=t[2];return e[0]=r+n*(i[0]-r),e[1]=a+n*(i[1]-a),e[2]=o+n*(i[2]-o),e},a.random=function(e,t){t=t||1;var i=2*Object(r.c)()*Math.PI,n=2*Object(r.c)()-1,a=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(i)*a,e[1]=Math.sin(i)*a,e[2]=n*t,e},a.transformMat4=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=i[3]*n+i[7]*r+i[11]*a+i[15];return o=o||1,e[0]=(i[0]*n+i[4]*r+i[8]*a+i[12])/o,e[1]=(i[1]*n+i[5]*r+i[9]*a+i[13])/o,e[2]=(i[2]*n+i[6]*r+i[10]*a+i[14])/o,e},a.transformMat3=function(e,t,i){var n=t[0],r=t[1],a=t[2];return e[0]=n*i[0]+r*i[3]+a*i[6],e[1]=n*i[1]+r*i[4]+a*i[7],e[2]=n*i[2]+r*i[5]+a*i[8],e},a.transformQuat=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=i[0],s=i[1],l=i[2],u=i[3],h=u*n+s*a-l*r,c=u*r+l*n-o*a,d=u*a+o*r-s*n,f=-o*n-s*r-l*a;return e[0]=h*u+f*-o+c*-l-d*-s,e[1]=c*u+f*-s+d*-o-h*-l,e[2]=d*u+f*-l+h*-s-c*-o,e},a.rotateX=function(e,t,i,n){var r=[],a=[];return r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],a[0]=r[0],a[1]=r[1]*Math.cos(n)-r[2]*Math.sin(n),a[2]=r[1]*Math.sin(n)+r[2]*Math.cos(n),e[0]=a[0]+i[0],e[1]=a[1]+i[1],e[2]=a[2]+i[2],e},a.rotateY=function(e,t,i,n){var r=[],a=[];return r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],a[0]=r[2]*Math.sin(n)+r[0]*Math.cos(n),a[1]=r[1],a[2]=r[2]*Math.cos(n)-r[0]*Math.sin(n),e[0]=a[0]+i[0],e[1]=a[1]+i[1],e[2]=a[2]+i[2],e},a.rotateZ=function(e,t,i,n){var r=[],a=[];return r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],a[0]=r[0]*Math.cos(n)-r[1]*Math.sin(n),a[1]=r[0]*Math.sin(n)+r[1]*Math.cos(n),a[2]=r[2],e[0]=a[0]+i[0],e[1]=a[1]+i[1],e[2]=a[2]+i[2],e},a.forEach=(n=a.create(),function(e,t,i,r,a,o){var s,l;for(t||(t=3),i||(i=0),l=r?Math.min(r*t+i,e.length):e.length,s=i;s<l;s+=t)n[0]=e[s],n[1]=e[s+1],n[2]=e[s+2],a(n,n,o),e[s]=n[0],e[s+1]=n[1],e[s+2]=n[2];return e}),a.angle=function(e,t){var i=a.fromValues(e[0],e[1],e[2]),n=a.fromValues(t[0],t[1],t[2]);a.normalize(i,i),a.normalize(n,n);var r=a.dot(i,n);return r>1?0:Math.acos(r)},t.a=a},function(e,t){var i={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},n={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},r=Object.prototype.toString,a=Array.prototype,o=a.forEach,s=a.filter,l=a.slice,u=a.map,h=a.reduce,c={};function d(e){if(null==e||"object"!=typeof e)return e;var t=e,a=r.call(e);if("[object Array]"===a){if(!S(e)){t=[];for(var o=0,s=e.length;o<s;o++)t[o]=d(e[o])}}else if(n[a]){if(!S(e)){var l=e.constructor;if(e.constructor.from)t=l.from(e);else for(t=new l(e.length),o=0,s=e.length;o<s;o++)t[o]=d(e[o])}}else if(!i[a]&&!S(e)&&!w(e))for(var u in t={},e)e.hasOwnProperty(u)&&(t[u]=d(e[u]));return t}function f(e,t,i){if(!x(t)||!x(e))return i?d(t):e;for(var n in t)if(t.hasOwnProperty(n)){var r=e[n],a=t[n];!x(a)||!x(r)||_(a)||_(r)||w(a)||w(r)||b(a)||b(r)||S(a)||S(r)?!i&&n in e||(e[n]=d(t[n])):f(r,a,i)}return e}function p(e,t,i){for(var n in t)t.hasOwnProperty(n)&&(i?null!=t[n]:null==e[n])&&(e[n]=t[n]);return e}var g,m=function(){return c.createCanvas()};function v(e,t,i){if(e&&t)if(e.forEach&&e.forEach===o)e.forEach(t,i);else if(e.length===+e.length)for(var n=0,r=e.length;n<r;n++)t.call(i,e[n],n,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(i,e[a],a,e)}function y(e,t){var i=l.call(arguments,2);return function(){return e.apply(t,i.concat(l.call(arguments)))}}function _(e){return"[object Array]"===r.call(e)}function x(e){var t=typeof e;return"function"===t||!!e&&"object"==t}function b(e){return!!i[r.call(e)]}function w(e){return"object"==typeof e&&"number"==typeof e.nodeType&&"object"==typeof e.ownerDocument}c.createCanvas=function(){return document.createElement("canvas")};var T="__ec_primitive__";function S(e){return e[T]}function M(e){var t=_(e),i=this;function n(e,n){t?i.set(e,n):i.set(n,e)}e instanceof M?e.each(n):e&&v(e,n)}M.prototype={constructor:M,get:function(e){return this.hasOwnProperty(e)?this[e]:null},set:function(e,t){return this[e]=t},each:function(e,t){for(var i in void 0!==t&&(e=y(e,t)),this)this.hasOwnProperty(i)&&e(this[i],i)},removeKey:function(e){delete this[e]}},t.$override=function(e,t){"createCanvas"===e&&(g=null),c[e]=t},t.clone=d,t.merge=f,t.mergeAll=function(e,t){for(var i=e[0],n=1,r=e.length;n<r;n++)i=f(i,e[n],t);return i},t.extend=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},t.defaults=p,t.createCanvas=m,t.getContext=function(){return g||(g=m().getContext("2d")),g},t.indexOf=function(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i}return-1},t.inherits=function(e,t){var i=e.prototype;function n(){}for(var r in n.prototype=t.prototype,e.prototype=new n,i)e.prototype[r]=i[r];e.prototype.constructor=e,e.superClass=t},t.mixin=function(e,t,i){p(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,i)},t.isArrayLike=function(e){if(e)return"string"!=typeof e&&"number"==typeof e.length},t.each=v,t.map=function(e,t,i){if(e&&t){if(e.map&&e.map===u)return e.map(t,i);for(var n=[],r=0,a=e.length;r<a;r++)n.push(t.call(i,e[r],r,e));return n}},t.reduce=function(e,t,i,n){if(e&&t){if(e.reduce&&e.reduce===h)return e.reduce(t,i,n);for(var r=0,a=e.length;r<a;r++)i=t.call(n,i,e[r],r,e);return i}},t.filter=function(e,t,i){if(e&&t){if(e.filter&&e.filter===s)return e.filter(t,i);for(var n=[],r=0,a=e.length;r<a;r++)t.call(i,e[r],r,e)&&n.push(e[r]);return n}},t.find=function(e,t,i){if(e&&t)for(var n=0,r=e.length;n<r;n++)if(t.call(i,e[n],n,e))return e[n]},t.bind=y,t.curry=function(e){var t=l.call(arguments,1);return function(){return e.apply(this,t.concat(l.call(arguments)))}},t.isArray=_,t.isFunction=function(e){return"function"==typeof e},t.isString=function(e){return"[object String]"===r.call(e)},t.isObject=x,t.isBuiltInObject=b,t.isTypedArray=function(e){return!!n[r.call(e)]},t.isDom=w,t.eqNaN=function(e){return e!=e},t.retrieve=function(e){for(var t=0,i=arguments.length;t<i;t++)if(null!=arguments[t])return arguments[t]},t.retrieve2=function(e,t){return null!=e?e:t},t.retrieve3=function(e,t,i){return null!=e?e:null!=t?t:i},t.slice=function(){return Function.call.apply(l,arguments)},t.normalizeCssArray=function(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},t.assert=function(e,t){if(!e)throw new Error(t)},t.trim=function(e){return null==e?null:"function"==typeof e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},t.setAsPrimitive=function(e){e[T]=!0},t.isPrimitive=S,t.createHashMap=function(e){return new M(e)},t.concatArray=function(e,t){for(var i=new e.constructor(e.length+t.length),n=0;n<e.length;n++)i[n]=e[n];var r=e.length;for(n=0;n<t.length;n++)i[n+r]=t[n];return i},t.noop=function(){}},function(e,t,i){(function(e){var n,r=i(112),a={supportWebGL:function(){if(null==n)try{var e=document.createElement("canvas");if(!e.getContext("webgl")&&!e.getContext("experimental-webgl"))throw new Error}catch(m9){n=!1}return n}};a.Int8Array="undefined"==typeof Int8Array?Array:Int8Array,a.Uint8Array="undefined"==typeof Uint8Array?Array:Uint8Array,a.Uint16Array="undefined"==typeof Uint16Array?Array:Uint16Array,a.Uint32Array="undefined"==typeof Uint32Array?Array:Uint32Array,a.Int16Array="undefined"==typeof Int16Array?Array:Int16Array,a.Float32Array="undefined"==typeof Float32Array?Array:Float32Array,a.Float64Array="undefined"==typeof Float64Array?Array:Float64Array;var o={};"undefined"!=typeof window?o=window:void 0!==e&&(o=e),a.requestAnimationFrame=o.requestAnimationFrame||o.msRequestAnimationFrame||o.mozRequestAnimationFrame||o.webkitRequestAnimationFrame||function(e){setTimeout(e,16)},a.createCanvas=function(){return document.createElement("canvas")},a.createImage=function(){return new o.Image},a.request={get:r.a.get},t.a=a}).call(t,i(68))},function(e,t,i){var n=i(14),r=i(12),a=i(21),o=i(18),s=i(118),l=r.a.create,u=r.a.add,h=r.a.set,c=s.a.Attribute,d=s.a.extend((function(){return{attributes:{position:new c("position","float",3,"POSITION"),texcoord0:new c("texcoord0","float",2,"TEXCOORD_0"),texcoord1:new c("texcoord1","float",2,"TEXCOORD_1"),normal:new c("normal","float",3,"NORMAL"),tangent:new c("tangent","float",4,"TANGENT"),color:new c("color","float",4,"COLOR"),weight:new c("weight","float",3,"WEIGHT"),joint:new c("joint","float",4,"JOINT"),barycentric:new c("barycentric","float",3,null)},boundingBox:null}}),{mainAttribute:"position",updateBoundingBox:function(){var e=this.boundingBox;e||(e=this.boundingBox=new o.a);var t=this.attributes.position.value;if(t&&t.length){var i=e.min,n=e.max,a=i.array,s=n.array;r.a.set(a,t[0],t[1],t[2]),r.a.set(s,t[0],t[1],t[2]);for(var l=3;l<t.length;){var u=t[l++],h=t[l++],c=t[l++];u<a[0]&&(a[0]=u),h<a[1]&&(a[1]=h),c<a[2]&&(a[2]=c),u>s[0]&&(s[0]=u),h>s[1]&&(s[1]=h),c>s[2]&&(s[2]=c)}i._dirty=!0,n._dirty=!0}},generateVertexNormals:function(){if(this.vertexCount){var e=this.indices,t=this.attributes,i=t.position.value,a=t.normal.value;if(a&&a.length===i.length)for(var o=0;o<a.length;o++)a[o]=0;else a=t.normal.value=new n.a.Float32Array(i.length);for(var s,u,c,d=l(),f=l(),p=l(),g=l(),m=l(),v=l(),y=e?e.length:this.vertexCount,_=0;_<y;)for(e?(s=e[_++],u=e[_++],c=e[_++]):(s=_++,u=_++,c=_++),h(d,i[3*s],i[3*s+1],i[3*s+2]),h(f,i[3*u],i[3*u+1],i[3*u+2]),h(p,i[3*c],i[3*c+1],i[3*c+2]),r.a.sub(g,d,f),r.a.sub(m,f,p),r.a.cross(v,g,m),o=0;o<3;o++)a[3*s+o]=a[3*s+o]+v[o],a[3*u+o]=a[3*u+o]+v[o],a[3*c+o]=a[3*c+o]+v[o];for(o=0;o<a.length;)h(v,a[o],a[o+1],a[o+2]),r.a.normalize(v,v),a[o++]=v[0],a[o++]=v[1],a[o++]=v[2];this.dirty()}},generateFaceNormals:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var e=this.indices,t=this.attributes,i=t.position.value,n=t.normal.value,a=l(),o=l(),s=l(),u=l(),c=l(),d=l();n||(n=t.normal.value=new Float32Array(i.length));for(var f,p,g,m=e?e.length:this.vertexCount,v=0;v<m;){e?(f=e[v++],p=e[v++],g=e[v++]):(f=v++,p=v++,g=v++),h(a,i[3*f],i[3*f+1],i[3*f+2]),h(o,i[3*p],i[3*p+1],i[3*p+2]),h(s,i[3*g],i[3*g+1],i[3*g+2]),r.a.sub(u,a,o),r.a.sub(c,o,s),r.a.cross(d,u,c),r.a.normalize(d,d);for(var y=0;y<3;y++)n[3*f+y]=d[y],n[3*p+y]=d[y],n[3*g+y]=d[y]}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 i=t.texcoord0.value,n=t.position.value,a=t.tangent.value,o=t.normal.value;if(i){for(var s=[],h=[],c=0;c<e;c++)s[c]=[0,0,0],h[c]=[0,0,0];var d,f,p,g=[0,0,0],m=[0,0,0],v=this.indices,y=v?v.length:this.vertexCount;for(c=0;c<y;){v?(d=v[c++],f=v[c++],p=v[c++]):(d=c++,f=c++,p=c++);var _=i[2*d],x=i[2*f],b=i[2*p],w=i[2*d+1],T=i[2*f+1],S=i[2*p+1],M=n[3*d],A=n[3*f],I=n[3*p],C=n[3*d+1],D=n[3*f+1],E=n[3*p+1],L=n[3*d+2],P=A-M,N=I-M,R=D-C,O=E-C,k=n[3*f+2]-L,z=n[3*p+2]-L,B=x-_,F=b-_,V=T-w,G=S-w,H=1/(B*G-V*F);g[0]=(G*P-V*N)*H,g[1]=(G*R-V*O)*H,g[2]=(G*k-V*z)*H,m[0]=(B*N-F*P)*H,m[1]=(B*O-F*R)*H,m[2]=(B*z-F*k)*H,u(s[d],s[d],g),u(s[f],s[f],g),u(s[p],s[p],g),u(h[d],h[d],m),u(h[f],h[f],m),u(h[p],h[p],m)}var U=l(),W=l(),j=l();for(c=0;c<e;c++){j[0]=o[3*c],j[1]=o[3*c+1],j[2]=o[3*c+2];var X=s[c];r.a.scale(U,j,r.a.dot(j,X)),r.a.sub(U,X,U),r.a.normalize(U,U),r.a.cross(W,j,X),a[4*c]=U[0],a[4*c+1]=U[1],a[4*c+2]=U[2],a[4*c+3]=r.a.dot(W,h[c])<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 n.a.Uint32Array(this.indices));for(var e=this.attributes,t=this.indices,i=this.getEnabledAttributes(),r={},a=0;a<i.length;a++)r[u=i[a]]=e[u].value,e[u].init(this.indices.length);for(var o=0,s=0;s<t.length;s++){var l=t[s];for(a=0;a<i.length;a++)for(var u,h=e[u=i[a]].value,c=e[u].size,d=0;d<c;d++)h[o*c+d]=r[u][l*c+d];t[s]=o,o++}this.dirty()}},generateBarycentric:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var e=this.attributes,t=e.barycentric.value,i=this.indices;if(!t||t.length!==3*i.length){t=e.barycentric.value=new Float32Array(3*i.length);for(var n=0;n<(i?i.length:this.vertexCount/3);)for(var r=0;r<3;r++)t[3*(i?i[n++]:3*n+r)+r]=1;this.dirty()}}},applyTransform:function(e){var t=this.attributes,i=t.position.value,n=t.normal.value,o=t.tangent.value;e=e.array;var s=a.a.create();a.a.invert(s,e),a.a.transpose(s,s);var l=r.a.transformMat4,u=r.a.forEach;u(i,3,0,null,l,e),n&&u(n,3,0,null,l,s),o&&u(o,4,0,null,l,s),this.boundingBox&&this.updateBoundingBox()},dispose:function(e){var t=this._cache;t.use(e.__uid__);var i=t.get("chunks");if(i)for(var n=0;n<i.length;n++){for(var r=i[n],a=0;a<r.attributeBuffers.length;a++){var o=r.attributeBuffers[a];e.gl.deleteBuffer(o.buffer)}r.indicesBuffer&&e.gl.deleteBuffer(r.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__)}});d.STATIC_DRAW=s.a.STATIC_DRAW,d.DYNAMIC_DRAW=s.a.DYNAMIC_DRAW,d.STREAM_DRAW=s.a.STREAM_DRAW,d.AttributeBuffer=s.a.AttributeBuffer,d.IndicesBuffer=s.a.IndicesBuffer,d.Attribute=c,t.a=d},function(e,t,i){var n=i(7),r=i(37),a=i(43),o=i(8),s=i(19),l=i(40),u=i(11),h=i(126);o.a.import(h.a);var c=new a.a,d=new l.a({geometry:c,frustumCulling:!1}),f=new r.a,p=n.a.extend((function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}}),(function(){var e=new o.a(o.a.source("clay.compositor.vertex"),this.fragment),t=new s.a({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||u.a.COLOR_ATTACHMENT0,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 i in this.outputs){var n=this.outputs[i];n&&t.attach(n,i)}t&&t.bind(e)},unbind:function(e,t){t.unbind(e)},render:function(e,t){var i=e.gl;if(t){this.bind(e,t);var n=e.getGLExtension("EXT_draw_buffers");if(n&&this.outputs){var r=[];for(var a in this.outputs)(a=+a)>=i.COLOR_ATTACHMENT0&&a<=i.COLOR_ATTACHMENT0+8&&r.push(a);n.drawBuffersEXT(r)}}this.trigger("beforerender",this,e);var o=this.clearDepth?i.DEPTH_BUFFER_BIT:0;if(i.depthMask(!0),this.clearColor){o|=i.COLOR_BUFFER_BIT,i.colorMask(!0,!0,!0,!0);var s=this.clearColor;Array.isArray(s)&&i.clearColor(s[0],s[1],s[2],s[3])}i.clear(o),this.blendWithPrevious?(i.enable(i.BLEND),this.material.transparent=!0):(i.disable(i.BLEND),this.material.transparent=!1),this.renderQuad(e),this.trigger("afterrender",this,e),t&&this.unbind(e,t)},renderQuad:function(e){d.material=this.material,e.renderPass([d],f)},dispose:function(e){}});t.a=p},function(e,t,i){t.a=function(e,t,i){return{seriesType:e,reset:function(e,t){var i=e.getData(),n=e.visualColorAccessPath.split(".");n[n.length-1]="opacity";var r=e.get(n);return i.setVisual("opacity",null==r?1:r),{dataEach:i.hasItemOption?function(e,t){var i=e.getItemModel(t).get(n,!0);null!=i&&e.setItemVisual(t,"opacity",i)}:null}}}}},function(e,t,i){var n,r,a,o,s,l,u=i(3),h=i(12),c=h.a.set,d=h.a.copy,f=function(e,t){this.min=e||new u.a(1/0,1/0,1/0),this.max=t||new u.a(-1/0,-1/0,-1/0),this.vertices=null};f.prototype={constructor:f,updateFromVertices:function(e){if(e.length>0){var t=this.min,i=this.max,n=t.array,r=i.array;d(n,e[0]),d(r,e[0]);for(var a=1;a<e.length;a++){var o=e[a];o[0]<n[0]&&(n[0]=o[0]),o[1]<n[1]&&(n[1]=o[1]),o[2]<n[2]&&(n[2]=o[2]),o[0]>r[0]&&(r[0]=o[0]),o[1]>r[1]&&(r[1]=o[1]),o[2]>r[2]&&(r[2]=o[2])}t._dirty=!0,i._dirty=!0}},union:function(e){var t=this.min,i=this.max;return h.a.min(t.array,t.array,e.min.array),h.a.max(i.array,i.array,e.max.array),t._dirty=!0,i._dirty=!0,this},intersection:function(e){var t=this.min,i=this.max;return h.a.max(t.array,t.array,e.min.array),h.a.min(i.array,i.array,e.max.array),t._dirty=!0,i._dirty=!0,this},intersectBoundingBox:function(e){var t=this.min.array,i=this.max.array,n=e.min.array,r=e.max.array;return!(t[0]>r[0]||t[1]>r[1]||t[2]>r[2]||i[0]<n[0]||i[1]<n[1]||i[2]<n[2])},containBoundingBox:function(e){var t=this.min.array,i=this.max.array,n=e.min.array,r=e.max.array;return t[0]<=n[0]&&t[1]<=n[1]&&t[2]<=n[2]&&i[0]>=r[0]&&i[1]>=r[1]&&i[2]>=r[2]},containPoint:function(e){var t=this.min.array,i=this.max.array,n=e.array;return t[0]<=n[0]&&t[1]<=n[1]&&t[2]<=n[2]&&i[0]>=n[0]&&i[1]>=n[1]&&i[2]>=n[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:(n=h.a.create(),r=h.a.create(),a=h.a.create(),o=h.a.create(),s=h.a.create(),l=h.a.create(),function(e,t){var i=e.min.array,u=e.max.array,h=t.array;return n[0]=h[0]*i[0],n[1]=h[1]*i[0],n[2]=h[2]*i[0],r[0]=h[0]*u[0],r[1]=h[1]*u[0],r[2]=h[2]*u[0],a[0]=h[4]*i[1],a[1]=h[5]*i[1],a[2]=h[6]*i[1],o[0]=h[4]*u[1],o[1]=h[5]*u[1],o[2]=h[6]*u[1],s[0]=h[8]*i[2],s[1]=h[9]*i[2],s[2]=h[10]*i[2],l[0]=h[8]*u[2],l[1]=h[9]*u[2],l[2]=h[10]*u[2],i=this.min.array,u=this.max.array,i[0]=Math.min(n[0],r[0])+Math.min(a[0],o[0])+Math.min(s[0],l[0])+h[12],i[1]=Math.min(n[1],r[1])+Math.min(a[1],o[1])+Math.min(s[1],l[1])+h[13],i[2]=Math.min(n[2],r[2])+Math.min(a[2],o[2])+Math.min(s[2],l[2])+h[14],u[0]=Math.max(n[0],r[0])+Math.max(a[0],o[0])+Math.max(s[0],l[0])+h[12],u[1]=Math.max(n[1],r[1])+Math.max(a[1],o[1])+Math.max(s[1],l[1])+h[13],u[2]=Math.max(n[2],r[2])+Math.max(a[2],o[2])+Math.max(s[2],l[2])+h[14],this.min._dirty=!0,this.max._dirty=!0,this}),applyProjection:function(e){var t=this.min.array,i=this.max.array,n=e.array,r=t[0],a=t[1],o=t[2],s=i[0],l=i[1],u=t[2],h=i[0],c=i[1],d=i[2];if(1===n[15])t[0]=n[0]*r+n[12],t[1]=n[5]*a+n[13],i[2]=n[10]*o+n[14],i[0]=n[0]*h+n[12],i[1]=n[5]*c+n[13],t[2]=n[10]*d+n[14];else{var f=-1/o;t[0]=n[0]*r*f,t[1]=n[5]*a*f,i[2]=(n[10]*o+n[14])*f,f=-1/u,i[0]=n[0]*s*f,i[1]=n[5]*l*f,f=-1/d,t[2]=(n[10]*d+n[14])*f}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]=h.a.fromValues(0,0,0);this.vertices=e}var i=this.min.array,n=this.max.array;return c(e[0],i[0],i[1],i[2]),c(e[1],i[0],n[1],i[2]),c(e[2],n[0],i[1],i[2]),c(e[3],n[0],n[1],i[2]),c(e[4],i[0],i[1],n[2]),c(e[5],i[0],n[1],n[2]),c(e[6],n[0],i[1],n[2]),c(e[7],n[0],n[1],n[2]),this},copy:function(e){var t=this.min,i=this.max;return d(t.array,e.min.array),d(i.array,e.max.array),t._dirty=!0,i._dirty=!0,this},clone:function(){var e=new f;return e.copy(this),e}},t.a=f},function(e,t,i){var n=i(7),r=i(23),a=i(113).a.parseToFloat,o={};function s(e){var t=Object.keys(e);t.sort();for(var i=[],n=0;n<t.length;n++){var r=t[n],a=e[r];null===a?i.push(r):i.push(r+" "+a.toString())}return i.join("\n")}var l=n.a.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 i=this.uniforms[e];i&&("string"==typeof t&&(t=a(t)||t),i.value=t,this.autoUpdateTextureStatus&&"t"===i.type&&(t?this.enableTexture(e):this.disableTexture(e)))},setUniforms:function(e){for(var t in e){var i=e[t];this.setUniform(t,i)}},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 i in e){var n=e[i];this.setUniform(i,n)}else this.setUniform(e,t)},get:function(e){var t=this.uniforms[e];if(t)return t.value},attachShader:function(e,t){var i=this.uniforms;this.uniforms=e.createUniforms(),this.shader=e;var n=this.uniforms;this._enabledUniforms=Object.keys(n),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter((function(e){var t=this.uniforms[e].type;return"t"===t||"tv"===t}),this);var a=this.vertexDefines,o=this.fragmentDefines;if(this.vertexDefines=r.a.clone(e.vertexDefines),this.fragmentDefines=r.a.clone(e.fragmentDefines),t){for(var s in i)n[s]&&(n[s].value=i[s].value);r.a.defaults(this.vertexDefines,a),r.a.defaults(this.fragmentDefines,o)}var l={};for(var u in e.textures)l[u]={shaderType:e.textures[u].shaderType,type:e.textures[u].type,enabled:!(!t||!this._textureStatus[u])&&this._textureStatus[u].enabled};this._textureStatus=l,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=r.a.clone(this.vertexDefines),e.fragmentDefines=r.a.clone(this.fragmentDefines),e.enableTexture(this.getEnabledTextures()),e.precision=this.precision,e},define:function(e,t,i){var n=this.vertexDefines,r=this.fragmentDefines;"vertex"!==e&&"fragment"!==e&&"both"!==e&&arguments.length<3&&(i=t,t=e,e="both"),i=null!=i?i:null,"vertex"!==e&&"both"!==e||n[t]!==i&&(n[t]=i,this._programKey=""),"fragment"!==e&&"both"!==e||r[t]!==i&&(r[t]=i,"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 i=this._textureStatus[e];i&&(i.enabled||(i.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 i=this._textureStatus[e];i&&(!i.enabled||(i.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 i in t)t[i].enabled&&e.push(i);return e},dirtyDefines:function(){this._programKey=""},getProgramKey:function(){return this._programKey||(this._programKey=function(e,t,i){i.sort();for(var n=[],a=0;a<i.length;a++){var l=i[a];n.push(l)}var u=s(e)+"\n"+s(t)+"\n"+n.join("\n");if(o[u])return o[u];var h=r.a.genGUID();return o[u]=h,h}(this.vertexDefines,this.fragmentDefines,this.getEnabledTextures())),this._programKey}});t.a=l},function(e,t,i){i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return r})),i.d(t,"c",(function(){return a}));var n=1e-6,r=Array,a=Math.random},function(e,t,i){var n=i(20),r={create:function(){var e=new n.a(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 n.a(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 i=t[1],n=t[2],r=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=i,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=r,e[13]=o,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 i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],h=t[8],c=t[9],d=t[10],f=t[11],p=t[12],g=t[13],m=t[14],v=t[15],y=i*s-n*o,_=i*l-r*o,x=i*u-a*o,b=n*l-r*s,w=n*u-a*s,T=r*u-a*l,S=h*g-c*p,M=h*m-d*p,A=h*v-f*p,I=c*m-d*g,C=c*v-f*g,D=d*v-f*m,E=y*D-_*C+x*I+b*A-w*M+T*S;return E?(E=1/E,e[0]=(s*D-l*C+u*I)*E,e[1]=(r*C-n*D-a*I)*E,e[2]=(g*T-m*w+v*b)*E,e[3]=(d*w-c*T-f*b)*E,e[4]=(l*A-o*D-u*M)*E,e[5]=(i*D-r*A+a*M)*E,e[6]=(m*x-p*T-v*_)*E,e[7]=(h*T-d*x+f*_)*E,e[8]=(o*C-s*A+u*S)*E,e[9]=(n*A-i*C-a*S)*E,e[10]=(p*w-g*x+v*y)*E,e[11]=(c*x-h*w-f*y)*E,e[12]=(s*M-o*I-l*S)*E,e[13]=(i*I-n*M+r*S)*E,e[14]=(g*_-p*b-m*y)*E,e[15]=(h*b-c*_+d*y)*E,e):null},adjoint:function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],h=t[8],c=t[9],d=t[10],f=t[11],p=t[12],g=t[13],m=t[14],v=t[15];return e[0]=s*(d*v-f*m)-c*(l*v-u*m)+g*(l*f-u*d),e[1]=-(n*(d*v-f*m)-c*(r*v-a*m)+g*(r*f-a*d)),e[2]=n*(l*v-u*m)-s*(r*v-a*m)+g*(r*u-a*l),e[3]=-(n*(l*f-u*d)-s*(r*f-a*d)+c*(r*u-a*l)),e[4]=-(o*(d*v-f*m)-h*(l*v-u*m)+p*(l*f-u*d)),e[5]=i*(d*v-f*m)-h*(r*v-a*m)+p*(r*f-a*d),e[6]=-(i*(l*v-u*m)-o*(r*v-a*m)+p*(r*u-a*l)),e[7]=i*(l*f-u*d)-o*(r*f-a*d)+h*(r*u-a*l),e[8]=o*(c*v-f*g)-h*(s*v-u*g)+p*(s*f-u*c),e[9]=-(i*(c*v-f*g)-h*(n*v-a*g)+p*(n*f-a*c)),e[10]=i*(s*v-u*g)-o*(n*v-a*g)+p*(n*u-a*s),e[11]=-(i*(s*f-u*c)-o*(n*f-a*c)+h*(n*u-a*s)),e[12]=-(o*(c*m-d*g)-h*(s*m-l*g)+p*(s*d-l*c)),e[13]=i*(c*m-d*g)-h*(n*m-r*g)+p*(n*d-r*c),e[14]=-(i*(s*m-l*g)-o*(n*m-r*g)+p*(n*l-r*s)),e[15]=i*(s*d-l*c)-o*(n*d-r*c)+h*(n*l-r*s),e},determinant:function(e){var t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],h=e[9],c=e[10],d=e[11],f=e[12],p=e[13],g=e[14],m=e[15];return(t*o-i*a)*(c*m-d*g)-(t*s-n*a)*(h*m-d*p)+(t*l-r*a)*(h*g-c*p)+(i*s-n*o)*(u*m-d*f)-(i*l-r*o)*(u*g-c*f)+(n*l-r*s)*(u*p-h*f)},multiply:function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],h=t[7],c=t[8],d=t[9],f=t[10],p=t[11],g=t[12],m=t[13],v=t[14],y=t[15],_=i[0],x=i[1],b=i[2],w=i[3];return e[0]=_*n+x*s+b*c+w*g,e[1]=_*r+x*l+b*d+w*m,e[2]=_*a+x*u+b*f+w*v,e[3]=_*o+x*h+b*p+w*y,_=i[4],x=i[5],b=i[6],w=i[7],e[4]=_*n+x*s+b*c+w*g,e[5]=_*r+x*l+b*d+w*m,e[6]=_*a+x*u+b*f+w*v,e[7]=_*o+x*h+b*p+w*y,_=i[8],x=i[9],b=i[10],w=i[11],e[8]=_*n+x*s+b*c+w*g,e[9]=_*r+x*l+b*d+w*m,e[10]=_*a+x*u+b*f+w*v,e[11]=_*o+x*h+b*p+w*y,_=i[12],x=i[13],b=i[14],w=i[15],e[12]=_*n+x*s+b*c+w*g,e[13]=_*r+x*l+b*d+w*m,e[14]=_*a+x*u+b*f+w*v,e[15]=_*o+x*h+b*p+w*y,e},multiplyAffine:function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[4],s=t[5],l=t[6],u=t[8],h=t[9],c=t[10],d=t[12],f=t[13],p=t[14],g=i[0],m=i[1],v=i[2];return e[0]=g*n+m*o+v*u,e[1]=g*r+m*s+v*h,e[2]=g*a+m*l+v*c,g=i[4],m=i[5],v=i[6],e[4]=g*n+m*o+v*u,e[5]=g*r+m*s+v*h,e[6]=g*a+m*l+v*c,g=i[8],m=i[9],v=i[10],e[8]=g*n+m*o+v*u,e[9]=g*r+m*s+v*h,e[10]=g*a+m*l+v*c,g=i[12],m=i[13],v=i[14],e[12]=g*n+m*o+v*u+d,e[13]=g*r+m*s+v*h+f,e[14]=g*a+m*l+v*c+p,e}};r.mul=r.multiply,r.mulAffine=r.multiplyAffine,r.translate=function(e,t,i){var n,r,a,o,s,l,u,h,c,d,f,p,g=i[0],m=i[1],v=i[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]):(n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],h=t[7],c=t[8],d=t[9],f=t[10],p=t[11],e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=u,e[7]=h,e[8]=c,e[9]=d,e[10]=f,e[11]=p,e[12]=n*g+s*m+c*v+t[12],e[13]=r*g+l*m+d*v+t[13],e[14]=a*g+u*m+f*v+t[14],e[15]=o*g+h*m+p*v+t[15]),e},r.scale=function(e,t,i){var n=i[0],r=i[1],a=i[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},r.rotate=function(e,t,i,r){var a,o,s,l,u,h,c,d,f,p,g,m,v,y,_,x,b,w,T,S,M,A,I,C,D=r[0],E=r[1],L=r[2],P=Math.sqrt(D*D+E*E+L*L);return Math.abs(P)<n.b?null:(D*=P=1/P,E*=P,L*=P,a=Math.sin(i),s=1-(o=Math.cos(i)),l=t[0],u=t[1],h=t[2],c=t[3],d=t[4],f=t[5],p=t[6],g=t[7],m=t[8],v=t[9],y=t[10],_=t[11],x=D*D*s+o,b=E*D*s+L*a,w=L*D*s-E*a,T=D*E*s-L*a,S=E*E*s+o,M=L*E*s+D*a,A=D*L*s+E*a,I=E*L*s-D*a,C=L*L*s+o,e[0]=l*x+d*b+m*w,e[1]=u*x+f*b+v*w,e[2]=h*x+p*b+y*w,e[3]=c*x+g*b+_*w,e[4]=l*T+d*S+m*M,e[5]=u*T+f*S+v*M,e[6]=h*T+p*S+y*M,e[7]=c*T+g*S+_*M,e[8]=l*A+d*I+m*C,e[9]=u*A+f*I+v*C,e[10]=h*A+p*I+y*C,e[11]=c*A+g*I+_*C,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)},r.rotateX=function(e,t,i){var n=Math.sin(i),r=Math.cos(i),a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],h=t[9],c=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]=a*r+u*n,e[5]=o*r+h*n,e[6]=s*r+c*n,e[7]=l*r+d*n,e[8]=u*r-a*n,e[9]=h*r-o*n,e[10]=c*r-s*n,e[11]=d*r-l*n,e},r.rotateY=function(e,t,i){var n=Math.sin(i),r=Math.cos(i),a=t[0],o=t[1],s=t[2],l=t[3],u=t[8],h=t[9],c=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]=a*r-u*n,e[1]=o*r-h*n,e[2]=s*r-c*n,e[3]=l*r-d*n,e[8]=a*n+u*r,e[9]=o*n+h*r,e[10]=s*n+c*r,e[11]=l*n+d*r,e},r.rotateZ=function(e,t,i){var n=Math.sin(i),r=Math.cos(i),a=t[0],o=t[1],s=t[2],l=t[3],u=t[4],h=t[5],c=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]=a*r+u*n,e[1]=o*r+h*n,e[2]=s*r+c*n,e[3]=l*r+d*n,e[4]=u*r-a*n,e[5]=h*r-o*n,e[6]=c*r-s*n,e[7]=d*r-l*n,e},r.fromRotationTranslation=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=n+n,l=r+r,u=a+a,h=n*s,c=n*l,d=n*u,f=r*l,p=r*u,g=a*u,m=o*s,v=o*l,y=o*u;return e[0]=1-(f+g),e[1]=c+y,e[2]=d-v,e[3]=0,e[4]=c-y,e[5]=1-(h+g),e[6]=p+m,e[7]=0,e[8]=d+v,e[9]=p-m,e[10]=1-(h+f),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e},r.fromQuat=function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=i+i,s=n+n,l=r+r,u=i*o,h=n*o,c=n*s,d=r*o,f=r*s,p=r*l,g=a*o,m=a*s,v=a*l;return e[0]=1-c-p,e[1]=h+v,e[2]=d-m,e[3]=0,e[4]=h-v,e[5]=1-u-p,e[6]=f+g,e[7]=0,e[8]=d+m,e[9]=f-g,e[10]=1-u-c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},r.frustum=function(e,t,i,n,r,a,o){var s=1/(i-t),l=1/(r-n),u=1/(a-o);return e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*l,e[6]=0,e[7]=0,e[8]=(i+t)*s,e[9]=(r+n)*l,e[10]=(o+a)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*u,e[15]=0,e},r.perspective=function(e,t,i,n,r){var a=1/Math.tan(t/2),o=1/(n-r);return e[0]=a/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(r+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*r*n*o,e[15]=0,e},r.ortho=function(e,t,i,n,r,a,o){var s=1/(t-i),l=1/(n-r),u=1/(a-o);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+i)*s,e[13]=(r+n)*l,e[14]=(o+a)*u,e[15]=1,e},r.lookAt=function(e,t,i,a){var o,s,l,u,h,c,d,f,p,g,m=t[0],v=t[1],y=t[2],_=a[0],x=a[1],b=a[2],w=i[0],T=i[1],S=i[2];return Math.abs(m-w)<n.b&&Math.abs(v-T)<n.b&&Math.abs(y-S)<n.b?r.identity(e):(d=m-w,f=v-T,p=y-S,o=x*(p*=g=1/Math.sqrt(d*d+f*f+p*p))-b*(f*=g),s=b*(d*=g)-_*p,l=_*f-x*d,(g=Math.sqrt(o*o+s*s+l*l))?(o*=g=1/g,s*=g,l*=g):(o=0,s=0,l=0),u=f*l-p*s,h=p*o-d*l,c=d*s-f*o,(g=Math.sqrt(u*u+h*h+c*c))?(u*=g=1/g,h*=g,c*=g):(u=0,h=0,c=0),e[0]=o,e[1]=u,e[2]=d,e[3]=0,e[4]=s,e[5]=h,e[6]=f,e[7]=0,e[8]=l,e[9]=c,e[10]=p,e[11]=0,e[12]=-(o*m+s*v+l*y),e[13]=-(u*m+h*v+c*y),e[14]=-(d*m+f*v+p*y),e[15]=1,e)},r.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))},t.a=r},function(e,t,i){var n=i(0),r=i.n(n),a=i(36),o=i(174),s=i(41),l=i(37),u=i(9),h=i(3),c=i(26),d=i(53),f=i(176),p=i(200),g=i(49);function m(e){e=e||"perspective",this.layer=null,this.scene=new a.a,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(e),this._compositor=new f.a,this._temporalSS=new p.a,this._shadowMapPass=new o.a;for(var t=[],i=0,n=0;n<30;n++){for(var r=[],s=0;s<6;s++)r.push(4*Object(g.a)(i,2)-2),r.push(4*Object(g.a)(i,3)-2),i++;t.push(r)}this._pcfKernels=t,this.scene.on("beforerender",(function(e,t,i){this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,i)}),this)}m.prototype.setProjection=function(e){var t=this.camera;t&&t.update(),"perspective"===e?this.camera instanceof s.a||(this.camera=new s.a,t&&this.camera.setLocalTransform(t.localTransform)):this.camera instanceof l.a||(this.camera=new l.a,t&&this.camera.setLocalTransform(t.localTransform)),this.camera.near=.1,this.camera.far=2e3},m.prototype.setViewport=function(e,t,i,n,r){this.camera instanceof s.a&&(this.camera.aspect=i/n),r=r||1,this.viewport.x=e,this.viewport.y=t,this.viewport.width=i,this.viewport.height=n,this.viewport.devicePixelRatio=r,this._compositor.resize(i*r,n*r),this._temporalSS.resize(i*r,n*r)},m.prototype.containPoint=function(e,t){var i=this.viewport;return t=this.layer.renderer.getHeight()-t,e>=i.x&&t>=i.y&&e<=i.x+i.width&&t<=i.y+i.height};var v=new c.a;m.prototype.castRay=function(e,t,i){var n=this.layer.renderer,r=n.viewport;return n.viewport=this.viewport,n.screenToNDC(e,t,v),this.camera.castRay(v,i),n.viewport=r,i},m.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 i=e.transparent[t].geometry;i.needsSortVerticesProgressively&&i.needsSortVerticesProgressively()&&(this._needsSortProgressively=!0),i.needsSortTrianglesProgressively&&i.needsSortTrianglesProgressively()&&(this._needsSortProgressively=!0)}this._frame=0,this._temporalSS.resetFrame()},m.prototype.render=function(e,t){this._doRender(e,t,this._frame),this._frame++},m.prototype.needsAccumulate=function(){return this.needsTemporalSS()||this._needsSortProgressively},m.prototype.needsTemporalSS=function(){var e=this._enableTemporalSS;return"auto"===e&&(e=this._enablePostEffect),e},m.prototype.hasDOF=function(){return this._enableDOF},m.prototype.isAccumulateFinished=function(){return this.needsTemporalSS()?this._temporalSS.isFinished():this._frame>30},m.prototype._doRender=function(e,t,i){var n=this.scene,r=this.camera;i=i||0,this._updateTransparent(e,n,r,i),t||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(e,n,r,!0)),this._updateShadowPCFKernel(i);var a,o=e.clearColor;e.gl.clearColor(o[0],o[1],o[2],o[3]),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,r),this._compositor.updateNormal(e,n,r,this._temporalSS.getFrame())),this._updateSSAO(e,n,r,this._temporalSS.getFrame()),this._enablePostEffect?((a=this._compositor.getSourceFrameBuffer()).bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),e.render(n,r,!0,!0),a.unbind(e),this.needsTemporalSS()&&t?(this._compositor.composite(e,n,r,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),this._compositor.composite(e,n,r,null,0))):this.needsTemporalSS()&&t?((a=this._temporalSS.getSourceFrameBuffer()).bind(e),e.saveClear(),e.clearBit=e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT,e.render(n,r,!0,!0),e.restoreClear(),a.unbind(e),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),e.render(n,r,!0,!0))},m.prototype._updateTransparent=function(e,t,i,n){for(var r=new h.a,a=new u.a,o=i.getWorldPosition(),s=t.getRenderList(i).transparent,l=0;l<s.length;l++){var c=s[l],d=c.geometry;u.a.invert(a,c.worldTransform),h.a.transformMat4(r,o,a),d.needsSortTriangles&&d.needsSortTriangles()&&d.doSortTriangles(r,n),d.needsSortVertices&&d.needsSortVertices()&&d.doSortVertices(r,n)}},m.prototype._updateSSAO=function(e,t,i){var n=this._enableSSAO&&this._enablePostEffect;n&&this._compositor.updateSSAO(e,t,i,this._temporalSS.getFrame());for(var r=t.getRenderList(i),a=0;a<r.opaque.length;a++){var o=r.opaque[a];o.renderNormal&&o.material[n?"enableTexture":"disableTexture"]("ssaoMap"),n&&o.material.set("ssaoMap",this._compositor.getSSAOTexture())}},m.prototype._updateShadowPCFKernel=function(e){for(var t=this._pcfKernels[e%this._pcfKernels.length],i=this.scene.getRenderList(this.camera).opaque,n=0;n<i.length;n++)i[n].receiveShadow&&(i[n].material.set("pcfKernel",t),i[n].material.define("fragment","PCF_KERNEL_SIZE",t.length/2))},m.prototype.dispose=function(e){this._compositor.dispose(e.gl),this._temporalSS.dispose(e.gl),this._shadowMapPass.dispose(e)},m.prototype.setPostEffect=function(e,t){var i=this._compositor;this._enablePostEffect=e.get("enable");var n=e.getModel("bloom"),r=e.getModel("edge"),a=e.getModel("DOF",e.getModel("depthOfField")),o=e.getModel("SSAO",e.getModel("screenSpaceAmbientOcclusion")),s=e.getModel("SSR",e.getModel("screenSpaceReflection")),l=e.getModel("FXAA"),u=e.getModel("colorCorrection");n.get("enable")?i.enableBloom():i.disableBloom(),a.get("enable")?i.enableDOF():i.disableDOF(),s.get("enable")?i.enableSSR():i.disableSSR(),u.get("enable")?i.enableColorCorrection():i.disableColorCorrection(),r.get("enable")?i.enableEdge():i.disableEdge(),l.get("enable")?i.enableFXAA():i.disableFXAA(),this._enableDOF=a.get("enable"),this._enableSSAO=o.get("enable"),this._enableSSAO?i.enableSSAO():i.disableSSAO(),i.setBloomIntensity(n.get("intensity")),i.setEdgeColor(r.get("color")),i.setColorLookupTexture(u.get("lookupTexture"),t),i.setExposure(u.get("exposure")),["radius","quality","intensity"].forEach((function(e){i.setSSAOParameter(e,o.get(e))})),["quality","maxRoughness","physical"].forEach((function(e){i.setSSRParameter(e,s.get(e))})),["quality","focalDistance","focalRange","blurRadius","fstop"].forEach((function(e){i.setDOFParameter(e,a.get(e))})),["brightness","contrast","saturation"].forEach((function(e){i.setColorCorrection(e,u.get(e))}))},m.prototype.setDOFFocusOnPoint=function(e){if(this._enablePostEffect){if(e>this.camera.far||e<this.camera.near)return;return this._compositor.setDOFParameter("focalDistance",e),!0}},m.prototype.setTemporalSuperSampling=function(e){this._enableTemporalSS=e.get("enable")},m.prototype.isLinearSpace=function(){return this._enablePostEffect},m.prototype.setRootNode=function(e){if(this.rootNode!==e){for(var t=this.rootNode.children(),i=0;i<t.length;i++)e.add(t[i]);e!==this.scene&&this.scene.add(e),this.rootNode=e}},m.prototype.add=function(e){this.rootNode.add(e)},m.prototype.remove=function(e){this.rootNode.remove(e)},m.prototype.removeAll=function(e){this.rootNode.removeAll(e)},r.a.util.extend(m.prototype,d.a),t.a=m},function(e,t,i){var n=0,r=Array.prototype.forEach,a={genGUID:function(){return++n},relative2absolute:function(e,t){if(!t||e.match(/^\//))return e;for(var i=e.split("/"),n=t.split("/"),r=i[0];"."===r||".."===r;)".."===r&&n.pop(),i.shift(),r=i[0];return n.join("/")+"/"+i.join("/")},extend:function(e,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},defaults:function(e,t){if(t)for(var i in t)void 0===e[i]&&(e[i]=t[i]);return e},extendWithPropList:function(e,t,i){if(t)for(var n=0;n<i.length;n++){var r=i[n];e[r]=t[r]}return e},defaultsWithPropList:function(e,t,i){if(t)for(var n=0;n<i.length;n++){var r=i[n];null==e[r]&&(e[r]=t[r])}return e},each:function(e,t,i){if(e&&t)if(e.forEach&&e.forEach===r)e.forEach(t,i);else if(e.length===+e.length)for(var n=0,a=e.length;n<a;n++)t.call(i,e[n],n,e);else for(var o in e)e.hasOwnProperty(o)&&t.call(i,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(a.isObject(e)){if(a.isArray(e))return e.slice();if(a.isArrayLike(e)){for(var t=new e.constructor(e.length),i=0;i<e.length;i++)t[i]=e[i];return t}return a.extend({},e)}return e}};t.a=a},function(e,t,i){var n=i(35),r=i(8),a=i(119);r.a.import(a.a);var o=n.a.extend((function(){return{color:[1,1,1],intensity:1,castShadow:!0,shadowResolution:512,group:0}}),{type:"",clone:function(){var e=n.a.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}});t.a=o},function(e,t,i){var n=i(15),r=i(0),a=i.n(r),o=i(38),s=i(6).a.vec3,l=[[0,0],[1,1]],u=n.a.extend((function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new n.a.Attribute("position","float",3,"POSITION"),positionPrev:new n.a.Attribute("positionPrev","float",3),positionNext:new n.a.Attribute("positionNext","float",3),prevPositionPrev:new n.a.Attribute("prevPositionPrev","float",3),prevPosition:new n.a.Attribute("prevPosition","float",3),prevPositionNext:new n.a.Attribute("prevPositionNext","float",3),offset:new n.a.Attribute("offset","float",1),color:new n.a.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,i,n){return 1/(s.dist(e,t)+s.dist(i,t)+s.dist(n,i)+1)*this.segmentScale},getCubicCurveVertexCount:function(e,t,i,n){var r=this._getCubicCurveApproxStep(e,t,i,n),a=Math.ceil(1/r);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(e,t,i,n){var r=this._getCubicCurveApproxStep(e,t,i,n),a=Math.ceil(1/r);return this.useNativeLine?0:2*a},getLineVertexCount:function(){return this.getPolylineVertexCount(l)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(l)},getPolylineVertexCount:function(e){var t;return t="number"==typeof e?e:"number"!=typeof e[0]?e.length:e.length/3,this.useNativeLine?2*(t-1):2*(t-1)+2},getPolylineTriangleCount:function(e){var t;return t="number"==typeof e?e:"number"!=typeof e[0]?e.length:e.length/3,this.useNativeLine?0:2*Math.max(t-1,0)},addCubicCurve:function(e,t,i,n,r,a){null==a&&(a=1);var o=e[0],s=e[1],l=e[2],u=t[0],h=t[1],c=t[2],d=i[0],f=i[1],p=i[2],g=n[0],m=n[1],v=n[2],y=this._getCubicCurveApproxStep(e,t,i,n),_=y*y,x=_*y,b=3*y,w=3*_,T=6*_,S=6*x,M=o-2*u+d,A=s-2*h+f,I=l-2*c+p,C=3*(u-d)-o+g,D=3*(h-f)-s+m,E=3*(c-p)-l+v,L=o,P=s,N=l,R=(u-o)*b+M*w+C*x,O=(h-s)*b+A*w+D*x,k=(c-l)*b+I*w+E*x,z=M*T+C*S,B=A*T+D*S,F=I*T+E*S,V=C*S,G=D*S,H=E*S,U=0,W=0,j=Math.ceil(1/y),X=new Float32Array(3*(j+1)),Z=(X=[],0);for(W=0;W<j+1;W++)X[Z++]=L,X[Z++]=P,X[Z++]=N,L+=R,P+=O,N+=k,R+=z,O+=B,k+=F,z+=V,B+=G,F+=H,(U+=y)>1&&(L=R>0?Math.min(L,g):Math.max(L,g),P=O>0?Math.min(P,m):Math.max(P,m),N=k>0?Math.min(N,v):Math.max(N,v));return this.addPolyline(X,r,a)},addLine:function(e,t,i,n){return this.addPolyline([e,t],i,n)},addPolyline:function(e,t,i,n,r){if(e.length){var a="number"!=typeof e[0];if(null==r&&(r=a?e.length:e.length/3),!(r<2)){null==n&&(n=0),null==i&&(i=1),this._itemVertexOffsets.push(this._vertexOffset);var o,s,l=(a="number"!=typeof e[0])?"number"!=typeof t[0]:t.length/4===r,u=this.attributes.position,h=this.attributes.positionPrev,c=this.attributes.positionNext,d=this.attributes.color,f=this.attributes.offset,p=this.indices,g=this._vertexOffset;i=Math.max(i,.01);for(var m=n;m<r;m++){if(a)o=e[m],s=l?t[m]:t;else{var v=3*m;if((o=o||[])[0]=e[v],o[1]=e[v+1],o[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<r-1&&(h.set(g+2,o),h.set(g+3,o)),m>0&&(c.set(g-2,o),c.set(g-1,o)),u.set(g,o),u.set(g+1,o),d.set(g,s),d.set(g+1,s),f.set(g,i/2),f.set(g+1,-i/2),g+=2),this.useNativeLine)d.set(g,s),u.set(g,o),g++;else if(m>0){var _=3*this._triangleOffset;(p=this.indices)[_]=g-4,p[_+1]=g-3,p[_+2]=g-2,p[_+3]=g-3,p[_+4]=g-1,p[_+5]=g-2,this._triangleOffset+=2}}if(!this.useNativeLine){var x=this._vertexOffset,b=this._vertexOffset+2*r;h.copy(x,x+2),h.copy(x+1,x+3),c.copy(b-1,b-3),c.copy(b-2,b-4)}return this._vertexOffset=g,this._vertexOffset}}},setItemColor:function(e,t){for(var i=this._itemVertexOffsets[e],n=e<this._itemVertexOffsets.length-1?this._itemVertexOffsets[e+1]:this._vertexOffset,r=i;r<n;r++)this.attributes.color.set(r,t);this.dirty("color")},currentTriangleOffset:function(){return this._triangleOffset},currentVertexOffset:function(){return this._vertexOffset}});a.a.util.defaults(u.prototype,o.a),t.a=u},function(e,t,i){var n=i(70),r=function(e,t){e=e||0,t=t||0,this.array=n.a.fromValues(e,t),this._dirty=!0};if(r.prototype={constructor:r,add:function(e){return n.a.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 r(this.x,this.y)},copy:function(e){return n.a.copy(this.array,e.array),this._dirty=!0,this},cross:function(e,t){return n.a.cross(e.array,this.array,t.array),e._dirty=!0,this},dist:function(e){return n.a.dist(this.array,e.array)},distance:function(e){return n.a.distance(this.array,e.array)},div:function(e){return n.a.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return n.a.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return n.a.dot(this.array,e.array)},len:function(){return n.a.len(this.array)},length:function(){return n.a.length(this.array)},lerp:function(e,t,i){return n.a.lerp(this.array,e.array,t.array,i),this._dirty=!0,this},min:function(e){return n.a.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return n.a.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return n.a.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return n.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return n.a.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return n.a.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return n.a.random(this.array,e),this._dirty=!0,this},scale:function(e){return n.a.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return n.a.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return n.a.sqrDist(this.array,e.array)},squaredDistance:function(e){return n.a.squaredDistance(this.array,e.array)},sqrLen:function(){return n.a.sqrLen(this.array)},squaredLength:function(){return n.a.squaredLength(this.array)},sub:function(e){return n.a.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return n.a.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat2:function(e){return n.a.transformMat2(this.array,this.array,e.array),this._dirty=!0,this},transformMat2d:function(e){return n.a.transformMat2d(this.array,this.array,e.array),this._dirty=!0,this},transformMat3:function(e){return n.a.transformMat3(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return n.a.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 a=r.prototype;Object.defineProperty(a,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),Object.defineProperty(a,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}})}r.add=function(e,t,i){return n.a.add(e.array,t.array,i.array),e._dirty=!0,e},r.set=function(e,t,i){return n.a.set(e.array,t,i),e._dirty=!0,e},r.copy=function(e,t){return n.a.copy(e.array,t.array),e._dirty=!0,e},r.cross=function(e,t,i){return n.a.cross(e.array,t.array,i.array),e._dirty=!0,e},r.distance=r.dist=function(e,t){return n.a.distance(e.array,t.array)},r.divide=r.div=function(e,t,i){return n.a.divide(e.array,t.array,i.array),e._dirty=!0,e},r.dot=function(e,t){return n.a.dot(e.array,t.array)},r.len=function(e){return n.a.length(e.array)},r.lerp=function(e,t,i,r){return n.a.lerp(e.array,t.array,i.array,r),e._dirty=!0,e},r.min=function(e,t,i){return n.a.min(e.array,t.array,i.array),e._dirty=!0,e},r.max=function(e,t,i){return n.a.max(e.array,t.array,i.array),e._dirty=!0,e},r.multiply=r.mul=function(e,t,i){return n.a.multiply(e.array,t.array,i.array),e._dirty=!0,e},r.negate=function(e,t){return n.a.negate(e.array,t.array),e._dirty=!0,e},r.normalize=function(e,t){return n.a.normalize(e.array,t.array),e._dirty=!0,e},r.random=function(e,t){return n.a.random(e.array,t),e._dirty=!0,e},r.scale=function(e,t,i){return n.a.scale(e.array,t.array,i),e._dirty=!0,e},r.scaleAndAdd=function(e,t,i,r){return n.a.scaleAndAdd(e.array,t.array,i.array,r),e._dirty=!0,e},r.squaredDistance=r.sqrDist=function(e,t){return n.a.sqrDist(e.array,t.array)},r.squaredLength=r.sqrLen=function(e){return n.a.sqrLen(e.array)},r.subtract=r.sub=function(e,t,i){return n.a.subtract(e.array,t.array,i.array),e._dirty=!0,e},r.transformMat2=function(e,t,i){return n.a.transformMat2(e.array,t.array,i.array),e._dirty=!0,e},r.transformMat2d=function(e,t,i){return n.a.transformMat2d(e.array,t.array,i.array),e._dirty=!0,e},r.transformMat3=function(e,t,i){return n.a.transformMat3(e.array,t.array,i.array),e._dirty=!0,e},r.transformMat4=function(e,t,i){return n.a.transformMat4(e.array,t.array,i.array),e._dirty=!0,e},t.a=r},function(e,t,i){var n=i(4),r=i(11),a=i(23),o=i(73),s=i(14),l=o.a.isPowerOfTwo,u=["px","nx","py","ny","pz","nz"],h=n.a.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 i=this.format,n=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 a=e.getGLExtension("EXT_texture_filter_anisotropic");if(a&&this.anisotropic>1&&t.texParameterf(t.TEXTURE_CUBE_MAP,a.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===n&&(e.getGLExtension("OES_texture_half_float")||(n=r.a.FLOAT)),this.mipmaps.length)for(var o=this.width,s=this.height,l=0;l<this.mipmaps.length;l++){var u=this.mipmaps[l];this._updateTextureData(t,u,l,o,s,i,n),o/=2,s/=2}else this._updateTextureData(t,this,0,this.width,this.height,i,n),!this.NPOT&&this.useMipmap&&t.generateMipmap(t.TEXTURE_CUBE_MAP);t.bindTexture(t.TEXTURE_CUBE_MAP,null)},_updateTextureData:function(e,t,i,n,r,a,o){for(var s=0;s<6;s++){var l=u[s],h=t.image&&t.image[l];h?e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+s,i,a,a,o,h):e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+s,i,a,n,r,0,a,o,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?l(this.image.px.width)&&l(this.image.px.height):l(this.width)&&l(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 i=0,n=this;return a.a.each(e,(function(e,r){var a=s.a.createImage();t&&(a.crossOrigin=t),a.onload=function(){0==--i&&(n.dirty(),n.trigger("success",n)),a.onload=null},a.onerror=function(){i--,a.onerror=null},i++,a.src=e,n.image[r]=a})),this}});function c(e){return"CANVAS"===e.nodeName||"VIDEO"===e.nodeName||e.complete}Object.defineProperty(h.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(h.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)}}),t.a=h},function(e,t,i){t.a={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"}}}},function(e,t,i){t.a={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}}}}},function(e,t,i){var n=i(1),r=i(42),a=i(0),o=i.n(a);function s(){}s.prototype={constructor:s,setScene:function(e){this._scene=e,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(e){this._lightRoot=e,this.mainLight=new n.a.DirectionalLight({shadowBias:.005}),this.ambientLight=new n.a.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,i=this.ambientLight,r=e.getModel("light"),a=r.getModel("main"),o=r.getModel("ambient");t.intensity=a.get("intensity"),i.intensity=o.get("intensity"),t.color=n.a.parseColor(a.get("color")).slice(0,3),i.color=n.a.parseColor(o.get("color")).slice(0,3);var s=a.get("alpha")||0,l=a.get("beta")||0;t.position.setArray(n.a.directionFromAlphaBeta(s,l)),t.lookAt(n.a.Vector3.ZERO),t.castShadow=a.get("shadow"),t.shadowResolution=n.a.getShadowResolution(a.get("shadowQuality"))},updateAmbientCubemap:function(e,t,i){var r=t.getModel("light.ambientCubemap"),a=r.get("texture");if(a){this._cubemapLightsCache=this._cubemapLightsCache||{};var o=this._cubemapLightsCache[a];if(!o){var s=this;o=this._cubemapLightsCache[a]=n.a.createAmbientCubemap(r.option,e,i,(function(){s._isSkyboxFromAmbientCubemap&&s._skybox.setEnvironmentMap(o.specular.cubemap),i.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,i){var a=t.get("environment"),s=this,l=(s._skybox=s._skybox||new r.a,s._skybox);if(a&&"none"!==a)if("auto"===a)if(this._isSkyboxFromAmbientCubemap=!0,this._currentCubemapLights){var u=this._currentCubemapLights.specular.cubemap;l.setEnvironmentMap(u),this._scene&&l.attachScene(this._scene),l.material.set("lod",3)}else this._skybox&&this._skybox.detachScene();else if("object"==typeof a&&a.colorStops||"string"==typeof a&&o.a.color.parse(a)){this._isSkyboxFromAmbientCubemap=!1;var h=new n.a.Texture2D({anisotropic:8,flipY:!1});l.setEnvironmentMap(h);var c=h.image=document.createElement("canvas");c.width=c.height=16;var d=c.getContext("2d");new o.a.graphic.Rect({shape:{x:0,y:0,width:16,height:16},style:{fill:a}}).brush(d),l.attachScene(this._scene)}else this._isSkyboxFromAmbientCubemap=!1,h=n.a.loadTexture(a,i,{anisotropic:8,flipY:!1}),l.setEnvironmentMap(h),l.attachScene(this._scene);else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var f=t.coordinateSystem;if(this._skybox)if(!f||!f.viewGL||"auto"===a||a.match&&a.match(/.hdr$/))this._skybox.material.undefine("fragment","SRGB_DECODE");else{var p=f.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[p]("fragment","SRGB_DECODE")}}},t.a=s},function(e,t,i){t.a={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"}}}},function(e,t,i){var n=i(0),r=i.n(n),a={getFormattedLabel:function(e,t,i,n,a){i=i||"normal";var o=e.getData(n).getItemModel(t),s=e.getDataParams(t,n);null!=a&&s.value instanceof Array&&(s.value=s.value[a]);var l,u=o.get("normal"===i?["label","formatter"]:["emphasis","label","formatter"]);return null==u&&(u=o.get(["label","formatter"])),"function"==typeof u?(s.status=i,l=u(s)):"string"==typeof u&&(l=r.a.format.formatTpl(u,s)),l},normalizeToArray:function(e){return e instanceof Array?e:null==e?[]:[e]}};t.a=a},function(e,t,i){var n,r=i(20),a={create:function(){var e=new r.a(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},clone:function(e){var t=new r.a(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},fromValues:function(e,t,i,n){var a=new r.a(4);return a[0]=e,a[1]=t,a[2]=i,a[3]=n,a},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,i,n,r){return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e},add:function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e},subtract:function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e}};a.sub=a.subtract,a.multiply=function(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e[2]=t[2]*i[2],e[3]=t[3]*i[3],e},a.mul=a.multiply,a.divide=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e[2]=t[2]/i[2],e[3]=t[3]/i[3],e},a.div=a.divide,a.min=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e[2]=Math.min(t[2],i[2]),e[3]=Math.min(t[3],i[3]),e},a.max=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e[3]=Math.max(t[3],i[3]),e},a.scale=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e},a.scaleAndAdd=function(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e[2]=t[2]+i[2]*n,e[3]=t[3]+i[3]*n,e},a.distance=function(e,t){var i=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(i*i+n*n+r*r+a*a)},a.dist=a.distance,a.squaredDistance=function(e,t){var i=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return i*i+n*n+r*r+a*a},a.sqrDist=a.squaredDistance,a.length=function(e){var t=e[0],i=e[1],n=e[2],r=e[3];return Math.sqrt(t*t+i*i+n*n+r*r)},a.len=a.length,a.squaredLength=function(e){var t=e[0],i=e[1],n=e[2],r=e[3];return t*t+i*i+n*n+r*r},a.sqrLen=a.squaredLength,a.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},a.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},a.normalize=function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=i*i+n*n+r*r+a*a;return o>0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*o),e},a.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},a.lerp=function(e,t,i,n){var r=t[0],a=t[1],o=t[2],s=t[3];return e[0]=r+n*(i[0]-r),e[1]=a+n*(i[1]-a),e[2]=o+n*(i[2]-o),e[3]=s+n*(i[3]-s),e},a.random=function(e,t){return t=t||1,e[0]=Object(r.c)(),e[1]=Object(r.c)(),e[2]=Object(r.c)(),e[3]=Object(r.c)(),a.normalize(e,e),a.scale(e,e,t),e},a.transformMat4=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3];return e[0]=i[0]*n+i[4]*r+i[8]*a+i[12]*o,e[1]=i[1]*n+i[5]*r+i[9]*a+i[13]*o,e[2]=i[2]*n+i[6]*r+i[10]*a+i[14]*o,e[3]=i[3]*n+i[7]*r+i[11]*a+i[15]*o,e},a.transformQuat=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=i[0],s=i[1],l=i[2],u=i[3],h=u*n+s*a-l*r,c=u*r+l*n-o*a,d=u*a+o*r-s*n,f=-o*n-s*r-l*a;return e[0]=h*u+f*-o+c*-l-d*-s,e[1]=c*u+f*-s+d*-o-h*-l,e[2]=d*u+f*-l+h*-s-c*-o,e},a.forEach=(n=a.create(),function(e,t,i,r,a,o){var s,l;for(t||(t=4),i||(i=0),l=r?Math.min(r*t+i,e.length):e.length,s=i;s<l;s+=t)n[0]=e[s],n[1]=e[s+1],n[2]=e[s+2],n[3]=e[s+3],a(n,n,o),e[s]=n[0],e[s+1]=n[1],e[s+2]=n[2],e[s+3]=n[3];return e}),t.a=a},function(e,t,i){var n=i(20),r={create:function(){var e=new n.a(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 n.a(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 i=t[1],n=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=i,e[5]=t[7],e[6]=n,e[7]=r}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 i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],h=t[8],c=h*o-s*u,d=-h*a+s*l,f=u*a-o*l,p=i*c+n*d+r*f;return p?(p=1/p,e[0]=c*p,e[1]=(-h*n+r*u)*p,e[2]=(s*n-r*o)*p,e[3]=d*p,e[4]=(h*i-r*l)*p,e[5]=(-s*i+r*a)*p,e[6]=f*p,e[7]=(-u*i+n*l)*p,e[8]=(o*i-n*a)*p,e):null},adjoint:function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],h=t[8];return e[0]=o*h-s*u,e[1]=r*u-n*h,e[2]=n*s-r*o,e[3]=s*l-a*h,e[4]=i*h-r*l,e[5]=r*a-i*s,e[6]=a*u-o*l,e[7]=n*l-i*u,e[8]=i*o-n*a,e},determinant:function(e){var t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8];return t*(u*a-o*l)+i*(-u*r+o*s)+n*(l*r-a*s)},multiply:function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],h=t[7],c=t[8],d=i[0],f=i[1],p=i[2],g=i[3],m=i[4],v=i[5],y=i[6],_=i[7],x=i[8];return e[0]=d*n+f*o+p*u,e[1]=d*r+f*s+p*h,e[2]=d*a+f*l+p*c,e[3]=g*n+m*o+v*u,e[4]=g*r+m*s+v*h,e[5]=g*a+m*l+v*c,e[6]=y*n+_*o+x*u,e[7]=y*r+_*s+x*h,e[8]=y*a+_*l+x*c,e}};r.mul=r.multiply,r.translate=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],h=t[7],c=t[8],d=i[0],f=i[1];return e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=d*n+f*o+u,e[7]=d*r+f*s+h,e[8]=d*a+f*l+c,e},r.rotate=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],h=t[7],c=t[8],d=Math.sin(i),f=Math.cos(i);return e[0]=f*n+d*o,e[1]=f*r+d*s,e[2]=f*a+d*l,e[3]=f*o-d*n,e[4]=f*s-d*r,e[5]=f*l-d*a,e[6]=u,e[7]=h,e[8]=c,e},r.scale=function(e,t,i){var n=i[0],r=i[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},r.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},r.fromQuat=function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=i+i,s=n+n,l=r+r,u=i*o,h=n*o,c=n*s,d=r*o,f=r*s,p=r*l,g=a*o,m=a*s,v=a*l;return e[0]=1-c-p,e[3]=h-v,e[6]=d+m,e[1]=h+v,e[4]=1-u-p,e[7]=f-g,e[2]=d-m,e[5]=f+g,e[8]=1-u-c,e},r.normalFromMat4=function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],h=t[8],c=t[9],d=t[10],f=t[11],p=t[12],g=t[13],m=t[14],v=t[15],y=i*s-n*o,_=i*l-r*o,x=i*u-a*o,b=n*l-r*s,w=n*u-a*s,T=r*u-a*l,S=h*g-c*p,M=h*m-d*p,A=h*v-f*p,I=c*m-d*g,C=c*v-f*g,D=d*v-f*m,E=y*D-_*C+x*I+b*A-w*M+T*S;return E?(E=1/E,e[0]=(s*D-l*C+u*I)*E,e[1]=(l*A-o*D-u*M)*E,e[2]=(o*C-s*A+u*S)*E,e[3]=(r*C-n*D-a*I)*E,e[4]=(i*D-r*A+a*M)*E,e[5]=(n*A-i*C-a*S)*E,e[6]=(g*T-m*w+v*b)*E,e[7]=(m*x-p*T-v*_)*E,e[8]=(p*w-g*x+v*y)*E,e):null},r.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))},t.a=r},function(e,t,i){var n,r=i(7),a=i(3),o=i(56),s=i(9),l=i(21),u=i(18),h=0,c=r.a.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")+"_"+h++),this.position||(this.position=new a.a),this.rotation||(this.rotation=new o.a),this.scale||(this.scale=new a.a(1,1,1)),this.worldTransform=new s.a,this.localTransform=new s.a,this._children=[]}),{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(e){var t=this._scene;if(t){var i=t._nodeRepository;delete i[this.name],i[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 i=this._scene;i&&i!==e.scene&&e.traverse(this._addSelfToScene,this),e._needsUpdateWorldTransform=!0}},remove:function(e){var t=this._children,i=t.indexOf(e);i<0||(t.splice(i,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,i=0;i<t.length;i++)if(t[i].name===e)return t[i]},getDescendantByName:function(e){for(var t=this._children,i=0;i<t.length;i++){var n=t[i];if(n.name===e)return n;var r=n.getDescendantByName(e);if(r)return r}},queryNode:function(e){if(e){for(var t=e.split("/"),i=this,n=0;n<t.length;n++){var r=t[n];if(r){for(var a=!1,o=i._children,s=0;s<o.length;s++){var l=o[s];if(l.name===r){i=l,a=!0;break}}if(!a)return}}return i}},getPath:function(e){if(!this._parent)return"/";for(var t=this._parent,i=this.name;t._parent&&(i=t.name+"/"+i,t._parent!=e);)t=t._parent;return!t._parent&&e?null:i},traverse:function(e,t){e.call(t,this);for(var i=this._children,n=0,r=i.length;n<r;n++)i[n].traverse(e,t)},eachChild:function(e,t){for(var i=this._children,n=0,r=i.length;n<r;n++){var a=i[n];e.call(t,a,n)}},setLocalTransform:function(e){l.a.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){l.a.copy(this.worldTransform.array,e.array),this.decomposeWorldTransform()},decomposeWorldTransform:(n=l.a.create(),function(e){var t=this.localTransform,i=this.worldTransform;this._parent?(l.a.invert(n,this._parent.worldTransform.array),l.a.multiply(t.array,n,i.array)):l.a.copy(t.array,i.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,i=this.scale;if(this.transformNeedsUpdate()){var n=this.localTransform.array;l.a.fromRotationTranslation(n,t.array,e.array),l.a.scale(n,n,i.array),t._dirty=!1,i._dirty=!1,e._dirty=!1,this._needsUpdateWorldTransform=!0}},_updateWorldTransformTopDown:function(){var e=this.localTransform.array,t=this.worldTransform.array;this._parent?l.a.multiplyAffine(t,this._parent.worldTransform.array,e):l.a.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,i=0,n=t.length;i<n;i++)t[i].update(e)},getBoundingBox:function(){function e(e){return!e.invisible&&e.geometry}var t=new u.a,i=new s.a,n=new s.a;return function(r,a){return a=a||new u.a,this._parent?s.a.invert(n,this._parent.worldTransform):s.a.identity(n),this.traverse((function(e){e.geometry&&e.geometry.boundingBox&&(t.copy(e.geometry.boundingBox),s.a.multiply(i,n,e.worldTransform),t.applyTransform(i),a.union(t))}),this,e),a}}(),getWorldPosition:function(e){this.transformNeedsUpdate()&&this.updateWorldTransform();var t=this.worldTransform.array;if(e){var i=e.array;return i[0]=t[12],i[1]=t[13],i[2]=t[14],e}return new a.a(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 i=0;i<t.length;i++)e.add(t[i].clone());return e},rotateAround:function(){var e=new a.a,t=new s.a;return function(i,n,r){e.copy(this.position).subtract(i);var a=this.localTransform;a.identity(),a.translate(i),a.rotate(r,n),t.fromRotationTranslation(this.rotation,e),a.multiply(t),a.scale(this.scale),this.decomposeLocalTransform(),this._needsUpdateWorldTransform=!0}}(),lookAt:function(){var e=new s.a;return function(t,i){e.lookAt(this.position,t,i||this.localTransform.y).invert(),this.setLocalTransform(e),this.target=t}}()});t.a=c},function(e,t,i){var n=i(35),r=i(24),a=i(58),o=i(18),s=i(23),l=i(21),u=i(69),h=i(9),c=l.a.create(),d=l.a.create(),f={};function p(e){var t=[],i=Object.keys(e);i.sort();for(var n=0;n<i.length;n++){var r=i[n];t.push(r+" "+e[r])}var a=t.join("\n");if(f[a])return f[a];var o=s.a.genGUID();return f[a]=o,o}function g(){this.opaque=[],this.transparent=[],this._opaqueCount=0,this._transparentCount=0}g.prototype.startCount=function(){this._opaqueCount=0,this._transparentCount=0},g.prototype.add=function(e,t){t?this.transparent[this._transparentCount++]=e:this.opaque[this._opaqueCount++]=e},g.prototype.endCount=function(){this.transparent.length=this._transparentCount,this.opaque.length=this._opaqueCount};var m,v,y=n.a.extend((function(){return{material:null,lights:[],viewBoundingBoxLastFrame:new o.a,shadowUniforms:{},_cameraList:[],_lightUniforms:{},_previousLightNumber:{},_lightNumber:{},_lightProgramKeys:{},_nodeRepository:{},_renderLists:new u.a(20)}}),(function(){this._scene=this}),{addToScene:function(e){e instanceof a.a?(this._cameraList.length>0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(e)):e instanceof r.a&&this.lights.push(e),e.name&&(this._nodeRepository[e.name]=e)},removeFromScene:function(e){var t;e instanceof a.a?(t=this._cameraList.indexOf(e))>=0&&this._cameraList.splice(t,1):e instanceof r.a&&(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={},i=0;i<e.length;i++){var n=e[i];if(!n.invisible){var r=n.group;t[r]||(t[r]={}),t[r][n.type]=t[r][n.type]||0,t[r][n.type]++}}for(var a in this._lightNumber=t,t)this._lightProgramKeys[a]=p(t[a]);this._updateLightUniforms()},cloneNode:function(e){var t=e.clone(),i={};return function e(t,n){i[t.__uid__]=n;for(var r=0;r<t._children.length;r++)e(t._children[r],n._children[r])}(e,t),t.traverse((function(e){e.skeleton&&(e.skeleton=e.skeleton.clone(i)),e.material&&(e.material=e.material.clone())})),t},updateRenderList:function(e,t){var i=e.__uid__,n=this._renderLists.get(i);n||(n=new g,this._renderLists.put(i,n)),n.startCount(),t&&(this.viewBoundingBoxLastFrame.min.set(1/0,1/0,1/0),this.viewBoundingBoxLastFrame.max.set(-1/0,-1/0,-1/0));var r=this.material&&this.material.transparent||!1;return this._doUpdateRenderList(this,e,r,n,t),n.endCount(),n},getRenderList:function(e){return this._renderLists.get(e.__uid__)},_doUpdateRenderList:function(e,t,i,n,r){if(!e.invisible)for(var a=0;a<e._children.length;a++){var o=e._children[a];if(o.isRenderable()){var s=o.isSkinnedMesh()?c:o.worldTransform.array,u=o.geometry;l.a.multiplyAffine(d,t.viewMatrix.array,s),(r&&!u.boundingBox||!this.isFrustumCulled(o,t,d))&&n.add(o,o.material.transparent||i)}o._children.length>0&&this._doUpdateRenderList(o,t,i,n,r)}},isFrustumCulled:(m=new o.a,v=new h.a,function(e,t,i){var n=e.boundingBox;if(n||(n=e.skeleton&&e.skeleton.boundingBox?e.skeleton.boundingBox:e.geometry.boundingBox),!n)return!1;if(v.array=i,m.transformFrom(n,v),e.castShadow&&this.viewBoundingBoxLastFrame.union(m),e.frustumCulling){if(!m.intersectBoundingBox(t.frustum.boundingBox))return!0;v.array=t.projectionMatrix.array,m.max.array[2]>0&&m.min.array[2]<0&&(m.max.array[2]=-1e-20),m.applyProjection(v);var r=m.min.array,a=m.max.array;if(a[0]<-1||r[0]>1||a[1]<-1||r[1]>1||a[2]<-1||r[2]>1)return!0}return!1}),_updateLightUniforms:function(){var e=this.lights;e.sort(_);var t=this._lightUniforms;for(var i in t)for(var n in t[i])t[i][n].value.length=0;for(var r=0;r<e.length;r++){var a=e[r];if(!a.invisible)for(var n in i=a.group,a.uniformTemplates){var o=a.uniformTemplates[n],s=o.value(a);if(null!=s){t[i]||(t[i]={}),t[i][n]||(t[i][n]={type:"",value:[]});var l=t[i][n];switch(l.type=o.type+"v",o.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 "+o.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,i=this._lightNumber;for(var n in i[e]){if(!t[e])return!0;if(i[e][n]!==t[e][n])return!0}for(var n in t[e]){if(!i[e])return!0;if(i[e][n]!==t[e][n])return!0}return!1},getLightsNumbers:function(e){return this._lightNumber[e]},getProgramKey:function(e){return this._lightProgramKeys[e]},setLightUniforms:function(){function e(e,t,i){for(var n in e){var r=e[n];if("tv"===r.type){if(!t.hasUniform(n))continue;for(var a=[],o=0;o<r.value.length;o++){var s=r.value[o],l=t.takeCurrentTextureSlot(i,s);a.push(l)}t.setUniform(i.gl,"1iv",n,a)}else t.setUniform(i.gl,r.type,n,r.value)}}return function(t,i,n){e(this._lightUniforms[i],t,n),e(this.shadowUniforms,t,n)}}(),dispose:function(){this.material=null,this._opaqueList=[],this._transparentList=[],this.lights=[],this._lightUniforms={},this._lightNumber={},this._nodeRepository={}}});function _(e,t){if(t.castShadow&&!e.castShadow)return!0}t.a=y},function(e,t,i){var n=i(58),r=n.a.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=n.a.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}});t.a=r},function(e,t,i){t.a={convertToDynamicArray:function(e){e&&this.resetOffset();var t=this.attributes;for(var i in t)e||!t[i].value?t[i].value=[]:t[i].value=Array.prototype.slice.call(t[i].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()}}},function(e,t,i){var n=i(0),r=i.n(n);t.a=function(e,t,i){var n=e.getData(),a=e.getRawValue(t),o=r.a.util.isArray(a)?function(e){var a=[],o=function(e,t){var i=[];return r.a.util.each(e.dimensions,(function(n){var r=e.getDimensionInfo(n),a=r.otherDims[t];null!=a&&!1!==a&&(i[a]=r.name)})),i}(n,"tooltip");function s(e,t){var o=n.getDimensionInfo(t);if(o&&!1!==o.otherDims.tooltip){var s=o.type,l="- "+(o.tooltipName||o.name)+": "+("ordinal"===s?e+"":"time"===s?i?"":r.a.format.formatTime("yyyy/MM/dd hh:mm:ss",e):r.a.format.addCommas(e));l&&a.push(r.a.format.encodeHTML(l))}}return o.length?r.a.util.each(o,(function(e){s(n.get(e,t),e)})):r.a.util.each(e,s),"<br/>"+a.join("<br/>")}(a):r.a.format.encodeHTML(r.a.format.addCommas(a)),s=n.getName(t),l=n.getItemVisual(t,"color");r.a.util.isObject(l)&&l.colorStops&&(l=(l.colorStops[0]||{}).color),l=l||"transparent";var u=r.a.format.getTooltipMarker(l),h=e.name;return"\0-"===h&&(h=""),h=h?r.a.format.encodeHTML(h)+(i?": ":"<br/>"):"",i?u+h+o:h+u+(s?r.a.format.encodeHTML(s)+": "+o:o)}},function(e,t,i){var n=i(72),r=i(11),a=n.a.extend({skeleton:null,joints:null,useSkinMatricesTexture:!1},(function(){this.joints||(this.joints=[])}),{isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&this.joints.length>0)},clone:function(){var e=n.a.prototype.clone.call(this);return e.skeleton=this.skeleton,this.joints&&(e.joints=this.joints.slice()),e}});a.POINTS=r.a.POINTS,a.LINES=r.a.LINES,a.LINE_LOOP=r.a.LINE_LOOP,a.LINE_STRIP=r.a.LINE_STRIP,a.TRIANGLES=r.a.TRIANGLES,a.TRIANGLE_STRIP=r.a.TRIANGLE_STRIP,a.TRIANGLE_FAN=r.a.TRIANGLE_FAN,a.BACK=r.a.BACK,a.FRONT=r.a.FRONT,a.FRONT_AND_BACK=r.a.FRONT_AND_BACK,a.CW=r.a.CW,a.CCW=r.a.CCW,t.a=a},function(e,t,i){var n=i(58),r=n.a.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=n.a.prototype.clone.call(this);return e.fov=this.fov,e.aspect=this.aspect,e.near=this.near,e.far=this.far,e}});t.a=r},function(e,t,i){var n=i(40),r=i(76),a=i(8),o=i(19),s=i(4),l=i(121);a.a.import(l.a);var u=n.a.extend((function(){var e=new a.a({vertex:a.a.source("clay.skybox.vertex"),fragment:a.a.source("clay.skybox.fragment")}),t=new o.a({shader:e,depthMask:!1});return{scene:null,geometry:new r.a,material:t,environmentMap:null,culling:!1}}),(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=s.a.LINEAR):this.material.undefine("EQUIRECTANGULAR"),this.material.set("environmentMap",e)},getEnvironmentMap:function(){return this.material.get("environmentMap")},_beforeRenderScene:function(e,t,i){this.renderSkybox(e,i)},renderSkybox:function(e,t){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],t)}});t.a=u},function(e,t,i){var n=i(15),r=i(18),a=n.a.extend({dynamic:!1,widthSegments:1,heightSegments:1},(function(){this.build()}),{build:function(){for(var e=this.heightSegments,t=this.widthSegments,i=this.attributes,n=[],a=[],o=[],s=[],l=0;l<=e;l++)for(var u=l/e,h=0;h<=t;h++){var c=h/t;if(n.push([2*c-1,2*u-1,0]),a&&a.push([c,u]),o&&o.push([0,0,1]),h<t&&l<e){var d=h+l*(t+1);s.push([d,d+1,d+t+1]),s.push([d+t+1,d+1,d+t+2])}}i.position.fromArray(n),i.texcoord0.fromArray(a),i.normal.fromArray(o),this.initIndicesFromArray(s),this.boundingBox=new r.a,this.boundingBox.min.set(-1,-1,0),this.boundingBox.max.set(1,1,0)}});t.a=a},function(e,t,i){t.a={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)}}},function(e,t,i){var n=i(7),r=i(26),a=i(3);i(56);var o=i(2).a.firstNotNull,s={left:0,middle:1,right:2};function l(e){return e instanceof Array||(e=[e,e]),e}var u=n.a.extend((function(){return{zr:null,viewGL:null,_center:new a.a,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 r.a,_panVelocity:new r.a,_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 i=(t=t||{}).baseDistance||0,n=t.baseOrthoSize||1,r=e.get("projection");"perspective"!==r&&"orthographic"!==r&&"isometric"!==r&&(console.error("Unkown projection type %s, use perspective projection instead.",r),r="perspective"),this._projection=r,this.viewGL.setProjection(r);var a=e.get("distance")+i,s=e.get("orthographicSize")+n;[["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]]=o(e.get(t[0]),t[1])}),this),this.minDistance+=i,this.maxDistance+=i,this.minOrthographicSize+=n,this.maxOrthographicSize+=n;var l=e.ecModel,u={};["animation","animationDurationUpdate","animationEasingUpdate"].forEach((function(t){u[t]=o(e.get(t),l&&l.get(t))}));var h=o(t.alpha,e.get("alpha"))||0,c=o(t.beta,e.get("beta"))||0,d=o(t.center,e.get("center"))||[0,0,0];u.animation&&u.animationDurationUpdate>0&&this._notFirst?this.animateTo({alpha:h,beta:c,center:d,distance:a,targetOrthographicSize:s,easing:u.animationEasingUpdate,duration:u.animationDurationUpdate}):(this.setDistance(a),this.setAlpha(h),this.setBeta(c),this.setCenter(d),this.setOrthographicSize(s)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){null==s[this.panMouseButton]&&console.error("Unkown panMouseButton %s. It should be left|middle|right",this.panMouseButton),null==s[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,i=this,n={},r={};return null!=e.distance&&(n.distance=this.getDistance(),r.distance=e.distance),null!=e.orthographicSize&&(n.orthographicSize=this.getOrthographicSize(),r.orthographicSize=e.orthographicSize),null!=e.alpha&&(n.alpha=this.getAlpha(),r.alpha=e.alpha),null!=e.beta&&(n.beta=this.getBeta(),r.beta=e.beta),null!=e.center&&(n.center=this.getCenter(),r.center=e.center),this._addAnimator(t.animation.animate(n).when(e.duration||1e3,r).during((function(){null!=n.alpha&&i.setAlpha(n.alpha),null!=n.beta&&i.setBeta(n.beta),null!=n.distance&&i.setDistance(n.distance),null!=n.center&&i.setCenter(n.center),null!=n.orthographicSize&&i.setOrthographicSize(n.orthographicSize),i._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(),i=this._orthoSize,n=i/this.viewGL.viewport.height*this.viewGL.viewport.width;t.left=-n/2,t.right=n/2,t.top=i/2,t.bottom=-i/2},_updatePan:function(e){var t=this._panVelocity,i=this._distance,n=this.getCamera(),r=n.worldTransform.y,a=n.worldTransform.x;this._center.scaleAndAdd(a,-t.x*i/200).scaleAndAdd(r,-t.y*i/200),this._vectorDamping(t,0)},_updateTransform:function(){var e=this.getCamera(),t=new a.a,i=this._theta+Math.PI/2,n=this._phi+Math.PI/2,r=Math.sin(i);t.x=r*Math.cos(n),t.y=-Math.cos(i),t.z=r*Math.sin(n),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 i=e.len();(i*=t)<1e-4&&(i=0),e.normalize().scale(i)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var e=this.getCamera().worldTransform.z,t=Math.asin(e.y),i=Math.atan2(e.x,e.z);this._theta=t,this._phi=-i,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,i=e.offsetY;this.viewGL&&!this.viewGL.containPoint(t,i)||(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===s[this.rotateMouseButton]?this._mode="rotate":e.event.button===s[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=l(this.panSensitivity),i=l(this.rotateSensitivity);"rotate"===this._mode?(this._rotateVelocity.y=(e.offsetX-this._mouseX)/this.zr.getHeight()*2*i[0],this._rotateVelocity.x=(e.offsetY-this._mouseY)/this.zr.getWidth()*2*i[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 i,n=e.offsetX,r=e.offsetY;this.viewGL&&!this.viewGL.containPoint(n,r)||(i="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)*i*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 i=t.indexOf(e);i>=0&&t.splice(i,1)})),e}});Object.defineProperty(u.prototype,"autoRotate",{get:function(e){return this._autoRotate},set:function(e){this._autoRotate=e,this._rotating=e}}),t.a=u},function(e,t,i){t.a="@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"},function(e,t,i){var n=i(13),r=i(82),a=i(85).parsePercent,o=i(171),s=n.each,l=["left","right","top","bottom","width","height"],u=[["width","left","right"],["height","top","bottom"]];function h(e,t,i,n,r){var a=0,o=0;null==n&&(n=1/0),null==r&&(r=1/0);var s=0;t.eachChild((function(l,u){var h,c,d=l.position,f=l.getBoundingRect(),p=t.childAt(u+1),g=p&&p.getBoundingRect();if("horizontal"===e){var m=f.width+(g?-g.x+f.x:0);(h=a+m)>n||l.newline?(a=0,h=m,o+=s+i,s=f.height):s=Math.max(s,f.height)}else{var v=f.height+(g?-g.y+f.y:0);(c=o+v)>r||l.newline?(a+=s+i,o=0,c=v,s=f.width):s=Math.max(s,f.width)}l.newline||(d[0]=a,d[1]=o,"horizontal"===e?a=h+i:o=c+i)}))}var c=h,d=n.curry(h,"vertical"),f=n.curry(h,"horizontal");function p(e,t,i){i=o.normalizeCssArray(i||0);var n=t.width,s=t.height,l=a(e.left,n),u=a(e.top,s),h=a(e.right,n),c=a(e.bottom,s),d=a(e.width,n),f=a(e.height,s),p=i[2]+i[0],g=i[1]+i[3],m=e.aspect;switch(isNaN(d)&&(d=n-h-g-l),isNaN(f)&&(f=s-c-p-u),null!=m&&(isNaN(d)&&isNaN(f)&&(m>n/s?d=.8*n:f=.8*s),isNaN(d)&&(d=m*f),isNaN(f)&&(f=d/m)),isNaN(l)&&(l=n-h-d-g),isNaN(u)&&(u=s-c-f-p),e.left||e.right){case"center":l=n/2-d/2-i[3];break;case"right":l=n-d-g}switch(e.top||e.bottom){case"middle":case"center":u=s/2-f/2-i[0];break;case"bottom":u=s-f-p}l=l||0,u=u||0,isNaN(d)&&(d=n-g-l-(h||0)),isNaN(f)&&(f=s-p-u-(c||0));var v=new r(l+i[3],u+i[0],d,f);return v.margin=i,v}function g(e,t){return t&&e&&s(l,(function(i){t.hasOwnProperty(i)&&(e[i]=t[i])})),e}t.LOCATION_PARAMS=l,t.HV_NAMES=u,t.box=c,t.vbox=d,t.hbox=f,t.getAvailableSize=function(e,t,i){var n=t.width,r=t.height,s=a(e.x,n),l=a(e.y,r),u=a(e.x2,n),h=a(e.y2,r);return(isNaN(s)||isNaN(parseFloat(e.x)))&&(s=0),(isNaN(u)||isNaN(parseFloat(e.x2)))&&(u=n),(isNaN(l)||isNaN(parseFloat(e.y)))&&(l=0),(isNaN(h)||isNaN(parseFloat(e.y2)))&&(h=r),i=o.normalizeCssArray(i||0),{width:Math.max(u-s-i[1]-i[3],0),height:Math.max(h-l-i[0]-i[2],0)}},t.getLayoutRect=p,t.positionElement=function(e,t,i,a,o){var s=!o||!o.hv||o.hv[0],l=!o||!o.hv||o.hv[1],u=o&&o.boundingMode||"all";if(s||l){var h;if("raw"===u)h="group"===e.type?new r(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(h=e.getBoundingRect(),e.needLocalTransform()){var c=e.getLocalTransform();(h=h.clone()).applyTransform(c)}t=p(n.defaults({width:h.width,height:h.height},t),i,a);var d=e.position,f=s?t.x-h.x:0,g=l?t.y-h.y:0;e.attr("position","raw"===u?[f,g]:[d[0]+f,d[1]+g])}},t.sizeCalculable=function(e,t){return null!=e[u[t][0]]||null!=e[u[t][1]]&&null!=e[u[t][2]]},t.mergeLayoutParam=function(e,t,i){!n.isObject(i)&&(i={});var r=i.ignoreSize;!n.isArray(r)&&(r=[r,r]);var a=l(u[0],0),o=l(u[1],1);function l(i,n){var a={},o=0,l={},u=0;if(s(i,(function(t){l[t]=e[t]})),s(i,(function(e){h(t,e)&&(a[e]=l[e]=t[e]),c(a,e)&&o++,c(l,e)&&u++})),r[n])return c(t,i[1])?l[i[2]]=null:c(t,i[2])&&(l[i[1]]=null),l;if(2!==u&&o){if(o>=2)return a;for(var d=0;d<i.length;d++){var f=i[d];if(!h(a,f)&&h(e,f)){a[f]=e[f];break}}return a}return l}function h(e,t){return e.hasOwnProperty(t)}function c(e,t){return null!=e[t]&&"auto"!==e[t]}function d(e,t,i){s(e,(function(e){t[e]=i[e]}))}d(u[0],e,a),d(u[1],e,o)},t.getLayoutParams=function(e){return g({},e)},t.copyLayoutParams=g},function(e,t,i){var n=i(7).a.extend((function(){return{name:"",inputLinks:{},outputLinks:{},_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}}),{updateParameter:function(e,t){var i,n,r=this.outputs[e],a=r.parameters,o=r._parametersCopy;if(o||(o=r._parametersCopy={}),a)for(var s in a)"width"!==s&&"height"!==s&&(o[s]=a[s]);return i=a.width instanceof Function?a.width.call(this,t):a.width,n=a.height instanceof Function?a.height.call(this,t):a.height,o.width===i&&o.height===n||this._outputTextures[e]&&this._outputTextures[e].dispose(t.gl),o.width=i,o.height=n,o},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 i=this.outputs[t];return i?this._rendered?i.outputLastFrame?this._prevOutputTextures[t]:this._outputTextures[t]:this._rendering?(this._prevOutputTextures[t]||(this._prevOutputTextures[t]=this._compositor.allocateTexture(i.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,i){this.inputLinks[e]={node:t,pin:i},t.outputLinks[i]||(t.outputLinks[i]=[]),t.outputLinks[i].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 i=this.inputLinks[t];i.node.updateReference(i.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)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]))}});t.a=n},function(e,t,i){t.a=function(e,t){for(var i=0,n=1/t,r=e;r>0;)i+=n*(r%t),r=Math.floor(r/t),n/=t;return i}},function(e,t,i){var n=i(0),r=i.n(n);t.a=function(e,t,i){i=i||e.getSource();var n=t||r.a.getCoordinateSystemDimensions(e.get("coordinateSystem"))||["x","y","z"],a=r.a.helper.createDimensions(i,{dimensionsDefine:i.dimensionsDefine||e.get("dimensions"),encodeDefine:i.encodeDefine||e.get("encode"),coordDimensions:n.map((function(t){var i=e.getReferringComponents(t+"Axis3D")[0];return{type:i&&"category"===i.get("type")?"ordinal":"float",name:t}}))});"cartesian3D"===e.get("coordinateSystem")&&a.forEach((function(t){if(n.indexOf(t.coordDim)>=0){var i=e.getReferringComponents(t.coordDim+"Axis3D")[0];i&&"category"===i.get("type")&&(t.ordinalMeta=i.getOrdinalMeta())}}));var o=r.a.helper.dataStack.enableDataStack(e,a,{byIndex:!0,stackedCoordDimension:"z"}),s=new r.a.List(a,e);return s.setCalculationInfo(o),s.initData(i),s}},function(e,t){e.exports=function(e,t,i){return{seriesType:e,performRawSeries:!0,reset:function(e,n,r){var a=e.getData(),o=e.get("symbol")||t,s=e.get("symbolSize"),l=e.get("symbolKeepAspect");if(a.setVisual({legendSymbol:i||o,symbol:o,symbolSize:s,symbolKeepAspect:l}),!n.isSeriesFiltered(e)){var u="function"==typeof s;return{dataEach:a.hasItemOption||u?function(t,i){if("function"==typeof s){var n=e.getRawValue(i),r=e.getDataParams(i);t.setItemVisual(i,"symbolSize",s(n,r))}if(t.hasItemOption){var a=t.getItemModel(i),o=a.getShallow("symbol",!0),l=a.getShallow("symbolSize",!0),u=a.getShallow("symbolKeepAspect",!0);null!=o&&t.setItemVisual(i,"symbol",o),null!=l&&t.setItemVisual(i,"symbolSize",l),null!=u&&t.setItemVisual(i,"symbolKeepAspect",u)}}:null}}}}}},function(e,t,i){var n=i(7),r=i(111),a=i(11),o=i(14),s=i(19),l=i(26),u=i(115),h=i(8),c=i(71),d=i(21),f=i(12);h.a.import(c.a);var p=d.a.create,g={};function m(e){return e.material}function v(e,t,i){return t.uniforms[i].value}function y(e,t,i,n){return i!==n}function _(e){return!0}function x(){}var b={float:a.a.FLOAT,byte:a.a.BYTE,ubyte:a.a.UNSIGNED_BYTE,short:a.a.SHORT,ushort:a.a.UNSIGNED_SHORT};function w(e,t,i){this.availableAttributes=e,this.availableAttributeSymbols=t,this.indicesBuffer=i,this.vao=null}function T(e){var t,i;this.bind=function(e){t||((t=o.a.createCanvas()).width=t.height=1,t.getContext("2d"));var n=e.gl,r=!i;r&&(i=n.createTexture()),n.bindTexture(n.TEXTURE_2D,i),r&&n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t)},this.unbind=function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},this.isRenderable=function(){return!0}}var S=n.a.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:{},__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}}),(function(){this.canvas||(this.canvas=o.a.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 r.a(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),this.gl.targetRenderer=this,this.resize()}catch(m9){throw"Error creating WebGL Context "+m9}this._programMgr=new u.a(this),this._placeholderTexture=new T(this)}),{resize:function(e,t){var i=this.canvas,n=this.devicePixelRatio;null!=e?(i.style.width=e+"px",i.style.height=t+"px",i.width=e*n,i.height=t*n,this._width=e,this._height=t):(this._width=i.width/n,this._height=i.height/n),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,i,n,r){if("object"==typeof e){var a=e;e=a.x,t=a.y,i=a.width,n=a.height,r=a.devicePixelRatio}r=r||this.devicePixelRatio,this.gl.viewport(e*r,t*r,i*r,n*r),this.viewport={x:e,y:t,width:i,height:n,devicePixelRatio:r}},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,i,n){var r=this.gl,a=this.clearColor;if(this.clearBit){r.colorMask(!0,!0,!0,!0),r.depthMask(!0);var o=this.viewport,s=!1,l=o.devicePixelRatio;(o.width!==this._width||o.height!==this._height||l&&l!==this.devicePixelRatio||o.x||o.y)&&(s=!0,r.enable(r.SCISSOR_TEST),r.scissor(o.x*l,o.y*l,o.width*l,o.height*l)),r.clearColor(a[0],a[1],a[2],a[3]),r.clear(this.clearBit),s&&r.disable(r.SCISSOR_TEST)}if(i||e.update(!1),e.updateLights(),t=t||e.getMainCamera()){t.update();var u=e.updateRenderList(t,!0);this._sceneRendering=e;var h=u.opaque,c=u.transparent,g=e.material;e.trigger("beforerender",this,e,t,u),n?(this.renderPreZ(h,e,t),r.depthFunc(r.LEQUAL)):r.depthFunc(r.LESS);for(var m=p(),v=f.a.create(),y=0;y<c.length;y++){var _=c[y];d.a.multiplyAffine(m,t.viewMatrix.array,_.worldTransform.array),f.a.transformMat4(v,_.position.array,m),_.__depth=v[2]}this.renderPass(h,t,{getMaterial:function(e){return g||e.material},sortCompare:this.opaqueSortCompare}),this.renderPass(c,t,{getMaterial:function(e){return g||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,i){return t=t||e.material,this._programMgr.getProgram(e,t,i)},validateProgram:function(e){if(e.__error){var t=e.__error;if(g[e.__uid__])return;if(g[e.__uid__]=!0,this.throwError)throw new Error(t);this.trigger("error",t)}},updatePrograms:function(e,t,i){var n=i&&i.getMaterial||m;t=t||null;for(var r=0;r<e.length;r++){var a=e[r],o=n.call(this,a);if(r>0){var s=e[r-1],l=s.joints?s.joints.length:0;if((a.joints?a.joints.length:0)===l&&a.material===s.material&&a.lightGroup===s.lightGroup){a.__program=s.__program;continue}}var u=this._programMgr.getProgram(a,o,t);this.validateProgram(u),a.__program=u}},renderPass:function(e,t,i){this.trigger("beforerenderpass",this,e,t,i),(i=i||{}).getMaterial=i.getMaterial||m,i.getUniform=i.getUniform||v,i.isMaterialChanged=i.isMaterialChanged||y,i.beforeRender=i.beforeRender||x,i.afterRender=i.afterRender||x;var n=i.ifRender||_;this.updatePrograms(e,this._sceneRendering,i),i.sortCompare&&e.sort(i.sortCompare);var r=this.viewport,a=r.devicePixelRatio,o=[r.x*a,r.y*a,r.width*a,r.height*a],s=this.devicePixelRatio,l=this.__currentFrameBuffer?[this.__currentFrameBuffer.getTextureWidth(),this.__currentFrameBuffer.getTextureHeight()]:[this._width*s,this._height*s],u=[o[2],o[3]],h=Date.now();t?(d.a.copy(M.VIEW,t.viewMatrix.array),d.a.copy(M.PROJECTION,t.projectionMatrix.array),d.a.copy(M.VIEWINVERSE,t.worldTransform.array)):(d.a.identity(M.VIEW),d.a.identity(M.PROJECTION),d.a.identity(M.VIEWINVERSE)),d.a.multiply(M.VIEWPROJECTION,M.PROJECTION,M.VIEW),d.a.invert(M.PROJECTIONINVERSE,M.PROJECTION),d.a.invert(M.VIEWPROJECTIONINVERSE,M.VIEWPROJECTION);for(var c,f,p,g,b,w,T,S,A,I,C,D,E=this.gl,L=this._sceneRendering,P=this.getGLExtension("OES_vertex_array_object"),N=0;N<e.length;N++){var R,O=e[N],k=null!=O.worldTransform;if(n(O)){k&&(R=O.isSkinnedMesh&&O.isSkinnedMesh()?M.IDENTITY:O.worldTransform.array);var z=O.geometry,B=i.getMaterial.call(this,O),F=O.__program,V=B.shader,G=z.__uid__+"-"+F.__uid__,H=G!==I;I=G,H&&P&&P.bindVertexArrayOES(null),k&&(d.a.copy(M.WORLD,R),d.a.multiply(M.WORLDVIEWPROJECTION,M.VIEWPROJECTION,R),d.a.multiplyAffine(M.WORLDVIEW,M.VIEW,R),(V.matrixSemantics.WORLDINVERSE||V.matrixSemantics.WORLDINVERSETRANSPOSE)&&d.a.invert(M.WORLDINVERSE,R),(V.matrixSemantics.WORLDVIEWINVERSE||V.matrixSemantics.WORLDVIEWINVERSETRANSPOSE)&&d.a.invert(M.WORLDVIEWINVERSE,M.WORLDVIEW),(V.matrixSemantics.WORLDVIEWPROJECTIONINVERSE||V.matrixSemantics.WORLDVIEWPROJECTIONINVERSETRANSPOSE)&&d.a.invert(M.WORLDVIEWPROJECTIONINVERSE,M.WORLDVIEWPROJECTION)),O.beforeRender&&O.beforeRender(this),i.beforeRender.call(this,O,B,c);var U=F!==f;U?(F.bind(this),F.setUniformOfSemantic(E,"VIEWPORT",o),F.setUniformOfSemantic(E,"WINDOW_SIZE",l),t&&(F.setUniformOfSemantic(E,"NEAR",t.near),F.setUniformOfSemantic(E,"FAR",t.far)),F.setUniformOfSemantic(E,"DEVICEPIXELRATIO",a),F.setUniformOfSemantic(E,"TIME",h),F.setUniformOfSemantic(E,"VIEWPORT_SIZE",u),L&&L.setLightUniforms(F,O.lightGroup,this)):F=f,(U||i.isMaterialChanged(O,p,B,c))&&(B.depthTest!==g&&(B.depthTest?E.enable(E.DEPTH_TEST):E.disable(E.DEPTH_TEST),g=B.depthTest),B.depthMask!==b&&(E.depthMask(B.depthMask),b=B.depthMask),B.transparent!==A&&(B.transparent?E.enable(E.BLEND):E.disable(E.BLEND),A=B.transparent),B.transparent&&(B.blend?B.blend(E):(E.blendEquationSeparate(E.FUNC_ADD,E.FUNC_ADD),E.blendFuncSeparate(E.SRC_ALPHA,E.ONE_MINUS_SRC_ALPHA,E.ONE,E.ONE_MINUS_SRC_ALPHA))),D=this._bindMaterial(O,B,F,p||null,c||null,f||null,i.getUniform),c=B);var W=V.matrixSemanticKeys;if(k)for(var j=0;j<W.length;j++){var X=W[j],Z=V.matrixSemantics[X],q=M[X];if(Z.isTranspose){var Y=M[Z.semanticNoTranspose];d.a.transpose(q,Y)}F.setUniform(E,Z.type,Z.symbol,q)}O.cullFace!==T&&(T=O.cullFace,E.cullFace(T)),O.frontFace!==S&&(S=O.frontFace,E.frontFace(S)),O.culling!==w&&((w=O.culling)?E.enable(E.CULL_FACE):E.disable(E.CULL_FACE)),this._updateSkeleton(O,F,D),H&&(C=this._bindVAO(P,V,z,F)),this._renderObject(O,C),i.afterRender(this,O),O.afterRender&&O.afterRender(this),f=F,p=O}}P&&P.bindVertexArrayOES(null),this.trigger("afterrenderpass",this,e,t,i)},getMaxJointNumber:function(){return this._glinfo.getMaxJointNumber()},_updateSkeleton:function(e,t,i){var n=this.gl,r=e.skeleton;if(r)if(r.update(),e.joints.length>this._glinfo.getMaxJointNumber()){var a=r.getSubSkinMatricesTexture(e.__uid__,e.joints);t.useTextureSlot(this,a,i),t.setUniform(n,"1i","skinMatricesTexture",i),t.setUniform(n,"1f","skinMatricesTextureSize",a.width)}else{var o=r.getSubSkinMatrices(e.__uid__,e.joints);t.setUniformOfSemantic(n,"SKIN_MATRIX",o)}},_renderObject:function(e,t){var i=this.gl,n=e.geometry,r=e.mode;if(null==r&&(r=4),t.indicesBuffer){var a=this.getGLExtension("OES_element_index_uint")&&n.indices instanceof Uint32Array?i.UNSIGNED_INT:i.UNSIGNED_SHORT;i.drawElements(r,t.indicesBuffer.count,a,0)}else i.drawArrays(r,0,n.vertexCount)},_bindMaterial:function(e,t,i,n,r,a,o){for(var s=this.gl,l=a===i,u=i.currentTextureSlot(),h=t.getEnabledUniforms(),c=t.getTextureUniforms(),d=this._placeholderTexture,f=0;f<c.length;f++){var p=o(e,t,v=c[f]);if("t"===(m=t.uniforms[v].type)&&p)p.__slot=-1;else if("tv"===m)for(var g=0;g<p.length;g++)p[g]&&(p[g].__slot=-1)}for(d.__slot=-1,f=0;f<h.length;f++){var m,v=h[f],y=t.uniforms[v],_=(p=o(e,t,v),"t"===(m=y.type));if(_&&(p&&p.isRenderable()||(p=d)),r&&l){var x=o(n,r,v);if(_&&(x&&x.isRenderable()||(x=d)),x===p){if(_)i.takeCurrentTextureSlot(this,null);else if("tv"===m&&p)for(g=0;g<p.length;g++)i.takeCurrentTextureSlot(this,null);continue}}if(null!=p)if(_)if(p.__slot<0){var b=i.currentTextureSlot();i.setUniform(s,"1i",v,b)&&(i.takeCurrentTextureSlot(this,p),p.__slot=b)}else i.setUniform(s,"1i",v,p.__slot);else if(Array.isArray(p)){if(0===p.length)continue;if("tv"===m){if(!i.hasUniform(v))continue;var w=[];for(g=0;g<p.length;g++){var T=p[g];T.__slot<0?(b=i.currentTextureSlot(),w.push(b),i.takeCurrentTextureSlot(this,T),T.__slot=b):w.push(T.__slot)}i.setUniform(s,"1iv",v,w)}else i.setUniform(s,y.type,v,p)}else i.setUniform(s,y.type,v,p)}var S=i.currentTextureSlot();return i.resetTextureSlot(u),S},_bindVAO:function(e,t,i,n){var r=!i.dynamic,a=this.gl,o=this.__uid__+"-"+n.__uid__,s=i.__vaoCache[o];if(!s){var l=i.getBufferChunks(this);if(!l||!l.length)return;for(var u=l[0],h=u.attributeBuffers,c=u.indicesBuffer,d=[],f=[],p=0;p<h.length;p++){var g,m=(S=h[p]).name,v=S.semantic;if(v){var y=t.attributeSemantics[v];g=y&&y.symbol}else g=m;g&&n.attributes[g]&&(d.push(S),f.push(g))}s=new w(d,f,c),r&&(i.__vaoCache[o]=s)}var _=!0;if(e&&r&&(null==s.vao?s.vao=e.createVertexArrayOES():_=!1,e.bindVertexArrayOES(s.vao)),d=s.availableAttributes,c=s.indicesBuffer,_){var x=n.enableAttributes(this,s.availableAttributeSymbols,e&&r&&s);for(p=0;p<d.length;p++){var T=x[p];if(-1!==T){var S,M=(S=d[p]).buffer,A=S.size,I=b[S.type]||a.FLOAT;a.bindBuffer(a.ARRAY_BUFFER,M),a.vertexAttribPointer(T,A,I,!1,0,0)}}i.isUseIndices()&&a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,c.buffer)}return s},renderPreZ:function(e,t,i){var n=this.gl,r=this._prezMaterial||new s.a({shader:new h.a(h.a.source("clay.prez.vertex"),h.a.source("clay.prez.fragment"))});this._prezMaterial=r,n.colorMask(!1,!1,!1,!1),n.depthMask(!0),this.renderPass(e,i,{ifRender:function(e){return!e.ignorePreZ},isMaterialChanged:function(e,t){var i=e.material,n=t.material;return i.get("diffuseMap")!==n.get("diffuseMap")||(i.get("alphaCutoff")||0)!==(n.get("alphaCutoff")||0)},getUniform:function(e,t,i){return"alphaMap"===i?e.material.get("diffuseMap"):"alphaCutoff"===i?e.material.isDefined("fragment","ALPHA_TEST")&&e.material.get("diffuseMap")&&e.material.get("alphaCutoff")||0:t.get(i)},getMaterial:function(){return r},sort:this.opaqueSortCompare}),n.colorMask(!0,!0,!0,!0),n.depthMask(!0)},disposeScene:function(e){this.disposeNode(e,!0,!0),e.dispose()},disposeNode:function(e,t,i){e.getParent()&&e.getParent().remove(e);var n={};e.traverse((function(e){var r=e.material;if(e.geometry&&t&&e.geometry.dispose(this),i&&r&&!n[r.__uid__]){for(var a=r.getTextureUniforms(),o=0;o<a.length;o++){var s=a[o],l=r.uniforms[s].value,u=r.uniforms[s].type;if(l)if("t"===u)l.dispose&&l.dispose(this);else if("tv"===u)for(var h=0;h<l.length;h++)l[h]&&l[h].dispose&&l[h].dispose(this)}n[r.__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,i){i||(i=new l.a),t=this._height-t;var n=this.viewport,r=i.array;return r[0]=(e-n.x)/n.width,r[0]=2*r[0]-1,r[1]=(t-n.y)/n.height,r[1]=2*r[1]-1,i}});S.opaqueSortCompare=S.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},S.transparentSortCompare=S.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 M={IDENTITY:p(),WORLD:p(),VIEW:p(),PROJECTION:p(),WORLDVIEW:p(),VIEWPROJECTION:p(),WORLDVIEWPROJECTION:p(),WORLDINVERSE:p(),VIEWINVERSE:p(),PROJECTIONINVERSE:p(),WORLDVIEWINVERSE:p(),VIEWPROJECTIONINVERSE:p(),WORLDVIEWPROJECTIONINVERSE:p(),WORLDTRANSPOSE:p(),VIEWTRANSPOSE:p(),PROJECTIONTRANSPOSE:p(),WORLDVIEWTRANSPOSE:p(),VIEWPROJECTIONTRANSPOSE:p(),WORLDVIEWPROJECTIONTRANSPOSE:p(),WORLDINVERSETRANSPOSE:p(),VIEWINVERSETRANSPOSE:p(),PROJECTIONINVERSETRANSPOSE:p(),WORLDVIEWINVERSETRANSPOSE:p(),VIEWPROJECTIONINVERSETRANSPOSE:p(),WORLDVIEWPROJECTIONINVERSETRANSPOSE:p()};S.COLOR_BUFFER_BIT=a.a.COLOR_BUFFER_BIT,S.DEPTH_BUFFER_BIT=a.a.DEPTH_BUFFER_BIT,S.STENCIL_BUFFER_BIT=a.a.STENCIL_BUFFER_BIT,t.a=S},function(e,t,i){function n(e,t){this.action=e,this.context=t}var r={trigger:function(e){if(this.hasOwnProperty("__handlers__")&&this.__handlers__.hasOwnProperty(e)){var t=this.__handlers__[e],i=t.length,n=-1,r=arguments;switch(r.length){case 1:for(;++n<i;)t[n].action.call(t[n].context);return;case 2:for(;++n<i;)t[n].action.call(t[n].context,r[1]);return;case 3:for(;++n<i;)t[n].action.call(t[n].context,r[1],r[2]);return;case 4:for(;++n<i;)t[n].action.call(t[n].context,r[1],r[2],r[3]);return;case 5:for(;++n<i;)t[n].action.call(t[n].context,r[1],r[2],r[3],r[4]);return;default:for(;++n<i;)t[n].action.apply(t[n].context,Array.prototype.slice.call(r,1));return}}},on:function(e,t,i){if(e&&t){var r=this.__handlers__||(this.__handlers__={});if(r[e]){if(this.has(e,t))return}else r[e]=[];var a=new n(t,i||this);return r[e].push(a),this}},once:function(e,t,i){if(e&&t){var n=this;return this.on(e,(function i(){n.off(e,i),t.apply(this,arguments)}),i)}},before:function(e,t,i){if(e&&t)return e="before"+e,this.on(e,t,i)},after:function(e,t,i){if(e&&t)return e="after"+e,this.on(e,t,i)},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 i=this.__handlers__||(this.__handlers__={});if(t){if(i[e]){for(var n=i[e],r=[],a=0;a<n.length;a++)t&&n[a].action!==t&&r.push(n[a]);i[e]=r}return this}i[e]=[]},has:function(e,t){var i=this.__handlers__;if(!i||!i[e])return!1;for(var n=i[e],r=0;r<n.length;r++)if(n[r].action===t)return!0}};t.a=r},function(e,t,i){var n,r,a,o,s=i(3),l=i(12),u=1e-5,h=function(e,t){this.origin=e||new s.a,this.direction=t||new s.a};h.prototype={constructor:h,intersectPlane:function(e,t){var i=e.normal.array,n=e.distance,r=this.origin.array,a=this.direction.array,o=l.a.dot(i,a);if(0===o)return null;t||(t=new s.a);var u=(l.a.dot(i,r)-n)/o;return l.a.scaleAndAdd(t.array,r,a,-u),t._dirty=!0,t},mirrorAgainstPlane:function(e){var t=l.a.dot(e.normal.array,this.direction.array);l.a.scaleAndAdd(this.direction.array,this.direction.array,e.normal.array,2*-t),this.direction._dirty=!0},distanceToPoint:function(){var e=l.a.create();return function(t){l.a.sub(e,t,this.origin.array);var i=l.a.dot(e,this.direction.array);if(i<0)return l.a.distance(this.origin.array,t);var n=l.a.lenSquared(e);return Math.sqrt(n-i*i)}}(),intersectSphere:function(){var e=l.a.create();return function(t,i,n){var r=this.origin.array,a=this.direction.array;t=t.array,l.a.sub(e,t,r);var o=l.a.dot(e,a),u=l.a.squaredLength(e)-o*o,h=i*i;if(!(u>h)){var c=Math.sqrt(h-u),d=o-c,f=o+c;return n||(n=new s.a),d<0?f<0?null:(l.a.scaleAndAdd(n.array,r,a,f),n):(l.a.scaleAndAdd(n.array,r,a,d),n)}}}(),intersectBoundingBox:function(e,t){var i,n,r,a,o,u,h=this.direction.array,c=this.origin.array,d=e.min.array,f=e.max.array,p=1/h[0],g=1/h[1],m=1/h[2];if(p>=0?(i=(d[0]-c[0])*p,n=(f[0]-c[0])*p):(n=(d[0]-c[0])*p,i=(f[0]-c[0])*p),g>=0?(r=(d[1]-c[1])*g,a=(f[1]-c[1])*g):(a=(d[1]-c[1])*g,r=(f[1]-c[1])*g),i>a||r>n)return null;if((r>i||i!=i)&&(i=r),(a<n||n!=n)&&(n=a),m>=0?(o=(d[2]-c[2])*m,u=(f[2]-c[2])*m):(u=(d[2]-c[2])*m,o=(f[2]-c[2])*m),i>u||o>n)return null;if((o>i||i!=i)&&(i=o),(u<n||n!=n)&&(n=u),n<0)return null;var v=i>=0?i:n;return t||(t=new s.a),l.a.scaleAndAdd(t.array,c,h,v),t},intersectTriangle:(n=l.a.create(),r=l.a.create(),a=l.a.create(),o=l.a.create(),function(e,t,i,h,c,d){var f=this.direction.array,p=this.origin.array;e=e.array,t=t.array,i=i.array,l.a.sub(n,t,e),l.a.sub(r,i,e),l.a.cross(o,r,f);var g=l.a.dot(n,o);if(h){if(g>-1e-5)return null}else if(g>-1e-5&&g<u)return null;l.a.sub(a,p,e);var m=l.a.dot(o,a)/g;if(m<0||m>1)return null;l.a.cross(o,n,a);var v=l.a.dot(f,o)/g;if(v<0||v>1||m+v>1)return null;l.a.cross(o,n,r);var y=-l.a.dot(a,o)/g;return y<0?null:(c||(c=new s.a),d&&s.a.set(d,1-m-v,m,v),l.a.scaleAndAdd(c.array,p,f,y),c)}),applyTransform:function(e){s.a.add(this.direction,this.direction,this.origin),s.a.transformMat4(this.origin,this.origin,e),s.a.transformMat4(this.direction,this.direction,e),s.a.sub(this.direction,this.direction,this.origin),s.a.normalize(this.direction,this.direction)},copy:function(e){s.a.copy(this.origin,e.origin),s.a.copy(this.direction,e.direction)},clone:function(){var e=new h;return e.copy(this),e}},t.a=h},function(e,t,i){var n,r,a,o,s=i(20),l=i(12),u=i(33),h=i(34),c={create:function(){var e=new s.a(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}};c.rotationTo=(n=l.a.create(),r=l.a.fromValues(1,0,0),a=l.a.fromValues(0,1,0),function(e,t,i){var o=l.a.dot(t,i);return o<-.999999?(l.a.cross(n,r,t),l.a.length(n)<1e-6&&l.a.cross(n,a,t),l.a.normalize(n,n),c.setAxisAngle(e,n,Math.PI),e):o>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(l.a.cross(n,t,i),e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=1+o,c.normalize(e,e))}),c.setAxes=(o=h.a.create(),function(e,t,i,n){return o[0]=i[0],o[3]=i[1],o[6]=i[2],o[1]=n[0],o[4]=n[1],o[7]=n[2],o[2]=-t[0],o[5]=-t[1],o[8]=-t[2],c.normalize(e,c.fromMat3(e,o))}),c.clone=u.a.clone,c.fromValues=u.a.fromValues,c.copy=u.a.copy,c.set=u.a.set,c.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},c.setAxisAngle=function(e,t,i){i*=.5;var n=Math.sin(i);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(i),e},c.add=u.a.add,c.multiply=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=i[0],l=i[1],u=i[2],h=i[3];return e[0]=n*h+o*s+r*u-a*l,e[1]=r*h+o*l+a*s-n*u,e[2]=a*h+o*u+n*l-r*s,e[3]=o*h-n*s-r*l-a*u,e},c.mul=c.multiply,c.scale=u.a.scale,c.rotateX=function(e,t,i){i*=.5;var n=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(i),l=Math.cos(i);return e[0]=n*l+o*s,e[1]=r*l+a*s,e[2]=a*l-r*s,e[3]=o*l-n*s,e},c.rotateY=function(e,t,i){i*=.5;var n=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(i),l=Math.cos(i);return e[0]=n*l-a*s,e[1]=r*l+o*s,e[2]=a*l+n*s,e[3]=o*l-r*s,e},c.rotateZ=function(e,t,i){i*=.5;var n=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(i),l=Math.cos(i);return e[0]=n*l+r*s,e[1]=r*l-n*s,e[2]=a*l+o*s,e[3]=o*l-a*s,e},c.calculateW=function(e,t){var i=t[0],n=t[1],r=t[2];return e[0]=i,e[1]=n,e[2]=r,e[3]=Math.sqrt(Math.abs(1-i*i-n*n-r*r)),e},c.dot=u.a.dot,c.lerp=u.a.lerp,c.slerp=function(e,t,i,n){var r,a,o,s,l,u=t[0],h=t[1],c=t[2],d=t[3],f=i[0],p=i[1],g=i[2],m=i[3];return(a=u*f+h*p+c*g+d*m)<0&&(a=-a,f=-f,p=-p,g=-g,m=-m),1-a>1e-6?(r=Math.acos(a),o=Math.sin(r),s=Math.sin((1-n)*r)/o,l=Math.sin(n*r)/o):(s=1-n,l=n),e[0]=s*u+l*f,e[1]=s*h+l*p,e[2]=s*c+l*g,e[3]=s*d+l*m,e},c.invert=function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=i*i+n*n+r*r+a*a,s=o?1/o:0;return e[0]=-i*s,e[1]=-n*s,e[2]=-r*s,e[3]=a*s,e},c.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},c.length=u.a.length,c.len=c.length,c.squaredLength=u.a.squaredLength,c.sqrLen=c.squaredLength,c.normalize=u.a.normalize,c.fromMat3=function(e,t){var i,n=t[0]+t[4]+t[8];if(n>0)i=Math.sqrt(n+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{var r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);var a=(r+1)%3,o=(r+2)%3;i=Math.sqrt(t[3*r+r]-t[3*a+a]-t[3*o+o]+1),e[r]=.5*i,i=.5/i,e[3]=(t[3*a+o]-t[3*o+a])*i,e[a]=(t[3*a+r]+t[3*r+a])*i,e[o]=(t[3*o+r]+t[3*r+o])*i}return e},t.a=c},function(e,t,i){var n,r=i(55),a=i(34),o=function(e,t,i,n){e=e||0,t=t||0,i=i||0,n=void 0===n?1:n,this.array=r.a.fromValues(e,t,i,n),this._dirty=!0};o.prototype={constructor:o,add:function(e){return r.a.add(this.array,this.array,e.array),this._dirty=!0,this},calculateW:function(){return r.a.calculateW(this.array,this.array),this._dirty=!0,this},set:function(e,t,i,n){return this.array[0]=e,this.array[1]=t,this.array[2]=i,this.array[3]=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.array[3]=e[3],this._dirty=!0,this},clone:function(){return new o(this.x,this.y,this.z,this.w)},conjugate:function(){return r.a.conjugate(this.array,this.array),this._dirty=!0,this},copy:function(e){return r.a.copy(this.array,e.array),this._dirty=!0,this},dot:function(e){return r.a.dot(this.array,e.array)},fromMat3:function(e){return r.a.fromMat3(this.array,e.array),this._dirty=!0,this},fromMat4:(n=a.a.create(),function(e){return a.a.fromMat4(n,e.array),a.a.transpose(n,n),r.a.fromMat3(this.array,n),this._dirty=!0,this}),identity:function(){return r.a.identity(this.array),this._dirty=!0,this},invert:function(){return r.a.invert(this.array,this.array),this._dirty=!0,this},len:function(){return r.a.len(this.array)},length:function(){return r.a.length(this.array)},lerp:function(e,t,i){return r.a.lerp(this.array,e.array,t.array,i),this._dirty=!0,this},mul:function(e){return r.a.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return r.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return r.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return r.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},normalize:function(){return r.a.normalize(this.array,this.array),this._dirty=!0,this},rotateX:function(e){return r.a.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return r.a.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return r.a.rotateZ(this.array,this.array,e),this._dirty=!0,this},rotationTo:function(e,t){return r.a.rotationTo(this.array,e.array,t.array),this._dirty=!0,this},setAxes:function(e,t,i){return r.a.setAxes(this.array,e.array,t.array,i.array),this._dirty=!0,this},setAxisAngle:function(e,t){return r.a.setAxisAngle(this.array,e.array,t),this._dirty=!0,this},slerp:function(e,t,i){return r.a.slerp(this.array,e.array,t.array,i),this._dirty=!0,this},sqrLen:function(){return r.a.sqrLen(this.array)},squaredLength:function(){return r.a.squaredLength(this.array)},fromEuler:function(e,t){return o.fromEuler(this,e,t)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var s=Object.defineProperty;if(s){var l=o.prototype;s(l,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),s(l,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),s(l,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}}),s(l,"w",{get:function(){return this.array[3]},set:function(e){this.array[3]=e,this._dirty=!0}})}o.add=function(e,t,i){return r.a.add(e.array,t.array,i.array),e._dirty=!0,e},o.set=function(e,t,i,n,a){r.a.set(e.array,t,i,n,a),e._dirty=!0},o.copy=function(e,t){return r.a.copy(e.array,t.array),e._dirty=!0,e},o.calculateW=function(e,t){return r.a.calculateW(e.array,t.array),e._dirty=!0,e},o.conjugate=function(e,t){return r.a.conjugate(e.array,t.array),e._dirty=!0,e},o.identity=function(e){return r.a.identity(e.array),e._dirty=!0,e},o.invert=function(e,t){return r.a.invert(e.array,t.array),e._dirty=!0,e},o.dot=function(e,t){return r.a.dot(e.array,t.array)},o.len=function(e){return r.a.length(e.array)},o.lerp=function(e,t,i,n){return r.a.lerp(e.array,t.array,i.array,n),e._dirty=!0,e},o.slerp=function(e,t,i,n){return r.a.slerp(e.array,t.array,i.array,n),e._dirty=!0,e},o.multiply=o.mul=function(e,t,i){return r.a.multiply(e.array,t.array,i.array),e._dirty=!0,e},o.rotateX=function(e,t,i){return r.a.rotateX(e.array,t.array,i),e._dirty=!0,e},o.rotateY=function(e,t,i){return r.a.rotateY(e.array,t.array,i),e._dirty=!0,e},o.rotateZ=function(e,t,i){return r.a.rotateZ(e.array,t.array,i),e._dirty=!0,e},o.setAxisAngle=function(e,t,i){return r.a.setAxisAngle(e.array,t.array,i),e._dirty=!0,e},o.normalize=function(e,t){return r.a.normalize(e.array,t.array),e._dirty=!0,e},o.squaredLength=o.sqrLen=function(e){return r.a.sqrLen(e.array)},o.fromMat3=function(e,t){return r.a.fromMat3(e.array,t.array),e._dirty=!0,e},o.setAxes=function(e,t,i,n){return r.a.setAxes(e.array,t.array,i.array,n.array),e._dirty=!0,e},o.rotationTo=function(e,t,i){return r.a.rotationTo(e.array,t.array,i.array),e._dirty=!0,e},o.fromEuler=function(e,t,i){e._dirty=!0,t=t.array;var n=e.array,r=Math.cos(t[0]/2),a=Math.cos(t[1]/2),o=Math.cos(t[2]/2),s=Math.sin(t[0]/2),l=Math.sin(t[1]/2),u=Math.sin(t[2]/2);switch(i=(i||"XYZ").toUpperCase()){case"XYZ":n[0]=s*a*o+r*l*u,n[1]=r*l*o-s*a*u,n[2]=r*a*u+s*l*o,n[3]=r*a*o-s*l*u;break;case"YXZ":n[0]=s*a*o+r*l*u,n[1]=r*l*o-s*a*u,n[2]=r*a*u-s*l*o,n[3]=r*a*o+s*l*u;break;case"ZXY":n[0]=s*a*o-r*l*u,n[1]=r*l*o+s*a*u,n[2]=r*a*u+s*l*o,n[3]=r*a*o-s*l*u;break;case"ZYX":n[0]=s*a*o-r*l*u,n[1]=r*l*o+s*a*u,n[2]=r*a*u-s*l*o,n[3]=r*a*o+s*l*u;break;case"YZX":n[0]=s*a*o+r*l*u,n[1]=r*l*o+s*a*u,n[2]=r*a*u-s*l*o,n[3]=r*a*o-s*l*u;break;case"XZY":n[0]=s*a*o-r*l*u,n[1]=r*l*o-s*a*u,n[2]=r*a*u+s*l*o,n[3]=r*a*o+s*l*u}},t.a=o},function(e,t,i){var n="__dt__",r=function(){this._contextId=0,this._caches=[],this._context={}};(r.prototype={use:function(e,t){var i=this._caches;i[e]||(i[e]={},t&&(i[e]=t())),this._contextId=e,this._context=i[e]},put:function(e,t){this._context[e]=t},get:function(e){return this._context[e]},dirty:function(e){var t=n+(e=e||"");this.put(t,!0)},dirtyAll:function(e){for(var t=n+(e=e||""),i=this._caches,r=0;r<i.length;r++)i[r]&&(i[r][t]=!0)},fresh:function(e){var t=n+(e=e||"");this.put(t,!1)},freshAll:function(e){for(var t=n+(e=e||""),i=this._caches,r=0;r<i.length;r++)i[r]&&(i[r][t]=!1)},isDirty:function(e){var t=n+(e=e||""),i=this._context;return!i.hasOwnProperty(t)||!0===i[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(i){e&&e.call(t,i)}))},miss:function(e){return!this._context.hasOwnProperty(e)}}).constructor=r,t.a=r},function(e,t,i){var n,r=i(35),a=i(9),o=i(59),s=i(54),l=i(33),u=i(12),h=r.a.extend((function(){return{projectionMatrix:new a.a,invProjectionMatrix:new a.a,viewMatrix:new a.a,frustum:new o.a}}),(function(){this.update(!0)}),{update:function(e){r.a.prototype.update.call(this,e),a.a.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),a.a.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(e){a.a.copy(this.viewMatrix,e),a.a.invert(this.worldTransform,e),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(e){a.a.copy(this.projectionMatrix,e),a.a.invert(this.invProjectionMatrix,e),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:(n=l.a.create(),function(e,t){var i=void 0!==t?t:new s.a,r=e.array[0],a=e.array[1];return l.a.set(n,r,a,-1,1),l.a.transformMat4(n,n,this.invProjectionMatrix.array),l.a.transformMat4(n,n,this.worldTransform.array),u.a.scale(i.origin.array,n,1/n[3]),l.a.set(n,r,a,1,1),l.a.transformMat4(n,n,this.invProjectionMatrix.array),l.a.transformMat4(n,n,this.worldTransform.array),u.a.scale(n,n,1/n[3]),u.a.sub(i.direction.array,n,i.origin.array),u.a.normalize(i.direction.array,i.direction.array),i.direction._dirty=!0,i.origin._dirty=!0,i})});t.a=h},function(e,t,i){var n,r=i(18),a=i(74),o=i(12),s=o.a.set,l=o.a.copy,u=o.a.transformMat4,h=Math.min,c=Math.max,d=function(){this.planes=[];for(var e=0;e<6;e++)this.planes.push(new a.a);for(this.boundingBox=new r.a,this.vertices=[],e=0;e<8;e++)this.vertices[e]=o.a.fromValues(0,0,0)};d.prototype={setFromProjection:function(e){var t=this.planes,i=e.array,n=i[0],r=i[1],a=i[2],o=i[3],l=i[4],u=i[5],h=i[6],c=i[7],d=i[8],f=i[9],p=i[10],g=i[11],m=i[12],v=i[13],y=i[14],_=i[15];s(t[0].normal.array,o-n,c-l,g-d),t[0].distance=-(_-m),t[0].normalize(),s(t[1].normal.array,o+n,c+l,g+d),t[1].distance=-(_+m),t[1].normalize(),s(t[2].normal.array,o+r,c+u,g+f),t[2].distance=-(_+v),t[2].normalize(),s(t[3].normal.array,o-r,c-u,g-f),t[3].distance=-(_-v),t[3].normalize(),s(t[4].normal.array,o-a,c-h,g-p),t[4].distance=-(_-y),t[4].normalize(),s(t[5].normal.array,o+a,c+h,g+p),t[5].distance=-(_+y),t[5].normalize();var x=this.boundingBox,b=this.vertices;if(0===_){var w=u/n,T=-y/(p-1),S=-y/(p+1),M=-S/u,A=-T/u;x.min.set(-M*w,-M,S),x.max.set(M*w,M,T),s(b[0],-M*w,-M,S),s(b[1],-M*w,M,S),s(b[2],M*w,-M,S),s(b[3],M*w,M,S),s(b[4],-A*w,-A,T),s(b[5],-A*w,A,T),s(b[6],A*w,-A,T),s(b[7],A*w,A,T)}else{var I=(-1-m)/n,C=(1-m)/n,D=(1-v)/u,E=(-1-v)/u,L=(-1-y)/p,P=(1-y)/p;x.min.set(Math.min(I,C),Math.min(E,D),Math.min(P,L)),x.max.set(Math.max(C,I),Math.max(D,E),Math.max(L,P));var N=x.min.array,R=x.max.array;s(b[0],N[0],N[1],N[2]),s(b[1],N[0],R[1],N[2]),s(b[2],R[0],N[1],N[2]),s(b[3],R[0],R[1],N[2]),s(b[4],N[0],N[1],R[2]),s(b[5],N[0],R[1],R[2]),s(b[6],R[0],N[1],R[2]),s(b[7],R[0],R[1],R[2])}},getTransformedBoundingBox:(n=o.a.create(),function(e,t){var i=this.vertices,r=t.array,a=e.min,o=e.max,s=a.array,d=o.array,f=i[0];u(n,f,r),l(s,n),l(d,n);for(var p=1;p<8;p++)f=i[p],u(n,f,r),s[0]=h(n[0],s[0]),s[1]=h(n[1],s[1]),s[2]=h(n[2],s[2]),d[0]=c(n[0],d[0]),d[1]=c(n[1],d[1]),d[2]=c(n[2],d[2]);return a._dirty=!0,o._dirty=!0,e})},t.a=d},function(e,t){var i=function(){this.head=null,this.tail=null,this._len=0},n=i.prototype;n.insert=function(e){var t=new r(e);return this.insertEntry(t),t},n.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++},n.remove=function(e){var t=e.prev,i=e.next;t?t.next=i:this.head=i,i?i.prev=t:this.tail=t,e.next=e.prev=null,this._len--},n.len=function(){return this._len},n.clear=function(){this.head=this.tail=null,this._len=0};var r=function(e){this.value=e,this.next,this.prev},a=function(e){this._list=new i,this._map={},this._maxSize=e||10,this._lastRemovedEntry=null},o=a.prototype;o.put=function(e,t){var i=this._list,n=this._map,a=null;if(null==n[e]){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=i.head;i.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=t:s=new r(t),s.key=e,i.insertEntry(s),n[e]=s}return a},o.get=function(e){var t=this._map[e],i=this._list;if(null!=t)return t!==i.tail&&(i.remove(t),i.insertEntry(t)),t.value},o.clear=function(){this._list.clear(),this._map={}};var s=a;e.exports=s},function(e,t,i){var n=i(5),r=i(27),a=i(14),o=i(62),s=i(75),l=i(36),u=i(122),h=i(123),c={loadTexture:function(e,t,i,a){var o;if("function"==typeof t?(a=i=t,t={}):t=t||{},"string"==typeof e){if(e.match(/.hdr$/)||"hdr"===t.fileType)return o=new n.a({width:0,height:0,sRGB:!1}),c._fetchTexture(e,(function(e){h.a.parseRGBE(e,o,t.exposure),o.dirty(),i&&i(o)}),a),o;e.match(/.dds$/)||"dds"===t.fileType?(o=new n.a({width:0,height:0}),c._fetchTexture(e,(function(e){u.a.parse(e,o),o.dirty(),i&&i(o)}),a)):((o=new n.a).load(e),o.success(i),o.error(a))}else"object"==typeof e&&void 0!==e.px&&((o=new r.a).load(e),o.success(i),o.error(a));return o},loadPanorama:function(e,t,i,n,r,a){var o=this;"function"==typeof n?(a=r=n,n={}):n=n||{},c.loadTexture(t,n,(function(t){t.flipY=n.flipY||!1,o.panoramaToCubeMap(e,t,i,n),t.dispose(e),r&&r(i)}),a)},panoramaToCubeMap:function(e,t,i,n){var r=new o.a,a=new s.a({scene:new l.a});return a.setEnvironmentMap(t),(n=n||{}).encodeRGBM&&a.material.define("fragment","RGBM_ENCODE"),i.sRGB=t.sRGB,r.texture=i,r.render(e,a.scene),r.texture=null,r.dispose(e),i},heightToNormal:function(e,t){var i=document.createElement("canvas"),n=i.width=e.width,r=i.height=e.height,a=i.getContext("2d");a.drawImage(e,0,0,n,r),t=t||!1;for(var o=a.getImageData(0,0,n,r),s=a.createImageData(n,r),l=0;l<o.data.length;l+=4){if(t){var u=o.data[l],h=o.data[l+1],c=o.data[l+2];if(Math.abs(u-h)+Math.abs(h-c)>20)return console.warn("Given image is not a height map"),e}var d,f,p,g;l%(4*n)==0?(d=o.data[l],p=o.data[l+4]):l%(4*n)==4*(n-1)?(d=o.data[l-4],p=o.data[l]):(d=o.data[l-4],p=o.data[l+4]),l<4*n?(f=o.data[l],g=o.data[l+4*n]):l>n*(r-1)*4?(f=o.data[l-4*n],g=o.data[l]):(f=o.data[l-4*n],g=o.data[l+4*n]),s.data[l]=d-p+127,s.data[l+1]=f-g+127,s.data[l+2]=255,s.data[l+3]=255}return a.putImageData(s,0,0),i},isHeightImage:function(e,t,i){if(!e||!e.width||!e.height)return!1;var n=document.createElement("canvas"),r=n.getContext("2d"),a=t||32;i=i||20,n.width=n.height=a,r.drawImage(e,0,0,a,a);for(var o=r.getImageData(0,0,a,a),s=0;s<o.data.length;s+=4){var l=o.data[s],u=o.data[s+1],h=o.data[s+2];if(Math.abs(l-u)+Math.abs(u-h)>i)return!1}return!0},_fetchTexture:function(e,t,i){a.a.request.get({url:e,responseType:"arraybuffer",onload:t,onerror:i})},createChessboard:function(e,t,i,r){e=e||512,t=t||64,i=i||"black",r=r||"white";var a=Math.ceil(e/t),o=document.createElement("canvas");o.width=e,o.height=e;var s=o.getContext("2d");s.fillStyle=r,s.fillRect(0,0,e,e),s.fillStyle=i;for(var l=0;l<a;l++)for(var u=0;u<a;u++)(u%2?l%2:l%2-1)&&s.fillRect(l*t,u*t,t,t);return new n.a({image:o,anisotropic:8})},createBlank:function(e){var t=document.createElement("canvas");t.width=1,t.height=1;var i=t.getContext("2d");return i.fillStyle=e,i.fillRect(0,0,1,1),new n.a({image:t})}};t.a=c},function(e,t,i){var n=i(7),r=i(3),a=i(41),o=i(10),s=["px","nx","py","ny","pz","nz"],l=n.a.extend((function(){var e={position:new r.a,far:1e3,near:.1,texture:null,shadowMapPass:null},t=e._cameras={px:new a.a({fov:90}),nx:new a.a({fov:90}),py:new a.a({fov:90}),ny:new a.a({fov:90}),pz:new a.a({fov:90}),nz:new a.a({fov:90})};return t.px.lookAt(r.a.POSITIVE_X,r.a.NEGATIVE_Y),t.nx.lookAt(r.a.NEGATIVE_X,r.a.NEGATIVE_Y),t.py.lookAt(r.a.POSITIVE_Y,r.a.POSITIVE_Z),t.ny.lookAt(r.a.NEGATIVE_Y,r.a.NEGATIVE_Z),t.pz.lookAt(r.a.POSITIVE_Z,r.a.NEGATIVE_Y),t.nz.lookAt(r.a.NEGATIVE_Z,r.a.NEGATIVE_Y),e._frameBuffer=new o.a,e}),{getCamera:function(e){return this._cameras[e]},render:function(e,t,i){var n=e.gl;i||t.update();for(var a=this.texture.width,o=2*Math.atan(a/(a-.5))/Math.PI*180,l=0;l<6;l++){var u=s[l],h=this._cameras[u];if(r.a.copy(h.position,this.position),h.far=this.far,h.near=this.near,h.fov=o,this.shadowMapPass){h.update();var c=t.getBoundingBox();c.applyTransform(h.viewMatrix),t.viewBoundingBoxLastFrame.copy(c),this.shadowMapPass.render(e,t,h,!0)}this._frameBuffer.attach(this.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+l),this._frameBuffer.bind(e),e.render(t,h,!0),this._frameBuffer.unbind(e)}},dispose:function(e){this._frameBuffer.dispose(e)}});t.a=l},function(e,t,i){var n=i(1),r=i(165),a=i(166);n.a.Shader.import(a.a),t.a=n.a.Mesh.extend((function(){return{geometry:new r.a({dynamic:!0}),material:new n.a.Material({shader:n.a.createShader("ecgl.labels"),transparent:!0,depthMask:!1}),culling:!1,castShadow:!1,ignorePicking:!0}}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(204),s=i(25),l=i(2),u=i(6),h=i(65),c=i(66),d=i(46),f=u.a.vec3;function p(e){this.rootNode=new a.a.Node,this._triangulationResults={},this._shadersMap=a.a.COMMON_SHADERS.reduce((function(e,t){return e[t]=a.a.createShader("ecgl."+t),e}),{}),this._linesShader=a.a.createShader("ecgl.meshLines3D");var t={};a.a.COMMON_SHADERS.forEach((function(e){t[e]=new a.a.Material({shader:a.a.createShader("ecgl."+e)})})),this._groundMaterials=t,this._groundMesh=new a.a.Mesh({geometry:new a.a.PlaneGeometry({dynamic:!0}),castShadow:!1,renderNormal:!0,$ignorePicking:!0}),this._groundMesh.rotation.rotateX(-Math.PI/2),this._labelsBuilder=new c.a(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}a.a.Shader.import(d.a),p.prototype={constructor:p,extrudeY:!0,update:function(e,t,i,n,r){var a=e.getData();null==n&&(n=0),null==r&&(r=a.count()),this._startIndex=n,this._endIndex=r-1,this._triangulation(e,n,r);var o=this._getShader(e.get("shading"));this._prepareMesh(e,o,i,n,r),this.rootNode.updateWorldTransform(),this._updateRegionMesh(e,i,n,r);var s=e.coordinateSystem;"geo3D"===s.type&&this._updateGroundPlane(e,s,i);var l=this;this._labelsBuilder.updateData(a,n,r),this._labelsBuilder.getLabelPosition=function(e,t,i){var n=a.getName(e),r=i;if("geo3D"===s.type){var o=s.getRegion(n);return o?(h=o.center,s.dataToPoint([h[0],h[1],r])):[NaN,NaN,NaN]}var u=l._triangulationResults[e-l._startIndex],h=l.extrudeY?[(u.max[0]+u.min[0])/2,u.max[1]+r,(u.max[2]+u.min[2])/2]:[(u.max[0]+u.min[0])/2,(u.max[1]+u.min[1])/2,u.max[2]+r]},this._data=a,this._labelsBuilder.updateLabels(),this._updateDebugWireframe(e),this._lastHoverDataIndex=0},_initMeshes:function(){var e,t=this,i=(e=new a.a.Mesh({name:"Polygon",material:new a.a.Material({shader:t._shadersMap.lambert}),geometry:new a.a.Geometry({sortTriangles:!0,dynamic:!0}),culling:!1,ignorePicking:!0,renderNormal:!0}),r.a.util.extend(e.geometry,h.a),e),n=new a.a.Mesh({material:new a.a.Material({shader:this._linesShader}),castShadow:!1,ignorePicking:!0,$ignorePicking:!0,geometry:new s.a({useNativeLine:!1})});this.rootNode.add(i),this.rootNode.add(n),i.material.define("both","VERTEX_COLOR"),i.material.define("fragment","DOUBLE_SIDED"),this._polygonMesh=i,this._linesMesh=n,this.rootNode.add(this._groundMesh)},_getShader:function(e){var t=this._shadersMap[e];return t||(console.warn("Unkown shading "+e),t=this._shadersMap.lambert),t.__shading=e,t},_prepareMesh:function(e,t,i,n,r){for(var o=0,s=0,l=0,u=0,h=n;h<r;h++){var c=this._getRegionPolygonInfo(h),d=this._getRegionLinesInfo(h,e,this._linesMesh.geometry);o+=c.vertexCount,s+=c.triangleCount,l+=d.vertexCount,u+=d.triangleCount}var f=this._polygonMesh,p=f.geometry;["position","normal","texcoord0","color"].forEach((function(e){p.attributes[e].init(o)})),p.indices=o>65535?new Uint32Array(3*s):new Uint16Array(3*s),f.material.shader!==t&&f.material.attachShader(t,!0),a.a.setMaterialFromModel(t.__shading,f.material,e,i),l>0&&(this._linesMesh.geometry.resetOffset(),this._linesMesh.geometry.setVertexCount(l),this._linesMesh.geometry.setTriangleCount(u)),this._dataIndexOfVertex=new Uint32Array(o),this._vertexRangeOfDataIndex=new Uint32Array(2*(r-n))},_updateRegionMesh:function(e,t,i,n){for(var r=e.getData(),o=0,s=0,u=!1,h=this._polygonMesh,c=this._linesMesh,d=i;d<n;d++){var f=e.getRegionModel(d),p=f.getModel("itemStyle"),g=p.get("color"),m=l.a.firstNotNull(p.get("opacity"),1),v=r.getItemVisual(d,"color",!0);null!=v&&r.hasValue(d)&&(g=v),r.setItemVisual(d,"color",g),r.setItemVisual(d,"opacity",m),g=a.a.parseColor(g);var y=a.a.parseColor(p.get("borderColor"));g[3]*=m,y[3]*=m;var _=g[3]<.99;h.material.set("color",[1,1,1,1]),u=u||_;for(var x=l.a.firstNotNull(f.get("height",!0),e.get("regionHeight")),b=this._updatePolygonGeometry(e,h.geometry,d,x,o,s,g),w=o;w<b.vertexOffset;w++)this._dataIndexOfVertex[w]=d;this._vertexRangeOfDataIndex[2*(d-i)]=o,this._vertexRangeOfDataIndex[2*(d-i)+1]=b.vertexOffset,o=b.vertexOffset,s=b.triangleOffset;var T=p.get("borderWidth"),S=T>0;S&&(T*=t.getDevicePixelRatio(),this._updateLinesGeometry(c.geometry,e,d,x,T,e.coordinateSystem.transform)),c.invisible=!S,c.material.set({color:y})}(h=this._polygonMesh).material.transparent=u,h.material.depthMask=!u,h.geometry.updateBoundingBox(),h.frontFace=this.extrudeY?a.a.Mesh.CCW:a.a.Mesh.CW,h.material.get("normalMap")&&h.geometry.generateTangents(),h.seriesIndex=e.seriesIndex,h.on("mousemove",this._onmousemove,this),h.on("mouseout",this._onmouseout,this)},_updateDebugWireframe:function(e){var t=e.getModel("debug.wireframe");if(t.get("show")){var i=a.a.parseColor(t.get("lineStyle.color")||"rgba(0,0,0,0.5)"),n=l.a.firstNotNull(t.get("lineStyle.width"),1),r=this._polygonMesh;r.geometry.generateBarycentric(),r.material.define("both","WIREFRAME_TRIANGLE"),r.material.set("wireframeLineColor",i),r.material.set("wireframeLineWidth",n)}},_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,i){var n=e.getModel("groundPlane",e);if(this._groundMesh.invisible=!n.get("show",!0),!this._groundMesh.invisible){var r=e.get("shading"),o=this._groundMaterials[r];o||(console.warn("Unkown shading "+r),o=this._groundMaterials.lambert),a.a.setMaterialFromModel(r,o,n,i),o.get("normalMap")&&this._groundMesh.geometry.generateTangents(),this._groundMesh.material=o,this._groundMesh.material.set("color",a.a.parseColor(n.get("color"))),this._groundMesh.scale.set(t.size[0],t.size[2],1)}},_triangulation:function(e,t,i){this._triangulationResults=[];for(var n=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0],a=e.coordinateSystem,s=t;s<i;s++){for(var l=[],u=e.getRegionPolygonCoords(s),h=0;h<u.length;h++){var c=u[h].exterior,d=u[h].interiors,p=[],g=[];if(!(c.length<3)){for(var m=0,v=0;v<c.length;v++){var y=c[v];p[m++]=y[0],p[m++]=y[1]}for(v=0;v<d.length;v++)if(!(d[v].length<3)){for(var _=p.length/2,x=0;x<d[v].length;x++)y=d[v][x],p.push(y[0]),p.push(y[1]);g.push(_)}var b=Object(o.a)(p,g),w=new Float64Array(p.length/2*3),T=[],S=[1/0,1/0,1/0],M=[-1/0,-1/0,-1/0],A=0;for(v=0;v<p.length;)f.set(T,p[v++],0,p[v++]),a&&a.transform&&f.transformMat4(T,T,a.transform),f.min(S,S,T),f.max(M,M,T),w[A++]=T[0],w[A++]=T[1],w[A++]=T[2];f.min(n,n,S),f.max(r,r,M),l.push({points:w,indices:b,min:S,max:M})}}this._triangulationResults.push(l)}this._geoBoundingBox=[n,r]},_getRegionPolygonInfo:function(e){for(var t=this._triangulationResults[e-this._startIndex],i=0,n=0,r=0;r<t.length;r++)i+=t[r].points.length/3,n+=t[r].indices.length/3;return{vertexCount:2*i+4*i,triangleCount:2*n+2*i}},_updatePolygonGeometry:function(e,t,i,n,r,a,o){var s=e.get("projectUVOnGround"),l=t.attributes.position,u=t.attributes.normal,h=t.attributes.texcoord0,c=t.attributes.color,d=this._triangulationResults[i-this._startIndex],p=c.value&&o,g=t.indices,m=this.extrudeY?1:2,v=this.extrudeY?2:1,y=[this.rootNode.worldTransform.x.len(),this.rootNode.worldTransform.y.len(),this.rootNode.worldTransform.z.len()],_=f.mul([],this._geoBoundingBox[0],y),x=f.mul([],this._geoBoundingBox[1],y),b=Math.max(x[0]-_[0],x[2]-_[2]);function w(e,t,i){var n=r;!function(e,t,i){for(var n=e.points,a=n.length,s=[],u=[],d=0;d<a;d+=3)s[0]=n[d],s[m]=t,s[v]=n[d+2],u[0]=(n[d]*y[0]-_[0])/b,u[1]=(n[d+2]*y[v]-_[2])/b,l.set(r,s),p&&c.set(r,o),h.set(r++,u)}(e,t);for(var s=e.indices.length,u=0;u<s;u++)g[3*a+u]=e.indices[u]+n;a+=e.indices.length/3}for(var T=this.extrudeY?[0,1,0]:[0,0,1],S=f.negate([],T),M=0;M<d.length;M++){var A=r,I=d[M];w(I,0),w(I,n);for(var C=I.points.length/3,D=0;D<C;D++)u.set(A+D,S),u.set(A+D+C,T);var E=[0,3,1,1,3,2],L=[[],[],[],[]],P=[],N=[],R=[],O=[],k=0;for(D=0;D<C;D++){for(var z=(D+1)%C,B=(I.points[3*z]-I.points[3*D])*y[0],F=(I.points[3*z+2]-I.points[3*D+2])*y[v],V=Math.sqrt(B*B+F*F),G=0;G<4;G++){var H=0===G||3===G,U=3*(H?D:z);L[G][0]=I.points[U],L[G][m]=G>1?n:0,L[G][v]=I.points[U+2],l.set(r+G,L[G]),s?(O[0]=(I.points[U]*y[0]-_[0])/b,O[1]=(I.points[U+2]*y[v]-_[v])/b):(O[0]=(H?k:k+V)/b,O[1]=(L[G][m]*y[m]-_[m])/b),h.set(r+G,O)}for(f.sub(P,L[1],L[0]),f.sub(N,L[3],L[0]),f.cross(R,P,N),f.normalize(R,R),G=0;G<4;G++)u.set(r+G,R),p&&c.set(r+G,o);for(G=0;G<6;G++)g[3*a+G]=E[G]+r;r+=4,a+=2,k+=V}}return t.dirty(),{vertexOffset:r,triangleOffset:a}},_getRegionLinesInfo:function(e,t,i){var n=0,r=0;return t.getRegionModel(e).getModel("itemStyle").get("borderWidth")>0&&t.getRegionPolygonCoords(e).forEach((function(e){var t=e.exterior,a=e.interiors;n+=i.getPolylineVertexCount(t),r+=i.getPolylineTriangleCount(t);for(var o=0;o<a.length;o++)n+=i.getPolylineVertexCount(a[o]),r+=i.getPolylineTriangleCount(a[o])}),this),{vertexCount:n,triangleCount:r}},_updateLinesGeometry:function(e,t,i,n,r,a){function o(e){for(var t=new Float64Array(3*e.length),i=0,r=[],o=0;o<e.length;o++)r[0]=e[o][0],r[1]=n+.1,r[2]=e[o][1],a&&f.transformMat4(r,r,a),t[i++]=r[0],t[i++]=r[1],t[i++]=r[2];return t}var s=[1,1,1,1];t.getRegionPolygonCoords(i).forEach((function(t){var i=t.exterior,n=t.interiors;e.addPolyline(o(i),s,r);for(var a=0;a<n.length;a++)e.addPolyline(o(n[a]),s,r)}))},highlight:function(e){var t=this._data;if(t){var i=t.getItemModel(e).getModel("emphasis.itemStyle"),n=i.get("color"),o=l.a.firstNotNull(i.get("opacity"),t.getItemVisual(e,"opacity"),1);if(null==n){var s=t.getItemVisual(e,"color");n=r.a.color.lift(s,-.4)}null==o&&(o=t.getItemVisual(e,"opacity"));var u=a.a.parseColor(n);u[3]*=o,this._setColorOfDataIndex(t,e,u)}},downplay:function(e){var t=this._data;if(t){var i=t.getItemVisual(e,"color"),n=l.a.firstNotNull(t.getItemVisual(e,"opacity"),1),r=a.a.parseColor(i);r[3]*=n,this._setColorOfDataIndex(t,e,r)}},_setColorOfDataIndex:function(e,t,i){if(!(t<this._startIndex&&t>this._endIndex)){t-=this._startIndex;for(var n=this._vertexRangeOfDataIndex[2*t];n<this._vertexRangeOfDataIndex[2*t+1];n++)this._polygonMesh.geometry.attributes.color.set(n,i);this._polygonMesh.geometry.dirty(),this._api.getZr().refresh()}}},t.a=p},function(e,t,i){var n=i(97),r=i(6).a.vec3,a=r.create(),o=r.create(),s=r.create();t.a={needsSortTriangles:function(){return this.indices&&this.sortTriangles},needsSortTrianglesProgressively:function(){return this.needsSortTriangles()&&this.triangleCount>=2e4},doSortTriangles:function(e,t){var i=this.indices;if(0===t){var n=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 i.constructor(i.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var l,u=0,h=0;h<i.length;){n.get(i[h++],a),n.get(i[h++],o),n.get(i[h++],s);var c=r.sqrDist(a,e),d=r.sqrDist(o,e),f=r.sqrDist(s,e),p=Math.min(c,d);p=Math.min(p,f),3===h?(l=p,p=0):p-=l,this._triangleZList[u++]=p}}var g=this._sortedTriangleIndices;for(h=0;h<g.length;h++)g[h]=h;if(this.triangleCount<2e4)0===t&&this._simpleSort(!0);else for(h=0;h<3;h++)this._progressiveQuickSort(3*t+h);var m=this._indicesTmp,v=this._triangleZListTmp,y=this._triangleZList;for(h=0;h<this.triangleCount;h++){var _=3*g[h],x=3*h;m[x++]=i[_++],m[x++]=i[_++],m[x]=i[_],v[h]=y[g[h]]}var b=this._indicesTmp;this._indicesTmp=this.indices,this.indices=b,b=this._triangleZListTmp,this._triangleZListTmp=this._triangleZList,this._triangleZList=b,this.dirtyIndices()},_simpleSort:function(e){var t=this._triangleZList,i=this._sortedTriangleIndices;function r(e,i){return t[i]-t[e]}e?Array.prototype.sort.call(i,r):n.a.sort(i,r,0,i.length-1)},_progressiveQuickSort:function(e){var t=this._triangleZList,i=this._sortedTriangleIndices;this._quickSort=this._quickSort||new n.a,this._quickSort.step(i,(function(e,i){return t[i]-t[e]}),e)}}},function(e,t,i){var n=i(0),r=i.n(n),a=i(81),o=i(63),s=i(2);function l(e,t,i){this._labelsMesh=new o.a,this._labelTextureSurface=new a.a({width:512,height:512,devicePixelRatio:i.getDevicePixelRatio(),onupdate:function(){i.getZr().refresh()}}),this._api=i,this._labelsMesh.material.set("textureAtlas",this._labelTextureSurface.getTexture())}l.prototype.getLabelPosition=function(e,t,i){return[0,0,0]},l.prototype.getLabelDistance=function(e,t,i){return 0},l.prototype.getMesh=function(){return this._labelsMesh},l.prototype.updateData=function(e,t,i){null==t&&(t=0),null==i&&(i=e.count()),this._labelsVisibilitiesBits&&this._labelsVisibilitiesBits.length===i-t||(this._labelsVisibilitiesBits=new Uint8Array(i-t));for(var n=["label","show"],r=["emphasis","label","show"],a=t;a<i;a++){var o=e.getItemModel(a),s=o.get(n),l=o.get(r);null==l&&(l=s);var u=(s?1:0)|(l?2:0);this._labelsVisibilitiesBits[a-t]=u}this._start=t,this._end=i,this._data=e},l.prototype.updateLabels=function(e){if(this._data){for(var t=(e=e||[]).length>0,i={},n=0;n<e.length;n++)i[e[n]]=!0;this._labelsMesh.geometry.convertToDynamicArray(!0),this._labelTextureSurface.clear();for(var a=["label"],o=["emphasis","label"],l=this._data.hostModel,u=this._data,h=l.getModel(a),c=l.getModel(o,h),d={left:"right",right:"left",top:"center",bottom:"center"},f={left:"middle",right:"middle",top:"bottom",bottom:"top"},p=this._start;p<this._end;p++){var g=!1;if(t&&i[p]&&(g=!0),this._labelsVisibilitiesBits[p-this._start]&(g?2:1)){var m=u.getItemModel(p).getModel(g?o:a,g?c:h),v=m.get("distance")||0,y=m.get("position"),_=m.getModel("textStyle"),x=this._api.getDevicePixelRatio(),b=l.getFormattedLabel(p,g?"emphasis":"normal");if(null==b||""===b)return;var w=new r.a.graphic.Text;r.a.graphic.setTextStyle(w.style,_,{text:b,textFill:_.get("color")||u.getItemVisual(p,"color")||"#000",textAlign:"left",textVerticalAlign:"top",opacity:s.a.firstNotNull(_.get("opacity"),u.getItemVisual(p,"opacity"),1)});var T=w.getBoundingRect();T.height*=1.2;var S=this._labelTextureSurface.add(w),M=d[y]||"center",A=f[y]||"bottom";this._labelsMesh.geometry.addSprite(this.getLabelPosition(p,y,v),[T.width*x,T.height*x],S,M,A,this.getLabelDistance(p,y,v)*x)}}this._labelsMesh.material.set("uvScale",this._labelTextureSurface.getCoordsScale()),this._labelTextureSurface.getZr().refreshImmediately(),this._labelsMesh.geometry.convertToTypedArray(),this._labelsMesh.geometry.dirty()}},t.a=l},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(239),s=i(240),l=i(66),u=i(9),h=i(2);function c(e,t){this.rootNode=new a.a.Node,this.is2D=e,this._labelsBuilder=new l.a(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}c.prototype={constructor:c,highlightOnMouseover:!0,update:function(e,t,i,n,r){var o=this._prevMesh;this._prevMesh=this._mesh,this._mesh=o;var l=e.getData();if(null==n&&(n=0),null==r&&(r=l.count()),this._startDataIndex=n,this._endDataIndex=r-1,!this._mesh){var u=this._prevMesh&&this._prevMesh.material;this._mesh=new s.a({renderOrder:10,frustumCulling:!1}),u&&(this._mesh.material=u)}u=this._mesh.material;var h=this._mesh.geometry,c=h.attributes;this.rootNode.remove(this._prevMesh),this.rootNode.add(this._mesh),this._setPositionTextureToMesh(this._mesh,this._positionTexture);var d=this._getSymbolInfo(e,n,r),f=i.getDevicePixelRatio(),p=e.getModel("itemStyle").getItemStyle(),g=e.get("large"),m=1;d.maxSize>2?(m=this._updateSymbolSprite(e,p,d,f),u.enableTexture("sprite")):u.disableTexture("sprite"),c.position.init(r-n);var v=[];if(g){u.undefine("VERTEX_SIZE"),u.undefine("VERTEX_COLOR");var y=l.getVisual("color"),_=l.getVisual("opacity");a.a.parseColor(y,v),v[3]*=_,u.set({color:v,u_Size:d.maxSize*this._sizeScale})}else u.set({color:[1,1,1,1]}),u.define("VERTEX_SIZE"),u.define("VERTEX_COLOR"),c.size.init(r-n),c.color.init(r-n),this._originalOpacity=new Float32Array(r-n);for(var x=l.getLayout("points"),b=c.position.value,w=0;w<r-n;w++){var T=3*w,S=2*w;if(this.is2D?(b[T]=x[S],b[T+1]=x[S+1],b[T+2]=-10):(b[T]=x[T],b[T+1]=x[T+1],b[T+2]=x[T+2]),!g){y=l.getItemVisual(w,"color"),_=l.getItemVisual(w,"opacity"),a.a.parseColor(y,v),v[3]*=_,c.color.set(w,v),v[3];var M=l.getItemVisual(w,"symbolSize");M=M instanceof Array?Math.max(M[0],M[1]):M,isNaN(M)&&(M=0),c.size.value[w]=M*m*this._sizeScale,this._originalOpacity[w]=v[3]}}this._mesh.sizeScale=m,h.updateBoundingBox(),h.dirty(),this._updateMaterial(e,p);var A=e.coordinateSystem;A&&A.viewGL&&u[A.viewGL.isLinearSpace()?"define":"undefine"]("fragment","SRGB_DECODE"),g||this._updateLabelBuilder(e,n,r),this._updateHandler(e,t,i),this._updateAnimation(e),this._api=i},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())},_updateSymbolSprite:function(e,t,i,n){i.maxSize=Math.min(2*i.maxSize,200);var r,a,s=[];return i.aspect>1?(s[0]=i.maxSize,s[1]=i.maxSize/i.aspect):(s[1]=i.maxSize,s[0]=i.maxSize*i.aspect),s[0]=s[0]||1,s[1]=s[1]||1,this._symbolType===i.type&&(r=this._symbolSize,a=s,r&&a&&r[0]===a[0]&&r[1]===a[1])&&this._lineWidth===t.lineWidth||(o.a.createSymbolSprite(i.type,s,{fill:"#fff",lineWidth:t.lineWidth,stroke:"transparent",shadowColor:"transparent",minMargin:Math.min(s[0]/2,10)},this._spriteImageCanvas),o.a.createSDFFromCanvas(this._spriteImageCanvas,Math.min(this._spriteImageCanvas.width,32),20,this._mesh.material.get("sprite").image),this._symbolType=i.type,this._symbolSize=s,this._lineWidth=t.lineWidth),this._spriteImageCanvas.width/i.maxSize*n},_updateMaterial:function(e,t){var i="lighter"===e.get("blendMode")?a.a.additiveBlend:null,n=this._mesh.material;n.blend=i,n.set("lineWidth",t.lineWidth/20);var r=a.a.parseColor(t.stroke);n.set("strokeColor",r),n.transparent=!0,n.depthMask=!1,n.depthTest=!this.is2D,n.sortVertices=!this.is2D},_updateLabelBuilder:function(e,t,i){var n=e.getData(),r=this._mesh.geometry,a=r.attributes.position.value,o=(t=this._startDataIndex,this._mesh.sizeScale);this._labelsBuilder.updateData(n,t,i),this._labelsBuilder.getLabelPosition=function(e,i,n){var r=3*(e-t);return[a[r],a[r+1],a[r+2]]},this._labelsBuilder.getLabelDistance=function(e,i,n){return r.attributes.size.get(e-t)/o/2+n},this._labelsBuilder.updateLabels()},_updateAnimation:function(e){a.a.updateVertexAnimation([["prevPosition","position"],["prevSize","size"]],this._prevMesh,this._mesh,e)},_updateHandler:function(e,t,i){var n,r=e.getData(),a=this._mesh,o=this,s=-1,l=e.coordinateSystem&&"cartesian3D"===e.coordinateSystem.type;l&&(n=e.coordinateSystem.model),a.seriesIndex=e.seriesIndex,a.off("mousemove"),a.off("mouseout"),a.on("mousemove",(function(t){var u=t.vertexIndex+o._startDataIndex;u!==s&&(this.highlightOnMouseover&&(this.downplay(r,s),this.highlight(r,u),this._labelsBuilder.updateLabels([u])),l&&i.dispatchAction({type:"grid3DShowAxisPointer",value:[r.get(e.coordDimToDataDim("x")[0],u),r.get(e.coordDimToDataDim("y")[0],u),r.get(e.coordDimToDataDim("z")[0],u)],grid3DIndex:n.componentIndex})),a.dataIndex=u,s=u}),this),a.on("mouseout",(function(e){var t=e.vertexIndex+o._startDataIndex;this.highlightOnMouseover&&(this.downplay(r,t),this._labelsBuilder.updateLabels()),s=-1,a.dataIndex=-1,l&&i.dispatchAction({type:"grid3DHideAxisPointer",grid3DIndex:n.componentIndex})}),this)},updateLayout:function(e,t,i){var n=e.getData();if(this._mesh){var r=this._mesh.geometry.attributes.position.value,a=n.getLayout("points");if(this.is2D)for(var o=0;o<a.length/2;o++){var s=3*o,l=2*o;r[s]=a[l],r[s+1]=a[l+1],r[s+2]=-10}else for(o=0;o<a.length;o++)r[o]=a[o];this._mesh.geometry.dirty(),i.getZr().refresh()}},updateView:function(e){if(this._mesh){var t=new u.a;u.a.mul(t,e.viewMatrix,this._mesh.worldTransform),u.a.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 i=e.getItemModel(t).getModel("emphasis.itemStyle"),n=i.get("color"),o=i.get("opacity");if(null==n){var s=e.getItemVisual(t,"color");n=r.a.color.lift(s,-.4)}null==o&&(o=e.getItemVisual(t,"opacity"));var l=a.a.parseColor(n);l[3]*=o,this._mesh.geometry.attributes.color.set(t-this._startDataIndex,l),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},downplay:function(e,t){if(!(t>this._endDataIndex||t<this._startDataIndex)){var i=e.getItemVisual(t,"color"),n=e.getItemVisual(t,"opacity"),r=a.a.parseColor(i);r[3]*=n,this._mesh.geometry.attributes.color.set(t-this._startDataIndex,r),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeOutAll:function(e){if(this._originalOpacity){for(var t=this._mesh.geometry,i=0;i<t.vertexCount;i++){var n=this._originalOpacity[i]*e;t.attributes.color.value[4*i+3]=n}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 i=this._mesh.geometry.attributes;if(i.size.value)for(var n=0;n<i.size.value.length;n++)i.size.value[n]=i.size.value[n]/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,i){if(e.get("large"))return(d=h.a.firstNotNull(e.get("symbolSize"),1))instanceof Array?(l=Math.max(d[0],d[1]),n=d[0]/d[1]):(l=d,n=1),{maxSize:d,type:e.get("symbol"),aspect:n};for(var n,r=e.getData(),a=!1,o=r.getItemVisual(0,"symbol")||"circle",s=!1,l=0,u=t;u<i;u++){var c,d=r.getItemVisual(u,"symbolSize"),f=r.getItemVisual(u,"symbol");if(d instanceof Array)c=d[0]/d[1],l=Math.max(Math.max(d[0],d[1]),l);else{if(isNaN(d))return;c=1,l=Math.max(d,l)}null!=n&&Math.abs(c-n)>.05&&(a=!0),f!==o&&(s=!0),o=f,n=c}return a&&console.warn("Different symbol width / height ratio will be ignored."),s&&console.warn("Different symbol type will be ignored."),{maxSize:l,type:o,aspect:n}}},t.a=c},function(e,t){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(m9){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){var n=i(114),r=function(e){this._list=new n.a,this._map={},this._maxSize=e||10};r.prototype.setMaxSize=function(e){this._maxSize=e},r.prototype.put=function(e,t){if(!this._map.hasOwnProperty(e)){var i=this._list.length();if(i>=this._maxSize&&i>0){var n=this._list.head;this._list.remove(n),delete this._map[n.key]}var r=this._list.insert(t);r.key=e,this._map[e]=r}},r.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},r.prototype.remove=function(e){var t=this._map[e];void 0!==t&&(delete this._map[e],this._list.remove(t))},r.prototype.clear=function(){this._list.clear(),this._map={}},t.a=r},function(e,t,i){var n,r=i(20),a={create:function(){var e=new r.a(2);return e[0]=0,e[1]=0,e},clone:function(e){var t=new r.a(2);return t[0]=e[0],t[1]=e[1],t},fromValues:function(e,t){var i=new r.a(2);return i[0]=e,i[1]=t,i},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,i){return e[0]=t,e[1]=i,e},add:function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e},subtract:function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}};a.sub=a.subtract,a.multiply=function(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e},a.mul=a.multiply,a.divide=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e},a.div=a.divide,a.min=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e},a.max=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e},a.scale=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e},a.scaleAndAdd=function(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e},a.distance=function(e,t){var i=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(i*i+n*n)},a.dist=a.distance,a.squaredDistance=function(e,t){var i=t[0]-e[0],n=t[1]-e[1];return i*i+n*n},a.sqrDist=a.squaredDistance,a.length=function(e){var t=e[0],i=e[1];return Math.sqrt(t*t+i*i)},a.len=a.length,a.squaredLength=function(e){var t=e[0],i=e[1];return t*t+i*i},a.sqrLen=a.squaredLength,a.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},a.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e},a.normalize=function(e,t){var i=t[0],n=t[1],r=i*i+n*n;return r>0&&(r=1/Math.sqrt(r),e[0]=t[0]*r,e[1]=t[1]*r),e},a.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},a.cross=function(e,t,i){var n=t[0]*i[1]-t[1]*i[0];return e[0]=e[1]=0,e[2]=n,e},a.lerp=function(e,t,i,n){var r=t[0],a=t[1];return e[0]=r+n*(i[0]-r),e[1]=a+n*(i[1]-a),e},a.random=function(e,t){t=t||1;var i=2*GLMAT_RANDOM()*Math.PI;return e[0]=Math.cos(i)*t,e[1]=Math.sin(i)*t,e},a.transformMat2=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[2]*r,e[1]=i[1]*n+i[3]*r,e},a.transformMat2d=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[2]*r+i[4],e[1]=i[1]*n+i[3]*r+i[5],e},a.transformMat3=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[3]*r+i[6],e[1]=i[1]*n+i[4]*r+i[7],e},a.transformMat4=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[4]*r+i[12],e[1]=i[1]*n+i[5]*r+i[13],e},a.forEach=(n=a.create(),function(e,t,i,r,a,o){var s,l;for(t||(t=2),i||(i=0),l=r?Math.min(r*t+i,e.length):e.length,s=i;s<l;s+=t)n[0]=e[s],n[1]=e[s+1],a(n,n,o),e[s]=n[0],e[s+1]=n[1];return e}),t.a=a},function(e,t,i){t.a="@export clay.prez.vertex\nuniform mat4 WVP : WORLDVIEWPROJECTION;\nattribute vec3 pos : POSITION;\nattribute vec2 uv : TEXCOORD_0;\n@import clay.chunk.skinning_header\nvarying vec2 v_Texcoord;\nvoid main()\n{\n vec3 P = pos;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = (skinMatrixWS * vec4(pos, 1.0)).xyz;\n#endif\n gl_Position = WVP * vec4(P, 1.0);\n v_Texcoord = uv;\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"},function(e,t,i){var n,r=i(35),a=i(11),o=r.a.extend({material:null,geometry:null,mode:a.a.TRIANGLES,_renderInfo:null},{__program:null,lightGroup:0,renderOrder:0,culling:!0,cullFace:a.a.BACK,frontFace:a.a.CCW,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=r.a.prototype.getBoundingBox.call(this,e,t),this.geometry&&this.geometry.boundingBox&&t.union(this.geometry.boundingBox),t},clone:(n=["castShadow","receiveShadow","mode","culling","cullFace","frontFace","frustumCulling","renderOrder","lineWidth","ignorePicking","ignorePreZ","ignoreGBuffer"],function(){var e=r.a.prototype.clone.call(this);e.geometry=this.geometry,e.material=this.material;for(var t=0;t<n.length;t++){var i=n[t];e[i]!==this[i]&&(e[i]=this[i])}return e})});o.POINTS=a.a.POINTS,o.LINES=a.a.LINES,o.LINE_LOOP=a.a.LINE_LOOP,o.LINE_STRIP=a.a.LINE_STRIP,o.TRIANGLES=a.a.TRIANGLES,o.TRIANGLE_STRIP=a.a.TRIANGLE_STRIP,o.TRIANGLE_FAN=a.a.TRIANGLE_FAN,o.BACK=a.a.BACK,o.FRONT=a.a.FRONT,o.FRONT_AND_BACK=a.a.FRONT_AND_BACK,o.CW=a.a.CW,o.CCW=a.a.CCW,t.a=o},function(e,t,i){var n={isPowerOfTwo:function(e){return 0==(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))}};t.a=n},function(e,t,i){var n,r,a,o,s=i(3),l=i(21),u=i(12),h=i(33),c=function(e,t){this.normal=e||new s.a(0,1,0),this.distance=t||0};c.prototype={constructor:c,distanceToPoint:function(e){return u.a.dot(e.array,this.normal.array)-this.distance},projectPoint:function(e,t){t||(t=new s.a);var i=this.distanceToPoint(e);return u.a.scaleAndAdd(t.array,e.array,this.normal.array,-i),t._dirty=!0,t},normalize:function(){var e=1/u.a.len(this.normal.array);u.a.scale(this.normal.array,e),this.distance*=e},intersectFrustum:function(e){for(var t=e.vertices,i=this.normal.array,n=u.a.dot(t[0].array,i)>this.distance,r=1;r<8;r++)if(u.a.dot(t[r].array,i)>this.distance!=n)return!0},intersectLine:(o=u.a.create(),function(e,t,i){var n=this.distanceToPoint(e),r=this.distanceToPoint(t);if(n>0&&r>0||n<0&&r<0)return null;var a=this.normal.array,l=this.distance,h=e.array;u.a.sub(o,t.array,e.array),u.a.normalize(o,o);var c=u.a.dot(a,o);if(0===c)return null;i||(i=new s.a);var d=(u.a.dot(a,h)-l)/c;return u.a.scaleAndAdd(i.array,h,o,-d),i._dirty=!0,i}),applyTransform:(n=l.a.create(),r=h.a.create(),a=h.a.create(),a[3]=1,function(e){e=e.array,u.a.scale(a,this.normal.array,this.distance),h.a.transformMat4(a,a,e),this.distance=u.a.dot(a,this.normal.array),l.a.invert(n,e),l.a.transpose(n,n),r[3]=0,u.a.copy(r,this.normal.array),h.a.transformMat4(r,r,n),u.a.copy(this.normal.array,r)}),copy:function(e){u.a.copy(this.normal.array,e.normal.array),this.normal._dirty=!0,this.distance=e.distance},clone:function(){var e=new c;return e.copy(this),e}},t.a=c},function(e,t,i){var n=i(42);t.a=n.a},function(e,t,i){var n=i(15),r=i(43),a=i(9),o=i(3),s=i(18),l=i(14),u=new a.a,h=n.a.extend({dynamic:!1,widthSegments:1,heightSegments:1,depthSegments:1,inside:!1},(function(){this.build()}),{build:function(){var e={px:c("px",this.depthSegments,this.heightSegments),nx:c("nx",this.depthSegments,this.heightSegments),py:c("py",this.widthSegments,this.depthSegments),ny:c("ny",this.widthSegments,this.depthSegments),pz:c("pz",this.widthSegments,this.heightSegments),nz:c("nz",this.widthSegments,this.heightSegments)},t=["position","texcoord0","normal"],i=0,n=0;for(var r in e)i+=e[r].vertexCount,n+=e[r].indices.length;for(var a=0;a<t.length;a++)this.attributes[t[a]].init(i);this.indices=new l.a.Uint16Array(n);var o=0,u=0;for(var r in e){var h=e[r];for(a=0;a<t.length;a++)for(var d=t[a],f=h.attributes[d].value,p=h.attributes[d].size,g="normal"===d,m=0;m<f.length;m++){var v=f[m];this.inside&&g&&(v=-v),this.attributes[d].value[m+p*u]=v}var y=h.indices.length;for(m=0;m<h.indices.length;m++)this.indices[m+o]=u+h.indices[this.inside?y-m-1:m];o+=h.indices.length,u+=h.vertexCount}this.boundingBox=new s.a,this.boundingBox.max.set(1,1,1),this.boundingBox.min.set(-1,-1,-1)}});function c(e,t,i){u.identity();var n=new r.a({widthSegments:t,heightSegments:i});switch(e){case"px":a.a.translate(u,u,o.a.POSITIVE_X),a.a.rotateY(u,u,Math.PI/2);break;case"nx":a.a.translate(u,u,o.a.NEGATIVE_X),a.a.rotateY(u,u,-Math.PI/2);break;case"py":a.a.translate(u,u,o.a.POSITIVE_Y),a.a.rotateX(u,u,-Math.PI/2);break;case"ny":a.a.translate(u,u,o.a.NEGATIVE_Y),a.a.rotateX(u,u,Math.PI/2);break;case"pz":a.a.translate(u,u,o.a.POSITIVE_Z);break;case"nz":a.a.translate(u,u,o.a.NEGATIVE_Z),a.a.rotateY(u,u,Math.PI)}return n.applyTransform(u),n}t.a=h},function(e,t,i){var n=i(5),r=i(27),a=i(4),o=i(10),s=i(16),l=i(19),u=i(8),h=i(42),c=i(36),d=i(62),f=i(14),p=i(61),g=i(127),m=i(128),v={},y=["px","nx","py","ny","pz","nz"];v.prefilterEnvironmentMap=function(e,t,i,s,g){g&&s||(s=v.generateNormalDistribution(),g=v.integrateBRDF(e,s));var _=(i=i||{}).width||64,x=i.height||64,b=i.type||t.type,w=new r.a({width:_,height:x,type:b,flipY:!1,mipmaps:[]});w.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var T=Math.min(_,x),S=Math.log(T)/Math.log(2)+1,M=new l.a({shader:new u.a({vertex:u.a.source("clay.skybox.vertex"),fragment:m.a})});M.set("normalDistribution",s),i.encodeRGBM&&M.define("fragment","RGBM_ENCODE"),i.decodeRGBM&&M.define("fragment","RGBM_DECODE");var A,I=new c.a;if("texture2D"===t.textureType){var C=new r.a({width:_,height:x,type:b===a.a.FLOAT?a.a.HALF_FLOAT:b});p.a.panoramaToCubeMap(e,t,C,{encodeRGBM:i.decodeRGBM}),t=C}(A=new h.a({scene:I,material:M})).material.set("environmentMap",t);var D=new d.a({texture:w});i.encodeRGBM&&(b=w.type=a.a.UNSIGNED_BYTE);for(var E=new n.a({width:_,height:x,type:b}),L=new o.a({depthBuffer:!1}),P=f.a[b===a.a.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],N=0;N<S;N++){w.mipmaps[N]={pixels:{}},A.material.set("roughness",N/(S-1));for(var R=E.width,O=2*Math.atan(R/(R-.5))/Math.PI*180,k=0;k<y.length;k++){var z=new P(E.width*E.height*4);L.attach(E),L.bind(e);var B=D.getCamera(y[k]);B.fov=O,e.render(I,B),e.gl.readPixels(0,0,E.width,E.height,a.a.RGBA,b,z),L.unbind(e),w.mipmaps[N].pixels[y[k]]=z}E.width/=2,E.height/=2,E.dirty()}return L.dispose(e),E.dispose(e),A.dispose(e),s.dispose(e),{environmentMap:w,brdfLookup:g,normalDistribution:s,maxMipmapLevel:S}},v.integrateBRDF=function(e,t){t=t||v.generateNormalDistribution();var i=new o.a({depthBuffer:!1}),r=new s.a({fragment:g.a}),l=new n.a({width:512,height:256,type:a.a.HALF_FLOAT,wrapS:a.a.CLAMP_TO_EDGE,wrapT:a.a.CLAMP_TO_EDGE,minFilter:a.a.NEAREST,magFilter:a.a.NEAREST,useMipmap:!1});return r.setUniform("normalDistribution",t),r.setUniform("viewportSize",[512,256]),r.attachOutput(l),r.render(e,i),i.dispose(e),l},v.generateNormalDistribution=function(e,t){e=e||256,t=t||1024;for(var i=new n.a({width:e,height:t,type:a.a.FLOAT,minFilter:a.a.NEAREST,magFilter:a.a.NEAREST,wrapS:a.a.CLAMP_TO_EDGE,wrapT:a.a.CLAMP_TO_EDGE,useMipmap:!1}),r=new Float32Array(t*e*4),o=[],s=0;s<e;s++){for(var l=s/e,u=l*l,h=0;h<t;h++){var c=(h<<16|h>>>16)>>>0;c=(((16711935&(c=((252645135&(c=((858993459&(c=((1431655765&c)<<1|(2863311530&c)>>>1)>>>0))<<2|(3435973836&c)>>>2)>>>0))<<4|(4042322160&c)>>>4)>>>0))<<8|(4278255360&c)>>>8)>>>0)/4294967296;var d=Math.sqrt((1-c)/(1+(u*u-1)*c));o[h]=d}for(h=0;h<t;h++){var f=4*(h*e+s),p=(d=o[h],Math.sqrt(1-d*d)),g=h/t,m=2*Math.PI*g;r[f]=p*Math.cos(m),r[f+1]=d,r[f+2]=p*Math.sin(m),r[f+3]=1}}return i.pixels=r,i},t.a=v},function(e,t,i){var n=i(20),r={create:function(){var e=new n.a(4);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},clone:function(e){var t=new n.a(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 i=t[1];e[1]=t[2],e[2]=i}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e},invert:function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=i*a-r*n;return o?(o=1/o,e[0]=a*o,e[1]=-n*o,e[2]=-r*o,e[3]=i*o,e):null},adjoint:function(e,t){var i=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=i,e},determinant:function(e){return e[0]*e[3]-e[2]*e[1]},multiply:function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=i[0],l=i[1],u=i[2],h=i[3];return e[0]=n*s+a*l,e[1]=r*s+o*l,e[2]=n*u+a*h,e[3]=r*u+o*h,e}};r.mul=r.multiply,r.rotate=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(i),l=Math.cos(i);return e[0]=n*l+a*s,e[1]=r*l+o*s,e[2]=n*-s+a*l,e[3]=r*-s+o*l,e},r.scale=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=i[0],l=i[1];return e[0]=n*s,e[1]=r*s,e[2]=a*l,e[3]=o*l,e},r.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))},r.LDU=function(e,t,i,n){return e[2]=n[2]/n[0],i[0]=n[0],i[1]=n[1],i[3]=n[3]-e[2]*i[1],[e,t,i]},t.a=r},function(e,t,i){var n=i(20),r={create:function(){var e=new n.a(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 n.a(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 i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],l=i*a-n*r;return l?(l=1/l,e[0]=a*l,e[1]=-n*l,e[2]=-r*l,e[3]=i*l,e[4]=(r*s-a*o)*l,e[5]=(n*o-i*s)*l,e):null},determinant:function(e){return e[0]*e[3]-e[1]*e[2]},multiply:function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=i[0],h=i[1],c=i[2],d=i[3],f=i[4],p=i[5];return e[0]=n*u+a*h,e[1]=r*u+o*h,e[2]=n*c+a*d,e[3]=r*c+o*d,e[4]=n*f+a*p+s,e[5]=r*f+o*p+l,e}};r.mul=r.multiply,r.rotate=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=Math.sin(i),h=Math.cos(i);return e[0]=n*h+a*u,e[1]=r*h+o*u,e[2]=n*-u+a*h,e[3]=r*-u+o*h,e[4]=s,e[5]=l,e},r.scale=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=i[0],h=i[1];return e[0]=n*u,e[1]=r*u,e[2]=a*h,e[3]=o*h,e[4]=s,e[5]=l,e},r.translate=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=i[0],h=i[1];return e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=n*u+a*h+s,e[5]=r*u+o*h+l,e},r.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)},t.a=r},function(e,t){var i="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){setTimeout(e,16)};e.exports=i},function(e,t,i){var n=i(0),r=i.n(n),a=i(5);function o(e,t,i,n,r,a,o){this._zr=e,this._x=0,this._y=0,this._rowHeight=0,this.width=n,this.height=r,this.offsetX=t,this.offsetY=i,this.dpr=o,this.gap=a}function s(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 a.a({image:t,flipY:!1});var i=this;this._zr=r.a.zrender.init(t);var n=this._zr.refreshImmediately;this._zr.refreshImmediately=function(){n.call(this),i._texture.dirty(),i.onupdate&&i.onupdate()},this._dpr=e.devicePixelRatio,this._coords={},this.onupdate=e.onupdate,this._gap=e.gap,this._textureAtlasNodes=[new o(this._zr,0,0,e.width,e.height,this._gap,this._dpr)],this._nodeWidth=e.width,this._nodeHeight=e.height,this._currentNodeIdx=0}o.prototype={constructor:o,clear:function(){this._x=0,this._y=0,this._rowHeight=0},add:function(e,t,i){var n=e.getBoundingRect();null==t&&(t=n.width),null==i&&(i=n.height),t*=this.dpr,i*=this.dpr,this._fitElement(e,t,i);var r=this._x,a=this._y,o=this.width*this.dpr,s=this.height*this.dpr,l=this.gap;if(r+t+l>o&&(r=this._x=0,a+=this._rowHeight+l,this._y=a,this._rowHeight=0),this._x+=t+l,this._rowHeight=Math.max(this._rowHeight,i),a+i+l>s)return null;e.position[0]+=this.offsetX*this.dpr+r,e.position[1]+=this.offsetY*this.dpr+a,this._zr.add(e);var u=[this.offsetX/this.width,this.offsetY/this.height];return[[r/o+u[0],a/s+u[1]],[(r+t)/o+u[0],(a+i)/s+u[1]]]},_fitElement:function(e,t,i){var n=e.getBoundingRect(),r=t/n.width,a=i/n.height;e.position=[-n.x*r,-n.y*a],e.scale=[r,a],e.update()}},s.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,i=t*this._nodeWidth%e,n=Math.floor(t*this._nodeWidth/e)*this._nodeHeight;if(!(n>=e)){var r=(i+this._nodeWidth)*this._dpr,a=(n+this._nodeHeight)*this._dpr;try{this._zr.resize({width:r,height:a})}catch(m9){this._canvas.width=r,this._canvas.height=a}var s=new o(this._zr,i,n,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(s),s}console.error("Too much labels. Some will be ignored.")},add:function(e,t,i){if(this._coords[e.id])return console.warn("Element already been add"),this._coords[e.id];var n=this._getCurrentNode().add(e,t,i);if(!n){var r=this._expand();if(!r)return;n=r.add(e,t,i)}return this._coords[e.id]=n,n},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]}},t.a=s},function(e,t,i){var n=i(83),r=i(84),a=n.applyTransform,o=Math.min,s=Math.max;function l(e,t,i,n){i<0&&(e+=i,i=-i),n<0&&(t+=n,n=-n),this.x=e,this.y=t,this.width=i,this.height=n}l.prototype={constructor:l,union:function(e){var t=o(e.x,this.x),i=o(e.y,this.y);this.width=s(e.x+e.width,this.x+this.width)-t,this.height=s(e.y+e.height,this.y+this.height)-i,this.x=t,this.y=i},applyTransform:function(){var e=[],t=[],i=[],n=[];return function(r){if(r){e[0]=i[0]=this.x,e[1]=n[1]=this.y,t[0]=n[0]=this.x+this.width,t[1]=i[1]=this.y+this.height,a(e,e,r),a(t,t,r),a(i,i,r),a(n,n,r),this.x=o(e[0],t[0],i[0],n[0]),this.y=o(e[1],t[1],i[1],n[1]);var l=s(e[0],t[0],i[0],n[0]),u=s(e[1],t[1],i[1],n[1]);this.width=l-this.x,this.height=u-this.y}}}(),calculateTransform:function(e){var t=this,i=e.width/t.width,n=e.height/t.height,a=r.create();return r.translate(a,a,[-t.x,-t.y]),r.scale(a,a,[i,n]),r.translate(a,a,[e.x,e.y]),a},intersect:function(e){if(!e)return!1;e instanceof l||(e=l.create(e));var t=this,i=t.x,n=t.x+t.width,r=t.y,a=t.y+t.height,o=e.x,s=e.x+e.width,u=e.y,h=e.y+e.height;return!(n<o||s<i||a<u||h<r)},contain:function(e,t){var i=this;return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height},clone:function(){return new l(this.x,this.y,this.width,this.height)},copy:function(e){this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},l.create=function(e){return new l(e.x,e.y,e.width,e.height)};var u=l;e.exports=u},function(e,t){var i="undefined"==typeof Float32Array?Array:Float32Array;function n(e){return Math.sqrt(a(e))}var r=n;function a(e){return e[0]*e[0]+e[1]*e[1]}var o=a;function s(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var l=s;function u(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var h=u;t.create=function(e,t){var n=new i(2);return null==e&&(e=0),null==t&&(t=0),n[0]=e,n[1]=t,n},t.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},t.clone=function(e){var t=new i(2);return t[0]=e[0],t[1]=e[1],t},t.set=function(e,t,i){return e[0]=t,e[1]=i,e},t.add=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e},t.scaleAndAdd=function(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e},t.sub=function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e},t.len=n,t.length=r,t.lenSquare=a,t.lengthSquare=o,t.mul=function(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e},t.div=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e},t.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},t.scale=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e},t.normalize=function(e,t){var i=n(t);return 0===i?(e[0]=0,e[1]=0):(e[0]=t[0]/i,e[1]=t[1]/i),e},t.distance=s,t.dist=l,t.distanceSquare=u,t.distSquare=h,t.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},t.lerp=function(e,t,i,n){return e[0]=t[0]+n*(i[0]-t[0]),e[1]=t[1]+n*(i[1]-t[1]),e},t.applyTransform=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[2]*r+i[4],e[1]=i[1]*n+i[3]*r+i[5],e},t.min=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e},t.max=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e}},function(e,t){var i="undefined"==typeof Float32Array?Array:Float32Array;function n(){var e=new i(6);return r(e),e}function r(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function a(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}t.create=n,t.identity=r,t.copy=a,t.mul=function(e,t,i){var n=t[0]*i[0]+t[2]*i[1],r=t[1]*i[0]+t[3]*i[1],a=t[0]*i[2]+t[2]*i[3],o=t[1]*i[2]+t[3]*i[3],s=t[0]*i[4]+t[2]*i[5]+t[4],l=t[1]*i[4]+t[3]*i[5]+t[5];return e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e},t.translate=function(e,t,i){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+i[0],e[5]=t[5]+i[1],e},t.rotate=function(e,t,i){var n=t[0],r=t[2],a=t[4],o=t[1],s=t[3],l=t[5],u=Math.sin(i),h=Math.cos(i);return e[0]=n*h+o*u,e[1]=-n*u+o*h,e[2]=r*h+s*u,e[3]=-r*u+h*s,e[4]=h*a+u*l,e[5]=h*l-u*a,e},t.scale=function(e,t,i){var n=i[0],r=i[1];return e[0]=t[0]*n,e[1]=t[1]*r,e[2]=t[2]*n,e[3]=t[3]*r,e[4]=t[4]*n,e[5]=t[5]*r,e},t.invert=function(e,t){var i=t[0],n=t[2],r=t[4],a=t[1],o=t[3],s=t[5],l=i*o-a*n;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-n*l,e[3]=i*l,e[4]=(n*s-o*r)*l,e[5]=(a*r-i*s)*l,e):null},t.clone=function(e){var t=n();return a(t,e),t}},function(e,t,i){var n=i(13),r=1e-4,a=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function o(e){return Math.floor(Math.log(e)/Math.LN10)}t.linearMap=function(e,t,i,n){var r=t[1]-t[0],a=i[1]-i[0];if(0===r)return 0===a?i[0]:(i[0]+i[1])/2;if(n)if(r>0){if(e<=t[0])return i[0];if(e>=t[1])return i[1]}else{if(e>=t[0])return i[0];if(e<=t[1])return i[1]}else{if(e===t[0])return i[0];if(e===t[1])return i[1]}return(e-t[0])/r*a+i[0]},t.parsePercent=function(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"string"==typeof e?(i=e,i.replace(/^\s+/,"").replace(/\s+$/,"")).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e;var i},t.round=function(e,t,i){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),i?e:+e},t.asc=function(e){return e.sort((function(e,t){return e-t})),e},t.getPrecision=function(e){if(e=+e,isNaN(e))return 0;for(var t=1,i=0;Math.round(e*t)/t!==e;)t*=10,i++;return i},t.getPrecisionSafe=function(e){var t=e.toString(),i=t.indexOf("e");if(i>0){var n=+t.slice(i+1);return n<0?-n:0}var r=t.indexOf(".");return r<0?0:t.length-1-r},t.getPixelPrecision=function(e,t){var i=Math.log,n=Math.LN10,r=Math.floor(i(e[1]-e[0])/n),a=Math.round(i(Math.abs(t[1]-t[0]))/n),o=Math.min(Math.max(-r+a,0),20);return isFinite(o)?o:20},t.getPercentWithPrecision=function(e,t,i){if(!e[t])return 0;var r=n.reduce(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===r)return 0;for(var a=Math.pow(10,i),o=n.map(e,(function(e){return(isNaN(e)?0:e)/r*a*100})),s=100*a,l=n.map(o,(function(e){return Math.floor(e)})),u=n.reduce(l,(function(e,t){return e+t}),0),h=n.map(o,(function(e,t){return e-l[t]}));u<s;){for(var c=Number.NEGATIVE_INFINITY,d=null,f=0,p=h.length;f<p;++f)h[f]>c&&(c=h[f],d=f);++l[d],h[d]=0,++u}return l[t]/a},t.MAX_SAFE_INTEGER=9007199254740991,t.remRadian=function(e){var t=2*Math.PI;return(e%t+t)%t},t.isRadianAroundZero=function(e){return e>-1e-4&&e<r},t.parseDate=function(e){if(e instanceof Date)return e;if("string"==typeof e){var t=a.exec(e);if(!t)return new Date(NaN);if(t[8]){var i=+t[4]||0;return"Z"!==t[8].toUpperCase()&&(i-=t[8].slice(0,3)),new Date(Date.UTC(+t[1],+(t[2]||1)-1,+t[3]||1,i,+(t[5]||0),+t[6]||0,+t[7]||0))}return new Date(+t[1],+(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,+t[7]||0)}return null==e?new Date(NaN):new Date(Math.round(e))},t.quantity=function(e){return Math.pow(10,o(e))},t.nice=function(e,t){var i=o(e),n=Math.pow(10,i),r=e/n;return e=(t?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*n,i>=-20?+e.toFixed(i<0?-i:0):e},t.reformIntervals=function(e){e.sort((function(e,t){return s(e,t,0)?-1:1}));for(var t=-1/0,i=1,n=0;n<e.length;){for(var r=e[n].interval,a=e[n].close,o=0;o<2;o++)r[o]<=t&&(r[o]=t,a[o]=o?1:1-i),t=r[o],i=a[o];r[0]===r[1]&&a[0]*a[1]!=1?e.splice(n,1):n++}return e;function s(e,t,i){return e.interval[i]<t.interval[i]||e.interval[i]===t.interval[i]&&(e.close[i]-t.close[i]==(i?-1:1)||!i&&s(e,t,1))}},t.isNumeric=function(e){return e-parseFloat(e)>=0}},function(e,t,i){var n=i(5),r=i(11),a=i(23),o=function(){this._pool={},this._allocatedTextures=[]};o.prototype={constructor:o,get:function(e){var t=u(e);this._pool.hasOwnProperty(t)||(this._pool[t]=[]);var i=this._pool[t];if(!i.length){var r=new n.a(e);return this._allocatedTextures.push(r),r}return i.pop()},put:function(e){var t=u(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 s={width:512,height:512,type:r.a.UNSIGNED_BYTE,format:r.a.RGBA,wrapS:r.a.CLAMP_TO_EDGE,wrapT:r.a.CLAMP_TO_EDGE,minFilter:r.a.LINEAR_MIPMAP_LINEAR,magFilter:r.a.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,unpackAlignment:4,premultiplyAlpha:!1},l=Object.keys(s);function u(e){var t,i,n,o;a.a.defaultsWithPropList(e,s,l),i=(t=e).width,n=t.height,o=0==(i&i-1)&&0==(n&n-1),t.format===r.a.DEPTH_COMPONENT&&(t.useMipmap=!1),o&&t.useMipmap||(t.minFilter==r.a.NEAREST_MIPMAP_NEAREST||t.minFilter==r.a.NEAREST_MIPMAP_LINEAR?t.minFilter=r.a.NEAREST:t.minFilter!=r.a.LINEAR_MIPMAP_LINEAR&&t.minFilter!=r.a.LINEAR_MIPMAP_NEAREST||(t.minFilter=r.a.LINEAR)),o||(t.wrapS=r.a.CLAMP_TO_EDGE,t.wrapT=r.a.CLAMP_TO_EDGE);for(var u="",h=0;h<l.length;h++)u+=e[l[h]].toString();return u}t.a=o},function(e,t,i){t.a="@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"},function(e,t,i){t.a="\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"},function(e,t,i){t.a="@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"},function(e,t,i){t.a="@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"},function(e,t,i){t.a="@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"},function(e,t,i){t.a="\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"},function(e,t,i){t.a="@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"},function(e,t,i){t.a="@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"},function(e,t,i){t.a="@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,t,i){var n=i(0),r=i.n(n);t.a={getFilledRegions:function(e,t){var i,n=(e||[]).slice();if("string"==typeof t?i=(t=r.a.getMap(t))&&t.geoJson:t&&t.features&&(i=t),!i)return console.error("Map "+t+" not exists. You can download map file on http://echarts.baidu.com/download-map.html"),i.features||console.error("Invalid GeoJSON for map3D"),[];for(var a={},o=i.features,s=0;s<n.length;s++)a[n[s].name]=n[s];for(s=0;s<o.length;s++){var l=o[s].properties.name;a[l]||n.push({name:l})}return n},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}}}}},function(e,t,i){function n(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function r(e,t,i,r,a){var o=i,s=e[t];n(e,t,r);for(var l=i;l<r;l++)a(e[l],s)<0&&(n(e,l,o),o++);return n(e,r,o),o}function a(e,t,i,n){if(i<n){var o=r(e,Math.floor((i+n)/2),i,n,t);a(e,t,i,o-1),a(e,t,o+1,n)}}function o(){this._parts=[]}o.prototype.step=function(e,t,i){var n=e.length;if(0===i){this._parts=[],this._sorted=!1;var o=Math.floor(n/2);this._parts.push({pivot:o,left:0,right:n-1}),this._currentSortPartIdx=0}if(!this._sorted){var s=this._parts;if(0===s.length)return this._sorted=!0,!0;if(s.length<512){for(var l=0;l<s.length;l++)s[l].pivot=r(e,s[l].pivot,s[l].left,s[l].right,t);var u=[];for(l=0;l<s.length;l++){var h,c=s[l].left;(h=s[l].pivot-1)>c&&u.push({pivot:Math.floor((h+c)/2),left:c,right:h}),c=s[l].pivot+1,(h=s[l].right)>c&&u.push({pivot:Math.floor((h+c)/2),left:c,right:h})}s=this._parts=u}else for(l=0;l<Math.floor(s.length/10);l++){var d=s.length-1-this._currentSortPartIdx;if(a(e,t,s[d].left,s[d].right),this._currentSortPartIdx++,this._currentSortPartIdx===s.length)return this._sorted=!0,!0}return!1}},o.sort=a,t.a=o},function(e,t,i){var n=i(99),r=i(0),a=i.n(r),o=i(47),s=i.n(o),l=i(22),u=i(2);function h(e,t){var i=e.getBoxLayoutParams(),n=s.a.getLayoutRect(i,{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(),a=r.width/r.height*(e.get("aspectScale")||.75),o=e.get("boxWidth"),l=e.get("boxDepth"),u=e.get("boxHeight");null==u&&(u=5),isNaN(o)&&isNaN(l)&&(o=100),isNaN(l)?l=o/a:isNaN(o)&&(o=l/a),this.setSize(o,u,l),this.regionHeight=e.get("regionHeight"),this.altitudeAxis&&this.altitudeAxis.setExtent(0,Math.max(u-this.regionHeight,0))}function c(e,t){var i=[1/0,-1/0];if(e.eachSeries((function(e){if(e.coordinateSystem===this&&"series.map3D"!==e.type){var t=e.getData(),n=e.coordDimToDataDim("alt"),r=n&&n[0];if(r){var a=t.getDataExtent(r,!0);i[0]=Math.min(i[0],a[0]),i[1]=Math.max(i[1],a[1])}}}),this),i&&isFinite(i[1]-i[0])){var n=a.a.helper.createScale(i,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new a.a.Axis("altitude",n),this.resize(this.model,t)}}var d=0,f={dimensions:n.a.prototype.dimensions,create:function(e,t){var i=[];if(!a.a.getMap)throw new Error("geo3D component depends on geo component");function n(e,n){var r=f.createGeo3D(e);e.__viewGL=e.__viewGL||new l.a,r.viewGL=e.__viewGL,e.coordinateSystem=r,r.model=e,i.push(r),r.resize=h,r.resize(e,t),r.update=c}return e.eachComponent("geo3D",(function(e,t){n(e)})),e.eachSeriesByType("map3D",(function(e,t){var i=e.get("coordinateSystem");null==i&&(i="geo3D"),"geo3D"===i&&n(e)})),e.eachSeries((function(t){if("geo3D"===t.get("coordinateSystem")){if("series.map3D"===t.type)return;var i=t.getReferringComponents("geo3D")[0];if(i||(i=e.getComponent("geo3D")),!i)throw new Error('geo "'+u.a.firstNotNull(t.get("geo3DIndex"),t.get("geo3DId"),0)+'" not found');t.coordinateSystem=i.coordinateSystem}})),i},createGeo3D:function(e){var t,i=e.get("map");if("string"==typeof i?(t=i,i=a.a.getMap(i)):i&&i.features&&(i={geoJson:i}),i||function(e){console.error("Map "+e+" not exists. You can download map file on http://echarts.baidu.com/download-map.html")}(i),!i.geoJson.features)throw new Error("Invalid GeoJSON for map3D");return null==t&&(t="GEO_ANONYMOUS_"+d++),new n.a(t+d++,t,i&&i.geoJson,i&&i.specialAreas,e.get("nameMap"))}};a.a.registerCoordinateSystem("geo3D",f),t.a=f},function(e,t,i){var n=i(0),r=i.n(n),a=i(6),o=i(205),s=i.n(o),l=i(206),u=i.n(l),h=a.a.vec3,c=a.a.mat4,d=[s.a,u.a];function f(e,t,i,n,r){this.name=e,this.map=t,this.regionHeight=0,this.regions=[],this._nameCoordMap={},this.loadGeoJson(i,n,r),this.transform=c.identity(new Float64Array(16)),this.invTransform=c.identity(new Float64Array(16)),this.extrudeY=!0,this.altitudeAxis}f.prototype={constructor:f,type:"geo3D",dimensions:["lng","lat","alt"],containPoint:function(){},loadGeoJson:function(e,t,i){var n=r.a.parseGeoJSON||r.a.parseGeoJson;try{this.regions=e?n(e):[]}catch(m9){throw"Invalid geoJson format\n"+m9}t=t||{},i=i||{};for(var a=this.regions,o={},s=0;s<a.length;s++){var l=a[s].name;l=i[l]||l,a[s].name=l,o[l]=a[s],this.addGeoCoord(l,a[s].center);var u=t[l];u&&a[s].transformTo(u.left,u.top,u.width,u.height)}this._regionsMap=o,this._geoRect=null,d.forEach((function(e){e(this)}),this)},getGeoBoundingRect:function(){if(this._geoRect)return this._geoRect;for(var e,t=this.regions,i=0;i<t.length;i++){var n=t[i].getBoundingRect();(e=e||n.clone()).union(n)}return this._geoRect=e||new r.a.graphic.BoundingRect(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,i=0;i<t.length;i++)if(t[i].contain(e))return t[i]},setSize:function(e,t,i){this.size=[e,t,i];var n=this.getGeoBoundingRect(),r=e/n.width,a=-i/n.height,o=-e/2-n.x*r,s=i/2-n.y*a,l=this.extrudeY?[o,0,s]:[o,s,0],u=this.extrudeY?[r,1,a]:[r,a,1],h=this.transform;c.identity(h),c.translate(h,h,l),c.scale(h,h,u),c.invert(this.invTransform,h)},dataToPoint:function(e,t){t=t||[];var i=this.extrudeY?1:2,n=this.extrudeY?2:1,r=e[2];return isNaN(r)&&(r=0),t[0]=e[0],t[n]=e[1],this.altitudeAxis?t[i]=this.altitudeAxis.dataToCoord(r):t[i]=0,t[i]+=this.regionHeight,h.transformMat4(t,t,this.transform),t},pointToData:function(e,t){}},t.a=f},function(e,t,i){var n=i(6).a.mat4,r=512,a=.6435011087932844,o=Math.PI,s=.1;function l(){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}l.prototype={constructor:l,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,r)),null==this._initialZoom&&(this._initialZoom=this.zoom),this.updateTransform()},updateTransform:function(){if(this.height){var e=.5/Math.tan(a/2)*this.height*s,t=Math.max(Math.min(this.pitch,this.maxPitch),0)/180*Math.PI,i=a/2,o=Math.PI/2+t,l=Math.sin(i)*e/Math.sin(Math.PI-o-i),u=1.1*(Math.cos(Math.PI/2-t)*l+e);this.pitch>50&&(u=1e3);var h=[];n.perspective(h,a,this.width/this.height,1,u),this.viewGL.camera.projectionMatrix.setArray(h),this.viewGL.camera.decomposeProjectionMatrix(),h=n.identity([]);var c=this.dataToPoint(this.center);n.scale(h,h,[1,-1,1]),n.translate(h,h,[0,0,-e]),n.rotateX(h,h,t),n.rotateZ(h,h,-this.bearing/180*Math.PI),n.translate(h,h,[-c[0]*this.getScale()*s,-c[1]*this.getScale()*s,0]),this.viewGL.camera.viewMatrix.array=h;var d=[];n.invert(d,h),this.viewGL.camera.worldTransform.array=d,this.viewGL.camera.decomposeWorldTransform();var f,p=r*this.getScale();if(this.altitudeExtent&&!isNaN(this.boxHeight)){var g=this.altitudeExtent[1]-this.altitudeExtent[0];f=this.boxHeight/g*this.getScale()/Math.pow(2,this._initialZoom-this.zoomOffset)}else f=p/(2*Math.PI*6378e3*Math.abs(Math.cos(this.center[1]*(Math.PI/180))))*this.altitudeScale*s;this.viewGL.rootNode.scale.set(this.getScale()*s,this.getScale()*s,f)}},getScale:function(){return Math.pow(2,this.zoom-this.zoomOffset)},projectOnTile:function(e,t){return this.projectOnTileWithScale(e,this.getScale()*r,t)},projectOnTileWithScale:function(e,t,i){var n=e[0],r=e[1]*o/180,a=t*(n*o/180+o)/(2*o),s=t*(o-Math.log(Math.tan(o/4+.5*r)))/(2*o);return(i=i||[])[0]=a,i[1]=s,i},unprojectFromTile:function(e,t){return this.unprojectOnTileWithScale(e,this.getScale()*r,t)},unprojectOnTileWithScale:function(e,t,i){var n=e[0],r=e[1],a=n/t*(2*o)-o,s=2*(Math.atan(Math.exp(o-r/t*(2*o)))-o/4);return(i=i||[])[0]=180*a/o,i[1]=180*s/o,i},dataToPoint:function(e,t){return(t=this.projectOnTileWithScale(e,r,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}},t.a=l},function(e,t,i){var n=i(2),r=i(1),a=i(22);t.a=function(e,t,i){function o(e,t){var i=t.getWidth(),n=t.getHeight(),r=t.getDevicePixelRatio();this.viewGL.setViewport(0,0,i,n,r),this.width=i,this.height=n,this.altitudeScale=e.get("altitudeScale"),this.boxHeight=e.get("boxHeight")}function s(e,t){if("auto"!==this.model.get("boxHeight")){var i=[1/0,-1/0];e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData(),n=e.coordDimToDataDim("alt")[0];if(n){var r=t.getDataExtent(n,!0);i[0]=Math.min(i[0],r[0]),i[1]=Math.max(i[1],r[1])}}}),this),i&&isFinite(i[1]-i[0])&&(this.altitudeExtent=i)}}return{dimensions:t.prototype.dimensions,create:function(l,u){var h=[];return l.eachComponent(e,(function(e){var i=e.__viewGL;i||(i=e.__viewGL=new a.a).setRootNode(new r.a.Node);var n=new t;n.viewGL=e.__viewGL,n.resize=o,n.resize(e,u),h.push(n),e.coordinateSystem=n,n.model=e,n.update=s})),l.eachSeries((function(t){if(t.get("coordinateSystem")===e){var i=t.getReferringComponents(e)[0];if(i||(i=l.getComponent(e)),!i)throw new Error(e+' "'+n.a.firstNotNull(t.get(e+"Index"),t.get(e+"Id"),0)+'" not found');t.coordinateSystem=i.coordinateSystem}})),i&&i(h,l,u),h}}}},function(e,t,i){t.a="\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"},function(e,t,i){var n=i(84),r=i.n(n),a=i(83),o=i.n(a);function s(e){this.viewGL=e}s.prototype.reset=function(e,t){this._updateCamera(t.getWidth(),t.getHeight(),t.getDevicePixelRatio()),this._viewTransform=r.a.create(),this.updateTransform(e,t)},s.prototype.updateTransform=function(e,t){var i=e.coordinateSystem;i.getRoamTransform&&(r.a.invert(this._viewTransform,i.getRoamTransform()),this._setCameraTransform(this._viewTransform),t.getZr().refresh())},s.prototype.dataToPoint=function(e,t,i){i=e.dataToPoint(t,null,i);var n=this._viewTransform;n&&o.a.applyTransform(i,i,n)},s.prototype.removeTransformInPoint=function(e){return this._viewTransform&&o.a.applyTransform(e,e,this._viewTransform),e},s.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},s.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)},s.prototype._updateCamera=function(e,t,i){this.viewGL.setViewport(0,0,e,t,i);var n=this.viewGL.camera;n.left=n.top=0,n.bottom=t,n.right=e,n.near=0,n.far=100},t.a=s},function(e,t,i){(function(e){var i;"undefined"!=typeof window?i=window.__DEV__:void 0!==e&&(i=e.__DEV__),void 0===i&&(i=!0);var n=i;t.__DEV__=n}).call(t,i(68))},function(e,t,i){var n,r,a,o,s,l,u,h=i(15),c=i(0),d=i.n(c),f=i(38),p=i(6).a.vec2,g=[[0,0],[1,1]],m=h.a.extend((function(){return{segmentScale:4,dynamic:!0,useNativeLine:!0,attributes:{position:new h.a.Attribute("position","float",2,"POSITION"),normal:new h.a.Attribute("normal","float",2),offset:new h.a.Attribute("offset","float",1),color:new h.a.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,i,n){return 1/(p.dist(e,t)+p.dist(i,t)+p.dist(n,i)+1)*this.segmentScale},getCubicCurveVertexCount:function(e,t,i,n){var r=this._getCubicCurveApproxStep(e,t,i,n),a=Math.ceil(1/r);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(e,t,i,n){var r=this._getCubicCurveApproxStep(e,t,i,n),a=Math.ceil(1/r);return this.useNativeLine?0:2*a},getLineVertexCount:function(){return this.getPolylineVertexCount(g)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(g)},getPolylineVertexCount:function(e){var t;return t="number"==typeof e?e:"number"!=typeof e[0]?e.length:e.length/2,this.useNativeLine?2*(t-1):2*(t-1)+2},getPolylineTriangleCount:function(e){var t;return t="number"==typeof e?e:"number"!=typeof e[0]?e.length:e.length/2,this.useNativeLine?0:2*(t-1)},addCubicCurve:function(e,t,i,n,r,a){null==a&&(a=1);var o=e[0],s=e[1],l=t[0],u=t[1],h=i[0],c=i[1],d=n[0],f=n[1],p=this._getCubicCurveApproxStep(e,t,i,n),g=p*p,m=g*p,v=3*p,y=3*g,_=6*g,x=6*m,b=o-2*l+h,w=s-2*u+c,T=3*(l-h)-o+d,S=3*(u-c)-s+f,M=o,A=s,I=(l-o)*v+b*y+T*m,C=(u-s)*v+w*y+S*m,D=b*_+T*x,E=w*_+S*x,L=T*x,P=S*x,N=0,R=0,O=Math.ceil(1/p),k=new Float32Array(3*(O+1)),z=(k=[],0);for(R=0;R<O+1;R++)k[z++]=M,k[z++]=A,M+=I,A+=C,I+=D,C+=E,D+=L,E+=P,(N+=p)>1&&(M=I>0?Math.min(M,d):Math.max(M,d),A=C>0?Math.min(A,f):Math.max(A,f));this.addPolyline(k,r,a)},addLine:function(e,t,i,n){this.addPolyline([e,t],i,n)},addPolyline:(n=p.create(),r=p.create(),a=p.create(),o=p.create(),s=[],l=[],u=[],function(e,t,i,h,c){if(e.length){var d="number"!=typeof e[0];if(null==c&&(c=d?e.length:e.length/2),!(c<2)){null==h&&(h=0),null==i&&(i=1),this._itemVertexOffsets.push(this._vertexOffset);for(var f,g=d?"number"!=typeof t[0]:t.length/4===c,m=this.attributes.position,v=this.attributes.color,y=this.attributes.offset,_=this.attributes.normal,x=this.indices,b=this._vertexOffset,w=0;w<c;w++){if(d)s=e[w+h],f=g?t[w+h]:t;else{var T=2*w+h;if((s=s||[])[0]=e[T],s[1]=e[T+1],g){var S=4*w+h;(f=f||[])[0]=t[S],f[1]=t[S+1],f[2]=t[S+2],f[3]=t[S+3]}else f=t}if(this.useNativeLine)w>1&&(m.copy(b,b-1),v.copy(b,b-1),b++);else{var M;if(w<c-1)if(d?p.copy(l,e[w+1]):(T=2*(w+1)+h,(l=l||[])[0]=e[T],l[1]=e[T+1]),w>0){p.sub(n,s,u),p.sub(r,l,s),p.normalize(n,n),p.normalize(r,r),p.add(o,n,r),p.normalize(o,o);var A=i/2*Math.min(1/p.dot(n,o),2);a[0]=-o[1],a[1]=o[0],M=A}else p.sub(n,l,s),p.normalize(n,n),a[0]=-n[1],a[1]=n[0],M=i/2;else p.sub(n,s,u),p.normalize(n,n),a[0]=-n[1],a[1]=n[0],M=i/2;_.set(b,a),_.set(b+1,a),y.set(b,M),y.set(b+1,-M),p.copy(u,s),m.set(b,s),m.set(b+1,s),v.set(b,f),v.set(b+1,f),b+=2}if(this.useNativeLine)v.set(b,f),m.set(b,s),b++;else if(w>0){var I=3*this._faceOffset;(x=this.indices)[I]=b-4,x[I+1]=b-3,x[I+2]=b-2,x[I+3]=b-3,x[I+4]=b-1,x[I+5]=b-2,this._faceOffset+=2}}this._vertexOffset=b}}}),setItemColor:function(e,t){for(var i=this._itemVertexOffsets[e],n=e<this._itemVertexOffsets.length-1?this._itemVertexOffsets[e+1]:this._vertexOffset,r=i;r<n;r++)this.attributes.color.set(r,t);this.dirty("color")}});d.a.util.defaults(m.prototype,f.a),t.a=m},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),i(107),i(154),i(201),i(207),i(213),i(219),i(225),i(232),i(236),i(243),i(249),i(252),i(256),i(259),i(262),i(275),i(281)},function(e,t,i){var n=i(0),r=i.n(n),a=i(108),o=i(109),s=i(153),l=i(1),u={echarts:"4.1.0",claygl:"1.2.1"};function h(e,t){e.replace(".","")-0<u[t].replace(".","")-0&&function(e){throw new Error(e+" version is too old, needs "+u[e]+" or higher")}(t),console.log("Loaded "+t+", version "+e)}function c(e){this._layers={},this._zr=e}h(a.a,"claygl"),h(r.a.version,"echarts"),c.prototype.update=function(e,t){var i=this,n=t.getZr();if(n.getWidth()&&n.getHeight()){for(var a in this._layers)this._layers[a].removeViewsAll();e.eachComponent((function(i,n){if("series"!==i){var r=t.getViewOfComponentModel(n),a=n.coordinateSystem;if(r.__ecgl__){if(a){if(!a.viewGL)return void console.error("Can't find viewGL in coordinateSystem of component "+n.id);o=a.viewGL}else{if(!n.viewGL)return void console.error("Can't find viewGL of component "+n.id);o=a.viewGL}var o=a.viewGL,u=s(n);u.addView(o),r.afterRender&&r.afterRender(n,e,t,u),l(r.groupGL,n.get("silent"))}}})),e.eachSeries((function(i){var n=t.getViewOfSeriesModel(i),r=i.coordinateSystem;if(n.__ecgl__){if(r&&!r.viewGL&&!n.viewGL)return void console.error("Can't find viewGL of series "+n.id);var a=r&&r.viewGL||n.viewGL,o=s(i);o.addView(a),n.afterRender&&n.afterRender(i,e,t,o),l(n.groupGL,i.get("silent"))}}))}else console.warn("Dom has no width or height");function s(e){var t;e.coordinateSystem&&e.coordinateSystem.model,t=e.get("zlevel");var a=i._layers,s=a[t];if(!s){if(s=a[t]=new o.a("gl-"+t,n),n.painter.isSingleCanvas()){s.virtual=!0;var l=new r.a.graphic.Image({z:1e4,style:{image:s.renderer.canvas},silent:!0});s.__hostImage=l,n.add(l)}n.painter.insertLayer(t,s)}return s.__hostImage&&s.__hostImage.setStyle({width:s.renderer.getWidth(),height:s.renderer.getHeight()}),s}function l(e,t){e&&e.traverse((function(e){e.isRenderable&&e.isRenderable()&&(e.ignorePicking=null!=e.$ignorePicking?e.$ignorePicking:t)}))}};var d=r.a.init;r.a.init=function(){var e=d.apply(this,arguments);return e.getZr().painter.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas)return this._layers[0].dom;var t=document.createElement("canvas"),i=e.pixelRatio||this.dpr;t.width=this.getWidth()*i,t.height=this.getHeight()*i;var n=t.getContext("2d");n.dpr=i,n.clearRect(0,0,t.width,t.height),e.backgroundColor&&(n.fillStyle=e.backgroundColor,n.fillRect(0,0,t.width,t.height));var r,a=this.storage.getDisplayList(!0),o={},s=this;function l(e,t){var i,r=s._zlevelList;null==e&&(e=-1/0);for(var a=0;a<r.length;a++){var o=r[a],l=s._layers[o];if(!l.__builtin__&&o>e&&o<t){i=l;break}}i&&i.renderToCanvas&&(n.save(),i.renderToCanvas(n),n.restore())}for(var u={ctx:n},h=0;h<a.length;h++){var c=a[h];c.zlevel!==r&&(l(r,c.zlevel),r=c.zlevel),this._doPaintEl(c,u,!0,o)}return l(r,1/0),t},e},r.a.registerPostUpdate((function(e,t){var i=t.getZr();(i.__egl=i.__egl||new c(i)).update(e,t)})),r.a.registerPreprocessor(s.a),r.a.graphicGL=l.a},function(e,t,i){t.a="1.2.1"},function(e,t,i){var n=i(0),r=i.n(n),a=i(52),o=i(117),s=i(4),l=i(1),u=i(53),h=i(80),c=i.n(h),d=function(e,t){this.id=e,this.zr=t;try{this.renderer=new a.a({clearBit:0,devicePixelRatio:t.painter.dpr,preserveDrawingBuffer:!0,premultipliedAlpha:!0}),this.renderer.resize(t.painter.getWidth(),t.painter.getHeight())}catch(m9){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(m9)}this.onglobalout=this.onglobalout.bind(this),t.on("globalout",this.onglobalout),this.dom=this.renderer.canvas;var i=this.dom.style;i.position="absolute",i.left="0",i.top="0",this.views=[],this._picking=new o.a({renderer:this.renderer}),this._viewsToDispose=[],this._accumulatingId=0,this._zrEventProxy=new r.a.graphic.Rect({shape:{x:-1,y:-1,width:2,height:2},__isGLToZRProxy:!0}),this._backgroundColor=null};function f(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)}d.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 i=this.zr;e.scene.traverse((function(e){e.__zr=i,e.addAnimatorsToZr&&e.addAnimatorsToZr(i)}))}},d.prototype.removeView=function(e){if(e.layer===this){var t=this.views.indexOf(e);t>=0&&(this.views.splice(t,1),e.scene.traverse(f,this),e.layer=null,this._viewsToDispose.push(e))}},d.prototype.removeViewsAll=function(){this.views.forEach((function(e){e.scene.traverse(f,this),e.layer=null,this._viewsToDispose.push(e)}),this),this.views.length=0},d.prototype.resize=function(e,t){this.renderer.resize(e,t)},d.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)},d.prototype.clearDepth=function(){var e=this.renderer.gl;e.clear(e.DEPTH_BUFFER_BIT)},d.prototype.clearColor=function(){var e=this.renderer.gl;e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},d.prototype.needsRefresh=function(){this.zr.refresh()},d.prototype.refresh=function(e){this._backgroundColor=e?l.a.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);for(this._doRender(!1),this._trackAndClean(),t=0;t<this._viewsToDispose.length;t++)this._viewsToDispose[t].dispose(this.renderer);this._viewsToDispose.length=0,this._startAccumulating()},d.prototype.renderToCanvas=function(e){this._startAccumulating(!0),e.drawImage(this.dom,0,0,e.canvas.width,e.canvas.height)},d.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()},d.prototype._stopAccumulating=function(){this._accumulatingId=0,clearTimeout(this._accumulatingTimeout)};var p=1;function g(e){for(var t=0;t<e.length;t++)e[t].__used__=0}function m(e,t){for(var i=0;i<t.length;i++)t[i].__used__||t[i].dispose(e)}function v(e,t){e.__used__=e.__used__||0,e.__used__++,1===e.__used__&&t.push(e)}function y(e,t,i){var n,r;e.traverse((function(e){if(e.isRenderable()){var a=e.geometry,o=e.material;if(o!==n)for(var l=o.getTextureUniforms(),u=0;u<l.length;u++){var h=l[u],c=o.uniforms[h].value;if(c)if(c instanceof s.a)v(c,t);else if(c instanceof Array)for(var d=0;d<c.length;d++)c[d]instanceof s.a&&v(c[d],t)}a!==r&&v(a,i),n=o,r=a}}));for(var a=0;a<e.lights.length;a++)e.lights[a].cubemap&&v(e.lights[a].cubemap,t)}d.prototype._startAccumulating=function(e){var t=this;this._stopAccumulating();for(var i=!1,n=0;n<this.views.length;n++)i=this.views[n].needsAccumulate()||i;function r(n){if(t._accumulatingId&&n===t._accumulatingId){for(var a=!0,o=0;o<t.views.length;o++)a=t.views[o].isAccumulateFinished()&&i;a||(t._doRender(!0),e?r(n):c()((function(){r(n)})))}}i&&(this._accumulatingId=p++,e?r(t._accumulatingId):this._accumulatingTimeout=setTimeout((function(){r(t._accumulatingId)}),50))},d.prototype._trackAndClean=function(){var e=[],t=[];this._textureList&&(g(this._textureList),g(this._geometriesList));for(var i=0;i<this.views.length;i++)y(this.views[i].scene,e,t);this._textureList&&(m(this.renderer,this._textureList),m(this.renderer,this._geometriesList)),this._textureList=e,this._geometriesList=t},d.prototype.dispose=function(){this._stopAccumulating(),this.renderer.disposeScene(this.scene),this.zr.off("globalout",this.onglobalout)},d.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}},d.prototype.onmousemove=function(e){if(!e.target||!e.target.__isGLToZRProxy){e=e.event;var t=this.pickObject(e.offsetX,e.offsetY),i=t&&t.target,n=this._hovered;this._hovered=t,n&&i!==n.target&&(n.relatedTarget=i,this._dispatchEvent("mouseout",e,n),this.zr.setCursorStyle("default")),this._dispatchEvent("mousemove",e,t),t&&(this.zr.setCursorStyle("pointer"),n&&i===n.target||this._dispatchEvent("mouseover",e,t)),this._dispatchDataEvent("mousemove",e,t)}},d.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}},d.prototype.onclick=d.prototype.dblclick=function(e){if(!e.target||!e.target.__isGLToZRProxy){var t=this._upX-this._downX,i=this._upY-this._downY;if(!(Math.sqrt(t*t+i*i)>20)){e=e.event;var n=this.pickObject(e.offsetX,e.offsetY);n&&(this._dispatchEvent(e.type,e,n),this._dispatchDataEvent(e.type,e,n));var r=this._clickToSetFocusPoint(e);r&&r.view.setDOFFocusOnPoint(r.distance)&&this.zr.refresh()}}},d.prototype._clickToSetFocusPoint=function(e){for(var t=this.renderer,i=t.viewport,n=this.views.length-1;n>=0;n--){var r=this.views[n];if(r.hasDOF()&&r.containPoint(e.offsetX,e.offsetY)){this._picking.scene=r.scene,this._picking.camera=r.camera,t.viewport=r.viewport;var a=this._picking.pick(e.offsetX,e.offsetY,!0);if(a)return a.view=r,a}}t.viewport=i},d.prototype.onglobalout=function(e){var t=this._hovered;t&&this._dispatchEvent("mouseout",e,{target:t.target})},d.prototype.pickObject=function(e,t){for(var i=[],n=this.renderer,r=n.viewport,a=0;a<this.views.length;a++){var o=this.views[a];o.containPoint(e,t)&&(this._picking.scene=o.scene,this._picking.camera=o.camera,n.viewport=o.viewport,this._picking.pickAll(e,t,i))}return n.viewport=r,i.sort((function(e,t){return e.distance-t.distance})),i[0]},d.prototype._dispatchEvent=function(e,t,i){i||(i={});var n=i.target;for(i.cancelBubble=!1,i.event=t,i.type=e,i.offsetX=t.offsetX,i.offsetY=t.offsetY;n&&(n.trigger(e,i),n=n.getParent(),!i.cancelBubble););this._dispatchToView(e,i)},d.prototype._dispatchDataEvent=function(e,t,i){var n=i&&i.target,r=n&&n.dataIndex,a=n&&n.seriesIndex,o=n&&n.eventData,s=!1,l=this._zrEventProxy;l.position=[t.offsetX,t.offsetY],l.update();var u={target:l};"mousemove"===e&&(null!=r?r!==this._lastDataIndex&&(parseInt(this._lastDataIndex,10)>=0&&(l.dataIndex=this._lastDataIndex,l.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(u,"mouseout",t)),s=!0):null!=o&&o!==this._lastEventData&&(null!=this._lastEventData&&(l.eventData=this._lastEventData,this.zr.handler.dispatchToElement(u,"mouseout",t)),s=!0),this._lastEventData=o,this._lastDataIndex=r,this._lastSeriesIndex=a),l.eventData=o,l.dataIndex=r,l.seriesIndex=a,(null!=o||parseInt(r,10)>=0&&parseInt(a,10)>=0)&&(this.zr.handler.dispatchToElement(u,e,t),s&&this.zr.handler.dispatchToElement(u,"mouseover",t))},d.prototype._dispatchToView=function(e,t){for(var i=0;i<this.views.length;i++)this.views[i].containPoint(t.offsetX,t.offsetY)&&this.views[i].trigger(e,t)},r.a.util.extend(d.prototype,u.a),t.a=d},function(e,t,i){function n(e,t,i){"object"==typeof t&&(i=t,t=null);var n,o=this;if(!(e instanceof Function))for(var s in n=[],e)e.hasOwnProperty(s)&&n.push(s);var l=function(t){if(o.apply(this,arguments),e instanceof Function?r(this,e.call(this,t)):a(this,e,n),this.constructor===l)for(var i=l.__initializers__,s=0;s<i.length;s++)i[s].apply(this,arguments)};l.__super__=o,o.__initializers__?l.__initializers__=o.__initializers__.slice():l.__initializers__=[],t&&l.__initializers__.push(t);var u=function(){};return u.prototype=o.prototype,l.prototype=new u,l.prototype.constructor=l,r(l.prototype,i),l.extend=o.extend,l.derive=o.extend,l}function r(e,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}function a(e,t,i){for(var n=0;n<i.length;n++){var r=i[n];e[r]=t[r]}}t.a={extend:n,derive:n}},function(e,t,i){var n=["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"],r=["MAX_TEXTURE_SIZE","MAX_CUBE_MAP_TEXTURE_SIZE"];t.a=function(e){for(var t={},i={},a=0;a<n.length;a++)s(n[a]);for(a=0;a<r.length;a++){var o=r[a];i[o]=e.getParameter(e[o])}function s(i){var n=e.getExtension(i);n||(n=e.getExtension("MOZ_"+i)),n||(n=e.getExtension("WEBKIT_"+i)),t[i]=n}this.getExtension=function(e){return e in t||s(e),t[e]},this.getParameter=function(e){return i[e]},this.getMaxJointNumber=function(){return 15}}},function(e,t,i){t.a={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 i=t.loaded/t.total;e.onprogress(i,t.loaded,t.total)}else e.onprogress(null)}),t.onload=function(i){t.status>=400?e.onerror&&e.onerror():e.onload&&e.onload(t.response)},e.onerror&&(t.onerror=e.onerror),t.send(null)}}},function(e,t,i){var n=i(69),r={},a={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 o(e){return(e=Math.round(e))<0?0:e>255?255:e}function s(e){return e<0?0:e>1?1:e}function l(e){return e.length&&"%"===e.charAt(e.length-1)?o(parseFloat(e)/100*255):o(parseInt(e,10))}function u(e){return e.length&&"%"===e.charAt(e.length-1)?s(parseFloat(e)/100):s(parseFloat(e))}function h(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function c(e,t,i){return e+(t-e)*i}function d(e,t,i,n,r){return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e}function f(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var p=new n.a(20),g=null;function m(e,t){g&&f(g,t),g=p.put(e,g||t.slice())}function v(e,t){var i=(parseFloat(e[0])%360+360)%360/360,n=u(e[1]),r=u(e[2]),a=r<=.5?r*(n+1):r+n-r*n,s=2*r-a;return d(t=t||[],o(255*h(s,a,i+1/3)),o(255*h(s,a,i)),o(255*h(s,a,i-1/3)),1),4===e.length&&(t[3]=e[3]),t}r.parse=function(e,t){if(e){t=t||[];var i=p.get(e);if(i)return f(t,i);var n,r=(e+="").replace(/ /g,"").toLowerCase();if(r in a)return f(t,a[r]),m(e,t),t;if("#"===r.charAt(0))return 4===r.length?(n=parseInt(r.substr(1),16))>=0&&n<=4095?(d(t,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),m(e,t),t):void d(t,0,0,0,1):7===r.length?(n=parseInt(r.substr(1),16))>=0&&n<=16777215?(d(t,(16711680&n)>>16,(65280&n)>>8,255&n,1),m(e,t),t):void d(t,0,0,0,1):void 0;var o=r.indexOf("("),s=r.indexOf(")");if(-1!==o&&s+1===r.length){var h=r.substr(0,o),c=r.substr(o+1,s-(o+1)).split(","),g=1;switch(h){case"rgba":if(4!==c.length)return void d(t,0,0,0,1);g=u(c.pop());case"rgb":return 3!==c.length?void d(t,0,0,0,1):(d(t,l(c[0]),l(c[1]),l(c[2]),g),m(e,t),t);case"hsla":return 4!==c.length?void d(t,0,0,0,1):(c[3]=u(c[3]),v(c,t),m(e,t),t);case"hsl":return 3!==c.length?void d(t,0,0,0,1):(v(c,t),m(e,t),t);default:return}}d(t,0,0,0,1)}},r.parseToFloat=function(e,t){if(t=r.parse(e,t))return t[0]/=255,t[1]/=255,t[2]/=255,t},r.lift=function(e,t){var i=r.parse(e);if(i){for(var n=0;n<3;n++)i[n]=t<0?i[n]*(1-t)|0:(255-i[n])*t+i[n]|0;return r.stringify(i,4===i.length?"rgba":"rgb")}},r.toHex=function(e){var t=r.parse(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},r.fastLerp=function(e,t,i){if(t&&t.length&&e>=0&&e<=1){i=i||[];var n=e*(t.length-1),r=Math.floor(n),a=Math.ceil(n),l=t[r],u=t[a],h=n-r;return i[0]=o(c(l[0],u[0],h)),i[1]=o(c(l[1],u[1],h)),i[2]=o(c(l[2],u[2],h)),i[3]=s(c(l[3],u[3],h)),i}},r.fastMapToColor=r.fastLerp,r.lerp=function(e,t,i){if(t&&t.length&&e>=0&&e<=1){var n=e*(t.length-1),a=Math.floor(n),l=Math.ceil(n),u=r.parse(t[a]),h=r.parse(t[l]),d=n-a,f=r.stringify([o(c(u[0],h[0],d)),o(c(u[1],h[1],d)),o(c(u[2],h[2],d)),s(c(u[3],h[3],d))],"rgba");return i?{color:f,leftIndex:a,rightIndex:l,value:n}:f}},r.mapToColor=r.lerp,r.modifyHSL=function(e,t,i,n){if(e=r.parse(e))return e=function(e){if(e){var t,i,n=e[0]/255,r=e[1]/255,a=e[2]/255,o=Math.min(n,r,a),s=Math.max(n,r,a),l=s-o,u=(s+o)/2;if(0===l)t=0,i=0;else{i=u<.5?l/(s+o):l/(2-s-o);var h=((s-n)/6+l/2)/l,c=((s-r)/6+l/2)/l,d=((s-a)/6+l/2)/l;n===s?t=d-c:r===s?t=1/3+h-d:a===s&&(t=2/3+c-h),t<0&&(t+=1),t>1&&(t-=1)}var f=[360*t,i,u];return null!=e[3]&&f.push(e[3]),f}}(e),null!=t&&(e[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=i&&(e[1]=u(i)),null!=n&&(e[2]=u(n)),r.stringify(v(e),"rgba")},r.modifyAlpha=function(e,t){if((e=r.parse(e))&&null!=t)return e[3]=s(t),r.stringify(e,"rgba")},r.stringify=function(e,t){if(e&&e.length){var i=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(i+=","+e[3]),t+"("+i+")"}},t.a=r},function(e,t,i){var n=function(){this.head=null,this.tail=null,this._length=0};n.prototype.insert=function(e){var t=new n.Entry(e);return this.insertEntry(t),t},n.prototype.insertAt=function(e,t){if(!(e<0)){for(var i=this.head,r=0;i&&r!=e;)i=i.next,r++;if(i){var a=new n.Entry(t),o=i.prev;o?(o.next=a,a.prev=o):this.head=a,a.next=i,i.prev=a}else this.insert(t)}},n.prototype.insertBeforeEntry=function(e,t){var i=new n.Entry(e),r=t.prev;r?(r.next=i,i.prev=r):this.head=i,i.next=t,t.prev=i,this._length++},n.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,this.tail=e):this.head=this.tail=e,this._length++},n.prototype.remove=function(e){var t=e.prev,i=e.next;t?t.next=i:this.head=i,i?i.prev=t:this.tail=t,e.next=e.prev=null,this._length--},n.prototype.removeAt=function(e){if(!(e<0)){for(var t=this.head,i=0;t&&i!=e;)t=t.next,i++;return t?(this.remove(t),t.value):void 0}},n.prototype.getHead=function(){if(this.head)return this.head.value},n.prototype.getTail=function(){if(this.tail)return this.tail.value},n.prototype.getAt=function(e){if(!(e<0)){for(var t=this.head,i=0;t&&i!=e;)t=t.next,i++;return t.value}},n.prototype.indexOf=function(e){for(var t=this.head,i=0;t;){if(t.value===e)return i;t=t.next,i++}},n.prototype.length=function(){return this._length},n.prototype.isEmpty=function(){return 0===this._length},n.prototype.forEach=function(e,t){for(var i=this.head,n=0,r=void 0!==t;i;)r?e.call(t,i.value,n):e(i.value,n),i=i.next,n++},n.prototype.clear=function(){this.tail=this.head=null,this._length=0},n.Entry=function(e){this.value=e,this.next=null,this.prev=null},t.a=n},function(e,t,i){var n=i(116),r=/for\s*?\(int\s*?_idx_\s*\=\s*([\w-]+)\;\s*_idx_\s*<\s*([\w-]+);\s*_idx_\s*\+\+\s*\)\s*\{\{([\s\S]+?)(?=\}\})\}\}/g;function a(e,t,i){var n={};for(var a in i)n[a+"_COUNT"]=i[a];return e.replace(r,(function(e,i,r,a){var o="";isNaN(i)&&(i=i in t?t[i]:n[i]),isNaN(r)&&(r=r in t?t[r]:n[r]);for(var s=parseInt(i);s<parseInt(r);s++)o+="{"+a.replace(/float\s*\(\s*_idx_\s*\)/g,s.toFixed(1)).replace(/_idx_/g,s)+"}";return o}))}function o(e,t,i){var n=[];if(t)for(var r in t){var a=t[r];a>0&&n.push("#define "+r.toUpperCase()+"_COUNT "+a)}if(i)for(var o=0;o<i.length;o++){var s=i[o];n.push("#define "+s.toUpperCase()+"_ENABLED")}for(var s in e){var l=e[s];null===l?n.push("#define "+s):n.push("#define "+s+" "+l.toString())}return n.join("\n")}function s(e){this._renderer=e,this._cache={}}s.prototype.getProgram=function(e,t,i){var r=this._cache,s=e.isSkinnedMesh&&e.isSkinnedMesh(),l="s"+t.shader.shaderID+"m"+t.getProgramKey();if(i&&(l+="se"+i.getProgramKey(e.lightGroup)),s&&(l+=","+e.joints.length),x=r[l])return x;var u=i?i.getLightsNumbers(e.lightGroup):{},h=this._renderer,c=h.gl,d=t.getEnabledTextures(),f="";if(s){var p={SKINNING:null,JOINT_COUNT:e.joints.length};e.joints.length>h.getMaxJointNumber()&&(p.USE_SKIN_MATRICES_TEXTURE=null),f="\n"+o(p)+"\n"}var g=f+o(t.vertexDefines,u,d),m=f+o(t.fragmentDefines,u,d),v=g+"\n"+t.shader.vertex,y=["OES_standard_derivatives","EXT_shader_texture_lod"].filter((function(e){return null!=h.getGLExtension(e)}));y.indexOf("EXT_shader_texture_lod")>=0&&(m+="\n#define SUPPORT_TEXTURE_LOD"),y.indexOf("OES_standard_derivatives")>=0&&(m+="\n#define SUPPORT_STANDARD_DERIVATIVES");var _,x,b=function(e){for(var t=[],i=0;i<e.length;i++)t.push("#extension GL_"+e[i]+" : enable");return t.join("\n")}(y)+"\n"+["precision",_=t.precision,"float"].join(" ")+";\n"+["precision",_,"int"].join(" ")+";\n"+["precision",_,"sampler2D"].join(" ")+";\n\n"+m+"\n"+t.shader.fragment,w=a(v,t.vertexDefines,u),T=a(b,t.fragmentDefines,u);(x=new n.a).uniformSemantics=t.shader.uniformSemantics,x.attributes=t.shader.attributes;var S=x.buildProgram(c,t.shader,w,T);return x.__error=S,r[l]=x,x},t.a=s},function(e,t,i){var n=i(14),r=i(7),a={};function o(e){for(var t=e.split("\n"),i=0,n=t.length;i<n;i++)t[i]=i+1+": "+t[i];return t.join("\n")}function s(e,t,i){if(!e.getShaderParameter(t,e.COMPILE_STATUS))return[e.getShaderInfoLog(t),o(i)].join("\n")}var l=new n.a.Float32Array(16),u=r.a.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,i){t&&(e.gl.activeTexture(e.gl.TEXTURE0+i),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 i=this._textureSlot;return this.useTextureSlot(e,t,i),this._textureSlot++,i},setUniform:function(e,t,i,r){var a=this._locations[i];if(null==a)return!1;switch(t){case"m4":if(!(r instanceof Float32Array)){for(var o=0;o<r.length;o++)l[o]=r[o];r=l}e.uniformMatrix4fv(a,!1,r);break;case"2i":e.uniform2i(a,r[0],r[1]);break;case"2f":e.uniform2f(a,r[0],r[1]);break;case"3i":e.uniform3i(a,r[0],r[1],r[2]);break;case"3f":e.uniform3f(a,r[0],r[1],r[2]);break;case"4i":e.uniform4i(a,r[0],r[1],r[2],r[3]);break;case"4f":e.uniform4f(a,r[0],r[1],r[2],r[3]);break;case"1i":e.uniform1i(a,r);break;case"1f":e.uniform1f(a,r);break;case"1fv":e.uniform1fv(a,r);break;case"1iv":e.uniform1iv(a,r);break;case"2iv":e.uniform2iv(a,r);break;case"2fv":e.uniform2fv(a,r);break;case"3iv":e.uniform3iv(a,r);break;case"3fv":e.uniform3fv(a,r);break;case"4iv":e.uniform4iv(a,r);break;case"4fv":e.uniform4fv(a,r);break;case"m2":case"m2v":e.uniformMatrix2fv(a,!1,r);break;case"m3":case"m3v":e.uniformMatrix3fv(a,!1,r);break;case"m4v":if(Array.isArray(r)&&Array.isArray(r[0])){var s=new n.a.Float32Array(16*r.length),u=0;for(o=0;o<r.length;o++)for(var h=r[o],c=0;c<16;c++)s[u++]=h[c];e.uniformMatrix4fv(a,!1,s)}else e.uniformMatrix4fv(a,!1,r)}return!0},setUniformOfSemantic:function(e,t,i){var n=this.uniformSemantics[t];return!!n&&this.setUniform(e,n.type,n.symbol,i)},enableAttributes:function(e,t,i){var n,r=e.gl,o=this._program,s=this._locations;(n=i?i.__enabledAttributeList:a[e.__uid__])||(n=i?i.__enabledAttributeList=[]:a[e.__uid__]=[]);for(var l=[],u=0;u<t.length;u++){var h=t[u];if(this.attributes[h]){var c=s[h];if(null==c){if(-1===(c=r.getAttribLocation(o,h))){l[u]=-1;continue}s[h]=c}l[u]=c,n[c]?n[c]=2:n[c]=1}else l[u]=-1}for(u=0;u<n.length;u++)switch(n[u]){case 1:r.enableVertexAttribArray(u),n[u]=3;break;case 2:n[u]=3;break;case 3:r.disableVertexAttribArray(u),n[u]=0}return l},buildProgram:function(e,t,i,n){var r=e.createShader(e.VERTEX_SHADER),a=e.createProgram();e.shaderSource(r,i),e.compileShader(r);var o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,n),e.compileShader(o);var l=s(e,r,i);if(l)return l;if(l=s(e,o,n))return l;if(e.attachShader(a,r),e.attachShader(a,o),t.attributeSemantics.POSITION)e.bindAttribLocation(a,0,t.attributeSemantics.POSITION.symbol);else{var u=Object.keys(this.attributes);e.bindAttribLocation(a,0,u[0])}if(e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))return"Could not link program\n"+e.getProgramInfoLog(a);for(var h=0;h<t.uniforms.length;h++){var c=t.uniforms[h];this._locations[c]=e.getUniformLocation(a,c)}e.deleteShader(r),e.deleteShader(o),this._program=a,this.vertexCode=i,this.fragmentCode=n}});t.a=u},function(e,t,i){var n=i(7),r=i(54),a=i(26),o=i(3),s=i(9),l=i(72),u=i(11),h=i(12),c=n.a.extend({scene:null,camera:null,renderer:null},(function(){this._ray=new r.a,this._ndc=new a.a}),{pick:function(e,t,i){return this.pickAll(e,t,[],i)[0]||null},pickAll:function(e,t,i,n){return this.renderer.screenToNDC(e,t,this._ndc),this.camera.castRay(this._ndc,this._ray),i=i||[],this._intersectNode(this.scene,i,n||!1),i.sort(this._intersectionCompareFunc),i},_intersectNode:function(e,t,i){e instanceof l.a&&e.isRenderable()&&(e.ignorePicking&&!i||!(e.mode===u.a.TRIANGLES&&e.geometry.isUseIndices()||e.geometry.pickByRay||e.geometry.pick)||this._intersectRenderable(e,t));for(var n=0;n<e._children.length;n++)this._intersectNode(e._children[n],t,i)},_intersectRenderable:function(){var e=new o.a,t=new o.a,i=new o.a,n=new r.a,a=new s.a;return function(r,l){var d=r.isSkinnedMesh();n.copy(this._ray),s.a.invert(a,r.worldTransform),d||n.applyTransform(a);var f=r.geometry,p=d?r.skeleton.boundingBox:f.boundingBox;if(!p||n.intersectBoundingBox(p))if(f.pick)f.pick(this._ndc.x,this._ndc.y,this.renderer,this.camera,r,l);else if(f.pickByRay)f.pickByRay(n,r,l);else{var g,m,v=r.cullFace===u.a.BACK&&r.frontFace===u.a.CCW||r.cullFace===u.a.FRONT&&r.frontFace===u.a.CW,y=f.indices,_=f.attributes.position,x=f.attributes.weight,b=f.attributes.joint,w=[];if(_&&_.value&&y){if(d){m=r.skeleton.getSubSkinMatrices(r.__uid__,r.joints);for(var T=0;T<r.joints.length;T++){w[T]=w[T]||[];for(var S=0;S<16;S++)w[T][S]=m[16*T+S]}var M=[],A=[],I=[],C=[],D=[],E=f.attributes.skinnedPosition;for(E&&E.value||(f.createAttribute("skinnedPosition","f",3),(E=f.attributes.skinnedPosition).init(f.vertexCount)),T=0;T<f.vertexCount;T++){for(_.get(T,M),x.get(T,A),b.get(T,I),A[3]=1-A[0]-A[1]-A[2],h.a.set(C,0,0,0),S=0;S<4;S++)I[S]>=0&&A[S]>1e-4&&(h.a.transformMat4(D,M,w[I[S]]),h.a.scaleAndAdd(C,C,D,A[S]));E.set(T,C)}}for(T=0;T<y.length;T+=3){var L=y[T],P=y[T+1],N=y[T+2],R=d?f.attributes.skinnedPosition:_;if(R.get(L,e.array),R.get(P,t.array),R.get(N,i.array),g=v?n.intersectTriangle(e,t,i,r.culling):n.intersectTriangle(e,i,t,r.culling)){var O=new o.a;d?o.a.copy(O,g):o.a.transformMat4(O,g,r.worldTransform),l.push(new c.Intersection(g,O,r,[L,P,N],T/3,o.a.dist(O,this._ray.origin)))}}}}}}(),_intersectionCompareFunc:function(e,t){return e.distance-t.distance}});c.Intersection=function(e,t,i,n,r,a){this.point=e,this.pointWorld=t,this.target=i,this.triangle=n,this.triangleIndex=r,this.distance=a},t.a=c},function(e,t,i){var n=i(7),r=i(11),a=i(57),o=i(14);function s(e){return{byte:o.a.Int8Array,ubyte:o.a.Uint8Array,short:o.a.Int16Array,ushort:o.a.Uint16Array}[e]||o.a.Float32Array}function l(e){return"attr_"+e}function u(e,t,i,n){switch(this.name=e,this.type=t,this.size=i,this.semantic=n||"",this.value=null,i){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 i=this.value;return t[0]=i[2*e],t[1]=i[2*e+1],t},this.set=function(e,t){var i=this.value;i[2*e]=t[0],i[2*e+1]=t[1]},this.copy=function(e,t){var i=this.value;t*=2,i[e*=2]=i[t],i[e+1]=i[t+1]};break;case 3:this.get=function(e,t){var i=3*e,n=this.value;return t[0]=n[i],t[1]=n[i+1],t[2]=n[i+2],t},this.set=function(e,t){var i=3*e,n=this.value;n[i]=t[0],n[i+1]=t[1],n[i+2]=t[2]},this.copy=function(e,t){var i=this.value;t*=3,i[e*=3]=i[t],i[e+1]=i[t+1],i[e+2]=i[t+2]};break;case 4:this.get=function(e,t){var i=this.value,n=4*e;return t[0]=i[n],t[1]=i[n+1],t[2]=i[n+2],t[3]=i[n+3],t},this.set=function(e,t){var i=this.value,n=4*e;i[n]=t[0],i[n+1]=t[1],i[n+2]=t[2],i[n+3]=t[3]},this.copy=function(e,t){var i=this.value;t*=4,i[e*=4]=i[t],i[e+1]=i[t+1],i[e+2]=i[t+2],i[e+3]=i[t+3]}}}function h(e,t,i,n,r){this.name=e,this.type=t,this.buffer=i,this.size=n,this.semantic=r,this.symbol="",this.needsRemove=!1}function c(e){this.buffer=e,this.count=0}u.prototype.init=function(e){if(!this.value||this.value.length!=e*this.size){var t=s(this.type);this.value=new t(e*this.size)}},u.prototype.fromArray=function(e){var t,i=s(this.type);if(e[0]&&e[0].length){var n=0,r=this.size;t=new i(e.length*r);for(var a=0;a<e.length;a++)for(var o=0;o<r;o++)t[n++]=e[a][o]}else t=new i(e);this.value=t},u.prototype.clone=function(e){var t=new u(this.name,this.type,this.size,this.semantic);return e&&console.warn("todo"),t};var d=n.a.extend((function(){return{attributes:{},indices:null,dynamic:!0,_enabledAttributes:null,__used:0}}),(function(){this._cache=new a.a,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(l(e)),this._cache.dirtyAll("attributes")},getTriangleIndices:function(e,t){if(e<this.triangleCount&&e>=0){t||(t=[]);var i=this.indices;return t[0]=i[3*e],t[1]=i[3*e+1],t[2]=i[3*e+2],t}},setTriangleIndices:function(e,t){var i=this.indices;i[3*e]=t[0],i[3*e+1]=t[1],i[3*e+2]=t[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(e){var t,i=this.vertexCount>65535?o.a.Uint32Array:o.a.Uint16Array;if(e[0]&&e[0].length){var n=0;t=new i(3*e.length);for(var r=0;r<e.length;r++)for(var a=0;a<3;a++)t[n++]=e[r][a]}else t=new i(e);this.indices=t},createAttribute:function(e,t,i,n){var r=new u(e,t,i,n);return this.attributes[e]&&this.removeAttribute(e),this.attributes[e]=r,this._attributeList.push(e),r},removeAttribute:function(e){var t=this._attributeList,i=t.indexOf(e);return i>=0&&(t.splice(i,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 i=[],n=this.vertexCount,r=0;r<t.length;r++){var a=t[r],o=this.attributes[a];o.value&&o.value.length===n*o.size&&i.push(a)}return this._enabledAttributes=i,i},getBufferChunks:function(e){var t=this._cache;t.use(e.__uid__);var i=t.isDirty("attributes"),n=t.isDirty("indices");if(i||n){this._updateBuffer(e.gl,i,n);for(var r=this.getEnabledAttributes(),a=0;a<r.length;a++)t.fresh(l(r[a]));t.fresh("attributes"),t.fresh("indices")}return t.fresh("any"),t.get("chunks")},_updateBuffer:function(e,t,i){var n=this._cache,a=n.get("chunks"),o=!1;a||((a=[])[0]={attributeBuffers:[],indicesBuffer:null},n.put("chunks",a),o=!0);var s=a[0],u=s.attributeBuffers,d=s.indicesBuffer;if(t||o){var f=this.getEnabledAttributes(),p={};if(!o)for(var g=0;g<u.length;g++)p[u[g].name]=u[g];for(var m=0;m<f.length;m++){var v,y,_=f[m],x=this.attributes[_];o||(v=p[_]),y=v?v.buffer:e.createBuffer(),n.isDirty(l(_))&&(e.bindBuffer(e.ARRAY_BUFFER,y),e.bufferData(e.ARRAY_BUFFER,x.value,this.dynamic?r.a.DYNAMIC_DRAW:r.a.STATIC_DRAW)),u[m]=new h(_,x.type,y,x.size,x.semantic)}for(g=m;g<u.length;g++)e.deleteBuffer(u[g].buffer);u.length=m}this.isUseIndices()&&(i||o)&&(d||(d=new c(e.createBuffer()),s.indicesBuffer=d),d.count=this.indices.length,e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,d.buffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices,this.dynamic?r.a.DYNAMIC_DRAW:r.a.STATIC_DRAW))},dispose:function(e){var t=this._cache;t.use(e.__uid__);var i=t.get("chunks");if(i)for(var n=0;n<i.length;n++){for(var r=i[n],a=0;a<r.attributeBuffers.length;a++){var o=r.attributeBuffers[a];e.gl.deleteBuffer(o.buffer)}r.indicesBuffer&&e.gl.deleteBuffer(r.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(d.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(d.prototype,"triangleCount",{enumerable:!1,get:function(){var e=this.indices;return e?e.length/3:0}})),d.STATIC_DRAW=r.a.STATIC_DRAW,d.DYNAMIC_DRAW=r.a.DYNAMIC_DRAW,d.STREAM_DRAW=r.a.STREAM_DRAW,d.AttributeBuffer=h,d.IndicesBuffer=c,d.Attribute=u,t.a=d},function(e,t,i){var n=i(120),r="@export clay.header.",a="@end",o=":unconfigurable;";t.a=[r+"directional_light","uniform vec3 directionalLightDirection[DIRECTIONAL_LIGHT_COUNT]"+o,"uniform vec3 directionalLightColor[DIRECTIONAL_LIGHT_COUNT]"+o,a,r+"ambient_light","uniform vec3 ambientLightColor[AMBIENT_LIGHT_COUNT]"+o,a,r+"ambient_sh_light","uniform vec3 ambientSHLightColor[AMBIENT_SH_LIGHT_COUNT]"+o,"uniform vec3 ambientSHLightCoefficients[AMBIENT_SH_LIGHT_COUNT * 9]"+o,n.a,a,r+"ambient_cubemap_light","uniform vec3 ambientCubemapLightColor[AMBIENT_CUBEMAP_LIGHT_COUNT]"+o,"uniform samplerCube ambientCubemapLightCubemap[AMBIENT_CUBEMAP_LIGHT_COUNT]"+o,"uniform sampler2D ambientCubemapLightBRDFLookup[AMBIENT_CUBEMAP_LIGHT_COUNT]"+o,a,r+"point_light","uniform vec3 pointLightPosition[POINT_LIGHT_COUNT]"+o,"uniform float pointLightRange[POINT_LIGHT_COUNT]"+o,"uniform vec3 pointLightColor[POINT_LIGHT_COUNT]"+o,a,r+"spot_light","uniform vec3 spotLightPosition[SPOT_LIGHT_COUNT]"+o,"uniform vec3 spotLightDirection[SPOT_LIGHT_COUNT]"+o,"uniform float spotLightRange[SPOT_LIGHT_COUNT]"+o,"uniform float spotLightUmbraAngleCosine[SPOT_LIGHT_COUNT]"+o,"uniform float spotLightPenumbraAngleCosine[SPOT_LIGHT_COUNT]"+o,"uniform float spotLightFalloffFactor[SPOT_LIGHT_COUNT]"+o,"uniform vec3 spotLightColor[SPOT_LIGHT_COUNT]"+o,a].join("\n")},function(e,t,i){t.a="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}"},function(e,t,i){t.a="@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"},function(e,t,i){var n=i(4),r=i(5);function a(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}i(27);var o=a("DXT1"),s=a("DXT3"),l=a("DXT5"),u={parse:function(e,t){var i=new Int32Array(e,0,31);if(542327876!==i[0])return null;if(4&!i(20))return null;var a,u,h=i(21),c=i[4],d=i[3],f=512&i[28],p=131072&i[2];switch(h){case o:a=8,u=n.a.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case s:a=16,u=n.a.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case l:a=16,u=n.a.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var g=i[1]+4,m=f?6:1,v=1;p&&(v=Math.max(1,i[7]));for(var y=[],_=0;_<m;_++){var x=c,b=d;y[_]=new r.a({width:x,height:b,format:u});for(var w=[],T=0;T<v;T++){var S=Math.max(4,x)/4*Math.max(4,b)/4*a,M=new Uint8Array(e,g,S);g+=S,x*=.5,b*=.5,w[T]=M}y[_].pixels=w[0],p&&(y[_].mipmaps=w)}if(!t)return y[0];t.width=y[0].width,t.height=y[0].height,t.format=y[0].format,t.pixels=y[0].pixels,t.mipmaps=y[0].mipmaps}};t.a=u},function(e,t,i){var n=i(4),r=i(5),a=String.fromCharCode;function o(e,t,i,n){if(e[3]>0){var r=Math.pow(2,e[3]-128-8+n);t[i+0]=e[0]*r,t[i+1]=e[1]*r,t[i+2]=e[2]*r}else t[i+0]=0,t[i+1]=0,t[i+2]=0;return t[i+3]=1,t}function s(e,t,i,n){for(var r,a,o=0,s=0,l=n;l>0;)if(e[s][0]=t[i++],e[s][1]=t[i++],e[s][2]=t[i++],e[s][3]=t[i++],1===e[s][0]&&1===e[s][1]&&1===e[s][2]){for(var u=e[s][3]<<o>>>0;u>0;u--)r=e[s-1],(a=e[s])[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],s++,l--;o+=8}else s++,l--,o=0;return i}function l(e,t,i,n){if(n<8|n>32767)return s(e,t,i,n);if(2!=(r=t[i++]))return s(e,t,i-1,n);if(e[0][1]=t[i++],e[0][2]=t[i++],r=t[i++],(e[0][2]<<8>>>0|r)>>>0!==n)return null;for(var r=0;r<4;r++)for(var a=0;a<n;){var o=t[i++];if(o>128){o=(127&o)>>>0;for(var l=t[i++];o--;)e[a++][r]=l}else for(;o--;)e[a++][r]=t[i++]}return i}var u={parseRGBE:function(e,t,i){null==i&&(i=0);var s=new Uint8Array(e),u=s.length;if("#?"===function(e,t,i){for(var n="",r=t;r<i;r++)n+=a(e[r]);return n}(s,0,2)){for(var h=2;h<u&&("\n"!==a(s[h])||"\n"!==a(s[h+1]));h++);if(!(h>=u)){h+=2;for(var c="";h<u;h++){var d=a(s[h]);if("\n"===d)break;c+=d}var f=c.split(" "),p=parseInt(f[1]),g=parseInt(f[3]);if(g&&p){for(var m=h+1,v=[],y=0;y<g;y++){v[y]=[];for(var _=0;_<4;_++)v[y][_]=0}for(var x=new Float32Array(g*p*4),b=0,w=0;w<p;w++){if(!(m=l(v,s,m,g)))return null;for(y=0;y<g;y++)o(v[y],x,b,i),b+=4}return t||(t=new r.a),t.width=g,t.height=p,t.pixels=x,t.type=n.a.FLOAT,t}}}},parseRGBEFromPNG:function(e){}};t.a=u},function(e,t,i){var n=i(5),r=i(3),a=i(26),o=["mousedown","mouseup","mousemove","mouseover","mouseout","click","dblclick","contextmenu"];function s(e){return"_on"+e}var l,u,h,c,d,f,p,g,m=function(e){var t=this;this._texture=new n.a({anisotropic:32,flipY:!1,surface:this,dispose:function(e){t.dispose(),n.a.prototype.dispose.call(this,e)}}),o.forEach((function(e){this[s(e)]=function(t){t.triangle&&this._meshes.forEach((function(i){this.dispatchEvent(e,i,t.triangle,t.point)}),this)}}),this),this._meshes=[],e&&this.setECharts(e),this.onupdate=null};m.prototype={constructor:m,getTexture:function(){return this._texture},setECharts:function(e){this._chart=e;var t=e.getDom();if(t instanceof HTMLCanvasElement){var i=this,n=e.getZr(),r=n.__oldRefreshImmediately||n.refreshImmediately;n.refreshImmediately=function(){r.call(this),i._texture.dirty(),i.onupdate&&i.onupdate()},n.__oldRefreshImmediately=r}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:(l=new r.a,u=new r.a,h=new r.a,c=new a.a,d=new a.a,f=new a.a,p=new a.a,g=new r.a,function(e,t,i,n){var o=t.geometry,s=o.attributes.position,m=o.attributes.texcoord0,v=r.a.dot,y=r.a.cross;s.get(i[0],l.array),s.get(i[1],u.array),s.get(i[2],h.array),m.get(i[0],c.array),m.get(i[1],d.array),m.get(i[2],f.array),y(g,u,h);var _=v(l,g),x=v(n,g)/_;y(g,h,l);var b=v(n,g)/_;y(g,l,u);var w=v(n,g)/_;a.a.scale(p,c,x),a.a.scaleAndAdd(p,p,d,b),a.a.scaleAndAdd(p,p,f,w);var T=p.x*this._chart.getWidth(),S=p.y*this._chart.getHeight();this._chart.getZr().handler.dispatch(e,{zrX:T,zrY:S})}),attachToMesh:function(e){this._meshes.indexOf(e)>=0||(o.forEach((function(t){e.on(t,this[s(t)],this)}),this),this._meshes.push(e))},detachFromMesh:function(e){var t=this._meshes.indexOf(e);t>=0&&this._meshes.splice(t,1),o.forEach((function(t){e.off(t,this[s(t)])}),this)},dispose:function(){this._meshes.forEach((function(e){this.detachFromMesh(e)}),this)}},t.a=m},function(e,t,i){var n=i(24),r=i(77),a=n.a.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=r.a.generateNormalDistribution(),this._brdfLookup=r.a.integrateBRDF(e,this._normalDistribution));var i=this.cubemap;if(!i.__prefiltered){var n=r.a.prefilterEnvironmentMap(e,i,{encodeRGBM:!0,width:t,height:t},this._normalDistribution,this._brdfLookup);this.cubemap=n.environmentMap,this.cubemap.__prefiltered=!0,i.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,i=e.intensity;return[t[0]*i,t[1]*i,t[2]*i]}},ambientCubemapLightCubemap:{type:"t",value:function(e){return e.cubemap}},ambientCubemapLightBRDFLookup:{type:"t",value:function(e){return e._brdfLookup}}}});t.a=a},function(e,t,i){t.a="\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"},function(e,t,i){t.a="#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"},function(e,t,i){t.a="#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"},function(e,t,i){var n=i(24),r=i(14),a=n.a.extend({castShadow:!1,coefficients:[]},(function(){this._coefficientsTmpArr=new r.a.Float32Array(27)}),{type:"AMBIENT_SH_LIGHT",uniformTemplates:{ambientSHLightColor:{type:"3f",value:function(e){var t=e.color,i=e.intensity;return[t[0]*i,t[1]*i,t[2]*i]}},ambientSHLightCoefficients:{type:"3f",value:function(e){for(var t=e._coefficientsTmpArr,i=0;i<e.coefficients.length;i++)t[i]=e.coefficients[i];return t}}}});t.a=a},function(e,t,i){var n=i(4),r=i(10),a=i(5);i(16);var o=i(14),s=i(42),l=i(75),u=i(62),h=i(36),c=i(12);i(131);var d={},f=["px","nx","py","ny","pz","nz"];function p(e,t){var i=e[0],n=e[1],r=e[2];return 0===t?1:1===t?i:2===t?n:3===t?r:4===t?i*r:5===t?n*r:6===t?i*n:7===t?3*r*r-1:i*i-n*n}var g={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]};d.projectEnvironmentMap=function(e,t,i){var d;(i=i||{}).lod=i.lod||0;var m=new h.a,v=64;"texture2D"===t.textureType?d=new l.a({scene:m,environmentMap:t}):(v=t.image&&t.image.px?t.image.px.width:t.width,d=new s.a({scene:m,environmentMap:t}));var y=Math.ceil(v/Math.pow(2,i.lod)),_=Math.ceil(v/Math.pow(2,i.lod)),x=new a.a({width:y,height:_}),b=new r.a;d.material.define("fragment","RGBM_ENCODE"),i.decodeRGBM&&d.material.define("fragment","RGBM_DECODE"),d.material.set("lod",i.lod);for(var w=new u.a({texture:x}),T={},S=0;S<f.length;S++){T[f[S]]=new Uint8Array(y*_*4);var M=w.getCamera(f[S]);M.fov=90,b.attach(x),b.bind(e),e.render(m,M),e.gl.readPixels(0,0,y,_,n.a.RGBA,n.a.UNSIGNED_BYTE,T[f[S]]),b.unbind(e)}return d.dispose(e),b.dispose(e),x.dispose(e),function(e,t,i,n){for(var r=new o.a.Float32Array(27),a=c.a.create(),s=c.a.create(),l=c.a.create(),u=0;u<9;u++){for(var h=c.a.create(),d=0;d<f.length;d++){for(var m=t[f[d]],v=c.a.create(),y=0,_=0,x=g[f[d]],b=0;b<n;b++)for(var w=0;w<i;w++){a[0]=w/(i-1)*2-1,a[1]=b/(n-1)*2-1,a[2]=-1,c.a.normalize(a,a),l[0]=a[x[0]]*x[3],l[1]=a[x[1]]*x[4],l[2]=a[x[2]]*x[5],s[0]=m[_++]/255,s[1]=m[_++]/255,s[2]=m[_++]/255;var T=m[_++]/255*8.12;s[0]*=T,s[1]*=T,s[2]*=T,c.a.scaleAndAdd(v,v,s,p(l,u)*-a[2]),y+=-a[2]}c.a.scaleAndAdd(h,h,v,1/y)}r[3*u]=h[0]/6,r[3*u+1]=h[1]/6,r[3*u+2]=h[2]/6}return r}(0,T,y,_)},t.a=d},function(e,t,i){t.a="uniform samplerCube environmentMap;\nvarying vec2 v_Texcoord;\n#define TEXTURE_SIZE 16\nmat3 front = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n);\nmat3 back = mat3(\n -1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, -1.0\n);\nmat3 left = mat3(\n 0.0, 0.0, -1.0,\n 0.0, 1.0, 0.0,\n 1.0, 0.0, 0.0\n);\nmat3 right = mat3(\n 0.0, 0.0, 1.0,\n 0.0, 1.0, 0.0,\n -1.0, 0.0, 0.0\n);\nmat3 up = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0,\n 0.0, -1.0, 0.0\n);\nmat3 down = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 0.0, -1.0,\n 0.0, 1.0, 0.0\n);\nfloat harmonics(vec3 normal){\n int index = int(gl_FragCoord.x);\n float x = normal.x;\n float y = normal.y;\n float z = normal.z;\n if(index==0){\n return 1.0;\n }\n else if(index==1){\n return x;\n }\n else if(index==2){\n return y;\n }\n else if(index==3){\n return z;\n }\n else if(index==4){\n return x*z;\n }\n else if(index==5){\n return y*z;\n }\n else if(index==6){\n return x*y;\n }\n else if(index==7){\n return 3.0*z*z - 1.0;\n }\n else{\n return x*x - y*y;\n }\n}\nvec3 sampleSide(mat3 rot)\n{\n vec3 result = vec3(0.0);\n float divider = 0.0;\n for (int i = 0; i < TEXTURE_SIZE * TEXTURE_SIZE; i++) {\n float x = mod(float(i), float(TEXTURE_SIZE));\n float y = float(i / TEXTURE_SIZE);\n vec2 sidecoord = ((vec2(x, y) + vec2(0.5, 0.5)) / vec2(TEXTURE_SIZE)) * 2.0 - 1.0;\n vec3 normal = normalize(vec3(sidecoord, -1.0));\n vec3 fetchNormal = rot * normal;\n vec3 texel = textureCube(environmentMap, fetchNormal).rgb;\n result += harmonics(fetchNormal) * texel * -normal.z;\n divider += -normal.z;\n }\n return result / divider;\n}\nvoid main()\n{\n vec3 result = (\n sampleSide(front) +\n sampleSide(back) +\n sampleSide(left) +\n sampleSide(right) +\n sampleSide(up) +\n sampleSide(down)\n ) / 6.0;\n gl_FragColor = vec4(result, 1.0);\n}"},function(e,t,i){var n=i(15),r=i(18),a=n.a.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,i=this.attributes.position,n=this.attributes.texcoord0,a=this.attributes.normal,o=(t+1)*(e+1);i.init(o),n.init(o),a.init(o);var s,l,u,h,c,d,f,p,g,m,v,y=o>65535?Uint32Array:Uint16Array,_=this.indices=new y(t*e*6),x=this.radius,b=this.phiStart,w=this.phiLength,T=this.thetaStart,S=this.thetaLength,M=[],A=[],I=0,C=1/(x=this.radius);for(f=0;f<=e;f++)for(d=0;d<=t;d++)h=d/t,c=f/e,s=-x*Math.cos(b+h*w)*Math.sin(T+c*S),l=x*Math.cos(T+c*S),u=x*Math.sin(b+h*w)*Math.sin(T+c*S),M[0]=s,M[1]=l,M[2]=u,A[0]=h,A[1]=c,i.set(I,M),n.set(I,A),M[0]*=C,M[1]*=C,M[2]*=C,a.set(I,M),I++;var D=t+1,E=0;for(f=0;f<e;f++)for(d=0;d<t;d++)g=f*D+d,p=f*D+d+1,v=(f+1)*D+d+1,m=(f+1)*D+d,_[E++]=p,_[E++]=g,_[E++]=v,_[E++]=g,_[E++]=m,_[E++]=v;this.boundingBox=new r.a,this.boundingBox.max.set(x,x,x),this.boundingBox.min.set(-x,-x,-x)}});t.a=a},function(e,t,i){var n=i(24).a.extend({castShadow:!1},{type:"AMBIENT_LIGHT",uniformTemplates:{ambientLightColor:{type:"3f",value:function(e){var t=e.color,i=e.intensity;return[t[0]*i,t[1]*i,t[2]*i]}}}});t.a=n},function(e,t,i){var n=i(24),r=i(3),a=n.a.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 r.a,e.__dir.copy(e.worldTransform.z).normalize().negate().array}},directionalLightColor:{type:"3f",value:function(e){var t=e.color,i=e.intensity;return[t[0]*i,t[1]*i,t[2]*i]}}},clone:function(){var e=n.a.prototype.clone.call(this);return e.shadowBias=this.shadowBias,e.shadowSlopeScale=this.shadowSlopeScale,e}});t.a=a},function(e,t,i){var n=i(24),r=n.a.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,i=e.intensity;return[t[0]*i,t[1]*i,t[2]*i]}}},clone:function(){var e=n.a.prototype.clone.call(this);return e.range=this.range,e}});t.a=r},function(e,t,i){var n=i(24),r=i(3),a=n.a.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 r.a,e.__dir.copy(e.worldTransform.z).negate().array}},spotLightColor:{type:"3f",value:function(e){var t=e.color,i=e.intensity;return[t[0]*i,t[1]*i,t[2]*i]}}},clone:function(){var e=n.a.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}});t.a=a},function(e,t,i){var n=i(33),r=function(e,t,i,r){e=e||0,t=t||0,i=i||0,r=r||0,this.array=n.a.fromValues(e,t,i,r),this._dirty=!0};r.prototype={constructor:r,add:function(e){return n.a.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t,i,n){return this.array[0]=e,this.array[1]=t,this.array[2]=i,this.array[3]=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.array[3]=e[3],this._dirty=!0,this},clone:function(){return new r(this.x,this.y,this.z,this.w)},copy:function(e){return n.a.copy(this.array,e.array),this._dirty=!0,this},dist:function(e){return n.a.dist(this.array,e.array)},distance:function(e){return n.a.distance(this.array,e.array)},div:function(e){return n.a.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return n.a.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return n.a.dot(this.array,e.array)},len:function(){return n.a.len(this.array)},length:function(){return n.a.length(this.array)},lerp:function(e,t,i){return n.a.lerp(this.array,e.array,t.array,i),this._dirty=!0,this},min:function(e){return n.a.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return n.a.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return n.a.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return n.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return n.a.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return n.a.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return n.a.random(this.array,e),this._dirty=!0,this},scale:function(e){return n.a.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return n.a.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return n.a.sqrDist(this.array,e.array)},squaredDistance:function(e){return n.a.squaredDistance(this.array,e.array)},sqrLen:function(){return n.a.sqrLen(this.array)},squaredLength:function(){return n.a.squaredLength(this.array)},sub:function(e){return n.a.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return n.a.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return n.a.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},transformQuat:function(e){return n.a.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 a=Object.defineProperty;if(a){var o=r.prototype;a(o,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),a(o,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),a(o,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}}),a(o,"w",{get:function(){return this.array[3]},set:function(e){this.array[3]=e,this._dirty=!0}})}r.add=function(e,t,i){return n.a.add(e.array,t.array,i.array),e._dirty=!0,e},r.set=function(e,t,i,r,a){n.a.set(e.array,t,i,r,a),e._dirty=!0},r.copy=function(e,t){return n.a.copy(e.array,t.array),e._dirty=!0,e},r.distance=r.dist=function(e,t){return n.a.distance(e.array,t.array)},r.divide=r.div=function(e,t,i){return n.a.divide(e.array,t.array,i.array),e._dirty=!0,e},r.dot=function(e,t){return n.a.dot(e.array,t.array)},r.len=function(e){return n.a.length(e.array)},r.lerp=function(e,t,i,r){return n.a.lerp(e.array,t.array,i.array,r),e._dirty=!0,e},r.min=function(e,t,i){return n.a.min(e.array,t.array,i.array),e._dirty=!0,e},r.max=function(e,t,i){return n.a.max(e.array,t.array,i.array),e._dirty=!0,e},r.multiply=r.mul=function(e,t,i){return n.a.multiply(e.array,t.array,i.array),e._dirty=!0,e},r.negate=function(e,t){return n.a.negate(e.array,t.array),e._dirty=!0,e},r.normalize=function(e,t){return n.a.normalize(e.array,t.array),e._dirty=!0,e},r.random=function(e,t){return n.a.random(e.array,t),e._dirty=!0,e},r.scale=function(e,t,i){return n.a.scale(e.array,t.array,i),e._dirty=!0,e},r.scaleAndAdd=function(e,t,i,r){return n.a.scaleAndAdd(e.array,t.array,i.array,r),e._dirty=!0,e},r.squaredDistance=r.sqrDist=function(e,t){return n.a.sqrDist(e.array,t.array)},r.squaredLength=r.sqrLen=function(e){return n.a.sqrLen(e.array)},r.subtract=r.sub=function(e,t,i){return n.a.subtract(e.array,t.array,i.array),e._dirty=!0,e},r.transformMat4=function(e,t,i){return n.a.transformMat4(e.array,t.array,i.array),e._dirty=!0,e},r.transformQuat=function(e,t,i){return n.a.transformQuat(e.array,t.array,i.array),e._dirty=!0,e},t.a=r},function(e,t,i){var n=i(78),r=function(){this.array=n.a.create(),this._dirty=!0};r.prototype={constructor:r,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 r).copy(this)},copy:function(e){return n.a.copy(this.array,e.array),this._dirty=!0,this},adjoint:function(){return n.a.adjoint(this.array,this.array),this._dirty=!0,this},determinant:function(){return n.a.determinant(this.array)},identity:function(){return n.a.identity(this.array),this._dirty=!0,this},invert:function(){return n.a.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return n.a.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return n.a.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return n.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return n.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return n.a.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return n.a.scale(this.array,this.array,e.array),this._dirty=!0,this},transpose:function(){return n.a.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)}},r.adjoint=function(e,t){return n.a.adjoint(e.array,t.array),e._dirty=!0,e},r.copy=function(e,t){return n.a.copy(e.array,t.array),e._dirty=!0,e},r.determinant=function(e){return n.a.determinant(e.array)},r.identity=function(e){return n.a.identity(e.array),e._dirty=!0,e},r.invert=function(e,t){return n.a.invert(e.array,t.array),e._dirty=!0,e},r.multiply=r.mul=function(e,t,i){return n.a.mul(e.array,t.array,i.array),e._dirty=!0,e},r.rotate=function(e,t,i){return n.a.rotate(e.array,t.array,i),e._dirty=!0,e},r.scale=function(e,t,i){return n.a.scale(e.array,t.array,i.array),e._dirty=!0,e},r.transpose=function(e,t){return n.a.transpose(e.array,t.array),e._dirty=!0,e},t.a=r},function(e,t,i){var n=i(79),r=function(){this.array=n.a.create(),this._dirty=!0};r.prototype={constructor:r,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 r).copy(this)},copy:function(e){return n.a.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return n.a.determinant(this.array)},identity:function(){return n.a.identity(this.array),this._dirty=!0,this},invert:function(){return n.a.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return n.a.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return n.a.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return n.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return n.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return n.a.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return n.a.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return n.a.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)}},r.copy=function(e,t){return n.a.copy(e.array,t.array),e._dirty=!0,e},r.determinant=function(e){return n.a.determinant(e.array)},r.identity=function(e){return n.a.identity(e.array),e._dirty=!0,e},r.invert=function(e,t){return n.a.invert(e.array,t.array),e._dirty=!0,e},r.multiply=r.mul=function(e,t,i){return n.a.mul(e.array,t.array,i.array),e._dirty=!0,e},r.rotate=function(e,t,i){return n.a.rotate(e.array,t.array,i),e._dirty=!0,e},r.scale=function(e,t,i){return n.a.scale(e.array,t.array,i.array),e._dirty=!0,e},r.translate=function(e,t,i){return n.a.translate(e.array,t.array,i.array),e._dirty=!0,e},t.a=r},function(e,t,i){var n=i(34),r=function(){this.array=n.a.create(),this._dirty=!0};r.prototype={constructor:r,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 n.a.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new r).copy(this)},copy:function(e){return n.a.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return n.a.determinant(this.array)},fromMat2d:function(e){return n.a.fromMat2d(this.array,e.array),this._dirty=!0,this},fromMat4:function(e){return n.a.fromMat4(this.array,e.array),this._dirty=!0,this},fromQuat:function(e){return n.a.fromQuat(this.array,e.array),this._dirty=!0,this},identity:function(){return n.a.identity(this.array),this._dirty=!0,this},invert:function(){return n.a.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return n.a.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return n.a.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return n.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return n.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return n.a.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return n.a.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return n.a.translate(this.array,this.array,e.array),this._dirty=!0,this},normalFromMat4:function(e){return n.a.normalFromMat4(this.array,e.array),this._dirty=!0,this},transpose:function(){return n.a.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)}},r.adjoint=function(e,t){return n.a.adjoint(e.array,t.array),e._dirty=!0,e},r.copy=function(e,t){return n.a.copy(e.array,t.array),e._dirty=!0,e},r.determinant=function(e){return n.a.determinant(e.array)},r.identity=function(e){return n.a.identity(e.array),e._dirty=!0,e},r.invert=function(e,t){return n.a.invert(e.array,t.array),e},r.multiply=r.mul=function(e,t,i){return n.a.mul(e.array,t.array,i.array),e._dirty=!0,e},r.fromMat2d=function(e,t){return n.a.fromMat2d(e.array,t.array),e._dirty=!0,e},r.fromMat4=function(e,t){return n.a.fromMat4(e.array,t.array),e._dirty=!0,e},r.fromQuat=function(e,t){return n.a.fromQuat(e.array,t.array),e._dirty=!0,e},r.normalFromMat4=function(e,t){return n.a.normalFromMat4(e.array,t.array),e._dirty=!0,e},r.rotate=function(e,t,i){return n.a.rotate(e.array,t.array,i),e._dirty=!0,e},r.scale=function(e,t,i){return n.a.scale(e.array,t.array,i.array),e._dirty=!0,e},r.transpose=function(e,t){return n.a.transpose(e.array,t.array),e._dirty=!0,e},r.translate=function(e,t,i){return n.a.translate(e.array,t.array,i.array),e._dirty=!0,e},t.a=r},function(e,t,i){var n=i(142),r=i.n(n),a={_animators:null,getAnimators:function(){return this._animators=this._animators||[],this._animators},animate:function(e,t){var i;if(this._animators=this._animators||[],e){for(var n=e.split("."),a=this,o=0,s=n.length;o<s;o++)a&&(a=a[n[o]]);a&&(i=a)}else i=this;if(null==i)throw new Error("Target "+e+" not exists");var l=this._animators,u=new r.a(i,t),h=this;return u.during((function(){h.__zr&&h.__zr.refresh()})).done((function(){var e=l.indexOf(u);e>=0&&l.splice(e,1)})),l.push(u),this.__zr&&this.__zr.animation.addAnimator(u),u},stopAnimation:function(e){this._animators=this._animators||[];for(var t=this._animators,i=t.length,n=0;n<i;n++)t[n].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])}};t.a=a},function(e,t,i){var n=i(143),r=i(145),a=i(13).isArrayLike,o=Array.prototype.slice;function s(e,t){return e[t]}function l(e,t,i){e[t]=i}function u(e,t,i){return(t-e)*i+e}function h(e,t,i){return i>.5?t:e}function c(e,t,i,n,r){var a=e.length;if(1==r)for(var o=0;o<a;o++)n[o]=u(e[o],t[o],i);else{var s=a&&e[0].length;for(o=0;o<a;o++)for(var l=0;l<s;l++)n[o][l]=u(e[o][l],t[o][l],i)}}function d(e,t,i){var n=e.length,r=t.length;if(n!==r)if(n>r)e.length=r;else for(var a=n;a<r;a++)e.push(1===i?t[a]:o.call(t[a]));var s=e[0]&&e[0].length;for(a=0;a<e.length;a++)if(1===i)isNaN(e[a])&&(e[a]=t[a]);else for(var l=0;l<s;l++)isNaN(e[a][l])&&(e[a][l]=t[a][l])}function f(e,t,i){if(e===t)return!0;var n=e.length;if(n!==t.length)return!1;if(1===i){for(var r=0;r<n;r++)if(e[r]!==t[r])return!1}else{var a=e[0].length;for(r=0;r<n;r++)for(var o=0;o<a;o++)if(e[r][o]!==t[r][o])return!1}return!0}function p(e,t,i,n,r,a,o,s,l){var u=e.length;if(1==l)for(var h=0;h<u;h++)s[h]=g(e[h],t[h],i[h],n[h],r,a,o);else{var c=e[0].length;for(h=0;h<u;h++)for(var d=0;d<c;d++)s[h][d]=g(e[h][d],t[h][d],i[h][d],n[h][d],r,a,o)}}function g(e,t,i,n,r,a,o){var s=.5*(i-e),l=.5*(n-t);return(2*(t-i)+s+l)*o+(-3*(t-i)-2*s-l)*a+s*r+t}function m(e){if(a(e)){var t=e.length;if(a(e[0])){for(var i=[],n=0;n<t;n++)i.push(o.call(e[n]));return i}return o.call(e)}return e}function v(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}function y(e,t,i,o,s,l){var m=e._getter,y=e._setter,_="spline"===t,x=o.length;if(x){var b,w=o[0].value,T=a(w),S=!1,M=!1,A=T?function(e){var t=e[e.length-1].value;return a(t&&t[0])?2:1}(o):0;o.sort((function(e,t){return e.time-t.time})),b=o[x-1].time;for(var I=[],C=[],D=o[0].value,E=!0,L=0;L<x;L++){I.push(o[L].time/b);var P=o[L].value;if(T&&f(P,D,A)||!T&&P===D||(E=!1),D=P,"string"==typeof P){var N=r.parse(P);N?(P=N,S=!0):M=!0}C.push(P)}if(l||!E){var R=C[x-1];for(L=0;L<x-1;L++)T?d(C[L],R,A):!isNaN(C[L])||isNaN(R)||M||S||(C[L]=R);T&&d(m(e._target,s),R,A);var O,k,z,B,F,V=0,G=0;if(S)var H=[0,0,0,0];var U=new n({target:e._target,life:b,loop:e._loop,delay:e._delay,onframe:function(e,t){var i;if(t<0)i=0;else if(t<G){for(i=Math.min(V+1,x-1);i>=0&&!(I[i]<=t);i--);i=Math.min(i,x-2)}else{for(i=V;i<x&&!(I[i]>t);i++);i=Math.min(i-1,x-2)}V=i,G=t;var n=I[i+1]-I[i];if(0!==n)if(O=(t-I[i])/n,_)if(z=C[i],k=C[0===i?i:i-1],B=C[i>x-2?x-1:i+1],F=C[i>x-3?x-1:i+2],T)p(k,z,B,F,O,O*O,O*O*O,m(e,s),A);else{if(S)r=p(k,z,B,F,O,O*O,O*O*O,H,1),r=v(H);else{if(M)return h(z,B,O);r=g(k,z,B,F,O,O*O,O*O*O)}y(e,s,r)}else if(T)c(C[i],C[i+1],O,m(e,s),A);else{var r;if(S)c(C[i],C[i+1],O,H,1),r=v(H);else{if(M)return h(C[i],C[i+1],O);r=u(C[i],C[i+1],O)}y(e,s,r)}},ondestroy:i});return t&&"spline"!==t&&(U.easing=t),U}}}var _=function(e,t,i,n){this._tracks={},this._target=e,this._loop=t||!1,this._getter=i||s,this._setter=n||l,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};_.prototype={when:function(e,t){var i=this._tracks;for(var n in t)if(t.hasOwnProperty(n)){if(!i[n]){i[n]=[];var r=this._getter(this._target,n);if(null==r)continue;0!==e&&i[n].push({time:0,value:m(r)})}i[n].push({time:e,value:t[n]})}return this},during:function(e){return this._onframeList.push(e),this},pause:function(){for(var e=0;e<this._clipList.length;e++)this._clipList[e].pause();this._paused=!0},resume:function(){for(var e=0;e<this._clipList.length;e++)this._clipList[e].resume();this._paused=!1},isPaused:function(){return!!this._paused},_doneCallback:function(){this._tracks={},this._clipList.length=0;for(var e=this._doneList,t=e.length,i=0;i<t;i++)e[i].call(this)},start:function(e,t){var i,n=this,r=0,a=function(){--r||n._doneCallback()};for(var o in this._tracks)if(this._tracks.hasOwnProperty(o)){var s=y(this,e,a,this._tracks[o],o,t);s&&(this._clipList.push(s),r++,this.animation&&this.animation.addClip(s),i=s)}if(i){var l=i.onframe;i.onframe=function(e,t){l(e,t);for(var i=0;i<n._onframeList.length;i++)n._onframeList[i](e,t)}}return r||this._doneCallback(),this},stop:function(e){for(var t=this._clipList,i=this.animation,n=0;n<t.length;n++){var r=t[n];e&&r.onframe(this._target,1),i&&i.removeClip(r)}t.length=0},delay:function(e){return this._delay=e,this},done:function(e){return e&&this._doneList.push(e),this},getClips:function(){return this._clipList}};var x=_;e.exports=x},function(e,t,i){var n=i(144);function r(e){this._target=e.target,this._life=e.life||1e3,this._delay=e.delay||0,this._initialized=!1,this.loop=null!=e.loop&&e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart,this._pausedTime=0,this._paused=!1}r.prototype={constructor:r,step:function(e,t){if(this._initialized||(this._startTime=e+this._delay,this._initialized=!0),this._paused)this._pausedTime+=t;else{var i=(e-this._startTime-this._pausedTime)/this._life;if(!(i<0)){i=Math.min(i,1);var r=this.easing,a="string"==typeof r?n[r]:r,o="function"==typeof a?a(i):i;return this.fire("frame",o),1==i?this.loop?(this.restart(e),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(e){var t=(e-this._startTime-this._pausedTime)%this._life;this._startTime=e-t+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(e,t){this[e="on"+e]&&this[e](this._target,t)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var a=r;e.exports=a},function(e,t){var i={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,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,i=.1,n=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=n*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.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-i.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*i.bounceIn(2*e):.5*i.bounceOut(2*e-1)+.5}},n=i;e.exports=n},function(e,t,i){var n=i(60),r={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 a(e){return(e=Math.round(e))<0?0:e>255?255:e}function o(e){return e<0?0:e>1?1:e}function s(e){return e.length&&"%"===e.charAt(e.length-1)?a(parseFloat(e)/100*255):a(parseInt(e,10))}function l(e){return e.length&&"%"===e.charAt(e.length-1)?o(parseFloat(e)/100):o(parseFloat(e))}function u(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function h(e,t,i){return e+(t-e)*i}function c(e,t,i,n,r){return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e}function d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var f=new n(20),p=null;function g(e,t){p&&d(p,t),p=f.put(e,p||t.slice())}function m(e,t){if(e){t=t||[];var i=f.get(e);if(i)return d(t,i);var n,a=(e+="").replace(/ /g,"").toLowerCase();if(a in r)return d(t,r[a]),g(e,t),t;if("#"===a.charAt(0))return 4===a.length?(n=parseInt(a.substr(1),16))>=0&&n<=4095?(c(t,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),g(e,t),t):void c(t,0,0,0,1):7===a.length?(n=parseInt(a.substr(1),16))>=0&&n<=16777215?(c(t,(16711680&n)>>16,(65280&n)>>8,255&n,1),g(e,t),t):void c(t,0,0,0,1):void 0;var o=a.indexOf("("),u=a.indexOf(")");if(-1!==o&&u+1===a.length){var h=a.substr(0,o),p=a.substr(o+1,u-(o+1)).split(","),m=1;switch(h){case"rgba":if(4!==p.length)return void c(t,0,0,0,1);m=l(p.pop());case"rgb":return 3!==p.length?void c(t,0,0,0,1):(c(t,s(p[0]),s(p[1]),s(p[2]),m),g(e,t),t);case"hsla":return 4!==p.length?void c(t,0,0,0,1):(p[3]=l(p[3]),v(p,t),g(e,t),t);case"hsl":return 3!==p.length?void c(t,0,0,0,1):(v(p,t),g(e,t),t);default:return}}c(t,0,0,0,1)}}function v(e,t){var i=(parseFloat(e[0])%360+360)%360/360,n=l(e[1]),r=l(e[2]),o=r<=.5?r*(n+1):r+n-r*n,s=2*r-o;return c(t=t||[],a(255*u(s,o,i+1/3)),a(255*u(s,o,i)),a(255*u(s,o,i-1/3)),1),4===e.length&&(t[3]=e[3]),t}function y(e,t,i){if(t&&t.length&&e>=0&&e<=1){i=i||[];var n=e*(t.length-1),r=Math.floor(n),s=Math.ceil(n),l=t[r],u=t[s],c=n-r;return i[0]=a(h(l[0],u[0],c)),i[1]=a(h(l[1],u[1],c)),i[2]=a(h(l[2],u[2],c)),i[3]=o(h(l[3],u[3],c)),i}}var _=y;function x(e,t,i){if(t&&t.length&&e>=0&&e<=1){var n=e*(t.length-1),r=Math.floor(n),s=Math.ceil(n),l=m(t[r]),u=m(t[s]),c=n-r,d=w([a(h(l[0],u[0],c)),a(h(l[1],u[1],c)),a(h(l[2],u[2],c)),o(h(l[3],u[3],c))],"rgba");return i?{color:d,leftIndex:r,rightIndex:s,value:n}:d}}var b=x;function w(e,t){if(e&&e.length){var i=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(i+=","+e[3]),t+"("+i+")"}}t.parse=m,t.lift=function(e,t){var i=m(e);if(i){for(var n=0;n<3;n++)i[n]=t<0?i[n]*(1-t)|0:(255-i[n])*t+i[n]|0,i[n]>255?i[n]=255:e[n]<0&&(i[n]=0);return w(i,4===i.length?"rgba":"rgb")}},t.toHex=function(e){var t=m(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},t.fastLerp=y,t.fastMapToColor=_,t.lerp=x,t.mapToColor=b,t.modifyHSL=function(e,t,i,n){if(e=m(e))return e=function(e){if(e){var t,i,n=e[0]/255,r=e[1]/255,a=e[2]/255,o=Math.min(n,r,a),s=Math.max(n,r,a),l=s-o,u=(s+o)/2;if(0===l)t=0,i=0;else{i=u<.5?l/(s+o):l/(2-s-o);var h=((s-n)/6+l/2)/l,c=((s-r)/6+l/2)/l,d=((s-a)/6+l/2)/l;n===s?t=d-c:r===s?t=1/3+h-d:a===s&&(t=2/3+c-h),t<0&&(t+=1),t>1&&(t-=1)}var f=[360*t,i,u];return null!=e[3]&&f.push(e[3]),f}}(e),null!=t&&(e[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=i&&(e[1]=l(i)),null!=n&&(e[2]=l(n)),w(v(e),"rgba")},t.modifyAlpha=function(e,t){if((e=m(e))&&null!=t)return e[3]=o(t),w(e,"rgba")},t.stringify=w},function(e,t,i){t.a="\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.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(e,t,i){t.a="\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"},function(e,t,i){t.a="@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\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 @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 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 @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n\n}\n@end"},function(e,t,i){t.a="/**\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 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 @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"},function(e,t,i){t.a="@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 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 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"},function(e,t,i){t.a="@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"},function(e,t,i){t.a="@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"},function(e,t,i){var n=i(0),r=i.n(n),a=["bar3D","line3D","map3D","scatter3D","surface","lines3D","scatterGL","scatter3D"];function o(e,t){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var i=e[t].normal,n=e[t].emphasis;i&&(e[t]=i),n&&(e.emphasis=e.emphasis||{},e.emphasis[t]=n)}}function s(e){e&&(e instanceof Array||(e=[e]),r.a.util.each(e,(function(e){if(e.axisLabel){var t=e.axisLabel;r.a.util.extend(t,t.textStyle),t.textStyle=null}})))}t.a=function(e){r.a.util.each(e.series,(function(t){r.a.util.indexOf(a,t.type)>=0&&(function(e){o(e,"itemStyle"),o(e,"lineStyle"),o(e,"areaStyle"),o(e,"label")}(t),"mapbox"===t.coordinateSystem&&(t.coordinateSystem="mapbox3D",e.mapbox3D=e.mapbox))})),s(e.xAxis3D),s(e.yAxis3D),s(e.zAxis3D),s(e.grid3D),o(e.geo3D)}},function(e,t,i){i(155),i(159),i(160),i(167);var n=i(0),r=i.n(n);r.a.registerAction({type:"grid3DChangeCamera",event:"grid3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"grid3D",query:e},(function(t){t.setView(e)}))})),r.a.registerAction({type:"grid3DShowAxisPointer",event:"grid3dshowaxispointer",update:"grid3D:showAxisPointer"},(function(e,t){})),r.a.registerAction({type:"grid3DHideAxisPointer",event:"grid3dhideaxispointer",update:"grid3D:hideAxisPointer"},(function(e,t){}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(156),o=r.a.extendComponentModel({type:"cartesian3DAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid3D",index:this.option.gridIndex,id:this.option.gridId})[0]}});function s(e,t){return t.type||(t.data?"category":"value")}r.a.helper.mixinAxisModelCommonMethods(o),Object(a.a)("x",o,s,{name:"X"}),Object(a.a)("y",o,s,{name:"Y"}),Object(a.a)("z",o,s,{name:"Z"})},function(e,t,i){var n=i(0),r=i.n(n),a=i(157),o=i(158),s=i.n(o),l=["value","category","time","log"];t.a=function(e,t,i,n){r.a.util.each(l,(function(o){t.extend({type:e+"Axis3D."+o,__ordinalMeta:null,mergeDefaultAndTheme:function(t,n){var a=n.getTheme();r.a.util.merge(t,a.get(o+"Axis3D")),r.a.util.merge(t,this.getDefaultOption()),t.type=i(e,t)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=s.a.createByAxisModel(this))},getCategories:function(){if("category"===this.option.type)return this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:r.a.util.merge(r.a.util.clone(a.a[o+"Axis3D"]),n||{},!0)})})),t.superClass.registerSubTypeDefaulter(e+"Axis3D",r.a.util.curry(i,e))}},function(e,t,i){var n=i(0),r=i.n(n),a={show:!0,grid3DIndex:0,inverse:!1,name:"",nameLocation:"middle",nameTextStyle:{fontSize:16},nameGap:20,axisPointer:{},axisLine:{},axisTick:{},axisLabel:{},splitArea:{}},o=r.a.util.merge({boundaryGap:!0,axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"},axisPointer:{label:{show:!1}}},a),s=r.a.util.merge({boundaryGap:[0,0],splitNumber:5,axisPointer:{label:{}}},a),l=r.a.util.defaults({scale:!0,min:"dataMin",max:"dataMax"},s),u=r.a.util.defaults({logBase:10},s);u.scale=!0,t.a={categoryAxis3D:o,valueAxis3D:s,timeAxis3D:l,logAxis3D:u}},function(e,t,i){var n=i(13),r=n.createHashMap,a=n.isObject,o=n.map;function s(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this._map}s.createByAxisModel=function(e){var t=e.option,i=t.data,n=i&&o(i,h);return new s({categories:n,needCollect:!n,deduplication:!1!==t.dedplication})};var l=s.prototype;function u(e){return e._map||(e._map=r(e.categories))}function h(e){return a(e)&&null!=e.value?e.value:e+""}l.getOrdinal=function(e){return u(this).get(e)},l.parseAndCollect=function(e){var t,i=this._needCollect;if("string"!=typeof e&&!i)return e;if(i&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var n=u(this);return null==(t=n.get(e))&&(i?(t=this.categories.length,this.categories[t]=e,n.set(e,t)):t=NaN),t};var c=s;e.exports=c},function(e,t,i){var n=i(0),r=i.n(n),a=i(44),o=i(28),s=i(29),l=r.a.extendComponentModel({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.a.util.merge(l.prototype,a.a),r.a.util.merge(l.prototype,o.a),r.a.util.merge(l.prototype,s.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(45),s=i(25),l=i(2),u=i(81),h=i(30),c=i(162),d=i(164),f=i(63),p=i(46),g=l.a.firstNotNull;a.a.Shader.import(p.a),["x","y","z"].forEach((function(e){r.a.extendComponentView({type:e+"Axis3D"})}));var m={x:0,y:2,z:1};r.a.extendComponentView({type:"grid3D",__ecgl__:!0,init:function(e,t){var i=new a.a.Material({shader:a.a.createShader("ecgl.color"),depthMask:!1,transparent:!0}),n=new a.a.Material({shader:a.a.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});i.define("fragment","DOUBLE_SIDED"),i.define("both","VERTEX_COLOR"),this.groupGL=new a.a.Node,this._control=new o.a({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 c.a(e,n,i);return this.groupGL.add(t.rootNode),t}),this),this._axes=["x","y","z"].map((function(e){var t=new d.a(e,n);return this.groupGL.add(t.rootNode),t}),this);var r=t.getDevicePixelRatio();this._axisLabelSurface=new u.a({width:256,height:256,devicePixelRatio:r}),this._axisLabelSurface.onupdate=function(){t.getZr().refresh()},this._axisPointerLineMesh=new a.a.Mesh({geometry:new s.a({useNativeLine:!1}),material:n,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new u.a({width:128,height:128,devicePixelRatio:r}),this._axisPointerLabelsMesh=new f.a({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new a.a.Node,this._sceneHelper=new h.a,this._sceneHelper.initLight(this._lightRoot)},render:function(e,t,i){this._model=e,this._api=i;var n=e.coordinateSystem;n.viewGL.add(this._lightRoot),e.get("show")?n.viewGL.add(this.groupGL):n.viewGL.remove(this.groupGL);var r=this._control;r.setViewGL(n.viewGL);var a=e.getModel("viewControl");r.setFromViewControlModel(a,0),this._axisLabelSurface.clear(),r.off("update"),e.get("show")&&(this._faces.forEach((function(n){n.update(e,t,i)}),this),this._axes.forEach((function(t){t.update(e,this._axisLabelSurface,i)}),this)),r.on("update",this._onCameraChange.bind(this,e,i),this),this._sceneHelper.setScene(n.viewGL.scene),this._sceneHelper.updateLight(e),n.viewGL.setPostEffect(e.getModel("postEffect"),i),n.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._initMouseHandler(e)},afterRender:function(e,t,i,n){var r=n.renderer;this._sceneHelper.updateAmbientCubemap(r,e,i),this._sceneHelper.updateSkybox(r,e,i)},showAxisPointer:function(e,t,i,n){this._doShowAxisPointer(),this._updateAxisPointer(n.value)},hideAxisPointer:function(e,t,i,n){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,i=this._model.coordinateSystem,n=i.viewGL,r=n.castRay(e.offsetX,e.offsetY,new a.a.Ray),o=0;o<this._faces.length;o++){var s=this._faces[o];if(!s.rootNode.invisible){s.plane.normal.dot(n.camera.worldTransform.z)<0&&s.plane.normal.negate();var l=r.intersectPlane(s.plane);if(l){var u=i.getAxis(s.faceInfo[0]),h=i.getAxis(s.faceInfo[1]),c=m[s.faceInfo[0]],d=m[s.faceInfo[1]];u.contain(l.array[c])&&h.contain(l.array[d])&&(t=l)}}}if(t){var f=i.pointToData(t.array,[],!0);this._updateAxisPointer(f),this._doShowAxisPointer()}else this._doHideAxisPointer()}},_onCameraChange:function(e,t){e.get("show")&&(this._updateFaceVisibility(),this._updateAxisLinePosition());var i=this._control;t.dispatchAction({type:"grid3DChangeCamera",alpha:i.getAlpha(),beta:i.getBeta(),distance:i.getDistance(),center:i.getCenter(),from:this.uid,grid3DId:e.id})},_updateFaceVisibility:function(){var e=this._control.getCamera(),t=new a.a.Vector3;e.update();for(var i=0;i<this._faces.length/2;i++){for(var n=[],r=0;r<2;r++)this._faces[2*i+r].rootNode.getWorldPosition(t),t.transformMat4(e.viewMatrix),n[r]=t.z;var o=n[0]>n[1]?0:1,s=this._faces[2*i+o],l=this._faces[2*i+1-o];s.rootNode.invisible=!0,l.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var e=this._model.coordinateSystem,t=e.getAxis("x"),i=e.getAxis("y"),n=e.getAxis("z"),r=n.getExtentMax(),a=n.getExtentMin(),o=t.getExtentMin(),s=t.getExtentMax(),l=i.getExtentMax(),u=i.getExtentMin(),h=this._axes[0].rootNode,c=this._axes[1].rootNode,d=this._axes[2].rootNode,f=this._faces,p=f[4].rootNode.invisible?u:l,g=f[2].rootNode.invisible?r:a,m=f[0].rootNode.invisible?o:s,v=f[2].rootNode.invisible?r:a,y=f[0].rootNode.invisible?s:o,_=f[4].rootNode.invisible?u:l;h.rotation.identity(),c.rotation.identity(),d.rotation.identity(),f[4].rootNode.invisible&&(this._axes[0].flipped=!0,h.rotation.rotateX(Math.PI)),f[0].rootNode.invisible&&(this._axes[1].flipped=!0,c.rotation.rotateZ(Math.PI)),f[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),h.position.set(0,g,p),c.position.set(m,v,0),d.position.set(y,0,_),h.update(),c.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var e=this._control.getCamera(),t=[new a.a.Vector4,new a.a.Vector4],i=new a.a.Vector4;this.groupGL.getWorldPosition(i),i.w=1,i.transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),i.x/=i.w,i.y/=i.w,this._axes.forEach((function(n){var r=n.axisLineCoords;n.labelsMesh.geometry;for(var a=0;a<t.length;a++)t[a].setArray(r[a]),t[a].w=1,t[a].transformMat4(n.rootNode.worldTransform).transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),t[a].x/=t[a].w,t[a].y/=t[a].w;var o,s,l=t[1].x-t[0].x,u=t[1].y-t[0].y,h=(t[1].x+t[0].x)/2,c=(t[1].y+t[0].y)/2;Math.abs(u/l)<.5?(o="center",s=c>i.y?"bottom":"top"):(s="middle",o=h>i.x?"left":"right"),n.setSpriteAlign(o,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,i=t.dataToPoint(e),n=this._axisPointerLineMesh.geometry,r=this._model.getModel("axisPointer"),o=this._api.getDevicePixelRatio();function s(e){return l.a.firstNotNull(e.model.get("axisPointer.show"),r.get("show"))}function u(e){var t=e.model.getModel("axisPointer",r).getModel("lineStyle"),i=a.a.parseColor(t.get("color")),n=g(t.get("width"),1),o=g(t.get("opacity"),1);return i[3]*=o,{color:i,lineWidth:n}}n.convertToDynamicArray(!0);for(var h=0;h<this._faces.length;h++){var c=this._faces[h];if(!c.rootNode.invisible){for(var d=c.faceInfo,f=d[3]<0?t.getAxis(d[2]).getExtentMin():t.getAxis(d[2]).getExtentMax(),p=m[d[2]],v=0;v<2;v++){var y=d[v],_=d[1-v],x=t.getAxis(y),b=t.getAxis(_);if(s(x)){var w=m[y],T=m[_];(A=[0,0,0])[w]=(M=[0,0,0])[w]=i[w],A[p]=M[p]=f,A[T]=b.getExtentMin(),M[T]=b.getExtentMax();var S=u(x);n.addLine(A,M,S.color,S.lineWidth*o)}}if(s(t.getAxis(d[2]))){var M,A=i.slice();(M=i.slice())[p]=f,S=u(t.getAxis(d[2])),n.addLine(A,M,S.color,S.lineWidth*o)}}}n.convertToTypedArray(),this._updateAxisPointerLabelsMesh(e),this._api.getZr().refresh()},_updateAxisPointerLabelsMesh:function(e){var t=this._model,i=this._axisPointerLabelsMesh,n=this._axisPointerLabelsSurface,a=t.coordinateSystem,o=t.getModel("axisPointer");i.geometry.convertToDynamicArray(!0),n.clear();var s={x:"y",y:"x",z:"y"};this._axes.forEach((function(t,l){var u=a.getAxis(t.dim),h=u.model.getModel("axisPointer",o),c=h.getModel("label"),d=h.get("lineStyle.color");if(c.get("show")&&h.get("show")){var f=e[l],p=c.get("formatter"),g=u.scale.getLabel(f);if(null!=p)g=p(g,e);else if("interval"===u.scale.type||"log"===u.scale.type){var v=r.a.number.getPrecisionSafe(u.scale.getTicks()[0]);g=f.toFixed(v+2)}var y=c.getModel("textStyle"),_=y.get("color"),x=new r.a.graphic.Text;r.a.graphic.setTextStyle(x.style,y,{text:g,textFill:_||d,textAlign:"left",textVerticalAlign:"top"});var b=n.add(x),w=x.getBoundingRect(),T=this._api.getDevicePixelRatio(),S=t.rootNode.position.toArray();S[m[s[t.dim]]]+=(t.flipped?-1:1)*c.get("margin"),S[m[t.dim]]=u.dataToCoord(e[l]),i.geometry.addSprite(S,[w.width*T,w.height*T],b,t.textAlign,t.textVerticalAlign)}}),this),n.getZr().refreshImmediately(),i.material.set("uvScale",n.getCoordsScale()),i.geometry.convertToTypedArray()},dispose:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(e,t,i){var n=i(70),r=i(12),a=i(33),o=i(78),s=i(79),l=i(34),u=i(21),h=i(55);t.a={vec2:n.a,vec3:r.a,vec4:a.a,mat2:o.a,mat2d:s.a,mat3:l.a,mat4:u.a,quat:h.a}},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(2),s=i(25),l=i(163),u=o.a.firstNotNull,h={x:0,y:2,z:1};function c(e,t,i){this.rootNode=new a.a.Node;var n=new a.a.Mesh({geometry:new s.a({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:1}),r=new a.a.Mesh({geometry:new l.a,material:i,castShadow:!1,culling:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:0});this.rootNode.add(r),this.rootNode.add(n),this.faceInfo=e,this.plane=new a.a.Plane,this.linesMesh=n,this.quadsMesh=r}c.prototype.update=function(e,t,i){var n=e.coordinateSystem,r=[n.getAxis(this.faceInfo[0]),n.getAxis(this.faceInfo[1])],a=this.linesMesh.geometry,o=this.quadsMesh.geometry;a.convertToDynamicArray(!0),o.convertToDynamicArray(!0),this._updateSplitLines(a,r,e,i),this._udpateSplitAreas(o,r,e,i),a.convertToTypedArray(),o.convertToTypedArray();var s=n.getAxis(this.faceInfo[2]);!function(e,t,i,n){var r=[0,0,0],a=n<0?i.getExtentMin():i.getExtentMax();r[h[i.dim]]=a,e.position.setArray(r),e.rotation.identity(),t.distance=-Math.abs(a),t.normal.set(0,0,0),"x"===i.dim?(e.rotation.rotateY(n*Math.PI/2),t.normal.x=-n):"z"===i.dim?(e.rotation.rotateX(-n*Math.PI/2),t.normal.y=-n):(n>0&&e.rotation.rotateY(Math.PI),t.normal.z=-n)}(this.rootNode,this.plane,s,this.faceInfo[3])},c.prototype._updateSplitLines=function(e,t,i,n){var o=n.getDevicePixelRatio();t.forEach((function(n,s){var l=n.model,h=t[1-s].getExtent();if(!n.scale.isBlank()){var c=l.getModel("splitLine",i.getModel("splitLine"));if(c.get("show")){var d=c.getModel("lineStyle"),f=d.get("color"),p=u(d.get("opacity"),1),g=u(d.get("width"),1);f=r.a.util.isArray(f)?f:[f];for(var m=n.getTicksCoords({tickModel:c}),v=0,y=0;y<m.length;y++){var _=m[y].coord,x=a.a.parseColor(f[v%f.length]);x[3]*=p;var b=[0,0,0],w=[0,0,0];b[s]=w[s]=_,b[1-s]=h[0],w[1-s]=h[1],e.addLine(b,w,x,g*o),v++}}}}))},c.prototype._udpateSplitAreas=function(e,t,i,n){t.forEach((function(n,o){var s=n.model,l=t[1-o].getExtent();if(!n.scale.isBlank()){var h=s.getModel("splitArea",i.getModel("splitArea"));if(h.get("show")){var c=h.getModel("areaStyle"),d=c.get("color"),f=u(c.get("opacity"),1);d=r.a.util.isArray(d)?d:[d];for(var p=n.getTicksCoords({tickModel:h,clamp:!0}),g=0,m=[0,0,0],v=[0,0,0],y=0;y<p.length;y++){var _=p[y].coord,x=[0,0,0],b=[0,0,0];if(x[o]=b[o]=_,x[1-o]=l[0],b[1-o]=l[1],0!==y){var w=a.a.parseColor(d[g%d.length]);w[3]*=f,e.addQuad([m,x,b,v],w),m=x,v=b,g++}else m=x,v=b}}}}))},t.a=c},function(e,t,i){var n,r,a,o,s=i(15),l=i(0),u=i.n(l),h=i(38),c=i(6).a.vec3,d=s.a.extend((function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new s.a.Attribute("position","float",3,"POSITION"),normal:new s.a.Attribute("normal","float",3,"NORMAL"),color:new s.a.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(e){var t=this.attributes,i=this.getQuadVertexCount()*e,n=this.getQuadTriangleCount()*e;this.vertexCount!==i&&(t.position.init(i),t.normal.init(i),t.color.init(i)),this.triangleCount!==n&&(this.indices=i>65535?new Uint32Array(3*n):new Uint16Array(3*n))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:(n=c.create(),r=c.create(),a=c.create(),o=[0,3,1,3,2,1],function(e,t){var i=this.attributes.position,s=this.attributes.normal,l=this.attributes.color;c.sub(n,e[1],e[0]),c.sub(r,e[2],e[1]),c.cross(a,n,r),c.normalize(a,a);for(var u=0;u<4;u++)i.set(this._vertexOffset+u,e[u]),l.set(this._vertexOffset+u,t),s.set(this._vertexOffset+u,a);var h=3*this._faceOffset;for(u=0;u<6;u++)this.indices[h+u]=o[u]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2})});u.a.util.defaults(d.prototype,h.a),t.a=d},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(25),s=i(2),l=i(63),u=s.a.firstNotNull,h={x:0,y:2,z:1};function c(e,t){var i=new a.a.Mesh({geometry:new o.a({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,renderOrder:2}),n=new l.a;n.material.depthMask=!1;var r=new a.a.Node;r.add(i),r.add(n),this.rootNode=r,this.dim=e,this.linesMesh=i,this.labelsMesh=n,this.axisLineCoords=null,this.labelElements=[]}var d={x:"y",y:"x",z:"y"};c.prototype.update=function(e,t,i){var n=e.coordinateSystem.getAxis(this.dim),o=this.linesMesh.geometry,s=this.labelsMesh.geometry;o.convertToDynamicArray(!0),s.convertToDynamicArray(!0);var l=n.model,c=n.getExtent(),f=i.getDevicePixelRatio(),p=l.getModel("axisLine",e.getModel("axisLine")),g=l.getModel("axisTick",e.getModel("axisTick")),m=l.getModel("axisLabel",e.getModel("axisLabel")),v=p.get("lineStyle.color");if(p.get("show")){var y=p.getModel("lineStyle"),_=[0,0,0];(D=[0,0,0])[E=h[n.dim]]=c[0],_[E]=c[1],this.axisLineCoords=[D,_];var x=a.a.parseColor(v),b=u(y.get("width"),1),w=u(y.get("opacity"),1);x[3]*=w,o.addLine(D,_,x,b*f)}if(g.get("show")){var T=g.getModel("lineStyle"),S=a.a.parseColor(u(T.get("color"),v));b=u(T.get("width"),1),S[3]*=u(T.get("opacity"),1);for(var M=n.getTicksCoords(),A=g.get("length"),I=0;I<M.length;I++){var C=M[I].coord,D=[0,0,0],E=(_=[0,0,0],h[n.dim]),L=h[d[n.dim]];D[E]=_[E]=C,_[L]=A,o.addLine(D,_,S,b*f)}}if(this.labelElements=[],f=i.getDevicePixelRatio(),m.get("show")){M=n.getTicksCoords();var P=l.get("data"),N=m.get("margin"),R=n.getViewLabels();for(I=0;I<R.length;I++){var O=R[I].tickValue,k=R[I].formattedLabel,z=R[I].rawLabel,B=(C=n.dataToCoord(O),[0,0,0]);E=h[n.dim],L=h[d[n.dim]],B[E]=B[E]=C,B[L]=N;var F=m;P&&P[O]&&P[O].textStyle&&(F=new r.a.Model(P[O].textStyle,m,l.ecModel));var V=u(F.get("color"),v),G=new r.a.graphic.Text;r.a.graphic.setTextStyle(G.style,F,{text:k,textFill:"function"==typeof V?V("category"===n.type?z:"value"===n.type?O+"":O,I):V,textVerticalAlign:"top",textAlign:"left"});var H=t.add(G),U=G.getBoundingRect();s.addSprite(B,[U.width*f,U.height*f],H),this.labelElements.push(G)}}if(l.get("name")){var W=l.getModel("nameTextStyle"),j=(B=[0,0,0],E=h[n.dim],L=h[d[n.dim]],u(W.get("color"),v)),X=W.get("borderColor");b=W.get("borderWidth"),B[E]=B[E]=(c[0]+c[1])/2,B[L]=l.get("nameGap"),G=new r.a.graphic.Text,r.a.graphic.setTextStyle(G.style,W,{text:l.get("name"),textFill:j,textStroke:X,lineWidth:b}),H=t.add(G),U=G.getBoundingRect(),s.addSprite(B,[U.width*f,U.height*f],H),G.__idx=this.labelElements.length,this.nameLabelElement=G}this.labelsMesh.material.set("textureAtlas",t.getTexture()),this.labelsMesh.material.set("uvScale",t.getCoordsScale()),o.convertToTypedArray(),s.convertToTypedArray()},c.prototype.setSpriteAlign=function(e,t,i){for(var n=i.getDevicePixelRatio(),r=this.labelsMesh.geometry,a=0;a<this.labelElements.length;a++){var o=this.labelElements[a].getBoundingRect();r.setSpriteAlign(a,[o.width*n,o.height*n],e,t)}var s=this.nameLabelElement;s&&(o=s.getBoundingRect(),r.setSpriteAlign(s.__idx,[o.width*n,o.height*n],e,t),r.dirty()),this.textAlign=e,this.textVerticalAlign=t},t.a=c},function(e,t,i){var n=i(0),r=i.n(n),a=i(15),o=i(38),s=[0,1,2,0,2,3],l=a.a.extend((function(){return{attributes:{position:new a.a.Attribute("position","float",3,"POSITION"),texcoord:new a.a.Attribute("texcoord","float",2,"TEXCOORD_0"),offset:new a.a.Attribute("offset","float",2),color:new a.a.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setSpriteCount:function(e){this._spriteCount=e;var t=4*e,i=2*e;this.vertexCount!==t&&(this.attributes.position.init(t),this.attributes.offset.init(t),this.attributes.color.init(t)),this.triangleCount!==i&&(this.indices=t>65535?new Uint32Array(3*i):new Uint16Array(3*i))},setSpriteAlign:function(e,t,i,n,r){var a,o,s,l;switch(null==i&&(i="left"),null==n&&(n="top"),r=r||0,i){case"left":a=r,s=t[0]+r;break;case"center":case"middle":a=-t[0]/2,s=t[0]/2;break;case"right":a=-t[0]-r,s=-r}switch(n){case"bottom":o=r,l=t[1]+r;break;case"middle":o=-t[1]/2,l=t[1]/2;break;case"top":o=-t[1]-r,l=-r}var u=4*e,h=this.attributes.offset;h.set(u,[a,l]),h.set(u+1,[s,l]),h.set(u+2,[s,o]),h.set(u+3,[a,o])},addSprite:function(e,t,i,n,r,a){var o=this._vertexOffset;this.setSprite(this._vertexOffset/4,e,t,i,n,r,a);for(var l=0;l<s.length;l++)this.indices[3*this._faceOffset+l]=s[l]+o;return this._faceOffset+=2,this._vertexOffset+=4,o/4},setSprite:function(e,t,i,n,r,a,o){for(var s=4*e,l=this.attributes,u=0;u<4;u++)l.position.set(s+u,t);var h=l.texcoord;h.set(s,[n[0][0],n[0][1]]),h.set(s+1,[n[1][0],n[0][1]]),h.set(s+2,[n[1][0],n[1][1]]),h.set(s+3,[n[0][0],n[1][1]]),this.setSpriteAlign(e,i,r,a,o)}});r.a.util.defaults(l.prototype,o.a),t.a=l},function(e,t,i){t.a="@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"},function(e,t,i){var n=i(168),r=i(170),a=i(0),o=i.n(a),s=i(47),l=i.n(s),u=i(22),h=i(2);function c(e,t){var i=e.getBoxLayoutParams(),n=l.a.getLayoutRect(i,{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"),a=e.get("boxHeight"),o=e.get("boxDepth");["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(-a/2,a/2),this.size=[r,a,o]}function d(e,t){var i={};e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();["x","y","z"].forEach((function(e){t.mapDimension(e,!0).forEach((function(n){var r,a;r=e,a=t.getDataExtent(n,!0),i[r]=i[r]||[1/0,-1/0],i[r][0]=Math.min(a[0],i[r][0]),i[r][1]=Math.max(a[1],i[r][1])}))}))}}),this),["xAxis3D","yAxis3D","zAxis3D"].forEach((function(t){e.eachComponent(t,(function(e){var n=t.charAt(0),a=e.getReferringComponents("grid3D")[0],s=a.coordinateSystem;if(s===this){var l=s.getAxis(n);if(l)console.warn("Can't have two %s in one grid3D",t);else{var u=o.a.helper.createScale(i[n]||[1/0,-1/0],e);(l=new r.a(n,u)).type=e.get("type");var h="category"===l.type;l.onBand=h&&e.get("boundaryGap"),l.inverse=e.get("inverse"),e.axis=l,l.model=e,l.getLabelModel=function(){return e.getModel("axisLabel",a.getModel("axisLabel"))},l.getTickModel=function(){return e.getModel("axisTick",a.getModel("axisTick"))},s.addAxis(l)}}}),this)}),this),this.resize(this.model,t)}var f={dimensions:n.a.prototype.dimensions,create:function(e,t){var i=[];e.eachComponent("grid3D",(function(e){e.__viewGL=e.__viewGL||new u.a;var t=new n.a;t.model=e,t.viewGL=e.__viewGL,e.coordinateSystem=t,i.push(t),t.resize=c,t.update=d}));var r=["xAxis3D","yAxis3D","zAxis3D"];return e.eachSeries((function(t){if("cartesian3D"===t.get("coordinateSystem")){if(null==(n=t.getReferringComponents("grid3D")[0])){var i=function(e,t){return r.map((function(i){var n=e.getReferringComponents(i)[0];if(null==n&&(n=t.getComponent(i)),!n)throw new Error(i+' "'+h.a.firstNotNull(e.get(i+"Index"),e.get(i+"Id"),0)+'" not found');return n}))}(t,e),n=i[0].getCoordSysModel();i.forEach((function(e){var t=e.getCoordSysModel();if(!t)throw new Error('grid3D "'+h.a.firstNotNull(e.get("gridIndex"),e.get("gridId"),0)+'" not found');if(t!==n)throw new Error("xAxis3D, yAxis3D, zAxis3D must use the same grid")}))}var a=n.coordinateSystem;t.coordinateSystem=a}})),i}};o.a.registerCoordinateSystem("grid3D",f)},function(e,t,i){var n=i(0),r=i.n(n),a=i(169),o=i.n(a);function s(e){o.a.call(this,e),this.size=[0,0,0]}s.prototype={constructor:s,type:"cartesian3D",dimensions:["x","y","z"],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,i){return(t=t||[])[0]=this.getAxis("x").dataToCoord(e[0],i),t[2]=this.getAxis("y").dataToCoord(e[1],i),t[1]=this.getAxis("z").dataToCoord(e[2],i),t},pointToData:function(e,t,i){return(t=t||[])[0]=this.getAxis("x").coordToData(e[0],i),t[1]=this.getAxis("y").coordToData(e[2],i),t[2]=this.getAxis("z").coordToData(e[1],i),t}},r.a.util.inherits(s,o.a),t.a=s},function(e,t,i){var n=i(13);function r(e){return this._axes[e]}var a=function(e){this._axes={},this._dimList=[],this.name=e||""};a.prototype={constructor:a,type:"cartesian",getAxis:function(e){return this._axes[e]},getAxes:function(){return n.map(this._dimList,r,this)},getAxesByScale:function(e){return e=e.toLowerCase(),n.filter(this.getAxes(),(function(t){return t.scale.type===e}))},addAxis:function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},dataToCoord:function(e){return this._dataCoordConvert(e,"dataToCoord")},coordToData:function(e){return this._dataCoordConvert(e,"coordToData")},_dataCoordConvert:function(e,t){for(var i=this._dimList,n=e instanceof Array?[]:{},r=0;r<i.length;r++){var a=i[r],o=this._axes[a];n[a]=o[t](e[a])}return n}};var o=a;e.exports=o},function(e,t,i){var n=i(0),r=i.n(n);function a(e,t,i){r.a.Axis.call(this,e,t,i)}a.prototype={constructor:a,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)}},r.a.util.inherits(a,r.a.Axis),t.a=a},function(e,t,i){var n=i(13),r=i(172),a=i(85),o=n.normalizeCssArray,s=/([&<>"'])/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"};function u(e){return null==e?"":(e+"").replace(s,(function(e,t){return l[t]}))}var h=["a","b","c","d","e","f","g"],c=function(e,t){return"{"+e+(null==t?"":t)+"}"};function d(e,t){return"0000".substr(0,t-(e+="").length)+e}var f=r.truncateText,p=r.getBoundingRect;t.addCommas=function(e){return isNaN(e)?"-":(e=(e+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")},t.toCamelCase=function(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},t.normalizeCssArray=o,t.encodeHTML=u,t.formatTpl=function(e,t,i){n.isArray(t)||(t=[t]);var r=t.length;if(!r)return"";for(var a=t[0].$vars||[],o=0;o<a.length;o++){var s=h[o];e=e.replace(c(s),c(s,0))}for(var l=0;l<r;l++)for(var d=0;d<a.length;d++){var f=t[l][a[d]];e=e.replace(c(h[d],l),i?u(f):f)}return e},t.formatTplSimple=function(e,t,i){return n.each(t,(function(t,n){e=e.replace("{"+n+"}",i?u(t):t)})),e},t.getTooltipMarker=function(e,t){var i=(e=n.isString(e)?{color:e,extraCssText:t}:e||{}).color,r=e.type;return t=e.extraCssText,i?"subItem"===r?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+u(i)+";"+(t||"")+'"></span>':'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:'+u(i)+";"+(t||"")+'"></span>':""},t.formatTime=function(e,t,i){"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var n=a.parseDate(t),r=i?"UTC":"",o=n["get"+r+"FullYear"](),s=n["get"+r+"Month"]()+1,l=n["get"+r+"Date"](),u=n["get"+r+"Hours"](),h=n["get"+r+"Minutes"](),c=n["get"+r+"Seconds"](),f=n["get"+r+"Milliseconds"]();return e=e.replace("MM",d(s,2)).replace("M",s).replace("yyyy",o).replace("yy",o%100).replace("dd",d(l,2)).replace("d",l).replace("hh",d(u,2)).replace("h",u).replace("mm",d(h,2)).replace("m",h).replace("ss",d(c,2)).replace("s",c).replace("SSS",d(f,3))},t.capitalFirst=function(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e},t.truncateText=f,t.getTextRect=p},function(e,t,i){var n=i(82),r=i(173),a=i(13),o=a.getContext,s=a.extend,l=a.retrieve2,u=a.retrieve3,h=a.trim,c={},d=0,f=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,p="12px sans-serif",g={};function m(e,t){var i=e+":"+(t=t||p);if(c[i])return c[i];for(var n=(e+"").split("\n"),r=0,a=0,o=n.length;a<o;a++)r=Math.max(S(n[a],t).width,r);return d>5e3&&(d=0,c={}),d++,c[i]=r,r}function v(e,t,i){return"right"===i?e-=t:"center"===i&&(e-=t/2),e}function y(e,t,i){return"middle"===i?e-=t/2:"bottom"===i&&(e-=t),e}function _(e,t,i,n,r){if(!t)return"";var a=(e+"").split("\n");r=x(t,i,n,r);for(var o=0,s=a.length;o<s;o++)a[o]=b(a[o],r);return a.join("\n")}function x(e,t,i,n){(n=s({},n)).font=t,i=l(i,"..."),n.maxIterations=l(n.maxIterations,2);var r=n.minChar=l(n.minChar,0);n.cnCharWidth=m("国",t);var a=n.ascCharWidth=m("a",t);n.placeholder=l(n.placeholder,"");for(var o=e=Math.max(0,e-1),u=0;u<r&&o>=a;u++)o-=a;var h=m(i);return h>o&&(i="",h=0),o=e-h,n.ellipsis=i,n.ellipsisWidth=h,n.contentWidth=o,n.containerWidth=e,n}function b(e,t){var i=t.containerWidth,n=t.font,r=t.contentWidth;if(!i)return"";var a=m(e,n);if(a<=i)return e;for(var o=0;;o++){if(a<=r||o>=t.maxIterations){e+=t.ellipsis;break}var s=0===o?w(e,r,t.ascCharWidth,t.cnCharWidth):a>0?Math.floor(e.length*r/a):0;a=m(e=e.substr(0,s),n)}return""===e&&(e=t.placeholder),e}function w(e,t,i,n){for(var r=0,a=0,o=e.length;a<o&&r<t;a++){var s=e.charCodeAt(a);r+=0<=s&&s<=127?i:n}return a}function T(e){return m("国",e)}function S(e,t){return g.measureText(e,t)}function M(e,t,i,n){null!=e&&(e+="");var r=T(t),a=e?e.split("\n"):[],o=a.length*r,s=o;if(i&&(s+=i[0]+i[2]),e&&n){var l=n.outerHeight,u=n.outerWidth;if(null!=l&&s>l)e="",a=[];else if(null!=u)for(var h=x(u-(i?i[1]+i[3]:0),t,n.ellipsis,{minChar:n.minChar,placeholder:n.placeholder}),c=0,d=a.length;c<d;c++)a[c]=b(a[c],h)}return{lines:a,height:o,outerHeight:s,lineHeight:r}}function A(e,t){var i={lines:[],width:0,height:0};if(null!=e&&(e+=""),!e)return i;for(var n,a=f.lastIndex=0;null!=(n=f.exec(e));){var o=n.index;o>a&&I(i,e.substring(a,o)),I(i,n[2],n[1]),a=f.lastIndex}a<e.length&&I(i,e.substring(a,e.length));var s=i.lines,h=0,c=0,d=[],p=t.textPadding,g=t.truncate,v=g&&g.outerWidth,y=g&&g.outerHeight;p&&(null!=v&&(v-=p[1]+p[3]),null!=y&&(y-=p[0]+p[2]));for(var x=0;x<s.length;x++){for(var b=s[x],w=0,S=0,M=0;M<b.tokens.length;M++){var A=(z=b.tokens[M]).styleName&&t.rich[z.styleName]||{},C=z.textPadding=A.textPadding,D=z.font=A.font||t.font,E=z.textHeight=l(A.textHeight,T(D));if(C&&(E+=C[0]+C[2]),z.height=E,z.lineHeight=u(A.textLineHeight,t.textLineHeight,E),z.textAlign=A&&A.textAlign||t.textAlign,z.textVerticalAlign=A&&A.textVerticalAlign||"middle",null!=y&&h+z.lineHeight>y)return{lines:[],width:0,height:0};z.textWidth=m(z.text,D);var L=A.textWidth,P=null==L||"auto"===L;if("string"==typeof L&&"%"===L.charAt(L.length-1))z.percentWidth=L,d.push(z),L=0;else{if(P){L=z.textWidth;var N=A.textBackgroundColor,R=N&&N.image;R&&(R=r.findExistImage(R),r.isImageReady(R)&&(L=Math.max(L,R.width*E/R.height)))}var O=C?C[1]+C[3]:0;L+=O;var k=null!=v?v-S:null;null!=k&&k<L&&(!P||k<O?(z.text="",z.textWidth=L=0):(z.text=_(z.text,k-O,D,g.ellipsis,{minChar:g.minChar}),z.textWidth=m(z.text,D),L=z.textWidth+O))}S+=z.width=L,A&&(w=Math.max(w,z.lineHeight))}b.width=S,b.lineHeight=w,h+=w,c=Math.max(c,S)}for(i.outerWidth=i.width=l(t.textWidth,c),i.outerHeight=i.height=l(t.textHeight,h),p&&(i.outerWidth+=p[1]+p[3],i.outerHeight+=p[0]+p[2]),x=0;x<d.length;x++){var z,B=(z=d[x]).percentWidth;z.width=parseInt(B,10)/100*c}return i}function I(e,t,i){for(var n=""===t,r=t.split("\n"),a=e.lines,o=0;o<r.length;o++){var s=r[o],l={styleName:i,text:s,isLineHolder:!s&&!n};if(o)a.push({tokens:[l]});else{var u=(a[a.length-1]||(a[0]={tokens:[]})).tokens,h=u.length;1===h&&u[0].isLineHolder?u[0]=l:(s||!h||n)&&u.push(l)}}}g.measureText=function(e,t){var i=o();return i.font=t||p,i.measureText(e)},t.DEFAULT_FONT=p,t.$override=function(e,t){g[e]=t},t.getWidth=m,t.getBoundingRect=function(e,t,i,r,a,o,s){return o?function(e,t,i,r,a,o,s){var l=A(e,{rich:o,truncate:s,font:t,textAlign:i,textPadding:a}),u=l.outerWidth,h=l.outerHeight,c=v(0,u,i),d=y(0,h,r);return new n(c,d,u,h)}(e,t,i,r,a,o,s):function(e,t,i,r,a,o){var s=M(e,t,a,o),l=m(e,t);a&&(l+=a[1]+a[3]);var u=s.outerHeight,h=v(0,l,i),c=y(0,u,r),d=new n(h,c,l,u);return d.lineHeight=s.lineHeight,d}(e,t,i,r,a,s)},t.adjustTextX=v,t.adjustTextY=y,t.adjustTextPositionOnRect=function(e,t,i){var n=t.x,r=t.y,a=t.height,o=t.width,s=a/2,l="left",u="top";switch(e){case"left":n-=i,r+=s,l="right",u="middle";break;case"right":n+=i+o,r+=s,u="middle";break;case"top":n+=o/2,r-=i,l="center",u="bottom";break;case"bottom":n+=o/2,r+=a+i,l="center";break;case"inside":n+=o/2,r+=s,l="center",u="middle";break;case"insideLeft":n+=i,r+=s,u="middle";break;case"insideRight":n+=o-i,r+=s,l="right",u="middle";break;case"insideTop":n+=o/2,r+=i,l="center";break;case"insideBottom":n+=o/2,r+=a-i,l="center",u="bottom";break;case"insideTopLeft":n+=i,r+=i;break;case"insideTopRight":n+=o-i,r+=i,l="right";break;case"insideBottomLeft":n+=i,r+=a-i,u="bottom";break;case"insideBottomRight":n+=o-i,r+=a-i,l="right",u="bottom"}return{x:n,y:r,textAlign:l,textVerticalAlign:u}},t.truncateText=_,t.getLineHeight=T,t.measureText=S,t.parsePlainText=M,t.parseRichText=A,t.makeFont=function(e){var t=(e.fontSize||e.fontFamily)&&[e.fontStyle,e.fontWeight,(e.fontSize||12)+"px",e.fontFamily||"sans-serif"].join(" ");return t&&h(t)||e.textFont||e.font}},function(e,t,i){var n=new(i(60))(50);function r(){var e=this.__cachedImgObj;this.onload=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var i=e.pending[t],n=i.cb;n&&n(this,i.cbPayload),i.hostEl.dirty()}e.pending.length=0}function a(e){return e&&e.width&&e.height}t.findExistImage=function(e){if("string"==typeof e){var t=n.get(e);return t&&t.image}return e},t.createOrUpdateImage=function(e,t,i,o,s){if(e){if("string"==typeof e){if(t&&t.__zrImageSrc===e||!i)return t;var l=n.get(e),u={hostEl:i,cb:o,cbPayload:s};return l?!a(t=l.image)&&l.pending.push(u):(!t&&(t=new Image),t.onload=r,n.put(e,t.__cachedImgObj={image:t,pending:[u]}),t.src=t.__zrImageSrc=e),t}return e}return t},t.isImageReady=a},function(e,t,i){var n=i(7),r=i(11),a=i(3),o=i(18),s=i(59),l=i(9),u=i(52),h=i(8),c=i(19),d=i(10),f=i(4),p=i(5),g=i(27),m=i(41),v=i(37),y=i(16),_=i(86),x=i(21),b=i(175),w=["px","nx","py","ny","pz","nz"];function T(e,t,i){return"alphaMap"===i?e.material.get("diffuseMap"):"alphaCutoff"===i?e.material.isDefined("fragment","ALPHA_TEST")&&e.material.get("diffuseMap")&&e.material.get("alphaCutoff")||0:t.get(i)}function S(e,t){var i=e.material,n=t.material;return i.get("diffuseMap")!==n.get("diffuseMap")||(i.get("alphaCutoff")||0)!==(n.get("alphaCutoff")||0)}h.a.import(b.a);var M,A,I,C,D,E,L,P=n.a.extend((function(){return{softShadow:P.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 d.a,_textures:{},_shadowMapNumber:{POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},_depthMaterials:{},_distanceMaterials:{},_receivers:[],_lightsCastShadow:[],_lightCameras:{},_lightMaterials:{},_texturePool:new _.a}}),(function(){this._gaussianPassH=new y.a({fragment:h.a.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new y.a({fragment:h.a.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 y.a({fragment:h.a.source("clay.sm.debug_depth")})}),{render:function(e,t,i,n){i||(i=t.getMainCamera()),this.trigger("beforerender",this,e,t,i),this._renderShadowPass(e,t,i,n),this.trigger("afterrender",this,e,t,i)},renderDebug:function(e,t){e.saveClear();var i=e.viewport,n=0,r=t||i.width/4,a=r;for(var o in this.softShadow===P.VSM?this._outputDepthPass.material.define("fragment","USE_VSM"):this._outputDepthPass.material.undefine("fragment","USE_VSM"),this._textures){var s=this._textures[o];e.setViewport(n,0,r*s.width/s.height,a),this._outputDepthPass.setUniform("depthMap",s),this._outputDepthPass.render(e),n+=r*s.width/s.height}e.setViewport(i),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===P.VSM)t.material.define("fragment","USE_VSM"),t.material.undefine("fragment","PCF_KERNEL_SIZE");else{t.material.undefine("fragment","USE_VSM");var i=this.kernelPCF;i&&i.length?t.material.define("fragment","PCF_KERNEL_SIZE",i.length/2):t.material.undefine("fragment","PCF_KERNEL_SIZE")}},_update:function(e,t){var i=this;t.traverse((function(t){t.isRenderable()&&i._updateReceivers(e,t)}));for(var n=0;n<t.lights.length;n++){var r=t.lights[n];r.castShadow&&!r.invisible&&this._lightsCastShadow.push(r)}},_renderShadowPass:function(e,t,i,n){for(var r in this._shadowMapNumber)this._shadowMapNumber[r]=0;this._lightsCastShadow.length=0,this._receivers.length=0;var a=e.gl;if(n||t.update(),i&&i.update(),t.updateLights(),this._update(e,t),this._lightsCastShadow.length||!this._lastRenderNotCastShadow){this._lastRenderNotCastShadow=0===this._lightsCastShadow,a.enable(a.DEPTH_TEST),a.depthMask(!0),a.disable(a.BLEND),a.clearColor(1,1,1,1);for(var o,s=[],l=[],u=[],h=[],c=[],d=[],f=0;f<this._lightsCastShadow.length;f++){var p=this._lightsCastShadow[f];if("DIRECTIONAL_LIGHT"===p.type){if(o){console.warn("Only one direectional light supported with shadow cascade");continue}if(p.shadowCascade>4){console.warn("Support at most 4 cascade");continue}p.shadowCascade>1&&(o=p),this.renderDirectionalLightShadow(e,t,i,p,c,h,u)}else"SPOT_LIGHT"===p.type?this.renderSpotLightShadow(e,t,p,l,s):"POINT_LIGHT"===p.type&&this.renderPointLightShadow(e,t,p,d);this._shadowMapNumber[p.type]++}for(var g in this._shadowMapNumber){var m=this._shadowMapNumber[g],v=g+"_SHADOWMAP_COUNT";for(f=0;f<this._receivers.length;f++)(y=this._receivers[f].material).fragmentDefines[v]!==m&&(m>0?y.define("fragment",v,m):y.isDefined("fragment",v)&&y.undefine("fragment",v))}for(f=0;f<this._receivers.length;f++){var y=this._receivers[f].material;o?y.define("fragment","SHADOW_CASCADE",o.shadowCascade):y.undefine("fragment","SHADOW_CASCADE")}var _=t.shadowUniforms;if(u.length>0){var x=u.map(S);if(_.directionalLightShadowMaps={value:u,type:"tv"},_.directionalLightMatrices={value:h,type:"m4v"},_.directionalLightShadowMapSizes={value:x,type:"1fv"},o){var b=c.slice(),w=c.slice();b.pop(),w.shift(),b.reverse(),w.reverse(),h.reverse(),_.shadowCascadeClipsNear={value:b,type:"1fv"},_.shadowCascadeClipsFar={value:w,type:"1fv"}}}if(s.length>0){var T=s.map(S);(_=t.shadowUniforms).spotLightShadowMaps={value:s,type:"tv"},_.spotLightMatrices={value:l,type:"m4v"},_.spotLightShadowMapSizes={value:T,type:"1fv"}}d.length>0&&(_.pointLightShadowMaps={value:d,type:"tv"})}function S(e){return e.height}},renderDirectionalLightShadow:(M=new s.a,A=new l.a,I=new o.a,C=new l.a,D=new l.a,E=new l.a,L=new l.a,function(e,t,i,n,r,a,o){var s=this._getDepthMaterial(n),h={getMaterial:function(e){return e.shadowDepthMaterial||s},isMaterialChanged:S,getUniform:T,ifRender:function(e){return e.castShadow},sortCompare:u.a.opaqueSortCompare};if(!t.viewBoundingBoxLastFrame.isFinite()){var c=t.getBoundingBox();t.viewBoundingBoxLastFrame.copy(c).applyTransform(i.viewMatrix)}var d=Math.min(-t.viewBoundingBoxLastFrame.min.z,i.far),f=Math.max(-t.viewBoundingBoxLastFrame.max.z,i.near),p=this._getDirectionalLightCamera(n,t,i),g=E.array;L.copy(p.projectionMatrix),x.a.invert(D.array,p.worldTransform.array),x.a.multiply(D.array,D.array,i.worldTransform.array),x.a.multiply(g,L.array,D.array);for(var v=[],y=i instanceof m.a,_=(i.near+i.far)/(i.near-i.far),b=2*i.near*i.far/(i.near-i.far),w=0;w<=n.shadowCascade;w++){var N=f*Math.pow(d/f,w/n.shadowCascade),R=f+(d-f)*w/n.shadowCascade,O=N*n.cascadeSplitLogFactor+R*(1-n.cascadeSplitLogFactor);v.push(O),r.push(-(-O*_+b)/-O)}var k=this._getTexture(n,n.shadowCascade);o.push(k);var z=e.viewport,B=e.gl;for(this._frameBuffer.attach(k),this._frameBuffer.bind(e),B.clear(B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT),w=0;w<n.shadowCascade;w++){var F=v[w],V=v[w+1];y?x.a.perspective(A.array,i.fov/180*Math.PI,i.aspect,F,V):x.a.ortho(A.array,i.left,i.right,i.bottom,i.top,F,V),M.setFromProjection(A),M.getTransformedBoundingBox(I,D),I.applyProjection(L);var G=I.min.array,H=I.max.array;G[0]=Math.max(G[0],-1),G[1]=Math.max(G[1],-1),H[0]=Math.min(H[0],1),H[1]=Math.min(H[1],1),C.ortho(G[0],H[0],G[1],H[1],1,-1),p.projectionMatrix.multiplyLeft(C);var U=n.shadowResolution||512;e.setViewport((n.shadowCascade-w-1)*U,0,U,U,1);var W=t.updateRenderList(p);e.renderPass(W.opaque,p,h),this.softShadow===P.VSM&&this._gaussianFilter(e,k,k.width);var j=new l.a;j.copy(p.viewMatrix).multiplyLeft(p.projectionMatrix),a.push(j.array),p.projectionMatrix.copy(L)}this._frameBuffer.unbind(e),e.setViewport(z)}),renderSpotLightShadow:function(e,t,i,n,r){var a=this._getTexture(i),o=this._getSpotLightCamera(i),s=e.gl;this._frameBuffer.attach(a),this._frameBuffer.bind(e),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT);var h=this._getDepthMaterial(i),c={getMaterial:function(e){return e.shadowDepthMaterial||h},isMaterialChanged:S,getUniform:T,ifRender:function(e){return e.castShadow},sortCompare:u.a.opaqueSortCompare},d=t.updateRenderList(o);e.renderPass(d.opaque,o,c),this._frameBuffer.unbind(e),this.softShadow===P.VSM&&this._gaussianFilter(e,a,a.width);var f=new l.a;f.copy(o.worldTransform).invert().multiplyLeft(o.projectionMatrix),r.push(a),n.push(f.array)},renderPointLightShadow:function(e,t,i,n){var r=this._getTexture(i),s=e.gl;n.push(r);var l=this._getDepthMaterial(i),h={getMaterial:function(e){return e.shadowDepthMaterial||l},getUniform:T,sortCompare:u.a.opaqueSortCompare},c={px:[],py:[],pz:[],nx:[],ny:[],nz:[]},d=new o.a,f=i.getWorldPosition().array,p=new o.a,g=i.range;p.min.setArray(f),p.max.setArray(f);var m=new a.a(g,g,g);p.max.add(m),p.min.sub(m);var v={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 i=0;i<w.length;i++)c[w[i]].push(e);return}if(d.transformFrom(t.boundingBox,e.worldTransform),!d.intersectBoundingBox(p))return;for(d.updateVertices(),i=0;i<w.length;i++)v[w[i]]=!1;for(i=0;i<8;i++){var n=d.vertices[i],r=n[0]-f[0],a=n[1]-f[1],o=n[2]-f[2],s=Math.abs(r),l=Math.abs(a),u=Math.abs(o);s>l?s>u?v[r>0?"px":"nx"]=!0:v[o>0?"pz":"nz"]=!0:l>u?v[a>0?"py":"ny"]=!0:v[o>0?"pz":"nz"]=!0}for(i=0;i<w.length;i++)v[w[i]]&&c[w[i]].push(e)}}));for(var y=0;y<6;y++){var _=w[y],x=this._getPointLightCamera(i,_);this._frameBuffer.attach(r,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+y),this._frameBuffer.bind(e),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),e.renderPass(c[_],x,h)}this._frameBuffer.unbind(e)},_getDepthMaterial:function(e){var t=this._lightMaterials[e.__uid__],i="POINT_LIGHT"===e.type;if(!t){var n=i?"clay.sm.distance.":"clay.sm.depth.";t=new c.a({precision:this.precision,shader:new h.a(h.a.source(n+"vertex"),h.a.source(n+"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===P.VSM?t.define("fragment","USE_VSM"):t.undefine("fragment","USE_VSM"),i&&(t.set("lightPosition",e.getWorldPosition().array),t.set("range",e.range)),t},_gaussianFilter:function(e,t,i){var n={width:i,height:i,type:f.a.FLOAT},r=this._texturePool.get(n);this._frameBuffer.attach(r),this._frameBuffer.bind(e),this._gaussianPassH.setUniform("texture",t),this._gaussianPassH.setUniform("textureWidth",i),this._gaussianPassH.render(e),this._frameBuffer.attach(t),this._gaussianPassV.setUniform("texture",r),this._gaussianPassV.setUniform("textureHeight",i),this._gaussianPassV.render(e),this._frameBuffer.unbind(e),this._texturePool.put(r)},_getTexture:function(e,t){var i=e.__uid__,n=this._textures[i],a=e.shadowResolution||512;return t=t||1,n||((n="POINT_LIGHT"===e.type?new g.a:new p.a).width=a*t,n.height=a,this.softShadow===P.VSM?(n.type=f.a.FLOAT,n.anisotropic=4):(n.minFilter=r.a.NEAREST,n.magFilter=r.a.NEAREST,n.useMipmap=!1),this._textures[i]=n),n},_getPointLightCamera:function(e,t){this._lightCameras.point||(this._lightCameras.point={px:new m.a,nx:new m.a,py:new m.a,ny:new m.a,pz:new m.a,nz:new m.a});var i=this._lightCameras.point[t];switch(i.far=e.range,i.fov=90,i.position.set(0,0,0),t){case"px":i.lookAt(a.a.POSITIVE_X,a.a.NEGATIVE_Y);break;case"nx":i.lookAt(a.a.NEGATIVE_X,a.a.NEGATIVE_Y);break;case"py":i.lookAt(a.a.POSITIVE_Y,a.a.POSITIVE_Z);break;case"ny":i.lookAt(a.a.NEGATIVE_Y,a.a.NEGATIVE_Z);break;case"pz":i.lookAt(a.a.POSITIVE_Z,a.a.NEGATIVE_Y);break;case"nz":i.lookAt(a.a.NEGATIVE_Z,a.a.NEGATIVE_Y)}return e.getWorldPosition(i.position),i.update(),i},_getDirectionalLightCamera:function(){var e=new l.a,t=new o.a,i=new o.a;return function(n,r,a){this._lightCameras.directional||(this._lightCameras.directional=new v.a);var o=this._lightCameras.directional;t.copy(r.viewBoundingBoxLastFrame),t.intersection(a.frustum.boundingBox),o.position.copy(t.min).add(t.max).scale(.5).transformMat4(a.worldTransform),o.rotation.copy(n.rotation),o.scale.copy(n.scale),o.updateWorldTransform(),l.a.invert(e,o.worldTransform),l.a.multiply(e,e,a.worldTransform),i.copy(t).applyTransform(e);var s=i.min.array,u=i.max.array;return o.position.set((s[0]+u[0])/2,(s[1]+u[1])/2,u[2]).transformMat4(o.worldTransform),o.near=0,o.far=-s[2]+u[2],isNaN(this.lightFrustumBias)?o.far*=4:o.far+=this.lightFrustumBias,o.left=s[0],o.right=u[0],o.top=u[1],o.bottom=s[1],o.update(!0),o}}(),_getSpotLightCamera:function(e){this._lightCameras.spot||(this._lightCameras.spot=new m.a);var t=this._lightCameras.spot;return t.fov=2*e.penumbraAngle,t.far=e.range,t.worldTransform.copy(e.worldTransform),t.updateProjectionMatrix(),x.a.invert(t.viewMatrix.array,t.worldTransform.array),t},dispose:function(e){var t=e.gl||e;for(var i in this._frameBuffer&&this._frameBuffer.dispose(t),this._textures)this._textures[i].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 n=0;n<this._receivers.length;n++){var r=this._receivers[n];if(r.material){var a=r.material;a.undefine("fragment","POINT_LIGHT_SHADOW_COUNT"),a.undefine("fragment","DIRECTIONAL_LIGHT_SHADOW_COUNT"),a.undefine("fragment","AMBIENT_LIGHT_SHADOW_COUNT"),a.set("shadowEnabled",0)}}this._receivers=[],this._lightsCastShadow=[]}});P.VSM=1,P.PCF=2,t.a=P},function(e,t,i){t.a="@export clay.sm.depth.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\n@import clay.chunk.skinning_header\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\nvoid main(){\n vec3 skinnedPosition = position;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;\n#endif\n v_ViewPosition = worldViewProjection * vec4(skinnedPosition, 1.0);\n gl_Position = v_ViewPosition;\n v_Texcoord = texcoord;\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 float dx = dFdx(depth);\n float dy = dFdy(depth);\n moment2 += 0.25*(dx*dx+dy*dy);\n gl_FragColor = vec4(moment1, moment2, 0.0, 1.0);\n#else\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n depth += sqrt(dx*dx + dy*dy) * slopeScale + bias;\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 vec3 skinnedPosition = position;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;\n#endif\n gl_Position = worldViewProjection * vec4(skinnedPosition , 1.0);\n v_WorldPosition = (world * vec4(skinnedPosition, 1.0)).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"},function(e,t,i){var n=i(8),r=i(5),a=i(4),o=i(10),s=i(177),l=i(189),u=i(191),h=i(193),c=i(1),d=i(194),f=i(196);i(9);var p=i(197),g=i(87),m=i(88),v=i(89),y=i(90),_=i(91),x=i(92),b=i(93),w=i(94),T=i(95),S=i(198),M=i(199);n.a.import(g.a),n.a.import(m.a),n.a.import(v.a),n.a.import(y.a),n.a.import(_.a),n.a.import(x.a),n.a.import(b.a),n.a.import(w.a),n.a.import(T.a),n.a.import(S.a),n.a.import(M.a);var A={color:{parameters:{width:function(e){return e.getWidth()},height:function(e){return e.getHeight()}}}},I=["composite","FXAA"];function C(){this._sourceTexture=new r.a({type:a.a.HALF_FLOAT}),this._depthTexture=new r.a({format:a.a.DEPTH_COMPONENT,type:a.a.UNSIGNED_INT}),this._framebuffer=new o.a,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,o.a.DEPTH_ATTACHMENT),this._normalPass=new d.a,this._compositor=Object(s.a)(p.a);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=I.map((function(e){return this._compositor.getNodeByName(e)}),this);var i={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new l.a(i),this._ssrPass=new u.a(i),this._edgePass=new f.a(i)}C.prototype.resize=function(e,t,i){e*=i=i||1,t*=i;var n=this._sourceTexture,r=this._depthTexture;n.width=e,n.height=t,r.width=e,r.height=t},C.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR},C.prototype._getPrevNode=function(e){for(var t=I.indexOf(e.name)-1,i=this._finalNodesChain[t];i&&!this._compositor.getNodeByName(i.name);)t-=1,i=this._finalNodesChain[t];return i},C.prototype._getNextNode=function(e){for(var t=I.indexOf(e.name)+1,i=this._finalNodesChain[t];i&&!this._compositor.getNodeByName(i.name);)t+=1,i=this._finalNodesChain[t];return i},C.prototype._addChainNode=function(e){var t=this._getPrevNode(e),i=this._getNextNode(e);t&&(t.outputs=A,e.inputs.texture=t.name,i?(e.outputs=A,i.inputs.texture=e.name):e.outputs=null,this._compositor.addNode(e))},C.prototype._removeChainNode=function(e){var t=this._getPrevNode(e),i=this._getNextNode(e);t&&(i?(t.outputs=A,i.inputs.texture=t.name):t.outputs=null,this._compositor.removeNode(e))},C.prototype.updateNormal=function(e,t,i,n){this._ifRenderNormalPass()&&this._normalPass.update(e,t,i)},C.prototype.updateSSAO=function(e,t,i,n){this._ssaoPass.update(e,i,n)},C.prototype.enableSSAO=function(){this._enableSSAO=!0},C.prototype.disableSSAO=function(){this._enableSSAO=!1},C.prototype.enableSSR=function(){this._enableSSR=!0},C.prototype.disableSSR=function(){this._enableSSR=!1},C.prototype.getSSAOTexture=function(){return this._ssaoPass.getTargetTexture()},C.prototype.getSourceFrameBuffer=function(){return this._framebuffer},C.prototype.getSourceTexture=function(){return this._sourceTexture},C.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)},C.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)},C.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()},C.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()},C.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()},C.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()},C.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0},C.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1},C.prototype.enableEdge=function(){this._enableEdge=!0},C.prototype.disableEdge=function(){this._enableEdge=!1},C.prototype.setBloomIntensity=function(e){this._compositeNode.setParameter("bloomIntensity",e)},C.prototype.setSSAOParameter=function(e,t){switch(e){case"quality":var i={low:6,medium:12,high:32,ultra:62}[t]||12;this._ssaoPass.setParameter("kernelSize",i);break;case"radius":this._ssaoPass.setParameter(e,t),this._ssaoPass.setParameter("bias",t/200);break;case"intensity":this._ssaoPass.setParameter(e,t);break;default:console.warn("Unkown SSAO parameter "+e)}},C.prototype.setDOFParameter=function(e,t){switch(e){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(e,t);break;case"blurRadius":for(var i=0;i<this._dofBlurNodes.length;i++)this._dofBlurNodes[i].setParameter("blurRadius",t);break;case"quality":var n={low:4,medium:8,high:16,ultra:32}[t]||8;for(this._dofBlurKernelSize=n,i=0;i<this._dofBlurNodes.length;i++)this._dofBlurNodes[i].pass.material.define("POISSON_KERNEL_SIZE",n);this._dofBlurKernel=new Float32Array(2*n);break;default:console.warn("Unkown DOF parameter "+e)}},C.prototype.setSSRParameter=function(e,t){if(null!=t)switch(e){case"quality":var i={low:10,medium:15,high:30,ultra:80}[t]||20,n={low:32,medium:16,high:8,ultra:4}[t]||16;this._ssrPass.setParameter("maxIteration",i),this._ssrPass.setParameter("pixelStride",n);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)}},C.prototype.setPhysicallyCorrectSSR=function(e){this._ssrPass.setPhysicallyCorrect(e)},C.prototype.setEdgeColor=function(e){var t=c.a.parseColor(e);this._edgePass.setParameter("edgeColor",t)},C.prototype.setExposure=function(e){this._compositeNode.setParameter("exposure",Math.pow(2,e))},C.prototype.setColorLookupTexture=function(e,t){this._compositeNode.pass.material.setTextureImage("lut",this._enableColorCorrection?e:"none",t,{minFilter:c.a.Texture.NEAREST,magFilter:c.a.Texture.NEAREST,flipY:!1})},C.prototype.setColorCorrection=function(e,t){this._compositeNode.setParameter(e,t)},C.prototype.isSSREnabled=function(){return this._enableSSR},C.prototype.composite=function(e,t,i,n,r){var a=this._sourceTexture,o=a;this._enableEdge&&(this._edgePass.update(e,i,a,r),a=o=this._edgePass.getTargetTexture()),this._enableSSR&&(this._ssrPass.update(e,i,a,r),o=this._ssrPass.getTargetTexture(),this._ssrPass.setSSAOTexture(this._enableSSAO?this._ssaoPass.getTargetTexture():null)),this._sourceNode.texture=o,this._cocNode.setParameter("depth",this._depthTexture);for(var s=this._dofBlurKernel,l=this._dofBlurKernelSize,u=r%Math.floor(h.a.length/2/l),c=0;c<2*l;c++)s[c]=h.a[c+u*l*2];for(c=0;c<this._dofBlurNodes.length;c++)this._dofBlurNodes[c].setParameter("percent",r/30),this._dofBlurNodes[c].setParameter("poissonKernel",s);this._cocNode.setParameter("zNear",i.near),this._cocNode.setParameter("zFar",i.far),this._compositor.render(e,n)},C.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)},t.a=C},function(e,t,i){var n=i(178);t.a=n.a},function(e,t,i){var n=i(23),r=i(179),a=i(181),o=i(182),s=i(183),l=i(8),u=i(4),h=i(5),c=i(27),d=i(184);Object(d.a)(l.a);var f=/^#source\((.*?)\)/;function p(e,t,i){var n,r,u,h,c=e.type||"filter";if("filter"===c){var d=e.shader.trim(),p=f.exec(d);if(p?n=l.a.source(p[1].trim()):"#"===d.charAt(0)&&(n=t.shaders[d.substr(1)]),n||(n=d),!n)return}if(e.inputs)for(var g in r={},e.inputs)"string"==typeof e.inputs[g]?r[g]=e.inputs[g]:r[g]={node:e.inputs[g].node,pin:e.inputs[g].pin};if(e.outputs)for(var g in u={},e.outputs){var m=e.outputs[g];u[g]={},null!=m.attachment&&(u[g].attachment=m.attachment),null!=m.keepLastFrame&&(u[g].keepLastFrame=m.keepLastFrame),null!=m.outputLastFrame&&(u[g].outputLastFrame=m.outputLastFrame),m.parameters&&(u[g].parameters=v(m.parameters))}if(h="scene"===c?new a.a({name:e.name,scene:i.scene,camera:i.camera,outputs:u}):"texture"===c?new o.a({name:e.name,outputs:u}):new s.a({name:e.name,shader:n,inputs:r,outputs:u})){if(e.parameters)for(var g in e.parameters)"string"==typeof(x=e.parameters[g])&&("#"===(x=x.trim()).charAt(0)?x=t.textures[x.substr(1)]:h.on("beforerender",y(g,_(x)))),h.setParameter(g,x);if(e.defines&&h.pass)for(var g in e.defines){var x=e.defines[g];h.pass.material.define("fragment",g,x)}}return h}function g(e,t){return e}function m(e,t){return t}function v(e){var t={};if(!e)return t;["type","minFilter","magFilter","wrapS","wrapT","flipY","useMipmap"].forEach((function(i){var n=e[i];null!=n&&("string"==typeof n&&(n=u.a[n]),t[i]=n)}));var i=e.scale||1;return["width","height"].forEach((function(n){if(null!=e[n]){var r=e[n];"string"==typeof r?(r=r.trim(),t[n]=function(e,t,i){return i=i||1,function(e){var n=e.getDevicePixelRatio(),r=e.getWidth()*i,a=e.getHeight()*i;return t(r,a,n)}}(0,_(r),i)):t[n]=r}})),t.width||(t.width=g),t.height||(t.height=m),null!=e.useMipmap&&(t.useMipmap=e.useMipmap),t}function y(e,t){return function(i){var n=i.getDevicePixelRatio(),r=i.getWidth(),a=i.getHeight(),o=t(r,a,n);this.setParameter(e,o)}}function _(e){var t=/^expr\((.*)\)$/.exec(e);if(t)try{var i=new Function("width","height","dpr","return "+t[1]);return i(1,1),i}catch(m9){throw new Error("Invalid expression.")}}t.a=function(e,t){var i=new r.a;t=t||{};var a={textures:{},parameters:{}};for(var o in e.parameters){var s=e.parameters[o];a.parameters[o]=v(s)}return function(e,t,i,r){if(e.textures){var a={},o=0,s=!1,l=i.textureRootPath;n.a.each(e.textures,(function(e,t){var i,u=e.path,d=v(e.parameters);if(Array.isArray(u)&&6===u.length)l&&(u=u.map((function(e){return n.a.relative2absolute(e,l)}))),i=new c.a(d);else{if("string"!=typeof u)return;l&&(u=n.a.relative2absolute(u,l)),i=new h.a(d)}i.load(u),o++,i.once("success",(function(){a[t]=i,0==--o&&(r(a),s=!0)}))})),0!==o||s||r(a)}else r({})}(e,0,t,(function(n){a.textures=n,function(n,r){for(var o=0;o<e.nodes.length;o++){var s=p(e.nodes[o],a,t);s&&i.addNode(s)}}()})),i}},function(e,t,i){var n=i(180),r=i(86),a=i(10),o=n.a.extend((function(){return{_outputs:[],_texturePool:new r.a,_frameBuffer:new a.a({depthBuffer:!1})}}),{addNode:function(e){n.a.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 i=0;i<this.nodes.length;i++)this.nodes[i].outputs||this._outputs.push(this.nodes[i])}for(i=0;i<this.nodes.length;i++)this.nodes[i].beforeFrame();for(i=0;i<this._outputs.length;i++)this._outputs[i].updateReference();for(i=0;i<this._outputs.length;i++)this._outputs[i].render(e,t);for(i=0;i<this.nodes.length;i++)this.nodes[i].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)}});t.a=o},function(e,t,i){var n=i(7),r=i(48),a=n.a.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 i in t.inputs)if(t.inputs[i])if(!t.pass||t.pass.material.isUniformEnabled(i)){var n=t.inputs[i],r=this.findPin(n);r?t.link(i,r.node,r.pin):"string"==typeof n?console.warn("Node "+n+" not exist"):console.warn("Pin of "+n.node+"."+n.pin+" not exist")}else console.warn("Pin "+t.name+"."+i+" not used.")}},findPin:function(e){var t;if(("string"==typeof e||e instanceof r.a)&&(e={node:e}),"string"==typeof e.node)for(var i=0;i<this.nodes.length;i++){var n=this.nodes[i];n.name===e.node&&(t=n)}else t=e.node;if(t){var a=e.pin;if(a||t.outputs&&(a=Object.keys(t.outputs)[0]),t.outputs[a])return{node:t,pin:a}}}});t.a=a},function(e,t,i){var n=i(48),r=i(11),a=i(10),o=n.a.extend({name:"scene",scene:null,camera:null,autoUpdateScene:!0,preZ:!1},(function(){this.frameBuffer=new a.a}),{render:function(e){this._rendering=!0;var t,i=e.gl;if(this.trigger("beforerender"),this.outputs){var n=this.frameBuffer;for(var a in this.outputs){var o=this.updateParameter(a,e),s=this.outputs[a],l=this._compositor.allocateTexture(o);this._outputTextures[a]=l,"string"==typeof(c=s.attachment||i.COLOR_ATTACHMENT0)&&(c=i[c]),n.attach(l,c)}n.bind(e);var u=e.getGLExtension("EXT_draw_buffers");if(u){var h=[];for(var c in this.outputs)(c=parseInt(c))>=i.COLOR_ATTACHMENT0&&c<=i.COLOR_ATTACHMENT0+8&&h.push(c);u.drawBuffersEXT(h)}e.saveClear(),e.clearBit=r.a.DEPTH_BUFFER_BIT|r.a.COLOR_BUFFER_BIT,t=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),e.restoreClear(),n.unbind(e)}else t=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ);this.trigger("afterrender",t),this._rendering=!1,this._rendered=!0}});t.a=o},function(e,t,i){var n=i(48).a.extend((function(){return{texture:null,outputs:{color:{}}}}),(function(){}),{getOutput:function(e,t){return this.texture},beforeFrame:function(){},afterFrame:function(){}});t.a=n},function(e,t,i){var n=i(16),r=i(48),a=r.a.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 n.a({fragment:this.shader});this.pass=e}),{render:function(e,t){this.trigger("beforerender",e),this._rendering=!0;var i=e.gl;for(var n in this.inputLinks){var r=(c=this.inputLinks[n]).node.getOutput(e,c.pin);this.pass.setUniform(n,r)}if(this.outputs){this.pass.outputs={};var a={};for(var o in this.outputs){var s=this.updateParameter(o,e);isNaN(s.width)&&this.updateParameter(o,e);var l=this.outputs[o],u=this._compositor.allocateTexture(s);this._outputTextures[o]=u,"string"==typeof(h=l.attachment||i.COLOR_ATTACHMENT0)&&(h=i[h]),a[h]=u}for(var h in this._compositor.getFrameBuffer().bind(e),a)this._compositor.getFrameBuffer().attach(a[h],h);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 n in this.inputLinks){var c;(c=this.inputLinks[n]).node.removeReference(c.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",e)},updateParameter:function(e,t){var i,n,r=this.outputs[e],a=r.parameters,o=r._parametersCopy;if(o||(o=r._parametersCopy={}),a)for(var s in a)"width"!==s&&"height"!==s&&(o[s]=a[s]);return i=a.width instanceof Function?a.width.call(this,t):a.width,n=a.height instanceof Function?a.height.call(this,t):a.height,i=Math.ceil(i),n=Math.ceil(n),o.width===i&&o.height===n||this._outputTextures[e]&&this._outputTextures[e].dispose(t),o.width=i,o.height=n,o},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(){r.a.prototype.clear.call(this),this.pass.material.disableTexturesAll()}});t.a=a},function(e,t,i){t.a=function(e){e.import(n.a),e.import(r.a),e.import(a.a),e.import(o.a),e.import(s.a),e.import(l.a),e.import(u.a),e.import(h.a),e.import(c.a),e.import(d.a),e.import(f.a),e.import(p.a),e.import(g.a)};var n=i(185),r=i(87),a=i(186),o=i(88),s=i(187),l=i(89),u=i(90),h=i(91),c=i(92),d=i(93),f=i(188),p=i(94),g=i(95)},function(e,t,i){t.a="@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"},function(e,t,i){t.a="@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"},function(e,t,i){t.a="@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"},function(e,t,i){t.a="@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"},function(e,t,i){var n=i(9),r=i(3),a=i(5),o=i(4),s=i(16),l=i(8),u=i(10),h=i(49),c=i(190);function d(e){for(var t=new Uint8Array(e*e*4),i=0,n=new r.a,a=0;a<e;a++)for(var o=0;o<e;o++)n.set(2*Math.random()-1,2*Math.random()-1,0).normalize(),t[i++]=255*(.5*n.x+.5),t[i++]=255*(.5*n.y+.5),t[i++]=0,t[i++]=255;return t}function f(e){return new a.a({pixels:d(e),wrapS:o.a.REPEAT,wrapT:o.a.REPEAT,width:e,height:e})}function p(e,t,i){var n=new Float32Array(3*e);t=t||0;for(var r=0;r<e;r++){var a=Object(h.a)(r+t,2)*(i?1:2)*Math.PI,o=Object(h.a)(r+t,3)*Math.PI,s=Math.random(),l=Math.cos(a)*Math.sin(o)*s,u=Math.cos(o)*s,c=Math.sin(a)*Math.sin(o)*s;n[3*r]=l,n[3*r+1]=u,n[3*r+2]=c}return n}function g(e){e=e||{},this._ssaoPass=new s.a({fragment:l.a.source("ecgl.ssao.estimate")}),this._blurPass=new s.a({fragment:l.a.source("ecgl.ssao.blur")}),this._framebuffer=new u.a({depthBuffer:!1}),this._ssaoTexture=new a.a,this._blurTexture=new a.a,this._blurTexture2=new a.a,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)}l.a.import(c.a),g.prototype.setDepthTexture=function(e){this._depthTex=e},g.prototype.setNormalTexture=function(e){this._normalTex=e,this._ssaoPass.material[e?"enableTexture":"disableTexture"]("normalTex"),this.setKernelSize(this._kernelSize)},g.prototype.update=function(e,t,i){var r=e.getWidth(),a=e.getHeight(),o=this._ssaoPass,s=this._blurPass;o.setUniform("kernel",this._kernels[i%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 l=new n.a;n.a.transpose(l,t.worldTransform),o.setUniform("projection",t.projectionMatrix.array),o.setUniform("projectionInv",t.invProjectionMatrix.array),o.setUniform("viewInverseTranspose",l.array);var u=this._ssaoTexture,h=this._blurTexture,c=this._blurTexture2;u.width=r/2,u.height=a/2,h.width=r,h.height=a,c.width=r,c.height=a,this._framebuffer.attach(u),this._framebuffer.bind(e),e.gl.clearColor(1,1,1,1),e.gl.clear(e.gl.COLOR_BUFFER_BIT),o.render(e),s.setUniform("textureSize",[r/2,a/2]),s.setUniform("projection",t.projectionMatrix.array),this._framebuffer.attach(h),s.setUniform("direction",0),s.setUniform("ssaoTexture",u),s.render(e),this._framebuffer.attach(c),s.setUniform("textureSize",[r,a]),s.setUniform("direction",1),s.setUniform("ssaoTexture",h),s.render(e),this._framebuffer.unbind(e);var d=e.clearColor;e.gl.clearColor(d[0],d[1],d[2],d[3])},g.prototype.getTargetTexture=function(){return this._blurTexture2},g.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)},g.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]=p(e,t*e,!!this._normalTex)},g.prototype.setNoiseSize=function(e){var t=this._ssaoPass.getUniform("noiseTex");t?(t.data=d(e),t.width=t.height=e,t.dirty()):(t=f(e),this._ssaoPass.setUniform("noiseTex",f(e))),this._ssaoPass.setUniform("noiseTexSize",[e,e])},g.prototype.dispose=function(e){this._blurTexture.dispose(e),this._ssaoTexture.dispose(e),this._blurTexture2.dispose(e)},t.a=g},function(e,t,i){t.a="@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"},function(e,t,i){var n=i(9);i(3);var r=i(5),a=i(4),o=i(16),s=i(8),l=i(10);i(49);var u=i(77),h=i(192);function c(e){e=e||{},this._ssrPass=new o.a({fragment:s.a.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new o.a({fragment:s.a.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new o.a({fragment:s.a.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blendPass=new o.a({fragment:s.a.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 r.a({type:a.a.HALF_FLOAT}),this._texture2=new r.a({type:a.a.HALF_FLOAT}),this._texture3=new r.a({type:a.a.HALF_FLOAT}),this._prevTexture=new r.a({type:a.a.HALF_FLOAT}),this._currentTexture=new r.a({type:a.a.HALF_FLOAT}),this._frameBuffer=new l.a({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}s.a.import(h.a),c.prototype.setAmbientCubemap=function(e,t){this._ssrPass.material.set("specularCubemap",e),this._ssrPass.material.set("specularIntensity",t);var i=e&&t;this._ssrPass.material[i?"enableTexture":"disableTexture"]("specularCubemap")},c.prototype.update=function(e,t,i,r){var a=e.getWidth(),o=e.getHeight(),s=this._ssrTexture,l=this._texture2,u=this._texture3;s.width=this._prevTexture.width=this._currentTexture.width=a/this._downScale,s.height=this._prevTexture.height=this._currentTexture.height=o/this._downScale,l.width=u.width=a,l.height=u.height=o;var h=this._frameBuffer,c=this._ssrPass,d=this._blurPass1,f=this._blurPass2,p=this._blendPass,g=new n.a,m=new n.a;n.a.transpose(g,t.worldTransform),n.a.transpose(m,t.viewMatrix),c.setUniform("sourceTexture",i),c.setUniform("projection",t.projectionMatrix.array),c.setUniform("projectionInv",t.invProjectionMatrix.array),c.setUniform("toViewSpace",g.array),c.setUniform("toWorldSpace",m.array),c.setUniform("nearZ",t.near);var v=r/this._totalSamples*this._samplePerFrame;if(c.setUniform("jitterOffset",v),c.setUniform("sampleOffset",r*this._samplePerFrame),d.setUniform("textureSize",[s.width,s.height]),f.setUniform("textureSize",[a,o]),f.setUniform("sourceTexture",i),d.setUniform("projection",t.projectionMatrix.array),f.setUniform("projection",t.projectionMatrix.array),h.attach(s),h.bind(e),c.render(e),this._physicallyCorrect&&(h.attach(this._currentTexture),p.setUniform("texture1",this._prevTexture),p.setUniform("texture2",s),p.material.set({weight1:r>=1?.95:0,weight2:r>=1?.05:1}),p.render(e)),h.attach(l),d.setUniform("texture",this._physicallyCorrect?this._currentTexture:s),d.render(e),h.attach(u),f.setUniform("texture",l),f.render(e),h.unbind(e),this._physicallyCorrect){var y=this._prevTexture;this._prevTexture=this._currentTexture,this._currentTexture=y}},c.prototype.getTargetTexture=function(){return this._texture3},c.prototype.setParameter=function(e,t){"maxIteration"===e?this._ssrPass.material.define("fragment","MAX_ITERATION",t):this._ssrPass.setUniform(e,t)},c.prototype.setPhysicallyCorrect=function(e){e?(this._normalDistribution||(this._normalDistribution=u.a.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},c.prototype.setSSAOTexture=function(e){var t=this._blurPass2;e?(t.material.enableTexture("ssaoTex"),t.material.set("ssaoTex",e)):t.material.disableTexture("ssaoTex")},c.prototype.isFinished=function(e){return!this._physicallyCorrect||e>this._totalSamples/this._samplePerFrame},c.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)},t.a=c},function(e,t,i){t.a="@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"},function(e,t,i){t.a=[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(e,t,i){var n=i(5),r=i(4),a=i(8),o=i(10),s=i(19),l=i(16),u=i(61),h=i(195);function c(e,t,i,n,r){var a=e.gl;t.setUniform(a,"1i",i,r),a.activeTexture(a.TEXTURE0+r),n.isRenderable()?n.bind(e):n.unbind(e)}function d(e,t,i,n,r){var a,o,s,l,u=e.gl;return function(r,h,d){if(!l||l.material!==r.material){var f=r.material,p=r.__program,g=f.get("roughness");null==g&&(g=1);var m=f.get("normalMap")||t,v=f.get("roughnessMap"),y=f.get("bumpMap"),_=f.get("uvRepeat"),x=f.get("uvOffset"),b=f.get("detailUvRepeat"),w=f.get("detailUvOffset"),T=!!y&&f.isTextureEnabled("bumpMap"),S=!!v&&f.isTextureEnabled("roughnessMap"),M=f.isDefined("fragment","DOUBLE_SIDED");y=y||i,v=v||n,d!==h?(h.set("normalMap",m),h.set("bumpMap",y),h.set("roughnessMap",v),h.set("useBumpMap",T),h.set("useRoughnessMap",S),h.set("doubleSide",M),null!=_&&h.set("uvRepeat",_),null!=x&&h.set("uvOffset",x),null!=b&&h.set("detailUvRepeat",b),null!=w&&h.set("detailUvOffset",w),h.set("roughness",g)):(p.setUniform(u,"1f","roughness",g),a!==m&&c(e,p,"normalMap",m,0),o!==y&&y&&c(e,p,"bumpMap",y,1),s!==v&&v&&c(e,p,"roughnessMap",v,2),null!=_&&p.setUniform(u,"2f","uvRepeat",_),null!=x&&p.setUniform(u,"2f","uvOffset",x),null!=b&&p.setUniform(u,"2f","detailUvRepeat",b),null!=w&&p.setUniform(u,"2f","detailUvOffset",w),p.setUniform(u,"1i","useBumpMap",+T),p.setUniform(u,"1i","useRoughnessMap",+S),p.setUniform(u,"1i","doubleSide",+M)),a=m,o=y,s=v,l=r}}}function f(e){this._depthTex=new n.a({format:r.a.DEPTH_COMPONENT,type:r.a.UNSIGNED_INT}),this._normalTex=new n.a({type:r.a.HALF_FLOAT}),this._framebuffer=new o.a,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,o.a.DEPTH_ATTACHMENT),this._normalMaterial=new s.a({shader:new a.a(a.a.source("ecgl.normal.vertex"),a.a.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=u.a.createBlank("#000"),this._defaultBumpMap=u.a.createBlank("#000"),this._defaultRoughessMap=u.a.createBlank("#000"),this._debugPass=new l.a({fragment:a.a.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}a.a.import(h.a),f.prototype.getDepthTexture=function(){return this._depthTex},f.prototype.getNormalTexture=function(){return this._normalTex},f.prototype.update=function(e,t,i){var n=e.getWidth(),r=e.getHeight(),a=this._depthTex,o=this._normalTex,s=this._normalMaterial;a.width=n,a.height=r,o.width=n,o.height=r;var l=t.getRenderList(i).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,i,{getMaterial:function(){return s},ifRender:function(e){return e.renderNormal},beforeRender:d(e,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:e.opaqueSortCompare}),this._framebuffer.unbind(e)},f.prototype.renderDebug=function(e){this._debugPass.render(e)},f.prototype.dispose=function(e){this._depthTex.dispose(e),this._normalTex.dispose(e)},t.a=f},function(e,t,i){t.a="@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"},function(e,t,i){i(9),i(3);var n=i(5),r=i(4),a=i(16),o=i(8),s=i(10);function l(e){e=e||{},this._edgePass=new a.a({fragment:o.a.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",e.normalTexture),this._edgePass.setUniform("depthTexture",e.depthTexture),this._targetTexture=new n.a({type:r.a.HALF_FLOAT}),this._frameBuffer=new s.a,this._frameBuffer.attach(this._targetTexture)}l.prototype.update=function(e,t,i,n){var r=e.getWidth(),a=e.getHeight(),o=this._targetTexture;o.width=r,o.height=a;var s=this._frameBuffer;s.bind(e),this._edgePass.setUniform("projectionInv",t.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[r,a]),this._edgePass.setUniform("texture",i),this._edgePass.render(e),s.unbind(e)},l.prototype.getTargetTexture=function(){return this._targetTexture},l.prototype.setParameter=function(e,t){this._edgePass.setUniform(e,t)},l.prototype.dispose=function(e){this._targetTexture.dispose(e),this._frameBuffer.dispose(e)},t.a=l},function(e,t,i){t.a={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"},defines:{}},{name:"FXAA",shader:"#source(clay.compositor.fxaa)",inputs:{texture:"composite"}}]}},function(e,t,i){t.a="@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"},function(e,t,i){t.a="@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"},function(e,t,i){var n=i(49),r=i(16),a=i(10),o=i(5),s=i(8),l=i(9);function u(e){for(var t=[],i=0;i<30;i++)t.push([Object(n.a)(i,2),Object(n.a)(i,3)]);this._haltonSequence=t,this._frame=0,this._sourceTex=new o.a,this._sourceFb=new a.a,this._sourceFb.attach(this._sourceTex),this._prevFrameTex=new o.a,this._outputTex=new o.a;var l=this._blendPass=new r.a({fragment:s.a.source("clay.compositor.blend")});l.material.disableTexturesAll(),l.material.enableTexture(["texture1","texture2"]),this._blendFb=new a.a({depthBuffer:!1}),this._outputPass=new r.a({fragment:s.a.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)}}u.prototype={constructor:u,jitterProjection:function(e,t){var i=e.viewport,n=i.devicePixelRatio||e.getDevicePixelRatio(),r=i.width*n,a=i.height*n,o=this._haltonSequence[this._frame%this._haltonSequence.length],s=new l.a;s.array[12]=(2*o[0]-1)/r,s.array[13]=(2*o[1]-1)/a,l.a.mul(t.projectionMatrix,s,t.projectionMatrix),l.a.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,i){var n=this._blendPass;0===this._frame?(n.setUniform("weight1",0),n.setUniform("weight2",1)):(n.setUniform("weight1",.9),n.setUniform("weight2",.1)),n.setUniform("texture1",this._prevFrameTex),n.setUniform("texture2",t||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(e),n.render(e),this._blendFb.unbind(e),i||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(e));var r=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=r,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)}},t.a=u},function(e,t,i){var n=i(0),r=i.n(n);i(202),i(203),i(98),r.a.registerAction({type:"geo3DChangeCamera",event:"geo3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"geo3D",query:e},(function(t){t.setView(e)}))}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(44),o=i(28),s=i(29),l=i(31),u=i(96),h=r.a.extendComponentModel({type:"geo3D",layoutMode:"box",coordinateSystem:null,optionUpdated:function(){var e=this.option;e.regions=this.getFilledRegions(e.regions,e.map);var t=r.a.helper.completeDimensions(["value"],e.data,{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),i=new r.a.List(t,this);i.initData(e.regions);var n={};i.each((function(e){var t=i.getName(e),r=i.getItemModel(e);n[t]=r})),this._regionModelMap=n,this._data=i},getData:function(){return this._data},getRegionModel:function(e){var t=this.getData().getName(e);return this._regionModelMap[t]||new r.a.Model(null,this)},getRegionPolygonCoords:function(e){var t=this.getData().getName(e),i=this.coordinateSystem.getRegion(t);return i?i.geometries:[]},getFormattedLabel:function(e,t){var i=this._data.getName(e),n=this.getRegionModel(i),r=n.get("normal"===t?["label","formatter"]:["emphasis","label","formatter"]);null==r&&(r=n.get(["label","formatter"]));var a={name:i};if("function"==typeof r)return a.status=t,r(a);if("string"==typeof r){var o=a.seriesName;return r.replace("{a}",null!=o?o:"")}return i},defaultOption:{regions:[]}});r.a.util.merge(h.prototype,u.a),r.a.util.merge(h.prototype,a.a),r.a.util.merge(h.prototype,o.a),r.a.util.merge(h.prototype,s.a),r.a.util.merge(h.prototype,l.a)},function(e,t,i){var n=i(64),r=i(0),a=i.n(r),o=i(1),s=i(45),l=i(30);a.a.extendComponentView({type:"geo3D",__ecgl__:!0,init:function(e,t){this._geo3DBuilder=new n.a(t),this.groupGL=new o.a.Node,this._lightRoot=new o.a.Node,this._sceneHelper=new l.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot),this._control=new s.a({zr:t.getZr()}),this._control.init()},render:function(e,t,i){this.groupGL.add(this._geo3DBuilder.rootNode);var n=e.coordinateSystem;if(n&&n.viewGL){n.viewGL.add(this._lightRoot),e.get("show")?n.viewGL.add(this.groupGL):n.viewGL.remove(this.groupGL);var r=this._control;r.setViewGL(n.viewGL);var a=e.getModel("viewControl");r.setFromViewControlModel(a,0),this._sceneHelper.setScene(n.viewGL.scene),this._sceneHelper.updateLight(e),n.viewGL.setPostEffect(e.getModel("postEffect"),i),n.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._geo3DBuilder.update(e,t,i,0,e.getData().count());var o=n.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse((function(e){e.material&&e.material[o]("fragment","SRGB_DECODE")})),r.off("update"),r.on("update",(function(){i.dispatchAction({type:"geo3DChangeCamera",alpha:r.getAlpha(),beta:r.getBeta(),distance:r.getDistance(),center:r.getCenter(),from:this.uid,geo3DId:e.id})})),r.update()}},afterRender:function(e,t,i,n){var r=n.renderer;this._sceneHelper.updateAmbientCubemap(r,e,i),this._sceneHelper.updateSkybox(r,e,i)},dispose:function(){this._control.dispose()}})},function(e,t,i){function n(e,t,i){i=i||2;var n,s,l,u,h,f,g,m=t&&t.length,v=m?t[0]*i:e.length,y=r(e,0,v,i,!0),_=[];if(!y)return _;if(m&&(y=function(e,t,i,n){var o,s,l,u=[];for(o=0,s=t.length;o<s;o++)(l=r(e,t[o]*n,o<s-1?t[o+1]*n:e.length,n,!1))===l.next&&(l.steiner=!0),u.push(p(l));for(u.sort(c),o=0;o<u.length;o++)d(u[o],i),i=a(i,i.next);return i}(e,t,y,i)),e.length>80*i){n=l=e[0],s=u=e[1];for(var x=i;x<v;x+=i)(h=e[x])<n&&(n=h),(f=e[x+1])<s&&(s=f),h>l&&(l=h),f>u&&(u=f);g=Math.max(l-n,u-s)}return o(y,_,i,n,s,g),_}function r(e,t,i,n,r){var a,o;if(r===M(e,t,i,n)>0)for(a=t;a<i;a+=n)o=w(a,e[a],e[a+1],o);else for(a=i-n;a>=t;a-=n)o=w(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(T(o),o=o.next),o}function a(e,t){if(!e)return e;t||(t=e);var i,n=e;do{if(i=!1,n.steiner||!y(n,n.next)&&0!==v(n.prev,n,n.next))n=n.next;else{if(T(n),(n=t=n.prev)===n.next)return null;i=!0}}while(i||n!==t);return t}function o(e,t,i,n,r,c,d){if(e){!d&&c&&function(e,t,i,n){var r=e;do{null===r.z&&(r.z=f(r.x,r.y,t,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,i,n,r,a,o,s,l,u=1;do{for(i=e,e=null,a=null,o=0;i;){for(o++,n=i,s=0,t=0;t<u&&(s++,n=n.nextZ);t++);for(l=u;s>0||l>0&&n;)0!==s&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,s--):(r=n,n=n.nextZ,l--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;i=n}a.nextZ=null,u*=2}while(o>1)}(r)}(e,n,r,c);for(var p,g,m=e;e.prev!==e.next;)if(p=e.prev,g=e.next,c?l(e,n,r,c):s(e))t.push(p.i/i),t.push(e.i/i),t.push(g.i/i),T(e),e=g.next,m=g.next;else if((e=g)===m){d?1===d?o(e=u(e,t,i),t,i,n,r,c,2):2===d&&h(e,t,i,n,r,c):o(a(e),t,i,n,r,c,1);break}}}function s(e){var t=e.prev,i=e,n=e.next;if(v(t,i,n)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(g(t.x,t.y,i.x,i.y,n.x,n.y,r.x,r.y)&&v(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function l(e,t,i,n){var r=e.prev,a=e,o=e.next;if(v(r,a,o)>=0)return!1;for(var s=r.x<a.x?r.x<o.x?r.x:o.x:a.x<o.x?a.x:o.x,l=r.y<a.y?r.y<o.y?r.y:o.y:a.y<o.y?a.y:o.y,u=r.x>a.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,h=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,c=f(s,l,t,i,n),d=f(u,h,t,i,n),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=c;){if(p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function u(e,t,i){var n=e;do{var r=n.prev,a=n.next.next;!y(r,a)&&_(r,n,n.next,a)&&x(r,a)&&x(a,r)&&(t.push(r.i/i),t.push(n.i/i),t.push(a.i/i),T(n),T(n.next),n=e=a),n=n.next}while(n!==e);return n}function h(e,t,i,n,r,s){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&m(l,u)){var h=b(l,u);return l=a(l,l.next),h=a(h,h.next),o(l,t,i,n,r,s),void o(h,t,i,n,r,s)}u=u.next}l=l.next}while(l!==e)}function c(e,t){return e.x-t.x}function d(e,t){if(t=function(e,t){var i,n=t,r=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>o){if(o=s,s===r){if(a===n.y)return n;if(a===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!i)return null;if(r===o)return i.prev;var l,u=i,h=i.x,c=i.y,d=1/0;for(n=i.next;n!==u;)r>=n.x&&n.x>=h&&r!==n.x&&g(a<c?r:o,a,h,c,a<c?o:r,a,n.x,n.y)&&((l=Math.abs(a-n.y)/(r-n.x))<d||l===d&&n.x>i.x)&&x(n,e)&&(i=n,d=l),n=n.next;return i}(e,t),t){var i=b(t,e);a(i,i.next)}}function f(e,t,i,n,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)/r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)/r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function p(e){var t=e,i=e;do{t.x<i.x&&(i=t),t=t.next}while(t!==e);return i}function g(e,t,i,n,r,a,o,s){return(r-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(n-s)-(i-o)*(t-s)>=0&&(i-o)*(a-s)-(r-o)*(n-s)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&_(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&x(e,t)&&x(t,e)&&function(e,t){var i=e,n=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{i.y>a!=i.next.y>a&&i.next.y!==i.y&&r<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)}function v(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function _(e,t,i,n){return!!(y(e,t)&&y(i,n)||y(e,n)&&y(i,t))||v(e,t,i)>0!=v(e,t,n)>0&&v(i,n,e)>0!=v(i,n,t)>0}function x(e,t){return v(e.prev,e,e.next)<0?v(e,t,e.next)>=0&&v(e,e.prev,t)>=0:v(e,t,e.prev)<0||v(e,e.next,t)<0}function b(e,t){var i=new S(e.i,e.x,e.y),n=new S(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,a.next=n,n.prev=a,n}function w(e,t,i,n){var r=new S(e,t,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function T(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 S(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,i,n){for(var r=0,a=t,o=i-n;a<i;a+=n)r+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return r}t.a=n,n.deviation=function(e,t,i,n){var r=t&&t.length,a=r?t[0]*i:e.length,o=Math.abs(M(e,0,a,i));if(r)for(var s=0,l=t.length;s<l;s++){var u=t[s]*i,h=s<l-1?t[s+1]*i:e.length;o-=Math.abs(M(e,u,h,i))}var c=0;for(s=0;s<n.length;s+=3){var d=n[s]*i,f=n[s+1]*i,p=n[s+2]*i;c+=Math.abs((e[d]-e[p])*(e[f+1]-e[d+1])-(e[d]-e[f])*(e[p+1]-e[d+1]))}return 0===o&&0===c?0:Math.abs((c-o)/o)}},function(e,t,i){var n=i(13),r={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]};e.exports=function(e){n.each(e.regions,(function(e){var t=r[e.name];if(t){var i=e.center;i[0]+=t[0]/10.5,i[1]+=-t[1]/14}}))}},function(e,t,i){var n=i(13),r={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};e.exports=function(e){n.each(e.regions,(function(e){var t=r[e.name];if(t){var i=e.center;i[0]=t[0],i[1]=t[1]}}))}},function(e,t,i){var n=i(0),r=i.n(n);i(208),i(209),i(211),r.a.registerAction({type:"globeChangeCamera",event:"globecamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"globe",query:e},(function(t){t.setView(e)}))})),r.a.registerAction({type:"globeUpdateDisplacment",event:"globedisplacementupdated",update:"update"},(function(e,t){}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(44),o=i(28),s=i(29),l=i(31);function u(e,t){e.id=e.id||e.name||t+""}var h=r.a.extendComponentModel({type:"globe",layoutMode:"box",coordinateSystem:null,init:function(){h.superApply(this,"init",arguments),r.a.util.each(this.option.layers,(function(e,t){r.a.util.merge(e,this.defaultLayerOption),u(e,t)}),this)},mergeOption:function(e){var t=this.option.layers;function i(e){return r.a.util.reduce(e,(function(e,t,i){return u(t,i),e[t.id]=t,e}),{})}if(this.option.layers=null,h.superApply(this,"mergeOption",arguments),t&&t.length){var n=i(e.layers),a=i(t);for(var o in n)a[o]?r.a.util.merge(a[o],n[o],!0):t.push(e.layers[o]);this.option.layers=t}r.a.util.each(this.option.layers,(function(e){r.a.util.merge(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:""}},viewControl:{autoRotate:!0,panSensitivity:0,targetCoord:null},layers:[]},setDisplacementData:function(e,t,i){this.displacementData=e,this.displacementWidth=t,this.displacementHeight=i},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.a.util.merge(h.prototype,a.a),r.a.util.merge(h.prototype,o.a),r.a.util.merge(h.prototype,s.a),r.a.util.merge(h.prototype,l.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(45),s=i(30),l=i(210),u=i(2);r.a.extendComponentView({type:"globe",__ecgl__:!0,_displacementScale:0,init:function(e,t){this.groupGL=new a.a.Node,this._sphereGeometry=new a.a.SphereGeometry({widthSegments:200,heightSegments:100,dynamic:!0}),this._overlayGeometry=new a.a.SphereGeometry({widthSegments:80,heightSegments:40}),this._planeGeometry=new a.a.PlaneGeometry,this._earthMesh=new a.a.Mesh({renderNormal:!0}),this._lightRoot=new a.a.Node,this._sceneHelper=new s.a,this._sceneHelper.initLight(this._lightRoot),this.groupGL.add(this._earthMesh),this._control=new o.a({zr:t.getZr()}),this._control.init(),this._layerMeshes={}},render:function(e,t,i){var n=e.coordinateSystem,r=e.get("shading");n.viewGL.add(this._lightRoot),e.get("show")?n.viewGL.add(this.groupGL):n.viewGL.remove(this.groupGL),this._sceneHelper.setScene(n.viewGL.scene),n.viewGL.setPostEffect(e.getModel("postEffect"),i),n.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));var o=this._earthMesh;o.geometry=this._sphereGeometry;var s="ecgl."+r;o.material&&o.material.shader.name===s||(o.material=a.a.createMaterial(s)),a.a.setMaterialFromModel(r,o.material,e,i),["roughnessMap","metalnessMap","detailMap","normalMap"].forEach((function(e){var t=o.material.get(e);t&&(t.flipY=!1)})),o.material.set("color",a.a.parseColor(e.get("baseColor")));var l=.99*n.radius;o.scale.set(l,l,l);var u=o.material.setTextureImage("diffuseMap",e.get("baseTexture"),i,{flipY:!1,anisotropic:8});u&&u.surface&&u.surface.attachToMesh(o);var h=o.material.setTextureImage("bumpMap",e.get("heightTexture"),i,{flipY:!1,anisotropic:8});h&&h.surface&&h.surface.attachToMesh(o),o.material[e.get("postEffect.enable")?"define":"undefine"]("fragment","SRGB_DECODE"),this._updateLight(e,i),this._displaceVertices(e,i),this._updateViewControl(e,i),this._updateLayers(e,i)},afterRender:function(e,t,i,n){var r=n.renderer;this._sceneHelper.updateAmbientCubemap(r,e,i),this._sceneHelper.updateSkybox(r,e,i)},_updateLayers:function(e,t){var i=e.coordinateSystem,n=e.get("layers"),o=i.radius,s=[],l=[],h=[],c=[];r.a.util.each(n,(function(e){var n=new r.a.Model(e),d=n.get("type"),f=a.a.loadTexture(n.get("texture"),t,{flipY:!1,anisotropic:8});if(f.surface&&f.surface.attachToMesh(this._earthMesh),"blend"===d){var p=n.get("blendTo"),g=u.a.firstNotNull(n.get("intensity"),1);"emission"===p?(h.push(f),c.push(g)):(s.push(f),l.push(g))}else{var m=n.get("id"),v=this._layerMeshes[m];v||(v=this._layerMeshes[m]=new a.a.Mesh({geometry:this._overlayGeometry,castShadow:!1,ignorePicking:!0})),"lambert"===n.get("shading")?(v.material=v.__lambertMaterial||new a.a.Material({autoUpdateTextureStatus:!1,shader:a.a.createShader("ecgl.lambert"),transparent:!0,depthMask:!1}),v.__lambertMaterial=v.material):(v.material=v.__colorMaterial||new a.a.Material({autoUpdateTextureStatus:!1,shader:a.a.createShader("ecgl.color"),transparent:!0,depthMask:!1}),v.__colorMaterial=v.material),v.material.enableTexture("diffuseMap");var y=n.get("distance"),_=o+(null==y?i.radius/100:y);v.scale.set(_,_,_),o=_;var x=this._blankTexture||(this._blankTexture=a.a.createBlankTexture("rgba(255, 255, 255, 0)"));v.material.set("diffuseMap",x),a.a.loadTexture(n.get("texture"),t,{flipY:!1,anisotropic:8},(function(e){e.surface&&e.surface.attachToMesh(v),v.material.set("diffuseMap",e),t.getZr().refresh()})),n.get("show")?this.groupGL.add(v):this.groupGL.remove(v)}}),this);var d=this._earthMesh.material;d.define("fragment","LAYER_DIFFUSEMAP_COUNT",s.length),d.define("fragment","LAYER_EMISSIVEMAP_COUNT",h.length),d.set("layerDiffuseMap",s),d.set("layerDiffuseIntensity",l),d.set("layerEmissiveMap",h),d.set("layerEmissionIntensity",c);var f=e.getModel("debug.wireframe");if(f.get("show")){d.define("both","WIREFRAME_TRIANGLE");var p=a.a.parseColor(f.get("lineStyle.color")||"rgba(0,0,0,0.5)"),g=u.a.firstNotNull(f.get("lineStyle.width"),1);d.set("wireframeLineWidth",g),d.set("wireframeLineColor",p)}else d.undefine("both","WIREFRAME_TRIANGLE")},_updateViewControl:function(e,t){var i=e.coordinateSystem,n=e.getModel("viewControl");i.viewGL.camera;var r=this,a=this._control;a.setViewGL(i.viewGL);var o,s,l=n.get("targetCoord");null!=l&&(s=l[0]+90,o=l[1]),a.setFromViewControlModel(n,{baseDistance:i.radius,alpha:o,beta:s}),a.off("update"),a.on("update",(function(){t.dispatchAction({type:"globeChangeCamera",alpha:a.getAlpha(),beta:a.getBeta(),distance:a.getDistance()-i.radius,center:a.getCenter(),from:r.uid,globeId:e.id})}))},_displaceVertices:function(e,t){var i=e.get("displacementQuality"),n=e.get("debug.wireframe.show"),r=e.coordinateSystem;if(e.isDisplacementChanged()||i!==this._displacementQuality||n!==this._showDebugWireframe){this._displacementQuality=i,this._showDebugWireframe=n;var a=this._sphereGeometry,o={low:100,medium:200,high:400,ultra:800}[i]||200,s=o/2;(a.widthSegments!==o||n)&&(a.widthSegments=o,a.heightSegments=s,a.build()),this._doDisplaceVertices(a,r),n&&a.generateBarycentric()}},_doDisplaceVertices:function(e,t){var i=e.attributes.position.value,n=e.attributes.texcoord0.value,r=e.__originalPosition;r&&r.length===i.length||((r=new Float32Array(i.length)).set(i),e.__originalPosition=r);for(var a=t.displacementWidth,o=t.displacementHeight,s=t.displacementData,l=0;l<e.vertexCount;l++){var u=3*l,h=2*l,c=r[u+1],d=r[u+2],f=r[u+3],p=n[h++],g=n[h++],m=Math.round(p*(a-1)),v=Math.round(g*(o-1)),y=s?s[v*a+m]:0;i[u+1]=c+c*y,i[u+2]=d+d*y,i[u+3]=f+f*y}e.generateVertexNormals(),e.dirty(),e.updateBoundingBox()},_updateLight:function(e,t){var i=this._earthMesh;this._sceneHelper.updateLight(e);var n=this._sceneHelper.mainLight,a=e.get("light.main.time")||new Date,o=l.a.getPosition(r.a.number.parseDate(a),0,0),s=Math.cos(o.altitude);n.position.y=-s*Math.cos(o.azimuth),n.position.x=Math.sin(o.altitude),n.position.z=s*Math.sin(o.azimuth),n.lookAt(i.getWorldPosition())},dispose:function(e,t){this.groupGL.removeAll(),this._control.dispose()}})},function(e,t,i){var n=Math.PI,r=Math.sin,a=Math.cos,o=Math.tan,s=Math.asin,l=Math.atan2,u=n/180,h=23.4397*u;function c(e,t){return l(r(e)*a(h)-o(t)*r(h),a(e))}function d(e,t,i){return l(r(e),a(e)*r(t)-o(i)*a(t))}function f(e,t,i){return s(r(t)*r(i)+a(t)*a(i)*a(e))}function p(e){var t,i,o=function(e){return u*(357.5291+.98560028*e)}(e),l=function(e){return e+u*(1.9148*r(e)+.02*r(2*e)+3e-4*r(3*e))+102.9372*u+n}(o);return{dec:(t=l,i=0,s(r(i)*a(h)+a(i)*r(h)*r(t))),ra:c(l,0)}}var g={getPosition:function(e,t,i){var n=u*-i,r=u*t,a=function(e){return function(e){return e.valueOf()/864e5-.5+2440588}(e)-2451545}(e),o=p(a),s=function(e,t){return u*(280.16+360.9856235*e)-t}(a,n)-o.ra;return{azimuth:d(s,r,o.dec),altitude:f(s,r,o.dec)}}};t.a=g},function(e,t,i){var n=i(212),r=i(0),a=i.n(r),o=i(47),s=i.n(o),l=i(22),u=i(2),h=i(1);function c(e,t){var i=e.getBoxLayoutParams(),n=s.a.getLayoutRect(i,{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 d(e,t){var i=[1/0,-1/0];if(e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData(),n=e.coordDimToDataDim("alt"),r=n&&n[0];if(r){var a=t.getDataExtent(r,!0);i[0]=Math.min(i[0],a[0]),i[1]=Math.max(i[1],a[1])}}}),this),i&&isFinite(i[1]-i[0])){var n=a.a.helper.createScale(i,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new a.a.Axis("altitude",n),this.resize(this.model,t)}}var f={dimensions:n.a.prototype.dimensions,create:function(e,t){var i=[];return e.eachComponent("globe",(function(e){e.__viewGL=e.__viewGL||new l.a;var r=new n.a;r.viewGL=e.__viewGL,e.coordinateSystem=r,r.model=e,i.push(r),r.resize=c,r.resize(e,t),r.update=d})),e.eachSeries((function(t){if("globe"===t.get("coordinateSystem")){var i=t.getReferringComponents("globe")[0];if(i||(i=e.getComponent("globe")),!i)throw new Error('globe "'+u.a.firstNotNull(t.get("globe3DIndex"),t.get("globe3DId"),0)+'" not found');var n=i.coordinateSystem;t.coordinateSystem=n}})),e.eachComponent("globe",(function(e,i){var n=e.coordinateSystem,r=e.getDisplacementTexture(),a=e.getDisplacemenScale();if(e.isDisplacementChanged()){if(e.hasDisplacement()){var o=!0;h.a.loadTexture(r,t,(function(i){var n=function(e,t){var i=document.createElement("canvas"),n=i.getContext("2d"),r=e.width,a=e.height;i.width=r,i.height=a,n.drawImage(e,0,0,r,a);for(var o=n.getImageData(0,0,r,a).data,s=new Float32Array(o.length/4),l=0;l<o.length/4;l++){var u=o[4*l];s[l]=u/255*t}return{data:s,width:r,height:a}}(i.image,a);e.setDisplacementData(n.data,n.width,n.height),o||t.dispatchAction({type:"globeUpdateDisplacment"})})),o=!1}else n.setDisplacementData(null,0,0);n.setDisplacementData(e.displacementData,e.displacementWidth,e.displacementHeight)}})),i}};a.a.registerCoordinateSystem("globe",f)},function(e,t,i){var n=i(6).a.vec3;function r(e){this.radius=e,this.viewGL=null,this.altitudeAxis,this.displacementData=null,this.displacementWidth,this.displacementHeight}r.prototype={constructor:r,dimensions:["lng","lat","alt"],type:"globe",containPoint:function(){},setDisplacementData:function(e,t,i){this.displacementData=e,this.displacementWidth=t,this.displacementHeight=i},_getDisplacementScale:function(e,t){var i=(e+180)/360*(this.displacementWidth-1),n=(90-t)/180*(this.displacementHeight-1),r=Math.round(i)+Math.round(n)*this.displacementWidth;return this.displacementData[r]},dataToPoint:function(e,t){var i=e[0],n=e[1],r=e[2]||0,a=this.radius;this.displacementData&&(a*=1+this._getDisplacementScale(i,n)),this.altitudeAxis&&(a+=this.altitudeAxis.dataToCoord(r)),i=i*Math.PI/180,n=n*Math.PI/180;var o=Math.cos(n)*a;return(t=t||[])[0]=-o*Math.cos(i+Math.PI),t[1]=Math.sin(n)*a,t[2]=o*Math.sin(i+Math.PI),t},pointToData:function(e,t){var i=e[0],r=e[1],a=e[2],o=n.len(e);i/=o,r/=o,a/=o;var s=Math.asin(r),l=Math.atan2(a,-i);l<0&&(l=2*Math.PI+l);var u=180*s/Math.PI,h=180*l/Math.PI-180;return(t=t||[])[0]=h,t[1]=u,t[2]=o-this.radius,this.altitudeAxis&&(t[2]=this.altitudeAxis.coordToData(t[2])),t}},t.a=r},function(e,t,i){var n=i(0),r=i.n(n);i(214),i(216),i(217),r.a.registerAction({type:"mapbox3DChangeCamera",event:"mapbox3dcamerachanged",update:"mapbox3D:updateCamera"},(function(e,t){t.eachComponent({mainType:"mapbox3D",query:e},(function(t){t.setMapboxCameraOption(e)}))}))},function(e,t,i){var n=i(215),r=i(0),a=i.n(r),o=i(101),s=Object(o.a)("mapbox3D",n.a,(function(e){e.forEach((function(e){e.setCameraOption(e.model.getMapboxCameraOption())}))}));a.a.registerCoordinateSystem("mapbox3D",s)},function(e,t,i){var n=i(100);function r(){n.a.apply(this,arguments)}r.prototype=new n.a,r.prototype.constructor=r,r.prototype.type="mapbox3D",t.a=r},function(e,t,i){var n=i(0),r=i.n(n),a=i(28),o=i(29),s=["zoom","center","pitch","bearing"],l=r.a.extendComponentModel({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 s.reduce((function(t,i){return t[i]=e.get(i),t}),{})},setMapboxCameraOption:function(e){null!=e&&s.forEach((function(t){null!=e[t]&&(this.option[t]=e[t])}),this)},getMapbox:function(){return this._mapbox},setMapbox:function(e){this._mapbox=e}});r.a.util.merge(l.prototype,a.a),r.a.util.merge(l.prototype,o.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(218),o=i(30),s=i(1),l=i(102);s.a.Shader.import(l.a),r.a.extendComponentView({type:"mapbox3D",__ecgl__:!0,init:function(e,t){var i=t.getZr();this._zrLayer=new a.a("mapbox3D",i),i.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new s.a.Node,this._sceneHelper=new o.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var n=this._zrLayer.getMapbox(),r=this._dispatchInteractAction.bind(this,t,n);["zoom","rotate","drag","pitch","rotate","move"].forEach((function(e){n.on(e,r)})),this._groundMesh=new s.a.Mesh({geometry:new s.a.PlaneGeometry,material:new s.a.Material({shader:new s.a.Shader({vertex:s.a.Shader.source("ecgl.displayShadow.vertex"),fragment:s.a.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},render:function(e,t,i){var n=this._zrLayer.getMapbox(),r=e.get("style"),a=JSON.stringify(r);a!==this._oldStyleStr&&r&&n.setStyle(r),this._oldStyleStr=a,n.setCenter(e.get("center")),n.setZoom(e.get("zoom")),n.setPitch(e.get("pitch")),n.setBearing(e.get("bearing")),e.setMapbox(n);var o=e.coordinateSystem;o.viewGL.scene.add(this._lightRoot),o.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(o.viewGL.scene),this._sceneHelper.updateLight(e),o.viewGL.setPostEffect(e.getModel("postEffect"),i),o.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._mapbox3DModel=e},afterRender:function(e,t,i,n){var r=n.renderer;this._sceneHelper.updateAmbientCubemap(r,e,i),this._sceneHelper.updateSkybox(r,e,i),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,i,n){e.coordinateSystem.setCameraOption(n),this._updateGroundMesh(),i.getZr().refresh()},_dispatchInteractAction:function(e,t,i){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 i=new s.a.Plane(new s.a.Vector3(0,0,1),0),n=e.viewGL.camera.castRay(new s.a.Vector2(-1,-1)),r=e.viewGL.camera.castRay(new s.a.Vector2(1,1)),a=n.intersectPlane(i),o=r.intersectPlane(i),l=a.dist(o)/e.viewGL.rootNode.scale.x;this._groundMesh.scale.set(l,l,1)}},dispose:function(e,t){this._zrLayer&&this._zrLayer.dispose(),t.getZr().painter.delLayer(-1e3)}})},function(e,t,i){function n(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()}n.prototype.resize=function(){this._mapbox.resize()},n.prototype.getMapbox=function(){return this._mapbox},n.prototype.clear=function(){},n.prototype.refresh=function(){this._mapbox.resize()};var r=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel"];n.prototype._initEvents=function(){var e=this._mapbox.getCanvasContainer();this._handlers=this._handlers||{contextmenu:function(e){return e.preventDefault(),!1}},r.forEach((function(t){this._handlers[t]=function(t){var i={};for(var n in t)i[n]=t[n];i.bubbles=!1;var r=new t.constructor(t.type,i);e.dispatchEvent(r)},this.zr.dom.addEventListener(t,this._handlers[t])}),this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},n.prototype.dispose=function(){r.forEach((function(e){this.zr.dom.removeEventListener(e,this._handlers[e])}),this)},t.a=n},function(e,t,i){var n=i(0),r=i.n(n);i(220),i(222),i(223),r.a.registerAction({type:"maptalks3DChangeCamera",event:"maptalks3dcamerachanged",update:"maptalks3D:updateCamera"},(function(e,t){t.eachComponent({mainType:"maptalks3D",query:e},(function(t){t.setMaptalksCameraOption(e)}))}))},function(e,t,i){var n=i(221),r=i(0),a=i.n(r),o=i(101),s=Object(o.a)("maptalks3D",n.a,(function(e){e.forEach((function(e){e.setCameraOption(e.model.getMaptalksCameraOption())}))}));a.a.registerCoordinateSystem("maptalks3D",s)},function(e,t,i){var n=i(100);function r(){n.a.apply(this,arguments),this.maxPitch=85,this.zoomOffset=1}r.prototype=new n.a,r.prototype.constructor=r,r.prototype.type="maptalks3D",t.a=r},function(e,t,i){var n=i(0),r=i.n(n),a=i(28),o=i(29),s=["zoom","center","pitch","bearing"],l=r.a.extendComponentModel({type:"maptalks3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,urlTemplate:"http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",attribution:'© <a href="http://osm.org">OpenStreetMap</a> contributors, © <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 s.reduce((function(t,i){return t[i]=e.get(i),t}),{})},setMaptalksCameraOption:function(e){null!=e&&s.forEach((function(t){null!=e[t]&&(this.option[t]=e[t])}),this)},getMaptalks:function(){return this._maptalks},setMaptalks:function(e){this._maptalks=e}});r.a.util.merge(l.prototype,a.a),r.a.util.merge(l.prototype,o.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(224),o=i(30),s=i(1),l=i(102);s.a.Shader.import(l.a),r.a.extendComponentView({type:"maptalks3D",__ecgl__:!0,init:function(e,t){this._groundMesh=new s.a.Mesh({geometry:new s.a.PlaneGeometry,material:new s.a.Material({shader:new s.a.Shader({vertex:s.a.Shader.source("ecgl.displayShadow.vertex"),fragment:s.a.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},_initMaptalksLayer:function(e,t){var i=t.getZr();this._zrLayer=new a.a("maptalks3D",i,e.get("center"),e.get("zoom")),i.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new s.a.Node,this._sceneHelper=new o.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var n=this._zrLayer.getMaptalks(),r=this._dispatchInteractAction.bind(this,t,n);["zoomend","zooming","zoomstart","dragrotating","pitch","pitchend","movestart","moving","moveend","resize","touchstart","touchmove","touchend"].forEach((function(e){n.on(e,r)}))},render:function(e,t,i){this._zrLayer||this._initMaptalksLayer(e,i);var n=this._zrLayer.getMaptalks(),r=e.get("urlTemplate"),a=n.getBaseLayer();r!==this._oldUrlTemplate&&(a?a.setOptions({urlTemplate:r,attribution:e.get("attribution")}):(a=new maptalks.TileLayer("maptalks-echarts-gl-baselayer",{urlTemplate:r,subdomains:["a","b","c"],attribution:e.get("attribution")}),n.setBaseLayer(a))),this._oldUrlTemplate=r,n.setCenter(e.get("center")),n.setZoom(e.get("zoom"),{animation:!1}),n.setPitch(e.get("pitch")),n.setBearing(e.get("bearing")),e.setMaptalks(n);var o=e.coordinateSystem;o.viewGL.scene.add(this._lightRoot),o.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(o.viewGL.scene),this._sceneHelper.updateLight(e),o.viewGL.setPostEffect(e.getModel("postEffect"),i),o.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._maptalks3DModel=e},afterRender:function(e,t,i,n){var r=n.renderer;this._sceneHelper.updateAmbientCubemap(r,e,i),this._sceneHelper.updateSkybox(r,e,i),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,i,n){e.coordinateSystem.setCameraOption(n),this._updateGroundMesh(),i.getZr().refresh()},_dispatchInteractAction:function(e,t,i){e.dispatchAction({type:"maptalks3DChangeCamera",pitch:t.getPitch(),zoom:t.getZoom(),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 i=new s.a.Plane(new s.a.Vector3(0,0,1),0),n=e.viewGL.camera.castRay(new s.a.Vector2(-1,-1)),r=e.viewGL.camera.castRay(new s.a.Vector2(1,1)),a=n.intersectPlane(i),o=r.intersectPlane(i),l=a.dist(o)/e.viewGL.rootNode.scale.x;this._groundMesh.scale.set(l,l,1)}},dispose:function(e,t){this._zrLayer&&this._zrLayer.dispose(),t.getZr().painter.delLayer(-1e3)}})},function(e,t,i){function n(e,t,i,n){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:i,zoom:n,fog:!1}),this._initEvents()}n.prototype.resize=function(){this._maptalks.checkSize()},n.prototype.getMaptalks=function(){return this._maptalks},n.prototype.clear=function(){},n.prototype.refresh=function(){this._maptalks.checkSize()};var r=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","DOMMouseScroll","touchstart","touchend","touchmove","touchcancel"];n.prototype._initEvents=function(){var e=this.dom;this._handlers=this._handlers||{contextmenu:function(e){return e.preventDefault(),!1}},r.forEach((function(t){this._handlers[t]=function(i){var n={};for(var r in i)n[r]=i[r];n.bubbles=!1;var a=new i.constructor(i.type,n);"mousewheel"===t||"DOMMouseScroll"===t?e.dispatchEvent(a):e.firstElementChild.dispatchEvent(a)},this.zr.dom.addEventListener(t,this._handlers[t])}),this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},n.prototype.dispose=function(){r.forEach((function(e){this.zr.dom.removeEventListener(e,this._handlers[e])}),this),this._maptalks.remove()},t.a=n},function(e,t,i){var n=i(0),r=i.n(n);i(226),i(229),i(231);var a=i(17);r.a.registerVisual(Object(a.a)("bar3D")),r.a.registerProcessor((function(e,t){e.eachSeriesByType("bar3d",(function(e){var t=e.getData();t.filterSelf((function(e){return t.hasValue(e)}))}))}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(3),o=i(6),s=i(227),l=i(228),u=o.a.vec3,h=r.a.helper.dataStack.isDimensionStacked;function c(e,t){var i=h(e,t[2]);return{dimension:i?e.getCalculationInfo("stackResultDimension"):t[2],isStacked:i}}r.a.registerLayout((function(e,t){e.eachSeriesByType("bar3D",(function(e){var t=e.coordinateSystem,i=t&&t.type;if("globe"===i)!function(e,t){var i=e.getData(),n=e.get("minHeight")||0,o=e.get("barSize"),s=["lng","lat","alt"].map((function(t){return e.coordDimToDataDim(t)[0]}));if(null==o){var h=t.radius*Math.PI,d=Object(l.a)(i,s[0],s[1]);o=[h/Math.sqrt(i.count()/d),h/Math.sqrt(i.count()/d)]}else r.a.util.isArray(o)||(o=[o,o]);var f=c(i,s);i.each(s,(function(e,r,a,s){var l=i.get(f.dimension,s),h=f.isStacked?l-a:t.altitudeAxis.scale.getExtent()[0],c=Math.max(t.altitudeAxis.dataToCoord(a),n),d=t.dataToPoint([e,r,h]),p=t.dataToPoint([e,r,l]),g=u.sub([],p,d);u.normalize(g,g);var m=[o[0],c,o[1]];i.setItemLayout(s,[d,g,m])})),i.setLayout("orient",a.a.UP.array)}(e,t);else if("cartesian3D"===i)Object(s.a)(e,t);else if("geo3D"===i)!function(e,t){var i=e.getData(),n=e.get("barSize"),a=e.get("minHeight")||0,o=["lng","lat","alt"].map((function(t){return e.coordDimToDataDim(t)[0]}));if(null==n){var s=Math.min(t.size[0],t.size[2]),u=Object(l.a)(i,o[0],o[1]);n=[s/Math.sqrt(i.count()/u),s/Math.sqrt(i.count()/u)]}else r.a.util.isArray(n)||(n=[n,n]);var h=[0,1,0],d=c(i,o);i.each(o,(function(e,r,o,s){var l=i.get(d.dimension,s),u=d.isStacked?l-o:t.altitudeAxis.scale.getExtent()[0],c=Math.max(t.altitudeAxis.dataToCoord(o),a),f=t.dataToPoint([e,r,u]),p=[n[0],c,n[1]];i.setItemLayout(s,[f,h,p])})),i.setLayout("orient",[1,0,0])}(e,t);else{if("mapbox3D"!==i&&"maptalks3D"!==i)throw t?new Error("bar3D doesn't support coordinate system "+t.type):new Error("bar3D doesn't have coordinate system.");!function(e,t){var i=e.getData(),n=e.coordDimToDataDim("lng")[0],a=e.coordDimToDataDim("lat")[0],o=e.coordDimToDataDim("alt")[0],s=e.get("barSize"),u=e.get("minHeight")||0;if(null==s){var h=i.getDataExtent(n),d=i.getDataExtent(a),f=t.dataToPoint([h[0],d[0]]),p=t.dataToPoint([h[1],d[1]]),g=Math.min(Math.abs(f[0]-p[0]),Math.abs(f[1]-p[1]))||1,m=Object(l.a)(i,n,a);s=[g/Math.sqrt(i.count()/m),g/Math.sqrt(i.count()/m)]}else r.a.util.isArray(s)||(s=[s,s]),s[0]/=t.getScale()/16,s[1]/=t.getScale()/16;var v=[0,0,1],y=[n,a,o],_=c(i,y);i.each(y,(function(e,n,r,a){var o=i.get(_.dimension,a),l=_.isStacked?o-r:0,h=t.dataToPoint([e,n,l]),c=t.dataToPoint([e,n,o]),d=Math.max(c[2]-h[2],u),f=[s[0],d,s[1]];i.setItemLayout(a,[h,v,f])})),i.setLayout("orient",[1,0,0])}(e,t)}}))}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(6).a.vec3,o=r.a.helper.dataStack.isDimensionStacked;t.a=function(e,t){var i=e.getData(),n=e.get("barSize");if(null==n){var s,l,u=t.size,h=t.getAxis("x"),c=t.getAxis("y");s="category"===h.type?.7*h.getBandWidth():.6*Math.round(u[0]/Math.sqrt(i.count())),l="category"===c.type?.7*c.getBandWidth():.6*Math.round(u[1]/Math.sqrt(i.count())),n=[s,l]}else r.a.util.isArray(n)||(n=[n,n]);var d=t.getAxis("z").scale.getExtent(),f=function(e){var t=e[0],i=e[1];return!(t>0&&i>0||t<0&&i<0)}(d),p=["x","y","z"].map((function(t){return e.coordDimToDataDim(t)[0]})),g=o(i,p[2]),m=g?i.getCalculationInfo("stackResultDimension"):p[2];i.each(p,(function(e,r,o,s){var l=i.get(m,s),u=g?l-o:f?0:d[0],h=t.dataToPoint([e,r,u]),c=t.dataToPoint([e,r,l]),p=a.dist(h,c),v=[0,c[1]<h[1]?-1:1,0];0===Math.abs(p)&&(p=.1);var y=[n[0],p,n[1]];i.setItemLayout(s,[h,v,y])})),i.setLayout("orient",[1,0,0])}},function(e,t,i){t.a=function(e,t,i){for(var n=e.getDataExtent(t),r=e.getDataExtent(i),a=n[1]-n[0]||n[0],o=r[1]-r[0]||r[0],s=new Uint8Array(2500),l=0;l<e.count();l++){var u=e.get(t,l),h=e.get(i,l),c=Math.floor((u-n[0])/a*49),d=50*Math.floor((h-r[0])/o*49)+c;s[d]=s[d]||1}var f=0;for(l=0;l<s.length;l++)s[l]&&f++;return f/s.length}},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(2),s=i(32),l=i(230),u=i(66),h=i(6).a.vec3;r.a.extendChartView({type:"bar3D",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this._api=t,this._labelsBuilder=new u.a(256,256,t);var i=this;this._labelsBuilder.getLabelPosition=function(e,t,n){if(i._data){var r=i._data.getItemLayout(e),a=r[0],o=r[1],s=r[2][1];return h.scaleAndAdd([],a,o,n+s)}return[0,0]},this._labelsBuilder.getMesh().renderOrder=100},render:function(e,t,i){var n=this._prevBarMesh;this._prevBarMesh=this._barMesh,this._barMesh=n,this._barMesh||(this._barMesh=new a.a.Mesh({geometry:new l.a,shadowDepthMaterial:new a.a.Material({shader:new a.a.Shader(a.a.Shader.source("ecgl.sm.depth.vertex"),a.a.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 r=e.coordinateSystem;if(this._doRender(e,i),r&&r.viewGL){r.viewGL.add(this.groupGL);var o=r.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){a.a.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevBarMesh,this._barMesh,e)},_doRender:function(e,t){var i=e.getData(),n=e.get("shading"),r="color"!==n,o=this,s=this._barMesh,l="ecgl."+n;s.material&&s.material.shader.name===l||(s.material=a.a.createMaterial(l,["VERTEX_COLOR"])),a.a.setMaterialFromModel(n,s.material,e,t),s.geometry.enableNormal=r,s.geometry.resetOffset();var u=e.get("bevelSize"),h=e.get("bevelSmoothness");s.geometry.bevelSegments=h,s.geometry.bevelSize=u;var c=[],d=new Float32Array(4*i.count()),f=0,p=0,g=!1;i.each((function(e){if(i.hasValue(e)){var t=i.getItemVisual(e,"color"),n=i.getItemVisual(e,"opacity");null==n&&(n=1),a.a.parseColor(t,c),c[3]*=n,d[f++]=c[0],d[f++]=c[1],d[f++]=c[2],d[f++]=c[3],c[3]>0&&(p++,c[3]<.99&&(g=!0))}})),s.geometry.setBarCount(p);var m=i.getLayout("orient"),v=this._barIndexOfData=new Int32Array(i.count());p=0,i.each((function(e){if(i.hasValue(e)){var t=i.getItemLayout(e),n=t[0],r=t[1],a=t[2],s=4*e;c[0]=d[s++],c[1]=d[s++],c[2]=d[s++],c[3]=d[s++],c[3]>0&&(o._barMesh.geometry.addBar(n,r,m,a,c,e),v[e]=p++)}else v[e]=-1})),s.geometry.dirty(),s.geometry.updateBoundingBox();var y=s.material;y.transparent=g,y.depthMask=!g,s.geometry.sortTriangles=g,this._initHandler(e,t)},_initHandler:function(e,t){var i=e.getData(),n=this._barMesh,r="cartesian3D"===e.coordinateSystem.type;n.seriesIndex=e.seriesIndex;var a=-1;n.off("mousemove"),n.off("mouseout"),n.on("mousemove",(function(e){var o=n.geometry.getDataIndexOfVertex(e.triangle[0]);o!==a&&(this._downplay(a),this._highlight(o),this._labelsBuilder.updateLabels([o]),r&&t.dispatchAction({type:"grid3DShowAxisPointer",value:[i.get("x",o),i.get("y",o),i.get("z",o,!0)]})),a=o,n.dataIndex=o}),this),n.on("mouseout",(function(e){this._downplay(a),this._labelsBuilder.updateLabels(),a=-1,n.dataIndex=-1,r&&t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_highlight:function(e){var t=this._data;if(t){var i=this._barIndexOfData[e];if(!(i<0)){var n=t.getItemModel(e).getModel("emphasis.itemStyle"),o=n.get("color"),s=n.get("opacity");if(null==o){var l=t.getItemVisual(e,"color");o=r.a.color.lift(l,-.4)}null==s&&(s=t.getItemVisual(e,"opacity"));var u=a.a.parseColor(o);u[3]*=s,this._barMesh.geometry.setColor(i,u),this._api.getZr().refresh()}}},_downplay:function(e){var t=this._data;if(t){var i=this._barIndexOfData[e];if(!(i<0)){var n=t.getItemVisual(e,"color"),r=t.getItemVisual(e,"opacity"),o=a.a.parseColor(n);o[3]*=r,this._barMesh.geometry.setColor(i,o),this._api.getZr().refresh()}}},highlight:function(e,t,i,n){this._toggleStatus("highlight",e,t,i,n)},downplay:function(e,t,i,n){this._toggleStatus("downplay",e,t,i,n)},_toggleStatus:function(e,t,i,n,a){var l=t.getData(),u=o.a.queryDataIndex(l,a),h=this;null!=u?r.a.util.each(s.a.normalizeToArray(u),(function(t){"highlight"===e?this._highlight(t):this._downplay(t)}),this):l.each((function(t){"highlight"===e?h._highlight(t):h._downplay(t)}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t,i){var n,r,a,o,s,l,u,h,c=i(0),d=i.n(c),f=i(38),p=i(65),g=i(15),m=i(6),v=m.a.vec3,y=m.a.mat3,_=g.a.extend((function(){return{attributes:{position:new g.a.Attribute("position","float",3,"POSITION"),normal:new g.a.Attribute("normal","float",3,"NORMAL"),color:new g.a.Attribute("color","float",4,"COLOR"),prevPosition:new g.a.Attribute("prevPosition","float",3),prevNormal:new g.a.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,i=this.getBarVertexCount()*e,n=this.getBarTriangleCount()*e;this.vertexCount!==i&&(this.attributes.position.init(i),t?this.attributes.normal.init(i):this.attributes.normal.value=null,this.attributes.color.init(i)),this.triangleCount!==n&&(this.indices=i>65535?new Uint32Array(3*n):new Uint16Array(3*n),this._dataIndices=new Uint32Array(i))},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 i=this.getBarVertexCount(),n=i*(e+1),r=i*e;r<n;r++)this.attributes.color.set(r,t);this.dirtyAttribute("color")},getDataIndexOfVertex:function(e){return this._dataIndices?this._dataIndices[e]:null},addBar:function(){for(var e=v.create,t=v.scaleAndAdd,i=e(),n=e(),r=e(),a=e(),o=e(),s=e(),l=e(),u=[],h=[],c=0;c<8;c++)u[c]=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]],f=[0,1,2,0,2,3],p=[];for(c=0;c<d.length;c++)for(var g=d[c],m=0;m<2;m++){for(var y=[],_=0;_<3;_++)y.push(g[f[3*m+_]]);p.push(y)}return function(e,c,g,m,y,_){var x=this._vertexOffset;if(this.bevelSize>0&&this.bevelSegments>0)this._addBevelBar(e,c,g,m,this.bevelSize,this.bevelSegments,y);else{v.copy(r,c),v.normalize(r,r),v.cross(a,g,r),v.normalize(a,a),v.cross(n,r,a),v.normalize(a,a),v.negate(o,n),v.negate(s,r),v.negate(l,a),t(u[0],e,n,m[0]/2),t(u[0],u[0],a,m[2]/2),t(u[1],e,n,m[0]/2),t(u[1],u[1],l,m[2]/2),t(u[2],e,o,m[0]/2),t(u[2],u[2],l,m[2]/2),t(u[3],e,o,m[0]/2),t(u[3],u[3],a,m[2]/2),t(i,e,r,m[1]),t(u[4],i,n,m[0]/2),t(u[4],u[4],a,m[2]/2),t(u[5],i,n,m[0]/2),t(u[5],u[5],l,m[2]/2),t(u[6],i,o,m[0]/2),t(u[6],u[6],l,m[2]/2),t(u[7],i,o,m[0]/2),t(u[7],u[7],a,m[2]/2);var b=this.attributes;if(this.enableNormal){h[0]=n,h[1]=o,h[2]=r,h[3]=s,h[4]=a,h[5]=l;for(var w=this._vertexOffset,T=0;T<d.length;T++){for(var S=3*this._triangleOffset,M=0;M<6;M++)this.indices[S++]=w+f[M];w+=4,this._triangleOffset+=2}for(T=0;T<d.length;T++){var A=h[T];for(M=0;M<4;M++){var I=d[T][M];b.position.set(this._vertexOffset,u[I]),b.normal.set(this._vertexOffset,A),b.color.set(this._vertexOffset++,y)}}}else{for(T=0;T<p.length;T++){for(S=3*this._triangleOffset,M=0;M<3;M++)this.indices[S+M]=p[T][M]+this._vertexOffset;this._triangleOffset++}for(T=0;T<u.length;T++)b.position.set(this._vertexOffset,u[T]),b.color.set(this._vertexOffset++,y)}}var C=this._vertexOffset;for(T=x;T<C;T++)this._dataIndices[T]=_}}(),_addBevelBar:(n=v.create(),r=v.create(),a=v.create(),o=y.create(),s=[],l=[1,-1,-1,1],u=[1,1,-1,-1],h=[2,0],function(e,t,i,c,d,f,p){v.copy(r,t),v.normalize(r,r),v.cross(a,i,r),v.normalize(a,a),v.cross(n,r,a),v.normalize(a,a),o[0]=n[0],o[1]=n[1],o[2]=n[2],o[3]=r[0],o[4]=r[1],o[5]=r[2],o[6]=a[0],o[7]=a[1],o[8]=a[2],d=Math.min(c[0],c[2])/2*d;for(var g=0;g<3;g++)s[g]=Math.max(c[g]-2*d,0);var m=(c[0]-s[0])/2,y=(c[1]-s[1])/2,_=(c[2]-s[2])/2,x=[],b=[],w=this._vertexOffset,T=[];for(g=0;g<2;g++){T[g]=T[g]=[];for(var S=0;S<=f;S++)for(var M=0;M<4;M++){(0===S&&0===g||1===g&&S===f)&&T[g].push(w);for(var A=0;A<=f;A++){var I=A/f*Math.PI/2+Math.PI/2*M,C=S/f*Math.PI/2+Math.PI/2*g;b[0]=m*Math.cos(I)*Math.sin(C),b[1]=y*Math.cos(C),b[2]=_*Math.sin(I)*Math.sin(C),x[0]=b[0]+l[M]*s[0]/2,x[1]=b[1]+y+h[g]*s[1]/2,x[2]=b[2]+u[M]*s[2]/2,Math.abs(m-y)<1e-6&&Math.abs(y-_)<1e-6||(b[0]/=m*m,b[1]/=y*y,b[2]/=_*_),v.normalize(b,b),v.transformMat3(x,x,o),v.transformMat3(b,b,o),v.add(x,x,e),this.attributes.position.set(w,x),this.enableNormal&&this.attributes.normal.set(w,b),this.attributes.color.set(w,p),w++}}}var D=4*f+3,E=2*f+1,L=D+1;for(M=0;M<E;M++)for(g=0;g<=D;g++){var P=M*L+g+this._vertexOffset,N=M*L+(g+1)%L+this._vertexOffset,R=(M+1)*L+(g+1)%L+this._vertexOffset,O=(M+1)*L+g+this._vertexOffset;this.setTriangleIndices(this._triangleOffset++,[R,P,N]),this.setTriangleIndices(this._triangleOffset++,[R,O,P])}this.setTriangleIndices(this._triangleOffset++,[T[0][0],T[0][2],T[0][1]]),this.setTriangleIndices(this._triangleOffset++,[T[0][0],T[0][3],T[0][2]]),this.setTriangleIndices(this._triangleOffset++,[T[1][0],T[1][1],T[1][2]]),this.setTriangleIndices(this._triangleOffset++,[T[1][0],T[1][2],T[1][3]]),this._vertexOffset=w})});d.a.util.defaults(_.prototype,f.a),d.a.util.defaults(_.prototype,p.a),t.a=_},function(e,t,i){var n=i(0),r=i.n(n),a=i(31),o=i(32),s=i(39),l=i(50),u=r.a.extendSeriesModel({type:"series.bar3D",dependencies:["globe"],visualColorAccessPath:"itemStyle.color",getInitialData:function(e,t){return Object(l.a)(this)},getFormattedLabel:function(e,t,i,n){var r=o.a.getFormattedLabel(this,e,t,i,n);return null==r&&(r=this.getData().get("z",e)),r},formatTooltip:function(e){return Object(s.a)(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.a.util.merge(u.prototype,a.a)},function(e,t,i){var n=i(0),r=i.n(n);i(233),i(234);var a=i(51),o=i.n(a),s=i(17);r.a.registerVisual(o()("line3D","circle",null)),r.a.registerVisual(Object(s.a)("line3D")),r.a.registerLayout((function(e,t){e.eachSeriesByType("line3D",(function(e){var t=e.getData(),i=e.coordinateSystem;if(i){if("cartesian3D"!==i.type)return void console.error("line3D needs cartesian3D coordinateSystem");var n=new Float32Array(3*t.count()),r=[],a=[],o=i.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]}));i&&t.each(o,(function(e,t,o,s){r[0]=e,r[1]=t,r[2]=o,i.dataToPoint(r,a),n[3*s]=a[0],n[3*s+1]=a[1],n[3*s+2]=a[2]})),t.setLayout("points",n)}}))}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(39),o=i(50);r.a.extendSeriesModel({type:"series.line3D",dependencies:["grid3D"],visualColorAccessPath:"lineStyle.color",getInitialData:function(e,t){return Object(o.a)(this)},formatTooltip:function(e){return Object(a.a)(this,e)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,lineStyle:{width:2},animationDurationUpdate:500}})},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(2),s=i(25),l=i(9),u=i(3),h=i(235),c=i.n(h),d=i(6),f=i(46),p=d.a.vec3;a.a.Shader.import(f.a),r.a.extendChartView({type:"line3D",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this._api=t},render:function(e,t,i){var n=this._prevLine3DMesh;this._prevLine3DMesh=this._line3DMesh,this._line3DMesh=n,this._line3DMesh||(this._line3DMesh=new a.a.Mesh({geometry:new s.a({useNativeLine:!1,sortTriangles:!0}),material:new a.a.Material({shader:a.a.createShader("ecgl.meshLines3D")}),renderOrder:10}),this._line3DMesh.geometry.pick=this._pick.bind(this)),this.groupGL.remove(this._prevLine3DMesh),this.groupGL.add(this._line3DMesh);var r=e.coordinateSystem;if(r&&r.viewGL){r.viewGL.add(this.groupGL);var o=r.viewGL.isLinearSpace()?"define":"undefine";this._line3DMesh.material[o]("fragment","SRGB_DECODE")}this._doRender(e,i),this._data=e.getData(),this._camera=r.viewGL.camera,this.updateCamera(),this._updateAnimation(e)},updateCamera:function(){this._updateNDCPosition()},_doRender:function(e,t){var i=e.getData(),n=this._line3DMesh;n.geometry.resetOffset();var r=i.getLayout("points"),s=[],l=new Float32Array(r.length/3*4),u=0,h=!1;i.each((function(e){var t=i.getItemVisual(e,"color"),n=i.getItemVisual(e,"opacity");null==n&&(n=1),a.a.parseColor(t,s),s[3]*=n,l[u++]=s[0],l[u++]=s[1],l[u++]=s[2],l[u++]=s[3],s[3]<.99&&(h=!0)})),n.geometry.setVertexCount(n.geometry.getPolylineVertexCount(r)),n.geometry.setTriangleCount(n.geometry.getPolylineTriangleCount(r)),n.geometry.addPolyline(r,l,o.a.firstNotNull(e.get("lineStyle.width"),1)),n.geometry.dirty(),n.geometry.updateBoundingBox();var c=n.material;c.transparent=h,c.depthMask=!h;var d=e.getModel("debug.wireframe");d.get("show")?(n.geometry.createAttribute("barycentric","float",3),n.geometry.generateBarycentric(),n.material.set("both","WIREFRAME_TRIANGLE"),n.material.set("wireframeLineColor",a.a.parseColor(d.get("lineStyle.color")||"rgba(0,0,0,0.5)")),n.material.set("wireframeLineWidth",o.a.firstNotNull(d.get("lineStyle.width"),1))):n.material.set("both","WIREFRAME_TRIANGLE"),this._points=r,this._initHandler(e,t)},_updateAnimation:function(e){a.a.updateVertexAnimation([["prevPosition","position"],["prevPositionPrev","positionPrev"],["prevPositionNext","positionNext"]],this._prevLine3DMesh,this._line3DMesh,e)},_initHandler:function(e,t){var i=e.getData(),n=e.coordinateSystem,r=this._line3DMesh,a=-1;r.seriesIndex=e.seriesIndex,r.off("mousemove"),r.off("mouseout"),r.on("mousemove",(function(e){var o=n.pointToData(e.point.array),s=i.indicesOfNearest("x",o[0])[0];s!==a&&(t.dispatchAction({type:"grid3DShowAxisPointer",value:[i.get("x",s),i.get("y",s),i.get("z",s)]}),r.dataIndex=s),a=s}),this),r.on("mouseout",(function(e){a=-1,r.dataIndex=-1,t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_updateNDCPosition:function(){var e=new l.a,t=this._camera;l.a.multiply(e,t.projectionMatrix,t.viewMatrix);var i=this._positionNDC,n=this._points,r=n.length/3;i&&i.length/2===r||(i=this._positionNDC=new Float32Array(2*r));for(var a=[],o=0;o<r;o++){var s=3*o,u=2*o;a[0]=n[s],a[1]=n[s+1],a[2]=n[s+2],a[3]=1,p.transformMat4(a,a,e.array),i[u]=a[0]/a[3],i[u+1]=a[1]/a[3]}},_pick:function(e,t,i,n,r,a){var o=this._positionNDC,s=this._data.hostModel.get("lineStyle.width"),l=-1,h=.5*i.viewport.width,d=.5*i.viewport.height;e=(e+1)*h,t=(t+1)*d;for(var f=1;f<o.length/2;f++){var p=(o[2*(f-1)]+1)*h,g=(o[2*(f-1)+1]+1)*d,m=(o[2*f]+1)*h,v=(o[2*f+1]+1)*d;c.a.containStroke(p,g,m,v,s,e,t)&&(l=(p-e)*(p-e)+(g-t)*(g-t)<(m-e)*(m-e)+(v-t)*(v-t)?f-1:f)}if(l>=0){var y=3*l,_=new u.a(this._points[y],this._points[y+1],this._points[y+2]);a.push({dataIndex:l,point:_,pointWorld:_.clone(),target:this._line3DMesh,distance:this._camera.getWorldPosition().dist(_)})}},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t){t.containStroke=function(e,t,i,n,r,a,o){if(0===r)return!1;var s=r,l=0;if(o>t+s&&o>n+s||o<t-s&&o<n-s||a>e+s&&a>i+s||a<e-s&&a<i-s)return!1;if(e===i)return Math.abs(a-e)<=s/2;var u=(l=(t-n)/(e-i))*a-o+(e*n-i*t)/(e-i);return u*u/(l*l+1)<=s/2*s/2}},function(e,t,i){var n=i(0),r=i.n(n);i(237),i(238);var a=i(51),o=i.n(a),s=i(17);r.a.registerVisual(o()("scatter3D","circle",null)),r.a.registerVisual(Object(s.a)("scatter3D")),r.a.registerLayout({seriesType:"scatter3D",reset:function(e){var t=e.coordinateSystem;if(t){var i=t.dimensions;if(i.length<3)return void console.error("scatter3D needs 3D coordinateSystem");var n=i.map((function(t){return e.coordDimToDataDim(t)[0]})),r=[],a=[];return{progress:function(e,i){for(var o=new Float32Array(3*(e.end-e.start)),s=e.start;s<e.end;s++){var l=3*(s-e.start);r[0]=i.get(n[0],s),r[1]=i.get(n[1],s),r[2]=i.get(n[2],s),t.dataToPoint(r,a),o[l]=a[0],o[l+1]=a[1],o[l+2]=a[2]}i.setLayout("points",o)}}}}})},function(e,t,i){var n=i(0),r=i.n(n),a=i(32),o=i(39),s=i(50);r.a.extendSeriesModel({type:"series.scatter3D",dependencies:["globe","grid3D","geo3D"],visualColorAccessPath:"itemStyle.color",getInitialData:function(e,t){return Object(s.a)(this)},getFormattedLabel:function(e,t,i,n){var r=a.a.getFormattedLabel(this,e,t,i,n);if(null==r){var o=this.getData(),s=o.dimensions[o.dimensions.length-1];r=o.get(s,e)}return r},formatTooltip:function(e){return Object(o.a)(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(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(2),s=i(32),l=i(67);r.a.extendChartView({type:"scatter3D",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this._pointsBuilderList=[],this._currentStep=0},render:function(e,t,i){if(this.groupGL.removeAll(),e.getData().count()){var n=e.coordinateSystem;if(!n||!n.viewGL)throw new Error("Invalid coordinate system");n.viewGL.add(this.groupGL),this._camera=n.viewGL.camera;var r=this._pointsBuilderList[0];r||(r=this._pointsBuilderList[0]=new l.a(!1,i)),this._pointsBuilderList.length=1,this.groupGL.add(r.rootNode),r.update(e,t,i),r.updateView(n.viewGL.camera)}},incrementalPrepareRender:function(e,t,i){var n=e.coordinateSystem;if(!n||!n.viewGL)throw new Error("Invalid coordinate system");n.viewGL.add(this.groupGL),this._camera=n.viewGL.camera,this.groupGL.removeAll(),this._currentStep=0},incrementalRender:function(e,t,i,n){if(!(e.end<=e.start)){var r=this._pointsBuilderList[this._currentStep];r||(r=new l.a(!1,n),this._pointsBuilderList[this._currentStep]=r),this.groupGL.add(r.rootNode),r.update(t,i,n,e.start,e.end),r.updateView(t.coordinateSystem.viewGL.camera),this._currentStep++}},updateCamera:function(){this._pointsBuilderList.forEach((function(e){e.updateView(this._camera)}),this)},highlight:function(e,t,i,n){this._toggleStatus("highlight",e,t,i,n)},downplay:function(e,t,i,n){this._toggleStatus("downplay",e,t,i,n)},_toggleStatus:function(e,t,i,n,a){var l=t.getData(),u=o.a.queryDataIndex(l,a),h="highlight"===e;null!=u?r.a.util.each(s.a.normalizeToArray(u),(function(e){for(var t=0;t<this._pointsBuilderList.length;t++){var i=this._pointsBuilderList[t];h?i.highlight(l,e):i.downplay(l,e)}}),this):l.each((function(e){for(var t=0;t<this._pointsBuilderList.length;t++){var i=this._pointsBuilderList[t];h?i.highlight(l,e):i.downplay(l,e)}}))},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(e,t,i){var n=i(0),r=i.n(n);function a(e,t,i){(t=t||document.createElement("canvas")).width=e,t.height=e;var n=t.getContext("2d");return i&&i(n),t}var o={getMarginByStyle:function(e){var t=e.minMargin||0,i=0;e.stroke&&"none"!==e.stroke&&(i=null==e.lineWidth?1:e.lineWidth);var n=e.shadowBlur||0,r=e.shadowOffsetX||0,a=e.shadowOffsetY||0,o={};return o.left=Math.max(i/2,-r+n,t),o.right=Math.max(i/2,r+n,t),o.top=Math.max(i/2,-a+n,t),o.bottom=Math.max(i/2,a+n,t),o},createSymbolSprite:function(e,t,i,n){var s=function(e,t,i,n){r.a.util.isArray(t)||(t=[t,t]);var a=o.getMarginByStyle(i,n),s=t[0]+a.left+a.right,l=t[1]+a.top+a.bottom,u=r.a.helper.createSymbol(e,0,0,t[0],t[1]),h=Math.max(s,l);u.position=[a.left,a.top],s>l?u.position[1]+=(h-l)/2:u.position[0]+=(h-s)/2;var c=u.getBoundingRect();return u.position[0]-=c.x,u.position[1]-=c.y,u.setStyle(i),u.update(),u.__size=h,u}(e,t,i),l=o.getMarginByStyle(i);return{image:a(s.__size,n,(function(e){s.brush(e)})),margin:l}},createSDFFromCanvas:function(e,t,i,n){return a(t,n,(function(t){var n=e.getContext("2d").getImageData(0,0,e.width,e.height);t.putImageData(function(e,t,i){var n=t.width,r=t.height,a=e.canvas.width,o=e.canvas.height,s=n/a,l=r/o;function u(e){return e<128?1:-1}function h(e,a){var o=1/0;e=Math.floor(e*s);for(var h=(a=Math.floor(a*l))*n+e,c=u(t.data[4*h]),d=Math.max(a-i,0);d<Math.min(a+i,r);d++)for(var f=Math.max(e-i,0);f<Math.min(e+i,n);f++){h=d*n+f;var p=f-e,g=d-a;if(c!==u(t.data[4*h])){var m=p*p+g*g;m<o&&(o=m)}}return c*Math.sqrt(o)}for(var c=e.createImageData(a,o),d=0;d<o;d++)for(var f=0;f<a;f++){var p=h(f,d)/i*.5+.5,g=4*(d*a+f);c.data[g++]=255*(1-p),c.data[g++]=255*(1-p),c.data[g++]=255*(1-p),c.data[g++]=255}return c}(t,n,i),0,0)}))},createSimpleSprite:function(e,t){return a(e,t,(function(t){var i=e/2;t.beginPath(),t.arc(i,i,60,0,2*Math.PI,!1),t.closePath();var n=t.createRadialGradient(i,i,0,i,i,i);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=n,t.fill()}))}};t.a=o},function(e,t,i){var n=i(1),r=i(241),a=i(0),o=i.n(a),s=i(6),l=i(242),u=s.a.vec4;n.a.Shader.import(l.a);var h=n.a.Mesh.extend((function(){var e=new n.a.Geometry({dynamic:!0,attributes:{color:new n.a.Geometry.Attribute("color","float",4,"COLOR"),position:new n.a.Geometry.Attribute("position","float",3,"POSITION"),size:new n.a.Geometry.Attribute("size","float",1),prevPosition:new n.a.Geometry.Attribute("prevPosition","float",3),prevSize:new n.a.Geometry.Attribute("prevSize","float",1)}});o.a.util.extend(e,r.a);var t=new n.a.Material({shader:n.a.createShader("ecgl.sdfSprite"),transparent:!0,depthMask:!1});t.enableTexture("sprite"),t.define("both","VERTEX_COLOR"),t.define("both","VERTEX_SIZE");var i=new n.a.Texture2D({image:document.createElement("canvas"),flipY:!1});return t.set("sprite",i),e.pick=this._pick.bind(this),{geometry:e,material:t,mode:n.a.Mesh.POINTS,sizeScale:1}}),{_pick:function(e,t,i,r,a,o){var s=this._positionNDC;if(s)for(var l=i.viewport,u=2/l.width,h=2/l.height,c=this.geometry.vertexCount-1;c>=0;c--){var d,f=s[2*(d=this.geometry.indices?this.geometry.indices[c]:c)],p=s[2*d+1],g=this.geometry.attributes.size.get(d)/this.sizeScale/2;if(e>f-g*u&&e<f+g*u&&t>p-g*h&&t<p+g*h){var m=new n.a.Vector3,v=new n.a.Vector3;this.geometry.attributes.position.get(d,m.array),n.a.Vector3.transformMat4(v,m,this.worldTransform),o.push({vertexIndex:d,point:m,pointWorld:v,target:this,distance:v.distance(r.getWorldPosition())})}}},updateNDCPosition:function(e,t,i){var n=this._positionNDC,r=this.geometry;n&&n.length/2===r.vertexCount||(n=this._positionNDC=new Float32Array(2*r.vertexCount));for(var a=u.create(),o=0;o<r.vertexCount;o++)r.attributes.position.get(o,a),a[3]=1,u.transformMat4(a,a,e.array),u.scale(a,a,1/a[3]),n[2*o]=a[0],n[2*o+1]=a[1]}});t.a=h},function(e,t,i){var n=i(97),r=i(6).a.vec3;t.a={needsSortVertices:function(){return this.sortVertices},needsSortVerticesProgressively:function(){return this.needsSortVertices()&&this.vertexCount>=2e4},doSortVertices:function(e,t){var i=this.indices,n=r.create();if(!i){i=this.indices=this.vertexCount>65535?new Uint32Array(this.vertexCount):new Uint16Array(this.vertexCount);for(var a=0;a<i.length;a++)i[a]=a}if(0===t){var o,s=this.attributes.position,l=(e=e.array,0);for(this._zList&&this._zList.length===this.vertexCount||(this._zList=new Float32Array(this.vertexCount)),a=0;a<this.vertexCount;a++){s.get(a,n);var u=r.sqrDist(n,e);isNaN(u)&&(u=1e7,l++),0===a?(o=u,u=0):u-=o,this._zList[a]=u}this._noneCount=l}if(this.vertexCount<2e4)0===t&&this._simpleSort(this._noneCount/this.vertexCount>.05);else for(a=0;a<3;a++)this._progressiveQuickSort(3*t+a);this.dirtyIndices()},_simpleSort:function(e){var t=this._zList,i=this.indices;function r(e,i){return t[i]-t[e]}e?Array.prototype.sort.call(i,r):n.a.sort(i,r,0,i.length-1)},_progressiveQuickSort:function(e){var t=this._zList,i=this.indices;this._quickSort=this._quickSort||new n.a,this._quickSort.step(i,(function(e,i){return t[i]-t[e]}),e)}}},function(e,t,i){t.a="@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"},function(e,t,i){var n=i(0),r=i.n(n);i(244),i(245),i(248);var a=i(17);r.a.registerVisual(Object(a.a)("lines3D")),r.a.registerAction({type:"lines3DPauseEffect",event:"lines3deffectpaused",update:"series.lines3D:pauseEffect"},(function(){})),r.a.registerAction({type:"lines3DResumeEffect",event:"lines3deffectresumed",update:"series.lines3D:resumeEffect"},(function(){})),r.a.registerAction({type:"lines3DToggleEffect",event:"lines3deffectchanged",update:"series.lines3D:toggleEffect"},(function(){}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(6),o=a.a.vec3,s=a.a.vec2,l=o.normalize,u=o.cross,h=o.sub,c=o.add,d=o.create,f=d(),p=d(),g=d(),m=d(),v=[],y=[];function _(e,t){s.copy(v,e[0]),s.copy(y,e[1]);var i=[],n=i[0]=d(),r=i[1]=d(),a=i[2]=d(),_=i[3]=d();t.dataToPoint(v,n),t.dataToPoint(y,_),l(f,n),h(p,_,n),l(p,p),u(g,p,f),l(g,g),u(p,f,g),c(r,f,p),l(r,r),l(f,_),h(p,n,_),l(p,p),u(g,p,f),l(g,g),u(p,f,g),c(a,f,p),l(a,a),c(m,n,_),l(m,m);var x=o.dot(n,m),b=o.dot(m,r),w=(Math.max(o.len(n),o.len(_))-x)/b*2;return o.scaleAndAdd(r,n,r,w),o.scaleAndAdd(a,_,a,w),i}function x(e,t){for(var i=new Float32Array(3*e.length),n=0,r=[],a=0;a<e.length;a++)t.dataToPoint(e[a],r),i[n++]=r[0],i[n++]=r[1],i[n++]=r[2];return i}function b(e){var t=[];return e.each((function(i){var n=e.getItemModel(i),r=n.option instanceof Array?n.option:n.getShallow("coords",!0);if(!(r instanceof Array&&r.length>0&&r[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(r)+". Lines must have 2d coords array in data item.");t.push(r)})),{coordsList:t}}function w(e,t,i){var n=e.getData(),r=e.get("polyline"),a=b(n);n.setLayout("lineType",r?"polyline":"cubicBezier"),n.each((function(e){var s=a.coordsList[e],l=r?x(s,t):function(e,t,i){var n=[],r=n[0]=o.create(),a=n[1]=o.create(),s=n[2]=o.create(),l=n[3]=o.create();t.dataToPoint(e[0],r),t.dataToPoint(e[1],l);var u=o.dist(r,l);return o.lerp(a,r,l,.3),o.lerp(s,r,l,.3),o.scaleAndAdd(a,a,i,Math.min(.1*u,10)),o.scaleAndAdd(s,s,i,Math.min(.1*u,10)),n}(s,t,i);n.setItemLayout(e,l)}))}r.a.registerLayout((function(e,t){e.eachSeriesByType("lines3D",(function(e){var t=e.coordinateSystem;"globe"===t.type?function(e,t){var i=e.getData(),n=e.get("polyline");i.setLayout("lineType",n?"polyline":"cubicBezier");var r=b(i);i.each((function(e){var a=r.coordsList[e],o=n?x:_;i.setItemLayout(e,o(a,t))}))}(e,t):"geo3D"===t.type?w(e,t,[0,1,0]):"mapbox3D"!==t.type&&"maptalks3D"!==t.type||w(e,t,[0,0,1])}))}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(25),s=i(246),l=i(46);a.a.Shader.import(l.a),r.a.extendChartView({type:"lines3D",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this._meshLinesMaterial=new a.a.Material({shader:a.a.createShader("ecgl.meshLines3D"),transparent:!0,depthMask:!1}),this._linesMesh=new a.a.Mesh({geometry:new o.a,material:this._meshLinesMaterial,$ignorePicking:!0}),this._trailMesh=new s.a},render:function(e,t,i){this.groupGL.add(this._linesMesh);var n=e.coordinateSystem,r=e.getData();if(n&&n.viewGL){n.viewGL.add(this.groupGL),this._updateLines(e,t,i);var o=n.viewGL.isLinearSpace()?"define":"undefine";this._linesMesh.material[o]("fragment","SRGB_DECODE"),this._trailMesh.material[o]("fragment","SRGB_DECODE")}var s=this._trailMesh;if(s.stopAnimation(),e.get("effect.show")){this.groupGL.add(s),s.updateData(r,i,this._linesMesh.geometry),s.__time=s.__time||0;var l=36e5;this._curveEffectsAnimator=s.animate("",{loop:!0}).when(l,{__time:l}).during((function(){s.setAnimationTime(s.__time)})).start()}else this.groupGL.remove(s),this._curveEffectsAnimator=null;this._linesMesh.material.blend=this._trailMesh.material.blend="lighter"===e.get("blendMode")?a.a.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,i){var n=e.getData(),r=e.coordinateSystem,o=this._linesMesh.geometry,s=e.get("polyline");o.expandLine=!0;var l=function(e){return null!=e.radius?e.radius:null!=e.size?Math.max(e.size[0],e.size[1],e.size[2]):100}(r);o.segmentScale=l/20;var u="lineStyle.width".split("."),h=i.getDevicePixelRatio();n.each((function(e){var t=n.getItemModel(e).get(u);null==t&&(t=1),n.setItemVisual(e,"lineWidth",t)})),o.useNativeLine=!1;var c=0,d=0;n.each((function(e){var t=n.getItemLayout(e);s?(c+=o.getPolylineVertexCount(t),d+=o.getPolylineTriangleCount(t)):(c+=o.getCubicCurveVertexCount(t[0],t[1],t[2],t[3]),d+=o.getCubicCurveTriangleCount(t[0],t[1],t[2],t[3]))})),o.setVertexCount(c),o.setTriangleCount(d),o.resetOffset();var f=[];n.each((function(e){var t=n.getItemLayout(e),i=n.getItemVisual(e,"color"),r=n.getItemVisual(e,"opacity"),l=n.getItemVisual(e,"lineWidth")*h;null==r&&(r=1),(f=a.a.parseColor(i,f))[3]*=r,s?o.addPolyline(t,f,l):o.addCubicCurve(t[0],t[1],t[2],t[3],f,l)})),o.dirty()},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t,i){var n=i(0);i.n(n);var r=i(1),a=i(6),o=i(25),s=i(247),l=a.a.vec3;r.a.Shader.import(s.a),t.a=r.a.Mesh.extend((function(){var e=new r.a.Material({shader:new r.a.Shader(r.a.Shader.source("ecgl.trail2.vertex"),r.a.Shader.source("ecgl.trail2.fragment")),transparent:!0,depthMask:!1}),t=new o.a({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,i){var n=e.hostModel,a=this.geometry,o=n.getModel("effect"),s=o.get("trailWidth")*t.getDevicePixelRatio(),u=o.get("trailLength"),h=n.get("effect.constantSpeed"),c=1e3*n.get("effect.period"),d=null!=h;this.getScene()||console.error("TrailMesh must been add to scene before updateData"),d?this.material.set("speed",h/1e3):this.material.set("period",c),this.material[d?"define":"undefine"]("vertex","CONSTANT_SPEED");var f=n.get("polyline");a.trailLength=u,this.material.set("trailLength",u),a.resetOffset(),["position","positionPrev","positionNext"].forEach((function(e){a.attributes[e].value=i.attributes[e].value})),["dist","distAll","start","offset","color"].forEach((function(e){a.attributes[e].init(a.vertexCount)})),a.indices=i.indices;var p=[],g=o.get("trailColor"),m=o.get("trailOpacity"),v=null!=g,y=null!=m;this.updateWorldTransform();var _=this.worldTransform.x.len(),x=this.worldTransform.y.len(),b=this.worldTransform.z.len(),w=0,T=0;e.each((function(t){var n=e.getItemLayout(t),o=y?m:e.getItemVisual(t,"opacity"),u=e.getItemVisual(t,"color");null==o&&(o=1),(p=r.a.parseColor(v?g:u,p))[3]*=o;for(var h=f?i.getPolylineVertexCount(n):i.getCubicCurveVertexCount(n[0],n[1],n[2],n[3]),S=0,M=[],A=[],I=w;I<w+h;I++)a.attributes.position.get(I,M),M[0]*=_,M[1]*=x,M[2]*=b,I>w&&(S+=l.dist(M,A)),a.attributes.dist.set(I,S),l.copy(A,M);T=Math.max(T,S);var C=Math.random()*(d?S:c);for(I=w;I<w+h;I++)a.attributes.distAll.set(I,S),a.attributes.start.set(I,C),a.attributes.offset.set(I,(i.attributes.offset.get(I)>0?1:-1)*s/2),a.attributes.color.set(I,p);w+=h})),this.material.set("spotSize",.1*T*u),this.material.set("spotIntensity",o.get("spotIntensity")),a.dirty()},setAnimationTime:function(e){this.material.set("time",e)}})},function(e,t,i){t.a="@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"},function(e,t,i){var n=i(0),r=i.n(n);r.a.extendSeriesModel({type:"series.lines3D",dependencies:["globe"],visualColorAccessPath:"lineStyle.color",getInitialData:function(e,t){var i=new r.a.List(["value"],this);return i.hasItemOption=!1,i.initData(e.data,[],(function(e,t,n,r){if(e instanceof Array)return NaN;i.hasItemOption=!0;var a=e.value;return null!=a?a instanceof Array?a[r]:a:void 0})),i},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}}})},function(e,t,i){var n=i(0),r=i.n(n);i(250),i(251);var a=i(17);r.a.registerVisual(Object(a.a)("polygons3D"))},function(e,t,i){var n=i(0),r=i.n(n),a=i(31);function o(e,t){for(var i=[],n=0;n<t.length;n++)i.push(e.dataToPoint(t[n]));return i}var s=r.a.extendSeriesModel({type:"series.polygons3D",getRegionModel:function(e){return this.getData().getItemModel(e)},getRegionPolygonCoords:function(e){var t=this.coordinateSystem,i=this.getData().getItemModel(e),n=i.option instanceof Array?i.option:i.getShallow("coords");i.get("multiPolygon")||(n=[n]);for(var r=[],a=0;a<n.length;a++){for(var s=[],l=1;l<n[a].length;l++)s.push(o(t,n[a][l]));r.push({exterior:o(t,n[a][0]),interiors:s})}return r},getInitialData:function(e){var t=new r.a.List(["value"],this);return t.hasItemOption=!1,t.initData(e.data,[],(function(e,i,n,r){if(e instanceof Array)return NaN;t.hasItemOption=!0;var a=e.value;return null!=a?a instanceof Array?a[r]:a: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.a.util.merge(s.prototype,a.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(64),o=i(1);r.a.extendChartView({type:"polygons3D",__ecgl__:!0,init:function(e,t){this.groupGL=new o.a.Node,this._geo3DBuilderList=[],this._currentStep=0},render:function(e,t,i){this.groupGL.removeAll();var n=e.coordinateSystem;n&&n.viewGL&&n.viewGL.add(this.groupGL);var r=this._geo3DBuilderList[0];r||((r=new a.a(i)).extrudeY="mapbox3D"!==n.type&&"maptalks3D"!==n.type,this._geo3DBuilderList[0]=r),this._updateShaderDefines(n,r),r.update(e,t,i),this._geo3DBuilderList.length=1,this.groupGL.add(r.rootNode)},incrementalPrepareRender:function(e,t,i){this.groupGL.removeAll();var n=e.coordinateSystem;n&&n.viewGL&&n.viewGL.add(this.groupGL),this._currentStep=0},incrementalRender:function(e,t,i,n){var r=this._geo3DBuilderList[this._currentStep],o=t.coordinateSystem;r||((r=new a.a(n)).extrudeY="mapbox3D"!==o.type&&"maptalks3D"!==o.type,this._geo3DBuilderList[this._currentStep]=r),r.update(t,i,n,e.start,e.end),this.groupGL.add(r.rootNode),this._updateShaderDefines(o,r),this._currentStep++},_updateShaderDefines:function(e,t){var i=e.viewGL.isLinearSpace()?"define":"undefine";t.rootNode.traverse((function(t){t.material&&(t.material[i]("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()}})},function(e,t,i){var n=i(0),r=i.n(n);i(253),i(254),i(255);var a=i(17);r.a.registerVisual(Object(a.a)("surface"))},function(e,t,i){var n=i(0),r=i.n(n),a=i(31),o=i(39),s=i(50),l=r.a.extendSeriesModel({type:"series.surface",dependencies:["globe","grid3D","geo3D"],visualColorAccessPath:"itemStyle.color",formatTooltip:function(e){return Object(o.a)(this,e)},getInitialData:function(e,t){var i=e.data;function n(e){return!(isNaN(e.min)||isNaN(e.max)||isNaN(e.step))}function a(e){var t=r.a.number.getPrecisionSafe;return Math.max(t(e.min),t(e.max),t(e.step))+1}if(!i)if(e.parametric){var o=e.parametricEquation||{},l=o.u||{},u=o.v||{};["u","v"].forEach((function(e){n(o[e])||console.error("Invalid parametricEquation.%s",e)})),["x","y","z"].forEach((function(e){"function"==typeof o[e]||console.error("parametricEquation.%s needs to be function",e)}));var h=Math.floor((l.max+l.step-l.min)/l.step),c=Math.floor((u.max+u.step-u.min)/u.step);i=new Float32Array(h*c*5);var d=a(l),f=a(u);for(M=0,A=0;A<c;A++)for(I=0;I<h;I++){var p=I*l.step+l.min,g=A*u.step+u.min,m=r.a.number.round(Math.min(p,l.max),d),v=r.a.number.round(Math.min(g,u.max),f);C=o.x(m,v),D=o.y(m,v),P=o.z(m,v),i[M++]=C,i[M++]=D,i[M++]=P,i[M++]=m,i[M++]=v}}else{var y=e.equation||{},_=y.x||{},x=y.y||{};if(["x","y"].forEach((function(e){n(y[e])||console.error("Invalid equation.%s",e)})),"function"!=typeof y.z)return void console.error("equation.z needs to be function");var b=Math.floor((_.max+_.step-_.min)/_.step),w=Math.floor((x.max+x.step-x.min)/x.step);i=new Float32Array(b*w*3);for(var T=a(_),S=a(x),M=0,A=0;A<w;A++)for(var I=0;I<b;I++){var C=I*_.step+_.min,D=A*x.step+x.min,E=r.a.number.round(Math.min(C,_.max),T),L=r.a.number.round(Math.min(D,x.max),S),P=y.z(E,L);i[M++]=E,i[M++]=L,i[M++]=P}}var N=["x","y","z"];return e.parametric&&N.push("u","v"),Object(s.a)(this,N,i)},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},itemStyle:{},animationDurationUpdate:500}});r.a.util.merge(l.prototype,a.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(1);i(2);var o=i(6),s=i(65),l=o.a.vec3;r.a.extendChartView({type:"surface",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node},render:function(e,t,i){var n=this._prevSurfaceMesh;this._prevSurfaceMesh=this._surfaceMesh,this._surfaceMesh=n,this._surfaceMesh||(this._surfaceMesh=this._createSurfaceMesh()),this.groupGL.remove(this._prevSurfaceMesh),this.groupGL.add(this._surfaceMesh);var r=e.coordinateSystem,o=e.get("shading"),s=e.getData(),l="ecgl."+o;if(this._surfaceMesh.material&&this._surfaceMesh.material.shader.name===l||(this._surfaceMesh.material=a.a.createMaterial(l,["VERTEX_COLOR","DOUBLE_SIDED"])),a.a.setMaterialFromModel(o,this._surfaceMesh.material,e,i),r&&r.viewGL){r.viewGL.add(this.groupGL);var u=r.viewGL.isLinearSpace()?"define":"undefine";this._surfaceMesh.material[u]("fragment","SRGB_DECODE")}var h=e.get("parametric"),c=this._getDataShape(s,h),d=e.getModel("wireframe"),f=d.get("lineStyle.width"),p=d.get("show")&&f>0;this._updateSurfaceMesh(this._surfaceMesh,e,c,p);var g=this._surfaceMesh.material;p?(g.define("WIREFRAME_QUAD"),g.set("wireframeLineWidth",f),g.set("wireframeLineColor",a.a.parseColor(d.get("lineStyle.color")))):g.undefine("WIREFRAME_QUAD"),this._initHandler(e,i),this._updateAnimation(e)},_updateAnimation:function(e){a.a.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,e)},_createSurfaceMesh:function(){var e=new a.a.Mesh({geometry:new a.a.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new a.a.Material({shader:new a.a.Shader(a.a.Shader.source("ecgl.sm.depth.vertex"),a.a.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),r.a.util.extend(e.geometry,s.a),e},_initHandler:function(e,t){var i=e.getData(),n=this._surfaceMesh,r=e.coordinateSystem;n.seriesIndex=e.seriesIndex;var a=-1;n.off("mousemove"),n.off("mouseout"),n.on("mousemove",(function(e){var o=function(e,t){for(var i=1/0,r=-1,a=[],o=0;o<e.length;o++){n.geometry.attributes.position.get(e[o],a);var s=l.dist(t.array,a);s<i&&(i=s,r=e[o])}return r}(e.triangle,e.point);if(o>=0){var s=[];n.geometry.attributes.position.get(o,s);for(var u=r.pointToData(s),h=1/0,c=-1,d=[],f=0;f<i.count();f++){d[0]=i.get("x",f),d[1]=i.get("y",f),d[2]=i.get("z",f);var p=l.squaredDistance(d,u);p<h&&(c=f,h=p)}c!==a&&t.dispatchAction({type:"grid3DShowAxisPointer",value:u}),a=c,n.dataIndex=c}else n.dataIndex=-1}),this),n.on("mouseout",(function(e){a=-1,n.dataIndex=-1,t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_updateSurfaceMesh:function(e,t,i,n){var r=e.geometry,o=t.getData(),s=o.getLayout("points"),u=0;o.each((function(e){o.hasValue(e)||u++}));var h=u||n,c=r.attributes.position,d=r.attributes.normal,f=r.attributes.texcoord0,p=r.attributes.barycentric,g=r.attributes.color,m=i.row,v=i.column,y="color"!==t.get("shading");if(h){var _=(m-1)*(v-1)*4;c.init(_),n&&p.init(_)}else c.value=new Float32Array(s);g.init(r.vertexCount),f.init(r.vertexCount);var x,b=[0,3,1,1,3,2],w=[[1,1,0,0],[0,1,0,1],[1,0,0,1],[1,0,1,0]],T=r.indices=new(r.vertexCount>65535?Uint32Array:Uint16Array)((m-1)*(v-1)*6),S=function(e,t,i){i[1]=e*v+t,i[0]=e*v+t+1,i[3]=(e+1)*v+t+1,i[2]=(e+1)*v+t},M=!1;if(h){var A=[],I=[],C=0;y?d.init(r.vertexCount):d.value=null;for(var D=[[],[],[]],E=[],L=[],P=l.create(),N=function(e,t,i){var n=3*t;return i[0]=e[n],i[1]=e[n+1],i[2]=e[n+2],i},R=new Float32Array(s.length),O=new Float32Array(s.length/3*4),k=0;k<o.count();k++)if(o.hasValue(k)){var z=a.a.parseColor(o.getItemVisual(k,"color")),B=o.getItemVisual(k,"opacity");z[3]*=B,z[3]<.99&&(M=!0);for(var F=0;F<4;F++)O[4*k+F]=z[F]}var V=[1e7,1e7,1e7];for(k=0;k<m-1;k++)for(var G=0;G<v-1;G++){var H=4*(k*(v-1)+G);S(k,G,A);var U=!1;for(F=0;F<4;F++)N(s,A[F],I),x=I,(isNaN(x[0])||isNaN(x[1])||isNaN(x[2]))&&(U=!0);for(F=0;F<4;F++)U?c.set(H+F,V):(N(s,A[F],I),c.set(H+F,I)),n&&p.set(H+F,w[F]);for(F=0;F<6;F++)T[C++]=b[F]+H;if(y&&!U)for(F=0;F<2;F++){for(var W=3*F,j=0;j<3;j++)N(s,q=A[b[W]+j],D[j]);for(l.sub(E,D[0],D[1]),l.sub(L,D[1],D[2]),l.cross(P,E,L),j=0;j<3;j++){var X=3*A[b[W]+j];R[X]=R[X]+P[0],R[X+1]=R[X+1]+P[1],R[X+2]=R[X+2]+P[2]}}}if(y)for(k=0;k<R.length/3;k++)N(R,k,P),l.normalize(P,P),R[3*k]=P[0],R[3*k+1]=P[1],R[3*k+2]=P[2];z=[];var Z=[];for(k=0;k<m-1;k++)for(G=0;G<v-1;G++)for(H=4*(k*(v-1)+G),S(k,G,A),F=0;F<4;F++){for(j=0;j<4;j++)z[j]=O[4*A[F]+j];g.set(H+F,z),y&&(N(R,A[F],P),d.set(H+F,P));var q=A[F];Z[0]=q%v/(v-1),Z[1]=Math.floor(q/v)/(m-1),f.set(H+F,Z)}}else{for(Z=[],k=0;k<o.count();k++)Z[0]=k%v/(v-1),Z[1]=Math.floor(k/v)/(m-1),z=a.a.parseColor(o.getItemVisual(k,"color")),B=o.getItemVisual(k,"opacity"),z[3]*=B,z[3]<.99&&(M=!0),g.set(k,z),f.set(k,Z);A=[];var Y=0;for(k=0;k<m-1;k++)for(G=0;G<v-1;G++)for(S(k,G,A),F=0;F<6;F++)T[Y++]=A[b[F]];y?r.generateVertexNormals():d.value=null}e.material.get("normalMap")&&r.generateTangents(),r.updateBoundingBox(),r.dirty(),e.material.transparent=M,e.material.depthMask=!M},_getDataShape:function(e,t){for(var i=-1/0,n=0,r=0,a=0,o=t?"u":"x",s=0;s<e.count();s++){var l=e.get(o,s);if(l<i){if(a&&a!==r)throw new Error("Invalid data. data should be a row major 2d array.");a=r,r=0,n++}i=l,r++}return{row:n+1,column:r}},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(e,t,i){var n=i(0);i.n(n).a.registerLayout((function(e,t){e.eachSeriesByType("surface",(function(e){var t=e.coordinateSystem;t&&"cartesian3D"===t.type||console.error("Surface chart only support cartesian3D coordinateSystem");var i=e.getData(),n=new Float32Array(3*i.count()),r=[NaN,NaN,NaN];if(t&&"cartesian3D"===t.type){var a=t.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]}));i.each(a,(function(e,a,o,s){var l;l=i.hasValue(s)?t.dataToPoint([e,a,o]):r,n[3*s]=l[0],n[3*s+1]=l[1],n[3*s+2]=l[2]}))}i.setLayout("points",n)}))}))},function(e,t,i){var n=i(0),r=i.n(n);i(99),i(257),i(258);var a=i(17);r.a.registerVisual(Object(a.a)("map3D")),r.a.registerAction({type:"map3DChangeCamera",event:"map3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"series",subType:"map3D",query:e},(function(t){t.setView(e)}))}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(44),o=i(28),s=i(29),l=i(31),u=i(96),h=i(32),c=i(39),d=i(98);function f(e,t){for(var i=[],n=0;n<t.length;n++)i.push(e.dataToPoint(t[n]));return i}var p=r.a.extendSeriesModel({type:"series.map3D",layoutMode:"box",coordinateSystem:null,visualColorAccessPath:"itemStyle.color",optionUpdated:function(e){e=e||{};var t=this.get("coordinateSystem");if(null!=t&&"geo3D"!==t){var i=[];["left","top","width","height","boxWidth","boxDepth","boxHeight","light","viewControl","postEffect","temporalSuperSampling","environment","groundPlane"].forEach((function(t){null!=e[t]&&i.push(t)})),i.length&&console.warn("Property %s in map3D series will be ignored if coordinate system is %s",i.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=r.a.helper.completeDimensions(["value"],e.data),i=new r.a.List(t,this);i.initData(e.data);var n={};return i.each((function(e){var t=i.getName(e),r=i.getItemModel(e);n[t]=r})),this._regionModelMap=n,i},formatTooltip:function(e){return Object(c.a)(this,e)},getRegionModel:function(e){var t=this.getData().getName(e);return this._regionModelMap[t]||new r.a.Model(null,this)},getRegionPolygonCoords:function(e){var t=this.coordinateSystem,i=this.getData().getName(e);if(t.transform)return(n=t.getRegion(i))?n.geometries:[];this._geo||(this._geo=d.a.createGeo3D(this));for(var n=this._geo.getRegion(i),r=[],a=0;a<n.geometries.length;a++){var o=n.geometries[a],s=[],l=f(t,o.exterior);if(s&&s.length)for(var u=0;u<o.interiors.length;u++)s.push(f(t,s[u]));r.push({interiors:s,exterior:l})}return r},getFormattedLabel:function(e,t){var i=h.a.getFormattedLabel(this,e,t);return null==i&&(i=this.getData().getName(e)),i},defaultOption:{coordinateSystem:"geo3D",data:null}});r.a.util.merge(p.prototype,u.a),r.a.util.merge(p.prototype,a.a),r.a.util.merge(p.prototype,o.a),r.a.util.merge(p.prototype,s.a),r.a.util.merge(p.prototype,l.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(45),s=i(30),l=i(64);r.a.extendChartView({type:"map3D",__ecgl__:!0,init:function(e,t){this._geo3DBuilder=new l.a(t),this.groupGL=new a.a.Node},render:function(e,t,i){var n=e.coordinateSystem;if(n&&n.viewGL){if(this.groupGL.add(this._geo3DBuilder.rootNode),n.viewGL.add(this.groupGL),"geo3D"===n.type){this._sceneHelper||(this._sceneHelper=new s.a,this._sceneHelper.initLight(this.groupGL)),this._sceneHelper.setScene(n.viewGL.scene),this._sceneHelper.updateLight(e),n.viewGL.setPostEffect(e.getModel("postEffect"),i),n.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));var r=this._control;r||(r=this._control=new o.a({zr:i.getZr()}),this._control.init());var a=e.getModel("viewControl");r.setViewGL(n.viewGL),r.setFromViewControlModel(a,0),r.off("update"),r.on("update",(function(){i.dispatchAction({type:"map3DChangeCamera",alpha:r.getAlpha(),beta:r.getBeta(),distance:r.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,i,0,e.getData().count());var l=n.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse((function(e){e.material&&e.material[l]("fragment","SRGB_DECODE")}))}},afterRender:function(e,t,i,n){var r=n.renderer,a=e.coordinateSystem;a&&"geo3D"===a.type&&(this._sceneHelper.updateAmbientCubemap(r,e,i),this._sceneHelper.updateSkybox(r,e,i))},dispose:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(e,t,i){var n=i(0),r=i.n(n);i(260),i(261);var a=i(51),o=i.n(a),s=i(17);r.a.registerVisual(o()("scatterGL","circle",null)),r.a.registerVisual(Object(s.a)("scatterGL")),r.a.registerLayout({seriesType:"scatterGL",reset:function(e){var t,i=e.coordinateSystem;if(i){var n=i.dimensions,r=[];1===n.length?t=function(e,t){for(var r=new Float32Array(2*(e.end-e.start)),a=e.start;a<e.end;a++){var o=2*(a-e.start),s=t.get(n[0],a),l=i.dataToPoint(s);r[o]=l[0],r[o+1]=l[1]}t.setLayout("points",r)}:2===n.length&&(t=function(e,t){for(var a=new Float32Array(2*(e.end-e.start)),o=e.start;o<e.end;o++){var s=2*(o-e.start),l=t.get(n[0],o),u=t.get(n[1],o);r[0]=l,r[1]=u,r=i.dataToPoint(r),a[s]=r[0],a[s+1]=r[1]}t.setLayout("points",a)})}return{progress:t}}})},function(e,t,i){var n=i(0),r=i.n(n);r.a.extendSeriesModel({type:"series.scatterGL",dependencies:["grid","polar","geo","singleAxis"],visualColorAccessPath:"itemStyle.color",getInitialData:function(){return r.a.helper.createList(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(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(22),s=i(67),l=i(103);i(2),r.a.extendChartView({type:"scatterGL",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this.viewGL=new o.a("orthographic"),this.viewGL.add(this.groupGL),this._pointsBuilderList=[],this._currentStep=0,this._sizeScale=1,this._glViewHelper=new l.a(this.viewGL)},render:function(e,t,i){if(this.groupGL.removeAll(),this._glViewHelper.reset(e,i),e.getData().count()){var n=this._pointsBuilderList[0];n||(n=this._pointsBuilderList[0]=new s.a(!0,i)),this._pointsBuilderList.length=1,this.groupGL.add(n.rootNode),this._removeTransformInPoints(e.getData().getLayout("points")),n.update(e,t,i),this.viewGL.setPostEffect(e.getModel("postEffect"),i)}},incrementalPrepareRender:function(e,t,i){this.groupGL.removeAll(),this._glViewHelper.reset(e,i),this._currentStep=0,this.viewGL.setPostEffect(e.getModel("postEffect"),i)},incrementalRender:function(e,t,i,n){if(!(e.end<=e.start)){var r=this._pointsBuilderList[this._currentStep];r||(r=new s.a(!0,n),this._pointsBuilderList[this._currentStep]=r),this.groupGL.add(r.rootNode),this._removeTransformInPoints(t.getData().getLayout("points")),r.setSizeScale(this._sizeScale),r.update(t,i,n,e.start,e.end),n.getZr().refresh(),this._currentStep++}},updateTransform:function(e,t,i){if(e.coordinateSystem.getRoamTransform){this._glViewHelper.updateTransform(e,i);var n=this._glViewHelper.getZoom(),r=Math.max((e.get("zoomScale")||0)*(n-1)+1,0);this._sizeScale=r,this._pointsBuilderList.forEach((function(e){e.setSizeScale(r)}))}},_removeTransformInPoints:function(e){if(e)for(var t=[],i=0;i<e.length;i+=2)t[0]=e[i],t[1]=e[i+1],this._glViewHelper.removeTransformInPoint(t),e[i]=t[0],e[i+1]=t[1]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(e,t,i){var n=i(0),r=i.n(n);i(263),i(268);var a=i(51),o=i.n(a),s=i(17);function l(){}r.a.registerVisual(o()("graphGL","circle",null)),r.a.registerVisual(Object(s.a)("graphGL")),r.a.registerVisual((function(e){var t={};e.eachSeriesByType("graphGL",(function(e){var i=e.getCategoriesData(),n=e.getData(),r={};i.each((function(n){var a=i.getName(n);r[a]=n;var o=i.getItemModel(n).get("itemStyle.color")||e.getColorFromPalette(a,t);i.setItemVisual(n,"color",o)})),i.count()&&n.each((function(e){var t=n.getItemModel(e).getShallow("category");null!=t&&("string"==typeof t&&(t=r[t]),n.getItemVisual(e,"color",!0)||n.setItemVisual(e,"color",i.getItemVisual(t,"color")))}))}))})),r.a.registerVisual((function(e){e.eachSeriesByType("graphGL",(function(e){var t=e.getGraph(),i=e.getEdgeData(),n="lineStyle.color".split("."),r="lineStyle.opacity".split(".");i.setVisual("color",e.get(n)),i.setVisual("opacity",e.get(r)),i.each((function(e){var a=i.getItemModel(e),o=t.getEdgeByIndex(e),s=a.get(n),l=a.get(r);switch(s){case"source":s=o.node1.getVisual("color");break;case"target":s=o.node2.getVisual("color")}o.setVisual("color",s),o.setVisual("opacity",l)}))}))})),r.a.registerAction({type:"graphGLRoam",event:"graphglroam",update:"series.graphGL:roam"},(function(e,t){t.eachComponent({mainType:"series",query:e},(function(t){t.setView(e)}))})),r.a.registerAction({type:"graphGLStartLayout",event:"graphgllayoutstarted",update:"series.graphGL:startLayout"},l),r.a.registerAction({type:"graphGLStopLayout",event:"graphgllayoutstopped",update:"series.graphGL:stopLayout"},l),r.a.registerAction({type:"graphGLFocusNodeAdjacency",event:"graphGLFocusNodeAdjacency",update:"series.graphGL:focusNodeAdjacency"},l),r.a.registerAction({type:"graphGLUnfocusNodeAdjacency",event:"graphGLUnfocusNodeAdjacency",update:"series.graphGL:unfocusNodeAdjacency"},l)},function(e,t,i){var n=i(0),r=i.n(n),a=i(264),o=i(32),s=r.a.extendSeriesModel({type:"series.graphGL",visualColorAccessPath:"itemStyle.color",init:function(e){s.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this._updateCategoriesData()},mergeOption:function(e){s.superApply(this,"mergeOption",arguments),this._updateCategoriesData()},getFormattedLabel:function(e,t,i,n){var r=o.a.getFormattedLabel(this,e,t,i,n);if(null==r){var a=this.getData(),s=a.dimensions[a.dimensions.length-1];r=a.get(s,e)}return r},getInitialData:function(e,t){var i=e.edges||e.links||[],n=e.data||e.nodes||[],o=this;if(n&&i)return Object(a.a)(n,i,this,!0,(function(e,i){e.wrapMethod("getItemModel",(function(e){var t=o._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));var n=o.getModel("edgeLabel"),a=new r.a.Model({label:n.option},n.parentModel,t);function s(e){return(e=this.parsePath(e))&&"label"===e[0]?a:this.parentModel}i.wrapMethod("getItemModel",(function(e){return e.customizeGetParent(s),e}))})).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(e,t,i){if("edge"===i){var n=this.getData(),a=this.getDataParams(e,i),o=n.graph.getEdgeByIndex(e),l=n.getName(o.node1.dataIndex),u=n.getName(o.node2.dataIndex),h=[];return null!=l&&h.push(l),null!=u&&h.push(u),h=r.a.format.encodeHTML(h.join(" > ")),a.value&&(h+=" : "+r.a.format.encodeHTML(a.value)),h}return s.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var e=(this.option.categories||[]).map((function(e){return null!=e.value?e:r.a.util.extend({value:0},e)})),t=new r.a.List(["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 i=e[2*t],n=e[2*t+1],r=this.getData().getRawDataItem(t);r.x=i,r.y=n}},isAnimationEnabled:function(){return s.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}})},function(e,t,i){var n=i(0),r=i.n(n),a=i(265),o=i.n(a),s=i(267),l=i.n(s),u=i(2);t.a=function(e,t,i,n,a){for(var s=new o.a(n),h=0;h<e.length;h++)s.addNode(u.a.firstNotNull(e[h].id,e[h].name,h),h);var c,d=[],f=[],p=0;for(h=0;h<t.length;h++){var g=t[h],m=g.source,v=g.target;s.addEdge(m,v,p)&&(f.push(g),d.push(u.a.firstNotNull(g.id,m+" > "+v)),p++)}var y=r.a.helper.completeDimensions(["value"],e);(c=new r.a.List(y,i)).initData(e);var _=new r.a.List(["value"],i);return _.initData(f,d),a&&a(c,_),l()({mainData:c,struct:s,structAttr:"graph",datas:{node:c,edge:_},datasAttr:{node:"data",edge:"edgeData"}}),s.update(),s}},function(e,t,i){i(104).__DEV__;var n=i(13),r=i(266).enableClassCheck;function a(e){return"_EC_"+e}var o=function(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData},s=o.prototype;function l(e,t){this.id=null==e?"":e,this.inEdges=[],this.outEdges=[],this.edges=[],this.hostGraph,this.dataIndex=null==t?-1:t}function u(e,t,i){this.node1=e,this.node2=t,this.dataIndex=null==i?-1:i}s.type="graph",s.isDirected=function(){return this._directed},s.addNode=function(e,t){e=e||""+t;var i=this._nodesMap;if(!i[a(e)]){var n=new l(e,t);return n.hostGraph=this,this.nodes.push(n),i[a(e)]=n,n}},s.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},s.getNodeById=function(e){return this._nodesMap[a(e)]},s.addEdge=function(e,t,i){var n=this._nodesMap,r=this._edgesMap;if("number"==typeof e&&(e=this.nodes[e]),"number"==typeof t&&(t=this.nodes[t]),l.isInstance(e)||(e=n[a(e)]),l.isInstance(t)||(t=n[a(t)]),e&&t){var o=e.id+"-"+t.id;if(!r[o]){var s=new u(e,t,i);return s.hostGraph=this,this._directed&&(e.outEdges.push(s),t.inEdges.push(s)),e.edges.push(s),e!==t&&t.edges.push(s),this.edges.push(s),r[o]=s,s}}},s.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},s.getEdge=function(e,t){l.isInstance(e)&&(e=e.id),l.isInstance(t)&&(t=t.id);var i=this._edgesMap;return this._directed?i[e+"-"+t]:i[e+"-"+t]||i[t+"-"+e]},s.eachNode=function(e,t){for(var i=this.nodes,n=i.length,r=0;r<n;r++)i[r].dataIndex>=0&&e.call(t,i[r],r)},s.eachEdge=function(e,t){for(var i=this.edges,n=i.length,r=0;r<n;r++)i[r].dataIndex>=0&&i[r].node1.dataIndex>=0&&i[r].node2.dataIndex>=0&&e.call(t,i[r],r)},s.breadthFirstTraverse=function(e,t,i,n){if(l.isInstance(t)||(t=this._nodesMap[a(t)]),t){for(var r="out"===i?"outEdges":"in"===i?"inEdges":"edges",o=0;o<this.nodes.length;o++)this.nodes[o].__visited=!1;if(!e.call(n,t,null))for(var s=[t];s.length;){var u=s.shift(),h=u[r];for(o=0;o<h.length;o++){var c=h[o],d=c.node1===u?c.node2:c.node1;if(!d.__visited){if(e.call(n,d,u))return;s.push(d),d.__visited=!0}}}}},s.update=function(){for(var e=this.data,t=this.edgeData,i=this.nodes,n=this.edges,r=0,a=i.length;r<a;r++)i[r].dataIndex=-1;for(r=0,a=e.count();r<a;r++)i[e.getRawIndex(r)].dataIndex=r;for(t.filterSelf((function(e){var i=n[t.getRawIndex(e)];return i.node1.dataIndex>=0&&i.node2.dataIndex>=0})),r=0,a=n.length;r<a;r++)n[r].dataIndex=-1;for(r=0,a=t.count();r<a;r++)n[t.getRawIndex(r)].dataIndex=r},s.clone=function(){for(var e=new o(this._directed),t=this.nodes,i=this.edges,n=0;n<t.length;n++)e.addNode(t[n].id,t[n].dataIndex);for(n=0;n<i.length;n++){var r=i[n];e.addEdge(r.node1.id,r.node2.id,r.dataIndex)}return e},l.prototype={constructor:l,degree:function(){return this.edges.length},inDegree:function(){return this.inEdges.length},outDegree:function(){return this.outEdges.length},getModel:function(e){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(e)}},u.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)};var h=function(e,t){return{getValue:function(i){var n=this[e][t];return n.get(n.getDimension(i||"value"),this.dataIndex)},setVisual:function(i,n){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,i,n)},getVisual:function(i,n){return this[e][t].getItemVisual(this.dataIndex,i,n)},setLayout:function(i,n){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,i,n)},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)}}};n.mixin(l,h("hostGraph","data")),n.mixin(u,h("hostGraph","edgeData")),o.Node=l,o.Edge=u,r(l),r(u);var c=o;e.exports=c},function(e,t,i){i(104).__DEV__;var n=i(13),r="___EC__COMPONENT__CONTAINER___";function a(e){var t={main:"",sub:""};return e&&(e=e.split("."),t.main=e[0]||"",t.sub=e[1]||""),t}var o=0;function s(e,t){var i=n.slice(arguments,2);return this.superClass.prototype[t].apply(e,i)}function l(e,t,i){return this.superClass.prototype[t].apply(e,i)}t.parseClassType=a,t.enableClassExtend=function(e,t){e.$constructor=e,e.extend=function(e){var t=this,i=function(){e.$constructor?e.$constructor.apply(this,arguments):t.apply(this,arguments)};return n.extend(i.prototype,e),i.extend=this.extend,i.superCall=s,i.superApply=l,n.inherits(i,this),i.superClass=t,i}},t.enableClassCheck=function(e){var t=["__\0is_clz",o++,Math.random().toFixed(3)].join("_");e.prototype[t]=!0,e.isInstance=function(e){return!(!e||!e[t])}},t.enableClassManagement=function(e,t){t=t||{};var i={};if(e.registerClass=function(e,t){if(t)if(function(e){n.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}(t),(t=a(t)).sub){if(t.sub!==r){var o=function(e){var t=i[e.main];return t&&t[r]||((t=i[e.main]={})[r]=!0),t}(t);o[t.sub]=e}}else i[t.main]=e;return e},e.getClass=function(e,t,n){var a=i[e];if(a&&a[r]&&(a=t?a[t]:null),n&&!a)throw new Error(t?"Component "+e+"."+(t||"")+" not exists. Load it first.":e+".type should be specified.");return a},e.getClassesByMainType=function(e){e=a(e);var t=[],o=i[e.main];return o&&o[r]?n.each(o,(function(e,i){i!==r&&t.push(e)})):t.push(o),t},e.hasClass=function(e){return e=a(e),!!i[e.main]},e.getAllClassMainTypes=function(){var e=[];return n.each(i,(function(t,i){e.push(i)})),e},e.hasSubTypes=function(e){e=a(e);var t=i[e.main];return t&&t[r]},e.parseClassType=a,t.registerWhenExtend){var o=e.extend;o&&(e.extend=function(t){var i=o.call(this,t);return e.registerClass(i,t.type)})}return e},t.setReadOnly=function(e,t){}},function(e,t,i){var n=i(13),r=n.each,a="\0__link_datas",o="\0__link_mainData";function s(e,t){if((r=this)[o]===r){var i=n.extend({},this[a]);i[this.dataType]=t,c(t,i,e)}else d(t,this.dataType,this[o],e);var r;return t}function l(e,t){return e.struct&&e.struct.update(this),t}function u(e,t){return r(t[a],(function(i,n){i!==t&&d(i.cloneShallow(),n,t,e)})),t}function h(e){var t=this[o];return null==e||null==t?t:t[a][e]}function c(e,t,i){e[a]={},r(t,(function(t,n){d(t,n,e,i)}))}function d(e,t,i,n){i[a][t]=e,e[o]=i,e.dataType=t,n.struct&&(e[n.structAttr]=n.struct,n.struct[n.datasAttr[t]]=e),e.getLinkedData=h}var f=function(e){var t=e.mainData,i=e.datas;i||(i={main:t},e.datasAttr={main:"data"}),e.datas=e.mainData=null,c(t,i,e),r(i,(function(i){r(t.TRANSFERABLE_METHODS,(function(t){i.wrapMethod(t,n.curry(s,e))}))})),t.wrapMethod("cloneShallow",n.curry(u,e)),r(t.CHANGABLE_METHODS,(function(i){t.wrapMethod(i,n.curry(l,e))})),n.assert(i[t.dataType]===t)};e.exports=f},function(e,t,i){var n=i(0),r=i.n(n),a=i(47),o=i.n(a),s=i(1),l=i(22),u=i(105),h=i(2),c=i(269),d=i(271),f=i(80),p=i.n(f),g=i(6),m=i(273),v=i(67),y=i(274),_=g.a.vec2;s.a.Shader.import(y.a);var x=1;r.a.extendChartView({type:"graphGL",__ecgl__:!0,init:function(e,t){this.groupGL=new s.a.Node,this.viewGL=new l.a("orthographic"),this.viewGL.camera.left=this.viewGL.camera.right=0,this.viewGL.add(this.groupGL),this._pointsBuilder=new v.a(!0,t),this._forceEdgesMesh=new s.a.Mesh({material:new s.a.Material({shader:s.a.createShader("ecgl.forceAtlas2.edges"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new s.a.Geometry({attributes:{node:new s.a.Geometry.Attribute("node","float",2),color:new s.a.Geometry.Attribute("color","float",4,"COLOR")},dynamic:!0,mainAttribute:"node"}),renderOrder:-1,mode:s.a.Mesh.LINES}),this._edgesMesh=new s.a.Mesh({material:new s.a.Material({shader:s.a.createShader("ecgl.meshLines2D"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new u.a({useNativeLine:!1,dynamic:!0}),renderOrder:-1,culling:!1}),this._layoutId=0,this._control=new m.a({zr:t.getZr(),viewGL:this.viewGL}),this._control.setTarget(this.groupGL),this._control.init(),this._clickHandler=this._clickHandler.bind(this)},render:function(e,t,i){this.groupGL.add(this._pointsBuilder.rootNode),this._model=e,this._api=i,this._initLayout(e,t,i),this._pointsBuilder.update(e,t,i),this._forceLayoutInstance instanceof c.a||this.groupGL.remove(this._forceEdgesMesh),this._updateCamera(e,i),this._control.off("update"),this._control.on("update",(function(){i.dispatchAction({type:"graphGLRoam",seriesId:e.id,zoom:this._control.getZoom(),offset:this._control.getOffset()}),this._pointsBuilder.updateView(this.viewGL.camera)}),this),this._control.setZoom(h.a.firstNotNull(e.get("zoom"),1)),this._control.setOffset(e.get("offset")||[0,0]);var n=this._pointsBuilder.getPointsMesh();if(n.off("mousemove",this._mousemoveHandler),n.off("mouseout",this._mouseOutHandler,this),i.getZr().off("click",this._clickHandler),this._pointsBuilder.highlightOnMouseover=!0,e.get("focusNodeAdjacency")){var r=e.get("focusNodeAdjacencyOn");"click"===r?i.getZr().on("click",this._clickHandler):"mouseover"===r?(n.on("mousemove",this._mousemoveHandler,this),n.on("mouseout",this._mouseOutHandler,this),this._pointsBuilder.highlightOnMouseover=!1):console.warn("Unkown focusNodeAdjacencyOn value s"+r)}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 i=this._forceEdgesMesh.geometry,n=t.getEdgeData(),r=0,a=this._forceLayoutInstance,o=2*n.count();i.attributes.node.init(o),i.attributes.color.init(o),n.each((function(t){var o=e[t];i.attributes.node.set(r,a.getNodeUV(o.node1)),i.attributes.node.set(r+1,a.getNodeUV(o.node2));var l=n.getItemVisual(o.dataIndex,"color"),u=s.a.parseColor(l);u[3]*=h.a.firstNotNull(n.getItemVisual(o.dataIndex,"opacity"),1),i.attributes.color.set(r,u),i.attributes.color.set(r+1,u),r+=2})),i.dirty()},_updateMeshLinesGeometry:function(){var e=this._model.getEdgeData(),t=this._edgesMesh.geometry,i=(e=this._model.getEdgeData(),this._model.getData().getLayout("points"));t.resetOffset(),t.setVertexCount(e.count()*t.getLineVertexCount()),t.setTriangleCount(e.count()*t.getLineTriangleCount());var n=[],r=[],a=["lineStyle","width"];this._originalEdgeColors=new Float32Array(4*e.count()),this._edgeIndicesMap=new Float32Array(e.count()),e.each((function(o){var l=e.graph.getEdgeByIndex(o),u=2*l.node1.dataIndex,c=2*l.node2.dataIndex;n[0]=i[u],n[1]=i[u+1],r[0]=i[c],r[1]=i[c+1];var d=e.getItemVisual(l.dataIndex,"color"),f=s.a.parseColor(d);f[3]*=h.a.firstNotNull(e.getItemVisual(l.dataIndex,"opacity"),1);var p=e.getItemModel(l.dataIndex),g=h.a.firstNotNull(p.get(a),1)*this._api.getDevicePixelRatio();t.addLine(n,r,f,g);for(var m=0;m<4;m++)this._originalEdgeColors[4*l.dataIndex+m]=f[m];this._edgeIndicesMap[l.dataIndex]=o}),this),t.dirty()},_updateForceNodesGeometry:function(e){for(var t=this._pointsBuilder.getPointsMesh(),i=[],n=0;n<e.count();n++)this._forceLayoutInstance.getNodeUV(n,i),t.geometry.attributes.position.set(n,i);t.geometry.dirty("position")},_initLayout:function(e,t,i){var n=e.get("layout"),a=e.getGraph(),s=e.getBoxLayoutParams(),l=o.a.getLayoutRect(s,{width:i.getWidth(),height:i.getHeight()});"force"===n&&(console.warn("Currently only forceAtlas2 layout supported."),n="forceAtlas2"),this.stopLayout(e,t,i,{beforeLayout:!0});var u=e.getData(),f=e.getData();if("forceAtlas2"===n){var p=e.getModel("forceAtlas2"),g=this._forceLayoutInstance,m=[],v=[],y=u.getDataExtent("value"),_=f.getDataExtent("value"),x=h.a.firstNotNull(p.get("edgeWeight"),1),b=h.a.firstNotNull(p.get("nodeWeight"),1);"number"==typeof x&&(x=[x,x]),"number"==typeof b&&(b=[b,b]);var w=0,T={},S=new Float32Array(2*u.count());if(a.eachNode((function(e){var t,i,n=e.dataIndex,a=u.get("value",n);if(u.hasItemOption){var o=u.getItemModel(n);t=o.get("x"),i=o.get("y")}null==t&&(t=l.x+Math.random()*l.width,i=l.y+Math.random()*l.height),S[2*w]=t,S[2*w+1]=i,T[e.id]=w++;var s=r.a.number.linearMap(a,y,b);isNaN(s)&&(s=isNaN(b[0])?1:b[0]),m.push({x:t,y:i,mass:s,size:u.getItemVisual(n,"symbolSize")})})),u.setLayout("points",S),a.eachEdge((function(e){var t=e.dataIndex,i=u.get("value",t),n=r.a.number.linearMap(i,_,x);isNaN(n)&&(n=isNaN(x[0])?1:x[0]),v.push({node1:T[e.node1.id],node2:T[e.node2.id],weight:n,dataIndex:t})})),!g){var M=p.get("GPU");this._forceLayoutInstance&&((!M||this._forceLayoutInstance instanceof c.a)&&(M||this._forceLayoutInstance instanceof d.a)||(this._forceLayoutInstanceToDispose=this._forceLayoutInstance)),g=this._forceLayoutInstance=M?new c.a:new d.a}g.initData(m,v),g.updateOption(p.option),this._updateForceEdgesGeometry(g.getEdges(),e),this._updatePositionTexture(),i.dispatchAction({type:"graphGLStartLayout",from:this.uid})}else S=new Float32Array(2*u.count()),w=0,a.eachNode((function(e){var t,i,n=e.dataIndex;if(u.hasItemOption){var r=u.getItemModel(n);t=r.get("x"),i=r.get("y")}S[w++]=t,S[w++]=i})),u.setLayout("points",S),this._updateAfterLayout(e,t,i)},_updatePositionTexture:function(){var e=this._forceLayoutInstance.getNodePositionTexture();this._pointsBuilder.setPositionTexture(e),this._forceEdgesMesh.material.set("positionTex",e)},startLayout:function(e,t,i,n){if(!n||null==n.from||n.from===this.uid){var r=this.viewGL,a=(i=this._api,this._forceLayoutInstance),o=this._model.getData(),s=this._model.getModel("forceAtlas2");if(a){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=x++,h=s.getShallow("maxSteps"),c=s.getShallow("steps"),d=0,f=Math.max(2*c,20),g=function(t){if(t===l._layoutId)return a.isFinished(h)?(i.dispatchAction({type:"graphGLStopLayout",from:l.uid}),void i.dispatchAction({type:"graphGLFinishLayout",points:o.getLayout("points"),from:l.uid})):void a.update(r.layer.renderer,c,(function(){l._updatePositionTexture(),(d+=c)>=f&&(l._syncNodePosition(e),d=0),i.getZr().refresh(),p()((function(){g(t)}))}))};p()((function(){l._forceLayoutInstanceToDispose&&(l._forceLayoutInstanceToDispose.dispose(r.layer.renderer),l._forceLayoutInstanceToDispose=null),g(u)})),this._layouting=!0}}else console.error("None layout don't have startLayout action")}},stopLayout:function(e,t,i,n){n&&null!=n.from&&n.from!==this.uid||(this._layoutId=0,this.groupGL.remove(this._forceEdgesMesh),this.groupGL.add(this._edgesMesh),this._forceLayoutInstance&&this.viewGL.layer&&(n&&n.beforeLayout||(this._syncNodePosition(e),this._updateAfterLayout(e,t,i)),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,i){this._updateMeshLinesGeometry(),this._pointsBuilder.removePositionTexture(),this._pointsBuilder.updateLayout(e,t,i),this._pointsBuilder.updateView(this.viewGL.camera),this._pointsBuilder.updateLabels(),this._pointsBuilder.showLabels()},focusNodeAdjacency:function(e,t,i,n){var r=this._model.getData();this._downplayAll();var a=n.dataIndex,o=r.graph,s=[],l=o.getNodeByIndex(a);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(r,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,i,n){this._downplayAll(),this._pointsBuilder.fadeInAll(),this._fadeInEdgesAll(),this._pointsBuilder.updateLabels()},_highlightEdge:function(e){var t=this._model.getEdgeData().getItemModel(e),i=s.a.parseColor(t.get("emphasis.lineStyle.color")||t.get("lineStyle.color")),n=h.a.firstNotNull(t.get("emphasis.lineStyle.opacity"),t.get("lineStyle.opacity"),1);i[3]*=n,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],i)},_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,i){this._getColor(t,e),e[3]*=i,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],e)}}(),_getColor:function(e,t){for(var i=0;i<4;i++)t[i]=this._originalEdgeColors[4*e+i];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 i=this.viewGL.camera,n=e.getData().getLayout("points"),r=_.create(1/0,1/0),a=_.create(-1/0,-1/0),o=[],s=0;s<n.length;)o[0]=n[s++],o[1]=n[s++],_.min(r,r,o),_.max(a,a,o);var l=(a[1]+r[1])/2,u=(a[0]+r[0])/2;if(!(u>i.left&&u<i.right&&l<i.bottom&&l>i.top)){var h=Math.max(a[0]-r[0],10),c=h/t.getWidth()*t.getHeight();h*=1.4,c*=1.4,r[0]-=.2*h,i.left=r[0],i.top=l-c/2,i.bottom=l+c/2,i.right=h+r[0],i.near=0,i.far=100}},dispose:function(){var e=this.viewGL.layer.renderer;this._forceLayoutInstance&&this._forceLayoutInstance.dispose(e),this.groupGL.removeAll(),this._layoutId=-1},remove:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(16),s=i(10),l=i(270);a.a.Shader.import(l.a);var u={repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null};function h(e){var t={type:a.a.Texture.FLOAT,minFilter:a.a.Texture.NEAREST,magFilter:a.a.Texture.NEAREST};this._positionSourceTex=new a.a.Texture2D(t),this._positionSourceTex.flipY=!1,this._positionTex=new a.a.Texture2D(t),this._positionPrevTex=new a.a.Texture2D(t),this._forceTex=new a.a.Texture2D(t),this._forcePrevTex=new a.a.Texture2D(t),this._weightedSumTex=new a.a.Texture2D(t),this._weightedSumTex.width=this._weightedSumTex.height=1,this._globalSpeedTex=new a.a.Texture2D(t),this._globalSpeedPrevTex=new a.a.Texture2D(t),this._globalSpeedTex.width=this._globalSpeedTex.height=1,this._globalSpeedPrevTex.width=this._globalSpeedPrevTex.height=1,this._nodeRepulsionPass=new o.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.updateNodeRepulsion")}),this._positionPass=new o.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.updatePosition")}),this._globalSpeedPass=new o.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.calcGlobalSpeed")}),this._copyPass=new o.a({fragment:a.a.Shader.source("clay.compositor.output")});var i=function(e){e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE)};this._edgeForceMesh=new a.a.Mesh({geometry:new a.a.Geometry({attributes:{node1:new a.a.Geometry.Attribute("node1","float",2),node2:new a.a.Geometry.Attribute("node2","float",2),weight:new a.a.Geometry.Attribute("weight","float",1)},dynamic:!0,mainAttribute:"node1"}),material:new a.a.Material({transparent:!0,shader:a.a.createShader("ecgl.forceAtlas2.updateEdgeAttraction"),blend:i,depthMask:!1,depthText:!1}),mode:a.a.Mesh.POINTS}),this._weightedSumMesh=new a.a.Mesh({geometry:new a.a.Geometry({attributes:{node:new a.a.Geometry.Attribute("node","float",2)},dynamic:!0,mainAttribute:"node"}),material:new a.a.Material({transparent:!0,shader:a.a.createShader("ecgl.forceAtlas2.calcWeightedSum"),blend:i,depthMask:!1,depthText:!1}),mode:a.a.Mesh.POINTS}),this._framebuffer=new s.a({depthBuffer:!1}),this._dummyCamera=new a.a.OrthographicCamera({left:-1,right:1,top:1,bottom:-1,near:0,far:100}),this._globalSpeed=0}h.prototype.updateOption=function(e){for(var t in u)this[t]=u[t];var i=this._nodes.length;if(this.jitterTolerence=i>5e4?10:i>5e3?1:.1,this.scaling=i>100?2:10,e)for(var t in u)null!=e[t]&&(this[t]=e[t]);if(this.repulsionByDegree)for(var n=this._positionSourceTex.pixels,r=0;r<this._nodes.length;r++)n[4*r+2]=(this._nodes[r].degree||0)+1},h.prototype._updateGravityCenter=function(e){var t=this._nodes,i=this._edges;if(this.gravityCenter)this._gravityCenter=this.gravityCenter;else{for(var n=[1/0,1/0],r=[-1/0,-1/0],a=0;a<t.length;a++)n[0]=Math.min(t[a].x,n[0]),n[1]=Math.min(t[a].y,n[1]),r[0]=Math.max(t[a].x,r[0]),r[1]=Math.max(t[a].y,r[1]);this._gravityCenter=[.5*(n[0]+r[0]),.5*(n[1]+r[1])]}for(a=0;a<i.length;a++){var o=i[a].node1,s=i[a].node2;t[o].degree=(t[o].degree||0)+1,t[s].degree=(t[s].degree||0)+1}},h.prototype.initData=function(e,t){this._nodes=e,this._edges=t,this._updateGravityCenter();var i=Math.ceil(Math.sqrt(e.length)),n=i,r=new Float32Array(i*n*4);this._resize(i,n);for(var a=0,o=0;o<e.length;o++){var s=e[o];r[a++]=s.x||0,r[a++]=s.y||0,r[a++]=s.mass||1,r[a++]=s.size||1}this._positionSourceTex.pixels=r;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 h=[];for(o=0;o<t.length;o++){var c=l.attributes,d=t[o].weight;null==d&&(d=1),c.node1.set(o,this.getNodeUV(t[o].node1,h)),c.node2.set(o,this.getNodeUV(t[o].node2,h)),c.weight.set(o,d),c.node1.set(o+u,this.getNodeUV(t[o].node2,h)),c.node2.set(o+u,this.getNodeUV(t[o].node1,h)),c.weight.set(o+u,d)}var f=this._weightedSumMesh.geometry;for(f.attributes.node.init(e.length),o=0;o<e.length;o++)f.attributes.node.set(o,this.getNodeUV(o,h));l.dirty(),f.dirty(),this._nodeRepulsionPass.material.define("fragment","NODE_COUNT",e.length),this._nodeRepulsionPass.material.setUniform("textureSize",[i,n]),this._inited=!1,this._frame=0},h.prototype.getNodes=function(){return this._nodes},h.prototype.getEdges=function(){return this._edges},h.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 i=this._edgeForceMesh;i.material.set("linLogMode",this.linLogMode),i.material.set("edgeWeightInfluence",this.edgeWeightInfluence),i.material.set("preventOverlap",this.preventOverlap),i.material.set("positionTex",this._positionPrevTex),e.gl.enable(e.gl.BLEND),e.renderPass([i],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 n=this._weightedSumMesh;n.material.set("positionTex",this._positionPrevTex),n.material.set("forceTex",this._forceTex),n.material.set("forcePrevTex",this._forcePrevTex),e.renderPass([n],this._dummyCamera),this._framebuffer.attach(this._globalSpeedTex);var r=this._globalSpeedPass;r.setUniform("globalSpeedPrevTex",this._globalSpeedPrevTex),r.setUniform("weightedSumTex",this._weightedSumTex),r.setUniform("jitterTolerence",this.jitterTolerence),e.gl.disable(e.gl.BLEND),r.render(e);var a=this._positionPass;this._framebuffer.attach(this._positionTex),a.setUniform("globalSpeedTex",this._globalSpeedTex),a.setUniform("positionTex",this._positionPrevTex),a.setUniform("forceTex",this._forceTex),a.setUniform("forcePrevTex",this._forcePrevTex),a.render(e),this._framebuffer.unbind(e),this._swapTexture()},h.prototype.update=function(e,t,i){null==t&&(t=1),t=Math.max(t,1);for(var n=0;n<t;n++)this.step(e);i&&i()},h.prototype.getNodePositionTexture=function(){return this._inited?this._positionPrevTex:this._positionSourceTex},h.prototype.getNodeUV=function(e,t){t=t||[];var i=this._positionTex.width,n=this._positionTex.height;return t[0]=e%i/(i-1),t[1]=Math.floor(e/i)/(n-1)||0,t},h.prototype.getNodePosition=function(e,t){var i=this._positionArr,n=this._positionTex.width,r=this._positionTex.height,a=n*r;i&&i.length===4*a||(i=this._positionArr=new Float32Array(4*a)),this._framebuffer.bind(e),this._framebuffer.attach(this._positionPrevTex),e.gl.readPixels(0,0,n,r,e.gl.RGBA,e.gl.FLOAT,i),this._framebuffer.unbind(e),t||(t=new Float32Array(2*this._nodes.length));for(var o=0;o<this._nodes.length;o++)t[2*o]=i[4*o],t[2*o+1]=i[4*o+1];return t},h.prototype.getTextureData=function(e,t){var i=this["_"+t+"Tex"],n=i.width,r=i.height;this._framebuffer.bind(e),this._framebuffer.attach(i);var a=new Float32Array(n*r*4);return e.gl.readPixels(0,0,n,r,e.gl.RGBA,e.gl.FLOAT,a),this._framebuffer.unbind(e),a},h.prototype.getTextureSize=function(){return{width:this._positionTex.width,height:this._positionTex.height}},h.prototype.isFinished=function(e){return this._frame>e},h.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},h.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)},h.prototype._resize=function(e,t){["_positionSourceTex","_positionTex","_positionPrevTex","_forceTex","_forcePrevTex"].forEach((function(i){this[i].width=e,this[i].height=t,this[i].dirty()}),this)},h.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)},r.a.ForceAtlas2GPU=h,t.a=h},function(e,t,i){t.a="@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"},function(e,t,i){var n=i(5),r=i(4),a=i(272).a.toString();a=a.slice(a.indexOf("{")+1,a.lastIndexOf("}"));var o={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},s=function(e){for(var t in o)this[t]=o[t];if(e)for(var t in e)this[t]=e[t];this._nodes=[],this._edges=[],this._disposed=!1,this._positionTex=new n.a({type:r.a.FLOAT,flipY:!1,minFilter:r.a.NEAREST,magFilter:r.a.NEAREST})};s.prototype.initData=function(e,t){var i=new Blob([a]),n=window.URL.createObjectURL(i);this._worker=new Worker(n),this._worker.onmessage=this._$onupdate.bind(this),this._nodes=e,this._edges=t,this._frame=0;for(var r=e.length,o=t.length,s=new Float32Array(2*r),l=new Float32Array(r),u=new Float32Array(r),h=new Float32Array(2*o),c=new Float32Array(o),d=0;d<e.length;d++){var f=e[d];s[2*d]=f.x,s[2*d+1]=f.y,l[d]=null==f.mass?1:f.mass,u[d]=null==f.size?1:f.size}for(d=0;d<t.length;d++){var p=t[d],g=p.node1,m=p.node2;h[2*d]=g,h[2*d+1]=m,c[d]=null==p.weight?1:p.weight}var v=Math.ceil(Math.sqrt(e.length)),y=v,_=new Float32Array(v*y*4),x=this._positionTex;x.width=v,x.height=y,x.pixels=_,this._worker.postMessage({cmd:"init",nodesPosition:s,nodesMass:l,nodesSize:u,edges:h,edgesWeight:c}),this._globalSpeed=1/0},s.prototype.updateOption=function(e){var t={};for(var i in o)t[i]=o[i];var n=this._nodes,r=this._edges,a=n.length;if(t.jitterTolerence=a>5e4?10:a>5e3?1:.1,t.scaling=a>100?2:10,t.barnesHutOptimize=a>1e3,e)for(var i in o)null!=e[i]&&(t[i]=e[i]);if(!t.gravityCenter){for(var s=[1/0,1/0],l=[-1/0,-1/0],u=0;u<n.length;u++)s[0]=Math.min(n[u].x,s[0]),s[1]=Math.min(n[u].y,s[1]),l[0]=Math.max(n[u].x,l[0]),l[1]=Math.max(n[u].y,l[1]);t.gravityCenter=[.5*(s[0]+l[0]),.5*(s[1]+l[1])]}for(u=0;u<r.length;u++){var h=r[u].node1,c=r[u].node2;n[h].degree=(n[h].degree||0)+1,n[c].degree=(n[c].degree||0)+1}this._worker&&this._worker.postMessage({cmd:"updateConfig",config:t})},s.prototype.update=function(e,t,i){null==t&&(t=1),t=Math.max(t,1),this._frame+=t,this._onupdate=i,this._worker&&this._worker.postMessage({cmd:"update",steps:Math.round(t)})},s.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()}},s.prototype.getNodePositionTexture=function(){return this._positionTex},s.prototype.getNodeUV=function(e,t){t=t||[];var i=this._positionTex.width,n=this._positionTex.height;return t[0]=e%i/(i-1),t[1]=Math.floor(e/i)/(n-1),t},s.prototype.getNodes=function(){return this._nodes},s.prototype.getEdges=function(){return this._edges},s.prototype.isFinished=function(e){return this._frame>e},s.prototype.getNodePosition=function(e,t){if(t||(t=new Float32Array(2*this._nodes.length)),this._positionArr)for(var i=0;i<this._positionArr.length;i++)t[i]=this._positionArr[i];return t},s.prototype._updateTexture=function(e){for(var t=this._positionTex.pixels,i=0,n=0;n<e.length;)t[i++]=e[n++],t[i++]=e[n++],t[i++]=1,t[i++]=1;this._positionTex.dirty()},s.prototype.dispose=function(e){this._disposed=!0,this._worker=null},t.a=s},function(e,t,i){t.a=function(){var e=function(){return new Float32Array(2)},t=function(e,t){var i=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(i*i+n*n)},i=function(e){var t=e[0],i=e[1];return Math.sqrt(t*t+i*i)},n=function(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e},r=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e},a=function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e},o=function(e,t){return e[0]=t[0],e[1]=t[1],e},s=function(e,t,i){return e[0]=t,e[1]=i,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 h(){this.position=new Float32Array(2),this.force=e(),this.forcePrev=e(),this.mass=1,this.inDegree=0,this.outDegree=0}function c(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 i=0;i<this.nSubRegions;i++){var n=this.subRegions[i];if(n.contain(e,t))return n}},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,i,n){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=i,this.bbox[3]=n,this.size=(i-e+n-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]),i=this.bbox;if(!t){var n=(i[0]+i[2])/2,r=(i[1]+i[3])/2,a=(i[2]-i[0])/2,o=(i[3]-i[1])/2,s=e.position[0]>=n?1:0,l=e.position[1]>=r?1:0;(t=this._newSubRegion()).setBBox(s*a+i[0],l*o+i[1],(s+1)*a+i[0],(l+1)*o+i[1])}t.addNode(e)},u._updateCenterOfMass=function(e){null==this.centerOfMass&&(this.centerOfMass=new Float32Array(2));var t=this.centerOfMass[0]*this.mass,i=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,i+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=i/this.mass};var f=d.prototype;f.initNodes=function(e,t,i){var n=t.length;this.nodes.length=0;for(var r=void 0!==i,a=0;a<n;a++){var o=new h;o.position[0]=e[2*a],o.position[1]=e[2*a+1],o.mass=t[a],r&&(o.size=i[a]),this.nodes.push(o)}this._massArr=t,this._swingingArr=new Float32Array(n),r&&(this._sizeArr=i)},f.initEdges=function(e,t){var i=e.length/2;this.edges.length=0;for(var n=0;n<i;n++){var r=e[2*n],a=e[2*n+1],o=this.nodes[r],s=this.nodes[a];if(!o||!s)return void console.error("Node not exists, try initNodes before initEdges");o.outDegree++,s.inDegree++;var l=new c(o,s);t&&(l.weight=t[n]),this.edges.push(l)}},f.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]}},f.update=function(){var a=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<a;l++)this.rootRegion.addNode(this.nodes[l]);this.rootRegion.afterUpdate()}for(l=0;l<a;l++){var u=this.nodes[l];o(u.forcePrev,u.force),s(u.force,0,0)}for(l=0;l<a;l++){var h=this.nodes[l];if(this.barnesHutOptimize)this.applyRegionToNodeRepulsion(this.rootRegion,h);else for(var c=l+1;c<a;c++){var d=this.nodes[c];this.applyNodeToNodeRepulsion(h,d,!1)}this.gravity>0&&(this.strongGravityMode?this.applyNodeStrongGravity(h):this.applyNodeGravity(h))}for(l=0;l<this.edges.length;l++)this.applyEdgeAttraction(this.edges[l]);var f=0,p=0,g=e();for(l=0;l<a;l++)u=this.nodes[l],f+=(v=t(u.force,u.forcePrev))*u.mass,r(g,u.force,u.forcePrev),p+=.5*i(g)*u.mass,this._swingingArr[l]=v;var m=this.jitterTolerence*this.jitterTolerence*p/f;for(this._globalSpeed>0&&(m=Math.min(m/this._globalSpeed,1.5)*this._globalSpeed),this._globalSpeed=m,l=0;l<a;l++){u=this.nodes[l];var v=this._swingingArr[l],y=.1*m/(1+m*Math.sqrt(v)),_=i(u.force);_>0&&(y=Math.min(_*y,10)/_,n(u.position,u.position,u.force,y))}},f.applyRegionToNodeRepulsion=function(){var t=e();return function(e,i){if(e.node)this.applyNodeToNodeRepulsion(e.node,i,!0);else{a(t,i.position,e.centerOfMass);var r=t[0]*t[0]+t[1]*t[1];if(r>this.barnesHutTheta*e.size*e.size){var o=this.scaling*i.mass*e.mass/r;n(i.force,i.force,t,o)}else for(var s=0;s<e.nSubRegions;s++)this.applyRegionToNodeRepulsion(e.subRegions[s],i)}}}(),f.applyNodeToNodeRepulsion=function(){var t=e();return function(e,i,r){if(e!=i){a(t,e.position,i.position);var o=t[0]*t[0]+t[1]*t[1];if(0!==o){var s;if(this.preventOverlap){var l=Math.sqrt(o);if((l=l-e.size-i.size)>0)s=this.scaling*e.mass*i.mass/(l*l);else{if(!(l<0))return;s=100*this.scaling*e.mass*i.mass}}else s=this.scaling*e.mass*i.mass/o;n(e.force,e.force,t,s),n(i.force,i.force,t,-s)}}}}(),f.applyEdgeAttraction=function(){var t=e();return function(e){var r=e.source,o=e.target;a(t,r.position,o.position);var s,l,u=i(t);s=0===this.edgeWeightInfluence?1:1===this.edgeWeightInfluence?e.weight:Math.pow(e.weight,this.edgeWeightInfluence),this.preventOverlap&&(u=u-r.size-o.size)<=0||(l=this.linLogMode?-s*Math.log(u+1)/(u+1):-s,n(r.force,r.force,t,l),n(o.force,o.force,t,-l))}}(),f.applyNodeGravity=function(){var t=e();return function(e){a(t,this.gravityCenter,e.position);var r=i(t);n(e.force,e.force,t,this.gravity*e.mass/(r+1))}}(),f.applyNodeStrongGravity=function(){var t=e();return function(e){a(t,this.gravityCenter,e.position),n(e.force,e.force,t,this.gravity*e.mass)}}(),f.updateBBox=function(){for(var e=1/0,t=1/0,i=-1/0,n=-1/0,r=0;r<this.nodes.length;r++){var a=this.nodes[r].position;e=Math.min(e,a[0]),t=Math.min(t,a[1]),i=Math.max(i,a[0]),n=Math.max(n,a[1])}this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=i,this.bbox[3]=n},f.getGlobalSpeed=function(){return this._globalSpeed};var p=null;self.onmessage=function(e){switch(e.data.cmd){case"init":(p=new d).initNodes(e.data.nodesPosition,e.data.nodesMass,e.data.nodesSize),p.initEdges(e.data.edges,e.data.edgesWeight);break;case"updateConfig":if(p)for(var t in e.data.config)p[t]=e.data.config[t];break;case"update":var i=e.data.steps;if(p){for(var n=0;n<i;n++)p.update();var r=p.nodes.length,a=new Float32Array(2*r);for(n=0;n<r;n++){var o=p.nodes[n];a[2*n]=o.position[0],a[2*n+1]=o.position[1]}self.postMessage({buffer:a.buffer,globalSpeed:p.getGlobalSpeed()},[a.buffer])}else{var s=new Float32Array;self.postMessage({buffer:s.buffer,globalSpeed:p.getGlobalSpeed()},[s.buffer])}}}}},function(e,t,i){var n=i(7);i(2);var r=n.a.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,i=e.offsetY;if(!this.viewGL||this.viewGL.containPoint(t,i)){this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler);var n=this._convertPos(t,i);this._x=n.x,this._y=n.y}}},_convertPos:function(e,t){var i=this.viewGL.camera,n=this.viewGL.viewport;return{x:(e-n.x)/n.width*(i.right-i.left)+i.left,y:(t-n.y)/n.height*(i.bottom-i.top)+i.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 i=e.offsetX,n=e.offsetY;if(!this.viewGL||this.viewGL.containPoint(i,n)){var r=t>0?1.1:.9,a=Math.max(Math.min(this._zoom*r,this.maxZoom),this.minZoom);r=a/this._zoom;var o=this._convertPos(i,n),s=(o.x-this._dx)*(r-1),l=(o.y-this._dy)*(r-1);this._dx-=s,this._dy-=l,this._zoom=a,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)}});t.a=r},function(e,t,i){t.a="@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"},function(e,t,i){var n=i(0);i.n(n),i(276),i(280)},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(2),s=i(22),l=i(277);r.a.extendChartView({type:"flowGL",__ecgl__:!0,init:function(e,t){this.viewGL=new s.a("orthographic"),this.groupGL=new a.a.Node,this.viewGL.add(this.groupGL),this._particleSurface=new l.a;var i=new a.a.Mesh({geometry:new a.a.PlaneGeometry,material:new a.a.Material({shader:new a.a.Shader({vertex:a.a.Shader.source("ecgl.color.vertex"),fragment:a.a.Shader.source("ecgl.color.fragment")}),transparent:!0})});i.material.enableTexture("diffuseMap"),this.groupGL.add(i),this._planeMesh=i},render:function(e,t,i){var n=this._particleSurface;n.setParticleType(e.get("particleType")),n.setSupersampling(e.get("supersampling")),this._updateData(e,i),this._updateCamera(i.getWidth(),i.getHeight(),i.getDevicePixelRatio());var r=o.a.firstNotNull(e.get("particleDensity"),128);n.setParticleDensity(r,r);var s=this._planeMesh,l=+new Date,u=this,h=!0;s.__percent=0,s.stopAnimation(),s.animate("",{loop:!0}).when(1e5,{__percent:1}).during((function(){var e=+new Date,t=Math.min(e-l,20);l+=t,u._renderer&&(n.update(u._renderer,i,t/1e3,h),s.material.set("diffuseMap",n.getSurfaceTexture())),h=!1})).start();var c=e.getModel("itemStyle"),d=a.a.parseColor(c.get("color"));d[3]*=o.a.firstNotNull(c.get("opacity"),1),s.material.set("color",d),n.setColorTextureImage(e.get("colorTexture"),i),n.setParticleSize(e.get("particleSize")),n.particleSpeedScaling=e.get("particleSpeed"),n.motionBlurFactor=1-Math.pow(.1,e.get("particleTrail"))},updateTransform:function(e,t,i){this._updateData(e,i)},afterRender:function(e,t,i,n){var r=n.renderer;this._renderer=r},_updateData:function(e,t){var i=e.coordinateSystem,n=i.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]})),r=e.getData(),a=r.getDataExtent(n[0]),o=r.getDataExtent(n[1]),s=e.get("gridWidth"),l=e.get("gridHeight");if(null==s||"auto"===s){var u=(a[1]-a[0])/(o[1]-o[0]);s=Math.round(Math.sqrt(u*r.count()))}null!=l&&"auto"!==l||(l=Math.ceil(r.count()/s));var h=this._particleSurface.vectorFieldTexture,c=h.pixels;if(c&&c.length===l*s*4)for(var d=0;d<c.length;d++)c[d]=0;else c=h.pixels=new Float32Array(s*l*4);var f=0,p=1/0,g=new Float32Array(2*r.count()),m=0,v=[[1/0,1/0],[-1/0,-1/0]];r.each([n[0],n[1],"vx","vy"],(function(e,t,n,r){var a=i.dataToPoint([e,t]);g[m++]=a[0],g[m++]=a[1],v[0][0]=Math.min(a[0],v[0][0]),v[0][1]=Math.min(a[1],v[0][1]),v[1][0]=Math.max(a[0],v[1][0]),v[1][1]=Math.max(a[1],v[1][1]);var o=Math.sqrt(n*n+r*r);f=Math.max(f,o),p=Math.min(p,o)})),r.each(["vx","vy"],(function(e,t,i){var n=Math.round((g[2*i]-v[0][0])/(v[1][0]-v[0][0])*(s-1)),r=4*((l-1-Math.round((g[2*i+1]-v[0][1])/(v[1][1]-v[0][1])*(l-1)))*s+n);c[r]=e/f*.5+.5,c[r+1]=t/f*.5+.5,c[r+3]=1})),h.width=s,h.height=l,"bmap"===e.get("coordinateSystem")&&this._fillEmptyPixels(h),h.dirty(),this._updatePlanePosition(v[0],v[1],e,t),this._updateGradientTexture(r.getVisual("visualMeta"),[p,f])},_fillEmptyPixels:function(e){var t=e.pixels,i=e.width,n=e.height;function r(e,r,a){e=Math.max(Math.min(e,i-1),0);var o=4*((r=Math.max(Math.min(r,n-1),0))*(i-1)+e);return 0!==t[o+3]&&(a[0]=t[o],a[1]=t[o+1],!0)}function a(e,t,i){i[0]=e[0]+t[0],i[1]=e[1]+t[1]}for(var o=[],s=[],l=[],u=[],h=[],c=0,d=0;d<n;d++)for(var f=0;f<i;f++){var p=4*(d*(i-1)+f);0===t[p+3]&&(c=o[0]=o[1]=0,r(f-1,d,s)&&(c++,a(s,o,o)),r(f+1,d,l)&&(c++,a(l,o,o)),r(f,d-1,u)&&(c++,a(u,o,o)),r(f,d+1,h)&&(c++,a(h,o,o)),o[0]/=c,o[1]/=c,t[p]=o[0],t[p+1]=o[1]),t[p+3]=1}},_updateGradientTexture:function(e,t){if(e&&e.length){this._gradientTexture=this._gradientTexture||new a.a.Texture2D({image:document.createElement("canvas")});var i=this._gradientTexture,n=i.image;n.width=200,n.height=1;var r=n.getContext("2d"),o=r.createLinearGradient(0,.5,n.width,.5);e[0].stops.forEach((function(e){var i;t[1]===t[0]?i=0:(i=e.value/t[1],i=Math.min(Math.max(i,0),1)),o.addColorStop(i,e.color)})),r.fillStyle=o,r.fillRect(0,0,n.width,n.height),i.dirty(),this._particleSurface.setGradientTexture(this._gradientTexture)}else this._particleSurface.setGradientTexture(null)},_updatePlanePosition:function(e,t,i,n){var r=this._limitInViewportAndFullFill(e,t,i,n);e=r.leftTop,t=r.rightBottom,this._particleSurface.setRegion(r.region),this._planeMesh.position.set((e[0]+t[0])/2,n.getHeight()-(e[1]+t[1])/2,0);var a=t[0]-e[0],o=t[1]-e[1];this._planeMesh.scale.set(a/2,o/2,1),this._particleSurface.resize(Math.max(Math.min(a,2048),1),Math.max(Math.min(o,2048),1)),this._renderer&&this._particleSurface.clearFrame(this._renderer)},_limitInViewportAndFullFill:function(e,t,i,n){var r=[Math.max(e[0],0),Math.max(e[1],0)],a=[Math.min(t[0],n.getWidth()),Math.min(t[1],n.getHeight())];if("bmap"===i.get("coordinateSystem")){var o=i.getData().getDataExtent(i.coordDimToDataDim("lng")[0]);Math.floor(o[1]-o[0])>=359&&(r[0]>0&&(r[0]=0),a[0]<n.getWidth()&&(a[0]=n.getWidth()))}var s=t[0]-e[0],l=t[1]-e[1],u=a[0]-r[0],h=a[1]-r[1];return{leftTop:r,rightBottom:a,region:[(r[0]-e[0])/s,1-h/l-(r[1]-e[1])/l,u/s,h/l]}},_updateCamera:function(e,t,i){this.viewGL.setViewport(0,0,e,t,i);var n=this.viewGL.camera;n.left=n.bottom=0,n.top=t,n.right=e,n.near=0,n.far=100,n.position.z=10},remove:function(){this._planeMesh.stopAnimation(),this.groupGL.removeAll()},dispose:function(){this._renderer&&this._particleSurface.dispose(this._renderer),this.groupGL.removeAll()}})},function(e,t,i){var n=i(16),r=i(15),a=i(40),o=i(19),s=i(8),l=i(5),u=i(4),h=i(37),c=i(43),d=i(10),f=i(278),p=i(279);s.a.import(p.a);var g=function(){this.motionBlurFactor=.99,this.vectorFieldTexture=new l.a({type:u.a.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()};g.prototype={constructor:g,init:function(){var e={type:u.a.FLOAT,minFilter:u.a.NEAREST,magFilter:u.a.NEAREST,useMipmap:!1};this._spawnTexture=new l.a(e),this._particleTexture0=new l.a(e),this._particleTexture1=new l.a(e),this._frameBuffer=new d.a({depthBuffer:!1}),this._particlePass=new n.a({fragment:s.a.source("ecgl.vfParticle.particle.fragment")}),this._particlePass.setUniform("velocityTexture",this.vectorFieldTexture),this._particlePass.setUniform("spawnTexture",this._spawnTexture),this._downsamplePass=new n.a({fragment:s.a.source("clay.compositor.downsample")});var t=new a.a({renderOrder:10,material:new o.a({shader:new s.a(s.a.source("ecgl.vfParticle.renderPoints.vertex"),s.a.source("ecgl.vfParticle.renderPoints.fragment"))}),mode:a.a.POINTS,geometry:new r.a({dynamic:!0,mainAttribute:"texcoord0"})}),i=new a.a({renderOrder:10,material:new o.a({shader:new s.a(s.a.source("ecgl.vfParticle.renderLines.vertex"),s.a.source("ecgl.vfParticle.renderLines.fragment"))}),geometry:new f.a,culling:!1}),p=new a.a({material:new o.a({shader:new s.a(s.a.source("ecgl.color.vertex"),s.a.source("ecgl.color.fragment"))}),geometry:new c.a});p.material.enableTexture("diffuseMap"),this._particlePointsMesh=t,this._particleLinesMesh=i,this._lastFrameFullQuadMesh=p,this._camera=new h.a,this._thisFrameTexture=new l.a,this._lastFrameTexture=new l.a},setParticleDensity:function(e,t){for(var i=new Float32Array(e*t*4),n=0,r=this.particleLife,a=0;a<e;a++)for(var o=0;o<t;o++,n++){i[4*n]=Math.random(),i[4*n+1]=Math.random(),i[4*n+2]=Math.random();var s=(r[1]-r[0])*Math.random()+r[0];i[4*n+3]=s}"line"===this._particleType?this._setLineGeometry(e,t):this._setPointsGeometry(e,t),this._spawnTexture.width=e,this._spawnTexture.height=t,this._spawnTexture.pixels=i,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 i=e*t,n=this._particlePointsMesh.geometry,r=n.attributes;r.texcoord0.init(i);for(var a=0,o=0;o<e;o++)for(var s=0;s<t;s++,a++)r.texcoord0.value[2*a]=o/e,r.texcoord0.value[2*a+1]=s/t;n.dirty()},_setLineGeometry:function(e,t){var i=e*t,n=this._getParticleMesh().geometry;n.setLineCount(i),n.resetOffset();for(var r=0;r<e;r++)for(var a=0;a<t;a++)n.addLine([r/e,a/t]);n.dirty()},_getParticleMesh:function(){return"line"===this._particleType?this._particleLinesMesh:this._particlePointsMesh},update:function(e,t,i,n){var r=this._getParticleMesh(),a=this._frameBuffer,o=this._particlePass;n&&this._updateDownsampleTextures(e,t),r.material.set("size",this._particleSize*this._supersampling),r.material.set("color",this.particleColor),o.setUniform("speedScaling",this.particleSpeedScaling),a.attach(this._particleTexture1),o.setUniform("firstFrameTime",n?(this.particleLife[1]+this.particleLife[0])/2:0),o.setUniform("particleTexture",this._particleTexture0),o.setUniform("deltaTime",i),o.setUniform("elapsedTime",this._elapsedTime),o.render(e,a),r.material.set("particleTexture",this._particleTexture1),r.material.set("prevParticleTexture",this._particleTexture0),a.attach(this._thisFrameTexture),a.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,r],this._camera),a.unbind(e),this._downsample(e),this._swapTexture(),this._elapsedTime+=i},_downsample:function(e){var t=this._downsampleTextures;if(0!==t.length)for(var i=0,n=this._thisFrameTexture,r=t[i];r;)this._frameBuffer.attach(r),this._downsamplePass.setUniform("texture",n),this._downsamplePass.setUniform("textureSize",[n.width,n.height]),this._downsamplePass.render(e,this._frameBuffer),n=r,r=t[++i]},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 l.a),this._spriteTexture.image&&this._spriteTexture.image.width===e||(this._spriteTexture.image=function(e){var t=document.createElement("canvas");t.width=t.height=e;var i=t.getContext("2d");return i.fillStyle="#fff",i.arc(e/2,e/2,e/2,0,2*Math.PI),i.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 i=this._downsampleTextures,n=Math.max(Math.floor(Math.log(this._supersampling/t.getDevicePixelRatio())/Math.log(2)),0),r=2,a=this._width*this._supersampling,o=this._height*this._supersampling,s=0;s<n;s++)i[s]=i[s]||new l.a,i[s].width=a/r,i[s].height=o/r,r*=2;for(;s<i.length;s++)i[s].dispose(e);i.length=n},_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)}))}},t.a=g},function(e,t,i){var n=i(15),r=i(0);i.n(r);var a=n.a.extend((function(){return{dynamic:!0,attributes:{position:new n.a.Attribute("position","float",3,"POSITION")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setLineCount:function(e){var t=this.attributes,i=4*e,n=2*e;this.vertexCount!==i&&t.position.init(i),this.triangleCount!==n&&(this.indices=0===n?null:this.vertexCount>65535?new Uint32Array(3*n):new Uint16Array(3*n))},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}});t.a=a},function(e,t,i){t.a="@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"},function(e,t,i){var n=i(0),r=i.n(n);r.a.extendSeriesModel({type:"series.flowGL",dependencies:["geo","grid","bmap"],visualColorAccessPath:"itemStyle.color",getInitialData:function(e,t){var i=r.a.getCoordinateSystemDimensions(this.get("coordinateSystem"))||["x","y"];if(i.length>2)throw new Error("flowGL can only be used on 2d coordinate systems.");i.push("vx","vy");var n=r.a.helper.completeDimensions(i,this.getSource(),{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),a=new r.a.List(n,this);return a.initData(this.getSource()),a},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}}})},function(e,t,i){var n=i(0),r=i.n(n);i(282),i(283);var a=i(17);r.a.registerVisual(Object(a.a)("linesGL"))},function(e,t,i){var n=i(0),r=i.n(n),a=i(13);i.n(a);var o=r.a.extendSeriesModel({type:"series.linesGL",dependencies:["grid","geo"],visualColorAccessPath:"lineStyle.color",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)),o.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)),o.superApply(this,"mergeOption",arguments)},appendData:function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=Object(a.concatArray)(this._flatCoords,t.flatCoords),this._flatCoordsOffset=Object(a.concatArray)(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),i=t.option instanceof Array?t.option:t.getShallow("coords");if(!(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.");return i},getLineCoordsCount:function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},getLineCoords:function(e,t){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[2*e],n=this._flatCoordsOffset[2*e+1],r=0;r<n;r++)t[r]=t[r]||[],t[r][0]=this._flatCoords[i+2*r],t[r][1]=this._flatCoords[i+2*r+1];return n}var a=this._getCoordsFromItemModel(e);for(r=0;r<a.length;r++)t[r]=t[r]||[],t[r][0]=a[r][0],t[r][1]=a[r][1];return a.length},_processFlatCoordsArray:function(e){var t=0;if(this._flatCoords&&(t=this._flatCoords.length),"number"==typeof e[0]){for(var i=e.length,n=new Uint32Array(i),r=new Float64Array(i),a=0,o=0,s=0,l=0;l<i;){s++;var u=e[l++];n[o++]=a+t,n[o++]=u;for(var h=0;h<u;h++){var c=e[l++],d=e[l++];if(r[a++]=c,r[a++]=d,l>i)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(n.buffer,0,o),flatCoords:r,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},getInitialData:function(e,t){var i=new r.a.List(["value"],this);return i.hasItemOption=!1,i.initData(e.data,[],(function(e,t,n,r){if(e instanceof Array)return NaN;i.hasItemOption=!0;var a=e.value;return null!=a?a instanceof Array?a[r]:a:void 0})),i},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}}}})},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(22),s=i(105),l=i(103),u=i(2);r.a.extendChartView({type:"linesGL",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this.viewGL=new o.a("orthographic"),this.viewGL.add(this.groupGL),this._glViewHelper=new l.a(this.viewGL),this._nativeLinesShader=a.a.createShader("ecgl.lines3D"),this._meshLinesShader=a.a.createShader("ecgl.meshLines3D"),this._linesMeshes=[],this._currentStep=0},render:function(e,t,i){this.groupGL.removeAll(),this._glViewHelper.reset(e,i);var n=this._linesMeshes[0];n||(n=this._linesMeshes[0]=this._createLinesMesh(e)),this._linesMeshes.length=1,this.groupGL.add(n),this._updateLinesMesh(e,n,0,e.getData().count()),this.viewGL.setPostEffect(e.getModel("postEffect"),i)},incrementalPrepareRender:function(e,t,i){this.groupGL.removeAll(),this._glViewHelper.reset(e,i),this._currentStep=0,this.viewGL.setPostEffect(e.getModel("postEffect"),i)},incrementalRender:function(e,t,i,n){var r=this._linesMeshes[this._currentStep];r||(r=this._createLinesMesh(t),this._linesMeshes[this._currentStep]=r),this._updateLinesMesh(t,r,e.start,e.end),this.groupGL.add(r),n.getZr().refresh(),this._currentStep++},updateTransform:function(e,t,i){e.coordinateSystem.getRoamTransform&&this._glViewHelper.updateTransform(e,i)},_createLinesMesh:function(e){return new a.a.Mesh({$ignorePicking:!0,material:new a.a.Material({shader:a.a.createShader("ecgl.lines3D"),transparent:!0,depthMask:!1,depthTest:!1}),geometry:new s.a({segmentScale:10,useNativeLine:!0,dynamic:!1}),mode:a.a.Mesh.LINES,culling:!1})},_updateLinesMesh:function(e,t,i,n){var r=e.getData();t.material.blend="lighter"===e.get("blendMode")?a.a.additiveBlend:null;var o=e.get("lineStyle.curveness")||0,s=e.get("polyline"),l=t.geometry,h=e.coordinateSystem,c=u.a.firstNotNull(e.get("lineStyle.width"),1);c>1?(t.material.shader!==this._meshLinesShader&&t.material.attachShader(this._meshLinesShader),t.mode=a.a.Mesh.TRIANGLES):(t.material.shader!==this._nativeLinesShader&&t.material.attachShader(this._nativeLinesShader),t.mode=a.a.Mesh.LINES),i=i||0,n=n||r.count(),l.resetOffset();var d=0,f=0,p=[],g=[],m=[],v=[],y=[],_=.3,x=.7;function b(){g[0]=p[0]*x+v[0]*_-(p[1]-v[1])*o,g[1]=p[1]*x+v[1]*_-(v[0]-p[0])*o,m[0]=p[0]*_+v[0]*x-(p[1]-v[1])*o,m[1]=p[1]*_+v[1]*x-(v[0]-p[0])*o}if(s||0!==o)for(var w=i;w<n;w++)if(s){var T=e.getLineCoordsCount(w);d+=l.getPolylineVertexCount(T),f+=l.getPolylineTriangleCount(T)}else e.getLineCoords(w,y),this._glViewHelper.dataToPoint(h,y[0],p),this._glViewHelper.dataToPoint(h,y[1],v),b(),d+=l.getCubicCurveVertexCount(p,g,m,v),f+=l.getCubicCurveTriangleCount(p,g,m,v);else{var S=n-i;d+=S*l.getLineVertexCount(),f+=S*l.getLineVertexCount()}l.setVertexCount(d),l.setTriangleCount(f);var M=i,A=[];for(w=i;w<n;w++){a.a.parseColor(r.getItemVisual(M,"color"),A);var I=u.a.firstNotNull(r.getItemVisual(M,"opacity"),1);A[3]*=I,T=e.getLineCoords(w,y);for(var C=0;C<T;C++)this._glViewHelper.dataToPoint(h,y[C],y[C]);s?l.addPolyline(y,A,c,0,T):0!==o?(p=y[0],v=y[1],b(),l.addCubicCurve(p,g,m,v,A,c)):l.addPolyline(y,A,c,0,2),M++}},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})}])},p9(u)}}}));
|