if(!_.surface){_.surface=1;(function($){var Q5=function(){$.ex.call(this);this.o=[];this.G=[]},Cia=function(a,b,c){var d=a.o.slice(),e=a.G.slice(),f=a.i("length"),h=a.i("stroke"),k=$.Tn(h),l=d[0]*(1-b)+b*e[0];b=d[1]*(1-b)+b*e[1]+c/2;b=$.O(b,1)-.5;l=$.O(l,k);a.path.moveTo(l,b);a.path.lineTo(l,b+f);a.path.stroke(h)},R5=function(a,b){a*=Math.PI/180;b*=Math.PI/180;var c=Math.sin(a),d=Math.cos(a),e=Math.sin(b),f=Math.cos(b);return[d*f,-c*f,e,c,d,0,-e*d,c*e,f]},S5=function(a,b){return[b[0]*a[0]+b[1]*a[1]+b[2]*a[2],b[0]*a[3]+b[1]*a[4]+b[2]*a[5],
b[0]*a[6]+b[1]*a[7]+b[2]*a[8]]},T5=function(a,b){var c=S5(R5(0,a),[-1,0,0]),d=c[0],e=c[1];c=c[2];for(var f=d*d+e*e+c*c,h=0,k=0;k<b.length;k++){var l=b[k];h+=Math.abs(d*l[0]+e*l[1]+c*l[2]-f)/Math.sqrt(f)}return h/=b.length},U5=function(a,b){a=a.slice();for(var c=0;c<a.length;c++){var d=a,e=c,f=a[c],h=b;f=f.slice();f[1]=h.left+f[1]*h.width/1.48+h.width/2;f[2]=h.top+f[2]*h.height/1.75+h.height/2;d[e]=f}return a},V5=function(){$.gx.call(this);this.U=[[-.5,-.5,.5],[-.5,.5,.5],[.5,.5,.5],[.5,-.5,.5]];this.b=
[]},W5=function(a){a.b=R5(a.N,a.g)},X5=function(a){W5(a);for(var b=[],c=[0,0,0],d=[0,0,0],e=0;e<a.U.length;e++){var f=a.U[e];b.push(S5(a.b,f));b[e][1]<d[1]&&(c=f,d=b[e])}return c},Y5=function(a){W5(a);for(var b=[],c=window.Infinity,d=0,e=0;e<a.U.length;e++){var f=T5(a.g,[S5(a.b,a.U[e])]);f<c&&(c=f,d=e);b.push(f)}return a.U[d]},Z5=function(a,b,c,d){b=S5(a.b,b);c=S5(a.b,c);a.o=b.slice();a.G=c.slice();var e=U5([b,c],d),f=e[0][1],h=e[0][2];d=e[1][1];e=e[1][2];b=a.zIndex()+2-T5(a.g,[b,c]);c=a.aE();c.clear();
c.moveTo(f,h).lineTo(d,e);c=a.Pa();a=a.ob();$.jq(c,a);var k=[f,h],l=[d,e];$.p(k)&&$.p(l)&&(c.o=k,c.G=l,c.ua(1));c.zIndex(b);f=[f,h];d=[d,e];$.p(f)&&$.p(d)&&(a.o=f,a.G=d,a.ua(1));a.zIndex(b);$.kq(c,a)},$5=function(){$.yx.call(this);this.G=null;this.P={uV:[],XQ:[]};this.ba=!1},a6=function(a){if(0==a.P.XQ.length){var b=$.aj();b.parent(a.O()).zIndex(a.zIndex());b.stroke("none");a.P.uV.push(b);return b}b=a.P.XQ.pop();a.P.uV.push(b);b.parent(a.O());return b},Dia=function(a,b){return $.p(b)?(a.ba=!!b,a):
a.ba},b6=function(a){a.G=a.G?a.G:$.aj();return a.G},Eia=function(a,b){var c=a.fa(),d=R5(a.N,a.g),e=[];e[0]=S5(d,b[0]);e[1]=S5(d,b[1]);if(T5(a.g,[e[0]])>T5(a.g,[e[1]])){var f=b[1];b[1]=b[0];b[0]=f;f=e[1];e[1]=e[0];e[0]=f}b[2]=[b[1][0],b[1][1],-.5];e[2]=S5(d,b[2]);c=U5(e,c);a.o.moveTo(c[0][1],c[0][2]);a.o.lineTo(c[1][1],c[1][2]);a.G.moveTo(c[1][1],c[1][2]);a.G.lineTo(c[2][1],c[2][2])},c6=function(a,b){function c(){var a=this.i("rotationZ"),b=this.i("rotationY"),c=$.hq(this,"xGrid"),h=$.hq(this,"yGrid"),
k=$.hq(this,"zGrid"),l=$.hq(this,"xAxis"),m=$.hq(this,"yAxis"),n=$.hq(this,"zAxis");$.jq(l,m,n,c,h,k);c&&c.Vp(a).Tp(b);h&&h.Vp(a).Tp(b);k&&k.Vp(a).Tp(b);n&&n.Vp(a).Tp(b);l&&l.Vp(a).Tp(b);m&&m.Vp(a).Tp(b);$.lq(l,m,n,c,h,k)}$.Wv.call(this);this.Ia("surface");this.Uq=["z","value"];this.wV=[];this.iy=[];this.uN=[];this.Ka=[];this.Ly=[];this.data(a||null,b);$.R(this.xa,[["rotationZ",10485776,1,null,c],["rotationY",10485776,1,null,c],["box",16,1],["stroke",16,1]])},d6=function(a,b){var c=a.Wa().transform(b[0])-
.5,d=a.bb().transform(b[1])-.5,e=1-a.vw().transform(b[2])-.5;return[c,d,e]},e6=function(a,b){for(var c=0,d=0;d<b.length;d++){var e=a.w$,f=b[d],h=e[0],k=e[1];e=e[2];var l=h*h+k*k+e*e;c+=Math.abs(h*f[0]+k*f[1]+e*f[2]-l)/Math.sqrt(l)}c/=b.length;return 2-c},Fia=function(a){for(var b=0,c=0,d=0,e=0,f=-window.Infinity,h=0,k=window.Infinity,l=0,m=0;m<a.length;m++){a[m][1]<b&&(b=a[m][1],c=m);a[m][1]>d&&(d=a[m][1],e=m);var n=a[m][0];f<n&&(f=a[m][0],h=m);k>n&&(k=a[m][0],l=m)}return{left:a[c],right:a[e],Yla:a[h],
h0:a[l]}},f6=function(a,b,c,d){var e=$.oa(b.scale());$.ya(a,e)||(d[c].scale=b.scale().F())},g6=function(a,b,c){c in b&&(a[c](b[c]),"scale"in b[c]&&a[c]().scale(b[c].scale))},Gia=function(a,b){var c=new c6(a,b);c.pd(c.ef("colorScale"));return c};$.H(Q5,$.ex);$.g=Q5.prototype;$.g.ra=$.ex.prototype.ra;$.g.qa=$.ex.prototype.qa|16;
$.g.xQ=function(a,b,c,d){b=this.i("length");c=this.o.slice();var e=this.o[1],f=this.G[1],h=Math.abs(e-f);c[1]=Math.min(e,f)+h-h*a;a=this.i("stroke");e=$.Tn(a);d=c[0]-d/2;d=$.O(d,1)+.5;c=c[1];c=$.O(c,e);this.path.moveTo(d,c);this.path.lineTo(d-b,c);this.path.stroke(a)};$.g.uQ=function(a,b,c,d){Cia(this,a,d)};$.g.zQ=function(a,b,c,d){Cia(this,a,d)};$.H(V5,$.gx);$.g=V5.prototype;$.g.ra=$.gx.prototype.ra;$.g.qa=$.gx.prototype.qa;$.g.IY=function(){var a=$.hq(this,"title");if(a){var b=this.aE().kb().clone(),c=this.fa();switch(this.i("orientation")){case "left":$.yu(a,"left");break;case "bottom":$.yu(a,"bottom");b.height=c.Ra()-b.top;break;case "right":$.yu(a,"bottom"),b.height=c.Ra()-b.top}a.fa(b);a.X()}};$.g.ZD=function(a){W5(this);var b=X5(this);Z5(this,b,[b[0],b[1],-.5],a)};
$.g.$D=function(a){W5(this);var b=Y5(this),c=[-.5==b[0]?.5:-.5,b[1],b[2]];if(-.5==c[0]){var d=c;c=b;b=d}Z5(this,b,c,a)};$.g.YD=function(a){W5(this);var b=Y5(this),c=[b[0],-.5==b[1]?.5:-.5,b[2]];if(-.5==c[1]){var d=c;c=b;b=d}Z5(this,b,c,a)};$.g.xO=function(){V5.B.xO.call(this);var a=this.zIndex()+2-T5(this.g,[this.o,this.G]);this.line.zIndex(a);this.Pa().zIndex(a);this.ob().zIndex(a)};
$.g.qp=function(){var a=this.i("orientation");if("left"==a)var b=this.ZD;else"right"==a?b=this.$D:"bottom"==a&&(b=this.YD);b.call(this,this.fa(),0,1,0,0);this.line.stroke(this.i("stroke"))};
$.g.zZ=function(a,b,c,d,e,f,h){e=this.fa();h=h?this.labels():this.jb();var k=0,l=0;c=this.zIndex();var m=this.i("orientation");f=Y5(this);switch(m){case "right":k=[-.5==f[0]?.5:-.5,f[1],f[2]];-.5==k[0]&&(c=f,f=k,k=c);f=S5(this.b,f);k=S5(this.b,k);c=this.zIndex()+(0>this.g?2:-2);l=U5([f,k],e);e=l[0][1];f=l[0][2];k=l[1][1];l=l[1][2];k=e*(1-a)+a*k;l=f*(1-a)+a*l+d+b.height/2;break;case "bottom":k=[f[0],-.5==f[1]?.5:-.5,f[2]];-.5==k[1]&&(c=f,f=k,k=c);f=S5(this.b,f);k=S5(this.b,k);c=1-a;l=[];l.push(a*k[0]+
c*f[0]);l.push(a*k[1]+c*f[1]);l.push(a*k[2]+c*f[2]);c=this.zIndex()+(0>this.g?2:-2);l=U5([f,k],e);e=l[0][1];f=l[0][2];k=l[1][1];l=l[1][2];k=e*(1-a)+a*k;l=f*(1-a)+a*l+d+b.height/2;break;case "left":f=X5(this),k=[f[0],f[1],-.5],f=S5(this.b,f),k=S5(this.b,k),c=this.zIndex()+2,l=U5([f,k],e),e=l[0][1],f=l[0][2],l=l[1][2],k=Math.abs(f-l),l=Math.min(f,l)+k-k*a,k=e-d-b.width/2}h.zIndex(c);return{x:k,y:l}};$.g.Tp=function(a){a=Number(a);$.p(a)&&this.g!=a&&(this.g=a,this.u(16|this.qe,9),this.Id())};
$.g.Vp=function(a){a=Number(a);return $.p(a)?(this.N!=a&&(this.N=a,this.u(16|this.qe,9),this.Id()),this):this.N};$.g.Gk=function(){return new Q5};
$.g.AZ=function(a,b,c,d){a=this.fa();var e=0,f=0;this.zIndex();var h=this.i("orientation");c=Y5(this);switch(h){case "right":e=[-.5==c[0]?.5:-.5,c[1],c[2]];-.5==e[0]&&(f=c,c=e,e=f);c=S5(this.b,c);e=S5(this.b,e);this.zIndex();f=U5([c,e],a);a=f[0][1];c=f[0][2];e=f[1][1];f=f[1][2];e=a*(1-b)+b*e;f=c*(1-b)+b*f+d;break;case "bottom":e=[c[0],-.5==c[1]?.5:-.5,c[2]];-.5==e[1]&&(f=c,c=e,e=f);c=S5(this.b,c);e=S5(this.b,e);f=1-b;h=[];h.push(b*e[0]+f*c[0]);h.push(b*e[1]+f*c[1]);h.push(b*e[2]+f*c[2]);this.zIndex();
f=U5([c,e],a);a=f[0][1];c=f[0][2];e=f[1][1];f=f[1][2];e=a*(1-b)+b*e;f=c*(1-b)+b*f+d;break;case "left":c=X5(this),e=[c[0],c[1],-.5],c=S5(this.b,c),e=S5(this.b,e),this.zIndex(),f=U5([c,e],a),a=f[0][1],c=f[0][2],f=f[1][2],e=Math.abs(c-f),f=Math.min(c,f)+e-e*b,e=a-d}return{x:e,y:f}};$.H($5,$.yx);$.g=$5.prototype;$.g.Oy=function(){$5.B.Oy.call(this);for(var a;a=this.P.uV.pop();)a.clear(),this.P.XQ.push(a)};$.g.oI=function(){$5.B.oI.call(this);b6(this).stroke(this.i("stroke"))};$.g.OI=function(){$5.B.OI.call(this);var a=this.O();b6(this).parent(a)};$.g.dB=function(){var a=this.zIndex()-1,b=0>=this.g?a+2:a;this.wh().zIndex(b);b6(this).zIndex(a);$.yc(this.D,function(a){a.zIndex(b)})};$.g.remove=function(){$5.B.remove.call(this);b6(this).parent(null)};
$.g.Jj=function(){b6(this).clear();$5.B.Jj.call(this)};
$.g.kF=function(a){a-=.5;if(this.ba){a=-a;var b=[[-.5,-.5,a],[-.5,.5,a],[.5,.5,a],[.5,-.5,a]];a=R5(this.N,this.g);for(var c=[],d=-window.Infinity,e=0,f=0;f<b.length;f++){c[f]=S5(a,b[f]);var h=T5(this.g,[c[f]]);h>d&&(d=h,e=f)}c=b[e];c=[[-c[0],c[1],c[2]],[c[0],c[1],c[2]],[c[0],-c[1],c[2]]];for(f=0;f<c.length;f++)c[f]=S5(a,c[f]);a=this.fa();a=U5(c,a);this.G.moveTo(a[0][1],a[0][2]);this.G.lineTo(a[1][1],a[1][2]);this.G.lineTo(a[2][1],a[2][2])}else a=[[a,-.5,.5],[a,.5,.5]],Eia(this,a)};
$.g.lF=function(a){a-=.5;Eia(this,[[-.5,a,.5],[.5,a,.5]])};
$.g.hF=function(a,b,c){if(Dia(this)){var d=a6(this),e=-(a-.5);a=-(b-.5);var f=[[-.5,-.5,e],[-.5,.5,e],[.5,.5,e],[.5,-.5,e]];e=R5(this.N,this.g);b=[];for(var h=-window.Infinity,k=0,l=0;l<f.length;l++){b[l]=S5(e,f[l]);var m=T5(this.g,[b[l]]);m>h&&(h=m,k=l)}l=f[k];b=[[-l[0],l[1],l[2]],[l[0],l[1],l[2]],[l[0],-l[1],l[2]]];a=[[-l[0],l[1],a],[l[0],l[1],a],[l[0],-l[1],a]];for(l=0;l<b.length;l++)b[l]=S5(e,b[l]),a[l]=S5(e,a[l]);e=this.fa();b=U5(b,e);a=U5(a,e);d.moveTo(b[0][1],b[0][2]);d.lineTo(b[1][1],b[1][2]);
d.lineTo(b[2][1],b[2][2]);d.lineTo(a[2][1],a[2][2]);d.lineTo(a[1][1],a[1][2]);d.lineTo(a[0][1],a[0][2]);d.close();d.fill(c.fill());d.zIndex(20)}else{d=R5(this.N,this.g);a-=.5;b-=.5;a=[[a,-.5,.5],[a,.5,.5]];a.push([b,.5,.5]);a.push([b,-.5,.5]);f=[];for(h=0;h<a.length;h++)f.push(S5(d,a[h]));e=this.fa();l=U5(f,e);c.moveTo(l[0][1],l[0][2]);c.lineTo(l[1][1],l[1][2]);c.lineTo(l[2][1],l[2][2]);c.lineTo(l[3][1],l[3][2]);c.close();l=a6(this);k=[];f[0][0]>f[1][0]?k.push(a[0]):k.push(a[1]);k.push([k[0][0],k[0][1],
-.5]);k.push([b,k[0][1],-.5]);k.push([b,k[0][1],.5]);b=[];for(h=0;h<a.length;h++)b.push(S5(d,k[h]));d=U5(b,e);l.moveTo(d[0][1],d[0][2]);l.lineTo(d[1][1],d[1][2]);l.lineTo(d[2][1],d[2][2]);l.lineTo(d[3][1],d[3][2]);l.close();l.fill(c.fill());l.zIndex(20)}};
$.g.iF=function(a,b,c){var d=R5(this.N,this.g);a-=.5;b-=.5;a=[[-.5,a,.5],[.5,a,.5]];a.push([.5,b,.5]);a.push([-.5,b,.5]);for(var e=[],f=0;f<a.length;f++)e.push(S5(d,a[f]));var h=this.fa(),k=U5(e,h);c.moveTo(k[0][1],k[0][2]);c.lineTo(k[1][1],k[1][2]);c.lineTo(k[2][1],k[2][2]);c.lineTo(k[3][1],k[3][2]);c.close();k=a6(this);k.clear();var l=[];e[0][0]>e[1][0]?l.push(a[0]):l.push(a[1]);l.push([l[0][0],l[0][1],-.5]);l.push([l[0][0],b,-.5]);l.push([l[0][0],b,.5]);b=[];for(f=0;f<a.length;f++)b.push(S5(d,
l[f]));d=U5(b,h);k.moveTo(d[0][1],d[0][2]);k.lineTo(d[1][1],d[1][2]);k.lineTo(d[2][1],d[2][2]);k.lineTo(d[3][1],d[3][2]);k.close();k.fill(c.fill());k.zIndex(20)};$.g.Vp=function(a){return $.p(a)?(this.N=+a,this.u(28,1),this):this.N};$.g.Tp=function(a){$.p(a)&&(this.g=+a,this.u(28,1))};$.g.R=function(){$.hd(this.G);this.G=null;$5.B.R.call(this)};$.H(c6,$.Wv);var h6=function(){var a={};$.ep(a,[[0,"rotationZ",$.mp],[0,"rotationY",function(a){a=Number(a);return $.Ya(a,-90,90)}],[1,"box",$.xp],[1,"stroke",$.xp]]);return a}();$.S(c6,h6);$.g=c6.prototype;$.g.ra=$.Wv.prototype.ra;$.g.qa=$.Wv.prototype.qa|10580496;$.g.EV=function(a){this.eu||(this.eu=new V5,$.L(this.eu,this.Un,this),this.eu.Vp(this.i("rotationZ")),this.eu.Tp(this.i("rotationY")),$.V(this,"zAxis",this.eu));return $.p(a)?(this.eu.K(a),this):this.eu};
$.g.ah=function(a){this.bc||(this.bc=new V5,$.L(this.bc,this.Un,this),this.bc.Vp(this.i("rotationZ")),this.bc.Tp(this.i("rotationY")),$.V(this,"xAxis",this.bc));return $.p(a)?(this.bc.K(a),this):this.bc};$.g.fi=function(a){this.Ej||(this.Ej=new V5,$.L(this.Ej,this.Un,this),this.Ej.Vp(this.i("rotationZ")),this.Ej.Tp(this.i("rotationY")),$.V(this,"yAxis",this.Ej));return $.p(a)?(this.Ej.K(a),this):this.Ej};$.g.Un=function(){this.u(2097152,1)};$.g.If=function(){return this.na.aa()};
$.g.wc=function(){return this.Md=this.na.aa()};$.g.aa=function(){return this.Md||(this.Md=this.na.aa())};$.g.ej=function(){return!this.na.aa().Eb()};$.g.data=function(a,b){return $.p(a)?(this.Vf!==a&&(this.Vf=a,this.na&&$.Xp(this.na,this.xd,this),$.hd(this.na),$.hd(this.ed),$.K(a,$.oq)?this.na=a.$i():this.na=$.K(a,$.yq)?a.Yd():(this.ed=new $.yq($.B(a)||$.z(a)?a:null,b)).Yd(),$.L(this.na,this.xd,this),this.u(4608,1)),this):this.na};$.g.xd=function(){this.u(4352,1)};
$.g.KQ=function(a,b,c){return(0,$.xa)(c,a)===b};
$.g.mb=function(){if(this.J(4096)){this.u(16384);var a=this.data().aa();a.reset();for(var b=[],c=[],d=[];a.advance();){var e=$.N(a.get("x")),f=$.N(a.get("y")),h=$.N(a.get("z"));b.push(e);c.push(f);d.push(h)}b=(0,$.Be)(b,this.KQ);c=(0,$.Be)(c,this.KQ);d=(0,$.Be)(d,this.KQ);this.wV=b;this.iy=c;this.uN=d;a=a.Eb();3E3<a&&$.Uj(800,null,[a],!0);(b.length*c.length!=a||4>a)&&0!=a?($.Sj(400),this.O0=!0):this.O0=!1;this.I(4096)}this.J(16384)&&this.Jb&&(this.Jb.Cf()?(this.Jb.fg(),this.Jb.Oc.apply(this.Jb,this.uN),
this.Jb.ng()):(this.Jb.To(),this.Jb.Oc.apply(this.Jb,this.uN)),$.K(this.Jb,$.wx)&&$.ms(this.Jb.Pa()),this.u(16),this.I(16384));b=this.Wa();c=this.bb();a=this.vw();d=!1;b.Cf()&&b.fg();c.Cf()&&c.fg();a.Cf()&&a.fg();b.Oc.apply(b,this.wV);c.Oc.apply(c,this.iy);a.Oc.apply(a,this.uN);b.Cf()&&(d|=b.ng());c.Cf()&&(d|=c.ng());a.Cf()&&(d|=a.ng());d&&this.u(65536)};
$.g.Nl=function(){this.mb();for(var a=this.vw().Pa().get(),b=[],c=0;c<a.length;c++){var d=this.pd()?this.pd().cq(a[c]):this.Yb().ic(0);d={index:0,text:a[c],iconEnabled:!0,iconType:"square",iconStroke:$.Lk(d,1),iconFill:d,disabled:!this.enabled()};b.push(d)}return b};$.g.Ne=function(){return[]};$.g.Wa=function(a){if($.p(a)){if(a=$.Vr(this.cb,a,null,15))this.cb=a,this.cb.da(!1),this.u(16,1);$.L(this.cb,this.MC,this);return this}this.cb||(this.cb=$.Rr(),$.L(this.cb,this.MC,this));return this.cb};
$.g.bb=function(a){if($.p(a)){if(a=$.Vr(this.tc,a,null,15))this.tc=a,this.tc.da(!1),this.u(16,1);$.L(this.tc,this.MC,this);return this}this.tc||(this.tc=$.Rr(),$.L(this.tc,this.MC,this));return this.tc};$.g.vw=function(a){if($.p(a)){if(a=$.Vr(this.oy,a,null,15))this.oy=a,this.oy.da(!1),this.u(16,1);$.L(this.oy,this.MC,this);return this}this.oy||(this.oy=$.Rr(),$.L(this.oy,this.MC,this));return this.oy};
$.g.pd=function(a){if($.p(a)){if(null===a&&this.Jb)this.Jb=null,this.u(16400,1);else if(a=$.Vr(this.Jb,a,null,48,null,this.gp,this)){var b=this.Jb==a;this.Jb=a;this.Jb.da(b);b||this.u(16400,1)}return this}return this.Jb};$.g.gp=function(a){$.W(a,6)&&this.u(16896,1)};$.g.MC=function(){this.u(16,1)};
$.g.Hj=function(a){this.Xb||(this.Xb=new $.lK,$.V(this,"colorRange",this.Xb),this.Xb.ja(!0,this.Xb.ma),this.Xb.Nq().Ia("defaultMarkerFactory","surface.colorRange.marker"),this.Xb.Nq().ja(!0,this.Xb.Nq().ma),this.Xb.qb(this),this.Xb.O(this.Ua),$.L(this.Xb,this.Qy,this),this.u(8196,1));return $.p(a)?(this.Xb.K(a),this):this.Xb};$.g.Qy=function(a){var b=0,c=0;$.W(a,1)&&(b|=8208,c|=1);$.W(a,8)&&(b|=4,c|=8);this.u(b,c)};
$.g.Np=function(a){a.button==$.ki&&(this.g0=!0,this.Gga=a.clientX,this.Hga=a.clientY,this.Iga=this.i("rotationY"),this.Jga=this.i("rotationZ"))};$.g.ih=function(a){"mouseup"==a.type&&(this.g0=!1)};$.g.cg=function(a){if(this.g0){$.U(this);var b=this.sb();this.rotationY(this.Iga-(this.Hga-a.clientY)/b.height*110);this.rotationZ(this.Jga+(this.Gga-a.clientX)/b.width*110);this.da(!0)}};
$.g.Ji=function(a){if(!this.zf()){var b=this.i("rotationZ"),c=this.i("rotationY"),d=[-1,0,0];this.w$=d=S5(R5(0,c),d);b*=Math.PI/180;c*=Math.PI/180;d=Math.sin(b);b=Math.cos(b);var e=Math.sin(c);c=Math.cos(c);this.Zg=[b*c,-d*c,e,d,b,0,-e*b,d*e,c];c=$.hq(this,"xGrid");d=$.hq(this,"yGrid");b=$.hq(this,"zGrid");e=$.hq(this,"xAxis");var f=$.hq(this,"yAxis"),h=$.hq(this,"zAxis");this.Va||(this.Va=this.Ua.Nd(),this.Va.zIndex(36),this.xD=this.Va.Nd(),this.xD.zIndex(36));var k=$.hq(this,"colorRange");this.mb();
this.J(65536)&&(h&&!h.scale()&&h.scale(this.vw()),e&&!e.scale()&&e.scale(this.Wa()),f&&!f.scale()&&f.scale(this.bb()),c&&c.scale(this.Wa()),d&&d.scale(this.bb()),b&&b.scale(this.vw()),this.I(65536));this.J(8192)&&k&&($.U(k),k.scale(this.pd()),k.target(this),k.da(!1),this.u(4));this.J(4)&&(k?(k.fa(a.clone()),this.xf=k.nd()):this.xf=a.clone(),this.xf.left+=10,this.xf.width-=10,h&&h.fa(this.xf),f&&f.fa(this.xf),e&&e.fa(this.xf),c&&c.fa(this.xf),d&&d.fa(this.xf),b&&b.fa(this.xf),this.u(512),this.I(4));
this.J(8192)&&(k&&($.U(k),k.O(this.Ua),k.X(),k.da(!1)),this.I(8192));a=this.xf;var l=[[-.5,-.5,.5],[-.5,.5,.5],[.5,.5,.5],[.5,-.5,.5]];h=[[-.5,-.5,-.5],[-.5,.5,-.5],[.5,.5,-.5],[.5,-.5,-.5]];if(0==this.Ly.length)for(f=0;12>f;f++)this.Ly[f]=this.Va.path();else for(f=0;f<this.Ly.length;f++)this.Ly[f].clear();e=this.i("box");var m=[],n=[];for(f=0;f<l.length;f++)m[f]=S5(this.Zg,l[f]),n[f]=S5(this.Zg,h[f]);f=Fia(m);h=f.h0;k=Fia(n).h0;var q=f.left,r=[];for(f=0;f<m.length;f++){var t=f==m.length-1?0:f+1,
u=m[t],v=m[f],w=Math.abs(l[f][0]-l[t][0]),x=Math.abs(l[f][1]-l[t][1]),y=$.hq(this,"xAxis"),A=$.hq(this,"yAxis");t=$.hq(this,"zAxis");(y&&y.enabled(),A&&A.enabled(),y&&y.enabled()&&w>x&&0<=[v,u].indexOf(h))||A&&A.enabled()&&x>w&&0<=[v,u].indexOf(h)||r.push([m[f],u])}for(f=0;f<n.length;f++)u=f==n.length-1?n[0]:n[f+1],r.push([n[f],u]);for(f=0;f<m.length;f++)t&&t.enabled()&&m[f]==q||r.push([m[f],n[f]]);for(f=0;f<r.length;f++){t=r[f][0];l=r[f][1];m=Math.min(e6(this,[t]),e6(this,[l]));if(t==h||l==h||t==
k||l==k)m=100;this.qp(this.Ly[f],U5(r[f],a),m,e)}this.J(8388608)&&(c&&(c.O(this.Ua),c.X()),d&&(d.O(this.Ua),d.X()),b&&(b.O(this.Ua),b.X()),this.I(8388608));if(this.J(16)){t=this.xf;c=this.data().aa();c.reset();d=this.i("stroke");this.xD.Ti();if(!this.O0){this.Va.suspend();for(b=0;b<this.wV.length-1;b++)for(a=0;a<this.iy.length-1;a++){f=b*(this.iy.length-1)+a;(e=this.Ka[f])?(e.parent(this.xD),e.clear()):(e=this.Ka[f]=this.xD.path(),e.stroke(null));c.select(b*this.iy.length+a);f=[$.N(c.get("x")),$.N(c.get("y")),
$.N(c.get("z"))];c.select((b+1)*this.iy.length+a);h=[$.N(c.get("x")),$.N(c.get("y")),$.N(c.get("z"))];c.select((b+1)*this.iy.length+a+1);k=[$.N(c.get("x")),$.N(c.get("y")),$.N(c.get("z"))];c.select(b*this.iy.length+a+1);r=[$.N(c.get("x")),$.N(c.get("y")),$.N(c.get("z"))];l=[f,h,k,r];n=this.vw();m=n.kh();n=n.Ih();u=this.bb();q=u.kh();u=u.Ih();w=this.Wa();v=w.kh();w=w.Ih();x=0;y=[];for(A=0;A<l.length;A++){var G=l[A];if(!(G[2]>=m&&G[2]<=n&&G[1]<=u&&G[1]>=q&&G[0]>=v&&G[0]<=w)){x++;if(G[2]<m||G[2]>n)G[2]=
Math.max(Math.min(G[2],n),m);if(G[1]<u||G[1]>q)G[1]=Math.max(Math.min(G[1],u),q);if(G[0]>v||G[0]<w)G[0]=Math.max(Math.min(G[0],w),v)}y.push(G)}if(l=x==l.length?null:y){m=S5(this.Zg,d6(this,l[0]));n=S5(this.Zg,d6(this,l[1]));q=S5(this.Zg,d6(this,l[2]));u=S5(this.Zg,d6(this,l[3]));l=36+e6(this,[m,n,q,u]);m=U5([m,n,q,u],t);n=this.pd();var C;n?C=n.cq((f[2]+h[2]+k[2]+r[2])/4):C=this.Yb().ic(0);f=C;this.qp(e,m,l,d);e.close();e.fill(f||"white")}}this.Va.resume()}this.I(16)}this.J(2097152)&&(C=$.hq(this,
"xAxis"),t=$.hq(this,"yAxis"),c=$.hq(this,"zAxis"),C&&C.O(this.Ua).X(),t&&t.O(this.Ua).X(),c&&c.O(this.Ua).X(),this.I(2097152))}};$.g.qp=function(a,b,c,d){a.clear();a.moveTo(b[0][1],b[0][2]);for(var e=1;e<b.length;e++)a.lineTo(b[e][1],b[e][2]);a.zIndex(c);a.stroke(d)};$.g.Im=function(a){this.xs||(this.xs=new $5,this.xs.hj=this,$.L(this.xs,this.Hx,this),this.xs.Vp(this.i("rotationZ")),this.xs.Tp(this.i("rotationY")),$.V(this,"xGrid",this.xs),this.u(8388608,1));return $.p(a)?(this.xs.K(a),this):this.xs};
$.g.Jm=function(a){this.er||(this.er=new $5,this.er.hj=this,$.L(this.er,this.Hx,this),this.er.Vp(this.i("rotationZ")),this.er.Tp(this.i("rotationY")),$.Ax(this.er,"vertical"),$.V(this,"yGrid",this.er),this.u(8388608,1));return $.p(a)?(this.er.K(a),this):this.er};
$.g.FV=function(a){this.hq||(this.hq=new $5,this.hq.hj=this,$.L(this.hq,this.Hx,this),this.hq.Vp(this.i("rotationZ")),this.hq.Tp(this.i("rotationY")),$.Ax(this.hq,"horizontal"),Dia(this.hq,!0),$.V(this,"zGrid",this.hq),this.u(8388608,1));return $.p(a)?(this.hq.K(a),this):this.hq};$.g.Hx=function(){this.u(8388624,1)};$.g.sc=function(){return this};$.g.Ad=function(){return null};
$.g.Yb=function(a){if($.K(a,$.xr))return this.Hc($.xr,a),this;if($.K(a,$.ur))return this.Hc($.ur,a),this;$.D(a)&&"range"==a.type?this.Hc($.xr):($.D(a)||null==this.Aa)&&this.Hc($.ur);return $.p(a)?(this.Aa.K(a),this):this.Aa};$.g.Hc=function(a,b){if($.K(this.Aa,a))b&&this.Aa.K(b);else{var c=!!this.Aa;$.hd(this.Aa);this.Aa=new a;$.V(this,"palette",this.Aa);this.Aa.Rp();b&&this.Aa.K(b);$.L(this.Aa,this.Df,this);c&&this.u(16,1)}};$.g.Df=function(a){$.W(a,2)&&this.u(16,1)};$.g.Qa=function(){return"surface"};
$.g.F=function(){var a=c6.B.F.call(this);this.na&&(a.data=this.data().F());var b=[];this.cb&&(a.xScale=this.Wa().F(),b.push($.oa(this.Wa())));this.tc&&(a.yScale=this.bb().F(),b.push($.oa(this.bb())));this.oy&&(a.zScale=this.vw().F(),b.push($.oa(this.vw())));this.bc&&(a.xAxis=this.ah().F(),f6(b,this.ah(),"xAxis",a));this.Ej&&(a.yAxis=this.fi().F(),f6(b,this.fi(),"yAxis",a));this.eu&&(a.zAxis=this.EV().F(),f6(b,this.EV(),"zAxis",a));this.xs&&(a.xGrid=this.Im().F(),f6(b,this.Im(),"xGrid",a));this.er&&
(a.yGrid=this.Jm().F(),f6(b,this.Jm(),"yGrid",a));this.hq&&(a.zGrid=this.FV().F(),f6(b,this.FV(),"zGrid",a));a.colorScale=this.Jb?this.pd().F():null;this.Xb&&(a.colorRange=this.Hj().F());$.Bp(this,h6,a);return{chart:a}};
$.g.Y=function(a,b){c6.B.Y.call(this,a,b);"data"in a&&this.data(a.data);g6(this,a,"xScale");g6(this,a,"yScale");g6(this,a,"zScale");g6(this,a,"xAxis");g6(this,a,"yAxis");g6(this,a,"zAxis");g6(this,a,"xGrid");g6(this,a,"yGrid");g6(this,a,"zGrid");"colorScale"in a&&this.pd(a.colorScale);"colorRange"in a&&this.Hj(a.colorRange);$.tp(this,h6,a,b)};
$.g.R=function(){$.jd(this.bc,this.Ej,this.eu,this.Ka,this.xs,this.er,this.hq,this.Ly,this.xD,this.Va,this.Xb,this.Aa,this.na,this.ed);this.Ly.length=0;this.Ka.length=0;this.hq=this.er=this.xs=this.eu=this.Ej=this.bc=this.ed=this.na=this.Aa=this.Xb=this.Va=this.xD=null;c6.B.R.call(this)};$.g.et=function(){return[this]};$.g.xF=function(){return["x","y","z"]};var i6=c6.prototype;i6.colorScale=i6.pd;i6.colorRange=i6.Hj;i6.xGrid=i6.Im;i6.yGrid=i6.Jm;i6.zGrid=i6.FV;i6.xAxis=i6.ah;i6.yAxis=i6.fi;
i6.zAxis=i6.EV;i6.xScale=i6.Wa;i6.yScale=i6.bb;i6.zScale=i6.vw;i6.getType=i6.Qa;i6.palette=i6.Yb;$.Fo.surface=Gia;$.F("anychart.surface",Gia);}).call(this,$)}
