UNPKG

zrender

Version:

A lightweight graphic library providing 2d draw for Apache ECharts

1 lines 215 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).zrender={})}(this,function(t){"use strict";var e=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},c=new function(){this.browser=new e,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(c.wxa=!0,c.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?c.worker=!0:"undefined"==typeof navigator||0===navigator.userAgent.indexOf("Node.js")?(c.node=!0,c.svgSupported=!0):function(t,e){var r=e.browser,i=t.match(/Firefox\/([\d.]+)/),n=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(r.firefox=!0,r.version=i[1]);n&&(r.ie=!0,r.version=n[1]);o&&(r.edge=!0,r.version=o[1],r.newEdge=18<+o[1].split(".")[0]);a&&(r.weChat=!0);e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&11<=+r.version),e.domSupported="undefined"!=typeof document;var s=document.documentElement.style;e.transform3dSupported=(r.ie&&"transition"in s||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||r.ie&&9<=+r.version}(navigator.userAgent,c);var h=12,v="sans-serif",E=h+"px "+v;var l,u,p=function(t){var e={};if("undefined"==typeof JSON)return e;for(var r=0;r<t.length;r++){var i=String.fromCharCode(r+32),n=(t.charCodeAt(r)-20)/100;e[i]=n}return e}("007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N"),f={createCanvas:function(){return"undefined"!=typeof document&&document.createElement("canvas")},measureText:function(t,e){var r;if(l||(r=f.createCanvas(),l=r&&r.getContext("2d")),l)return u!==e&&(u=l.font=e||E),l.measureText(t);t=t||"";var i=/(\d+)px/.exec(e=e||E),n=i&&+i[1]||h,o=0;if(0<=e.indexOf("mono"))o=n*t.length;else for(var a=0;a<t.length;a++){var s=p[t[a]];o+=null==s?n:s*n}return{width:o}},loadImage:function(t,e,r){var i=new Image;return i.onload=e,i.onerror=r,i.src=t,i}};var s=D(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(t,e){return t["[object "+e+"]"]=!0,t},{}),d=D(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(t,e){return t["[object "+e+"Array]"]=!0,t},{}),y=Object.prototype.toString,r=Array.prototype,a=r.forEach,g=r.filter,n=r.slice,_=r.map,i=function(){}.constructor,o=i?i.prototype:null,m="__proto__",x=2311;function w(){return x++}function b(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];"undefined"!=typeof console&&console.error.apply(console,t)}function C(t){if(null==t||"object"!=typeof t)return t;var e=t,r=y.call(t);if("[object Array]"===r){if(!rt(t)){e=[];for(var i=0,n=t.length;i<n;i++)e[i]=C(t[i])}}else if(d[r]){if(!rt(t)){var o=t.constructor;if(o.from)e=o.from(t);else{e=new o(t.length);for(i=0,n=t.length;i<n;i++)e[i]=t[i]}}}else if(!s[r]&&!rt(t)&&!j(t))for(var a in e={},t)t.hasOwnProperty(a)&&a!==m&&(e[a]=C(t[a]));return e}function S(t,e,r){if(!W(e)||!W(t))return r?C(e):t;for(var i in e){var n,o;e.hasOwnProperty(i)&&i!==m&&(n=t[i],!W(o=e[i])||!W(n)||G(o)||G(n)||j(o)||j(n)||X(o)||X(n)||rt(o)||rt(n)?!r&&i in t||(t[i]=C(e[i])):S(n,o,r))}return t}function I(t,e){if(Object.assign)Object.assign(t,e);else for(var r in e)e.hasOwnProperty(r)&&r!==m&&(t[r]=e[r]);return t}function k(t,e,r){for(var i=F(e),n=0;n<i.length;n++){var o=i[n];(r?null!=e[o]:null==t[o])&&(t[o]=e[o])}return t}var T=f.createCanvas;function P(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r}return-1}function M(t,e,r){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var i=Object.getOwnPropertyNames(e),n=0;n<i.length;n++){var o=i[n];"constructor"!==o&&(r?null!=e[o]:null==t[o])&&(t[o]=e[o])}else k(t,e,r)}function A(t){return!!t&&("string"!=typeof t&&"number"==typeof t.length)}function O(t,e,r){if(t&&e)if(t.forEach&&t.forEach===a)t.forEach(e,r);else if(t.length===+t.length)for(var i=0,n=t.length;i<n;i++)e.call(r,t[i],i,t);else for(var o in t)t.hasOwnProperty(o)&&e.call(r,t[o],o,t)}function L(t,e,r){if(!t)return[];if(!e)return Q(t);if(t.map&&t.map===_)return t.map(e,r);for(var i=[],n=0,o=t.length;n<o;n++)i.push(e.call(r,t[n],n,t));return i}function D(t,e,r,i){if(t&&e){for(var n=0,o=t.length;n<o;n++)r=e.call(i,r,t[n],n,t);return r}}function R(t,e,r){if(!t)return[];if(!e)return Q(t);if(t.filter&&t.filter===g)return t.filter(e,r);for(var i=[],n=0,o=t.length;n<o;n++)e.call(r,t[n],n,t)&&i.push(t[n]);return i}function F(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e}var z=o&&B(o.bind)?o.call.bind(o.bind):function(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return function(){return t.apply(e,r.concat(n.call(arguments)))}};function G(t){return Array.isArray?Array.isArray(t):"[object Array]"===y.call(t)}function B(t){return"function"==typeof t}function N(t){return"string"==typeof t}function H(t){return"number"==typeof t}function W(t){var e=typeof t;return"function"==e||!!t&&"object"==e}function X(t){return!!s[y.call(t)]}function q(t){return!!d[y.call(t)]}function j(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}function Y(t){return null!=t.colorStops}function V(t){return null!=t.image}function U(t){return t!=t}function Z(t,e){return null!=t?t:e}function K(t,e,r){return null!=t?t:null!=e?e:r}function Q(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return n.apply(t,e)}function $(t){if("number"==typeof t)return[t,t,t,t];var e=t.length;return 2===e?[t[0],t[1],t[0],t[1]]:3===e?[t[0],t[1],t[2],t[1]]:t}function J(t,e){if(!t)throw new Error(e)}function tt(t){return null==t?null:"function"==typeof t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var et="__ec_primitive__";function rt(t){return t[et]}var it=(nt.prototype.delete=function(t){var e=this.has(t);return e&&delete this.data[t],e},nt.prototype.has=function(t){return this.data.hasOwnProperty(t)},nt.prototype.get=function(t){return this.data[t]},nt.prototype.set=function(t,e){return this.data[t]=e,this},nt.prototype.keys=function(){return F(this.data)},nt.prototype.forEach=function(t){var e=this.data;for(var r in e)e.hasOwnProperty(r)&&t(e[r],r)},nt);function nt(){this.data={}}var ot="function"==typeof Map;var at=(st.prototype.hasKey=function(t){return this.data.has(t)},st.prototype.get=function(t){return this.data.get(t)},st.prototype.set=function(t,e){return this.data.set(t,e),e},st.prototype.each=function(r,i){this.data.forEach(function(t,e){r.call(i,t,e)})},st.prototype.keys=function(){var t=this.data.keys();return ot?Array.from(t):t},st.prototype.removeKey=function(t){this.data.delete(t)},st);function st(t){var r=G(t);this.data=new(ot?Map:it);var i=this;function e(t,e){r?i.set(t,e):i.set(e,t)}t instanceof st?t.each(e):t&&O(t,e)}function ht(t,e){var r,i=Object.create?Object.create(t):((r=function(){}).prototype=t,new r);return e&&I(i,e),i}function lt(t){var e=t.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function ut(t,e){return t.hasOwnProperty(e)}function ct(){}var pt=180/Math.PI,ft=Object.freeze({__proto__:null,guid:w,logError:b,clone:C,merge:S,mergeAll:function(t,e){for(var r=t[0],i=1,n=t.length;i<n;i++)r=S(r,t[i],e);return r},extend:I,defaults:k,createCanvas:T,indexOf:P,inherits:function(t,e){var r=t.prototype;function i(){}for(var n in i.prototype=e.prototype,t.prototype=new i,r)r.hasOwnProperty(n)&&(t.prototype[n]=r[n]);(t.prototype.constructor=t).superClass=e},mixin:M,isArrayLike:A,each:O,map:L,reduce:D,filter:R,find:function(t,e,r){if(t&&e)for(var i=0,n=t.length;i<n;i++)if(e.call(r,t[i],i,t))return t[i]},keys:F,bind:z,curry:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return function(){return t.apply(this,e.concat(n.call(arguments)))}},isArray:G,isFunction:B,isString:N,isStringSafe:function(t){return"[object String]"===y.call(t)},isNumber:H,isObject:W,isBuiltInObject:X,isTypedArray:q,isDom:j,isGradientObject:Y,isImagePatternObject:V,isRegExp:function(t){return"[object RegExp]"===y.call(t)},eqNaN:U,retrieve:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0,i=t.length;r<i;r++)if(null!=t[r])return t[r]},retrieve2:Z,retrieve3:K,slice:Q,normalizeCssArray:$,assert:J,trim:tt,setAsPrimitive:function(t){t[et]=!0},isPrimitive:rt,HashMap:at,createHashMap:function(t){return new at(t)},concatArray:function(t,e){for(var r=new t.constructor(t.length+e.length),i=0;i<t.length;i++)r[i]=t[i];for(var n=t.length,i=0;i<e.length;i++)r[i+n]=e[i];return r},createObject:ht,disableUserSelect:lt,hasOwn:ut,noop:ct,RADIAN_TO_DEGREE:pt}),dt=function(t,e){return(dt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function yt(t,e){function r(){this.constructor=t}dt(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function vt(t,e){return null==t&&(t=0),null==e&&(e=0),[t,e]}function gt(t){return[t[0],t[1]]}function _t(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function mt(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function xt(t){return Math.sqrt(wt(t))}function wt(t){return t[0]*t[0]+t[1]*t[1]}function bt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function St(t,e){var r=xt(e);return 0===r?(t[0]=0,t[1]=0):(t[0]=e[0]/r,t[1]=e[1]/r),t}function kt(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var Tt=kt;function Ct(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var Pt=Ct;function Mt(t,e,r,i){return t[0]=e[0]+i*(r[0]-e[0]),t[1]=e[1]+i*(r[1]-e[1]),t}function At(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n+r[4],t[1]=r[1]*i+r[3]*n+r[5],t}function Lt(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function Dt(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}var zt=Object.freeze({__proto__:null,create:vt,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},clone:gt,set:function(t,e,r){return t[0]=e,t[1]=r,t},add:_t,scaleAndAdd:function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t},sub:mt,len:xt,length:xt,lenSquare:wt,lengthSquare:wt,mul:function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},div:function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},scale:bt,normalize:St,distance:kt,dist:Tt,distanceSquare:Ct,distSquare:Pt,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},lerp:Mt,applyTransform:At,min:Lt,max:Dt}),It=function(t,e){this.target=t,this.topTarget=e&&e.topTarget},Ot=(Rt.prototype._dragStart=function(t){for(var e=t.target;e&&!e.draggable;)e=e.parent||e.__hostTarget;e&&((this._draggingTarget=e).dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.handler.dispatchToElement(new It(e,t),"dragstart",t.event))},Rt.prototype._drag=function(t){var e,r,i,n,o,a,s=this._draggingTarget;s&&(e=t.offsetX,r=t.offsetY,i=e-this._x,n=r-this._y,this._x=e,this._y=r,s.drift(i,n,t),this.handler.dispatchToElement(new It(s,t),"drag",t.event),o=this.handler.findHover(e,r,s).target,a=this._dropTarget,s!==(this._dropTarget=o)&&(a&&o!==a&&this.handler.dispatchToElement(new It(a,t),"dragleave",t.event),o&&o!==a&&this.handler.dispatchToElement(new It(o,t),"dragenter",t.event)))},Rt.prototype._dragEnd=function(t){var e=this._draggingTarget;e&&(e.dragging=!1),this.handler.dispatchToElement(new It(e,t),"dragend",t.event),this._dropTarget&&this.handler.dispatchToElement(new It(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null},Rt);function Rt(t){(this.handler=t).on("mousedown",this._dragStart,this),t.on("mousemove",this._drag,this),t.on("mouseup",this._dragEnd,this)}var Ft=(Bt.prototype.on=function(t,e,r,i){this._$handlers||(this._$handlers={});var n=this._$handlers;if("function"==typeof e&&(i=r,r=e,e=null),!r||!t)return this;var o=this._$eventProcessor;null!=e&&o&&o.normalizeQuery&&(e=o.normalizeQuery(e)),n[t]||(n[t]=[]);for(var a=0;a<n[t].length;a++)if(n[t][a].h===r)return this;var s={h:r,query:e,ctx:i||this,callAtLast:r.zrEventfulCallAtLast},h=n[t].length-1,l=n[t][h];return l&&l.callAtLast?n[t].splice(h,0,s):n[t].push(s),this},Bt.prototype.isSilent=function(t){var e=this._$handlers;return!e||!e[t]||!e[t].length},Bt.prototype.off=function(t,e){var r=this._$handlers;if(!r)return this;if(!t)return this._$handlers={},this;if(e){if(r[t]){for(var i=[],n=0,o=r[t].length;n<o;n++)r[t][n].h!==e&&i.push(r[t][n]);r[t]=i}r[t]&&0===r[t].length&&delete r[t]}else delete r[t];return this},Bt.prototype.trigger=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(!this._$handlers)return this;var i=this._$handlers[t],n=this._$eventProcessor;if(i)for(var o=e.length,a=i.length,s=0;s<a;s++){var h=i[s];if(!n||!n.filter||null==h.query||n.filter(t,h.query))switch(o){case 0:h.h.call(h.ctx);break;case 1:h.h.call(h.ctx,e[0]);break;case 2:h.h.call(h.ctx,e[0],e[1]);break;default:h.h.apply(h.ctx,e)}}return n&&n.afterTrigger&&n.afterTrigger(t),this},Bt.prototype.triggerWithContext=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(!this._$handlers)return this;var i=this._$handlers[t],n=this._$eventProcessor;if(i)for(var o=e.length,a=e[o-1],s=i.length,h=0;h<s;h++){var l=i[h];if(!n||!n.filter||null==l.query||n.filter(t,l.query))switch(o){case 0:l.h.call(a);break;case 1:l.h.call(a,e[0]);break;case 2:l.h.call(a,e[0],e[1]);break;default:l.h.apply(a,e.slice(1,o-1))}}return n&&n.afterTrigger&&n.afterTrigger(t),this},Bt);function Bt(t){t&&(this._$eventProcessor=t)}var Nt=Math.log(2);function Ht(t,e,r,i,n,o){var a=i+"-"+n,s=t.length;if(o.hasOwnProperty(a))return o[a];if(1===e){var h=Math.round(Math.log((1<<s)-1&~n)/Nt);return t[r][h]}for(var l=i|1<<r,u=r+1;i&1<<u;)u++;for(var c=0,p=0,f=0;p<s;p++){var d=1<<p;d&n||(c+=(f%2?-1:1)*t[r][p]*Ht(t,e-1,u,l,n|d,o),f++)}return o[a]=c}function Et(t,e){var r=[[t[0],t[1],1,0,0,0,-e[0]*t[0],-e[0]*t[1]],[0,0,0,t[0],t[1],1,-e[1]*t[0],-e[1]*t[1]],[t[2],t[3],1,0,0,0,-e[2]*t[2],-e[2]*t[3]],[0,0,0,t[2],t[3],1,-e[3]*t[2],-e[3]*t[3]],[t[4],t[5],1,0,0,0,-e[4]*t[4],-e[4]*t[5]],[0,0,0,t[4],t[5],1,-e[5]*t[4],-e[5]*t[5]],[t[6],t[7],1,0,0,0,-e[6]*t[6],-e[6]*t[7]],[0,0,0,t[6],t[7],1,-e[7]*t[6],-e[7]*t[7]]],i={},n=Ht(r,8,0,0,0,i);if(0!==n){for(var o=[],a=0;a<8;a++)for(var s=0;s<8;s++)null==o[s]&&(o[s]=0),o[s]+=((a+s)%2?-1:1)*Ht(r,7,0===a?1:0,1<<a,1<<s,i)/n*e[a];return function(t,e,r){var i=e*o[6]+r*o[7]+1;t[0]=(e*o[0]+r*o[1]+o[2])/i,t[1]=(e*o[3]+r*o[4]+o[5])/i}}}var Wt="___zrEVENTSAVED";function Xt(t,e,r,i,n){if(e.getBoundingClientRect&&c.domSupported&&!qt(e)){var o=e[Wt]||(e[Wt]={}),a=function(t,e,r){for(var i=r?"invTrans":"trans",n=e[i],o=e.srcCoords,a=[],s=[],h=!0,l=0;l<4;l++){var u=t[l].getBoundingClientRect(),c=2*l,p=u.left,f=u.top;a.push(p,f),h=h&&o&&p===o[c]&&f===o[1+c],s.push(t[l].offsetLeft,t[l].offsetTop)}return h&&n?n:(e.srcCoords=a,e[i]=r?Et(s,a):Et(a,s))}(function(t,e){var r=e.markers;if(r)return r;r=e.markers=[];for(var i=["left","right"],n=["top","bottom"],o=0;o<4;o++){var a=document.createElement("div"),s=a.style,h=o%2,l=(o>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[h]+":0",n[l]+":0",i[1-h]+":auto",n[1-l]+":auto",""].join("!important;"),t.appendChild(a),r.push(a)}return r}(e,o),o,n);if(a)return a(t,r,i),1}}function qt(t){return"CANVAS"===t.nodeName.toUpperCase()}var jt=/([&<>"'])/g,Yt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};var Vt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ut=[],Gt=c.browser.firefox&&+c.browser.version.split(".")[0]<39;function Zt(t,e,r,i){return r=r||{},i?Kt(t,e,r):Gt&&null!=e.layerX&&e.layerX!==e.offsetX?(r.zrX=e.layerX,r.zrY=e.layerY):null!=e.offsetX?(r.zrX=e.offsetX,r.zrY=e.offsetY):Kt(t,e,r),r}function Kt(t,e,r){if(c.domSupported&&t.getBoundingClientRect){var i=e.clientX,n=e.clientY;if(qt(t)){var o=t.getBoundingClientRect();return r.zrX=i-o.left,void(r.zrY=n-o.top)}if(Xt(Ut,t,i,n))return r.zrX=Ut[0],void(r.zrY=Ut[1])}r.zrX=r.zrY=0}function Qt(t){return t||window.event}function $t(t,e,r){if(null!=(e=Qt(e)).zrX)return e;var i,n,o=e.type;o&&0<=o.indexOf("touch")?(i="touchend"!==o?e.targetTouches[0]:e.changedTouches[0])&&Zt(t,i,e,r):(Zt(t,e,e,r),n=function(t){var e=t.wheelDelta;if(e)return e;var r=t.deltaX,i=t.deltaY;return null!=r&&null!=i?3*(0!==i?Math.abs(i):Math.abs(r))*(0<i||!(i<0)&&0<r?-1:1):e}(e),e.zrDelta=n?n/120:-(e.detail||0)/3);var a=e.button;return null==e.which&&void 0!==a&&Vt.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}var Jt=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0},te=(ee.prototype.recognize=function(t,e,r){return this._doTrack(t,e,r),this._recognize(t)},ee.prototype.clear=function(){return this._track.length=0,this},ee.prototype._doTrack=function(t,e,r){var i=t.touches;if(i){for(var n={points:[],touches:[],target:e,event:t},o=0,a=i.length;o<a;o++){var s=i[o],h=Zt(r,s,{});n.points.push([h.zrX,h.zrY]),n.touches.push(s)}this._track.push(n)}},ee.prototype._recognize=function(t){for(var e in ie)if(ie.hasOwnProperty(e)){var r=ie[e](this._track,t);if(r)return r}},ee);function ee(){this._track=[]}function re(t){var e=t[1][0]-t[0][0],r=t[1][1]-t[0][1];return Math.sqrt(e*e+r*r)}var ie={pinch:function(t,e){var r=t.length;if(r){var i,n=(t[r-1]||{}).points,o=(t[r-2]||{}).points||n;if(o&&1<o.length&&n&&1<n.length){var a=re(n)/re(o);isFinite(a)||(a=1),e.pinchScale=a;var s=[((i=n)[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2];return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}};function ne(){return[1,0,0,1,0,0]}function oe(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function ae(t,e){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}function se(t,e,r){var i=e[0]*r[0]+e[2]*r[1],n=e[1]*r[0]+e[3]*r[1],o=e[0]*r[2]+e[2]*r[3],a=e[1]*r[2]+e[3]*r[3],s=e[0]*r[4]+e[2]*r[5]+e[4],h=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=i,t[1]=n,t[2]=o,t[3]=a,t[4]=s,t[5]=h,t}function he(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t}function le(t,e,r,i){void 0===i&&(i=[0,0]);var n=e[0],o=e[2],a=e[4],s=e[1],h=e[3],l=e[5],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*u,t[1]=-n*u+s*c,t[2]=o*c+h*u,t[3]=-o*u+c*h,t[4]=c*(a-i[0])+u*(l-i[1])+i[0],t[5]=c*(l-i[1])-u*(a-i[0])+i[1],t}function ue(t,e,r){var i=r[0],n=r[1];return t[0]=e[0]*i,t[1]=e[1]*n,t[2]=e[2]*i,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*n,t}function ce(t,e){var r=e[0],i=e[2],n=e[4],o=e[1],a=e[3],s=e[5],h=r*a-o*i;return h?(h=1/h,t[0]=a*h,t[1]=-o*h,t[2]=-i*h,t[3]=r*h,t[4]=(i*s-a*n)*h,t[5]=(o*n-r*s)*h,t):null}var pe=Object.freeze({__proto__:null,create:ne,identity:oe,copy:ae,mul:se,translate:he,rotate:le,scale:ue,invert:ce,clone:function(t){var e=ne();return ae(e,t),e}}),fe=(de.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},de.prototype.clone=function(){return new de(this.x,this.y)},de.prototype.set=function(t,e){return this.x=t,this.y=e,this},de.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},de.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},de.prototype.scale=function(t){this.x*=t,this.y*=t},de.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},de.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},de.prototype.dot=function(t){return this.x*t.x+this.y*t.y},de.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},de.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},de.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},de.prototype.distance=function(t){var e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)},de.prototype.distanceSquare=function(t){var e=this.x-t.x,r=this.y-t.y;return e*e+r*r},de.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},de.prototype.transform=function(t){if(t){var e=this.x,r=this.y;return this.x=t[0]*e+t[2]*r+t[4],this.y=t[1]*e+t[3]*r+t[5],this}},de.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},de.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},de.set=function(t,e,r){t.x=e,t.y=r},de.copy=function(t,e){t.x=e.x,t.y=e.y},de.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},de.lenSquare=function(t){return t.x*t.x+t.y*t.y},de.dot=function(t,e){return t.x*e.x+t.y*e.y},de.add=function(t,e,r){t.x=e.x+r.x,t.y=e.y+r.y},de.sub=function(t,e,r){t.x=e.x-r.x,t.y=e.y-r.y},de.scale=function(t,e,r){t.x=e.x*r,t.y=e.y*r},de.scaleAndAdd=function(t,e,r,i){t.x=e.x+r.x*i,t.y=e.y+r.y*i},de.lerp=function(t,e,r,i){var n=1-i;t.x=n*e.x+i*r.x,t.y=n*e.y+i*r.y},de);function de(t,e){this.x=t||0,this.y=e||0}var ye=Math.min,ve=Math.max,ge=new fe,_e=new fe,me=new fe,xe=new fe,we=new fe,be=new fe,Se=(ke.prototype.union=function(t){var e=ye(t.x,this.x),r=ye(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=ve(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=ve(t.y+t.height,this.y+this.height)-r:this.height=t.height,this.x=e,this.y=r},ke.prototype.applyTransform=function(t){ke.applyTransform(this,this,t)},ke.prototype.calculateTransform=function(t){var e=t.width/this.width,r=t.height/this.height,i=ne();return he(i,i,[-this.x,-this.y]),ue(i,i,[e,r]),he(i,i,[t.x,t.y]),i},ke.prototype.intersect=function(t,e){if(!t)return!1;t instanceof ke||(t=ke.create(t));var r,i,n,o,a,s,h,l,u=this,c=u.x,p=u.x+u.width,f=u.y,d=u.y+u.height,y=t.x,v=t.x+t.width,g=t.y,_=t.y+t.height,m=!(p<y||v<c||d<g||_<f);return e&&(r=1/0,i=0,n=Math.abs(p-y),o=Math.abs(v-c),a=Math.abs(d-g),s=Math.abs(_-f),h=Math.min(n,o),l=Math.min(a,s),p<y||v<c?i<h&&(i=h,n<o?fe.set(be,-n,0):fe.set(be,o,0)):h<r&&(r=h,n<o?fe.set(we,n,0):fe.set(we,-o,0)),d<g||_<f?i<l&&(i=l,a<s?fe.set(be,0,-a):fe.set(be,0,s)):h<r&&(r=h,a<s?fe.set(we,0,a):fe.set(we,0,-s))),e&&fe.copy(e,m?we:be),m},ke.prototype.contain=function(t,e){var r=this;return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height},ke.prototype.clone=function(){return new ke(this.x,this.y,this.width,this.height)},ke.prototype.copy=function(t){ke.copy(this,t)},ke.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},ke.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},ke.prototype.isZero=function(){return 0===this.width||0===this.height},ke.create=function(t){return new ke(t.x,t.y,t.width,t.height)},ke.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},ke.applyTransform=function(t,e,r){if(r){if(r[1]<1e-5&&-1e-5<r[1]&&r[2]<1e-5&&-1e-5<r[2]){var i=r[0],n=r[3],o=r[4],a=r[5];return t.x=e.x*i+o,t.y=e.y*n+a,t.width=e.width*i,t.height=e.height*n,t.width<0&&(t.x+=t.width,t.width=-t.width),void(t.height<0&&(t.y+=t.height,t.height=-t.height))}ge.x=me.x=e.x,ge.y=xe.y=e.y,_e.x=xe.x=e.x+e.width,_e.y=me.y=e.y+e.height,ge.transform(r),xe.transform(r),_e.transform(r),me.transform(r),t.x=ye(ge.x,_e.x,me.x,xe.x),t.y=ye(ge.y,_e.y,me.y,xe.y);var s=ve(ge.x,_e.x,me.x,xe.x),h=ve(ge.y,_e.y,me.y,xe.y);t.width=s-t.x,t.height=h-t.y}else t!==e&&ke.copy(t,e)},ke);function ke(t,e,r,i){r<0&&(t+=r,r=-r),i<0&&(e+=i,i=-i),this.x=t,this.y=e,this.width=r,this.height=i}var Te="silent";function Ce(){Jt(this.event)}var Pe,Me=(yt(Ae,Pe=Ft),Ae.prototype.dispose=function(){},Ae.prototype.setCursor=function(){},Ae);function Ae(){var t=null!==Pe&&Pe.apply(this,arguments)||this;return t.handler=null,t}var Le,De=function(t,e){this.x=t,this.y=e},ze=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Ie=new Se(0,0,0,0),Oe=(yt(Re,Le=Ft),Re.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(O(ze,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},Re.prototype.mousemove=function(t){var e=t.zrX,r=t.zrY,i=Be(this,e,r),n=this._hovered,o=n.target;o&&!o.__zr&&(o=(n=this.findHover(n.x,n.y)).target);var a=this._hovered=i?new De(e,r):this.findHover(e,r),s=a.target,h=this.proxy;h.setCursor&&h.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(n,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==o&&this.dispatchToElement(a,"mouseover",t)},Re.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},Re.prototype.resize=function(){this._hovered=new De(0,0)},Re.prototype.dispatch=function(t,e){var r=this[t];r&&r.call(this,e)},Re.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},Re.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},Re.prototype.dispatchToElement=function(t,e,r){var i=(t=t||{}).target;if(!i||!i.silent){for(var n,o,a="on"+e,s={type:e,event:o=r,target:(n=t).target,topTarget:n.topTarget,cancelBubble:!1,offsetX:o.zrX,offsetY:o.zrY,gestureEvent:o.gestureEvent,pinchX:o.pinchX,pinchY:o.pinchY,pinchScale:o.pinchScale,wheelDelta:o.zrDelta,zrByTouch:o.zrByTouch,which:o.which,stop:Ce};i&&(i[a]&&(s.cancelBubble=!!i[a].call(i,s)),i.trigger(e,s),i=i.__hostTarget?i.__hostTarget:i.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(e,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(t){"function"==typeof t[a]&&t[a].call(t,s),t.trigger&&t.trigger(e,s)}))}},Re.prototype.findHover=function(t,e,r){var i=this.storage.getDisplayList(),n=new De(t,e);if(Fe(i,n,t,e,r),this._pointerSize&&!n.target){for(var o=[],a=this._pointerSize,s=a/2,h=new Se(t-s,e-s,a,a),l=i.length-1;0<=l;l--){var u=i[l];u===r||u.ignore||u.ignoreCoarsePointer||u.parent&&u.parent.ignoreCoarsePointer||(Ie.copy(u.getBoundingRect()),u.transform&&Ie.applyTransform(u.transform),Ie.intersect(h)&&o.push(u))}if(o.length)for(var c=Math.PI/12,p=2*Math.PI,f=0;f<s;f+=4)for(var d=0;d<p;d+=c)if(Fe(o,n,t+f*Math.cos(d),e+f*Math.sin(d),r),n.target)return n}return n},Re.prototype.processGesture=function(t,e){this._gestureMgr||(this._gestureMgr=new te);var r=this._gestureMgr;"start"===e&&r.clear();var i,n,o=r.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);"end"===e&&r.clear(),o&&(i=o.type,t.gestureEvent=i,(n=new De).target=o.target,this.dispatchToElement(n,i,o.event))},Re);function Re(t,e,r,i,n){var o=Le.call(this)||this;return o._hovered=new De(0,0),o.storage=t,o.painter=e,o.painterRoot=i,o._pointerSize=n,r=r||new Me,o.proxy=null,o.setHandlerProxy(r),o._draggingMgr=new Ot(o),o}function Fe(t,e,r,i,n){for(var o=t.length-1;0<=o;o--){var a=t[o],s=void 0;if(a!==n&&!a.ignore&&(s=function(t,e,r){if(t[t.rectHover?"rectContain":"contain"](e,r)){for(var i=t,n=void 0,o=!1;i;){if(i.ignoreClip&&(o=!0),!o){var a=i.getClipPath();if(a&&!a.contain(e,r))return!1}i.silent&&(n=!0);var s=i.__hostTarget,i=s||i.parent}return!n||Te}return!1}(a,r,i))&&(e.topTarget||(e.topTarget=a),s!==Te)){e.target=a;break}}}function Be(t,e,r){var i=t.painter;return e<0||e>i.getWidth()||r<0||r>i.getHeight()}O(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(a){Oe.prototype[a]=function(t){var e,r,i=t.zrX,n=t.zrY,o=Be(this,i,n);if("mouseup"===a&&o||(r=(e=this.findHover(i,n)).target),"mousedown"===a)this._downEl=r,this._downPoint=[t.zrX,t.zrY],this._upEl=r;else if("mouseup"===a)this._upEl=r;else if("click"===a){if(this._downEl!==this._upEl||!this._downPoint||4<Tt(this._downPoint,[t.zrX,t.zrY]))return;this._downPoint=null}this.dispatchToElement(e,a,t)}});var Ne=32,He=7;function Ee(t,e,r,i){var n=e+1;if(n===r)return 1;if(i(t[n++],t[e])<0){for(;n<r&&i(t[n],t[n-1])<0;)n++;!function(t,e,r){r--;for(;e<r;){var i=t[e];t[e++]=t[r],t[r--]=i}}(t,e,n)}else for(;n<r&&0<=i(t[n],t[n-1]);)n++;return n-e}function We(t,e,r,i,n){for(i===e&&i++;i<r;i++){for(var o,a=t[i],s=e,h=i;s<h;)n(a,t[o=s+h>>>1])<0?h=o:s=1+o;var l=i-s;switch(l){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;0<l;)t[s+l]=t[s+l-1],l--}t[s]=a}}function Xe(t,e,r,i,n,o){var a=0,s=0,h=1;if(0<o(t,e[r+n])){for(s=i-n;h<s&&0<o(t,e[r+n+h]);)(h=1+((a=h)<<1))<=0&&(h=s);s<h&&(h=s),a+=n,h+=n}else{for(s=n+1;h<s&&o(t,e[r+n-h])<=0;)(h=1+((a=h)<<1))<=0&&(h=s);s<h&&(h=s);var l=a,a=n-h,h=n-l}for(a++;a<h;){var u=a+(h-a>>>1);0<o(t,e[r+u])?a=u+1:h=u}return h}function qe(t,e,r,i,n,o){var a=0,s=0,h=1;if(o(t,e[r+n])<0){for(s=n+1;h<s&&o(t,e[r+n-h])<0;)(h=1+((a=h)<<1))<=0&&(h=s);s<h&&(h=s);var l=a,a=n-h,h=n-l}else{for(s=i-n;h<s&&0<=o(t,e[r+n+h]);)(h=1+((a=h)<<1))<=0&&(h=s);s<h&&(h=s),a+=n,h+=n}for(a++;a<h;){var u=a+(h-a>>>1);o(t,e[r+u])<0?h=u:a=u+1}return h}function je(d,y){var a,s,v=He,h=0,g=[];function e(t){var e=a[t],r=s[t],i=a[t+1],n=s[t+1];s[t]=r+n,t===h-3&&(a[t+1]=a[t+2],s[t+1]=s[t+2]),h--;var o=qe(d[i],d,e,r,0,y);e+=o,0!=(r-=o)&&0!==(n=Xe(d[e+r-1],d,i,n,n-1,y))&&(r<=n?function(t,e,r,i){var n=0;for(n=0;n<e;n++)g[n]=d[t+n];var o=0,a=r,s=t;if(d[s++]=d[a++],0==--i){for(n=0;n<e;n++)d[s+n]=g[o+n];return}if(1===e){for(n=0;n<i;n++)d[s+n]=d[a+n];return d[s+i]=g[o]}var h,l,u,c=v;for(;;){l=h=0,u=!1;do{if(y(d[a],g[o])<0){if(d[s++]=d[a++],l++,(h=0)==--i){u=!0;break}}else if(d[s++]=g[o++],h++,l=0,1==--e){u=!0;break}}while((h|l)<c);if(u)break;do{if(0!==(h=qe(d[a],g,o,e,0,y))){for(n=0;n<h;n++)d[s+n]=g[o+n];if(s+=h,o+=h,(e-=h)<=1){u=!0;break}}if(d[s++]=d[a++],0==--i){u=!0;break}if(0!==(l=Xe(g[o],d,a,i,0,y))){for(n=0;n<l;n++)d[s+n]=d[a+n];if(s+=l,a+=l,0===(i-=l)){u=!0;break}}if(d[s++]=g[o++],1==--e){u=!0;break}c--}while(He<=h||He<=l);if(u)break;c<0&&(c=0),c+=2}if((v=c)<1&&(v=1),1===e){for(n=0;n<i;n++)d[s+n]=d[a+n];d[s+i]=g[o]}else{if(0===e)throw new Error;for(n=0;n<e;n++)d[s+n]=g[o+n]}}:function(t,e,r,i){var n=0;for(n=0;n<i;n++)g[n]=d[r+n];var o=t+e-1,a=i-1,s=r+i-1,h=0,l=0;if(d[s--]=d[o--],0==--e){for(h=s-(i-1),n=0;n<i;n++)d[h+n]=g[n];return}if(1===i){for(l=(s-=e)+1,h=(o-=e)+1,n=e-1;0<=n;n--)d[l+n]=d[h+n];return d[s]=g[a]}var u=v;for(;;){var c=0,p=0,f=!1;do{if(y(g[a],d[o])<0){if(d[s--]=d[o--],c++,(p=0)==--e){f=!0;break}}else if(d[s--]=g[a--],p++,c=0,1==--i){f=!0;break}}while((c|p)<u);if(f)break;do{if(0!==(c=e-qe(g[a],d,t,e,e-1,y))){for(e-=c,l=(s-=c)+1,h=(o-=c)+1,n=c-1;0<=n;n--)d[l+n]=d[h+n];if(0===e){f=!0;break}}if(d[s--]=g[a--],1==--i){f=!0;break}if(0!==(p=i-Xe(d[o],g,0,i,i-1,y))){for(i-=p,l=(s-=p)+1,h=(a-=p)+1,n=0;n<p;n++)d[l+n]=g[h+n];if(i<=1){f=!0;break}}if(d[s--]=d[o--],0==--e){f=!0;break}u--}while(He<=c||He<=p);if(f)break;u<0&&(u=0),u+=2}(v=u)<1&&(v=1);if(1===i){for(l=(s-=e)+1,h=(o-=e)+1,n=e-1;0<=n;n--)d[l+n]=d[h+n];d[s]=g[a]}else{if(0===i)throw new Error;for(h=s-(i-1),n=0;n<i;n++)d[h+n]=g[n]}})(e,r,i,n)}return a=[],s=[],{mergeRuns:function(){for(;1<h;){var t=h-2;if(1<=t&&s[t-1]<=s[t]+s[t+1]||2<=t&&s[t-2]<=s[t]+s[t-1])s[t-1]<s[t+1]&&t--;else if(s[t]>s[t+1])break;e(t)}},forceMergeRuns:function(){for(;1<h;){var t=h-2;0<t&&s[t-1]<s[t+1]&&t--,e(t)}},pushRun:function(t,e){a[h]=t,s[h]=e,h+=1}}}function Ye(t,e,r,i){r=r||0;var n=(i=i||t.length)-r;if(!(n<2)){var o=0;if(n<Ne)We(t,r,i,r+(o=Ee(t,r,i,e)),e);else{var a,s=je(t,e),h=function(t){for(var e=0;Ne<=t;)e|=1&t,t>>=1;return t+e}(n);do{(o=Ee(t,r,i,e))<h&&(h<(a=n)&&(a=h),We(t,r,r+a,r+o,e),o=a),s.pushRun(r,o),s.mergeRuns(),n-=o,r+=o}while(0!==n);s.forceMergeRuns()}}}var Ve=1,Ue=4,Ge=!1;function Ze(){Ge||(Ge=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Ke(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var Qe=($e.prototype.traverse=function(t,e){for(var r=0;r<this._roots.length;r++)this._roots[r].traverse(t,e)},$e.prototype.getDisplayList=function(t,e){e=e||!1;var r=this._displayList;return!t&&r.length||this.updateDisplayList(e),r},$e.prototype.updateDisplayList=function(t){this._displayListLen=0;for(var e=this._roots,r=this._displayList,i=0,n=e.length;i<n;i++)this._updateAndAddDisplayable(e[i],null,t);r.length=this._displayListLen,Ye(r,Ke)},$e.prototype._updateAndAddDisplayable=function(t,e,r){if(!t.ignore||r){t.beforeUpdate(),t.update(),t.afterUpdate();var i=t.getClipPath();if(t.ignoreClip)e=null;else if(i){e=e?e.slice():[];for(var n=i,o=t;n;)n.parent=o,n.updateTransform(),e.push(n),n=(o=n).getClipPath()}if(t.childrenRef){for(var a=t.childrenRef(),s=0;s<a.length;s++){var h=a[s];t.__dirty&&(h.__dirty|=Ve),this._updateAndAddDisplayable(h,e,r)}t.__dirty=0}else{var l=t;e&&e.length?l.__clipPaths=e:l.__clipPaths&&0<l.__clipPaths.length&&(l.__clipPaths=[]),isNaN(l.z)&&(Ze(),l.z=0),isNaN(l.z2)&&(Ze(),l.z2=0),isNaN(l.zlevel)&&(Ze(),l.zlevel=0),this._displayList[this._displayListLen++]=l}var u=t.getDecalElement&&t.getDecalElement();u&&this._updateAndAddDisplayable(u,e,r);var c=t.getTextGuideLine();c&&this._updateAndAddDisplayable(c,e,r);var p=t.getTextContent();p&&this._updateAndAddDisplayable(p,e,r)}},$e.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},$e.prototype.delRoot=function(t){if(t instanceof Array)for(var e=0,r=t.length;e<r;e++)this.delRoot(t[e]);else{var i=P(this._roots,t);0<=i&&this._roots.splice(i,1)}},$e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},$e.prototype.getRoots=function(){return this._roots},$e.prototype.dispose=function(){this._displayList=null,this._roots=null},$e);function $e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Ke}var Je=c.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)},tr={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,r=.1;return 0===t?0:1===t?1:(e=!r||r<1?(r=1,.1):.4*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*--t)*Math.sin((t-e)*(2*Math.PI)/.4)))},elasticOut:function(t){var e,r=.1;return 0===t?0:1===t?1:(e=!r||r<1?(r=1,.1):.4*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,r=.1;return 0===t?0:1===t?1:(e=!r||r<1?(r=1,.1):.4*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?r*Math.pow(2,10*--t)*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:r*Math.pow(2,-10*--t)*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){return t*t*(2.70158*t-1.70158)},backOut:function(t){return--t*t*(2.70158*t+1.70158)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((1+e)*t-e)*.5:.5*((t-=2)*t*((1+e)*t+e)+2)},bounceIn:function(t){return 1-tr.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*tr.bounceIn(2*t):.5*tr.bounceOut(2*t-1)+.5}},er=Math.pow,rr=Math.sqrt,ir=1e-8,nr=1e-4,or=rr(3),ar=1/3,sr=vt(),hr=vt(),lr=vt();function ur(t){return-ir<t&&t<ir}function cr(t){return ir<t||t<-ir}function pr(t,e,r,i,n){var o=1-n;return o*o*(o*t+3*n*e)+n*n*(n*i+3*o*r)}function fr(t,e,r,i,n){var o=1-n;return 3*(((e-t)*o+2*(r-e)*n)*o+(i-r)*n*n)}function dr(t,e,r,i,n,o){var a,s,h,l,u,c,p,f,d,y,v,g,_=i+3*(e-r)-t,m=3*(r-2*e+t),x=3*(e-t),w=t-n,b=m*m-3*_*x,S=m*x-9*_*w,k=x*x-3*m*w,T=0;return ur(b)&&ur(S)?ur(m)?o[0]=0:0<=(y=-x/m)&&y<=1&&(o[T++]=y):ur(a=S*S-4*b*k)?(v=-(s=S/b)/2,0<=(y=-m/_+s)&&y<=1&&(o[T++]=y),0<=v&&v<=1&&(o[T++]=v)):0<a?(u=b*m+1.5*_*(-S-(h=rr(a))),0<=(y=(-m-((l=(l=b*m+1.5*_*(-S+h))<0?-er(-l,ar):er(l,ar))+(u=u<0?-er(-u,ar):er(u,ar))))/(3*_))&&y<=1&&(o[T++]=y)):(c=(2*b*m-3*_*S)/(2*rr(b*b*b)),p=Math.acos(c)/3,y=(-m-2*(f=rr(b))*(d=Math.cos(p)))/(3*_),v=(-m+f*(d+or*Math.sin(p)))/(3*_),g=(-m+f*(d-or*Math.sin(p)))/(3*_),0<=y&&y<=1&&(o[T++]=y),0<=v&&v<=1&&(o[T++]=v),0<=g&&g<=1&&(o[T++]=g)),T}function yr(t,e,r,i,n){var o,a,s,h,l=6*r-12*e+6*t,u=9*e+3*i-3*t-9*r,c=3*e-3*t,p=0;return ur(u)?cr(l)&&0<=(s=-c/l)&&s<=1&&(n[p++]=s):ur(o=l*l-4*u*c)?n[0]=-l/(2*u):0<o&&(h=(-l-(a=rr(o)))/(2*u),0<=(s=(-l+a)/(2*u))&&s<=1&&(n[p++]=s),0<=h&&h<=1&&(n[p++]=h)),p}function vr(t,e,r,i,n,o){var a=(e-t)*n+t,s=(r-e)*n+e,h=(i-r)*n+r,l=(s-a)*n+a,u=(h-s)*n+s,c=(u-l)*n+l;o[0]=t,o[1]=a,o[2]=l,o[3]=c,o[4]=c,o[5]=u,o[6]=h,o[7]=i}function gr(t,e,r,i){var n=1-i;return n*(n*t+2*i*e)+i*i*r}function _r(t,e,r,i){return 2*((1-i)*(e-t)+i*(r-e))}function mr(t,e,r){var i=t+r-2*e;return 0==i?.5:(t-e)/i}function xr(t,e,r,i,n){var o=(e-t)*i+t,a=(r-e)*i+e,s=(a-o)*i+o;n[0]=t,n[1]=o,n[2]=s,n[3]=s,n[4]=a,n[5]=r}var wr=/cubic-bezier\(([0-9,\.e ]+)\)/;function br(t){var e=t&&wr.exec(t);if(e){var r=e[1].split(","),i=+tt(r[0]),n=+tt(r[1]),o=+tt(r[2]),a=+tt(r[3]);if(isNaN(i+n+o+a))return;var s=[];return function(t){return t<=0?0:1<=t?1:dr(0,i,o,1,t,s)&&pr(0,n,a,1,s[0])}}}var Sr=(kr.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var r=this._life,i=t-this._startTime-this._pausedTime,n=i/r;n<0&&(n=0),n=Math.min(n,1);var o=this.easingFunc,a=o?o(n):n;if(this.onframe(a),1===n){if(!this.loop)return!0;var s=i%r;this._startTime=t-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},kr.prototype.pause=function(){this._paused=!0},kr.prototype.resume=function(){this._paused=!1},kr.prototype.setEasing=function(t){this.easing=t,this.easingFunc=B(t)?t:tr[t]||br(t)},kr);function kr(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||ct,this.ondestroy=t.ondestroy||ct,this.onrestart=t.onrestart||ct,t.easing&&this.setEasing(t.easing)}var Tr=function(t){this.value=t},Cr=(Pr.prototype.insert=function(t){var e=new Tr(t);return this.insertEntry(e),e},Pr.prototype.insertEntry=function(t){this.head?((this.tail.next=t).prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},Pr.prototype.remove=function(t){var e=t.prev,r=t.next;e?e.next=r:this.head=r,r?r.prev=e:this.tail=e,t.next=t.prev=null,this._len--},Pr.prototype.len=function(){return this._len},Pr.prototype.clear=function(){this.head=this.tail=null,this._len=0},Pr);function Pr(){this._len=0}var Mr=(Ar.prototype.put=function(t,e){var r,i,n,o=this._list,a=this._map,s=null;return null==a[t]&&(r=o.len(),i=this._lastRemovedEntry,r>=this._maxSize&&0<r&&(n=o.head,o.remove(n),delete a[n.key],s=n.value,this._lastRemovedEntry=n),i?i.value=e:i=new Tr(e),i.key=t,o.insertEntry(i),a[t]=i),s},Ar.prototype.get=function(t){var e=this._map[t],r=this._list;if(null!=e)return e!==r.tail&&(r.remove(e),r.insertEntry(e)),e.value},Ar.prototype.clear=function(){this._list.clear(),this._map={}},Ar.prototype.len=function(){return this._list.len()},Ar);function Ar(t){this._list=new Cr,this._maxSize=10,this._map={},this._maxSize=t}var Lr={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 Dr(t){return(t=Math.round(t))<0?0:255<t?255:t}function zr(t){return t<0?0:1<t?1:t}function Ir(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Dr(parseFloat(e)/100*255):Dr(parseInt(e,10))}function Or(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?zr(parseFloat(e)/100):zr(parseFloat(e))}function Rr(t,e,r){return r<0?r+=1:1<r&&--r,6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function Fr(t,e,r){return t+(e-t)*r}function Br(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}function Nr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Hr=new Mr(20),Er=null;function Wr(t,e){Er&&Nr(Er,e),Er=Hr.put(t,Er||e.slice())}function Xr(t,e){if(t){e=e||[];var r=Hr.get(t);if(r)return Nr(e,r);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in Lr)return Nr(e,Lr[i]),Wr(t,e),e;var n,o=i.length;if("#"===i.charAt(0))return 4===o||5===o?0<=(n=parseInt(i.slice(1,4),16))&&n<=4095?(Br(e,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,5===o?parseInt(i.slice(4),16)/15:1),Wr(t,e),e):void Br(e,0,0,0,1):7===o||9===o?0<=(n=parseInt(i.slice(1,7),16))&&n<=16777215?(Br(e,(16711680&n)>>16,(65280&n)>>8,255&n,9===o?parseInt(i.slice(7),16)/255:1),Wr(t,e),e):void Br(e,0,0,0,1):void 0;var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===o){var h=i.substr(0,a),l=i.substr(a+1,s-(a+1)).split(","),u=1;switch(h){case"rgba":if(4!==l.length)return 3===l.length?Br(e,+l[0],+l[1],+l[2],1):Br(e,0,0,0,1);u=Or(l.pop());case"rgb":return 3<=l.length?(Br(e,Ir(l[0]),Ir(l[1]),Ir(l[2]),3===l.length?u:Or(l[3])),Wr(t,e),e):void Br(e,0,0,0,1);case"hsla":return 4!==l.length?void Br(e,0,0,0,1):(l[3]=Or(l[3]),qr(l,e),Wr(t,e),e);case"hsl":return 3!==l.length?void Br(e,0,0,0,1):(qr(l,e),Wr(t,e),e);default:return}}Br(e,0,0,0,1)}}function qr(t,e){var r=(parseFloat(t[0])%360+360)%360/360,i=Or(t[1]),n=Or(t[2]),o=n<=.5?n*(i+1):n+i-n*i,a=2*n-o;return Br(e=e||[],Dr(255*Rr(a,o,r+1/3)),Dr(255*Rr(a,o,r)),Dr(255*Rr(a,o,r-1/3)),1),4===t.length&&(e[3]=t[3]),e}function jr(t,e){var r=Xr(t);if(r){for(var i=0;i<3;i++)r[i]=e<0?r[i]*(1-e)|0:(255-r[i])*e+r[i]|0,255<r[i]?r[i]=255:r[i]<0&&(r[i]=0);return Zr(r,4===r.length?"rgba":"rgb")}}function Yr(t,e,r){if(e&&e.length&&0<=t&&t<=1){r=r||[];var i=t*(e.length-1),n=Math.floor(i),o=Math.ceil(i),a=e[n],s=e[o],h=i-n;return r[0]=Dr(Fr(a[0],s[0],h)),r[1]=Dr(Fr(a[1],s[1],h)),r[2]=Dr(Fr(a[2],s[2],h)),r[3]=zr(Fr(a[3],s[3],h)),r}}var Vr=Yr;function Ur(t,e,r){if(e&&e.length&&0<=t&&t<=1){var i=t*(e.length-1),n=Math.floor(i),o=Math.ceil(i),a=Xr(e[n]),s=Xr(e[o]),h=i-n,l=Zr([Dr(Fr(a[0],s[0],h)),Dr(Fr(a[1],s[1],h)),Dr(Fr(a[2],s[2],h)),zr(Fr(a[3],s[3],h))],"rgba");return r?{color:l,leftIndex:n,rightIndex:o,value:i}:l}}var Gr=Ur;function Zr(t,e){if(t&&t.length){var r=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(r+=","+t[3]),e+"("+r+")"}}function Kr(t,e){var r=Xr(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}var Qr=new Mr(100);function $r(t){if(N(t)){var e=Qr.get(t);return e||(e=jr(t,-.1),Qr.put(t,e)),e}if(Y(t)){var r=I({},t);return r.colorStops=L(t.colorStops,function(t){return{offset:t.offset,color:jr(t.color,-.1)}}),r}return t}var Jr=Object.freeze({__proto__:null,parse:Xr,lift:jr,toHex:function(t){var e=Xr(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)},fastLerp:Yr,fastMapToColor:Vr,lerp:Ur,mapToColor:Gr,modifyHSL:function(t,e,r,i){var n,o=Xr(t);if(t)return o=function(t){if(t){var e,r,i,n,o,a=t[0]/255,s=t[1]/255,h=t[2]/255,l=Math.min(a,s,h),u=Math.max(a,s,h),c=u-l,p=(u+l)/2;0==c?r=e=0:(r=p<.5?c/(u+l):c/(2-u-l),i=((u-a)/6+c/2)/c,n=((u-s)/6+c/2)/c,o=((u-h)/6+c/2)/c,a===u?e=o-n:s===u?e=1/3+i-o:h===u&&(e=2/3+n-i),e<0&&(e+=1),1<e&&--e);var f=[360*e,r,p];return null!=t[3]&&f.push(t[3]),f}}(o),null!=e&&(o[0]=(n=e,(n=Math.round(n))<0?0:360<n?360:n)),null!=r&&(o[1]=Or(r)),null!=i&&(o[2]=Or(i)),Zr(qr(o),"rgba")},modifyAlpha:function(t,e){var r=Xr(t);if(r&&null!=e)return r[3]=zr(e),Zr(r,"rgba")},stringify:Zr,lum:Kr,random:function(){return Zr([Math.round(255*Math.random()),Math.round(255*Math.random()),Math.round(255*Math.random())],"rgb")},liftColor:$r}),ti=Math.round;function ei(t){var e,r;return t&&"transparent"!==t?"string"==typeof t&&-1<t.indexOf("rgba")&&((r=Xr(t))&&(t="rgb("+r[0]+","+r[1]+","+r[2]+")",e=r[3])):t="none",{color:t,opacity:null==e?1:e}}var ri=1e-4;function ii(t){return t<ri&&-ri<t}function ni(t){return ti(1e3*t)/1e3}function oi(t){return ti(1e4*t)/1e4}var ai={left:"start",right:"end",center:"middle",middle:"middle"};function si(t){return t&&!!t.image}function hi(t){return si(t)||(e=t)&&e.svgElement;var e}function li(t){return"linear"===t.type}function ui(t){return"radial"===t.type}function ci(t){return t&&("linear"===t.type||"radial"===t.type)}function pi(t){return"url(#"+t+")"}function fi(t){var e=t.getGlobalScale(),r=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(r)/Math.log(10)),1)}function di(t){var e=t.x||0,r=t.y||0,i=(t.rotation||0)*pt,n=Z(t.scaleX,1),o=Z(t.scaleY,1),a=t.skewX||0,s=t.skewY||0,h=[];return(e||r)&&h.push("translate("+e+"px,"+r+"px)"),i&&h.push("rotate("+i+")"),1===n&&1===o||h.push("scale("+n+","+o+")"),(a||s)&&h.push("skew("+ti(a*pt)+"deg, "+ti(s*pt)+"deg)"),h.join(" ")}var yi=c.hasGlobalWindow&&B(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:"undefined"!=typeof Buffer?function(t){return Buffer.from(t).toString("base64")}:function(t){return null},vi=Array.prototype.slice;function gi(t,e,r){return(e-t)*r+t}function _i(t,e,r,i){for(var n=e.length,o=0;o<n;o++)t[o]=gi(e[o],r[o],i);return t}function mi(t,e,r,i){for(var n=e.length,o=0;o<n;o++)t[o]=e[o]+r[o]*i;return t}function xi(t,e,r,i){for(var n=e.length,o=n&&e[0].length,a=0;a<n;a++){t[a]||(t[a]=[]);for(var s=0;s<o;s++)t[a][s]=e[a][s]+r[a][s]*i}return t}function wi(t){if(A(t)){var e=t.length;if(A(t[0])){for(var r=[],i=0;i<e;i++)r.push(vi.call(t[i]));return r}return vi.call(t)}return t}function bi(t){return t[0]=Math.floor(t[0])||0,t[1]=Math.floor(t[1])||0,t[2]=Math.floor(t[2])||0,t[3]=null==t[3]?1:t[3],"rgba("+t.join