if(!_.heatmap_part){_.heatmap_part=1;(function($){var yN=function(a){$.xA.call(this,a)},zN=function(a,b,c){if(c){var d=b==$.Zl?"normal":b==$.po?"hover":"select";b=a.o(d+"X");var e=a.o(d+"Y"),f=a.o(d+"Width");a=a.o(d+"Height");a=new $.J(b,e,f,a);c.rect.uf(a);c.hatchRect.uf(a)}},AN=function(a,b,c,d,e){$.gB.call(this,a,b,c,d,e);$.Cu(this.Sa().labels(),"same");this.Sa().labels().ib(this);this.b=$.Vl("stroke",2,!0);this.ca.Hn("stroke",[1024,65,4294967295])},BN=function(a,b,c,d,e){if(a=$.ZA(a,[a.Sa().labels,a.mb().labels,a.selected().labels],[],["label",
"hoverLabel","selectLabel"],a.DD(),!0,null,b,c,!1))if(c=$.Iu(a),c.adjustByHeight||c.adjustByHeight){var f=b.o(d+"Width");b=b.o(d+"Height");d=(new $.tu).K(c.padding);f-=d.i("left")+d.i("right");b-=d.i("top")+d.i("bottom");$.qd(d);b=$.Vu(a,f,b,c.minFontSize,c.maxFontSize,c.adjustByWidth,c.adjustByHeight);e=Math.min(e||window.Infinity,b)}return e},CN=function(a,b){$.BB.call(this,!1);this.Fa("heatMap");this.je="heat-map";this.pa("defaultSeriesType","heat-map");this.Oa=this.te(this.i("defaultSeriesType"),
a||null,b);$.T(this.ua,[["labelsDisplayMode",32768,1,0,function(){this.Oa.B(256)}]])},DN=function(a,b){var c={},d=0,e=a.values(),f=[];if(e)for(var h=0;h<e.length;h++){var k=e[h],l=a.transform(k,0),m=a.transform(k,1);if(!b||1>=Math.min(l,m)&&0<=Math.max(l,m))c[$.ko(k)]=d++,f.push(String(k))}return{values:c,names:f}},EN=function(a,b,c){if($.ea(b))var d=c[b];else $.z(b)?(d=$.Rs(b,null))||(d=c[b]):$.D(b)?(d=$.Rs(b.type,null))&&d.K(b):d=null;d&&a.sd(d)},FN=function(a,b){var c=new CN(a,b);EN(c,c.mf("colorScale"),
c.Et());c.Kg();c.ld();return c};$.H(yN,$.xA);$.sG[30]=yN;$.g=yN.prototype;$.g.type=30;$.g.flags=512;$.g.sp=["y"];$.g.vh={rect:"rect",hatchRect:"rect"};$.g.fg=function(a,b){var c=this.Wc.Xc(b);zN(a,b,c)};$.g.mB=function(a,b){var c=a.o("shapes");zN(a,b,c)};$.H(AN,$.gB);$.g=AN.prototype;$.g.sP=1.3E-5;$.g.FE={"%XValue":"x"};$.g.Xa=function(a){var b=this.Aa.Xa(a);return $.n(a)?this:b};
$.g.MP=function(){var a=this.Sa().labels(),b=this.mb().labels(),c=this.selected().labels(),d=a.enabled(),e=d||b.enabled(),f=d||c.enabled(),h=a.AB();e=(h||b.AB())&&e;f=(h||c.AB())&&f;h=d&&h;var k,l;d=k=l=window.NaN;$.kN(a,null);$.kN(b,null);$.kN(c,null);if(h||e||f){var m=this.aa();for(m.reset();m.advance();)m.o("missing")||(h&&(d=BN(this,m,$.Zl,"normal",d)),e&&(k=BN(this,m,$.po,"hover",k)),f&&(l=BN(this,m,$.qo,"select",l)))}h?$.kN(a,d):$.kN(a,null);e?$.kN(b,k):$.kN(b,null);f?$.kN(c,l):$.kN(c,null)};
$.g.mfa=function(a,b,c,d){b=a.o("left");var e=a.o("right");c=a.o("top");var f=a.o("bottom"),h=this.b(this,$.Zl),k=this.b(this,$.po),l=this.b(this,$.qo);h=$.bc(h)/2;k=$.bc(k)/2;l=$.bc(l)/2;e-=b;f-=c;a.o("normalX",b+h);a.o("normalY",c+h);a.o("normalWidth",e-h-h);a.o("normalHeight",f-h-h);a.o("hoverX",b+k);a.o("hoverY",c+k);a.o("hoverWidth",e-k-k);a.o("hoverHeight",f-k-k);a.o("selectX",b+l);a.o("selectY",c+l);a.o("selectWidth",e-l-l);a.o("selectHeight",f-l-l);return d};
$.g.iD=function(a){var b=this.cl(),c=this.bb(),d=a.get("x"),e=a.get("y"),f=b.transform(d,0),h=b.transform(d,1),k=c.transform(e,0);c=c.transform(e,1);if(0>f&&0>h||0>k&&0>c||1<f&&1<h||1<k&&1<c)return!1;var l=Math.round(this.Ie(f,!0)),m=Math.round(this.Ie(k,!1)),p=Math.round(this.Ie(h,!0)),q=Math.round(this.Ie(c,!1));k=this.g/2;f=this.f/2;e=Math.min(l,p);l=Math.max(l,p);p=Math.min(m,q);m=Math.max(m,q);e+=Math.ceil(k);p+=Math.floor(f);l-=1==h?Math.ceil(k):Math.floor(k);m-=1==c?Math.floor(f):Math.ceil(f);
a.o("left",e);a.o("top",p);a.o("right",l);a.o("bottom",m);a.o("x",b.transform(d,.5));return!0};$.g.hI=function(a,b){this.Fj.length=0;this.Fj.push(this.mfa);var c=this.aa();for(c.reset();c.advance();)this.qA(c,a,b);this.Fj.length=0};$.g.EF=function(a){var b=this.aa(),c=b.o("left"),d=b.o("top"),e=b.o("right");b=b.o("bottom");a=$.xo(new $.J(c,d,e-c,b-d),a);a.x=Math.floor(a.x);a.y=Math.floor(a.y);return a};
$.g.yf=function(a,b,c){var d=this.Aa.i("labelsDisplayMode"),e=$.ZA(this,[this.Sa().labels,this.mb().labels,this.selected().labels],[],["label","hoverLabel","selectLabel"],this.DD(),!0,null,a,b,!1);if(e){var f=b==$.Zl?"normal":b==$.po?"hover":"select";b=a.o(f+"X");var h=a.o(f+"Y"),k=a.o(f+"Width");f=a.o(f+"Height");h=$.gn(b,h,k,f);b=this.Sa().labels();"drop"==d&&(k=$.Iu(e),k.width=null,k.height=null,k=b.measure(e.lf(),e.uc(),k),h.left>k.left+.5||h.$a()<k.$a()-.5||h.top>k.top+.5||h.Ua()<k.Ua()-.5)&&
(b.clear(e.la()),e=null);e&&((d="always-show"==d?this.ea:$.pb(this.ea,h))?(e.clip(d),c&&e.$()):b.clear(e.la()))}a.o("label",e)};$.g.BW=function(a,b,c,d,e,f,h){$.Qu(a,$.ho([h,0,f,$.co,d,0,c,$.co,a,$.co,f||c,$.fo,f,$.eo,a,$.fo,c,$.eo]))};$.g.GD=function(){var a=this.mc();a=$.Ga(a.Lg,a.Mg);for(var b=0,c=0,d=0,e=a.length;d<e;d++){var f=a[d];if(f&&f.enabled()){var h=$.bc(f.i("stroke"));f.Hb()?h>c&&(c=h):h>b&&(b=h)}}this.g=b;this.f=c;AN.u.GD.call(this)};
$.g.wZ=function(a){var b=this.ea,c=b.Ua()-this.wp().bottom();b=b.bc()+this.wp().top();return $.Za(a,b,c)};$.g.sR=function(){return[this,this.mc()]};$.g.NS=function(){return{}};
$.g.Em=function(a,b){var c={chart:{value:this.mc(),type:""},series:{value:this,type:""},scale:{value:this.Va(),type:""},index:{value:b.la(),type:"number"},x:{value:b.get("x"),type:"string"},y:{value:b.get("y"),type:"string"},heat:{value:b.get("heat"),type:"number"},seriesName:{value:this.name(),type:"string"}},d=this.mc().sd();if(d){var e=b.get("heat");if($.K(d,$.Uy)){var f=d.pn(e);f&&(c.colorRange={value:{color:f.color,end:f.end,name:f.name,start:f.start,index:f.sourceIndex},type:""});c.color={value:d.yq(e),
type:""}}}return c};$.g.Ae=function(a,b,c){b=AN.u.Ae.call(this,a,b,c);c=$.$u(b);var d=b.Ag();c.x={value:d.get("x"),type:"string"};c.y={value:d.get("y"),type:"string"};c.heat={value:d.get("heat"),type:"number"};var e;a=a||this.i("color")||"blue";var f=this.mc().sd();f&&(d=d.get("heat"),$.n(d)&&(e=f.yq(d)),c.scaledColor={value:e,type:""});c.colorScale={value:f,type:""};c.sourceColor={value:e||a,type:""};return $.av(b,c)};var GN=AN.prototype;GN.tooltip=GN.Xa;$.H(CN,$.BB);CN.prototype.sa=$.BB.prototype.sa|-2147483648;var HN={};HN["heat-map"]={Ab:30,Fb:2,Jb:[{name:"rect",Mb:"rect",Sb:"fill",Tb:"stroke",Vb:!0,Bb:!1,zIndex:0},{name:"hatchRect",Mb:"rect",Sb:"hatchFill",Tb:null,Vb:!0,Bb:!0,zIndex:1E-6}],Ib:null,Cb:null,zb:$.tG|5767168,yb:"y",wb:"y"};CN.prototype.Oi=HN;var IN=["normal","hovered","selected"],JN=["data","tooltip"];
(function(){function a(a,b){for(var c=[],d=1;d<arguments.length;d++)c.push(arguments[d]);d=this.Nh(0);d=d[a].apply(d,c);return $.n(c[0])?this:d}for(var b=0;b<IN.length;b++){var c=IN[b];CN.prototype[c]=$.qa(a,c)}})();$.xq(CN,["fill","stroke","hatchFill","labels","markers"],"normal");var KN={};$.gq(KN,0,"labelsDisplayMode",$.mN);$.U(CN,KN);$.g=CN.prototype;$.g.zs=function(){return"heat-map"};$.g.tv=function(a){return this.Mj()?null:CN.u.tv.call(this,a)};
$.g.kt=function(a,b){return new AN(this,this,a,b,!0)};$.g.Zz=function(){return $.Ps};$.g.RC=function(){return["HeatMap chart scale","ordinal"]};$.g.FG=function(){return"ordinal"};$.g.Yt=function(){this.Oa.B(1024);this.B(8421376,1)};$.g.sd=function(a){if($.n(a)){if(null===a&&this.Kb)this.Kb=null,this.B(-2147483136,1);else if(a=$.Xs(this.Kb,a,null,48,["HeatMap chart color scale","ordinal-color, linear-color"],this.Cp,this)){var b=this.Kb==a;this.Kb=a;this.Kb.da(b);b||this.B(-2147483136,1)}return this}return this.Kb};
$.g.Cp=function(a){$.X(a,6)&&this.B(-2147483136,1)};$.g.bm=function(a){var b,c=[];if("categories"==a){this.ob();var d=this.sd();if(d&&$.K(d,$.Uy)){var e=this.Oa,f=d.Xq();a=0;for(b=f.length;a<b;a++){var h=f[a];"default"!==h.name&&c.push({text:h.name,iconEnabled:!0,iconType:"square",iconFill:h.color,disabled:!this.enabled(),sourceUid:$.oa(this),sourceKey:a,meta:{W:e,scale:d,qe:h}})}}}return c};$.g.ts=function(a){return"categories"==a};
$.g.er=function(a,b){var c=a.o();if("categories"==this.Gf().i("itemsSourceMode")){var d=c.W;var e=c.scale;if(e&&d){var f=[];c=c.qe;for(var h=d.vc();h.advance();){var k=h.get("heat");c==e.pn(k)&&f.push(h.la())}if(e=$.mo(b.domTarget))"single"==this.Vc().i("hoverMode")?e.Jf={W:d,md:f}:e.Jf=[{W:d,md:f,xn:f[f.length-1],we:{index:f[f.length-1],Yf:0}}]}}};
$.g.bq=function(a,b){var c=a.o();if("categories"==this.Gf().i("itemsSourceMode")){var d=c.W;var e=c.scale;if(e&&d){var f=c.qe,h=d.vc();for(c=[];h.advance();){var k=h.get("heat");f==e.pn(k)&&c.push(h.la())}if(e=$.mo(b.domTarget))"single"==this.Vc().i("hoverMode")?e.Jf={W:d,md:c}:e.Jf=[{W:d,md:c,xn:c[c.length-1],we:{index:c[c.length-1],Yf:0}}]}}};$.g.aq=function(a,b){var c=a.o();if("categories"==this.Gf().i("itemsSourceMode")&&"single"==this.Vc().i("hoverMode")){var d=$.mo(b.domTarget);d&&(d.W=c.W)}};
$.g.CF=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++){var f=a[d],h;f.we?h={index:f.we.index,distance:f.we.Yf}:h={index:window.NaN,distance:window.NaN};c.push({series:f.W,points:b?[]:f.md?$.Ha(f.md):[],nearestPointToCursor:h})}return c};$.g.oD=function(a,b,c){a=CN.u.oD.call(this,a,b,c);a.series=this;return a};$.g.Rd=function(a){return this.Oa.Rd(a)};$.g.uu=function(){return!0};$.g.xk=function(){return this.Oa.xk()};
$.g.UQ=function(){var a=this.J(327680);CN.u.UQ.call(this);if(a){var b=null,c=null,d=this.bb(),e=this.Va(),f=$.Ft(e),h=$.Ft(d);if(f||h){if(f){var k=f;b=[]}if(h){var l=h;c=[]}for(var m=this.Oa.vc();m.advance();){if(f){a=e.Mx(m.get("x"));var p=m.get(k);$.n(b[a])||(b[a]=p||m.get("x")||m.get("heat"))}h&&(a=d.Mx(m.get("y")),p=m.get(l),$.n(c[a])||(c[a]=p||m.get("y")||m.get("heat")))}f&&(e.uk=b);h&&(d.uk=c)}this.B(-2147483648)}if(this.J(-2147483648)){if(this.Kb&&this.Kb.Hf()){this.Kb.tg();m=this.Oa.aa();
for(m.reset();m.advance();)this.Kb.Uc(m.get("heat"));this.Kb.Cg()}this.Oa&&this.Oa.B(2048);this.B(32768);this.I(-2147483648)}};$.g.data=function(a,b){if($.n(a)){if(a){var c=a.title||a.caption;c&&this.title(c);a.rows&&(a=a.rows)}this.Oa.data(a,b);return this}return this.Oa.data()};$.g.Oj=function(a){this.Oa.Oj(a);return this};$.g.select=function(a){this.Oa.select(a);return this};
$.g.FL=function(a){this.ob();var b="selected"==a,c=DN(this.Va(),b);a=c.values;var d=c.names;c=DN(this.bb(),b);b=c.values;var e=c.names;c=[];for(var f=0;f<e.length;f++)c.push([e[f]]);for(e=this.Oa.Qf();e.advance();){f=a[$.ko(e.get("x"))];var h=b[$.ko(e.get("y"))],k=String(e.get("heat"));(0,window.isNaN)(f)||(0,window.isNaN)(h)||(c[h][f+1]=k)}d.unshift("#");return{headers:d,data:c}};
$.g.F=function(){var a=CN.u.F.call(this),b=a.chart;delete b.barsPadding;delete b.barGroupsPadding;delete b.crosshair;delete b.defaultSeriesType;return a};$.g.Ns=function(a,b,c){EN(this,a.colorScale,b);CN.u.Ns.call(this,a,b,c);$.zq(this,KN,a)};$.g.Ms=function(a,b,c){CN.u.Ms.call(this,a,b,c);$.Hq(this,KN,a);$.Qz(a,"colorScale",this.sd(),b,c)};
$.g.fO=function(a,b,c){b={};var d=IN,e;for(e=0;e<d.length;e++){var f=d[e];$.n(a[f])&&(b[f]=a[f])}d=JN;for(e=0;e<d.length;e++)f=d[e],$.n(a[f])&&(b[f]=a[f]);this.Oa.X(b,c)};$.g.aO=function(a){var b=this.Oa.F(),c=IN,d;for(d=0;d<c.length;d++){var e=c[d];$.n(b[e])&&(a[e]=b[e])}c=JN;for(d=0;d<c.length;d++)e=c[d],$.n(b[e])&&(a[e]=b[e])};$.g.R=function(){CN.u.R.call(this);this.Oa=null};var LN=CN.prototype;LN.getType=LN.Na;LN.xGrid=LN.Zm;LN.yGrid=LN.$m;LN.xAxis=LN.lh;LN.yAxis=LN.ti;LN.xScale=LN.Va;
LN.yScale=LN.bb;LN.hover=LN.Oj;LN.select=LN.select;LN.unhover=LN.Pd;LN.unselect=LN.ae;LN.data=LN.data;LN.colorScale=LN.sd;LN.xZoom=LN.Aq;LN.yZoom=LN.Bq;LN.xScroller=LN.rp;LN.yScroller=LN.Br;LN.annotations=LN.tk;$.Jp["heat-map"]=FN;$.F("anychart.heatMap",FN);}).call(this,$)}
