From 6da8856df05f58627d8e432b8f8e3b958f3fc451 Mon Sep 17 00:00:00 2001 From: icret Date: Sat, 13 Nov 2021 18:49:44 +0800 Subject: [PATCH] chart --- admin/chart.php | 249 ++ .../static/echarts/echarts.simple.min.js | 45 + public/static/public/static/hm.js | 7 + public/static/public/static/jscolor.js | 3548 +++++++++++++++++ public/static/public/static/lazyload.js | 20 + public/static/public/static/md5.min.js | 2 + public/static/public/static/md5.min.js.map | 1 + public/static/public/static/nprogress.min.css | 1 + public/static/public/static/nprogress.min.js | 1 + public/static/public/static/paste.js | 54 + public/static/public/static/qrcode.min.js | 1 + .../public/static/viewjs/viewer.min.css | 9 + .../static/public/static/viewjs/viewer.min.js | 10 + .../static/public/static/zui/css/zui.min.css | 6 + .../public/static/zui/fonts/zenicon.eot | Bin 0 -> 84200 bytes .../public/static/zui/fonts/zenicon.svg | 374 ++ .../public/static/zui/fonts/zenicon.ttf | Bin 0 -> 84036 bytes .../public/static/zui/fonts/zenicon.woff | Bin 0 -> 84112 bytes public/static/public/static/zui/js/zui.min.js | 16 + .../public/static/zui/lib/chart/excanvas.js | 14 + .../static/zui/lib/chart/zui.chart.min.js | 14 + .../static/zui/lib/clipboard/clipboard.min.js | 7 + .../lib/datetimepicker/datetimepicker.min.css | 5 + .../lib/datetimepicker/datetimepicker.min.js | 7 + .../static/zui/lib/jquery/jquery-3.4.1.min.js | 2 + .../public/static/zui/lib/uploader/Moxie.swf | Bin 0 -> 27640 bytes .../public/static/zui/lib/uploader/Moxie.xap | Bin 0 -> 65757 bytes 27 files changed, 4393 insertions(+) create mode 100755 admin/chart.php create mode 100755 public/static/public/static/echarts/echarts.simple.min.js create mode 100755 public/static/public/static/hm.js create mode 100755 public/static/public/static/jscolor.js create mode 100755 public/static/public/static/lazyload.js create mode 100755 public/static/public/static/md5.min.js create mode 100755 public/static/public/static/md5.min.js.map create mode 100755 public/static/public/static/nprogress.min.css create mode 100755 public/static/public/static/nprogress.min.js create mode 100755 public/static/public/static/paste.js create mode 100755 public/static/public/static/qrcode.min.js create mode 100755 public/static/public/static/viewjs/viewer.min.css create mode 100755 public/static/public/static/viewjs/viewer.min.js create mode 100755 public/static/public/static/zui/css/zui.min.css create mode 100755 public/static/public/static/zui/fonts/zenicon.eot create mode 100755 public/static/public/static/zui/fonts/zenicon.svg create mode 100755 public/static/public/static/zui/fonts/zenicon.ttf create mode 100755 public/static/public/static/zui/fonts/zenicon.woff create mode 100755 public/static/public/static/zui/js/zui.min.js create mode 100755 public/static/public/static/zui/lib/chart/excanvas.js create mode 100755 public/static/public/static/zui/lib/chart/zui.chart.min.js create mode 100755 public/static/public/static/zui/lib/clipboard/clipboard.min.js create mode 100755 public/static/public/static/zui/lib/datetimepicker/datetimepicker.min.css create mode 100755 public/static/public/static/zui/lib/datetimepicker/datetimepicker.min.js create mode 100755 public/static/public/static/zui/lib/jquery/jquery-3.4.1.min.js create mode 100755 public/static/public/static/zui/lib/uploader/Moxie.swf create mode 100755 public/static/public/static/zui/lib/uploader/Moxie.xap diff --git a/admin/chart.php b/admin/chart.php new file mode 100755 index 0000000..d070473 --- /dev/null +++ b/admin/chart.php @@ -0,0 +1,249 @@ + + +
+
+
统计时间:
+
+
+
+
今日上传 +
+ +
+
昨日上传 +
+ +
+
+ 累计上传 +
+ +
+ +
+ 缓存文件 +
+ +
+
+ 可疑图片 +
+ +
+
+ 文件夹 +
+ +
+
+ 占用存储 +
+ +
+
+ 剩余空间 +
+ +
+
+
+
+
+
+
+
+
+

最近30日上传趋势与空间占用

+
+
+ + + + + +18);o&&(n.weChat=!0);e.canvasSupported=!!document.createElement("canvas").getContext,e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),e.domSupported="undefined"!=typeof document;var s=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}(navigator.userAgent,o);var s={"[object Function]":!0,"[object RegExp]":!0,"[object Date]":!0,"[object Error]":!0,"[object CanvasGradient]":!0,"[object CanvasPattern]":!0,"[object Image]":!0,"[object Canvas]":!0},l={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0},u=Object.prototype.toString,h=Array.prototype,c=h.forEach,p=h.filter,f=h.slice,d=h.map,g=function(){}.constructor,y=g?g.prototype:null,v={};function m(t,e){v[t]=e}var _=2311;function x(){return _++}function b(){for(var t=[],e=0;e>1)%2;o.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",r[l]+":0",i[1-s]+":auto",r[1-l]+":auto",""].join("!important;"),t.appendChild(o),n.push(o)}return n}(e,a),a,r);if(s)return s(t,n,i),!0}return!1}function Ft(t){return"CANVAS"===t.nodeName.toUpperCase()}var Vt="undefined"!=typeof window&&!!window.addEventListener,Ht=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Gt=[];function Wt(t,e,n,i){return n=n||{},i||!o.canvasSupported?Ut(t,e,n):o.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):Ut(t,e,n),n}function Ut(t,e,n){if(o.domSupported&&t.getBoundingClientRect){var i=e.clientX,r=e.clientY;if(Ft(t)){var a=t.getBoundingClientRect();return n.zrX=i-a.left,void(n.zrY=r-a.top)}if(Bt(Gt,t,i,r))return n.zrX=Gt[0],void(n.zrY=Gt[1])}n.zrX=n.zrY=0}function Xt(t){return t||window.event}function Yt(t,e,n){if(null!=(e=Xt(e)).zrX)return e;var i=e.type;if(i&&i.indexOf("touch")>=0){var r="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];r&&Wt(t,r,e,n)}else{Wt(t,e,e,n);var a=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,i=t.deltaY;if(null==n||null==i)return e;return 3*(0!==i?Math.abs(i):Math.abs(n))*(i>0?-1:i<0?1:n>0?-1:1)}(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var o=e.button;return null==e.which&&void 0!==o&&Ht.test(e.type)&&(e.which=1&o?1:2&o?3:4&o?2:0),e}var qt=Vt?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0},jt=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,n){var i=t.touches;if(i){for(var r={points:[],touches:[],target:e,event:t},a=0,o=i.length;a1&&r&&r.length>1){var o=Zt(r)/Zt(a);!isFinite(o)&&(o=1),e.pinchScale=o;var s=[((i=r)[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}}}}},$t="silent";function Jt(){qt(this.event)}var Qt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return n(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Rt),te=function(t,e){this.x=t,this.y=e},ee=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],ne=function(t){function e(e,n,i,r){var a=t.call(this)||this;return a._hovered=new te(0,0),a.storage=e,a.painter=n,a.painterRoot=r,i=i||new Qt,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new Ot(a),a}return n(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(L(ee,(function(e){t.on&&t.on(e,this[e],this)}),this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,n=t.zrY,i=re(this,e,n),r=this._hovered,a=r.target;a&&!a.__zr&&(a=(r=this.findHover(r.x,r.y)).target);var o=this._hovered=i?new te(e,n):this.findHover(e,n),s=o.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),a&&s!==a&&this.dispatchToElement(r,"mouseout",t),this.dispatchToElement(o,"mousemove",t),s&&s!==a&&this.dispatchToElement(o,"mouseover",t)},e.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})},e.prototype.resize=function(){this._hovered=new te(0,0)},e.prototype.dispatch=function(t,e){var n=this[t];n&&n.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,n){var i=(t=t||{}).target;if(!i||!i.silent){for(var r="on"+e,a=function(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Jt}}(e,t,n);i&&(i[r]&&(a.cancelBubble=!!i[r].call(i,a)),i.trigger(e,a),i=i.__hostTarget?i.__hostTarget:i.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(e,a),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(t){"function"==typeof t[r]&&t[r].call(t,a),t.trigger&&t.trigger(e,a)})))}},e.prototype.findHover=function(t,e,n){for(var i=this.storage.getDisplayList(),r=new te(t,e),a=i.length-1;a>=0;a--){var o=void 0;if(i[a]!==n&&!i[a].ignore&&(o=ie(i[a],t,e))&&(!r.topTarget&&(r.topTarget=i[a]),o!==$t)){r.target=i[a];break}}return r},e.prototype.processGesture=function(t,e){this._gestureMgr||(this._gestureMgr=new jt);var n=this._gestureMgr;"start"===e&&n.clear();var i=n.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if("end"===e&&n.clear(),i){var r=i.type;t.gestureEvent=r;var a=new te;a.target=i.target,this.dispatchToElement(a,r,i.event)}},e}(Rt);function ie(t,e,n){if(t[t.rectHover?"rectContain":"contain"](e,n)){for(var i=t,r=void 0,a=!1;i;){if(i.ignoreClip&&(a=!0),!a){var o=i.getClipPath();if(o&&!o.contain(e,n))return!1;i.silent&&(r=!0)}var s=i.__hostTarget;i=s||i.parent}return!r||$t}return!1}function re(t,e,n){var i=t.painter;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}L(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(t){ne.prototype[t]=function(e){var n,i,r=e.zrX,a=e.zrY,o=re(this,r,a);if("mouseup"===t&&o||(i=(n=this.findHover(r,a)).target),"mousedown"===t)this._downEl=i,this._downPoint=[e.zrX,e.zrY],this._upEl=i;else if("mouseup"===t)this._upEl=i;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||Mt(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,t,e)}}));function ae(t,e,n,i){var r=e+1;if(r===n)return 1;if(i(t[r++],t[e])<0){for(;r=0;)r++;return r-e}function oe(t,e,n,i,r){for(i===e&&i++;i>>1])<0?l=a:s=a+1;var u=i-s;switch(u){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(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=o}}function se(t,e,n,i,r,a){var o=0,s=0,l=1;if(a(t,e[n+r])>0){for(s=i-r;l0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}else{for(s=r+1;ls&&(l=s);var u=o;o=r-l,l=r-u}for(o++;o>>1);a(t,e[n+h])>0?o=h+1:l=h}return l}function le(t,e,n,i,r,a){var o=0,s=0,l=1;if(a(t,e[n+r])<0){for(s=r+1;ls&&(l=s);var u=o;o=r-l,l=r-u}else{for(s=i-r;l=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}for(o++;o>>1);a(t,e[n+h])<0?l=h:o=h+1}return l}function ue(t,e){var n,i,r=7,a=0;t.length;var o=[];function s(s){var l=n[s],u=i[s],h=n[s+1],c=i[s+1];i[s]=u+c,s===a-3&&(n[s+1]=n[s+2],i[s+1]=i[s+2]),a--;var p=le(t[h],t,l,u,0,e);l+=p,0!==(u-=p)&&0!==(c=se(t[l+u-1],t,h,c,c-1,e))&&(u<=c?function(n,i,a,s){var l=0;for(l=0;l=7||f>=7);if(d)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===i){for(l=0;l=0;l--)t[f+l]=t[p+l];return void(t[c]=o[h])}var d=r;for(;;){var g=0,y=0,v=!1;do{if(e(o[h],t[u])<0){if(t[c--]=t[u--],g++,y=0,0==--i){v=!0;break}}else if(t[c--]=o[h--],y++,g=0,1==--s){v=!0;break}}while((g|y)=0;l--)t[f+l]=t[p+l];if(0===i){v=!0;break}}if(t[c--]=o[h--],1==--s){v=!0;break}if(0!==(y=s-se(t[u],o,0,s,s-1,e))){for(s-=y,f=(c-=y)+1,p=(h-=y)+1,l=0;l=7||y>=7);if(v)break;d<0&&(d=0),d+=2}(r=d)<1&&(r=1);if(1===s){for(f=(c-=i)+1,p=(u-=i)+1,l=i-1;l>=0;l--)t[f+l]=t[p+l];t[c]=o[h]}else{if(0===s)throw new Error;for(p=c-(s-1),l=0;l1;){var t=a-2;if(t>=1&&i[t-1]<=i[t]+i[t+1]||t>=2&&i[t-2]<=i[t]+i[t-1])i[t-1]i[t+1])break;s(t)}},forceMergeRuns:function(){for(;a>1;){var t=a-2;t>0&&i[t-1]=32;)e|=1&t,t>>=1;return t+e}(r);do{if((a=ae(t,n,i,e))s&&(l=s),oe(t,n,n+l,n+a,e),a=l}o.pushRun(n,a),o.mergeRuns(),r-=a,n+=a}while(0!==r);o.forceMergeRuns()}}}var ce=!1;function pe(){ce||(ce=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function fe(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var de=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=fe}return t.prototype.traverse=function(t,e){for(var n=0;n0&&(u.__clipPaths=[]),isNaN(u.z)&&(pe(),u.z=0),isNaN(u.z2)&&(pe(),u.z2=0),isNaN(u.zlevel)&&(pe(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var h=t.getDecalElement&&t.getDecalElement();h&&this._updateAndAddDisplayable(h,e,n);var c=t.getTextGuideLine();c&&this._updateAndAddDisplayable(c,e,n);var p=t.getTextContent();p&&this._updateAndAddDisplayable(p,e,n)}},t.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},t.prototype.delRoot=function(t){if(t instanceof Array)for(var e=0,n=t.length;e=0&&this._roots.splice(i,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}(),ge="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)},ye={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,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=i*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-ye.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*ye.bounceIn(2*t):.5*ye.bounceOut(2*t-1)+.5}},ve=function(){function t(t){this._initialized=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=null!=t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart}return t.prototype.step=function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),!this._paused){var n=(t-this._startTime-this._pausedTime)/this._life;n<0&&(n=0),n=Math.min(n,1);var i=this.easing,r="string"==typeof i?ye[i]:i,a="function"==typeof r?r(n):n;if(this.onframe&&this.onframe(a),1===n){if(!this.loop)return!0;this._restart(t),this.onrestart&&this.onrestart()}return!1}this._pausedTime+=e},t.prototype._restart=function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t}(),me=function(t){this.value=t},_e=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new me(t);return this.insertEntry(e),e},t.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},t.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),xe=function(){function t(t){this._list=new _e,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var n=this._list,i=this._map,r=null;if(null==i[t]){var a=n.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=n.head;n.remove(s),delete i[s.key],r=s.value,this._lastRemovedEntry=s}o?o.value=e:o=new me(e),o.key=t,n.insertEntry(o),i[t]=o}return r},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}(),be={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 we(t){return(t=Math.round(t))<0?0:t>255?255:t}function Se(t){return t<0?0:t>1?1:t}function Me(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?we(parseFloat(e)/100*255):we(parseInt(e,10))}function Te(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Se(parseFloat(e)/100):Se(parseFloat(e))}function Ce(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function ke(t,e,n){return t+(e-t)*n}function De(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function Ie(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Ae=new xe(20),Le=null;function Pe(t,e){Le&&Ie(Le,e),Le=Ae.put(t,Le||e.slice())}function Oe(t,e){if(t){e=e||[];var n=Ae.get(t);if(n)return Ie(e,n);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in be)return Ie(e,be[i]),Pe(t,e),e;var r,a=i.length;if("#"===i.charAt(0))return 4===a||5===a?(r=parseInt(i.slice(1,4),16))>=0&&r<=4095?(De(e,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,5===a?parseInt(i.slice(4),16)/15:1),Pe(t,e),e):void De(e,0,0,0,1):7===a||9===a?(r=parseInt(i.slice(1,7),16))>=0&&r<=16777215?(De(e,(16711680&r)>>16,(65280&r)>>8,255&r,9===a?parseInt(i.slice(7),16)/255:1),Pe(t,e),e):void De(e,0,0,0,1):void 0;var o=i.indexOf("("),s=i.indexOf(")");if(-1!==o&&s+1===a){var l=i.substr(0,o),u=i.substr(o+1,s-(o+1)).split(","),h=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?De(e,+u[0],+u[1],+u[2],1):De(e,0,0,0,1);h=Te(u.pop());case"rgb":return 3!==u.length?void De(e,0,0,0,1):(De(e,Me(u[0]),Me(u[1]),Me(u[2]),h),Pe(t,e),e);case"hsla":return 4!==u.length?void De(e,0,0,0,1):(u[3]=Te(u[3]),Re(u,e),Pe(t,e),e);case"hsl":return 3!==u.length?void De(e,0,0,0,1):(Re(u,e),Pe(t,e),e);default:return}}De(e,0,0,0,1)}}function Re(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Te(t[1]),r=Te(t[2]),a=r<=.5?r*(i+1):r+i-r*i,o=2*r-a;return De(e=e||[],we(255*Ce(o,a,n+1/3)),we(255*Ce(o,a,n)),we(255*Ce(o,a,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Ne(t,e){var n=Oe(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return Ve(n,4===n.length?"rgba":"rgb")}}function Ee(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var i=t*(e.length-1),r=Math.floor(i),a=Math.ceil(i),o=e[r],s=e[a],l=i-r;return n[0]=we(ke(o[0],s[0],l)),n[1]=we(ke(o[1],s[1],l)),n[2]=we(ke(o[2],s[2],l)),n[3]=Se(ke(o[3],s[3],l)),n}}var ze=Ee;function Be(t,e,n){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),r=Math.floor(i),a=Math.ceil(i),o=Oe(e[r]),s=Oe(e[a]),l=i-r,u=Ve([we(ke(o[0],s[0],l)),we(ke(o[1],s[1],l)),we(ke(o[2],s[2],l)),Se(ke(o[3],s[3],l))],"rgba");return n?{color:u,leftIndex:r,rightIndex:a,value:i}:u}}var Fe=Be;function Ve(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function He(t,e){var n=Oe(t);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*e:0}var Ge=Object.freeze({__proto__:null,parse:Oe,lift:Ne,toHex:function(t){var e=Oe(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)},fastLerp:Ee,fastMapToColor:ze,lerp:Be,mapToColor:Fe,modifyHSL:function(t,e,n,i){var r=Oe(t);if(t)return r=function(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,a=t[2]/255,o=Math.min(i,r,a),s=Math.max(i,r,a),l=s-o,u=(s+o)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+o):l/(2-s-o);var h=((s-i)/6+l/2)/l,c=((s-r)/6+l/2)/l,p=((s-a)/6+l/2)/l;i===s?e=p-c:r===s?e=1/3+h-p:a===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,n,u];return null!=t[3]&&f.push(t[3]),f}}(r),null!=e&&(r[0]=function(t){return(t=Math.round(t))<0?0:t>360?360:t}(e)),null!=n&&(r[1]=Te(n)),null!=i&&(r[2]=Te(i)),Ve(Re(r),"rgba")},modifyAlpha:function(t,e){var n=Oe(t);if(n&&null!=e)return n[3]=Se(e),Ve(n,"rgba")},stringify:Ve,lum:He,random:function(){return"rgb("+Math.round(255*Math.random())+","+Math.round(255*Math.random())+","+Math.round(255*Math.random())+")"}}),We=Array.prototype.slice;function Ue(t,e,n){return(e-t)*n+t}function Xe(t,e,n,i){for(var r=e.length,a=0;ao)i.length=o;else for(var s=a;s=2&&this.interpolable},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e){t>=this.maxTime?this.maxTime=t:this._needsSort=!0;var n=this.keyframes,i=n.length;if(this.interpolable)if(A(e)){var r=function(t){return A(t&&t[0])?2:1}(e);if(i>0&&this.arrDim!==r)return void(this.interpolable=!1);if(1===r&&"number"!=typeof e[0]||2===r&&"number"!=typeof e[0][0])return void(this.interpolable=!1);if(i>0){var a=n[i-1];this._isAllValueEqual&&(1===r&&Ze(e,a.value)||(this._isAllValueEqual=!1))}this.arrDim=r}else{if(this.arrDim>0)return void(this.interpolable=!1);if("string"==typeof e){var o=Oe(e);o?(e=o,this.isValueColor=!0):this.interpolable=!1}else if("number"!=typeof e||isNaN(e))return void(this.interpolable=!1);if(this._isAllValueEqual&&i>0){a=n[i-1];(this.isValueColor&&!Ze(a.value,e)||a.value!==e)&&(this._isAllValueEqual=!1)}}var s={time:t,value:e,percent:0};return this.keyframes.push(s),s},t.prototype.prepare=function(t){var e=this.keyframes;this._needsSort&&e.sort((function(t,e){return t.time-e.time}));for(var n=this.arrDim,i=e.length,r=e[i-1],a=0;a0&&a!==i-1&&je(e[a].value,r.value,n);if(t&&this.needsAnimate()&&t.needsAnimate()&&n===t.arrDim&&this.isValueColor===t.isValueColor&&!t._finished){this._additiveTrack=t;var o=e[0].value;for(a=0;a=0&&!(a[n].percent<=e);n--);n=Math.min(n,o-2)}else{for(n=this._lastFrame;ne);n++);n=Math.min(n-1,o-2)}var h=a[n+1],c=a[n];if(c&&h){this._lastFrame=n,this._lastFramePercent=e;var p=h.percent-c.percent;if(0!==p){var f=(e-c.percent)/p,d=i?this._additiveValue:u?nn:t[s];if((l>0||u)&&!d&&(d=this._additiveValue=[]),this.useSpline){var g=a[n][r],y=a[0===n?n:n-1][r],v=a[n>o-2?o-1:n+1][r],m=a[n>o-3?o-1:n+2][r];if(l>0)1===l?$e(d,y,g,v,m,f,f*f,f*f*f):function(t,e,n,i,r,a,o,s){for(var l=e.length,u=e[0].length,h=0;h0)1===l?Xe(d,c[r],h[r],f):function(t,e,n,i){for(var r=e.length,a=r&&e[0].length,o=0;o.5?e:t}(c[r],h[r],f),i?this._additiveValue=_:t[s]=_}i&&this._addToTarget(t)}}}},t.prototype._addToTarget=function(t){var e=this.arrDim,n=this.propName,i=this._additiveValue;0===e?this.isValueColor?(Oe(t[n],nn),Ye(nn,nn,i,1),t[n]=Qe(nn)):t[n]=t[n]+i:1===e?Ye(t[n],t[n],i,1):2===e&&qe(t[n],t[n],i,1)},t}(),an=function(){function t(t,e,n){this._tracks={},this._trackKeys=[],this._delay=0,this._maxTime=0,this._paused=!1,this._started=0,this._clip=null,this._target=t,this._loop=e,e&&n?b("Can' use additive animation on looped animation."):this._additiveAnimators=n}return t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(t){this._target=t},t.prototype.when=function(t,e){return this.whenWithKeys(t,e,N(e))},t.prototype.whenWithKeys=function(t,e,n){for(var i=this._tracks,r=0;r0)){this._started=1;for(var n=this,i=[],r=0;r1){var o=a.pop();r.addKeyframe(o.time,t[i]),r.prepare(r.getAdditiveTrack())}}}},t}(),on=function(t){function e(e){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,e=e||{},n.stage=e.stage||{},n.onframe=e.onframe||function(){},n}return n(e,t),e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._clipsHead?(this._clipsTail.next=t,t.prev=this._clipsTail,t.next=null,this._clipsTail=t):this._clipsHead=this._clipsTail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},e.prototype.removeClip=function(t){if(t.animation){var e=t.prev,n=t.next;e?e.next=n:this._clipsHead=n,n?n.prev=e:this._clipsTail=e,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},e.prototype.update=function(t){for(var e=(new Date).getTime()-this._pausedTime,n=e-this._time,i=this._clipsHead;i;){var r=i.next;i.step(e,n)?(i.ondestroy&&i.ondestroy(),this.removeClip(i),i=r):i=r}this._time=e,t||(this.onframe(n),this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0,ge((function e(){t._running&&(ge(e),!t._paused&&t.update())}))},e.prototype.start=function(){this._running||(this._time=(new Date).getTime(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=(new Date).getTime(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=(new Date).getTime()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._clipsHead;t;){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._clipsHead=this._clipsTail=null},e.prototype.isFinished=function(){return null==this._clipsHead},e.prototype.animate=function(t,e){e=e||{},this.start();var n=new an(t,e.loop);return this.addAnimator(n),n},e}(Rt),sn=o.domSupported,ln=(en={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:tn=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:P(tn,(function(t){var e=t.replace("mouse","pointer");return en.hasOwnProperty(e)?e:t}))}),un=["mousemove","mouseup"],hn=["pointermove","pointerup"],cn=!1;function pn(t){var e=t.pointerType;return"pen"===e||"touch"===e}function fn(t){t&&(t.zrByTouch=!0)}function dn(t,e){for(var n=e,i=!1;n&&9!==n.nodeType&&!(i=n.domBelongToZr||n!==e&&n===t.painterRoot);)n=n.parentNode;return i}var gn=function(t,e){this.stopPropagation=ct,this.stopImmediatePropagation=ct,this.preventDefault=ct,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY},yn={mousedown:function(t){t=Yt(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=Yt(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=Yt(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){dn(this,(t=Yt(this.dom,t)).toElement||t.relatedTarget)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){cn=!0,t=Yt(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){cn||(t=Yt(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){fn(t=Yt(this.dom,t)),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),yn.mousemove.call(this,t),yn.mousedown.call(this,t)},touchmove:function(t){fn(t=Yt(this.dom,t)),this.handler.processGesture(t,"change"),yn.mousemove.call(this,t)},touchend:function(t){fn(t=Yt(this.dom,t)),this.handler.processGesture(t,"end"),yn.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<300&&yn.click.call(this,t)},pointerdown:function(t){yn.mousedown.call(this,t)},pointermove:function(t){pn(t)||yn.mousemove.call(this,t)},pointerup:function(t){yn.mouseup.call(this,t)},pointerout:function(t){pn(t)||yn.mouseout.call(this,t)}};L(["click","dblclick","contextmenu"],(function(t){yn[t]=function(e){e=Yt(this.dom,e),this.trigger(t,e)}}));var vn={pointermove:function(t){pn(t)||vn.mousemove.call(this,t)},pointerup:function(t){vn.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function mn(t,e){var n=e.domHandlers;o.pointerEventsSupported?L(ln.pointer,(function(i){xn(e,i,(function(e){n[i].call(t,e)}))})):(o.touchEventsSupported&&L(ln.touch,(function(i){xn(e,i,(function(r){n[i].call(t,r),function(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout((function(){t.touching=!1,t.touchTimer=null}),700)}(e)}))})),L(ln.mouse,(function(i){xn(e,i,(function(r){r=Xt(r),e.touching||n[i].call(t,r)}))})))}function _n(t,e){function n(n){xn(e,n,(function(i){i=Xt(i),dn(t,i.target)||(i=function(t,e){return Yt(t.dom,new gn(t,e),!0)}(t,i),e.domHandlers[n].call(t,i))}),{capture:!0})}o.pointerEventsSupported?L(hn,n):o.touchEventsSupported||L(un,n)}function xn(t,e,n,i){t.mounted[e]=n,t.listenerOpts[e]=i,function(t,e,n,i){Vt?t.addEventListener(e,n,i):t.attachEvent("on"+e,n)}(t.domTarget,e,n,i)}function bn(t){var e,n,i,r,a=t.mounted;for(var o in a)a.hasOwnProperty(o)&&(e=t.domTarget,n=o,i=a[o],r=t.listenerOpts[o],Vt?e.removeEventListener(n,i,r):e.detachEvent("on"+n,i));t.mounted={}}var wn=function(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e},Sn=function(t){function e(e,n){var i=t.call(this)||this;return i.__pointerCapturing=!1,i.dom=e,i.painterRoot=n,i._localHandlerScope=new wn(e,yn),sn&&(i._globalHandlerScope=new wn(document,vn)),mn(i,i._localHandlerScope),i}return n(e,t),e.prototype.dispose=function(){bn(this._localHandlerScope),sn&&bn(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,sn&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var e=this._globalHandlerScope;t?_n(this,e):bn(e)}},e}(Rt),Mn=1;"undefined"!=typeof window&&(Mn=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var Tn=Mn,Cn="#333",kn="#ccc";function Dn(){return[1,0,0,1,0,0]}function In(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function An(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 Ln(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],a=e[0]*n[2]+e[2]*n[3],o=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],l=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t}function Pn(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function On(t,e,n){var i=e[0],r=e[2],a=e[4],o=e[1],s=e[3],l=e[5],u=Math.sin(n),h=Math.cos(n);return t[0]=i*h+o*u,t[1]=-i*u+o*h,t[2]=r*h+s*u,t[3]=-r*u+h*s,t[4]=h*a+u*l,t[5]=h*l-u*a,t}function Rn(t,e,n){var i=n[0],r=n[1];return t[0]=e[0]*i,t[1]=e[1]*r,t[2]=e[2]*i,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*r,t}function Nn(t,e){var n=e[0],i=e[2],r=e[4],a=e[1],o=e[3],s=e[5],l=n*o-a*i;return l?(l=1/l,t[0]=o*l,t[1]=-a*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-o*r)*l,t[5]=(a*r-n*s)*l,t):null}var En=Object.freeze({__proto__:null,create:Dn,identity:In,copy:An,mul:Ln,translate:Pn,rotate:On,scale:Rn,invert:Nn,clone:function(t){var e=[1,0,0,1,0,0];return An(e,t),e}}),zn=In,Bn=5e-5;function Fn(t){return t>Bn||t<-5e-5}var Vn,Hn,Gn=[],Wn=[],Un=[1,0,0,1,0,0],Xn=Math.abs,Yn=function(){function t(){}return t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return Fn(this.rotation)||Fn(this.x)||Fn(this.y)||Fn(this.scaleX-1)||Fn(this.scaleY-1)},t.prototype.updateTransform=function(){var t=this.parent,e=t&&t.transform,n=this.needLocalTransform(),i=this.transform;n||e?(i=i||[1,0,0,1,0,0],n?this.getLocalTransform(i):zn(i),e&&(n?Ln(i,t.transform,i):An(i,t.transform)),this.transform=i,this._resolveGlobalScaleRatio(i)):i&&zn(i)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(Gn);var n=Gn[0]<0?-1:1,i=Gn[1]<0?-1:1,r=((Gn[0]-n)*e+n)/Gn[0]||0,a=((Gn[1]-i)*e+i)/Gn[1]||0;t[0]*=r,t[1]*=r,t[2]*=a,t[3]*=a}this.invTransform=this.invTransform||[1,0,0,1,0,0],Nn(this.invTransform,t)},t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),r=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(r),e=Math.sqrt(e),this.skewX=r,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(Ln(Wn,t.invTransform,e),e=Wn);var n=this.originX,i=this.originY;(n||i)&&(Un[4]=n,Un[5]=i,Ln(Wn,e,Un),Wn[4]-=n,Wn[5]-=i,e=Wn),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var n=[t,e],i=this.invTransform;return i&&Dt(n,n,i),n},t.prototype.transformCoordToGlobal=function(t,e){var n=[t,e],i=this.transform;return i&&Dt(n,n,i),n},t.prototype.getLineScale=function(){var t=this.transform;return t&&Xn(t[0]-1)>1e-10&&Xn(t[3]-1)>1e-10?Math.sqrt(Xn(t[0]*t[3]-t[2]*t[1])):1},t.getLocalTransform=function(t,e){e=e||[];var n=t.originX||0,i=t.originY||0,r=t.scaleX,a=t.scaleY,o=t.rotation||0,s=t.x,l=t.y,u=t.skewX?Math.tan(t.skewX):0,h=t.skewY?Math.tan(-t.skewY):0;return n||i?(e[4]=-n*r-u*i*a,e[5]=-i*a-h*n*r):e[4]=e[5]=0,e[0]=r,e[3]=a,e[1]=h*r,e[2]=u*a,o&&On(e,e,o),e[4]+=n+s,e[5]+=i+l,e},t.initDefaultProps=function(){var e=t.prototype;e.x=0,e.y=0,e.scaleX=1,e.scaleY=1,e.originX=0,e.originY=0,e.skewX=0,e.skewY=0,e.rotation=0,e.globalScaleRatio=1}(),t}(),qn=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,n=this.y;return this.x=t[0]*e+t[2]*n+t[4],this.y=t[1]*e+t[3]*n+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,n){t.x=e,t.y=n},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,n){t.x=e.x+n.x,t.y=e.y+n.y},t.sub=function(t,e,n){t.x=e.x-n.x,t.y=e.y-n.y},t.scale=function(t,e,n){t.x=e.x*n,t.y=e.y*n},t.scaleAndAdd=function(t,e,n,i){t.x=e.x+n.x*i,t.y=e.y+n.y*i},t.lerp=function(t,e,n,i){var r=1-i;t.x=r*e.x+i*n.x,t.y=r*e.y+i*n.y},t}(),jn=Math.min,Zn=Math.max,Kn=new qn,$n=new qn,Jn=new qn,Qn=new qn,ti=new qn,ei=new qn,ni=function(){function t(t,e,n,i){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i),this.x=t,this.y=e,this.width=n,this.height=i}return t.prototype.union=function(t){var e=jn(t.x,this.x),n=jn(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Zn(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Zn(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=e,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){var e=this,n=t.width/e.width,i=t.height/e.height,r=[1,0,0,1,0,0];return Pn(r,r,[-e.x,-e.y]),Rn(r,r,[n,i]),Pn(r,r,[t.x,t.y]),r},t.prototype.intersect=function(e,n){if(!e)return!1;e instanceof t||(e=t.create(e));var i=this,r=i.x,a=i.x+i.width,o=i.y,s=i.y+i.height,l=e.x,u=e.x+e.width,h=e.y,c=e.y+e.height,p=!(ad&&(d=_,gd&&(d=x,v=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},t.applyTransform=function(e,n,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var r=i[0],a=i[3],o=i[4],s=i[5];return e.x=n.x*r+o,e.y=n.y*a+s,e.width=n.width*r,e.height=n.height*a,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}Kn.x=Jn.x=n.x,Kn.y=Qn.y=n.y,$n.x=Qn.x=n.x+n.width,$n.y=Jn.y=n.y+n.height,Kn.transform(i),Qn.transform(i),$n.transform(i),Jn.transform(i),e.x=jn(Kn.x,$n.x,Jn.x,Qn.x),e.y=jn(Kn.y,$n.y,Jn.y,Qn.y);var l=Zn(Kn.x,$n.x,Jn.x,Qn.x),u=Zn(Kn.y,$n.y,Jn.y,Qn.y);e.width=l-e.x,e.height=u-e.y}else e!==n&&t.copy(e,n)},t}(),ii={},ri="12px sans-serif";var ai={measureText:function(t,e){return Vn||(Vn=C().getContext("2d")),Hn!==e&&(Hn=Vn.font=e||ri),Vn.measureText(t)}};function oi(t,e){var n=ii[e=e||ri];n||(n=ii[e]=new xe(500));var i=n.get(t);return null==i&&(i=ai.measureText(t,e).width,n.put(t,i)),i}function si(t,e,n,i){var r=oi(t,e),a=ci(e),o=ui(0,r,n),s=hi(0,a,i);return new ni(o,s,r,a)}function li(t,e,n,i){var r=((t||"")+"").split("\n");if(1===r.length)return si(r[0],e,n,i);for(var a=new ni(0,0,0,0),o=0;o=0?parseFloat(t)/100*e:parseFloat(t):t}function fi(t,e,n){var i=e.position||"inside",r=null!=e.distance?e.distance:5,a=n.height,o=n.width,s=a/2,l=n.x,u=n.y,h="left",c="top";if(i instanceof Array)l+=pi(i[0],n.width),u+=pi(i[1],n.height),h=null,c=null;else switch(i){case"left":l-=r,u+=s,h="right",c="middle";break;case"right":l+=r+o,u+=s,c="middle";break;case"top":l+=o/2,u-=r,h="center",c="bottom";break;case"bottom":l+=o/2,u+=a+r,h="center";break;case"inside":l+=o/2,u+=s,h="center",c="middle";break;case"insideLeft":l+=r,u+=s,c="middle";break;case"insideRight":l+=o-r,u+=s,h="right",c="middle";break;case"insideTop":l+=o/2,u+=r,h="center";break;case"insideBottom":l+=o/2,u+=a-r,h="center",c="bottom";break;case"insideTopLeft":l+=r,u+=r;break;case"insideTopRight":l+=o-r,u+=r,h="right";break;case"insideBottomLeft":l+=r,u+=a-r,c="bottom";break;case"insideBottomRight":l+=o-r,u+=a-r,h="right",c="bottom"}return(t=t||{}).x=l,t.y=u,t.align=h,t.verticalAlign=c,t}var di="__zr_normal__",gi=["x","y","scaleX","scaleY","originX","originY","rotation","ignore"],yi={x:!0,y:!0,scaleX:!0,scaleY:!0,originX:!0,originY:!0,rotation:!0,ignore:!1},vi={},mi=new ni(0,0,0,0),_i=function(){function t(t){this.id=x(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,n){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,r=e.attachedTransform,a=void 0,o=void 0,s=!1;r.parent=i?this:null;var l=!1;if(r.x=e.x,r.y=e.y,r.originX=e.originX,r.originY=e.originY,r.rotation=e.rotation,r.scaleX=e.scaleX,r.scaleY=e.scaleY,null!=n.position){var u=mi;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),i||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(vi,n,u):fi(vi,n,u),r.x=vi.x,r.y=vi.y,a=vi.align,o=vi.verticalAlign;var h=n.origin;if(h&&null!=n.rotation){var c=void 0,p=void 0;"center"===h?(c=.5*u.width,p=.5*u.height):(c=pi(h[0],u.width),p=pi(h[1],u.height)),l=!0,r.originX=-r.x+c+(i?0:u.x),r.originY=-r.y+p+(i?0:u.y)}}null!=n.rotation&&(r.rotation=n.rotation);var f=n.offset;f&&(r.x+=f[0],r.y+=f[1],l||(r.originX=-f[0],r.originY=-f[1]));var d=null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),y=void 0,v=void 0,m=void 0;d&&this.canBeInsideText()?(y=n.insideFill,v=n.insideStroke,null!=y&&"auto"!==y||(y=this.getInsideTextFill()),null!=v&&"auto"!==v||(v=this.getInsideTextStroke(y),m=!0)):(y=n.outsideFill,v=n.outsideStroke,null!=y&&"auto"!==y||(y=this.getOutsideFill()),null!=v&&"auto"!==v||(v=this.getOutsideStroke(y),m=!0)),(y=y||"#000")===g.fill&&v===g.stroke&&m===g.autoStroke&&a===g.align&&o===g.verticalAlign||(s=!0,g.fill=y,g.stroke=v,g.autoStroke=m,g.align=a,g.verticalAlign=o,e.setDefaultTextStyle(g)),e.__dirty|=1,s&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?kn:Cn},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof e&&Oe(e);n||(n=[255,255,255,1]);for(var i=n[3],r=this.__zr.isDarkMode(),a=0;a<3;a++)n[a]=n[a]*i+(r?0:255)*(1-i);return n[3]=1,Ve(n,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},M(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(W(t))for(var n=N(t),i=0;i0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(di,!1,t)},t.prototype.useState=function(t,e,n,i){var r=t===di;if(this.hasState()||!r){var a=this.currentStates,o=this.stateTransition;if(!(k(a,t)>=0)||!e&&1!==a.length){var s;if(this.stateProxy&&!r&&(s=this.stateProxy(t)),s||(s=this.states&&this.states[t]),s||r){r||this.saveCurrentToNormalState(s);var l=!!(s&&s.hoverLayer||i);l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,s,this._normalState,e,!n&&!this.__inHover&&o&&o.duration>0,o);var u=this._textContent,h=this._textGuide;return u&&u.useState(t,e,n,l),h&&h.useState(t,e,n,l),r?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),s}b("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,n){if(t.length){var i=[],r=this.currentStates,a=t.length,o=a===r.length;if(o)for(var s=0;s0,f);var d=this._textContent,g=this._textGuide;d&&d.useStates(t,e,c),g&&g.useStates(t,e,c),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}else this.clearStates()},t.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(e,1),this.useStates(n)}},t.prototype.replaceState=function(t,e,n){var i=this.currentStates.slice(),r=k(i,t),a=k(i,e)>=0;r>=0?a?i.splice(r,1):i[r]=e:n&&!a&&i.push(e),this.useStates(i)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,n={},i=0;i=0&&e.splice(n,1)})),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var n=this.animators,i=n.length,r=[],a=0;a8)&&(r("position","_legacyPos","x","y"),r("scale","_legacyScale","scaleX","scaleY"),r("origin","_legacyOrigin","originX","originY"))}(),t}();function xi(t,e,n,i,r){var a=[];Si(t,"",t,e,n=n||{},i,a,r);var o=a.length,s=!1,l=n.done,u=n.aborted,h=function(){s=!0,--o<=0&&(s?l&&l():u&&u())},c=function(){--o<=0&&(s?l&&l():u&&u())};o||l&&l(),a.length>0&&n.during&&a[0].during((function(t,e){n.during(e)}));for(var p=0;p0||r.force&&!o.length){for(var m=t.animators,_=[],x=0;x=0&&(n.splice(i,0,t),this._doAdd(t))}return this},e.prototype.replaceAt=function(t,e){var n=this._children,i=n[e];if(t&&t!==this&&t.parent!==this&&t!==i){n[e]=t,i.parent=null;var r=this.__zr;r&&i.removeSelfFromZr(r),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},e.prototype.remove=function(t){var e=this.__zr,n=this._children,i=k(n,t);return i<0||(n.splice(i,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},e.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},t.prototype.addHover=function(t){},t.prototype.removeHover=function(t){},t.prototype.clearHover=function(){},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},t.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},t.prototype.clearAnimation=function(){this.animation.clear()},t.prototype.getWidth=function(){return this.painter.getWidth()},t.prototype.getHeight=function(){return this.painter.getHeight()},t.prototype.pathToImage=function(t,e){if(this.painter.pathToImage)return this.painter.pathToImage(t,e)},t.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},t.prototype.on=function(t,e,n){return this.handler.on(t,e,n),this},t.prototype.off=function(t,e){this.handler.off(t,e)},t.prototype.trigger=function(t,e){this.handler.trigger(t,e)},t.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e0){if(t<=r)return o;if(t>=a)return s}else{if(t>=r)return o;if(t<=a)return s}else{if(t===r)return o;if(t===a)return s}return(t-r)/l*u+o}function Ri(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?(n=t,n.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t;var n}function Ni(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function Ei(t){if(t=+t,isNaN(t))return 0;if(t>1e-14)for(var e=1,n=0;n<15;n++,e*=10)if(Math.round(t*e)/e===t)return n;return zi(t)}function zi(t){var e=t.toString().toLowerCase(),n=e.indexOf("e"),i=n>0?+e.slice(n+1):0,r=n>0?n:e.length,a=e.indexOf("."),o=a<0?0:r-1-a;return Math.max(0,o-i)}function Bi(t,e){var n=Math.log,i=Math.LN10,r=Math.floor(n(t[1]-t[0])/i),a=Math.round(n(Math.abs(e[1]-e[0]))/i),o=Math.min(Math.max(-r+a,0),20);return isFinite(o)?o:20}function Fi(t,e,n){if(!t[e])return 0;var i=O(t,(function(t,e){return t+(isNaN(e)?0:e)}),0);if(0===i)return 0;for(var r=Math.pow(10,n),a=P(t,(function(t){return(isNaN(t)?0:t)/i*r*100})),o=100*r,s=P(a,(function(t){return Math.floor(t)})),l=O(s,(function(t,e){return t+e}),0),u=P(a,(function(t,e){return t-s[e]}));lh&&(h=u[p],c=p);++s[c],u[c]=0,++l}return s[e]/r}function Vi(t,e){var n=Math.max(Ei(t),Ei(e)),i=t+e;return n>20?i:Ni(i,n)}function Hi(t){var e=2*Math.PI;return(t%e+e)%e}function Gi(t){return t>-1e-4&&t=10&&e++,e}function qi(t,e){var n=Yi(t),i=Math.pow(10,n),r=t/i;return t=(e?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)*i,n>=-20?+t.toFixed(n<0?-n:0):t}function ji(t){var e=parseFloat(t);return e==t&&(0!==e||"string"!=typeof t||t.indexOf("x")<=0)?e:NaN}function Zi(t){return!isNaN(ji(t))}function Ki(t,e){return 0===e?t:Ki(e,t%e)}function $i(t,e){return null==t?e:null==e?t:t*e/Ki(t,e)}"undefined"!=typeof console&&console.warn&&console.log;function Ji(t){0}function Qi(t){throw new Error(t)}var tr="series\0";function er(t){return t instanceof Array?t:null==t?[]:[t]}function nr(t,e,n){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var i=0,r=n.length;i=0||r&&k(r,s)<0)){var l=n.getShallow(s,e);null!=l&&(a[t[o][0]]=l)}}return a}}var Lr=Ar([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),Pr=function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return Lr(this,t,e)},t}(),Or=new xe(50);function Rr(t){if("string"==typeof t){var e=Or.get(t);return e&&e.image}return t}function Nr(t,e,n,i,r){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!n)return e;var a=Or.get(t),o={hostEl:n,cb:i,cbPayload:r};return a?!zr(e=a.image)&&a.pending.push(o):((e=new Image).onload=e.onerror=Er,Or.put(t,e.__cachedImgObj={image:e,pending:[o]}),e.src=e.__zrImageSrc=t),e}return t}return e}function Er(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=o;l++)s-=o;var u=oi(n,e);return u>s&&(n="",u=0),s=t-u,r.ellipsis=n,r.ellipsisWidth=u,r.contentWidth=s,r.containerWidth=t,r}function Hr(t,e){var n=e.containerWidth,i=e.font,r=e.contentWidth;if(!n)return"";var a=oi(t,i);if(a<=n)return t;for(var o=0;;o++){if(a<=r||o>=e.maxIterations){t+=e.ellipsis;break}var s=0===o?Gr(t,r,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(t.length*r/a):0;a=oi(t=t.substr(0,s),i)}return""===t&&(t=e.placeholder),t}function Gr(t,e,n,i){for(var r=0,a=0,o=t.length;a0&&d+i.accumWidth>i.width&&(a=e.split("\n"),c=!0),i.accumWidth=d}else{var g=Zr(e,h,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+f,o=g.linesWidths,a=g.lines}}else a=e.split("\n");for(var y=0;y=33&&e<=255}(t)||!!qr[t]}function Zr(t,e,n,i,r){for(var a=[],o=[],s="",l="",u=0,h=0,c=0;cn:r+h+f>n)?h?(s||l)&&(d?(s||(s=l,l="",h=u=0),a.push(s),o.push(h-u),l+=p,s="",h=u+=f):(l&&(s+=l,h+=u,l="",u=0),a.push(s),o.push(h),s=p,h=f)):d?(a.push(l),o.push(u),l=p,u=f):(a.push(p),o.push(f)):(h+=f,d?(l+=p,u+=f):(l&&(s+=l,l="",u=0),s+=p))}else l&&(s+=l,h+=u),a.push(s),o.push(h),s="",l="",u=0,h=0}return a.length||s||(s=t,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(h)),1===a.length&&(h+=r),{accumWidth:h,lines:a,linesWidths:o}}var Kr="__zr_style_"+Math.round(10*Math.random()),$r={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Jr={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};$r[Kr]=!0;var Qr=["z","z2","invisible"],ta=["invisible"],ea=function(t){function e(e){return t.call(this,e)||this}var i;return n(e,t),e.prototype._init=function(e){for(var n=N(e),i=0;i-1e-8&&toa||t<-1e-8}function ga(t,e,n,i,r){var a=1-r;return a*a*(a*t+3*r*e)+r*r*(r*i+3*a*n)}function ya(t,e,n,i,r){var a=1-r;return 3*(((e-t)*a+2*(n-e)*r)*a+(i-n)*r*r)}function va(t,e,n,i,r,a){var o=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-r,h=s*s-3*o*l,c=s*l-9*o*u,p=l*l-3*s*u,f=0;if(fa(h)&&fa(c)){if(fa(s))a[0]=0;else(M=-l/s)>=0&&M<=1&&(a[f++]=M)}else{var d=c*c-4*h*p;if(fa(d)){var g=c/h,y=-g/2;(M=-s/o+g)>=0&&M<=1&&(a[f++]=M),y>=0&&y<=1&&(a[f++]=y)}else if(d>0){var v=aa(d),m=h*s+1.5*o*(-c+v),_=h*s+1.5*o*(-c-v);(M=(-s-((m=m<0?-ra(-m,ua):ra(m,ua))+(_=_<0?-ra(-_,ua):ra(_,ua))))/(3*o))>=0&&M<=1&&(a[f++]=M)}else{var x=(2*h*s-3*o*c)/(2*aa(h*h*h)),b=Math.acos(x)/3,w=aa(h),S=Math.cos(b),M=(-s-2*w*S)/(3*o),T=(y=(-s+w*(S+la*Math.sin(b)))/(3*o),(-s+w*(S-la*Math.sin(b)))/(3*o));M>=0&&M<=1&&(a[f++]=M),y>=0&&y<=1&&(a[f++]=y),T>=0&&T<=1&&(a[f++]=T)}}return f}function ma(t,e,n,i,r){var a=6*n-12*e+6*t,o=9*e+3*i-3*t-9*n,s=3*e-3*t,l=0;if(fa(o)){if(da(a))(h=-s/a)>=0&&h<=1&&(r[l++]=h)}else{var u=a*a-4*o*s;if(fa(u))r[0]=-a/(2*o);else if(u>0){var h,c=aa(u),p=(-a-c)/(2*o);(h=(-a+c)/(2*o))>=0&&h<=1&&(r[l++]=h),p>=0&&p<=1&&(r[l++]=p)}}return l}function _a(t,e,n,i,r,a){var o=(e-t)*r+t,s=(n-e)*r+e,l=(i-n)*r+n,u=(s-o)*r+o,h=(l-s)*r+s,c=(h-u)*r+u;a[0]=t,a[1]=o,a[2]=u,a[3]=c,a[4]=c,a[5]=h,a[6]=l,a[7]=i}function xa(t,e,n,i,r,a,o,s,l,u,h){var c,p,f,d,g,y=.005,v=1/0;ha[0]=l,ha[1]=u;for(var m=0;m<1;m+=.05)ca[0]=ga(t,n,r,o,m),ca[1]=ga(e,i,a,s,m),(d=Ct(ha,ca))=0&&d=0&&y1e-4)return s[0]=t-n,s[1]=e-i,l[0]=t+n,void(l[1]=e+i);if(Oa[0]=La(r)*n+t,Oa[1]=Aa(r)*i+e,Ra[0]=La(a)*n+t,Ra[1]=Aa(a)*i+e,u(s,Oa,Ra),h(l,Oa,Ra),(r%=Pa)<0&&(r+=Pa),(a%=Pa)<0&&(a+=Pa),r>a&&!o?a+=Pa:rr&&(Na[0]=La(f)*n+t,Na[1]=Aa(f)*i+e,u(s,Na,s),h(l,Na,l))}var Wa={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Ua=[],Xa=[],Ya=[],qa=[],ja=[],Za=[],Ka=Math.min,$a=Math.max,Ja=Math.cos,Qa=Math.sin,to=Math.sqrt,eo=Math.abs,no=Math.PI,io=2*no,ro="undefined"!=typeof Float32Array,ao=[];function oo(t){return Math.round(t/no*1e8)/1e8%2*no}function so(t,e){var n=oo(t[0]);n<0&&(n+=io);var i=n-t[0],r=t[1];r+=i,!e&&r-n>=io?r=n+io:e&&n-r>=io?r=n-io:!e&&n>r?r=n+(io-oo(n-r)):e&&n0&&(this._ux=eo(n/Tn/t)||0,this._uy=eo(n/Tn/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(Wa.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var n=eo(t-this._xi),i=eo(e-this._yi),r=n>this._ux||i>this._uy;if(this.addData(Wa.L,t,e),this._ctx&&r&&(this._needsDash?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),r)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var a=n*n+i*i;a>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=a)}return this},t.prototype.bezierCurveTo=function(t,e,n,i,r,a){return this.addData(Wa.C,t,e,n,i,r,a),this._ctx&&(this._needsDash?this._dashedBezierTo(t,e,n,i,r,a):this._ctx.bezierCurveTo(t,e,n,i,r,a)),this._xi=r,this._yi=a,this},t.prototype.quadraticCurveTo=function(t,e,n,i){return this.addData(Wa.Q,t,e,n,i),this._ctx&&(this._needsDash?this._dashedQuadraticTo(t,e,n,i):this._ctx.quadraticCurveTo(t,e,n,i)),this._xi=n,this._yi=i,this},t.prototype.arc=function(t,e,n,i,r,a){ao[0]=i,ao[1]=r,so(ao,a),i=ao[0];var o=(r=ao[1])-i;return this.addData(Wa.A,t,e,n,n,i,o,0,a?0:1),this._ctx&&this._ctx.arc(t,e,n,i,r,a),this._xi=Ja(r)*n+t,this._yi=Qa(r)*n+e,this},t.prototype.arcTo=function(t,e,n,i,r){return this._ctx&&this._ctx.arcTo(t,e,n,i,r),this},t.prototype.rect=function(t,e,n,i){return this._ctx&&this._ctx.rect(t,e,n,i),this.addData(Wa.R,t,e,n,i),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(Wa.Z);var t=this._ctx,e=this._x0,n=this._y0;return t&&(this._needsDash&&this._dashedLineTo(e,n),t.closePath()),this._xi=e,this._yi=n,this},t.prototype.fill=function(t){t&&t.fill(),this.toStatic()},t.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},t.prototype.setLineDash=function(t){if(t instanceof Array){this._lineDash=t,this._dashIdx=0;for(var e=0,n=0;nu.length&&(this._expandData(),u=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e0&&f<=t||h<0&&f>=t||0===h&&(c>0&&d<=e||c<0&&d>=e);)f+=h*(n=a[i=this._dashIdx]),d+=c*n,this._dashIdx=(i+1)%g,h>0&&fl||c>0&&du||o[i%2?"moveTo":"lineTo"](h>=0?Ka(f,t):$a(f,t),c>=0?Ka(d,e):$a(d,e));h=f-t,c=d-e,this._dashOffset=-to(h*h+c*c)},t.prototype._dashedBezierTo=function(t,e,n,i,r,a){var o,s,l,u,h,c=this._ctx,p=this._dashSum,f=this._dashOffset,d=this._lineDash,g=this._xi,y=this._yi,v=0,m=this._dashIdx,_=d.length,x=0;for(f<0&&(f=p+f),f%=p,o=0;o<1;o+=.1)s=ga(g,t,n,r,o+.1)-ga(g,t,n,r,o),l=ga(y,e,i,a,o+.1)-ga(y,e,i,a,o),v+=to(s*s+l*l);for(;m<_&&!((x+=d[m])>f);m++);for(o=(x-f)/v;o<=1;)u=ga(g,t,n,r,o),h=ga(y,e,i,a,o),m%2?c.moveTo(u,h):c.lineTo(u,h),o+=d[m]/v,m=(m+1)%_;m%2!=0&&c.lineTo(r,a),s=r-u,l=a-h,this._dashOffset=-to(s*s+l*l)},t.prototype._dashedQuadraticTo=function(t,e,n,i){var r=n,a=i;n=(n+2*t)/3,i=(i+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,n,i,r,a)},t.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var t=this.data;t instanceof Array&&(t.length=this._len,ro&&this._len>11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){Ya[0]=Ya[1]=ja[0]=ja[1]=Number.MAX_VALUE,qa[0]=qa[1]=Za[0]=Za[1]=-Number.MAX_VALUE;var t,e=this.data,n=0,i=0,r=0,a=0;for(t=0;tn||eo(y)>i||c===e-1)&&(d=Math.sqrt(I*I+y*y),r=g,a=_);break;case Wa.C:var v=t[c++],m=t[c++],_=(g=t[c++],t[c++]),x=t[c++],b=t[c++];d=ba(r,a,v,m,g,_,x,b,10),r=x,a=b;break;case Wa.Q:d=ka(r,a,v=t[c++],m=t[c++],g=t[c++],_=t[c++],10),r=g,a=_;break;case Wa.A:var w=t[c++],S=t[c++],M=t[c++],T=t[c++],C=t[c++],k=t[c++],D=k+C;c+=1;t[c++];f&&(o=Ja(C)*M+w,s=Qa(C)*T+S),d=$a(M,T)*Ka(io,Math.abs(k)),r=Ja(D)*M+w,a=Qa(D)*T+S;break;case Wa.R:o=r=t[c++],s=a=t[c++],d=2*t[c++]+2*t[c++];break;case Wa.Z:var I=o-r;y=s-a;d=Math.sqrt(I*I+y*y),r=o,a=s}d>=0&&(l[h++]=d,u+=d)}return this._pathLen=u,u},t.prototype.rebuildPath=function(t,e){var n,i,r,a,o,s,l,u,h,c,p=this.data,f=this._ux,d=this._uy,g=this._len,y=e<1,v=0,m=0,_=0;if(!y||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=e*this._pathLen))t:for(var x=0;x0&&(t.lineTo(h,c),_=0),n=r=p[x++],i=a=p[x++],t.moveTo(r,a);break;case Wa.L:o=p[x++],s=p[x++];var S=eo(o-r),M=eo(s-a);if(S>f||M>d){if(y){if(v+(j=l[m++])>u){var T=(u-v)/j;t.lineTo(r*(1-T)+o*T,a*(1-T)+s*T);break t}v+=j}t.lineTo(o,s),r=o,a=s,_=0}else{var C=S*S+M*M;C>_&&(h=o,c=s,_=C)}break;case Wa.C:var k=p[x++],D=p[x++],I=p[x++],A=p[x++],L=p[x++],P=p[x++];if(y){if(v+(j=l[m++])>u){_a(r,k,I,L,T=(u-v)/j,Ua),_a(a,D,A,P,T,Xa),t.bezierCurveTo(Ua[1],Xa[1],Ua[2],Xa[2],Ua[3],Xa[3]);break t}v+=j}t.bezierCurveTo(k,D,I,A,L,P),r=L,a=P;break;case Wa.Q:k=p[x++],D=p[x++],I=p[x++],A=p[x++];if(y){if(v+(j=l[m++])>u){Ta(r,k,I,T=(u-v)/j,Ua),Ta(a,D,A,T,Xa),t.quadraticCurveTo(Ua[1],Xa[1],Ua[2],Xa[2]);break t}v+=j}t.quadraticCurveTo(k,D,I,A),r=I,a=A;break;case Wa.A:var O=p[x++],R=p[x++],N=p[x++],E=p[x++],z=p[x++],B=p[x++],F=p[x++],V=!p[x++],H=N>E?N:E,G=eo(N-E)>.001,W=z+B,U=!1;if(y)v+(j=l[m++])>u&&(W=z+B*(u-v)/j,U=!0),v+=j;if(G&&t.ellipse?t.ellipse(O,R,N,E,F,z,W,V):t.arc(O,R,H,z,W,V),U)break t;w&&(n=Ja(z)*N+O,i=Qa(z)*E+R),r=Ja(W)*N+O,a=Qa(W)*E+R;break;case Wa.R:n=r=p[x],i=a=p[x+1],o=p[x++],s=p[x++];var X=p[x++],Y=p[x++];if(y){if(v+(j=l[m++])>u){var q=u-v;t.moveTo(o,s),t.lineTo(o+Ka(q,X),s),(q-=X)>0&&t.lineTo(o+X,s+Ka(q,Y)),(q-=Y)>0&&t.lineTo(o+$a(X-q,0),s+Y),(q-=X)>0&&t.lineTo(o,s+$a(Y-q,0));break t}v+=j}t.rect(o,s,X,Y);break;case Wa.Z:if(_>0&&(t.lineTo(h,c),_=0),y){var j;if(v+(j=l[m++])>u){T=(u-v)/j;t.lineTo(r*(1-T)+n*T,a*(1-T)+i*T);break t}v+=j}t.closePath(),r=n,a=i}}},t.CMD=Wa,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._needsDash=!1,e._dashOffset=0,e._dashIdx=0,e._dashSum=0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();function uo(t,e,n,i,r,a,o){if(0===r)return!1;var s=r,l=0;if(o>e+s&&o>i+s||ot+s&&a>n+s||ae+c&&h>i+c&&h>a+c&&h>s+c||ht+c&&u>n+c&&u>r+c&&u>o+c||ue+u&&l>i+u&&l>a+u||lt+u&&s>n+u&&s>r+u||sn||h+ur&&(r+=go);var p=Math.atan2(l,s);return p<0&&(p+=go),p>=i&&p<=r||p+go>=i&&p+go<=r}function vo(t,e,n,i,r,a){if(a>e&&a>i||ar?s:0}var mo=lo.CMD,_o=2*Math.PI;var xo=[-1,-1,-1],bo=[-1,-1];function wo(t,e,n,i,r,a,o,s,l,u){if(u>e&&u>i&&u>a&&u>s||u1&&(h=void 0,h=bo[0],bo[0]=bo[1],bo[1]=h),d=ga(e,i,a,s,bo[0]),f>1&&(g=ga(e,i,a,s,bo[1]))),2===f?ve&&s>i&&s>a||s=0&&h<=1&&(r[l++]=h);else{var u=o*o-4*a*s;if(fa(u))(h=-o/(2*a))>=0&&h<=1&&(r[l++]=h);else if(u>0){var h,c=aa(u),p=(-o-c)/(2*a);(h=(-o+c)/(2*a))>=0&&h<=1&&(r[l++]=h),p>=0&&p<=1&&(r[l++]=p)}}return l}(e,i,a,s,xo);if(0===l)return 0;var u=Ma(e,i,a);if(u>=0&&u<=1){for(var h=0,c=wa(e,i,a,u),p=0;pn||s<-n)return 0;var l=Math.sqrt(n*n-s*s);xo[0]=-l,xo[1]=l;var u=Math.abs(i-r);if(u<1e-4)return 0;if(u>=_o-1e-4){i=0,r=_o;var h=a?1:-1;return o>=xo[0]+t&&o<=xo[1]+t?h:0}if(i>r){var c=i;i=r,r=c}i<0&&(i+=_o,r+=_o);for(var p=0,f=0;f<2;f++){var d=xo[f];if(d+t>o){var g=Math.atan2(s,d);h=a?1:-1;g<0&&(g=_o+g),(g>=i&&g<=r||g+_o>=i&&g+_o<=r)&&(g>Math.PI/2&&g<1.5*Math.PI&&(h=-h),p+=h)}}return p}function To(t,e,n,i,r){for(var a,o,s,l,u=t.data,h=t.len(),c=0,p=0,f=0,d=0,g=0,y=0;y1&&(n||(c+=vo(p,f,d,g,i,r))),m&&(d=p=u[y],g=f=u[y+1]),v){case mo.M:p=d=u[y++],f=g=u[y++];break;case mo.L:if(n){if(uo(p,f,u[y],u[y+1],e,i,r))return!0}else c+=vo(p,f,u[y],u[y+1],i,r)||0;p=u[y++],f=u[y++];break;case mo.C:if(n){if(ho(p,f,u[y++],u[y++],u[y++],u[y++],u[y],u[y+1],e,i,r))return!0}else c+=wo(p,f,u[y++],u[y++],u[y++],u[y++],u[y],u[y+1],i,r)||0;p=u[y++],f=u[y++];break;case mo.Q:if(n){if(co(p,f,u[y++],u[y++],u[y],u[y+1],e,i,r))return!0}else c+=So(p,f,u[y++],u[y++],u[y],u[y+1],i,r)||0;p=u[y++],f=u[y++];break;case mo.A:var _=u[y++],x=u[y++],b=u[y++],w=u[y++],S=u[y++],M=u[y++];y+=1;var T=!!(1-u[y++]);a=Math.cos(S)*b+_,o=Math.sin(S)*w+x,m?(d=a,g=o):c+=vo(p,f,a,o,i,r);var C=(i-_)*w/b+_;if(n){if(yo(_,x,w,S,S+M,T,e,C,r))return!0}else c+=Mo(_,x,w,S,S+M,T,C,r);p=Math.cos(S+M)*b+_,f=Math.sin(S+M)*w+x;break;case mo.R:if(d=p=u[y++],g=f=u[y++],a=d+u[y++],o=g+u[y++],n){if(uo(d,g,a,g,e,i,r)||uo(a,g,a,o,e,i,r)||uo(a,o,d,o,e,i,r)||uo(d,o,d,g,e,i,r))return!0}else c+=vo(a,g,a,o,i,r),c+=vo(d,o,d,g,i,r);break;case mo.Z:if(n){if(uo(p,f,d,g,e,i,r))return!0}else c+=vo(p,f,d,g,i,r);p=d,f=g}}return n||(s=f,l=g,Math.abs(s-l)<1e-4)||(c+=vo(p,f,d,g,i,r)||0),0!==c}var Co=T({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},$r),ko={style:T({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Jr.style)},Do=["x","y","rotation","scaleX","scaleY","originX","originY","invisible","culling","z","z2","zlevel","parent"],Io=function(t){function e(e){return t.call(this,e)||this}var i;return n(e,t),e.prototype.update=function(){var n=this;t.prototype.update.call(this);var i=this.style;if(i.decal){var r=this._decalEl=this._decalEl||new e;r.buildPath===e.prototype.buildPath&&(r.buildPath=function(t){n.buildPath(t,n.shape)}),r.silent=!0;var a=r.style;for(var o in i)a[o]!==i[o]&&(a[o]=i[o]);a.fill=i.fill?i.decal:null,a.decal=null,a.shadowColor=null,i.strokeFirst&&(a.stroke=null);for(var s=0;s.5?Cn:e>.2?"#eee":kn}if(t)return kn}return Cn},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(V(e)){var n=this.__zr;if(!(!n||!n.isDarkMode())===He(t,0)<.4)return e}},e.prototype.buildPath=function(t,e,n){},e.prototype.pathUpdated=function(){this.__dirty&=-5},e.prototype.createPathProxy=function(){this.path=new lo(!1)},e.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,n=!t;if(n){var i=!1;this.path||(i=!0,this.createPathProxy());var r=this.path;(i||4&this.__dirty)&&(r.beginPath(),this.buildPath(r,this.shape,!1),this.pathUpdated()),t=r.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var a=this._rectWithStroke||(this._rectWithStroke=t.clone());if(this.__dirty||n){a.copy(t);var o=e.strokeNoScale?this.getLineScale():1,s=e.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}o>1e-10&&(a.width+=s/o,a.height+=s/o,a.x-=s/o/2,a.y-=s/o/2)}return a}return t},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect(),r=this.style;if(t=n[0],e=n[1],i.contain(t,e)){var a=this.path;if(this.hasStroke()){var o=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),function(t,e,n,i){return To(t,e,!0,n,i)}(a,o/s,t,e)))return!0}if(this.hasFill())return function(t,e,n){return To(t,0,!1,e,n)}(a,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(e,n){"shape"===e?this.setShape(n):t.prototype.attrKV.call(this,e,n)},e.prototype.setShape=function(t,e){var n=this.shape;return n||(n=this.shape={}),"string"==typeof t?n[t]=e:M(n,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(4&this.__dirty)},e.prototype.createStyle=function(t){return ut(Co,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var n=this._normalState;e.shape&&!n.shape&&(n.shape=M({},this.shape))},e.prototype._applyStateObj=function(e,n,i,r,a,o){t.prototype._applyStateObj.call(this,e,n,i,r,a,o);var s,l=!(n&&r);if(n&&n.shape?a?r?s=n.shape:(s=M({},i.shape),M(s,n.shape)):(s=M({},r?this.shape:i.shape),M(s,n.shape)):l&&(s=i.shape),s)if(a){this.shape=M({},this.shape);for(var u={},h=N(s),c=0;c0},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.createStyle=function(t){return ut(Ao,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var e=t.text;null!=e?e+="":e="";var n=li(e,t.font,t.textAlign,t.textBaseline);if(n.x+=t.x||0,n.y+=t.y||0,this.hasStroke()){var i=t.lineWidth;n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i}this._rect=n}return this._rect},e.initDefaultProps=void(e.prototype.dirtyRectTolerance=10),e}(ea);Lo.prototype.type="tspan";var Po=T({x:0,y:0},$r),Oo={style:T({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Jr.style)};var Ro=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.createStyle=function(t){return ut(Po,t)},e.prototype._getSize=function(t){var e=this.style,n=e[t];if(null!=n)return n;var i,r=(i=e.image)&&"string"!=typeof i&&i.width&&i.height?e.image:this.__image;if(!r)return 0;var a="width"===t?"height":"width",o=e[a];return null==o?r[t]:r[t]/r[a]*o},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return Oo},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new ni(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(ea);Ro.prototype.type="image";var No=Math.round;function Eo(t,e,n){if(!e)return t;var i=No(2*t);return(i+No(e))%2==0?i/2:(i+(n?1:-1))/2}var zo=function(){this.x=0,this.y=0,this.width=0,this.height=0},Bo={},Fo=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getDefaultShape=function(){return new zo},e.prototype.buildPath=function(t,e){var n,i,r,a;if(this.subPixelOptimize){var o=function(t,e,n){if(e){var i=e.x,r=e.y,a=e.width,o=e.height;t.x=i,t.y=r,t.width=a,t.height=o;var s=n&&n.lineWidth;return s?(t.x=Eo(i,s,!0),t.y=Eo(r,s,!0),t.width=Math.max(Eo(i+a,s,!1)-t.x,0===a?0:1),t.height=Math.max(Eo(r+o,s,!1)-t.y,0===o?0:1),t):t}}(Bo,e,this.style);n=o.x,i=o.y,r=o.width,a=o.height,o.r=e.r,e=o}else n=e.x,i=e.y,r=e.width,a=e.height;e.r?function(t,e){var n,i,r,a,o,s=e.x,l=e.y,u=e.width,h=e.height,c=e.r;u<0&&(s+=u,u=-u),h<0&&(l+=h,h=-h),"number"==typeof c?n=i=r=a=c:c instanceof Array?1===c.length?n=i=r=a=c[0]:2===c.length?(n=r=c[0],i=a=c[1]):3===c.length?(n=c[0],i=a=c[1],r=c[2]):(n=c[0],i=c[1],r=c[2],a=c[3]):n=i=r=a=0,n+i>u&&(n*=u/(o=n+i),i*=u/o),r+a>u&&(r*=u/(o=r+a),a*=u/o),i+r>h&&(i*=h/(o=i+r),r*=h/o),n+a>h&&(n*=h/(o=n+a),a*=h/o),t.moveTo(s+n,l),t.lineTo(s+u-i,l),0!==i&&t.arc(s+u-i,l+i,i,-Math.PI/2,0),t.lineTo(s+u,l+h-r),0!==r&&t.arc(s+u-r,l+h-r,r,0,Math.PI/2),t.lineTo(s+a,l+h),0!==a&&t.arc(s+a,l+h-a,a,Math.PI/2,Math.PI),t.lineTo(s,l+n),0!==n&&t.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}(t,e):t.rect(n,i,r,a)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(Io);Fo.prototype.type="rect";var Vo={fill:"#000"},Ho={style:T({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},Jr.style)},Go=function(t){function e(e){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=Vo,n.attr(e),n}return n(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){this.styleChanged()&&this._updateSubTexts();for(var e=0;ep&&u){var f=Math.floor(p/l);n=n.slice(0,f)}var d=p,g=h;if(r&&(d+=r[0]+r[2],null!=g&&(g+=r[1]+r[3])),t&&o&&null!=g)for(var y=Vr(h,a,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),v=0;v0,T=null!=t.width&&("truncate"===t.overflow||"break"===t.overflow||"breakAll"===t.overflow),C=i.calculatedLineHeight,k=0;kl&&Yr(n,t.substring(l,u),e,s),Yr(n,i[2],e,s,i[1]),l=Br.lastIndex}la){b>0?(m.tokens=m.tokens.slice(0,b),y(m,x,_),n.lines=n.lines.slice(0,v+1)):n.lines=n.lines.slice(0,v);break t}var k=w.width,D=null==k||"auto"===k;if("string"==typeof k&&"%"===k.charAt(k.length-1))P.percentWidth=k,h.push(P),P.contentWidth=oi(P.text,T);else{if(D){var I=w.backgroundColor,A=I&&I.image;A&&zr(A=Rr(A))&&(P.width=Math.max(P.width,A.width*C/A.height))}var L=d&&null!=r?r-x:null;null!=L&&L=0&&"right"===(k=_[C]).align;)this._placeToken(k,t,b,d,T,"right",y),w-=k.width,T-=k.width,C--;for(M+=(n-(M-f)-(g-T)-w)/2;S<=C;)k=_[S],this._placeToken(k,t,b,d,M+k.width/2,"center",y),M+=k.width,S++;d+=b}},e.prototype._placeToken=function(t,e,n,i,r,a,o){var s=e.rich[t.styleName]||{};s.text=t.text;var l=t.verticalAlign,u=i+n/2;"top"===l?u=i+t.height/2:"bottom"===l&&(u=i+n-t.height/2),!t.isLineHolder&&Zo(s)&&this._renderBackground(s,e,"right"===a?r-t.width:"center"===a?r-t.width/2:r,u-t.height/2,t.width,t.height);var h=!!s.backgroundColor,c=t.textPadding;c&&(r=qo(r,a,c),u-=t.height/2-c[0]-t.innerHeight/2);var p=this._getOrCreateChild(Lo),f=p.createStyle();p.useStyle(f);var d=this._defaultStyle,g=!1,y=0,v=Yo("fill"in s?s.fill:"fill"in e?e.fill:(g=!0,d.fill)),m=Yo("stroke"in s?s.stroke:"stroke"in e?e.stroke:h||o||d.autoStroke&&!g?null:(y=2,d.stroke)),_=s.textShadowBlur>0||e.textShadowBlur>0;f.text=t.text,f.x=r,f.y=u,_&&(f.shadowBlur=s.textShadowBlur||e.textShadowBlur||0,f.shadowColor=s.textShadowColor||e.textShadowColor||"transparent",f.shadowOffsetX=s.textShadowOffsetX||e.textShadowOffsetX||0,f.shadowOffsetY=s.textShadowOffsetY||e.textShadowOffsetY||0),f.textAlign=a,f.textBaseline="middle",f.font=t.font||ri,f.opacity=Q(s.opacity,e.opacity,1),m&&(f.lineWidth=Q(s.lineWidth,e.lineWidth,y),f.lineDash=J(s.lineDash,e.lineDash),f.lineDashOffset=e.lineDashOffset||0,f.stroke=m),v&&(f.fill=v);var x=t.contentWidth,b=t.contentHeight;p.setBoundingRect(new ni(ui(f.x,x,f.textAlign),hi(f.y,b,f.textBaseline),x,b))},e.prototype._renderBackground=function(t,e,n,i,r,a){var o,s,l,u=t.backgroundColor,h=t.borderWidth,c=t.borderColor,p=u&&u.image,f=u&&!p,d=t.borderRadius,g=this;if(f||h&&c){(o=this._getOrCreateChild(Fo)).useStyle(o.createStyle()),o.style.fill=null;var y=o.shape;y.x=n,y.y=i,y.width=r,y.height=a,y.r=d,o.dirtyShape()}if(f)(l=o.style).fill=u||null,l.fillOpacity=J(t.fillOpacity,1);else if(p){(s=this._getOrCreateChild(Ro)).onload=function(){g.dirtyStyle()};var v=s.style;v.image=u.image,v.x=n,v.y=i,v.width=r,v.height=a}h&&c&&((l=o.style).lineWidth=h,l.stroke=c,l.strokeOpacity=J(t.strokeOpacity,1),l.lineDash=t.borderDash,l.lineDashOffset=t.borderDashOffset||0,o.strokeContainThreshold=0,o.hasFill()&&o.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var m=(o||s).style;m.shadowBlur=t.shadowBlur||0,m.shadowColor=t.shadowColor||"transparent",m.shadowOffsetX=t.shadowOffsetX||0,m.shadowOffsetY=t.shadowOffsetY||0,m.opacity=Q(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";if(t.fontSize||t.fontFamily||t.fontWeight){var n="";n="string"!=typeof t.fontSize||-1===t.fontSize.indexOf("px")&&-1===t.fontSize.indexOf("rem")&&-1===t.fontSize.indexOf("em")?isNaN(+t.fontSize)?"12px":t.fontSize+"px":t.fontSize,e=[t.fontStyle,t.fontWeight,n,t.fontFamily||"sans-serif"].join(" ")}return e&&it(e)||t.textFont||t.font},e}(ea),Wo={left:!0,right:1,center:1},Uo={top:1,bottom:1,middle:1};function Xo(t){if(t){t.font=Go.makeFont(t);var e=t.align;"middle"===e&&(e="center"),t.align=null==e||Wo[e]?e:"left";var n=t.verticalAlign;"center"===n&&(n="middle"),t.verticalAlign=null==n||Uo[n]?n:"top",t.padding&&(t.padding=et(t.padding))}}function Yo(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function qo(t,e,n){return"right"===e?t-n[1]:"center"===e?t+n[3]/2-n[1]/2:t+n[3]}function jo(t){var e=t.text;return null!=e&&(e+=""),e}function Zo(t){return!!(t.backgroundColor||t.borderWidth&&t.borderColor)}var Ko=pr(),$o=1,Jo={},Qo=pr(),ts=["emphasis","blur","select"],es=["normal","emphasis","blur","select"],ns="highlight",is="downplay",rs="select",as="unselect",os="toggleSelect";function ss(t){return null!=t&&"none"!==t}var ls=new xe(100);function us(t){if("string"!=typeof t)return t;var e=ls.get(t);return e||(e=Ne(t,-.1),ls.put(t,e)),e}function hs(t,e,n){t.onHoverStateChange&&(t.hoverState||0)!==n&&t.onHoverStateChange(e),t.hoverState=n}function cs(t){hs(t,"emphasis",2)}function ps(t){2===t.hoverState&&hs(t,"normal",0)}function fs(t){hs(t,"blur",1)}function ds(t){1===t.hoverState&&hs(t,"normal",0)}function gs(t){t.selected=!0}function ys(t){t.selected=!1}function vs(t,e,n){e(t,n)}function ms(t,e,n){vs(t,e,n),t.isGroup&&t.traverse((function(t){vs(t,e,n)}))}function _s(t,e){switch(e){case"emphasis":t.hoverState=2;break;case"normal":t.hoverState=0;break;case"blur":t.hoverState=1;break;case"select":t.selected=!0}}function xs(t,e){var n=this.states[t];if(this.style){if("emphasis"===t)return function(t,e,n,i){var r=n&&k(n,"select")>=0,a=!1;if(t instanceof Io){var o=Qo(t),s=r&&o.selectFill||o.normalFill,l=r&&o.selectStroke||o.normalStroke;if(ss(s)||ss(l)){var u=(i=i||{}).style||{};!ss(u.fill)&&ss(s)?(a=!0,i=M({},i),(u=M({},u)).fill=us(s)):!ss(u.stroke)&&ss(l)&&(a||(i=M({},i),u=M({},u)),u.stroke=us(l)),i.style=u}}if(i&&null==i.z2){a||(i=M({},i));var h=t.z2EmphasisLift;i.z2=t.z2+(null!=h?h:10)}return i}(this,0,e,n);if("blur"===t)return function(t,e,n){var i=k(t.currentStates,e)>=0,r=t.style.opacity,a=i?null:function(t,e,n,i){for(var r=t.style,a={},o=0;o0){var a={dataIndex:r,seriesIndex:t.seriesIndex};null!=i&&(a.dataType=i),e.push(a)}}))})),e}function Es(t,e,n){!function(t,e){var n=!1===e,i=t;t.highDownSilentOnTouch&&(i.__highDownSilentOnTouch=t.highDownSilentOnTouch);n&&!i.__highDownDispatcher||(i.__highByOuter=i.__highByOuter||0,i.__highDownDispatcher=!n)}(t,!0),ms(t,bs),function(t,e,n){var i=Ko(t);null!=e?(i.focus=e,i.blurScope=n):i.focus&&(i.focus=null)}(t,e,n)}var zs=["emphasis","blur","select"],Bs={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Fs(t,e,n,i){n=n||"itemStyle";for(var r=0;r1&&(o*=qs(d),s*=qs(d));var g=(r===a?-1:1)*qs((o*o*(s*s)-o*o*(f*f)-s*s*(p*p))/(o*o*(f*f)+s*s*(p*p)))||0,y=g*o*f/s,v=g*-s*p/o,m=(t+n)/2+Zs(c)*y-js(c)*v,_=(e+i)/2+js(c)*y+Zs(c)*v,x=Qs([1,0],[(p-y)/o,(f-v)/s]),b=[(p-y)/o,(f-v)/s],w=[(-1*p-y)/o,(-1*f-v)/s],S=Qs(b,w);if(Js(b,w)<=-1&&(S=Ks),Js(b,w)>=1&&(S=0),S<0){var M=Math.round(S/Ks*1e6)/1e6;S=2*Ks+M%2*Ks}h.addData(u,m,_,o,s,x,S,c,a)}var el=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,nl=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;var il=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.applyTransform=function(t){},e}(Io);function rl(t){return null!=t.setData}function al(t,e){var n=function(t){var e=new lo;if(!t)return e;var n,i=0,r=0,a=i,o=r,s=lo.CMD,l=t.match(el);if(!l)return e;for(var u=0;uA*A+L*L&&(M=C,T=k),{cx:M,cy:T,x01:-h,y01:-c,x11:M*(r/b-1),y11:T*(r/b-1)}}function Sl(t,e){var n=_l(e.r,0),i=_l(e.r0||0,0),r=n>0;if(r||i>0){if(r||(n=i,i=0),i>n){var a=n;n=i,i=a}var o,s=!!e.clockwise,l=e.startAngle,u=e.endAngle;if(l===u)o=0;else{var h=[l,u];so(h,!s),o=vl(h[0]-h[1])}var c=e.cx,p=e.cy,f=e.cornerRadius||0,d=e.innerCornerRadius||0;if(n>bl)if(o>pl-bl)t.moveTo(c+n*dl(l),p+n*fl(l)),t.arc(c,p,n,l,u,!s),i>bl&&(t.moveTo(c+i*dl(u),p+i*fl(u)),t.arc(c,p,i,u,l,s));else{var g=vl(n-i)/2,y=xl(g,f),v=xl(g,d),m=v,_=y,x=n*dl(l),b=n*fl(l),w=i*dl(u),S=i*fl(u),M=void 0,T=void 0,C=void 0,k=void 0;if((y>bl||v>bl)&&(M=n*dl(u),T=n*fl(u),C=i*dl(l),k=i*fl(l),obl)if(_>bl){var N=wl(C,k,x,b,n,_,s),E=wl(M,T,w,S,n,_,s);t.moveTo(c+N.cx+N.x01,p+N.cy+N.y01),_bl&&o>bl)if(m>bl){N=wl(w,S,M,T,i,-m,s),E=wl(x,b,C,k,i,-m,s);t.lineTo(c+N.cx+N.x01,p+N.cy+N.y01),m=2){if(i&&"spline"!==i){var a=function(t,e,n,i){var r,a,o,s,l=[],u=[],h=[],c=[];if(i){o=[1/0,1/0],s=[-1/0,-1/0];for(var p=0,f=t.length;pn-2?n-1:l+1],f=t[l>n-3?n-1:l+2]);var d=u*u,g=u*d;i.push([Dl(h[0],c[0],p[0],f[0],u,d,g),Dl(h[1],c[1],p[1],f[1],u,d,g)])}return i}(r,n)),t.moveTo(r[0][0],r[0][1]);s=1;for(var c=r.length;sjl[1]){if(o=!1,r)return o;var u=Math.abs(jl[0]-ql[1]),h=Math.abs(ql[0]-jl[1]);Math.min(u,h)>i.len()&&(u0?l?e.animateFrom(n,{duration:d,delay:y||0,easing:g,done:a,force:!!a||!!o,scope:t,during:o}):e.animateTo(n,{duration:d,delay:y||0,easing:g,done:a,force:!!a||!!o,setToFinal:!0,scope:t,during:o}):(e.stopAnimation(),!l&&e.attr(n),a&&a())}else e.stopAnimation(),!l&&e.attr(n),o&&o(1),a&&a()}function cu(t,e,n,i,r,a){hu("update",t,e,n,i,r,a)}function pu(t,e,n,i,r,a){hu("init",t,e,n,i,r,a)}function fu(t,e,n,i,r,a){yu(t)||hu("remove",t,e,n,i,r,a)}function du(t,e,n,i){t.removeTextContent(),t.removeTextGuideLine(),fu(t,{style:{opacity:0}},e,n,i)}function gu(t,e,n){function i(){t.parent&&t.parent.remove(t)}t.isGroup?t.traverse((function(t){t.isGroup||du(t,e,n,i)})):du(t,e,n,i)}function yu(t){if(!t.__zr)return!0;for(var e=0;e-1?Uu:Yu;function Ku(t,e){t=t.toUpperCase(),ju[t]=new Hu(e),qu[t]=e}Ku(Xu,{time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}}),Ku(Uu,{time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}});var $u=1e3,Ju=6e4,Qu=36e5,th=864e5,eh=31536e6,nh={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{hh}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}"},ih="{yyyy}-{MM}-{dd}",rh={year:"{yyyy}",month:"{yyyy}-{MM}",day:ih,hour:"{yyyy}-{MM}-{dd} "+nh.hour,minute:"{yyyy}-{MM}-{dd} "+nh.minute,second:"{yyyy}-{MM}-{dd} "+nh.second,millisecond:nh.none},ah=["year","month","day","hour","minute","second","millisecond"],oh=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function sh(t,e){return"0000".substr(0,e-(t+="").length)+t}function lh(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function uh(t){return t===lh(t)}function hh(t,e,n,i){var r=Ui(t),a=r[fh(n)](),o=r[dh(n)]()+1,s=Math.floor((o-1)/4)+1,l=r[gh(n)](),u=r["get"+(n?"UTC":"")+"Day"](),h=r[yh(n)](),c=(h-1)%12+1,p=r[vh(n)](),f=r[mh(n)](),d=r[_h(n)](),g=(i instanceof Hu?i:function(t){return ju[t]}(i||Zu)||ju.EN).getModel("time"),y=g.get("month"),v=g.get("monthAbbr"),m=g.get("dayOfWeek"),_=g.get("dayOfWeekAbbr");return(e||"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,a%100+"").replace(/{Q}/g,s+"").replace(/{MMMM}/g,y[o-1]).replace(/{MMM}/g,v[o-1]).replace(/{MM}/g,sh(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,sh(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,m[u]).replace(/{ee}/g,_[u]).replace(/{e}/g,u+"").replace(/{HH}/g,sh(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,sh(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,sh(p,2)).replace(/{m}/g,p+"").replace(/{ss}/g,sh(f,2)).replace(/{s}/g,f+"").replace(/{SSS}/g,sh(d,3)).replace(/{S}/g,d+"")}function ch(t,e){var n=Ui(t),i=n[dh(e)]()+1,r=n[gh(e)](),a=n[yh(e)](),o=n[vh(e)](),s=n[mh(e)](),l=0===n[_h(e)](),u=l&&0===s,h=u&&0===o,c=h&&0===a,p=c&&1===r;return p&&1===i?"year":p?"month":c?"day":h?"hour":u?"minute":l?"second":"millisecond"}function ph(t,e,n){var i="number"==typeof t?Ui(t):t;switch(e=e||ch(t,n)){case"year":return i[fh(n)]();case"half-year":return i[dh(n)]()>=6?1:0;case"quarter":return Math.floor((i[dh(n)]()+1)/4);case"month":return i[dh(n)]();case"day":return i[gh(n)]();case"half-day":return i[yh(n)]()/24;case"hour":return i[yh(n)]();case"minute":return i[vh(n)]();case"second":return i[mh(n)]();case"millisecond":return i[_h(n)]()}}function fh(t){return t?"getUTCFullYear":"getFullYear"}function dh(t){return t?"getUTCMonth":"getMonth"}function gh(t){return t?"getUTCDate":"getDate"}function yh(t){return t?"getUTCHours":"getHours"}function vh(t){return t?"getUTCMinutes":"getMinutes"}function mh(t){return t?"getUTCSeconds":"getSeconds"}function _h(t){return t?"getUTCSeconds":"getSeconds"}function xh(t){return t?"setUTCFullYear":"setFullYear"}function bh(t){return t?"setUTCMonth":"setMonth"}function wh(t){return t?"setUTCDate":"setDate"}function Sh(t){return t?"setUTCHours":"setHours"}function Mh(t){return t?"setUTCMinutes":"setMinutes"}function Th(t){return t?"setUTCSeconds":"setSeconds"}function Ch(t){return t?"setUTCSeconds":"setSeconds"}function kh(t){if(!Zi(t))return V(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}var Dh=et,Ih=/([&<>"'])/g,Ah={"&":"&","<":"<",">":">",'"':""","'":"'"};function Lh(t){return null==t?"":(t+"").replace(Ih,(function(t,e){return Ah[e]}))}var Ph=["a","b","c","d","e","f","g"],Oh=function(t,e){return"{"+t+(null==e?"":e)+"}"};function Rh(t,e,n){B(e)||(e=[e]);var i=e.length;if(!i)return"";for(var r=e[0].$vars||[],a=0;ai||l.newline?(a=0,h=g,o+=s+n,s=p.height):s=Math.max(s,p.height)}else{var y=p.height+(d?-d.y+p.y:0);(c=o+y)>r||l.newline?(a+=s+n,o=0,c=y,s=p.width):s=Math.max(s,p.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),"horizontal"===t?a=h+n:o=c+n)}))}z(Fh,"vertical"),z(Fh,"horizontal");function Vh(t,e,n){n=Dh(n||0);var i=e.width,r=e.height,a=Ri(t.left,i),o=Ri(t.top,r),s=Ri(t.right,i),l=Ri(t.bottom,r),u=Ri(t.width,i),h=Ri(t.height,r),c=n[2]+n[0],p=n[1]+n[3],f=t.aspect;switch(isNaN(u)&&(u=i-s-p-a),isNaN(h)&&(h=r-l-c-o),null!=f&&(isNaN(u)&&isNaN(h)&&(f>i/r?u=.8*i:h=.8*r),isNaN(u)&&(u=f*h),isNaN(h)&&(h=u/f)),isNaN(a)&&(a=i-s-u-p),isNaN(o)&&(o=r-l-h-c),t.left||t.right){case"center":a=i/2-u/2-n[3];break;case"right":a=i-u-p}switch(t.top||t.bottom){case"middle":case"center":o=r/2-h/2-n[0];break;case"bottom":o=r-h-c}a=a||0,o=o||0,isNaN(u)&&(u=i-p-a-(s||0)),isNaN(h)&&(h=r-c-o-(l||0));var d=new ni(a+n[3],o+n[0],u,h);return d.margin=n,d}function Hh(t){var e=t.layoutMode||t.constructor.layoutMode;return W(e)?e:e?{type:e}:null}function Gh(t,e,n){var i=n&&n.ignoreSize;!B(i)&&(i=[i,i]);var r=o(Bh[0],0),a=o(Bh[1],1);function o(n,r){var a={},o=0,u={},h=0;if(Eh(n,(function(e){u[e]=t[e]})),Eh(n,(function(t){s(e,t)&&(a[t]=u[t]=e[t]),l(a,t)&&o++,l(u,t)&&h++})),i[r])return l(e,n[1])?u[n[2]]=null:l(e,n[2])&&(u[n[1]]=null),u;if(2!==h&&o){if(o>=2)return a;for(var c=0;c=0;o--)a=S(a,n[o],!0);e.defaultOption=a}return e.defaultOption},e.prototype.getReferringComponents=function(t,e){var n=t+"Index",i=t+"Id";return vr(this.ecModel,t,{index:this.get(n,!0),id:this.get(i,!0)},e)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(Hu);Tr(Xh,Hu),Ir(Xh),function(t){var e={};t.registerSubTypeDefaulter=function(t,n){var i=wr(t);e[i.main]=n},t.determineSubType=function(n,i){var r=i.type;if(!r){var a=wr(n).main;t.hasSubTypes(n)&&e[a]&&(r=e[a](i))}return r}}(Xh),function(t,e){function n(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}t.topologicalTravel=function(t,i,r,a){if(t.length){var o=function(t){var i={},r=[];return L(t,(function(a){var o=n(i,a),s=function(t,e){var n=[];return L(t,(function(t){k(e,t)>=0&&n.push(t)})),n}(o.originalDeps=e(a),t);o.entryCount=s.length,0===o.entryCount&&r.push(a),L(s,(function(t){k(o.predecessor,t)<0&&o.predecessor.push(t);var e=n(i,t);k(e.successor,t)<0&&e.successor.push(a)}))})),{graph:i,noEntryList:r}}(i),s=o.graph,l=o.noEntryList,u={};for(L(t,(function(t){u[t]=!0}));l.length;){var h=l.pop(),c=s[h],p=!!u[h];p&&(r.call(a,h,c.originalDeps.slice()),delete u[h]),L(c.successor,p?d:f)}L(u,(function(){var t="";throw new Error(t)}))}function f(t){s[t].entryCount--,0===s[t].entryCount&&l.push(t)}function d(t){u[t]=!0,f(t)}}}(Xh,(function(t){var e=[];L(Xh.getClassesByMainType(t),(function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])})),e=P(e,(function(t){return wr(t).main})),"dataset"!==t&&k(e,"dataset")<=0&&e.unshift("dataset");return e}));var Yh="";"undefined"!=typeof navigator&&(Yh=navigator.platform||"");var qh="rgba(0, 0, 0, 0.2)",jh={darkMode:"auto",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:qh,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:qh,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:qh,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:qh,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:qh,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:qh,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Yh.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},Zh=lt(["tooltip","label","itemName","itemId","seriesName"]),Kh="original",$h="arrayRows",Jh="objectRows",Qh="keyedColumns",tc="typedArray",ec="unknown",nc="column",ic="row",rc=1,ac=2,oc=3,sc=pr();function lc(t,e,n){var i={},r=hc(e);if(!r||!t)return i;var a,o,s=[],l=[],u=e.ecModel,h=sc(u).datasetMap,c=r.uid+"_"+n.seriesLayoutBy;L(t=t.slice(),(function(e,n){var r=W(e)?e:t[n]={name:e};"ordinal"===r.type&&null==a&&(a=n,o=d(r)),i[r.name]=[]}));var p=h.get(c)||h.set(c,{categoryWayDim:o,valueWayDim:0});function f(t,e,n){for(var i=0;ie)return t[i];return t[n-1]}(i,o):n;if((h=h||n)&&h.length){var c=h[l];return r&&(u[r]=c),s.paletteIdx=(l+1)%h.length,c}}var wc=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.init=function(t,e,n,i,r,a){i=i||{},this.option=null,this._theme=new Hu(i),this._locale=new Hu(r),this._optionManager=a},e.prototype.setOption=function(t,e,n){var i=Tc(e);this._optionManager.setOption(t,n,i),this._resetOption(null,i)},e.prototype.resetOption=function(t,e){return this._resetOption(t,Tc(e))},e.prototype._resetOption=function(t,e){var n=!1,i=this._optionManager;if(!t||"recreate"===t){var r=i.mountOption("recreate"===t);0,this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(r,e)):yc(this,r),n=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var a=i.getTimelineOption(this);a&&(n=!0,this._mergeOption(a,e))}if(!t||"recreate"===t||"media"===t){var o=i.getMediaOption(this);o.length&&L(o,(function(t){n=!0,this._mergeOption(t,e)}),this)}return n},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,e){var n=this.option,i=this._componentsMap,r=this._componentsCount,a=[],o=lt(),s=e&&e.replaceMergeMainTypeMap;sc(this).datasetMap=lt(),L(t,(function(t,e){null!=t&&(Xh.hasClass(e)?e&&(a.push(e),o.set(e,!0)):n[e]=null==n[e]?w(t):S(n[e],t,!0))})),s&&s.each((function(t,e){Xh.hasClass(e)&&!o.get(e)&&(a.push(e),o.set(e,!0))})),Xh.topologicalTravel(a,Xh.getAllClassMainTypes(),(function(e){var a=function(t,e,n){var i=fc.get(e);if(!i)return n;var r=i(t);return r?n.concat(r):n}(this,e,er(t[e])),o=i.get(e),l=o?s&&s.get(e)?"replaceMerge":"normalMerge":"replaceAll",u=ar(o,a,l);(function(t,e,n){L(t,(function(t){var i=t.newOption;W(i)&&(t.keyInfo.mainType=e,t.keyInfo.subType=function(t,e,n,i){return e.type?e.type:n?n.subType:i.determineSubType(t,e)}(e,i,t.existing,n))}))})(u,e,Xh),n[e]=null,i.set(e,null),r.set(e,0);var h=[],c=[],p=0;L(u,(function(t,n){var i=t.existing,r=t.newOption;if(r){var a="series"===e,o=Xh.getClass(e,t.keyInfo.subType,!a);if(!o)return;if(i&&i.constructor===o)i.name=t.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1);else{var s=M({componentIndex:n},t.keyInfo);M(i=new o(r,this,this,s),s),t.brandNew&&(i.__requireNewView=!0),i.init(r,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(h.push(i.option),c.push(i),p++):(h.push(void 0),c.push(void 0))}),this),n[e]=h,i.set(e,c),r.set(e,p),"series"===e&&dc(this)}),this),this._seriesIndices||dc(this)},e.prototype.getOption=function(){var t=w(this.option);return L(t,(function(e,n){if(Xh.hasClass(n)){for(var i=er(e),r=i.length,a=!1,o=r-1;o>=0;o--)i[o]&&!hr(i[o])?a=!0:(i[o]=null,!a&&r--);i.length=r,t[n]=i}})),delete t["\0_ec_inner"],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.getLocale=function(t){return this.getLocaleModel().get(t)},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){var i=n[e||0];if(i)return i;if(null==e)for(var r=0;r=e:"max"===n?t<=e:t===e})(i[o],t,a)||(r=!1)}})),r}var Oc=L,Rc=W,Nc=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Ec(t){var e=t&&t.itemStyle;if(e)for(var n=0,i=Nc.length;n=0;d--){var g=t[d];if(s||(c=g.data.rawIndexOf(g.stackedByDimension,h)),c>=0){var y=g.data.getByRawIndex(g.stackResultDimension,c);if(p>=0&&y>0||p<=0&&y<0){p=Vi(p,y),f=y;break}}}return i[0]=p,i[1]=f,i}));o.hostModel.setData(l),e.data=l}))}var tp,ep,np,ip,rp,ap=function(t){this.data=t.data||(t.sourceFormat===Qh?{}:[]),this.sourceFormat=t.sourceFormat||ec,this.seriesLayoutBy=t.seriesLayoutBy||nc,this.startIndex=t.startIndex||0,this.dimensionsDefine=t.dimensionsDefine,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.encodeDefine=t.encodeDefine,this.metaRawOption=t.metaRawOption};function op(t){return t instanceof ap}function sp(t,e,n,i){n=n||hp(t);var r=e.seriesLayoutBy,a=function(t,e,n,i,r){var a,o;if(!t)return{dimensionsDefine:cp(r),startIndex:o,dimensionsDetectedCount:a};if(e===$h){var s=t;"auto"===i||null==i?pp((function(t){null!=t&&"-"!==t&&(V(t)?null==o&&(o=1):o=0)}),n,s,10):o=G(i)?i:i?1:0,r||1!==o||(r=[],pp((function(t,e){r[e]=null!=t?t+"":""}),n,s,1/0)),a=r?r.length:n===ic?s.length:s[0]?s[0].length:null}else if(e===Jh)r||(r=function(t){var e,n=0;for(;nu&&(u=f)}s[0]=l,s[1]=u}},i=function(){return this._data?this._data.length/this._dimSize:0};function r(t){for(var e=0;e=1)&&(t=1),t}o===l&&s===u||(e="reset"),(this._dirty||"reset"===e)&&(this._dirty=!1,a=this._doReset(i)),this._modBy=l,this._modDataCount=u;var c=t&&t.step;if(this._dueEnd=n?n._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var p=this._dueIndex,f=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!i&&(a||p1&&i>0?s:o}};return a;function o(){return e=t?null:a9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&this._createSource()},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,n=this._sourceHost,i=this._getUpstreamSourceManagers(),r=!!i.length;if(Hp(n)){var a=n,o=void 0,s=void 0,l=void 0;if(r){var u=i[0];u.prepareSource(),o=(l=u.getSource()).data,s=l.sourceFormat,e=[u._getVersionSign()]}else s=X(o=a.get("data",!0))?tc:Kh,e=[];var h=this._getSourceMetaRawOption(),c=l?l.metaRawOption:null;t=[sp(o,{seriesLayoutBy:J(h.seriesLayoutBy,c?c.seriesLayoutBy:null),sourceHeader:J(h.sourceHeader,c?c.sourceHeader:null),dimensions:J(h.dimensions,c?c.dimensions:null)},s,a.get("encode",!0))]}else{var p=n;if(r){var f=this._applyTransform(i);t=f.sourceList,e=f.upstreamSignList}else{t=[sp(p.get("source",!0),this._getSourceMetaRawOption(),null,null)],e=[]}}this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,n=this._sourceHost,i=n.get("transform",!0),r=n.get("fromTransformResult",!0);if(null!=r){var a="";1!==t.length&&Gp(a)}var o,s=[],l=[];return L(t,(function(t){t.prepareSource();var e=t.getSource(r||0),n="";null==r||e||Gp(n),s.push(e),l.push(t._getVersionSign())})),i?e=function(t,e,n){var i=er(t),r=i.length,a="";r||Qi(a);for(var o=0,s=r;o1||p&&!h){var d=function(t,e,n,i,r){var a=e.getData(),o=O(t,(function(t,e,n){var i=a.getDimensionInfo(n);return t||i&&!1!==i.tooltip&&null!=i.displayName}),!1),s=[],l=[],u=[];function h(t,e){var n=a.getDimensionInfo(e);n&&!1!==n.otherDims.tooltip&&(o?u.push(Wp("nameValue",{markerType:"subItem",markerColor:r,name:n.displayName,value:t,valueType:n.type})):(s.push(t),l.push(n.type)))}return i.length?L(i,(function(t){h(Mp(a,n,t),t)})):L(t,h),{inlineValues:s,inlineValueTypes:l,blocks:u}}(c,a,o,u,f);e=d.inlineValues,n=d.inlineValueTypes,i=d.blocks,r=d.inlineValues[0]}else if(h){var g=l.getDimensionInfo(u[0]);r=e=Mp(l,o,u[0]),n=g.type}else r=e=p?c[0]:c;var y=ur(a),v=y&&a.name||"",m=l.getName(o),_=s?v:m;return Wp("section",{header:v,noHeader:s||!y,sortParam:r,blocks:[Wp("nameValue",{markerType:"item",markerColor:f,name:_,noName:!it(_),value:e,valueType:n})].concat(i||[])})}var Xp=pr();function Yp(t,e){return t.getName(e)||t.getId(e)}var qp=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}return n(e,t),e.prototype.init=function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=kp({count:Zp,reset:Kp}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n),(Xp(this).sourceManager=new Fp(this)).prepareSource();var i=this.getInitialData(t,n);Jp(i,this),this.dataTask.context.data=i,Xp(this).dataBeforeProcessed=i,jp(this),this._initSelectedMapFromData(i)},e.prototype.mergeDefaultAndTheme=function(t,e){var n=Hh(this),i=n?Wh(t):{},r=this.subType;Xh.hasClass(r)&&(r+="Series"),S(t,e.getTheme().get(this.subType)),S(t,this.getDefaultOption()),nr(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&Gh(t,i,n)},e.prototype.mergeOption=function(t,e){t=S(this.option,t,!0),this.fillDataTextStyle(t.data);var n=Hh(this);n&&Gh(this.option,t,n);var i=Xp(this).sourceManager;i.dirty(),i.prepareSource();var r=this.getInitialData(t,e);Jp(r,this),this.dataTask.dirty(),this.dataTask.context.data=r,Xp(this).dataBeforeProcessed=r,jp(this),this._initSelectedMapFromData(r)},e.prototype.fillDataTextStyle=function(t){if(t&&!X(t))for(var e=["show"],n=0;nthis.getShallow("animationThreshold")&&(t=!1),!!t},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel,r=_c.prototype.getColorFromPalette.call(this,t,e,n);return r||(r=i.getColorFromPalette(t,e,n)),r},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},e.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n)for(var i=this.getData(e),r=0;r=0&&n.push(r)}return n},e.prototype.isSelected=function(t,e){var n=this.option.selectedMap;return n&&n[Yp(this.getData(e),t)]||!1},e.prototype._innerSelect=function(t,e){var n,i,r=this.option.selectedMode,a=e.length;if(r&&a)if("multiple"===r)for(var o=this.option.selectedMap||(this.option.selectedMap={}),s=0;s0&&this._innerSelect(t,e)}},e.registerClass=function(t){return Xh.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.useColorPaletteOnData=!1,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(Xh);function jp(t){var e=t.name;ur(t)||(t.name=function(t){var e=t.getRawData(),n=e.mapDimensionsAll("seriesName"),i=[];return L(n,(function(t){var n=e.getDimensionInfo(t);n.displayName&&i.push(n.displayName)})),i.join(" ")}(t)||e)}function Zp(t){return t.model.getRawData().count()}function Kp(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),$p}function $p(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Jp(t,e){L(r(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),(function(n){t.wrapMethod(n,z(Qp,e))}))}function Qp(t,e){var n=tf(t);return n&&n.setOutputEnd((e||this).count()),e}function tf(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var i=n.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(t.uid))}return i}}I(qp,Cp),I(qp,_c),Tr(qp,Xh);var ef=function(){function t(){this.group=new Mi,this.uid=Wu("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){},t.prototype.updateLayout=function(t,e,n,i){},t.prototype.updateVisual=function(t,e,n,i){},t.prototype.blurSeries=function(t,e){},t}();function nf(){var t=pr();return function(e){var n=t(e),i=e.pipelineContext,r=!!n.large,a=!!n.progressiveRender,o=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(r===o&&a===s)&&"reset"}}Sr(ef),Ir(ef);var rf=pr(),af=nf(),of=function(){function t(){this.group=new Mi,this.uid=Wu("viewChart"),this.renderTask=kp({plan:uf,reset:hf}),this.renderTask.context={view:this}}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},t.prototype.highlight=function(t,e,n,i){lf(t.getData(),i,"emphasis")},t.prototype.downplay=function(t,e,n,i){lf(t.getData(),i,"normal")},t.prototype.remove=function(t,e){this.group.removeAll()},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){this.render(t,e,n,i)},t.prototype.updateLayout=function(t,e,n,i){this.render(t,e,n,i)},t.prototype.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},t.markUpdateMethod=function(t,e){rf(t).updateMethod=e},t.protoInitialize=void(t.prototype.type="chart"),t}();function sf(t,e,n){t&&("emphasis"===e?Ms:Ts)(t,n)}function lf(t,e,n){var i=cr(t,e),r=e&&null!=e.highlightKey?function(t){var e=Jo[t];return null==e&&$o<=32&&(e=Jo[t]=$o++),e}(e.highlightKey):null;null!=i?L(er(i),(function(e){sf(t.getItemGraphicEl(e),n,r)})):t.eachItemGraphicEl((function(t){sf(t,n,r)}))}function uf(t){return af(t.model)}function hf(t){var e=t.model,n=t.ecModel,i=t.api,r=t.payload,a=e.pipelineContext.progressiveRender,o=t.view,s=r&&rf(r).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return"render"!==l&&o[l](e,n,i,r),cf[l]}Sr(of),Ir(of);var cf={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};function pf(t,e,n){var i,r,a,o,s,l=0,u=0,h=null;function c(){u=(new Date).getTime(),h=null,t.apply(a,o||[])}e=e||0;var p=function(){for(var t=[],p=0;p=0?c():h=setTimeout(c,-r),l=i};return p.clear=function(){h&&(clearTimeout(h),h=null)},p.debounceNextCall=function(t){s=t},p}var ff=pr(),df={itemStyle:Ar(Bu,!0),lineStyle:Ar(Nu,!0)},gf={lineStyle:"stroke",itemStyle:"fill"};function yf(t,e){var n=t.visualStyleMapper||df[e];return n||(console.warn("Unkown style type '"+e+"'."),df.itemStyle)}function vf(t,e){var n=t.visualDrawType||gf[e];return n||(console.warn("Unkown style type '"+e+"'."),"fill")}var mf={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",r=t.getModel(i),a=yf(t,i)(r),o=r.getShallow("decal");o&&(n.setVisual("decal",o),o.dirty=!0);var s=vf(t,i),l=a[s],u=F(l)?l:null,h="auto"===a.fill||"auto"===a.stroke;if(!a[s]||u||h){var c=t.getColorFromPalette(t.name,null,e.getSeriesCount());a[s]||(a[s]=c,n.setVisual("colorFromPalette",!0)),a.fill="auto"===a.fill||"function"==typeof a.fill?c:a.fill,a.stroke="auto"===a.stroke||"function"==typeof a.stroke?c:a.stroke}if(n.setVisual("style",a),n.setVisual("drawType",s),!e.isSeriesFiltered(t)&&u)return n.setVisual("colorFromPalette",!1),{dataEach:function(e,n){var i=t.getDataParams(n),r=M({},a);r[s]=u(i),e.setItemVisual(n,"style",r)}}}},_f=new Hu,xf={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData&&!e.isSeriesFiltered(t)){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",r=yf(t,i),a=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(t,e){var n=t.getRawDataItem(e);if(n&&n[i]){_f.option=n[i];var o=r(_f);M(t.ensureUniqueItemVisual(e,"style"),o),_f.option.decal&&(t.setItemVisual(e,"decal",_f.option.decal),_f.option.decal.dirty=!0),a in o&&t.setItemVisual(e,"colorFromPalette",!1)}}:null}}}},bf={performRawSeries:!0,overallReset:function(t){var e=lt();t.eachSeries((function(t){if(t.useColorPaletteOnData){var n=e.get(t.type);n||(n={},e.set(t.type,n)),ff(t).scope=n}})),t.eachSeries((function(e){if(e.useColorPaletteOnData&&!t.isSeriesFiltered(e)){var n=e.getRawData(),i={},r=e.getData(),a=ff(e).scope,o=e.visualStyleAccessPath||"itemStyle",s=vf(e,o);r.each((function(t){var e=r.getRawIndex(t);i[e]=t})),n.each((function(t){var o=i[t];if(r.getItemVisual(o,"colorFromPalette")){var l=r.ensureUniqueItemVisual(o,"style"),u=n.getName(t)||t+"",h=n.count();l[s]=e.getColorFromPalette(u,a,h)}}))}}))}},wf=Math.PI;var Sf=function(){function t(t,e,n,i){this._stageTaskMap=lt(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return t.prototype.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each((function(t){var e=t.overallTask;e&&e.dirty()}))},t.prototype.getPerformArgs=function(t,e){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,r=!e&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex?n.step:null,a=i&&i.modDataCount;return{step:r,modBy:null!=a?Math.ceil(a/r):null,modDataCount:a}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},t.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),r=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,a=t.get("large")&&i>=t.get("largeThreshold"),o="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:r,modDataCount:o,large:a}},t.prototype.restorePipelines=function(t){var e=this,n=e._pipelineMap=lt();t.eachSeries((function(t){var i=t.getProgressive(),r=t.uid;n.set(r,{id:r,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),e._pipe(t,t.dataTask)}))},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),n=this.api;L(this._allHandlers,(function(i){var r=t.get(i.uid)||t.set(i.uid,{}),a="";nt(!(i.reset&&i.overallReset),a),i.reset&&this._createSeriesStageTask(i,r,e,n),i.overallReset&&this._createOverallStageTask(i,r,e,n)}),this)},t.prototype.prepareView=function(t,e,n,i){var r=t.renderTask,a=r.context;a.model=e,a.ecModel=n,a.api=i,r.__block=!t.incrementalPrepareRender,this._pipe(e,r)},t.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},t.prototype._performStageTasks=function(t,e,n,i){i=i||{};var r=!1,a=this;function o(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}L(t,(function(t,s){if(!i.visualType||i.visualType===t.visualType){var l=a._stageTaskMap.get(t.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,p=h.agentStubMap;p.each((function(t){o(i,t)&&(t.dirty(),c=!0)})),c&&h.dirty(),a.updatePayload(h,n);var f=a.getPerformArgs(h,i.block);p.each((function(t){t.perform(f)})),h.perform(f)&&(r=!0)}else u&&u.each((function(s,l){o(i,s)&&s.dirty();var u=a.getPerformArgs(s,i.block);u.skip=!t.performRawSeries&&e.isSeriesFiltered(s.context.model),a.updatePayload(s,n),s.perform(u)&&(r=!0)}))}})),this.unfinished=r||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries((function(t){e=t.dataTask.perform()||e})),this.unfinished=e||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each((function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)}))},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,n,i){var r=this,a=e.seriesTaskMap,o=e.seriesTaskMap=lt(),s=t.seriesType,l=t.getTargetSeries;function u(e){var s=e.uid,l=o.set(s,a&&a.get(s)||kp({plan:Df,reset:If,count:Pf}));l.context={model:e,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:r},r._pipe(e,l)}t.createOnAllSeries?n.eachRawSeries(u):s?n.eachRawSeriesByType(s,u):l&&l(n,i).each(u)},t.prototype._createOverallStageTask=function(t,e,n,i){var r=this,a=e.overallTask=e.overallTask||kp({reset:Mf});a.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r};var o=a.agentStubMap,s=a.agentStubMap=lt(),l=t.seriesType,u=t.getTargetSeries,h=!0,c=!1,p="";function f(t){var e=t.uid,n=s.set(e,o&&o.get(e)||(c=!0,kp({reset:Tf,onDirty:kf})));n.context={model:t,overallProgress:h},n.agent=a,n.__block=h,r._pipe(t,n)}nt(!t.createOnAllSeries,p),l?n.eachRawSeriesByType(l,f):u?u(n,i).each(f):(h=!1,L(n.getSeries(),f)),c&&a.dirty()},t.prototype._pipe=function(t,e){var n=t.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=e),i.tail&&i.tail.pipe(e),i.tail=e,e.__idxInPipeline=i.count++,e.__pipeline=i},t.wrapStageHandler=function(t,e){return F(t)&&(t={overallReset:t,seriesType:Of(t)}),t.uid=Wu("stageHandler"),e&&(t.visualType=e),t},t}();function Mf(t){t.overallReset(t.ecModel,t.api,t.payload)}function Tf(t){return t.overallProgress&&Cf}function Cf(){this.agent.dirty(),this.getDownstream().dirty()}function kf(){this.agent&&this.agent.dirty()}function Df(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function If(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=er(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?P(e,(function(t,e){return Lf(e)})):Af}var Af=Lf(0);function Lf(t){return function(e,n){var i=n.data,r=n.resetDefines[t];if(r&&r.dataEach)for(var a=e.start;a0&&h===r.length-u.length){var c=r.slice(0,h);"data"!==c&&(e.mainType=c,e[u.toLowerCase()]=t,s=!0)}}o.hasOwnProperty(r)&&(n[r]=t,s=!0),s||(i[r]=t)}))}return{cptQuery:e,dataQuery:n,otherQuery:i}},t.prototype.filter=function(t,e){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,r=n.packedEvent,a=n.model,o=n.view;if(!a||!o)return!0;var s=e.cptQuery,l=e.dataQuery;return u(s,a,"mainType")&&u(s,a,"subType")&&u(s,a,"index","componentIndex")&&u(s,a,"name")&&u(s,a,"id")&&u(l,r,"name")&&u(l,r,"dataIndex")&&u(l,r,"dataType")&&(!o.filterForExposedEvent||o.filterForExposedEvent(t,e.otherQuery,i,r));function u(t,e,n,i){return null==t[n]||e[i||n]===t[n]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),Yf={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData();if(t.legendIcon&&n.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){var i=t.get("symbol"),r=t.get("symbolSize"),a=t.get("symbolKeepAspect"),o=t.get("symbolRotate"),s=t.get("symbolOffset"),l=F(i),u=F(r),h=F(o),c=F(s),p=l||u||h||c,f=!l&&i?i:t.defaultSymbol,d=u?null:r,g=h?null:o,y=c?null:s;if(n.setVisual({legendIcon:t.legendIcon||f,symbol:f,symbolSize:d,symbolKeepAspect:a,symbolRotate:g,symbolOffset:y}),!e.isSeriesFiltered(t))return{dataEach:p?function(e,n){var a=t.getRawValue(n),p=t.getDataParams(n);l&&e.setItemVisual(n,"symbol",i(a,p)),u&&e.setItemVisual(n,"symbolSize",r(a,p)),h&&e.setItemVisual(n,"symbolRotate",o(a,p)),c&&e.setItemVisual(n,"symbolOffset",s(a,p))}:null}}}};var qf=2*Math.PI,jf=lo.CMD,Zf=["top","right","bottom","left"];function Kf(t,e,n,i,r){var a=n.width,o=n.height;switch(t){case"top":i.set(n.x+a/2,n.y-e),r.set(0,-1);break;case"bottom":i.set(n.x+a/2,n.y+o+e),r.set(0,1);break;case"left":i.set(n.x-e,n.y+o/2),r.set(-1,0);break;case"right":i.set(n.x+a+e,n.y+o/2),r.set(1,0)}}function $f(t,e,n,i,r,a,o,s,l){o-=t,s-=e;var u=Math.sqrt(o*o+s*s),h=(o/=u)*n+t,c=(s/=u)*n+e;if(Math.abs(i-r)%qf<1e-4)return l[0]=h,l[1]=c,u-n;if(a){var p=i;i=fo(r),r=fo(p)}else i=fo(i),r=fo(r);i>r&&(r+=qf);var f=Math.atan2(s,o);if(f<0&&(f+=qf),f>=i&&f<=r||f+qf>=i&&f+qf<=r)return l[0]=h,l[1]=c,u-n;var d=n*Math.cos(i)+t,g=n*Math.sin(i)+e,y=n*Math.cos(r)+t,v=n*Math.sin(r)+e,m=(d-o)*(d-o)+(g-s)*(g-s),_=(y-o)*(y-o)+(v-s)*(v-s);return m<_?(l[0]=d,l[1]=g,Math.sqrt(m)):(l[0]=y,l[1]=v,Math.sqrt(_))}function Jf(t,e,n,i,r,a,o,s){var l=r-t,u=a-e,h=n-t,c=i-e,p=Math.sqrt(h*h+c*c),f=(l*(h/=p)+u*(c/=p))/p;s&&(f=Math.min(Math.max(f,0),1)),f*=p;var d=o[0]=t+f*h,g=o[1]=e+f*c;return Math.sqrt((d-r)*(d-r)+(g-a)*(g-a))}function Qf(t,e,n,i,r,a,o){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i);var s=t+n,l=e+i,u=o[0]=Math.min(Math.max(r,t),s),h=o[1]=Math.min(Math.max(a,e),l);return Math.sqrt((u-r)*(u-r)+(h-a)*(h-a))}var td=[];function ed(t,e,n){var i=Qf(e.x,e.y,e.width,e.height,t.x,t.y,td);return n.set(td[0],td[1]),i}function nd(t,e,n){for(var i,r,a=0,o=0,s=0,l=0,u=1/0,h=e.data,c=t.x,p=t.y,f=0;f0){e=e/180*Math.PI,id.fromArray(t[0]),rd.fromArray(t[1]),ad.fromArray(t[2]),qn.sub(od,id,rd),qn.sub(sd,ad,rd);var n=od.len(),i=sd.len();if(!(n<.001||i<.001)){od.scale(1/n),sd.scale(1/i);var r=od.dot(sd);if(Math.cos(e)1&&qn.copy(hd,ad),hd.toArray(t[1])}}}}function pd(t,e,n){if(n<=180&&n>0){n=n/180*Math.PI,id.fromArray(t[0]),rd.fromArray(t[1]),ad.fromArray(t[2]),qn.sub(od,rd,id),qn.sub(sd,ad,rd);var i=od.len(),r=sd.len();if(!(i<.001||r<.001))if(od.scale(1/i),sd.scale(1/r),od.dot(e)=o)qn.copy(hd,ad);else{hd.scaleAndAdd(sd,a/Math.tan(Math.PI/2-s));var l=ad.x!==rd.x?(hd.x-rd.x)/(ad.x-rd.x):(hd.y-rd.y)/(ad.y-rd.y);if(isNaN(l))return;l<0?qn.copy(hd,rd):l>1&&qn.copy(hd,ad)}hd.toArray(t[1])}}}function fd(t,e,n,i){var r="normal"===n,a=r?t:t.ensureState(n);a.ignore=e;var o=i.get("smooth");o&&!0===o&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=i.getModel("lineStyle").getLineStyle();r?t.useStyle(s):a.style=s}function dd(t,e){var n=e.smooth,i=e.points;if(i)if(t.moveTo(i[0][0],i[0][1]),n>0&&i.length>=3){var r=Mt(i[0],i[1]),a=Mt(i[1],i[2]);if(!r||!a)return t.lineTo(i[1][0],i[1][1]),void t.lineTo(i[2][0],i[2][1]);var o=Math.min(r,a)*n,s=kt([],i[1],i[0],o/r),l=kt([],i[1],i[2],o/a),u=kt([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var h=1;h0&&a&&x(-h/o,0,o);var d,g,y=t[0],v=t[o-1];return m(),d<0&&b(-d,.8),g<0&&b(g,.8),m(),_(d,g,1),_(g,d,-1),m(),d<0&&w(-d),g<0&&w(g),u}function m(){d=y.rect[e]-i,g=r-v.rect[e]-v.rect[n]}function _(t,e,n){if(t<0){var i=Math.min(e,-t);if(i>0){x(i*n,0,o);var r=i+t;r<0&&b(-r*n,1)}else b(-t*n,1)}}function x(n,i,r){0!==n&&(u=!0);for(var a=i;a0)for(l=0;l0;l--){x(-(a[l-1]*c),l,o)}}}function w(t){var e=t<0?-1:1;t=Math.abs(t);for(var n=Math.ceil(t/(o-1)),i=0;i0?x(n,0,i+1):x(-n,o-i-1,o),(t-=n)<=0)return}}function md(t,e,n,i){return vd(t,"y","height",e,n,i)}function _d(t){if(t){for(var e=[],n=0;n=0&&n.attr(f.oldLayoutSelect),k(u,"emphasis")>=0&&n.attr(f.oldLayoutEmphasis)),cu(n,s,e,o)}else if(n.attr(s),!Iu(n).valueAnimation){var h=J(n.style.opacity,1);n.style.opacity=0,pu(n,{style:{opacity:h}},e,o)}if(f.oldLayout=s,n.states.select){var c=f.oldLayoutSelect={};Td(c,s,Cd),Td(c,n.states.select,Cd)}if(n.states.emphasis){var p=f.oldLayoutEmphasis={};Td(p,s,Cd),Td(p,n.states.emphasis,Cd)}!function(t,e,n,i,r){var a=Iu(t);if(a.valueAnimation){var o=a.defaultInterpolatedText,s=J(a.interpolatedValue,a.prevValue),l=a.value;(null==s?pu:cu)(t,{},i,e,null,(function(i){var u=_r(n,a.precision,s,l,i);a.interpolatedValue=1===i?null:u;var h=xu({labelDataIndex:e,labelFetcher:r,defaultText:o?o(u):u+""},a.statesModels,u);_u(t,h)}))}}(n,o,l,e,e)}if(i&&!i.ignore&&!i.invisible){r=(f=Md(i)).oldLayout;var f,d={points:i.shape.points};r?(i.attr({shape:r}),cu(i,{shape:d},e)):(i.setShape(d),i.style.strokePercent=0,pu(i,{style:{strokePercent:1}},e)),f.oldLayout=d}},t}();function Dd(t,e,n,i,r){var a=t+e;n.isSilent(a)||i.eachComponent({mainType:"series",subType:"pie"},(function(t){for(var e=t.seriesIndex,i=r.selected,o=0;o0?(e=e||1,"dashed"===t?[4*e,2*e]:"dotted"===t?[e]:G(t)?[t]:B(t)?t:null):null}var Wd=new lo(!0);function Ud(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function Xd(t){var e=t.fill;return null!=e&&"none"!==e}function Yd(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var n=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=n}else t.fill()}function qd(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var n=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=n}else t.stroke()}function jd(t,e,n){var i=Nr(e.image,e.__image,n);if(zr(i)){var r=t.createPattern(i,e.repeat||"repeat");if("function"==typeof DOMMatrix&&r.setTransform){var a=new DOMMatrix;a.rotateSelf(0,0,(e.rotation||0)/Math.PI*180),a.scaleSelf(e.scaleX||1,e.scaleY||1),a.translateSelf(e.x||0,e.y||0),r.setTransform(a)}return r}}var Zd=["shadowBlur","shadowOffsetX","shadowOffsetY"],Kd=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function $d(t,e,n,i,r){var a=!1;if(!i&&e===(n=n||{}))return!1;if(i||e.opacity!==n.opacity){a||(tg(t,r),a=!0);var o=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(o)?$r.opacity:o}(i||e.blend!==n.blend)&&(a||(tg(t,r),a=!0),t.globalCompositeOperation=e.blend||$r.blend);for(var s=0;s0&&Gd(n.lineDash,n.lineWidth),w=n.lineDashOffset,S=!!t.setLineDash,M=e.getGlobalScale();if(u.setScale(M[0],M[1],e.segmentIgnoreThreshold),b){var T=n.strokeNoScale&&e.getLineScale?e.getLineScale():1;T&&1!==T&&(b=P(b,(function(t){return t/T})),w/=T)}var C=!0;(l||4&e.__dirty||b&&!S&&r)&&(u.setDPR(t.dpr),s?u.setContext(null):(u.setContext(t),C=!1),u.reset(),b&&!S&&(u.setLineDash(b),u.setLineDashOffset(w)),e.buildPath(u,e.shape,i),u.toStatic(),e.pathUpdated()),C&&u.rebuildPath(t,s?o:1),b&&S&&(t.setLineDash(b),t.lineDashOffset=w),i||(n.strokeFirst?(r&&qd(t,n),a&&Yd(t,n)):(a&&Yd(t,n),r&&qd(t,n))),b&&S&&t.setLineDash([])}(t,e,f,p),p&&(n.batchFill=f.fill||"",n.batchStroke=f.stroke||"")):e instanceof Lo?(3!==n.lastDrawType&&(l=!0,n.lastDrawType=3),Jd(t,e,u,l,n),function(t,e,n){var i=n.text;if(null!=i&&(i+=""),i){t.font=n.font||ri,t.textAlign=n.textAlign,t.textBaseline=n.textBaseline;var r=void 0;if(t.setLineDash){var a=n.lineDash&&n.lineWidth>0&&Gd(n.lineDash,n.lineWidth),o=n.lineDashOffset;if(a){var s=n.strokeNoScale&&e.getLineScale?e.getLineScale():1;s&&1!==s&&(a=P(a,(function(t){return t/s})),o/=s),t.setLineDash(a),t.lineDashOffset=o,r=!0}}n.strokeFirst?(Ud(n)&&t.strokeText(i,n.x,n.y),Xd(n)&&t.fillText(i,n.x,n.y)):(Xd(n)&&t.fillText(i,n.x,n.y),Ud(n)&&t.strokeText(i,n.x,n.y)),r&&t.setLineDash([])}}(t,e,f)):e instanceof Ro?(2!==n.lastDrawType&&(l=!0,n.lastDrawType=2),function(t,e,n,i,r){$d(t,eg(e,r.inHover),n&&eg(n,r.inHover),i,r)}(t,e,u,l,n),function(t,e,n){var i=e.__image=Nr(n.image,e.__image,e,e.onload);if(i&&zr(i)){var r=n.x||0,a=n.y||0,o=e.getWidth(),s=e.getHeight(),l=i.width/i.height;if(null==o&&null!=s?o=s*l:null==s&&null!=o?s=o/l:null==o&&null==s&&(o=i.width,s=i.height),n.sWidth&&n.sHeight){var u=n.sx||0,h=n.sy||0;t.drawImage(i,u,h,n.sWidth,n.sHeight,r,a,o,s)}else if(n.sx&&n.sy){var c=o-(u=n.sx),p=s-(h=n.sy);t.drawImage(i,u,h,c,p,r,a,o,s)}else t.drawImage(i,r,a,o,s)}}(t,e,f)):e instanceof Ql&&(4!==n.lastDrawType&&(l=!0,n.lastDrawType=4),function(t,e,n){var i=e.getDisplayables(),r=e.getTemporalDisplayables();t.save();var a,o,s={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:n.viewWidth,viewHeight:n.viewHeight,inHover:n.inHover};for(a=e.getCursor(),o=i.length;a=4&&(l={x:parseFloat(c[0]||0),y:parseFloat(c[1]||0),width:parseFloat(c[2]),height:parseFloat(c[3])})}if(l&&null!=o&&null!=s&&(u=Pg(l,{x:0,y:0,width:o,height:s}),!e.ignoreViewBox)){var p=i;(i=new Mi).add(p),p.scaleX=p.scaleY=u.scale,p.x=u.x,p.y=u.y}return e.ignoreRootClip||null==o||null==s||i.setClipPath(new Fo({shape:{x:0,y:0,width:o,height:s}})),{root:i,width:o,height:s,viewBoxRect:l,viewBoxTransform:u,named:r}},t.prototype._parseNode=function(t,e,n,i,r,a){var o,s=t.nodeName.toLowerCase(),l=i;if("defs"===s&&(r=!0),"text"===s&&(a=!0),"defs"===s||"switch"===s)o=e;else{if(!r){var u=rg[s];if(u&&ht(rg,s)){o=u.call(this,t,e);var h=t.getAttribute("name");if(h){var c={name:h,namedFrom:null,svgNodeTagLower:s,el:o};n.push(c),"g"===s&&(l=c)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:o});e.add(o)}}var p=mg[s];if(p&&ht(mg,s)){var f=p.call(this,t),d=t.getAttribute("id");d&&(this._defs[d]=f)}}if(o&&o.isGroup)for(var g=t.firstChild;g;)1===g.nodeType?this._parseNode(g,o,n,l,r,a):3===g.nodeType&&a&&this._parseText(g,o),g=g.nextSibling},t.prototype._parseText=function(t,e){var n=new Lo({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});bg(e,n),Sg(t,n,this._defsUsePending,!1,!1),function(t,e){var n=e.__selfStyle;if(n){var i=n.textBaseline,r=i;i&&"auto"!==i?"baseline"===i?r="alphabetic":"before-edge"===i||"text-before-edge"===i?r="top":"after-edge"===i||"text-after-edge"===i?r="bottom":"central"!==i&&"mathematical"!==i||(r="middle"):r="alphabetic",t.style.textBaseline=r}var a=e.__inheritedStyle;if(a){var o=a.textAlign,s=o;o&&("middle"===o&&(s="center"),t.style.textAlign=s)}}(n,e);var i=n.style,r=i.fontSize;r&&r<9&&(i.fontSize=9,n.scaleX*=r/9,n.scaleY*=r/9);var a=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=a;var o=n.getBoundingRect();return this._textX+=o.width,e.add(n),n},t.internalField=void(rg={g:function(t,e){var n=new Mi;return bg(e,n),Sg(t,n,this._defsUsePending,!1,!1),n},rect:function(t,e){var n=new Fo;return bg(e,n),Sg(t,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(t.getAttribute("x")||"0"),y:parseFloat(t.getAttribute("y")||"0"),width:parseFloat(t.getAttribute("width")||"0"),height:parseFloat(t.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(t,e){var n=new ll;return bg(e,n),Sg(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),n.silent=!0,n},line:function(t,e){var n=new El;return bg(e,n),Sg(t,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(t.getAttribute("x1")||"0"),y1:parseFloat(t.getAttribute("y1")||"0"),x2:parseFloat(t.getAttribute("x2")||"0"),y2:parseFloat(t.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(t,e){var n=new hl;return bg(e,n),Sg(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),rx:parseFloat(t.getAttribute("rx")||"0"),ry:parseFloat(t.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(t,e){var n,i=t.getAttribute("points");i&&(n=wg(i));var r=new Ll({shape:{points:n||[]},silent:!0});return bg(e,r),Sg(t,r,this._defsUsePending,!1,!1),r},polyline:function(t,e){var n,i=t.getAttribute("points");i&&(n=wg(i));var r=new Ol({shape:{points:n||[]},silent:!0});return bg(e,r),Sg(t,r,this._defsUsePending,!1,!1),r},image:function(t,e){var n=new Ro;return bg(e,n),Sg(t,n,this._defsUsePending,!1,!1),n.setStyle({image:t.getAttribute("xlink:href"),x:+t.getAttribute("x"),y:+t.getAttribute("y"),width:+t.getAttribute("width"),height:+t.getAttribute("height")}),n.silent=!0,n},text:function(t,e){var n=t.getAttribute("x")||"0",i=t.getAttribute("y")||"0",r=t.getAttribute("dx")||"0",a=t.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(r),this._textY=parseFloat(i)+parseFloat(a);var o=new Mi;return bg(e,o),Sg(t,o,this._defsUsePending,!1,!0),o},tspan:function(t,e){var n=t.getAttribute("x"),i=t.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=i&&(this._textY=parseFloat(i));var r=t.getAttribute("dx")||"0",a=t.getAttribute("dy")||"0",o=new Mi;return bg(e,o),Sg(t,o,this._defsUsePending,!1,!0),this._textX+=parseFloat(r),this._textY+=parseFloat(a),o},path:function(t,e){var n=ol(t.getAttribute("d")||"");return bg(e,n),Sg(t,n,this._defsUsePending,!1,!1),n.silent=!0,n}}),t}(),mg={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||"0",10),n=parseInt(t.getAttribute("y1")||"0",10),i=parseInt(t.getAttribute("x2")||"10",10),r=parseInt(t.getAttribute("y2")||"0",10),a=new Xl(e,n,i,r);return _g(t,a),xg(t,a),a},radialgradient:function(t){var e=parseInt(t.getAttribute("cx")||"0",10),n=parseInt(t.getAttribute("cy")||"0",10),i=parseInt(t.getAttribute("r")||"0",10),r=new Yl(e,n,i);return _g(t,r),xg(t,r),r}};function _g(t,e){"userSpaceOnUse"===t.getAttribute("gradientUnits")&&(e.global=!0)}function xg(t,e){for(var n=t.firstChild;n;){if(1===n.nodeType&&"stop"===n.nodeName.toLocaleLowerCase()){var i=n.getAttribute("offset"),r=void 0;r=i&&i.indexOf("%")>0?parseInt(i,10)/100:i?parseFloat(i):0;var a={};Lg(n,a,a);var o=a.stopColor||n.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:r,color:o})}n=n.nextSibling}}function bg(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),T(e.__inheritedStyle,t.__inheritedStyle))}function wg(t){for(var e=kg(t),n=[],i=0;i0;a-=2){var o=i[a],s=i[a-1],l=kg(o);switch(r=r||[1,0,0,1,0,0],s){case"translate":Pn(r,r,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":Rn(r,r,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":On(r,r,-parseFloat(l[0])*Ig);break;case"skewX":Ln(r,[1,0,Math.tan(parseFloat(l[0])*Ig),1,0,0],r);break;case"skewY":Ln(r,[1,Math.tan(parseFloat(l[0])*Ig),0,1,0,0],r);break;case"matrix":r[0]=parseFloat(l[0]),r[1]=parseFloat(l[1]),r[2]=parseFloat(l[2]),r[3]=parseFloat(l[3]),r[4]=parseFloat(l[4]),r[5]=parseFloat(l[5])}}e.setLocalTransform(r)}}(t,e),Lg(t,o,s),i||function(t,e,n){for(var i=0;i>1^-(1&s),l=l>>1^-(1&l),r=s+=r,a=l+=a,i.push([s/n,l/n])}return i}function Gg(t,e){return P(R((t=function(t){if(!t.UTF8Encoding)return t;var e=t,n=e.UTF8Scale;null==n&&(n=1024);for(var i=e.features,r=0;r0})),(function(t){var n=t.properties,i=t.geometry,r=[];if("Polygon"===i.type){var a=i.coordinates;r.push({type:"polygon",exterior:a[0],interiors:a.slice(1)})}"MultiPolygon"===i.type&&L(a=i.coordinates,(function(t){t[0]&&r.push({type:"polygon",exterior:t[0],interiors:t.slice(1)})}));var o=new zg(n[e||"name"],r,n.cp);return o.properties=n,o}))}for(var Wg=[126,25],Ug="南海诸岛",Xg=[[[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]]],Yg=0;Yg0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.setOption=function(t,e,n){if(this._disposed)Gy(this.id);else{var i,r,a;if(ay(e)&&(n=e.lazyUpdate,i=e.silent,r=e.replaceMerge,a=e.transition,e=e.notMerge),this.__flagInMainProcess=!0,!this._model||e){var o=new Lc(this._api),s=this._theme,l=this._model=new wc;l.scheduler=this._scheduler,l.init(null,null,null,s,this._locale,o)}this._model.setOption(t,{replaceMerge:r},Yy),Ry(this,a),n?(this.__optionUpdated={silent:i},this.__flagInMainProcess=!1,this.getZr().wakeUp()):(yy(this),_y.update.call(this),this._zr.flush(),this.__optionUpdated=!1,this.__flagInMainProcess=!1,Sy.call(this,i),My.call(this,i))}},e.prototype.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||sy&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){if(o.canvasSupported)return t=t||{},this._zr.painter.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.getSvgDataURL=function(){if(o.svgSupported){var t=this._zr;return L(t.storage.getDisplayList(),(function(t){t.stopAnimation(null,!0)})),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(!this._disposed){var e=(t=t||{}).excludeComponents,n=this._model,i=[],r=this;iy(e,(function(t){n.eachComponent({mainType:t},(function(t){var e=r._componentsMap[t.__viewId];e.group.ignore||(i.push(e),e.group.ignore=!0)}))}));var a="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.getRenderedCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return iy(i,(function(t){t.group.ignore=!1})),a}Gy(this.id)},e.prototype.getConnectedDataURL=function(t){if(this._disposed)Gy(this.id);else if(o.canvasSupported){var e="svg"===t.type,n=this.group,i=Math.min,r=Math.max,a=1/0;if(Qy[n]){var s=a,l=a,u=-1/0,h=-1/0,c=[],p=t&&t.pixelRatio||this.getDevicePixelRatio();L(Jy,(function(a,o){if(a.group===n){var p=e?a.getZr().painter.getSvgDom().innerHTML:a.getRenderedCanvas(w(t)),f=a.getDom().getBoundingClientRect();s=i(f.left,s),l=i(f.top,l),u=r(f.right,u),h=r(f.bottom,h),c.push({dom:p,left:f.left,top:f.top})}}));var f=(u*=p)-(s*=p),d=(h*=p)-(l*=p),g=C(),y=Ii(g,{renderer:e?"svg":"canvas"});if(y.resize({width:f,height:d}),e){var v="";return iy(c,(function(t){var e=t.left-s,n=t.top-l;v+=''+t.dom+""})),y.painter.getSvgRoot().innerHTML=v,t.connectedBackgroundColor&&y.painter.setBackgroundColor(t.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}return t.connectedBackgroundColor&&y.add(new Fo({shape:{x:0,y:0,width:f,height:d},style:{fill:t.connectedBackgroundColor}})),iy(c,(function(t){var e=new Ro({style:{x:t.left*p-s,y:t.top*p-l,image:t.dom}});y.add(e)})),y.refreshImmediately(),g.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}},e.prototype.convertToPixel=function(t,e){return xy(this,"convertToPixel",t,e)},e.prototype.convertFromPixel=function(t,e){return xy(this,"convertFromPixel",t,e)},e.prototype.containPixel=function(t,e){var n;if(!this._disposed)return L(dr(this._model,t),(function(t,i){i.indexOf("Models")>=0&&L(t,(function(t){var r=t.coordinateSystem;if(r&&r.containPoint)n=n||!!r.containPoint(e);else if("seriesModels"===i){var a=this._chartsMap[t.__viewId];a&&a.containPoint&&(n=n||a.containPoint(e,t))}else 0}),this)}),this),!!n;Gy(this.id)},e.prototype.getVisual=function(t,e){var n=dr(this._model,t,{defaultMainType:"series"}),i=n.seriesModel;var r=i.getData(),a=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?r.indexOfRawIndex(n.dataIndex):null;return null!=a?function(t,e,n){switch(n){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n)}}(r,a,e):function(t,e){switch(e){case"color":return t.getVisual("style")[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}(r,e)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t,e,n,i=this;iy(Hy,(function(t){var e=function(e){var n,r=i.getModel(),a=e.target,o="globalout"===t;if(o?n={}:a&&Id(a,(function(t){var e=Ko(t);if(e&&null!=e.dataIndex){var i=e.dataModel||r.getSeriesByIndex(e.seriesIndex);return n=i&&i.getDataParams(e.dataIndex,e.dataType)||{},!0}if(e.eventData)return n=M({},e.eventData),!0}),!0),n){var s=n.componentType,l=n.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=n.seriesIndex);var u=s&&null!=l&&r.getComponent(s,l),h=u&&i["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];0,n.event=e,n.type=t,i._$eventProcessor.eventInfo={targetEl:a,packedEvent:n,model:u,view:h},i.trigger(t,n)}};e.zrEventfulCallAtLast=!0,i._zr.on(t,e,i)})),iy(Uy,(function(t,e){i._messageCenter.on(e,(function(t){this.trigger(e,t)}),i)})),iy(["selectchanged"],(function(t){i._messageCenter.on(t,(function(e){this.trigger(t,e)}),i)})),t=this._messageCenter,e=this,n=this._api,t.on("selectchanged",(function(t){var i=n.getModel();t.isFromClick?(Dd("map","selectchanged",e,i,t),Dd("pie","selectchanged",e,i,t)):"select"===t.fromAction?(Dd("map","selected",e,i,t),Dd("pie","selected",e,i,t)):"unselect"===t.fromAction&&(Dd("map","unselected",e,i,t),Dd("pie","unselected",e,i,t))}))},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){this._disposed?Gy(this.id):this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed)Gy(this.id);else{this._disposed=!0,mr(this.getDom(),nv,"");var t=this._api,e=this._model;iy(this._componentsViews,(function(n){n.dispose(e,t)})),iy(this._chartsViews,(function(n){n.dispose(e,t)})),this._zr.dispose(),delete Jy[this.id]}},e.prototype.resize=function(t){if(this._disposed)Gy(this.id);else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),i=t&&t.silent;this.__optionUpdated&&(null==i&&(i=this.__optionUpdated.silent),n=!0,this.__optionUpdated=!1),this.__flagInMainProcess=!0,n&&yy(this),_y.update.call(this,{type:"resize",animation:M({duration:0},t&&t.animation)}),this.__flagInMainProcess=!1,Sy.call(this,i),My.call(this,i)}}},e.prototype.showLoading=function(t,e){if(this._disposed)Gy(this.id);else if(ay(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),$y[t]){var n=$y[t](this._api,e),i=this._zr;this._loadingFX=n,i.add(n)}},e.prototype.hideLoading=function(){this._disposed?Gy(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},e.prototype.makeActionFromEvent=function(t){var e=M({},t);return e.type=Uy[t.type],e},e.prototype.dispatchAction=function(t,e){if(this._disposed)Gy(this.id);else if(ay(e)||(e={silent:!!e}),Wy[t.type]&&this._model)if(this.__flagInMainProcess)this._pendingActions.push(t);else{var n=e.silent;wy.call(this,t,n);var i=e.flush;i?this._zr.flush():!1!==i&&o.browser.weChat&&this._throttledZrFlush(),Sy.call(this,n),My.call(this,n)}},e.prototype.updateLabelLayout=function(){var t=this._labelManager;t.updateLayoutConfig(this._api),t.layout(this._api),t.processLabelsOverall()},e.prototype.appendData=function(t){if(this._disposed)Gy(this.id);else{var e=t.seriesIndex,n=this.getModel().getSeriesByIndex(e);0,n.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},e.internalField=function(){function t(t){for(var e=[],n=t.currentStates,i=0;i0?{duration:a,delay:i.get("delay"),easing:i.get("easing")}:null;n.group.traverse((function(e){if(e.states&&e.states.emphasis){if(yu(e))return;if(e instanceof Io&&function(t){var e=Qo(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var n=t.states.select||{};e.selectFill=n.style&&n.style.fill||null,e.selectStroke=n.style&&n.style.stroke||null}(e),e.__dirty){var n=e.prevStates;n&&e.useStates(n)}if(r){e.stateTransition=o;var i=e.getTextContent(),a=e.getTextGuideLine();i&&(i.stateTransition=o),a&&(a.stateTransition=o)}e.__dirty&&t(e)}}))}yy=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),vy(t,!0),vy(t,!1),e.plan()},vy=function(t,e){for(var n=t._model,i=t._scheduler,r=e?t._componentsViews:t._chartsViews,a=e?t._componentsMap:t._chartsMap,o=t._zr,s=t._api,l=0;le.get("hoverLayerThreshold")&&!o.node&&!o.worker&&e.eachSeries((function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.group.traverse((function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)}))}}))}(t,n)},Ly=function(t,e){iy(jy,(function(n){n(t,e)}))},Ny=function(t){t.__needsUpdateStatus=!0,t.getZr().wakeUp()},Ey=function(e){e.__needsUpdateStatus&&(e.getZr().storage.traverse((function(e){yu(e)||t(e)})),e.__needsUpdateStatus=!1)},Py=function(t){return new(function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.getCoordinateSystems=function(){return t._coordSysMgr.getCoordinateSystems()},i.prototype.getComponentByElement=function(e){for(;e;){var n=e.__ecComponentInfo;if(null!=n)return t._model.getComponent(n.mainType,n.index);e=e.parent}},i.prototype.enterEmphasis=function(e,n){Ms(e,n),Ny(t)},i.prototype.leaveEmphasis=function(e,n){Ts(e,n),Ny(t)},i.prototype.enterBlur=function(e){!function(t){ms(t,fs)}(e),Ny(t)},i.prototype.leaveBlur=function(e){Cs(e),Ny(t)},i.prototype.enterSelect=function(e){ks(e),Ny(t)},i.prototype.leaveSelect=function(e){Ds(e),Ny(t)},i.prototype.getModel=function(){return t.getModel()},i.prototype.getViewOfComponentModel=function(e){return t.getViewOfComponentModel(e)},i.prototype.getViewOfSeriesModel=function(e){return t.getViewOfSeriesModel(e)},i}(kc))(t)},Oy=function(t){function e(t,e){for(var n=0;n=0)){gv.push(n);var a=Sf.wrapStageHandler(n,r);a.__prio=e,a.__raw=n,t.push(a)}}function vv(t,e){$y[t]=e}function mv(t,e,n){ty(t,e,n)}var _v=function(t){var e=(t=w(t)).type,n="";e||Qi(n);var i=e.split(":");2!==i.length&&Qi(n);var r=!1;"echarts"===i[0]&&(e=i[1],r=!0),t.__isBuiltIn=r,Ep.set(e,t)};dv(ly,mf),dv(uy,xf),dv(uy,bf),dv(ly,Yf),dv(uy,{createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(t.hasSymbolVisual&&!e.isSeriesFiltered(t))return{dataEach:t.getData().hasItemOption?function(t,e){var n=t.getItemModel(e),i=n.getShallow("symbol",!0),r=n.getShallow("symbolSize",!0),a=n.getShallow("symbolRotate",!0),o=n.getShallow("symbolOffset",!0),s=n.getShallow("symbolKeepAspect",!0);null!=i&&t.setItemVisual(e,"symbol",i),null!=r&&t.setItemVisual(e,"symbolSize",r),null!=a&&t.setItemVisual(e,"symbolRotate",a),null!=o&&t.setItemVisual(e,"symbolOffset",o),null!=s&&t.setItemVisual(e,"symbolKeepAspect",s)}:null}}}),dv(7e3,(function(t,e){t.eachRawSeries((function(n){if(!t.isSeriesFiltered(n)){var i=n.getData();i.hasItemVisual()&&i.each((function(t){var n=i.getItemVisual(t,"decal");n&&(i.ensureUniqueItemVisual(t,"style").decal=lg(n,e))}));var r=i.getVisual("decal");if(r)i.getVisual("style").decal=lg(r,e)}}))})),sv(Jc),lv(900,(function(t){var e=lt();t.eachSeries((function(t){var n=t.get("stack");if(n){var i=e.get(n)||e.set(n,[]),r=t.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:t};if(!a.stackedDimension||!a.isStackedByIndex&&!a.stackedByDimension)return;i.length&&r.setCalculationInfo("stackedOnSeries",i[i.length-1].seriesModel),i.push(a)}})),e.each(Qc)})),vv("default",(function(t,e){T(e=e||{},{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Mi,i=new Fo({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});n.add(i);var r,a=new Go({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),o=new Fo({style:{fill:"none"},textContent:a,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return n.add(o),e.showSpinner&&((r=new Gl({shape:{startAngle:-wf/2,endAngle:-wf/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*wf/2}).start("circularInOut"),r.animateShape(!0).when(1e3,{startAngle:3*wf/2}).delay(300).start("circularInOut"),n.add(r)),n.resize=function(){var n=a.getBoundingRect().width,s=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*s-(e.showSpinner&&n?10:0)-n)/2-(e.showSpinner&&n?0:5+n/2)+(e.showSpinner?0:n/2)+(n?0:s),u=t.getHeight()/2;e.showSpinner&&r.setShape({cx:l,cy:u}),o.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},n.resize(),n})),cv({type:ns,event:ns,update:ns},ct),cv({type:is,event:is,update:is},ct),cv({type:rs,event:rs,update:rs},ct),cv({type:as,event:as,update:as},ct),cv({type:os,event:os,update:os},ct),ov("light",Ff),ov("dark",Uf);var xv=[],bv={registerPreprocessor:sv,registerProcessor:lv,registerPostInit:uv,registerPostUpdate:hv,registerAction:cv,registerCoordinateSystem:pv,registerLayout:fv,registerVisual:dv,registerTransform:_v,registerLoading:vv,registerMap:mv,PRIORITY:hy,ComponentModel:Xh,ComponentView:ef,SeriesModel:qp,ChartView:of,registerComponentModel:function(t){Xh.registerClass(t)},registerComponentView:function(t){ef.registerClass(t)},registerSeriesModel:function(t){qp.registerClass(t)},registerChartView:function(t){of.registerClass(t)},registerSubTypeDefaulter:function(t,e){Xh.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){Ai(t,e)}};function wv(t){B(t)?L(t,(function(t){wv(t)})):k(xv,t)>=0||(xv.push(t),F(t)&&(t={install:t}),t.install(bv))}function Sv(t){return null==t?0:t.length||1}function Mv(t){return t}var Tv=function(){function t(t,e,n,i,r,a){this._old=t,this._new=e,this._oldKeyGetter=n||Mv,this._newKeyGetter=i||Mv,this.context=r,this._diffModeMultiple="multiple"===a}return t.prototype.add=function(t){return this._add=t,this},t.prototype.update=function(t){return this._update=t,this},t.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},t.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},t.prototype.remove=function(t){return this._remove=t,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var t=this._old,e=this._new,n={},i=new Array(t.length),r=new Array(e.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(e,n,r,"_newKeyGetter");for(var a=0;a1){var u=s.shift();1===s.length&&(n[o]=s[0]),this._update&&this._update(u,a)}else 1===l?(n[o]=null,this._update&&this._update(s,a)):this._remove&&this._remove(a)}this._performRestAdd(r,n)},t.prototype._executeMultiple=function(){var t=this._old,e=this._new,n={},i={},r=[],a=[];this._initIndexMap(t,n,r,"_oldKeyGetter"),this._initIndexMap(e,i,a,"_newKeyGetter");for(var o=0;o1&&1===c)this._updateManyToOne&&this._updateManyToOne(u,l),i[s]=null;else if(1===h&&c>1)this._updateOneToMany&&this._updateOneToMany(u,l),i[s]=null;else if(1===h&&1===c)this._update&&this._update(u,l),i[s]=null;else if(h>1)for(var p=0;p1)for(var o=0;ov[1]&&(v[1]=y)}e&&(this._nameList[f]=e[d],this._dontMakeIdFromName||Nv(this,f))}this._rawCount=this._count=s,this._extent={},Dv(this)},t.prototype._initDataFromProvider=function(t,e,n){if(!(t>=e)){for(var i=this._rawData,r=this._storage,a=this.dimensions,o=a.length,s=this._dimensionInfos,l=this._nameList,u=this._idList,h=this._rawExtent,c=i.getSource().sourceFormat===Kh,p=0;pb[1]&&(b[1]=x)}if(c&&!i.pure&&y){var w=y.name;null==l[v]&&null!=w&&(l[v]=lr(w,null));var S=y.id;null==u[v]&&null!=S&&(u[v]=lr(S,null))}this._dontMakeIdFromName||Nv(this,v)}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent={},Dv(this)}},t.prototype.count=function(){return this._count},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var n=e.constructor,i=this._count;if(n===Array){t=new n(i);for(var r=0;r=0&&e=0&&e=0&&eo&&(o=l)}return i=[a,o],this._extent[t]=i,i},t.prototype.getApproximateExtent=function(t){return t=this.getDimension(t),this._approximateExtent[t]||this.getDataExtent(t)},t.prototype.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},t.prototype.getCalculationInfo=function(t){return this._calculationInfo[t]},t.prototype.setCalculationInfo=function(t,e){Wv(t)?M(this._calculationInfo,t):this._calculationInfo[t]=e},t.prototype.getSum=function(t){var e=0;if(this._storage[t])for(var n=0,i=this.count();n=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return a;r=a-1}}return-1},t.prototype.indicesOfNearest=function(t,e,n){var i=this._storage[t],r=[];if(!i)return r;null==n&&(n=1/0);for(var a=1/0,o=-1,s=0,l=0,u=this.count();l=0&&o<0)&&(a=c,o=h,s=0),h===o&&(r[s++]=l))}return r.length=s,r},t.prototype.getRawDataItem=function(t){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(t));for(var e=[],n=0;n=c&&b<=p||isNaN(b))&&(s[l++]=g),g++}d=!0}else if(2===a){y=f[h[0]];var m=f[h[1]],_=t[i[1]][0],x=t[i[1]][1];for(v=0;v=c&&b<=p||isNaN(b))&&(w>=_&&w<=x||isNaN(w))&&(s[l++]=g),g++}d=!0}}if(!d)if(1===a)for(v=0;v=c&&b<=p||isNaN(b))&&(s[l++]=S)}else for(v=0;vt[C][1])&&(M=!1)}M&&(s[l++]=this.getRawIndex(v))}return lx[1]&&(x[1]=_)}}}return o},t.prototype.downSample=function(t,e,n,i){for(var r=zv(this,[t]),a=r._storage,o=[],s=Gv(1/e),l=a[t],u=this.count(),h=r._rawExtent[t],c=new(Iv(this))(u),p=0,f=0;fu-f&&(s=u-f,o.length=s);for(var d=0;dh[1]&&(h[1]=y),c[p++]=v}return r._count=p,r._indices=c,r.getRawIndex=Pv,r},t.prototype.lttbDownSample=function(t,e){var n,i,r,a=zv(this,[]),o=a._storage[t],s=this.count(),l=new(Iv(this))(s),u=0,h=Gv(1/e),c=this.getRawIndex(0);l[u++]=c;for(var p=1;pn&&(n=i,r=S)}l[u++]=r,c=r}return l[u++]=this.getRawIndex(s-1),a._count=u,a._indices=l,a.getRawIndex=Pv,a},t.prototype.getItemModel=function(t){var e=this.hostModel,n=this.getRawDataItem(t);return new Hu(n,e,e&&e.ecModel)},t.prototype.diff=function(t){var e=this;return new Tv(t?t.getIndices():[],this.getIndices(),(function(e){return Ov(t,e)}),(function(t){return Ov(e,t)}))},t.prototype.getVisual=function(t){var e=this._visual;return e&&e[t]},t.prototype.setVisual=function(t,e){this._visual=this._visual||{},Wv(t)?M(this._visual,t):this._visual[t]=e},t.prototype.getItemVisual=function(t,e){var n=this._itemVisuals[t],i=n&&n[e];return null==i?this.getVisual(e):i},t.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},t.prototype.ensureUniqueItemVisual=function(t,e){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var r=i[e];return null==r&&(B(r=this.getVisual(e))?r=r.slice():Wv(r)&&(r=M({},r)),i[e]=r),r},t.prototype.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,Wv(e)?M(i,e):i[e]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(t,e){if(Wv(t))for(var n in t)t.hasOwnProperty(n)&&this.setLayout(n,t[n]);else this._layout[t]=e},t.prototype.getLayout=function(t){return this._layout[t]},t.prototype.getItemLayout=function(t){return this._itemLayouts[t]},t.prototype.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?M(this._itemLayouts[t]||{},e):e},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(t,e){var n=this.hostModel;if(e){var i=Ko(e);i.dataIndex=t,i.dataType=this.dataType,i.seriesIndex=n&&n.seriesIndex,"group"===e.type&&e.traverse(Fv,e)}this._graphicEls[t]=e},t.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},t.prototype.eachItemGraphicEl=function(t,e){L(this._graphicEls,(function(n,i){n&&t&&t.call(e,n,i)}))},t.prototype.cloneShallow=function(e){e||(e=new t(Uv(this.dimensions,this.getDimensionInfo,this),this.hostModel));if(e._storage=this._storage,e._storageArr=this._storageArr,Vv(e,this),this._indices){var n=this._indices.constructor;if(n===Array){var i=this._indices.length;e._indices=new n(i);for(var r=0;r65535?qv:Zv},Av=function(t,e,n,i){var r=Yv[e.type],a=e.name;if(i){var o=t[a],s=o&&o.length;if(s!==n){for(var l=new r(n),u=0;u=0?this._indices[t]:-1},Ov=function(t,e){var n=t._idList[e];return null==n&&null!=t._idDimIdx&&(n=Rv(t,t._idDimIdx,t._idOrdinalMeta,e)),null==n&&(n="e\0\0"+e),n},Ev=function(t){return B(t)||(t=null!=t?[t]:[]),t},function(t,e){for(var n=0;n=0?(s[c]=(a=l[c],o=void 0,(o=a.constructor)===Array?a.slice():new o(a)),r._rawExtent[c]=Bv(),r._extent[c]=null):s[c]=l[c],u.push(s[c]))}return r},Bv=function(){return[1/0,-1/0]},Fv=function(t){var e=Ko(t),n=Ko(this);e.seriesIndex=n.seriesIndex,e.dataIndex=n.dataIndex,e.dataType=n.dataType},Vv=function(t,e){L(Kv.concat(e.__wrappedMethods||[]),(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t.__wrappedMethods=e.__wrappedMethods,L($v,(function(n){t[n]=w(e[n])})),t._calculationInfo=M({},e._calculationInfo)},Nv=function(t,e){var n=t._nameList,i=t._idList,r=t._nameDimIdx,a=t._idDimIdx,o=n[e],s=i[e];if(null==o&&null!=r&&(n[e]=o=Rv(t,r,t._nameOrdinalMeta,e)),null==s&&null!=a&&(i[e]=s=Rv(t,a,t._idOrdinalMeta,e)),null==s&&null!=o){var l=t._nameRepeatCount,u=l[o]=(l[o]||0)+1;s=o,u>1&&(s+="__ec__"+u),i[e]=s}}}(),t}();function Qv(t,e,n){op(e)||(e=lp(e)),n=n||{},t=(t||[]).slice();for(var i=(n.dimsDef||[]).slice(),r=lt(),a=lt(),o=[],s=function(t,e,n,i){var r=Math.max(t.dimensionsDetectedCount||1,e.length,n.length,i||0);return L(e,(function(t){var e;W(t)&&(e=t.dimsDef)&&(r=Math.max(r,e.length))})),r}(e,t,i,n.dimCount),l=0;le[1]&&(e[1]=t[1])},t.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(t){this._isBlank=t},t}();Ir(um);var hm=function(){function t(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication}return t.createByAxisModel=function(e){var n=e.option,i=n.data,r=i&&P(i,cm);return new t({categories:r,needCollect:!r,deduplication:!1!==n.dedplication})},t.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},t.prototype.parseAndCollect=function(t){var e,n=this._needCollect;if("string"!=typeof t&&!n)return t;if(n&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var i=this._getOrCreateMap();return null==(e=i.get(t))&&(n?(e=this.categories.length,this.categories[e]=t,i.set(t,e)):e=NaN),e},t.prototype._getOrCreateMap=function(){return this._map||(this._map=lt(this.categories))},t}();function cm(t){return W(t)&&null!=t.value?t.value:t+""}var pm=Ni;function fm(t,e,n,i){var r={},a=t[1]-t[0],o=r.interval=qi(a/e,!0);null!=n&&oi&&(o=r.interval=i);var s=r.intervalPrecision=dm(o);return function(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),gm(t,0,e),gm(t,1,e),t[0]>t[1]&&(t[0]=t[1])}(r.niceTickExtent=[pm(Math.ceil(t[0]/o)*o,s),pm(Math.floor(t[1]/o)*o,s)],t),r}function dm(t){return Ei(t)+2}function gm(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function ym(t,e){return t>=e[0]&&t<=e[1]}function vm(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function mm(t,e){return t*(e[1]-e[0])+e[0]}var _m=function(t){function e(e){var n=t.call(this,e)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new hm({})),B(i)&&(i=new hm({categories:P(i,(function(t){return W(t)?t.value:t}))})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return n(e,t),e.prototype.parse=function(t){return"string"==typeof t?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return ym(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},e.prototype.normalize=function(t){return vm(t=this._getTickNumber(this.parse(t)),this._extent)},e.prototype.scale=function(t){return t=Math.round(mm(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push({value:n}),n++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(null!=t){for(var e=t.ordinalNumbers,n=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],r=0,a=this._ordinalMeta.categories.length,o=Math.min(a,e.length);r=0&&t=0&&t=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.niceTicks=function(){},e.prototype.niceExtent=function(){},e.type="ordinal",e}(um);um.registerClass(_m);var xm=Ni,bm=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return n(e,t),e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return ym(t,this._extent)},e.prototype.normalize=function(t){return vm(t,this._extent)},e.prototype.scale=function(t){return mm(t,this._extent)},e.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},e.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=dm(t)},e.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,a=[];if(!e)return a;n[0]1e4)return[];var s=a.length?a[a.length-1].value:i[1];return n[1]>s&&(t?a.push({value:xm(s+e,r)}):a.push({value:n[1]})),a},e.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],i=this.getExtent(),r=1;ri[0]&&h0&&(a=null===a?s:Math.min(a,s))}n[i]=a}}return n}(t),n=[];return L(t,(function(t){var i,r=t.coordinateSystem.getBaseAxis(),a=r.getExtent();if("category"===r.type)i=r.getBandWidth();else if("value"===r.type||"time"===r.type){var o=r.dim+"_"+r.index,s=e[o],l=Math.abs(a[1]-a[0]),u=r.scale.getExtent(),h=Math.abs(u[1]-u[0]);i=s?l/h*s:l}else{var c=t.getData();i=Math.abs(a[1]-a[0])/c.count()}var p=Ri(t.get("barWidth"),i),f=Ri(t.get("barMaxWidth"),i),d=Ri(t.get("barMinWidth")||1,i),g=t.get("barGap"),y=t.get("barCategoryGap");n.push({bandWidth:i,barWidth:p,barMaxWidth:f,barMinWidth:d,barGap:g,barCategoryGap:y,axisKey:Mm(r),stackId:Sm(t)})})),function(t){var e={};L(t,(function(t,n){var i=t.axisKey,r=t.bandWidth,a=e[i]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},o=a.stacks;e[i]=a;var s=t.stackId;o[s]||a.autoWidthCount++,o[s]=o[s]||{width:0,maxWidth:0};var l=t.barWidth;l&&!o[s].width&&(o[s].width=l,l=Math.min(a.remainedWidth,l),a.remainedWidth-=l);var u=t.barMaxWidth;u&&(o[s].maxWidth=u);var h=t.barMinWidth;h&&(o[s].minWidth=h);var c=t.barGap;null!=c&&(a.gap=c);var p=t.barCategoryGap;null!=p&&(a.categoryGap=p)}));var n={};return L(e,(function(t,e){n[e]={};var i=t.stacks,r=t.bandWidth,a=t.categoryGap;if(null==a){var o=N(i).length;a=Math.max(35-4*o,15)+"%"}var s=Ri(a,r),l=Ri(t.gap,1),u=t.remainedWidth,h=t.autoWidthCount,c=(u-s)/(h+(h-1)*l);c=Math.max(c,0),L(i,(function(t){var e=t.maxWidth,n=t.minWidth;if(t.width){i=t.width;e&&(i=Math.min(i,e)),n&&(i=Math.max(i,n)),t.width=i,u-=i+l*i,h--}else{var i=c;e&&ei&&(i=n),i!==c&&(t.width=i,u-=i+l*i,h--)}})),c=(u-s)/(h+(h-1)*l),c=Math.max(c,0);var p,f=0;L(i,(function(t,e){t.width||(t.width=c),p=t,f+=t.width*(1+l)})),p&&(f-=p.width*l);var d=-f/2;L(i,(function(t,i){n[e][i]=n[e][i]||{bandWidth:r,offset:d,width:t.width},d+=t.width*(1+l)}))})),n}(n)}function km(t,e,n){if(t&&e){var i=t[Mm(e)];return null!=i&&null!=n?i[Sm(n)]:i}}function Dm(t,e){var n=Tm(t,e),i=Cm(n),r={};L(n,(function(t){var e=t.getData(),n=t.coordinateSystem,a=n.getBaseAxis(),o=Sm(t),s=i[Mm(a)][o],l=s.offset,u=s.width,h=n.getOtherAxis(a),c=t.get("barMinHeight")||0;r[o]=r[o]||[],e.setLayout({bandWidth:s.bandWidth,offset:l,size:u});for(var p=e.mapDimension(h.dim),f=e.mapDimension(a.dim),d=om(e,p),g=h.isHorizontal(),y=Pm(a,h),v=0,m=e.count();v=0?"p":"n",w=y;d&&(r[o][x]||(r[o][x]={p:y,n:y}),w=r[o][x][b]);var S,M=void 0,T=void 0,C=void 0,k=void 0;if(g)M=w,T=(S=n.dataToPoint([_,x]))[1]+l,C=S[0]-y,k=u,Math.abs(C).5||(h=.5),{progress:function(t,e){for(var c,p=t.count,f=new wm(2*p),d=new wm(2*p),g=new wm(p),y=[],v=[],m=0,_=0;null!=(c=t.next());)v[u]=e.get(o,c),v[1-u]=e.get(s,c),y=n.dataToPoint(v,null),d[m]=l?i.x+i.width:y[0],f[m++]=y[0],d[m]=l?y[1]:i.y+i.height,f[m++]=y[1],g[_++]=c;e.setLayout({largePoints:f,largeDataIndices:g,largeBackgroundPoints:d,barWidth:h,valueAxisStart:Pm(r,a),backgroundStart:l?i.x:i.y,valueAxisHorizontal:l})}}}}};function Am(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type}function Lm(t){return t.pipelineContext&&t.pipelineContext.large}function Pm(t,e,n){return e.toGlobalCoord(e.dataToCoord("log"===e.type?1:0))}var Om=function(t){function e(e){var n=t.call(this,e)||this;return n.type="time",n}return n(e,t),e.prototype.getLabel=function(t){var e=this.getSetting("useUTC");return hh(t.value,rh[function(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(lh(this._minLevelUnit))]||rh.second,e,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(t,e,n){var i=this.getSetting("useUTC");return function(t,e,n,i,r){var a=null;if("string"==typeof n)a=n;else if("function"==typeof n)a=n(t.value,e,{level:t.level});else{var o=M({},nh);if(t.level>0)for(var s=0;s=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(B(a)){var h=null==t.level?0:t.level>=0?t.level:a.length+t.level;a=a[h=Math.min(h,a.length-1)]}}return hh(new Date(t.value),a,r,i)}(t,e,n,this.getSetting("locale"),i)},e.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=[];if(!e)return i;i.push({value:n[0],level:0});var r=this.getSetting("useUTC"),a=function(t,e,n,i){var r=1e4,a=oh,o=0;function s(t,e,n,r,a,o,s){for(var l=new Date(e),u=e,h=l[r]();u1&&0===u&&a.unshift({value:a[0].value-p})}}for(u=0;u=i[0]&&v<=i[1]&&c++)}var m=(i[1]-i[0])/e;if(c>1.5*m&&p>m/1.5)break;if(u.push(g),c>m||t===a[f])break}h=[]}}0;var _=R(P(u,(function(t){return R(t,(function(t){return t.value>=i[0]&&t.value<=i[1]&&!t.notAdd}))})),(function(t){return t.length>0})),x=[],b=_.length-1;for(f=0;f<_.length;++f)for(var w=_[f],S=0;Sn&&(this._approxInterval=n);var a=Rm.length,o=Math.min(function(t,e,n,i){for(;n>>1;t[r][1]16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function Em(t){return(t/=2592e6)>6?6:t>3?3:t>2?2:1}function zm(t){return(t/=Qu)>12?12:t>6?6:t>3.5?4:t>2?2:1}function Bm(t,e){return(t/=e?Ju:$u)>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function Fm(t){return qi(t,!0)}function Vm(t,e,n){var i=new Date(t);switch(lh(e)){case"year":case"month":i[bh(n)](0);case"day":i[wh(n)](1);case"hour":i[Sh(n)](0);case"minute":i[Mh(n)](0);case"second":i[Th(n)](0),i[Ch(n)](0)}return i.getTime()}um.registerClass(Om);var Hm=um.prototype,Gm=bm.prototype,Wm=Ni,Um=Math.floor,Xm=Math.ceil,Ym=Math.pow,qm=Math.log,jm=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e.base=10,e._originalScale=new bm,e._interval=0,e}return n(e,t),e.prototype.getTicks=function(t){var e=this._originalScale,n=this._extent,i=e.getExtent();return P(Gm.getTicks.call(this,t),(function(t){var e=t.value,r=Ni(Ym(this.base,e));return r=e===n[0]&&this._fixMin?Km(r,i[0]):r,{value:r=e===n[1]&&this._fixMax?Km(r,i[1]):r}}),this)},e.prototype.setExtent=function(t,e){var n=this.base;t=qm(t)/qm(n),e=qm(e)/qm(n),Gm.setExtent.call(this,t,e)},e.prototype.getExtent=function(){var t=this.base,e=Hm.getExtent.call(this);e[0]=Ym(t,e[0]),e[1]=Ym(t,e[1]);var n=this._originalScale.getExtent();return this._fixMin&&(e[0]=Km(e[0],n[0])),this._fixMax&&(e[1]=Km(e[1],n[1])),e},e.prototype.unionExtent=function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=qm(t[0])/qm(e),t[1]=qm(t[1])/qm(e),Hm.unionExtent.call(this,t)},e.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},e.prototype.niceTicks=function(t){t=t||10;var e=this._extent,n=e[1]-e[0];if(!(n===1/0||n<=0)){var i=Xi(n);for(t/n*i<=.5&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&Math.abs(i)>0;)i*=10;var r=[Ni(Xm(e[0]/i)*i),Ni(Um(e[1]/i)*i)];this._interval=i,this._niceExtent=r}},e.prototype.niceExtent=function(t){Gm.niceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return ym(t=qm(t)/qm(this.base),this._extent)},e.prototype.normalize=function(t){return vm(t=qm(t)/qm(this.base),this._extent)},e.prototype.scale=function(t){return t=mm(t,this._extent),Ym(this.base,t)},e.type="log",e}(um),Zm=jm.prototype;function Km(t,e){return Wm(t,Ei(e))}Zm.getMinorTicks=Gm.getMinorTicks,Zm.getLabel=Gm.getLabel,um.registerClass(jm);var $m=function(){function t(t,e,n){this._prepareParams(t,e,n)}return t.prototype._prepareParams=function(t,e,n){n[1]s&&(o=NaN,s=NaN);var h=K(o)||K(s)||t&&!i;this._needCrossZero&&(o>0&&s>0&&!l&&(o=0),o<0&&s<0&&!u&&(s=0));var c=this._determinedMin,p=this._determinedMax;return null!=c&&(o=c,l=!0),null!=p&&(s=p,u=!0),{min:o,max:s,minFixed:l,maxFixed:u,isBlank:h}},t.prototype.modifyDataMinMax=function(t,e){this[Qm[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){var n=Jm[t];this[n]=e},t.prototype.freeze=function(){this.frozen=!0},t}(),Jm={min:"_determinedMin",max:"_determinedMax"},Qm={min:"_dataMin",max:"_dataMax"};function t_(t,e){return null==e?null:K(e)?NaN:t.parse(e)}function e_(t,e){var n=t.type,i=function(t,e,n){var i=t.rawExtentInfo;return i||(i=new $m(t,e,n),t.rawExtentInfo=i,i)}(t,e,t.getExtent()).calculate();t.setBlank(i.isBlank);var r=i.min,a=i.max,o=e.ecModel;if(o&&"time"===n){var s=Tm("bar",o),l=!1;if(L(s,(function(t){l=l||t.getBaseAxis()===e.axis})),l){var u=Cm(s),h=function(t,e,n,i){var r=n.axis.getExtent(),a=r[1]-r[0],o=km(i,n.axis);if(void 0===o)return{min:t,max:e};var s=1/0;L(o,(function(t){s=Math.min(t.offset,s)}));var l=-1/0;L(o,(function(t){l=Math.max(t.offset+t.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,c=h/(1-(s+l)/a)-h;return{min:t-=c*(s/u),max:e+=c*(l/u)}}(r,a,e,u);r=h.min,a=h.max}}return{extent:[r,a],fixMin:i.minFixed,fixMax:i.maxFixed}}function n_(t,e){var n=e_(t,e),i=n.extent,r=e.get("splitNumber");t instanceof jm&&(t.base=e.get("logBase"));var a=t.type;t.setExtent(i[0],i[1]),t.niceExtent({splitNumber:r,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:"interval"===a||"time"===a?e.get("minInterval"):null,maxInterval:"interval"===a||"time"===a?e.get("maxInterval"):null});var o=e.get("interval");null!=o&&t.setInterval&&t.setInterval(o)}function i_(t,e){if(e=e||t.get("type"))switch(e){case"category":return new _m({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new Om({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(um.getClass(e)||bm)}}function r_(t){var e,n,i=t.getLabelModel().get("formatter"),r="category"===t.type?t.scale.getExtent()[0]:null;return"time"===t.scale.type?(n=i,function(e,i){return t.scale.getFormattedLabel(e,i,n)}):"string"==typeof i?function(e){return function(n){var i=t.scale.getLabel(n);return e.replace("{value}",null!=i?i:"")}}(i):"function"==typeof i?(e=i,function(n,i){return null!=r&&(i=n.value-r),e(function(t,e){return"category"===t.type?t.scale.getLabel(e):e.value}(t,n),i,null!=n.level?{level:n.level}:null)}):function(e){return t.scale.getLabel(e)}}function a_(t,e){var n=e*Math.PI/180,i=t.width,r=t.height,a=i*Math.abs(Math.cos(n))+Math.abs(r*Math.sin(n)),o=i*Math.abs(Math.sin(n))+Math.abs(r*Math.cos(n));return new ni(t.x,t.y,a,o)}function o_(t){var e=t.get("interval");return null==e?"auto":e}function s_(t){return"category"===t.type&&0===o_(t.getLabelModel())}var l_=function(){function t(){}return t.prototype.getNeedCrossZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}();var u_={isDimensionStacked:om,enableDataStack:am,getStackedDimension:sm};var h_=Object.freeze({__proto__:null,createList:function(t){return lm(t.getSource(),t)},getLayoutRect:Vh,dataStack:u_,createScale:function(t,e){var n=e;e instanceof Hu||(n=new Hu(e));var i=i_(n);return i.setExtent(t[0],t[1]),n_(i,n),i},mixinAxisModelCommonMethods:function(t){I(t,l_)},getECData:Ko,createTextStyle:function(t,e){return Su(t,null,null,"normal"!==(e=e||{}).state)},createDimensions:em,createSymbol:Vd,enableHoverEmphasis:Es}),c_=Object.freeze({__proto__:null,linearMap:Oi,round:Ni,asc:function(t){return t.sort((function(t,e){return t-e})),t},getPrecision:Ei,getPrecisionSafe:zi,getPixelPrecision:Bi,getPercentWithPrecision:Fi,MAX_SAFE_INTEGER:9007199254740991,remRadian:Hi,isRadianAroundZero:Gi,parseDate:Ui,quantity:Xi,quantityExponent:Yi,nice:qi,quantile:function(t,e){var n=(t.length-1)*e+1,i=Math.floor(n),r=+t[i-1],a=n-i;return a?r+a*(t[i]-r):r},reformIntervals:function(t){t.sort((function(t,e){return s(t,e,0)?-1:1}));for(var e=-1/0,n=1,i=0;i=n&&a>=r)return{x:n,y:r,width:i-n,height:a-r}},registerShape:ru,getShapeClass:function(t){if(nu.hasOwnProperty(t))return nu[t]},Group:Mi,Image:Ro,Text:Go,Circle:ll,Ellipse:hl,Sector:Tl,Ring:kl,Polygon:Ll,Polyline:Ol,Rect:Fo,Line:El,BezierCurve:Vl,Arc:Gl,IncrementalDisplayable:Ql,CompoundPath:Wl,LinearGradient:Xl,RadialGradient:Yl,BoundingRect:ni}),d_=Object.freeze({__proto__:null,addCommas:kh,toCamelCase:function(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()})),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t},normalizeCssArray:Dh,encodeHTML:Lh,formatTpl:Rh,getTooltipMarker:function(t,e){var n=V(t)?{color:t,extraCssText:e}:t||{},i=n.color,r=n.type;e=n.extraCssText;var a=n.renderMode||"html";return i?"html"===a?"subItem"===r?'':'':{renderMode:a,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===r?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""},formatTime:function(t,e,n){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var i=Ui(e),r=n?"UTC":"",a=i["get"+r+"FullYear"](),o=i["get"+r+"Month"]()+1,s=i["get"+r+"Date"](),l=i["get"+r+"Hours"](),u=i["get"+r+"Minutes"](),h=i["get"+r+"Seconds"](),c=i["get"+r+"Milliseconds"]();return t=t.replace("MM",sh(o,2)).replace("M",o).replace("yyyy",a).replace("yy",a%100+"").replace("dd",sh(s,2)).replace("d",s).replace("hh",sh(l,2)).replace("h",l).replace("mm",sh(u,2)).replace("m",u).replace("ss",sh(h,2)).replace("s",h).replace("SSS",sh(c,3))},capitalFirst:function(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t},truncateText:Fr,getTextRect:function(t,e,n,i,r,a,o,s){return Ji(),new Go({style:{text:t,font:e,align:n,verticalAlign:i,padding:r,rich:a,overflow:o?"truncate":null,lineHeight:s}}).getBoundingRect()}}),g_=Object.freeze({__proto__:null,map:P,each:L,indexOf:k,inherits:D,reduce:O,filter:R,bind:E,curry:z,isArray:B,isString:V,isObject:W,isFunction:F,extend:M,defaults:T,clone:w,merge:S}),y_=pr();function v_(t){return"category"===t.type?function(t){var e=t.getLabelModel(),n=__(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}(t):function(t){var e=t.scale.getTicks(),n=r_(t);return{labels:P(e,(function(e,i){return{formattedLabel:n(e,i),rawLabel:t.scale.getLabel(e),tickValue:e.value}}))}}(t)}function m_(t,e){return"category"===t.type?function(t,e){var n,i,r=x_(t,"ticks"),a=o_(e),o=b_(r,a);if(o)return o;e.get("show")&&!t.scale.isBlank()||(n=[]);if(F(a))n=M_(t,a,!0);else if("auto"===a){var s=__(t,t.getLabelModel());i=s.labelCategoryInterval,n=P(s.labels,(function(t){return t.tickValue}))}else n=S_(t,i=a,!0);return w_(r,a,{ticks:n,tickCategoryInterval:i})}(t,e):{ticks:P(t.scale.getTicks(),(function(t){return t.value}))}}function __(t,e){var n,i,r=x_(t,"labels"),a=o_(e),o=b_(r,a);return o||(F(a)?n=M_(t,a):(i="auto"===a?function(t){var e=y_(t).autoInterval;return null!=e?e:y_(t).autoInterval=t.calculateCategoryInterval()}(t):a,n=S_(t,i)),w_(r,a,{labels:n,labelCategoryInterval:i}))}function x_(t,e){return y_(t)[e]||(y_(t)[e]=[])}function b_(t,e){for(var n=0;n1&&h/l>2&&(u=Math.round(Math.ceil(u/l)*l));var c=s_(t),p=o.get("showMinLabel")||c,f=o.get("showMaxLabel")||c;p&&u!==a[0]&&g(a[0]);for(var d=u;d<=a[1];d+=l)g(d);function g(t){var e={value:t};s.push(n?t:{formattedLabel:i(e),rawLabel:r.getLabel(e),tickValue:t})}return f&&d-l!==a[1]&&g(a[1]),s}function M_(t,e,n){var i=t.scale,r=r_(t),a=[];return L(i.getTicks(),(function(t){var o=i.getLabel(t),s=t.value;e(t.value,o)&&a.push(n?s:{formattedLabel:r(t),rawLabel:o,tickValue:s})})),a}var T_=[0,1],C_=function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return t>=n&&t<=i},t.prototype.containData=function(t){return this.scale.contain(t)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return Bi(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},t.prototype.dataToCoord=function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(t),this.onBand&&"ordinal"===i.type&&k_(n=n.slice(),i.count()),Oi(t,T_,n,e)},t.prototype.coordToData=function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&k_(n=n.slice(),i.count());var r=Oi(t,n,T_,e);return this.scale.scale(r)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){var e=(t=t||{}).tickModel||this.getTickModel(),n=P(m_(this,e).ticks,(function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}}),this);return function(t,e,n,i){var r=e.length;if(!t.onBand||n||!r)return;var a,o,s=t.getExtent();if(1===r)e[0].coord=s[0],a=e[1]={coord:s[0]};else{var l=e[r-1].tickValue-e[0].tickValue,u=(e[r-1].coord-e[0].coord)/l;L(e,(function(t){t.coord-=u/2})),o=1+t.scale.getExtent()[1]-e[r-1].tickValue,a={coord:e[r-1].coord+u*o},e.push(a)}var h=s[0]>s[1];c(e[0].coord,s[0])&&(i?e[0].coord=s[0]:e.shift());i&&c(s[0],e[0].coord)&&e.unshift({coord:s[0]});c(s[1],a.coord)&&(i?a.coord=s[1]:e.pop());i&&c(a.coord,s[1])&&e.push({coord:s[1]});function c(t,e){return t=Ni(t),e=Ni(e),h?t>e:t0&&t<100||(t=5),P(this.scale.getMinorTicks(t),(function(t){return P(t,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this)}),this)},t.prototype.getViewLabels=function(){return v_(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},t.prototype.calculateCategoryInterval=function(){return function(t){var e=function(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}(t),n=r_(t),i=(e.axisRotate-e.labelRotate)/180*Math.PI,r=t.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=t.dataToCoord(l+1)-t.dataToCoord(l),h=Math.abs(u*Math.cos(i)),c=Math.abs(u*Math.sin(i)),p=0,f=0;l<=a[1];l+=s){var d,g,y=li(n({value:l}),e.font,"center","top");d=1.3*y.width,g=1.3*y.height,p=Math.max(p,d,7),f=Math.max(f,g,7)}var v=p/h,m=f/c;isNaN(v)&&(v=1/0),isNaN(m)&&(m=1/0);var _=Math.max(0,Math.floor(Math.min(v,m))),x=y_(t.model),b=t.getExtent(),w=x.lastAutoInterval,S=x.lastTickCount;return null!=w&&null!=S&&Math.abs(w-_)<=1&&Math.abs(S-o)<=1&&w>_&&x.axisExtent0===b[0]&&x.axisExtent1===b[1]?_=w:(x.lastTickCount=o,x.lastAutoInterval=_,x.axisExtent0=b[0],x.axisExtent1=b[1]),_}(this)},t}();function k_(t,e){var n=(t[1]-t[0])/e/2;t[0]+=n,t[1]-=n}function D_(){return!1}function I_(t,e,n){var i=C(),r=e.getWidth(),a=e.getHeight(),o=i.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=r+"px",o.height=a+"px",i.setAttribute("data-zr-dom-id",t)),i.width=r*n,i.height=a*n,i}var A_=function(t){function e(e,n,i){var r,a=t.call(this)||this;a.motionBlur=!1,a.lastFrameAlpha=.7,a.dpr=1,a.virtual=!1,a.config={},a.incremental=!1,a.zlevel=0,a.maxRepaintRectCount=5,a.__dirty=!0,a.__firstTimePaint=!0,a.__used=!1,a.__drawIndex=0,a.__startIndex=0,a.__endIndex=0,a.__prevStartIndex=null,a.__prevEndIndex=null,i=i||Tn,"string"==typeof e?r=I_(e,n,i):W(e)&&(e=(r=e).id),a.id=e,a.dom=r;var o=r.style;return o&&(r.onselectstart=D_,o.webkitUserSelect="none",o.userSelect="none",o.webkitTapHighlightColor="rgba(0,0,0,0)",o["-webkit-touch-callout"]="none",o.padding="0",o.margin="0",o.borderWidth="0"),a.domBack=null,a.ctxBack=null,a.painter=n,a.config=null,a.dpr=i,a}return n(e,t),e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var t=this.dpr;this.domBack=I_("back-"+this.id,this.painter,t),this.ctxBack=this.domBack.getContext("2d"),1!==t&&this.ctxBack.scale(t,t)},e.prototype.createRepaintRects=function(t,e,n,i){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var r,a=[],o=this.maxRepaintRectCount,s=!1,l=new ni(0,0,0,0);function u(t){if(t.isFinite()&&!t.isZero())if(0===a.length){(e=new ni(0,0,0,0)).copy(t),a.push(e)}else{for(var e,n=!1,i=1/0,r=0,u=0;u=o)}}for(var h=this.__startIndex;h15)break}n.prevElClipPaths&&u.restore()};if(p)if(0===p.length)s=l.__endIndex;else for(var x=f.dpr,b=0;b0&&t>i[0]){for(s=0;st);s++);o=n[i[s]]}if(i.splice(s+1,0,t),n[t]=e,!e.virtual)if(o){var l=o.dom;l.nextSibling?a.insertBefore(e.dom,l.nextSibling):a.appendChild(e.dom)}else a.firstChild?a.insertBefore(e.dom,a.firstChild):a.appendChild(e.dom);e.__painter=this}else b("Layer of zlevel "+t+" is not valid")},t.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i0?O_:0),this._needsManuallyCompositing),u.__builtin__||b("ZLevel "+l+" has been used by unkown layer "+u.id),u!==a&&(u.__used=!0,u.__startIndex!==r&&(u.__dirty=!0),u.__startIndex=r,u.incremental?u.__drawIndex=-1:u.__drawIndex=r,e(r),a=u),1&s.__dirty&&!s.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=r))}e(r),this.eachBuiltinLayer((function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)}))},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,L(this._layers,(function(t){t.setUnpainted()}))},t.prototype.configLayer=function(t,e){if(e){var n=this._layerConfig;n[t]?S(n[t],e,!0):n[t]=e;for(var i=0;i-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),e},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={zlevel:0,z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0,lineStyle:{width:"bolder"}},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},e}(qp);function z_(t,e){var n=t.mapDimensionsAll("defaultedLabel"),i=n.length;if(1===i){var r=Mp(t,e,n[0]);return null!=r?r+"":null}if(i){for(var a=[],o=0;o0?n=i[0]:i[1]<0&&(n=i[1]);return n}(r,n),o=i.dim,s=r.dim,l=e.mapDimension(s),u=e.mapDimension(o),h="x"===s||"radius"===s?1:0,c=P(t.dimensions,(function(t){return e.mapDimension(t)})),p=!1,f=e.getCalculationInfo("stackResultDimension");return om(e,c[0])&&(p=!0,c[0]=f),om(e,c[1])&&(p=!0,c[1]=f),{dataDimsForPoint:c,valueStart:a,valueAxisDim:s,baseAxisDim:o,stacked:!!p,valueDim:l,baseDim:u,baseDataOffset:h,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function Y_(t,e,n,i){var r=NaN;t.stacked&&(r=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(r)&&(r=t.valueStart);var a=t.baseDataOffset,o=[];return o[a]=n.get(t.baseDim,i),o[1-a]=r,e.dataToPoint(o)}var q_="undefined"!=typeof Float32Array,j_=q_?Float32Array:Array;function Z_(t){return B(t)?q_?new Float32Array(t):t:new j_(t)}var K_=Math.min,$_=Math.max;function J_(t,e){return isNaN(t)||isNaN(e)}function Q_(t,e,n,i,r,a,o,s,l){for(var u,h,c,p,f,d,g=n,y=0;y=r||g<0)break;if(J_(v,m)){if(l){g+=a;continue}break}if(g===n)t[a>0?"moveTo":"lineTo"](v,m),c=v,p=m;else{var _=v-u,x=m-h;if(_*_+x*x<.5){g+=a;continue}if(o>0){var b=g+a,w=e[2*b],S=e[2*b+1],M=y+1;if(l)for(;J_(w,S)&&M=i||J_(w,S))f=v,d=m;else{C=w-u,k=S-h;var A=v-u,L=w-v,P=m-h,O=S-m,R=void 0,N=void 0;"x"===s?(R=Math.abs(A),N=Math.abs(L),f=v-R*o,d=m,D=v+R*o,I=m):"y"===s?(R=Math.abs(P),N=Math.abs(O),f=v,d=m-R*o,D=v,I=m+R*o):(R=Math.sqrt(A*A+P*P),f=v-C*o*(1-(T=(N=Math.sqrt(L*L+O*O))/(N+R))),d=m-k*o*(1-T),I=m+k*o*T,D=K_(D=v+C*o*T,$_(w,v)),I=K_(I,$_(S,m)),D=$_(D,K_(w,v)),d=m-(k=(I=$_(I,K_(S,m)))-m)*R/N,f=K_(f=v-(C=D-v)*R/N,$_(u,v)),d=K_(d,$_(h,m)),D=v+(C=v-(f=$_(f,K_(u,v))))*N/R,I=m+(k=m-(d=$_(d,K_(h,m))))*N/R)}t.bezierCurveTo(c,p,f,d,v,m),c=D,p=I}else t.lineTo(v,m)}u=v,h=m,g+=a}return y}var tx=function(){this.smooth=0,this.smoothConstraint=!0},ex=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polyline",n}return n(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new tx},e.prototype.buildPath=function(t,e){var n=e.points,i=0,r=n.length/2;if(e.connectNulls){for(;r>0&&J_(n[2*r-2],n[2*r-1]);r--);for(;i=0){var y=o?(h-i)*g+i:(u-n)*g+n;return o?[t,y]:[y,t]}n=u,i=h;break;case a.C:u=r[l++],h=r[l++],c=r[l++],p=r[l++],f=r[l++],d=r[l++];var v=o?va(n,u,c,f,t,s):va(i,h,p,d,t,s);if(v>0)for(var m=0;m=0){y=o?ga(i,h,p,d,_):ga(n,u,c,f,_);return o?[t,y]:[y,t]}}n=f,i=d}}},e}(Io),nx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(tx),ix=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polygon",n}return n(e,t),e.prototype.getDefaultShape=function(){return new nx},e.prototype.buildPath=function(t,e){var n=e.points,i=e.stackedOnPoints,r=0,a=n.length/2,o=e.smoothMonotone;if(e.connectNulls){for(;a>0&&J_(n[2*a-2],n[2*a-1]);a--);for(;ri)return!1;return!0}(a,e))){var o=e.mapDimension(a.dim),s={};return L(a.getViewLabels(),(function(t){var e=a.scale.getRawOrdinalNumber(t.tickValue);s[e]=1})),function(t){return!s.hasOwnProperty(e.get(o,t))}}}}function fx(t,e){return[t[2*e],t[2*e+1]]}function dx(t,e,n,i){if(ox(e,"cartesian2d")){var r=i.getModel("endLabel"),a=r.get("show"),o=r.get("valueAnimation"),s=i.getData(),l={lastFrameIndex:0},u=a?function(n,i){t._endLabelOnDuring(n,i,s,l,o,r,e)}:null,h=e.getBaseAxis().isHorizontal(),c=rx(e,n,i,(function(){var e=t._endLabel;e&&n&&null!=l.originalX&&e.attr({x:l.originalX,y:l.originalY})}),u);if(!i.get("clip",!0)){var p=c.shape,f=Math.max(p.width,p.height);h?(p.y-=f,p.height+=2*f):(p.x-=f,p.width+=2*f)}return u&&u(1,c),c}return ax(e,n,i)}var gx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.init=function(){var t=new Mi,e=new U_;this.group.add(e.group),this._symbolDraw=e,this._lineGroup=t},e.prototype.render=function(t,e,n){var i=this,r=t.coordinateSystem,a=this.group,o=t.getData(),s=t.getModel("lineStyle"),l=t.getModel("areaStyle"),u=o.getLayout("points")||[],h="polar"===r.type,c=this._coordSys,p=this._symbolDraw,f=this._polyline,d=this._polygon,g=this._lineGroup,y=t.get("animation"),v=!l.isEmpty(),m=l.get("origin"),_=X_(r,o,m),x=v&&function(t,e,n){if(!n.valueDim)return[];for(var i=e.count(),r=Z_(2*i),a=0;a=0;a--){var o=n[a].dimension,s=t.dimensions[o],l=t.getDimensionInfo(s);if("x"===(i=l&&l.coordDim)||"y"===i){r=n[a];break}}if(r){var u=e.getAxis(i),h=P(r.stops,(function(t){return{offset:0,coord:u.toGlobalCoord(u.dataToCoord(t.value,!0)),color:t.color}})),c=h.length,p=r.outerColors.slice();c&&h[0].coord>h[c-1].coord&&(h.reverse(),p.reverse());var f=h[0].coord-10,d=h[c-1].coord+10,g=d-f;if(g<.001)return"transparent";L(h,(function(t){t.offset=(t.coord-f)/g})),h.push({offset:c?h[c-1].offset:.5,color:p[1]||"transparent"}),h.unshift({offset:c?h[0].offset:.5,color:p[0]||"transparent"});var y=new Xl(0,0,0,0,h,!0);return y[i]=f,y[i+"2"]=d,y}}}(o,r)||o.getVisual("style")[o.getVisual("drawType")];f&&c.type===r.type&&C===this._step?(v&&!d?d=this._newPolygon(u,x):d&&!v&&(g.remove(d),d=this._polygon=null),h||this._initOrUpdateEndLabel(t,r,Nh(k)),g.setClipPath(dx(this,r,!1,t)),b&&p.updateData(o,{isIgnore:w,clipShape:M,disableAnimation:!0,getSymbolPoint:function(t){return[u[2*t],u[2*t+1]]}}),sx(this._stackedOnPoints,x)&&sx(this._points,u)||(y?this._doUpdateAnimation(o,x,r,n,C,m):(C&&(u=cx(u,r,C),x&&(x=cx(x,r,C))),f.setShape({points:u}),d&&d.setShape({points:u,stackedOnPoints:x})))):(b&&p.updateData(o,{isIgnore:w,clipShape:M,disableAnimation:!0,getSymbolPoint:function(t){return[u[2*t],u[2*t+1]]}}),y&&this._initSymbolLabelAnimation(o,r,M),C&&(u=cx(u,r,C),x&&(x=cx(x,r,C))),f=this._newPolyline(u),v&&(d=this._newPolygon(u,x)),h||this._initOrUpdateEndLabel(t,r,Nh(k)),g.setClipPath(dx(this,r,!0,t)));var D=t.get(["emphasis","focus"]),I=t.get(["emphasis","blurScope"]);(f.useStyle(T(s.getLineStyle(),{fill:"none",stroke:k,lineJoin:"bevel"})),Fs(f,t,"lineStyle"),f.style.lineWidth>0&&"bolder"===t.get(["emphasis","lineStyle","width"]))&&(f.getState("emphasis").style.lineWidth=+f.style.lineWidth+1);Ko(f).seriesIndex=t.seriesIndex,Es(f,D,I);var A=hx(t.get("smooth")),O=t.get("smoothMonotone"),R=t.get("connectNulls");if(f.setShape({smooth:A,smoothMonotone:O,connectNulls:R}),d){var N=o.getCalculationInfo("stackedOnSeries"),E=0;d.useStyle(T(l.getAreaStyle(),{fill:k,opacity:.7,lineJoin:"bevel",decal:o.getVisual("style").decal})),N&&(E=hx(N.get("smooth"))),d.setShape({smooth:A,stackedOnSmooth:E,smoothMonotone:O,connectNulls:R}),Fs(d,t,"areaStyle"),Ko(d).seriesIndex=t.seriesIndex,Es(d,D,I)}var z=function(t){i._changePolyState(t)};o.eachItemGraphicEl((function(t){t&&(t.onHoverStateChange=z)})),this._polyline.onHoverStateChange=z,this._data=o,this._coordSys=r,this._stackedOnPoints=x,this._points=u,this._step=C,this._valueOrigin=m},e.prototype.dispose=function(){},e.prototype.highlight=function(t,e,n,i){var r=t.getData(),a=cr(r,i);if(this._changePolyState("emphasis"),!(a instanceof Array)&&null!=a&&a>=0){var o=r.getLayout("points"),s=r.getItemGraphicEl(a);if(!s){var l=o[2*a],u=o[2*a+1];if(isNaN(l)||isNaN(u))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;var h=t.get("zlevel"),c=t.get("z");(s=new F_(r,a)).x=l,s.y=u,s.setZ(h,c);var p=s.getSymbolPath().getTextContent();p&&(p.zlevel=h,p.z=c,p.z2=this._polyline.z2+1),s.__temp=!0,r.setItemGraphicEl(a,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else of.prototype.highlight.call(this,t,e,n,i)},e.prototype.downplay=function(t,e,n,i){var r=t.getData(),a=cr(r,i);if(this._changePolyState("normal"),null!=a&&a>=0){var o=r.getItemGraphicEl(a);o&&(o.__temp?(r.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else of.prototype.downplay.call(this,t,e,n,i)},e.prototype._changePolyState=function(t){var e=this._polygon;_s(this._polyline,t),e&&_s(e,t)},e.prototype._newPolyline=function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new ex({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(e),this._polyline=e,e},e.prototype._newPolygon=function(t,e){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new ix({shape:{points:t,stackedOnPoints:e},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},e.prototype._initSymbolLabelAnimation=function(t,e,n){var i,r,a=e.getBaseAxis(),o=a.inverse;"cartesian2d"===e.type?(i=a.isHorizontal(),r=!1):"polar"===e.type&&(i="angle"===a.dim,r=!0);var s=t.hostModel,l=s.get("animationDuration");"function"==typeof l&&(l=l(null));var u=s.get("animationDelay")||0,h="function"==typeof u?u(null):u;t.eachItemGraphicEl((function(t,a){var s=t;if(s){var c=[t.x,t.y],p=void 0,f=void 0,d=void 0;if(n)if(r){var g=n,y=e.pointToCoord(c);i?(p=g.startAngle,f=g.endAngle,d=-y[1]/180*Math.PI):(p=g.r0,f=g.r,d=y[0])}else{var v=n;i?(p=v.x,f=v.x+v.width,d=t.x):(p=v.y+v.height,f=v.y,d=t.y)}var m=f===p?0:(d-p)/(f-p);o&&(m=1-m);var _="function"==typeof u?u(a):l*m+h,x=s.getSymbolPath(),b=x.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,delay:_}),b&&b.animateFrom({style:{opacity:0}},{duration:300,delay:_}),x.disableLabelAnimation=!0}}))},e.prototype._initOrUpdateEndLabel=function(t,e,n){var i=t.getModel("endLabel");if(i.get("show")){var r=t.getData(),a=this._polyline,o=this._endLabel;o||((o=this._endLabel=new Go({z2:200})).ignoreClip=!0,a.setTextContent(this._endLabel),a.disableLabelAnimation=!0);var s=function(t){for(var e,n,i=t.length/2;i>0&&(e=t[2*i-2],n=t[2*i-1],isNaN(e)||isNaN(n));i--);return i-1}(r.getLayout("points"));s>=0&&(bu(a,wu(t,"endLabel"),{inheritColor:n,labelFetcher:t,labelDataIndex:s,defaultText:function(t,e,n){return null!=n?B_(r,n):z_(r,t)},enableTextSetter:!0},function(t,e){var n=e.getBaseAxis(),i=n.isHorizontal(),r=n.inverse,a=i?r?"right":"left":"center",o=i?"middle":r?"top":"bottom";return{normal:{align:t.get("align")||a,verticalAlign:t.get("verticalAlign")||o}}}(i,e)),a.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,e,n,i,r,a,o){var s=this._endLabel,l=this._polyline;if(s){t<1&&null==i.originalX&&(i.originalX=s.x,i.originalY=s.y);var u=n.getLayout("points"),h=n.hostModel,c=h.get("connectNulls"),p=a.get("precision"),f=a.get("distance")||0,d=o.getBaseAxis(),g=d.isHorizontal(),y=d.inverse,v=e.shape,m=y?g?v.x:v.y+v.height:g?v.x+v.width:v.y,_=(g?f:0)*(y?-1:1),x=(g?0:-f)*(y?-1:1),b=g?"x":"y",w=function(t,e,n){for(var i,r,a=t.length/2,o="x"===n?0:1,s=0,l=-1,u=0;u=e||i>=e&&r<=e){l=u;break}s=u,i=r}else i=r;return{range:[s,l],t:(e-i)/(r-i)}}(u,m,b),S=w.range,M=S[1]-S[0],T=void 0;if(M>=1){if(M>1&&!c){var C=fx(u,S[0]);s.attr({x:C[0]+_,y:C[1]+x}),r&&(T=h.getRawValue(S[0]))}else{(C=l.getPointOn(m,b))&&s.attr({x:C[0]+_,y:C[1]+x});var k=h.getRawValue(S[0]),D=h.getRawValue(S[1]);r&&(T=_r(n,p,k,D,w.t))}i.lastFrameIndex=S[0]}else{var I=1===t||i.lastFrameIndex>0?S[0]:0;C=fx(u,I);r&&(T=h.getRawValue(I)),s.attr({x:C[0]+_,y:C[1]+x})}r&&Iu(s).setLabelText(T)}},e.prototype._doUpdateAnimation=function(t,e,n,i,r,a){var o=this._polyline,s=this._polygon,l=t.hostModel,u=function(t,e,n,i,r,a,o,s){for(var l=function(t,e){var n=[];return e.diff(t).add((function(t){n.push({cmd:"+",idx:t})})).update((function(t,e){n.push({cmd:"=",idx:e,idx1:t})})).remove((function(t){n.push({cmd:"-",idx:t})})).execute(),n}(t,e),u=[],h=[],c=[],p=[],f=[],d=[],g=[],y=X_(r,e,o),v=t.getLayout("points")||[],m=e.getLayout("points")||[],_=0;_3e3||s&&ux(c,f)>3e3)return o.setShape({points:p}),void(s&&s.setShape({points:p,stackedOnPoints:f}));o.shape.__points=u.current,o.shape.points=h;var d={shape:{points:p}};u.current!==h&&(d.shape.__points=u.next),o.stopAnimation(),cu(o,d,l),s&&(s.setShape({points:h,stackedOnPoints:c}),s.stopAnimation(),cu(s,{shape:{stackedOnPoints:f}},l),o.shape.points!==s.shape.points&&(s.shape.points=o.shape.points));for(var g=[],y=u.status,v=0;ve&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;n10&&"cartesian2d"===a.type&&r){var s=a.getBaseAxis(),l=a.getOtherAxis(s),u=s.getExtent(),h=n.getDevicePixelRatio(),c=Math.abs(u[1]-u[0])*(h||1),p=Math.round(o/c);if(p>1){"lttb"===r&&t.setData(i.lttbDownSample(i.mapDimension(l.dim),1/p));var f=void 0;"string"==typeof r?f=yx[r]:"function"==typeof r&&(f=r),f&&t.setData(i.downSample(i.mapDimension(l.dim),1/p,f,vx))}}}}}var _x=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.getInitialData=function(t,e){return lm(this.getSource(),this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t){var e=this.coordinateSystem;if(e){var n=e.dataToPoint(e.clampData(t)),i=this.getData(),r=i.getLayout("offset"),a=i.getLayout("size");return n[e.getBaseAxis().isHorizontal()?0:1]+=r+a/2,n}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(qp);qp.registerClass(_x);var xx=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}var i,r;return n(e,t),e.prototype.getInitialData=function(){return lm(this.getSource(),this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),e=this.get("largeThreshold");return e>t&&(t=e),t},e.prototype.brushSelector=function(t,e,n){return n.rect(e.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=(i=_x.defaultOption,r={clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1},S(S({},i,!0),r,!0)),e}(_x),bx=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},Sx=function(t){function e(e){var n=t.call(this,e)||this;return n.type="sausage",n}return n(e,t),e.prototype.getDefaultShape=function(){return new bx},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,r=Math.max(e.r0||0,0),a=Math.max(e.r,0),o=.5*(a-r),s=r+o,l=e.startAngle,u=e.endAngle,h=e.clockwise,c=Math.cos(l),p=Math.sin(l),f=Math.cos(u),d=Math.sin(u);(h?u-l<2*Math.PI:l-u<2*Math.PI)&&(t.moveTo(c*r+n,p*r+i),t.arc(c*s+n,p*s+i,o,-Math.PI+l,l,!h)),t.arc(n,i,a,l,u,!h),t.moveTo(f*a+n,d*a+i),t.arc(f*s+n,d*s+i,o,u-2*Math.PI,u-Math.PI,!h),0!==r&&(t.arc(n,i,r,u,l,h),t.moveTo(c*r+n,d*r+i)),t.closePath()},e}(Io),Mx=[0,0],Tx=Math.max,Cx=Math.min;var kx=function(t){function e(){var n=t.call(this)||this;return n.type=e.type,n._isFirstFrame=!0,n}return n(e,t),e.prototype.render=function(t,e,n,i){this._model=t,this._removeOnRenderedListener(n),this._updateDrawMode(t);var r=t.get("coordinateSystem");("cartesian2d"===r||"polar"===r)&&(this._isLargeDraw?this._renderLarge(t,e,n):this._renderNormal(t,e,n,i))},e.prototype.incrementalPrepareRender=function(t){this._clear(),this._updateDrawMode(t),this._updateLargeClip(t)},e.prototype.incrementalRender=function(t,e){this._incrementalRenderLarge(t,e)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t,e,n,i){var r,a=this.group,o=t.getData(),s=this._data,l=t.coordinateSystem,u=l.getBaseAxis();"cartesian2d"===l.type?r=u.isHorizontal():"polar"===l.type&&(r="angle"===u.dim);var h=t.isAnimationEnabled()?t:null,c=function(t,e){var n=t.get("realtimeSort",!0),i=e.getBaseAxis();0;if(n&&"category"===i.type&&"cartesian2d"===e.type)return{baseAxis:i,otherAxis:e.getOtherAxis(i)}}(t,l);c&&this._enableRealtimeSort(c,o,n);var p=t.get("clip",!0)||c,f=function(t,e){var n=t.getArea&&t.getArea();if(ox(t,"cartesian2d")){var i=t.getBaseAxis();if("category"!==i.type||!i.onBand){var r=e.getLayout("bandWidth");i.isHorizontal()?(n.x-=r,n.width+=2*r):(n.y-=r,n.height+=2*r)}}return n}(l,o);a.removeClipPath();var d=t.get("roundCap",!0),g=t.get("showBackground",!0),y=t.getModel("backgroundStyle"),v=y.get("borderRadius")||0,m=[],_=this._backgroundEls,x=i&&i.isInitSort,b=i&&"changeAxisOrder"===i.type;function w(t){var e=Lx[l.type](o,t),n=function(t,e,n){return new("polar"===t.type?Tl:Fo)({shape:zx(e,n,t),silent:!0,z2:0})}(l,r,e);return n.useStyle(y.getItemStyle()),"cartesian2d"===l.type&&n.setShape("r",v),m[t]=n,n}o.diff(s).add((function(e){var n=o.getItemModel(e),i=Lx[l.type](o,e,n);if(g&&w(e),o.hasValue(e)){var s=!1;p&&(s=Dx[l.type](f,i));var y=Ix[l.type](t,o,e,i,r,h,u.model,!1,d);Px(y,o,e,n,i,t,r,"polar"===l.type),x?y.attr({shape:i}):c?Ax(c,h,y,i,e,r,!1,!1):pu(y,{shape:i},t,e),o.setItemGraphicEl(e,y),a.add(y),y.ignore=s}})).update((function(e,n){var i=o.getItemModel(e),S=Lx[l.type](o,e,i);if(g){var M=void 0;0===_.length?M=w(n):((M=_[n]).useStyle(y.getItemStyle()),"cartesian2d"===l.type&&M.setShape("r",v),m[e]=M);var T=Lx[l.type](o,e);cu(M,{shape:zx(r,T,l)},h,e)}var C=s.getItemGraphicEl(n);if(!o.hasValue(e))return a.remove(C),void(C=null);var k=!1;p&&(k=Dx[l.type](f,S))&&a.remove(C),C||(C=Ix[l.type](t,o,e,S,r,h,u.model,!!C,d)),b||Px(C,o,e,i,S,t,r,"polar"===l.type),x?C.attr({shape:S}):c?Ax(c,h,C,S,e,r,!0,b):cu(C,{shape:S},t,e,null),o.setItemGraphicEl(e,C),C.ignore=k,a.add(C)})).remove((function(e){var n=s.getItemGraphicEl(e);n&&gu(n,t,e)})).execute();var S=this._backgroundGroup||(this._backgroundGroup=new Mi);S.removeAll();for(var M=0;Ma)return!0;a=u}return!1},e.prototype._isOrderDifferentInView=function(t,e){for(var n=e.scale,i=n.getExtent(),r=Math.max(0,i[0]),a=Math.min(i[1],n.getOrdinalMeta().categories.length-1);r<=a;++r)if(t.ordinalNumbers[r]!==n.getRawOrdinalNumber(r))return!0},e.prototype._updateSortWithinSameData=function(t,e,n,i){if(this._isOrderChangedWithinSameData(t,e,n)){var r=this._dataSort(t,n,e);this._isOrderDifferentInView(r,n)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:r}))}},e.prototype._dispatchInitSort=function(t,e,n){var i=e.baseAxis,r=this._dataSort(t,i,(function(n){return t.get(t.mapDimension(e.otherAxis.dim),n)}));n.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:r,animation:{duration:0}})},e.prototype.remove=function(t,e){this._clear(this._model),this._removeOnRenderedListener(e)},e.prototype.dispose=function(t,e){this._removeOnRenderedListener(e)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var e=this.group,n=this._data;t&&t.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl((function(e){gu(e,t,Ko(e).dataIndex)}))):e.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(of),Dx={cartesian2d:function(t,e){var n=e.width<0?-1:1,i=e.height<0?-1:1;n<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height);var r=t.x+t.width,a=t.y+t.height,o=Tx(e.x,t.x),s=Cx(e.x+e.width,r),l=Tx(e.y,t.y),u=Cx(e.y+e.height,a),h=sr?s:o,e.y=c&&l>a?u:l,e.width=h?0:s-o,e.height=c?0:u-l,n<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height),h||c},polar:function(t,e){var n=e.r0<=e.r?1:-1;if(n<0){var i=e.r;e.r=e.r0,e.r0=i}var r=Cx(e.r,t.r),a=Tx(e.r0,t.r0);e.r=r,e.r0=a;var o=r-a<0;if(n<0){i=e.r;e.r=e.r0,e.r0=i}return o}},Ix={cartesian2d:function(t,e,n,i,r,a,o,s,l){var u=new Fo({shape:M({},i),z2:1});(u.__dataIndex=n,u.name="item",a)&&(u.shape[r?"height":"width"]=0);return u},polar:function(t,e,n,i,r,a,o,s,l){var u=i.startAngle0?1:-1,o=i.height>0?1:-1;return{x:i.x+a*r/2,y:i.y+o*r/2,width:i.width-a*r,height:i.height-o*r}},polar:function(t,e,n){var i=t.getItemLayout(e);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle}}};function Px(t,e,n,i,r,a,o,s){var l=e.getItemVisual(n,"style");s||t.setShape("r",i.get(["itemStyle","borderRadius"])||0),t.useStyle(l);var u=i.getShallow("cursor");if(u&&t.attr("cursor",u),!s){var h=o?r.height>0?"bottom":"top":r.width>0?"left":"right",c=wu(i);bu(t,c,{labelFetcher:a,labelDataIndex:n,defaultText:z_(a.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:h}),function(t,e,n,i){if(t){var r=Iu(t);r.prevValue=r.value,r.value=n;var a=e.normal;r.valueAnimation=a.get("valueAnimation"),r.valueAnimation&&(r.precision=a.get("precision"),r.defaultInterpolatedText=i,r.statesModels=e)}}(t.getTextContent(),c,a.getRawValue(n),(function(t){return B_(e,t)}))}var p=i.getModel(["emphasis"]);Es(t,p.get("focus"),p.get("blurScope")),Fs(t,i),function(t){return null!=t.startAngle&&null!=t.endAngle&&t.startAngle===t.endAngle}(r)&&(t.style.fill="none",t.style.stroke="none",L(t.states,(function(t){t.style&&(t.style.fill=t.style.stroke="none")})))}var Ox=function(){},Rx=function(t){function e(e){var n=t.call(this,e)||this;return n.type="largeBar",n}return n(e,t),e.prototype.getDefaultShape=function(){return new Ox},e.prototype.buildPath=function(t,e){for(var n=e.points,i=this.__startPoint,r=this.__baseDimIdx,a=0;a=c&&y<=p&&(l<=v?h>=l&&h<=v:h>=v&&h<=l))return o[f]}return-1}(this,t.offsetX,t.offsetY);Ko(this).dataIndex=e>=0?e:null}),30,!1);function zx(t,e,n){if(ox(n,"cartesian2d")){var i=e,r=n.getArea();return{x:t?i.x:r.x,y:t?r.y:i.y,width:t?i.width:r.width,height:t?r.height:i.height}}var a=e;return{cx:(r=n.getArea()).cx,cy:r.cy,r0:t?r.r0:a.r0,r:t?r.r:a.r,startAngle:t?a.startAngle:0,endAngle:t?a.endAngle:2*Math.PI}}var Bx=2*Math.PI,Fx=Math.PI/180;function Vx(t,e,n){e.eachSeriesByType(t,(function(t){var e=t.getData(),i=e.mapDimension("value"),r=function(t,e){return Vh(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,n),a=t.get("center"),o=t.get("radius");B(o)||(o=[0,o]),B(a)||(a=[a,a]);var s=Ri(r.width,n.getWidth()),l=Ri(r.height,n.getHeight()),u=Math.min(s,l),h=Ri(a[0],s)+r.x,c=Ri(a[1],l)+r.y,p=Ri(o[0],u/2),f=Ri(o[1],u/2),d=-t.get("startAngle")*Fx,g=t.get("minAngle")*Fx,y=0;e.each(i,(function(t){!isNaN(t)&&y++}));var v=e.getSum(i),m=Math.PI/(v||y)*2,_=t.get("clockwise"),x=t.get("roseType"),b=t.get("stillShowZeroSum"),w=e.getDataExtent(i);w[0]=0;var S=Bx,M=0,T=d,C=_?1:-1;if(e.setLayout({viewRect:r,r:f}),e.each(i,(function(t,n){var i;if(isNaN(t))e.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:_,cx:h,cy:c,r0:p,r:x?NaN:f});else{(i="area"!==x?0===v&&b?m:t*m:Bx/y)n?o:a,h=Math.abs(l.label.y-n);if(h>u.maxY){var c=l.label.x-e-l.len2*r,p=i+l.len,d=Math.abs(c)0?"right":"left":A>0?"left":"right"}var V=y.get("rotate");if(O="number"==typeof V?V*(Math.PI/180):V?A<0?-I+Math.PI:-I:0,a=!!O,p.x=T,p.y=C,p.rotation=O,p.setStyle({verticalAlign:"middle"}),R){p.setStyle({align:D});var H=p.states.select;H&&(H.x+=p.x,H.y+=p.y)}else{var G=p.getBoundingRect().clone();G.applyTransform(p.getComputedTransform());var W=(p.style.margin||0)+2.1;G.y-=W/2,G.height+=W,r.push({label:p,labelLine:d,position:v,len:S,len2:M,minTurnAngle:w.get("minTurnAngle"),maxSurfaceAngle:w.get("maxSurfaceAngle"),surfaceNormal:new qn(A,P),linePoints:k,textAlign:D,labelDistance:m,labelAlignTo:_,edgeDistance:x,bleedMargin:b,rect:G})}s.setTextConfig({inside:R})}})),!a&&t.get("avoidLabelOverlap")&&function(t,e,n,i,r,a,o,s){for(var l=[],u=[],h=Number.MAX_VALUE,c=-Number.MAX_VALUE,p=0;p0){for(var l=a.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u=n.r0}},e.type="pie",e}(of);var jx=function(){function t(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return t.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},t.prototype.containName=function(t){return this._getRawData().indexOfName(t)>=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}(),Zx=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.useColorPaletteOnData=!0,e}return n(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new jx(E(this.getData,this),E(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return function(t,e,n){e=B(e)&&{coordDimensions:e}||M({},e);var i=t.getSource(),r=em(i,e),a=new Jv(r,t);return a.initData(i,n),a}(this,{coordDimensions:["value"],encodeDefaulter:z(uc,this)})},e.prototype.getDataParams=function(e){var n=this.getData(),i=t.prototype.getDataParams.call(this,e),r=[];return n.each(n.mapDimension("value"),(function(t){r.push(t)})),i.percent=Fi(r,e,n.hostModel.get("percentPrecision")),i.$vars.push("percent"),i},e.prototype._defaultLabelLine=function(t){nr(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={zlevel:0,z:2,legendHoverLink:!0,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(qp);var Kx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Xh),$x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",yr).models[0]},e.type="cartesian2dAxis",e}(Xh);I($x,l_);var Jx={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:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},Qx=S({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},Jx),tb=S({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},Jx),eb={category:Qx,value:tb,time:S({scale:!0,splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},tb),log:T({scale:!0,logBase:10},tb)},nb={value:1,category:1,time:1,log:1};function ib(t,e,i,r){L(nb,(function(a,o){var s=S(S({},eb[o],!0),r,!0),l=function(t){function i(){for(var n=[],i=0;ie[1]&&e.reverse(),e},e.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},e.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(C_);function hb(t){return"cartesian2d"===t.get("coordinateSystem")}function cb(t){var e={xAxisModel:null,yAxisModel:null};return L(e,(function(n,i){var r=i.replace(/Model$/,""),a=t.getReferringComponents(r,yr).models[0];e[i]=a})),e}var pb=function(){function t(t,e,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=ob,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){var n=this._axesMap;this._updateScale(t,this.model),L(n.x,(function(t){n_(t.scale,t.model)})),L(n.y,(function(t){n_(t.scale,t.model)}));var i={};L(n.x,(function(t){db(n,"y",t,i)})),L(n.y,(function(t){db(n,"x",t,i)})),this.resize(this.model,e)},t.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),r=!n&&t.get("containLabel"),a=Vh(i,{width:e.getWidth(),height:e.getHeight()});this._rect=a;var o=this._axesList;function s(){L(o,(function(t){var e=t.isHorizontal(),n=e?[0,a.width]:[0,a.height],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),function(t,e){var n=t.getExtent(),i=n[0]+n[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return i-t+e}}(t,e?a.x:a.y)}))}s(),r&&(L(o,(function(t){if(!t.model.get(["axisLabel","inside"])){var e=function(t){var e=t.model,n=t.scale;if(e.get(["axisLabel","show"])&&!n.isBlank()){var i,r,a=n.getExtent();r=n instanceof _m?n.count():(i=n.getTicks()).length;var o,s=t.getLabelModel(),l=r_(t),u=1;r>40&&(u=Math.ceil(r/40));for(var h=0;h0&&i>0||n<0&&i<0)}(t)}var yb=Math.PI,vb=function(){function t(t,e){this.group=new Mi,this.opt=e,this.axisModel=t,T(e,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new Mi({x:e.position[0],y:e.position[1],rotation:e.rotation});n.updateTransform(),this._transformGroup=n}return t.prototype.hasBuilder=function(t){return!!mb[t]},t.prototype.add=function(t){mb[t](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(t,e,n){var i,r,a=Hi(e-t);return Gi(a)?(r=n>0?"top":"bottom",i="center"):Gi(a-yb)?(r=n>0?"bottom":"top",i="center"):(r="middle",i=a>0&&a0?"right":"left":n>0?"left":"right"),{rotation:a,textAlign:i,textVerticalAlign:r}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),mb={axisLine:function(t,e,n,i){var r=e.get(["axisLine","show"]);if("auto"===r&&t.handleAutoShown&&(r=t.handleAutoShown("axisLine")),r){var a=e.axis.getExtent(),o=i.transform,s=[a[0],0],l=[a[1],0];o&&(Dt(s,s,o),Dt(l,l,o));var u=M({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new El({subPixelOptimize:!0,shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:u,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});h.anid="line",n.add(h);var c=e.get(["axisLine","symbol"]),p=e.get(["axisLine","symbolSize"]),f=e.get(["axisLine","symbolOffset"])||0;if("number"==typeof f&&(f=[f,f]),null!=c){"string"==typeof c&&(c=[c,c]),"string"!=typeof p&&"number"!=typeof p||(p=[p,p]);var d=p[0],g=p[1];L([{rotate:t.rotation+Math.PI/2,offset:f[0],r:0},{rotate:t.rotation-Math.PI/2,offset:f[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(e,i){if("none"!==c[i]&&null!=c[i]){var r=Vd(c[i],-d/2,-g/2,d,g,u.stroke,!0),a=e.r+e.offset;r.attr({rotation:e.rotate,x:s[0]+a*Math.cos(t.rotation),y:s[1]-a*Math.sin(t.rotation),silent:!0,z2:11}),n.add(r)}}))}}},axisTickLabel:function(t,e,n,i){var r=function(t,e,n,i){var r=n.axis,a=n.getModel("axisTick"),o=a.get("show");"auto"===o&&i.handleAutoShown&&(o=i.handleAutoShown("axisTick"));if(!o||r.scale.isBlank())return;for(var s=a.getModel("lineStyle"),l=i.tickDirection*a.get("length"),u=wb(r.getTicksCoords(),e.transform,l,T(s.getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])}),"ticks"),h=0;hc[1]?-1:1,f=["start"===s?c[0]-p*h:"end"===s?c[1]+p*h:(c[0]+c[1])/2,bb(s)?t.labelOffset+l*h:0],d=e.get("nameRotate");null!=d&&(d=d*yb/180),bb(s)?a=vb.innerTextLayout(t.rotation,null!=d?d:t.rotation,l):(a=function(t,e,n,i){var r,a,o=Hi(n-t),s=i[0]>i[1],l="start"===e&&!s||"start"!==e&&s;Gi(o-yb/2)?(a=l?"bottom":"top",r="center"):Gi(o-1.5*yb)?(a=l?"top":"bottom",r="center"):(a="middle",r=o<1.5*yb&&o>yb/2?l?"left":"right":l?"right":"left");return{rotation:o,textAlign:r,textVerticalAlign:a}}(t.rotation,s,d||0,c),null!=(o=t.axisNameAvailableWidth)&&(o=Math.abs(o/Math.sin(a.rotation)),!isFinite(o)&&(o=null)));var g=u.getFont(),y=e.get("nameTruncate",!0)||{},v=y.ellipsis,m=$(t.nameTruncateMaxWidth,y.maxWidth,o),_=new Go({x:f[0],y:f[1],rotation:a.rotation,silent:vb.isLabelSilent(e),style:Su(u,{text:r,font:g,overflow:"truncate",width:m,ellipsis:v,fill:u.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:u.get("align")||a.textAlign,verticalAlign:u.get("verticalAlign")||a.textVerticalAlign}),z2:1});if(function(t){var e=t.itemTooltipOption,n=t.componentModel,i=t.itemName,r=V(e)?{formatter:e}:e,a=n.mainType,o=n.componentIndex,s={componentType:a,name:i,$vars:["name"]};s[a+"Index"]=o;var l=t.formatterParamsExtra;l&&L(N(l),(function(t){ht(s,t)||(s[t]=l[t],s.$vars.push(t))}));var u=Ko(t.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:i,option:T({content:i,formatterParams:s},r)}}({el:_,componentModel:e,itemName:r}),_.__fullText=r,_.anid="name",e.get("triggerEvent")){var x=vb.makeAxisEventDataBase(e);x.targetType="axisName",x.name=r,Ko(_).eventData=x}i.add(_),_.updateTransform(),n.add(_),_.decomposeTransform()}}};function _b(t){t&&(t.ignore=!0)}function xb(t,e){var n=t&&t.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(n&&i){var r=In([]);return On(r,r,-t.rotation),n.applyTransform(Ln([],r,t.getLocalTransform())),i.applyTransform(Ln([],r,e.getLocalTransform())),n.intersect(i)}}function bb(t){return"middle"===t||"center"===t}function wb(t,e,n,i,r){for(var a=[],o=[],s=[],l=0;ll[1]&&l.reverse(),(null==o||o>l[1])&&(o=l[1]),o1?a.get(["series","multiple","prefix"]):a.get(["series","single","prefix"]);s+=r(g,{seriesCount:l}),t.eachSeries((function(e,n){if(n1?a.get(["series","multiple",o]):a.get(["series","single",o]),{seriesId:e.seriesIndex,seriesName:e.get("name"),seriesType:(_=e.subType,t.getLocaleModel().get(["series","typeNames"])[_]||"自定义图")});var s=e.getData();if(s.count()>u)i+=r(a.get(["data","partialData"]),{displayCnt:u});else i+=a.get(["data","allData"]);for(var h=[],p=0;p try to evaluate the options string as JavaScript object + try { + opts = (new Function ('var opts = (' + str + '); return typeof opts === "object" ? opts : {};'))(); + } catch (eEval) { + throw new Error('Could not evaluate jscolor options: ' + eEval); + } + } + } + return opts; + }, + + + getInstances : function () { + var inst = []; + for (var i = 0; i < jsc.instances.length; i += 1) { + // if the targetElement still exists, the instance is considered "alive" + if (jsc.instances[i] && jsc.instances[i].targetElement) { + inst.push(jsc.instances[i]); + } + } + return inst; + }, + + + createEl : function (tagName) { + var el = window.document.createElement(tagName); + jsc.setData(el, 'gui', true); + return el; + }, + + + node : function (nodeOrSelector) { + if (!nodeOrSelector) { + return null; + } + + if (typeof nodeOrSelector === 'string') { + // query selector + var sel = nodeOrSelector; + var el = null; + try { + el = window.document.querySelector(sel); + } catch (e) { + console.warn(e); + return null; + } + if (!el) { + console.warn('No element matches the selector: %s', sel); + } + return el; + } + + if (jsc.isNode(nodeOrSelector)) { + // DOM node + return nodeOrSelector; + } + + console.warn('Invalid node of type %s: %s', typeof nodeOrSelector, nodeOrSelector); + return null; + }, + + + // See https://stackoverflow.com/questions/384286/ + isNode : function (val) { + if (typeof Node === 'object') { + return val instanceof Node; + } + return val && typeof val === 'object' && typeof val.nodeType === 'number' && typeof val.nodeName === 'string'; + }, + + + nodeName : function (node) { + if (node && node.nodeName) { + return node.nodeName.toLowerCase(); + } + return false; + }, + + + removeChildren : function (node) { + while (node.firstChild) { + node.removeChild(node.firstChild); + } + }, + + + isTextInput : function (el) { + return el && jsc.nodeName(el) === 'input' && el.type.toLowerCase() === 'text'; + }, + + + isButton : function (el) { + if (!el) { + return false; + } + var n = jsc.nodeName(el); + return ( + (n === 'button') || + (n === 'input' && ['button', 'submit', 'reset'].indexOf(el.type.toLowerCase()) > -1) + ); + }, + + + isButtonEmpty : function (el) { + switch (jsc.nodeName(el)) { + case 'input': return (!el.value || el.value.trim() === ''); + case 'button': return (el.textContent.trim() === ''); + } + return null; // could not determine element's text + }, + + + // See https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md + isPassiveEventSupported : (function () { + var supported = false; + + try { + var opts = Object.defineProperty({}, 'passive', { + get: function () { supported = true; } + }); + window.addEventListener('testPassive', null, opts); + window.removeEventListener('testPassive', null, opts); + } catch (e) {} + + return supported; + })(), + + + isColorAttrSupported : (function () { + var elm = window.document.createElement('input'); + if (elm.setAttribute) { + elm.setAttribute('type', 'color'); + if (elm.type.toLowerCase() == 'color') { + return true; + } + } + return false; + })(), + + + dataProp : '_data_jscolor', + + + // usage: + // setData(obj, prop, value) + // setData(obj, {prop:value, ...}) + // + setData : function () { + var obj = arguments[0]; + + if (arguments.length === 3) { + // setting a single property + var data = obj.hasOwnProperty(jsc.dataProp) ? obj[jsc.dataProp] : (obj[jsc.dataProp] = {}); + var prop = arguments[1]; + var value = arguments[2]; + + data[prop] = value; + return true; + + } else if (arguments.length === 2 && typeof arguments[1] === 'object') { + // setting multiple properties + var data = obj.hasOwnProperty(jsc.dataProp) ? obj[jsc.dataProp] : (obj[jsc.dataProp] = {}); + var map = arguments[1]; + + for (var prop in map) { + if (map.hasOwnProperty(prop)) { + data[prop] = map[prop]; + } + } + return true; + } + + throw new Error('Invalid arguments'); + }, + + + // usage: + // removeData(obj, prop, [prop...]) + // + removeData : function () { + var obj = arguments[0]; + if (!obj.hasOwnProperty(jsc.dataProp)) { + return true; // data object does not exist + } + for (var i = 1; i < arguments.length; i += 1) { + var prop = arguments[i]; + delete obj[jsc.dataProp][prop]; + } + return true; + }, + + + getData : function (obj, prop, setDefault) { + if (!obj.hasOwnProperty(jsc.dataProp)) { + // data object does not exist + if (setDefault !== undefined) { + obj[jsc.dataProp] = {}; // create data object + } else { + return undefined; // no value to return + } + } + var data = obj[jsc.dataProp]; + + if (!data.hasOwnProperty(prop) && setDefault !== undefined) { + data[prop] = setDefault; + } + return data[prop]; + }, + + + getDataAttr : function (el, name) { + var attrName = 'data-' + name; + var attrValue = el.getAttribute(attrName); + return attrValue; + }, + + + setDataAttr : function (el, name, value) { + var attrName = 'data-' + name; + el.setAttribute(attrName, value); + }, + + + _attachedGroupEvents : {}, + + + attachGroupEvent : function (groupName, el, evnt, func) { + if (!jsc._attachedGroupEvents.hasOwnProperty(groupName)) { + jsc._attachedGroupEvents[groupName] = []; + } + jsc._attachedGroupEvents[groupName].push([el, evnt, func]); + el.addEventListener(evnt, func, false); + }, + + + detachGroupEvents : function (groupName) { + if (jsc._attachedGroupEvents.hasOwnProperty(groupName)) { + for (var i = 0; i < jsc._attachedGroupEvents[groupName].length; i += 1) { + var evt = jsc._attachedGroupEvents[groupName][i]; + evt[0].removeEventListener(evt[1], evt[2], false); + } + delete jsc._attachedGroupEvents[groupName]; + } + }, + + + preventDefault : function (e) { + if (e.preventDefault) { e.preventDefault(); } + e.returnValue = false; + }, + + + captureTarget : function (target) { + // IE + if (target.setCapture) { + jsc._capturedTarget = target; + jsc._capturedTarget.setCapture(); + } + }, + + + releaseTarget : function () { + // IE + if (jsc._capturedTarget) { + jsc._capturedTarget.releaseCapture(); + jsc._capturedTarget = null; + } + }, + + + triggerEvent : function (el, eventName, bubbles, cancelable) { + if (!el) { + return; + } + + var ev = null; + + if (typeof Event === 'function') { + ev = new Event(eventName, { + bubbles: bubbles, + cancelable: cancelable + }); + } else { + // IE + ev = window.document.createEvent('Event'); + ev.initEvent(eventName, bubbles, cancelable); + } + + if (!ev) { + return false; + } + + // so that we know that the event was triggered internally + jsc.setData(ev, 'internal', true); + + el.dispatchEvent(ev); + return true; + }, + + + triggerInputEvent : function (el, eventName, bubbles, cancelable) { + if (!el) { + return; + } + if (jsc.isTextInput(el)) { + jsc.triggerEvent(el, eventName, bubbles, cancelable); + } + }, + + + eventKey : function (ev) { + var keys = { + 9: 'Tab', + 13: 'Enter', + 27: 'Escape', + }; + if (typeof ev.code === 'string') { + return ev.code; + } else if (ev.keyCode !== undefined && keys.hasOwnProperty(ev.keyCode)) { + return keys[ev.keyCode]; + } + return null; + }, + + + strList : function (str) { + if (!str) { + return []; + } + return str.replace(/^\s+|\s+$/g, '').split(/\s+/); + }, + + + // The className parameter (str) can only contain a single class name + hasClass : function (elm, className) { + if (!className) { + return false; + } + if (elm.classList !== undefined) { + return elm.classList.contains(className); + } + // polyfill + return -1 != (' ' + elm.className.replace(/\s+/g, ' ') + ' ').indexOf(' ' + className + ' '); + }, + + + // The className parameter (str) can contain multiple class names separated by whitespace + addClass : function (elm, className) { + var classNames = jsc.strList(className); + + if (elm.classList !== undefined) { + for (var i = 0; i < classNames.length; i += 1) { + elm.classList.add(classNames[i]); + } + return; + } + // polyfill + for (var i = 0; i < classNames.length; i += 1) { + if (!jsc.hasClass(elm, classNames[i])) { + elm.className += (elm.className ? ' ' : '') + classNames[i]; + } + } + }, + + + // The className parameter (str) can contain multiple class names separated by whitespace + removeClass : function (elm, className) { + var classNames = jsc.strList(className); + + if (elm.classList !== undefined) { + for (var i = 0; i < classNames.length; i += 1) { + elm.classList.remove(classNames[i]); + } + return; + } + // polyfill + for (var i = 0; i < classNames.length; i += 1) { + var repl = new RegExp( + '^\\s*' + classNames[i] + '\\s*|' + + '\\s*' + classNames[i] + '\\s*$|' + + '\\s+' + classNames[i] + '(\\s+)', + 'g' + ); + elm.className = elm.className.replace(repl, '$1'); + } + }, + + + getCompStyle : function (elm) { + var compStyle = window.getComputedStyle ? window.getComputedStyle(elm) : elm.currentStyle; + + // Note: In Firefox, getComputedStyle returns null in a hidden iframe, + // that's why we need to check if the returned value is non-empty + if (!compStyle) { + return {}; + } + return compStyle; + }, + + + // Note: + // Setting a property to NULL reverts it to the state before it was first set + // with the 'reversible' flag enabled + // + setStyle : function (elm, styles, important, reversible) { + // using '' for standard priority (IE10 apparently doesn't like value undefined) + var priority = important ? 'important' : ''; + var origStyle = null; + + for (var prop in styles) { + if (styles.hasOwnProperty(prop)) { + var setVal = null; + + if (styles[prop] === null) { + // reverting a property value + + if (!origStyle) { + // get the original style object, but dont't try to create it if it doesn't exist + origStyle = jsc.getData(elm, 'origStyle'); + } + if (origStyle && origStyle.hasOwnProperty(prop)) { + // we have property's original value -> use it + setVal = origStyle[prop]; + } + + } else { + // setting a property value + + if (reversible) { + if (!origStyle) { + // get the original style object and if it doesn't exist, create it + origStyle = jsc.getData(elm, 'origStyle', {}); + } + if (!origStyle.hasOwnProperty(prop)) { + // original property value not yet stored -> store it + origStyle[prop] = elm.style[prop]; + } + } + setVal = styles[prop]; + } + + if (setVal !== null) { + elm.style.setProperty(prop, setVal, priority); + } + } + } + }, + + + hexColor : function (r, g, b) { + return '#' + ( + ('0' + Math.round(r).toString(16)).substr(-2) + + ('0' + Math.round(g).toString(16)).substr(-2) + + ('0' + Math.round(b).toString(16)).substr(-2) + ).toUpperCase(); + }, + + + hexaColor : function (r, g, b, a) { + return '#' + ( + ('0' + Math.round(r).toString(16)).substr(-2) + + ('0' + Math.round(g).toString(16)).substr(-2) + + ('0' + Math.round(b).toString(16)).substr(-2) + + ('0' + Math.round(a * 255).toString(16)).substr(-2) + ).toUpperCase(); + }, + + + rgbColor : function (r, g, b) { + return 'rgb(' + + Math.round(r) + ',' + + Math.round(g) + ',' + + Math.round(b) + + ')'; + }, + + + rgbaColor : function (r, g, b, a) { + return + + Math.round(r) + ',' + + Math.round(g) + ',' + + Math.round(b) + ',' + + (Math.round((a===undefined || a===null ? 1 : a) * 100) / 100); + }, + + + linearGradient : (function () { + + function getFuncName () { + var stdName = 'linear-gradient'; + var prefixes = ['', '-webkit-', '-moz-', '-o-', '-ms-']; + var helper = window.document.createElement('div'); + + for (var i = 0; i < prefixes.length; i += 1) { + var tryFunc = prefixes[i] + stdName; + var tryVal = tryFunc + '(to right, rgba(0,0,0,0), rgba(0,0,0,0))'; + + helper.style.background = tryVal; + if (helper.style.background) { // CSS background successfully set -> function name is supported + return tryFunc; + } + } + return stdName; // fallback to standard 'linear-gradient' without vendor prefix + } + + var funcName = getFuncName(); + + return function () { + return funcName + '(' + Array.prototype.join.call(arguments, ', ') + ')'; + }; + + })(), + + + setBorderRadius : function (elm, value) { + jsc.setStyle(elm, {'border-radius' : value || '0'}); + }, + + + setBoxShadow : function (elm, value) { + jsc.setStyle(elm, {'box-shadow': value || 'none'}); + }, + + + getElementPos : function (e, relativeToViewport) { + var x=0, y=0; + var rect = e.getBoundingClientRect(); + x = rect.left; + y = rect.top; + if (!relativeToViewport) { + var viewPos = jsc.getViewPos(); + x += viewPos[0]; + y += viewPos[1]; + } + return [x, y]; + }, + + + getElementSize : function (e) { + return [e.offsetWidth, e.offsetHeight]; + }, + + + // get pointer's X/Y coordinates relative to viewport + getAbsPointerPos : function (e) { + var x = 0, y = 0; + if (typeof e.changedTouches !== 'undefined' && e.changedTouches.length) { + // touch devices + x = e.changedTouches[0].clientX; + y = e.changedTouches[0].clientY; + } else if (typeof e.clientX === 'number') { + x = e.clientX; + y = e.clientY; + } + return { x: x, y: y }; + }, + + + // get pointer's X/Y coordinates relative to target element + getRelPointerPos : function (e) { + var target = e.target || e.srcElement; + var targetRect = target.getBoundingClientRect(); + + var x = 0, y = 0; + + var clientX = 0, clientY = 0; + if (typeof e.changedTouches !== 'undefined' && e.changedTouches.length) { + // touch devices + clientX = e.changedTouches[0].clientX; + clientY = e.changedTouches[0].clientY; + } else if (typeof e.clientX === 'number') { + clientX = e.clientX; + clientY = e.clientY; + } + + x = clientX - targetRect.left; + y = clientY - targetRect.top; + return { x: x, y: y }; + }, + + + getViewPos : function () { + var doc = window.document.documentElement; + return [ + (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0), + (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0) + ]; + }, + + + getViewSize : function () { + var doc = window.document.documentElement; + return [ + (window.innerWidth || doc.clientWidth), + (window.innerHeight || doc.clientHeight), + ]; + }, + + + // r: 0-255 + // g: 0-255 + // b: 0-255 + // + // returns: [ 0-360, 0-100, 0-100 ] + // + RGB_HSV : function (r, g, b) { + r /= 255; + g /= 255; + b /= 255; + var n = Math.min(Math.min(r,g),b); + var v = Math.max(Math.max(r,g),b); + var m = v - n; + if (m === 0) { return [ null, 0, 100 * v ]; } + var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m); + return [ + 60 * (h===6?0:h), + 100 * (m/v), + 100 * v + ]; + }, + + + // h: 0-360 + // s: 0-100 + // v: 0-100 + // + // returns: [ 0-255, 0-255, 0-255 ] + // + HSV_RGB : function (h, s, v) { + var u = 255 * (v / 100); + + if (h === null) { + return [ u, u, u ]; + } + + h /= 60; + s /= 100; + + var i = Math.floor(h); + var f = i%2 ? h-i : 1-(h-i); + var m = u * (1 - s); + var n = u * (1 - s * f); + switch (i) { + case 6: + case 0: return [u,n,m]; + case 1: return [n,u,m]; + case 2: return [m,u,n]; + case 3: return [m,n,u]; + case 4: return [n,m,u]; + case 5: return [u,m,n]; + } + }, + + + parseColorString : function (str) { + var ret = { + rgba: null, + format: null // 'hex' | 'hexa' | 'rgb' | 'rgba' + }; + + var m; + + if (m = str.match(/^\W*([0-9A-F]{3,8})\W*$/i)) { + // HEX notation + + if (m[1].length === 8) { + // 8-char notation (= with alpha) + ret.format = 'hexa'; + ret.rgba = [ + parseInt(m[1].substr(0,2),16), + parseInt(m[1].substr(2,2),16), + parseInt(m[1].substr(4,2),16), + parseInt(m[1].substr(6,2),16) / 255 + ]; + + } else if (m[1].length === 6) { + // 6-char notation + ret.format = 'hex'; + ret.rgba = [ + parseInt(m[1].substr(0,2),16), + parseInt(m[1].substr(2,2),16), + parseInt(m[1].substr(4,2),16), + null + ]; + + } else if (m[1].length === 3) { + // 3-char notation + ret.format = 'hex'; + ret.rgba = [ + parseInt(m[1].charAt(0) + m[1].charAt(0),16), + parseInt(m[1].charAt(1) + m[1].charAt(1),16), + parseInt(m[1].charAt(2) + m[1].charAt(2),16), + null + ]; + + } else { + return false; + } + + return ret; + } + + if (m = str.match(/^\W*rgba?\(([^)]*)\)\W*$/i)) { + // rgb(...) or rgba(...) notation + + var par = m[1].split(','); + var re = /^\s*(\d+|\d*\.\d+|\d+\.\d*)\s*$/; + var mR, mG, mB, mA; + if ( + par.length >= 3 && + (mR = par[0].match(re)) && + (mG = par[1].match(re)) && + (mB = par[2].match(re)) + ) { + ret.format = 'rgb'; + ret.rgba = [ + parseFloat(mR[1]) || 0, + parseFloat(mG[1]) || 0, + parseFloat(mB[1]) || 0, + null + ]; + + if ( + par.length >= 4 && + (mA = par[3].match(re)) + ) { + ret.format = 'rgba'; + ret.rgba[3] = parseFloat(mA[1]) || 0; + } + return ret; + } + } + + return false; + }, + + + parsePaletteValue : function (mixed) { + var vals = []; + + if (typeof mixed === 'string') { // input is a string of space separated color values + // rgb() and rgba() may contain spaces too, so let's find all color values by regex + mixed.replace(/#[0-9A-F]{3}([0-9A-F]{3})?|rgba?\(([^)]*)\)/ig, function (val) { + vals.push(val); + }); + } else if (Array.isArray(mixed)) { // input is an array of color values + vals = mixed; + } + + // convert all values into uniform color format + + var colors = []; + + for (var i = 0; i < vals.length; i++) { + var color = jsc.parseColorString(vals[i]); + if (color) { + colors.push(color); + } + } + + return colors; + }, + + + containsTranparentColor : function (colors) { + for (var i = 0; i < colors.length; i++) { + var a = colors[i].rgba[3]; + if (a !== null && a < 1.0) { + return true; + } + } + return false; + }, + + + isAlphaFormat : function (format) { + switch (format.toLowerCase()) { + case 'hexa': + case 'rgba': + return true; + } + return false; + }, + + + // Canvas scaling for retina displays + // + // adapted from https://www.html5rocks.com/en/tutorials/canvas/hidpi/ + // + scaleCanvasForHighDPR : function (canvas) { + var dpr = window.devicePixelRatio || 1; + canvas.width *= dpr; + canvas.height *= dpr; + var ctx = canvas.getContext('2d'); + ctx.scale(dpr, dpr); + }, + + + genColorPreviewCanvas : function (color, separatorPos, specWidth, scaleForHighDPR) { + + var sepW = Math.round(jsc.pub.previewSeparator.length); + var sqSize = jsc.pub.chessboardSize; + var sqColor1 = jsc.pub.chessboardColor1; + var sqColor2 = jsc.pub.chessboardColor2; + + var cWidth = specWidth ? specWidth : sqSize * 2; + var cHeight = sqSize * 2; + + var canvas = jsc.createEl('canvas'); + var ctx = canvas.getContext('2d'); + + canvas.width = cWidth; + canvas.height = cHeight; + if (scaleForHighDPR) { + jsc.scaleCanvasForHighDPR(canvas); + } + + // transparency chessboard - background + ctx.fillStyle = sqColor1; + ctx.fillRect(0, 0, cWidth, cHeight); + + // transparency chessboard - squares + ctx.fillStyle = sqColor2; + for (var x = 0; x < cWidth; x += sqSize * 2) { + ctx.fillRect(x, 0, sqSize, sqSize); + ctx.fillRect(x + sqSize, sqSize, sqSize, sqSize); + } + + if (color) { + // actual color in foreground + ctx.fillStyle = color; + ctx.fillRect(0, 0, cWidth, cHeight); + } + + var start = null; + switch (separatorPos) { + case 'left': + start = 0; + ctx.clearRect(0, 0, sepW/2, cHeight); + break; + case 'right': + start = cWidth - sepW; + ctx.clearRect(cWidth - (sepW/2), 0, sepW/2, cHeight); + break; + } + if (start !== null) { + ctx.lineWidth = 1; + for (var i = 0; i < jsc.pub.previewSeparator.length; i += 1) { + ctx.beginPath(); + ctx.strokeStyle = jsc.pub.previewSeparator[i]; + ctx.moveTo(0.5 + start + i, 0); + ctx.lineTo(0.5 + start + i, cHeight); + ctx.stroke(); + } + } + + return { + canvas: canvas, + width: cWidth, + height: cHeight, + }; + }, + + + // if position or width is not set => fill the entire element (0%-100%) + genColorPreviewGradient : function (color, position, width) { + var params = []; + + if (position && width) { + params = [ + 'to ' + {'left':'right', 'right':'left'}[position], + color + ' 0%', + color + ' ' + width + 'px', + 'rgba(0,0,0,0) ' + (width + 1) + 'px', + 'rgba(0,0,0,0) 100%', + ]; + } else { + params = [ + 'to right', + color + ' 0%', + color + ' 100%', + ]; + } + + return jsc.linearGradient.apply(this, params); + }, + + + redrawPosition : function () { + + if (!jsc.picker || !jsc.picker.owner) { + return; // picker is not shown + } + + var thisObj = jsc.picker.owner; + + var tp, vp; + + if (thisObj.fixed) { + // Fixed elements are positioned relative to viewport, + // therefore we can ignore the scroll offset + tp = jsc.getElementPos(thisObj.targetElement, true); // target pos + vp = [0, 0]; // view pos + } else { + tp = jsc.getElementPos(thisObj.targetElement); // target pos + vp = jsc.getViewPos(); // view pos + } + + var ts = jsc.getElementSize(thisObj.targetElement); // target size + var vs = jsc.getViewSize(); // view size + var pd = jsc.getPickerDims(thisObj); + var ps = [pd.borderW, pd.borderH]; // picker outer size + var a, b, c; + switch (thisObj.position.toLowerCase()) { + case 'left': a=1; b=0; c=-1; break; + case 'right':a=1; b=0; c=1; break; + case 'top': a=0; b=1; c=-1; break; + default: a=0; b=1; c=1; break; + } + var l = (ts[b]+ps[b])/2; + + // compute picker position + if (!thisObj.smartPosition) { + var pp = [ + tp[a], + tp[b]+ts[b]-l+l*c + ]; + } else { + var pp = [ + -vp[a]+tp[a]+ps[a] > vs[a] ? + (-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) : + tp[a], + -vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ? + (-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) : + (tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c) + ]; + } + + var x = pp[a]; + var y = pp[b]; + var positionValue = thisObj.fixed ? 'fixed' : 'absolute'; + var contractShadow = + (pp[0] + ps[0] > tp[0] || pp[0] < tp[0] + ts[0]) && + (pp[1] + ps[1] < tp[1] + ts[1]); + + jsc._drawPosition(thisObj, x, y, positionValue, contractShadow); + }, + + + _drawPosition : function (thisObj, x, y, positionValue, contractShadow) { + var vShadow = contractShadow ? 0 : thisObj.shadowBlur; // px + + jsc.picker.wrap.style.position = positionValue; + jsc.picker.wrap.style.left = x + 'px'; + jsc.picker.wrap.style.top = y + 'px'; + + jsc.setBoxShadow( + jsc.picker.boxS, + thisObj.shadow ? + new jsc.BoxShadow(0, vShadow, thisObj.shadowBlur, 0, thisObj.shadowColor) : + null); + }, + + + getPickerDims : function (thisObj) { + var w = 2 * thisObj.controlBorderWidth + thisObj.width; + var h = 2 * thisObj.controlBorderWidth + thisObj.height; + + var sliderSpace = 2 * thisObj.controlBorderWidth + 2 * jsc.getControlPadding(thisObj) + thisObj.sliderSize; + + if (jsc.getSliderChannel(thisObj)) { + w += sliderSpace; + } + if (thisObj.hasAlphaChannel()) { + w += sliderSpace; + } + + var pal = jsc.getPaletteDims(thisObj, w); + + if (pal.height) { + h += pal.height + thisObj.padding; + } + if (thisObj.closeButton) { + h += 2 * thisObj.controlBorderWidth + thisObj.padding + thisObj.buttonHeight; + } + + var pW = w + (2 * thisObj.padding); + var pH = h + (2 * thisObj.padding); + + return { + contentW: w, + contentH: h, + paddedW: pW, + paddedH: pH, + borderW: pW + (2 * thisObj.borderWidth), + borderH: pH + (2 * thisObj.borderWidth), + palette: pal, + }; + }, + + + getPaletteDims : function (thisObj, width) { + var cols = 0, rows = 0, cellW = 0, cellH = 0, height = 0; + var sampleCount = thisObj._palette ? thisObj._palette.length : 0; + + if (sampleCount) { + cols = thisObj.paletteCols; + rows = cols > 0 ? Math.ceil(sampleCount / cols) : 0; + + // color sample's dimensions (includes border) + cellW = Math.max(1, Math.floor((width - ((cols - 1) * thisObj.paletteSpacing)) / cols)); + cellH = thisObj.paletteHeight ? Math.min(thisObj.paletteHeight, cellW) : cellW; + } + + if (rows) { + height = + rows * cellH + + (rows - 1) * thisObj.paletteSpacing; + } + + return { + cols: cols, + rows: rows, + cellW: cellW, + cellH: cellH, + width: width, + height: height, + }; + }, + + + getControlPadding : function (thisObj) { + return Math.max( + thisObj.padding / 2, + (2 * thisObj.pointerBorderWidth + thisObj.pointerThickness) - thisObj.controlBorderWidth + ); + }, + + + getPadYChannel : function (thisObj) { + switch (thisObj.mode.charAt(1).toLowerCase()) { + case 'v': return 'v'; break; + } + return 's'; + }, + + + getSliderChannel : function (thisObj) { + if (thisObj.mode.length > 2) { + switch (thisObj.mode.charAt(2).toLowerCase()) { + case 's': return 's'; break; + case 'v': return 'v'; break; + } + } + return null; + }, + + + // calls function specified in picker's property + triggerCallback : function (thisObj, prop) { + if (!thisObj[prop]) { + return; // callback func not specified + } + var callback = null; + + if (typeof thisObj[prop] === 'string') { + // string with code + try { + callback = new Function (thisObj[prop]); + } catch (e) { + console.error(e); + } + } else { + // function + callback = thisObj[prop]; + } + + if (callback) { + callback.call(thisObj); + } + }, + + + // Triggers a color change related event(s) on all picker instances. + // It is possible to specify multiple events separated with a space. + triggerGlobal : function (eventNames) { + var inst = jsc.getInstances(); + for (var i = 0; i < inst.length; i += 1) { + inst[i].trigger(eventNames); + } + }, + + + _pointerMoveEvent : { + mouse: 'mousemove', + touch: 'touchmove' + }, + _pointerEndEvent : { + mouse: 'mouseup', + touch: 'touchend' + }, + + + _pointerOrigin : null, + _capturedTarget : null, + + + onDocumentKeyUp : function (e) { + if (['Tab', 'Escape'].indexOf(jsc.eventKey(e)) !== -1) { + if (jsc.picker && jsc.picker.owner) { + jsc.picker.owner.tryHide(); + } + } + }, + + + onWindowResize : function (e) { + jsc.redrawPosition(); + }, + + + onWindowScroll : function (e) { + jsc.redrawPosition(); + }, + + + onParentScroll : function (e) { + // hide the picker when one of the parent elements is scrolled + if (jsc.picker && jsc.picker.owner) { + jsc.picker.owner.tryHide(); + } + }, + + + onDocumentMouseDown : function (e) { + var target = e.target || e.srcElement; + + if (target.jscolor && target.jscolor instanceof jsc.pub) { // clicked targetElement -> show picker + if (target.jscolor.showOnClick && !target.disabled) { + target.jscolor.show(); + } + } else if (jsc.getData(target, 'gui')) { // clicked jscolor's GUI element + var control = jsc.getData(target, 'control'); + if (control) { + // jscolor's control + jsc.onControlPointerStart(e, target, jsc.getData(target, 'control'), 'mouse'); + } + } else { + // mouse is outside the picker's controls -> hide the color picker! + if (jsc.picker && jsc.picker.owner) { + jsc.picker.owner.tryHide(); + } + } + }, + + + onPickerTouchStart : function (e) { + var target = e.target || e.srcElement; + + if (jsc.getData(target, 'control')) { + jsc.onControlPointerStart(e, target, jsc.getData(target, 'control'), 'touch'); + } + }, + + + onControlPointerStart : function (e, target, controlName, pointerType) { + var thisObj = jsc.getData(target, 'instance'); + + jsc.preventDefault(e); + jsc.captureTarget(target); + + var registerDragEvents = function (doc, offset) { + jsc.attachGroupEvent('drag', doc, jsc._pointerMoveEvent[pointerType], + jsc.onDocumentPointerMove(e, target, controlName, pointerType, offset)); + jsc.attachGroupEvent('drag', doc, jsc._pointerEndEvent[pointerType], + jsc.onDocumentPointerEnd(e, target, controlName, pointerType)); + }; + + registerDragEvents(window.document, [0, 0]); + + if (window.parent && window.frameElement) { + var rect = window.frameElement.getBoundingClientRect(); + var ofs = [-rect.left, -rect.top]; + registerDragEvents(window.parent.window.document, ofs); + } + + var abs = jsc.getAbsPointerPos(e); + var rel = jsc.getRelPointerPos(e); + jsc._pointerOrigin = { + x: abs.x - rel.x, + y: abs.y - rel.y + }; + + switch (controlName) { + case 'pad': + // if the value slider is at the bottom, move it up + if (jsc.getSliderChannel(thisObj) === 'v' && thisObj.channels.v === 0) { + thisObj.fromHSVA(null, null, 100, null); + } + jsc.setPad(thisObj, e, 0, 0); + break; + + case 'sld': + jsc.setSld(thisObj, e, 0); + break; + + case 'asld': + jsc.setASld(thisObj, e, 0); + break; + } + thisObj.trigger('input'); + }, + + + onDocumentPointerMove : function (e, target, controlName, pointerType, offset) { + return function (e) { + var thisObj = jsc.getData(target, 'instance'); + switch (controlName) { + case 'pad': + jsc.setPad(thisObj, e, offset[0], offset[1]); + break; + + case 'sld': + jsc.setSld(thisObj, e, offset[1]); + break; + + case 'asld': + jsc.setASld(thisObj, e, offset[1]); + break; + } + thisObj.trigger('input'); + } + }, + + + onDocumentPointerEnd : function (e, target, controlName, pointerType) { + return function (e) { + var thisObj = jsc.getData(target, 'instance'); + jsc.detachGroupEvents('drag'); + jsc.releaseTarget(); + + // Always trigger changes AFTER detaching outstanding mouse handlers, + // in case some color change that occured in user-defined onChange/onInput handler + // intruded into current mouse events + thisObj.trigger('input'); + thisObj.trigger('change'); + }; + }, + + + onPaletteSampleClick : function (e) { + var target = e.currentTarget; + var thisObj = jsc.getData(target, 'instance'); + var color = jsc.getData(target, 'color'); + + // when format is flexible, use the original format of this color sample + if (thisObj.format.toLowerCase() === 'any') { + thisObj._setFormat(color.format); // adapt format + if (!jsc.isAlphaFormat(thisObj.getFormat())) { + color.rgba[3] = 1.0; // when switching to a format that doesn't support alpha, set full opacity + } + } + + // if this color doesn't specify alpha, use alpha of 1.0 (if applicable) + if (color.rgba[3] === null) { + if (thisObj.paletteSetsAlpha === true || (thisObj.paletteSetsAlpha === 'auto' && thisObj._paletteHasTransparency)) { + color.rgba[3] = 1.0; + } + } + + thisObj.fromRGBA.apply(thisObj, color.rgba); + + thisObj.trigger('input'); + thisObj.trigger('change'); + + if (thisObj.hideOnPaletteClick) { + thisObj.hide(); + } + }, + + + setPad : function (thisObj, e, ofsX, ofsY) { + var pointerAbs = jsc.getAbsPointerPos(e); + var x = ofsX + pointerAbs.x - jsc._pointerOrigin.x - thisObj.padding - thisObj.controlBorderWidth; + var y = ofsY + pointerAbs.y - jsc._pointerOrigin.y - thisObj.padding - thisObj.controlBorderWidth; + + var xVal = x * (360 / (thisObj.width - 1)); + var yVal = 100 - (y * (100 / (thisObj.height - 1))); + + switch (jsc.getPadYChannel(thisObj)) { + case 's': thisObj.fromHSVA(xVal, yVal, null, null); break; + case 'v': thisObj.fromHSVA(xVal, null, yVal, null); break; + } + }, + + + setSld : function (thisObj, e, ofsY) { + var pointerAbs = jsc.getAbsPointerPos(e); + var y = ofsY + pointerAbs.y - jsc._pointerOrigin.y - thisObj.padding - thisObj.controlBorderWidth; + var yVal = 100 - (y * (100 / (thisObj.height - 1))); + + switch (jsc.getSliderChannel(thisObj)) { + case 's': thisObj.fromHSVA(null, yVal, null, null); break; + case 'v': thisObj.fromHSVA(null, null, yVal, null); break; + } + }, + + + setASld : function (thisObj, e, ofsY) { + var pointerAbs = jsc.getAbsPointerPos(e); + var y = ofsY + pointerAbs.y - jsc._pointerOrigin.y - thisObj.padding - thisObj.controlBorderWidth; + var yVal = 1.0 - (y * (1.0 / (thisObj.height - 1))); + + if (yVal < 1.0) { + // if format is flexible and the current format doesn't support alpha, switch to a suitable one + var fmt = thisObj.getFormat(); + if (thisObj.format.toLowerCase() === 'any' && !jsc.isAlphaFormat(fmt)) { + thisObj._setFormat(fmt === 'hex' ? 'hexa' : 'rgba'); + } + } + + thisObj.fromHSVA(null, null, null, yVal); + }, + + + createPadCanvas : function () { + + var ret = { + elm: null, + draw: null + }; + + var canvas = jsc.createEl('canvas'); + var ctx = canvas.getContext('2d'); + + var drawFunc = function (width, height, type) { + canvas.width = width; + canvas.height = height; + + ctx.clearRect(0, 0, canvas.width, canvas.height); + + var hGrad = ctx.createLinearGradient(0, 0, canvas.width, 0); + hGrad.addColorStop(0 / 6, '#F00'); + hGrad.addColorStop(1 / 6, '#FF0'); + hGrad.addColorStop(2 / 6, '#0F0'); + hGrad.addColorStop(3 / 6, '#0FF'); + hGrad.addColorStop(4 / 6, '#00F'); + hGrad.addColorStop(5 / 6, '#F0F'); + hGrad.addColorStop(6 / 6, '#F00'); + + ctx.fillStyle = hGrad; + ctx.fillRect(0, 0, canvas.width, canvas.height); + + var vGrad = ctx.createLinearGradient(0, 0, 0, canvas.height); + switch (type.toLowerCase()) { + case 's': + vGrad.addColorStop(0, 'rgba(255,255,255,0)'); + vGrad.addColorStop(1, 'rgba(255,255,255,1)'); + break; + case 'v': + vGrad.addColorStop(0, 'rgba(0,0,0,0)'); + vGrad.addColorStop(1, 'rgba(0,0,0,1)'); + break; + } + ctx.fillStyle = vGrad; + ctx.fillRect(0, 0, canvas.width, canvas.height); + }; + + ret.elm = canvas; + ret.draw = drawFunc; + + return ret; + }, + + + createSliderGradient : function () { + + var ret = { + elm: null, + draw: null + }; + + var canvas = jsc.createEl('canvas'); + var ctx = canvas.getContext('2d'); + + var drawFunc = function (width, height, color1, color2) { + canvas.width = width; + canvas.height = height; + + ctx.clearRect(0, 0, canvas.width, canvas.height); + + var grad = ctx.createLinearGradient(0, 0, 0, canvas.height); + grad.addColorStop(0, color1); + grad.addColorStop(1, color2); + + ctx.fillStyle = grad; + ctx.fillRect(0, 0, canvas.width, canvas.height); + }; + + ret.elm = canvas; + ret.draw = drawFunc; + + return ret; + }, + + + createASliderGradient : function () { + + var ret = { + elm: null, + draw: null + }; + + var canvas = jsc.createEl('canvas'); + var ctx = canvas.getContext('2d'); + + var drawFunc = function (width, height, color) { + canvas.width = width; + canvas.height = height; + + ctx.clearRect(0, 0, canvas.width, canvas.height); + + var sqSize = canvas.width / 2; + var sqColor1 = jsc.pub.chessboardColor1; + var sqColor2 = jsc.pub.chessboardColor2; + + // dark gray background + ctx.fillStyle = sqColor1; + ctx.fillRect(0, 0, canvas.width, canvas.height); + + if (sqSize > 0) { // to avoid infinite loop + for (var y = 0; y < canvas.height; y += sqSize * 2) { + // light gray squares + ctx.fillStyle = sqColor2; + ctx.fillRect(0, y, sqSize, sqSize); + ctx.fillRect(sqSize, y + sqSize, sqSize, sqSize); + } + } + + var grad = ctx.createLinearGradient(0, 0, 0, canvas.height); + grad.addColorStop(0, color); + grad.addColorStop(1, 'rgba(0,0,0,0)'); + + ctx.fillStyle = grad; + ctx.fillRect(0, 0, canvas.width, canvas.height); + }; + + ret.elm = canvas; + ret.draw = drawFunc; + + return ret; + }, + + + BoxShadow : (function () { + var BoxShadow = function (hShadow, vShadow, blur, spread, color, inset) { + this.hShadow = hShadow; + this.vShadow = vShadow; + this.blur = blur; + this.spread = spread; + this.color = color; + this.inset = !!inset; + }; + + BoxShadow.prototype.toString = function () { + var vals = [ + Math.round(this.hShadow) + 'px', + Math.round(this.vShadow) + 'px', + Math.round(this.blur) + 'px', + Math.round(this.spread) + 'px', + this.color + ]; + if (this.inset) { + vals.push('inset'); + } + return vals.join(' '); + }; + + return BoxShadow; + })(), + + + flags : { + leaveValue : 1 << 0, + leaveAlpha : 1 << 1, + leavePreview : 1 << 2, + }, + + + enumOpts : { + format: ['auto', 'any', 'hex', 'hexa', 'rgb', 'rgba'], + previewPosition: ['left', 'right'], + mode: ['hsv', 'hvs', 'hs', 'hv'], + position: ['left', 'right', 'top', 'bottom'], + alphaChannel: ['auto', true, false], + paletteSetsAlpha: ['auto', true, false], + }, + + + deprecatedOpts : { + // : ( can be null) + 'styleElement': 'previewElement', + 'onFineChange': 'onInput', + 'overwriteImportant': 'forceStyle', + 'closable': 'closeButton', + 'insetWidth': 'controlBorderWidth', + 'insetColor': 'controlBorderColor', + 'refine': null, + }, + + + docsRef : ' ' + 'See https://jscolor.com/docs/', + + + // + // Usage: + // var myPicker = new JSColor( [, ]) + // + // (constructor is accessible via both 'jscolor' and 'JSColor' name) + // + + pub : function (targetElement, opts) { + + var THIS = this; + + if (!opts) { + opts = {}; + } + + this.channels = { + r: 255, // red [0-255] + g: 255, // green [0-255] + b: 255, // blue [0-255] + h: 0, // hue [0-360] + s: 0, // saturation [0-100] + v: 100, // value (brightness) [0-100] + a: 1.0, // alpha (opacity) [0.0 - 1.0] + }; + + // General options + // + this.format = 'auto'; // 'auto' | 'any' | 'hex' | 'hexa' | 'rgb' | 'rgba' - Format of the input/output value + this.value = undefined; // INITIAL color value in any supported format. To change it later, use method fromString(), fromHSVA(), fromRGBA() or channel() + this.alpha = undefined; // INITIAL alpha value. To change it later, call method channel('A', ) + this.random = false; // whether to randomize the initial color. Either true | false, or an array of ranges: [minV, maxV, minS, maxS, minH, maxH, minA, maxA] + this.onChange = undefined; // called when color changes. Value can be either a function or a string with JS code. + this.onInput = undefined; // called repeatedly as the color is being changed, e.g. while dragging a slider. Value can be either a function or a string with JS code. + this.valueElement = undefined; // element that will be used to display and input the color value + this.alphaElement = undefined; // element that will be used to display and input the alpha (opacity) value + this.previewElement = undefined; // element that will preview the picked color using CSS background + this.previewPosition = 'left'; // 'left' | 'right' - position of the color preview in previewElement + this.previewSize = 32; // (px) width of the color preview displayed in previewElement + this.previewPadding = 8; // (px) space between color preview and content of the previewElement + this.required = true; // whether the associated text input must always contain a color value. If false, the input can be left empty. + this.hash = true; // whether to prefix the HEX color code with # symbol (only applicable for HEX format) + this.uppercase = true; // whether to show the HEX color code in upper case (only applicable for HEX format) + this.forceStyle = true; // whether to overwrite CSS style of the previewElement using !important flag + + // Color Picker options + // + this.width = 181; // width of the color spectrum (in px) + this.height = 101; // height of the color spectrum (in px) + this.mode = 'HSV'; // 'HSV' | 'HVS' | 'HS' | 'HV' - layout of the color picker controls + this.alphaChannel = 'auto'; // 'auto' | true | false - if alpha channel is enabled, the alpha slider will be visible. If 'auto', it will be determined according to color format + this.position = 'bottom'; // 'left' | 'right' | 'top' | 'bottom' - position relative to the target element + this.smartPosition = true; // automatically change picker position when there is not enough space for it + this.showOnClick = true; // whether to show the picker when user clicks its target element + this.hideOnLeave = true; // whether to automatically hide the picker when user leaves its target element (e.g. upon clicking the document) + this.palette = []; // colors to be displayed in the palette, specified as an array or a string of space separated color values (in any supported format) + this.paletteCols = 10; // number of columns in the palette + this.paletteSetsAlpha = 'auto'; // 'auto' | true | false - if true, palette colors that don't specify alpha will set alpha to 1.0 + this.paletteHeight = 16; // maximum height (px) of a row in the palette + this.paletteSpacing = 4; // distance (px) between color samples in the palette + this.hideOnPaletteClick = false; // when set to true, clicking the palette will also hide the color picker + this.sliderSize = 16; // px + this.crossSize = 8; // px + this.closeButton = false; // whether to display the Close button + this.closeText = 'Close'; + this.buttonColor = 'rgba(0,0,0,1)'; // CSS color + this.buttonHeight = 18; // px + this.padding = 12; // px + this.backgroundColor = 'rgba(255,255,255,1)'; // CSS color + this.borderWidth = 1; // px + this.borderColor = 'rgba(187,187,187,1)'; // CSS color + this.borderRadius = 8; // px + this.controlBorderWidth = 1; // px + this.controlBorderColor = 'rgba(187,187,187,1)'; // CSS color + this.shadow = true; // whether to display a shadow + this.shadowBlur = 15; // px + this.shadowColor = 'rgba(0,0,0,0.2)'; // CSS color + this.pointerColor = 'rgba(76,76,76,1)'; // CSS color + this.pointerBorderWidth = 1; // px + this.pointerBorderColor = 'rgba(255,255,255,1)'; // CSS color + this.pointerThickness = 2; // px + this.zIndex = 5000; + this.container = undefined; // where to append the color picker (BODY element by default) + + // Experimental + // + this.minS = 0; // min allowed saturation (0 - 100) + this.maxS = 100; // max allowed saturation (0 - 100) + this.minV = 0; // min allowed value (brightness) (0 - 100) + this.maxV = 100; // max allowed value (brightness) (0 - 100) + this.minA = 0.0; // min allowed alpha (opacity) (0.0 - 1.0) + this.maxA = 1.0; // max allowed alpha (opacity) (0.0 - 1.0) + + + // Getter: option(name) + // Setter: option(name, value) + // option({name:value, ...}) + // + this.option = function () { + if (!arguments.length) { + throw new Error('No option specified'); + } + + if (arguments.length === 1 && typeof arguments[0] === 'string') { + // getting a single option + try { + return getOption(arguments[0]); + } catch (e) { + console.warn(e); + } + return false; + + } else if (arguments.length >= 2 && typeof arguments[0] === 'string') { + // setting a single option + try { + if (!setOption(arguments[0], arguments[1])) { + return false; + } + } catch (e) { + console.warn(e); + return false; + } + this.redraw(); // immediately redraws the picker, if it's displayed + this.exposeColor(); // in case some preview-related or format-related option was changed + return true; + + } else if (arguments.length === 1 && typeof arguments[0] === 'object') { + // setting multiple options + var opts = arguments[0]; + var success = true; + for (var opt in opts) { + if (opts.hasOwnProperty(opt)) { + try { + if (!setOption(opt, opts[opt])) { + success = false; + } + } catch (e) { + console.warn(e); + success = false; + } + } + } + this.redraw(); // immediately redraws the picker, if it's displayed + this.exposeColor(); // in case some preview-related or format-related option was changed + return success; + } + + throw new Error('Invalid arguments'); + } + + + // Getter: channel(name) + // Setter: channel(name, value) + // + this.channel = function (name, value) { + if (typeof name !== 'string') { + throw new Error('Invalid value for channel name: ' + name); + } + + if (value === undefined) { + // getting channel value + if (!this.channels.hasOwnProperty(name.toLowerCase())) { + console.warn('Getting unknown channel: ' + name); + return false; + } + return this.channels[name.toLowerCase()]; + + } else { + // setting channel value + var res = false; + switch (name.toLowerCase()) { + case 'r': res = this.fromRGBA(value, null, null, null); break; + case 'g': res = this.fromRGBA(null, value, null, null); break; + case 'b': res = this.fromRGBA(null, null, value, null); break; + case 'h': res = this.fromHSVA(value, null, null, null); break; + case 's': res = this.fromHSVA(null, value, null, null); break; + case 'v': res = this.fromHSVA(null, null, value, null); break; + case 'a': res = this.fromHSVA(null, null, null, value); break; + default: + console.warn('Setting unknown channel: ' + name); + return false; + } + if (res) { + this.redraw(); // immediately redraws the picker, if it's displayed + return true; + } + } + + return false; + } + + + // Triggers given input event(s) by: + // - executing on callback specified as picker's option + // - triggering standard DOM event listeners attached to the value element + // + // It is possible to specify multiple events separated with a space. + // + this.trigger = function (eventNames) { + var evs = jsc.strList(eventNames); + for (var i = 0; i < evs.length; i += 1) { + var ev = evs[i].toLowerCase(); + + // trigger a callback + var callbackProp = null; + switch (ev) { + case 'input': callbackProp = 'onInput'; break; + case 'change': callbackProp = 'onChange'; break; + } + if (callbackProp) { + jsc.triggerCallback(this, callbackProp); + } + + // trigger standard DOM event listeners on the value element + jsc.triggerInputEvent(this.valueElement, ev, true, true); + } + }; + + + // h: 0-360 + // s: 0-100 + // v: 0-100 + // a: 0.0-1.0 + // + this.fromHSVA = function (h, s, v, a, flags) { // null = don't change + if (h === undefined) { h = null; } + if (s === undefined) { s = null; } + if (v === undefined) { v = null; } + if (a === undefined) { a = null; } + + if (h !== null) { + if (isNaN(h)) { return false; } + this.channels.h = Math.max(0, Math.min(360, h)); + } + if (s !== null) { + if (isNaN(s)) { return false; } + this.channels.s = Math.max(0, Math.min(100, this.maxS, s), this.minS); + } + if (v !== null) { + if (isNaN(v)) { return false; } + this.channels.v = Math.max(0, Math.min(100, this.maxV, v), this.minV); + } + if (a !== null) { + if (isNaN(a)) { return false; } + this.channels.a = this.hasAlphaChannel() ? + Math.max(0, Math.min(1, this.maxA, a), this.minA) : + 1.0; // if alpha channel is disabled, the color should stay 100% opaque + } + + var rgb = jsc.HSV_RGB( + this.channels.h, + this.channels.s, + this.channels.v + ); + this.channels.r = rgb[0]; + this.channels.g = rgb[1]; + this.channels.b = rgb[2]; + + this.exposeColor(flags); + return true; + }; + + + // r: 0-255 + // g: 0-255 + // b: 0-255 + // a: 0.0-1.0 + // + this.fromRGBA = function (r, g, b, a, flags) { // null = don't change + if (r === undefined) { r = null; } + if (g === undefined) { g = null; } + if (b === undefined) { b = null; } + if (a === undefined) { a = null; } + + if (r !== null) { + if (isNaN(r)) { return false; } + r = Math.max(0, Math.min(255, r)); + } + if (g !== null) { + if (isNaN(g)) { return false; } + g = Math.max(0, Math.min(255, g)); + } + if (b !== null) { + if (isNaN(b)) { return false; } + b = Math.max(0, Math.min(255, b)); + } + if (a !== null) { + if (isNaN(a)) { return false; } + this.channels.a = this.hasAlphaChannel() ? + Math.max(0, Math.min(1, this.maxA, a), this.minA) : + 1.0; // if alpha channel is disabled, the color should stay 100% opaque + } + + var hsv = jsc.RGB_HSV( + r===null ? this.channels.r : r, + g===null ? this.channels.g : g, + b===null ? this.channels.b : b + ); + if (hsv[0] !== null) { + this.channels.h = Math.max(0, Math.min(360, hsv[0])); + } + if (hsv[2] !== 0) { // fully black color stays black through entire saturation range, so let's not change saturation + this.channels.s = Math.max(0, this.minS, Math.min(100, this.maxS, hsv[1])); + } + this.channels.v = Math.max(0, this.minV, Math.min(100, this.maxV, hsv[2])); + + // update RGB according to final HSV, as some values might be trimmed + var rgb = jsc.HSV_RGB(this.channels.h, this.channels.s, this.channels.v); + this.channels.r = rgb[0]; + this.channels.g = rgb[1]; + this.channels.b = rgb[2]; + + this.exposeColor(flags); + return true; + }; + + + // DEPRECATED. Use .fromHSVA() instead + // + this.fromHSV = function (h, s, v, flags) { + console.warn('fromHSV() method is DEPRECATED. Using fromHSVA() instead.' + jsc.docsRef); + return this.fromHSVA(h, s, v, null, flags); + }; + + + // DEPRECATED. Use .fromRGBA() instead + // + this.fromRGB = function (r, g, b, flags) { + console.warn('fromRGB() method is DEPRECATED. Using fromRGBA() instead.' + jsc.docsRef); + return this.fromRGBA(r, g, b, null, flags); + }; + + + this.fromString = function (str, flags) { + if (!this.required && str.trim() === '') { + // setting empty string to an optional color input + this.setPreviewElementBg(null); + this.setValueElementValue(''); + return true; + } + + var color = jsc.parseColorString(str); + if (!color) { + return false; // could not parse + } + if (this.format.toLowerCase() === 'any') { + this._setFormat(color.format); // adapt format + if (!jsc.isAlphaFormat(this.getFormat())) { + color.rgba[3] = 1.0; // when switching to a format that doesn't support alpha, set full opacity + } + } + this.fromRGBA( + color.rgba[0], + color.rgba[1], + color.rgba[2], + color.rgba[3], + flags + ); + return true; + }; + + + this.randomize = function (minV, maxV, minS, maxS, minH, maxH, minA, maxA) { + if (minV === undefined) { minV = 0; } + if (maxV === undefined) { maxV = 100; } + if (minS === undefined) { minS = 0; } + if (maxS === undefined) { maxS = 100; } + if (minH === undefined) { minH = 0; } + if (maxH === undefined) { maxH = 359; } + if (minA === undefined) { minA = 1; } + if (maxA === undefined) { maxA = 1; } + + this.fromHSVA( + minH + Math.floor(Math.random() * (maxH - minH + 1)), + minS + Math.floor(Math.random() * (maxS - minS + 1)), + minV + Math.floor(Math.random() * (maxV - minV + 1)), + ((100 * minA) + Math.floor(Math.random() * (100 * (maxA - minA) + 1))) / 100 + ); + }; + + + this.toString = function (format) { + if (format === undefined) { + format = this.getFormat(); // format not specified -> use the current format + } + switch (format.toLowerCase()) { + case 'hex': return this.toHEXString(); break; + case 'hexa': return this.toHEXAString(); break; + case 'rgb': return this.toRGBString(); break; + case 'rgba': return this.toRGBAString(); break; + } + return false; + }; + + + this.toHEXString = function () { + return jsc.hexColor( + this.channels.r, + this.channels.g, + this.channels.b + ); + }; + + + this.toHEXAString = function () { + return jsc.hexaColor( + this.channels.r, + this.channels.g, + this.channels.b, + this.channels.a + ); + }; + + + this.toRGBString = function () { + return jsc.rgbColor( + this.channels.r, + this.channels.g, + this.channels.b + ); + }; + + + this.toRGBAString = function () { + return jsc.rgbaColor( + this.channels.r, + this.channels.g, + this.channels.b, + this.channels.a + ); + }; + + + this.toGrayscale = function () { + return ( + 0.213 * this.channels.r + + 0.715 * this.channels.g + + 0.072 * this.channels.b + ); + }; + + + this.toCanvas = function () { + return jsc.genColorPreviewCanvas(this.toRGBAString()).canvas; + }; + + + this.toDataURL = function () { + return this.toCanvas().toDataURL(); + }; + + + this.toBackground = function () { + return jsc.pub.background(this.toRGBAString()); + }; + + + this.isLight = function () { + return this.toGrayscale() > 255 / 2; + }; + + + this.hide = function () { + if (isPickerOwner()) { + detachPicker(); + } + }; + + + this.show = function () { + drawPicker(); + }; + + + this.redraw = function () { + if (isPickerOwner()) { + drawPicker(); + } + }; + + + this.getFormat = function () { + return this._currentFormat; + }; + + + this._setFormat = function (format) { + this._currentFormat = format.toLowerCase(); + }; + + + this.hasAlphaChannel = function () { + if (this.alphaChannel === 'auto') { + return ( + this.format.toLowerCase() === 'any' || // format can change on the fly (e.g. from hex to rgba), so let's consider the alpha channel enabled + jsc.isAlphaFormat(this.getFormat()) || // the current format supports alpha channel + this.alpha !== undefined || // initial alpha value is set, so we're working with alpha channel + this.alphaElement !== undefined // the alpha value is redirected, so we're working with alpha channel + ); + } + + return this.alphaChannel; // the alpha channel is explicitly set + }; + + + this.processValueInput = function (str) { + if (!this.fromString(str)) { + // could not parse the color value - let's just expose the current color + this.exposeColor(); + } + }; + + + this.processAlphaInput = function (str) { + if (!this.fromHSVA(null, null, null, parseFloat(str))) { + // could not parse the alpha value - let's just expose the current color + this.exposeColor(); + } + }; + + + this.exposeColor = function (flags) { + var colorStr = this.toString(); + var fmt = this.getFormat(); + + // reflect current color in data- attribute + jsc.setDataAttr(this.targetElement, 'current-color', colorStr); + + if (!(flags & jsc.flags.leaveValue) && this.valueElement) { + if (fmt === 'hex' || fmt === 'hexa') { + if (!this.uppercase) { colorStr = colorStr.toLowerCase(); } + if (!this.hash) { colorStr = colorStr.replace(/^#/, ''); } + } + this.setValueElementValue(colorStr); + } + + if (!(flags & jsc.flags.leaveAlpha) && this.alphaElement) { + var alphaVal = Math.round(this.channels.a * 100) / 100; + this.setAlphaElementValue(alphaVal); + } + + if (!(flags & jsc.flags.leavePreview) && this.previewElement) { + var previewPos = null; // 'left' | 'right' (null -> fill the entire element) + + if ( + jsc.isTextInput(this.previewElement) || // text input + (jsc.isButton(this.previewElement) && !jsc.isButtonEmpty(this.previewElement)) // button with text + ) { + previewPos = this.previewPosition; + } + + this.setPreviewElementBg(this.toRGBAString()); + } + + if (isPickerOwner()) { + redrawPad(); + redrawSld(); + redrawASld(); + } + }; + + + this.setPreviewElementBg = function (color) { + if (!this.previewElement) { + return; + } + + var position = null; // color preview position: null | 'left' | 'right' + var width = null; // color preview width: px | null = fill the entire element + if ( + jsc.isTextInput(this.previewElement) || // text input + (jsc.isButton(this.previewElement) && !jsc.isButtonEmpty(this.previewElement)) // button with text + ) { + position = this.previewPosition; + width = this.previewSize; + } + + var backgrounds = []; + + if (!color) { + // there is no color preview to display -> let's remove any previous background image + backgrounds.push({ + image: 'none', + position: 'left top', + size: 'auto', + repeat: 'no-repeat', + origin: 'padding-box', + }); + } else { + // CSS gradient for background color preview + backgrounds.push({ + image: jsc.genColorPreviewGradient( + color, + position, + width ? width - jsc.pub.previewSeparator.length : null + ), + position: 'left top', + size: 'auto', + repeat: position ? 'repeat-y' : 'repeat', + origin: 'padding-box', + }); + + // data URL of generated PNG image with a gray transparency chessboard + var preview = jsc.genColorPreviewCanvas( + 'rgba(0,0,0,0)', + position ? {'left':'right', 'right':'left'}[position] : null, + width, + true + ); + backgrounds.push({ + image: 'url(\'' + preview.canvas.toDataURL() + '\')', + position: (position || 'left') + ' top', + size: preview.width + 'px ' + preview.height + 'px', + repeat: position ? 'repeat-y' : 'repeat', + origin: 'padding-box', + }); + } + + var bg = { + image: [], + position: [], + size: [], + repeat: [], + origin: [], + }; + for (var i = 0; i < backgrounds.length; i += 1) { + bg.image.push(backgrounds[i].image); + bg.position.push(backgrounds[i].position); + bg.size.push(backgrounds[i].size); + bg.repeat.push(backgrounds[i].repeat); + bg.origin.push(backgrounds[i].origin); + } + + // set previewElement's background-images + var sty = { + 'background-image': bg.image.join(', '), + 'background-position': bg.position.join(', '), + 'background-size': bg.size.join(', '), + 'background-repeat': bg.repeat.join(', '), + 'background-origin': bg.origin.join(', '), + }; + jsc.setStyle(this.previewElement, sty, this.forceStyle); + + + // set/restore previewElement's padding + var padding = { + left: null, + right: null, + }; + if (position) { + padding[position] = (this.previewSize + this.previewPadding) + 'px'; + } + + var sty = { + 'padding-left': padding.left, + 'padding-right': padding.right, + }; + jsc.setStyle(this.previewElement, sty, this.forceStyle, true); + }; + + + this.setValueElementValue = function (str) { + if (this.valueElement) { + if (jsc.nodeName(this.valueElement) === 'input') { + this.valueElement.value = str; + } else { + this.valueElement.innerHTML = str; + } + } + }; + + + this.setAlphaElementValue = function (str) { + if (this.alphaElement) { + if (jsc.nodeName(this.alphaElement) === 'input') { + this.alphaElement.value = str; + } else { + this.alphaElement.innerHTML = str; + } + } + }; + + + this._processParentElementsInDOM = function () { + if (this._parentElementsProcessed) { return; } + this._parentElementsProcessed = true; + + var elm = this.targetElement; + do { + // If the target element or one of its parent nodes has fixed position, + // then use fixed positioning instead + var compStyle = jsc.getCompStyle(elm); + if (compStyle.position && compStyle.position.toLowerCase() === 'fixed') { + this.fixed = true; + } + + if (elm !== this.targetElement) { + // Ensure to attach onParentScroll only once to each parent element + // (multiple targetElements can share the same parent nodes) + // + // Note: It's not just offsetParents that can be scrollable, + // that's why we loop through all parent nodes + if (!jsc.getData(elm, 'hasScrollListener')) { + elm.addEventListener('scroll', jsc.onParentScroll, false); + jsc.setData(elm, 'hasScrollListener', true); + } + } + } while ((elm = elm.parentNode) && jsc.nodeName(elm) !== 'body'); + }; + + + this.tryHide = function () { + if (this.hideOnLeave) { + this.hide(); + } + }; + + + this.set__palette = function (val) { + this.palette = val; + this._palette = jsc.parsePaletteValue(val); + this._paletteHasTransparency = jsc.containsTranparentColor(this._palette); + }; + + + function setOption (option, value) { + if (typeof option !== 'string') { + throw new Error('Invalid value for option name: ' + option); + } + + // enum option + if (jsc.enumOpts.hasOwnProperty(option)) { + if (typeof value === 'string') { // enum string values are case insensitive + value = value.toLowerCase(); + } + if (jsc.enumOpts[option].indexOf(value) === -1) { + throw new Error('Option \'' + option + '\' has invalid value: ' + value); + } + } + + // deprecated option + if (jsc.deprecatedOpts.hasOwnProperty(option)) { + var oldOpt = option; + var newOpt = jsc.deprecatedOpts[option]; + if (newOpt) { + // if we have a new name for this option, let's log a warning and use the new name + console.warn('Option \'%s\' is DEPRECATED, using \'%s\' instead.' + jsc.docsRef, oldOpt, newOpt); + option = newOpt; + } else { + // new name not available for the option + throw new Error('Option \'' + option + '\' is DEPRECATED'); + } + } + + var setter = 'set__' + option; + + if (typeof THIS[setter] === 'function') { // a setter exists for this option + THIS[setter](value); + return true; + + } else if (option in THIS) { // option exists as a property + THIS[option] = value; + return true; + } + + throw new Error('Unrecognized configuration option: ' + option); + } + + + function getOption (option) { + if (typeof option !== 'string') { + throw new Error('Invalid value for option name: ' + option); + } + + // deprecated option + if (jsc.deprecatedOpts.hasOwnProperty(option)) { + var oldOpt = option; + var newOpt = jsc.deprecatedOpts[option]; + if (newOpt) { + // if we have a new name for this option, let's log a warning and use the new name + console.warn('Option \'%s\' is DEPRECATED, using \'%s\' instead.' + jsc.docsRef, oldOpt, newOpt); + option = newOpt; + } else { + // new name not available for the option + throw new Error('Option \'' + option + '\' is DEPRECATED'); + } + } + + var getter = 'get__' + option; + + if (typeof THIS[getter] === 'function') { // a getter exists for this option + return THIS[getter](value); + + } else if (option in THIS) { // option exists as a property + return THIS[option]; + } + + throw new Error('Unrecognized configuration option: ' + option); + } + + + function detachPicker () { + jsc.removeClass(THIS.targetElement, jsc.pub.activeClassName); + jsc.picker.wrap.parentNode.removeChild(jsc.picker.wrap); + delete jsc.picker.owner; + } + + + function drawPicker () { + + // At this point, when drawing the picker, we know what the parent elements are + // and we can do all related DOM operations, such as registering events on them + // or checking their positioning + THIS._processParentElementsInDOM(); + + if (!jsc.picker) { + jsc.picker = { + owner: null, // owner picker instance + wrap : jsc.createEl('div'), + box : jsc.createEl('div'), + boxS : jsc.createEl('div'), // shadow area + boxB : jsc.createEl('div'), // border + pad : jsc.createEl('div'), + padB : jsc.createEl('div'), // border + padM : jsc.createEl('div'), // mouse/touch area + padCanvas : jsc.createPadCanvas(), + cross : jsc.createEl('div'), + crossBY : jsc.createEl('div'), // border Y + crossBX : jsc.createEl('div'), // border X + crossLY : jsc.createEl('div'), // line Y + crossLX : jsc.createEl('div'), // line X + sld : jsc.createEl('div'), // slider + sldB : jsc.createEl('div'), // border + sldM : jsc.createEl('div'), // mouse/touch area + sldGrad : jsc.createSliderGradient(), + sldPtrS : jsc.createEl('div'), // slider pointer spacer + sldPtrIB : jsc.createEl('div'), // slider pointer inner border + sldPtrMB : jsc.createEl('div'), // slider pointer middle border + sldPtrOB : jsc.createEl('div'), // slider pointer outer border + asld : jsc.createEl('div'), // alpha slider + asldB : jsc.createEl('div'), // border + asldM : jsc.createEl('div'), // mouse/touch area + asldGrad : jsc.createASliderGradient(), + asldPtrS : jsc.createEl('div'), // slider pointer spacer + asldPtrIB : jsc.createEl('div'), // slider pointer inner border + asldPtrMB : jsc.createEl('div'), // slider pointer middle border + asldPtrOB : jsc.createEl('div'), // slider pointer outer border + pal : jsc.createEl('div'), // palette + btn : jsc.createEl('div'), + btnT : jsc.createEl('span'), // text + }; + + jsc.picker.pad.appendChild(jsc.picker.padCanvas.elm); + jsc.picker.padB.appendChild(jsc.picker.pad); + jsc.picker.cross.appendChild(jsc.picker.crossBY); + jsc.picker.cross.appendChild(jsc.picker.crossBX); + jsc.picker.cross.appendChild(jsc.picker.crossLY); + jsc.picker.cross.appendChild(jsc.picker.crossLX); + jsc.picker.padB.appendChild(jsc.picker.cross); + jsc.picker.box.appendChild(jsc.picker.padB); + jsc.picker.box.appendChild(jsc.picker.padM); + + jsc.picker.sld.appendChild(jsc.picker.sldGrad.elm); + jsc.picker.sldB.appendChild(jsc.picker.sld); + jsc.picker.sldB.appendChild(jsc.picker.sldPtrOB); + jsc.picker.sldPtrOB.appendChild(jsc.picker.sldPtrMB); + jsc.picker.sldPtrMB.appendChild(jsc.picker.sldPtrIB); + jsc.picker.sldPtrIB.appendChild(jsc.picker.sldPtrS); + jsc.picker.box.appendChild(jsc.picker.sldB); + jsc.picker.box.appendChild(jsc.picker.sldM); + + jsc.picker.asld.appendChild(jsc.picker.asldGrad.elm); + jsc.picker.asldB.appendChild(jsc.picker.asld); + jsc.picker.asldB.appendChild(jsc.picker.asldPtrOB); + jsc.picker.asldPtrOB.appendChild(jsc.picker.asldPtrMB); + jsc.picker.asldPtrMB.appendChild(jsc.picker.asldPtrIB); + jsc.picker.asldPtrIB.appendChild(jsc.picker.asldPtrS); + jsc.picker.box.appendChild(jsc.picker.asldB); + jsc.picker.box.appendChild(jsc.picker.asldM); + + jsc.picker.box.appendChild(jsc.picker.pal); + + jsc.picker.btn.appendChild(jsc.picker.btnT); + jsc.picker.box.appendChild(jsc.picker.btn); + + jsc.picker.boxB.appendChild(jsc.picker.box); + jsc.picker.wrap.appendChild(jsc.picker.boxS); + jsc.picker.wrap.appendChild(jsc.picker.boxB); + + jsc.picker.wrap.addEventListener('touchstart', jsc.onPickerTouchStart, + jsc.isPassiveEventSupported ? {passive: false} : false); + } + + var p = jsc.picker; + + var displaySlider = !!jsc.getSliderChannel(THIS); + var displayAlphaSlider = THIS.hasAlphaChannel(); + var pickerDims = jsc.getPickerDims(THIS); + var crossOuterSize = (2 * THIS.pointerBorderWidth + THIS.pointerThickness + 2 * THIS.crossSize); + var controlPadding = jsc.getControlPadding(THIS); + var borderRadius = Math.min( + THIS.borderRadius, + Math.round(THIS.padding * Math.PI)); // px + var padCursor = 'crosshair'; + + // wrap + p.wrap.className = 'jscolor-picker-wrap'; + p.wrap.style.clear = 'both'; + p.wrap.style.width = pickerDims.borderW + 'px'; + p.wrap.style.height = pickerDims.borderH + 'px'; + p.wrap.style.zIndex = THIS.zIndex; + + // picker + p.box.className = 'jscolor-picker'; + p.box.style.width = pickerDims.paddedW + 'px'; + p.box.style.height = pickerDims.paddedH + 'px'; + p.box.style.position = 'relative'; + + // picker shadow + p.boxS.className = 'jscolor-picker-shadow'; + p.boxS.style.position = 'absolute'; + p.boxS.style.left = '0'; + p.boxS.style.top = '0'; + p.boxS.style.width = '100%'; + p.boxS.style.height = '100%'; + jsc.setBorderRadius(p.boxS, borderRadius + 'px'); + + // picker border + p.boxB.className = 'jscolor-picker-border'; + p.boxB.style.position = 'relative'; + p.boxB.style.border = THIS.borderWidth + 'px solid'; + p.boxB.style.borderColor = THIS.borderColor; + p.boxB.style.background = THIS.backgroundColor; + jsc.setBorderRadius(p.boxB, borderRadius + 'px'); + + // IE hack: + // If the element is transparent, IE will trigger the event on the elements under it, + // e.g. on Canvas or on elements with border + p.padM.style.background = 'rgba(255,0,0,.2)'; + p.sldM.style.background = 'rgba(0,255,0,.2)'; + p.asldM.style.background = 'rgba(0,0,255,.2)'; + + p.padM.style.opacity = + p.sldM.style.opacity = + p.asldM.style.opacity = + '0'; + + // pad + p.pad.style.position = 'relative'; + p.pad.style.width = THIS.width + 'px'; + p.pad.style.height = THIS.height + 'px'; + + // pad - color spectrum (HSV and HVS) + p.padCanvas.draw(THIS.width, THIS.height, jsc.getPadYChannel(THIS)); + + // pad border + p.padB.style.position = 'absolute'; + p.padB.style.left = THIS.padding + 'px'; + p.padB.style.top = THIS.padding + 'px'; + p.padB.style.border = THIS.controlBorderWidth + 'px solid'; + p.padB.style.borderColor = THIS.controlBorderColor; + + // pad mouse area + p.padM.style.position = 'absolute'; + p.padM.style.left = 0 + 'px'; + p.padM.style.top = 0 + 'px'; + p.padM.style.width = (THIS.padding + 2 * THIS.controlBorderWidth + THIS.width + controlPadding) + 'px'; + p.padM.style.height = (2 * THIS.controlBorderWidth + 2 * THIS.padding + THIS.height) + 'px'; + p.padM.style.cursor = padCursor; + jsc.setData(p.padM, { + instance: THIS, + control: 'pad', + }) + + // pad cross + p.cross.style.position = 'absolute'; + p.cross.style.left = + p.cross.style.top = + '0'; + p.cross.style.width = + p.cross.style.height = + crossOuterSize + 'px'; + + // pad cross border Y and X + p.crossBY.style.position = + p.crossBX.style.position = + 'absolute'; + p.crossBY.style.background = + p.crossBX.style.background = + THIS.pointerBorderColor; + p.crossBY.style.width = + p.crossBX.style.height = + (2 * THIS.pointerBorderWidth + THIS.pointerThickness) + 'px'; + p.crossBY.style.height = + p.crossBX.style.width = + crossOuterSize + 'px'; + p.crossBY.style.left = + p.crossBX.style.top = + (Math.floor(crossOuterSize / 2) - Math.floor(THIS.pointerThickness / 2) - THIS.pointerBorderWidth) + 'px'; + p.crossBY.style.top = + p.crossBX.style.left = + '0'; + + // pad cross line Y and X + p.crossLY.style.position = + p.crossLX.style.position = + 'absolute'; + p.crossLY.style.background = + p.crossLX.style.background = + THIS.pointerColor; + p.crossLY.style.height = + p.crossLX.style.width = + (crossOuterSize - 2 * THIS.pointerBorderWidth) + 'px'; + p.crossLY.style.width = + p.crossLX.style.height = + THIS.pointerThickness + 'px'; + p.crossLY.style.left = + p.crossLX.style.top = + (Math.floor(crossOuterSize / 2) - Math.floor(THIS.pointerThickness / 2)) + 'px'; + p.crossLY.style.top = + p.crossLX.style.left = + THIS.pointerBorderWidth + 'px'; + + + // slider + p.sld.style.overflow = 'hidden'; + p.sld.style.width = THIS.sliderSize + 'px'; + p.sld.style.height = THIS.height + 'px'; + + // slider gradient + p.sldGrad.draw(THIS.sliderSize, THIS.height, '#000', '#000'); + + // slider border + p.sldB.style.display = displaySlider ? 'block' : 'none'; + p.sldB.style.position = 'absolute'; + p.sldB.style.left = (THIS.padding + THIS.width + 2 * THIS.controlBorderWidth + 2 * controlPadding) + 'px'; + p.sldB.style.top = THIS.padding + 'px'; + p.sldB.style.border = THIS.controlBorderWidth + 'px solid'; + p.sldB.style.borderColor = THIS.controlBorderColor; + + // slider mouse area + p.sldM.style.display = displaySlider ? 'block' : 'none'; + p.sldM.style.position = 'absolute'; + p.sldM.style.left = (THIS.padding + THIS.width + 2 * THIS.controlBorderWidth + controlPadding) + 'px'; + p.sldM.style.top = 0 + 'px'; + p.sldM.style.width = ( + (THIS.sliderSize + 2 * controlPadding + 2 * THIS.controlBorderWidth) + + (displayAlphaSlider ? 0 : Math.max(0, THIS.padding - controlPadding)) // remaining padding to the right edge + ) + 'px'; + p.sldM.style.height = (2 * THIS.controlBorderWidth + 2 * THIS.padding + THIS.height) + 'px'; + p.sldM.style.cursor = 'default'; + jsc.setData(p.sldM, { + instance: THIS, + control: 'sld', + }); + + // slider pointer inner and outer border + p.sldPtrIB.style.border = + p.sldPtrOB.style.border = + THIS.pointerBorderWidth + 'px solid ' + THIS.pointerBorderColor; + + // slider pointer outer border + p.sldPtrOB.style.position = 'absolute'; + p.sldPtrOB.style.left = -(2 * THIS.pointerBorderWidth + THIS.pointerThickness) + 'px'; + p.sldPtrOB.style.top = '0'; + + // slider pointer middle border + p.sldPtrMB.style.border = THIS.pointerThickness + 'px solid ' + THIS.pointerColor; + + // slider pointer spacer + p.sldPtrS.style.width = THIS.sliderSize + 'px'; + p.sldPtrS.style.height = jsc.pub.sliderInnerSpace + 'px'; + + + // alpha slider + p.asld.style.overflow = 'hidden'; + p.asld.style.width = THIS.sliderSize + 'px'; + p.asld.style.height = THIS.height + 'px'; + + // alpha slider gradient + p.asldGrad.draw(THIS.sliderSize, THIS.height, '#000'); + + // alpha slider border + p.asldB.style.display = displayAlphaSlider ? 'block' : 'none'; + p.asldB.style.position = 'absolute'; + p.asldB.style.left = ( + (THIS.padding + THIS.width + 2 * THIS.controlBorderWidth + controlPadding) + + (displaySlider ? (THIS.sliderSize + 3 * controlPadding + 2 * THIS.controlBorderWidth) : 0) + ) + 'px'; + p.asldB.style.top = THIS.padding + 'px'; + p.asldB.style.border = THIS.controlBorderWidth + 'px solid'; + p.asldB.style.borderColor = THIS.controlBorderColor; + + // alpha slider mouse area + p.asldM.style.display = displayAlphaSlider ? 'block' : 'none'; + p.asldM.style.position = 'absolute'; + p.asldM.style.left = ( + (THIS.padding + THIS.width + 2 * THIS.controlBorderWidth + controlPadding) + + (displaySlider ? (THIS.sliderSize + 2 * controlPadding + 2 * THIS.controlBorderWidth) : 0) + ) + 'px'; + p.asldM.style.top = 0 + 'px'; + p.asldM.style.width = ( + (THIS.sliderSize + 2 * controlPadding + 2 * THIS.controlBorderWidth) + + Math.max(0, THIS.padding - controlPadding) // remaining padding to the right edge + ) + 'px'; + p.asldM.style.height = (2 * THIS.controlBorderWidth + 2 * THIS.padding + THIS.height) + 'px'; + p.asldM.style.cursor = 'default'; + jsc.setData(p.asldM, { + instance: THIS, + control: 'asld', + }) + + // alpha slider pointer inner and outer border + p.asldPtrIB.style.border = + p.asldPtrOB.style.border = + THIS.pointerBorderWidth + 'px solid ' + THIS.pointerBorderColor; + + // alpha slider pointer outer border + p.asldPtrOB.style.position = 'absolute'; + p.asldPtrOB.style.left = -(2 * THIS.pointerBorderWidth + THIS.pointerThickness) + 'px'; + p.asldPtrOB.style.top = '0'; + + // alpha slider pointer middle border + p.asldPtrMB.style.border = THIS.pointerThickness + 'px solid ' + THIS.pointerColor; + + // alpha slider pointer spacer + p.asldPtrS.style.width = THIS.sliderSize + 'px'; + p.asldPtrS.style.height = jsc.pub.sliderInnerSpace + 'px'; + + + // palette + p.pal.className = 'jscolor-palette'; + p.pal.style.display = pickerDims.palette.rows ? 'block' : 'none'; + p.pal.style.position = 'absolute'; + p.pal.style.left = THIS.padding + 'px'; + p.pal.style.top = (2 * THIS.controlBorderWidth + 2 * THIS.padding + THIS.height) + 'px'; + + // palette's color samples + + p.pal.innerHTML = ''; + + var chessboard = jsc.genColorPreviewCanvas('rgba(0,0,0,0)'); + + var si = 0; // color sample's index + for (var r = 0; r < pickerDims.palette.rows; r++) { + for (var c = 0; c < pickerDims.palette.cols && si < THIS._palette.length; c++, si++) { + var sampleColor = THIS._palette[si]; + var sampleCssColor = jsc.rgbaColor.apply(null, sampleColor.rgba); + + var sc = jsc.createEl('div'); // color sample's color + sc.style.width = (pickerDims.palette.cellW - 2 * THIS.controlBorderWidth) + 'px'; + sc.style.height = (pickerDims.palette.cellH - 2 * THIS.controlBorderWidth) + 'px'; + sc.style.backgroundColor = sampleCssColor; + + var sw = jsc.createEl('div'); // color sample's wrap + sw.className = 'jscolor-palette-sample'; + sw.style.display = 'block'; + sw.style.position = 'absolute'; + sw.style.left = ( + pickerDims.palette.cols <= 1 ? 0 : + Math.round(10 * (c * ((pickerDims.contentW - pickerDims.palette.cellW) / (pickerDims.palette.cols - 1)))) / 10 + ) + 'px'; + sw.style.top = (r * (pickerDims.palette.cellH + THIS.paletteSpacing)) + 'px'; + sw.style.border = THIS.controlBorderWidth + 'px solid'; + sw.style.borderColor = THIS.controlBorderColor; + sw.style.cursor = 'pointer'; + if (sampleColor.rgba[3] !== null && sampleColor.rgba[3] < 1.0) { // only create chessboard background if the sample has transparency + sw.style.backgroundImage = 'url(\'' + chessboard.canvas.toDataURL() + '\')'; + sw.style.backgroundRepeat = 'repeat'; + sw.style.backgroundPosition = 'center center'; + } + jsc.setData(sw, { + instance: THIS, + control: 'palette-sample', + color: sampleColor, + }) + sw.addEventListener('click', jsc.onPaletteSampleClick, false); + sw.appendChild(sc); + p.pal.appendChild(sw); + } + } + + + // the Close button + function setBtnBorder () { + var insetColors = THIS.controlBorderColor.split(/\s+/); + var outsetColor = insetColors.length < 2 ? insetColors[0] : insetColors[1] + ' ' + insetColors[0] + ' ' + insetColors[0] + ' ' + insetColors[1]; + p.btn.style.borderColor = outsetColor; + } + var btnPadding = 15; // px + p.btn.className = 'jscolor-btn-close'; + p.btn.style.display = THIS.closeButton ? 'block' : 'none'; + p.btn.style.position = 'absolute'; + p.btn.style.left = THIS.padding + 'px'; + p.btn.style.bottom = THIS.padding + 'px'; + p.btn.style.padding = '0 ' + btnPadding + 'px'; + p.btn.style.maxWidth = (pickerDims.contentW - 2 * THIS.controlBorderWidth - 2 * btnPadding) + 'px'; + p.btn.style.overflow = 'hidden'; + p.btn.style.height = THIS.buttonHeight + 'px'; + p.btn.style.whiteSpace = 'nowrap'; + p.btn.style.border = THIS.controlBorderWidth + 'px solid'; + setBtnBorder(); + p.btn.style.color = THIS.buttonColor; + p.btn.style.font = '12px sans-serif'; + p.btn.style.textAlign = 'center'; + p.btn.style.cursor = 'pointer'; + p.btn.onmousedown = function () { + THIS.hide(); + }; + p.btnT.style.lineHeight = THIS.buttonHeight + 'px'; + p.btnT.innerHTML = ''; + p.btnT.appendChild(window.document.createTextNode(THIS.closeText)); + + // reposition the pointers + redrawPad(); + redrawSld(); + redrawASld(); + + // If we are changing the owner without first closing the picker, + // make sure to first deal with the old owner + if (jsc.picker.owner && jsc.picker.owner !== THIS) { + jsc.removeClass(jsc.picker.owner.targetElement, jsc.pub.activeClassName); + } + + // Set a new picker owner + jsc.picker.owner = THIS; + + // The redrawPosition() method needs picker.owner to be set, that's why we call it here, + // after setting the owner + if (THIS.container === window.document.body) { + jsc.redrawPosition(); + } else { + jsc._drawPosition(THIS, 0, 0, 'relative', false); + } + + if (p.wrap.parentNode !== THIS.container) { + THIS.container.appendChild(p.wrap); + } + + jsc.addClass(THIS.targetElement, jsc.pub.activeClassName); + } + + + function redrawPad () { + // redraw the pad pointer + var yChannel = jsc.getPadYChannel(THIS); + var x = Math.round((THIS.channels.h / 360) * (THIS.width - 1)); + var y = Math.round((1 - THIS.channels[yChannel] / 100) * (THIS.height - 1)); + var crossOuterSize = (2 * THIS.pointerBorderWidth + THIS.pointerThickness + 2 * THIS.crossSize); + var ofs = -Math.floor(crossOuterSize / 2); + jsc.picker.cross.style.left = (x + ofs) + 'px'; + jsc.picker.cross.style.top = (y + ofs) + 'px'; + + // redraw the slider + switch (jsc.getSliderChannel(THIS)) { + case 's': + var rgb1 = jsc.HSV_RGB(THIS.channels.h, 100, THIS.channels.v); + var rgb2 = jsc.HSV_RGB(THIS.channels.h, 0, THIS.channels.v); + var color1 = 'rgb(' + + Math.round(rgb1[0]) + ',' + + Math.round(rgb1[1]) + ',' + + Math.round(rgb1[2]) + ')'; + var color2 = 'rgb(' + + Math.round(rgb2[0]) + ',' + + Math.round(rgb2[1]) + ',' + + Math.round(rgb2[2]) + ')'; + jsc.picker.sldGrad.draw(THIS.sliderSize, THIS.height, color1, color2); + break; + case 'v': + var rgb = jsc.HSV_RGB(THIS.channels.h, THIS.channels.s, 100); + var color1 = 'rgb(' + + Math.round(rgb[0]) + ',' + + Math.round(rgb[1]) + ',' + + Math.round(rgb[2]) + ')'; + var color2 = '#000'; + jsc.picker.sldGrad.draw(THIS.sliderSize, THIS.height, color1, color2); + break; + } + + // redraw the alpha slider + jsc.picker.asldGrad.draw(THIS.sliderSize, THIS.height, THIS.toHEXString()); + } + + + function redrawSld () { + var sldChannel = jsc.getSliderChannel(THIS); + if (sldChannel) { + // redraw the slider pointer + var y = Math.round((1 - THIS.channels[sldChannel] / 100) * (THIS.height - 1)); + jsc.picker.sldPtrOB.style.top = (y - (2 * THIS.pointerBorderWidth + THIS.pointerThickness) - Math.floor(jsc.pub.sliderInnerSpace / 2)) + 'px'; + } + + // redraw the alpha slider + jsc.picker.asldGrad.draw(THIS.sliderSize, THIS.height, THIS.toHEXString()); + } + + + function redrawASld () { + var y = Math.round((1 - THIS.channels.a) * (THIS.height - 1)); + jsc.picker.asldPtrOB.style.top = (y - (2 * THIS.pointerBorderWidth + THIS.pointerThickness) - Math.floor(jsc.pub.sliderInnerSpace / 2)) + 'px'; + } + + + function isPickerOwner () { + return jsc.picker && jsc.picker.owner === THIS; + } + + + function onValueKeyDown (ev) { + if (jsc.eventKey(ev) === 'Enter') { + if (THIS.valueElement) { + THIS.processValueInput(THIS.valueElement.value); + } + THIS.tryHide(); + } + } + + + function onAlphaKeyDown (ev) { + if (jsc.eventKey(ev) === 'Enter') { + if (THIS.alphaElement) { + THIS.processAlphaInput(THIS.alphaElement.value); + } + THIS.tryHide(); + } + } + + + function onValueChange (ev) { + if (jsc.getData(ev, 'internal')) { + return; // skip if the event was internally triggered by jscolor + } + + var oldVal = THIS.valueElement.value; + + THIS.processValueInput(THIS.valueElement.value); // this might change the value + + jsc.triggerCallback(THIS, 'onChange'); + + if (THIS.valueElement.value !== oldVal) { + // value was additionally changed -> let's trigger the change event again, even though it was natively dispatched + jsc.triggerInputEvent(THIS.valueElement, 'change', true, true); + } + } + + + function onAlphaChange (ev) { + if (jsc.getData(ev, 'internal')) { + return; // skip if the event was internally triggered by jscolor + } + + var oldVal = THIS.alphaElement.value; + + THIS.processAlphaInput(THIS.alphaElement.value); // this might change the value + + jsc.triggerCallback(THIS, 'onChange'); + + // triggering valueElement's onChange (because changing alpha changes the entire color, e.g. with rgba format) + jsc.triggerInputEvent(THIS.valueElement, 'change', true, true); + + if (THIS.alphaElement.value !== oldVal) { + // value was additionally changed -> let's trigger the change event again, even though it was natively dispatched + jsc.triggerInputEvent(THIS.alphaElement, 'change', true, true); + } + } + + + function onValueInput (ev) { + if (jsc.getData(ev, 'internal')) { + return; // skip if the event was internally triggered by jscolor + } + + if (THIS.valueElement) { + THIS.fromString(THIS.valueElement.value, jsc.flags.leaveValue); + } + + jsc.triggerCallback(THIS, 'onInput'); + + // triggering valueElement's onInput + // (not needed, it was dispatched normally by the browser) + } + + + function onAlphaInput (ev) { + if (jsc.getData(ev, 'internal')) { + return; // skip if the event was internally triggered by jscolor + } + + if (THIS.alphaElement) { + THIS.fromHSVA(null, null, null, parseFloat(THIS.alphaElement.value), jsc.flags.leaveAlpha); + } + + jsc.triggerCallback(THIS, 'onInput'); + + // triggering valueElement's onInput (because changing alpha changes the entire color, e.g. with rgba format) + jsc.triggerInputEvent(THIS.valueElement, 'input', true, true); + } + + + // let's process the DEPRECATED 'options' property (this will be later removed) + if (jsc.pub.options) { + // let's set custom default options, if specified + for (var opt in jsc.pub.options) { + if (jsc.pub.options.hasOwnProperty(opt)) { + try { + setOption(opt, jsc.pub.options[opt]); + } catch (e) { + console.warn(e); + } + } + } + } + + + // let's apply configuration presets + // + var presetsArr = []; + + if (opts.preset) { + if (typeof opts.preset === 'string') { + presetsArr = opts.preset.split(/\s+/); + } else if (Array.isArray(opts.preset)) { + presetsArr = opts.preset.slice(); // slice() to clone + } else { + console.warn('Unrecognized preset value'); + } + } + + // always use the 'default' preset. If it's not listed, append it to the end. + if (presetsArr.indexOf('default') === -1) { + presetsArr.push('default'); + } + + // let's apply the presets in reverse order, so that should there be any overlapping options, + // the formerly listed preset will override the latter + for (var i = presetsArr.length - 1; i >= 0; i -= 1) { + var pres = presetsArr[i]; + if (!pres) { + continue; // preset is empty string + } + if (!jsc.pub.presets.hasOwnProperty(pres)) { + console.warn('Unknown preset: %s', pres); + continue; + } + for (var opt in jsc.pub.presets[pres]) { + if (jsc.pub.presets[pres].hasOwnProperty(opt)) { + try { + setOption(opt, jsc.pub.presets[pres][opt]); + } catch (e) { + console.warn(e); + } + } + } + } + + + // let's set specific options for this color picker + var nonProperties = [ + // these options won't be set as instance properties + 'preset', + ]; + for (var opt in opts) { + if (opts.hasOwnProperty(opt)) { + if (nonProperties.indexOf(opt) === -1) { + try { + setOption(opt, opts[opt]); + } catch (e) { + console.warn(e); + } + } + } + } + + + // + // Install the color picker on chosen element(s) + // + + + // Determine picker's container element + if (this.container === undefined) { + this.container = window.document.body; // default container is BODY element + + } else { // explicitly set to custom element + this.container = jsc.node(this.container); + } + + if (!this.container) { + throw new Error('Cannot instantiate color picker without a container element'); + } + + + // Fetch the target element + this.targetElement = jsc.node(targetElement); + + if (!this.targetElement) { + // temporarily customized error message to help with migrating from versions prior to 2.2 + if (typeof targetElement === 'string' && /^[a-zA-Z][\w:.-]*$/.test(targetElement)) { + // targetElement looks like valid ID + var possiblyId = targetElement; + throw new Error('If \'' + possiblyId + '\' is supposed to be an ID, please use \'#' + possiblyId + '\' or any valid CSS selector.'); + } + + throw new Error('Cannot instantiate color picker without a target element'); + } + + if (this.targetElement.jscolor && this.targetElement.jscolor instanceof jsc.pub) { + throw new Error('Color picker already installed on this element'); + } + + + // link this instance with the target element + this.targetElement.jscolor = this; + jsc.addClass(this.targetElement, jsc.pub.className); + + // register this instance + jsc.instances.push(this); + + + // if target is BUTTON + if (jsc.isButton(this.targetElement)) { + + if (this.targetElement.type.toLowerCase() !== 'button') { + // on buttons, always force type to be 'button', e.g. in situations the target ");return n},a.prototype.createSizeMenu=function(){var e=this,i=this.state,n=t(''),o=e.options.pageSizeOptions;"string"==typeof o&&(o=o.split(","));for(var a=0;a'+r+"").toggleClass("active",r===i.recPerPage);n.append(s)}return t('
').addClass(e.options.menuDirection).append(n)},a.prototype.createElement=function(e,i,n){var o=this,a=o.createLinkItem.bind(o),r=o.lang;switch(e){case"prev":return a(n.prev,r.prev);case"prev_icon":return a(n.prev,'');case"next":return a(n.next,r.next);case"next_icon":return a(n.next,'');case"first":return a(1,r.first);case"first_icon":return a(1,'');case"last":return a(n.totalPage,r.last);case"last_icon":return a(n.totalPage,'');case"space":case"|":return t('
  • ');case"nav":case"pages":return void o.createNavItems();case"total_text":return t(('
    '+r.totalCount+"
    ").format(n));case"page_text":return t(('
    '+r.pageOf+"
    ").format(n));case"total_page_text":return t(('
    '+r.totalPage+"
    ").format(n));case"page_of_total_text":return t(('
    '+r.pageOfTotal+"
    ").format(n));case"page_size_text":return t(('
    '+r.pageSize+"
    ").format(n));case"items_range_text":return t(('
    '+r.itemsRange+"
    ").format(n));case"goto":return o.createGoto();case"size_menu":return o.createSizeMenu();default:return t("
  • ").html(e.format(n))}},a.prototype.createLink=function(i,n){i===e&&(i=this.state.page),n===e&&(n=this.state);var o=this.options.linkCreator;return"string"==typeof o?o.format(t.extend({},n,{page:i})):"function"==typeof o?o(i,n):"#page="+i},a.prototype.render=function(e){var i=this,n=i.state,o=i.options.elementCreator||i.createElement,a=t.isPlainObject(o);e=e||i.elements||i.options.elements,"string"==typeof e&&(e=e.split(",")),i.elements=e,i.$.empty();for(var r=0;r").append(d)),i.$.append(d))}var c=null;return i.$.children("li").each(function(){var e=t(this),i=!!e.children(".pager-item").length;c?c.toggleClass("pager-item-right",!i):i&&e.addClass("pager-item-left"),c=i?e:null}),c&&c.addClass("pager-item-right"),i.$.callComEvent(i,"onRender",[n]),i},a.DEFAULTS=t.extend({elements:["first_icon","prev_icon","pages","next_icon","last_icon","page_of_total_text","items_range_text","total_text"],prevIcon:"icon-double-angle-left",nextIcon:"icon-double-angle-right",firstIcon:"icon-step-backward",lastIcon:"icon-step-forward",navEllipsisItem:'',maxNavCount:10,menuDirection:"dropdown",pageSizeOptions:[10,20,30,50,100]},n),t.fn.pager=function(e){return this.each(function(){var n=t(this),o=n.data(i),r="object"==typeof e&&e;o||n.data(i,o=new a(this,r)),"string"==typeof e&&o[e]()})},a.NAME=i,a.LANG=o,t.fn.pager.Constructor=a,t(function(){t('[data-ride="pager"]').pager()})}(jQuery,void 0),+function(t){"use strict";var e="zui.tab",i=function(e){this.element=t(e)};i.prototype.show=function(){var i=this.element,n=i.closest("ul:not(.dropdown-menu)"),o=i.attr("data-target")||i.attr("data-tab");if(o||(o=i.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),!i.parent("li").hasClass("active")){var a=n.find(".active:last a")[0],r=t.Event("show."+e,{relatedTarget:a});if(i.trigger(r),!r.isDefaultPrevented()){var s=t(o);this.activate(i.parent("li"),n),this.activate(s,s.parent(),function(){i.trigger({type:"shown."+e,relatedTarget:a})})}}},i.prototype.activate=function(e,i,n){function o(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),e.addClass("active"),r?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu")&&e.closest("li.dropdown").addClass("active"),n&&n()}var a=i.find("> .active"),r=n&&t.support.transition&&a.hasClass("fade");r?a.one(t.support.transition.end,o).emulateTransitionEnd(150):o(),a.removeClass("in")};var n=t.fn.tab;t.fn.tab=function(n){return this.each(function(){var o=t(this),a=o.data(e);a||o.data(e,a=new i(this)),"string"==typeof n&&a[n]()})},t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=n,this},t(document).on("click.zui.tab.data-api",'[data-toggle="tab"], [data-tab]',function(e){e.preventDefault(),t(this).tab("show")})}(window.jQuery),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,n=this;t(this).one("bsTransitionEnd",function(){i=!0});var o=function(){i||t(n).trigger(t.support.transition.end)};return setTimeout(o,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(t){"use strict";var e="zui.collapse",i=function(e,n){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,n),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};i.DEFAULTS={toggle:!0},i.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},i.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var i=t.Event("show."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var n=this.$parent&&this.$parent.find(".in");if(n&&n.length){var o=n.data(e);if(o&&o.transitioning)return;n.collapse("hide"),o||n.data(e,null)}var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0),this.transitioning=1;var r=function(){this.$element.removeClass("collapsing").addClass("in")[a]("auto"),this.transitioning=0,this.$element.trigger("shown."+e)};if(!t.support.transition)return r.call(this);var s=t.camelCase(["scroll",a].join("-"));this.$element.one(t.support.transition.end,r.bind(this)).emulateTransitionEnd(350)[a](this.$element[0][s])}}},i.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var i=t.Event("hide."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var o=function(){this.transitioning=0,this.$element.trigger("hidden."+e).removeClass("collapsing").addClass("collapse")};return t.support.transition?void this.$element[n](0).one(t.support.transition.end,o.bind(this)).emulateTransitionEnd(350):o.call(this)}}},i.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var n=t.fn.collapse;t.fn.collapse=function(n){return this.each(function(){var o=t(this),a=o.data(e),r=t.extend({},i.DEFAULTS,o.data(),"object"==typeof n&&n);a||o.data(e,a=new i(this,r)),"string"==typeof n&&a[n]()})},t.fn.collapse.Constructor=i,t.fn.collapse.noConflict=function(){return t.fn.collapse=n,this},t(document).on("click."+e+".data-api","[data-toggle=collapse]",function(i){var n,o=t(this),a=o.attr("data-target")||i.preventDefault()||(n=o.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,""),r=t(a),s=r.data(e),l=s?"toggle":o.data(),d=o.attr("data-parent"),c=d&&t(d);s&&s.transitioning||(c&&c.find('[data-toggle=collapse][data-parent="'+d+'"]').not(o).addClass("collapsed"),o[r.hasClass("in")?"addClass":"removeClass"]("collapsed")),r.collapse(l)})}(window.jQuery),function(t,e){"use strict";var i=1200,n=992,o=768,a=e(t),r=function(){var t=a.width();e("html").toggleClass("screen-desktop",t>=n&&t=i).toggleClass("screen-tablet",t>=o&&t=n)},s="",l=navigator.userAgent;l.match(/(iPad|iPhone|iPod)/i)?s+=" os-ios":l.match(/android/i)?s+=" os-android":l.match(/Win/i)?s+=" os-windows":l.match(/Mac/i)?s+=" os-mac":l.match(/Linux/i)?s+=" os-linux":l.match(/X11/i)&&(s+=" os-unix"),"ontouchstart"in document.documentElement&&(s+=" is-touchable"),e("html").addClass(s),a.resize(r),r()}(window,jQuery),function(t){"use strict";var e={zh_cn:'您的浏览器版本过低,无法体验所有功能,建议升级或者更换浏览器。 了解更多...',zh_tw:'您的瀏覽器版本過低,無法體驗所有功能,建議升級或者更换瀏覽器。了解更多...',en:'Your browser is too old, it has been unable to experience the colorful internet. We strongly recommend that you upgrade a better one. Learn more...'},i=function(){for(var t=!1,e=11;e>5;e--)if(this.isIE(e)){t=e;break}this.ie=t,this.cssHelper()};i.prototype.cssHelper=function(){var e=this.ie,i=t("html");i.toggleClass("ie",e).removeClass("ie-6 ie-7 ie-8 ie-9 ie-10"),e&&i.addClass("ie-"+e).toggleClass("gt-ie-7 gte-ie-8 support-ie",e>=8).toggleClass("lte-ie-7 lt-ie-8 outdated-ie",e<8).toggleClass("gt-ie-8 gte-ie-9",e>=9).toggleClass("lte-ie-8 lt-ie-9",e<9).toggleClass("gt-ie-9 gte-ie-10",e>=10).toggleClass("lte-ie-9 lt-ie-10",e<10).toggleClass("gt-ie-10 gte-ie-11",e>=11).toggleClass("lte-ie-10 lt-ie-11",e<11)},i.prototype.tip=function(i){var n=t("#browseHappyTip");n.length||(n=t('
    '),n.prependTo("body")),i||(i=t.zui.getLangData("zui.browser",t.zui.clientLang(),e),"object"==typeof i&&(i=i.tip)),n.find(".content").html(i)},i.prototype.isIE=function(t){if(11===t)return this.isIE11();if(10===t)return this.isIE10();if(!t&&(this.isIE11()||this.isIE10()))return!0;var e=document.createElement("b");return e.innerHTML="",1===e.getElementsByTagName("i").length},i.prototype.isIE10=function(){return navigator.appVersion.indexOf("MSIE 10")!==-1},i.prototype.isIE11=function(){var t=navigator.userAgent;return t.indexOf("Trident")!==-1&&t.indexOf("rv:11")!==-1},t.zui({browser:new i}),t(function(){t("body").hasClass("disabled-browser-tip")||t.zui.browser.ie&&t.zui.browser.ie<8&&t.zui.browser.tip()})}(jQuery),function(t){"use strict";var e=864e5,i=function(t){return t instanceof Date||("number"==typeof t&&t<1e10&&(t*=1e3),t=new Date(t)),t},n=function(t){return i(t).getTime()},o=function(t,e){t=i(t),void 0===e&&(e="yyyy-MM-dd hh:mm:ss");var n={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),"S+":t.getMilliseconds()};/(y+)/i.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(var o in n)new RegExp("("+o+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?n[o]:("00"+n[o]).substr((""+n[o]).length)));return e},a=function(t,e){return t.setTime(t.getTime()+e),t},r=function(t,i){return a(t,i*e)},s=function(t){return new Date(i(t).getTime())},l=function(t){return t%4===0&&t%100!==0||t%400===0},d=function(t,e){return[31,l(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},c=function(t){return d(t.getFullYear(),t.getMonth())},p=function(t){return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},u=function(t,e){var i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(Math.min(i,c(t))),t},f=function(t,e){e=e||1;for(var i=new Date(t.getTime());i.getDay()!=e;)i=r(i,-1);return p(i)},h=function(t,e){return t.toDateString()===e.toDateString()},g=function(t,e){var i=f(t),n=r(s(i),7);return e>=i&&e1){var i;if(2==arguments.length&&"object"==typeof e)for(var n in e)void 0!==e[n]&&(i=new RegExp("({"+n+"})","g"),t=t.replace(i,e[n]));else for(var o=1;othis.length)&&(e=this.length),this.substring(e-t.length,e)===t}),String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(t,e){return e=!e||e<0?0:+e,this.substring(e,e+t.length)===t}}),String.prototype.includes||(String.prototype.includes=function(){return String.prototype.indexOf.apply(this,arguments)!==-1}))}(),/*! + * jQuery resize event - v1.1 + * http://benalman.com/projects/jquery-resize-plugin/ + * Copyright (c) 2010 "Cowboy" Ben Alman + * MIT & GPL http://benalman.com/about/license/ + */ +function(t,e,i){"$:nomunge";function n(){o=e[s](function(){a.each(function(){var e=t(this),i=e.width(),n=e.height(),o=t.data(this,d);i===o.w&&n===o.h||e.trigger(l,[o.w=i,o.h=n])}),n()},r[c])}var o,a=t([]),r=t.resize=t.extend(t.resize,{}),s="setTimeout",l="resize",d=l+"-special-event",c="delay",p="throttleWindow";r[c]=250,r[p]=!0,t.event.special[l]={setup:function(){if(!r[p]&&this[s])return!1;var e=t(this);a=a.add(e),t.data(this,d,{w:e.width(),h:e.height()}),1===a.length&&n()},teardown:function(){if(!r[p]&&this[s])return!1;var e=t(this);a=a.not(e),e.removeData(d),a.length||clearTimeout(o)},add:function(e){function n(e,n,a){var r=t(this),s=t.data(this,d)||{};s.w=n!==i?n:r.width(),s.h=a!==i?a:r.height(),o.apply(this,arguments)}if(!r[p]&&this[s])return!1;var o;return"function"==typeof e?(o=e,n):(o=e.handler,void(e.handler=n))}}}(jQuery,this),+function(t){"use strict";function e(n,o){var a,r=this.process.bind(this);this.$element=t(t(n).is("body")?window:n),this.$body=t("body"),this.$scrollElement=this.$element.on("scroll."+i+".data-api",r),this.options=t.extend({},e.DEFAULTS,o),this.selector||(this.selector=(this.options.target||(a=t(n).attr("href"))&&a.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a"),this.offsets=t([]),this.targets=t([]),this.activeTarget=null,this.refresh(),this.process()}var i="zui.scrollspy";e.DEFAULTS={offset:10},e.prototype.refresh=function(){var e=this.$element[0]==window?"offset":"position";this.offsets=t([]),this.targets=t([]);var i=this;this.$body.find(this.selector).map(function(){var n=t(this),o=n.data("target")||n.attr("href"),a=/^#./.test(o)&&t(o);return a&&a.length&&a.is(":visible")&&[[a[e]().top+(!t.isWindow(i.$scrollElement.get(0))&&i.$scrollElement.scrollTop()),o]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){i.offsets.push(this[0]),i.targets.push(this[1])})},e.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=i-this.$scrollElement.height(),o=this.offsets,a=this.targets,r=this.activeTarget;if(e>=n)return r!=(t=a.last()[0])&&this.activate(t);if(r&&e<=o[0])return r!=(t=a[0])&&this.activate(t);for(t=o.length;t--;)r!=a[t]&&e>=o[t]&&(!o[t+1]||e<=o[t+1])&&this.activate(a[t])},e.prototype.activate=function(e){this.activeTarget=e,t(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var n=this.selector+'[data-target="'+e+'"],'+this.selector+'[href="'+e+'"]',o=t(n).parents("li").addClass("active");o.parent(".dropdown-menu").length&&(o=o.closest("li.dropdown").addClass("active")),o.trigger("activate."+i)};var n=t.fn.scrollspy;t.fn.scrollspy=function(n){return this.each(function(){var o=t(this),a=o.data(i),r="object"==typeof n&&n;a||o.data(i,a=new e(this,r)),"string"==typeof n&&a[n]()})},t.fn.scrollspy.Constructor=e,t.fn.scrollspy.noConflict=function(){return t.fn.scrollspy=n,this},t(window).on("load",function(){t('[data-spy="scroll"]').each(function(){var e=t(this);e.scrollspy(e.data())})})}(jQuery),function(t,e){"use strict";var i,n,o="localStorage",a="page_"+t.location.pathname+t.location.search,r=function(){this.silence=!0;try{o in t&&t[o]&&t[o].setItem&&(this.enable=!0,i=t[o])}catch(r){}this.enable||(n={},i={getLength:function(){var t=0;return e.each(n,function(){t++}),t},key:function(t){var i,o=0;return e.each(n,function(e){return o===t?(i=e,!1):void o++}),i},removeItem:function(t){delete n[t]},getItem:function(t){return n[t]},setItem:function(t,e){n[t]=e},clear:function(){n={}}}),this.storage=i,this.page=this.get(a,{})};r.prototype.pageSave=function(){if(e.isEmptyObject(this.page))this.remove(a);else{var t,i=[];for(t in this.page){var n=this.page[t];null===n&&i.push(t)}for(t=i.length-1;t>=0;t--)delete this.page[i[t]];this.set(a,this.page)}},r.prototype.pageRemove=function(t){"undefined"!=typeof this.page[t]&&(this.page[t]=null,this.pageSave())},r.prototype.pageClear=function(){this.page={},this.pageSave()},r.prototype.pageGet=function(t,e){var i=this.page[t];return void 0===e||null!==i&&void 0!==i?i:e},r.prototype.pageSet=function(t,i){e.isPlainObject(t)?e.extend(!0,this.page,t):this.page[this.serialize(t)]=i,this.pageSave()},r.prototype.check=function(){if(!this.enable&&!this.silence)throw new Error("Browser not support localStorage or enable status been set true.");return this.enable},r.prototype.length=function(){return this.check()?i.getLength?i.getLength():i.length:0},r.prototype.removeItem=function(t){return i.removeItem(t),this},r.prototype.remove=function(t){return this.removeItem(t)},r.prototype.getItem=function(t){return i.getItem(t)},r.prototype.get=function(t,e){var i=this.deserialize(this.getItem(t));return"undefined"!=typeof i&&null!==i||"undefined"==typeof e?i:e},r.prototype.key=function(t){return i.key(t)},r.prototype.setItem=function(t,e){return i.setItem(t,e),this},r.prototype.set=function(t,e){return void 0===e?this.remove(t):(this.setItem(t,this.serialize(e)),this)},r.prototype.clear=function(){return i.clear(),this},r.prototype.forEach=function(t){for(var e=this.length(),n=e-1;n>=0;n--){var o=i.key(n);t(o,this.get(o))}return this},r.prototype.getAll=function(){var t={};return this.forEach(function(e,i){t[e]=i}),t},r.prototype.serialize=function(t){return"string"==typeof t?t:JSON.stringify(t)},r.prototype.deserialize=function(t){if("string"==typeof t)try{return JSON.parse(t)}catch(e){return t||void 0}},e.zui({store:new r})}(window,jQuery),function(t){"use strict";var e="zui.searchBox",i=function(e,n){var o=this;o.name=name,o.$=t(e),o.options=n=t.extend({},i.DEFAULTS,o.$.data(),n);var a=o.$.is(n.inputSelector)?o.$:o.$.find(n.inputSelector);if(a.length){var r=function(){o.changeTimer&&(clearTimeout(o.changeTimer),o.changeTimer=null)},s=function(){r();var t=o.getSearch();if(t!==o.lastValue){var e=""===t;a.toggleClass("empty",e),o.$.callComEvent(o,"onSearchChange",[t,e]),o.lastValue=t}};o.$input=a=a.first(),a.on(n.listenEvent,function(t){o.changeTimer=setTimeout(function(){s()},n.changeDelay)}).on("focus",function(t){a.addClass("focus"),o.$.callComEvent(o,"onFocus",[t])}).on("blur",function(t){a.removeClass("focus"),o.$.callComEvent(o,"onBlur",[t])}).on("keydown",function(t){var e=0,i=t.which;27===i&&n.escToClear?(this.setSearch("",!0),s(),e=1):13===i&&n.onPressEnter&&(s(),o.$.callComEvent(o,"onPressEnter",[t]));var a=o.$.callComEvent(o,"onKeyDown",[t]);a===!1&&(e=1),e&&t.preventDefault()}),o.$.on("click",".search-clear-btn",function(t){o.setSearch("",!0),s(),o.focus(),t.preventDefault()}),s()}else console.error("ZUI: search box init error, cannot find search box input element.")};i.DEFAULTS={inputSelector:'input[type="search"],input[type="text"]',listenEvent:"change input paste",changeDelay:500},i.prototype.getSearch=function(){return this.$input&&t.trim(this.$input.val())},i.prototype.setSearch=function(t,e){var i=this.$input;i&&(i.val(t),e||i.trigger("change"))},i.prototype.focus=function(){this.$input&&this.$input.focus()},t.fn.searchBox=function(n){return this.each(function(){var o=t(this),a=o.data(e),r="object"==typeof n&&n;a||o.data(e,a=new i(this,r)),"string"==typeof n&&a[n]()})},i.NAME=e,t.fn.searchBox.Constructor=i}(jQuery),function(t,e){"use strict";var i="zui.draggable",n={container:"body",move:!0},o=0,a=function(e,i){var a=this;a.$=t(e),a.id=o++,a.options=t.extend({},n,a.$.data(),i),a.init()};a.DEFAULTS=n,a.NAME=i,a.prototype.init=function(){var n,o,a,r,s,l=this,d=l.$,c="before",p="drag",u="finish",f="."+i+"."+l.id,h="mousedown"+f,g="mouseup"+f,m="mousemove"+f,v=l.options,y=v.selector,b=v.handle,w=d,C="function"==typeof v.move,x=function(t){var e=t.pageX,i=t.pageY;s=!0;var o={left:e-a.x,top:i-a.y};w.removeClass("drag-ready").addClass("dragging"),v.move&&(C?v.move(o,w):w.css(o)),v[p]&&v[p]({event:t,element:w,startOffset:a,pos:o,offset:{x:e-n.x,y:i-n.y},smallOffset:{x:e-r.x,y:i-r.y}}),r.x=e,r.y=i,v.stopPropagation&&t.stopPropagation()},$=function(i){if(t(e).off(f),!s)return void w.removeClass("drag-ready");var o={left:i.pageX-a.x,top:i.pageY-a.y};w.removeClass("drag-ready dragging"),v.move&&(C?v.move(o,w):w.css(o)),v[u]&&v[u]({event:i,element:w,startOffset:a,pos:o,offset:{x:i.pageX-n.x,y:i.pageY-n.y},smallOffset:{x:i.pageX-r.x,y:i.pageY-r.y}}),i.preventDefault(),v.stopPropagation&&i.stopPropagation()},T=function(i){var l=t.zui.getMouseButtonCode(v.mouseButton);if(!(l>-1&&i.button!==l)){var d=t(this);if(y&&(w=b?d.closest(y):d),v[c]){var p=v[c]({event:i,element:w});if(p===!1)return}var u=t(v.container),f=w.offset();o=u.offset(),n={x:i.pageX,y:i.pageY},a={x:i.pageX-f.left+o.left,y:i.pageY-f.top+o.top},r=t.extend({},n),s=!1,w.addClass("drag-ready"),i.preventDefault(),v.stopPropagation&&i.stopPropagation(),t(e).on(m,x).on(g,$)}};b?d.on(h,b,T):y?d.on(h,y,T):d.on(h,T)},a.prototype.destroy=function(){var n="."+i+"."+this.id;this.$.off(n),t(e).off(n),this.$.data(i,null)},t.fn.draggable=function(e){return this.each(function(){var n=t(this),o=n.data(i),r="object"==typeof e&&e;o||n.data(i,o=new a(this,r)),"string"==typeof e&&o[e]()})},t.fn.draggable.Constructor=a}(jQuery,document),function(t,e,i){"use strict";var n="zui.droppable",o={target:".droppable-target",deviation:5,sensorOffsetX:0,sensorOffsetY:0,dropToClass:"drop-to"},a=0,r=function(e,i){var n=this;n.id=a++,n.$=t(e),n.options=t.extend({},o,n.$.data(),i),n.init()};r.DEFAULTS=o,r.NAME=n,r.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},r.prototype.init=function(){var o,a,r,s,l,d,c,p,u,f,h,g,m,v=this,y=v.$,b=v.options,w=b.deviation,C="."+n+"."+v.id,x="mousedown"+C,$="mouseup"+C,T="mousemove"+C,D=b.selector,S=b.handle,k=b.flex,z=b.container,E=b.canMoveHere,P=b.dropToClass,I=y,M=!1,O=z?t(b.container).first():D?y:t("body"),L=function(e){if(M&&(h={left:e.pageX,top:e.pageY},!(i.abs(h.left-p.left)a&&h.top>r&&h.left-1&&i.button!==n)){var h=t(this);D&&(I=S?h.closest(D):h),I.hasClass("drag-shadow")||b.before&&b.before({event:i,element:I})===!1||(M=!0,o="function"==typeof b.target?b.target(I,y):O.find(b.target),a=null,r=null,s=!1,l=!0,d=null,c=I.offset(),u=O.offset(),u.top=u.top-O.scrollTop(),u.left=u.left-O.scrollLeft(),p={left:i.pageX,top:i.pageY},g=t.extend({},p),f={left:p.left-c.left,top:p.top-c.top},I.addClass("drag-from"),t(e).on(T,L).on($,j),m=setTimeout(function(){t(e).on(x,j)},10),i.preventDefault(),b.stopPropagation&&i.stopPropagation())}};S?y.on(x,S,A):D?y.on(x,D,A):y.on(x,A)},r.prototype.destroy=function(){var i="."+n+"."+this.id;this.$.off(i),t(e).off(i),this.$.data(n,null)},r.prototype.reset=function(){this.destroy(),this.init()},t.fn.droppable=function(e){return this.each(function(){var i=t(this),o=i.data(n),a="object"==typeof e&&e;o||i.data(n,o=new r(this,a)),"string"==typeof e&&o[e]()})},t.fn.droppable.Constructor=r}(jQuery,document,Math),+function(t,e){"use strict";function i(e,i,a){return this.each(function(){var r=t(this),s=r.data(n),l=t.extend({},o.DEFAULTS,r.data(),"object"==typeof e&&e);s||r.data(n,s=new o(this,l)),"string"==typeof e?s[e](i,a):l.show&&s.show(i,a)})}var n="zui.modal",o=function(i,o){var a=this;a.options=o,a.$body=t(document.body),a.$element=t(i),a.$backdrop=a.isShown=null,a.scrollbarWidth=0,o.moveable===e&&(a.options.moveable=a.$element.hasClass("modal-moveable")),o.remote&&a.$element.find(".modal-content").load(o.remote,function(){a.$element.trigger("loaded."+n)}),o.scrollInside&&t(window).on("resize."+n,function(){a.isShown&&a.adjustPosition(e,100)})};o.VERSION="3.2.0",o.TRANSITION_DURATION=300,o.BACKDROP_TRANSITION_DURATION=150,o.DEFAULTS={backdrop:!0,keyboard:!0,show:!0,position:"fit"};var a=function(e,i){var n=t(window);i.left=Math.max(0,Math.min(i.left,n.width()-e.outerWidth())),i.top=Math.max(0,Math.min(i.top,n.height()-e.outerHeight())),e.css(i)};o.prototype.toggle=function(t,e){return this.isShown?this.hide():this.show(t,e)},o.prototype.adjustPosition=function(i,o){var r=this;if(clearTimeout(r.reposTask),o)return void(r.reposTask=setTimeout(r.adjustPosition.bind(r,i,0),o));var s=r.options;if(i===e&&(i=s.position),i!==e&&null!==i){"function"==typeof i&&(i=i(r));var l=r.$element.find(".modal-dialog"),d=t(window).height(),c={maxHeight:"initial",overflow:"visible"},p=l.find(".modal-body").css(c);if(s.scrollInside&&p.length){var u=s.headerHeight,f=s.footerHeight,h=l.find(".modal-header"),g=l.find(".modal-footer");"number"!=typeof u&&(u=h.length?h.outerHeight():"function"==typeof u?u(h):0),"number"!=typeof f&&(f=g.length?g.outerHeight():"function"==typeof f?f(g):0),c.maxHeight=d-u-f,c.overflow=p[0].scrollHeight>c.maxHeight?"auto":"visible",p.css(c)}var m=Math.max(0,(d-l.outerHeight())/2);if("fit"===i?i={top:m>50?Math.floor(2*m/3):m}:"center"===i?i={top:m}:t.isPlainObject(i)||(i={top:i}),l.hasClass("modal-moveable")){var v=null,y=s.rememberPos;y&&(y===!0?v=r.$element.data("modal-pos"):t.zui.store&&(v=t.zui.store.pageGet(n+".rememberPos."+y))),i=t.extend(i,{left:Math.max(0,(t(window).width()-l.outerWidth())/2)},v),"inside"===s.moveable?a(l,i):l.css(i)}else l.css(i)}},o.prototype.setMoveable=function(){t.fn.draggable||console.error("Moveable modal requires draggable.js.");var e=this,i=e.options,o=e.$element.find(".modal-dialog").removeClass("modal-dragged");o.toggleClass("modal-moveable",!!i.moveable),e.$element.data("modal-moveable-setup")||o.draggable({container:e.$element,handle:".modal-header",before:function(){var t=o.css("margin-top");t&&"0px"!==t&&o.css("top",t).css("margin-top","").addClass("modal-dragged")},finish:function(o){var a=i.rememberPos;a&&(e.$element.data("modal-pos",o.pos),t.zui.store&&a!==!0&&t.zui.store.pageSet(n+".rememberPos."+a,o.pos))},move:"inside"!==i.moveable||function(t){a(o,t)}})},o.prototype.show=function(e,i){var a=this,r=t.Event("show."+n,{relatedTarget:e});a.$element.trigger(r),a.$element.toggleClass("modal-scroll-inside",!!a.options.scrollInside),a.isShown||r.isDefaultPrevented()||(a.isShown=!0,a.options.moveable&&a.setMoveable(),a.options.backdrop!==!1&&(a.setScrollbar(),a.$body.addClass("modal-open")),a.escape(),a.$element.on("click.dismiss."+n,'[data-dismiss="modal"]',function(t){a.hide(),t.stopPropagation()}),a.backdrop(function(){var r=t.support.transition&&a.$element.hasClass("fade");a.$element.parent().length||a.$element.appendTo(a.$body),a.$element.show().scrollTop(0),r&&a.$element[0].offsetWidth,a.$element.addClass("in").attr("aria-hidden",!1),a.adjustPosition(i),a.enforceFocus();var s=t.Event("shown."+n,{relatedTarget:e});r?a.$element.find(".modal-dialog").one("bsTransitionEnd",function(){a.$element.trigger("focus").trigger(s)}).emulateTransitionEnd(o.TRANSITION_DURATION):a.$element.trigger("focus").trigger(s)}))},o.prototype.hide=function(e){e&&e.preventDefault&&e.preventDefault();var i=this;e=t.Event("hide."+n),i.$element.trigger(e),i.isShown&&!e.isDefaultPrevented()&&(i.isShown=!1,i.options.backdrop!==!1&&(i.$body.removeClass("modal-open"),i.resetScrollbar()),i.escape(),t(document).off("focusin."+n),i.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss."+n),t.support.transition&&i.$element.hasClass("fade")?i.$element.one("bsTransitionEnd",i.hideModal.bind(i)).emulateTransitionEnd(o.TRANSITION_DURATION):i.hideModal())},o.prototype.enforceFocus=function(){t(document).off("focusin."+n).on("focusin."+n,function(t){this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")}.bind(this))},o.prototype.escape=function(){this.isShown&&this.options.keyboard?t(document).on("keydown.dismiss."+n,function(i){if(27==i.which){var o=t.Event("escaping."+n),a=this.$element.triggerHandler(o,"esc");if(a!=e&&!a)return;this.hide()}}.bind(this)):this.isShown||t(document).off("keydown.dismiss."+n)},o.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$element.trigger("hidden."+n)})},o.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},o.prototype.backdrop=function(e){var i=this,a=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var r=t.support.transition&&a;if(this.$backdrop=t('
  • ');var n=t("").attr(t.extend({href:e.url||"###","class":e.className,style:e.style},e.attrs)).data("item",e);return e.html?e.html===!0?n.html(e.label||e.text):n=t(e.html):n.text(e.label||e.text),e.icon&&n.prepend(''),e.onClick&&n.on("click",e.onClick),t("
  • ").toggleClass("disabled",e.disabled===!0).append(n)},p=function(e){var i=t("#"+r);return i.length&&i.hasClass("contextmenu-show")&&(!e||(i.data("options")||{}).id===e)},u=null,f=function(e,i){"function"==typeof e&&(i=e,e=null),u&&(clearTimeout(u),u=null);var n=t("#"+r);if(n.length){var o=n.removeClass("contextmenu-show").data("options");if(!e||o.id===e){var s=function(){n.find(".contextmenu-menu").removeClass("open"),o.onHidden&&o.onHidden(),i&&i()};o.onHide&&o.onHide();var l=o.animation;n.find(".contextmenu-menu").removeClass("in"),l?u=setTimeout(s,o.duration):s()}}return a},h=function(d,p,h){t.isPlainObject(d)&&(h=p,p=d,d=p.items),o=!0,p=t.extend({},n,p);var g=t("#"+r);g.length||(g=t('
    ').appendTo("body"));var m=g.find(".contextmenu-menu").off("click."+i).on("click."+i,"a,.contextmenu-item",function(e){var i=t(this),n=p.onClickItem&&p.onClickItem(i.data("item"),i,e,p);n!==!1&&f()}).empty();m.attr("class","contextmenu-menu"+(p.className?" "+p.className:"")),g.attr("class","contextmenu contextmenu-show");var v=p.menuCreator;if(v)m.append(v(d,p));else{m.append(p.menuTemplate);var y=m.children().first(),b=p.itemCreator||c,w=typeof d;if("string"===w?d=d.split(","):"function"===w&&(d=d(p)),!d)return!1;t.each(d,function(t,e){y.append(b(e,t,p))})}var C=p.animation,x=p.duration;C===!0&&(p.animation=C="fade"),u&&(clearTimeout(u),u=null);var $=function(){m.addClass("in"),p.onShown&&p.onShown(),h&&h()};p.onShow&&p.onShow(),g.data("options",{animation:C,onHide:p.onHide,onHidden:p.onHidden,id:p.id,duration:x});var T=p.x,D=p.y;T===e&&(T=(p.event||p).clientX),T===e&&(T=s),D===e&&(D=(p.event||p).clientY),D===e&&(D=l);var y=m.children().first(),S=y.outerWidth(),k=y.outerHeight();if(p.position){var z=p.position({x:T,y:D,width:S,height:k},p,m);z&&(T=z.x,D=z.y)}if(p.limitInsideWindow){var E=t(window);T=Math.max(0,Math.min(T,E.width()-S)),D=Math.max(0,Math.min(D,E.height()-k))}return g.css({left:T,top:D}).show(),m.addClass("open"),C?(m.addClass(C),u=setTimeout(function(){$(),o=!1},10)):($(),o=!1),a};t.extend(a,{NAME:i,DEFAULTS:n,show:h,hide:f,listenMouse:d,isShow:p}),t.zui({ContextMenu:a});var g=function(e,n){var o=this;o.name=i,o.$=t(e),o.id=t.zui.uuid(),n=o.options=t.extend({trigger:"contextmenu"},a.DEFAULTS,this.$.data(),n);var r=function(t){if("mousedown"!==t.type||2===t.button){if(n.toggleTrigger&&o.isShow())o.hide();else{var e={x:t.clientX,y:t.clientY,event:t};if(o.show(e)===!1)return}return t.preventDefault(),t.returnValue=!1,!1}},s=n.trigger,l=s+"."+i;n.selector?o.$.on(l,n.selector,r):o.$.on(l,r),n.show&&o.show("object"==typeof n.show?n.show:null)};g.prototype.destory=function(){that.$.off("."+i)},g.prototype.hide=function(t){return a.hide(this.id,t)},g.prototype.show=function(e,i){return e=t.extend({id:this.id,$toggle:this.$},this.options,e),a.show(e,i)},g.prototype.isShow=function(){return p(this.id)},t.fn.contextmenu=function(e){return this.each(function(){var n=t(this),o=n.data(i),a="object"==typeof e&&e;o||n.data(i,o=new g(this,a)),"string"==typeof e&&o[e]()})},t.fn.contextmenu.Constructor=g,t.fn.contextDropdown=function(e){t(this).contextmenu(t.extend({trigger:"click",animation:"fade",toggleTrigger:!0,menuCreator:function(e,i){var n=i.$toggle,o=n.attr("data-target");o||(o=n.attr("href"),o=o&&/#/.test(o)&&o.replace(/.*(?=#[^\s]*$)/,""));var a=o?t(o):n.next(".dropdown-menu"),r=i.transferEvent;if(r!==!1){var s="data-contextmenu-index";a.find("a,.contextmenu-item").each(function(e){t(this).attr(s,e)});var l=a.clone();return l.on("string"==typeof r?r:"click","a,.contextmenu-item",function(e){var i=a.find("["+s+'="'+t(this).attr(s)+'"]'),n=i[0];if(n)return n[e.type]?n[e.type]():i.trigger(e.type),e.preventDefault(),e.stopPropagation(),!1}),l}return a.clone()},position:function(t,e,i){var n=e.placement,o=e.$toggle;if(!n){var a=i.find(".dropdown-menu"),r=a.hasClass("pull-right"),s=o.parent().hasClass("dropup");n=r?s?"top-right":"bottom-right":s?"top-left":"bottom-left",r&&a.removeClass("pull-right")}var l=o[0].getBoundingClientRect();switch(n){case"top-left":return{x:l.left,y:Math.floor(l.top-t.height)};case"top-right":return{x:Math.floor(l.right-t.width),y:Math.floor(l.top-t.height)};case"bottom-left":return{x:l.left,y:l.bottom};case"bottom-right":return{x:Math.floor(l.right-t.width),y:l.bottom}}return t}},e))},t(document).on("click",function(e){var n=t(e.target),a=n.closest('[data-toggle="context-dropdown"]');if(a.length){var r=a.data(i);r||a.contextDropdown({show:!0})}else o||n.closest(".contextmenu").length||f()})}(jQuery,void 0),+function(t){"use strict";var e=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",this.pause.bind(this)).on("mouseleave",this.cycle.bind(this))};e.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,touchable:!0},e.prototype.touchable=function(){function e(e){var e=e||window.event;e.originalEvent&&(e=e.originalEvent);var a=t(this);switch(e.type){case"touchstart":n=e.touches[0].pageX,o=e.touches[0].pageY;break;case"touchend":var r=e.changedTouches[0].pageX-n,s=e.changedTouches[0].pageY-o;if(Math.abs(r)>Math.abs(s))i(a,r),Math.abs(r)>10&&e.preventDefault();else{var l=t(window);t("body,html").animate({scrollTop:l.scrollTop()-s},400)}}}function i(t,e){e>10?a.prev():e<-10&&a.next()}if(this.options.touchable){this.$element.on("touchstart touchmove touchend",e);var n,o,a=this}},e.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(this.next.bind(this),this.options.interval)),this},e.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},e.prototype.to=function(e){var i=this,n=this.getActiveIndex();if(!(e>this.$items.length-1||e<0))return this.sliding?this.$element.one("slid",function(){i.to(e)}):n==e?this.pause().cycle():this.slide(e>n?"next":"prev",t(this.$items[e]))},e.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition.end&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},e.prototype.next=function(){if(!this.sliding)return this.slide("next")},e.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},e.prototype.slide=function(e,i){var n=this.$element.find(".item.active"),o=i||n[e](),a=this.interval,r="next"==e?"left":"right",s="next"==e?"first":"last",l=this;if(!o.length){if(!this.options.wrap)return;o=this.$element.find(".item")[s]()}this.sliding=!0,a&&this.pause();var d=t.Event("slide.zui.carousel",{relatedTarget:o[0],direction:r});if(!o.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var e=t(l.$indicators.children()[l.getActiveIndex()]);e&&e.addClass("active")})),t.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(d),d.isDefaultPrevented())return;o.addClass(e),o[0].offsetWidth,n.addClass(r),o.addClass(r),n.one(t.support.transition.end,function(){o.removeClass([e,r].join(" ")).addClass("active"),n.removeClass(["active",r].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(d),d.isDefaultPrevented())return;n.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return a&&this.cycle(),this}};var i=t.fn.carousel;t.fn.carousel=function(i){return this.each(function(){var n=t(this),o=n.data("zui.carousel"),a=t.extend({},e.DEFAULTS,n.data(),"object"==typeof i&&i),r="string"==typeof i?i:a.slide;o||n.data("zui.carousel",o=new e(this,a)),"number"==typeof i?o.to(i):r?o[r]():a.interval&&o.pause().cycle(),a.touchable&&o.touchable()})},t.fn.carousel.Constructor=e,t.fn.carousel.noConflict=function(){return t.fn.carousel=i,this},t(document).on("click.zui.carousel.data-api","[data-slide], [data-slide-to]",function(e){var i,n=t(this),o=t(n.attr("data-target")||(i=n.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"")),a=t.extend({},o.data(),n.data()),r=n.attr("data-slide-to");r&&(a.interval=!1),o.carousel(a),(r=n.attr("data-slide-to"))&&o.data("zui.carousel").to(r),e.preventDefault()}),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var e=t(this);e.carousel(e.data())})})}(window.jQuery),/*! TangBin: image.ready.js http://www.planeart.cn/?p=1121 */ +function(t){"use strict";t.zui.imgReady=function(){var t=[],e=null,i=function(){for(var e=0;e1024)&&(o.call(u),s.end=!0)},s(),u.onload=function(){!s.end&&s(),a&&a.call(u),u=u.onload=u.onerror=null},void(s.end||(t.push(s),null===e&&(e=setInterval(i,40)))))}}()}(jQuery),function(t,e,i){"use strict";if(!t.fn.modalTrigger)throw new Error("modal & modalTrigger requires for lightbox");if(!t.zui.imgReady)throw new Error("imgReady requires for lightbox");var n=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.init()};n.DEFAULTS={modalTeamplate:'