123456789101112131415161718192021 |
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).F2={})}(this,(function(t){"use strict";var e=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},i=function(t,i){if(!e(t))return t;for(var n=[],r=0;r<t.length;r++){var a=t[r];i(a,r)&&n.push(a)}return n},n={}.toString,r=function(t,e){return n.call(t)==="[object "+e+"]"},a=function(t){return r(t,"Function")},s=function(t){return null==t},o=function(t){return Array.isArray?Array.isArray(t):r(t,"Array")},l=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};function h(t,e){if(t)if(o(t))for(var i=0,n=t.length;i<n&&!1!==e(t[i],i);i++);else if(l(t))for(var r in t)if(t.hasOwnProperty(r)&&!1===e(t[r],r))break}var u=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return h(t,(function(i,n){a(t)&&"prototype"===n||e.push(n)})),e};var c=function(t){return"object"==typeof t&&null!==t},f=function(t){if(!c(t)||!r(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var p=function(t){var e=t.filter((function(t){return!isNaN(t)}));if(!e.length)return{min:0,max:0};if(o(t[0])){for(var i=[],n=0;n<t.length;n++)i=i.concat(t[n]);e=i}var r=function(t){if(o(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])}(e);return{min:function(t){if(o(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])}(e),max:r}},g=function(t){return r(t,"String")};function d(t,e){void 0===e&&(e=new Map);var i=[];if(Array.isArray(t))for(var n=0,r=t.length;n<r;n++){var a=t[n];e.has(a)||(i.push(a),e.set(a,!0))}return i}function v(t){if(e(t))return t[0]}function m(t){if(e(t)){return t[t.length-1]}}var y=function(t,e){var i=e.toString(),n=i.indexOf(".");if(-1===n)return Math.round(t);var r=i.substr(n+1).length;return r>20&&(r=20),parseFloat(t.toFixed(r))},x=function(t){return r(t,"Number")},_=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return h(t,(function(i,n){a(t)&&"prototype"===n||e.push(i)})),e},S=function(t){return s(t)?"":t.toString()},b=function(t){var e=S(t);return e.charAt(0).toLowerCase()+e.substring(1)};function M(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,i){return"\\"===t.charAt(0)?t.slice(1):void 0===e[i]?"":e[i]})):t}var C=function(t){var e=S(t);return e.charAt(0).toUpperCase()+e.substring(1)},w={}.toString,P=function(t){return r(t,"Boolean")},T=function(t){return r(t,"Date")},D=Object.prototype;function k(t,e){for(var i in e)e.hasOwnProperty(i)&&"constructor"!==i&&void 0!==e[i]&&(t[i]=e[i])}function A(t,e,i,n){return e&&k(t,e),i&&k(t,i),n&&k(t,n),t}function I(t,e,i,n){for(var r in i=i||0,n=n||5,e)if(e.hasOwnProperty(r)){var a=e[r];null!==a&&f(a)?(f(t[r])||(t[r]={}),i<n?I(t[r],a,i+1,n):t[r]=e[r]):o(a)?(t[r]=[],t[r]=t[r].concat(a)):void 0!==a&&(t[r]=a)}}var E=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=0;n<e.length;n+=1)I(t,e[n]);return t},Y=function(t,i){if(!e(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,i);for(var r=-1,a=0;a<t.length;a++)if(t[a]===i){r=a;break}return r},O=Object.prototype.hasOwnProperty;function N(t){if(s(t))return!0;if(e(t))return!t.length;var i=function(t){return w.call(t).replace(/^\[object /,"").replace(/]$/,"")}(t);if("Map"===i||"Set"===i)return!t.size;if(function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||D)}(t))return!Object.keys(t).length;for(var n in t)if(O.call(t,n))return!1;return!0}var z=function(t,i){if(t===i)return!0;if(!t||!i)return!1;if(g(t)||g(i))return!1;if(e(t)||e(i)){if(t.length!==i.length)return!1;for(var n=!0,r=0;r<t.length&&(n=z(t[r],i[r]));r++);return n}if(c(t)||c(i)){var a=Object.keys(t),s=Object.keys(i);if(a.length!==s.length)return!1;for(n=!0,r=0;r<a.length&&(n=z(t[a[r]],i[a[r]]));r++);return n}return!1};function L(t){return s(t)?0:e(t)?t.length:Object.keys(t).length}
- /*! *****************************************************************************
- Copyright (c) Microsoft Corporation.
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */var X,B=function(t,e){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function F(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}B(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function R(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),r=0;for(e=0;e<i;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,r++)n[r]=a[s];return n}function j(t){for(var e=[],i=0,n=t.length;i<n;i++)e=e.concat(t[i]);return e}function G(t,e){for(var i=[],n={},r=0,a=t.length;r<a;r++){var l=t[r][e];s(l)||(o(l)?h(l,(function(t){n[t]||(i.push(t),n[t]=!0)})):n[l]||(i.push(l),n[l]=!0))}return i}function H(t,e){for(var i=null,n=0,r=t.length;n<r;n++){var a=t[n][e];if(!s(a)){i=o(a)?a[0]:a;break}}return i}function W(t,e){if(!e)return{0:t};for(var i=function(t){for(var i="_",n=0,r=e.length;n<r;n++)i+=t[e[n]]&&t[e[n]].toString();return i},n={},r=0,a=t.length;r<a;r++){var s=t[r],o=i(s);n[o]?n[o].push(s):n[o]=[s]}return n}function V(t,e,i){if(void 0===i&&(i={}),!e)return[t];var n=W(t,e),r=[];if(1===e.length&&i[e[0]])h(i[e[0]],(function(t){t="_"+t,r.push(n[t])}));else for(var a in n)r.push(n[a]);return r}function q(t,e){if(t){var i=t.indexOf(e);-1!==i&&t.splice(i,1)}}function U(t){if(!t.length)return{min:0,max:0};var e=Math.max.apply(null,t);return{min:Math.min.apply(null,t),max:e}}!function(t,e){if(!a(t))throw new TypeError("Expected a function");var i=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var a=e?e.apply(this,n):n[0],s=i.cache;if(s.has(a))return s.get(a);var o=t.apply(this,n);return s.set(a,o),o};i.cache=new Map}((function(t,e){void 0===e&&(e={});var i=e.fontSize,n=e.fontFamily,r=e.fontWeight,a=e.fontStyle,s=e.fontVariant;return X||(X=document.createElement("canvas").getContext("2d")),X.font=[a,s,r,i+"px",n].join(" "),X.measureText(g(t)?t:"").width}),(function(t,e){return void 0===e&&(e={}),R([t],_(e)).join("")}));var Z=Object.freeze({__proto__:null,merge:j,values:G,firstValue:H,group:V,groupToMap:W,remove:q,getRange:U}),J=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0},$="object"==typeof wx&&"function"==typeof wx.getSystemInfoSync,K="object"==typeof my&&"function"==typeof my.getSystemInfoSync,Q=typeof global&&!1,tt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.sessionStorage;function et(t){return!(!t||"object"!=typeof t)&&(!(1!==t.nodeType||!t.nodeName)||!!t.isCanvasElement)}function it(){return window&&window.devicePixelRatio||1}function nt(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function rt(t){var e=nt(t,"width");return"auto"===e&&(e=t.offsetWidth),parseFloat(e)}function at(t){var e=nt(t,"height");return"auto"===e&&(e=t.offsetHeight),parseFloat(e)}function st(t){return t?document.getElementById(t):null}function ot(t,e){var i=e.get("el");if(!i)return t;var n=i.getBoundingClientRect(),r=n.top,a=n.left,s=parseFloat(nt(i,"padding-left")),o=parseFloat(nt(i,"padding-top"));return{x:t.x-a-s,y:t.y-r-o}}function lt(t,e,i){t.addEventListener(e,i,J)}function ht(t,e,i){t.removeEventListener(e,i,J)}function ut(t,e){var i=e.get("landscape");if(!i)return t;if(a(i))return i(t,e);var n=e.get("height");return{x:t.y,y:n-t.x}}function ct(t,e){var i=t.touches;if(!i)return[ut(ot({x:t.clientX,y:t.clientY},e),e)];i.length||(i=t.changedTouches||[]);for(var n=[],r=0,a=i.length;r<a;r++){var s=i[r],o=s.x,l=s.y,h=s.clientX,u=s.clientY,c=void 0;c=x(o)||x(l)?{x:o,y:l}:ot({x:h,y:u},e),n.push(ut(c,e))}return n}function ft(t,e){var i=ct(t,e.get("canvas"))[0]||{};return{type:t.type,chart:e,native:t,x:i.x,y:i.y}}function pt(t,e,i){return i||(i=document.createElement("canvas").getContext("2d")),i.font=e||"12px sans-serif",i.measureText(t)}function gt(t,e){t=Object.assign({},t),e=Object.assign({},e);var i=Object.getOwnPropertyNames(t),n=Object.getOwnPropertyNames(e);if(i.length!==n.length)return!1;for(var r=0,a=i.length;r<a;r++){var s=i[r];if(t[s]!==e[s])return!1}return!0}function dt(t){var e,i,n,r;return x(t)||g(t)?e=n=r=i=t:o(t)&&(e=t[0],i=s(t[1])?t[0]:t[1],n=s(t[2])?t[0]:t[2],r=s(t[3])?i:t[3]),[e,i,n,r]}function vt(t,e){return void 0===t||"string"==typeof t&&-1!==t.indexOf(e)}function mt(t){return g(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),T(t)&&(t=t.getTime()),t}var yt=Object.freeze({__proto__:null,Array:Z,upperFirst:C,lowerFirst:b,isString:g,isNumber:x,isBoolean:P,isFunction:a,isDate:T,isArray:o,isNil:s,isObject:l,isPlainObject:f,isEqual:z,deepMix:E,mix:A,each:h,uniq:d,find:function(t,e){if(!o(t))return null;var i;if(a(e)&&(i=e),f(e)&&(i=function(t){return function(t,e){var i=u(e),n=i.length;if(s(t))return!n;for(var r=0;r<n;r+=1){var a=i[r];if(e[a]!==t[a]||!(a in t))return!1}return!0}(t,e)}),i)for(var n=0;n<t.length;n+=1)if(i(t[n]))return t[n];return null},isObjectValueEqual:gt,parsePadding:dt,directionEnabled:vt,toTimeStamp:mt,substitute:M,isWx:$,isMy:K,isNode:Q,isBrowser:tt,isCanvasElement:et,getPixelRatio:it,getStyle:nt,getWidth:rt,getHeight:at,getDomById:st,getRelativePosition:ot,addEventListener:lt,removeEventListener:ht,createEvent:ft,convertPoints:ct,measureText:pt}),xt={label:{fill:"#808080",fontSize:10},line:{stroke:"#E8E8E8",lineWidth:1},grid:{type:"line",stroke:"#E8E8E8",lineWidth:1,lineDash:[2]},tickLine:null,labelOffset:7.5},_t={fontFamily:'"Helvetica Neue", "San Francisco", Helvetica, Tahoma, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", sans-serif',defaultColor:"#1890FF",pixelRatio:1,padding:"auto",appendPadding:15,colors:["#1890FF","#2FC25B","#FACC14","#223273","#8543E0","#13C2C2","#3436C7","#F04864"],shapes:{line:["line","dash"],point:["circle","hollowCircle"]},sizes:[4,10],axis:{common:xt,bottom:A({},xt,{grid:null}),left:A({},xt,{line:null}),right:A({},xt,{line:null}),circle:A({},xt,{line:null}),radius:A({},xt,{labelOffset:4})},shape:{line:{lineWidth:2,lineJoin:"round",lineCap:"round"},point:{lineWidth:0,size:3},area:{fillOpacity:.1}},_defaultAxis:xt},St={general:{title:"这是一个图表,",withTitle:"这是一个关于“{title}”的图表。"},coord:{cartesian:"X轴是{xLabel}Y轴是{yLabel}"},scale:{linear:"数值型,数据最小值为{min},最大值为{max};",cat:"分类型, 分类类型有:{values};",timeCat:"时间型,时间范围从{start}到{end};"},geometry:{prefix:"共有{count}种分类组成,",oneData:"第{index}类是{name},数据是{values};",partData:"第{index}类是{name},共有{count}项数据,前{part}项是{values};",allData:"第{index}类是{name},有{count}项数据,分别是{values};"},legend:{prefix:"图例分类有:"}},bt={version:"3.8.10-beta.1",scales:{},widthRatio:{column:.5,rose:.999999,multiplePie:3/4},lineDash:[4,4],lang:St};function Mt(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Ct(){return(Ct=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}).apply(this,arguments)}function wt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Pt(t,e)}function Pt(t,e){return(Pt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Tt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}bt.setTheme=function(t){E(bt,t)},bt.setTheme(_t);var Dt=function(){function t(){this.__events={}}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this.__events[t]||[];i.push(e),this.__events[t]=i}},e.emit=function(t,e){var i=this;if(l(t)&&(t=(e=t)&&e.type),t){var n=this.__events[t];n&&n.length&&n.forEach((function(t){t.call(i,e)}))}},e.off=function(t,e){var i=this.__events,n=i[t];if(n&&n.length)if(e)for(var r=0,a=n.length;r<a;r++)n[r]===e&&(n.splice(r,1),r--);else delete i[t]},t}(),kt=function(t){wt(i,t);var e=i.prototype;function i(e){var i,n={},r=(i=t.call(this)||this).getDefaultCfg();return i._attrs=n,A(n,r,e),i}return e.getDefaultCfg=function(){return{}},e.get=function(t){return this._attrs[t]},e.set=function(t,e){this._attrs[t]=e},e.destroy=function(){this._attrs={},this.destroyed=!0},i}(Dt),At=function(){function t(t){A(this,t),this._init()}var e=t.prototype;return e._init=function(){var t=this.start,e=this.end,i=Math.min(t.x,e.x),n=Math.max(t.x,e.x),r=Math.min(t.y,e.y),a=Math.max(t.y,e.y);this.tl={x:i,y:r},this.tr={x:n,y:r},this.bl={x:i,y:a},this.br={x:n,y:a},this.width=n-i,this.height=a-r},e.reset=function(t,e){this.start=t,this.end=e,this._init()},e.isInRange=function(t,e){l(t)&&(e=t.y,t=t.x);var i=this.tl,n=this.br;return i.x<=t&&t<=n.x&&i.y<=e&&e<=n.y},t}(),It={generateDefault:function(){return[1,0,0,1,0,0]},isChanged:function(t){return 1!==t[0]||0!==t[1]||0!==t[2]||1!==t[3]||0!==t[4]||0!==t[5]},multiply:function(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]},scale:function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[0],t[2]=e[2]*i[1],t[3]=e[3]*i[1],t[4]=e[4],t[5]=e[5],t},rotate:function(t,e,i){var n=Math.cos(i),r=Math.sin(i),a=e[0]*n+e[2]*r,s=e[1]*n+e[3]*r,o=e[0]*-r+e[2]*n,l=e[1]*-r+e[3]*n;return t[0]=a,t[1]=s,t[2]=o,t[3]=l,t[4]=e[4],t[5]=e[5],t},translate:function(t,e,i){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+e[0]*i[0]+e[2]*i[1],t[5]=e[5]+e[1]*i[0]+e[3]*i[1],t},transform:function(t,e){for(var i=[].concat(t),n=0,r=e.length;n<r;n++){var a=e[n];switch(a[0]){case"t":It.translate(i,i,[a[1],a[2]]);break;case"s":It.scale(i,i,[a[1],a[2]]);break;case"r":It.rotate(i,i,a[1])}}return i}},Et={create:function(){return[0,0]},length:function(t){var e=t[0],i=t[1];return Math.sqrt(e*e+i*i)},normalize:function(t,e){var i=this.length(e);return 0===i?(t[0]=0,t[1]=0):(t[0]=e[0]/i,t[1]=e[1]/i),t},add:function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t},sub:function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t},scale:function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},direction:function(t,e){return t[0]*e[1]-e[0]*t[1]},angle:function(t,e){var i=this.dot(t,e)/(this.length(t)*this.length(e));return Math.acos(i)},angleTo:function(t,e,i){var n=this.angle(t,e),r=this.direction(t,e)>=0;return i?r?2*Math.PI-n:n:r?n:2*Math.PI-n},zero:function(t){return 0===t[0]&&0===t[1]},distance:function(t,e){var i=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(i*i+n*n)},clone:function(t){return[t[0],t[1]]},min:function(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t},max:function(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t},transformMat2d:function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r+i[4],t[1]=i[1]*n+i[3]*r+i[5],t}},Yt=[1,0,0,1,0,0],Ot=function(){var t=e.prototype;function e(t){var e,i;this._initDefaultCfg(),A(this,t),this.plot?(e=this.plot.bl,i=this.plot.tr,this.start=e,this.end=i):(e=this.start,i=this.end),this.init(e,i)}return t._initDefaultCfg=function(){},t._scale=function(t,e){var i=this.matrix,n=this.center;It.translate(i,i,[n.x,n.y]),It.scale(i,i,[t,e]),It.translate(i,i,[-n.x,-n.y])},t.init=function(t,e){this.matrix=[].concat(Yt),this.center={x:(e.x-t.x)/2+t.x,y:(e.y-t.y)/2+t.y},this.scale&&this._scale(this.scale[0],this.scale[1])},t.convertPoint=function(t){var e=this._convertPoint(t),i=e.x,n=e.y;if(!It.isChanged(this.matrix))return{x:i,y:n};var r=[i,n];return Et.transformMat2d(r,r,this.matrix),{x:r[0],y:r[1]}},t.invertPoint=function(t){return this._invertPoint(t)},t._convertPoint=function(t){return t},t._invertPoint=function(t){return t},t.reset=function(t){this.plot=t;var e=t.bl,i=t.tr;this.start=e,this.end=i,this.init(e,i)},e}(),Nt=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="cartesian",this.transposed=!1,this.isRect=!0},i.init=function(e,i){t.prototype.init.call(this,e,i),this.x={start:e.x,end:i.x},this.y={start:e.y,end:i.y}},i._convertPoint=function(t){var e=this.transposed,i=e?"y":"x",n=e?"x":"y",r=this.x,a=this.y;return{x:r.start+(r.end-r.start)*t[i],y:a.start+(a.end-a.start)*t[n]}},i._invertPoint=function(t){var e=this.transposed,i=e?"y":"x",n=e?"x":"y",r=this.x,a=this.y,s={};return s[i]=(t.x-r.start)/(r.end-r.start),s[n]=(t.y-a.start)/(a.end-a.start),s},e}(Ot);function zt(t,e){return g(e)?e:t.invert(t.scale(e))}Ot.Cartesian=Nt,Ot.Rect=Nt;var Lt=function(){function t(t){var e=this;this.type="base",this.name=null,this.method=null,this.values=[],this.scales=[],this.linear=null;var i=null,n=this.callback;if(t.callback){var r=t.callback;i=function(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];var o=r.apply(void 0,i);return s(o)&&(o=n.apply(e,i)),o}}A(this,t),i&&A(this,{callback:i})}var e=t.prototype;return e._getAttrValue=function(t,e){var i=this.values;if(t.isCategory&&!this.linear)return i[t.translate(e)%i.length];var n=t.scale(e);return this.getLinearValue(n)},e.getLinearValue=function(t){var e=this.values,i=e.length-1,n=Math.floor(i*t),r=i*t-n,a=e[n];return a+((n===i?a:e[n+1])-a)*r},e.callback=function(t){var e=this.scales[0];return"identity"===e.type?e.value:this._getAttrValue(e,t)},e.getNames=function(){for(var t=this.scales,e=this.names,i=Math.min(t.length,e.length),n=[],r=0;r<i;r++)n.push(e[r]);return n},e.getFields=function(){var t=this.scales,e=[];return h(t,(function(t){e.push(t.field)})),e},e.getScale=function(t){return this.scales[this.names.indexOf(t)]},e.mapping=function(){for(var t=this.scales,e=this.callback,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];var a=n;if(e){for(var s=0,o=n.length;s<o;s++)n[s]=this._toOriginParam(n[s],t[s]);a=e.apply(this,n)}return a=[].concat(a)},e._toOriginParam=function(t,e){var i=t;if(!e.isLinear)if(o(t)){i=[];for(var n=0,r=t.length;n<r;n++)i.push(zt(e,t[n]))}else i=zt(e,t);return i},t}(),Xt=function(t){function e(e){var i;return(i=t.call(this,e)||this).names=["x","y"],i.type="position",i}return wt(e,t),e.prototype.mapping=function(t,e){var i,n,r,a=this.scales,l=this.coord,u=a[0],c=a[1];if(s(t)||s(e))return[];if(o(e)&&o(t)){i=[],n=[];for(var f=0,p=0,g=t.length,d=e.length;f<g&&p<d;f++,p++)r=l.convertPoint({x:u.scale(t[f]),y:c.scale(e[p])}),i.push(r.x),n.push(r.y)}else if(o(e))t=u.scale(t),n=[],h(e,(function(e){e=c.scale(e),r=l.convertPoint({x:t,y:e}),i&&i!==r.x?(o(i)||(i=[i]),i.push(r.x)):i=r.x,n.push(r.y)}));else if(o(t))e=c.scale(e),i=[],h(t,(function(t){t=u.scale(t),r=l.convertPoint({x:t,y:e}),n&&n!==r.y?(o(n)||(n=[n]),n.push(r.y)):n=r.y,i.push(r.x)}));else{t=u.scale(t),e=c.scale(e);var v=l.convertPoint({x:t,y:e});i=v.x,n=v.y}return[i,n]},e}(Lt),Bt=function(t){function e(e){var i;return(i=t.call(this,e)||this).names=["shape"],i.type="shape",i.gradient=null,i}return wt(e,t),e.prototype.getLinearValue=function(t){var e=this.values;return e[Math.round((e.length-1)*t)]},e}(Lt),Ft=function(t){function e(e){var i;return(i=t.call(this,e)||this).names=["size"],i.type="size",i.gradient=null,i}return wt(e,t),e}(Lt);function Rt(t,e,i,n){return t[n]+(e[n]-t[n])*i}function jt(t){return"#"+Gt(t[0])+Gt(t[1])+Gt(t[2])}function Gt(t){return 1===(t=(t=Math.round(t)).toString(16)).length&&(t="0"+t),t}var Ht={black:"#000000",blue:"#0000ff",grey:"#808080",green:"#008000",orange:"#ffa500",pink:"#ffc0cb",purple:"#800080",red:"#ff0000",white:"#ffffff",yellow:"#ffff00"};function Wt(t){var e=[];return g(t)&&(t=t.split("-")),h(t,(function(t){var i,n;-1===t.indexOf("#")&&(t=function(t){if(Ht[t])return Ht[t];if("#"===t[0]){if(7===t.length)return t;var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,n){return"#"+e+e+i+i+n+n}));return Ht[t]=e,e}var i=t.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);return i.shift(),i=jt(i),Ht[t]=i,i}(t)),e.push((i=t,(n=[]).push(parseInt(i.substr(1,2),16)),n.push(parseInt(i.substr(3,2),16)),n.push(parseInt(i.substr(5,2),16)),n))})),function(t){return function(t,e){var i=t.length-1,n=Math.floor(i*e),r=i*e-n,a=t[n],s=n===i?a:t[n+1];return jt([Rt(a,s,r,0),Rt(a,s,r,1),Rt(a,s,r,2)])}(e,t)}}var Vt=function(t){function e(e){var i;return(i=t.call(this,e)||this).names=["color"],i.type="color",i.gradient=null,g(i.values)&&(i.linear=!0),i}return wt(e,t),e.prototype.getLinearValue=function(t){var e=this.gradient;e||(e=Wt(this.values),this.gradient=e);return e(t)},e}(Lt),qt=Object.freeze({__proto__:null,Position:Xt,Shape:Bt,Size:Ft,Color:Vt}),Ut={},Zt={_coord:null,draw:function(t,e){this.drawShape&&this.drawShape(t,e)},setCoord:function(t){this._coord=t},parsePoint:function(t){var e=this._coord;return e.isPolar&&(1===t.x&&(t.x=.9999999),1===t.y&&(t.y=.9999999)),e.convertPoint(t)},parsePoints:function(t){if(!t)return!1;var e=this,i=[];return t.forEach((function(t){i.push(e.parsePoint(t))})),i}},Jt={defaultShapeType:null,setCoord:function(t){this._coord=t},getShape:function(t){o(t)&&(t=t[0]);var e=this[t]||this[this.defaultShapeType];return e._coord=this._coord,e},getShapePoints:function(t,e){var i=this.getShape(t);return(i.getPoints||i.getShapePoints||this.getDefaultPoints)(e)},getDefaultPoints:function(){return[]},drawShape:function(t,e,i){var n=this.getShape(t);return e.color||(e.color=bt.colors[0]),n.draw(e,i)}};function $t(t,e){for(var i in e)e.hasOwnProperty(i)&&"constructor"!==i&&void 0!==e[i]&&(t[i]=e[i])}Ut.registerFactory=function(t,e){var i=C(t),n=A({},Jt,e);return Ut[i]=n,n.name=t,n},Ut.registerShape=function(t,e,i){var n=C(t),r=Ut[n],a=A({},Zt,i);return r[e]=a,a},Ut.registShape=Ut.registerShape,Ut.getShapeFactory=function(t){return this[C(t=t||"point")]};var Kt=function(t,e,i,n){return e&&$t(t,e),i&&$t(t,i),n&&$t(t,n),t},Qt=function(){var t=e.prototype;function e(t){this._initDefaultCfg(),Kt(this,t)}return t._initDefaultCfg=function(){this.adjustNames=["x","y"]},t.processAdjust=function(){},e}();function te(t){var e=t.type,i=t.values;if("linear"===e)return M(St.scale.linear,t);if("cat"===e)return M(St.scale.cat,{values:i.slice(0,10).join(" ")});if("timeCat"===e){var n=t.getText(i[0]),r=t.getText(i[i.length-1]);return M(St.scale.timeCat,{start:n,end:r})}return""}var ee=["color","size","shape"];function ie(t){return o(t)?t:g(t)?t.split("*"):[t]}var ne=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i.getDefaultCfg=function(){return{type:null,data:null,attrs:{},scales:{},container:null,styleOptions:null,chart:null,shapeType:"",generatePoints:!1,attrOptions:{},sortable:!1,startOnZero:!0,visible:!0,connectNulls:!1,ignoreEmptyGroup:!1,isInit:!1}},i.init=function(){this.get("isInit")||(this._initAttrs(),this._processData(),this.set("isInit",!0))},i._getGroupScales=function(){var t=this,e=[];return h(ee,(function(i){var n=t.getAttr(i);n&&h(n.scales,(function(t){t&&t.isCategory&&-1===e.indexOf(t)&&e.push(t)}))})),e},i._groupData=function(t){var e=this.get("colDefs"),i=this._getGroupScales();if(i.length){var n={},r=[];return h(i,(function(t){var i=t.field;r.push(i),e&&e[i]&&e[i].values&&(n[t.field]=e[i].values)})),V(t,r,n)}return[t]},i._setAttrOptions=function(t,e){this.get("attrOptions")[t]=e;var i=this.get("attrs");Object.keys(i).length&&this._createAttr(t,e)},i._createAttrOption=function(t,e,i,n){var r={};r.field=e,i?a(i)?r.callback=i:r.values=i:r.values=n,this._setAttrOptions(t,r)},i._createAttr=function(t,e){var i=this.get("attrs"),n=this.get("coord"),r=C(t),a=ie(e.field);"position"===t&&(e.coord=n);for(var s=[],o=0,l=a.length;o<l;o++){var h=a[o],u=this._createScale(h);s.push(u)}if("position"===t){var c=s[1];"polar"===n.type&&n.transposed&&this.hasAdjust("stack")&&c.values.length&&c.change({nice:!1,min:0,max:Math.max.apply(null,c.values)})}e.scales=s;var f=new qt[r](e);return i[t]=f,f},i._initAttrs=function(){var t=this.get("attrOptions");for(var e in t)t.hasOwnProperty(e)&&this._createAttr(e,t[e])},i._createScale=function(t){var e=this.get("scales"),i=e[t];return i||(i=this.get("chart").createScale(t),e[t]=i),i},i._processData=function(){var t=this.get("data"),e=[],i=this._groupData(t);if(this.get("ignoreEmptyGroup")){var n=this.getYScale();i=i.filter((function(t){return t.some((function(t){return void 0!==t[n.field]}))}))}for(var r=0,a=i.length;r<a;r++){var s=i[r],o=this._saveOrigin(s);this.hasAdjust("dodge")&&this._numberic(o),e.push(o)}return this.get("adjust")&&this._adjustData(e),this.get("sortable")&&this._sort(e),this.emit("afterprocessdata",{dataArray:e}),this.set("mappingData",e),this.set("dataArray",e),e},i._saveOrigin=function(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i],a={};for(var s in r)a[s]=r[s];a._origin=r,e.push(a)}return e},i._numberic=function(t){for(var e=this.getAttr("position").scales,i=0,n=t.length;i<n;i++)for(var r=t[i],a=Math.min(2,e.length),s=0;s<a;s++){var o=e[s];if(o.isCategory){var l=o.field;r[l]=o.translate(r[l])}}},i._adjustData=function(t){var e=this.get("adjust");if(e){var i=C(e.type);if(!Qt[i])throw new Error("not support such adjust : "+e);var n=this.getXScale(),r=this.getYScale(),a=A({xField:n.field,yField:r.field},e);new Qt[i](a).processAdjust(t),"Stack"===i&&this._updateStackRange(r.field,r,t)}},i._updateStackRange=function(t,e,i){for(var n=j(i),r=e.min,a=e.max,s=0,o=n.length;s<o;s++){var l=n[s],h=Math.min.apply(null,l[t]),u=Math.max.apply(null,l[t]);h<r&&(r=h),u>a&&(a=u)}(r<e.min||a>e.max)&&e.change({min:r,max:a})},i._sort=function(t){var e=this.getXScale(),i=e.field,n=e.type;"identity"!==n&&e.values.length>1&&h(t,(function(t){t.sort((function(t,r){return"timeCat"===n?mt(t._origin[i])-mt(r._origin[i]):e.translate(t._origin[i])-e.translate(r._origin[i])}))})),this.set("hasSorted",!0),this.set("dataArray",t)},i.paint=function(){var t=this.get("mappingData"),e=[],i=this.getShapeFactory();i.setCoord(this.get("coord")),this._beforeMapping(t);for(var n=0,r=t.length;n<r;n++){var a=t[n];if(a.length){var s=this._mapping(a);e.push(s),this.draw(s,i)}}this.set("dataArray",e),this.generateAria()},i.getShapeFactory=function(){var t=this.get("shapeFactory");if(!t){var e=this.get("shapeType");t=Ut.getShapeFactory(e),this.set("shapeFactory",t)}return t},i._mapping=function(t){var e=this.get("attrs"),i=this.getYScale().field,n={},r=new Array(t.length);for(var a in e)if(e.hasOwnProperty(a))for(var s=e[a],l=s.names,h=s.scales,u=0,c=t.length;u<c;u++){var f=t[u],p=Ct({},f,r[u]);if(p._originY=f[i],"position"===s.type)for(var g=this._getAttrValues(s,f),d=0,v=g.length;d<v;d++){var m=g[d];p[l[d]]=o(m)&&1===m.length?m[0]:m}else{var y=l[0],x=""+y+f[h[0].field],_=n[x];_||(_=this._getAttrValues(s,f),n[x]=_),p[y]=_[0]}r[u]=p}return r},i._getAttrValues=function(t,e){for(var i=t.scales,n=[],r=0,a=i.length;r<a;r++){var s=i[r],o=s.field;"identity"===s.type?n.push(s.value):n.push(e[o])}return t.mapping.apply(t,n)},i.getAttrValue=function(t,e){var i=this.getAttr(t),n=null;i&&(n=this._getAttrValues(i,e)[0]);return n},i._beforeMapping=function(t){this.get("generatePoints")&&this._generatePoints(t)},i.isInCircle=function(){var t=this.get("coord");return t&&t.isPolar},i.getCallbackCfg=function(t,e,i){if(!t)return e;var n={},r=t.map((function(t){return i[t]}));return h(e,(function(t,e){a(t)?n[e]=t.apply(null,r):n[e]=t})),n},i.getDrawCfg=function(t){var e=this.isInCircle(),i={origin:t,x:t.x,y:t.y,color:t.color,size:t.size,shape:t.shape,isInCircle:e,opacity:t.opacity},n=this.get("styleOptions");return n&&n.style&&(i.style=this.getCallbackCfg(n.fields,n.style,t._origin)),this.get("generatePoints")&&(i.points=t.points,i.nextPoints=t.nextPoints),e&&(i.center=this.get("coord").center),i},i.draw=function(t,e){var i=this,n=i.get("container"),r=i.getYScale();h(t,(function(t,a){if(!r||!s(t._origin[r.field])){t.index=a;var o=i.getDrawCfg(t),l=t.shape;i.drawShape(l,t,o,n,e)}}))},i.drawShape=function(t,e,i,n,r){var a=r.drawShape(t,i,n);a&&h([].concat(a),(function(t){t.set("origin",e)}))},i._generatePoints=function(t){var e=this,i=e.getShapeFactory(),n=e.getAttr("shape");h(t,(function(t){for(var r=0,a=t.length;r<a;r++){var s=t[r],o=e.createShapePointsCfg(s),l=n?e._getAttrValues(n,s):null,h=i.getShapePoints(l,o);s.points=h}})),h(t,(function(e,i){var n=t[i+1];n&&(e[0].nextPoints=n[0].points)}))},i.generateAria=function(){var t=this.get("container");if(t.get("aria")){var e=[],i=this.get("coord"),n=this.getXScale(),r=this.getYScale(),a=function(t,e,i){var n=t.type;return St.coord[n]?M(St.coord[n],{xLabel:te(e),yLabel:te(i)}):""}(i,n,r);e.push(a);var s=St.geometry,o=s.prefix,l=s.oneData,u=s.partData,c=s.allData,f=this.get("dataArray"),p=f.length,g=this._getGroupScales()[0];if(g){var d=M(o,{count:p});e.push(d),h(f,(function(t,i){var a=t.length;if(a){var s=t[0]._origin;if(1===a)e.push(M(l,{index:i+1,count:a,name:s[g.field],values:s[r.field]}));else{var o=a>5?u:c,h=t.slice(0,5).map((function(t){var e=t._origin;return n.getText(e[n.field])+":"+r.getText(e[r.field])}));e.push(M(o,{index:i+1,count:a,part:3,name:s[g.field],values:h.join(" ")}))}}}))}t.set("ariaLabel",e.join(""))}},i.createShapePointsCfg=function(t){var e=this.getXScale(),i=this.getYScale();return{x:this._normalizeValues(t[e.field],e),y:i?this._normalizeValues(t[i.field],i):t.y?t.y:.1,y0:i?i.scale(this.getYMinValue()):void 0}},i.getYMinValue=function(){var t=this.getYScale(),e=t.min,i=t.max;return this.get("startOnZero")?i<=0&&e<=0?i:e>=0?e:0:e},i._normalizeValues=function(t,e){var i=[];if(o(t))for(var n=0,r=t.length;n<r;n++){var a=t[n];i.push(e.scale(a))}else i=e.scale(t);return i},i.getAttr=function(t){return this.get("attrs")[t]},i.getXScale=function(){return this.getAttr("position").scales[0]},i.getYScale=function(){return this.getAttr("position").scales[1]},i.hasAdjust=function(t){return this.get("adjust")&&this.get("adjust").type===t},i._getSnap=function(t,e,i){var n,r=0,a=this.getYScale().field;if(this.hasAdjust("stack")&&t.field===a){n=[],i.forEach((function(t){n.push(t._originY)}));for(var s=n.length;r<s&&!(n[0][0]>e);r++){if(n[n.length-1][1]<=e){r=n.length-1;break}if(n[r][0]<=e&&n[r][1]>e)break}}else{(n=t.values).sort((function(t,e){return t-e}));for(var o=n.length;r<o&&!(o<=1)&&!((n[0]+n[1])/2>e)&&!((n[r-1]+n[r])/2<=e&&(n[r+1]+n[r])/2>e);r++)if((n[n.length-2]+n[n.length-1])/2<=e){r=n.length-1;break}}return n[r]},i.getSnapRecords=function(t){var e=this,i=e.get("coord"),n=e.getXScale(),r=e.getYScale(),a=n.field,l=e.get("dataArray");this.get("hasSorted")||this._sort(l);var h=[],u=i.invertPoint(t),c=u.x;e.isInCircle()&&!i.transposed&&c>(1+n.rangeMax())/2&&(c=n.rangeMin());var f=n.invert(c);n.isCategory||(f=e._getSnap(n,f));var p=[];if(l.forEach((function(t){t.forEach((function(t){var i=s(t._origin)?t[a]:t._origin[a];e._isEqual(i,f,n)&&p.push(t)}))})),this.hasAdjust("stack")&&i.isPolar&&i.transposed){if(c>=0&&c<=1){var g=r.invert(u.y);g=e._getSnap(r,g,p),p.forEach((function(t){(o(g)?t._originY.toString()===g.toString():t._originY===g)&&h.push(t)}))}}else h=p;return h},i.getRecords=function(t){var e=this,i=this.getXScale(),n=this.get("dataArray"),r=i.field;return n.map((function(n){for(var a=n.length-1;a>=0;a--){var o=n[a],l=s(o._origin)?o[r]:o._origin[r];if(e._isEqual(l,t,i))return o}return null}))},i._isEqual=function(t,e,i){return"timeCat"===i.type?mt(t)===e:e===t},i.position=function(t){return this._setAttrOptions("position",{field:t}),this},i.color=function(t,e){return this._createAttrOption("color",t,e,bt.colors),this},i.size=function(t,e){return this._createAttrOption("size",t,e,bt.sizes),this},i.shape=function(t,e){var i=this.get("type"),n=bt.shapes[i]||[];return this._createAttrOption("shape",t,e,n),this},i.style=function(t,e){var i,n=this.get("styleOptions");return n||(n={},this.set("styleOptions",n)),l(t)&&(e=t,t=null),t&&(i=ie(t)),n.fields=i,n.style=e,this},i.adjust=function(t){return g(t)&&(t={type:t}),this.set("adjust",t),this},i.animate=function(t){return this.set("animateCfg",t),this},i.changeData=function(t){this.set("data",t),this.set("scales",{}),this.get("isInit")&&(this.set("isInit",!1),this.init())},i.clearInner=function(){var t=this.get("container");t&&t.clear()},i.reset=function(){this.set("isInit",!1),this.set("attrs",{}),this.set("attrOptions",{}),this.set("adjust",null),this.clearInner()},i.clear=function(){this.clearInner()},i.destroy=function(){this.set("isInit",!1),this.clear(),t.prototype.destroy.call(this)},i._display=function(t){this.set("visible",t);var e=this.get("container"),i=e.get("canvas");e.set("visible",t),i.draw()},i.show=function(){this._display(!0)},i.hide=function(){this._display(!1)},e}(kt),re={};function ae(t){return re[t]}function se(t,e){re[t]=e}var oe=function(){function t(t){this.type="base",this.isCategory=!1,this.isLinear=!1,this.isContinuous=!1,this.isIdentity=!1,this.values=[],this.range=[0,1],this.ticks=[],this.__cfg__=t,this.initCfg(),this.init()}return t.prototype.translate=function(t){return t},t.prototype.change=function(t){A(this.__cfg__,t),this.init()},t.prototype.clone=function(){return this.constructor(this.__cfg__)},t.prototype.getTicks=function(){var t=this;return function(t,i){if(!e(t))return t;for(var n=[],r=0;r<t.length;r++){var a=t[r];n.push(i(a,r))}return n}(this.ticks,(function(e,i){return l(e)?e:{text:t.getText(e,i),tickValue:e,value:t.scale(e)}}))},t.prototype.getText=function(t,e){var i=this.formatter,n=i?i(t,e):t;return s(n)||!a(n.toString)?"":n.toString()},t.prototype.getConfig=function(t){return this.__cfg__[t]},t.prototype.init=function(){A(this,this.__cfg__),this.setDomain(),N(this.getConfig("ticks"))&&(this.ticks=this.calculateTicks())},t.prototype.initCfg=function(){},t.prototype.setDomain=function(){},t.prototype.calculateTicks=function(){var t=this.tickMethod,e=[];if(g(t)){var i=ae(t);if(!i)throw new Error("There is no method to to calculate ticks!");e=i(this)}else a(t)&&(e=t(this));return e},t.prototype.rangeMin=function(){return this.range[0]},t.prototype.rangeMax=function(){return this.range[1]},t.prototype.calcPercent=function(t,e,i){return x(t)?(t-e)/(i-e):NaN},t.prototype.calcValue=function(t,e,i){return e+t*(i-e)},t}(),le=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cat",e.isCategory=!0,e}return F(e,t),e.prototype.buildIndexMap=function(){if(!this.translateIndexMap){this.translateIndexMap=new Map;for(var t=0;t<this.values.length;t++)this.translateIndexMap.set(this.values[t],t)}},e.prototype.translate=function(t){this.buildIndexMap();var e=this.translateIndexMap.get(t);return void 0===e&&(e=x(t)?t:NaN),e},e.prototype.scale=function(t){var e=this.translate(t),i=this.calcPercent(e,this.min,this.max);return this.calcValue(i,this.rangeMin(),this.rangeMax())},e.prototype.invert=function(t){var e=this.max-this.min,i=this.calcPercent(t,this.rangeMin(),this.rangeMax()),n=Math.round(e*i)+this.min;return n<this.min||n>this.max?NaN:this.values[n]},e.prototype.getText=function(e){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];var r=e;return x(e)&&!this.values.includes(e)&&(r=this.values[r]),t.prototype.getText.apply(this,R([r],i))},e.prototype.initCfg=function(){this.tickMethod="cat"},e.prototype.setDomain=function(){if(s(this.getConfig("min"))&&(this.min=0),s(this.getConfig("max"))){var t=this.values.length;this.max=t>1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(oe),he=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,ue="[^\\s]+",ce=/\[([^]*?)\]/gm;function fe(t,e){for(var i=[],n=0,r=t.length;n<r;n++)i.push(t[n].substr(0,e));return i}var pe=function(t){return function(e,i){var n=i[t].map((function(t){return t.toLowerCase()})).indexOf(e.toLowerCase());return n>-1?n:null}};function ge(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=0,r=e;n<r.length;n++){var a=r[n];for(var s in a)t[s]=a[s]}return t}var de=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ve=["January","February","March","April","May","June","July","August","September","October","November","December"],me=fe(ve,3),ye={dayNamesShort:fe(de,3),dayNames:de,monthNamesShort:me,monthNames:ve,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}},xe=ge({},ye),_e=function(t){return xe=ge(xe,t)},Se=function(t){return t.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},be=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},Me={D:function(t){return String(t.getDate())},DD:function(t){return be(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return be(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return be(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return be(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return be(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return be(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return be(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return be(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return be(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return be(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return be(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+be(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+be(Math.floor(Math.abs(e)/60),2)+":"+be(Math.abs(e)%60,2)}},Ce=function(t){return+t-1},we=[null,"[1-9]\\d?"],Pe=[null,ue],Te=["isPm",ue,function(t,e){var i=t.toLowerCase();return i===e.amPm[0]?0:i===e.amPm[1]?1:null}],De=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var i=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?i:-i}return 0}],ke={D:["day","[1-9]\\d?"],DD:["day","\\d\\d"],Do:["day","[1-9]\\d?"+ue,function(t){return parseInt(t,10)}],M:["month","[1-9]\\d?",Ce],MM:["month","\\d\\d",Ce],YY:["year","\\d\\d",function(t){var e=+(""+(new Date).getFullYear()).substr(0,2);return+(""+(+t>68?e-1:e)+t)}],h:["hour","[1-9]\\d?",void 0,"isPm"],hh:["hour","\\d\\d",void 0,"isPm"],H:["hour","[1-9]\\d?"],HH:["hour","\\d\\d"],m:["minute","[1-9]\\d?"],mm:["minute","\\d\\d"],s:["second","[1-9]\\d?"],ss:["second","\\d\\d"],YYYY:["year","\\d{4}"],S:["millisecond","\\d",function(t){return 100*+t}],SS:["millisecond","\\d\\d",function(t){return 10*+t}],SSS:["millisecond","\\d{3}"],d:we,dd:we,ddd:Pe,dddd:Pe,MMM:["month",ue,pe("monthNamesShort")],MMMM:["month",ue,pe("monthNames")],a:Te,A:Te,ZZ:De,Z:De},Ae={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Ie=function(t){return ge(Ae,t)},Ee=function(t,e,i){if(void 0===e&&(e=Ae.default),void 0===i&&(i={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var n=[];e=(e=Ae[e]||e).replace(ce,(function(t,e){return n.push(e),"@@@"}));var r=ge(ge({},xe),i);return(e=e.replace(he,(function(e){return Me[e](t,r)}))).replace(/@@@/g,(function(){return n.shift()}))};function Ye(t,e,i){if(void 0===i&&(i={}),"string"!=typeof e)throw new Error("Invalid format in fecha parse");if(e=Ae[e]||e,t.length>1e3)return null;var n={year:(new Date).getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},r=[],a=[],s=e.replace(ce,(function(t,e){return a.push(Se(e)),"@@@"})),o={},l={};s=Se(s).replace(he,(function(t){var e=ke[t],i=e[0],n=e[1],a=e[3];if(o[i])throw new Error("Invalid format. "+i+" specified twice in format");return o[i]=!0,a&&(l[a]=!0),r.push(e),"("+n+")"})),Object.keys(l).forEach((function(t){if(!o[t])throw new Error("Invalid format. "+t+" is required in specified format")})),s=s.replace(/@@@/g,(function(){return a.shift()}));var h=t.match(new RegExp(s,"i"));if(!h)return null;for(var u=ge(ge({},xe),i),c=1;c<h.length;c++){var f=r[c-1],p=f[0],g=f[2],d=g?g(h[c],u):+h[c];if(null==d)return null;n[p]=d}1===n.isPm&&null!=n.hour&&12!=+n.hour?n.hour=+n.hour+12:0===n.isPm&&12==+n.hour&&(n.hour=0);for(var v=new Date(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond),m=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],y=(c=0,m.length);c<y;c++)if(o[m[c][0]]&&n[m[c][0]]!==v[m[c][1]]())return null;return null==n.timezoneOffset?v:new Date(Date.UTC(n.year,n.month,n.day,n.hour,n.minute-n.timezoneOffset,n.second,n.millisecond))}var Oe={format:Ee,parse:Ye,defaultI18n:ye,setGlobalDateI18n:_e,setGlobalDateMasks:Ie},Ne=Object.freeze({__proto__:null,default:Oe,assign:ge,format:Ee,parse:Ye,defaultI18n:ye,setGlobalDateI18n:_e,setGlobalDateMasks:Ie});function ze(t,e){return(Ne.format||Oe.format)(t,e)}function Le(t){return g(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),T(t)&&(t=t.getTime()),t}var Xe=36e5,Be=24*Xe,Fe=31*Be,Re=[["HH:mm:ss",1e3],["HH:mm:ss",1e4],["HH:mm:ss",3e4],["HH:mm",6e4],["HH:mm",6e5],["HH:mm",18e5],["HH",Xe],["HH",6*Xe],["HH",12*Xe],["YYYY-MM-DD",Be],["YYYY-MM-DD",4*Be],["YYYY-WW",7*Be],["YYYY-MM",Fe],["YYYY-MM",4*Fe],["YYYY-MM",6*Fe],["YYYY",380*Be]];function je(t,e,i){var n,r=(n=function(t){return t[1]},function(t,e,i,r){for(var a=s(i)?0:i,o=s(r)?t.length:r;a<o;){var l=a+o>>>1;n(t[l])>e?o=l:a=l+1}return a})(Re,(e-t)/i)-1,a=Re[r];return r<0?a=Re[0]:r>=Re.length&&(a=m(Re)),a}var Ge=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="timeCat",e}return F(e,t),e.prototype.translate=function(t){t=Le(t);var e=this.values.indexOf(t);return-1===e&&(e=x(t)&&t<this.values.length?t:NaN),e},e.prototype.getText=function(t,e){var i=this.translate(t);if(i>-1){var n=this.values[i],r=this.formatter;return n=r?r(n,e):ze(n,this.mask)}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var e=this.values;h(e,(function(t,i){e[i]=Le(t)})),e.sort((function(t,e){return t-e})),t.prototype.setDomain.call(this)},e}(le),He=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isContinuous=!0,e}return F(e,t),e.prototype.scale=function(t){if(s(t))return NaN;var e=this.rangeMin(),i=this.rangeMax();return this.max===this.min?e:e+this.getScalePercent(t)*(i-e)},e.prototype.init=function(){t.prototype.init.call(this);var e=this.ticks,i=v(e),n=m(e);i<this.min&&(this.min=i),n>this.max&&(this.max=n),s(this.minLimit)||(this.min=i),s(this.maxLimit)||(this.max=n)},e.prototype.setDomain=function(){var t=p(this.values),e=t.min,i=t.max;s(this.min)&&(this.min=e),s(this.max)&&(this.max=i),this.min>this.max&&(this.min=e,this.max=i)},e.prototype.calculateTicks=function(){var e=this,n=t.prototype.calculateTicks.call(this);return this.nice||(n=i(n,(function(t){return t>=e.min&&t<=e.max}))),n},e.prototype.getScalePercent=function(t){var e=this.max,i=this.min;return(t-i)/(e-i)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(oe),We=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="linear",e.isLinear=!0,e}return F(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t);return this.min+e*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(He);function Ve(t,e){var i=Math.E;return e>=0?Math.pow(i,Math.log(e)/t):-1*Math.pow(i,Math.log(-e)/t)}function qe(t,e){return 1===t?1:Math.log(e)/Math.log(t)}function Ue(t,e,i){s(i)&&(i=Math.max.apply(null,t));var n=i;return h(t,(function(t){t>0&&t<n&&(n=t)})),n===i&&(n=i/e),n>1&&(n=1),n}var Ze=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e}return F(e,t),e.prototype.invert=function(t){var e,i=this.base,n=qe(i,this.max),r=this.rangeMin(),a=this.rangeMax()-r,s=this.positiveMin;if(s){if(0===t)return 0;var o=1/(n-(e=qe(i,s/i)))*a;if(t<o)return t/o*s}else e=qe(i,this.min);var l=(t-r)/a*(n-e)+e;return Math.pow(i,l)},e.prototype.initCfg=function(){this.tickMethod="log",this.base=10,this.tickCount=6,this.nice=!0},e.prototype.setDomain=function(){t.prototype.setDomain.call(this);var e=this.min;if(e<0)throw new Error("When you use log scale, the minimum value must be greater than zero!");0===e&&(this.positiveMin=Ue(this.values,this.base,this.max))},e.prototype.getScalePercent=function(t){var e=this.max,i=this.min;if(e===i)return 0;if(t<=0)return 0;var n=this.base,r=this.positiveMin;return r&&(i=1*r/n),t<r?t/r/(qe(n,e)-qe(n,i)):(qe(n,t)-qe(n,i))/(qe(n,e)-qe(n,i))},e}(He),Je=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="pow",e}return F(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t),i=this.exponent,n=Ve(i,this.max),r=Ve(i,this.min),a=e*(n-r)+r,s=a>=0?1:-1;return Math.pow(a,i)*s},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var e=this.max,i=this.min;if(e===i)return 0;var n=this.exponent;return(Ve(n,t)-Ve(n,i))/(Ve(n,e)-Ve(n,i))},e}(He),$e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="time",e}return F(e,t),e.prototype.getText=function(t,e){var i=this.translate(t),n=this.formatter;return n?n(i,e):ze(i,this.mask)},e.prototype.scale=function(e){var i=e;return(g(i)||T(i))&&(i=this.translate(i)),t.prototype.scale.call(this,i)},e.prototype.translate=function(t){return Le(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,e=this.getConfig("min"),i=this.getConfig("max");if(s(e)&&x(e)||(this.min=this.translate(this.min)),s(i)&&x(i)||(this.max=this.translate(this.max)),t&&t.length){var n=[],r=1/0,a=r,o=0;h(t,(function(t){var e=Le(t);if(isNaN(e))throw new TypeError("Invalid Time: "+t+" in time scale!");r>e?(a=r,r=e):a>e&&(a=e),o<e&&(o=e),n.push(e)})),t.length>1&&(this.minTickInterval=a-r),s(e)&&(this.min=r),s(i)&&(this.max=o)}},e}(We),Ke=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantize",e}return F(e,t),e.prototype.invert=function(t){var e=this.ticks,i=e.length,n=this.getInvertPercent(t),r=Math.floor(n*(i-1));if(r>=i-1)return m(e);if(r<0)return v(e);var a=e[r],s=r/(i-1);return a+(n-s)/((r+1)/(i-1)-s)*(e[r+1]-a)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var e=t.prototype.calculateTicks.call(this);return this.nice||(m(e)!==this.max&&e.push(this.max),v(e)!==this.min&&e.unshift(this.min)),e},e.prototype.getScalePercent=function(t){var e=this.ticks;if(t<v(e))return 0;if(t>m(e))return 1;var i=0;return h(e,(function(e,n){if(!(t>=e))return!1;i=n})),i/(e.length-1)},e}(He),Qe=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantile",e}return F(e,t),e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(Ke),ti={};function ei(t){return ti[t]}function ii(t,e){if(ei(t))throw new Error("type '"+t+"' existed.");ti[t]=e}var ni=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="identity",e.isIdentity=!0,e}return F(e,t),e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&x(t)?t:this.range[0]},e.prototype.invert=function(t){var e=this.range;return t<e[0]||t>e[1]?NaN:this.values[0]},e}(oe),ri=[1,5,2,2.5,4,3],ai=100*Number.EPSILON;function si(t,e,i,n,r,a){var s=L(e),o=Y(e,t),l=0,h=function(t,e){return(t%e+e)%e}(n,a);return(h<ai||a-h<ai)&&n<=0&&r>=0&&(l=1),1-o/(s-1)-i+l}function oi(t,e,i){var n=L(e);return 1-Y(e,t)/(n-1)-i+1}function li(t,e,i,n,r,a){var s=(t-1)/(a-r),o=(e-1)/(Math.max(a,n)-Math.min(i,r));return 2-Math.max(s/o,o/s)}function hi(t,e){return t>=e?2-(t-1)/(e-1):1}function ui(t,e,i,n){var r=e-t;return 1-.5*(Math.pow(e-n,2)+Math.pow(t-i,2))/Math.pow(.1*r,2)}function ci(t,e,i){var n=e-t;if(i>n){var r=(i-n)/2;return 1-Math.pow(r,2)/Math.pow(.1*n,2)}return 1}function fi(t,e,i,n,r,a){if(void 0===i&&(i=5),void 0===n&&(n=!0),void 0===r&&(r=ri),void 0===a&&(a=[.25,.2,.5,.05]),Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!i)return{min:0,max:0,ticks:[]};if(e-t<1e-15||1===i)return{min:t,max:e,ticks:[t]};for(var s={score:-2,lmin:0,lmax:0,lstep:0},o=1;o<1/0;){for(var l=0;l<r.length;l+=1){var h=r[l],u=oi(h,r,o);if(a[0]*u+a[1]+a[2]+a[3]<s.score){o=1/0;break}for(var c=2;c<1/0;){var f=hi(c,i);if(a[0]*u+a[1]+a[2]*f+a[3]<s.score)break;for(var p=(e-t)/(c+1)/o/h,g=Math.ceil(Math.log10(p));g<1/0;){var d=o*h*Math.pow(10,g),y=ci(t,e,d*(c-1));if(a[0]*u+a[1]*y+a[2]*f+a[3]<s.score)break;var x=Math.floor(e/d)*o-(c-1)*o,_=Math.ceil(t/d)*o;if(x<=_)for(var S=_-x,b=0;b<=S;b+=1){var M=(x+b)*(d/o),C=M+d*(c-1),w=d,P=si(h,r,o,M,C,w),T=ui(t,e,M,C),D=li(c,i,t,e,M,C),k=a[0]*P+a[1]*T+a[2]*D+1*a[3];k>s.score&&(!n||M<=t&&C>=e)&&(s.lmin=M,s.lmax=C,s.lstep=w,s.score=k)}g+=1}c+=1}}o+=1}var A,I=s.lmax,E=s.lmin,Y=s.lstep,O=Math.floor((I-E)/Y)+1,N=new Array(O);for(l=0;l<O;l++)N[l]=(A=E+l*Y)<1e-15?A:parseFloat(A.toFixed(15));return{min:Math.min(t,v(N)),max:Math.max(e,m(N)),ticks:N}}function pi(t){var e=t.values,n=t.tickInterval,r=t.tickCount,a=e;if(x(n))return i(a,(function(t,e){return e%n==0}));var o=t.min,l=t.max;if(s(o)&&(o=0),s(l)&&(l=e.length-1),x(r)&&r<l-o){var h=fi(o,l,r,!1,[1,2,5,3,4,7,6,8,9]).ticks;return i(h,(function(t){return t>=o&&t<=l})).map((function(t){return e[t]}))}return e.slice(o,l+1)}var gi=Math.sqrt(50),di=Math.sqrt(10),vi=Math.sqrt(2),mi=function(){function t(){this._domain=[0,1]}return t.prototype.domain=function(t){return t?(this._domain=Array.from(t,Number),this):this._domain.slice()},t.prototype.nice=function(t){var e,i;void 0===t&&(t=5);var n,r=this._domain.slice(),a=0,s=this._domain.length-1,o=this._domain[a],l=this._domain[s];return l<o&&(o=(e=[l,o])[0],l=e[1],a=(i=[s,a])[0],s=i[1]),(n=yi(o,l,t))>0?n=yi(o=Math.floor(o/n)*n,l=Math.ceil(l/n)*n,t):n<0&&(n=yi(o=Math.ceil(o*n)/n,l=Math.floor(l*n)/n,t)),n>0?(r[a]=Math.floor(o/n)*n,r[s]=Math.ceil(l/n)*n,this.domain(r)):n<0&&(r[a]=Math.ceil(o*n)/n,r[s]=Math.floor(l*n)/n,this.domain(r)),this},t.prototype.ticks=function(t){return void 0===t&&(t=5),function(t,e,i){var n,r,a,s,o=-1;if(i=+i,(t=+t)===(e=+e)&&i>0)return[t];(n=e<t)&&(r=t,t=e,e=r);if(0===(s=yi(t,e,i))||!isFinite(s))return[];if(s>0)for(t=Math.ceil(t/s),e=Math.floor(e/s),a=new Array(r=Math.ceil(e-t+1));++o<r;)a[o]=(t+o)*s;else for(t=Math.floor(t*s),e=Math.ceil(e*s),a=new Array(r=Math.ceil(t-e+1));++o<r;)a[o]=(t-o)/s;n&&a.reverse();return a}(this._domain[0],this._domain[this._domain.length-1],t||5)},t}();function yi(t,e,i){var n=(e-t)/Math.max(0,i),r=Math.floor(Math.log(n)/Math.LN10),a=n/Math.pow(10,r);return r>=0?(a>=gi?10:a>=di?5:a>=vi?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(a>=gi?10:a>=di?5:a>=vi?2:1)}function xi(t,e,i){return("ceil"===i?Math.ceil(t/e):"floor"===i?Math.floor(t/e):Math.round(t/e))*e}function _i(t,e,i){var n=xi(t,i,"floor"),r=xi(e,i,"ceil");n=y(n,i),r=y(r,i);for(var a=[],s=n;s<=r;s+=i){var o=y(s,i);a.push(o)}return{min:n,max:r,ticks:a}}function Si(t,e,i){var n,r=t.minLimit,a=t.maxLimit,o=t.min,l=t.max,h=t.tickCount,u=void 0===h?5:h,c=s(r)?s(e)?o:e:r,f=s(a)?s(i)?l:i:a;if(c>f&&(f=(n=[c,f])[0],c=n[1]),u<=2)return[c,f];for(var p=(f-c)/(u-1),g=[],d=0;d<u;d++)g.push(c+p*d);return g}function bi(t){return t<1e-15?t:parseFloat(t.toFixed(15))}function Mi(t,e,i){if(void 0===i&&(i=5),t===e)return{max:e,min:t,ticks:[t]};var n=(e-t)/i,r=Math.pow(10,Math.floor(Math.log10(n))),a=r;2*r-n<1.5*(n-a)&&5*r-n<2.75*(n-(a=2*r))&&10*r-n<1.5*(n-(a=5*r))&&(a=10*r);for(var s=Math.ceil(e/a),o=Math.floor(t/a),l=Math.max(s*a,e),h=Math.min(o*a,t),u=Math.floor((l-h)/a)+1,c=new Array(u),f=0;f<u;f++)c[f]=bi(h+f*a);return{min:h,max:l,ticks:c}}function Ci(t,e){var i=t.length*e;return 1===e?t[t.length-1]:0===e?t[0]:i%1!=0?t[Math.ceil(i)-1]:t.length%2==0?(t[i-1]+t[i])/2:t[i]}function wi(t){return new Date(t).getFullYear()}function Pi(t){return new Date(t,0,1).getTime()}function Ti(t){return new Date(t).getMonth()}function Di(t,e){return new Date(t,e,1).getTime()}se("cat",pi),se("time-cat",(function(t){var e=pi(t),i=m(t.values);return i!==m(e)&&e.push(i),e})),se("wilkinson-extended",(function(t){var e=t.min,i=t.max,n=t.tickCount,r=t.nice,a=t.tickInterval,o=t.minLimit,l=t.maxLimit,h=fi(e,i,n,r).ticks;return s(o)&&s(l)?a?_i(e,i,a).ticks:h:Si(t,v(h),m(h))})),se("r-pretty",(function(t){var e=t.min,i=t.max,n=t.tickCount,r=t.tickInterval,a=t.minLimit,o=t.maxLimit,l=Mi(e,i,n).ticks;return s(a)&&s(o)?r?_i(e,i,r).ticks:l:Si(t,v(l),m(l))})),se("time",(function(t){var e=t.min,i=t.max,n=t.minTickInterval,r=t.tickInterval,a=t.tickCount;if(r)a=Math.ceil((i-e)/r);else{var s=(i-e)/(r=je(e,i,a)[1])/a;s>1&&(r*=Math.ceil(s)),n&&r<n&&(r=n)}for(var o=[],l=e;l<i+r;l+=r)o.push(l);return o})),se("time-pretty",(function(t){var e=t.min,i=t.max,n=t.minTickInterval,r=t.tickCount,a=t.tickInterval,s=[];a||(a=(i-e)/r,n&&a<n&&(a=n));var o=wi(e);if(a>31536e6)for(var l=wi(i),h=Math.ceil(a/31536e6),u=o;u<=l+h;u+=h)s.push(Pi(u));else if(a>Fe){var c=Math.ceil(a/Fe),f=Ti(e),p=function(t,e){var i=wi(t),n=wi(e),r=Ti(t);return 12*(n-i)+(Ti(e)-r)%12}(e,i);for(u=0;u<=p+c;u+=c)s.push(Di(o,u+f))}else if(a>Be){var g=(x=new Date(e)).getFullYear(),d=x.getMonth(),v=x.getDate(),m=Math.ceil(a/Be),y=function(t,e){return Math.ceil((e-t)/Be)}(e,i);for(u=0;u<y+m;u+=m)s.push(new Date(g,d,v+u).getTime())}else if(a>Xe){g=(x=new Date(e)).getFullYear(),d=x.getMonth(),m=x.getDate();var x,_=x.getHours(),S=Math.ceil(a/Xe),b=function(t,e){return Math.ceil((e-t)/Xe)}(e,i);for(u=0;u<=b+S;u+=S)s.push(new Date(g,d,m,_+u).getTime())}else if(a>6e4){var M=function(t,e){return Math.ceil((e-t)/6e4)}(e,i),C=Math.ceil(a/6e4);for(u=0;u<=M+C;u+=C)s.push(e+6e4*u)}else{var w=a;w<1e3&&(w=1e3);var P=1e3*Math.floor(e/1e3),T=Math.ceil((i-e)/1e3),D=Math.ceil(w/1e3);for(u=0;u<T+D;u+=D)s.push(P+1e3*u)}return s.length>=512&&console.warn("Notice: current ticks length("+s.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+a+") is too small, increase the value to solve the problem!"),s})),se("log",(function(t){var e,i=t.base,n=t.tickCount,r=t.min,a=t.max,s=t.values,o=qe(i,a);if(r>0)e=Math.floor(qe(i,r));else{var l=Ue(s,i,a);e=Math.floor(qe(i,l))}for(var h=o-e,u=Math.ceil(h/n),c=[],f=e;f<o+u;f+=u)c.push(Math.pow(i,f));return r<=0&&c.unshift(0),c})),se("pow",(function(t){var e=t.exponent,i=t.tickCount,n=Math.ceil(Ve(e,t.max));return Mi(Math.floor(Ve(e,t.min)),n,i).ticks.map((function(t){var i=t>=0?1:-1;return Math.pow(t,e)*i}))})),se("quantile",(function(t){var e=t.tickCount,i=t.values;if(!i||!i.length)return[];for(var n=i.slice().sort((function(t,e){return t-e})),r=[],a=0;a<e;a++){var s=a/(e-1);r.push(Ci(n,s))}return r})),se("d3-linear",(function(t){var e=t.min,i=t.max,n=t.tickInterval,r=t.minLimit,a=t.maxLimit,o=function(t){var e=t.min,i=t.max,n=t.nice,r=t.tickCount,a=new mi;return a.domain([e,i]),n&&a.nice(r),a.ticks(r)}(t);return s(r)&&s(a)?n?_i(e,i,n).ticks:o:Si(t,v(o),m(o))})),ii("cat",le),ii("category",le),ii("identity",ni),ii("linear",We),ii("log",Ze),ii("pow",Je),ii("time",$e),ii("timeCat",Ge),ii("quantize",Ke),ii("quantile",Qe);var ki=function(t){var e=t.values,i=t.tickCount;if(!i)return e;if(e.length<=1)return e;for(var n=parseInt(e.length/(i-1))||1,r=[],a=0;a<e.length;a+=n)r.push(e[a]);var s=e[e.length-1];return r[r.length-1]!==s&&(r.length>=i?r[r.length-1]=s:r.push(s)),r},Ai=[1,1.2,1.5,2,2.2,2.4,2.5,3,4,5,6,7.5,8,10];function Ii(t){var e=1;if(0===(t=Math.abs(t)))return e;if(t<1){for(var i=0;t<1;)e/=10,t*=10,i++;return e.toString().length>12&&(e=parseFloat(e.toFixed(i))),e}for(;t>10;)e*=10,t/=10;return e}function Ei(t){var e=t.interval,i=t.tickCount,n=t.max,r=t.min;return Math.floor(r/e)*e+(i-1)*e>=n}function Yi(t){var e=t.toString(),i=e.indexOf("."),n=e.indexOf("e-"),r=n>=0?parseInt(e.substr(n+2),10):e.substr(i+1).length;return r>20&&(r=20),r}function Oi(t,e){return parseFloat(t.toFixed(e))}var Ni=ei("linear"),zi=ei("identity"),Li=ei("category"),Xi=ei("timeCat");function Bi(t){Object.keys(t).forEach((function(e){delete t[e]}))}se("cat",ki),se("time-cat",ki),se("wilkinson-extended",(function(t){var e=t||{},i=e.tickCount,n=e.tickInterval,r=t||{},a=r.min,s=r.max;a=isNaN(a)?0:a,s=isNaN(s)?0:s;var o=i&&i>=2?i:5,l=n||function(t){var e=t.tickCount,i=t.min,n=t.max;if(i===n)return 1*Ii(n);for(var r=(n-i)/(e-1),a=Ii(r),s=r/a,o=n/a,l=i/a,h=0,u=0;u<Ai.length;u++){if(s<=Ai[u]){h=u;break}}var c=function t(e,i,n,r){for(var a=!1,s=Ai[e],o=e;o<Ai.length;o++)if(Ei({interval:Ai[o],tickCount:i,max:r,min:n})){s=Ai[o],a=!0;break}if(!a)return 10*t(0,i,n/10,r/10);return s}(h,e,l,o),f=Yi(c)+Yi(a);return Oi(c*a,f)}({tickCount:o,max:s,min:a}),h=Math.floor(a/l)*l;if(n){var u=Math.abs(Math.ceil((s-h)/n))+1;o=Math.max(o,u)}for(var c=[],f=0,p=Yi(l);f<o;)c.push(Oi(h+f*l,p)),f++;return c})),oe.Linear=Ni,oe.Identity=zi,oe.Category=Li,oe.Cat=Li,oe.TimeCat=Xi;var Fi=function(){function t(t){this.defs={},this.scales={},A(this,t)}var e=t.prototype;return e.setFieldDef=function(t,e){var i=this.defs;l(t)?A(i,t):i[t]=e,this.updateScales()},e._getDef=function(t){var e=this.defs,i=null;return(bt.scales[t]||e[t])&&(i=A({},bt.scales[t]),h(e[t],(function(t,e){s(t)?delete i[e]:i[e]=t}))),i},e._getDefaultType=function(t,e,i){if(i&&i.type)return i.type;var n="linear",r=H(e,t);return o(r)&&(r=r[0]),g(r)&&(n="cat"),n},e._getScaleDef=function(t,e,i,n){var r,a={field:e,values:r=n&&n.values?n.values:G(i,e)};if("cat"!==t&&"timeCat"!==t){if(!n||!n.min||!n.max){var s=U(r),o=s.min,l=s.max;a.min=o,a.max=l,a.nice=!0}}else a.isRounding=!1;return a},e._adjustRange=function(t,e){var i=e.range,n=e.values;if("linear"===t||i||!n)return e;var r=n.length;if(1===r)e.range=[.5,1];else{var a=this.chart.get("coord"),o=bt.widthRatio.multiplePie,l=0;!function(t){if(!t.isPolar)return!1;var e=t.startAngle,i=t.endAngle;return!(!s(e)&&!s(i)&&i-e<2*Math.PI)}(a)?(l=1/r*.5,e.range=[l,1-l]):a.transposed?(l=1/r*o,e.range=[l/2,1-l/2]):e.range=[0,1-1/r]}return e},e._getScaleCfg=function(t,e){var i=this._getDef(t);if(!e||!e.length)return i&&i.type?(i.field=t,{type:i.type,cfg:i}):{type:"identity",cfg:{value:t,field:t.toString(),values:[t]}};var n=e[0][t];if(null===n&&(n=H(e,t)),x(t)||s(n)&&!i)return{type:"identity",cfg:{value:t,field:t.toString(),values:[t]}};var r=this._getDefaultType(t,e,i),a=this._getScaleDef(r,t,e,i);return i&&A(a,i),{type:r,cfg:a=this._adjustRange(r,a)}},e.createScale=function(t,e){var i=this.scales,n=this._getScaleCfg(t,e),r=n.type,a=n.cfg,s=i[t];if(s&&s.type===r)return s.change(a),s;var o=new(ei(r))(a);return i[t]=o,o},e._updateScale=function(t){var e=t.field,i=this.chart._getScaleData(e),n=this._getScaleCfg(e,i).cfg;t.change(n)},e.updateScales=function(){var t=this;h(this.scales,(function(e){t._updateScale(e)}))},e.adjustStartZero=function(t){var e=this.defs,i=t.field,n=t.min,r=t.max;e[i]&&e[i].min||(n>0?t.change({min:0}):r<0&&t.change({max:0}))},e.clear=function(){Bi(this.defs),Bi(this.scales),this.data=null},t}(),Ri=function(){var t=e.prototype;function e(t){this._initDefaultCfg(),A(this,t),this.draw()}return t._initDefaultCfg=function(){this.ticks=[],this.tickLine={},this.offsetFactor=1,this.frontContainer=null,this.backContainer=null,this.gridPoints=[]},t.draw=function(){var t=this.line,e=this.tickLine,i=this.label,n=this.grid;n&&this.drawGrid(n),e&&this.drawTicks(e),t&&this.drawLine(t),i&&this.drawLabels()},t.drawTicks=function(t){var e=this,i=e.ticks,n=t.length,r=e.getContainer(t.top);h(i,(function(i){var a=e.getOffsetPoint(i.value),s=e.getSidePoint(a,n);r.addShape("line",{className:"axis-tick",attrs:A({x1:a.x,y1:a.y,x2:s.x,y2:s.y},t)})._id=e._id+"-ticks"}))},t.drawLabels=function(){var t=this,e=t.labelOffset;h(t.labels,(function(i){var n=t.getContainer(i.get("top")),r=t.getOffsetPoint(i.get("value")),a=t.getSidePoint(r,e),s=a.x,o=a.y;i.attr(A({x:s,y:o},t.getTextAlignInfo(r,e),i.get("textStyle"))),i._id=t._id+"-"+i.attr("text"),n.add(i)}))},t.drawLine=function(){},t.drawGrid=function(t){var e=this,i=e.gridPoints,n=e.ticks,r=t,s=i.length;h(i,(function(i,o){if(a(t)){var l=n[o]||{},h=t(l.text,o,s);r=h?A({},bt._defaultAxis.grid,h):null}if(r){var u,c=r.type,f=i.points,p=e.getContainer(r.top);if("arc"===c){var g=e.center,d=e.startAngle,v=e.endAngle,m=Et.length([f[0].x-g.x,f[0].y-g.y]);u=p.addShape("Arc",{className:"axis-grid",attrs:A({x:g.x,y:g.y,startAngle:d,endAngle:v,r:m},r)})}else u=p.addShape("Polyline",{className:"axis-grid",attrs:A({points:f},r)});u._id=i._id}}))},t.getOffsetPoint=function(){},t.getAxisVector=function(){},t.getOffsetVector=function(t,e){var i=this.getAxisVector(t),n=Et.normalize([],i),r=this.offsetFactor,a=[-1*n[1]*r,n[0]*r];return Et.scale([],a,e)},t.getSidePoint=function(t,e){var i=this.getOffsetVector(t,e);return{x:t.x+i[0],y:t.y+i[1]}},t.getTextAlignInfo=function(t,e){var i=this.getOffsetVector(t,e);return{textAlign:i[0]>0?"left":i[0]<0?"right":"center",textBaseline:i[1]>0?"top":i[1]<0?"bottom":"middle"}},t.getContainer=function(t){var e=this.frontContainer,i=this.backContainer;return t?e:i},e}(),ji=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.start=null,this.end=null},i.getOffsetPoint=function(t){var e=this.start,i=this.end;return{x:e.x+(i.x-e.x)*t,y:e.y+(i.y-e.y)*t}},i.getAxisVector=function(){var t=this.start,e=this.end;return[e.x-t.x,e.y-t.y]},i.drawLine=function(t){var e=this.getContainer(t.top),i=this.start,n=this.end;e.addShape("line",{className:"axis-line",attrs:A({x1:i.x,y1:i.y,x2:n.x,y2:n.y},t)})},e}(Ri);Ri.Line=ji;var Gi=function(){function t(t){this.axisCfg={},this.frontPlot=null,this.backPlot=null,this.axes={},A(this,t)}var e=t.prototype;return e._isHide=function(t){var e=this.axisCfg;return!e||!1===e[t]},e._getLinePosition=function(t,e,i,n){var r="",a=t.field,s=this.axisCfg;return s[a]&&s[a].position?r=s[a].position:"x"===e?r=n?"left":"bottom":"y"===e&&(r=i?"right":"left",n&&(r="bottom")),r},e._getLineCfg=function(t,e,i){var n,r,a=1;return"x"===e?(n={x:0,y:0},r={x:1,y:0}):"right"===i?(n={x:1,y:0},r={x:1,y:1}):(n={x:0,y:0},r={x:0,y:1},a=-1),t.transposed&&(a*=-1),{offsetFactor:a,start:t.convertPoint(n),end:t.convertPoint(r)}},e._getCircleCfg=function(t){return{startAngle:t.startAngle,endAngle:t.endAngle,center:t.center,radius:t.circleRadius}},e._getRadiusCfg=function(t){var e,i;return t.transposed?(e={x:0,y:0},i={x:1,y:0}):(e={x:0,y:0},i={x:0,y:1}),{offsetFactor:-1,start:t.convertPoint(e),end:t.convertPoint(i)}},e._getAxisCfg=function(t,e,i,n,r){var s=this,o=this,l=this.axisCfg,u=e.getTicks(),c=E({ticks:u,frontContainer:this.frontPlot,backContainer:this.backPlot},r,l[e.field]),f=[],p=c.label,g=u.length,d=0,v=0,m=p;return h(u,(function(t,e){if(a(p)){var i=p(t.text,e,g);m=i?A({},bt._defaultAxis.label,i):null}if(m){var n={};m.textAlign&&(n.textAlign=m.textAlign),m.textBaseline&&(n.textBaseline=m.textBaseline);var r=(m.top?s.frontPlot:s.backPlot).addShape("text",{className:"axis-label",aria:!1,attrs:A({x:0,y:0,text:t.text,fontFamily:o.chart.get("canvas").get("fontFamily")},m),value:t.value,textStyle:n,top:m.top,context:o.chart.get("canvas").get("context")});f.push(r);var l=r.getBBox(),h=l.width,u=l.height;d=Math.max(d,h),v=Math.max(v,u)}})),c.labels=f,c.maxWidth=d,c.maxHeight=v,c},e._createAxis=function(t,e,i,n,r){void 0===r&&(r="");var a,s,o,l=t.type,h=t.transposed;if("cartesian"===l||"rect"===l){var u=this._getLinePosition(e,n,r,h);(o=bt.axis[u]).position=u,a="Line",s=u}else"x"===n&&!h||"y"===n&&h?(o=bt.axis.circle,a="Circle",s="circle"):(o=bt.axis.radius,a="Line",s="radius");var c=this._getAxisCfg(t,e,i,n,o);c.type=a,c.dimType=n,c.verticalScale=i,c.index=r,this.axes[s]=c},e.createAxis=function(t,e,i){var n=this;e&&!n._isHide(e.field)&&n._createAxis(t,e,i[0],"x"),h(i,(function(i,r){n._isHide(i.field)||n._createAxis(t,i,e,"y",r)}));var r=this.axes,a=n.chart;if(a._isAutoPadding()){var o=dt(a.get("padding")),l=dt(a.get("appendPadding")),u=a.get("legendRange")||{top:0,right:0,bottom:0,left:0},c=["auto"===o[0]?u.top+2*l[0]:o[0],"auto"===o[1]?u.right+l[1]:o[1],"auto"===o[2]?u.bottom+l[2]:o[2],"auto"===o[3]?u.left+l[3]:o[3]];if(t.isPolar){var f=r.circle;if(f){var p=f.maxHeight,g=f.maxWidth,d=f.labelOffset;c[0]+=p+d,c[1]+=g+d,c[2]+=p+d,c[3]+=g+d}}else{if(r.right&&"auto"===o[1]){var v=r.right,m=v.maxWidth,y=v.labelOffset;c[1]+=m+y}if(r.left&&"auto"===o[3]){var x=r.left,_=x.maxWidth,S=x.labelOffset;c[3]+=_+S}if(r.bottom&&"auto"===o[2]){var b=r.bottom,M=b.maxHeight,C=b.labelOffset;c[2]+=M+C}}a.set("_padding",c),a._updateLayout(c)}h(r,(function(e){var i,r=e.type,a=e.grid,o=e.verticalScale,l=e.ticks,u=e.dimType,c=e.position,f=e.index;if(t.isPolar?"Line"===r?i=n._getRadiusCfg(t):"Circle"===r&&(i=n._getCircleCfg(t)):i=n._getLineCfg(t,u,c),a&&o){var p=[],g=function(t){var e=t.slice(0);if(e.length>0){var i=e[0],n=e[e.length-1];0!==i.value&&e.unshift({value:0}),1!==n.value&&e.push({value:1})}return e}(o.getTicks());h(l,(function(e){var i=[];h(g,(function(n){var r="x"===u?e.value:n.value,a="x"===u?n.value:e.value;if(r>=0&&r<=1&&a>=0&&a<=1){var s=t.convertPoint({x:r,y:a});i.push(s)}})),p.push({points:i,_id:"axis-"+u+f+"-grid-"+e.tickValue})})),e.gridPoints=p,t.isPolar&&(e.center=t.center,e.startAngle=t.startAngle,e.endAngle=t.endAngle)}i._id="axis-"+u,s(f)||(i._id="axis-"+u+f),new Ri[r](A(e,i))}))},e.clear=function(){this.axes={},this.frontPlot.clear(),this.backPlot.clear()},t}(),Hi=function(t,e){var i=e.x-t.x,n=e.y-t.y;return Math.abs(i)>Math.abs(n)?i>0?"right":"left":n>0?"down":"up"},Wi=function(t,e){var i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);return Math.sqrt(i*i+n*n)},Vi=function(){function t(t){var e=this,i=t.canvas,n=t.el;Mt(this,"_click",(function(t){var i=ct(t,e.canvas);t.points=i,e.emitEvent("click",t)})),Mt(this,"_start",(function(t){var i,n,r=ct(t,e.canvas);r&&(t.points=r,e.emitEvent("touchstart",t),e.reset(),e.startTime=Date.now(),e.startPoints=r,r.length>1?(e.startDistance=Wi(r[0],r[1]),e.center=(i=r[0],n=r[1],{x:i.x+(n.x-i.x)/2,y:i.y+(n.y-i.y)/2})):e.pressTimeout=setTimeout((function(){t.direction="none",e.emitStart("press",t),e.emitEvent("press",t),e.eventType="press",e.direction="none"}),250))})),Mt(this,"_move",(function(t){var i=ct(t,e.canvas);if(i){e.clearPressTimeout(),t.points=i,e.emitEvent("touchmove",t);var n=e.startPoints;if(n)if(i.length>1){var r=e.startDistance,a=Wi(i[0],i[1]);t.zoom=a/r,t.center=e.center,e.emitStart("pinch",t),e.emitEvent("pinch",t)}else{var s=i[0].x-n[0].x,o=i[0].y-n[0].y,l=e.direction||Hi(n[0],i[0]);e.direction=l;var h=e.getEventType(i);t.direction=l,t.deltaX=s,t.deltaY=o,e.emitStart(h,t),e.emitEvent(h,t);var u=e.lastMoveTime,c=Date.now();c-u>0&&(e.prevMoveTime=u,e.prevMovePoints=e.lastMovePoints,e.lastMoveTime=c,e.lastMovePoints=i)}}})),Mt(this,"_end",(function(t){var i=ct(t,e.canvas);t.points=i,e.emitEnd(t),e.emitEvent("touchend",t);var n=e.lastMoveTime;if(Date.now()-n<100){var r=n-(e.prevMoveTime||e.startTime);if(r>0){var a=e.prevMovePoints||e.startPoints,s=e.lastMovePoints,o=Wi(a[0],s[0])/r;o>.3&&(t.velocity=o,t.direction=Hi(a[0],s[0]),e.emitEvent("swipe",t))}}e.reset();var l=t.touches;l&&l.length>0&&e._start(t)})),Mt(this,"_cancel",(function(t){e.emitEvent("touchcancel",t),e.reset()})),this.canvas=i,this.delegateEvent(n),this.processEvent={}}var e=t.prototype;return e.delegateEvent=function(t){t.addEventListener("click",this._click),t.addEventListener("touchstart",this._start),t.addEventListener("touchmove",this._move),t.addEventListener("touchend",this._end),t.addEventListener("touchcancel",this._cancel)},e.emitEvent=function(t,e){this.canvas.emit(t,e)},e.getEventType=function(t){var e,i=this.eventType,n=this.canvas,r=this.startTime,a=this.startPoints;if(i)return i;var s=n.__events.pan;s&&s.length?e=Date.now()-r>250&&Wi(a[0],t[0])<10?"press":"pan":e="press";return this.eventType=e,e},e.enable=function(t){this.processEvent[t]=!0},e.isProcess=function(t){return this.processEvent[t]},e.emitStart=function(t,e){this.isProcess(t)||(this.enable(t),this.emitEvent(t+"start",e))},e.emitEnd=function(t){var e=this,i=this.processEvent;Object.keys(i).forEach((function(n){e.emitEvent(n+"end",t),delete i[n]}))},e.clearPressTimeout=function(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=0)},e.reset=function(){this.clearPressTimeout(),this.startTime=0,this.startPoints=null,this.startDistance=0,this.direction=null,this.eventType=null,this.pinch=!1,this.prevMoveTime=0,this.prevMovePoints=null,this.lastMoveTime=0,this.lastMovePoints=null},t}(),qi=function(t){function e(e){var i;return(i=t.call(this)||this).context=e,i.width=0,i.height=0,i.style={},i.currentStyle={},i.attrs={},i.isCanvasElement=!0,i}wt(e,t);var i=e.prototype;return i.getContext=function(){return this.context},i.getBoundingClientRect=function(){return{top:0,right:this.width,bottom:this.height,left:0}},i.setAttribute=function(t,e){this.attrs[t]=e},i.addEventListener=function(t,e){this.on(t,e)},i.removeEventListener=function(t,e){this.off(t,e)},i.dispatchEvent=function(t,e){this.emit(t,e)},e}(Dt);var Ui=function(t){return t?function(t){if(!t)return!1;if(1!==t.nodeType||!t.nodeName||"canvas"!==t.nodeName.toLowerCase())return!1;var e=!1;try{t.addEventListener("eventTest",(function(){e=!0})),t.dispatchEvent(new Event("eventTest"))}catch(t){e=!1}return e}(t.canvas)?t.canvas:new qi(t):null};function Zi(t,e){h(t,(function(t){t=t.split(":"),e.addColorStop(Number(t[0]),t[1])}))}function Ji(t,e,i){if("("===t[1])try{var n=t[0];if("l"===n)return function(t,e,i){var n,r,a=t.split(" "),s=a[0].slice(2,a[0].length-1);n=parseFloat(s)*Math.PI/180,r=2*Math.PI,s=(n%r+r)%r;var o,l,h=a.slice(1),u=e.getBBox(),c=u.minX,f=u.minY,p=u.maxX,g=u.maxY;s>=0&&s<.5*Math.PI?(o={x:c,y:f},l={x:p,y:g}):.5*Math.PI<=s&&s<Math.PI?(o={x:p,y:f},l={x:c,y:g}):Math.PI<=s&&s<1.5*Math.PI?(o={x:p,y:g},l={x:c,y:f}):(o={x:c,y:g},l={x:p,y:f});var d=Math.tan(s),v=d*d,m=(l.x-o.x+d*(l.y-o.y))/(v+1)+o.x,y=d*(l.x-o.x+d*(l.y-o.y))/(v+1)+o.y,x=i.createLinearGradient(o.x,o.y,m,y);return Zi(h,x),x}(t,e,i);if("r"===n)return function(t,e,i){var n=t.split(" "),r=n[0].slice(2,n[0].length-1);r=r.split(",");var a=parseFloat(r[0]),s=parseFloat(r[1]),o=parseFloat(r[2]),l=n.slice(1);if(0===o)return l[l.length-1].split(":")[1];var h=e.getBBox(),u=h.width,c=h.height,f=h.minX,p=h.minY,g=Math.sqrt(u*u+c*c)/2,d=i.createRadialGradient(f+u*a,p+c*s,o*g,f+u/2,p+c/2,g);return Zi(l,d),d}(t,e,i)}catch(t){console.error("error in parsing gradient string, please check if there are any extra whitespaces."),console.error(t)}return t}var $i={stroke:"strokeStyle",fill:"fillStyle",opacity:"globalAlpha"},Ki=["fillStyle","font","globalAlpha","lineCap","lineWidth","lineJoin","miterLimit","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","strokeStyle","textAlign","textBaseline","lineDash","shadow"],Qi=["circle","sector","polygon","rect","polyline"],tn=function(){var t=e.prototype;function e(t){this._initProperties(),A(this._attrs,t);var e=this._attrs.attrs;e&&this.initAttrs(e),this.initTransform()}return t._initProperties=function(){this._attrs={zIndex:0,visible:!0,destroyed:!1}},t.get=function(t){return this._attrs[t]},t.set=function(t,e){this._attrs[t]=e},t.isGroup=function(){return this.get("isGroup")},t.isShape=function(){return this.get("isShape")},t.initAttrs=function(t){this.attr(A(this.getDefaultAttrs(),t))},t.getDefaultAttrs=function(){return{}},t._setAttr=function(t,e){var i=this._attrs.attrs;if("clip"===t)e=this._setAttrClip(e);else{var n=$i[t];n&&(i[n]=e)}i[t]=e},t._getAttr=function(t){return this._attrs.attrs[t]},t._setAttrClip=function(t){return t&&Qi.indexOf(t._attrs.type)>-1?(null===t.get("canvas")&&(t=Object.assign({},t)),t.set("parent",this.get("parent")),t.set("context",this.get("context")),t):null},t.attr=function(t,e){var i=this;if(i.get("destroyed"))return null;var n=arguments.length;if(0===n)return i._attrs.attrs;if(l(t)){for(var r in this._attrs.bbox=null,t)i._setAttr(r,t[r]);return i._afterAttrsSet&&i._afterAttrsSet(),i}return 2===n?(this._attrs.bbox=null,i._setAttr(t,e),i._afterAttrsSet&&i._afterAttrsSet(),i):i._getAttr(t)},t.getParent=function(){return this.get("parent")},t.draw=function(t){this.get("destroyed")||this.get("visible")&&(this.setContext(t),this.drawInner(t),this.restoreContext(t))},t.setContext=function(t){var e=this._attrs.attrs.clip;t.save(),e&&(e.resetTransform(t),e.createPath(t),t.clip()),this.resetContext(t),this.resetTransform(t)},t.restoreContext=function(t){t.restore()},t.resetContext=function(t){var e=this._attrs.attrs;for(var i in e)if(Ki.indexOf(i)>-1){var n=e[i];"fillStyle"!==i&&"strokeStyle"!==i||!n||(n=Ji(n,this,t)),"lineDash"===i&&t.setLineDash&&o(n)?t.setLineDash(n):t[i]=n}},t.hasFill=function(){return this.get("canFill")&&this._attrs.attrs.fillStyle},t.hasStroke=function(){return this.get("canStroke")&&this._attrs.attrs.strokeStyle},t.drawInner=function(){},t.show=function(){return this.set("visible",!0),this},t.hide=function(){return this.set("visible",!1),this},t.isVisible=function(){return this.get("visible")},t.getAriaLabel=function(){var t=this._attrs,e=t.destroyed,i=t.visible,n=t.isShape,r=t.aria;if(!e&&i&&(!n||r))return this._getAriaLabel()},t._getAriaLabel=function(){return this._attrs.ariaLabel},t._removeFromParent=function(){var t=this.get("parent");t&&q(t.get("children"),this);return this},t.remove=function(t){t?this.destroy():this._removeFromParent()},t.destroy=function(){if(this.get("destroyed"))return null;this._removeFromParent(),this._attrs={},this.set("destroyed",!0)},t.getBBox=function(){return{minX:0,maxX:0,minY:0,maxY:0,width:0,height:0}},t.initTransform=function(){var t=this._attrs.attrs||{};t.matrix||(t.matrix=[1,0,0,1,0,0]),this._attrs.attrs=t},t.getMatrix=function(){return this._attrs.attrs.matrix},t.setMatrix=function(t){this._attrs.attrs.matrix=[t[0],t[1],t[2],t[3],t[4],t[5]]},t.transform=function(t){var e=this._attrs.attrs.matrix;return this._attrs.attrs.matrix=It.transform(e,t),this},t.setTransform=function(t){return this._attrs.attrs.matrix=[1,0,0,1,0,0],this.transform(t)},t.translate=function(t,e){var i=this._attrs.attrs.matrix;It.translate(i,i,[t,e])},t.rotate=function(t){var e=this._attrs.attrs.matrix;It.rotate(e,e,t)},t.scale=function(t,e){var i=this._attrs.attrs.matrix;It.scale(i,i,[t,e])},t.moveTo=function(t,e){var i=this._attrs.x||0,n=this._attrs.y||0;this.translate(t-i,e-n),this.set("x",t),this.set("y",e)},t.apply=function(t){var e=this._attrs.attrs.matrix;return Et.transformMat2d(t,t,e),this},t.resetTransform=function(t){var e=this._attrs.attrs.matrix;It.isChanged(e)&&t.transform(e[0],e[1],e[2],e[3],e[4],e[5])},t.isDestroyed=function(){return this.get("destroyed")},e}(),en=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initProperties=function(){this._attrs={zIndex:0,visible:!0,destroyed:!1,isShape:!0,attrs:{}}},i.getType=function(){return this._attrs.type},i.drawInner=function(t){var e=this.get("attrs");this.createPath(t);var i=t.globalAlpha;if(this.hasFill()){var n=e.fillOpacity;s(n)||1===n?t.fill():(t.globalAlpha=n,t.fill(),t.globalAlpha=i)}if(this.hasStroke()&&e.lineWidth>0){var r=e.strokeOpacity;s(r)||1===r||(t.globalAlpha=r),t.stroke()}},i.getBBox=function(){var t=this._attrs.bbox;return t||((t=this.calculateBox())&&(t.x=t.minX,t.y=t.minY,t.width=t.maxX-t.minX,t.height=t.maxY-t.minY),this._attrs.bbox=t),t},i.calculateBox=function(){return null},i.createPath=function(){},e}(tn);var nn=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="rect"},i.getDefaultAttrs=function(){return{x:0,y:0,width:0,height:0,radius:0,lineWidth:0}},i.createRadiusPath=function(t,e,i,n,r,a){a=function(t,e,i){if(!((t=dt(t))[0]||t[1]||t[2]||t[3]))return t;var n=Math.max(t[0]+t[1],t[2]+t[3]),r=Math.max(t[0]+t[3],t[1]+t[2]),a=Math.min(e/n,i/r);return a<1?t.map((function(t){return t*a})):t}(a,n,r),t.moveTo(e+a[0],i),t.lineTo(e+n-a[1],i),t.arc(e+n-a[1],i+a[1],a[1],-Math.PI/2,0,!1),t.lineTo(e+n,i+r-a[2]),t.arc(e+n-a[2],i+r-a[2],a[2],0,Math.PI/2,!1),t.lineTo(e+a[3],i+r),t.arc(e+a[3],i+r-a[3],a[3],Math.PI/2,Math.PI,!1),t.lineTo(e,i+a[0]),t.arc(e+a[0],i+a[0],a[0],Math.PI,3*Math.PI/2,!1),t.closePath()},i.createPath=function(t){var e=this.get("attrs"),i=e.x,n=e.y,r=e.width,a=e.height,s=e.radius;t.beginPath(),s&&r*a?this.createRadiusPath(t,i,n,r,a,s):t.rect(i,n,r,a)},i.calculateBox=function(){var t=this.get("attrs"),e=t.x,i=t.y;return{minX:e,minY:i,maxX:e+t.width,maxY:i+t.height}},e}(en),rn={},an=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!1,this._attrs.canStroke=!1,this._attrs.loading=!1,this._attrs.image=null,this._attrs.type="image"},i.draw=function(e){var i=this;if(!this.get("loading"))if(this.get("image"))t.prototype.draw.call(this,e);else{var n=this.get("attrs").src;if(n&&window.Image){var r=this.get("cacheImage");if(r&&rn[n])return this.set("image",rn[n]),void this.draw(e);this.set("loading",!0);var a=new Image;a.crossOrigin="",a.onload=function(){i.set("loading",!1),i.set("image",a),i.draw(e)},a.src=n,r&&(rn[n]=a)}}},i.createPath=function(t){var e=this.get("image");this.drawImage(t,e)},i.drawImage=function(t,e){var i=this._attrs,n=i.attrs;if(!i.destroyed){var r=n.x,a=n.y,o=n.width,l=n.height,h=n.sx,u=n.sy,c=n.swidth,f=n.sheight,p=n.radius,g=n.fillOpacity;p&&(t.save(),this.createRadiusPath(t,r,a,o,l,p),t.clip());var d=t.globalAlpha;s(g)||(t.globalAlpha=g),s(h)||s(u)||s(c)||s(f)?t.drawImage(e,r,a,o,l):t.drawImage(e,h,u,c,f,r,a,o,l),t.globalAlpha=d,p&&t.restore()}},e}(nn),sn=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="circle"},i.getDefaultAttrs=function(){return{x:0,y:0,r:0,lineWidth:0}},i.createPath=function(t){var e=this.get("attrs"),i=e.x,n=e.y,r=e.r;t.beginPath(),t.arc(i,n,r,0,2*Math.PI,!1),t.closePath()},i.calculateBox=function(){var t=this.get("attrs"),e=t.x,i=t.y,n=t.r;return{minX:e-n,maxX:e+n,minY:i-n,maxY:i+n}},e}(en),on=Et.create(),ln=Et.create(),hn=Et.create();function un(t,e,i,n,r){var a=t*t;return e+(3*-e+t*(3*e-e*t))*t+(3*i+t*(-6*i+3*i*t))*t+(3*n-3*n*t)*a+r*(a*t)}function cn(t){for(var e,i,n,r,a,s=1/0,o=-1/0,l=1/0,h=-1/0,u={x:t[0],y:t[1]},c={x:t[2],y:t[3]},f={x:t[4],y:t[5]},p={x:t[6],y:t[7]},g=0;g<100;g++){var d={x:un(a=g/100,(e=u).x,(i=c).x,(n=f).x,(r=p).x),y:un(a,e.y,i.y,n.y,r.y)};d.x<s&&(s=d.x),d.x>o&&(o=d.x),d.y<l&&(l=d.y),d.y>h&&(h=d.y)}return{minX:s,minY:l,maxX:o,maxY:h}}function fn(t,e){if(0!==t.length){for(var i=t[0],n=i.x,r=i.x,a=i.y,s=i.y,o=t.length,l=1;l<o;l++)i=t[l],n=Math.min(n,i.x),r=Math.max(r,i.x),a=Math.min(a,i.y),s=Math.max(s,i.y);return{minX:n-(e=e/2||0),minY:a-e,maxX:r+e,maxY:s+e}}}function pn(t,e,i,n,r,a){var s=Math.abs(n-r);if(s%(2*Math.PI)<1e-4&&s>1e-4)return{minX:t-i,minY:e-i,maxX:t+i,maxY:e+i};on[0]=Math.cos(n)*i+t,on[1]=Math.sin(n)*i+e,ln[0]=Math.cos(r)*i+t,ln[1]=Math.sin(r)*i+e;var o=[0,0],l=[0,0];if(Et.min(o,on,ln),Et.max(l,on,ln),(n%=2*Math.PI)<0&&(n+=2*Math.PI),(r%=2*Math.PI)<0&&(r+=2*Math.PI),n>r&&!a?r+=2*Math.PI:n<r&&a&&(n+=2*Math.PI),a){var h=r;r=n,n=h}for(var u=0;u<r;u+=Math.PI/2)u>n&&(hn[0]=Math.cos(u)*i+t,hn[1]=Math.sin(u)*i+e,Et.min(o,hn,o),Et.max(l,hn,l));return{minX:o[0],minY:o[1],maxX:l[0],maxY:l[1]}}var gn=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canStroke=!0,this._attrs.type="line"},i.getDefaultAttrs=function(){return{x1:0,y1:0,x2:0,y2:0,lineWidth:1}},i.createPath=function(t){var e=this.get("attrs"),i=e.x1,n=e.y1,r=e.x2,a=e.y2;t.beginPath(),t.moveTo(i,n),t.lineTo(r,a)},i.calculateBox=function(){var t=this.get("attrs");return function(t,e,i,n,r){return r=r/2||0,{minX:Math.min(t,i)-r,minY:Math.min(e,n)-r,maxX:Math.max(t,i)+r,maxY:Math.max(e,n)+r}}(t.x1,t.y1,t.x2,t.y2,t.lineWidth)},e}(en),dn=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="polygon"},i.getDefaultAttrs=function(){return{points:null,lineWidth:0}},i.createPath=function(t){var e=this.get("attrs").points;t.beginPath();for(var i=0,n=e.length;i<n;i++){var r=e[i];0===i?t.moveTo(r.x,r.y):t.lineTo(r.x,r.y)}t.closePath()},i.calculateBox=function(){return fn(this.get("attrs").points)},e}(en);function vn(t){return[t.x,t.y]}function mn(t,e,i){for(var n,r,a,s=!!e,o=function(t,e,i,n){var r,a,s,o,l,h,u,c,f=[],p=!!n;if(p){for(s=[1/0,1/0],o=[-1/0,-1/0],c=0,u=t.length;c<u;c++)l=vn(t[c]),Et.min(s,s,l),Et.max(o,o,l);Et.min(s,s,n[0]),Et.max(o,o,n[1])}for(c=0,h=t.length;c<h;c++){if(l=vn(t[c]),i)r=vn(t[c?c-1:h-1]),a=vn(t[(c+1)%h]);else{if(0===c||c===h-1){f.push([l[0],l[1]]);continue}r=vn(t[c-1]),a=vn(t[c+1])}var g=Et.sub([],a,r);Et.scale(g,g,e);var d=Et.distance(l,r),v=Et.distance(l,a),m=d+v;0!==m&&(d/=m,v/=m);var y=Et.scale([],g,-d),x=Et.scale([],g,v),_=Et.add([],l,y),S=Et.add([],l,x);p&&(Et.max(_,_,s),Et.min(_,_,o),Et.max(S,S,s),Et.min(S,S,o)),f.push([_[0],_[1]]),f.push([S[0],S[1]])}return i&&f.push(f.shift()),f}(t,.4,s,i),l=t.length,h=[],u=0;u<l-1;u++)n=o[2*u],r=o[2*u+1],a=t[u+1],h.push(["C",n[0],n[1],r[0],r[1],a.x,a.y]);return s&&(n=o[l],r=o[l+1],a=t[0],h.push(["C",n[0],n[1],r[0],r[1],a.x,a.y])),h}function yn(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];isNaN(r.x)||isNaN(r.y)||e.push(r)}return e}var xn=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="polyline"},i.getDefaultAttrs=function(){return{points:null,lineWidth:1,smooth:!1}},i.createPath=function(t){var e=this.get("attrs"),i=e.points,n=e.smooth,r=yn(i);if(t.beginPath(),r.length)if(t.moveTo(r[0].x,r[0].y),n)for(var a=mn(r,!1,[[0,0],[1,1]]),s=0,o=a.length;s<o;s++){var l=a[s];t.bezierCurveTo(l[1],l[2],l[3],l[4],l[5],l[6])}else{var h,u;for(h=1,u=r.length-1;h<u;h++)t.lineTo(r[h].x,r[h].y);t.lineTo(r[u].x,r[u].y)}},i.calculateBox=function(){var t=this.get("attrs"),e=t.points,i=t.smooth,n=t.lineWidth,r=yn(e);if(i){for(var a=[],s=mn(r,!1,[[0,0],[1,1]]),o=0,l=s.length;o<l;o++){var h=s[o];if(0===o)a.push([r[0].x,r[0].y,h[1],h[2],h[3],h[4],h[5],h[6]]);else{var u=s[o-1];a.push([u[5],u[6],h[1],h[2],h[3],h[4],h[5],h[6]])}}return function(t,e){for(var i=1/0,n=-1/0,r=1/0,a=-1/0,s=0,o=t.length;s<o;s++){var l=cn(t[s]);l.minX<i&&(i=l.minX),l.maxX>n&&(n=l.maxX),l.minY<r&&(r=l.minY),l.maxY>a&&(a=l.maxY)}return{minX:i-(e=e/2||0),minY:r-e,maxX:n+e,maxY:a+e}}(a,n)}return fn(r,n)},e}(en),_n=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canStroke=!0,this._attrs.canFill=!0,this._attrs.type="arc"},i.getDefaultAttrs=function(){return{x:0,y:0,r:0,startAngle:0,endAngle:2*Math.PI,anticlockwise:!1,lineWidth:1}},i.createPath=function(t){var e=this.get("attrs"),i=e.x,n=e.y,r=e.r,a=e.startAngle,s=e.endAngle,o=e.anticlockwise;t.beginPath(),a!==s&&t.arc(i,n,r,a,s,o)},i.calculateBox=function(){var t=this.get("attrs");return pn(t.x,t.y,t.r,t.startAngle,t.endAngle,t.anticlockwise)},e}(en),Sn=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="sector"},i.getDefaultAttrs=function(){return{x:0,y:0,lineWidth:0,r:0,r0:0,startAngle:0,endAngle:2*Math.PI,anticlockwise:!1}},i.createPath=function(t){var e=this.get("attrs"),i=e.x,n=e.y,r=e.startAngle,a=e.endAngle,s=e.r,o=e.r0,l=e.anticlockwise;t.beginPath();var h=Math.cos(r),u=Math.sin(r);t.moveTo(h*o+i,u*o+n),t.lineTo(h*s+i,u*s+n),(Math.abs(a-r)>1e-4||0===r&&a<0)&&(t.arc(i,n,s,r,a,l),t.lineTo(Math.cos(a)*o+i,Math.sin(a)*o+n),0!==o&&t.arc(i,n,o,a,r,!l)),t.closePath()},i.calculateBox=function(){var t=this.get("attrs"),e=t.x,i=t.y,n=t.r,r=t.r0,a=t.startAngle,s=t.endAngle,o=t.anticlockwise,l=pn(e,i,n,a,s,o),h=pn(e,i,r,a,s,o);return{minX:Math.min(l.minX,h.minX),minY:Math.min(l.minY,h.minY),maxX:Math.max(l.maxX,h.maxX),maxY:Math.max(l.maxY,h.maxY)}},e}(en),bn=function(t){var e=t.width,i=t.height,n=t.rotate,r=Math.abs(n);return{width:Math.abs(e*Math.cos(r)+i*Math.sin(r)),height:Math.abs(i*Math.cos(r)+e*Math.sin(r))}},Mn=0,Cn={},wn=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="text"},i.getDefaultAttrs=function(){return{lineWidth:0,lineCount:1,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom",lineHeight:null,textArr:null}},i._getFontStyle=function(){var t=this._attrs.attrs,e=t.fontSize,i=t.fontFamily,n=t.fontWeight;return t.fontStyle+" "+t.fontVariant+" "+n+" "+e+"px "+i},i._afterAttrsSet=function(){var t=this._attrs.attrs;if(t.font=this._getFontStyle(),t.text){var e=t.text,i=null,n=1;g(e)&&-1!==e.indexOf("\n")&&(n=(i=e.split("\n")).length),t.lineCount=n,t.textArr=i}this.set("attrs",t)},i._getTextHeight=function(){var t=this._attrs.attrs;if(t.height)return t.height;var e=t.lineCount,i=1*t.fontSize;return e>1?i*e+this._getSpaceingY()*(e-1):i},i._getSpaceingY=function(){var t=this._attrs.attrs,e=t.lineHeight,i=1*t.fontSize;return e?e-i:.14*i},i.drawInner=function(t){var e=this._attrs.attrs,i=e.text,n=e.x,r=e.y;if(!(s(i)||isNaN(n)||isNaN(r))){var a=e.textArr,o=1*e.fontSize,l=this._getSpaceingY();e.rotate&&(t.translate(n,r),t.rotate(e.rotate),n=0,r=0);var h,u,c=e.textBaseline;if(a&&(h=this._getTextHeight()),this.hasFill()){var f=e.fillOpacity;if(s(f)||1===f||(t.globalAlpha=f),a)for(var p=0,g=a.length;p<g;p++){var d=a[p];u=r+p*(l+o)-h+o,"middle"===c&&(u+=h-o-(h-o)/2),"top"===c&&(u+=h-o),t.fillText(d,n,u)}else t.fillText(i,n,r)}if(this.hasStroke())if(a)for(var v=0,m=a.length;v<m;v++){var y=a[v];u=r+v*(l+o)-h+o,"middle"===c&&(u+=h-o-(h-o)/2),"top"===c&&(u+=h-o),t.strokeText(y,n,u)}else t.strokeText(i,n,r)}},i._getAriaLabel=function(){return this._attrs.attrs.text},i.calculateBox=function(){var t=this._attrs.attrs,e=t.x,i=t.y,n=t.textAlign,r=t.textBaseline,a=this._getTextWidth();if(!a)return{minX:e,minY:i,maxX:e,maxY:i};var s=this._getTextHeight();if(t.rotate){var o=bn({width:a,height:s,rotate:t.rotate});a=o.width,s=o.height}var l={x:e,y:i-s};return n&&("end"===n||"right"===n?l.x-=a:"center"===n&&(l.x-=a/2)),r&&("top"===r?l.y+=s:"middle"===r&&(l.y+=s/2)),{minX:l.x,minY:l.y,maxX:l.x+a,maxY:l.y+s}},i._getTextWidth=function(){var t=this._attrs.attrs;if(t.width)return t.width;var e=t.text,i=this.get("context");if(!s(e)){var n=t.font,r=t.textArr,a=e+""+n;if(Cn[a])return Cn[a];var o=0;if(r)for(var l=0,h=r.length;l<h;l++){var u=r[l];o=Math.max(o,pt(u,n,i).width)}else o=pt(e,n,i).width;return Mn>5e3&&(Mn=0,Cn={}),Mn++,Cn[a]=o,o}},e}(en),Pn=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.createPath=null,this._attrs.type="custom"},i.createPath=function(t){var e=this.get("createPath");e&&e.call(this,t)},i.calculateBox=function(){var t=this.get("calculateBox");return t&&t.call(this)},e}(en),Tn={circle:function(t,e,i,n){n.arc(t,e,i,0,2*Math.PI,!1)},square:function(t,e,i,n){n.moveTo(t-i,e-i),n.lineTo(t+i,e-i),n.lineTo(t+i,e+i),n.lineTo(t-i,e+i),n.closePath()}},Dn=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="marker"},i.getDefaultAttrs=function(){return{x:0,y:0,lineWidth:0}},i.createPath=function(t){var e,i=this.get("attrs"),n=i.x,r=i.y,s=i.radius,o=i.symbol||"circle";e=a(o)?o:Tn[o],t.beginPath(),e(n,r,s,t,this)},i.calculateBox=function(){var t=this.get("attrs"),e=t.x,i=t.y,n=t.radius;return{minX:e-n,minY:i-n,maxX:e+n,maxY:i+n}},e}(en);en.Rect=nn,en.Image=an,en.Circle=sn,en.Line=gn,en.Polygon=dn,en.Polyline=xn,en.Arc=_n,en.Sector=Sn,en.Text=wn,en.Custom=Pn,en.Marker=Dn;var kn={};var An={getGroupClass:function(){},getChildren:function(){return this.get("children")},addShape:function(t,e){void 0===e&&(e={});var i=kn[t];i||(i=C(t),kn[t]=i);var n=new en[i](e);return this.add(n),n},addGroup:function(t){var e=new(this.getGroupClass())(t);return this.add(e),e},contain:function(t){return this.get("children").indexOf(t)>-1},sort:function(){for(var t=this.get("children"),e=0,i=t.length;e<i;e++){t[e]._INDEX=e}return t.sort(function(t){return function(e,i){var n=t(e,i);return 0===n?e._INDEX-i._INDEX:n}}((function(t,e){return t.get("zIndex")-e.get("zIndex")}))),this},drawChildren:function(t){for(var e=this.get("children"),i=0,n=e.length;i<n;i++){e[i].draw(t)}return this},clear:function(){for(var t=this.get("children");0!==t.length;)t[t.length-1].remove(!0);return this},add:function(t){var e=this.get("children");o(t)||(t=[t]);for(var i=0,n=t.length;i<n;i++){var r=t[i],a=r.get("parent");if(a)q(a.get("children"),r);this._setEvn(r),e.push(r)}return this},_setEvn:function(t){var e=this._attrs,i=e.context,n=e.canvas,r=e.aria,a=t._attrs,s=a.isGroup,o=a.type;t._attrs.parent=this,t._attrs.context=i,t._attrs.canvas=n,r&&!1!==t._attrs.aria&&(t._attrs.aria=r),"text"===o&&n&&n.get("fontFamily")&&(t._attrs.attrs.fontFamily=t._attrs.attrs.fontFamily||n.get("fontFamily"));var l=t._attrs.attrs.clip;if(l&&(l._attrs.parent=this,l._attrs.context=i,l._attrs.canvas=n),s)for(var h=t._attrs.children,u=0,c=h.length;u<c;u++)t._setEvn(h[u])},_getAriaLabel:function(){var t=this._attrs,e=t.aria,i=t.ariaLabel,n=t.children;if(e){var r=[];if(n&&n.length)for(var a=0,s=n.length;a<s;a++){var o=n[a].getAriaLabel();o&&r.push(o)}var l=r.join(" ");return i&&l?i+" "+l+" ":i||l}}},In=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initProperties=function(){this._attrs={type:"group",zIndex:0,visible:!0,destroyed:!1,isGroup:!0,canFill:!0,canStroke:!0,attrs:{},children:[]}},i.getBBox=function(){for(var t=1/0,e=-1/0,i=1/0,n=-1/0,r=this.get("children"),a=0,s=r.length;a<s;a++){var o=r[a];if(o.get("visible")){var l=o.getBBox();if(!l)continue;var h=[l.minX,l.minY],u=[l.minX,l.maxY],c=[l.maxX,l.minY],f=[l.maxX,l.maxY],p=o.attr("matrix");Et.transformMat2d(h,h,p),Et.transformMat2d(u,u,p),Et.transformMat2d(c,c,p),Et.transformMat2d(f,f,p),t=Math.min(h[0],u[0],c[0],f[0],t),e=Math.max(h[0],u[0],c[0],f[0],e),i=Math.min(h[1],u[1],c[1],f[1],i),n=Math.max(h[1],u[1],c[1],f[1],n)}}return{minX:t,minY:i,maxX:e,maxY:n,x:t,y:i,width:e-t,height:n-i}},i.createPath=function(e){var i=this.get("attrs");(i.fillStyle||i.strokeStyle)&&t.prototype.createPath.call(this,e)},i.drawInner=function(e){t.prototype.drawInner.call(this,e),this.drawChildren(e)},i.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e}(nn);A(In.prototype,An,{getGroupClass:function(){return In}});var En="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:function(t){return setTimeout(t,16)},Yn=function(t){wt(i,t);var e=i.prototype;function i(e){var i;i=t.call(this)||this;var n=e.title,r=n?M(St.general.withTitle,{title:n}):St.general.title;return i._attrs=A({type:"canvas",children:[],ariaLabel:r},e),i._initPixelRatio(),i._initCanvas(),i}return e.get=function(t){return this._attrs[t]},e.set=function(t,e){this._attrs[t]=e},e._initPixelRatio=function(){this.get("pixelRatio")||this.set("pixelRatio",it())},e.beforeDraw=function(){var t=this._attrs.context,e=this._attrs.el;t&&t.clearRect&&t.clearRect(0,0,e.width,e.height)},e._initCanvas=function(){var t,e=this.get("el"),i=this.get("context");if(!e&&!i)throw new Error("Please specify the id, el or context of the chart!");t=e?g(e)?st(e):e:Ui(i),i&&t&&!t.getContext&&(t.getContext=function(){return i});var n=this.get("width");n||(n=rt(t));var r=this.get("height");r||(r=at(t)),this.set("canvas",this),this.set("el",t),this.set("context",i||t.getContext("2d")),this.changeSize(n,r);var a=new Vi({canvas:this,el:t});this.set("eventController",a)},e.changeSize=function(t,e){var i=this.get("pixelRatio"),n=this.get("el");(n.style&&(n.style.width=t+"px",n.style.height=e+"px"),et(n))&&(n.width=t*i,n.height=e*i,1!==i&&this.get("context").scale(i,i));this.set("width",t),this.set("height",e)},e.getWidth=function(){var t=this.get("pixelRatio");return this.get("width")*t},e.getHeight=function(){var t=this.get("pixelRatio");return this.get("height")*t},e.getPointByClient=function(t,e){var i=this.get("el"),n=i.getBoundingClientRect(),r=n.right-n.left,a=n.bottom-n.top;return{x:(t-n.left)*(i.width/r),y:(e-n.top)*(i.height/a)}},e._beginDraw=function(){this._attrs.toDraw=!0},e._endDraw=function(){this._attrs.toDraw=!1},e.draw=function(){var t=this;t.get("destroyed")||(t.get("animateHandler")?this._beginDraw():function e(){t.set("animateHandler",En((function(){t.set("animateHandler",void 0),t.get("toDraw")&&e()}))),t.beforeDraw();try{var i=t._attrs.context;t.drawChildren(i),i.draw&&i.draw(),t.setAriaLabel()}catch(e){console.warn("error in draw canvas, detail as:"),console.warn(e),t._endDraw()}t._endDraw()}())},e.setAriaLabel=function(){var t=this._attrs.el,e=this._getAriaLabel();e&&t.setAttribute&&t.setAttribute("aria-label",e)},e.destroy=function(){if(!this.get("destroyed")){var t=this.get("el");t.width=0,t.height=0,this.clear(),this._attrs={},this.set("destroyed",!0)}},e.isDestroyed=function(){return this.get("destroyed")},i}(Dt);A(Yn.prototype,An,{getGroupClass:function(){return In}});var On={};function Nn(t){var e=On[t];return e||{Canvas:Yn,Group:In,Shape:en}}function zn(t){return new(Nn(t.renderer).Canvas)(t)}var Ln=Object.freeze({__proto__:null,registerEngine:function(t,e){On[t]=e},getEngine:Nn,createCanvas:zn,Canvas:Yn,Group:In,Shape:en,Matrix:It,Vector2:Et});function Xn(t){var e,i=t.start,n=t.end,r=n.x-i.x,a=Math.abs(n.y-i.y);if(t.isPolar){var s=t.circleRadius,o=t.center,l=t.startAngle,h=t.endAngle;e=new en.Sector({attrs:{x:o.x,y:o.y,r:s,r0:0,startAngle:l,endAngle:h}})}else e=new en.Rect({attrs:{x:i.x,y:n.y-10,width:r,height:a+20}});return e.isClip=!0,e}function Bn(t,e){var i=t.x,n=t.y,r=e.tl,a=e.tr,s=e.br;return i>=r.x&&i<=a.x&&n>=r.y&&n<=s.y}var Fn=Object.freeze({__proto__:null,getClip:Xn,isPointInPlot:Bn});function Rn(t,e){return t-e}var jn=function(t){wt(i,t),i.initPlugins=function(){return{_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach((function(t){-1===e.indexOf(t)&&e.push(t)})),this._cacheId++},unregister:function(t){var e=this._plugins;[].concat(t).forEach((function(t){var i=e.indexOf(t);-1!==i&&e.splice(i,1)})),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,i){var n,r,a,s,o=this.descriptors(t),l=o.length;for(n=0;n<l;++n)if("function"==typeof(s=(r=o[n].plugin)[e])&&(a=[t].concat(i||[]),!1===s.apply(r,a)))return!1;return!0},descriptors:function(t){var e=t._plugins||(t._plugins={});if(e.id===this._cacheId)return e.descriptors;var i=[],n=[];return this._plugins.concat(t&&t.get("plugins")||[]).forEach((function(t){-1===i.indexOf(t)&&(i.push(t),n.push({plugin:t}))})),e.descriptors=n,e.id=this._cacheId,n}}};var e=i.prototype;function i(e){var i,n=Tt(i=t.call(this,e)||this);return h(ne,(function(t,e){var i=b(e);n[i]=function(e){var i=new t(e);return n.addGeom(i),i}})),n._init(),i}return e.getDefaultCfg=function(){return{id:null,renderer:"canvas",rendered:!1,padding:bt.padding,data:null,scales:{},geoms:[],colDefs:null,pixelRatio:bt.pixelRatio,filters:null,appendPadding:bt.appendPadding}},e._syncYScales=function(){if(this.get("syncY")){var t=this.get("geoms"),e=[],i=[],n=[];h(t,(function(t){var r=t.getYScale();r.isLinear&&(e.push(r),i.push(r.min),n.push(r.max))})),i=Math.min.apply(null,i),n=Math.max.apply(null,n),h(e,(function(t){t.change({min:i}),t.change({max:n})}))}},e._getFieldsForLegend=function(){var t=[];return h(this.get("geoms"),(function(e){var i=e.get("attrOptions").color;i&&i.field&&g(i.field)&&h(i.field.split("*"),(function(e){-1===t.indexOf(e)&&t.push(e)}))})),t},e._getScaleData=function(t){var e=this.get("data"),i=this.get("filteredData");i.length&&(-1===this._getFieldsForLegend().indexOf(t)&&(e=i));return e},e._adjustScale=function(){for(var t=this.get("scaleController"),e=this.get("geoms"),i=0;i<e.length;i++){var n=e[i];if("interval"===n.get("type")){var r=n.getYScale();t.adjustStartZero(r)}}},e._removeGeoms=function(){for(var t=this.get("geoms");t.length>0;){t.shift().destroy()}},e._clearGeoms=function(){for(var t=this.get("geoms"),e=0,i=t.length;e<i;e++){t[e].clear()}},e._clearInner=function(){this._clearGeoms(),i.plugins.notify(this,"clearInner"),this.emit("clearinner"),this.get("axisController")&&this.get("axisController").clear()},e._initFilteredData=function(){var t=this.get("filters"),e=this.get("data")||[];t&&(e=e.filter((function(e){var i=!0;return h(t,(function(t,n){if(t&&!(i=t(e[n],e)))return!1})),i}))),this.set("filteredData",e)},e._changeGeomsData=function(){for(var t=this.get("geoms"),e=this.get("filteredData"),i=0,n=t.length;i<n;i++){t[i].changeData(e)}},e._initGeom=function(t){if(!t.get("isInit")){var e=this.get("coord"),i=this.get("filteredData"),n=this.get("colDefs"),r=this.get("middlePlot");t.set("chart",this),t.set("container",r.addGroup()),t.set("data",i),t.set("coord",e),t.set("colDefs",n),t.init(),this.emit("_aftergeominit",t)}},e._initGeoms=function(){for(var t=this.get("geoms"),e=0,i=t.length;e<i;e++)this._initGeom(t[e])},e._initCoord=function(){var t=this.get("plotRange"),e=A({type:"cartesian"},this.get("coordCfg"),{plot:t}),i=e.type,n=new(0,Ot[C(i)])(e);this.set("coord",n)},e._initLayout=function(){var t=this.get("_padding");t||(t=dt(t=this.get("margin")||this.get("padding")));var e="auto"===t[0]?0:t[0],i="auto"===t[1]?0:t[1],n="auto"===t[2]?0:t[2],r={x:"auto"===t[3]?0:t[3],y:e},a={x:this.get("width")-i,y:this.get("height")-n},s=this.get("plot");if(s)s.reset(r,a);else{var o=new At({start:r,end:a});this.set("plotRange",o),this.set("plot",o)}},e._initCanvas=function(){try{var t=zn({renderer:this.get("renderer"),el:this.get("el")||this.get("id"),context:this.get("context"),pixelRatio:this.get("pixelRatio"),width:this.get("width"),height:this.get("height"),fontFamily:bt.fontFamily,aria:this.get("aria"),title:this.get("title"),landscape:this.get("landscape")});this.set("canvas",t),this.set("el",t.get("el")),this.set("width",t.get("width")),this.set("height",t.get("height"))}catch(t){throw t}i.plugins.notify(this,"afterCanvasInit")},e._initLayers=function(){var t=this.get("canvas");this.set("backPlot",t.addGroup()),this.set("middlePlot",t.addGroup({zIndex:10})),this.set("frontPlot",t.addGroup({zIndex:20}))},e._initEvents=function(){var t=this;this.on("afterdatachange",(function(){t._initFilteredData(),t._changeGeomsData()})),this.on("_aftersizechange",(function(){t._initLayout();var e=t.get("coord");e&&e.reset(t.get("plot"))}))},e._initScaleController=function(){var t=new Fi({chart:this});this.set("colDefs",t.defs),this.set("scales",t.scales),this.set("scaleController",t)},e._clearScaleController=function(){this.get("scaleController").clear()},e._init=function(){this._initCanvas(),this._initLayout(),this._initLayers(),this._initEvents(),this._initScaleController(),this.set("axisController",new Gi({frontPlot:this.get("frontPlot").addGroup({className:"axisContainer"}),backPlot:this.get("backPlot").addGroup({className:"axisContainer"}),chart:this})),i.plugins.notify(this,"init")},e.init=function(){this._initFilteredData(),this._initCoord(),i.plugins.notify(this,"beforeGeomInit"),this._initGeoms(),this._syncYScales(),this._adjustScale(),this.emit("afterinit")},e.source=function(t,e){return this.set("data",t),e&&this.scale(e),this},e.scale=function(t,e){return this.get("scaleController").setFieldDef(t,e),this},e.axis=function(t,e){var i=this.get("axisController");return t?(i.axisCfg=i.axisCfg||{},i.axisCfg[t]=e):i.axisCfg=null,this},e.coord=function(t,e){var i;return l(t)?i=t:(i=e||{}).type=t||"cartesian",this.set("coordCfg",i),this},e.filter=function(t,e){var i=this.get("filters")||{};i[t]=e,this.set("filters",i),this.get("rendered")&&this.emit("afterdatachange",this.get("data"))},e.render=function(){var t=this.get("rendered"),e=this.get("canvas"),n=this.get("geoms");t?(this._initGeoms(),this._adjustScale()):(this.init(),this.set("rendered",!0)),this.emit("beforerender"),i.plugins.notify(this,"beforeGeomDraw"),this._renderAxis();var r=this.get("middlePlot");if(this.get("limitInPlot")&&!r.attr("clip")){var a=Xn(this.get("coord"));a.set("canvas",r.get("canvas")),r.attr("clip",a)}this.emit("beforegeomdraw");for(var s=0,o=n.length;s<o;s++){n[s].paint()}return this.emit("aftergeomdraw"),i.plugins.notify(this,"afterGeomDraw"),e.sort(),this.get("frontPlot").sort(),i.plugins.notify(this,"beforeCanvasDraw"),e.draw(),this.emit("afterrender"),this},e.clear=function(){return i.plugins.notify(this,"clear"),this.emit("clear"),this._clearInner(),this._removeGeoms(),this._clearScaleController(),this.set("legendItems",null),this.set("filters",null),this.set("isUpdate",!1),this.set("_padding",null),this.set("rendered",!1),this.get("canvas").draw(),this},e.repaint=function(){this.get("rendered")&&(this.set("isUpdate",!0),this.set("legendItems",null),i.plugins.notify(this,"repaint"),this._clearInner(),this.emit("repaint"),this.render())},e.changeData=function(t){this.emit("beforedatachange",t),this.set("data",t),i.plugins.notify(this,"changeData"),this.emit("afterdatachange",t),this.set("_padding",null),this.repaint()},e.changeSize=function(t,e){return t?this.set("width",t):t=this.get("width"),e?this.set("height",e):e=this.get("height"),this.get("canvas").changeSize(t,e),this.emit("_aftersizechange",{width:t,height:e}),this.repaint(),this},e.destroy=function(){this.clear(),this.get("canvas").destroy(),i.plugins.notify(this,"afterCanvasDestroyed"),this._interactions&&h(this._interactions,(function(t){t.destroy()})),t.prototype.destroy.call(this)},e.getPosition=function(t){for(var e=this.get("coord"),i=this.getXScale(),n=i.field,r=this.getYScales(),a=r[0],s=a.field,o=0,l=r.length;o<l;o++){var h=r[o],u=h.field;if(t[u]){a=h,s=u;break}}var c=i.scale(t[n]),f=a.scale(t[s]);return e.convertPoint({x:c,y:f})},e.getRecord=function(t){var e=this.get("coord"),i=this.getXScale(),n=this.getYScales()[0],r=e.invertPoint(t),a={};return a[i.field]=i.invert(r.x),a[n.field]=n.invert(r.y),a},e.getSnapRecords=function(t){var e=this.get("geoms")[0],i=[];return e&&(i=e.getSnapRecords(t)),i},e.createScale=function(t){var e=this._getScaleData(t);return this.get("scaleController").createScale(t,e)},e.addGeom=function(t){this.get("geoms").push(t)},e.getXScale=function(){return this.get("geoms")[0].getXScale()},e.getYScales=function(){var t=this.get("geoms"),e=[];return h(t,(function(t){var i=t.getYScale();-1===e.indexOf(i)&&e.push(i)})),e},e.getLegendItems=function(){if(this.get("legendItems"))return this.get("legendItems");var t={},e=[];return h(this.get("geoms"),(function(i){var n=i.getAttr("color");if(n){var r=n.getScale("color");if(r.isCategory&&!function(t,e){var i=!1;return h(t,(function(t){var n=[].concat(t.values),r=[].concat(e.values);t.type!==e.type||t.field!==e.field||n.sort(Rn).toString()!==r.sort(Rn).toString()||(i=!0)})),i}(e,r)){e.push(r);var a=r.field,s=r.getTicks(),o=[];h(s,(function(t){var e=t.text,i=t.value,a=r.invert(i),s={fill:n.mapping(a).join("")||bt.defaultColor,radius:3,symbol:"circle",stroke:"#fff"};o.push({name:e,dataValue:a,checked:!0,marker:s})})),t[a]=o}}})),this.set("legendItems",t),t},e.registerPlugins=function(t){var e=this,n=e.get("plugins")||[];o(n)||(n=[n]),[].concat(t).forEach((function(t){-1===n.indexOf(t)&&(t.init&&t.init(e),n.push(t))})),i.plugins._cacheId++,e.set("plugins",n)},e._renderAxis=function(){var t=this.get("axisController"),e=this.getXScale(),n=this.getYScales(),r=this.get("coord");i.plugins.notify(this,"beforeRenderAxis"),t.createAxis(r,e,n)},e._isAutoPadding=function(){if(this.get("_padding"))return!1;var t=this.get("padding");return o(t)?-1!==t.indexOf("auto"):"auto"===t},e._updateLayout=function(t){var e=this.get("width"),i=this.get("height"),n={x:t[3],y:t[0]},r={x:e-t[1],y:i-t[2]},a=this.get("plot"),s=this.get("coord");a.reset(n,r),s.reset(a)},e.landscape=function(t){this.get("canvas").set("landscape",t)},i}(kt);jn.plugins=jn.initPlugins();var Gn=function(){return null};function Hn(t){var e=[],i=t.x,n=t.y;return(n=o(n)?n:[n]).forEach((function(t,n){var r={x:o(i)?i[n]:i,y:t};e.push(r)})),e}function Wn(t,e,i){if(!t.length)return[];var n,r=[],a=[];return h(t,(function(t){n=t._origin?t._origin[e]:t[e],i?s(n)||a.push(t):o(n)&&s(n[0])||s(n)?a.length&&(r.push(a),a=[]):a.push(t)})),a.length&&r.push(a),r}bt.version;function Vn(t,e,i){if(0!==t.size){var n=function(t){var e={lineWidth:0,stroke:t.color,fill:t.color};return t.size&&(e.size=t.size),A(e,t.style),A({},bt.shape.point,e)}(t),r=n.r||n.size,a=t.x,s=o(t.y)?t.y:[t.y];"hollowCircle"===i&&(n.lineWidth=1,n.fill=null);for(var l=0,h=s.length;l<h;l++)return"rect"===i?e.addShape("Rect",{className:"point",attrs:A({x:a-r,y:s[l]-r,width:2*r,height:2*r},n)}):e.addShape("Circle",{className:"point",attrs:A({x:a,y:s[l],r:r},n)})}}Ut.registerFactory("point",{defaultShapeType:"circle",getDefaultPoints:function(t){return Hn(t)}}),h(["circle","hollowCircle","rect"],(function(t){Ut.registerShape("point",t,{draw:function(e,i){return Vn(e,i,t)}})}));var qn=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="point",e.shapeType="point",e.generatePoints=!1,e},i.draw=function(t,e){var i=this,n=i.get("container");h(t,(function(t){var r=t.shape,a=i.getDrawCfg(t);if(o(t.y)){var l=i.hasAdjust("stack");h(t.y,(function(s,o){a.y=s,l&&0===o||i.drawShape(r,t,a,n,e)}))}else s(t.y)||i.drawShape(r,t,a,n,e)}))},e}(ne);ne.Point=qn,Ut.registerFactory("line",{defaultShapeType:"line"});h(["line","smooth","dash"],(function(t){Ut.registerShape("line",t,{draw:function(e,i){var n="smooth"===t,r=function(t){var e={strokeStyle:t.color};return t.size>=0&&(e.lineWidth=t.size),A(e,t.style),A({},bt.shape.line,e)}(e);return"dash"===t&&(r.lineDash=bt.lineDash),function(t,e,i,n){var r=t.points;if(r.length&&o(r[0].y)){for(var a=[],s=[],l=0,h=r.length;l<h;l++){var u=Hn(r[l]);s.push(u[0]),a.push(u[1])}return t.isInCircle&&(a.push(a[0]),s.push(s[0])),t.isStack?e.addShape("Polyline",{className:"line",attrs:A({points:a,smooth:n},i)}):[e.addShape("Polyline",{className:"line",attrs:A({points:a,smooth:n},i)}),e.addShape("Polyline",{className:"line",attrs:A({points:s,smooth:n},i)})]}return t.isInCircle&&r.push(r[0]),e.addShape("Polyline",{className:"line",attrs:A({points:r,smooth:n},i)})}(e,i,r,n)}})}));var Un=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="path",e.shapeType="line",e},i.getDrawCfg=function(e){var i=t.prototype.getDrawCfg.call(this,e);return i.isStack=this.hasAdjust("stack"),i},i.draw=function(t,e){var i=this,n=i.get("container"),r=i.getYScale(),a=i.get("connectNulls"),s=Wn(t,r.field,a),o=this.getDrawCfg(t[0]);o.origin=t,h(s,(function(r,a){o.splitedIndex=a,o.points=r,i.drawShape(o.shape,t[0],o,n,e)}))},e}(ne);ne.Path=Un;var Zn=function(t){function e(){return t.apply(this,arguments)||this}return wt(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="line",e.sortable=!0,e},e}(Un);function Jn(t,e){return Math.abs(t-e)<1e-5}function $n(t){return!isNaN(t)&&!s(t)}function Kn(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];$n(r.x)&&$n(r.y)&&e.push(r)}return e}function Qn(t,e,i){var n=t.points,r=[],a=[];h(n,(function(t){a.push(t[0]),r.push(t[1])}));var s=A({fillStyle:t.color},bt.shape.area,t.style);return a.reverse(),r=this.parsePoints(r),a=this.parsePoints(a),t.isInCircle&&(r.push(r[0]),a.unshift(a[a.length-1]),function(t,e){var i=!0;return h(t,(function(t){if(!Jn(t.x,e.x)||!Jn(t.y,e.y))return i=!1,!1})),i}(a,t.center)&&(a=[])),function(t,e,i,n,r){var a=t.concat(e);return r?i.addShape("Custom",{className:"area",attrs:A({points:a},n),createPath:function(t){var e=[[0,0],[1,1]],i=Kn(this._attrs.attrs.points),n=i.length,r=i.slice(0,n/2),a=i.slice(n/2,n),s=mn(r,!1,e);t.beginPath(),t.moveTo(r[0].x,r[0].y);for(var o=0,l=s.length;o<l;o++){var h=s[o];t.bezierCurveTo(h[1],h[2],h[3],h[4],h[5],h[6])}if(a.length){var u=mn(a,!1,e);t.lineTo(a[0].x,a[0].y);for(var c=0,f=u.length;c<f;c++){var p=u[c];t.bezierCurveTo(p[1],p[2],p[3],p[4],p[5],p[6])}}t.closePath()},calculateBox:function(){return fn(Kn(this._attrs.attrs.points))}}):i.addShape("Polyline",{className:"area",attrs:A({points:a},n)})}(r,a,e,s,i)}ne.Line=Zn,Ut.registerFactory("area",{defaultShapeType:"area",getDefaultPoints:function(t){var e=t.x,i=t.y,n=t.y0;i=o(i)?i:[n,i];var r=[];return r.push({x:e,y:i[0]},{x:e,y:i[1]}),r}});h(["area","smooth"],(function(t){Ut.registerShape("area",t,{draw:function(e,i){var n="smooth"===t;return Qn.call(this,e,i,n)}})}));var tr=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="area",e.shapeType="area",e.generatePoints=!0,e.sortable=!0,e},i.draw=function(t,e){var i=this,n=i.get("container"),r=this.getDrawCfg(t[0]),a=i.getYScale(),s=i.get("connectNulls"),o=Wn(t,a.field,s);r.origin=t,h(o,(function(a,s){r.splitedIndex=s;var o=a.map((function(t){return t.points}));r.points=o,i.drawShape(r.shape,t[0],r,n,e)}))},e}(ne);ne.Area=tr;var er={initEvent:function(){var t=this,e=this.get("chart");e&&e.on("_aftersizechange",(function(){t.set("_width",null)}))},getDefaultSize:function(){var t=this.get("defaultSize");if(!t){var e=this.get("coord"),i=this.getXScale(),n=this.get("dataArray"),r=d(i.values).length,a=i.range,s=1/r,o=1;e&&e.isPolar?o=e.transposed&&r>1?bt.widthRatio.multiplePie:bt.widthRatio.rose:(i.isLinear&&(s*=a[1]-a[0]),o=bt.widthRatio.column),s*=o,this.hasAdjust("dodge")&&(s/=n.length),t=s,this.set("defaultSize",t)}return t},getDimWidth:function(t){var e=this.get("coord"),i=e.convertPoint({x:0,y:0}),n=e.convertPoint({x:"x"===t?1:0,y:"x"===t?0:1}),r=0;return i&&n&&(r=Math.sqrt(Math.pow(n.x-i.x,2)+Math.pow(n.y-i.y,2))),r},_getWidth:function(){var t=this.get("_width");if(!t){var e=this.get("coord");t=e&&e.isPolar&&!e.transposed?(e.endAngle-e.startAngle)*e.circleRadius:this.getDimWidth("x"),this.set("_width",t)}return t},_toNormalizedSize:function(t){return t/this._getWidth()},_toCoordSize:function(t){return this._getWidth()*t},getNormalizedSize:function(t){var e=this.getAttrValue("size",t);return e=s(e)?this.getDefaultSize():this._toNormalizedSize(e)},getSize:function(t){var e=this.getAttrValue("size",t);if(s(e)){var i=this.getDefaultSize();e=this._toCoordSize(i)}return e}};function ir(t){var e,i,n=t.x,r=t.y,a=t.y0,s=t.size,l=a,h=r;return o(r)&&(h=r[1],l=r[0]),o(n)?(e=n[0],i=n[1]):(e=n-s/2,i=n+s/2),[{x:e,y:l},{x:e,y:h},{x:i,y:h},{x:i,y:l}]}Ut.registerFactory("interval",{defaultShapeType:"rect",getDefaultPoints:function(t){return ir(t)}}),Ut.registerShape("interval","rect",{draw:function(t,e){var i=this.parsePoints(t.points),n=A({fill:t.color},bt.shape.interval,t.style);if(t.isInCircle){var r=i.slice(0);this._coord.transposed&&(r=[i[0],i[3],i[2],i[1]]);var a=t.center,s=a.x,o=a.y,l=[1,0],h=[r[0].x-s,r[0].y-o],u=[r[1].x-s,r[1].y-o],c=[r[2].x-s,r[2].y-o],f=Et.angleTo(l,u),p=Et.angleTo(l,c),g=Et.length(h),d=Et.length(u);return f>=1.5*Math.PI&&(f-=2*Math.PI),p>=1.5*Math.PI&&(p-=2*Math.PI),e.addShape("Sector",{className:"interval",attrs:A({x:s,y:o,r:d,r0:g,startAngle:f,endAngle:p},n)})}var v=function(t){for(var e=[],i=[],n=0,r=t.length;n<r;n++){var a=t[n];e.push(a.x),i.push(a.y)}var s=Math.min.apply(null,e),o=Math.min.apply(null,i);return{x:s,y:o,width:Math.max.apply(null,e)-s,height:Math.max.apply(null,i)-o}}(i);return e.addShape("rect",{className:"interval",attrs:A(v,n)})}}),["pyramid","funnel"].forEach((function(t){Ut.registerShape("interval",t,{getPoints:function(t){return t.size=2*t.size,ir(t)},draw:function(e,i){var n,r,a=this.parsePoints(e.points),s=this.parsePoints(e.nextPoints),o=null;s?o=[a[0],a[1],s[1],s[0]]:(o=[a[0],a[1]],"pyramid"===t?o.push((n=a[2],r=a[3],{x:(n.x-r.x)/2+r.x,y:(n.y-r.y)/2+r.y})):o.push(a[2],a[3]));var l=A({fill:e.color,points:o},bt.shape.interval,e.style);return i.addShape("polygon",{className:"interval",attrs:l})}})}));var nr=function(t){wt(i,t);var e=i.prototype;function i(e){var i;return A(Tt(i=t.call(this,e)||this),er),i}return e.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="interval",e.shapeType="interval",e.generatePoints=!0,e},e.init=function(){t.prototype.init.call(this),this.initEvent()},e.createShapePointsCfg=function(e){var i=t.prototype.createShapePointsCfg.call(this,e);return i.size=this.getNormalizedSize(e),i},e.clearInner=function(){t.prototype.clearInner.call(this),this.set("defaultSize",null)},i}(ne);ne.Interval=nr,Ut.registerFactory("polygon",{defaultShapeType:"polygon",getDefaultPoints:function(t){for(var e=[],i=t.x,n=t.y,r=0,a=i.length;r<a;r++)e.push({x:i[r],y:n[r]});return e}}),Ut.registerShape("polygon","polygon",{draw:function(t,e){var i=this.parsePoints(t.points),n=A({fill:t.color,points:i},t.style);return e.addShape("Polygon",{className:"polygon",attrs:n})}});var rr=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="polygon",e.shapeType="polygon",e.generatePoints=!0,e},i.createShapePointsCfg=function(e){var i,n=t.prototype.createShapePointsCfg.call(this,e),r=n.x,a=n.y;if(!o(r)||!o(a)){var s=this.getXScale(),l=this.getYScale(),h=.5/(s.values?s.values.length:s.ticks.length),u=.5/(l.values?l.values.length:l.ticks.length);s.isCategory&&l.isCategory?(r=[r-h,r-h,r+h,r+h],a=[a-u,a+u,a+u,a-u]):o(r)?(r=[(i=r)[0],i[0],i[1],i[1]],a=[a-u/2,a+u/2,a+u/2,a-u/2]):o(a)&&(a=[(i=a)[0],i[1],i[1],i[0]],r=[r-h/2,r-h/2,r+h/2,r+h/2]),n.x=r,n.y=a}return n},e}(ne);ne.Polygon=rr,Ut.registerFactory("schema",{}),Ut.registerShape("schema","candle",{getPoints:function(t){return e=t.x,i=t.y,n=t.size,r=function(t){var e=t.sort((function(t,e){return t<e?1:-1})),i=e.length;if(i<4)for(var n=e[i-1],r=0;r<4-i;r++)e.push(n);return e}(i),[{x:e,y:r[0]},{x:e,y:r[1]},{x:e-n/2,y:r[2]},{x:e-n/2,y:r[1]},{x:e+n/2,y:r[1]},{x:e+n/2,y:r[2]},{x:e,y:r[2]},{x:e,y:r[3]}];var e,i,n,r},draw:function(t,e){var i=this.parsePoints(t.points),n=A({stroke:t.color,fill:t.color,lineWidth:1},t.style);return e.addShape("Custom",{className:"schema",attrs:n,createPath:function(t){t.beginPath(),t.moveTo(i[0].x,i[0].y),t.lineTo(i[1].x,i[1].y),t.moveTo(i[2].x,i[2].y);for(var e=3;e<6;e++)t.lineTo(i[e].x,i[e].y);t.closePath(),t.moveTo(i[6].x,i[6].y),t.lineTo(i[7].x,i[7].y)}})}});var ar=function(t){wt(i,t);var e=i.prototype;function i(e){var i;return A(Tt(i=t.call(this,e)||this),er),i}return e.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="schema",e.shapeType="schema",e.generatePoints=!0,e},e.init=function(){t.prototype.init.call(this),this.initEvent()},e.createShapePointsCfg=function(e){var i=t.prototype.createShapePointsCfg.call(this,e);return i.size=this.getNormalizedSize(e),i},e.clearInner=function(){t.prototype.clearInner.call(this),this.set("defaultSize",null)},i}(ne);ne.Schema=ar;var sr={}.toString,or=function(t,e){return sr.call(t)==="[object "+e+"]"},lr=Array.isArray?Array.isArray:function(t){return or(t,"Array")},hr=function(t){return null==t};var ur=function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,e.__proto__=i;var r=n.prototype;return r._initDefaultCfg=function(){this.xField=null,this.yField=null},r.processAdjust=function(t){this.processStack(t)},r.processStack=function(t){var e=this.xField,i=this.yField,n=t.length,r={positive:{},negative:{}};this.reverseOrder&&(t=t.slice(0).reverse());for(var a=0;a<n;a++)for(var s=t[a],o=0,l=s.length;o<l;o++){var h=s[o],u=h[e]||0,c=h[i],f=u.toString();if(c=lr(c)?c[1]:c,!hr(c)){var p=c>=0?"positive":"negative";r[p][f]||(r[p][f]=0),h[i]=[r[p][f],c+r[p][f]],r[p][f]+=c}}},n}(Qt);Qt.Stack=ur;var cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fr=function(t){var e=void 0===t?"undefined":cr(t);return null!==t&&"object"===e||"function"===e},pr=function(t,e){if(t){if(lr(t))for(var i=0,n=t.length;i<n&&!1!==e(t[i],i);i++);else if(fr(t))for(var r in t)if(t.hasOwnProperty(r)&&!1===e(t[r],r))break}};var gr=function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,e.__proto__=i;var r=n.prototype;return r._initDefaultCfg=function(){this.marginRatio=.5,this.dodgeRatio=.5,this.adjustNames=["x","y"]},r.getDodgeOffset=function(t,e,i){var n=t.pre,r=t.next,a=r-n,s=a*this.dodgeRatio/i,o=this.marginRatio*s;return(n+r)/2+(.5*(a-i*s-(i-1)*o)+((e+1)*s+e*o)-.5*s-.5*a)},r.processAdjust=function(t){var e=this,i=t.length,n=e.xField;pr(t,(function(t,r){for(var a=0,s=t.length;a<s;a++){var o=t[a],l=o[n],h={pre:1===s?l-1:l-.5,next:1===s?l+1:l+.5},u=e.getDodgeOffset(h,r,i);o[n]=u}}))},n}(Qt);Qt.Dodge=gr;var dr=function(t){return or(t,"Function")},vr=function(t,e){if(lr(t)){var i=t[0],n=void 0;n=dr(e)?e(t[0]):t[0][e];var r=void 0;return pr(t,(function(t){(r=dr(e)?e(t):t[e])>n&&(i=t,n=r)})),i}};var mr={merge:function(t){for(var e=[],i=0;i<t.length;i++)e=e.concat(t[i]);return e}},yr=function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,e.__proto__=i;var r=n.prototype;return r._initDefaultCfg=function(){this.xField=null,this.yField=null,this.cacheMax=null,this.adjustNames=["y"],this.groupFields=null},r._getMax=function(t){var e=this.mergeData,i=vr(e,(function(e){var i=e[t];return lr(i)?Math.max.apply(null,i):i}))[t];return lr(i)?Math.max.apply(null,i):i},r._getXValuesMax=function(){var t=this.yField,e=this.xField,i={},n=this.mergeData;return pr(n,(function(n){var r=n[e],a=n[t],s=lr(a)?Math.max.apply(null,a):a;i[r]=i[r]||0,i[r]<s&&(i[r]=s)})),i},r.processAdjust=function(t){var e=mr.merge(t);this.mergeData=e,this._processSymmetric(t),this.mergeData=null},r._processSymmetric=function(t){var e,i=this.xField,n=this.yField,r=this._getMax(n),a=t[0][0];a&&lr(a[n])&&(e=this._getXValuesMax()),pr(t,(function(t){pr(t,(function(t){var a,s=t[n];if(lr(s)){var o=t[i],l=e[o];a=(r-l)/2;var h=[];pr(s,(function(t){h.push(a+t)})),t[n]=h}else a=(r-s)/2,t[n]=[a,s+a]}))}))},n}(Qt);Qt.Symmetric=yr;var xr=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="polar",this.startAngle=-Math.PI/2,this.endAngle=3*Math.PI/2,this.inner=0,this.innerRadius=0,this.isPolar=!0,this.transposed=!1,this.center=null,this.radius=null},i.init=function(e,i){t.prototype.init.call(this,e,i);var n,r,a=this.inner||this.innerRadius,s=Math.abs(i.x-e.x),o=Math.abs(i.y-e.y);this.startAngle===-Math.PI&&0===this.endAngle?(n=Math.min(s/2,o),r={x:(e.x+i.x)/2,y:e.y}):(n=Math.min(s,o)/2,r={x:(e.x+i.x)/2,y:(e.y+i.y)/2});var l=this.radius;l>0&&l<=1&&(n*=l),this.x={start:this.startAngle,end:this.endAngle},this.y={start:n*a,end:n},this.center=r,this.circleRadius=n},i._convertPoint=function(t){var e=this.center,i=this.transposed,n=i?"y":"x",r=i?"x":"y",a=this.x,s=this.y,o=a.start+(a.end-a.start)*t[n],l=s.start+(s.end-s.start)*t[r];return{x:e.x+Math.cos(o)*l,y:e.y+Math.sin(o)*l}},i._invertPoint=function(t){var e=this.center,i=this.transposed,n=this.x,r=this.y,a=i?"y":"x",s=i?"x":"y",o=[1,0,0,1,0,0];It.rotate(o,o,n.start);var l=[1,0];Et.transformMat2d(l,l,o),l=[l[0],l[1]];var h=[t.x-e.x,t.y-e.y];if(Et.zero(h))return{x:0,y:0};var u=Et.angleTo(l,h,n.end<n.start);Math.abs(u-2*Math.PI)<.001&&(u=0);var c=Et.length(h),f=u/(n.end-n.start);f=n.end-n.start>0?f:-f;var p=(c-r.start)/(r.end-r.start),g={};return g[a]=f,g[s]=p,g},e}(Ot);Ot.Polar=xr;var _r=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.startAngle=-Math.PI/2,this.endAngle=3*Math.PI/2,this.radius=null,this.center=null},i.getOffsetPoint=function(t){var e=this.startAngle,i=e+(this.endAngle-e)*t;return this._getCirclePoint(i)},i._getCirclePoint=function(t,e){var i=this.center;return e=e||this.radius,{x:i.x+Math.cos(t)*e,y:i.y+Math.sin(t)*e}},i.getTextAlignInfo=function(t,e){var i,n=this.getOffsetVector(t,e),r="middle";return n[0]>0?i="left":n[0]<0?i="right":(i="center",n[1]>0?r="top":n[1]<0&&(r="bottom")),{textAlign:i,textBaseline:r}},i.getAxisVector=function(t){var e=this.center,i=this.offsetFactor;return[(t.y-e.y)*i,-1*(t.x-e.x)*i]},i.drawLine=function(t){var e=this.center,i=this.radius,n=this.startAngle,r=this.endAngle;this.getContainer(t.top).addShape("arc",{className:"axis-line",attrs:A({x:e.x,y:e.y,r:i,startAngle:n,endAngle:r},t)})},e}(Ri);Ri.Circle=_r;var Sr={min:0,median:.5,max:1},br=function(){var t=e.prototype;function e(t){this._initDefaultCfg(),E(this,t)}return t._initDefaultCfg=function(){},t._getNormalizedValue=function(t,e){return s(Sr[t])?e.scale(t):Sr[t]},t.parsePercentPoint=function(t,e){var i=parseFloat(e[0])/100,n=parseFloat(e[1])/100,r=t.start,a=t.end,s=Math.abs(r.x-a.x),o=Math.abs(r.y-a.y);return{x:s*i+Math.min(r.x,a.x),y:o*n+Math.min(r.y,a.y)}},t.parsePoint=function(t,e){var i=this.xScale,n=this.yScales;if(a(e)&&(e=e(i,n)),g(e[0])&&-1!==e[0].indexOf("%")&&!isNaN(e[0].slice(0,-1)))return this.parsePercentPoint(t,e);var r=this._getNormalizedValue(e[0],i),s=this._getNormalizedValue(e[1],n[0]),o=t.convertPoint({x:r,y:s});return this.limitInPlot?r>=0&&r<=1&&s>=0&&s<=1?o:null:o},t.render=function(){},t.repaint=function(){this.remove();var t=this.coord,e=this.container,i=this.canvas;e&&!e.isDestroyed()&&(this.render(t,e),i.draw())},t.remove=function(){var t=this.element;t&&t.remove(!0)},t.changeVisible=function(t){this.visible=t;var e=this.element;e&&(e.set?e.set("visible",t):e.style.display=t?"":"none")},e}(),Mr=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="text",this.position=null,this.content=null,this.style={fill:"#000"},this.offsetX=0,this.offsetY=0},i.render=function(t,e){var i=this.position,n=this.parsePoint(t,i);if(n){var r=this.content,a=this.style,s=this.offsetX,o=this.offsetY;s&&(n.x+=s),o&&(n.y+=o);var l=e.addShape("text",{className:"guide-text",attrs:A({x:n.x,y:n.y,text:r},a)});return this.element=l,l}},e}(br);br.Text=Mr;var Cr=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="line",this.start=[],this.end=[],this.style={stroke:"#000",lineWidth:1}},i.render=function(t,e){var i=[];if(i[0]=this.parsePoint(t,this.start),i[1]=this.parsePoint(t,this.end),i[0]&&i[1]){var n=e.addShape("Line",{className:"guide-line",attrs:A({x1:i[0].x,y1:i[0].y,x2:i[1].x,y2:i[1].y},this.style)});return this.element=n,n}},e}(br);br.Line=Cr;var wr=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="arc",this.start=[],this.end=[],this.style={stroke:"#999",lineWidth:1}},i.render=function(t,e){var i=this.parsePoint(t,this.start),n=this.parsePoint(t,this.end);if(i&&n){var r=t.center,a=Math.sqrt((i.x-r.x)*(i.x-r.x)+(i.y-r.y)*(i.y-r.y)),s=Math.atan2(i.y-r.y,i.x-r.x),o=Math.atan2(n.y-r.y,n.x-r.x),l=e.addShape("arc",{className:"guide-arc",attrs:A({x:r.x,y:r.y,r:a,startAngle:s,endAngle:o},this.style)});return this.element=l,l}},e}(br);br.Arc=wr;var Pr=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="rect",this.start=[],this.end=[],this.style={fill:"#CCD7EB",opacity:.4}},i.render=function(t,e){var i=this.parsePoint(t,this.start),n=this.parsePoint(t,this.end);if(i&&n){var r=e.addShape("rect",{className:"guide-rect",attrs:A({x:Math.min(i.x,n.x),y:Math.min(i.y,n.y),width:Math.abs(n.x-i.x),height:Math.abs(i.y-n.y)},this.style)});return this.element=r,r}},e}(br);function Tr(t,e){for(var i in e)e.hasOwnProperty(i)&&(t.style[i]=e[i]);return t}function Dr(t){var e=document.createElement("div");return t=t.replace(/(^\s*)|(\s*$)/g,""),e.innerHTML=""+t,e.childNodes[0]}br.Rect=Pr;var kr=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="html",this.position=null,this.alignX="center",this.alignY="middle",this.offsetX=null,this.offsetY=null,this.html=null},i.render=function(t,e){var i=this.parsePoint(t,this.position);if(i){var n=Dr(this.html);n=Tr(n,{position:"absolute",top:Math.floor(i.y)+"px",left:Math.floor(i.x)+"px",visibility:"hidden"});var r=e.get("canvas").get("el"),a=r.parentNode;a=Tr(a,{position:"relative"});var s=Dr('<div class="guideWapper" style="position: absolute;top: 0; left: 0;"></div>');a.appendChild(s),s.appendChild(n);var o=r.offsetTop,l=r.offsetLeft,h=this.alignX,u=this.alignY,c=this.offsetX,f=this.offsetY,p=function(t,e,i,n){var r=[];return"left"===t&&"top"===e?(r[0]=0,r[1]=0):"right"===t&&"top"===e?(r[0]=-i,r[1]=0):"left"===t&&"bottom"===e?(r[0]=0,r[1]=Math.floor(-n)):"right"===t&&"bottom"===e?(r[0]=Math.floor(-i),r[1]=Math.floor(-n)):"right"===t&&"middle"===e?(r[0]=Math.floor(-i),r[1]=Math.floor(-n/2)):"left"===t&&"middle"===e?(r[0]=0,r[1]=Math.floor(-n/2)):"center"===t&&"bottom"===e?(r[0]=Math.floor(-i/2),r[1]=Math.floor(-n)):"center"===t&&"top"===e?(r[0]=Math.floor(-i/2),r[1]=0):(r[0]=Math.floor(-i/2),r[1]=Math.floor(-n/2)),r}(h,u,rt(n),at(n));i.x=i.x+p[0]+l,i.y=i.y+p[1]+o,c&&(i.x+=c),f&&(i.y+=f),Tr(n,{top:Math.floor(i.y)+"px",left:Math.floor(i.x)+"px",visibility:"visible"}),this.element=s}},i.remove=function(){var t=this.element;t&&t.parentNode&&t.parentNode.removeChild(t)},e}(br);br.Html=kr;var Ar=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="tag",this.position=null,this.content=null,this.direct="tl",this.autoAdjust=!0,this.offsetX=0,this.offsetY=0,this.side=4,this.background={padding:5,radius:2,fill:"#1890FF"},this.textStyle={fontSize:12,fill:"#fff",textAlign:"center",textBaseline:"middle"},this.withPoint=!0,this.pointStyle={fill:"#1890FF",r:3,lineWidth:1,stroke:"#fff"}},i._getDirect=function(t,e,i,n){var r=this.direct,a=this.side,s=t.get("canvas"),o=s.get("width"),l=s.get("height"),h=e.x,u=e.y,c=r[0],f=r[1];"t"===c&&u-a-n<0?c="b":"b"===c&&u+a+n>l&&(c="t");var p="c"===c?a:0;return"l"===f&&h-p-i<0?f="r":"r"===f&&h+p+i>o?f="l":"c"===f&&(i/2+h+p>o?f="l":h-i/2-p<0&&(f="r")),r=c+f},i.render=function(t,e){var i=this.parsePoint(t,this.position);if(i&&!isNaN(i.x)&&!isNaN(i.y)){var n=this.content,r=this.background,a=this.textStyle,s=[],o=e.addGroup({className:"guide-tag"});if(this.withPoint){var l=o.addShape("Circle",{className:"guide-tag-point",attrs:A({x:i.x,y:i.y},this.pointStyle)});s.push(l)}var h=o.addGroup(),u=h.addShape("text",{className:"guide-tag-text",zIndex:1,attrs:A({x:0,y:0,text:n},a)});s.push(u);var c=u.getBBox(),f=dt(r.padding),p=c.width+f[1]+f[3],g=c.height+f[0]+f[2],d=c.minY-f[0],v=c.minX-f[3],m=h.addShape("rect",{className:"guide-tag-bg",zIndex:-1,attrs:A({x:v,y:d,width:p,height:g},r)});s.push(m);var y,x=this.autoAdjust?this._getDirect(e,i,p,g):this.direct,_=this.side,S=i.x+this.offsetX,b=i.y+this.offsetY,M=dt(r.radius);"tl"===x?(y=[{x:p+v-_-1,y:g+d-1},{x:p+v,y:g+d-1},{x:p+v,y:g+_+d}],M[2]=0,S-=p,b=b-_-g):"cl"===x?(y=[{x:p+v-1,y:(g-_)/2+d-1},{x:p+v-1,y:(g+_)/2+d+1},{x:p+_+v,y:g/2+d}],S=S-p-_,b-=g/2):"bl"===x?(y=[{x:p+v,y:-_+d},{x:p+v-_-1,y:d+1},{x:p+v,y:d+1}],M[1]=0,S-=p,b+=_):"bc"===x?(y=[{x:p/2+v,y:-_+d},{x:(p-_)/2+v-1,y:d+1},{x:(p+_)/2+v+1,y:d+1}],S-=p/2,b+=_):"br"===x?(y=[{x:v,y:d-_},{x:v,y:d+1},{x:v+_+1,y:d+1}],M[0]=0,b+=_):"cr"===x?(y=[{x:v-_,y:g/2+d},{x:v+1,y:(g-_)/2+d-1},{x:v+1,y:(g+_)/2+d+1}],S+=_,b-=g/2):"tr"===x?(y=[{x:v,y:g+_+d},{x:v,y:g+d-1},{x:_+v+1,y:g+d-1}],M[3]=0,b=b-g-_):"tc"===x&&(y=[{x:(p-_)/2+v-1,y:g+d-1},{x:(p+_)/2+v+1,y:g+d-1},{x:p/2+v,y:g+_+d}],S-=p/2,b=b-g-_);var C=h.addShape("Polygon",{className:"guide-tag-side",zIndex:0,attrs:{points:y,fill:r.fill}});return s.push(C),m.attr("radius",M),h.moveTo(S-v,b-d),h.sort(),this.element=o,s}},e}(br);br.Tag=Ar;var Ir=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="point",this.position=null,this.offsetX=0,this.offsetY=0,this.style={fill:"#1890FF",r:3,lineWidth:1,stroke:"#fff"}},i.render=function(t,e){var i=this.parsePoint(t,this.position);if(!i)return null;var n=e.addShape("Circle",{className:"guide-point",attrs:A({x:i.x+this.offsetX,y:i.y+this.offsetY},this.style)});return this.element=n,n},e}(br);br.Point=Ir;var Er=function(t){function e(){return t.apply(this,arguments)||this}wt(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="regionFilter",this.start=[],this.end=[],this.color=null,this.style=null},i.render=function(t){var e=this.parsePoint(t,this.start),i=this.parsePoint(t,this.end);if(e&&i){var n=new nn({attrs:{x:Math.min(e.x,i.x),y:Math.min(e.y,i.y),width:Math.abs(i.x-e.x),height:Math.abs(i.y-e.y)}});this.clip=n;var r=this.chart,a=this.color,s=this.style||{},o=[];r.get("geoms").map((function(t){var e=t.get("container"),i=e.get("children"),r=e.addGroup({zIndex:10,className:"guide-region-filter"});return i.map((function(t){if(t.get("isShape")){var e=t.get("type"),i=A({},t.get("attrs"),s);a&&(i.fill||i.fillStyle)&&(i.fill=i.fillStyle=a),a&&(i.stroke||i.strokeStyle)&&(i.stroke=i.strokeStyle=a);var n={attrs:i};"custom"!==e&&"Custom"!==e||(n.createPath=t.get("createPath"),n.calculateBox=t.get("calculateBox")),r.addShape(e,n)}return t})),r.attr("clip",n),e.sort(),o.push(r),t})),this.element=o}},i.remove=function(){h(this.element,(function(t){t&&t.remove(!0)})),this.clip&&this.clip.remove(!0)},e}(br);br.RegionFilter=Er;var Yr=function(){var t=e.prototype;function e(t){E(this,this.getDefaultCfg(),t),this._init(),this._renderTitle(),this._renderItems()}return t.getDefaultCfg=function(){return{showTitle:!1,title:null,items:null,titleGap:12,itemGap:10,itemMarginBottom:12,itemFormatter:null,itemWidth:null,wordSpace:6,x:0,y:0,layout:"horizontal",joinString:": "}},t._init=function(){var t=this.parent;if(t){var e=t.addGroup({zIndex:this.zIndex||0});this.container=e;var i=e.addGroup();this.wrapper=i;var n=i.addGroup({className:"itemsGroup"});this.itemsGroup=n}},t._renderTitle=function(t){t=t||this.title;var e=this.titleShape,i=0;if(this.showTitle&&t){if(e&&!e.get("destroyed"))e.attr("text",t);else{var n=this.wrapper,r=this.titleStyle;e=n.addShape("text",{className:"title",attrs:A({x:0,y:0,text:t},r)}),this.titleShape=e}i=e.getBBox().height+this.titleGap}this._titleHeight=i},t._renderItems=function(t){var e=this;(t=t||e.items)&&(e.reversed&&t.reverse(),h(t,(function(t,i){e._addItem(t,i)})),t.length>1&&this._adjustItems(),this._renderBackground())},t._renderBackground=function(){var t=this.background;if(t){var e=this.container,i=this.wrapper.getBBox(),n=i.minX,r=i.minY,a=i.width,s=i.height,o=t.padding||[0,0,0,0],l=A({x:n-(o=dt(o))[3],y:r-o[0],width:a+o[1]+o[3],height:s+o[0]+o[2]},t),h=this.backShape;h?h.attr(l):h=e.addShape("Rect",{zIndex:-1,attrs:l}),this.backShape=h,e.sort()}},t._addItem=function(t){var e,i=this.itemsGroup.addGroup({name:t.name,value:t.value,dataValue:t.dataValue,checked:t.checked}),n=this.unCheckStyle,r=this.unCheckColor,a=this.nameStyle,s=this.valueStyle,o=this.wordSpace,l=t.marker,h=t.value,u=0;if(r&&(n.fill=r),l){var c=A({x:l.radius||3,y:this._titleHeight},l);!1===t.checked&&A(c,n),u+=i.addShape("marker",{className:"item-marker",attrs:c}).getBBox().width+o}var f=t.name;if(f){var p=this.joinString||"";f=h?f+p:f,e=i.addShape("text",{className:"name",attrs:A({x:u,y:this._titleHeight,text:this._formatItemValue(f)},a,!1===t.checked?n:null)})}if(h){var g=u;e&&(g+=e.getBBox().width),i.addShape("text",{className:"value",attrs:A({x:g,y:this._titleHeight,text:h},s,!1===t.checked?n:null)})}return i},t._formatItemValue=function(t){var e=this.itemFormatter;return e&&(t=e.call(this,t)),t},t._getMaxItemWidth=function(){var t=this.itemWidth;if(x(t)||s(t))return t;if("auto"===t){for(var e=this.itemsGroup.get("children"),i=e.length,n=0,r=0;r<i;r++){var a=e[r].getBBox().width;n=Math.max(n,a)}var o=this.maxLength,l=this.itemGap,h=(o-l)/2,u=(o-2*l)/3;return 2===i?Math.max(n,h):n<=u?u:n<=h?h:n}},t._adjustHorizontal=function(){for(var t,e,i=this.maxLength,n=this.itemsGroup.get("children"),r=this.itemGap,a=this.itemMarginBottom,s=this._titleHeight,o=0,l=0,h=this._getMaxItemWidth(),u=[],c=0,f=n.length;c<f;c++){var p=n[c],g=p.getBBox(),d=g.height,v=g.width;e=d+a,(t=h||v)-(i-l)>1e-4&&(o++,l=0),p.moveTo(l,o*e),u.push({x:l,y:o*e+s-d/2,width:1.375*v,height:1.375*d}),l+=t+r}this.legendHitBoxes=u},t._adjustVertical=function(){for(var t,e,i=this.maxLength,n=this.itemsGroup,r=this.itemGap,a=this.itemMarginBottom,s=this.itemWidth,o=this._titleHeight,l=n.get("children"),h=0,u=0,c=0,f=[],p=0,g=l.length;p<g;p++){var d=l[p],v=d.getBBox();t=v.width,e=v.height,x(s)?u=s+r:t>u&&(u=t+r),i-h<e?(h=0,c+=u,d.moveTo(c,0),f.push({x:c,y:o-e/2,width:1.375*t,height:1.375*e})):(d.moveTo(c,h),f.push({x:c,y:h-e/2+o,width:1.375*t,height:1.375*e})),h+=e+a}this.legendHitBoxes=f},t._adjustItems=function(){"horizontal"===this.layout?this._adjustHorizontal():this._adjustVertical()},t.moveTo=function(t,e){this.x=t,this.y=e;var i=this.container;return i&&i.moveTo(t,e),this},t.setItems=function(t){this.clearItems(),this._renderItems(t)},t.setTitle=function(t){this._renderTitle(t)},t.clearItems=function(){this.itemsGroup.clear()},t.getWidth=function(){return this.container.getBBox().width},t.getHeight=function(){return this.container.getBBox().height},t.show=function(){this.container.show()},t.hide=function(){this.container.hide()},t.clear=function(){var t=this.container;t.clear(),t.remove(!0)},e}(),Or=function(){var t=e.prototype;function e(t){E(this,this.getDefaultCfg(),t),this._init();var e=this.content,i=this.x,n=this.y;s(e)||this.updateContent(e),this.updatePosition(i,n)}return t.getDefaultCfg=function(){return{x:0,y:0,content:"",textStyle:{fontSize:12,fill:"#fff",textAlign:"center",textBaseline:"middle",fontFamily:"Arial"},background:{radius:1,fill:"rgba(0, 0, 0, 0.65)",padding:[3,5]},width:0,height:0,className:""}},t._init=function(){var t=this.content,e=this.textStyle,i=this.background,n=this.className,r=this.visible,a=this.context,s=new In({context:a,className:n,zIndex:0,visible:r}),o=s.addShape("Text",{className:n+"-text",zIndex:1,attrs:A({text:t,x:0,y:0},e)}),l=s.addShape("Rect",{className:n+"-bg",zIndex:-1,attrs:A({x:0,y:0,width:0,height:0},i)});s.sort(),this.container=s,this.textShape=o,this.backgroundShape=l},t._getBBox=function(){var t=this.textShape,e=this.background,i=t.getBBox(),n=dt(e.padding),r=i.width+n[1]+n[3],a=i.height+n[0]+n[2];return{x:i.minX-n[3],y:i.minY-n[0],width:r,height:a}},t.updateContent=function(t){var e=this.textShape,i=this.backgroundShape;if(!s(t)){l(t)||(t={text:t}),e.attr(t);var n=this._getBBox(),r=n.x,a=n.y,o=n.width,h=n.height,u=this.width||o,c=this.height||h;i.attr({x:r,y:a,width:u,height:c}),this._width=u,this._height=c,this.content=t.text}},t.updatePosition=function(t,e){var i=this.container,n=this._getBBox(),r=n.x,a=n.y;i.moveTo(t-r,e-a),this.x=t-r,this.y=e-a},t.getWidth=function(){return this._width},t.getHeight=function(){return this._height},t.show=function(){this.container.show()},t.hide=function(){this.container.hide()},t.clear=function(){var t=this.container;t.clear(),t.remove(!0),this.container=null,this.textShape=null,this.backgroundShape=null},e}(),Nr=function(){var t=e.prototype;function e(t){E(this,this.getDefaultCfg(),t);var e=this.frontPlot;if(!this.custom){var i=new Yr(A({parent:e,zIndex:3},t));this.container=i;var n=this.fixed,r=this.background;n||(this.tooltipArrow=e.addShape("Polygon",{className:"tooltip-arrow",visible:!1,zIndex:2,attrs:A({points:[]},r)}))}if(this.showXTip){var a=this.xTipBackground,s=this.xTipTextStyle,o=new Or({context:e.get("context"),className:"xTip",background:a,textStyle:s,visible:!1});e.add(o.container),this.xTipBox=o}if(this.showYTip){var l=this.yTipBackground,h=this.yTipTextStyle,u=new Or({context:e.get("context"),className:"yTip",background:l,textStyle:h,visible:!1});e.add(u.container),this.yTipBox=u}this.showCrosshairs&&this._renderCrosshairs(),e.sort()}return t.getDefaultCfg=function(){return{showCrosshairs:!1,crosshairsStyle:{stroke:"rgba(0, 0, 0, 0.25)",lineWidth:1},crosshairsType:"y",showXTip:!1,showYTip:!1,xTip:null,xTipBackground:{radius:1,fill:"rgba(0, 0, 0, 0.65)",padding:[3,5]},xTipTextStyle:{fontSize:12,fill:"#fff",textAlign:"center",textBaseline:"middle"},yTip:null,yTipBackground:{radius:1,fill:"rgba(0, 0, 0, 0.65)",padding:[3,5]},yTipTextStyle:{fontSize:12,fill:"#fff",textAlign:"center",textBaseline:"middle"},background:null,layout:"horizontal",offsetX:0,offsetY:0}},t.setContent=function(t,e){if(this.title=t,this.items=e,!this.custom){var i=this.container;i.setTitle(t),i.setItems(e)}},t.setYTipContent=function(t){var e=this.yTip;t=a(e)?e(t):A({text:t},e),this.yTipBox&&this.yTipBox.updateContent(t)},t.setYTipPosition=function(t){var e=this.plotRange,i=this.crosshairsShapeX;if(this.showYTip){var n=this.yTipBox,r=n.getHeight(),a=n.getWidth(),s=e.tl.x-a,o=t-r/2;o<=e.tl.y&&(o=e.tl.y),o+r>=e.br.y&&(o=e.br.y-r),s<0&&(s=e.tl.x,i&&i.attr("x1",e.tl.x+a)),n.updatePosition(s,o)}},t.setXTipContent=function(t){var e=this.xTip;t=a(e)?e(t):A({text:t},e),this.xTipBox&&this.xTipBox.updateContent(t)},t.setXTipPosition=function(t){var e=this.showXTip,i=this.canvas,n=this.plotRange,r=this.xTipBox,a=this.crosshairsShapeY;if(e){var s=i.get("height"),o=r.getWidth(),l=r.getHeight(),h=t-o/2,u=n.br.y;h<=n.tl.x&&(h=n.tl.x),h+o>=n.tr.x&&(h=n.tr.x-o),s-u<l&&(u-=l),r.updatePosition(h,u),a&&a.attr("y1",u)}},t.setXCrosshairPosition=function(t){this.crosshairsShapeX&&this.crosshairsShapeX.moveTo(0,t)},t.setYCrosshairPosition=function(t){this.crosshairsShapeY&&this.crosshairsShapeY.moveTo(t,0)},t.setPosition=function(t){var e=this.container,i=this.plotRange,n=this.offsetX,r=this.offsetY,a=this.fixed,s=this.tooltipArrow;if(e){var o,l=e.container.getBBox(),h=l.minX,u=l.minY,c=l.width,f=l.height,p=i.tl,g=i.tr,d=0,v=p.y-f-4+r;if(v<0&&(v=0),a)d=(p.x+g.x)/2-c/2+n;else if((d=(o=t.length>1?(t[0].x+t[t.length-1].x)/2:t[0].x)-c/2+n)<p.x&&(d=p.x),d+c>g.x&&(d=g.x-c),s){var m=v+f;s.attr("points",[{x:o-3,y:m},{x:o+3,y:m},{x:o,y:m+4}]);var y=e.backShape,x=dt(y.attr("radius"));o===p.x?(x[3]=0,s.attr("points",[{x:p.x,y:m},{x:p.x+4,y:m},{x:p.x,y:m+4}])):o===g.x&&(x[2]=0,s.attr("points",[{x:g.x-4,y:m},{x:g.x,y:m},{x:g.x,y:m+4}])),y.attr("radius",x)}e.moveTo(d-h,v-u)}},t.setMarkers=function(t){void 0===t&&(t={});var e=t,i=e.items,n=e.style,r=e.type,a=this._getMarkerGroup(r);if("circle"===r)for(var s=0,o=i.length;s<o;s++){var l=i[s];a.addShape("marker",{className:"tooltip-circle-marker",attrs:A({x:l.x,y:l.y,stroke:l.color},n)})}else a.addShape("rect",{className:"tooltip-rect-marker",attrs:n})},t.clearMarkers=function(){var t=this.markerGroup;t&&t.clear()},t.show=function(){var t=this.crosshairsShapeX,e=this.crosshairsShapeY,i=this.markerGroup,n=this.container,r=this.tooltipArrow,a=this.xTipBox,s=this.yTipBox,o=this.canvas;t&&t.show(),e&&e.show(),i&&i.show(),n&&n.show(),r&&r.show(),a&&a.show(),s&&s.show(),o.draw()},t.hide=function(){var t=this.crosshairsShapeX,e=this.crosshairsShapeY,i=this.markerGroup,n=this.container,r=this.tooltipArrow,a=this.xTipBox,s=this.yTipBox;t&&t.hide(),e&&e.hide(),i&&i.hide(),n&&n.hide(),r&&r.hide(),a&&a.hide(),s&&s.hide()},t.destroy=function(){var t=this.crosshairsShapeX,e=this.crosshairsShapeY,i=this.markerGroup,n=this.container,r=this.tooltipArrow,a=this.xTipBox,s=this.yTipBox;t&&t.remove(!0),e&&e.remove(!0),i&&i.remove(!0),r&&r.remove(!0),n&&n.clear(),a&&a.clear(),s&&s.clear(),this.destroyed=!0},t._getMarkerGroup=function(t){var e=this.markerGroup;return e?e.clear():("circle"===t?(e=this.frontPlot.addGroup({zIndex:1}),this.frontPlot.sort()):e=this.backPlot.addGroup(),this.markerGroup=e),e},t._renderCrosshairs=function(){var t=this.crosshairsType,e=this.crosshairsStyle,i=this.frontPlot,n=this.plotRange,r=n.tl,a=n.br;vt(t,"x")&&(this.crosshairsShapeX=i.addShape("Line",{className:"tooltip-crosshairs-x",zIndex:0,visible:!1,attrs:A({x1:r.x,y1:0,x2:a.x,y2:0},e)})),vt(t,"y")&&(this.crosshairsShapeY=i.addShape("Line",{className:"tooltip-crosshairs-y",zIndex:0,visible:!1,attrs:A({x1:0,y1:a.y,x2:0,y2:r.y},e)}))},e}();function zr(t){var e=t.getAttr("color");if(e){var i=e.getScale(e.type);if(i.isLinear)return i}var n=t.getXScale(),r=t.getYScale();return r||n}function Lr(t,e){var i,n,r=t._getGroupScales();if(r.length&&h(r,(function(t){return n=t,!1})),n){var a=n.field;i=n.getText(e[a])}else{var s=zr(t);i=s.alias||s.field}return i}function Xr(t,e){var i=zr(t);return i.getText(e[i.field])}function Br(t,e){var i=t.getAttr("position").getFields()[0],n=t.get("scales")[i];return n.getText(e[n.field])}function Fr(t){var e=[];return h(t,(function(t){var i=function(t,e){var i=-1;return h(t,(function(t,n){if(t.title===e.title&&t.name===e.name&&t.value===e.value&&t.color===e.color)return i=n,!1})),i}(e,t);-1===i?e.push(t):e[i]=t})),e}bt.tooltip=E({triggerOn:"press",triggerOff:"pressend",alwaysShow:!1,showTitle:!1,showCrosshairs:!1,crosshairsStyle:{stroke:"rgba(0, 0, 0, 0.25)",lineWidth:1},showTooltipMarker:!0,background:{radius:1,fill:"rgba(0, 0, 0, 0.65)",padding:[3,5]},titleStyle:{fontSize:12,fill:"#fff",textAlign:"start",textBaseline:"top"},nameStyle:{fontSize:12,fill:"rgba(255, 255, 255, 0.65)",textAlign:"start",textBaseline:"middle"},valueStyle:{fontSize:12,fill:"#fff",textAlign:"start",textBaseline:"middle"},showItemMarker:!0,itemMarkerStyle:{radius:3,symbol:"circle",lineWidth:1,stroke:"#fff"},layout:"horizontal",snap:!1},bt.tooltip||{});var Rr=function(){function t(t){var e=this;Mt(this,"handleShowEvent",(function(t){var i=e.chart;if(e.enable){var n=i.get("plotRange"),r=ft(t,i);if(Bn(r,n)||e._tooltipCfg.alwaysShow){var a=e.timeStamp,s=+new Date;s-a>16&&(e.showTooltip(r),e.timeStamp=s)}else e.hideTooltip()}})),Mt(this,"handleHideEvent",(function(){e.enable&&e.hideTooltip()})),this.enable=!0,this.cfg={},this.tooltip=null,this.chart=null,this.timeStamp=0,A(this,t);var i=this.chart.get("canvas");this.canvas=i,this.canvasDom=i.get("el")}var e=t.prototype;return e._setCrosshairsCfg=function(){var t=this.chart,e=A({},bt.tooltip),i=t.get("geoms"),n=[];h(i,(function(t){var e=t.get("type");-1===n.indexOf(e)&&n.push(e)}));var r=t.get("coord").type;return!i.length||"cartesian"!==r&&"rect"!==r||1===n.length&&-1!==["line","area","path","point"].indexOf(n[0])&&A(e,{showCrosshairs:!0}),e},e._getMaxLength=function(t){void 0===t&&(t={});var e=t,i=e.layout,n=e.plotRange;return"horizontal"===i?n.br.x-n.bl.x:n.bl.y-n.tr.y},e.render=function(){if(!this.tooltip){var t=this.chart,e=t.get("canvas"),i=t.get("frontPlot").addGroup({className:"tooltipContainer",zIndex:10}),n=t.get("backPlot").addGroup({className:"tooltipContainer"}),r=t.get("plotRange"),a=t.get("coord"),s=this._setCrosshairsCfg(),o=this.cfg,l=E({plotRange:r,frontPlot:i,backPlot:n,canvas:e,fixed:a.transposed||a.isPolar},s,o);l.maxLength=this._getMaxLength(l),this._tooltipCfg=l;var h=new Nr(l);this.tooltip=h,l.alwaysShow&&this.prePoint&&this.showTooltip(this.prePoint),this.bindEvents()}},e.clear=function(){var t=this.tooltip;t&&(t.destroy(),this.unBindEvents()),this.tooltip=null,this._lastActive=null},e._getTooltipMarkerStyle=function(t){void 0===t&&(t={});var e=t,i=e.type,n=e.items,r=this._tooltipCfg;if("rect"===i){var a,s,o,l,h=this.chart,u=h.get("plotRange"),c=u.tl,f=u.br,p=h.get("coord"),g=n[0],d=n[n.length-1],v=g.width;p.transposed?(a=c.x,s=d.y-.75*v,o=f.x-c.x,l=g.y-d.y+1.5*v):(a=g.x-.75*v,s=c.y,o=d.x-g.x+1.5*v,l=f.y-c.y),t.style=A({x:a,y:s,width:o,height:l,fill:"#CCD6EC",opacity:.3},r.tooltipMarkerStyle)}else t.style=A({radius:4,fill:"#fff",lineWidth:2},r.tooltipMarkerStyle);return t},e._setTooltip=function(t,e,i){void 0===i&&(i={}),this.prePoint=t;var n=this._lastActive,r=this.tooltip,a=this._tooltipCfg;e=Fr(e);var s=this.chart,o=s.get("coord"),l=s.getYScales()[0],h=a.snap;if(!1===h&&l.isLinear){var u,c,f=o.invertPoint(t);Bn(t,s.get("plotRange"))&&(o.transposed?(u=l.invert(f.x),c=t.x,r.setXTipContent(u),r.setXTipPosition(c),r.setYCrosshairPosition(c)):(u=l.invert(f.y),c=t.y,r.setYTipContent(u),r.setYTipPosition(c),r.setXCrosshairPosition(c)))}if(a.onShow&&a.onShow({x:t.x,y:t.y,tooltip:r,items:e,tooltipMarkerCfg:i}),p=n,g=e,JSON.stringify(p)!==JSON.stringify(g)){var p,g;this._lastActive=e;var d=a.onChange;d&&d({x:t.x,y:t.y,tooltip:r,items:e,tooltipMarkerCfg:i});var v=e[0],m=v.title||v.name,y=v.x;if(e.length>1&&(y=(e[0].x+e[e.length-1].x)/2),r.setContent(m,e,o.transposed),r.setPosition(e,t),o.transposed){var x=v.y;e.length>1&&(x=(e[0].y+e[e.length-1].y)/2),r.setYTipContent(m),r.setYTipPosition(x),r.setXCrosshairPosition(x),h&&(r.setXTipContent(v.value),r.setXTipPosition(y),r.setYCrosshairPosition(y))}else r.setXTipContent(m),r.setXTipPosition(y),r.setYCrosshairPosition(y),h&&(r.setYTipContent(v.value),r.setYTipPosition(v.y),r.setXCrosshairPosition(v.y));var _=i.items;a.showTooltipMarker&&_.length?(i=this._getTooltipMarkerStyle(i),r.setMarkers(i)):r.clearMarkers(),r.show()}else{!1===h&&(vt(a.crosshairsType,"y")||a.showYTip)&&this.chart.get("canvas").draw()}},e.showTooltip=function(t){var e,i,n=this.chart,r=[],a=[],s=this._tooltipCfg,l=s.showItemMarker,u=s.itemMarkerStyle,c=s.alwaysShow;l&&(i=u);var f=n.get("geoms"),p=n.get("coord");if(h(f,(function(n){if(n.get("visible")){var s=n.get("type"),l=n.getSnapRecords(t),u=n.get("adjust");if("interval"===s&&u&&"symmetric"===u.type)return;h(l,(function(t){var l=t.x,h=t.y,u=t._origin,c=t.color;if((l||!isNaN(l))&&(h||!isNaN(h))){var f={x:l,y:o(h)?h[1]:h,color:c||bt.defaultColor,origin:u,name:Lr(n,u),value:Xr(n,u),title:Br(n,u)};i&&(f.marker=A({fill:c||bt.defaultColor},i)),a.push(f),-1!==["line","area","path"].indexOf(s)?(e="circle",r.push(f)):"interval"!==s||"cartesian"!==p.type&&"rect"!==p.type||(e="rect",f.width=n.getSize(t._origin),r.push(f))}}))}})),a.length){var g={items:r,type:e};this._setTooltip(t,a,g)}else c||this.hideTooltip()},e.hideTooltip=function(){var t=this._tooltipCfg;this._lastActive=null;var e=this.tooltip;e&&(e.hide(),t.onHide&&t.onHide({tooltip:e}),this.chart.get("canvas").draw())},e._handleEvent=function(t,e,i){var n=this.canvas;h([].concat(t),(function(t){"bind"===i?n.on(t,e):n.off(t,e)}))},e.bindEvents=function(){var t=this._tooltipCfg,e=t.triggerOn,i=t.triggerOff,n=t.alwaysShow;e&&this._handleEvent(e,this.handleShowEvent,"bind"),n||this._handleEvent(i,this.handleHideEvent,"bind")},e.unBindEvents=function(){var t=this._tooltipCfg,e=t.triggerOn,i=t.triggerOff,n=t.alwaysShow;e&&this._handleEvent(e,this.handleShowEvent,"unBind"),n||this._handleEvent(i,this.handleHideEvent,"unBind")},t}();function jr(t){var e=new Rr({chart:t});t.set("tooltipController",e),t.tooltip=function(t,i){return l(t)&&(i=t,t=!0),e.enable=t,i&&(e.cfg=i),this}}function Gr(t){var e=t.get("tooltipController");e.render(),t.showTooltip=function(t){return e.showTooltip(t),this},t.hideTooltip=function(){return e.hideTooltip(),this}}function Hr(t){t.get("tooltipController").clear()}var Wr={init:jr,afterGeomDraw:Gr,clearInner:Hr},Vr=Object.freeze({__proto__:null,init:jr,afterGeomDraw:Gr,clearInner:Hr,default:Wr});bt.guide=E({line:{style:{stroke:"#a3a3a3",lineWidth:1},top:!0},text:{style:{fill:"#787878",textAlign:"center",textBaseline:"middle"},offsetX:0,offsetY:0,top:!0},rect:{style:{fill:"#fafafa"},top:!1},arc:{style:{stroke:"#a3a3a3"},top:!0},html:{offsetX:0,offsetY:0,alignX:"center",alignY:"middle"},tag:{top:!0,offsetX:0,offsetY:0,side:4,background:{padding:5,radius:2,fill:"#1890FF"},textStyle:{fontSize:12,fill:"#fff",textAlign:"center",textBaseline:"middle"}},point:{top:!0,offsetX:0,offsetY:0,style:{fill:"#fff",r:3,lineWidth:2,stroke:"#1890ff"}}},bt.guide||{});var qr=function(){function t(t){this.guides=[],this.xScale=null,this.yScales=null,this.guideShapes=[],A(this,t)}var e=t.prototype;return e._toString=function(t){return a(t)&&(t=t(this.xScale,this.yScales)),t=t.toString()},e._getId=function(t,e){var i=e.id;if(!i){var n=e.type;i="arc"===n||"line"===n||"rect"===n?this._toString(e.start)+"-"+this._toString(e.end):this._toString(e.position)}return i},e.paint=function(t){var e=this,i=e.chart,n=e.guides,r=e.xScale,a=e.yScales,s=[];h(n,(function(n,o){var l;n.xScale=r,n.yScales=a,"regionFilter"===n.type?n.chart=i:l=n.top?e.frontPlot:e.backPlot,n.coord=t,n.container=l,n.canvas=i.get("canvas");var h=n.render(t,l);if(h){var u=e._getId(h,n);[].concat(h).forEach((function(t){t._id=t.get("className")+"-"+u,t.set("index",o),s.push(t)}))}})),e.guideShapes=s},e.clear=function(){return this.reset(),this.guides=[],this},e.reset=function(){h(this.guides,(function(t){t.remove()}))},e._createGuide=function(t,e){var i=C(t),n=new br[i](E({},bt.guide[t],e));return this.guides.push(n),n},e.line=function(t){return void 0===t&&(t={}),this._createGuide("line",t)},e.text=function(t){return void 0===t&&(t={}),this._createGuide("text",t)},e.arc=function(t){return void 0===t&&(t={}),this._createGuide("arc",t)},e.html=function(t){return void 0===t&&(t={}),this._createGuide("html",t)},e.rect=function(t){return void 0===t&&(t={}),this._createGuide("rect",t)},e.tag=function(t){return void 0===t&&(t={}),this._createGuide("tag",t)},e.point=function(t){return void 0===t&&(t={}),this._createGuide("point",t)},e.regionFilter=function(t){return void 0===t&&(t={}),this._createGuide("regionFilter",t)},t}();function Ur(t){var e=new qr({frontPlot:t.get("frontPlot").addGroup({zIndex:20,className:"guideContainer"}),backPlot:t.get("backPlot").addGroup({className:"guideContainer"})});t.set("guideController",e),t.guide=function(){return e}}function Zr(t){var e=t.get("guideController");if(e.guides.length){var i=t.getXScale(),n=t.getYScales(),r=t.get("coord");e.xScale=i,e.yScales=n,e.chart=t,e.paint(r)}}function Jr(t){t.get("guideController").clear()}function $r(t){t.get("guideController").reset()}var Kr={init:Ur,afterGeomDraw:Zr,clear:Jr,repaint:$r},Qr=Object.freeze({__proto__:null,init:Ur,afterGeomDraw:Zr,clear:Jr,repaint:$r,default:Kr}),ta={itemMarginBottom:12,itemGap:10,showTitle:!1,titleStyle:{fontSize:12,fill:"#808080",textAlign:"start",textBaseline:"top"},nameStyle:{fill:"#808080",fontSize:12,textAlign:"start",textBaseline:"middle"},valueStyle:{fill:"#000000",fontSize:12,textAlign:"start",textBaseline:"middle"},unCheckStyle:{fill:"#bfbfbf"},itemWidth:"auto",wordSpace:6,selectedMode:"multiple"};bt.legend=E({common:ta,right:A({position:"right",layout:"vertical"},ta),left:A({position:"left",layout:"vertical"},ta),top:A({position:"top",layout:"horizontal"},ta),bottom:A({position:"bottom",layout:"horizontal"},ta)},bt.legend||{});var ea=function(){function t(t){var e=this;Mt(this,"handleEvent",(function(t){var i=e;var n=i.chart,r=ft(t,n),a=function(t,e){var n=null;return h(i.legends,(function(i){h(i,(function(i){var r=i.itemsGroup,a=i.legendHitBoxes,s=r.get("children");if(s.length){var o=i.x,l=i.y;h(a,(function(r,a){if(t>=r.x+o&&t<=r.x+r.width+o&&e>=r.y+l&&e<=r.height+r.y+l)return n={clickedItem:s[a],clickedLegend:i},!1}))}}))})),n}(r.x,r.y);if(a&&!1!==a.clickedLegend.clickable){var s=a.clickedItem,o=a.clickedLegend;if(o.onClick)t.clickedItem=s,o.onClick(t);else if(!o.custom){var l=s.get("checked"),u=s.get("dataValue"),c=o.filteredVals,f=o.field;"single"===o.selectedMode?n.filter(f,(function(t){return t===u})):(l?c.push(u):q(c,u),n.filter(f,(function(t){return-1===c.indexOf(t)}))),n.repaint()}}})),this.legendCfg={},this.enable=!0,this.position="top",A(this,t);var i=this.chart;this.canvasDom=i.get("canvas").get("el"),this.clear()}var e=t.prototype;return e.addLegend=function(t,e,i){var n=this.legendCfg,r=t.field,a=n[r];if(!1===a)return null;if(a&&a.custom)this.addCustomLegend(r);else{var s=n.position||this.position;a&&a.position&&(s=a.position),t.isCategory&&this._addCategoryLegend(t,e,s,i)}},e.addCustomLegend=function(t){var e=this.legendCfg;t&&e[t]&&(e=e[t]);var i=e.position||this.position,n=this.legends;n[i]=n[i]||[];var r=e.items;if(!r)return null;var a=this.container;h(r,(function(t){f(t.marker)?t.marker.radius=t.marker.radius||3:t.marker={symbol:t.marker||"circle",fill:t.fill,radius:3},t.checked=!!s(t.checked)||t.checked,t.name=t.name||t.value}));var o=new Yr(E({},bt.legend[i],e,{maxLength:this._getMaxLength(i),items:r,parent:a}));n[i].push(o)},e.clear=function(){h(this.legends,(function(t){h(t,(function(t){t.clear()}))})),this.legends={},this.unBindEvents()},e._isFiltered=function(t,e,i){var n=!1;return h(e,(function(e){if(n=n||t.getText(e)===t.getText(i))return!1})),n},e._getMaxLength=function(t){var e=this.chart,i=dt(e.get("appendPadding"));return"right"===t||"left"===t?e.get("height")-(i[0]+i[2]):e.get("width")-(i[1]+i[3])},e._addCategoryLegend=function(t,e,i,n){var r=this,a=r.legendCfg,s=r.legends,o=r.container,l=r.chart,u=t.field;s[i]=s[i]||[];var c="circle";a[u]&&a[u].marker?c=a[u].marker:a.marker&&(c=a.marker),h(e,(function(e){f(c)?A(e.marker,c):e.marker.symbol=c,n&&(e.checked=!r._isFiltered(t,n,e.dataValue))})),l.get("legendItems")[u]=e;var p=E({},bt.legend[i],a[u]||a,{maxLength:r._getMaxLength(i),items:e,field:u,filteredVals:n,parent:o});p.showTitle&&E(p,{title:t.alias||t.field});var g=new Yr(p);return s[i].push(g),g},e._alignLegend=function(t,e,i){var n=this.plotRange,r=n.tl,a=n.bl,s=this.chart,o=t.offsetX||0,l=t.offsetY||0,h=s.get("width"),u=s.get("height"),c=dt(s.get("appendPadding")),f=t.getHeight(),p=t.getWidth(),g=0,d=0;if("left"===i||"right"===i){var v=t.verticalAlign||"middle",m=Math.abs(r.y-a.y);g="left"===i?c[3]:h-p-c[1],d=(m-f)/2+r.y,"top"===v?d=r.y:"bottom"===v&&(d=a.y-f),e&&(d=e.get("y")-f-12)}else{var y=t.align||"left";if(g=c[3],"center"===y?g=h/2-p/2:"right"===y&&(g=h-(p+c[1])),d="top"===i?c[0]+Math.abs(t.container.getBBox().minY):u-f,e){var x=e.getWidth();g=e.x+x+12}}"bottom"===i&&l>0&&(l=0),"right"===i&&o>0&&(o=0),t.moveTo(g+o,d+l)},e.alignLegends=function(){var t=this;return h(t.legends,(function(e,i){h(e,(function(n,r){var a=e[r-1];t._alignLegend(n,a,i)}))})),t},e.bindEvents=function(){var t=this.legendCfg.triggerOn||"touchstart";lt(this.canvasDom,t,this.handleEvent)},e.unBindEvents=function(){var t=this.legendCfg.triggerOn||"touchstart";ht(this.canvasDom,t,this.handleEvent)},t}();function ia(t){var e=new ea({container:t.get("backPlot").addGroup(),plotRange:t.get("plotRange"),chart:t});t.set("legendController",e),t.legend=function(t,i){var n=e.legendCfg;return e.enable=!0,P(t)?(e.enable=t,n=i||{}):l(t)?n=t:n[t]=i,e.legendCfg=n,this}}function na(t){var e=t.get("legendController");if(!e.enable)return null;var i=e.legendCfg,n=e.container;if(i&&i.custom)e.addCustomLegend();else{var r=t.getLegendItems(),a=t.get("scales"),s=t.get("filters");h(r,(function(t,i){var n,r=a[i],o=r.values;n=s&&s[i]?o.filter((function(t){return!s[i](t)})):[],e.addLegend(r,t,n)}))}i&&!1!==i.clickable&&e.bindEvents();var o=e.legends,l={top:0,right:0,bottom:0,left:0};h(o,(function(e,i){var n=0;h(e,(function(t){var e=t.getWidth(),r=t.getHeight();"top"===i||"bottom"===i?(n=Math.max(n,r),t.offsetY>0&&(n+=t.offsetY)):(n=Math.max(n,e),t.offsetX>0&&(n+=t.offsetX))})),l[i]=n+function(t,e){var i=0;switch(e=dt(e),t){case"top":i=e[0];break;case"right":i=e[1];break;case"bottom":i=e[2];break;case"left":i=e[3]}return i}(i,t.get("appendPadding"))})),t.set("legendRange",l),Object.keys(o).length?n.set("ariaLabel",St.legend.prefix):n.set("ariaLabel",null)}function ra(t){t.get("legendController").alignLegends()}function aa(t){t.get("legendController").clear(),t.set("legendRange",null)}var sa={init:ia,beforeGeomDraw:na,afterGeomDraw:ra,clearInner:aa},oa=Object.freeze({__proto__:null,init:ia,beforeGeomDraw:na,afterGeomDraw:ra,clearInner:aa,default:sa}),la="object"==typeof performance&&performance.now?performance:Date,ha=function(){function t(){this.anims=[],this.time=null,this.playing=!1,this.canvas=[]}var e=t.prototype;return e.play=function(){var t=this;t.time=la.now(),t.playing=!0,En((function e(){t.playing&&(En(e),t.update())}))},e.stop=function(){this.playing=!1,this.time=null,this.canvas=[]},e.pushAnim=function(t){this.playing||this.play();var e=t.delay,i=t.duration,n=this.time+e,r=n+i;t.startTime=n,t.endTime=r,this.anims.push(t)},e.update=function(){var t=la.now();if(this.canvas=[],this.anims.length){for(var e=0;e<this.anims.length;e++){var i=this.anims[e];if(!(t<i.startTime||i.hasEnded)){var n=i.shape;if(n.get("destroyed"))this.anims.splice(e,1),e--;else{var r=i.startState,a=i.endState,s=i.interpolate,o=i.duration;t>=i.startTime&&!i.hasStarted&&(i.hasStarted=!0,i.onStart&&i.onStart());var l=(t-i.startTime)/o;if(l=Math.max(0,Math.min(l,1)),l=i.easing(l),i.onFrame)i.onFrame(l);else for(var h in s){var u=(0,s[h])(l),c=void 0;if("points"===h){c=[];for(var f=Math.max(r.points.length,a.points.length),p=0;p<f;p+=2)c.push({x:u[p],y:u[p+1]})}else c=u;n._attrs.attrs[h]=c,n._attrs.bbox=null}var g=n.get("canvas");-1===this.canvas.indexOf(g)&&this.canvas.push(g),i.onUpdate&&i.onUpdate(l),t>=i.endTime&&!i.hasEnded&&(i.hasEnded=!0,i.onEnd&&i.onEnd()),1===l&&(this.anims.splice(e,1),e--)}}}this.canvas.map((function(t){return t.draw(),t})),this.time=la.now()}else this.stop()},t}();function ua(t){return t}function ca(t){return 1-fa(1-t)}function fa(t){return(t/=1)<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}var pa=Object.freeze({__proto__:null,linear:ua,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)},elasticIn:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,i=.1,n=.4;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=n/(2*Math.PI)*Math.asin(1/i),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.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-=1)*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:ca,bounceOut:fa,bounceInOut:function(t){return t<.5?.5*ca(2*t):.5*fa(2*t-1)+.5}});function ga(t){for(var e=[],i=0,n=t.length;i<n;i++)t[i]&&(e.push(t[i].x),e.push(t[i].y));return e}function da(t,e){return e-=t=+t,function(i){return t+e*i}}function va(t,e){var i,n=e?e.length:0,r=t?Math.min(n,t.length):0,a=new Array(r),s=new Array(n);for(i=0;i<r;++i)a[i]=da(t[i],e[i]);for(;i<n;++i)s[i]=e[i];return function(t){for(i=0;i<r;++i)s[i]=a[i](t);return s}}var ma=function(){function t(t,e,i){this.hasStarted=!1,this.hasEnded=!1,this.shape=t,this.source=e,this.timeline=i,this.animate=null}var e=t.prototype;return e.to=function(t){void 0===t&&(t={});var e,i=t.delay||0,n=t.attrs||{},r=t.duration||1e3;e="function"==typeof t.easing?t.easing:pa[t.easing]||ua;var a={shape:this.shape,delay:i,duration:r,easing:e},s={};for(var o in n){var l=this.source[o],h=n[o];"points"===o?(l=ga(l),h=ga(h),s.points=va(l,h),this.source.points=l,n.points=h):"matrix"===o?s.matrix=va(l,h):s[o]=da(l,h)}return a.interpolate=s,a.startState=this.source,a.endState=n,this.timeline.pushAnim(a),this.animate=a,this},e.onFrame=function(t){return this.animate&&(this.animate.onFrame=function(e){t(e)}),this},e.onStart=function(t){return this.animate&&(this.animate.onStart=function(){t()}),this},e.onUpdate=function(t){return this.animate&&(this.animate.onUpdate=function(e){t(e)}),this},e.onEnd=function(t){return this.animate&&(this.animate.onEnd=function(){t()}),this},t}(),ya={appear:{duration:450,easing:"quadraticOut"},update:{duration:300,easing:"quadraticOut"},enter:{duration:300,easing:"quadraticOut"},leave:{duration:350,easing:"quadraticIn"}},xa={defaultCfg:{},Action:{},getAnimation:function(t,e,i){var n=this.defaultCfg[t];if(n){var r=n[i];if(a(r))return r(e)}return!1},getAnimateCfg:function(t,e){var i=ya[e],n=this.defaultCfg[t];return n&&n.cfg&&n.cfg[e]?E({},i,n.cfg[e]):i},registerAnimation:function(t,e){var i;this.Action||(this.Action={}),this.Action=Ct({},this.Action,((i={})[t]=e,i))}};function _a(t,e,i){var n;t.apply(e);var r=e[0],a=e[1];if("x"===i){t.transform([["t",r,a],["s",.01,1],["t",-r,-a]]);var s=t.getMatrix();n=It.transform(s,[["t",r,a],["s",100,1],["t",-r,-a]])}else if("y"===i){t.transform([["t",r,a],["s",1,.01],["t",-r,-a]]);var o=t.getMatrix();n=It.transform(o,[["t",r,a],["s",1,100],["t",-r,-a]])}else if("xy"===i){t.transform([["t",r,a],["s",.01,.01],["t",-r,-a]]);var l=t.getMatrix();n=It.transform(l,[["t",r,a],["s",100,100],["t",-r,-a]])}return n}function Sa(t,e,i,n){var r=t._id,s=function(t,e,i){var n={};return t.delay&&(n.delay=a(t.delay)?t.delay(e,i):t.delay),n.easing=t.easing,n.duration=t.duration,n.delay=t.delay,n}(i,t.get("index"),r),o=s.easing,l=s.delay,h=s.duration,u=t.animate().to({attrs:e,duration:h,delay:l,easing:o});n&&u.onEnd((function(){n()}))}function ba(t,e){var i=s(t.attr("fillOpacity"))?1:t.attr("fillOpacity"),n=s(t.attr("strokeOpacity"))?1:t.attr("strokeOpacity");t.attr("fillOpacity",0),t.attr("strokeOpacity",0),Sa(t,{fillOpacity:i,strokeOpacity:n},e)}var Ma=Object.freeze({__proto__:null,fadeIn:ba});function Ca(t,e,i,n,r){var a,s,o=function(t){var e=t.start,i=t.end;return{start:e,end:i,width:i.x-e.x,height:Math.abs(i.y-e.y)}}(i),l=o.start,h=o.end,u=o.width,c=o.height,f=new en.Rect({attrs:{x:l.x,y:h.y,width:u,height:c}});"y"===r?(a=l.x+u/2,s=n.y<l.y?n.y:l.y):"x"===r?(a=n.x>l.x?n.x:l.x,s=l.y+c/2):"xy"===r&&(i.isPolar?(a=i.center.x,s=i.center.y):(a=(l.x+h.x)/2,s=(l.y+h.y)/2));var p=_a(f,[a,s],r);f.isClip=!0,f.endState={matrix:p},f.set("canvas",t.get("canvas")),t.attr("clip",f);Sa(f,f.endState,e,(function(){t.attr("clip",null),f.remove(!0)}))}function wa(t,e,i){for(var n=t.get("children"),r=0,a=n.length;r<a;r++){var s=n[r],o=s.getBBox();Sa(s,{matrix:_a(s,[(o.minX+o.maxX)/2,(o.minY+o.maxY)/2],i)},e)}}function Pa(t,e,i,n){Ca(t,e,i,n,"x")}function Ta(t,e,i,n){Ca(t,e,i,n,"y")}function Da(t,e,i,n){Ca(t,e,i,n,"xy")}function ka(t,e){wa(t,e,"xy")}function Aa(t,e,i){var n=Xn(i);n.set("canvas",t.get("canvas")),t.attr("clip",n);var r={};if(i.isPolar){var a=i.startAngle,s=i.endAngle;r.endAngle=s,n.attr("endAngle",a)}else{var o=i.start,l=i.end,h=Math.abs(o.x-l.x),u=Math.abs(o.y-l.y);i.isTransposed?(n.attr("height",0),r.height=u):(n.attr("width",0),r.width=h)}Sa(n,r,e,(function(){t.attr("clip",null),n.remove(!0)}))}var Ia,Ea=Object.freeze({__proto__:null,groupWaveIn:Aa,groupScaleInX:Pa,groupScaleInY:Ta,groupScaleInXY:Da,shapesScaleInX:function(t,e){wa(t,e,"x")},shapesScaleInY:function(t,e){wa(t,e,"y")},shapesScaleInXY:ka});tn.prototype.animate=function(){var t=A({},this.get("attrs"));return new ma(this,t,Ia)},jn.prototype.animate=function(t){return this.set("animate",t),this},xa.Action=Ma,xa.defaultCfg={interval:{enter:function(t){return t.isPolar&&t.transposed?function(t){t.set("zIndex",-1),t.get("parent").sort()}:ba}},area:{enter:function(t){return t.isPolar?null:ba}},line:{enter:function(t){return t.isPolar?null:ba}},path:{enter:function(t){return t.isPolar?null:ba}}};var Ya={line:function(t){return t.isPolar?Da:Aa},area:function(t){return t.isPolar?Da:Aa},path:function(t){return t.isPolar?Da:Aa},point:function(){return ka},interval:function(t){var e;return t.isPolar?(e=Da,t.transposed&&(e=Aa)):e=t.transposed?Pa:Ta,e},schema:function(){return Aa}};function Oa(t,e,i){var n=[];return h(t,(function(t,r){var a=t.get("container").get("children"),o=t.get("type"),l=s(t.get("animateCfg"))?Xa(o,e):t.get("animateCfg");!1!==l&&h(a,(function(e,a){e.get("className")===o&&(e._id=function(t,e,i){var n,r=t.get("type"),a="geom"+i+"-"+r,s=t.getXScale(),o=t.getYScale(),l=s.field||"x",u=o.field||"y",c=e[u];return n=s.isIdentity?s.value:e[l],a+="interval"===r||"schema"===r?"-"+n:"line"===r||"area"===r||"path"===r?"-"+r:s.isCategory?"-"+n:"-"+n+"-"+c,h(t._getGroupScales(),(function(t){var i=t.field;"identity"!==t.type&&(a+="-"+e[i])})),a}(t,e.get("origin")._origin,r),e.set("coord",i),e.set("animateCfg",l),e.set("index",a),n.push(e))})),t.set("shapes",a)})),n}function Na(t,e,i,n){return a(n)?n:g(n)?xa.Action[n]:xa.getAnimation(t,e,i)}function za(t,e,i){if(!1===i||l(i)&&!1===i[e])return!1;var n=xa.getAnimateCfg(t,e);return i&&i[e]?E({},n,i[e]):n}function La(t,e,i){var n,r,s=[],l=[];h(e,(function(e){var i=t[e._id];i?(e.set("cacheShape",i),s.push(e),delete t[e._id]):l.push(e)})),h(t,(function(t){var e=t.className,s=t.coord,o=t._id,l=t.attrs,h=t.index,u=t.type;if(!1===(r=za(e,"leave",t.animateCfg)))return!0;if(n=Na(e,s,"leave",r.animation),a(n)){var c=i.addShape(u,{attrs:l,index:h,canvas:i,className:e});c._id=o,n(c,r,s)}})),h(s,(function(t){var e=t.get("className");if(!1===(r=za(e,"update",t.get("animateCfg"))))return!0;var i=t.get("coord"),s=t.get("cacheShape").attrs,l=function(t,e){var i={};for(var n in e)(x(t[n])&&t[n]!==e[n]||o(t[n])&&JSON.stringify(t[n])!==JSON.stringify(e[n]))&&(i[n]=e[n]);return i}(s,t._attrs.attrs);if(Object.keys(l).length)if(n=Na(e,i,"update",r.animation),a(n))n(t,r,i);else{var u={};h(l,(function(t,e){u[e]=s[e]})),t.attr(u),t.animate().to({attrs:l,duration:r.duration,easing:r.easing,delay:r.delay}).onEnd((function(){t.set("cacheShape",null)}))}})),h(l,(function(t){var e=t.get("className"),i=t.get("coord");if(!1===(r=za(e,"enter",t.get("animateCfg"))))return!0;if(n=Na(e,i,"enter",r.animation),a(n))if("interval"===e&&i.isPolar&&i.transposed){var o=t.get("index"),l=s[o-1];n(t,r,l)}else n(t,r,i)}))}function Xa(t,e){if(!t)return null;var i=e.get("animate");return t.indexOf("guide-tag")>-1&&(t="guide-tag"),l(i)?i[t]:!1!==i&&null}function Ba(){(Ia=new ha).play()}function Fa(t){if(!1!==t.get("animate")){var e=t.get("isUpdate"),i=t.get("canvas"),n=t.get("coord"),r=t.get("geoms"),o=i.get("caches")||[];0===o.length&&(e=!1);var l=Oa(r,t,n),u=t.get("axisController"),c=u.frontPlot,f=u.backPlot,p=c.get("children").concat(f.get("children")),g=[];t.get("guideController")&&(g=t.get("guideController").guideShapes);var d,v,m=[];if(p.concat(g).forEach((function(e){var i=Xa(e.get("className"),t);e.set("coord",n),e.set("animateCfg",i),m.push(e),l.push(e)})),i.set("caches",function(t){for(var e={},i=0,n=t.length;i<n;i++){var r=t[i];if(r._id&&!r.isClip){var a=r._id;e[a]={_id:a,type:r.get("type"),attrs:A({},r._attrs.attrs),className:r.get("className"),geomType:r.get("className"),index:r.get("index"),coord:r.get("coord"),animateCfg:r.get("animateCfg")}}}return e}(l)),e)La(o,l,i);else h(r,(function(e){var i=e.get("type"),r=s(e.get("animateCfg"))?Xa(i,t):e.get("animateCfg");if(!1!==r)if(d=za(i,"appear",r),v=Na(i,n,"appear",d.animation),a(v))h(e.get("shapes"),(function(t){v(t,d,n)}));else if(Ya[i]){v=Ea[d.animation]||Ya[i](n);var o=e.getYScale(),l=n.convertPoint({x:0,y:o.scale(e.getYMinValue())}),u=e.get("container");v&&v(u,d,n,l)}})),h(m,(function(t){var e=t.get("animateCfg"),i=t.get("className");if(e&&e.appear){var r=xa.getAnimateCfg(i,"appear"),s=E({},r,e.appear),o=Na(i,n,"appear",s.animation);a(o)&&o(t,s,n)}}))}}function Ra(){Ia.stop()}var ja={afterCanvasInit:Ba,beforeCanvasDraw:Fa,afterCanvasDestroyed:Ra},Ga=Object.freeze({__proto__:null,afterCanvasInit:Ba,beforeCanvasDraw:Fa,afterCanvasDestroyed:Ra,default:ja});function Ha(t,e){return t.get("scales")[e]}function Wa(t,e,i){if(!t)return[0,1];var n=0,r=0;if("linear"===i){var a=e.min,s=e.max;n=(t.min-a)/(s-a),r=(t.max-a)/(s-a)}else{var o=e,l=t.values||[],h=o.indexOf(l[0]),u=o.indexOf(l[l.length-1]);n=h/(o.length-1),r=u/(o.length-1)}return[n,r]}function Va(t,e){var i,n=e.field,r=e.type,a=G(t,n);return"linear"===r?(i=U(a),e.min<i.min&&(i.min=e.min),e.max>i.max&&(i.max=e.max)):"timeCat"===r?(h(a,(function(t,e){a[e]=mt(t)})),a.sort((function(t,e){return t-e})),i=a):i=a,i}var qa={mode:"x",xStyle:{backgroundColor:"rgba(202, 215, 239, .2)",fillerColor:"rgba(202, 215, 239, .5)",size:4,lineCap:"round",offsetX:0,offsetY:8},yStyle:{backgroundColor:"rgba(202, 215, 239, .2)",fillerColor:"rgba(202, 215, 239, .5)",size:4,lineCap:"round",offsetX:8,offsetY:0}};function Ua(t){t.set("_limitRange",{}),t.scrollBar=function(t){!0===t?t=qa:l(t)&&(t=E({},qa,t)),this.set("_scrollBarCfg",t)}}function Za(t){t.set("_limitRange",{})}function Ja(t){t.set("_limitRange",{})}function $a(t){var e=t.get("_horizontalBar"),i=t.get("_verticalBar");e&&e.remove(!0),i&&i.remove(!0),t.set("_horizontalBar",null),t.set("_verticalBar",null)}function Ka(t){var e=t.get("_scrollBarCfg");if(e){var i=t.get("data"),n=t.get("plotRange"),r=t.get("backPlot"),a=t.get("canvas").get("height"),s=t.get("_limitRange"),o=e.mode;if(vt(o,"x")){var l=e.xStyle,h=l.offsetX,u=l.offsetY,c=l.lineCap,f=l.backgroundColor,p=l.fillerColor,g=l.size,d=t.getXScale(),v=s[d.field];v||(v=Va(i,d),s[d.field]=v);var m=Wa(d,v,d.type),y=t.get("_horizontalBar"),x=a-g/2+u;if(y)y.get("children")[1].attr({x1:Math.max(n.bl.x+n.width*m[0]+h,n.bl.x),x2:Math.min(n.bl.x+n.width*m[1]+h,n.br.x)});else(y=r.addGroup({className:"horizontalBar"})).addShape("line",{attrs:{x1:n.bl.x+h,y1:x,x2:n.br.x+h,y2:x,lineWidth:g,stroke:f,lineCap:c}}),y.addShape("line",{attrs:{x1:Math.max(n.bl.x+n.width*m[0]+h,n.bl.x),y1:x,x2:Math.min(n.bl.x+n.width*m[1]+h,n.br.x),y2:x,lineWidth:g,stroke:p,lineCap:c}}),t.set("_horizontalBar",y)}if(vt(o,"y")){var _=e.yStyle,S=_.offsetX,b=_.offsetY,M=_.lineCap,C=_.backgroundColor,w=_.fillerColor,P=_.size,T=t.getYScales()[0],D=s[T.field];D||(D=Va(i,T),s[T.field]=D);var k=Wa(T,D,T.type),A=t.get("_verticalBar"),I=P/2+S;if(A)A.get("children")[1].attr({y1:Math.max(n.tl.y+n.height*k[0]+b,n.tl.y),y2:Math.min(n.tl.y+n.height*k[1]+b,n.bl.y)});else(A=r.addGroup({className:"verticalBar"})).addShape("line",{attrs:{x1:I,y1:n.tl.y+b,x2:I,y2:n.bl.y+b,lineWidth:P,stroke:C,lineCap:M}}),A.addShape("line",{attrs:{x1:I,y1:Math.max(n.tl.y+n.height*k[0]+b,n.tl.y),x2:I,y2:Math.min(n.tl.y+n.height*k[1]+b,n.bl.y),lineWidth:P,stroke:w,lineCap:M}}),t.set("_verticalBar",A)}}}var Qa={init:Ua,clear:Za,changeData:Ja,clearInner:$a,afterGeomDraw:Ka},ts=Object.freeze({__proto__:null,init:Ua,clear:Za,changeData:Ja,clearInner:$a,afterGeomDraw:Ka,default:Qa}),es={anchorOffset:5,inflectionOffset:15,sidePadding:20,lineHeight:32,adjustOffset:15,skipOverlapLabels:!1,triggerOn:"touchstart",activeShape:!1,activeStyle:{offset:1,appendRadius:8,fillOpacity:.5},label1OffsetY:-1,label2OffsetY:1};function is(t,e,i){return{x:t.x+i*Math.cos(e),y:t.y+i*Math.sin(e)}}function ns(t,e){var i=t.getBBox(),n=e.getBBox();return Math.max(i.minX,n.minX)<=Math.min(i.maxX,n.maxX)&&Math.max(i.minY,n.minY)<=Math.min(i.maxY,n.maxY)}var rs=function(){function t(t){var e=this;Mt(this,"_handleEvent",(function(t){for(var i,n=e,r=n.chart,a=n.drawnLabels,s=n.pieLabelCfg,o=s.onClick,l=s.activeShape,h=ft(t,r),u=h.x,c=h.y,f=0,p=a.length;f<p;f++){var g=a[f],d=g.getBBox();if(u>=d.minX&&u<=d.maxX&&c>=d.minY&&c<=d.maxY){i=g;break}}var v=r.getSnapRecords({x:u,y:c});i?h.data=i.get("data"):v.length&&(h.data=v[0]._origin),o&&o(h),h.data&&l&&e._activeShape(h.data)})),A(this,t);var i=this.chart;this.canvasDom=i.get("canvas").get("el")}var e=t.prototype;return e.renderLabels=function(){var t=this,e=t.chart,i=t.pieLabelCfg,n=t.labelGroup,r=[[],[]],s=e.get("geoms")[0].get("container").get("children"),o=i.anchorOffset,l=i.inflectionOffset,h=i.label1,u=i.label2,c=i.lineHeight,f=i.skipOverlapLabels,p=i.label1OffsetY,g=i.label2OffsetY,d=e.get("coord"),v=d.center,m=d.circleRadius;s.forEach((function(t){var i=t._attrs.attrs,n=function(t,e){return e<t&&(e+=2*Math.PI),(e+t)/2}(i.startAngle,i.endAngle),s=is(v,n,m+o),c=is(v,n,m+l),f=t.get("origin"),d=f._origin,y=f.color,x={_anchor:s,_inflection:c,_data:d,x:c.x,y:c.y,r:m+l,fill:y},_=new In({context:e.get("canvas").get("context"),data:d}),S={x:0,y:0,fontSize:12,lineHeight:12,fill:"#808080"};a(h)&&_.addShape("Text",{attrs:A({textBaseline:"bottom"},S,h(d,y)),data:d,offsetY:p}),a(u)&&_.addShape("Text",{attrs:A({textBaseline:"top"},S,u(d,y)),data:d,offsetY:g}),x.textGroup=_,s.x<v.x?(x._side="left",r[0].push(x)):(x._side="right",r[1].push(x))}));var y=[];if(f)for(var x,_=r[1].concat(r[0]),S=0,b=_.length;S<b;S++){var M=_[S],C=t._drawLabel(M);x&&ns(C,x)||(n.add(C),t._drawLabelLine(M),x=C,y.push(C))}else{var w=e.get("height"),P=parseInt(w/c,10);r.forEach((function(e){e.length>P&&e.splice(P,e.length-P),e.sort((function(t,e){return t.y-e.y}));var i=t._antiCollision(e);y=y.concat(i)}))}this.drawnLabels=y},e.bindEvents=function(){var t=this.pieLabelCfg.triggerOn||"touchstart";lt(this.canvasDom,t,this._handleEvent)},e.unBindEvents=function(){var t=this.pieLabelCfg.triggerOn||"touchstart";ht(this.canvasDom,t,this._handleEvent)},e.clear=function(){this.labelGroup&&this.labelGroup.clear(),this.halo&&this.halo.remove(!0),this.lastSelectedData=null,this.drawnLabels=[],this.unBindEvents()},e._drawLabel=function(t){var e=this.pieLabelCfg,i=this.chart.get("width"),n=e.sidePadding,r=t.y,a=t.textGroup,s=a.get("children"),o={textAlign:"left"===t._side?"left":"right",x:"left"===t._side?n:i-n};return s.forEach((function(t){t.attr(o),t.attr("y",r+t.get("offsetY"))})),a},e._drawLabelLine=function(t,e){var i=this.chart,n=this.pieLabelCfg,r=this.labelGroup,a=i.get("width"),s=n.sidePadding,o=n.adjustOffset,l=n.lineStyle,h=n.anchorStyle,u=n.skipOverlapLabels,c=t._anchor,f=t._inflection,p=t.fill,g=t.y,d={x:"left"===t._side?s:a-s,y:g},v=[c,f,d];if(!u&&f.y!==g)if(f.y<g){var m=f,y={x:"left"===t._side?d.x+e+o:d.x-e-o,y:f.y},x={x:"left"===t._side?d.x+e:d.x-e,y:d.y};v=[c,m,y,x,d],("right"===t._side&&y.x<m.x||"left"===t._side&&y.x>m.x)&&(v=[c,x,d])}else v=[c,{x:f.x,y:g},d];r.addShape("Polyline",{attrs:A({points:v,lineWidth:1,stroke:p},l)}),r.addShape("Circle",{attrs:A({x:c.x,y:c.y,r:2,fill:p},h)})},e._antiCollision=function(t){var e,i=this,n=i.chart,r=i.pieLabelCfg,a=n.get("coord"),s=n.get("height"),o=a.center,l=a.circleRadius,h=r.inflectionOffset,u=r.lineHeight,c=o.y-l-h-u,f=!0,p=s,g=0,d=Number.MIN_VALUE,v=0,m=t.map((function(t){var e=t.y;e>g&&(g=e),e<d&&(d=e);var i=t.textGroup.getBBox().width;return i>=v&&(v=i),{size:u,targets:[e-c]}}));g-c>p&&(p=g-c);for(var y=function(t){t.forEach((function(t){var e=(Math.min.apply(d,t.targets)+Math.max.apply(d,t.targets))/2;t.pos=Math.min(Math.max(d,e-t.size/2),p-t.size)}))};f;)for(y(m),f=!1,e=m.length;e--;)if(e>0){var x=m[e-1],_=m[e];x.pos+x.size>_.pos&&(x.size+=_.size,x.targets=x.targets.concat(_.targets),x.pos+x.size>p&&(x.pos=p-x.size),m.splice(e,1),f=!0)}e=0,m.forEach((function(i){var n=c;i.targets.forEach((function(){t[e].y=i.pos+n+u/2,n+=u,e++}))}));var S=[];return t.forEach((function(t){var e=i._drawLabel(t);i.labelGroup.add(e),i._drawLabelLine(t,v),S.push(e)})),S},e._getSelectedShapeByData=function(t){var e=null,i=this.chart.get("geoms")[0];return h(i.get("container").get("children"),(function(n){if(n.get("isShape")&&n.get("className")===i.get("type")&>(n.get("origin")._origin,t))return e=n,!1})),e},e._activeShape=function(t){var e=this.chart,i=this.lastSelectedData,n=this.pieLabelCfg;if(t!==i){this.lastSelectedData=t;var r=n.activeStyle,a=this._getSelectedShapeByData(t)._attrs.attrs,s=a.x,o=a.y,l=a.startAngle,h=a.endAngle,u=a.r,c=a.fill,f=e.get("frontPlot");this.halo&&this.halo.remove(!0);var p=f.addShape("sector",{attrs:A({x:s,y:o,r:u+r.offset+r.appendRadius,r0:u+r.offset,fill:c,startAngle:l,endAngle:h},r)});this.halo=p,e.get("canvas").draw()}},t}();function as(t){var e=t.get("frontPlot").addGroup({className:"pie-label",zIndex:0}),i=new rs({chart:t,labelGroup:e});t.set("pieLabelController",i),t.pieLabel=function(t){return t=E({},es,t),i.pieLabelCfg=t,this}}function ss(t){var e=t.get("pieLabelController");e.pieLabelCfg&&(e.renderLabels(),e.bindEvents())}function os(t){var e=t.get("pieLabelController");e.pieLabelCfg&&e.clear()}var ls={init:as,afterGeomDraw:ss,clearInner:os},hs=Object.freeze({__proto__:null,init:as,afterGeomDraw:ss,clearInner:os,default:ls}),us={label:null,offsetX:0,offsetY:0},cs={textBaseline:"middle",fill:"#808080"};function fs(t,e){return{x:(t.x-e.x)/2+e.x,y:(t.y-e.y)/2+e.y}}var ps=function(){function t(t){var e=t.chart,i=t.container;this.cfg=null,this.chart=e,this.container=i}var e=t.prototype;return e.draw=function(){var t=this.chart,e=this.container,i=this.cfg;if(i){var n=A({},us,i);t.get("geoms")[0].get("container").get("children").forEach((function(t){var i=t.get("origin"),r=t.get("attrs"),a=i._origin,s=i.color,o=r.points;if(n.label){var l=n.label(a,s),h=fs(o[1],o[2]);e.addShape("Text",{attrs:A({x:h.x+n.offsetX,y:h.y+n.offsetY},cs,l)})}if(n.guide){var u=n.guide(a,s),c=fs(fs(o[0],o[1]),fs(o[2],o[3]||o[2]));e.addShape("Text",{attrs:A({x:c.x,y:c.y,textBaseline:"middle",textAlign:"center"},cs,u)})}}))}},e.clear=function(){this.container.clear()},t}();function gs(t){var e=t.get("frontPlot").addGroup({className:"label",zIndex:0}),i=new ps({chart:t,container:e});t.set("intervalLabelController",i),t.intervalLabel=function(t){i.cfg=t}}function ds(t){t.get("intervalLabelController").draw()}function vs(t){t.get("intervalLabelController").clear()}var ms={init:gs,afterGeomDraw:ds,clearInner:vs},ys=Object.freeze({__proto__:null,init:gs,afterGeomDraw:ds,clearInner:vs,default:ms});var xs,_s=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){
- /*! Hammer.JS - v2.0.7 - 2016-04-22
- * http://hammerjs.github.io/
- *
- * Copyright (c) 2016 Jorik Tangelder;
- * Licensed under the MIT license */
- !function(e,i,n,r){var a,s=["","webkit","Moz","MS","ms","o"],o=i.createElement("div"),l=Math.round,h=Math.abs,u=Date.now;function c(t,e,i){return setTimeout(y(t,i),e)}function f(t,e,i){return!!Array.isArray(t)&&(p(t,i[e],i),!0)}function p(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(void 0!==t.length)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function g(t,i,n){var r="DEPRECATED METHOD: "+i+"\n"+n+" AT \n";return function(){var i=new Error("get-stack-trace"),n=i&&i.stack?i.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=e.console&&(e.console.warn||e.console.log);return a&&a.call(e.console,r,n),t.apply(this,arguments)}}a="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}:Object.assign;var d=g((function(t,e,i){for(var n=Object.keys(e),r=0;r<n.length;)(!i||i&&void 0===t[n[r]])&&(t[n[r]]=e[n[r]]),r++;return t}),"extend","Use `assign`."),v=g((function(t,e){return d(t,e,!0)}),"merge","Use `assign`.");function m(t,e,i){var n,r=e.prototype;(n=t.prototype=Object.create(r)).constructor=t,n._super=r,i&&a(n,i)}function y(t,e){return function(){return t.apply(e,arguments)}}function x(t,e){return"function"==typeof t?t.apply(e&&e[0]||void 0,e):t}function _(t,e){return void 0===t?e:t}function S(t,e,i){p(w(e),(function(e){t.addEventListener(e,i,!1)}))}function b(t,e,i){p(w(e),(function(e){t.removeEventListener(e,i,!1)}))}function M(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function C(t,e){return t.indexOf(e)>-1}function w(t){return t.trim().split(/\s+/g)}function P(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}function T(t){return Array.prototype.slice.call(t,0)}function D(t,e,i){for(var n=[],r=[],a=0;a<t.length;){var s=e?t[a][e]:t[a];P(r,s)<0&&n.push(t[a]),r[a]=s,a++}return i&&(n=e?n.sort((function(t,i){return t[e]>i[e]})):n.sort()),n}function k(t,e){for(var i,n,r=e[0].toUpperCase()+e.slice(1),a=0;a<s.length;){if((n=(i=s[a])?i+r:e)in t)return n;a++}}var A=1;function I(t){var i=t.ownerDocument||t;return i.defaultView||i.parentWindow||e}var E="ontouchstart"in e,Y=void 0!==k(e,"PointerEvent"),O=E&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),N=["x","y"],z=["clientX","clientY"];function L(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){x(t.options.enable,[t])&&i.handler(e)},this.init()}function X(t,e,i){var n=i.pointers.length,r=i.changedPointers.length,a=1&e&&n-r==0,s=12&e&&n-r==0;i.isFirst=!!a,i.isFinal=!!s,a&&(t.session={}),i.eventType=e,function(t,e){var i=t.session,n=e.pointers,r=n.length;i.firstInput||(i.firstInput=B(e));r>1&&!i.firstMultiple?i.firstMultiple=B(e):1===r&&(i.firstMultiple=!1);var a=i.firstInput,s=i.firstMultiple,o=s?s.center:a.center,l=e.center=F(n);e.timeStamp=u(),e.deltaTime=e.timeStamp-a.timeStamp,e.angle=H(o,l),e.distance=G(o,l),function(t,e){var i=e.center,n=t.offsetDelta||{},r=t.prevDelta||{},a=t.prevInput||{};1!==e.eventType&&4!==a.eventType||(r=t.prevDelta={x:a.deltaX||0,y:a.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y});e.deltaX=r.x+(i.x-n.x),e.deltaY=r.y+(i.y-n.y)}(i,e),e.offsetDirection=j(e.deltaX,e.deltaY);var c=R(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=h(c.x)>h(c.y)?c.x:c.y,e.scale=s?function(t,e){return G(e[0],e[1],z)/G(t[0],t[1],z)}(s.pointers,n):1,e.rotation=s?function(t,e){return H(e[1],e[0],z)+H(t[1],t[0],z)}(s.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,r,a,s=t.lastInterval||e,o=e.timeStamp-s.timeStamp;if(8!=e.eventType&&(o>25||void 0===s.velocity)){var l=e.deltaX-s.deltaX,u=e.deltaY-s.deltaY,c=R(o,l,u);n=c.x,r=c.y,i=h(c.x)>h(c.y)?c.x:c.y,a=j(l,u),t.lastInterval=e}else i=s.velocity,n=s.velocityX,r=s.velocityY,a=s.direction;e.velocity=i,e.velocityX=n,e.velocityY=r,e.direction=a}(i,e);var f=t.element;M(e.srcEvent.target,f)&&(f=e.srcEvent.target);e.target=f}(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function B(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:l(t.pointers[i].clientX),clientY:l(t.pointers[i].clientY)},i++;return{timeStamp:u(),pointers:e,center:F(e),deltaX:t.deltaX,deltaY:t.deltaY}}function F(t){var e=t.length;if(1===e)return{x:l(t[0].clientX),y:l(t[0].clientY)};for(var i=0,n=0,r=0;r<e;)i+=t[r].clientX,n+=t[r].clientY,r++;return{x:l(i/e),y:l(n/e)}}function R(t,e,i){return{x:e/t||0,y:i/t||0}}function j(t,e){return t===e?1:h(t)>=h(e)?t<0?2:4:e<0?8:16}function G(t,e,i){i||(i=N);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return Math.sqrt(n*n+r*r)}function H(t,e,i){i||(i=N);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return 180*Math.atan2(r,n)/Math.PI}L.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(I(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&b(this.element,this.evEl,this.domHandler),this.evTarget&&b(this.target,this.evTarget,this.domHandler),this.evWin&&b(I(this.element),this.evWin,this.domHandler)}};var W={mousedown:1,mousemove:2,mouseup:4};function V(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,L.apply(this,arguments)}m(V,L,{handler:function(t){var e=W[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var q={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},U={2:"touch",3:"pen",4:"mouse",5:"kinect"},Z="pointerdown",J="pointermove pointerup pointercancel";function $(){this.evEl=Z,this.evWin=J,L.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&(Z="MSPointerDown",J="MSPointerMove MSPointerUp MSPointerCancel"),m($,L,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),r=q[n],a=U[t.pointerType]||t.pointerType,s="touch"==a,o=P(e,t.pointerId,"pointerId");1&r&&(0===t.button||s)?o<0&&(e.push(t),o=e.length-1):12&r&&(i=!0),o<0||(e[o]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:a,srcEvent:t}),i&&e.splice(o,1))}});var K={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function Q(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,L.apply(this,arguments)}function tt(t,e){var i=T(t.touches),n=T(t.changedTouches);return 12&e&&(i=D(i.concat(n),"identifier",!0)),[i,n]}m(Q,L,{handler:function(t){var e=K[t.type];if(1===e&&(this.started=!0),this.started){var i=tt.call(this,t,e);12&e&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:"touch",srcEvent:t})}}});var et={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function it(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},L.apply(this,arguments)}function nt(t,e){var i=T(t.touches),n=this.targetIds;if(3&e&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,a,s=T(t.changedTouches),o=[],l=this.target;if(a=i.filter((function(t){return M(t.target,l)})),1===e)for(r=0;r<a.length;)n[a[r].identifier]=!0,r++;for(r=0;r<s.length;)n[s[r].identifier]&&o.push(s[r]),12&e&&delete n[s[r].identifier],r++;return o.length?[D(a.concat(o),"identifier",!0),o]:void 0}m(it,L,{handler:function(t){var e=et[t.type],i=nt.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:"touch",srcEvent:t})}});function rt(){L.apply(this,arguments);var t=y(this.handler,this);this.touch=new it(this.manager,t),this.mouse=new V(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function at(t,e){1&t?(this.primaryTouch=e.changedPointers[0].identifier,st.call(this,e)):12&t&&st.call(this,e)}function st(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY};this.lastTouches.push(i);var n=this.lastTouches;setTimeout((function(){var t=n.indexOf(i);t>-1&&n.splice(t,1)}),2500)}}function ot(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var r=this.lastTouches[n],a=Math.abs(e-r.x),s=Math.abs(i-r.y);if(a<=25&&s<=25)return!0}return!1}m(rt,L,{handler:function(t,e,i){var n="touch"==i.pointerType,r="mouse"==i.pointerType;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)at.call(this,e,i);else if(r&&ot.call(this,i))return;this.callback(t,e,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var lt=k(o.style,"touchAction"),ht=void 0!==lt,ut=function(){if(!ht)return!1;var t={},i=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){t[n]=!i||e.CSS.supports("touch-action",n)})),t}();function ct(t,e){this.manager=t,this.set(e)}ct.prototype={set:function(t){"compute"==t&&(t=this.compute()),ht&&this.manager.element.style&&ut[t]&&(this.manager.element.style[lt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return p(this.manager.recognizers,(function(e){x(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(C(t,"none"))return"none";var e=C(t,"pan-x"),i=C(t,"pan-y");if(e&&i)return"none";if(e||i)return e?"pan-x":"pan-y";if(C(t,"manipulation"))return"manipulation";return"auto"}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,r=C(n,"none")&&!ut.none,a=C(n,"pan-y")&&!ut["pan-y"],s=C(n,"pan-x")&&!ut["pan-x"];if(r){var o=1===t.pointers.length,l=t.distance<2,h=t.deltaTime<250;if(o&&l&&h)return}if(!s||!a)return r||a&&6&i||s&&24&i?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};function ft(t){this.options=a({},this.defaults,t||{}),this.id=A++,this.manager=null,this.options.enable=_(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function pt(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}function gt(t){return 16==t?"down":8==t?"up":2==t?"left":4==t?"right":""}function dt(t,e){var i=e.manager;return i?i.get(t):t}function vt(){ft.apply(this,arguments)}function mt(){vt.apply(this,arguments),this.pX=null,this.pY=null}function yt(){vt.apply(this,arguments)}function xt(){ft.apply(this,arguments),this._timer=null,this._input=null}function _t(){vt.apply(this,arguments)}function St(){vt.apply(this,arguments)}function bt(){ft.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Mt(t,e){return(e=e||{}).recognizers=_(e.recognizers,Mt.defaults.preset),new Ct(t,e)}ft.prototype={defaults:{},set:function(t){return a(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(f(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=dt(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return f(t,"dropRecognizeWith",this)||(t=dt(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(f(t,"requireFailure",this))return this;var e=this.requireFail;return-1===P(e,t=dt(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(f(t,"dropRequireFailure",this))return this;t=dt(t,this);var e=P(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i<8&&n(e.options.event+pt(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=8&&n(e.options.event+pt(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},recognize:function(t){var e=a({},t);if(!x(this.options.enable,[this,e]))return this.reset(),void(this.state=32);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},m(vt,ft,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,n=6&e,r=this.attrTest(t);return n&&(8&i||!r)?16|e:n||r?4&i?8|e:2&e?4|e:2:32}}),m(mt,vt,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var t=this.options.direction,e=[];return 6&t&&e.push("pan-y"),24&t&&e.push("pan-x"),e},directionTest:function(t){var e=this.options,i=!0,n=t.distance,r=t.direction,a=t.deltaX,s=t.deltaY;return r&e.direction||(6&e.direction?(r=0===a?1:a<0?2:4,i=a!=this.pX,n=Math.abs(t.deltaX)):(r=0===s?1:s<0?8:16,i=s!=this.pY,n=Math.abs(t.deltaY))),t.direction=r,i&&n>e.threshold&&r&e.direction},attrTest:function(t){return vt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=gt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),m(yt,vt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),m(xt,ft,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime>e.time;if(this._input=t,!n||!i||12&t.eventType&&!r)this.reset();else if(1&t.eventType)this.reset(),this._timer=c((function(){this.state=8,this.tryEmit()}),e.time,this);else if(4&t.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}}),m(_t,vt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),m(St,vt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return mt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return 30&i?e=t.overallVelocity:6&i?e=t.overallVelocityX:24&i&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&h(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=gt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),m(bt,ft,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return["manipulation"]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime<e.time;if(this.reset(),1&t.eventType&&0===this.count)return this.failTimeout();if(n&&r&&i){if(4!=t.eventType)return this.failTimeout();var a=!this.pTime||t.timeStamp-this.pTime<e.interval,s=!this.pCenter||G(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,s&&a?this.count+=1:this.count=1,this._input=t,0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=c((function(){this.state=8,this.tryEmit()}),e.interval,this),2):8}return 32},failTimeout:function(){return this._timer=c((function(){this.state=32}),this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Mt.VERSION="2.0.7",Mt.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[_t,{enable:!1}],[yt,{enable:!1},["rotate"]],[St,{direction:6}],[mt,{direction:6},["swipe"]],[bt],[bt,{event:"doubletap",taps:2},["tap"]],[xt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Ct(t,e){var i;this.options=a({},Mt.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((i=this).options.inputClass||(Y?$:O?it:E?rt:V))(i,X),this.touchAction=new ct(this,this.options.touchAction),wt(this,!0),p(this.options.recognizers,(function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}function wt(t,e){var i,n=t.element;n.style&&(p(t.options.cssProps,(function(r,a){i=k(n.style,a),e?(t.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=t.oldCssProps[i]||""})),e||(t.oldCssProps={}))}Ct.prototype={set:function(t){return a(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,r=e.curRecognizer;(!r||r&&8&r.state)&&(r=e.curRecognizer=null);for(var a=0;a<n.length;)i=n[a],2===e.stopped||r&&i!=r&&!i.canRecognizeWith(r)?i.reset():i.recognize(t),!r&&14&i.state&&(r=e.curRecognizer=i),a++}},get:function(t){if(t instanceof ft)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(f(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(f(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,i=P(e,t);-1!==i&&(e.splice(i,1),this.touchAction.update())}return this},on:function(t,e){if(void 0!==t&&void 0!==e){var i=this.handlers;return p(w(t),(function(t){i[t]=i[t]||[],i[t].push(e)})),this}},off:function(t,e){if(void 0!==t){var i=this.handlers;return p(w(t),(function(t){e?i[t]&&i[t].splice(P(i[t],e),1):delete i[t]})),this}},emit:function(t,e){this.options.domEvents&&function(t,e){var n=i.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](e),r++}},destroy:function(){this.element&&wt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},a(Mt,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Ct,Input:L,TouchAction:ct,TouchInput:it,MouseInput:V,PointerEventInput:$,TouchMouseInput:rt,SingleTouchInput:Q,Recognizer:ft,AttrRecognizer:vt,Tap:bt,Pan:mt,Swipe:St,Pinch:yt,Rotate:_t,Press:xt,on:S,off:b,each:p,merge:v,extend:d,assign:a,inherit:m,bindFn:y,prefixed:k}),(void 0!==e?e:"undefined"!=typeof self?self:{}).Hammer=Mt,t.exports?t.exports=Mt:e.Hammer=Mt}(window,document)}));jn._Interactions={},jn.registerInteraction=function(t,e){jn._Interactions[t]=e},jn.getInteraction=function(t){return jn._Interactions[t]},jn.prototype.interaction=function(t,e){var i=this._interactions||{};i[t]&&i[t].destroy();var n=new(jn.getInteraction(t))(e,this);return i[t]=n,this._interactions=i,this},jn.prototype.clearInteraction=function(t){var e=this._interactions;if(e)return t?(e[t]&&e[t].destroy(),delete e[t]):h(e,(function(t,i){t.destroy(),delete e[i]})),this},$||K||(xs=_s);var Ss=["touchstart","touchmove","touchend"],bs=function(){var t=e.prototype;function e(t,e){var i=this;Mt(this,"_start",(function(t){i.preStart&&i.preStart(t),i.start(t),i.onStart&&i.onStart(t)})),Mt(this,"_process",(function(t){i.preProcess&&i.preProcess(t),i.process(t),i.onProcess&&i.onProcess(t)})),Mt(this,"_end",(function(t){i.preEnd&&i.preEnd(t),i.end(t),i.onEnd&&i.onEnd(t)})),Mt(this,"_reset",(function(t){i.preReset&&i.preReset(t),i.reset(t),i.onReset&&i.onReset(t)}));var n=this.getDefaultCfg();E(this,n,t),this.chart=e,this.canvas=e.get("canvas"),this.el=e.get("canvas").get("el"),this._bindEvents()}return t.getDefaultCfg=function(){return{startEvent:Ss[0],processEvent:Ss[1],endEvent:Ss[2],resetEvent:null}},t.start=function(){},t.process=function(){},t.end=function(){},t.reset=function(){},t._bindEvents=function(){this._clearEvents();var t=this.startEvent,e=this.processEvent,i=this.endEvent,n=this.resetEvent,r=this.el;xs&&(this.hammer=new xs(r)),this._bindEvent(t,this._start),this._bindEvent(e,this._process),this._bindEvent(i,this._end),this._bindEvent(n,this._reset)},t._clearEvents=function(){var t=this.startEvent,e=this.processEvent,i=this.endEvent,n=this.resetEvent;this.hammer&&(this.hammer.destroy(),this.hammer=null),this._clearTouchEvent(t,this._start),this._clearTouchEvent(e,this._process),this._clearTouchEvent(i,this._end),this._clearTouchEvent(n,this._reset)},t._bindEvent=function(t,e){var i=this.el;t&&(-1!==Ss.indexOf(t)?lt(i,t,e):this.hammer&&this.hammer.on(t,e))},t._clearTouchEvent=function(t,e){var i=this.el;t&&-1!==Ss.indexOf(t)&&ht(i,t,e)},t.destroy=function(){this._clearEvents()},e}(),Ms=function(t){wt(i,t);var e=i.prototype;function i(e,i){var n,r=Tt(n=t.call(this,e,i)||this);i.registerPlugins({clearInner:function(){r.halo&&r.halo.remove(!0),r.selected=!1,r.selectedShape=null,r.lastShape=null,r.halo=null,r.defaultSelected=null}});var a=r.defaultSelected;if(l(a)){var s=r._getSelectedShapeByData(a);s&&r._selectedShape(s),n.canvas.draw()}return n}return e.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e=A({},e,{startEvent:"tap",processEvent:null,animate:!1,offset:1,appendRadius:8,style:{fillOpacity:.5},cancelable:!0,defaultSelected:null}),($||K)&&(e.startEvent="touchstart",e.endEvent="touchend"),e},e._getSelectedShapeByData=function(t){var e=null,i=this.chart.get("geoms")[0];return h(i.get("container").get("children"),(function(n){if(n.get("isShape")&&n.get("className")===i.get("type")&>(n.get("origin")._origin,t))return e=n,!1})),e},e._selectedShape=function(t){var e=this.offset,i=this.style,n=this.appendRadius,r=this.chart;this.lastShape=t;var a=t._attrs.attrs,s=a.x,o=a.y,l=a.startAngle,h=a.endAngle,u=a.r,c=a.fill,f=r.get("frontPlot").addShape("sector",{attrs:A({x:s,y:o,r:u+e+n,r0:u+e,fill:c,startAngle:l,endAngle:h},i)});this.halo=f;var p=this.animate;p&&(!0===p&&(p={duration:300}),f.attr("r",u+e),f.animate().to(A({attrs:{r:u+e+n}},p)))},e.start=function(t){var e=this.chart;"tap"===t.type&&(t.clientX=t.center.x,t.clientY=t.center.y);var i=ft(t,e),n=i.x,r=i.y,a=e.getSnapRecords({x:n,y:r});if(!a.length)return this.selected=!1,void(this.selectedShape=null);var s=a[0]._origin,o=this._getSelectedShapeByData(s),l=this.lastShape;if(this.selectedShape=o,this.selected=!0,o===l){if(!this.cancelable)return;this.halo&&this.halo.remove(!0),this.lastShape=null,this.selected=!1}else this.halo&&this.halo.remove(!0),this._selectedShape(o);this.canvas.draw()},e.end=function(t){var e=this.selectedShape;e&&!e.get("destroyed")&&(t.data=e.get("origin")._origin,t.shapeInfo=e.get("origin"),t.shape=e,t.selected=!!this.selected)},i}(bs);jn.registerInteraction("pie-select",Ms);var Cs=function(t){wt(i,t);var e=i.prototype;function i(e,i){var n,r=(n=t.call(this,e,i)||this).defaultSelected;if(l(r)){var a=n._selectShapesByData(r),s=a.selectedShape,o=a.unSelectedShapes;s&&n._selectShapes(s,o),n.selectedShape=s}return n}return e.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e=A({},e,{startEvent:"tap",processEvent:null,selectAxis:!0,selectAxisStyle:{fontWeight:"bold"},mode:"shape",selectStyle:{fillOpacity:1},unSelectStyle:{fillOpacity:.4},cancelable:!0,defaultSelected:null}),($||K)&&(e.startEvent="touchstart",e.endEvent="touchend"),e},e._getIntervalShapes=function(){var t=[];return this.chart.get("geoms").forEach((function(e){if("interval"===e.get("type")){var i=e.get("container");t=t.concat(i.get("children"))}})),t},e._resetShape=function(t){var e=t.get("_originAttrs");e&&(t._attrs.attrs=e,t.set("_originAttrs",null))},e._setEventData=function(t){var e=this.selectedShape;e&&!e.get("destroyed")&&(t.data=e.get("origin")._origin,t.shapeInfo=e.get("origin"),t.shape=e,t.selected=!!e.get("_selected"))},e._selectShapesByData=function(t){var e=this._getIntervalShapes(),i=null,n=[];return h(e,(function(e){e.get("isShape")&&"interval"===e.get("className")&&(gt(e.get("origin")._origin,t)?i=e:n.push(e))})),{selectedShape:i,unSelectedShapes:n}},e._selectShapes=function(t,e){var i=this.selectStyle,n=this.unSelectStyle,r=this.selectAxisStyle,a=this.chart;if(!t.get("_originAttrs")){var s=Object.assign({},t.attr());t.set("_originAttrs",s)}if(t.attr(i),h(e,(function(t){if(t.get("_originAttrs"))t.attr(t.get("_originAttrs"));else{var e=Object.assign({},t.attr());t.set("_originAttrs",e)}t.set("_selected",!1),n&&t.attr(n)})),t.set("_selected",!0),this.selectAxis){this.selectedAxisShape&&this._resetShape(this.selectedAxisShape);var o,l=a.getXScale(),u=t.get("origin")._origin,c=a.get("axisController"),f=c.frontPlot,p=c.backPlot;h(f.get("children").concat(p.get("children")),(function(t){if(t.get("value")===l.scale(u[l.field]))return o=t,!1})),this.selectedAxisShape=o,o.set("_originAttrs",Object.assign({},o.attr())),o.attr(r)}this.canvas.draw()},e.reset=function(){var t=this;t.selectedShape&&(h(t._getIntervalShapes(),(function(e){t._resetShape(e),e.set("_selected",!1)})),t.selectedAxisShape&&t._resetShape(t.selectedAxisShape),t.canvas.draw(),t.selectedShape=null,t.selectedAxisShape=null)},e.start=function(t){var e=this.chart;"tap"===t.type&&(t.clientX=t.center.x,t.clientY=t.center.y);var i,n=ft(t,e),r=n.x,a=n.y,s=this.mode,o=this._getIntervalShapes(),l=[];if("shape"===s){var u=e.get("plotRange");if(!Bn({x:r,y:a},u))return void this.reset();h(o,(function(t){var e=t.getBBox();r>=e.x&&r<=e.x+e.width&&a>=e.y&&a<=e.height+e.y?i=t:l.push(t)}))}else if("range"===s){var c=e.getSnapRecords({x:r,y:a});if(!c.length)return void this.reset();var f=c[0]._origin,p=this._selectShapesByData(f);i=p.selectedShape,l=p.unSelectedShapes}if(i)if(this.selectedShape=i,i.get("_selected")){if(!this.cancelable)return void this._setEventData(t);this.reset()}else this._selectShapes(i,l);else this.reset();this._setEventData(t)},e.end=function(t){this._setEventData(t)},i}(bs);jn.registerInteraction("interval-select",Cs);var ws=Object.freeze({__proto__:null,beforeGeomInit:function(t){t.set("limitInPlot",!0);var e=t.get("filteredData"),i=t.get("colDefs");if(!i)return e;var n=t.get("geoms"),r=!1;h(n,(function(t){if(-1!==["area","line","path"].indexOf(t.get("type")))return r=!0,!1}));var a=[];if(h(i,(function(t,e){!r&&t&&(t.values||t.min||t.max)&&a.push(e)})),0===a.length)return e;var s=[];h(e,(function(t){var e=!0;h(a,(function(n){var r=t[n];if(r){var a=i[n];if("timeCat"===a.type){var s=a.values;x(s[0])&&(r=mt(r))}(a.values&&-1===a.values.indexOf(r)||a.min&&r<a.min||a.max&&r>a.max)&&(e=!1)}})),e&&s.push(t)})),t.set("filteredData",s)}}),Ps=["touchstart","touchmove","touchend","touchStart","touchMove","touchEnd"];function Ts(t){var e=t.x,i=t.y,n=t.clientX,r=t.clientY;return x(e)||x(i)?{x:e,y:i}:{x:n,y:r}}var Ds={_handleMove:function(t){if("swipe"===t.type&&t.deltaTime>350)return null;var e,i,n=this.currentDeltaX,r=this.currentDeltaY,a=this.lastPoint;if(-1!==Ps.indexOf(t.type)){var s=t.touches[0],o=Ts(a),l=Ts(s);e=l.x-o.x,i=l.y-o.y,this.lastPoint=s}else null!==n&&null!==r&&(e=t.deltaX-n,i=t.deltaY-r,this.currentDeltaX=t.deltaX,this.currentDeltaY=t.deltaY);if(Math.abs(e)>0||Math.abs(i)>0){var h=this._timestamp,u=+new Date;u-h>16&&(this._doMove(e,i),this._timestamp=u)}},_doMove:function(t,e){var i=this,n=i.mode,r=i.chart,a=i.limitRange,s=r.get("coord"),o=s.start,l=s.end,u=r.get("data");if(vt(n,"x")&&0!==t){var c=r.getXScale(),f=c.field;a[f]||(a[f]=Va(u,c));var p=l.x-o.x;c.isCategory?i._handleCatScale(c,t,p):c.isLinear&&i._handleLinearScale(c,t,p,"x"),i.xRange=Wa(c,a[f],c.type)}if(vt(n,"y")&&0!==e){var g=o.y-l.y,d=r.getYScales();h(d,(function(t){var n=t.field;a[n]||(a[n]=Va(u,t)),t.isLinear&&i._handleLinearScale(t,e,g,"y")}));var v=d[0];i.yRange=Wa(v,a[v.field],v.type)}r.repaint()},_handleLinearScale:function(t,e,i,n){var r=t.field,a=t.min,o=t.max,l=this.limitRange;if(a!==l[r].min||o!==l[r].max){var h=e/i*(o-a),u="x"===n?o-h:o+h,c="x"===n?a-h:a+h;l[r]&&!s(l[r].min)&&c<=l[r].min&&(u=o-a+(c=l[r].min)),l[r]&&!s(l[r].max)&&u>=l[r].max&&(c=(u=l[r].max)-(o-a)),this.updateLinearScale(r,c,u)}},_handleCatScale:function(t,e,i){var n,r=t.type,a=t.field,s=t.values,o=t.ticks,l=t.tickCount,h=d(s),u=this.limitRange[a],c=u.length-1,f=h.length,p=i/(f*(this.speed||1)),g=u.indexOf(h[0]),v=u.indexOf(h[f-1]),m=g,y=Math.abs(e/i),x=this.step||Math.max(1,parseInt(y*f));if(this._panCumulativeDelta+=e,m=this._panCumulativeDelta>p?Math.max(0,m-x):this._panCumulativeDelta<-p?Math.min(c-f+1,m+x):m,n=Math.min(c,m+f-1),m===g&&n===v)return null;var _=u.slice(m,n+1),S=null;if("timeCat"===r){var b=o.length>2?o[1]-o[0]:864e5;if(this._panCumulativeDelta>p)for(var M=o[0]-b;M>=_[0];M-=b)o.unshift(M);else if(this._panCumulativeDelta<-p)for(var C=o[o.length-1]+b;C<=_[_.length-1];C+=b)o.push(C);S=o}else if("cat"===r){S=ae("cat")({tickCount:l,values:_})}else S=o;this.updateCatScale(a,_,S,u,m,n),this._panCumulativeDelta=m!==g?0:this._panCumulativeDelta}};var ks={updateLinearScale:function(t,e,i){Ha(this.chart,t).change({min:e,max:i,nice:!1})},updateCatScale:function(t,e,i,n,r,a){Ha(this.chart,t).change({values:e,ticks:i,scale:function(t){"timeCat"===this.type&&(t=mt(t));var e,i,s,o=this.rangeMin(),l=this.rangeMax(),h=l-o,u=n.indexOf(t);if(u>=0&&u<r)e=(i=o>0?-.1:o-.1)-h,s=u/r;else if(u>=0&&u>a)i=(e=l<1?1.1:l+.1)+h,s=(u-a-1)/(n.length-1-a);else{var c=this.translate(t);s=1===this.values.length?c:c/(this.values.length-1),e=o,i=l}return e+s*(i-e)},getTicks:function(){var t=this,e=this.ticks,i=[];return h(e,(function(e){var n;if(l(e))n=e;else{var r=t.scale(e);r=r>=0&&r<=1?r:NaN,n={text:g(e)?e:t.getText(e),value:r,tickValue:e}}i.push(n)})),i}})}},As=function(t){wt(i,t);var e=i.prototype;function i(e,i){var n,r=Tt(n=t.call(this,e,i)||this),a=r.hammer,s=r.threshold,o=r.velocity;return a&&a.get("swipe").set({direction:6,threshold:s,velocity:o}),i.registerPlugins([ws,{changeData:function(){r.limitRange={}},clear:function(){r.limitRange={}}}]),r.mode="x",A(r,ks,Ds),n}return e.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e=A({},e,{startEvent:"touchstart",processEvent:"swipe",endEvent:"touchend",currentDeltaX:null,threshold:10,velocity:.3,limitRange:{},_timestamp:0,_panCumulativeDelta:0,speed:5})},e.process=function(t){this.currentDeltaX=0,this._handleMove(t)},e.end=function(){this.currentDeltaX=null,this._panCumulativeDelta=0},i}(bs);jn.registerInteraction("swipe",As);var Is=function(t){wt(i,t);var e=i.prototype;function i(e,i){var n,r=Tt(n=t.call(this,e,i)||this),a=r.hammer,s=r.panThreshold;return i.set("limitInPlot",!0),a&&(a.get("pan").set({threshold:s}),i.get("canvas").on("pan",(function(){}))),A(Tt(n),ks,Ds),n}return e.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e=A({},e,{startEvent:"panstart",processEvent:"panmove",endEvent:"panend",resetEvent:"touchend",mode:"x",panThreshold:10,pressThreshold:9,pressTime:251,currentDeltaX:null,currentDeltaY:null,limitRange:{},_timestamp:0,lastPoint:null,_panCumulativeDelta:0,speed:5}),($||K)&&(e.startEvent="touchstart",e.processEvent="touchmove",e.endEvent="touchend"),e},e.start=function(t){this.pressed||(this.currentDeltaX=0,this.currentDeltaY=0,"touchstart"!==t.type&&"touchStart"!==t.type||(this.lastPoint=t.touches[0]))},e.process=function(t){this.pressed||this._handleMove(t)},e.end=function(){this.pressed||(this.currentDeltaX=null,this.currentDeltaY=null,this.lastPoint=null,this._panCumulativeDelta=0)},i}(bs);jn.registerInteraction("pan",Is);var Es=function(t){wt(i,t);var e=i.prototype;function i(e,i){var n,r=Tt(n=t.call(this,e,i)||this);return r.hammer.get("pinch").set({enable:!0}),i.registerPlugins([ws,{changeData:function(){r.limitRange={},r.originTicks=null},clear:function(){r.limitRange={},r.originTicks=null}}]),A(r,ks),n}return e.getDefaultCfg=function(){return A({},t.prototype.getDefaultCfg.call(this),{startEvent:"pinchstart",processEvent:"pinch",endEvent:"pinchend",resetEvent:"touchend",pressThreshold:9,pressTime:251,mode:"x",currentPinchScaling:null,originValues:null,minScale:null,maxScale:null,limitRange:{},sensitivity:1,_pinchCumulativeDelta:0,_timestamp:0})},e.start=function(){this.pressed||(this.currentPinchScaling=1)},e.process=function(t){this.pressed||this._handlePinch(t)},e.end=function(t){this.pressed||(this._handlePinch(t),this.currentPinchScaling=null,this.pinchCumulativeDelta=0)},e._handlePinch=function(t){var e,i=1/this.currentPinchScaling*t.scale,n=t.target.getBoundingClientRect(),r={x:t.center.x-n.left,y:t.center.y-n.top},a=Math.abs(t.pointers[0].clientX-t.pointers[1].clientX),s=Math.abs(t.pointers[0].clientY-t.pointers[1].clientY),o=a/s;e=o>.3&&o<1.7?"xy":a>s?"x":"y";var l=this._timestamp,h=+new Date;h-l>16&&(this._doZoom(i,r,e),this._timestamp=h),this.currentPinchScaling=t.scale},e._doZoom=function(t,e,i){var n,r=this,a=r.mode,s=r.chart,o=r.limitRange;n="xy"===a&&void 0!==i?i:"xy";var l=s.get("data");if(vt(a,"x")&&vt(n,"x")){var u=s.getXScale(),c=u.field;o[c]||(o[c]=Va(l,u)),u.isCategory?r._zoomCatScale(u,t,e):u.isLinear&&r._zoomLinearScale(u,t,e,"x"),this.xRange=Wa(u,o[c],u.type)}if(vt(a,"y")&&vt(n,"y")){var f=s.getYScales();h(f,(function(i){var n=i.field;o[n]||(o[n]=Va(l,i)),i.isLinear&&r._zoomLinearScale(i,t,e,"y")}));var p=f[0];this.yRange=Wa(p,o[p.field],p.type)}s.repaint()},e._zoomLinearScale=function(t,e,i,n){var r=this.chart,a=t.min,s=t.max,o=t.field,l=s-a,h=this.limitRange,u=h[o].max-h[o].min,c=r.get("coord"),f=l*(e-1);if(this.minScale&&e<1){var p=u/this.minScale;f=Math.max(l-p,f)}if(this.maxScale&&e>=1){var g=u/this.maxScale;f=Math.min(l-g,f)}var d=c.invertPoint(i),v="x"===n?d.x:d.y,m=s-f*(1-v),y=a+f*v;this.updateLinearScale(o,y,m)},e._zoomCatScale=function(t,e,i){var n=this._pinchCumulativeDelta,r=this.sensitivity;n=e>1?n+1:n-1,this._pinchCumulativeDelta=n;var a=t.field,s=t.values,o=this.chart.get("coord");this.originTicks||(this.originTicks=t.ticks);var l=this.limitRange[a],h=l.length,u=this.minScale||1,c=this.maxScale||5,f=parseInt(h/c),p=parseInt(h/u),g=s.length;if(n>0&&g<=f)return null;if(n<0&&g>=p)return null;var d=h-1,v=s[0],m=s[g-1],y=l.indexOf(v),x=l.indexOf(m),_=(o.start.x+o.end.x)/2,S=i.x;if(Math.abs(n)>r){var b=Math.max(1,parseInt(g*Math.abs(e-1)));n<0?(S>=_?y<=0?x=Math.min(d,x+b):y=Math.max(0,y-b):S<_&&(x>=d?y=Math.max(0,y-b):x=Math.min(d,x+b)),this._pinchCumulativeDelta=0):n>0&&(S>=_?y=y<x?y=Math.min(x,y+b):y:S<_&&(x=x>y?x=Math.max(y,x-b):x),this._pinchCumulativeDelta=0);var M=l.slice(y,x+1);this.updateCatScale(a,M,this.originTicks,l,y,x)}},i}(bs);jn.registerInteraction("pinch",Es),jn.plugins.register([Vr,oa,Qr,Ga,ts,hs,ys]);var Ys={Global:bt,Chart:jn,Shape:Ut,G:Ln,Util:yt,Helper:Fn,track:Gn,Interaction:bs,Animate:xa};t.Animate=xa,t.Chart=jn,t.G=Ln,t.Global=bt,t.Helper=Fn,t.Interaction=bs,t.Shape=Ut,t.Util=yt,t.default=Ys,t.track=Gn,Object.defineProperty(t,"__esModule",{value:!0})}));
|