(function(p){var o=navigator.userAgent.toLowerCase(),r=Object.prototype.toString,z=/opera/.test(o),A=/\bchrome\b/.test(o),B=/webkit/.test(o),O=!A&&/safari/.test(o),P=!z&&/msie/.test(o),Q=!!document.createElement("canvas").getContext,R=!B&&/gecko/.test(o),C=/ipod|ipad|iphone|android/gi.test(o),D=function(g,h,i,j){return i*g/j+h},S={easeIn:function(g,h,i,j){return i*(g/=j)*g*g+h},easeOut:function(g,h,i,j){return i*((g=g/j-1)*g*g+1)+h},easeInOut:function(g,h,i,j){return 1>(g/=j/2)?i/2*g*g*g+h:i/2*((g-=2)*g*g+2)+h}},y=function(g){var h=!1,i=!1,j=[],k=function(){if(document.addEventListener)return function(){document.removeEventListener("DOMContentLoaded",k,!1);q()};if(document.attachEvent)return function(){"complete"===document.readyState&&(document.detachEvent("onreadystatechange",k),q())}}(),o=function(){if(!h){try{document.documentElement.doScroll("left")}catch(a){setTimeout(o,1);return}q()}},q=function(){if(!h){h=!0;for(var a=0;a<j.length;a++)j[a].call(document);j=[]}},p=function(){if(!i){i=!0;if("complete"===document.readyState)return setTimeout(q,1);if(document.addEventListener)document.addEventListener("DOMContentLoaded",k,!1),g.addEventListener("load",q,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",k);g.attachEvent("onload",q);var a=!1;try{a=null==g.frameElement}catch(b){}document.documentElement.doScroll&&a&&o()}}},T=function(a){p();h?a.call(document,f):j.push(function(){return a.call(this)})},f=function(a){if(!a||a.nodeType)return a;if("string"===typeof a)return-1!=a.indexOf("#")&&(a=a.substring(1)),document.getElementById(a);"function"===typeof a&&T(a)};f.apply=function(a,b){if(a&&b&&"object"==typeof b)for(var c in b)"undefined"!=typeof b[c]&&(a[c]=b[c]);if(!b&&a){var e={};for(c in a)e[c]=a[c];return e}return a};f.apply(f,{version:"1.0",email:"taylor@ichartjs.com",isEmpty:function(a,b){return null===a||void 0===a||f.isArray(a)&&!a.length||(!b?""===a:!1)},isArray:function(a){return"[object Array]"===r.apply(a)},isDate:function(a){return"[object Date]"===r.apply(a)},isObject:function(a){return!!a&&"[object Object]"===r.apply(a)},isFunction:function(a){return"[object Function]"===r.apply(a)},isNumber:function(a){return"number"===typeof a&&isFinite(a)},isString:function(a){return"string"===typeof a},isBoolean:function(a){return"boolean"===typeof a},isFalse:function(a){return"boolean"===typeof a&&!a},isElement:function(a){return a?!!a.tagName:!1},isDefined:function(a){return"undefined"!==typeof a}});f.applyIf=function(a,b){if(a&&f.isObject(b))for(var c in b)f.isDefined(b[c])&&!f.isDefined(a[c])&&(a[c]=b[c]);return!b&&a?f.apply(a):a};f.merge=function(a,b,c){if(a&&f.isObject(b)){for(var e in b)f.isDefined(b[e])&&(f.isObject(b[e])?f.isObject(a[e])?f.merge(a[e],b[e]):a[e]=f.clone(b[e],!0):a[e]=b[e]);if(f.isObject(c))return f.merge(a,c)}return a};f.clone=function(a,b,c){var e={};if(f.isArray(a)&&f.isObject(b))for(var d=0;d<a.length;d++)e[a[d]]=c&&f.isObject(b[a[d]])?f.clone(b[a[d]],c):b[a[d]];else if(f.isObject(a))for(d in a)e[d]=b&&f.isObject(a[d])&&!a[d].ICHARTJS_OBJECT?f.clone(a[d],b):a[d];return e};f.override=function(a,b){if(a&&b){var c=a.prototype;f.apply(c,b);f.isIE&&b.hasOwnProperty("toString")&&(c.toString=b.toString)}};f.extend=function(){var a=function(a){for(var b in a)this[b]=a[b]},b=Object.prototype.constructor;return function(c,e){var d=function(){c.apply(this,arguments)},g=function(){},h=c.prototype;g.prototype=h;g=d.prototype=new g;g.constructor=d;d.superclass=h;h.constructor==b&&(h.constructor=c);d.override=function(a){f.override(d,a)};g.superclass=g.supr=function(){return h};g.override=a;f.override(d,e);d.extend=function(a){return f.extend(d,a)};d.plugin_={};d.plugin=function(a,b){f.isString(a)&&f.isFunction(b)&&(d.plugin_[a]=b)};return d}}();var u=Math.sin,E=Math.cos,U=Math.atan,V=Math.sqrt,F=Math.abs,l=Math.PI,n=2*l,G=Math.ceil,s=Math.round,v=Math.floor,H=Math.max,I=Math.min,m=parseFloat,t={},w={},J=function(a,b){if(0==a)return a;var c=F(a),e=0.1;if(1<c){for(;1<c;)c/=10,e*=10;return v(a/e+b)*e}for(e=1;1>c;)c*=10,e*=10;return s(a*e+b)/e},K={white:"rgb(255,255,255)",green:"rgb(0,128,0)",gray:"rgb(80,80,80)",red:"rgb(255,0,0)",blue:"rgb(0,0,255)",yellow:"rgb(255,255,0)",black:"rgb(0,0,0)"},L=function(a){var b=/rgb\((\w*),(\w*),(\w*)\)/.exec(a);if(b)return[b[1],b[2],b[3]];if(b=/rgba\((\w*),(\w*),(\w*),(.*)\)/.exec(a))return[b[1],b[2],b[3],b[4]];throw Error("invalid colors value '"+a+"'");},x=function(a){if(!a)return a;a=a.replace(/\s/g,"").toLowerCase();if(/^rgb\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3}\)$/.exec(a)||/^rgba\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},(0(\.[0-9])?|1(\.0)?)\)$/.exec(a))return a;if(/^#(([a-fA-F0-9]{6,7})|([a-fA-F0-9]{3}))$/.exec(a))return a=a.replace(/#/g,"").replace(/^(\w)(\w)(\w)$/,"$1$1$2$2$3$3"),(7==a.length?"rgba(":"rgb(")+parseInt(a.substring(0,2),16)+","+parseInt(a.substring(2,4),16)+","+parseInt(a.substring(4,6),16)+(7==a.length?",0."+a.substring(6,7)+")":")");if(K[a])return K[a];throw Error("invalid colors value '"+a+"'");},M=function(a,b){b=b||0.14;return 0.5<a?b-(1-a)/10:0.1<a?b-0.16+a/5:a>b?b:a/2},N=function(a,b,c,e){if(!b)return b;var b=L(x(b)),d;d=b;var g=void 0,h=void 0;f.isArray(d)&&(g=d[1],h=d[2],d=d[0]);d/=255;var g=g/255,h=h/255,j=H(H(d,g),h),k=I(I(d,g),h),k=j-k;if(0==k)d=[0,0,j];else{var i;d==j?i=(g-h)/k:g==j?i=(h-d)/k+2:h==j&&(i=(d-g)/k+4);i*=60;0>i&&(i+=360);d=[i,k/j,j]}d[1]-=0!=e?e||0.05:e;a?(d[2]-=M(d[2],c),d[1]=f.upTo(d[1],1),d[2]=f.lowTo(d[2],0)):(d[2]+=M(1-d[2],c),d[1]=f.lowTo(d[1],0),d[2]=f.upTo(d[2],1));e=b[3];a=b=void 0;f.isArray(d)&&(a=e,e=d[1],b=d[2],d=d[0]);var l,m,n,c=v(d/60)%6,h=d/60-c;d=b*(1-e);g=b*(1-e*h);e=b*(1-e*(1-h));switch(c){case 0:l=b;m=e;n=d;break;case 1:l=g;m=b;n=d;break;case 2:l=d;m=b;n=e;break;case 3:l=d;m=g;n=b;break;case 4:l=e;m=d;n=b;break;case 5:l=b,m=d,n=g}return"rgb"+(a?"a":"")+"("+s(255*l)+","+s(255*m)+","+s(255*n)+(a?","+a+")":")")};f.apply(f,{getFont:function(a,b,c,e){return a+" "+b+(e||"px")+" "+c},getDoc:function(){return g.contentWindow?g.contentWindow.document:g.contentDocument?g.contentDocument:g.document},DefineAbstract:function(a,b){if(!b[a])throw Error("Cannot instantiate the type '"+b.type+"'.you must implements it with method '"+a+"'.");},getAA:function(a){return"linear"==a?D:"easeInOut"==a||"easeIn"==a||"easeOut"==a?S[a]:D},noConflict:function(){return y},plugin:function(a,b,c){f.isFunction(a)&&a.plugin(b,c)},parsePadding:function(a,b){a=a||0;if(f.isNumber(a))return[a,a,a,a];if(f.isArray(a))return a;b=b||0;a=a.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g,/\s/).replace(/\s/g,",").split(",");1==a.length?a[0]=a[1]=a[2]=a[3]=m(a[0])||b:2==a.length?(a[0]=a[2]=m(a[0])||b,a[1]=a[3]=m(a[1])||b):3==a.length?(a[0]=m(a[0])||b,a[1]=a[3]=m(a[1])||b,a[2]=m(a[2])||b):(a[0]=m(a[0])||b,a[1]=m(a[1])||b,a[2]=m(a[2])||b,a[3]=m(a[3])||b);return a},distanceP2P:function(a,b,c,e){return V((c-a)*(c-a)+(e-b)*(e-b))},atan2Radian:function(a,b,c,e){if(a==c)return e>b?l/2:3*l/2;if(b==e)return c>a?0:l;var d=f.quadrant(a,b,c,e),a=U(F((b-e)/(a-c)));return d?(3==d?n:l)+(2==d?a:-a):a},angle2Radian:function(a){return a*l/180},radian2Angle:function(a){return 180*a/l},quadrant:function(a,b,c,e){return a<c?b<e?0:3:b<e?1:2},toPI2:function(a){for(;0>a;)a+=n;return a},visible:function(a,b,c){if(a>=b)return[];var e=f.quadrantd(a),d=f.quadrantd(b);if((2==e||3==e)&&(2==d||3==d)&&b-a<l)return[];a=f.toPI2(a);b=f.toPI2(b);b<=a&&(b+=n);if(a>l)a=n;else{if(b>n)return[{s:a,e:l,f:c},{s:n,e:b,f:c}];b>l&&(b=l)}return{s:a,e:b,f:c}},quadrantd:function(a){if(0==a)return 0;if(0==a%n)return 3;for(;0>a;)a+=n;return G(2*(a%n)/l)-1},upTo:function(a,b){return b>a?a:b},lowTo:function(a,b){return b<a?a:b},between:function(a,b,c){return a>b?f.between(b,a,c):c>b?b:c<a?a:c},inRange:function(a,b,c){return b>c&&a<c},angleInRange:function(a,b,c){c-=a;c=0>c?c+n:c;c%=n;return b-a>c},angleZInRange:function(a,b,c){return b<a?c>a||c<b:b>c&&a<c},inRangeClosed:function(a,b,c){return b>=c&&a<=c},inEllipse:function(a,b,c,e){return 1>=a*a/c/c+b*b/e/e},p2Point:function(a,b,c,e){return{x:a+E(c)*e,y:b+u(c)*e}},toRgb:x,toRgba:function(a,b){var c=L(x(a));return"rgba("+c[0]+","+c[1]+","+c[2]+","+b+")"},vectorP2P:function(a,b,c){c||(b=f.angle2Radian(b),a=f.angle2Radian(a));b=u(b);return{x:b*u(a),y:b*E(a)}},uid:function(a){return(a||"ichartjs")+"_"+G(1E4*Math.random())+(new Date).getTime().toString().substring(4)},register:function(a){if(f.isString(a))w[a.toLowerCase()]=a;else{var b=a.get("id");if(!b||""==b){for(b=f.uid(a.type);t[b];)b=f.uid(a.type);a.push("id",b)}if(t[b])throw Error("exist reduplicate id :"+b);a.id=b;t[b]=a}},create:function(a){if(!a.type||!w[a.type])throw Error("TypeNotFoundException["+a.type+"]");return new f[w[a.type]](a)},get:function(a){return t[a]},isPercent:function(a){return f.isString(a)&&a.match(/(.*)%/)},parsePercent:function(a,b){f.isString(a)&&(a=a.match(/(.*)%/))&&(a=b?v(m(a[1])*b/100):a[1]/100);return!a||0>=a||a>b?b:a},parseFloat:function(a,b){if(!f.isNumber(a)&&(a=m(a),!f.isNumber(a)))throw Error("["+b+"]="+a+"is not a valid number.");return a},ceil:function(a){return J(a,1)},floor:function(a){return J(a,-1)},_2D:"2d",_3D:"3d",light:function(a,b,c){return N(!1,a,b,c)},dark:function(a,b,c){return N(!0,a,b,c)},fixPixel:function(a){return f.isNumber(a)?a:m(a.replace("px",""))||0},toPixel:function(a){return f.isNumber(a)?a+"px":f.fixPixel(a)+"px"},emptyFn:function(){return!0},supportCanvas:Q,isOpera:z,isWebKit:B,isChrome:A,isSafari:O,isIE:P,isGecko:R,isMobile:C,touch:"ontouchend"in document,FRAME:C?30:60});f.Assert={isTrue:function(a,b){if(!0!==a)throw Error(b);}};f.requestAnimFrame=function(){var a=g.requestAnimationFrame||g.webkitRequestAnimationFrame||g.mozRequestAnimationFrame||g.oRequestAnimationFrame||g.msRequestAnimationFrame||function(a){g.setTimeout(a,1E3/60)};return function(b){a(b)}}();f.Event={addEvent:function(a,b,c,e){a.addEventListener?a.addEventListener(b,c,e):a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c},fix:function(a){"undefined"==typeof a&&(a=g.event);var b={target:a.target,pageX:a.pageX,pageY:a.pageY,offsetX:a.offsetX,offsetY:a.offsetY,stopPropagation:!1,event:a};if("undefined"==typeof a.offsetX){a.target||(b.target=a.srcElement||document);a.targetTouches&&(b.pageX=a.targetTouches[0].pageX,b.pageY=a.targetTouches[0].pageY);if(null==b.pageX&&null!=a.clientX){var c=document.documentElement,e=document.body;b.pageX=a.clientX+(c&&c.scrollLeft||e&&e.scrollLeft||0)-(c&&c.clientLeft||e&&e.clientLeft||0);b.pageY=a.clientY+(c&&c.scrollTop||e&&e.scrollTop||0)-(c&&c.clientTop||e&&e.clientTop||0)}for(var e=c=0,d=a.target;d!=document.body&&d;)c+=d.offsetLeft-(d.scrollLeft||0),e+=d.offsetTop,d=d.offsetParent;b.offsetX=b.pageX-c;b.offsetY=b.pageY-e}b.x=b.offsetX;b.y=b.offsetY;a.stopPropagation||(a.stopPropagation=function(){g.event.cancelBubble=true});return b}};return f}(p);Array.prototype.each=function(g,h){for(var i=this.length,j,k=0;k<i&&!(j=h?g.call(h,this[k],k):g(this[k],k),"boolean"===typeof j&&!j);k++);return this};Array.prototype.eachAll=function(g,h){this.each(function(i,j){return y.isArray(i)?i.eachAll(g,h):h?g.call(h,i,j):g(i,j)},h)};Array.prototype.sor=function(g){for(var h=this.length-1,i,j=0;j<h;j++)for(var k=h;k>j;k--)if(g?!g(this[k],this[k-1]):this[k]<this[k-1])i=this[k],this[k]=this[k-1],this[k-1]=i};p.iChart=y;p.$||(p.$=p.iChart)})(window);