!function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w){function x(a){return a?(""+a).toUpperCase():""}function y(a,b){if(a=""+a,a.length<b)for(;a.length<4;)a="0"+a;return a}function z(a,b,c){return c>1?c=1:c<0&&(c=0),a+(b-a)*c}function A(a,b){return void 0===b?k.random()*a:k.random()*(b-a)+a}function B(a){var b=a[Uc.Penetrable],c=a[Uc.IsCircle],d=a[Uc.CircleOffset],e=a[Uc.CircleRadius],f=a[Uc.Interp],g=a[Uc.SelfClose],h=a[Uc.ShapePoints],i=new Sc;if(void 0!==b&&(i.penetrable=b),void 0!==c&&(i.isCircle=c),void 0!==d&&i.circleOffset.copy(d),void 0!==e&&(i.circleRadius=e),void 0!==f&&(i.interp=f),void 0!==g&&(i.selfClose=g),h)for(var j=0;j<h.length;j++){var k=h[j],l=k[Vc.Position],m=k[Vc.Handle1],n=k[Vc.Handle2],o=new Rc;o.pos.copy(l),void 0!==m&&o.h1.copy(m),void 0!==n&&o.h2.copy(n),i.shapePoints.push(o)}return i.update(),i}function C(b,c,d,e){var f=Qc.PATH.TEXTURE+b+"-"+(100*d).toFixed()+".png";return e&&c!=Qc.TYPE.ROPE?c==Qc.TYPE.TILESPRITE?e.spritesheet.getTexture(f):e.spritesheetMipmap.getTexture(f):a.Texture.fromImage(f)}function D(a,b,c){var d=1;return c&&b!=Qc.TYPE.ROPE&&(d=b==Qc.TYPE.TILESPRITE?c.spritesNormal[a]?c.spritesNormal[a]:1:c.spritesMipmap[a]?c.spritesMipmap[a]:1),d*Wc}function E(b,c,d){var e,f,g=b[Tc.Name],h=b[Tc.Texture],i=b[Tc.Helper],j=b[Tc.EditorLocked],k=q(b[Tc.Type]),l=b[Tc.Alpha],m=b[Tc.Position],n=b[Tc.Rotation],o=b[Tc.Scale],p=b[Tc.Tint],r=b[Tc.BlendMode],t=b[Tc.TileScale],u=b[Tc.Width],v=b[Tc.Height],w=b[Tc.Shape],x=b[Tc.RopeScale],y=b[Tc.RopeSpeed],z=b[Tc.Collider],A=b[Tc.ColliderType],E=b[Tc.DynamicFriction],F=b[Tc.DynamicAngularDamp],G=b[Tc.DynamicWeight],H=b[Tc.TriggerWindForce],I=b[Tc.TriggerWindAngle],J=b[Tc.TriggerFrictionMultiply],K=b[Tc.TriggerSpeedMultiply],L=D(h,k,d);if(h&&(f=C(h,k,L,d)),k==Qc.TYPE.SPRITE&&(e=new a.Sprite(f)),k==Qc.TYPE.TILESPRITE&&(e=new a.extras.TilingSprite(f,u,v),e.texture.baseTexture.mipmap=!1,void 0!==t?(e.tileScale.x=t.x/L,e.tileScale.y=t.y/L):(e.tileScale.x=1/L,e.tileScale.y=1/L)),k==Qc.TYPE.ROPE){var M=B(w);e=new s(f,M.curve),e.texture.baseTexture.mipmap=!1,e.shape=M,e.points=e.shape.curve,e.updateverts(),void 0!==x&&(e._scale=x/L),void 0!==y&&(e._speed=y)}if(k==Qc.TYPE.LAYER&&(e=new a.Container),void 0!==z){e.colliders=[];for(var N=0;N<z.length;N++)e.colliders.push(B(z[N]));A==Qc.COLLIDERTYPE.DYNAMIC?(void 0!==E&&(e.dynamic_friction=E),void 0!==F&&(e.dynamic_angular=F),void 0!==G&&(e.dynamic_weight=G)):A==Qc.COLLIDERTYPE.TRIGGER&&(void 0!==H&&(e.trigger_windforce=H),void 0!==I&&(e.trigger_windangle=I),void 0!==J&&(e.trigger_frictionmultiply=J),void 0!==K&&(e.trigger_speedmultiply=K))}return void 0!==p&&(e.tint=p),void 0!==r&&(e.blendMode=r),void 0!==g&&(e.name=g),void 0!==i&&(e._helper=i),void 0!==j&&(e.editor_locked=j),void 0!==k&&(e._type=k),void 0!==l&&(e.alpha=l),void 0!==m&&e.position.copy(m),void 0!==n&&(e.rotation=n),void 0!==o?(e.scale.x=k==Qc.TYPE.ROPE||k==Qc.TYPE.TILESPRITE?o.x:o.x/L,e.scale.y=k==Qc.TYPE.ROPE||k==Qc.TYPE.TILESPRITE?o.y:o.y/L):(e.scale.x=k==Qc.TYPE.ROPE||k==Qc.TYPE.TILESPRITE?1:1/L,e.scale.y=k==Qc.TYPE.ROPE||k==Qc.TYPE.TILESPRITE?1:1/L),void 0!==A&&(e.colliderType=A),e.anchor&&e.anchor.set(.5),c&&c.addChild(e),e}function F(){this.container=new a.Container,this.barBackground=a.Sprite.fromFrame("Conquest/zone_bar_bg.png"),this.barColor=a.Sprite.fromFrame("Conquest/zone_bar_color.png"),this.barShader=a.Sprite.fromFrame("Conquest/zone_bar_shader.png"),this.barFill=a.Sprite.fromFrame("blank.png"),this.barFill.height=13,this.barFill.width=0,this.barFill.position.set(3,2),this.text=new a.Text("0%",{fontFamily:"Arial",fontSize:"12px",fontWeight:"bold",fill:16777215,align:"center"}),this.text.anchor.set(.5),this.text.position.set(65,8),this.text.parentLayer=Dd.Scene.layerText,this.container.addChild(this.barBackground),this.container.addChild(this.barFill),this.container.addChild(this.barColor),this.container.addChild(this.barShader),this.container.addChild(this.text),this.ClearTeam()}function G(b){var c=b?.43:1;this.thickness=b?4:7,this.radius=40*c,this.sides=6,this.container=new a.Container,this.glow=a.Sprite.fromFrame("Particles/particle_big.png"),this.glow.anchor.set(.5),this.glow.alpha=0,this.glow.blendMode=1,this.glow.scale.set(c),this.glowContainer=new a.Container,this.glowContainer.addChild(this.glow),this.container.addChild(this.glowContainer),this.bg=a.Sprite.fromFrame("Conquest/zone_polygon_bg.png"),this.bg.anchor.set(.5),this.bg.scale.set(c),this.container.addChild(this.bg),this.text=new a.Text("A",{fontFamily:"Calibri",fontWeight:"bold",fontSize:b?"20px":"47px",fill:16777215,align:"center"}),this.text.anchor.set(.5),this.container.addChild(this.text),this.bars={};var d=new Vector2(0,(-this.radius)),e=new Vector2(0,(-this.radius)).rotate(k.PI/(.5*this.sides));this.maxWidth=Vector2.Distance(d,e);for(var f=0;f<this.sides;f++){var g=a.Sprite.fromImage("content/sprites/blank.png"),h=new Vector2(0,(-this.radius));g.width=this.maxWidth,g.height=this.thickness,g.position=h.rotate(k.PI/(.5*this.sides)*f),g.rotation=k.PI/this.sides+k.PI/(.5*this.sides)*f,this.container.addChild(g),this.bars[f]=g}this.ClearTeam(),this.ClearPresence()}function H(a,b,c,d){this.left=void 0!==a?a:0,this.right=void 0!==b?b:0,this.top=void 0!==c?c:0,this.bottom=void 0!==d?d:0}function I(b,c,d,e,f){this.icon=b,this.arrow=a.Sprite.fromFrame("Misc/arrow.png"),this.arrow.visible=this.icon.visible=!1,this.arrow.blendMode=a.BLEND_MODES.ADD,this.arrow.alpha=.2,this.arrow.parentLayer=Dd.Scene.layerUI_ADD,this.snapOffset=new Oc,this.snapOffset.x=d||0,this.snapOffset.y=e||0,this.iconScale=f||1,this.lerp=0,this.arrow.anchor.set(.5,0),this.targetUpdated=!1,this.target=void 0,this.targetPosition=new Oc,this.targetVisible=!1}function J(b){this.health=100,this.healthbarbg=a.Sprite.fromFrame("hpbg.png"),this.healthbarbg.position.x=-41,this.healthbarfg=a.Sprite.fromFrame("hpfg.png"),this.healthbarfg.anchor.set(.5,1),this.healthbarbg.anchor.y=1,this.container=new a.Container,this.container.addChild(this.healthbarbg),this.container.addChild(this.healthbarfg),Dd.Scene.layerHealth.addChild(this.container),this.container.parentLayer=Dd.Scene.layerHealth,void 0!==b&&this.setHealth(b)}function K(a,b){this.id=a,this.revision=b,this.height=5e3,this.width=5e3,this.demoMode=0===this.revision,this.data=void 0,this.loaded=!1,this.Above=[],this.Below=[],this.gameObjects=[],this.spritesNormal={},this.spritesMipmap={},this.spritesheet=new Nc(2048,2,(!1)),this.spritesheetMipmap=new Nc(2048,2,(!0)),this.loadCallback=null}function L(){GameObject.call(this),this.sessionID=-1,this.friendID=-1,this.avatar="",this.name="",this.Ping="",this.Kills=0,this.Deaths=0,this.Assists=0,this.Score=0,this.team=-1,this.PlayerState=-1,this.dead=!1,this.connected=!1,this.me=!1,this.unit=null,this.initialize=function(a,b,c,d,e,f,g,h,i,j,k){this.sessionID=a,this.friendID=b,this.avatar=d,this.name="",this.Ping=j||"",this.Kills=e,this.Deaths=f,this.Assists=g,this.Score=h,this.team=-1,this.PlayerState=i,this.dead=!1,this.connected=!0,this.me=PE.Server.playerId===a,this.unit=null,this.setTeam(k),this.setName(c),Dd.Players[a]=this,Dd.PlayersSorted.push(this),this.me&&(Dd.player=this,Dd.joined=!0,Dd.triggerStateChange()),Dd.ScoreBoard.setDirty(!0)},this.setName=function(a){a!==this.name&&(this.name=a,null!=this.unit&&this.unit.setName(a),this.playerItem&&this.playerItem.updateName(),Dd.ScoreBoard.setDirty(!0))},this.setTeam=this.on(1,function(a){this.team!==a&&(this.team=a,null!=this.unit&&this.unit.updateColors(),this.me&&u(function(){Dd.UpdateColors()},500)),Dd.ScoreBoard.addPlayer(this)}),this.setPing=this.on(2,function(a){this.Ping=a}),this.updateScore=this.on(3,function(a){this.Score=a,Dd.ScoreBoard.setDirty(!0)}),this.gameEnd=function(){null!=this.unit&&this.unit.EngineSound&&this.unit.EngineSound.audio.fade(this.unit.EngineSound.GetVolume(),0,1500)},this.Die=this.on(4,function(a,b,c){var d=Dd.Players[a];if(b.length)for(var e=0;e<b.length;e++){var f=Dd.Players[b[e]];f&&(f.Assists+=1)}void 0!==d&&(d!==this&&(d.Kills+=1),this.me&&(Dd.playerKilledBy=d)),this.dead=!0,this.Deaths+=1,this.PlayerState=1,this.me&&Dd.PlayerDie(),Dd.KillStreak.Update(d,this),Dd.KillLog.Log(d,this,c),Dd.ScoreBoard.setDirty(!0)}),this.destroy=function(){GameObject.prototype.destroy.call(this),Dd.ScoreBoard.setDirty(!0),this.playerItem&&(this.playerItem.dispose(),this.playerItem=null),delete Dd.Players[this.sessionID];var a=Dd.PlayersSorted.indexOf(this);a>=0&&Dd.PlayersSorted.splice(a,1),this.unit=null}}function M(a){this.player=a,this.playSpawnEffect=!0,this.teammate=this.player.me,this.arrowDistance=78,this.arrowDistanceSides=65,this.player.me&&(this.setMe(),this.Spawn())}function N(a,b,c){this.id=a,this.name=b,this.abilityType=c||Pe.Activate}function O(a,b,c,d,e,f,g,h,i,j,k){for(var l=[],m=0;m<b.length;m++)l.push(a+"."+b[m]+"?"+Dd.version);this.src=l,this.groups=c,this.loop=d,this.audio=void 0,this.volumeFrom=f,this.volumeTo=g,this.rateFrom=h,this.rateTo=i,this.pool=j,this.html5=1==k,this.scaleSpeed=e}function P(a,b,c){this.base=a,this.Stereo=b||!1,this.id=void 0,this.initialized=!1,this.stopped=!1,this.groups=c,this.currentVolume=this.GetVolume(),this.lastPositionVolume=0,this._vol=0,c&&Dd.Audio.Special.push(this)}function Q(b,c,d,e,f){if(this.sprites=[],this.pendingSprites=[],this.ready=!1,this.currentRow=[],this.height=0,this.width=0,this.currentX=0,this.currentY=0,this.nextY=0,this.maxX=void 0!==d?d:2048,this.maxY=void 0!==e?e:2048,this.resolution=new Oc(void 0!==b?b:0,void 0!==c?c:0),this.positionContainer=new a.Container,this.objectCacheContainer=new a.Container,this.texture=a.RenderTexture.create(this.resolution.x,this.resolution.y),this.rendercheck=void 0,f){var g=new a.Sprite(this.texture);g.scale.set(.5),g.position.x=200,Dd.Scene.layerDebugStage.addChild(g)}}function R(b,c,d,e){this.active=!0,this.height=e,this.width=d,this.reservedWidth=0,this.reservedHeight=0,this.container=b,this.sprite=new a.Sprite(a.Texture.EMPTY),this.spritesheet=c,this.startX=0,this.startY=0,this.spritesheet.sprites.push(this),this.images={}}function S(){var b=this.container=new a.Container,c=this.gunContainer=new a.Container,d=this.body=new a.Sprite(a.Texture.EMPTY),e=this.gun=new a.Sprite(a.Texture.EMPTY);this.isSoldier=!1,this.class=null;var f=0,g=0,h=0;this.refresh=function(){this.loadClass(f,g,h,!0)},this.loadClass=function(a,i,j,k){var l=this.class=tankClass[a];(!i||i<=0)&&(i=l.DefaultSkinCannon),(!j||j<=0)&&(j=l.DefaultSkinBody);var m="/image/body-"+a+"-"+j+".png",n="/image/cannon-"+a+"-"+i+".png";Kd.load([m,n],function(){(h!=j||f!=a||k)&&(h=j,d.texture=Kd.getTexture(m),d.anchor.set(l["BodyAnchor"]["x"],l["BodyAnchor"]["y"]),b.addChild(d),d.addChild(c)),(g!=i||f!=a||k)&&(g=i,e.texture=Kd.getTexture(n),e.position.set(l["CannonOffset"]["x"],l["CannonOffset"]["y"]),e.anchor.set(l["CannonAnchor"]["x"],l["CannonAnchor"]["y"]),c.addChild(e))}),f=a,this.isSoldier=!1},this.loadSoldierTextures=function(){if(!Hd){var b;for(b=0;b<=21;b++)Id.push(a.Texture.fromFrame("run_body_"+y(b,4)+".png")),Jd.push(a.Texture.fromFrame("run_legs_"+y(b,4)+".png"));Hd=!0}},this.loadSoldier=function(){this.isSoldier=!0,this.loadSoldierTextures();this.class={PrimaryBodyMounted:!1,SecondaryBodyMounted:!1,ID:-1,ControlType:2,PrimaryOffset:{x:52,y:12},SecondaryOffset:{x:52,y:12},CannonOffset:{x:1,y:2}};d=this.body=new a.extras.AnimatedSprite(Jd),e=this.gun=new a.extras.AnimatedSprite(Id),d.anchor.set(.4),e.anchor.set(.4),d.play(),e.play(),b.addChild(d),d.addChild(c),c.addChild(e)},this.dead=!1,this.die=function(){this.dead=!0,d.tint=7829367,e.tint=7829367},this.spawn=function(){this.dead=!1,d.tint=16777215,e.tint=16777215},this.clone=function(){var a=new S;return this.isSoldier?a.loadSoldier():a.loadClass(f,g,h),a},this.destroy=function(){b.destroy({children:!0,texture:!1,baseTexture:!1})}}function T(){this.container=new a.UI.Container;var c=0,d=a.UI.Sprite.fromFrame("blank.png");d.width=d.height="100%",d.tint=0,d.alpha=.49;var e=a.UI.Sprite.fromFrame("blank.png");e.anchorTop=2,e.anchorBottom=2;var f=new a.UI.DynamicText(" ",{style:kd,allowTags:!0,width:"100%",height:"100%"});f.style.align="center",f.style.valign="middle",this.container.addChild(d,e,f),this.SetTeamColor=function(a){e.tint=Dd.TeamColors.GetColor(a).Color},this.SetAmount=function(a){var d=a/c,g=(this.container.width-4)*d;f.value=a+"<font size='12'>/"+c+"</font>",b.to(e,.5,{width:g})},this.setData=function(a,b,d,f,g){c=d,this.container.width=f,this.container.height=g,e.anchorRight=a?null:2,e.anchorLeft=a?2:null,this.SetAmount(b)},this.Clear=function(){this.container&&this.container.parent&&this.container.parent.removeChild(this.container),this.SetAmount(0)}}function U(){this.loaded=!1,this.initialized=!1,this.container=new a.UI.Container}function V(){U.call(this);var b,c=this,d=["Game Begins in","Forced Start in"],e=new a.UI.DynamicText("textabove",{style:id}),f=new a.UI.DynamicText("textbelow",{style:md});this.initialize=function(){U.prototype.initialize.call(this),this.container.verticalAlign="middle",this.container.horizontalAlign="center",e.y=-20,e.pivot=.5,f.pivot=.5,this.container.addChild(e,f)},this.update=function(a,d){b-=a,f.text=b.toFixed(2),b<=0&&c.unload()},this.load=function(a,c,g){this.loaded&&(b=c,e.text=d[a],f.text=c.floatRound(2)+""),this.loaded||(b=c,U.prototype.load.call(this),PE.GameLoop.onUpdate(this.update,this),e.text=d[a],f.text=c.floatRound(2)+"")},this.unload=function(){this.loaded&&(U.prototype.unload.call(this),PE.GameLoop.offUpdate(this.update,this))},this.clear=function(){U.prototype.clear.call(this)}}function W(){U.call(this);var b=new a.UI.DynamicText(": 0",{style:md}),c=new a.UI.DynamicText(": 0",{style:md}),d=0,e=0;this.initialize=function(){U.prototype.initialize.call(this),this.container.verticalAlign="top",this.container.horizontalAlign="right",b.anchorTop=c.anchorTop=10,b.anchorRight=50,c.anchorRight=150,b.pivot=.5,c.pivot=.5,this.container.addChild(b,c)},this.updateValues=function(){if(Dd.player){d=Dd.player.Kills,e=0;for(var a in Dd.Players){Dd.Players[a].dead||e++}c.text=": "+d,b.text=": "+e}},this.load=function(){this.loaded||(U.prototype.load.call(this),Dd.ScoreBoard.OnScoreboardChange(this.updateValues))},this.unload=function(){this.loaded&&(U.prototype.unload.call(this),Dd.ScoreBoard.OffScoreboardChange(this.updateValues))},this.clear=function(){U.prototype.clear.call(this)}}function X(){U.call(this);var b,c=this,d=["","New Zone assigned\nShrinking starts in: ","New Zone in: ","Zone is fully shrinked in: "],e=new a.UI.DynamicText("textabove",{style:id}),f=new a.UI.DynamicText("textbelow",{style:md});this.initialize=function(){U.prototype.initialize.call(this),this.container.verticalAlign="middle",this.container.horizontalAlign="center",e.y=-20,e.pivot=.5,f.pivot=.5,this.container.addChild(e,f)},this.update=function(a,d){b-=a,b<=0&&c.unload()},this.load=function(a,c,g,h){g=""+g;for(var i=(d[c].match(/\r?\n/g)||"").length,j=0;j<i;j++)g="\n"+g;this.loaded&&(e.text=d[c],f.text=g,b=a),this.loaded||(e.text=d[c],f.text=g,b=a,U.prototype.load.call(this),PE.GameLoop.onUpdate(this.update,this))},this.unload=function(){this.loaded&&(U.prototype.unload.call(this),PE.GameLoop.offUpdate(this.update,this))},this.clear=function(){U.prototype.clear.call(this)}}function Y(){var b=void 0,c=5,d=0,e=new a.particles.Emitter(Dd.Scene.layerParticle,[a.Texture.fromFrame("Particles/dust.png")],Ld);e.emit=!1;var f=new Oc;this.update=function(a){Dd.Scene.getPositionOf(b,!1,e.ownerPos),e.updateOwnerPos(e.ownerPos.x+f.x,e.ownerPos.y+f.y),e.update(a),c-=a,c<0&&this.stop()},this.stop=function(){c>0&&e.cleanup(),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a,g,h){b=a,d=g,e.updateOwnerPos(0,0),e.resetPositionTracking(),e.emit=!0,c=5,Oc.Forward(d,620,f),h&&(e.update(h),c-=h),Dd.Effects.VFXHandler.Add(this)}}function Z(){var b=2,c=new a.particles.Emitter(parent,[a.Texture.fromFrame("Particles/a10fire.png")],Md);c.emit=!1,this.update=function(a){c.update(a),b-=a,b<0&&this.stop()},this.stop=function(){b>0&&c.cleanup(),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a,d){c.parent=a,c.emit=!0,b=2,d&&(b-=d,update(d)),Dd.Effects.VFXHandler.Add(this)}}function $(){var b,c=4,d=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/lightning1.png")],{alpha:{start:.6,end:0},scale:{start:.4,end:.7,minimumScaleMultiplier:1},color:{start:"#ffffff",end:"#60fbfd"},speed:{start:50,end:20},rotationSpeed:{min:80,max:-80},startRotation:{min:-360,max:360},lifetime:{min:.5,max:1.5},blendMode:"add",frequency:.05,emitterLifetime:2,maxParticles:50,pos:{x:0,y:0},addAtBack:!1,spawnType:"circle",spawnCircle:{x:0,y:0,r:35,minR:0}});d.emit=!1,this.update=function(a){d.updateOwnerPos(b.position.x,b.position.y),d.update(a),c-=a,c<0&&this.stop()},this.stop=function(){c>0&&d.cleanup(),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a){b=a,d.ownerPos.set(b.position.x,b.position.y),d.emit=!0,c=4,Dd.Effects.VFXHandler.Add(this)}}function _(){var b=!1,c=0,d=new a.Container,e=new a.Container;e.parentLayer=Dd.Scene.layerParticle_ADD,e.scale.set(.9,.6);var f=new P(Dd.Audio.Base.emp_air),g=new P(Dd.Audio.Base.emp_explode),h=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/lightning1.png"),a.Texture.fromFrame("Particles/lightning2.png"),a.Texture.fromFrame("Particles/lightning3.png"),a.Texture.fromFrame("Particles/lightning4.png"),a.Texture.fromFrame("Particles/lightning5.png")],_d);h.frequency=.008,h.particleBlendMode=1;var i=new a.particles.Emitter(e,[a.Texture.fromFrame("Particles/mini_flash_1.png"),a.Texture.fromFrame("Particles/mini_flash_2.png"),a.Texture.fromFrame("Particles/mini_flash_3.png"),a.Texture.fromFrame("Particles/mini_flash_4.png")],Zd),j=a.Sprite.fromFrame("Particles/missile_02.png");j.scale.set(1.2),j.anchor.y=.5,e.rotation=k.PI,d.addChild(e,j);var l,m=2,n=new Vector2,o=new Vector2,p=new Vector2;h.emit=!1,i.emit=!1;var q=0;this.update=function(a){q+=a;var e=q/m;Vector2.Lerp(o,n,e,p),d.position=p,h.updateOwnerPos(p.x,p.y);var g=180*l/k.PI;if(h.minStartRotation=g-180,h.maxStartRotation=g-180,b){if(c-=a,c<=0)return void this.stop(!0)}else m>1&&f.SetPosition(p.x,p.y),e>=1&&this.explode();h.update(a),i.update(a)},this.explode=function(){aa.Get().start(p.x,p.y,l),g.Play(p.x,p.y),this.stop()},this.stop=function(a){this.hide(),a?(Dd.Scene.layerParticle.removeChild(d),h.cleanup(),i.cleanup(),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)):(b=!0,c=1)},this.start=function(a,e,g,j){Dd.Scene.layerParticle.addChild(d),b=!1,m=j,c=1,q=0,l=g,n.set(a,e),Vector2.Forward(l,-2500*m,o),o.x+=n.x,o.y+=n.y,p.copy(o),d.rotation=l,m>1&&f.Play(p.x,p.y),i.ownerPos.set(0),h.ownerPos.set(p.x,p.y),this.show(),Dd.Effects.VFXHandler.Add(this)},this.show=function(){b||(j.visible=!0,h.resetPositionTracking(),h.emit=!0,i.emit=!0,p.copy(o),d.position=p,h.ownerPos.set(p.x,p.y))},this.hide=function(){j.visible=!1,h.emit=!1,i.emit=!1}}function aa(){var c=3,d=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/lightning1.png"),a.Texture.fromFrame("Particles/lightning2.png"),a.Texture.fromFrame("Particles/lightning3.png"),a.Texture.fromFrame("Particles/lightning4.png"),a.Texture.fromFrame("Particles/lightning5.png")],{alpha:{start:.3,end:0},scale:{start:.5,end:2.5,minimumScaleMultiplier:1},color:{start:"#ffffff",end:"#60fbfd"},speed:{start:80,end:20},rotationSpeed:{min:80,max:-80},lifetime:{min:.5,max:1.5},blendMode:"add",frequency:1e-4,emitterLifetime:.2,maxParticles:150,pos:{x:0,y:0},addAtBack:!1,spawnType:"circle",spawnCircle:{x:0,y:0,r:400,minR:0}});d.emit=!1;var e=a.Sprite.fromFrame("Particles/particle_big.png");e.blendMode=a.BLEND_MODES.ADD,e.tint=11334399,e.anchor.set(.5),e.scale.set(4),Dd.Scene.layerParticle_ADD.addChild(e);var f=a.Sprite.fromFrame("Displacement/donut.png");f.blendMode=a.BLEND_MODES.ADD,f.anchor.set(.5),Dd.Scene.layerParticle_ADD.addChild(f),f.parentLayer=Dd.Scene.layerDisplacement,this.update=function(a){d.update(a),c-=a,c<0&&this.stop()},this.stop=function(){c>0&&d.cleanup(),e.visible=!1,f.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a,g,h){e.visible=!0,e.position.set(a,g),f.visible=!0,f.position.set(a,g),d.ownerPos.set(a,g),d.emit=!0,c=3,b.fromTo(e,.5,{alpha:1},{alpha:0}),b.fromTo(f,1,{alpha:.4},{alpha:0}),b.fromTo(f.scale,1,{x:1,y:1},{x:20,y:20}),Dd.Effects.Decals.Add(a,g,.9,1.4),d.minStartRotation=h*(180/k.PI),d.maxStartRotation=h*(180/k.PI),Dd.Effects.VFXHandler.Add(this)}}function ba(){var b,c,d=new Vector2,e=new Vector2,f=a.Sprite.fromFrame("Particles/laser.png"),g=new P(Dd.Audio.Base.emp_mark),h=!1,i=a.Sprite.fromFrame("Particles/particle_big.png");i.blendMode=a.BLEND_MODES.ADD,i.tint=12329506,i.anchor.set(.5),i.scale.set(2.5);var j=a.Sprite.fromFrame("Particles/particle_big.png");j.blendMode=a.BLEND_MODES.ADD,j.tint=16748688,j.anchor.set(.5),j.scale.set(.2),f.blendMode=1,f.anchor.set(.87,.5),f.scale.set(-1,.7);var k=0,l=0;this.update=function(a){l+=5*a,l>1.5&&(l=-2);var m=Mathf.clamp(l,.1,1);if(k+=a,c&&c.visible){d.copy(c.position);var n=d.distance(e),o=n/70*100,p=d.angleTowards(e);f.width=o,f.rotation=p,f.position.copy(d),f.alpha=m,h&&g.SetPosition(d.x,d.y)}else f.alpha=0;i.alpha=.8*m,j.alpha=.7*m,k>b&&this.stop()},this.stop=function(){this.hide(),Dd.Scene.layerParticle_ADD.removeChild(f),Dd.Scene.layerParticle_ADD.removeChild(i),Dd.Scene.layerParticle_ADD.removeChild(j),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a,m,n,o){l=0,Dd.Scene.layerParticle_ADD.addChild(f),Dd.Scene.layerParticle_ADD.addChild(i),Dd.Scene.layerParticle_ADD.addChild(j),f.alpha=i.alpha=j.alpha=0,c=a,c&&c.visible&&(h=!0,d.copy(c.position),g.Play(d.x,d.y)),b=o,k=0,e.set(m,n),i.position.copy(e),j.position.copy(e),this.show(),Dd.Effects.VFXHandler.Add(this)},this.show=function(){},this.hide=function(){}}function ca(){var b=void 0,c=!1,d=0,e=17,f=new Oc,g=new a.particles.Emitter(Dd.Scene.layerParticle,[a.Texture.fromFrame("Particles/debris01.png"),a.Texture.fromFrame("Particles/debris02.png"),a.Texture.fromFrame("Particles/debris03.png"),a.Texture.fromFrame("Particles/debris04.png")],Sd),h=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/flame.png")],{alpha:{start:.9,end:.1},scale:{start:2,end:.3,minimumScaleMultiplier:1},color:{start:"#ad6428",end:"#f7a134"},speed:{start:500,end:0},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:0,max:0},lifetime:{min:.5,max:.8},blendMode:"add",frequency:.01,emitterLifetime:.1,maxParticles:15,pos:{x:0,y:0},addAtBack:!1,ease:[{s:0,cp:.329,e:.548},{s:.548,cp:.767,e:.876},{s:.876,cp:.985,e:1}],spawnType:"point"}),j=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/flame.png")],Ud),k=new a.particles.Emitter(Dd.Scene.layerParticle,[a.Texture.fromFrame("Particles/smoke2.png")],Od);k.emit=!1,g.emit=!1,j.emit=!1,h.emit=!1;var l=a.Sprite.fromFrame("Particles/particle_big.png");l.anchor.set(.5),l.scale.set(3.5),l.blendMode=a.BLEND_MODES.ADD,l.tint=16758886,Dd.Scene.layerParticle_ADD.addChild(l);var m=(new i).to(l,.35,{alpha:0});m.stop(),this.update=function(a){d+=a,b.dead&&b.visible?f.copy(b.position):this.stop(),c&&(g.ownerPos.set(f.x,f.y),j.ownerPos.set(f.x,f.y),h.ownerPos.set(f.x,f.y),g.update(a),j.update(a),h.update(a)),!k.emit&&b.dead&&b.visible&&(k.emit=!0),k.ownerPos.set(f.x,f.y),k.update(a),d>e&&this.stop()},this.stop=function(){k.emit=!1,g.emit=!1,j.emit=!1,h.emit=!1,g.cleanup(),j.cleanup(),h.cleanup(),k.cleanup(),l.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this);var a=b.VFX.indexOf(this);a!=-1&&b.VFX.splice(a,1)},this.start=function(a){d=0,a.VFX.push(this),b=a,l.position.copy(a.position),l.visible=!0,l.alpha=.35,m.gotoAndPlay(0),c=!1,f.copy(b.position),Dd.Effects.Decals.Add(a.position.x,a.position.y,.7,1.4),a.visible&&(c=!0,g.emit=!0,j.emit=!0,h.emit=!0),Dd.Effects.VFXHandler.Add(this)}}function da(){var b=void 0,c=!1,d=0,e=3,f=(new Oc,new a.particles.Emitter(Dd.Scene.layerParticle,[a.Texture.fromFrame("Particles/debris01.png"),a.Texture.fromFrame("Particles/debris02.png"),a.Texture.fromFrame("Particles/debris03.png"),a.Texture.fromFrame("Particles/debris04.png")],Sd)),g=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/flame.png")],Td);f.emit=!1,g.emit=!1,g.startScale=1,g.endScale=1.5,g.startSpeed=600,g.maxLifetime=.5;var h=a.Sprite.fromFrame("Particles/particle_big.png");h.anchor.set(.5),h.scale.set(3.5),h.blendMode=a.BLEND_MODES.ADD,h.tint=16758886,Dd.Scene.layerParticle_ADD.addChild(h);var j=(new i).to(h,.35,{alpha:0});j.stop(),this.update=function(a){d+=a,f.ownerPos.set(b.position.x,b.position.y),g.ownerPos.set(b.position.x,b.position.y),f.update(a),g.update(a),d>e&&this.stop()},this.stop=function(){d<e&&(f.cleanup(),g.cleanup()),h.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a){d=0,b=a,h.position.copy(a.position),h.visible=!0,h.alpha=.35,j.gotoAndPlay(0),Dd.Effects.Decals.Add(a.position.x,a.position.y,.3,.9),c=!0,f.emit=!0,g.emit=!0,Dd.Effects.VFXHandler.Add(this)}}function ea(){var b=0,c=new a.particles.Emitter(Dd.Scene.layerParticle,[a.Texture.fromFrame("Particles/debris01.png"),a.Texture.fromFrame("Particles/debris02.png"),a.Texture.fromFrame("Particles/debris03.png"),a.Texture.fromFrame("Particles/debris04.png")],Sd),d=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/flame.png")],{alpha:{start:1,end:0},scale:{start:.3,end:1.5,minimumScaleMultiplier:1},color:{start:"#ff4800",end:"#ffe38f"},speed:{start:150,end:0,minimumSpeedMultiplier:1},acceleration:{x:0,y:0},maxSpeed:0,startRotation:{min:0,max:360},noRotation:!1,rotationSpeed:{min:-50,max:50},lifetime:{min:.3,max:1.4},blendMode:"add",ease:[{s:0,cp:.329,e:.548},{s:.548,cp:.767,e:.876},{s:.876,cp:.985,e:1}],frequency:.01,emitterLifetime:.1,maxParticles:10,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"}),e=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/spark.png")],be);d.emit=!1,c.emit=!1,e.emit=!1;var f=a.Sprite.fromFrame("Particles/particle_big.png");f.anchor.set(.5),f.scale.set(3.5),f.blendMode=a.BLEND_MODES.ADD,f.tint=16758886,Dd.Scene.layerParticle_ADD.addChild(f);var g=(new i).to(f,.35,{alpha:0});g.stop(),this.update=function(a){d.update(a),c.update(a),e.update(a),b-=a,b<0&&this.stop()},this.stop=function(){b>0&&(d.cleanup(),c.cleanup(),e.cleanup()),f.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this),ea.Count--},this.start=function(a){b=2,d.ownerPos.set(a.x,a.y),c.ownerPos.set(a.x,a.y),e.ownerPos.set(a.x,a.y),e.minStartRotation=0,e.maxStartRotation=360,f.position.copy(a),f.visible=!0,f.alpha=.35,g.gotoAndPlay(0),Dd.Effects.Decals.Add(a.x,a.y,.4,.6,.5),d.emit=!0,c.emit=!0,e.emit=!0,ea.Count++,Dd.Effects.VFXHandler.Add(this)}}function fa(){var b=0,c=new a.particles.Emitter(Dd.Scene.layerParticle,[a.Texture.fromFrame("Particles/debris01.png"),a.Texture.fromFrame("Particles/debris02.png"),a.Texture.fromFrame("Particles/debris03.png"),a.Texture.fromFrame("Particles/debris04.png")],Sd),d=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/flame.png")],Td),e=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/spark.png")],ce),f=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/dust.png")],Pd);d.emit=!1,c.emit=!1,e.emit=!1,f.emit=!1;var g=a.Sprite.fromFrame("Particles/particle_big.png");g.anchor.set(.5),g.scale.set(3.5),g.blendMode=a.BLEND_MODES.ADD,g.tint=16758886,Dd.Scene.layerParticle_ADD.addChild(g);var h=(new i).to(g,.35,{alpha:0});h.stop(),this.update=function(a){d.update(a),c.update(a),e.update(a),f.update(a),b-=a,b<0&&this.stop()},this.stop=function(){b>0&&(d.cleanup(),c.cleanup(),e.cleanup(),f.cleanup()),g.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this),fa.Count--,ge--},this.start=function(a){b=3.1,d.ownerPos.set(a.x,a.y),c.ownerPos.set(a.x,a.y),e.ownerPos.set(a.x,a.y),f.ownerPos.set(a.x,a.y),g.position.copy(a),g.visible=!0,g.alpha=.35,h.gotoAndPlay(0),Dd.Effects.Decals.Add(a.x,a.y,1.1,1.7),d.emit=!0,c.emit=!0,e.emit=!0,f.emit=!0,fa.Count++,ge++,Dd.Effects.VFXHandler.Add(this)}}function ga(){var b=0,c=new a.particles.Emitter(Dd.Scene.layerParticle,[a.Texture.fromFrame("Particles/debris01.png"),a.Texture.fromFrame("Particles/debris02.png"),a.Texture.fromFrame("Particles/debris03.png"),a.Texture.fromFrame("Particles/debris04.png")],Sd),d=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/flame.png")],Ud),e=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/spark.png")],ce);d.emit=!1,c.emit=!1,e.emit=!1;var f=a.Sprite.fromFrame("Particles/particle_big.png");f.anchor.set(.5),f.scale.set(3.5),f.blendMode=a.BLEND_MODES.ADD,f.tint=16758886,Dd.Scene.layerParticle_ADD.addChild(f);var g=(new i).to(f,.35,{alpha:0});g.stop(),this.update=function(a){d.update(a),c.update(a),e.update(a),b-=a,b<0&&this.stop()},this.stop=function(){b>0&&(d.cleanup(),c.cleanup(),e.cleanup()),f.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this),ga.Count--},this.start=function(a){b=2,d.ownerPos.set(a.x,a.y),c.ownerPos.set(a.x,a.y),e.ownerPos.set(a.x,a.y);var h=180*a.rotation/k.PI;d.minStartRotation=e.minStartRotation=c.minStartRotation=h-50,d.maxStartRotation=e.maxStartRotation=c.maxStartRotation=h+50,f.position.copy(a),f.visible=!0,f.alpha=.35,g.gotoAndPlay(0),Dd.Effects.Decals.Add(a.x,a.y,.4,.6,.5),d.emit=!0,c.emit=!0,e.emit=!0,ga.Count++,Dd.Effects.VFXHandler.Add(this)}}function ha(){var b=void 0,c=!1,d=!1,e=!1,f=new Oc,g=0,h=300,i=300,j=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/particle.png"),a.Texture.fromFrame("Particles/flamethrow.png"),a.Texture.fromFrame("Particles/flamethrow2.png")],Wd);j.emit=!1,this.update=function(a){if(f.copy(b.getMuzzleFlashPosition(e)),g=180*b.getWeaponOrientation(e)/k.PI,j.updateOwnerPos(f.x,f.y),j.minStartRotation=g-5,j.maxStartRotation=g+5,d&&(timeleft-=a,timeleft<=0))return void this.stop(!0);var c=i/300,l=h/300/c;j.frequency=.004/c,j.minLifetime=.1*l,j.maxLifetime=.45*l,j.startSpeed=800*c,j.endSpeed=400*c,h=z(h,i,3*a),j.update(a)},this.stop=function(a){if(j.emit=!1,a){c=!0,j.cleanup();var e=b.VFX.indexOf(this);e!=-1&&b.VFX.splice(e,1),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)}else d=!0,timeleft=1},this.updateRange=function(a,b){h=a,i=b},this.start=function(a,h,i){this.updateRange(h,h),e=i,d=!1,timeleft=1,b=a,c=!1,f.copy(b.getMuzzleFlashPosition(e)),g=180*b.getWeaponOrientation(e)/k.PI,j.ownerPos.copy(f),j.minStartRotation=g-5,j.maxStartRotation=g+5,j.resetPositionTracking(),j.emit=!0,b.VFX.push(this),Dd.Effects.VFXHandler.Add(this)}}function ia(){var b=.5,c=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/particle.png"),a.Texture.fromFrame("Particles/flamethrow.png"),a.Texture.fromFrame("Particles/flamethrow2.png")],Xd),d=void 0,e=0;c.emit=!1;var f=new Oc;this.update=function(a){d&&(f.set(d.position.x,d.position.y),c.updateOwnerPos(f.x,f.y)),c.update(a),b-=a,b<0&&this.stop()},this.stop=function(){b>0&&c.cleanup(),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a,g,h,i){d=i,e=180*h/k.PI,c.maxStartRotation=e+80,c.minStartRotation=e-80,d?f.set(d.position.x,d.position.y):f.set(a,g),c.updateOwnerPos(f.x,f.y),c.resetPositionTracking(),c.emit=!0,b=1,Dd.Effects.VFXHandler.Add(this)}}function ja(){var b=!1,c=!1,d=0,e=new a.Container,f=a.Sprite.fromFrame("Particles/grenade.png"),g=a.Sprite.fromFrame("Particles/grenade.png");f.scale.set(1),f.anchor.set(.5),g.anchor.set(.5),g.tint=0,g.alpha=.2,e.addChild(g,f);var h=0,i=new a.Point,j=null,l=0,m=2.5,n=1,o=0,p=.8;this.update=function(a){if(l+=a,m-=a,i.x=Interp(i.x,j.data.x),i.y=Interp(i.y,j.data.y),h=Interp(h,j.data.rotation),m>2?n+=2*a:m>1.5?(n-=2*a,o=m-p):m>p?(o-=a,n=1+k.abs(3*k.sin(.4*o*k.PI*2)/k.exp(3*o))):n=1,
f.scale.set(n),g.scale.set(1+.6*(n-1)),e.position=i,f.rotation=g.rotation=h,g.y=k.max(0,40*n-35),c&&(d-=a,d<=0))return void this.stop(!0)},this.stop=function(a){this.hide(),a?(b=!0,Dd.Scene.layerParticle.removeChild(e),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)):(c=!0,d=1)},this.start=function(a,g){Dd.Scene.layerParticle.addChild(e),c=!1,d=1,b=!1,j=a,l=g||0,m=2.5-l,n=1,f.scale.set(n),i.set(a.data.x,a.data.y),h=a.data.rotation,this.show(),Dd.Effects.VFXHandler.Add(this)},this.show=function(){c||(e.visible=!0,i.x=j.data.x,i.y=j.data.y,e.position=i,h=j.data.rotation)},this.hide=function(){e.visible=!1}}function ka(){var b=void 0,c=0,d=!1,e=!1,f=!1,g=2,h=new a.Container;Dd.Scene.layerParticle_ADD.addChild(h);var i=new a.Container,j=new a.Container;h.addChild(i),h.addChild(j);var l=a.Sprite.fromFrame("Particles/speed.png");l.blendMode=a.BLEND_MODES.ADD,l.tint="0x6be5ff",l.anchor.set(.5),h.addChild(l);var m=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/particle.png")],ee),n=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/particle.png")],ee);m.emit=!1,n.emit=!1;var o=function(){c=b.width;var a=b.width/2-16,d=b.height/2-6;i.position.set(a,d),j.position.set(a,-d),l.position.x=a,l.scale.set(b.scale.x*b.effectScale,b.scale.y*b.effectScale)};this.update=function(a){return f&&(h.alpha=z(0,h.alpha,g/2),g-=a,g<=0)?void this.stop(!0):(c!=b.width&&o(),h.position.copy(b.position),h.rotation=b.rotation,!e&&b.forwardVelocity<0?(e=!0,h.scale.x=-1,h.alpha=0):e&&b.forwardVelocity>0&&(e=!1,h.scale.x=1,h.alpha=0),h.alpha=z(h.alpha,z(0,1,k.abs(b.forwardVelocity)/600),15*a),m.startAlpha=n.startAlpha=.15*h.alpha,m.endAlpha=n.endAlpha=.6*h.alpha,!b.visible||k.abs(b.forwardVelocity)<.1?(m.emit=!1,n.emit=!1):f||(m.emit=!0,n.emit=!0),h.visible=b.visible,h.updateTransform(),Dd.Scene.getPositionOf(i,!1,m.ownerPos),Dd.Scene.getPositionOf(j,!1,n.ownerPos),m._posChanged=n._posChanged=!0,m.update(a),void n.update(a))},this.stop=function(a){if(m.emit=!1,n.emit=!1,a){d=!0,h.visible=!1,m.cleanup(),n.cleanup();var c=b.VFX.indexOf(this);c!=-1&&b.VFX.splice(c,1),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)}else f=!0,g=2},this.start=function(a){h.visible=!0,h.alpha=0,f=!1,g=2,b=a,d=!1,m.emit=!0,n.emit=!0,b.VFX.push(this),Dd.Effects.VFXHandler.Add(this)}}function la(){var b=0,c=null,d=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/health.png")],Yd),e=!1,f=!1;this.update=function(a){d.updateOwnerPos(c.position.x,c.position.y),d.update(a),d.emit&&e&&this.stop(),f&&(b-=a,b<0&&this.stop(!0))},this.stop=function(a){a?(b>0&&d.cleanup(),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)):d.emit=!1},this.start=function(a,g){b=1.5,e=g,c=a,g?(d.frequency=.001,f=!0):(d.frequency=.1,f=!1),d.ownerPos.set(c.position.x,c.position.y),d.resetPositionTracking(),d.emit=!0,Dd.Effects.VFXHandler.Add(this)}}function ma(){var b=0,c=!1,d=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/health.png")],Zd);d.spawnPos.x=0,d.endScale=2.5,d.startScale=1.2;var e=!1,f=new Oc(0,0),g=new Oc(10,10),h=new Oc(0,5),i=new Oc(5,10),j=0,l=Sc.getSteps(f,h,i,g,20,!0),m=null,n=null,o=new s(a.Texture.fromImage("Content/HealingBeam.png"),l);o.blendMode=a.BLEND_MODES.ADD,o.tint=16383953,o.alpha=0,o._scale=0,Dd.Scene.layerParticle_ADD.addChildAt(o,0),this.update=function(a){j+=a,p(a),d.update(a),c&&(b-=a,b<0&&this.stop(!0))};var p=function(a){c?(o._scale=z(o._scale,.5,10*a),o.alpha=z(o.alpha,0,10*a)):(o._scale=z(o._scale,1,10*a),o.alpha=z(o.alpha,1,10*a));var b=n.getMuzzleFlashPosition(e),j=n.getWeaponOrientation(e);f.copy(b),g.copy(m.position);var k=Oc.Distance(f,g);Oc.Forward(j,.9*k,h),h.x+=f.x,h.y+=f.y,Oc.Forward(g.angleTowards(f),.1*k,i),i.x+=g.x,i.y+=g.y,Sc.getSteps(f,h,i,g,20,!0,l),o.Offset-=600*a,d.updateOwnerPos(m.position.x,m.position.y)};this.stop=function(a){return d.emit=!1,a?(b>0&&d.cleanup(),o.visible=!1,PE.ObjectCache.free(this),void Dd.Effects.VFXHandler.Remove(this)):(c=!0,void(b=2.1))},this.start=function(a,b,f){j=0,n=a,m=b,e=f,c=!1,o.Offset=50*k.random(),o.visible=!0,d.resetPositionTracking(),d.emit=!0,p(0),Dd.Effects.VFXHandler.Add(this)}}function na(){var b=0,c=!1,d=new a.Container;Dd.Scene.layerParticle_ADD.addChild(d);var e=new a.particles.Emitter(d,[a.Texture.fromFrame("Particles/health.png")],Zd);e.spawnPos.x=0,e.endScale=2.5,e.startScale=1.2;var f=!1,g=0,h=null;this.update=function(a){g+=a,e.update(a);var i=h.getMuzzleFlashPosition(f),j=h.getWeaponOrientation(f);d.position=i,d.rotation=j,c&&(b-=a,b<0&&this.stop(!0))},this.stop=function(a){return e.emit=!1,a?(b>0&&e.cleanup(),PE.ObjectCache.free(this),void Dd.Effects.VFXHandler.Remove(this)):(c=!0,void(b=.5))},this.start=function(a,b){g=0,h=a,f=b,c=!1,e.resetPositionTracking(),e.emit=!0,Dd.Effects.VFXHandler.Add(this)}}function oa(){var b=0,c=null,d=new a.Container,e=new a.particles.Emitter(d,[a.Texture.fromFrame("Particles/flame.png")],Td);e.startSpeed=500,e.endSpeed=500,e.startAlpha=.25,e.endAlpha=0,e.maxParticles=7,e.startColor=[196,244,126],e.endColor=[196,244,126];var f=a.Sprite.fromFrame("Particles/pulse.png");f.anchor.set(.5),f.scale.set(0),f.alpha=.4,f.blendMode=a.BLEND_MODES.ADD,f.tint=13827930;var g=a.Sprite.fromFrame("Particles/pulse.png");g.anchor.set(.5),g.scale.set(0),g.alpha=.5,g.blendMode=a.BLEND_MODES.ADD,g.tint=16383953,d.addChild(f,g),Dd.Scene.layerGroundObjects_ADD.addChild(d);var h=(new i).to(f,.5,{alpha:0},0).to(f.scale,.5,{x:8,y:8},0).to(g,.8,{alpha:0},0).to(g.scale,.8,{x:10,y:10},0);h.stop(),this.update=function(a){e.update(a),d.position=c.position,b-=a,b<0&&this.stop()},this.stop=function(){b>0&&e.cleanup(),d.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a){c=a,d.visible=!0,b=1,d.position=c.position,h.gotoAndPlay(0),e.emit=!0,Dd.Effects.VFXHandler.Add(this)}}function pa(){var b=!1,c=!1,d=0,e=new a.Container,f=new a.Container;f.parentLayer=Dd.Scene.layerParticle_ADD,f.scale.set(.9,.6);var g=new P(Dd.Audio.Base.missile),h=new a.particles.Emitter(Dd.Scene.layerParticle,[a.Texture.fromFrame("Particles/dust.png")],_d),i=new a.particles.Emitter(f,[a.Texture.fromFrame("Particles/mini_flash_1.png"),a.Texture.fromFrame("Particles/mini_flash_2.png"),a.Texture.fromFrame("Particles/mini_flash_3.png"),a.Texture.fromFrame("Particles/mini_flash_4.png")],Zd),j=a.Sprite.fromFrame("Particles/missile_01.png"),l=!1;j.scale.set(1.2),j.anchor.y=.5,f.rotation=k.PI,e.addChild(f,j);var m=0,n=new a.Point,o=null;h.emit=!1,i.emit=!1;var p=0;this.update=function(a){p+=a,l?(n.x=Interp(n.x,o.data.x),n.y=Interp(n.y,o.data.y),m=Interp(m,o.data.rotation)):(n.x=o.data.x,n.y=o.data.y,m=o.data.rotation),e.position=n,e.rotation=m,h.updateOwnerPos(n.x,n.y);var b=180*m/k.PI;if(h.minStartRotation=b-180,h.maxStartRotation=b-180,c){if(d-=a,d<=0)return void this.stop(!0)}else g.SetPosition(n.x,n.y);h.update(a),i.update(a)},this.stop=function(a){this.hide(),a?(b=!0,Dd.Scene.layerParticle.removeChild(e),h.cleanup(),i.cleanup(),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)):(c=!0,d=1)},this.start=function(a,f){Dd.Scene.layerParticle.addChild(e),c=!1,d=1,b=!1,o=a,l=f,p=0,n.set(a.data.x,a.data.y),m=a.data.rotation,g.Play(n.x,n.y),g.Seek(p),i.ownerPos.set(0),h.ownerPos.set(n.x,n.y),this.show(),Dd.Effects.VFXHandler.Add(this)},this.show=function(){c||(j.visible=!0,h.resetPositionTracking(),h.emit=!0,i.emit=!0,n.x=o.data.x,n.y=o.data.y,e.position=n,m=o.data.rotation,h.ownerPos.set(n.x,n.y))},this.hide=function(){g.IsPlaying()&&g.FadeOut(.5),j.visible=!1,h.emit=!1,i.emit=!1}}function qa(){var b=0,c=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/spark.png")],{alpha:{start:1,end:0},scale:{start:.1,end:.7,minimumScaleMultiplier:1.5},color:{start:"#ff4800",end:"#ffe38f"},speed:{start:200,end:350},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:0,max:0},lifetime:{min:.2,max:.25},blendMode:"add",frequency:.01,emitterLifetime:.1,maxParticles:3,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"}),d=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/flame.png")],{alpha:{start:1,end:0},scale:{start:.1,end:.35,minimumScaleMultiplier:1.5},color:{start:"#ff4800",end:"#ffe38f"},speed:{start:120,end:0},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:0,max:0},lifetime:{min:.1,max:.35},blendMode:"add",frequency:.005,emitterLifetime:.1,maxParticles:10,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"});d.emit=!1,c.emit=!1;var e=a.Sprite.fromFrame("Particles/particle_big.png");e.anchor.set(.5),e.scale.set(1.5),e.blendMode=a.BLEND_MODES.ADD,e.tint=16758886,Dd.Scene.layerParticle_ADD.addChild(e);var f=(new i).to(e,.35,{alpha:0});f.stop(),this.update=function(a){c.update(a),d.update(a),b-=a,b<0&&this.stop()},this.stop=function(){b>0&&(c.cleanup(),d.cleanup()),e.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a,g){b=1,c.ownerPos.set(a.x,a.y),d.ownerPos.set(a.x,a.y);var h=180*g/k.PI;d.minStartRotation=c.minStartRotation=h-100,d.maxStartRotation=c.maxStartRotation=h+100,e.position.set(a.x,a.y),e.visible=!0,e.alpha=.2,f.gotoAndPlay(0),d.emit=!0,c.emit=!0,Dd.Effects.VFXHandler.Add(this)}}function ra(){var b=0,c=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/spark.png")],{alpha:{start:1,end:0},scale:{start:.1,end:.7,minimumScaleMultiplier:1.5},color:{start:"#ff4800",end:"#ffe38f"},speed:{start:250,end:400},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:0,max:0},lifetime:{min:.2,max:.25},blendMode:"add",frequency:.01,emitterLifetime:.1,maxParticles:5,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"}),d=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/flame.png")],{alpha:{start:1,end:0},scale:{start:.1,end:.4,minimumScaleMultiplier:1.5},color:{start:"#ff4800",end:"#ffe38f"},speed:{start:150,end:0},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:0,max:0},lifetime:{min:.1,max:.4},blendMode:"add",frequency:.005,emitterLifetime:.1,maxParticles:15,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"});d.emit=!1,c.emit=!1;var e=a.Sprite.fromFrame("Particles/particle_big.png");e.anchor.set(.5),e.scale.set(1.5),e.blendMode=a.BLEND_MODES.ADD,e.tint=16758886,Dd.Scene.layerParticle_ADD.addChild(e);var f=(new i).to(e,.35,{alpha:0});f.stop(),this.update=function(a){c.update(a),d.update(a),b-=a,b<0&&this.stop()},this.stop=function(){b>0&&(c.cleanup(),d.cleanup()),e.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a,g){b=1,c.ownerPos.set(a.x,a.y),d.ownerPos.set(a.x,a.y);var h=180*g/k.PI;d.minStartRotation=c.minStartRotation=h-100,d.maxStartRotation=c.maxStartRotation=h+100,e.position.set(a.x,a.y),e.visible=!0,e.alpha=.2,f.gotoAndPlay(0),d.emit=!0,c.emit=!0,Dd.Effects.VFXHandler.Add(this)}}function sa(){var b=0,c=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/spark.png")],{alpha:{start:1,end:0},scale:{start:.1,end:1,minimumScaleMultiplier:1.5},color:{start:"#ff4800",end:"#ffe38f"},speed:{start:300,end:500},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:0,max:0},lifetime:{min:.2,max:.3},blendMode:"add",frequency:.01,emitterLifetime:.1,maxParticles:8,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"}),d=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/flame.png")],{alpha:{start:1,end:0},scale:{start:.2,end:.55,minimumScaleMultiplier:1.5},color:{start:"#ff4800",end:"#ffe38f"},speed:{start:150,end:0},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:0,max:0},lifetime:{min:.1,max:.4},blendMode:"add",frequency:.005,emitterLifetime:.1,maxParticles:20,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"});d.emit=!1,c.emit=!1;var e=a.Sprite.fromFrame("Particles/particle_big.png");e.anchor.set(.5),e.scale.set(1.5),e.blendMode=a.BLEND_MODES.ADD,e.tint=16758886,Dd.Scene.layerParticle_ADD.addChild(e);var f=(new i).to(e,.35,{alpha:0});f.stop(),this.update=function(a){c.update(a),d.update(a),b-=a,b<0&&this.stop()},this.stop=function(){b>0&&(c.cleanup(),d.cleanup()),e.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a,g){b=1,c.ownerPos.set(a.x,a.y),d.ownerPos.set(a.x,a.y);var h=180*g/k.PI;d.minStartRotation=c.minStartRotation=h-100,d.maxStartRotation=c.maxStartRotation=h+100,e.position.set(a.x,a.y),e.visible=!0,e.alpha=.2,f.gotoAndPlay(0),d.emit=!0,c.emit=!0,Dd.Effects.VFXHandler.Add(this)}}function ta(){var b=0,c=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/spark.png")],{alpha:{start:1,end:0},scale:{start:.1,end:1,minimumScaleMultiplier:1.5},color:{start:"#ff4800",end:"#ffe38f"},speed:{start:300,end:500},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:0,max:0},lifetime:{min:.2,max:.3},blendMode:"add",frequency:.01,emitterLifetime:.1,maxParticles:3,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"}),d=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/flame.png")],{alpha:{start:1,end:0},scale:{start:.01,end:.55,minimumScaleMultiplier:1.5},color:{start:"#ff4800",end:"#ffe38f"},speed:{start:300,end:0},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:0,max:0},lifetime:{min:.2,max:.3},blendMode:"add",frequency:.01,emitterLifetime:.1,maxParticles:15,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"});d.emit=!1,c.emit=!1;var e=a.Sprite.fromFrame("Particles/particle_big.png");e.anchor.set(.5),e.scale.set(1.5),e.blendMode=a.BLEND_MODES.ADD,e.tint=16758886,Dd.Scene.layerParticle_ADD.addChild(e);var f=(new i).to(e,.35,{alpha:0});f.stop(),this.update=function(a){c.update(a),d.update(a),b-=a,b<0&&this.stop()},this.stop=function(){b>0&&(c.cleanup(),d.cleanup()),e.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a,g){b=1,c.ownerPos.set(a.x,a.y),d.ownerPos.set(a.x,a.y);var h=180*(g-k.PI)/k.PI;c.minStartRotation=h+80,c.maxStartRotation=h-80,e.position.set(a.x,a.y),e.visible=!0,e.alpha=.2,f.gotoAndPlay(0),d.emit=!0,c.emit=!0,Dd.Effects.VFXHandler.Add(this)}}function ua(){var b=0,c=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/flame.png")],Ud),d=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/lightning1.png"),a.Texture.fromFrame("Particles/lightning2.png"),a.Texture.fromFrame("Particles/lightning3.png")],ce);c.emit=!1,d.emit=!1;var e=a.Sprite.fromFrame("Particles/particle_big.png");e.anchor.set(.5),e.scale.set(2.5),e.blendMode=a.BLEND_MODES.ADD,e.tint=15959172,Dd.Scene.layerParticle_ADD.addChild(e);var f=(new i).to(e,.35,{alpha:0});f.stop(),c.endColor=d.endColor=[224,54,54],c.startColor=d.startColor=[251,208,208],d.startSpeed=200,d.endSpeed=0,d.startScale=.2,d.endScale=.8,this.update=function(a){c.update(a),d.update(a),b-=a,b<0&&this.stop()},this.stop=function(){b>0&&(c.cleanup(),d.cleanup()),e.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this),ua.Count--},this.start=function(a,g){b=2,c.ownerPos.set(a.x,a.y),d.ownerPos.set(a.x,a.y);var h=180*g/k.PI;c.minStartRotation=d.minStartRotation=h-90,c.maxStartRotation=d.maxStartRotation=h+90,e.position.copy(a),e.visible=!0,e.alpha=.35,f.gotoAndPlay(0),Dd.Effects.Decals.Add(a.x,a.y,.6,.8,.3),c.emit=!0,d.emit=!0,ua.Count++,Dd.Effects.VFXHandler.Add(this)}}function va(){var b=void 0,c=!1,d=!1,e=!1,f=new Oc,g=0,h=700,i=700,j=700,l=0,m=new a.Container;m.parentLayer=Dd.Scene.layerParticle_ADD,m.scale.set(.5);var n=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/minigun_projectile_2.png")],$d),o=new a.particles.Emitter(m,[a.Texture.fromFrame("Particles/mini_flash_1.png"),a.Texture.fromFrame("Particles/mini_flash_2.png"),a.Texture.fromFrame("Particles/mini_flash_3.png"),a.Texture.fromFrame("Particles/mini_flash_4.png")],Zd);n.emit=!1,o.emit=!1;var p=1,q=!1,r=0;this.update=function(a){var c=b.getWeaponOrientation(e);return f.copy(b.getMuzzleFlashPosition(e)),g=180*c/k.PI,m.position=f,m.rotation=c,n.updateOwnerPos(f.x,f.y),n.minStartRotation=g,n.maxStartRotation=g,d&&(l-=a,l<=0)?void this.stop(!0):(p=h/i,n.minLifetime=.15*p,n.maxLifetime=.2*p,q?(r+=a,r>.11&&(q=!1,p=1)):h=z(h,j,3*a),n.update(a),void o.update(a))},this.stop=function(a){if(n.emit=!1,o.emit=!1,a){n.cleanup(),o.cleanup(),c=!0,Dd.Scene.layerParticle_ADD.removeChild(m);var e=b.VFX.indexOf(this);e!=-1&&b.VFX.splice(e,1),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)}else d=!0,l=1},this.updateRange=function(a,b){q=!0,r=0,p=h/i,h=a,j=b},this.start=function(a,h,i){this.updateRange(h,h),Dd.Scene.layerParticle_ADD.addChild(m),e=i,d=!1,l=1,b=a,c=!1;var j=b.getWeaponOrientation(e);f.copy(b.getMuzzleFlashPosition(e)),g=180*j/k.PI,m.position=f,m.rotation=j,n.ownerPos.copy(f),n.minStartRotation=g-5,n.maxStartRotation=g+5,n.resetPositionTracking(),n.emit=!0,o.emit=!0,b.VFX.push(this),Dd.Effects.VFXHandler.Add(this)}}function wa(){var b=void 0,c=3,d=100,e=new Oc,f=new a.Sprite(a.Texture.fromFrame("Particles/projectile.png"));this.texture="Particles/projectile.png",this.textures={},f.anchor.set(.9,.5),Dd.Scene.layerProjectiles.addChild(f),this.update=function(a){f.position.x+=e.x*d*a,f.position.y+=e.y*d*a,c-=a,c<0&&this.stop()},this.stop=function(){f.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(g,h,i,j,l,m,n){if(f.visible=!0,l&&l!==this.texture){this.texture=l;var o=this.textures[this.texture];o||(o=a.Texture.fromFrame(this.texture),this.textures[this.texture]=o),f.texture=o,n!=f.blendmode&&(1==n?Dd.Scene.layerParticle_ADD.addChild(f):Dd.Scene.layerProjectiles.addChild(f),f.blendMode=n)}f.tint=m,b=g;var p=g.getWeaponOrientation(h,!0);e.x=k.cos(p),e.y=k.sin(p),f.position.copy(b.getMuzzleFlashPosition(h,!0)),f.rotation=p,d=i,c=j/d,Dd.Effects.VFXHandler.Add(this)}}function xa(){var b=1,c=new a.particles.Emitter(Dd.Scene.layerParticle,[a.Texture.fromFrame("Particles/debris01.png"),a.Texture.fromFrame("Particles/debris02.png"),a.Texture.fromFrame("Particles/debris03.png"),a.Texture.fromFrame("Particles/debris04.png")],Sd);c.emit=!1,this.update=function(a){c.update(a),b-=a,b<0&&this.stop()},this.stop=function(){b>0&&c.cleanup(),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a,d){c.ownerPos.x=a,c.ownerPos.y=d,c.emit=!0,b=1,Dd.Effects.VFXHandler.Add(this)}}function ya(){var b=1,c=new Oc,d=new a.particles.Emitter(Dd.Scene.layerParticle,[a.Texture.fromFrame("Particles/debris01.png"),a.Texture.fromFrame("Particles/debris02.png"),a.Texture.fromFrame("Particles/debris03.png"),a.Texture.fromFrame("Particles/debris04.png")],Sd),e=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/spark.png")],be),f=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/flame.png")],Vd);d.emit=!1,e.emit=!1,f.emit=!1;var g=a.Sprite.fromFrame("Particles/particle_big.png");g.anchor.set(.5),g.scale.set(2),g.blendMode=a.BLEND_MODES.ADD,g.tint=16758886,Dd.Scene.layerParticle_ADD.addChild(g);var h=h=(new i).to(g,.2,{alpha:0});h.stop(),this.update=function(a){d.ownerPos.set(c.x,c.y),e.ownerPos.set(c.x,c.y),f.ownerPos.set(c.x,c.y),d.update(a),e.update(a),f.update(a),b-=a,b<0&&this.stop()},this.stop=function(){b>0&&(d.cleanup(),e.cleanup(),f.cleanup()),g.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a){return Dd.Camera.isOnScreen(a,300,300)?(b=1,c=a,g.position.copy(c),g.visible=!0,g.alpha=.25,h.gotoAndPlay(0),d.emit=!0,e.emit=!0,f.emit=!0,void Dd.Effects.VFXHandler.Add(this)):void PE.ObjectCache.free(this)}}function za(){var b=0,c=void 0,d=5,e=0,f=0,g=new a.Container;Dd.Scene.layerProjectiles.addChild(g);var h=a.Sprite.fromFrame("Particles/particle_big.png");h.anchor.set(.5),h.scale.set(1.5),h.blendMode=a.BLEND_MODES.ADD,h.tint=16711680,Dd.Scene.layerParticle_ADD.addChild(h);var i=a.Sprite.fromFrame("Buffs/RapidFire/bullet.png"),j=a.Sprite.fromFrame("Buffs/RapidFire/bullet.png"),l=a.Sprite.fromFrame("Buffs/RapidFire/bullet.png");i.anchor.x=j.anchor.x=l.anchor.x=.5,i.anchor.y=j.anchor.y=l.anchor.y=6,j.rotation=2.1,l.rotation=4.2,i.scale.set(-1,1),j.scale.set(-1,1),l.scale.set(-1,1),g.addChild(i),g.addChild(j),g.addChild(l);var m=new a.particles.Emitter(Dd.Scene.layerParticle,[a.Texture.fromFrame("Buffs/RapidFire/case.png")],Nd),n=0;this.update=function(a){if(b-=a,!c.visible&&g.visible)return h.visible=!1,g.visible=!1,void(m.emit=!1);if(c.visible&&!g.visible)h.visible=!0,g.visible=!0;else if(!c.visible)return;if(g.position.copy(c.position),h.position.copy(c.position),f=.2*k.abs(k.cos(.7*b))+.1,c.primaryWeapon){var i=n!=c.primaryWeapon.ammo;n=c.primaryWeapon.ammo,i?(d=z(d,100,4*a),e=.2*k.abs(k.cos(90*b)),m.ownerPos.copy(c.getMuzzleFlashPosition(!0,!0,!1)),m.emit=!0):(d=z(d,5,5*a),e=0,m.emit=!1)}g.rotation-=a*d,h.alpha=f+e,h.scale.set(.2*k.abs(k.cos(.7*b))+1.3),m.update(a),b<0&&this.stop()},this.stop=function(){h.visible=!1,g.visible=!1,m.emit=!1,m.cleanup(),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a){b=7,c=a,h.visible=!0,g.visible=!0,Dd.Effects.VFXHandler.Add(this)}}function Aa(){var c=new a.Container;Dd.Scene.layerParticle_ADD.addChild(c);var d=void 0,e=!1,f=2,g=0,h=0,i=.4,j=0,l=a.Sprite.fromFrame("Particles/shield.png"),m=a.Sprite.fromFrame("Particles/shield.png"),n=a.Sprite.fromFrame("Particles/shield.png"),o=a.Sprite.fromFrame("Particles/shield.png"),p=a.Sprite.fromFrame("Particles/shield.png");l.blendMode=m.blendMode=n.blendMode=o.blendMode=p.blendMode=a.BLEND_MODES.ADD,l.anchor.x=m.anchor.x=n.anchor.x=o.anchor.x=p.anchor.x=.338,l.anchor.y=m.anchor.y=n.anchor.y=o.anchor.y=p.anchor.y=.533,c.addChild(l),c.addChild(m),c.addChild(n),c.addChild(o),c.addChild(p);var q=a.Sprite.fromFrame("Particles/particle_big.png");q.tint=l.tint=m.tint=n.tint=o.tint=p.tint=10252799,q.anchor.set(.5),q.scale.set(2),q.blendMode=a.BLEND_MODES.ADD,c.addChild(q);var r=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/hexagon.png")],ae);r.emit=!1;var s=0;this.update=function(a){g-=a,g<=0&&!e&&this.stop(),h+=3*a,j=.1*k.cos(h),p.visible?(i<.4&&(i+=1*a,i>.4&&(i=.4)),i>.4&&(i-=1*a,i<.4&&(i=.4)),c.alpha=k.min(i+j,1)):c.alpha=i,c.scale.x>1&&(c.scale.y-=2*a,c.scale.x-=2*a,c.scale.x<1&&(c.scale.y=1,c.scale.x=1)),l.rotation+=2*a,m.rotation-=2*a,n.rotation+=3*a,o.rotation-=3*a,p.rotation+=6*a,c.visible=!!d.visible,e&&(i=z(0,i,f/2),f-=a,f<=0&&this.stop(!0)),s>0&&(s-=a,r.update(a)),c.position.copy(d.position)},this.setState=function(a){p.visible&&(i=1,Dd.Scene.getPositionOf(d.body,!1,r.ownerPos),l.visible=a>=5,m.visible=a>=4,n.visible=a>=3,o.visible=a>=2,p.visible=a>=1,0==a&&b.to(this,1,{baseAlpha:0}),c.scale.set(1.2),d.visible&&(r.emit=!0,s=.5))},this.stop=function(a){if(e=!0,f=2,a){c.visible=!1,r.cleanup();var b=d.VFX.indexOf(this);b!=-1&&d.VFX.splice(b,1),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)}},this.start=function(a,b,h){e=!1,f=2,d=a,g=h+5,c.visible=q.visible=!0,l.visible=b>=5,m.visible=b>=4,n.visible=b>=3,o.visible=b>=2,p.visible=b>=1,i=0,d.VFX.push(this),Dd.Effects.VFXHandler.Add(this)}}function Ba(){var c=4,d=0,e=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/dust.png")],Pd),f=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/dust.png")],Pd),g=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/dust.png")],Pd),h=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/dust.png")],Pd),i=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/dust.png")],Pd),j=!1,l=!1,m=!1,n=!1,o=!1,p=!1;e.spawnCircle.radius=120,e.spawnCircle.minRadius=70,f.spawnCircle.radius=180,f.spawnCircle.minRadius=130,g.spawnCircle.radius=240,g.spawnCircle.minRadius=190,h.spawnCircle.radius=280,h.spawnCircle.minRadius=250,i.spawnCircle.radius=340,i.spawnCircle.minRadius=310,e.startScale=f.startScale=g.startScale=h.startScale=i.startScale=.6,e.endScale=f.endScale=g.endScale=h.endScale=i.endScale=1.8,e.maxParticles=f.maxParticles=g.maxParticles=h.maxParticles=i.maxParticles=50,e.emit=!1;var q=a.Sprite.fromFrame("Particles/particle_big.png");q.blendMode=a.BLEND_MODES.ADD,q.tint=16007746,q.anchor.set(.5),q.scale.set(4.5),Dd.Scene.layerParticle_ADD.addChild(q);var r=a.Sprite.fromFrame("Particles/cracks.png");r.anchor.set(.5),r.scale.set(.2*k.random()+1.1),Dd.Scene.layerGroundDecals.addChild(r),this.update=function(a){d>=0&&(j||(e.emit=j=!0),e.update(a),d>=.08&&(l||(f.emit=l=!0),f.update(a),d>=.16&&(m||(g.emit=m=!0),g.update(a),d>=.24&&(n||(h.emit=n=!0),h.update(a),d>=.32&&(o||(i.emit=o=!0),i.update(a))))),d>2&&!p&&(p=!0,b.fromTo(r,2,{alpha:.7},{alpha:0}))),d+=a,c-=a,c<0&&this.stop()},this.stop=function(){c>0&&(e.cleanup(),f.cleanup(),g.cleanup(),h.cleanup(),i.cleanup()),q.visible=!1,r.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a,s){j=l=m=n=o=p=!1,q.visible=!0,q.position.set(a,s),r.visible=!0,r.rotation=k.random()*k.PI,r.position.set(a,s),e.ownerPos.set(a,s),f.ownerPos.set(a,s),g.ownerPos.set(a,s),h.ownerPos.set(a,s),i.ownerPos.set(a,s),c=4,d=0,b.fromTo(r,.2,{alpha:0},{alpha:.7}),b.fromTo(q,.35,{alpha:.5},{alpha:0}),Dd.Effects.VFXHandler.Add(this)}}function Ca(){var c=void 0,d=3,e=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/hexagon.png")],de),f=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/hexagon.png")],de),g=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/flame.png")],Qd),h=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/flame.png")],Qd);e.emit=!1,f.emit=!1,g.emit=!1;var j=!1,k=!1,l=a.Sprite.fromFrame("Particles/particle_big.png");l.anchor.set(.5),l.scale.set(3.5),l.blendMode=a.BLEND_MODES.ADD,l.tint=16771583,Dd.Scene.layerParticle_ADD.addChild(l);var m=(new i).to(l,.35,{alpha:0});m.stop();var n=new Oc(1);this.update=function(a){j&&(e.update(a),h.update(a)),k&&(f.update(a),g.update(a)),d-=a,d<0&&this.stop()},this.stop=function(){d>0&&(j&&(e.cleanup(),h.cleanup()),k&&(f.cleanup(),g.cleanup())),l.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this),c.removeScaleMultiplier(n)},this.start=function(a,i){c=a,j=a.visible,k=a.visibleLastUpdate,k&&(f.ownerPos.copy(c.position),g.ownerPos.copy(c.position),f.emit=!0,g.emit=!0,Dd.Audio.Common.teleport.Play(c.position.x,c.position.y)),j&&(n.set(1),c.addScaleMultiplier(n),l.position.copy(i),l.visible=!0,l.alpha=.35,m.gotoAndPlay(0),e.ownerPos.copy(i),h.ownerPos.copy(i),e.emit=!0,h.emit=!0,b.from(n,.25,{x:0,y:0}),Dd.Audio.Common.teleport.Play(i.x,i.y)),d=3,Dd.Effects.VFXHandler.Add(this)}}function Da(){var b=0,c=new a.particles.Emitter(Dd.Scene.layerParticle,[a.Texture.fromFrame("Particles/debris01.png"),a.Texture.fromFrame("Particles/debris02.png"),a.Texture.fromFrame("Particles/debris03.png"),a.Texture.fromFrame("Particles/debris04.png")],Sd),d=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/flame.png")],Ud),e=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/lightning1.png"),a.Texture.fromFrame("Particles/lightning2.png"),a.Texture.fromFrame("Particles/lightning3.png")],ce);d.emit=!1,c.emit=!1,e.emit=!1;var f=a.Sprite.fromFrame("Particles/particle_big.png");f.anchor.set(.5),f.scale.set(3.5),f.blendMode=a.BLEND_MODES.ADD,f.tint=10797563,Dd.Scene.layerParticle_ADD.addChild(f),d.endColor=e.endColor=[54,84,224],d.startColor=e.startColor=[208,222,251],e.startSpeed=200,e.endSpeed=0;var g=(new i).to(f,.35,{alpha:0});g.stop(),this.update=function(a){d.update(a),c.update(a),e.update(a),b-=a,b<0&&this.stop()},this.stop=function(){b>0&&(d.cleanup(),c.cleanup(),e.cleanup()),f.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this),Da.Count--},this.start=function(a,h){b=2,d.ownerPos.set(a.x,a.y),c.ownerPos.set(a.x,a.y),e.ownerPos.set(a.x,a.y);var i=180*h/k.PI;d.minStartRotation=e.minStartRotation=c.minStartRotation=i-90,d.maxStartRotation=e.maxStartRotation=c.maxStartRotation=i+90,f.position.copy(a),f.visible=!0,f.alpha=.35,g.gotoAndPlay(0),Dd.Effects.Decals.Add(a.x,a.y,.6,.8,.3),d.emit=!0,c.emit=!0,e.emit=!0,Da.Count++,Dd.Effects.VFXHandler.Add(this)}}function Ea(){var b=!1,c=0,d=new a.Container,e=a.Sprite.fromFrame("Particles/tesla_01.png"),f=a.Sprite.fromFrame("Particles/tesla_02.png");e.blendMode=f.blendMode=a.BLEND_MODES.ADD,e.anchor.y=f.anchor.y=.5,e.anchor.x=f.anchor.x=.01,e.scale.y=f.scale.y=1.2,d.addChild(e,f);var g=0,h=new a.Point,i=0,j=.1,l=0,m=0;this.update=function(a){if(l+=a,m<i?(m=k.min(i,8e3*l),d.width=m):d.alpha=z(d.alpha,0,10*a),j-=a,j<=0&&(e.alpha=k.random(),f.alpha=k.random(),j=.1),c-=a,c<=0)return void this.stop(!0)},this.stop=function(a){a?(Dd.Scene.layerParticle_ADD.removeChild(d),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)):(b=!0,c=1)},this.start=function(a,j,n){var o=.3*k.random()+.85;d.scale.y=k.random()>.5?-o:o,o=.3*k.random()+.85,d.scale.y=k.random()>.5?-o:o,o=.4*k.random()+.9,e.scale.y=k.random()>.5?-o:o,o=.4*k.random()+.9,f.scale.y=k.random()>.5?-o:o,d.width=0,Dd.Scene.layerParticle_ADD.addChild(d),m=0,b=!1,c=1,l=0,d.alpha=1,h.set(a.x,a.y),g=j,i=n,d.position=h,d.rotation=g,Dd.Effects.VFXHandler.Add(this)}}function Fa(){var b,c=!1,d=0,e=!1,f=this.container=new a.Container,g=a.Sprite.fromFrame("Particles/particle.png"),h=a.Sprite.fromFrame("Particles/particle_big.png"),i=new P(Dd.Audio.Base.tesla_shot),j=!1,k=new a.particles.Emitter(f,[a.Texture.fromFrame("Particles/lightning1.png"),a.Texture.fromFrame("Particles/lightning2.png")],Rd);k.emit=!1,g.blendMode=h.blendMode=a.BLEND_MODES.ADD,g.anchor.set(.5),h.anchor.set(.5),h.tint=14208,f.addChild(g,h);var l=new a.Point,m=0;this.update=function(a){if(m+=a,l.copy(b.getMuzzleFlashPosition(e)),f.position=l,m<=.6){j&&i.SetPosition(l.x,l.y);var n=m/.6;n=n,h.scale.set(z(1,.1,n)),g.scale.set(z(0,.5,n)),k.endScale=z(.1,.5,n),h.alpha=z(0,.5,n)}else if(m<=.75){var n=(m-.6)/.15;h.alpha=z(1,0,n),g.alpha=z(.3,0,n),f.rotation=b.getWeaponOrientation(e),c||this.stop()}else c||this.stop(),h.alpha=0,g.alpha=0;if(c){if(d-=a,d<=0)return void this.stop(!0)}else k.update(a)},this.stop=function(a){k.emit=!1,k.cleanup(),a?(Dd.Scene.layerParticle_ADD.removeChild(f),PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)):(c=!0,d=.3)},this.start=function(a,n,o){f.scale.set(1.2),g.scale.set(0),g.alpha=1,h.scale.set(1),h.alpha=0,j=!!o,k.resetPositionTracking(),k.emit=!0,Dd.Scene.layerParticle_ADD.addChild(f),c=!1,d=1,m=0,b=a,e=n,Dd.Effects.VFXHandler.Add(this),l.copy(b.getMuzzleFlashPosition(e)),f.position=l,j&&i.Play(l.x,l.y)}}function Ga(){var c=3,d=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/lightning1.png"),a.Texture.fromFrame("Particles/lightning2.png"),a.Texture.fromFrame("Particles/lightning3.png"),a.Texture.fromFrame("Particles/lightning4.png"),a.Texture.fromFrame("Particles/lightning5.png")],fe);d.emit=!1;var e=a.Sprite.fromFrame("Particles/particle_big.png");e.blendMode=a.BLEND_MODES.ADD,e.tint=11334399,e.anchor.set(.5),e.scale.set(4.5),Dd.Scene.layerParticle_ADD.addChild(e),this.update=function(a){d.update(a),c-=a,c<0&&this.stop()},this.stop=function(){c>0&&d.cleanup(),e.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a,f){e.visible=!0,e.position.set(a,f),d.ownerPos.set(a,f),d.emit=!0,c=3,b.fromTo(e,.35,{alpha:.5},{alpha:0}),Dd.Effects.VFXHandler.Add(this)}}function Ha(){var b=0,c=new a.particles.Emitter(Dd.Scene.layerParticle_ADD,[a.Texture.fromFrame("Particles/spark.png")],ce);c.emit=!1,c.startSpeed=300,c.startScale=.1,c.endScale=1,c.maxParticles=3;var d=a.Sprite.fromFrame("Particles/particle_big.png");d.anchor.set(.5),d.scale.set(1.5),d.blendMode=a.BLEND_MODES.ADD,
d.tint=16758886,Dd.Scene.layerParticle_ADD.addChild(d);var e=(new i).to(d,.35,{alpha:0});e.stop(),this.update=function(a){c.update(a),b-=a,b<0&&this.stop()},this.stop=function(){b>0&&c.cleanup(),d.visible=!1,PE.ObjectCache.free(this),Dd.Effects.VFXHandler.Remove(this)},this.start=function(a,f,g){b=2,c.ownerPos.set(a,f);var h=180*(g-k.PI)/k.PI;c.minStartRotation=h+80,c.maxStartRotation=h-80,d.position.set(a,f),d.visible=!0,d.alpha=.2,e.gotoAndPlay(0),c.emit=!0,Dd.Effects.VFXHandler.Add(this)}}function Ia(){oe=this;GameObject.call(this),this.initialize=function(a,b,c){Dd.ScoreBoard.setTeams(c)},this.Clear=function(){for(var a in this.Players)this.RemovePlayer(a)},this.on(0,function(a,b){Dd.Spectator||(Dd.Spectator=new $b),Dd.Spectator.show(),Dd.Spectator.setName(b),Dd.spectating=!0,Dd.Camera.setTarget(a),pf.close(!0)})}function Ja(){this.maxTier=8;var b=!1,c=new a.UI.Container("100%","100%");Dd.Scene.UI_Respawn.addChild(c),GameObject.call(this);var d=this,e={},f={},g=a.UI.Sprite.fromFrame("UI/blank.png");g.width=g.height="100%",g.alpha=.2,c.addChild(g);var h=this.teamContainer=new a.UI.Container("100%",580);c.addChild(h),h.align="center",h.anchorBottom=0,h.visible=h.interactiveChildren=!1;var i=this.spawnContainer=new a.UI.Container("100%",580);c.addChild(i),i.align="center",i.valign="middle",i.anchorBottom=0,i.visible=i.interactiveChildren=!1;var j=new a.UI.DynamicText("Game Settings",{style:ad,allowTags:!0});j.anchorTop=j.anchorLeft=20,c.addChild(j);var l=new a.UI.Button({width:300,height:35,text:new a.UI.DynamicText("LEAVE GAME",{style:bd}),background:new a.UI.SliceSprite(a.Texture.fromFrame("UI/ui-box-line-red.png"),7)});l.align="center",l.anchorBottom=20;var m=function(b){a.UI.Tween.to(l.background,.6,{alpha:b?1:.5},a.UI.Ease.Circ.CircOut)};l.on("hover",m),m(!1),l.on("click",function(){Dd.Connection.invoke("LeaveCheck")}),c.addChild(l);var n=!1;this.initTeamScreen=function(){if(!n){n=!0;var b=a.UI.Sprite.fromFrame("UI/Spawn/select_team.png");b.align="center",b.top=10,h.addChild(b)}};var o=!1;this.initSpawnScreen=function(){if(!o){o=!0;var b=a.UI.Sprite.fromFrame("UI/Spawn/select_crew.png");b.align="center",b.top=5,i.addChild(b);var c=new a.UI.DynamicText("ALL TANKS ARE REPAIRED FOR FREE WHEN THE GAME ENDS",{style:vd});c.align="center",c.y=60,i.addChild(c);var d=this.wallet=new re;d.container.align="center",d.container.top=80,i.addChild(d.container);var e=this.preview=new se;e.container.align="center",e.container.top=255,i.addChild(e.container);i.addChild((this.controlGuide=new ie).container)}};var p=function(a){var b=a.length;i.width=150*b;for(var c,d=0;d<10;d++)c=e[d],c&&(c.container.visible=!1);c=void 0;for(var d=0;d<b;d++){var f=e[d];f||(e[d]=f=new qe,i.addChild(f.container)),f.container.visible=!0,f.container.x=150*d,f.container.y=100,f.update(a[d])}},q=function(a){for(var b in f)f[b].hide();h.width=310*a.length-10;for(var c=0;c<a.length;c++)!function(){var b=a[c],d=f[b];d||(d=f[b]=new ue(b),h.addChild(d.container)),d.container.x=310*c,d.container.y=100,d.show()}()};this.hide=function(){this.visible&&(GameObject.prototype.hide.call(this),a.UI.Tween.to(c,.3,{alpha:0,onComplete:function(){d.visible||(c.visible=!1)}},a.UI.Ease.Circ.CircOut),b&&(Dd.UI.FilterGray.Remove(),b=!1),c.interactiveChildren=!1)},this.toggleGuide=function(a){a?this.controlGuide.show():this.controlGuide.hide()},this.show=function(){this.visible||(GameObject.prototype.show.call(this),c.visible=!0,c.interactiveChildren=!0,a.UI.Tween.to(c,.5,{alpha:1},a.UI.Ease.Circ.CircOut),b||(Dd.UI.FilterGray.Add(),b=!0))};var r=!1,s=!1;this.toggleSpawn=function(a){a!==s&&(a&&this.toggleTeam(!1),this.initSpawnScreen(),this.toggleGuide(a),s=a,i.visible=i.interactiveChildren=a)},this.toggleTeam=function(a){a!==r&&(a&&this.toggleSpawn(!1),this.initTeamScreen(),r=a,h.visible=h.interactiveChildren=a)},this.destroy=function(){GameObject.prototype.destroy.call(this)},this.initialize=function(a,b,d,e,f){Dd.allowTeamChange=a,this.maxTier=d,this.levelName=f,pe=this,c.interactiveChildren=!1,c.alpha=0,this.hide(),j.value="Region: <b>"+e+"</b>\nGameMode: <b>"+Dd.currentGameMode.name+"</b>\nMax Tier:  <b>"+this.maxTier+"</b>\nMap:  <b>"+f+"</b>\n",Dd.TeamColors.emit("update")};var t,v,w,x,y=!1,z=!1,A=-1,B=function(a){t-=a,t<=A&&(A-=.1,w.value=k.max(0,t).toFixed(1)),t<=0&&D()},C=function(b){b&&(t=b),A=t-.1,z||(PE.GameLoop.onUpdate(B,d),z=!0),y||(x=new a.UI.Container,v=new a.UI.DynamicText("RESPAWN IN",{style:wd}),w=new a.UI.DynamicText(t.toFixed(1),{style:xd}),w.top=15,x.addChild(v,w),x.align=v.align=w.align="center",x.valign="middle",Dd.Scene.UI_Respawn.addChild(x),y=!0),x.visible=!0,a.UI.Tween.to(x,.2,{alpha:1},a.UI.Ease.Circ.CircOut)},D=function(){z&&(PE.GameLoop.offUpdate(B,d),a.UI.Tween.to(x,.3,{alpha:0,onComplete:function(){z||(x.visible=!1)}},a.UI.Ease.Circ.CircOut),z=!1)};this.on(0,function(a,b){p(a),d.toggleSpawn(!0),d.show(),d.wallet.setBalance(b)}),this.on(1,function(a){d.toggleTeam(!1),d.toggleSpawn(!1),d.wallet.setBalance(a),u(function(){d.toggleSpawn(!0),d.show()},1500)}),this.on(10,function(a){q(a),d.toggleTeam(!0),d.show()}),this.on(20,function(a){d.wallet.setBalance(a)}),this.on(2,function(a,b,c,f,g){var h=e[a];h&&(b?h.showRepaired():h.showNeedGold(),h.setLives(c),h.setRepairCost(b,f)),d.wallet.setBalance(g)}),this.on(3,function(a,b,c,d){var f=e[b];if(f){f.setLives(c),f.setRepairCost(c==-1||c>0,d)}pe.hide(),t=a.unpack(2),t>.5&&C()})}function Ka(){GameObject.call(this);var e,f,g,h,i,j,l=this,m=!1,n=!1,o=new a.UI.Container,p=new a.UI.Container;containerBottom=new a.UI.Container,this.isOpen=!1,this.destroy=function(){GameObject.prototype.destroy.call(this),this.Clear()},this.initialize=function(a){ve=this,this.hide(),void 0!==a&&this.Open(null,a.unpack(2),null)};var q,r=function(a){Be.Load(["Content/won.png","Content/lost.png"],function(){n=!0,a()})},s=function(b){if(!m){if(!n)return void r(function(){s(b)});e=l.mentions=new Na,f=l.xpBar=new Pa,g=l.shareArea=new Oa,h=l.crewProgress=new La,m=!0,o.pivot=.5,o.horizontalAlign="center",o.verticalAlign="middle",Dd.Scene.UI_GameEnd.addChild(o),e.container.y=-200,o.addChild(e.container),p.y=200,p.addChild(f.container),o.addChild(p),containerBottom.y=400,containerBottom.addChild(g.container,h.container),o.addChild(containerBottom),i=new a.UI.Button({background:new a.UI.DynamicText("(Sign in to save your progression)",{style:yd})}),i.on("click",function(){pf.open()}),i.horizontalAlign="center",i.anchorBottom=20,Dd.Scene.UI_GameEnd.addChild(i),j=new a.UI.DynamicText("Next game begins in -- seconds",{style:yd}),j.align="center",j.anchorBottom=30,Dd.Scene.UI_GameEnd.addChild(j),wonSprite=a.UI.Sprite.fromImage("Content/won.png"),lostSprite=a.UI.Sprite.fromImage("Content/lost.png"),wonSprite.pivot=.5,lostSprite.width=853,lostSprite.height=285,lostSprite.pivot=.5,lostSprite.width=732,lostSprite.height=354,wonSprite.visible=lostSprite.visible=!1,o.addChild(wonSprite,lostSprite),Dd.onResize(function(){z()}),b()}},v=function(d,e){if(!e||!n)return void u(function(){v(d,!0)},1100);var i=d["Crews"];h.load(i),b.set(containerBottom,{y:400}),pf.wallet.UpdateBalance(ah.Gold,d["NewGold"]),Dd.XPSystem.SetExperience(d["NewXp"]);var j=d["NewXp"]-d["Xp"]-d["PremiumXp"],k=35;f.prepare(j),f.addItem("Reward",d["Xp"],d["Gold"],0),f.addItem("<b>50%</b> Premium Bonus",d["PremiumXp"],d["PremiumGold"],0),d["LevelRewards"].length>0&&(k+=35,f.addItem("<b>Level Up</b>",0,d["LevelGold"],d["LevelRewards"])),c.delayedCall(4,function(){a.UI.Tween.to(g.container,6,{alpha:1},a.UI.Ease.Circ.CircOut),f.start(function(){a.UI.Tween.to(containerBottom,1,{y:400+k},a.UI.Ease.Circ.CircOut),i.length&&(h.show(),Zh.authenticated||u(function(){xc.open("You must sign-in to save your progression!")},2e3));var b=d["LevelRewards"];b.length&&eg.loadItemInfo(b,function(){for(var a=0;a<b.length;a++)!function(){new Zb("New Inventory Item","1x "+eg.items[b[a]].name).addButton("Show Inventory",200,5592405,function(){pf.openSubMenu(pf.inventoryPage)}).show(5e3)}()})})})},w=!1,x=function(){Dd.Scene.UI_GameEnd.visible=!0,Dd.UI.PlayerGUI.hide(),Dd.Scene.layerUIArrows.visible=!1,w||(Dd.UI.FilterBlur.Add(),Dd.UI.FilterGray.Add(),w=!0),pe&&pe.hide(),a.UI.Tween.to(j,4,{alpha:1})},y=function(a){if(Dd.joined){a?Dd.Audio.Common.music_game_end_winning.Play():Dd.Audio.Common.music_game_end_losing.Play();var c=a?wonSprite:lostSprite;c.visible=!0,b.fromTo(c,4,{scale:.6,alpha:0},{scale:1,alpha:1,ease:Power0.easeNone})}};this.Open=function(c,d,f){if(pe&&pe.hide(),!m)return void s(function(){l.Open(c,d,f)});this.Clear(),i.visible=!Zh.authenticated;for(var g in Dd.Players)Dd.Players[g].gameEnd();this.isOpen=!0,z(),this.currentCountdown=d;var h=d;a.UI.Tween.set(j,{alpha:0}),b.to(l,l.currentCountdown,{currentCountdown:0,roundProps:"currentCountdown",ease:Linear.easeNone,onUpdate:function(){h!==this.target.currentCountdown&&(h=this.target.currentCountdown,j.text="Next game begins in "+h+" seconds",1===h&&a.UI.Tween.to(j,2,{alpha:0}))}}),e.load(f),q=u(function(){x(),null!==c&&y(c),f&&e.show()},1e3)},this.Clear=function(){Dd.Scene.UI_GameEnd.visible=!1,t(q),m&&this.isOpen&&(this.isOpen=!1,ye.Clear(),this.dimm&&(this.dimm.visible=!1),wonSprite.visible=lostSprite.visible=!1,this.xpBar.container.alpha=0,a.UI.Tween.set(g.container,{alpha:0}),w&&(Dd.UI.FilterBlur.Remove(),Dd.UI.FilterGray.Remove(),w=!1),Dd.Scene.layerUIArrows.visible=!0,e.hide())};var z=function(){if(m&&l.isOpen){o.scale=ye.levelUpContainer.scale=k.min(k.max(.4,Dd.width/Dd.Scene.PIXIUIStage.scale.x/2e3),k.max(.4,Dd.height/Dd.Scene.PIXIUIStage.scale.x/1440),1)}};this.on(99,function(a){v(a)}),d["demo"]=function(){l.Open(!0,45,[Dd.player.sessionID,"SHARP SHOOTER","59 Shots Fired (47% Hit)",Dd.player.sessionID,"ZONES DEFENDED","1 Zones Defended",Dd.player.sessionID,"KILLSTEALER","1 kills stolen",Dd.player.sessionID,"ZONES CAPTURED","1 Zones Captured",Dd.player.sessionID,"PUNCHING BAG","3,794 Damage Taken"]),v({Crews:[{StartXp:4e4,EndXp:40100,Index:0,LevelUp:0},{StartXp:950,EndXp:1002,Index:1,LevelUp:0},{StartXp:2e3,EndXp:2025,Index:2,LevelUp:0}],Gold:128,Level:7,LevelGold:300,LevelRewards:[827],NewGold:3996,NewXp:10041,PremiumGold:64,PremiumXp:32,Xp:64})}}function La(){var b=this.container=new a.UI.Container(100,200);b.visible=!1,b.align="center",b.y=0;var c={},d=[],e=null,f=0;this.load=function(a){this.hide(),f=0;for(var g=0;g<d.length;g++)b.removeChild(d[g].container);d=[];for(var g=0;g<a.length;g++){var h=c[g];h||(h=c[g]=new Ma),h.container.anchorLeft=356*g,b.addChild(h.container),h.load(a[g]),d.push(h),h.amt>f&&(f=h.amt,e=h)}this.container.width=356*d.length-6},this.hide=function(){this.container.visible=!1},this.show=function(){b.visible=!0;for(var a=0;a<d.length;a++){var c=d[a];c.show(150*a),c.playSound=c==e}}}function Ma(){var b=this.container=new a.UI.Container(350,62);b.pivot=.5,b.anchorLeft=0;var c=this,d=new a.UI.SliceSprite(new a.Texture.fromFrame("UI/ui-box-5.png"),10);d.width=d.height="100%",d.alpha=.17,d.tint=0,b.addChild(d);var e=new a.UI.Container;e.height=17,e.anchorRight=10,e.anchorBottom=9,e.anchorLeft=100,b.addChild(e);var f=a.UI.Sprite.fromFrame("UI/blank.png");f.width=f.height="100%",f.alpha=.5,f.tint=0,e.addChild(f);var g=a.UI.Sprite.fromFrame("UI/blank.png");g.width=g.height="100%",d.height="100%",g.alpha=.9,g.tint=9102402,e.addChild(g);var h=new a.UI.Container;h.valign="middle",h.x=50,b.addChild(h);var i=new S;i.container.scale.set(.6),i.body.rotation=-.8,h.container.addChild(i.container);var j=new a.UI.DynamicText("ALPHA",{style:ld});j.anchorLeft=99,j.y=3,b.addChild(j);var l=new a.UI.DynamicText("Level 2",{style:dd,allowTags:!0});l.anchorRight=10,l.y=3,b.addChild(l);var m=new a.UI.DynamicText("",{style:vd,allowTags:!0});m.anchorBottom=8,m.anchorRight=15,b.addChild(m);var n=new a.UI.DynamicText("",{style:vd,allowTags:!0});n.anchorBottom=8,n.anchorLeft=105,b.addChild(n);var o,p=-1,q=-1,r=-1;this.updateBar=function(c,d){var e=_b(c);(p!=e||d)&&(p=e,q=1==e?0:tf[e-1],r=tf[p],l.text="Level <b>"+p,d||(this.levelUpBox||(this.levelUpBox=new a.UI.Button({background:new a.UI.SliceSprite(cf,3,(!0),(!0)),text:new a.UI.DynamicText("<font tint='#ffde00' shadow='#ffde00 1 0 0 10'><b>LEVEL UP</b></font>",{style:dd,allowTags:!0}),width:150,height:30}),this.levelUpBox.background.tint=0,this.levelUpBox.pivot=.5,this.levelUpBox.top=-10,this.levelUpBox.align="center",this.levelUpBox.alpha=0,this.levelUpBox.on("click",function(){pf.crews.previews[o.index].container.click()}),b.addChild(this.levelUpBox)),Dd.Audio.Common.ui_level_up_2.Play(),a.UI.Tween.fromTo(this.levelUpBox,.5,{alpha:0,scale:0},{alpha:1,scale:1},a.UI.Ease.Bounce.BounceOut)));var f=8==p?1:(c-q)/(r-q),h=this._xp.toFixed()+" / "+r;d||h==m.text||(m.text=this._xp.toFixed()+" / "+r,n.text="+"+(this._xp-this.startXp).toFixed(),this.playSound&&Dd.Audio.Common.ui_gain_xp.Play()),g.width=(100*f).toFixed(2)+"%"},this.load=function(b){if(this.clear(),o=pf.crews.getCrew(b["Index"]),this.levelUpBox&&a.UI.Tween.set(this.levelUpBox,{alpha:0}),o&&(this.startXp=b["StartXp"],this.endXp=b["EndXp"],this.amt=this.endXp-this.startXp,this._xp=this.startXp,o.xp=this.endXp,pf.crews.updatePreview(o.index),this.updateBar(this._xp,!0),j.text=vf[o.index],o.classId>0)){var c=tankClass[o.classId];c&&(i.loadClass(o.classId,c.SkinCannon?c.SkinCannon:c.DefaultSkinCannon,c.SkinBody?c.SkinBody:c.DefaultSkinBody),i.container.visible=!0)}},this.clear=function(){a.UI.Tween.set(b,{alpha:0,scale:0}),i.container.visible=!1,b.alpha=0},this.show=function(d){if(d)return void u(function(){c.show(0)},d);Dd.Audio.Common.ui_crate_wosh.Play();var e=this.endXp-this.startXp,f=k.min(5,k.max(1,e/20));u(function(){a.UI.Tween.to(c,f,{_xp:c.endXp,onUpdate:function(a){c.updateBar(c._xp)}},a.UI.Ease.Power2.easeOut)},1500),a.UI.Tween.fromTo(i.container.scale,1,{x:.2,y:.2},{x:.6,y:.6},a.UI.Ease.Power2.easeOut),a.UI.Tween.to(b,1,{alpha:1,scale:1},a.UI.Ease.Bounce.BounceOut)}}function Na(){var c=this.container=new a.UI.Container,d=new we(337,1),e=new we(307,2),f=new we(300,3),g=new we(287,4),h=new we(287,5);e.container.position.x=-294,f.container.position.x=294,g.container.position.x=-588,h.container.position.x=588,c.container.addChild(d.container),c.container.addChild(e.container),c.container.addChild(f.container),c.container.addChild(g.container),c.container.addChild(h.container),this.show=function(){Dd.joined&&(b.delayedCall(2.9,function(){d.Show()}),b.delayedCall(3.08,function(){e.Show()}),b.delayedCall(3.26,function(){f.Show()}),b.delayedCall(3.44,function(){g.Show()}),b.delayedCall(3.62,function(){h.Show()}))},this.hide=function(){d.Hide(),e.Hide(),f.Hide(),g.Hide(),h.Hide()},this.load=function(a){if(a)for(var b=1,c=0;c<a.length;c+=3){var i=1===b?d:2===b?e:3===b?f:4===b?g:h,j=a[c],k=a[c+1],l=a[c+2];i.Set(j,k,l),b++}}}function Oa(){var b=this.container=new a.UI.Container;b.y=75,b.alpha=0,b.horizontalAlign="center",b.pivotX=.5,b.scale=1.4;var d=new a.UI.Button({background:new a.UI.Sprite(new a.Texture.fromFrame("UI/share.png"))}),e=new a.UI.Button({background:new a.UI.Sprite(new a.Texture.fromFrame("UI/tweet.png"))});d.pivot=e.pivot=.5,d.y=e.y=0,d.rotation=e.rotation=0,d.x=-60,e.x=60,b.addChild(d,e),d.on("hover",function(b){b?(this.background.sprite.texture=new a.Texture.fromFrame("UI/share_hover.png"),c.to(this,.1,{scale:1.05,ease:Sine.easeOut})):(this.background.sprite.texture=new a.Texture.fromFrame("UI/share.png"),c.to(this,.1,{scale:1,ease:Sine.easeIn}))}),d.on("press",function(a,b){this.background.tint=b?14606046:16777215}),d.on("click",function(){var a=Dd.player,b=Dd.currentGameMode.name;a?a.winner&&a.Kills>=5?Dd.share("I just WON in TankWars.io "+b+" with "+a.Kills+" kills!"):a.winner?Dd.share("I just WON in TankWars.io "+b+"!"):a.Kills>=5?Dd.share("I just got "+a.Kills+" kills in TankWars.io "+b+"!"):Dd.share():Dd.share()}),e.on("hover",function(b){b?(this.background.sprite.texture=new a.Texture.fromFrame("UI/tweet_hover.png"),c.to(this,.1,{scale:1.05,ease:Sine.easeOut})):(this.background.sprite.texture=new a.Texture.fromFrame("UI/tweet.png"),c.to(this,.1,{scale:1,ease:Sine.easeIn}))}),e.on("press",function(a,b){this.background.tint=b?14606046:16777215}),e.on("click",function(){var a=Dd.player,b=Dd.currentGameMode.name;a?a.winner&&a.Kills>=5?Dd.tweet("I just WON in TankWars.io "+b+" with "+a.Kills+" kills!"):a.winner?Dd.tweet("I just WON in TankWars.io "+b+"!"):a.Kills>=5?Dd.tweet("I just got "+a.Kills+" kills in TankWars.io "+b+"!"):Dd.tweet():Dd.tweet()});var f=self.shareAnimation=(new j).to(d,.1,{y:-10,rotation:.1,ease:Sine.easeOut}).to(d,.2,{y:0,rotation:0,ease:Sine.easeIn}).to(d,.05,{y:-5,rotation:.1,ease:Sine.easeOut}).to(d,.1,{y:0,rotation:0,ease:Sine.easeIn}),g=self.tweetAnimation=(new j).to(e,.1,{y:-10,rotation:-.1,ease:Sine.easeOut},.1).to(e,.2,{y:0,rotation:0,ease:Sine.easeIn}).to(e,.05,{y:-5,rotation:-.1,ease:Sine.easeOut}).to(e,.1,{y:0,rotation:0,ease:Sine.easeIn});g.stop(),f.stop(),this.play=function(){g.gotoAndPlay(0),f.gotoAndPlay(0)}}function Pa(){var b=[],d=this,e=this.container=new a.UI.SliceSprite(new a.Texture.fromFrame("UI/progress-bar-bg.png"),25);e.y=50,e.width=680,e.pivot=.5,e.alpha=0;var f=new a.UI.Text("Level",{fill:"#FFFFFF",fontSize:32,fontFamily:Yc});f.x=20,f.y=-26,e.addChild(f);var g=new a.UI.Text("210",{fill:"#FFFFFF",fontSize:32,fontFamily:Yc,fontWeight:"bold"});g.pivotX=0,g.right=-8,f.addChild(g),barFill=new a.UI.SliceSprite(new a.Texture.fromFrame("UI/progress-bar-fill.png"),5),barFill.anchorTop=16,barFill.anchorLeft=16,e.addChild(barFill);var h=new a.UI.Text("0 / 150",{fill:"#333333",fontSize:22,fontFamily:Yc,fontWeight:"bold"});h.horizontalAlign="center",h.verticalAlign="middle",e.addChild(h);var i=new a.UI.Sprite(new a.Texture.fromFrame("UI/Rank/Medium/214.png"));i.anchorLeft=-32,i.y=12,rankIconTo=new a.UI.Sprite(new a.Texture.fromFrame("UI/Rank/Medium/215.png")),rankIconTo.anchorRight=-32,rankIconTo.y=12,e.addChild(i,rankIconTo);var l=new a.UI.Container(200);l.width=380,l.pivotX=.5,l.right=235,l.y=11,e.addChild(l);var m=new a.UI.SliceSprite(new a.Texture.fromFrame("UI/ui-box-tower.png"),40,(!0),(!1));m.width="100%",m.tint=0,m.alpha=.4,m.pivotY=1,l.addChild(m),this.goldRewardBg=new a.UI.SliceSprite(new a.Texture.fromFrame("UI/ui-box-tower.png"),38,(!0),(!1)),this.goldRewardBg.width="53%",this.goldRewardBg.tint=0,this.goldRewardBg.anchorRight=0,this.goldRewardBg.alpha=1,m.addChild(this.goldRewardBg);var n=new a.UI.Text("+150",{fill:"#FFFFFF",fontSize:32,fontFamily:Yc,fontWeight:"bold"});n.pivotX=.5,n.x=90,n.y=-37,l.addChild(n);var o=new a.UI.Text("XP",{fill:"#FFFFFF",fontSize:32,fontFamily:Yc});o.pivotX=0,o.right=-8,n.addChild(o);var p=new a.UI.Text("100",{fill:"#ffe139",fontSize:32,fontFamily:Yc,fontWeight:"bold"});p.pivotX=.5,p.right=115,p.y=-37,l.addChild(p);var q=new a.UI.Sprite(new a.Texture.fromFrame("UI/coin.png"));q.pivotX=0,q.right=-8,q.y=3,p.addChild(q);var r=3,s=.8,t=(new j).fromTo(e,s,{alpha:0},{alpha:1,ease:Sine.easeOut},r).from(e,s,{width:100,ease:Sine.easeOut},r).from(l,s,{width:50,ease:Sine.easeOut},r).from(n,s,{alpha:0,ease:Sine.easeIn},r).from(p,s,{alpha:0,ease:Sine.easeIn},r).from(f,s,{alpha:0,ease:Sine.easeIn},r);t.stop();var u=new a.UI.Text("50%",{fill:"#FFFFFF",fontSize:30,fontFamily:Yc,fontWeight:"bold"}),v=new a.UI.Text("Premium Bonus",{fill:"#FFFFFF",fontSize:30,fontFamily:Yc});u.addChild(v),v.right=-6;var w=0;this.prepare=function(a){for(var c=0;c<b.length;c++)this.container.removeChild(b[c].container);b=[],p.text="+0",p._sum=0,p._value=0,w=a,this.addXp(0),t.gotoAndPlay(0)};var x=0,y=0;this.addXp=function(b,e){var f=x,j=Dd.XPSystem.GetLevel(w),l=j.Level,m=l+1,o=j.StartExperience,p=j.EndExperience,q=p-o,r=q+1,s=w-o,t=s/r;if(g.text=l,h.text=s+" / "+r,barFill.width=649*t,barFill.maxWidth="100%",i.currentLevel!==l&&(i.sprite.texture=a.Texture.fromFrame("UI/Rank/Medium/"+k.min(240,l)+".png"),i.currentLevel=l),rankIconTo.currentLevel!==m&&(rankIconTo.sprite.texture=a.Texture.fromFrame("UI/Rank/Medium/"+k.min(240,m)+".png"),rankIconTo.currentLevel=m),n.text="+"+f,b){var u=s+b,v=0,y=!1;u>q&&(v=u-q,u=q,y=!0);var z=u-s,A=v<=1,B=k.max(1,.012*z)*(A?1:1.8),C=barFill;C.current=s,C.currentFloor=s,c.to(barFill,B,{current:y?r:u,onUpdate:function(){var a=C.current;if(C.width=649*(a/(q+1)),a>=C.currentFloor+1){var b=k.floor(a),c=b-C.currentFloor;C.currentFloor=b,h.text=C.currentFloor+" / "+r,f+=c,n.text="+"+f,Dd.Audio.Common.ui_gain_xp.Play()}},onComplete:function(){v>0?(h.text=r+" / "+r,C.width=649,ye.ShowLevelUp(l+1,function(){w+=z+1,x+=z+1,d.addXp(v-1,e,f)})):(x+=z,w+=z,"function"==typeof e&&e())},ease:A?Power1.easeOut:Power0.easeNone})}else"function"==typeof e&&e()},this.addGold=function(a){var b=p;a>0&&(c.to(b,.3,{_sum:b._sum+a,onUpdate:function(){b._sum>=b._value+1&&(b._value=k.floor(b._sum),b.text="+"+b._value)}}),Dd.Audio.Common.ui_coins.Play())},this.start=function(a){x=y=0;var e=function(f){var g=b[f];g.container.y=95+37*f,g.show();var h=a;b.length>f+1&&(h=function(){c.delayedCall(1,function(){e(f+1)})}),d.addGold(g.Gold),d.addXp(g.XP,h)};e(0)},this.addItem=function(a,c,d,e){var f=new xe(a,c,d,e);this.container.addChild(f.container),b.push(f)}}function Qa(){GameObject.call(this),this.name=""}function Ra(){Qa.call(this);var a=this;this.name="KingDM",this.CurrentLeader=void 0,this.initialize=function(c,d,e,g){Qa.prototype.initialize.call(this),Dd.currentGM=Dd.GameModes.KingDM,Dd.ScoreBoard.KingDM.Init(d),u(function(){if(!a.leaderSet){a.SetLeader(Dd.Players[e])}},10),f("#inGameUI").addClass("KingDM"),c==Dd.State.Ended&&b(g.unpack(1))};var b=function(b,c){var d=null;c&&(d=JSON.parse(c)),ve.Open(a.CurrentLeader&&a.CurrentLeader.me,b,d)};this.on(0,b),this.on(1,function(b){a.SetLeader(Dd.Players[b])}),this.on(2,function(){a.CurrentLeader=void 0,a.leaderSet=!1}),this.destroy=function(){Qa.prototype.destroy.call(this),f("#inGameUI").removeClass("KingDM"),Dd.ScoreBoard.KingDM.Clear(),Dd.UI.GuidingArrowController.Clear(),this.CurrentLeader=void 0},this.SetLeader=function(a){this.leaderSet=!0,a&&(this.CurrentLeader&&this.CurrentLeader.me&&Dd.Audio.Common.kingdm_dethrone.Play(),this.CurrentLeader=a,a.me&&Dd.Audio.Common.kingdm_throne.Play())}}function Sa(){GameObject.call(this);this.initialize=function(){},this.destroy=function(){GameObject.prototype.destroy.call(this)}}function Ta(){GameObject.call(this),this.container=new a.Container,this.Position=new Vector2,this.text=new a.Text(" ",{fontFamily:"Arial",fontSize:"16px",fontWeight:"bold",fill:16777215,align:"center",dropShadow:!0,dropShadowColor:"#000000",dropShadowAngle:k.PI/6,dropShadowDistance:2}),this.text.anchor.set(.5),this.text.position.set(0,-50),this.text.parentLayer=Dd.Scene.layerText,this.dot=new G,this.uiDot=new G((!0)),this.container.addChild(this.text),this.guidingArrow=new I(this.dot.container,(!0),0,0,.5),this.zoneIndex=0,this.Letter=" ",this.Amount=0,this.Team=-1,this.Presence=-1,this.State=-1,this.initialize=function(a,b,c,d,e,f,g,h){this.zoneIndex=a,this.Letter=b,this.Position.set(c,d),this.Amount=e.unpack(2),this.Team=f,this.Presence=g,this.State=h,this.container.position.copy(this.Position),Dd.Scene.layerMapInterface.addChild(this.container),Dd.UI.GuidingArrowController.Add(this.guidingArrow),this.guidingArrow.SetTarget(this.container),this.dot.SetLetter(b),this.uiDot.SetLetter(b),this.ForceUpdateValues(),Dd.ScoreBoard.Conquest.AddZone(this)},this.on(0,function(a){this.SetAmount(a.unpack(2))}),this.on(1,function(a,b,c){var d=this.Team,e=this.Presence;this.SetTeam(a),this.SetPresence(b),this.SetState(c),this.PlayLocationSound(d,e)}),this.PlayLocationSound=function(a,b){var c=this.State,d=this.Presence,e=this.Team,f=this.Amount,g=this.zoneIndex-1;if(!(g>=6)&&Dd.player){var h=Dd.player.team;if(d==h&&c==ze.Neutralizing&&f>95)Dd.Commander.Play("location_attacking",g);else if(d==h&&c==ze.Capturing&&f<5)Dd.Commander.Play("location_taking",g);else if(a!=h&&e==h&&c==ze.Captured){for(var i in Dd.ScoreBoard.Conquest.Zones)if(Dd.ScoreBoard.Conquest.Zones[i].Team!==h)return void Dd.Commander.Play("location_taken",g);Dd.Commander.Play("location_taken_all",g)}else if(e!=a&&a!=h&&e!=h&&c==ze.Captured)Dd.Commander.Play("location_enemy_taken",g);else if(d!=h&&a!=h&&c==ze.Capturing&&f<5)Dd.Commander.Play("location_enemy_taking",g);else if(d!=h&&a==h&&c==ze.Neutralizing&&f>98)Dd.Commander.Play("location_losing",g);else if(a==h&&e!=h){for(var i in Dd.ScoreBoard.Conquest.Zones)if(Dd.ScoreBoard.Conquest.Zones[i].Team===h)return void Dd.Commander.Play("location_lost",g);Dd.Commander.Play("location_lost_all",g)}}},this.destroy=function(){this.Clear(),GameObject.prototype.destroy.call(this),Dd.Scene.layerMapInterface.removeChild(this.container)},this.SetTeam=function(a,b){if(void 0===a||a==-1)return void this.ClearTeam();if(this.Team!=a||b){this.Team=a;Dd.TeamColors.GetColor(a);this.dot.SetTeam(a),this.uiDot.SetTeam(a)}},this.ClearTeam=function(){this.Team=void 0,this.dot.ClearTeam(),this.uiDot.ClearTeam()},this.SetPresence=function(a,b){return void 0===a||a==-1?void this.ClearPresence():void((this.Presence!=a||b)&&(this.Presence=a,this.dot.SetPresence(a),this.uiDot.SetPresence(a)))},this.ClearPresence=function(){this.Presence=void 0,this.dot.ClearPresence(),this.uiDot.ClearPresence()},this.SetAmount=function(a,b){(this.Amount!=a||b)&&(this.Amount=a,this.dot.SetAmount(a),this.uiDot.SetAmount(a))},this.SetState=function(a,b){(this.State!=a||b)&&(this.State=a,this.UpdateStateText(),this.State==ze.Capturing&&(this.dot.SetTeam(this.Presence),this.uiDot.SetTeam(this.Presence)))},this.UpdateStateText=function(){this.text.text=this.State==ze.Capturing?"Capturing":this.State==ze.Neutralizing?"Neutralizing":this.State==ze.Paused?"Battle":" "},this.ForceUpdateValues=function(){this.SetTeam(this.Team,!0),this.SetPresence(this.Presence,!0),this.SetAmount(this.Amount,!0),this.SetState(this.State,!0)},this.Clear=function(){this.SetTeam(-1,!0),this.SetPresence(-1,!0),this.SetAmount(0,!0),this.SetState(-1,!0),this.guidingArrow.ClearTarget(),Dd.UI.GuidingArrowController.Remove(this.guidingArrow),this.container&&this.container.parent&&this.container.parent.removeChild(this.container)}}function Ua(){Qa.call(this);this.name="Conquest",this.Teams={},this.winLimit=0;var a=new V,b=function(){Dd.ScoreBoard.Conquest.UpdateTeamColors()};this.UpdateTeamScore=function(a,b){this.Teams[a]=b,Dd.ScoreBoard.Conquest.UpdateTeamScore(a,b),!this.playedEndingSound&&b>.9*this.winLimit&&Dd.player&&(this.playedEndingSound=Dd.Commander.Play(Dd.player.team===a?"game_ending_winning":"game_ending_losing"))},this.initialize=function(a,c){Qa.prototype.initialize.call(this),Dd.currentGM=Dd.GameModes.Conquest,this.winLimit=a;for(var d=0;d<c.length;d++){this.Teams[c[d][0]]=c[d][1]}u(function(){Dd.player&&Dd.Commander.Play("game_start")},3500),Dd.ScoreBoard.Conquest.Init(a,c),Dd.TeamColors.on("update",b,this)},this.EndGame=function(a,b,c){var d=Dd.player&&Dd.player.team==a;ve.Open(d,b,c),u(function(){Dd.Commander.Play(d?"game_won":"game_lost")},5e3)},this.Clear=function(){},this.destroy=function(){Qa.prototype.destroy.call(this),this.playedEndingSound=!1,Dd.UI.GuidingArrowController.Clear(),this.Teams={},Dd.ScoreBoard.Conquest.Clear(),Dd.TeamColors.off("update",b)},this.on(2,function(a,b,c){this.EndGame(a,b,JSON.parse(c))}),this.on(3,function(a){for(var b=a.length,c=0;c<b;c+=2)this.UpdateTeamScore(a[c],a[c+1])}),this.on(4,function(b,c,d){a.load(b,c,d)}),this.on(5,function(){for(var a in Dd.Players){var b=Dd.Players[a];b&&(b.Kills=0,b.Deaths=0,b.Assists=0,b.Score=0)}Dd.ScoreBoard.setDirty(!0)})}function Va(){Qa.call(this);this.name="Battle Royale",this.winLimit=0;var a=new V,b=new W,c=new X;this.initialize=function(a,c){Qa.prototype.initialize.call(this),Dd.currentGM=Dd.GameModes.BattleRoyal,this.winLimit=c,b.load(),Dd.ScoreBoard.BattleRoyale.Init(c),u(function(){Dd.player&&Dd.Commander.Play("game_start")},3500)},this.EndGame=function(a,b,c){var d=-1,e=-1;for(var f in this.Teams)this.Teams[f]>e&&(d=f,e=this.Teams[f]);var g=Dd.player&&Dd.player.sessionID==c;ve.Open(g,a,b),u(function(){Dd.Commander.Play(g?"game_won":"game_lost")},5e3)},this.zones={},this.Clear=function(){},this.destroy=function(){Qa.prototype.destroy.call(this),this.playedEndingSound=!1,Dd.ScoreBoard.BattleRoyale.Clear(),Dd.UI.GuidingArrowController.Clear()},this.on(0,function(a,b,c){this.EndGame(a,JSON.parse(b),c)}),this.on(1,function(b,c,d){a.load(b,c,d)}),this.on(2,function(a){}),this.on(3,function(a,b,d,e){c.load(a,b,d)})}function Wa(){GameObject.call(this);var a={x:0,y:0,rotation:0},b=null;this.update=function(c,d){b.position.x=Interp(b.position.x,a.x),b.position.y=Interp(b.position.y,a.y),b.rotation=Interp(b.rotation,a.rotation)},this.initialize=function(a,c,d,e,f,g,h){var i={};i[Tc.Texture]=a,i[Tc.Type]=c,i[Tc.Scale]={x:d,y:e},i[Tc.Alpha]=f,i[Tc.BlendMode]=g,i[Tc.Tint]=h,b=E(i,Dd.Scene.layerDynamic,Dd.Level),b.visible=!1},this.show=function(){this.visible||(GameObject.prototype.show.call(this),b.visible=!0,b.position.copy(a),b.rotation=a.rotation,PE.GameLoop.onUpdate(this.update,this))},this.hide=function(){this.visible&&(GameObject.prototype.hide.call(this),b&&(b.visible=!1),PE.GameLoop.offUpdate(this.update,this))},this.destroy=function(){this.hide(),GameObject.prototype.destroy.call(this),null!=b&&null!=b.parent&&b.parent.removeChild(b)},this.on(0,function(b,c,d){a.x=b,a.y=c,a.rotation=d.unpack(2),this.show()})}function Xa(){var a={};this.addWeapon=function(b){a[b.id]||(a[b.id]=b)},this.show=function(){for(var b in a)a[b].show()},this.hide=function(){for(var b in a)a[b].hide()},this.destroy=function(){a={}}}function Ya(){GameObject.call(this),this.testScale=1;var b=this;this._gunPosition=new Oc,this.gunRotation=0;var c=this.data={x:0,y:0,rotation:0,gunRotation:0},d=this.healthbar=new J(100);d.container.position.y=-50,d.container.scale.set(Dd.Camera.uiZoom);var e=this.tank=new S;e.container.addChild(d.container),this.player=void 0,this.helper=void 0,this.class=void 0,this.immortal=!0,this.dead=!1,this.respawned=!0,this.visibleLastUpdate=!1,this.me=!1,this.team=-1,this.currentRate=.6,this.VFX=[],this.effectScale=1,this.weapons=new Xa,this.velocity=0,this.forwardVelocity=0,this.rightVelocity=0,this.directionVectorForward=new Oc(0,0),this.directionVectorRight=new Oc(0,0),this.directionVectorGlobal=new Oc(0,0),this.name="",this.nametag=void 0,this.nameSpritesheetObject=void 0,this.updateColors=function(){this.setTeam(this.player?this.player.team:-1)},this.setName=function(b){if(b!=this.name){this.nameSpritesheetObject&&this.DisposeName();var c={fontFamily:'"Arial Black", Gadget, sans-serif',fontSize:"10pt",fontWeight:"bold",fill:["#FFFFFF","#dedede"],stroke:"#222222",strokeThickness:2.5,lineJoin:"round"},e=new a.Container;e.addChild(new a.Text(b,c)),this.nameSpritesheetObject=Dd.Scene.NameSpritesheet.add(e),this.nametag=this.nameSpritesheetObject.sprite,this.nametag.parentLayer=Dd.Scene.layerName,this.nametag.anchor.set(.5,1),this.nametag.position.y=-6,this.name=b,d.container.addChild(this.nametag)}},this.DisposeName=function(){this.nameSpritesheetObject.dispose()},this.friendsWith=function(a){return null!=a&&void 0!==a&&(0==a.team?a==this:this.team==a.team)},this.setTeam=function(a){this.team=a,d.setColor(Dd.TeamColors.GetColor(a,this.me)),d.TeamBadge(!(this.me||!Dd.player||a==-1)&&(0!=a&&Dd.player.team==a))};var f,g,h,i,l,m;this.setEngineSound=function(){this.EngineSound&&this.EngineSound.Stop();var a;f=.5,g=.5,h=.5,i=1.8,l=1.1,m=1.5,1==this.class.WeightClass?a=Dd.Audio.Base.tank_engine_small:2==this.class.WeightClass?a=Dd.Audio.Base.tank_engine_medium:(a=Dd.Audio.Base.tank_engine_large,l=.6,m=1);var b=this.EngineSound=new P(a,(!0),[Dd.Audio.Groups.MyTank]);b.Preload(function(){b.Play()})},this.update=function(a,d){if(b.me&&b.helper.Update(),b.gunRotation=Interp(b.gunRotation,c.gunRotation),e.container.position.x=Interp(e.container.position.x,c.x),e.container.position.y=Interp(e.container.position.y,c.y),b.updateScale(),this.me&&this.EngineSound&&this.EngineSound.IsPlaying()){var j=!(!PE.InputManager.Custom("Drive")&&!PE.InputManager.AxisY),k=Mathf.abs(this.forwardVelocity),n=this.dead?0:Mathf.lerp(h,i,k/400),o=Mathf.lerp(l,m,k/300);g=Mathf.lerp(g,o,(j?3:6)*a),f=Mathf.lerp(f,n,(j?3:6)*a),
this.EngineSound.Rate(f),this.EngineSound.SetVolume(g)}},this.show=function(){this.visibleLastUpdate=this.visible,this.visible||(GameObject.prototype.show.call(this),this.weapons.show(),this.helper&&this.helper.show(),e.container.visible=!0,e.container.position.copy(c),e.body.rotation=c.rotation,this.gunRotation=c.gunRotation,e.gun.rotation=this.gunRotation-c.rotation,PE.GameLoop.onUpdate(this.update,this),d.container.scale.set(Dd.Camera.uiZoom),this.respawned&&this.me&&(b.helper.Spawn(),this.respawned=!1))},this.hide=function(){this.visibleLastUpdate=this.visible,this.visible&&(GameObject.prototype.hide.call(this),this.weapons.hide(),this.helper&&this.helper.hide(),PE.GameLoop.offUpdate(this.update,this),e.container.visible=!1,this.forwardVelocity=0,this.rightVelocity=0,this.velocity=0)},this.destroy=function(){GameObject.prototype.destroy.call(this),this.weapons.destroy(),Dd.Scene.layerTank.removeChild(e.container),this.helper&&(this.helper.Dispose(),this.helper=void 0),this.EngineSound&&this.EngineSound.Stop(),PE.GameLoop.offUpdate(this.update,this),Dd.TeamColors.off("update",this.updateColors)};var n=this;this.spawnAnimation=new j({repeat:12,onComplete:function(){n.RemoveImmortalityEffect()}}).to(e.container,.1,{alpha:.4,ease:Power4.easeOut},0).to(e.container,.1,{alpha:.8,ease:Power4.easeOut},.15),this.spawnAnimation.stop(),this.PlayImmortalityEffect=function(){this.immortal=!0,this.spawnAnimation.gotoAndPlay(0)},this.RemoveImmortalityEffect=function(){this.spawnAnimation.gotoAndStop(0),e.container.alpha=1,this.immortal=!1};var o=[],p=new Oc;this.addScaleMultiplier=function(a){o.indexOf(a)===-1&&o.push(a)},this.removeScaleMultiplier=function(a){var b=o.indexOf(a);b!==-1&&o.splice(b,1)},this.updateScale=function(){Dd.Camera.dirtyZoom&&d.container.scale.set(Dd.Camera.uiZoom),p.set(1);for(var a=0;a<o.length;a++)p.x*=o[a].x,p.y*=o[a].y;1!=this.testScale&&(p.x*=this.testScale,p.y*=this.testScale),e.body.scale.x==p.x&&e.body.scale.y==p.y||e.body.scale.copy(p)};var q,r,s,t=(new Oc,new Oc),u=new Oc;this.getMuzzleFlashPosition=function(a,b,c){return q=a?this.class.PrimaryBodyMounted:this.class.SecondaryBodyMounted,r=a?this.class.PrimaryOffset:this.class.SecondaryOffset,s=this.getWeaponOrientation(a,b,c),t.x=r.x,t.y=r.y,t.rotate(s),q||0==this.class.CannonOffset.x&&0==this.class.CannonOffset.y||(u.x=this.class.CannonOffset.x,u.y=this.class.CannonOffset.y,u.rotate(this.rotation),t.x+=u.x,t.y+=u.y),t.x+=this.position.x,t.y+=this.position.y,t},this.getWeaponOrientation=function(a,b,c){return a?this.class.PrimaryBodyMounted?c?.5*(this.data.rotation+this.rotation):b?this.data.rotation:this.rotation:c?.5*(this.data.gunRotation+this.gunRotation):b?this.data.gunRotation:this.gunRotation:this.class.SecondaryBodyMounted?c?.5*(this.data.rotation+this.rotation):b?this.data.rotation:this.rotation:c?.5*(this.data.gunRotation+this.gunRotation):b?this.data.gunRotation:this.gunRotation},this.UpdatePosition=function(a,b,d,f,g,h){void 0!==g&&v(g),void 0!==h&&(v(g),!h&&this.dead&&(this.dead=!1,e.spawn()),h&&!this.dead&&(this.dead=!0,e.die())),this.directionVectorForward.x=k.cos(e.body.rotation),this.directionVectorForward.y=k.sin(e.body.rotation),this.directionVectorRight.x=k.cos(e.body.rotation-1.571),this.directionVectorRight.y=k.sin(e.body.rotation-1.571),this.serverDirection=k.atan2(this.directionVectorGlobal.y,this.directionVectorGlobal.x),this.directionVectorGlobal.x=a-c.x,this.directionVectorGlobal.y=b-c.y,this.forwardVelocity=(this.directionVectorForward.x*this.directionVectorGlobal.x+this.directionVectorForward.y*this.directionVectorGlobal.y)/PE.Server.deltaTime,this.rightVelocity=(this.directionVectorRight.x*this.directionVectorGlobal.x+this.directionVectorRight.y*this.directionVectorGlobal.y)/PE.Server.deltaTime,this.velocity=Oc.Distance(c.x,c.y,a,b)/PE.Server.deltaTime,c.x=a,c.y=b,c.rotation=d.unpack(2),c.gunRotation=f.unpack(2),this.show()},this.on(0,this.UpdatePosition);var v=function(a){d.setHealth(a)};this.on(1,v),this.on(2,function(a){a&&this.PlayImmortalityEffect(),this.dead=!1,this.hide(),this.respawned=!0,v(100),this.me&&Dd.PlayerRespawn(),e.spawn()}),this.playerEnter=function(a){this.player=Dd.Players[a],this.me=!1,this.player?(!e.isSoldier&&this.player.unit&&this.player.unit.hide(),this.player.unit=this,this.setName(this.player.name),this.me=a===PE.Server.playerId,this.helper&&(this.helper.Dispose(),this.helper=void 0),this.me&&(this.helper=new M(this,(!0)),Dd.Camera.setTarget(this.id),Dd.playerUnit=this)):(this.setName(" "),this.me=!1,this.player=void 0),this.updateColors(),this.me&&Dd.UI.PlayerGUI.clearWeapons()},this.on(5,this.playerEnter),this.playerEject=function(){this.me&&(e.isSoldier||(Dd.UI.PowerUpBelt.ClearUI(),Dd.UI.PlayerGUI.hide())),this.me=!1,this.helper&&(this.helper.Dispose(),this.helper=void 0),this.setName(" "),this.player&&(this.player.unit=null,this.player=void 0),this.updateColors()},this.on(4,this.playerEject),this.die=function(){this.dead=!0,d.setHealth(0),e.die(),ca.Get().start(this),Dd.Audio.Common.explosion_2.Play(this.position.x,this.position.y)},this.on(6,this.die),this.on(7,this.updateColors),this.on(99,function(a,b){this.data.x=a,this.data.y=b,Ca.Get().start(this,this.data),this.position.x=this.data.x,this.position.y=this.data.y})}function Za(){Ya.call(this);var a=this;this.initialize=function(a,b,c,d){this.tank.loadClass(b,c,d,!0),Dd.Scene.layerTank.addChild(this.tank.container),this.class=this.tank.class,Ya.prototype.initialize.call(this,a),this.me&&this.setEngineSound()},this.baseUpdate=this.update,this.update=function(b,c){a.baseUpdate(b,c),a.tank.body.rotation=Interp(a.tank.body.rotation,a.data.rotation),a.tank.gun.rotation=a.gunRotation-a.tank.body.rotation}}function $a(){Ya.call(this);var a=this;this.initialize=function(a){this.tank.loadSoldier(),Dd.Scene.layerTank.addChild(this.tank.container),this.class=this.tank.class,Ya.prototype.initialize.call(this,a)};this.baseUpdate=this.update,this.update=function(b,c){a.baseUpdate(b,c);var d=a.velocity/300,e=a.tank.body;a.animationSpeed=z(0,1,d);var f=a.animationSpeed>.1;e.playing&&!f?(e.animationSpeed=e.currentFrame>0&&e.currentFrame<=6||e.currentFrame>11&&e.currentFrame<=17?-.6:.6,11!=e.currentFrame&&0!=e.currentFrame||e.gotoAndStop(e.currentFrame)):f&&(a.tank.body.rotation=a.serverDirection,e.playing||e.play(),e.animationSpeed=a.animationSpeed),a.tank.gun.animationSpeed=a.animationSpeed,a.tank.gun.rotation=a.gunRotation-a.tank.body.rotation+.26},this.on(0,function(a,b,c,d,e){this.UpdatePosition.call(this,a,b,0,c,d,e)})}function _a(){GameObject.call(this);var b=this,d=!1,e=new a.Sprite(a.Texture.EMPTY),f=a.Sprite.fromFrame("UI/PowerUp/frame_silver.png"),g=new a.Sprite(a.Texture.fromFrame("Particles/particle_big.png"));g.anchor.set(.5),g.tint=16777215,g.blendMode=f.blendMode=a.BLEND_MODES.ADD,g.alpha=.3,f.alpha=.5,g.scale.set(.8),g.parentLayer=Dd.Scene.layerParticle_ADD,f.parentLayer=Dd.Scene.layerGroundObjects_ADD,e.addChild(f,g);var h=0;e.anchor.set(.5),f.anchor.set(.5),f.scale.set(1.04),this.update=function(a,c){h-=a,h<=0&&!d&&b.stop()},this.initialize=function(b,c,f,g,i){d=!1,e.texture=a.Texture.fromFrame("UI/PowerUp/"+g+".png"),h=f.unpack(1),PE.GameLoop.onUpdate(this.update,this),this.show(i,b,c)},this.show=function(a,b,d){if(!this.visible){if(GameObject.prototype.show.call(this),e.position.set(b,d),e.scale.set(.6),e.visible=!0,Dd.Scene.layerGroundObjects.addChild(e),a){var h=getGameObject(a);null!=h&&h.visible&&c.fromTo(e.position,k.random()*(.7-.4)+.4,{x:h.position.x,y:h.position.y},{x:b,y:d})}this.animation=c.fromTo(e.scale,1.6,{x:.6,y:.6},{x:.75,y:.75,repeat:-1,yoyo:!0,ease:Power1.easeInOut}),this.animation2=c.fromTo(e,3.2,{rotation:-.1},{rotation:.1,repeat:-1,yoyo:!0,ease:Power1.easeInOut}),this.animation3=c.fromTo(g,1.6,{alpha:.22},{alpha:.05,repeat:-1,yoyo:!0,ease:Power1.easeInOut}),this.animation4=c.fromTo(f,1.6,{alpha:1},{alpha:.6,repeat:-1,yoyo:!0,ease:Power1.easeInOut})}},this.hide=function(){this.visible&&(GameObject.prototype.hide.call(this),e.visible=!1)},this.stop=function(a){d=!0;var b=getGameObject(a);if(null!=b&&b.visible)var f=c.to(e.position,.35,{x:b.position.x,y:b.position.y,ease:Back.easeIn.config(1),onUpdate:function(){f.updateTo({x:b.position.x,y:b.position.y},!1)}});var g=this;g.pickupAnimation=c.to(e.scale,.36,{x:.2,y:.2,ease:Power1.easeIn,onComplete:function(){g.pickupAnimation=null,g.destroy()}})},this.destroy=function(){this.pickupAnimation&&this.pickupAnimation.kill(),PE.GameLoop.offUpdate(this.update,this),this.animation.kill(),this.animation2.kill(),this.animation3.kill(),this.animation4.kill(),GameObject.prototype.destroy.call(this),null!=e&&null!=e.parent&&e.parent.removeChild(e)},this.on(0,function(a){b.stop(a)})}function ab(){GameObject.call(this);var b=this,d=!1,e=new a.Sprite(a.Texture.fromFrame("Misc/repair.png")),f=new a.Container,g=new a.Sprite(a.Texture.fromFrame("Particles/particle_big.png"));e.anchor.set(.5),g.anchor.set(.5),e.alpha=.7,g.tint=13827840,g.blendMode=a.BLEND_MODES.ADD,g.alpha=.3,g.parentLayer=Dd.Scene.layerParticle_ADD,f.scale.set(1),startRot=4.1*k.random()+0,f.addChild(g),f.addChild(e);var h=0;this.update=function(a,c){h-=a,h<=0&&!d&&b.stop()},this.initialize=function(a,b,c,e){h=c.unpack(1),PE.GameLoop.onUpdate(this.update,this),this.show(e,a,b),d=!1},this.show=function(a,b,d){if(!this.visible){GameObject.prototype.show.call(this),Dd.Scene.layerGroundObjects.addChild(f);3.14*k.random();if(f.position.set(b,d),f.scale.set(1),g.scale.set(.5),f.visible=!0,this.glowAnimation=c.fromTo(e.scale,1.6,{x:.95,y:.95},{x:1.1,y:1.1,repeat:-1,yoyo:!0,ease:Power1.easeInOut}),this.glowAnimation2=c.fromTo(g,1.6,{alpha:.1},{alpha:.25,repeat:-1,yoyo:!0,ease:Power1.easeInOut}),this.glowAnimation3=c.fromTo(e,1.6,{alpha:.7},{alpha:1,repeat:-1,yoyo:!0,ease:Power1.easeInOut}),this.glowAnimation4=c.fromTo(f,3.2,{rotation:-.11},{rotation:.11,repeat:-1,yoyo:!0,ease:Power1.easeInOut}),a){var h=getGameObject(a);null!=h&&h.visible&&c.fromTo(f.position,k.random()*(.7-.4)+.4,{x:h.position.x,y:h.position.y},{x:b,y:d})}}},this.hide=function(){this.visible&&(GameObject.prototype.hide.call(this),f.visible=!1)},this.stop=function(a){d=!0;var b=getGameObject(a);if(null!=b&&b.visible)var e=c.to(f.position,.35,{x:b.position.x,y:b.position.y,ease:Back.easeIn.config(1),onUpdate:function(){e.updateTo({x:b.position.x,y:b.position.y},!1)}});var g=this;g.pickupAnimation=c.to(f.scale,.36,{x:.2,y:.2,ease:Back.easeIn.config(4),onComplete:function(){g.pickupAnimation=null,g.destroy()}})},this.destroy=function(){this.pickupAnimation&&this.pickupAnimation.kill(),PE.GameLoop.offUpdate(this.update,this),this.hide(),this.glowAnimation.kill(),this.glowAnimation2.kill(),this.glowAnimation3.kill(),this.glowAnimation4.kill(),f.visible=!1,Dd.Scene.layerGroundObjects.removeChild(f),GameObject.prototype.destroy.call(this)},this.on(0,function(a){b.stop(a)})}function bb(){GameObject.call(this);var b=this,d=!1,e=new a.Sprite(a.Texture.fromFrame("Particles/particle_big.png")),f=new a.Container,g=new a.Sprite(a.Texture.fromFrame("Particles/particle_big.png"));e.anchor.set(.5),g.anchor.set(.5),e.alpha=.7,e.tint=5083391,g.tint=16777215,g.blendMode=e.blendMode=a.BLEND_MODES.ADD,g.alpha=.3;4.1*k.random()+0;f.addChild(g),f.addChild(e),f.parentLayer=Dd.Scene.layerParticle_ADD;var h=0;this.update=function(a,c){h-=a,h<=0&&!d&&b.stop()},this.initialize=function(a,b,c,e){h=c.unpack(1),d=!1,PE.GameLoop.onUpdate(this.update,this),this.show(e,a,b)},this.show=function(a,b,d){if(!this.visible&&(GameObject.prototype.show.call(this),f.position.set(b,d),f.scale.set(1),g.scale.set(.5),f.visible=!0,Dd.Scene.layerGroundObjects.addChild(f),this.glowAnimation=c.fromTo(e.scale,2,{x:.1,y:.1},{x:.15,y:.15,repeat:-1,yoyo:!0,ease:Power1.easeInOut}),this.glowAnimation2=c.fromTo(g,2,{alpha:.15},{alpha:.25,repeat:-1,yoyo:!0,ease:Power1.easeInOut}),this.glowAnimation3=c.fromTo(e,2,{alpha:.5},{alpha:1,repeat:-1,yoyo:!0,ease:Power1.easeInOut}),this.glowAnimation.play(3*k.random()),this.glowAnimation2.play(3*k.random()),this.glowAnimation3.play(3*k.random()),a)){var h=getGameObject(a);null!=h&&h.visible&&c.fromTo(f.position,k.random()*(.7-.4)+.4,{x:h.position.x,y:h.position.y},{x:b,y:d})}},this.hide=function(){this.visible&&(GameObject.prototype.hide.call(this),f.visible=!1)},this.stop=function(a){d=!0;var b=getGameObject(a);if(null!=b&&b.visible)var e=c.to(f.position,.35,{x:b.position.x,y:b.position.y,ease:Back.easeIn.config(1),onUpdate:function(){e.updateTo({x:b.position.x,y:b.position.y},!1)}});var g=this;g.pickupAnimation=c.to(f.scale,.36,{x:.2,y:.2,ease:Back.easeIn.config(4),onComplete:function(){g.pickupAnimation=null,g.destroy()}})},this.destroy=function(){this.pickupAnimation&&this.pickupAnimation.kill(),PE.GameLoop.offUpdate(this.update,this),this.glowAnimation.kill(),this.glowAnimation2.kill(),this.glowAnimation3.kill(),f.visible=!1,Dd.Scene.layerGroundObjects.removeChild(f),GameObject.prototype.destroy.call(this)},this.on(0,function(a){b.stop(a)})}function cb(){GameObject.call(this);var a=this,b=void 0,c=void 0,d=0;this.initialize=function(a,e){return c=getGameObject(a),d=e.unpack(1),c?(PE.GameLoop.onUpdate(this.update,this),b=ka.Get(),void b.start(c)):void this.destroy()},this.update=function(b,e){d-=b,(d<=0||c.dead)&&a.destroy()},this.destroy=function(a){GameObject.prototype.destroy.call(this),b&&b.stop(a),PE.GameLoop.offUpdate(this.update,this)}}function db(){GameObject.call(this);var a=this,b=void 0,c=void 0,d=void 0,e=0;this.initialize=function(a,f,g){return c=getGameObject(a),e=f.unpack(1),c?(PE.GameLoop.onUpdate(this.update,this),d=g,b=Aa.Get(),b.start(c,d,e),void Dd.Audio.Common.shield_activate.Play(c.position.x,c.position.y)):void this.destroy()},this.update=function(b,d){e-=b,(e<=0||c.dead)&&a.destroy()},this.destroy=function(a){GameObject.prototype.destroy.call(this),b&&b.stop(a),PE.GameLoop.offUpdate(this.update,this)},this.on(0,function(e){d=e,b&&b.setState(e),e<=0&&a.destroy(),c.visible&&Dd.Audio.Common.shield_absorb.Play(c.position.x,c.position.y)})}function eb(){GameObject.call(this);var a=this,b=void 0,c=void 0,d=0;this.initialize=function(a,e){return c=getGameObject(a),d=e.unpack(1),c?(PE.GameLoop.onUpdate(this.update,this),b=za.Get(),b.start(c),void Dd.Audio.Common.rapidfire_activate.Play(c.position.x,c.position.y)):void this.destroy()},this.update=function(b,e){d-=b,(d<=0||c.dead)&&a.destroy()},this.destroy=function(a){GameObject.prototype.destroy.call(this),b&&b.stop(a),PE.GameLoop.offUpdate(this.update,this)}}function fb(){GameObject.call(this);var c=void 0,d=a.Sprite.fromFrame("Misc/crown.png");d.anchor.set(.5);var e=new I(d,(!0),0,(-90),.65);this.initialize=function(a){return(c=getGameObject(a))?(c._kingScaleMultiplier||(c._kingScaleMultiplier=new Oc),c._kingScaleMultiplier.set(1,1),Dd.UI.GuidingArrowController.Add(e),e.SetTarget(c),void b.to(c._kingScaleMultiplier,1.7,{ease:Elastic.easeOut.config(1.5,.2),x:1.2,y:1.2})):void this.destroy()},this.destroy=function(a){e&&(e.ClearTarget(),Dd.UI.GuidingArrowController.Remove(e)),GameObject.prototype.destroy.call(this),c&&b.to(c._kingScaleMultiplier,2,{ease:RoughEase.ease.config({template:Power0.easeNone,strength:1,points:20,taper:"none",randomize:!0,clamp:!1}),x:1,y:1,onComplete:function(){}})}}function gb(){GameObject.call(this),this.initialize=function(a){var b=getGameObject(a);b&&$.Get().start(b),this.destroy()}}function hb(){GameObject.call(this);var b=this;this.elapsed=0,this.duration=30,this.packageDropped=!1,this.parashootOpen=!1,this.parashootLanded=!1,this.parashootDone=!1,this.airdropPosition=new Oc,this.airdropRotation=0,this.parashootTargetScale=new Oc(.55,.55),this.parashootStartScale=new Oc(1.25,1.25),this.planeContainer=new a.Container,this.plane=new a.Sprite(a.Texture.fromFrame("Events/airdrop/plane.png")),this.plane.anchor.set(.5),this.planeContainer.addChild(this.plane),Dd.Scene.above3.addChild(this.planeContainer),this.shadowContainer=new a.Container,this.shadow=new a.Sprite(a.Texture.fromFrame("Events/airdrop/shadow.png")),this.shadow.anchor.set(.5),this.shadow.tint=0,this.shadow.alpha=.5,this.shadow.scale.set(1.4),this.shadowContainer.addChild(this.shadow),Dd.Scene.aboveShadow.addChild(this.shadowContainer),this.parashootContainer=new a.Container,this.parashoot=new a.Sprite(a.Texture.fromFrame("Events/airdrop/parashoot.png")),this.parashoot.anchor.set(.5),this.parashoot.scale.set(0),this.parashootContainer.addChild(this.parashoot),Dd.Scene.above2.addChild(this.parashootContainer),this.soundPlaying=!1,this.soundPosition=new Oc,this.engineSound=new P(Dd.Audio.Base.airdrop_engine),this.parashootSound=new P(Dd.Audio.Base.airdrop_parashoot_open);var c=15,d=.3,e=4.5,f=new Oc((-8e3),0),g=new Oc(8e3,0);this.animation=(new i).fromTo(this.plane.position,this.duration,{x:f.x,y:f.y},{x:g.x,y:g.y,ease:Linear.easeNone},0).fromTo(this.shadow.position,this.duration,{x:f.x,y:f.y},{x:g.x,y:g.y,ease:Linear.easeNone},0).to(this.parashoot.scale,d,{x:this.parashootStartScale.x,y:this.parashootStartScale.y},c).to(this.parashoot.scale,e,{x:this.parashootTargetScale.x,y:this.parashootTargetScale.y,ease:Linear.easeNone},c+d).to(this.parashoot,.3,{alpha:0},c+e).fromTo(this.parashootContainer.scale,1.2,{x:1.04,y:.96},{x:.96,y:1.04,repeat:-1,yoyo:!0,ease:Sine.easeInOut},c).to(this.parashoot,2.5,{rotation:.8,repeat:-1,yoyo:!0,ease:Sine.easeInOut},c),this.initialize=function(a,b,c,d){return d&&d.unpack()>.5*this.duration?void this.destroy():(PE.GameLoop.onUpdate(this.update,this),this.started=!0,this.elapsed=0,this.packageDropped=!1,this.parashootContainer.visible=!0,this.planeContainer.visible=!0,this.shadowContainer.visible=!0,this.airdropPosition.x=a,this.airdropPosition.y=b,this.airdropRotation=c.unpack(2),this.parashootContainer.position.copy(this.airdropPosition),this.parashootContainer.rotation=c.unpack(2),this.planeContainer.position.copy(this.airdropPosition),this.planeContainer.rotation=c.unpack(2),this.shadowContainer.position.copy(this.planeContainer.position),this.shadowContainer.rotation=this.planeContainer.rotation,this.shadowContainer.position.y+=250,this.parashoot.scale.set(0),this.parashoot.alpha=1,void(d?(this.elapsed=d.unpack(1),this.animation.gotoAndPlay(this.elapsed)):this.animation.gotoAndPlay(0)))},this.update=function(a,c){if(b.started){b.elapsed+=a;var d=b.elapsed/b.duration;Dd.Scene.getPositionOf(b.plane,!1,b.soundPosition);var e=Dd.Camera.isOnScreen(b.soundPosition,300,300);return b.soundPlaying||0===b.soundPosition.x||0===b.soundPosition.y?e?b.engineSound.SetPosition(b.soundPosition.x,b.soundPosition.y):(b.engineSound.FadeOut(2),b.soundPlaying=!1):e&&(b.engineSound.Play(b.soundPosition.x,b.soundPosition.y,null,2),b.soundPlaying=!0),!b.packageDropped&&d>=.5&&(b.packageDropped=!0,b.soundPlaying&&b.parashootSound.Play(b.soundPosition.x,b.soundPosition.y)),b.elapsed>b.duration?void b.destroy():void 0}},this.destroy=function(a){GameObject.prototype.destroy.call(this),this.soundPlaying&&(this.engineSound.FadeOut(2),this.soundPlaying=!1),this.started&&PE.GameLoop.offUpdate(this.update,this),this.started=!1,this.parashootContainer.visible=!1,this.planeContainer.visible=!1,this.shadowContainer.visible=!1,this.animation.stop()}}function ib(){GameObject.call(this);var b=this;this.elapsed=0,this.duration=6,this.started=!1,this.position=new Oc,this.angle=0,this.shadowHeight=250,this.shoot=!1,this.planeContainer=new a.Container,this.plane=new a.Sprite(a.Texture.fromFrame("Events/airstrafe/plane.png")),this.plane.anchor.set(.5),this.planeContainer.addChild(this.plane),this.particleContainer=new a.Container,this.plane.addChild(this.particleContainer),this.particleContainer.parentLayer=Dd.Scene.layerParticle_ADD,Dd.Scene.above3.addChild(this.planeContainer),this.shadowContainer=new a.Container,this.shadow=new a.Sprite(a.Texture.fromFrame("Events/airstrafe/shadow.png")),this.shadow.anchor.set(.5),this.shadow.tint=0,this.shadow.alpha=.5,this.shadow.scale.set(1.4),this.shadowContainer.addChild(this.shadow),Dd.Scene.aboveShadow.addChild(this.shadowContainer);var c=new Oc((-2e3),0),d=new Oc(5e3,0);this.soundPosition=new Oc,this.engineSound=new P(Dd.Audio.Base.airstrafe_engine),this.fireSound=new P(Dd.Audio.Base.airstrafe_fire),this.animation=(new i).fromTo(this.plane.position,this.duration,{x:c.x,y:c.y},{x:d.x,y:d.y,ease:Linear.easeNone},0).fromTo(this.shadow.position,this.duration,{x:c.x,y:c.y},{x:d.x,y:d.y,ease:Linear.easeNone},0).to(this,2,{shadowHeight:50},0).to(this,3,{shadowHeight:250},2.3),this.animation.stop(),this.initialize=function(a,b,c,d){return d&&d.unpack(1)>.5*this.duration?void this.destroy():(PE.GameLoop.onUpdate(this.update,this),this.started=!0,this.elapsed=0,this.shoot=!1,this.position.x=a,this.position.y=b,this.angle=c.unpack(2),this.planeContainer.position.copy(this.position),this.planeContainer.rotation=this.angle,this.shadowContainer.position.copy(this.planeContainer.position),this.shadowContainer.rotation=this.planeContainer.rotation,this.shadowContainer.position.y=this.planeContainer.position.y+this.shadowHeight,this.planeContainer.visible=!0,this.shadowContainer.visible=!0,d?(this.elapsed=d.unpack(1),this.animation.gotoAndPlay(this.elapsed)):this.animation.gotoAndPlay(0),void this.engineSound.Play(this.soundPosition.x,this.soundPosition.y))},this.update=function(a,c){if(b.started){b.elapsed+=a,Dd.Scene.getPositionOf(b.plane,!1,b.soundPosition),b.shadowContainer.position.y=b.planeContainer.position.y+b.shadowHeight;return this.plane.scale.set(z(.65,1,this.shadowHeight/250)),b.engineSound.SetPosition(b.soundPosition.x,b.soundPosition.y),!b.shoot&&b.elapsed>1&&(b.shoot=!0,Y.Get().start(b.plane,b.angle),Z.Get().start(b.particleContainer),b.fireSound.Play(b.soundPosition.x,b.soundPosition.y),b.fireSound.Seek(b.elapsed-1)),b.shoot&&b.fireSound.SetPosition(b.soundPosition.x,b.soundPosition.y),b.elapsed>b.duration?void b.destroy():void 0}},this.destroy=function(a){GameObject.prototype.destroy.call(this),this.started&&(PE.GameLoop.offUpdate(this.update,this),this.planeContainer.visible=!1,this.shadowContainer.visible=!1,this.animation.stop(),this.engineSound.Stop(),this.started=!1)}}function jb(){GameObject.call(this);var b=this;this.elapsed=0,this.duration=1,this.position=new Oc,this.angle=0,this.shoot=!1,this.audio=new P(Dd.Audio.Base.vacuum),this.vacContainer=new a.Container,this.vacDonutTexture=a.Texture.fromFrame("Displacement/donut.png"),this.vacDonut=new a.Sprite(this.vacDonutTexture),this.vacDonut.anchor.set(.5),this.vacDonut.blendMode=1,this.vacDonut.parentLayer=Dd.Scene.layerDisplacement,this.vacContainer.addChild(this.vacDonut),Dd.Scene.above3.addChild(this.vacContainer),this.initialize=function(a,b,c,d){return d&&d.unpack(1)>.5*this.duration?void this.destroy():(PE.GameLoop.onUpdate(this.update,this),this.started=!0,this.vacDonut.alpha=0,this.animation=(new j).to(this.vacDonut,.5,{alpha:.7,ease:Sine.easeOut},0).to(this.vacDonut,.5,{alpha:0,ease:Sine.easeOut},.5).fromTo(this.vacDonut.scale,1,{x:10,y:10},{x:.5,y:.5,ease:Sine.easeOut},0),this.elapsed=0,this.audio.Play(a,b),this.position.x=a,this.position.y=b,this.angle=0,this.vacContainer.position.copy(this.position),this.vacContainer.rotation=this.angle,this.vacContainer.visible=!0,this.animation.gotoAndPlay(0),void Ga.Get().start(a,b))},this.update=function(a,c){b.started&&(b.elapsed+=a,b.audio.SetPosition(b.vacContainer.position.x,b.vacContainer.position.y),b.elapsed>2&&b.destroy())},this.destroy=function(a){GameObject.prototype.destroy.call(this),this.started&&(PE.GameLoop.offUpdate(this.update,this),this.vacContainer.visible=!1,this.animation.stop(),this.started=!1)}}function kb(){GameObject.call(this);var b=this,c=!1;this.triggered=!1,this.exploded=!1,this.position=new Oc,this.angle=0,this.mineFull=a.Sprite.fromFrame("Events/Mine/full.png"),this.mineBurried=a.Sprite.fromFrame("Events/Mine/burried"+k.floor(3*k.random())+".png"),this.ring=a.Sprite.fromFrame("Particles/orb_green.png"),this.glow=a.Sprite.fromFrame("Particles/particle_big.png"),this.mineFull.anchor.set(.5),this.mineBurried.anchor.set(.5),this.mineBurried.alpha=.7,this.glow.anchor.set(.5),this.glow.scale.set(1),this.glow.blendMode=a.BLEND_MODES.ADD,this.glow.tint=16717591,this.ring.anchor.set(.5),this.ring.alpha=1,this.ring.visible=!1,this.ring.scale.set(1.45),this.ring.tint=16777215,Dd.Scene.layerGroundObjects.addChildAt(this.mineBurried,0),Dd.Scene.layerGroundObjects.addChildAt(this.mineFull,0),Dd.Scene.layerGroundObjects.addChildAt(this.ring,0),Dd.Scene.layerParticle_ADD.addChild(this.glow),this.HideAnimation=(new i).fromTo(this.mineFull,1.5,{alpha:1},{alpha:0},1);this.TriggerAnimation=(new i).to(this.mineFull,.1,{alpha:1}).to(this.mineFull,.1,{alpha:0}).to(this.mineFull,.1,{alpha:1}).to(this.mineFull,.1,{alpha:0}).to(this.mineFull,.1,{alpha:1}).to(this.mineFull,.1,{alpha:0}).call(function(){b.explode()}).call(function(){b.destroy()},null,null,5),this.SoundPosition=new Oc,this.ActivateSound=new P(Dd.Audio.Base.mine_activate),this.ExplodeSound=new P(Dd.Audio.Base.mine_explode),this.HideAnimation.stop(),this.TriggerAnimation.stop(),this.initialize=function(a,b,d,e,f){var g=k.random()*k.PI;this.team=d,this.owner=getGameObject(f),this.me=null!==Dd.playerUnit&&this.owner===Dd.playerUnit,c=void 0!==f,this.position.set(a,b),this.mineFull.position.set(a,b),this.mineBurried.position.set(a,b),this.ring.position.set(a,b),this.glow.position.set(a,b),this.mineFull.visible=!0,this.mineBurried.visible=!0,this.mineFull.alpha=c?.8:0,this.glow.visible=!0,this.mineFull.rotation=g,this.mineBurried.rotation=g,this.glow.alpha=0,c&&Dd.Audio.Common.mine_place.Play(this.position.x,this.position.y),this.setFriendly(),Dd.TeamColors.on("update",this.setFriendly,this),e&&this.explode()},this.update=function(a,c){b.triggered&&(b.glow.alpha=.15*b.mineFull.alpha,Dd.Scene.getPositionOf(b.mineFull,!1,b.SoundPosition),b.ActivateSound.SetPosition(b.SoundPosition.x,b.SoundPosition.y),b.exploded&&b.ExplodeSound.SetPosition(b.SoundPosition.x,b.SoundPosition.y))},this.destroy=function(a){GameObject.prototype.destroy.call(this),this.triggered&&(this.TriggerAnimation.isActive()&&this.TriggerAnimation.gotoAndStop(0),PE.GameLoop.offUpdate(this.update,this)),this.triggered=!1,this.exploded=!1,this.mineFull.visible=!1,this.mineBurried.visible=!1,this.glow.visible=!1,this.ring.visible=!1,Dd.TeamColors.off("update",this.setFriendly)},this.explode=function(a){this.mineFull.visible=!1,this.mineBurried.visible=!1,this.glow.visible=!1,this.ring.visible=!1,fa.Count<15&&Dd.Camera.isOnScreen(this.position,200,200)&&(this.exploded=!0,Dd.Scene.getPositionOf(this.mineFull,!1,this.SoundPosition),this.ExplodeSound.Play(this.SoundPosition.x,this.SoundPosition.y),fa.Get().start(this.position))},this.setFriendly=function(){var a=null!=Dd.player&&(this.me&&0==Dd.player.team||0!=Dd.player.team&&this.team==Dd.player.team);this.ring.visible=a,this.ring.tint=rf.UserSettings["ColorBlind"]?65535:16777215,a?(this.HideAnimation.stop(),this.mineFull.alpha=.8):(this.HideAnimation.gotoAndPlay(0),c||this.HideAnimation.progress(1,!1))},this.on(0,function(){this.HideAnimation.gotoAndStop(0),fa.Count<15&&Dd.Camera.isOnScreen(this.position,200,200)?(this.triggered=!0,PE.GameLoop.onUpdate(this.update,this),Dd.Scene.getPositionOf(this.mineFull,!1,this.SoundPosition),this.ActivateSound.Play(this.SoundPosition.x,this.SoundPosition.y),this.TriggerAnimation.gotoAndPlay(0)):this.destroy()})}function lb(){GameObject.call(this);var b=this;this.owner=void 0,this.elapsed=0,this.audio=new P(Dd.Audio.Base.stomp),this.vacContainer=new a.Container,this.vacDonutTexture=a.Texture.fromFrame("Displacement/donut.png"),this.vacDonut=new a.Sprite(this.vacDonutTexture),this.vacDonut.blendMode=1,this.vacDonut.parentLayer=Dd.Scene.layerDisplacement,this.vacDonut.anchor.set(.5),this.vacContainer.addChild(this.vacDonut),Dd.Scene.above3.addChild(this.vacContainer),this.scaleMultiplier=new Oc(1),this.initialize=function(a,d){var e=this.owner=getGameObject(a);if(!this.owner||!this.owner.visible)return void this.destroy();this.elapsed=d?d.unpack(1):0,PE.GameLoop.onUpdate(this.update,this);var f=this.owner.position.x,g=this.owner.position.y;this.vacDonut.alpha=0,this.animation=(new j).to(this.vacDonut,.1,{alpha:.7,ease:Sine.easeOut},1.1).to(this.vacDonut,.7,{alpha:0,ease:Sine.easeOut},1.2).fromTo(this.vacDonut.scale,.8,{x:0,y:0},{x:12,y:12,ease:Sine.easeOut},1.1).fromTo(this.scaleMultiplier,1,{x:1,y:1},{x:1.15,y:1.15,ease:Power0.easeNone},0).to(this.scaleMultiplier,.5,{x:1,y:1,ease:Elastic.easeOut.config(1.75,.2)},1),c.delayedCall(1.1-this.elapsed,function(){Ba.Get().start(e.position.x,e.position.y),b.vacContainer.position.copy(e.position),b.vacContainer.visible=!0}),this.elapsed=0,this.audio.Play(f,g),this.scaleMultiplier.set(1),this.angle=0,this.animation.gotoAndPlay(this.elapsed),this.owner.addScaleMultiplier(this.scaleMultiplier)},this.update=function(a,c){b.elapsed+=a,b.elapsed<1.1?b.audio.SetPosition(b.owner.position.x,b.owner.position.y):b.elapsed>2&&b.destroy()},this.destroy=function(a){GameObject.prototype.destroy.call(this),PE.GameLoop.offUpdate(this.update,this),this.owner&&this.owner.removeScaleMultiplier(this.scaleMultiplier),this.vacContainer.visible=!1,this.animation&&this.animation.stop()}}function mb(){GameObject.call(this);var b=this;this.elapsed=0,this.duration=9,this.started=!1,this.rolled=!1,this.position=new Oc,this.angle=0,this.planeContainer=new a.Container,this.plane=new a.Container,this.planeContainer.addChild(this.plane),Dd.Scene.above3.addChild(this.planeContainer),this.shadowContainer=new a.Container,this.shadow=new a.Container,this.shadowContainer.addChild(this.shadow),Dd.Scene.aboveShadow.addChild(this.shadowContainer),Be.Load(["/Content/Gunship/spritesheet.json"],function(){for(var c=[],d=1;d<=23;d++)c.push(a.Texture.fromFrame("Gunship/gunship_"+d+".png"));b.animation=new a.extras.AnimatedSprite(c),b.shadowAnimation=new a.extras.AnimatedSprite(c),b.animation.anchor.set(0,.5),b.shadowAnimation.anchor.set(0,.5),b.animation.loop=b.shadowAnimation.loop=!1,b.animation.animationSpeed=b.shadowAnimation.animationSpeed=.7,b.animation.gotoAndStop(0),b.shadowAnimation.gotoAndStop(0),b.shadowAnimation.tint=0,b.shadowAnimation.alpha=.18,b.shadowAnimation.scale.set(.6),b.plane.addChild(b.animation),b.shadow.addChild(b.shadowAnimation)});var c=new Oc((-2e3),0),d=new Oc(6e3,0);this.soundPosition=new Oc,this.engineSound=new P(Dd.Audio.Base.airstrafe_engine),this.initialize=function(a,b,c,d){return this.elapsed=d?d.unpack(1):0,d&&this.elapsed>.5*this.duration?void this.destroy():(PE.GameLoop.onUpdate(this.update,this),this.started=!0,this.rolled=!1,this.position.x=a,this.position.y=b,this.angle=c.unpack(2),this.planeContainer.position.copy(this.position),this.planeContainer.rotation=this.angle,this.shadowContainer.position.copy(this.position),this.shadowContainer.rotation=this.angle,this.shadowContainer.position.y+=250,this.planeContainer.visible=!0,this.shadowContainer.visible=!0,void this.engineSound.Play(this.soundPosition.x,this.soundPosition.y))},this.update=function(a,e){if(this.started){this.elapsed+=a;var f=this.elapsed/this.duration;return Vector2.Lerp(c,d,f,this.plane.position),this.shadow.position=this.plane.position,!this.rolled&&f>.15&&this.animation&&(this.rolled=!0,this.animation.gotoAndPlay(0),this.shadowAnimation.gotoAndPlay(0)),Dd.Scene.getPositionOf(b.plane,!1,b.soundPosition),b.engineSound.SetPosition(b.soundPosition.x,b.soundPosition.y),b.elapsed>b.duration?void b.destroy():void 0}},this.destroy=function(a){GameObject.prototype.destroy.call(this),this.started&&(PE.GameLoop.offUpdate(this.update,this),this.planeContainer.visible=!1,this.shadowContainer.visible=!1,this.engineSound.Stop(),this.started=!1)}}function nb(){GameObject.call(this),this.initialize=function(a,b,c,d,e){e=e?e.unpack(1):2;var f=getGameObject(a);ba.Get().start(f,b,c,e),_.Get().start(b,c,d.unpack(2),e),this.destroy()},this.destroy=function(a){GameObject.prototype.destroy.call(this)}}function ob(){GameObject.call(this);var b=this,d=new a.Container;this.durationLeft=0;for(var e=!1,f=[],g=0;g<=18;g++)f.push(a.Texture.fromFrame("Displacement/force/displace"+g+".png"));
var h=a.Sprite.fromFrame("Particles/particle_big.png");h.anchor.set(.5),h.blendMode=0,h.alpha=1,h.tint=7217,h.scale.set(1/162*250*2),h.parentLayer=Dd.Scene.layerGroundDecals;var i=a.Sprite.fromFrame("Particles/particle_big.png");i.anchor.set(.5),i.blendMode=1,i.alpha=.3,i.tint=15135999,i.scale.set(1/162*250*3),i.parentLayer=Dd.Scene.layerGroundObjects_ADD;var j=new a.extras.AnimatedSprite(f);j.anchor.set(.5),j.blendMode=1,j.alpha=.9,j.play(),j.scale.set(1/162*250*2*1.05),j.parentLayer=Dd.Scene.layerParticle_ADD;var k=new a.extras.AnimatedSprite(f);k.anchor.set(.5),k.play(),k.blendMode=1,k.alpha=.4,k.scale.set(1/162*250*2),k.parentLayer=Dd.Scene.layerDisplacement,d.addChild(j,k,h,i),Dd.Scene.layerGroundObjects.addChild(d);var l=new P(Dd.Audio.Base.forcefield_absorb);k.onLoop=function(){var a=-k.animationSpeed;k.animationSpeed=j.animationSpeed=a,k.gotoAndPlay(a>0?1:17),j.gotoAndPlay(a>0?1:17)},this.initialize=function(a,b,c){e=!1,this.durationLeft=c.unpack(1),d.position.set(a,b),j.animationSpeed=k.animationSpeed=.5,PE.GameLoop.onUpdate(this.update,this),this.show()},this.update=function(a,c){b.durationLeft-=a,b.durationLeft<=.3&&b.despawn()},this.hide=function(a){this.visible&&(d.visible=!1,k.stop(),j.stop(),GameObject.prototype.hide.call(this))},this.show=function(){this.visible||(d.visible=!0,c.fromTo(d.scale,.7,{x:.9,y:.9},{x:1,y:1,ease:Elastic.easeOut}),c.fromTo(d,.5,{alpha:0},{alpha:1,ease:Elastic.easeOut}),k.play(),j.play(),GameObject.prototype.show.call(this))},this.despawn=function(){e||(e=!0,c.fromTo(d.scale,.7,{x:1,y:1},{x:.9,y:.9,ease:Elastic.easeOut,onComplete:function(){b.destroy()}}),c.fromTo(d,.5,{alpha:1},{alpha:0,ease:Power2.easeIn}))},this.destroy=function(a){PE.GameLoop.offUpdate(this.update,this),GameObject.prototype.destroy.call(this)},this.on(0,function(a){c.fromTo(k,.7,{alpha:.55},{alpha:.4,ease:Elastic.easeOut}),l.Play(d.position.x,d.position.y)}),this.on(1,function(a){c.fromTo(k,.7,{alpha:.25},{alpha:.4,ease:Elastic.easeOut}),l.Play(d.position.x,d.position.y)})}function pb(){GameObject.call(this);var b=this;this.healthbarOffset=-55,this.hideHealthbar=!1,this.bodySprite=new a.Sprite(a.Texture.EMPTY),this.isOwner=!1,this.healthbar=new J(100);var d=this.data={x:0,y:0,bodyRotation:0};this.unit=void 0,this.isNew=!1;var e,f=this.container=new a.Container;f.addChild(this.bodySprite,this.healthbar.container),Dd.Scene.layerConstructions.addChild(f),this.setTeam=function(a){this.team=a,this.healthbar.setColor(Dd.TeamColors.GetColor(this.team,this.isOwner)),!this.isOwner&&Dd.playerUnit&&this.healthbar.TeamBadge(0!=a&&Dd.playerUnit.team==a)};var g=0;this.baseUpdate=function(a,c){if(this.hideHealthbar&&(g+=a,g>1.5&&g<10)){b.healthbar.container.alpha=z(1,0,(g-1.5)/2.5)}f.x=Interp(f.x,d.x),f.y=Interp(f.y,d.y),b.bodySprite.rotation=Interp(b.bodySprite.rotation,d.bodyRotation)},this.on(0,function(a,b,c,e){d.x=a,d.y=b,d.bodyRotation=c.unpack(2),void 0!==e&&this.sethealth(e),this.show()}),this.sethealth=function(a){this.hideHealthbar&&(100!=a?(c.to(this.healthbar.container,.5,{alpha:1}),g=0):g=10),e=a,this.healthbar.setHealth(e)},this.on(2,this.sethealth),this.die=function(){this.healthbar.setHealth(0),da.Get().start(this),this.destroy()},this.on(5,this.die)}function qb(){pb.call(this);var b=this;this.VFX=[],this.topContainer=new a.Container,this.topSprite=new a.Sprite(a.Texture.EMPTY),this.topContainer.addChild(this.topSprite),this.bodySprite.addChild(this.topContainer),this.muzzleOffset=new Oc,this.weapons=new Xa,this.topRotation=0;var c,d;this.turnRate=2;var e=this.turretData={topRotation:0,velocity:0};this.initialize=function(a,b,c){b!=-1&&this.setTarget(b),pb.prototype.initialize.call(this,a,c)},this.update=function(a,c){pb.prototype.update.call(b,a,c),b.topRotation=Interp(b.topRotation,e.topRotation),b.topSprite.rotation=b.topRotation-b.bodySprite.rotation},this.servupdate=function(a,c){tmpPos=new Oc(this.data.x,this.data.y),e.topRotation=d?Mathf.smoothDampAngle(e.topRotation,tmpPos.angleTowards(new Oc(d.data.x,d.data.y)),e,a,.2,this.turnRate):Mathf.smoothDampAngle(e.topRotation,b.data.bodyRotation,e,a,.2,this.turnRate)};var f=new Oc,g=new Oc;this.getMuzzleFlashPosition=function(a,b,c){return _weaponOrientation=this.getWeaponOrientation(a,b,c),f.copy(this.muzzleOffset),f.rotate(_weaponOrientation),0==this.topSprite.x&&0==this.topSprite.y||(g.copy(this.topSprite.position),g.rotate(this.bodySprite.rotation),f.x+=g.x,f.y+=g.y),f.x+=this.container.position.x,f.y+=this.container.position.y,f},this.getWeaponOrientation=function(a,b,c){return c?.5*(e.topRotation+this.topRotation):b?e.topRotation:this.topRotation},this.on(0,function(a,b,c,d,f,g){this.data.x=a,this.data.y=b,this.data.bodyRotation=c.unpack(2),void 0!==d&&this.sethealth(d),void 0!==f&&(e.topRotation=f.unpack(2),this.topRotation=f.unpack(2)),void 0!==g&&(g?this.setTarget(g):this.clearTarget()),this.show()}),this.clearTarget=function(){c=void 0,d=void 0},this.on(3,this.clearTarget),this.setTarget=function(a){c=a,d=getGameObject(a)},this.on(4,this.setTarget)}function rb(){qb.call(this),this.bodySprite.texture=a.Texture.fromFrame("Construction/50/body.png"),this.topSprite.texture=a.Texture.fromFrame("Construction/50/cannon.png"),this.bodySprite.anchor.set(.5),this.topSprite.anchor.set(.4,.5),this.topSprite.position.set(-12,0),this.healthbarOffset=-35,this.turnRate=SETTINGS["PowerUp_MissileTurret_Stat_TurnRate"]}function sb(){qb.call(this),this.bodySprite.texture=a.Texture.fromFrame("Construction/51/body.png"),this.topSprite.texture=a.Texture.fromFrame("Construction/51/cannon.png"),this.bodySprite.anchor.set(.5),this.topSprite.anchor.set(.32,.5),this.healthbarOffset=-35,this.muzzleOffset.set(65,-8),this.turnRate=SETTINGS["PowerUp_LaserTurret_Stat_TurnRate"],this.getMuzzleFlashPositionBase=this.getMuzzleFlashPosition,this.getMuzzleFlashPosition=function(){return this.muzzleOffset.y=-this.muzzleOffset.y,this.primaryWeapon&&(this.primaryWeapon.muzzleContainer.position=this.muzzleOffset),this.getMuzzleFlashPositionBase()}}function tb(){qb.call(this),this.bodySprite.texture=a.Texture.fromFrame("Construction/52/body.png"),this.topSprite.texture=a.Texture.fromFrame("Construction/52/cannon.png"),this.bodySprite.anchor.set(.5),this.topSprite.anchor.set(.55,.56),this.topSprite.position.set(-12,0),this.healthbarOffset=-35,this.muzzleOffset.set(60,0),this.turnRate=SETTINGS["PowerUp_MinigunTurret_Stat_TurnRate"];for(var b=[],d=0;d<=9;d++)b.push(a.Texture.fromFrame("Construction/52/barrel"+d+".png"));var e=new a.extras.AnimatedSprite(b);e.anchor.set(0,.5),e.x=-2,this.topSprite.addChild(e),e.animationSpeed=0,this.minigunSpinUp=function(){c.to(e,.5,{animationSpeed:3})},this.minigunSpinDown=function(){c.to(e,2,{animationSpeed:0})},this.hide=function(){this.visible&&(e.stop(),qb.prototype.hide.call(this))},this.show=function(){this.visible||(e.play(),qb.prototype.show.call(this))}}function ub(){qb.call(this),this.bodySprite.texture=a.Texture.fromFrame("Construction/53/body.png"),this.topSprite.visible=!1,this.bodySprite.anchor.set(.5),this.healthbarOffset=-35,this.teslaWarmUp=function(){var a=Fa.Get();a.start(this,!0),a.container.scale.set(3)}}function vb(){qb.call(this),this.bodySprite.texture=a.Texture.fromFrame("Construction/54/body.png"),this.topSprite.texture=a.Texture.fromFrame("Construction/54/top.png"),this.bodySprite.anchor.set(.5),this.topSprite.anchor.set(.5),this.healthbarOffset=-35,this.topFullSprite=a.Sprite.fromFrame("Construction/54/top_full.png"),this.topFullSprite.anchor.set(.5),this.topSprite.addChild(this.topFullSprite);var b=0,d=k.PI,e=this;this.healingPulse=function(){c.fromTo(e.topFullSprite,1,{alpha:0},{alpha:1,ease:Power1.easeIn}),c.fromTo(e.topSprite.scale,1.5,{x:.5,y:.5},{x:1,y:1,ease:Power2.easeOut}),c.fromTo(e.topSprite,1.5,{rotation:b},{rotation:d,ease:Power2.easeIn}),b+=.5*k.PI,d+=.5*k.PI},e.healingPulse()}function wb(){qb.call(this);for(var b=this,c=[],d=1;d<=7;d++)c.push(a.Texture.fromFrame("Construction/55/body"+d+".png"));this.turnRate=SETTINGS["PowerUp_Drone_Stat_TurnRate"];var e=this.shadowTop=a.Sprite.fromFrame("Construction/55/cannon.png"),f=this.shadowBody=new a.extras.AnimatedSprite(c);this.bodySprite.texture=a.Texture.fromFrame("Construction/55/body1.png"),this.topSprite.texture=a.Texture.fromFrame("Construction/55/cannon.png"),this.bodySprite.anchor.set(.5),this.topSprite.anchor.set(.23,.5),this.shadowBody.anchor.set(.5),this.shadowTop.anchor.set(.25,.5),this.container.addChild(this.shadowBody),this.shadowBody.addChild(this.shadowTop),this.bodySprite.tint=0,this.topSprite.tint=0,this.bodySprite.alpha=this.topSprite.alpha=.2,this.shadowBody=this.bodySprite,this.shadowTop=this.topSprite,this.bodySprite=f,this.topSprite=e,this.bodySprite.animationSpeed=1.5,this.shadowBody.position.y=80,this.healthbarOffset=-35,this.muzzleOffset.set(50,-6),this.startsound=new P(Dd.Audio.Base.drone_start),this.loopsound=new P(Dd.Audio.Base.drone_loop),this.bodySprite.parentLayer=Dd.Scene.above2,this.topSprite.parentLayer=Dd.Scene.above2,this.show=function(){if(!this.visible){this.bodySprite.play();var a=this.isNew;qb.prototype.show.call(this),a&&this.unit&&this.startsound.Play(this.data.x,this.data.y),this.loopsound.Play(this.data.x,this.data.y)}},this.hide=function(){this.visible&&(this.bodySprite.stop(),qb.prototype.hide.call(this),this.loopsound.FadeOut(1))};var g=new Oc,h=0;this.updateBase=this.update,this.update=function(a,c){g.copy(b.container),b.updateBase(a,c),b.shadowBody.rotation=b.bodySprite.rotation,b.shadowTop.rotation=b.topSprite.rotation,h=z(h,g.distance(b.container.position),2*a);var d=h/11;b.loopsound.SetPosition(b.container.x,b.container.y),b.loopsound.Rate(z(.9,2.5,d))},this.getMuzzleFlashPositionBase=this.getMuzzleFlashPosition,this.getMuzzleFlashPosition=function(){return this.muzzleOffset.y=-this.muzzleOffset.y,this.primaryWeapon&&(this.primaryWeapon.muzzleContainer.position=this.muzzleOffset),this.getMuzzleFlashPositionBase()}}function xb(){pb.call(this);var b=this;this.bodySprite.texture=a.Texture.fromFrame("Construction/60/body.png"),this.bodySprite.anchor.set(.5),this.hideHealthbar=!0,this.initialize=function(a,b){pb.prototype.initialize.call(this,a,b)},this.update=function(a,c){pb.prototype.update.call(b,a,c)},this.destroy=function(a){pb.prototype.destroy.call(this)}}function yb(){GameObject.call(this);var b,c,d,e,f,g=new Oc,h=new Oc,i=new Oc,j=new a.Graphics;this.update=function(a,k){if(f>=0){if(f-=a,f<=0)return g.copy(i),void(b=d);var l=1-f/e;g.x=z(h.x,i.x,l),g.y=z(h.y,i.y,l),b=z(c,d,l),j.clear(),j.lineStyle(5,16711680,1),j.drawCircle(0,0,b),j.position.set(g.x,g.y)}},this.initialize=function(a,c,d,e,f,h,i){g.set(a,c),b=d,j.lineStyle(5,16711680,1),j.drawCircle(0,0,b),j.position.set(a,c),Dd.Scene.layerDebug.addChild(j),i&&k(e,f,h,i),this.show()},this.show=function(){this.visible||(GameObject.prototype.show.call(this),PE.GameLoop.onUpdate(this.update,this))},this.hide=function(){this.visible&&(GameObject.prototype.hide.call(this),PE.GameLoop.offUpdate(this.update,this))},this.destroy=function(){j.clear(),Dd.Scene.layerDebug.removeChild(j),GameObject.prototype.destroy.call(this)};var k=function(a,j,k,l){e=l,f=l,h.set(g.x,g.y),i.set(a,j),c=b,d=k};this.on(0,k)}function zb(b,c){this.weapon=c,this.container=new a.UI.Container,this.ammoOffset=new a.UI.Container("100%","100%"),this.ammoText=new a.UI.DynamicText("0",{style:xd,allowTags:!0}),this.reloadText=new a.UI.DynamicText("Reloading",{style:vd}),this.nameText=new a.UI.DynamicText((""+b).toUpperCase(),{style:sd}),this.gradeText=new a.UI.DynamicText("",{style:od}),c.GUIIconId&&(this.icon=a.UI.Sprite.fromFrame("UI/weapon/"+c.GUIIconId+".png"),this.icon.pivotX=0,this.icon.pivotY=0,this.icon.anchorBottom=-c.GUIIconOffset.y,this.icon.right=-c.GUIIconOffset.x-2,this.icon.alpha=.8,this.ammoText.addChild(this.icon),this.ammoOffset.x=this.icon.width*-.5+1),this.ammo=-1,this.primary=!1,this.container.width="100%",this.container.height="100%",this.gradeText.anchorBottom=-1,this.nameText.anchorBottom=11,this.ammoText.anchorTop=30,this.reloadText.anchorTop=37,this.ammoText.horizontalAlign=this.reloadText.horizontalAlign=this.nameText.horizontalAlign=this.gradeText.horizontalAlign="center",this.ammoOffset.addChild(this.ammoText),this._a="",this.container.addChild(this.ammoOffset,this.reloadText,this.nameText,this.gradeText)}function Ab(){this.GUIClass=zb,this.GUIIconId=0,this.GUIIconOffset=new a.Point,this.GUIAmmoSize=25,this.GUIAmmoMaxSize=16,this.GUIMultiply=1,this.GUIDecimals=0,this.GUIShowMax=!0,this.GUIPrepend="",GameObject.call(this);this.ammo=0,this.primary=0,this.GUI=void 0,this.defaultAmmo=0,this.name="",this.GUIInitialized=!1,this.unit=null,this.weaponConfig=null,this.on(100,function(a,b){return b?void this.updateAmmo(a,b.unpack(1)):void this.updateAmmo(a)}),this.on(99,function(a,b,c){return c?void this.initGUI(a,b,c.unpack(1)):void this.initGUI(a,b)})}function Bb(){Ab.call(this);var b=this,d=void 0,e=!1,f=0,g=0;this.sound_shoot=new P(Dd.Audio.Base.tesla_impact),this.sound_impact=new P(Dd.Audio.Base.tesla_impact),this.sound_reload=new P(Dd.Audio.Base.tesla_impact),this.bullet_texture_frame="Particles/projectile.png",this.bullet_tint=16777215,this.bullet_blendmode=0,this.impact_effect=Da,this.muzzle_flash_textures=["Particles/mini_flash_1.png","Particles/mini_flash_2.png","Particles/mini_flash_3.png","Particles/mini_flash_4.png"],this.muzzle_flash_tint=16777215,this.muzzle_flash_scale_x_min=1,this.muzzle_flash_scale_x_max=1,this.muzzle_flash_scale_y_min=1,this.muzzle_flash_scale_y_max=1,this.muzzle_glow_anchor=new a.Point(.5,.5),this.muzzle_glow_tint=16777215,this.muzzle_glow_scale_x_min=1.5,this.muzzle_glow_scale_x_max=1.5,this.muzzle_glow_scale_y_min=1.5,this.muzzle_glow_scale_y_max=1.5,this.muzzle_glow_alpha=.2,this.kick_force=5;var h={},i=[],j=new a.Sprite(a.Texture.EMPTY),k=a.Sprite.fromFrame("Particles/particle_big.png");k.alpha=0,this.muzzleContainer=new a.Container,this.muzzleContainer.addChild(j,k),c.fromTo(k,.35,{alpha:0},{alpha:0}),this.initialize=function(b,c,h,l){if(Ab.prototype.initialize.call(this,b,c),d=getGameObject(b),e=c,e?d.primaryWeapon=this:d.secondaryWeapon=this,f=h,g=l,!d)return void this.destroy();if(!i.length)for(var m=0;m<this.muzzle_flash_textures.length;m++)i.push(a.Texture.fromFrame(this.muzzle_flash_textures[m]));var n;n=d.muzzleOffset?d.muzzleOffset:e?d.class.PrimaryOffset:d.class.SecondaryOffset,this.muzzleContainer.position.set(n.x,n.y),j.blendMode=1,j.tint=this.muzzle_flash_tint,j.anchor.set(.2,.5),k.anchor=this.muzzle_glow_anchor,k.blendMode=1,k.tint=this.muzzle_glow_tint,d.gun.addChild(this.muzzleContainer),j.parentLayer=k.parentLayer=Dd.Scene.layerParticle_ADD},this.show=function(){this.visible||Ab.prototype.show.call(this)},this.hide=function(){this.visible&&Ab.prototype.hide.call(this)},this.destroy=function(){for(var a in h){var b=h[a];b&&(b.stop(),h[a]=void 0)}Ab.prototype.destroy.call(this)};this.on(0,function(a){this.kick(this.kick_force),k.scale.x=A(this.muzzle_glow_scale_x_min,this.muzzle_glow_scale_x_max),k.scale.y=A(this.muzzle_glow_scale_y_min,this.muzzle_glow_scale_y_max),c.fromTo(k,.35,{alpha:this.muzzle_glow_alpha},{alpha:0}),j.texture=i.random();var l=A(this.muzzle_flash_scale_x_min,this.muzzle_flash_scale_x_max),m=A(this.muzzle_flash_scale_y_min,this.muzzle_flash_scale_y_max);c.fromTo(j.scale,.4,{x:l,y:m},{x:.1*l,y:.1*m}),c.fromTo(j,.4,{alpha:1},{alpha:0,ease:Power3.easeOut}),b.sound_shoot.Play(d.position.x,d.position.y),h[a]=wa.Get(),h[a].start(d,e,f,g,this.bullet_texture_frame,this.bullet_tint,this.bullet_blendmode),d.me&&this.updateAmmo(this.ammo-1)}),this.on(1,function(a,c,d,e){var f=new Oc(a,c),g=f.rotation=d.unpack(2);this.impact_effect.Get().start(f,g),b.sound_impact.Play(f.x,f.y);var i=h[e];i&&(i.stop(),h[e]=void 0)}),this.on(2,function(a){})}function Cb(){Bb.call(this),this.GUIIconId=200,this.GUIIconOffset=new a.Point(0,(-3)),this.sound_shoot=new P(Dd.Audio.Base.cannon_small_shot),this.sound_impact=new P(Dd.Audio.Base.weapon_impact_medium),this.sound_reload=new P(Dd.Audio.Base.cannon_medium_reload),this.bullet_texture_frame="Particles/projectile.png",this.kick_force=3,this.bullet_tint=16777215,this.bullet_blendmode=0,this.impact_effect=qa,this.muzzle_flash_tint=16777215,this.muzzle_flash_scale_x_min=1.5,this.muzzle_flash_scale_x_max=2,this.muzzle_flash_scale_y_min=1.5,this.muzzle_flash_scale_y_max=2,this.muzzle_glow_tint=16773523,this.muzzle_glow_alpha=.2}function Db(){Bb.call(this),this.GUIIconId=201,this.GUIIconOffset=new a.Point(0,0),this.sound_shoot=new P(Dd.Audio.Base.cannon_medium_shot),this.sound_impact=new P(Dd.Audio.Base.weapon_impact_medium),this.sound_reload=new P(Dd.Audio.Base.cannon_medium_reload),this.bullet_texture_frame="Particles/projectile.png",this.kick_force=5,this.bullet_tint=16777215,this.bullet_blendmode=0,this.impact_effect=ra,this.muzzle_flash_tint=16777215,this.muzzle_flash_scale_x_min=2,this.muzzle_flash_scale_x_max=2.5,this.muzzle_flash_scale_y_min=2,this.muzzle_flash_scale_y_max=2.5,this.muzzle_glow_tint=16773523,this.muzzle_glow_alpha=.2}function Eb(){Bb.call(this),this.GUIIconId=202,this.GUIIconOffset=new a.Point((-1),0),this.sound_shoot=new P(Dd.Audio.Base.cannon_heavy_shot),this.sound_impact=new P(Dd.Audio.Base.weapon_impact_heavy),this.sound_reload=new P(Dd.Audio.Base.cannon_heavy_reload),this.bullet_texture_frame="Particles/projectile.png",this.kick_force=7,this.bullet_tint=16777215,this.bullet_blendmode=0,this.impact_effect=sa,this.muzzle_flash_tint=16777215,this.muzzle_flash_scale_x_min=3,this.muzzle_flash_scale_x_max=4,this.muzzle_flash_scale_y_min=3,this.muzzle_flash_scale_y_max=4,this.muzzle_glow_tint=16773523,this.muzzle_glow_alpha=.3,this.muzzle_flash_textures=["Particles/round_flash_1.png","Particles/round_flash_2.png","Particles/round_flash_3.png","Particles/round_flash_4.png"]}function Fb(){Ab.call(this),this.GUIIconId=203,this.GUIIconOffset=new a.Point(0,(-3)),this.GUIMultiply=2,this.GUIDecimals=1,this.GUIPrepend="L";var b=this,c=void 0,d=!1,e=0,f=0,g=new P(Dd.Audio.Base.flamethrower_activate),h=new P(Dd.Audio.Base.flamethrower_loop),i=new P(Dd.Audio.Base.flamethrower_hit_loop);this.sound_reload=new P(Dd.Audio.Base.flamethrower_reload);var j=!1,k=100;this.update=function(a,d){j&&(k+=a,k>.2&&(i.FadeOut(.5),j=!1)),l&&(c.me&&b.updateAmmo(b.ammo-a),h.SetPosition(c.position.x,c.position.y))},this.initialize=function(a,b,g){Ab.prototype.initialize.call(this,a,b),c=this.unit,d=b,e=g,f=e},this.show=function(){this.visible||(Ab.prototype.show.call(this),PE.GameLoop.onUpdate(this.update,this))},this.hide=function(){this.visible&&(Ab.prototype.hide.call(this),m(),PE.GameLoop.offUpdate(this.update,this))};var l=null;this.destroy=function(){Ab.prototype.destroy.call(this)};var m=function(){l&&(h.FadeOut(.5),j&&(i.FadeOut(.5),j=!1),l.stop(),l=void 0)};this.on(0,m),this.on(1,function(){this.show(),g.Play(c.position.x,c.position.y),h.Play(0,0,null,.5),l&&m(),l=ha.Get(),l.start(c,e,d)});new Oc;this.on(2,function(a,b){if(k=0,j?i.SetPosition(a,b):(j=!0,i.Play(a,b,null,0,5)),l){var g=c.getMuzzleFlashPosition(d);f=Oc.Distance(g.x,g.y,a,b),l.updateRange(f,e),ia.Get().start(a,b,c.getWeaponOrientation(d))}}),this.on(3,function(){m()}),this.on(4,function(a){e=a,l&&l.updateRange(f,e)})}function Gb(){Ab.call(this),this.GUIIconId=204,this.GUIIconOffset=new a.Point(0,(-1)),this.GUIMultiply=50,this.sound_reload=new P(Dd.Audio.Base.minigun_reload);var b=this,c=!1,d=void 0,e=!1,f=0,g=0,h=new P(Dd.Audio.Base.minigun_start),i=new P(Dd.Audio.Base.minigun_stop),j=new P(Dd.Audio.Base.minigun_loop),k=!1;this.update=function(a,c){l&&(d.me&&b.updateAmmo(b.ammo-a),j.SetPosition(d.position.x,d.position.y),k||(k=!0,u(function(){b.kick(3),k=!1},100)))},this.initialize=function(a,b,c){Ab.prototype.initialize.call(this,a,b),d=this.unit,e=b,f=c,g=f},this.show=function(){this.visible||(Ab.prototype.show.call(this),PE.GameLoop.onUpdate(this.update,this))},this.hide=function(){this.visible&&(Ab.prototype.hide.call(this),m(),PE.GameLoop.offUpdate(this.update,this))};var l=null,m=function(){c&&(d.minigunSpinDown&&d.minigunSpinDown(),c=!1,n())};this.on(0,m);var n=function(){l&&(j.FadeOut(.2),l.stop(),l=void 0);var a=0;h.IsPlaying()&&(a=h.Seek(),h.FadeOut(.3)),i.Play(d.position.x,d.position.y),a&&i.Seek(1-a)};this.on(1,function(a){c||(d.minigunSpinUp&&d.minigunSpinUp(),this.show(),c=!0,a?o():h.Play(d.position.x,d.position.y))});var o=function(){n(),j.Play(d.position.x,d.position.y),l=va.Get(),l.start(d,f,e),b.kick(3)};this.on(2,o);new Oc;this.on(3,function(a,b){Dd.Audio.Common.wall_impact_light.Play(a,b),Ha.Get().start(a,b,d.getWeaponOrientation(e));var c=d.getMuzzleFlashPosition(e);g=Oc.Distance(c.x,c.y,a,b),l&&l.updateRange(g,f)});var p=new Oc;this.on(4,function(a,b){var c=d.getWeaponOrientation(e);Dd.Audio.Common.impact_light.Play(a,b),Oc.Forward(c,20,p),p.x+=a,p.y+=b,ta.Get().start(p,c);var h=d.getMuzzleFlashPosition(e);g=Oc.Distance(h.x,h.y,a,b),l&&l.updateRange(g,f)})}function Hb(){Ab.call(this),this.GUIIconId=205,this.GUIIconOffset=new a.Point((-1),0),this.sound_reload=new P(Dd.Audio.Base.missile_reload),this.on(0,function(a){this.kick(5),this.unit.me&&this.updateAmmo(this.ammo-1)})}function Ib(){Ab.call(this),this.GUIIconId=206,this.GUIIconOffset=new a.Point(0,(-1)),this.sound_reload=new P(Dd.Audio.Base.missile_reload),this.on(0,function(a){this.kick(5),this.unit.me&&this.updateAmmo(this.ammo-1)})}function Jb(){Ab.call(this),this.GUIIconId=207,this.GUIIconOffset=new a.Point(0,0),this.sound_reload=new P(Dd.Audio.Base.tesla_reload);var b=void 0,c=!1,d=new P(Dd.Audio.Base.tesla_impact);this.initialize=function(a,d){Ab.prototype.initialize.call(this,a,d),b=this.unit,c=d},this.show=function(){this.visible||Ab.prototype.show.call(this)},this.hide=function(){this.visible&&Ab.prototype.hide.call(this)},this.on(0,function(){b.teslaWarmUp&&b.teslaWarmUp(),Fa.Get().start(b,c,!0)}),this.on(1,function(a,e,f){var g=new Oc(a,e),h=b.getMuzzleFlashPosition(c,!0,!0),i=h.angleTowards(g),j=Oc.Distance(h,g)+15;Ea.Get().start(h,i,j),f&&(Da.Get().start(g,i),d.Play(g.x,g.y)),b.me&&this.updateAmmo(this.ammo-1)})}function Kb(){Ab.call(this),this.GUIIconId=208,this.GUIIconOffset=new a.Point(0,(-1));var b=void 0,c=new P(Dd.Audio.Base.healing_pulse);this.initialize=function(a,c){Ab.prototype.initialize.call(this,a,c),b=this.unit},this.show=function(){this.visible||Ab.prototype.show.call(this)},this.hide=function(){this.visible&&Ab.prototype.hide.call(this)},this.on(0,function(a){b.healingPulse&&b.healingPulse(),c.Play(b.position.x,b.position.y),oa.Get().start(b),this.unit.me&&this.updateAmmo(this.ammo-1)}),this.on(1,function(a){var b=getGameObject(a);b&&la.Get().start(b,!0)})}function Lb(){Ab.call(this),this.GUIIconId=209,this.GUIIconOffset=new a.Point(0,(-1)),this.GUIDecimals=1,this.GUIPrepend="sec";var b=this,c=void 0,d=!1,e=void 0,f=void 0,g=void 0,h=void 0,i=!1,j=function(a){b.updateAmmo(i?b.ammo-a:b.ammo+.5*a)};this.initialize=function(a,b){Ab.prototype.initialize.call(this,a,b),c=this.unit,d=b,c.me&&PE.GameLoop.onUpdate(j,this)},this.show=function(){this.visible||Ab.prototype.show.call(this)},this.hide=function(){this.visible&&(l(),Ab.prototype.hide.call(this))},this.destroy=function(){c.me&&PE.GameLoop.offUpdate(j,this),Ab.prototype.destroy.call(this)};var k=function(a){if(e&&m(),a){var b=getGameObject(a);b&&(e=ma.Get(),e.start(c,b,d),g&&g.stop(),g=la.Get(),g.start(b,!1))}},l=(this.on(0,function(a){i=!0,k(a),f||(f=na.Get(),f.start(c,d)),h||(h=la.Get(),h.start(c,!1))}),this.on(1,function(){i=!1,m(),f&&(f.stop(),f=void 0),h&&(h.stop(),h=void 0)})),m=this.on(2,function(){e&&(e.stop(),e=void 0),g&&(g.stop(),g=void 0)});this.on(3,function(){this.updateAmmo(0)})}function Mb(){Bb.call(this),this.GUIIconId=210,this.GUIIconOffset=new a.Point(0,(-2)),this.sound_shoot=new P(Dd.Audio.Base.cannon_long_shot),this.sound_impact=new P(Dd.Audio.Base.weapon_impact_heavy),this.sound_reload=new P(Dd.Audio.Base.cannon_heavy_reload),this.bullet_texture_frame="Particles/projectile.png",this.kick_force=10,this.bullet_tint=16777215,this.bullet_blendmode=0,this.impact_effect=sa,this.muzzle_flash_tint=16777215,this.muzzle_flash_scale_x_min=2.5,this.muzzle_flash_scale_x_max=3.5,this.muzzle_flash_scale_y_min=2.5,this.muzzle_flash_scale_y_max=3.5,this.muzzle_glow_tint=16773523,this.muzzle_glow_alpha=.3}function Nb(){Ab.call(this),this.GUIIconId=211,this.GUIIconOffset=new a.Point(0,(-3)),this.sound_reload=new P(Dd.Audio.Base.grenade_reload),this.on(0,function(a){this.kick(6),this.unit.me&&this.updateAmmo(this.ammo-1)})}function Ob(){Bb.call(this),this.GUIIconId=212,this.GUIIconOffset=new a.Point(0,(-1)),this.sound_shoot=new P(Dd.Audio.Base.laser_shot),this.sound_impact=new P(Dd.Audio.Base.tesla_impact),this.sound_reload=new P(Dd.Audio.Base.laser_reload),this.bullet_texture_frame="Particles/laser.png",this.bullet_tint=16777215,this.bullet_blendmode=1,this.impact_effect=ua,this.muzzle_flash_textures=["Particles/round_flash_1.png","Particles/round_flash_2.png","Particles/round_flash_3.png","Particles/round_flash_4.png"],this.muzzle_flash_tint=16762052,this.muzzle_flash_scale_x_min=1.3,this.muzzle_flash_scale_x_max=1.6,this.muzzle_flash_scale_y_min=1.3,this.muzzle_flash_scale_y_max=1.4,this.muzzle_glow_tint=15948892,this.muzzle_glow_alpha=.2}function Pb(){Ab.call(this),this.GUIIconId=213,this.GUIIconOffset=new a.Point((-1),(-3)),this.GUIDecimals=1,this.GUIShowMax=0,this.GUIPrepend="sec";var b=this,d=void 0,e=new P(Dd.Audio.Base.cloak_activate),f=new P(Dd.Audio.Base.cloak_deactivate),g=!1,h=!1,i=null;this.initialize=function(a,b){Ab.prototype.initialize.call(this,a,b),d=this.unit,i=d.tank.clone(),Dd.Scene.layerTank.addChild(i.container),i.container.parentLayer=Dd.Scene.layerDisplacement},this.show=function(){this.visible||(Ab.prototype.show.call(this),h=!1,i.container.visible=!1,d.tank.gun.alpha=1,d.tank.body.alpha=1,d.healthbar.container.alpha=1,i.container.alpha=0,PE.GameLoop.onUpdate(this.update,this))},this.hide=function(){this.visible&&(i.container.visible=!1,Ab.prototype.hide.call(this),PE.GameLoop.offUpdate(this.update,this))},this.destroy=function(){Ab.prototype.destroy.call(this),j(!1,!0),i&&i.parent&&i.parent.removeChild(i)},this.update=function(a,c){d.me&&b.updateAmmo(g?b.ammo-a:b.ammo+a),h&&(i.container.position=d.tank.container.position,i.body.rotation=d.tank.body.rotation,i.gun.rotation=d.tank.gun.rotation)};var j=function(a,b){return g=a,b?(c.set(i.container,{alpha:g?.5:0}),c.set(d.tank.gun,{alpha:g?0:1}),c.set(d.tank.body,{alpha:g?0:1}),c.to(d.healthbar.container,.5,{alpha:g?0:1}),i.container.visible=g,void(h=g)):(c.to(d.healthbar.container,.5,{alpha:g?d.friendsWith(Dd.playerUnit)?1:0:1}),c.to(i.container,.5,{alpha:g?.5:0}),c.to(d.tank.gun,.5,{alpha:g?0:1}),c.to(d.tank.body,.5,{alpha:g?0:1,onComplete:function(){g||(i.container.visible=!1,h=!1)}}),void(a?(e.Play(d.position.x,d.position.y),h=!0,i.container.visible=!0):f.Play(d.position.x,d.position.y)))};this.on(0,j),this.on(1,function(){h=!0,i.container.visible=!0,i.container.alpha=.5,d.tank.gun.alpha=0,d.tank.body.alpha=0,d.friendsWith(Dd.playerUnit)||(d.healthbar.container.alpha=0)})}function Qb(){Ab.call(this),this.GUIIconId=0,this.GUIIconOffset=new a.Point(0,0),this.GUIMultiply=50;var b=this,c=!1,d=void 0,e=!1,f=0,g=0,h=!1;this.update=function(a,c){i&&(d.me&&b.updateAmmo(b.ammo-a),h||(h=!0,u(function(){b.kick(3),h=!1},100)))},this.initialize=function(a,b,c){Ab.prototype.initialize.call(this,a,b),d=this.unit,e=b,f=c,g=f},this.show=function(){this.visible||(Ab.prototype.show.call(this),PE.GameLoop.onUpdate(this.update,this))},this.hide=function(){this.visible&&(Ab.prototype.hide.call(this),j(),PE.GameLoop.offUpdate(this.update,this))};var i=null;this.destroy=function(){Ab.prototype.destroy.call(this)};var j=function(){c&&(c=!1,k())};this.on(0,j);var k=function(){if(i){i.stop(),i=void 0}};this.on(1,function(){c||(this.show(),c=!0,k(),i=va.Get(),i.start(d,f,e),b.kick(3))});new Oc;this.on(3,function(a,b){Dd.Audio.Common.wall_impact_light.Play(a,b),Ha.Get().start(a,b,d.getWeaponOrientation(e));var c=d.getMuzzleFlashPosition(e);g=Oc.Distance(c.x,c.y,a,b),i&&i.updateRange(g,f)});var l=new Oc;this.on(4,function(a,b){var c=d.getWeaponOrientation(e);Dd.Audio.Common.impact_light.Play(a,b),Oc.Forward(c,20,l),l.x+=a,l.y+=b,ta.Get().start(l,c);var h=d.getMuzzleFlashPosition(e);g=Oc.Distance(h.x,h.y,a,b),i&&i.updateRange(g,f)})}function Rb(){Bb.call(this),this.GUIIconId=210,this.GUIIconOffset=new a.Point(0,(-1)),this.sound_shoot=new P(Dd.Audio.Base.cannon_long_shot),this.sound_impact=new P(Dd.Audio.Base.weapon_impact_heavy),this.sound_reload=new P(Dd.Audio.Base.cannon_heavy_reload),this.bullet_texture_frame="Particles/missile_01.png",this.kick_force=10,this.bullet_tint=16777215,this.bullet_blendmode=0,this.impact_effect=sa,this.muzzle_flash_tint=16777215,this.muzzle_flash_scale_x_min=2.5,this.muzzle_flash_scale_x_max=3.5,this.muzzle_flash_scale_y_min=2.5,this.muzzle_flash_scale_y_max=3.5,this.muzzle_glow_tint=16773523,this.muzzle_glow_alpha=.3}function Sb(){GameObject.call(this);var a,b,c,d=this,e=2,f=2,g=2,h=this.data={x:0,y:0,rotation:0,velocity:0},i=2,j=2,l=!0;this.initialize=function(i,j,k,m,n,o,p){a=p,b=getGameObject(p),h.velocity=o.unpack(3),f=m.unpack(2),void 0!==n?e=n.unpack(1):(g=f,e=2),h.x=i,h.y=j,h.rotation=k.unpack(2),d.show(),c||(c=pa.Get(),c.start(d,!0),c.show()),l=!0},this.show=function(){this.visible||(c&&c.show(),GameObject.prototype.show.call(this),PE.Server.onUpdate(this.update,this))},this.hide=function(){this.visible&&(c&&c.hide(),GameObject.prototype.hide.call(this),PE.Server.offUpdate(this.update,this))},this.update=function(a,c){if(l)return void(l=!1);if(e<1){var d=e/1;g=z(.3,f,d),i=z(0,j,d),e+=a,e>1&&(i=j,g=f)}var m=g*a,n=new Oc(h.x,h.y);b&&(h.rotation=Mathf.smoothDampAngle(h.rotation,n.angleTowards(new Oc(b.data.x,b.data.y)),h,a,.3,i)),h.x+=k.cos(h.rotation)*m*100,h.y+=k.sin(h.rotation)*m*100},this.destroy=function(){this.hide(),c&&c.stop(),PE.Server.offUpdate(d.update,this),GameObject.prototype.destroy.call(this)},this.on(0,function(a,b,d){h.x=a,h.y=b,h.rotation=d,this.show(),c||(c=pa.Get(),c.start(this,!0),c.show())}),this.on(1,function(){if(this.visible){Dd.Audio.Common.explosion_3.Play(h.x,h.y);ga.Get().start(h)}var a=c;c=void 0,u(function(){a&&a.stop(),d.destroy()},90)})}function Tb(){GameObject.call(this);var a,b=this,c=0,d=0,e=0,f=this.data={x:0,y:0,rotation:0},g=0;this.initialize=function(h,i,j,k,l){g=0,d=k.unpack(2),void 0!==l?c=l.unpack(1):(e=d,c=2),f.x=h,f.y=i,f.rotation=j.unpack(2),b.show(),a||(a=pa.Get(),a.start(b,!1),a.show())},this.show=function(){this.visible||(a&&a.show(),GameObject.prototype.show.call(this),PE.GameLoop.onUpdate(this.update,this))},this.hide=function(){this.visible&&(a&&a.hide(),GameObject.prototype.hide.call(this),PE.GameLoop.offUpdate(this.update,this))},this.update=function(a,b){if(g<.09&&(a*=.5,g+=a),c<1){e=z(.3,d,c/1),c+=a,c>1&&(e=d)}var h=e*a;f.x+=k.cos(f.rotation)*h*100,f.y+=k.sin(f.rotation)*h*100},this.destroy=function(){this.hide(),a&&a.stop(),PE.GameLoop.offUpdate(this.update,this),GameObject.prototype.destroy.call(this)},this.on(1,function(b,c){if(f.x=b,f.y=c,a&&a.stop(),this.visible){Dd.Audio.Common.explosion_3.Play(b,c);ga.Get().start(f)}a=void 0,this.destroy()})}function Ub(){GameObject.call(this);var a,b=this,c=this.data={x:0,y:0,rotation:0,velocity:new Oc,rotspd:0},d=0,e=new P(Dd.Audio.Base.grenade_shot),f=new P(Dd.Audio.Base.grenade_bounce);this.initialize=function(b){a=void 0,d=b?b.unpack(2):0},this.show=function(){this.visible||(a||(d<.2&&e.Play(c.x,c.y),a=ja.Get(),a.start(b,d)),PE.Server.onUpdate(this.update,this),a.show(),GameObject.prototype.show.call(this))},this.hide=function(){this.visible&&(PE.Server.offUpdate(this.update,this),a&&a.hide(),GameObject.prototype.hide.call(this))},this.destroy=function(){a&&a.stop(),GameObject.prototype.destroy.call(this)},this.update=function(a,b){var d=c.velocity.x*k.min(1,1.5*a),e=c.velocity.y*k.min(1,1.5*a),f=c.rotspd*a;c.velocity.x-=d,c.velocity.y-=e,c.rotspd-=f,c.rotation+=c.rotspd*a,c.x+=c.velocity.x*a,c.y+=c.velocity.y*a};var g=function(a,d,e,f,g){c.x=a,c.y=d,c.rotation=k.atan2(f,e),
c.rotspd=g.unpack(2),c.velocity.set(e,f),b.show()};this.on(0,g),this.on(1,function(a,b,c,d,e){g(a,b,c,d,e),f.Play(a,b)}),this.on(2,function(d,e){if(c.x=d,c.y=e,a&&a.stop(),this.visible){Dd.Audio.Common.explosion_3.Play(d,e);ea.Get().start(c)}var f=a;a=void 0,u(function(){f&&f.stop(),b.destroy()},90)})}function Vb(){GameObject.call(this);var b=new Vector2,c=new Vector2,d=0,e=0,f=a.Sprite.fromFrame("Particles/bomb.png"),g=a.Sprite.fromFrame("Particles/bomb.png");f.anchor.set(.5),g.anchor.set(.5),g.scale=.5,g.tint=0,g.alpha=.5;var h=new P(Dd.Audio.Base.bomb_fall_explode);this.initialize=function(a,e,i,j){b.set(a,e),c.set(i,j),h.Play(c.x,c.y),d=b.angleTowards(c),f.position.copy(b),f.rotation=g.rotation=d,this.show()},this.show=function(){this.visible||(e=0,PE.GameLoop.onUpdate(this.update,this),GameObject.prototype.show.call(this),Dd.Scene.layerParticle.addChild(f),Dd.Scene.aboveShadow.addChild(g))},this.hide=function(){this.visible&&(PE.GameLoop.offUpdate(this.update,this),GameObject.prototype.hide.call(this),Dd.Scene.layerParticle.removeChild(f),Dd.Scene.aboveShadow.removeChild(g))},this.destroy=function(){GameObject.prototype.destroy.call(this)},this.update=function(a,d){h.SetPosition(c.x,c.y),e+=a;var i=e*e;f.scale.set(Mathf.lerp(1.3,.5,i)),g.scale.set(Mathf.lerp(.8,.5,i)),g.alpha=Mathf.lerp(.15,.35,i),Vector2.Lerp(b,c,i,f.position),g.position.x=f.position.x,g.position.y=f.position.y+Mathf.lerp(250,0,i),e>=1&&(fa.Get().start(c),this.destroy())}}function Wb(a){return a[k.floor(k.random()*a.length)]}function Xb(a,b){return k.floor(k.random()*(b-a+1))+a}function Yb(a){var b=a.html();a.empty();for(var c=b.split(" "),d={chars:[],words:[]},e=0;e<c.length;e++){0!=e&&a.append(" ");var g=f("<div style='position: relative; display: inline-block'>");a.append(g),d.words.push(c[e]);for(var h=0;h<c[e].length;h++){var i=f("<div style='position: relative; display: inline-block'>"+c[e][h]+"</div>");g.append(i),d.chars.push(i)}}return d}function Zb(b,c){var d=this,e=this.container=new a.UI.Container(250,0);e.alpha=0,this.index=0;var f=0,g=0,h=new a.UI.SliceSprite(kf,4);h.tint=0,h.alpha=.7,h.width=h.height="100%",e.addChild(h);var i=this.container=new a.UI.Container(0,30);i.anchorBottom=0,i.align="center",e.addChild(i);var j=new a.UI.DynamicText(b,{style:kd,width:"95%",height:25}),k=new a.UI.DynamicText(c,{style:ad,width:"95%",height:25});j.style.overflowY=k.style.overflowY="hidden",j.style.overflowX=k.style.overflowX="hidden",j.style.ellipsis=k.style.ellipsis=!0,j.style.wrap=k.style.wrap=!1,k.align=j.align=k.style.align=j.style.align="center",j.y=10,k.y=40,e.addChild(j,k);var l=!1,m=null,n=function(){m=u(function(){d.hide()},g)},o=function(){null!==m&&(t(m),m=null)};new a.UI.Interaction.ClickEvent(e,(!0)).onHover=function(a,b){b?o():n()};var p=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/blank.png"),text:new a.UI.DynamicText("X",{style:fd}),width:20,height:20});p.background.tint=16711680,p.background.alpha=.6,p.anchorTop=p.anchorRight=5,p.on("click",function(){d.hide()}),e.addChild(p),this.addButton=function(b,c,e,g){var h=new a.UI.Button({background:new a.UI.SliceSprite(kf,4),text:new a.UI.DynamicText(b,{style:id}),width:c,height:23});return h.background.tint=e,h.on("click",function(){"function"==typeof g&&g(),d.hide()}),h.x=f,f+=c+7,i.width=f-7,i.addChild(h),this},this.move=function(){a.UI.Tween.to(e,.4,{y:5+105*this.index},a.UI.Ease.Circ.CircOut)},this.show=function(b){if(!l){l=!0,g=b;for(var c=0;c<Oe.length;c++)Oe[c].index+=1,Oe[c].move();Oe.unshift(this),e.visible=e.interactive=l,e.anchorRight=10,e.y=5,Dd.Scene.UI_Notification.addChild(e),Ne++,a.UI.Tween.to(e,.4,{alpha:1,height:100},a.UI.Ease.Circ.CircOut),n()}},this.hide=function(){if(l){l=!1,Ne--;for(var b=this.index+1;b<Oe.length;b++)Oe[b].index-=1,Oe[b].move();Oe.splice(this.index,1),o(),a.UI.Tween.to(e,.4,{alpha:0,height:0,onComplete:function(){e.visible=e.interactive=l,Dd.Scene.UI_Notification.removeChild(e)}},a.UI.Ease.Circ.CircOut)}}}function $b(){var b=!1,c=new a.UI.Container(350,100);c.top="10%",c.align="center";var d=a.UI.Sprite.fromFrame("blank.png");d.width=d.height="100%",d.alpha=.2,d.tint=0,c.addChild(d),Dd.Scene.UI_INGAME.addChild(c);var e=new a.UI.DynamicText("Spectating",{style:xd});e.align="center",e.top=20,e.alpha=.5;var f=new a.UI.DynamicText("Name of player",{style:wd});f.align="center",f.top=50;var g=function(a){this.background.alpha=a?.5:.3},h=new a.UI.Button({background:a.UI.Sprite.fromFrame("blank.png"),width:100,height:100,text:new a.UI.DynamicText("◀",{style:nd})});h.background.tint=0,h.background.alpha=.4,h.anchorLeft=-105,h.on("hover",g),h.on("click",function(){oe.signal(2)});var i=new a.UI.Button({background:a.UI.Sprite.fromFrame("blank.png"),width:100,height:100,text:new a.UI.DynamicText("▶",{style:nd})});i.background.tint=0,i.background.alpha=.4,i.anchorRight=-105,i.on("hover",g),i.on("click",function(){oe.signal(1)}),c.addChild(e,f,h,i),this.show=function(){b||(b=!0,c.visible=!0,a.UI.Tween.set(c,{alpha:0}),a.UI.Tween.to(c,1,{alpha:1}))},this.hide=function(){b&&(b=!1,c.visible=!1,a.UI.Tween.set(c,{alpha:0}))},this.setName=function(a){f.value=a}}function _b(a){return a<tf[1]?1:a<tf[2]?2:a<tf[3]?3:a<tf[4]?4:a<tf[5]?5:a<tf[6]?6:a<tf[7]?7:8}function ac(){this.initialized=!1,this.isOpen=!1,this.headline=""}function bc(){var b="",c=a.UI.Sprite.fromFrame("UI/Menu/Shop/offers/refer_a_friend.png");c.anchorTop=24,c.horizontalAlign="center";var d=new a.UI.Container(190,51);d.anchorTop=106,d.horizontalAlign="center";var e=new a.UI.SliceSprite(cf,3,(!0),(!0));e.tint=0,e.alpha=.4,e.height=e.width="100%",e.anchorBottom=0;var f=new ec(10,ah.Gems,2);f.container.anchorBottom=9,f.container.anchorRight=30;var g=new a.UI.DynamicText("Earn",{style:ld});g.anchorBottom=10,g.anchorLeft=35;var h=new a.UI.DynamicText("FOR EACH NEW SIGNUP\nUSING YOUR REFERRAL LINK",{style:yd});h.style.align="center",h.style.lineHeight=26,h.width="100%",h.anchorTop=182,d.addChild(e,g,f.container);var i=new a.UI.SliceSprite(cf,3,(!0),(!0));i.tint=3355443,i.width="100%",i.height="100%",i.alpha=.4;var j=new a.UI.SliceSprite(cf,3,(!0),(!0));j.tint=0,j.width="100%",j.height="100%",j.alpha=.4;var k=new a.UI.DynamicText("Friends Referred  <b>0</b>",{style:cd,allowTags:!0,width:"100%"});k.style.align="center",k.anchorBottom=25;var l=new a.UI.Container(380,44);l.horizontalAlign="center",l.anchorBottom=68;var m=a.UI.Sprite.fromFrame("UI/blank.png");m.height="100%",m.anchorLeft=0,m.anchorRight=96,m.alpha=.8;var n=new a.UI.DynamicText(" ",{style:cd,allowTags:!0});n.anchorBottom=9,n.anchorLeft=15,n.style.tint="#484848";var o=a.UI.Sprite.fromFrame("UI/blank.png");o.height="100%",o.anchorLeft=0,o.anchorRight=96,o.alpha=0;var p=new a.UI.DynamicText("Copied",{style:jd});p.verticalAlign="middle",p.horizontalAlign="center",p.style.tint="#000000",o.addChild(p);var q=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/blank.png"),width:96,height:"100%"});q.background.tint=5208490,q.anchorRight=0;var r=a.UI.Sprite.fromFrame("UI/Menu/Shop/offers/copy.png");r.anchorLeft=7,r.anchorTop=13;var s=new a.UI.DynamicText("copy to\nclipboard",{style:_c});s.style.lineHeight=14,s.anchorTop=6,s.anchorLeft=30,q.on("hover",function(a){this.background.tint=a?6919365:5208490}),q.on("click",function(){0===Dd.friendID?xc.open("You must sign-in to refer friends"):(Ic(b),a.UI.Tween.fromTo(o,1.5,{alpha:1},{alpha:0}),googa("send","event","Offers Menu","ReferURL Copied"))}),q.addChild(r,s),l.addChild(m,q,n,o);var v=new a.UI.Container("100%",139);v.anchorBottom=0,v.addChild(j,k,l);var w=this.container=new a.UI.Container(433,412);w.pivotX=.5,w.addChild(i,c,d,h,v),this.show=function(c,d){b=0===Dd.friendID?"Please Sign-in":"https://tankwars.io/?f="+Dd.friendID,n.text=b,k.text="Friends Referred <b>"+Dd.friendsReferred+"</b>",a.UI.Tween.set(this.container,{alpha:0});var e=this;this.to&&t(this.to),this.to=u(function(){a.UI.Tween.fromTo(e.container,d?0:1,{alpha:0},{alpha:1}),e.to=null},d?0:c)}}function cc(){var b=new a.UI.DynamicText("MORE OFFERS COMMING SOON",{style:bd});b.verticalAlign="middle",b.horizontalAlign="center",b.alpha=.5;var c=new a.UI.SliceSprite(cf,3,(!0),(!0));c.tint=3355443,c.width="100%",c.height="100%",c.alpha=.15;var d=new a.UI.Sprite.fromFrame("UI/banners/video.png");d.valign="middle",d.anchorLeft=10;var e=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/blank.png"),width:"90%",height:80});e.background.tint=8820535,e.align="center",e.anchorTop=20;var f=new a.UI.DynamicText("WATCH VIDEO AD",{style:ld});f.valign="middle",f.anchorLeft=70;var g=a.UI.Sprite.fromFrame("UI/Menu/Currency/gem2.png");g.pivot=.5,g.anchorTop=5,g.anchorRight=45,g.width=50,g.height=50;var h=a.UI.Sprite.fromFrame("UI/Menu/Currency/gem2.png");h.pivot=.5,h.anchorTop=5,h.anchorRight=5,h.width=50,h.height=50;var i=new a.UI.DynamicText("And get",{style:qd});i.pivot=.5,i.anchorRight=95,i.anchorBottom=6;var j=new a.UI.DynamicText("2 Gems",{style:xd});j.style.tint="#dbf791",j.pivot=.5,j.anchorRight=10,j.anchorBottom=6,e.on("hover",function(a){this.background.tint=a?10992459:8820535}),e.on("click",function(){Cd.WatchRewardAd()}),e.addChild(f,d,g,h,i,j);var k=this.container=new a.UI.Container(606,297);k.pivotX=.5,k.addChild(c,b,e),this.show=function(b,c){a.UI.Tween.set(this.container,{alpha:0});var d=this;this.to&&t(this.to),this.to=u(function(){a.UI.Tween.fromTo(d.container,c?0:1,{alpha:0},{alpha:1}),d.to=null},c?0:b)}}function dc(){ac.call(this),this.headline="FREE OFFERS",this.init=function(){ac.prototype.init.call(this),this.premiumOffer=new bc,this.container.addChild(this.premiumOffer.container),this.premiumOffer.container.anchorRight=77,this.premiumOffer.container.anchorBottom=51,this.moreOffer=new cc,this.container.addChild(this.moreOffer.container),this.moreOffer.container.anchorLeft=77,this.moreOffer.container.anchorBottom=51},this.open=function(){this.isOpen?(this.moreOffer.show(0,!0),this.premiumOffer.show(0,!0)):(ac.prototype.open.call(this),this.moreOffer.show(100),this.premiumOffer.show(0))}}function ec(b,c,d){var e,f,g=(this.container=new a.UI.Container,0),h="#ffffff";e=1==d?ud:yd,this.text=new a.UI.DynamicText(" ",{style:e,allowTags:!0}),this.text.pivot=1,this.container.addChild(this.text);var i={},j=-1;this.updateCurrency=function(b){if(b!=j&&(j=b,f&&f.parent.removeChild(f)),f=i[b],!f){var c;switch(b){case ah.Gems:c="UI/Menu/Currency/gem"+(1===d?1:2)+".png";break;case ah.Gold:c="UI/Menu/Currency/gold"+(1===d?1:2)+".png";break;case ah.Talent:c="UI/Menu/Currency/talent"+(1===d?1:2)+".png"}c&&(f=i[b]=a.UI.Sprite.fromFrame(c))}b==ah.Gems?(f=a.UI.Sprite.fromFrame("UI/Menu/Currency/gem"+(1===d?1:2)+".png"),h="#dbf791",1==d?(f.anchorRight=-3,f.y=2,g=17):(f.anchorRight=0,f.y=1,g=33)):b==ah.Gold?(f=a.UI.Sprite.fromFrame("UI/Menu/Currency/gold"+(1===d?1:2)+".png"),h="#fcd201",1==d?(f.anchorRight=0,f.y=-3,g=19):(f.anchorRight=0,f.y=-4,g=33)):b==ah.Talent&&(f=a.UI.Sprite.fromFrame("UI/Menu/Currency/talent"+(1===d?1:2)+".png"),h="#edfaff",1==d?(f.anchorRight=0,f.y=-2,g=19):(f.anchorRight=0,f.y=-4,g=33)),f&&(f.pivotY=1,this.container.addChild(f)),this.text.anchorRight=g,this.text.style.tint=h},this.amount=0,this.updateAmount=function(a){this.amount=a;var b=""+a;"LIFETIME"==this.text.value&&0!==a||(isNaN(j)&&(b=1==d?b+" "+j.toUpperCase():b+" <font size='16'>"+j.toUpperCase()),this.text.value=b)},this.addAmount=function(a){this.updateAmount(this.amount+a)},this.updateCurrency(c),this.updateAmount(b)}function fc(b){var c=b[0],d=a.UI.Sprite.fromFrame("UI/Menu/Shop/"+b[1]);d.x=b[2],d.y=b[3],d.pivot=.5;var e=new a.UI.Container("100%",46),g=a.UI.Sprite.fromFrame("UI/blank.png");g.tint=0,g.alpha=.4,g.height=g.width="100%",g.anchorBottom=0;var h=new ec(b[4],b[5],2);h.container.anchorBottom=7,h.container.anchorRight=7;var i=new a.UI.DynamicText("BUY NOW",{style:Ad});i.anchorBottom=11,i.anchorLeft=11,i.alpha=.4,e.addChild(g,i,h.container),e.anchorBottom=7;var j=b[7],k=void 0!==b[8],l=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0)),m=.4;l.tint=0,l.width="100%",l.height="100%",l.alpha=m;var n=this.container=new a.UI.Button({background:l,width:249,height:k?412:297});if(n.pivotX=.5,n.on("hover",function(b){a.UI.Tween.to(d,.1,{scale:b?1.1:1}),a.UI.Tween.to(l,.2,{alpha:b?.7:m}),a.UI.Tween.to(i,.2,{alpha:b?1:.4}),a.UI.Tween.to(g,.1,{height:b?55:46})}),n.on("click",function(){return Zh.authenticated?void f.ajax({type:"POST",url:"/Shop/StartBuyShopItem",data:{id:c},dataType:"json",async:!1,success:function(a){if(a.success){var b=a.price,c=a.currency,d=a.id,e=a.name;a.realmoney?Dd.Payment.BuyItem(d,e):vc.open(b,c,e,d)}else a.message&&nc.open("PURCHASE ERROR",a.message,"OK"),a.missing&&pc.open(a.missing,a.currency)}}):void xc.open("You must sign-in to make purchases")}),n.addChild(l,d,e),k){var o=new a.UI.Container("100%",89),p=a.UI.Sprite.fromFrame("UI/blank.png");p.height=p.width="100%",p.tint=0,p.alpha=.4;var q=a.UI.Sprite.fromFrame("UI/Menu/Shop/"+b[8]);q.verticalAlign="middle",q.horizontalAlign="center",o.addChild(p,q),n.addChild(o)}if(j){var r=a.UI.Sprite.fromFrame("UI/Menu/Shop/value.png");r.x=-10,r.y=-13,n.addChild(r)}this.show=function(b){a.UI.Tween.set(this.container,{alpha:0});var c=this;this.to&&t(this.to),this.to=u(function(){a.UI.Tween.fromTo(c.container,1,{alpha:0},{alpha:1}),a.UI.Tween.fromTo(d,1,{scale:.9},{scale:1},a.UI.Ease.Circ.CircOut),c.to=null},b)}}function gc(){ac.call(this),this.products=[],this.headline="BUY GOLD",this.bulletHeadline="USE GOLD TO",this.bulletTexts=["Unlock new crews and tanks","Repair and reuse tanks in combat","Buy loot crates"],this.bulletX=550,this.bulletY=24,this.bulletColor="#f7cc00",this.productData=[[0,"gold/image1.png",132,142,50,ah.Gems,!1,!1],[1,"gold/image2.png",129,136,50,ah.Gems,!1,!1],[2,"gold/image3.png",128,132,50,ah.Gems,!0,!1],[3,"gold/image4.png",141,216,50,ah.Gems,!1,!0,"bonus/1000talent.png"]]}function hc(){gc.call(this),this.headline="BUY CRATES",this.bulletHeadline="WHAT CAN YOU GET FROM A CRATE?",this.bulletTexts=["Skins and other cosmetic items","Gold, Talent or more Crates","Crew Commanders"],this.bulletX=610,this.bulletColor="#dbf791",this.init=function(){var a=Ec("/shop/getprices/19,20,21,22");this.productData=[[19,"crate/image1.png",125,136,a[0][1],a[0][2],!1,!1],[20,"crate/image2.png",124,136,a[1][1],a[1][2],!1,!1],[21,"crate/image3.png",123,126,a[2][1],a[2][2],!0,!1],[22,"crate/image4.png",123,236,a[3][1],a[3][2],!1,!0,"bonus/5crates.png"]],gc.prototype.init.call(this)}}function ic(){gc.call(this),this.headline="BUY GEMS",this.bulletHeadline="USE GEMS TO",this.bulletTexts=["Buy other currencies (Gold, Talent)","Upgade your account to Premium","Other special events and offers"],this.bulletX=550,this.bulletColor="#d3ff8b",this.init=function(){var a=Ec("/shop/getprices/15,16,17,18");this.productData=[[15,"gem/image1.png",127,168,a[0][1],a[0][2],!1,!1],[16,"gem/image2.png",127,154,a[1][1],a[1][2],!1,!1],[17,"gem/image3.png",130,117,a[2][1],a[2][2],!0,!1],[18,"gem/image4.png",116,227,a[3][1],a[3][2],!1,!0,"bonus/5crates.png",0,10]],gc.prototype.init.call(this)}}function jc(){gc.call(this),this.headline="BUY GOLD",this.bulletHeadline="USE GOLD TO",this.bulletTexts=["Unlock new crews and tanks","Repair and reuse tanks in combat","Buy loot crates"],this.bulletX=550,this.bulletY=24,this.bulletColor="#f7cc00",this.init=function(){var a=Ec("/shop/getprices/6,7,8,9");this.productData=[[6,"gold/image1.png",113,160,a[0][1],a[0][2],!1,!1],[7,"gold/image2.png",120,139,a[1][1],a[1][2],!1,!1],[8,"gold/image3.png",128,135,a[2][1],a[2][2],!0,!1],[9,"gold/image4.png",125,235,a[3][1],a[3][2],!1,!0,"bonus/5crates.png"]],gc.prototype.init.call(this)}}function kc(){gc.call(this),this.headline="PREMIUM",this.bulletHeadline="",this.bulletTexts=["Supports The Developers of TankWars","No In-Game Advertisement!","Host custom private games","50% Gold Bonus","50% XP Bonus!"],this.bulletX=550,this.bulletColor="#e3c680",this.init=function(){var a=Ec("/shop/getprices/2,3,4,5");this.productData=[[2,"premium/image1.png",125,114,a[0][1],a[0][2],!1,!1],[3,"premium/image2.png",126,114,a[1][1],a[1][2],!1,!1],[4,"premium/image3.png",128,102,a[2][1],a[2][2],!0,!1],[5,"premium/image4.png",124,198,a[3][1],a[3][2],!1,!0,"bonus/5crates.png"]],gc.prototype.init.call(this)}}function lc(){gc.call(this),this.headline="BUY TALENT",this.bulletHeadline="USE TALENT TO",this.bulletTexts=["Level up crews faster","Reset crew stat points","Reset profile stats"],this.bulletX=630,this.bulletColor="#d5f3fe",this.init=function(){var a=Ec("/shop/getprices/10,11,13,14");this.productData=[[10,"talent/image1.png",138,153,a[0][1],a[0][2],!1,!1],[11,"talent/image2.png",136,146,a[1][1],a[1][2],!1,!1],[13,"talent/image3.png",138,125,a[2][1],a[2][2],!0,!1],[14,"talent/image4.png",127,221,a[3][1],a[3][2],!1,!0,"bonus/5crates.png"]],gc.prototype.init.call(this)}}function mc(a,b){this.products=[],this.initialized=!1,this.isOpen=!1,this.width=a,this.height=b}function nc(){mc.call(this,590,290)}function oc(){mc.call(this,590,290)}function pc(){mc.call(this,590,290),this.headlineText=" ",this.subHeadlineText=" ",this.buttonText=" ",this.buttonIcon=null,this.buttonIconAnchorBottom=0,this.buttonIconAnchorRight=0,this.buttonFn=null}function qc(){pc.call(this),this.headlineText="Not enough Gems",this.subHeadlineText="You need <amount> gems to buy this item!",this.buttonText="BUY GEMS",this.buttonIcon="UI/Menu/notification-gems.png",this.buttonIconAnchorBottom=5,this.buttonIconAnchorRight=5,this.buttonFn=function(){pf.open(),pf.buttons.Shop.button.click(),pf.shopPage.menuButtons["GEMS"].click(),googa("send","event","Currency Missing","Gems Clicked")}}function rc(){pc.call(this),this.headlineText="Not enough Gold",this.subHeadlineText="You need <amount> gold to buy this item!",this.buttonText="BUY GOLD",this.buttonIcon="UI/Menu/notification-gold.png",this.buttonIconAnchorBottom=10,this.buttonIconAnchorRight=5,this.buttonFn=function(){pf.open(),pf.buttons.Shop.button.click(),pf.shopPage.menuButtons["GOLD"].click(),googa("send","event","Currency Missing","Gold Clicked")}}function sc(){pc.call(this),this.headlineText="Not enough Talent",this.subHeadlineText="You need <amount> talent!",this.buttonText="BUY TALENT",this.buttonIcon="UI/Menu/notification-talent.png",this.buttonIconAnchorBottom=8,this.buttonIconAnchorRight=13,this.buttonFn=function(){pf.open(),pf.buttons.Shop.button.click(),pf.shopPage.menuButtons["TALENT"].click(),googa("send","event","Currency Missing","Talent Clicked")}}function tc(){mc.call(this,590,290)}function uc(){mc.call(this,590,250),this.buttonFn=null}function vc(){mc.call(this,590,290),this.buttonFn=null}function wc(){mc.call(this,590,290),this.buttonFn=null}function xc(){mc.call(this,690,250),this.buttonFn=null}function yc(){mc.call(this,590,290)}function zc(){a.utils.EventEmitter.call(this),this.FriendID=null,this.Online=!1,this.LastOnline=0,this.Name="",this.Server="",this.Avatar="",this.Ingame=!1,this.Blocked=!1,this.State=0,this.FriendInvite=!1,this.Status="Offline",this.StatusClass="",this.server=null,this.room=null,this.updateState=function(){if(this.Blocked=ai.blockedFriends.indexOf(this.FriendID)!==-1)this.State=_h.Blocked,this.Status="Blocked",this.StatusClass="friend_status_blocked";else if(this.FriendInvite)this.State=_h.Invite,this.Status="Friend Request";else if(null!==this.Server&&this.Server.length>0){var a=this.Server.split(","),b=a[0],c=a[1],d=1===q(a[4]),e=1===q(a[5]);this.Ingame=!0,this.State=_h.Ingame,this.Status="In-Game ("+(d?"Custom ":"")+Yh[b].modes[c]+")"+(e?"🔒":""),this.StatusClass="friend_status_ingame"}else this.Online?(this.State=_h.Online,this.Status="Online",this.StatusClass="friend_status_online"):(this.State=_h.Offline,this.Status="Offline",this.StatusClass="friend_status_offline");this.emit("update");var g=ei.checkFriendChatWindow(this.FriendID);g&&ei.setFriendInfo(this,g),f("#chat_tab_"+this.FriendID).find(".name").text(this.Name)},this.update=function(a,b){this.server=null,this.room=null,this.FriendID=a.FriendID,this.Online=a.Online,this.LastOnline=a.LastOnline,this.Name=a.Name,this.Server=a.Server,this.Avatar=a.Avatar,this.Ingame=!1,this.FriendInvite=b,this.updateState()}}function Ac(){a.utils.EventEmitter.call(this);var b={FriendList:{BlockedFriends:"BlockedFriends",Friends:"Friends",FriendInvites:"FriendInvites"},Friend:{FriendID:"FriendID",Online:"Online",LastOnline:"LastOnline",Name:"Name",Server:"Server",Avatar:"Avatar"}},c=this.allFriendItems={},d=[],e=[];this.blockedFriends=[],this.getFriendItem=function(a,d){var e=a[b.Friend.FriendID],f=c[e];return f||(f=c[e]=new zc),f.update(a,d),f},this.initFriendList=function(a){var c=a[b.FriendList.Friends],f=a[b.FriendList.FriendInvites];this.blockedFriends=a[b.FriendList.BlockedFriends],d=[],e=[];for(var g,h=0;h<c.length;h++)g=this.updateFriendStatus(c[h],!1),d.push(g);if(f)for(var i=0;i<f.length;i++)g=this.updateFriendStatus(f[i],!0),d.push(g);this.emit("init",d)},this.updateFriendStatus=function(a,b,c){var d=this.getFriendItem(a,b);return c&&this.emit("friendAdded",d),d},this.sort=function(){this.emit("sort")},this.blockFriend=function(a){var b=c[a];b&&(this.blockedFriends.push(a),b.updateState())},this.getFriend=function(a){return c[a]},this.removeFriend=function(a){delete c[a],this.emit("friendRemoved",a)}}function Bc(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function Cc(a){var b,c;d.getSelection?(b=d.getSelection(),b.getRangeAt&&b.rangeCount&&(c=b.getRangeAt(0),c.deleteContents(),c.insertNode(r.createTextNode(a)))):r.selection&&r.selection.createRange&&(r.selection.createRange().text=a)}function Dc(a){return a&&a.length?"/avatar?path="+a:"/Content/UserPictures/NoAvatar.jpg"}function Ec(a){var b;return e.ajax({url:a,success:function(a){b=a},async:!1}),b}function Fc(a){return(""+a).replace(/\B(?=(\d{3})+(?!\d))/g,",")}function Gc(a){return a=m(a),0===a||!(!a||a%2)}function Hc(a){var b=r.createElement("textarea");b.value=a,r.body.appendChild(b),b.focus(),b.select();try{r.execCommand("copy")}catch(a){}r.body.removeChild(b)}function Ic(a){return navigator.clipboard?void navigator.clipboard.writeText(a).then(function(){},function(a){}):void Hc(a)}function Jc(){r.fullScreenElement&&null!==r.fullScreenElement||!r.mozFullScreen&&!r.webkitIsFullScreen?r.documentElement.requestFullScreen?r.documentElement.requestFullScreen():r.documentElement.mozRequestFullScreen?r.documentElement.mozRequestFullScreen():r.documentElement.webkitRequestFullScreen&&r.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):r.cancelFullScreen?r.cancelFullScreen():r.mozCancelFullScreen?r.mozCancelFullScreen():r.webkitCancelFullScreen&&r.webkitCancelFullScreen()}function Kc(){var a=this;this.commands=[],this.infos=[],this.infosCount=7,this.lastInfo=1,this.infoCooldown=30;this.isHidden=!1,this.isOpen=!1,this.isHover=!1;var b=f("#GameChatContainer").find(".room_chat_message"),c=f("#GameChatContainer").find(".room_chat_window_wrapper");this.init=function(){Xc.InputManager.addKeyUpListener([27],0,function(b){if(a.isOpen)return a.hideChatBox(),!0}),Xc.InputManager.addKeyUpListener([13],0,function(a){if(pi.isOpen)return pi.SendMessage(),!0}),Xc.InputManager.addKeyUpListener(null,10,function(c){return c.which!=rf.UserSettings["Input_Chat"]||pf.isOpen||a.isOpen?c.which!=rf.UserSettings["Input_ChatTeam"]||pf.isOpen||a.isOpen?c.which!=rf.UserSettings["Input_ChatParty"]||pf.isOpen||a.isOpen?c.which==rf.UserSettings["Input_ChatQuickView"]&&a.isOpen&&!b.is(":focus")?(a.hideChatBox(),!0):void 0:(a.showChatBox(),b.val("/p "),!0):(a.showChatBox(),b.val("/t "),!0):(a.showChatBox(),!0)}),Xc.InputManager.addKeyDownListener(null,10,function(c){if(c.which==rf.UserSettings["Input_ChatQuickView"]&&!a.isOpen)return a.showChatBox(),b.blur(),!0}),c.hover(function(b){a.isHover=!0},function(b){a.isHover=!1})},this.showChatBox=function(){c.addClass("open"),b.show().focus(),this.isOpen=!0},this.hideChatBox=function(){c.removeClass("open"),c.scrollTop(c[0].scrollHeight),this.isOpen=!1,b.hide().blur().val("")},this.showMessage=function(a,b){this.isHidden&&!b||(new i).to(a,.4,{opacity:1},0).to(a,1,{opacity:0},10)},this.hideChatFromUser=function(a){c.children("[data-playerId='"+a+"']").hide()},this.showChatFromUser=function(a){c.children("[data-playerId='"+a+"']").show()},this.checkFunction=function(a){a.split(" ").length<=1&&(a+=" ");var b=/^([^\s]+)\s(.*)$/.exec(a).slice(1),c=b[0],d=b[1],e=f(this.commands).filter(function(){return f.inArray(c,this.command)!=-1})[0];return void 0!==e?(e.callback(d),!0):(this.systemError("Command '"+a.split(" ")[0]+"' not found"),!0)},this.initShowInfo=function(){u(function(){if(k.random()>.4){var b=(new o).getTime()/1e3;b-a.lastInfo>=a.infoCooldown&&(a.showInfo(),a.lastInfo=b)}},1e3)},this.showInfo=function(a){a||(a=k.floor(k.random()*this.infosCount));var b=f(this.infos).filter(function(){return f.inArray(a,this.info)!=-1})[0];if(void 0!==b)return b.callback(),!0},this.SendMessage=function(){return Zh.authenticated?(b.val().length>0&&Dd.Connection.server.connected&&("/"==b.val()[0]&&this.checkFunction(b.val())||Dd.Connection.invoke("ChatMsg",b.val()),b.val("")),void this.hideChatBox()):(this.systemError("You must sign in to send chat messages!"),b.val(""),void this.hideChatBox())},this.RecieveMessage=function(a,b,d){var e=Dd.Players[a],g=e?e.name:"SERVER",h="",i="",j="";switch(d){case 1:i="(TEAM)",j="team";break;case 2:i="(PARTY)",j="party";break;default:i="",j="player"}var k=f("<div data-playerId='"+a+"'>").text(b).addClass("chatMsg"+h).prepend(f("<span>").text(i+g).addClass(j)),e=Dd.Players[a],l=e.friendID;k.find("span:first").data("playerId",a).on("contextmenu",function(){if(0!=a){l&&ci.open(l,!0)}}),oi.contains(l)?k.hide():this.showMessage(k),c.append(k),c.children(":visible").length>=50&&c.children(":visible").first().remove(),c.scrollTop(c[0].scrollHeight)},this.systemError=function(a){this.systemInfo(a,!0)},this.systemInfo=function(a,b){var d=f("<div>").text(a).addClass("chatMsg systemInfo").prepend(f("<span>").text("System").addClass("player"));b&&d.addClass("systemError"),c.append(d),c.scrollTop(c[0].scrollHeight),this.showMessage(d,!0)},this.infoMsg=function(a){var b=f("<div>").text(a).addClass("chatMsg infoMsg").prepend(f("<span>"));c.append(b),c.scrollTop(c[0].scrollHeight),this.showMessage(b,!0)},this.init()}function Lc(b){this.teamId=b,this.visible=!1;var c=a.Texture.fromFrame("UI/ui-box-2.png"),d=a.Texture.fromFrame("UI/ui-horizontal-line-border.png"),e=this.section=new a.UI.Container;e.anchorBottom=0,e.anchorTop=0,Dd.ScoreBoard.container.addChild(e);var f=new qi(this.teamId);f.container.bottom=0,e.addChild(f.container);var g=new a.UI.SliceSprite(c,5);g.anchorTop=g.anchorBottom=6,g.tint=2435380,e.addChild(g);var h={fill:"#5ebef2, #26aff1",fontSize:18,fontFamily:Yc,fontWeight:"bold",shadow:"#000000 0.8 1 1 1"},i=new a.UI.DynamicText("PLAYER",{style:h}),j=new a.UI.DynamicText("SCORE",{style:h}),k=new a.UI.DynamicText("K/D/A",{style:h}),l=new a.UI.DynamicText("PING",{style:h});i.anchorTop=j.anchorTop=k.anchorTop=l.anchorTop=19,i.left=13,j.right="55%",k.right="33%",l.anchorRight="2%";var m=new a.UI.SliceSprite(d,2,(!0),(!1));m.tint=7783410,m.anchorLeft=m.anchorRight=8,m.anchorTop=37;var n=new a.UI.SortableList((!0));n.height="100%",n.width="100%",this.items=n.items;var o=new a.UI.ScrollingContainer({scrollX:!1,scrollY:!0});o.anchorLeft=o.anchorRight=o.anchorBottom=0,o.anchorTop=40,o.dragThreshold=5,o.dragRestrictAxis="y",o.addChild(n);var p=new a.UI.ScrollBar({track:new a.UI.SliceSprite(c,4),handle:new a.UI.SliceSprite(c,4),vertical:!0,scrollingContainer:o,autohide:!0});p.track.width=p.handle.width=8,p.anchorTop=38,p.anchorBottom=1,p.anchorRight=0,p.track.tint=2236962,p.track.blendMode=0,g.addChild(i,j,k,l,m,o,p),this.setTeamColor=function(a){var b=Dd.TeamColors.GetColor(a);g.tint=b.LBBackgroundColor,m.tint=b.LBHeaderStroke,i.style.fill=j.style.fill=k.style.fill=l.style.fill=b.LBHeadlineTextFill},this.sort=function(a){n.sort(a)},this.setVisible=function(a){this.visible=a,this.section.visible=a},this.fixPosition=function(a,b,c,d){e.width=b+"%",e.anchorLeft=a*b+"%",g.anchorRight=d?6:3,g.anchorLeft=c?6:3},this.addPlayer=function(a){n.addChild(a.playerItem.scoreboardItem,function(){return a.Score},function(){return a.Kills})},this.playerCount=function(){return n.items.length}}function Mc(b){var c=a.Texture.fromFrame("UI/ui-horizontal-line-border.png"),d=a.Texture.fromFrame("UI/profile-image-bg.png"),e=a.Texture.fromFrame("UI/horizontal-gradient.png"),f=this.scoreboardItem=new a.UI.Container;f.x=f.y=0,f.width="100%",f.height=42,f.player=this.player=b;var g=new a.UI.SliceSprite(c,2,(!0),(!1));g.anchorLeft=g.anchorRight=10,g.anchorBottom=0,g.alpha=.7;var h=new a.UI.Sprite(e);h.anchorLeft=h.anchorRight=10,h.anchorTop=0,h.anchorBottom=3,h.blendMode=1;var i=new a.UI.DynamicText(b.name,{style:ud,width:1});i.style.wrap=!1,i.style.overflowX="hidden",i.style.ellipsis=!0,i.anchorLeft=53,i.anchorRight="60%";var j=new a.UI.DynamicText(Fc(b.Score),{style:ud}),k=new a.UI.DynamicText(b.Kills+" / "+b.Deaths+" / "+b.Assists,{style:ud}),l=new a.UI.DynamicText(b.Ping+"",{style:ud});i.anchorTop=j.anchorTop=k.anchorTop=l.anchorTop=3,i.left=53,j.right="55%",k.right="33%",l.anchorRight="2%";var m=new a.UI.Sprite(d);if(m.left=12,m.top=3,b.friendID&&b.friendID!=Zh.data["friendID"]){new a.UI.Interaction.ClickEvent(m,(!0),(!0),(!1)).onClick=function(a){ci.open(b.friendID,!0)}}if(b.avatar.indexOf("NoAvatar")===-1){var n=a.UI.Sprite.fromImage("/avatar?path="+b.avatar);n.width=n.height=30,n.left=n.top=2,m.addChild(n)}f.addChild(h,g,m,i,j,k,l),f.altering=function(a){b.me?(h.alpha=.35,h.tint=8572444,h.blendMode=0):h.alpha=a?0:.09},this.dispose=function(){f.parent.removeChild(f)},this.updateName=function(){i.text!=this.player.name&&(i.text=this.player.name),i.tint=this.player.dead?16711680:16777215},this.updatePing=function(){var a=this.player.Ping+"";l.text!=a&&(l.text=a)},this.updateScore=function(a){var b=Fc(this.player.Score);j.text!=b&&(j.text=b)},this.updateKDA=function(){var a=b.Kills+" / "+b.Deaths+" / "+b.Assists;k.text!=a&&(k.text=a)};var o;this.updateMute=function(){if(b.friendID){var c=oi.contains(b.friendID);c&&!o&&(o=new a.UI.DynamicText("(MUTED)",{style:rd,width:1}),o.style.tint="#ff0000",o.anchorLeft=53,o.anchorTop=20,f.addChild(o)),o&&(o.visible=c)}},this.updatePing(),this.updateScore(),this.updateName(),this.updateKDA(),this.updateMute()}var Nc=function(b,c,d){var e,f,g,h,i,j,l,m=(devicePixelRatio||1,[]),n=[],o=256,p=b?b:2048,q=[],s=function(b,c){var d=this.children=[];this.rect=new a.Rectangle(0,0,b||0,c||0),this.data=null,this.insert=function(b,c,e){if(d.length>0){var f=d[0].insert(b,c,e);return null!==f?f:d[1].insert(b,c,e)}return null!==this.data?null:b>this.rect.width||c>this.rect.height?null:b==this.rect.width&&c==this.rect.height?(this.data=e,e.x=this.rect.x,e.y=this.rect.y,this):(d.push(new s),d.push(new s),this.rect.width-b>this.rect.height-c?(d[0].rect=new a.Rectangle(this.rect.x,this.rect.y,b,this.rect.height),d[1].rect=new a.Rectangle(this.rect.x+b,this.rect.y,this.rect.width-b,this.rect.height)):(d[0].rect=new a.Rectangle(this.rect.x,this.rect.y,this.rect.width,c),d[1].rect=new a.Rectangle(this.rect.x,this.rect.y+c,this.rect.width,this.rect.height-c)),d[0].insert(b,c,e))}},v=0,w=0,x={},y={},z=function(){e=r.createElement("canvas"),f=e.getContext("2d"),n.push(e),l=o,e.width=e.height=l,j=new s(l,l),g=[],h=a.BaseTexture.fromCanvas(e),h.mipmap=d,h.resolution=1,h.update()},A=function(){if(d)for(var a in h._glTextures)h._glTextures[a].enableMipmap()},B=function(a,b){b&&h.update();for(var c=0;c<a.length;c++)C(a[c]);A()},C=function(b){f.drawImage(b.image,b.x,b.y),b.texture.frame=new a.Rectangle(b.x,b.y,b.image.width,b.image.height),b.texture.update()},D=function(b,c){(e.width<c.width||e.height<c.height)&&(e.width=e.height=k.max(c.width,c.height),h.update()),obj={x:0,y:0,image:c,path:b,baseTexture:h,texture:new a.Texture(h,new a.Rectangle(0,0,c.width,c.height))},y[b]=obj,m.push(obj),0==v&&(t(i),i=u(function(){F(),i=void 0},0))};this.load=function(a,b){"string"==typeof a&&(a=[a]);for(var c=0;c<a.length;c++)!function(){var b=a[c];if(!x[b]){
v++,w++,x[b]=!0;var d=new Image;d.src=b,d.onload=function(){v--,D(b,d)}}}();"function"==typeof b&&(0==w?b():q.push(b))},this.getTexture=function(a){return y[a].texture};var E=function(a,b){return a.image.height<b.image.height?1:a.image.height>b.image.height?-1:a.image.width<b.image.width?1:a.image.width>b.image.width?-1:0},F=function(){m.sort(E);for(var a=!1,b=!1,d=0;d<m.length;d++){var e=m[d];null===j.insert(e.image.width+c,e.image.height+c,e)?(d--,l<p?(a=!0,G(2*l)):(B(g,a),z(),b=!0,a=!1)):(b&&(e.texture.baseTexture=h),g.push(e))}if(B(a||b?g:m,a),w-=m.length,m=[],0===w){for(var d=0;d<q.length;d++)q[d]();q=[]}},G=function(a){e.width=e.height=l=a,j=new s(a,a),g.sort(E);for(var b=0;b<g.length;b++){var d=g[b];j.insert(d.image.width+c,d.image.height+c,d)}};z()},Oc=function(a,b){this.x=a||0,this.y=b||0};Oc.prototype.add=function(a,b){this.set(this.x+a,this.y+b)},Oc.prototype.clone=function(){return new Oc(this.x,this.y)},Oc.prototype.copy=function(a){this.set(a.x,a.y)},Oc.prototype.equals=function(a){return this.x===a.x&&this.y===a.y},Oc.prototype.set=function(a,b){this.x=a||0,this.y=b||(0!==b?this.x:0)},Oc.prototype.round=function(a){var b=k.pow(10,a||0);this.x=k.round(this.x*b)/b,this.y=k.round(this.y*b)/b},Oc.prototype.lerp=function(a,b){this.x=this.x+(a.x-this.x)*b,this.y=this.y+(a.y-this.y)*b},Oc.prototype.rotate=function(a){var b=this.x,c=this.y;return this.x=b*k.cos(a)-c*k.sin(a),this.y=b*k.sin(a)+c*k.cos(a),this},Oc.prototype.distance=function(a){var b=this.x-a.x,c=this.y-a.y;return k.sqrt(b*b+c*c)},Oc.prototype.angleTowards=function(a){return k.atan2(a.y-this.y,a.x-this.x)},Oc.prototype.forward=function(a,b,c){return c=c||new Oc,c.x=k.cos(a)*b+this.x,c.y=k.sin(a)*b+this.y,c},Oc.prototype.pointTowards=function(a,b,c){return this.forward(this.angleTowards(a),b,c)};var Pc=new Oc(0,0);Object.defineProperties(Oc,{Zero:{get:function(){return Pc.set(0,0),Pc}},One:{get:function(){return Pc.set(1,1),Pc}},Right:{get:function(){return Pc.set(1,0),Pc}},Left:{get:function(){return Pc.set(-1,0),Pc}},Up:{get:function(){return Pc.set(0,-1),Pc}},Down:{get:function(){return Pc.set(0,1),Pc}}}),Oc.Lerp=function(a,b,c,d){return c=k.max(0,k.min(1,c)),d=d||new Oc,d.x=a.x+(b.x-a.x)*c,d.y=a.y+(b.y-a.y)*c,d},Oc.Distance=function(a,b,c,d){var e,f,g,h;return 2===arguments.length?(e=a.x,f=a.y,c=b.x,d=b.y):(e=a,f=b),g=e-c,h=f-d,k.sqrt(g*g+h*h)},Oc.Forward=function(a,b,c){return c=c||new Oc,b=b||1,c.x=k.cos(a)*b,c.y=k.sin(a)*b,c};m.prototype.lerp=function(a,b){return this+(a-this)*b},m.prototype.clamp=function(a,b){return k.max(k.min(this,b),a)},m.prototype.toDegrees=function(){var a=this*(180/k.PI);return a%=360,a<0&&(a+=360),a},m.prototype.toRadians=function(){return this*(k.PI/180)},m.prototype.floatRound=function(a){var b=k.pow(10,a||0);return k.round(this*b)/b};var Qc={TYPE:{LAYER:0,SPRITE:1,ROPE:2,TILESPRITE:3,ZONE:4},COLLIDERTYPE:{STATIC:0,DYNAMIC:1,TRIGGER:2},PATH:{TEXTURE:"Textures/"}};l.prototype.merge=function(){for(var a=0;a<arguments.length;a++)for(var b=arguments[a],c=0;c<b.length;c++)this.indexOf(b[c])==-1&&this.push(b[c]);return this},l.prototype.random||(l.prototype.random=function(){return this[k.floor(k.random()*this.length)]}),l.prototype.add=function(a){this.push(a)},l.prototype.remove=function(a){var b=this.indexOf(a);b!==-1&&this.splice(b,1)};var Rc=function(a,b){this.pos=new Oc(a||0,b||0),this.h1=new Oc,this.h2=new Oc},Sc=function(a,b,c,d){this.penetrable=!1,this.shapePoints=[],this.curve=[],this.interp=!0,void 0!=a&&(this.interp=a),this.selfClose=b||!1,this.isCircle=c||!1,this.circleRadius=d||0,this.circleOffset=new Oc};Sc.prototype.update=function(){this.curve.length=0;for(var a=1;a<this.shapePoints.length;a++){var b=this.shapePoints[a-1],c=this.shapePoints[a],d=0;b.h2&&(b.h2.x||b.h2.y)&&(d+=10),c.h1&&(c.h1.x||c.h1.y)&&(d+=10),this.interp?this.curve=this.curve.merge(Sc.getSteps(b.pos,b.h2,c.h1,c.pos,d,!0)):(this.curve.push(b.pos),this.curve.push(c.pos))}},Sc.getSteps=function(a,b,c,d,e,f,g){var h=e,i=a.x,j=a.y,k=0==b.x?a.x:b.x,l=0==b.y?a.y:b.y,m=0==c.x?d.x:c.x,n=0==c.y?d.y:c.y,o=d.x,p=d.y,q=1/(h+1),r=q*q,s=q*q*q,t=3*q,u=3*r,v=6*r,w=6*s,x=i-2*k+m,y=j-2*l+n,z=3*(k-m)-i+o,A=3*(l-n)-j+p,B=i,C=j,D=(k-i)*t+x*u+z*s,E=(l-j)*t+y*u+A*s,F=x*v+z*w,G=y*v+A*w,H=z*w,I=A*w,J=h,K=g||[];if(f){var L=K[0];L||(L=new Oc,K.push(L)),L.set(a.x,a.y)}for(var M=0;M<J;M++){B+=D,C+=E,D+=F,E+=G,F+=H,G+=I;var N=f?M+1:M,L=K[N];L||(L=new Oc,K.push(L)),L.set(B,C)}if(f){var L=K[e+1];L||(L=new Oc,K.push(L)),L.set(d.x,d.y)}return K};var Tc={Name:"n",Texture:"t",Helper:"_h",EditorLocked:"el",Type:"t1",Alpha:"a",Position:"p",Rotation:"r",Scale:"s",Tint:"t2",BlendMode:"b",TileScale:"ts",Width:"w",Height:"h",Shape:"s2",RopeScale:"s1",RopeSpeed:"sp",Collider:"c",ColliderType:"ct",DynamicFriction:"df",DynamicAngularDamp:"da",DynamicWeight:"dw",TriggerWindForce:"tw",TriggerWindAngle:"twa",TriggerFrictionMultiply:"tf",TriggerSpeedMultiply:"tsm"},Uc={Penetrable:"p",IsCircle:"c",CircleOffset:"co",CircleRadius:"cr",Interp:"i",SelfClose:"sc",ShapePoints:"sp"},Vc={Position:"pos",Handle1:"h1",Handle2:"h2"},Wc=1,Xc={};Xc.InputManager={keyAllowed:{},keyDownListeners:l(),keyUpListeners:l(),tempListener:null,paused:!1,init:function(){f(r).on("keyup",function(a){Xc.InputManager.executeKeyUp(a)}).on("keydown",function(a){Xc.InputManager.executeKeyDown(a)})},executeKeyDown:function(a){if(this.paused)return!1;if(32===a.which&&ke)return!1;if(this.keyAllowed[a.which]===!1&&8!==a.keyCode)return a.preventDefault(),a.stopPropagation(),!1;this.keyAllowed[a.which]=!1;for(var b=0;b<this.keyDownListeners.length&&(this.tempListener=this.keyDownListeners[b],null!=this.tempListener.keyCode&&this.tempListener.keyCode!=a.keyCode||!this.tempListener.callback(a));b++);9==a.keyCode&&(a.preventDefault(),a.stopPropagation())},executeKeyUp:function(a){if(this.paused)return!1;this.keyAllowed[a.which]=!0;for(var b=0;b<this.keyUpListeners.length;b++)if(this.tempListener=this.keyUpListeners[b],(null==this.tempListener.keyCode||this.tempListener.keyCode==a.keyCode)&&this.tempListener.callback(a))return},addKeyDownListener:function(a,b,c){if("function"!=typeof c);else if("number"==typeof b){f.isArray(a)||(a=[a]);for(var d=0;d<a.length;d++)Xc.InputManager.keyDownListeners.push(new Xc.InputManager.Listener(a[d],b,c));return Xc.InputManager.keyDownListeners=Xc.InputManager.keyDownListeners.sort(function(a,b){return a.priority-b.priority}),!0}return!1},addKeyUpListener:function(a,b,c){if("function"!=typeof c);else if("number"==typeof b){f.isArray(a)||(a=[a]);for(var d=0;d<a.length;d++)Xc.InputManager.keyUpListeners.push(new Xc.InputManager.Listener(a[d],b,c));return Xc.InputManager.keyUpListeners=Xc.InputManager.keyUpListeners.sort(function(a,b){return a.priority-b.priority}),!0}return!1},keyName:{8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"CAPS",27:"ESC",32:"space",33:"page up",34:"page down",35:"end",36:"home",37:"◀",38:"▲",39:"▶",40:"▼",45:"ins",46:"del",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",91:"left window key",92:"right window key",93:"select key",96:"numpad 0",97:"numpad 1",98:"numpad 2",99:"numpad 3",100:"numpad 4",101:"numpad 5",102:"numpad 6",103:"numpad 7",104:"numpad 8",105:"numpad 9",106:"multiply",107:"add",109:"subtract",110:"decimal point",111:"divide",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"num lock",145:"scroll lock",186:"semi-colon",187:"equal sign",188:"comma",189:"dash",190:"period",191:"forward slash",192:"grave accent",219:"open bracket",220:"back slash",221:"close braket",222:"single quote"}},Xc.InputManager.Listener=function(a,b,c){this.keyCode=a,this.priority=b,this.callback=c};var Yc="Calibri, 'woffwoff'",Zc={tint:"#f5f5f5",fontSize:11,fontFamily:Yc},$c={tint:"#f5f5f5",fontSize:12,fontFamily:Yc},_c={tint:"#f5f5f5",fontSize:14,fontFamily:Yc},ad={tint:"#f5f5f5",fontSize:15,fontFamily:Yc},bd={tint:"#f5f5f5",fontSize:16,fontFamily:Yc},cd={tint:"#f5f5f5",fontSize:18,fontFamily:Yc},dd={tint:"#f5f5f5",fontSize:25,fontFamily:Yc},ed={tint:"#f5f5f5",fontSize:30,fontFamily:Yc},fd={tint:"#f5f5f5",fontSize:11,fontFamily:Yc,fontWeight:"bold"},gd={tint:"#f5f5f5",fontSize:12,fontFamily:Yc,fontWeight:"bold"},hd={tint:"#f5f5f5",fontSize:14,fontFamily:Yc,fontWeight:"bold"},id={tint:"#f5f5f5",fontSize:15,fontFamily:Yc,fontWeight:"bold"},jd={tint:"#f5f5f5",fontSize:16,fontFamily:Yc,fontWeight:"bold"},kd={tint:"#f5f5f5",fontSize:18,fontFamily:Yc,fontWeight:"bold"},ld={tint:"#f5f5f5",fontSize:25,fontFamily:Yc,fontWeight:"bold"},md={tint:"#f5f5f5",fontSize:30,fontFamily:Yc,fontWeight:"bold"},nd={tint:"#f5f5f5",fontSize:33,fontFamily:Yc,fontWeight:"bold"},od={tint:"#f5f5f5",fontSize:11,fontFamily:Yc,shadow:"#000000 1 1 1 1"},pd={tint:"#f5f5f5",fontSize:12,fontFamily:Yc,shadow:"#000000 1 1 1 1"},qd={tint:"#f5f5f5",fontSize:24,fontFamily:Yc,shadow:"#000000 1 1 1 1"},rd={tint:"#f5f5f5",fontSize:12,fontFamily:Yc,fontWeight:"bold",shadow:"#000000 0.8 1 1 1"},sd={tint:"#f5f5f5",fontSize:13,fontFamily:Yc,fontWeight:"bold",shadow:"#000000 1 1 1 1"},td={tint:"#f5f5f5",fontSize:14,fontFamily:Yc,fontWeight:"bold",shadow:"#000000 1 1 1 1"},ud={tint:"#f5f5f5",fontSize:15,fontFamily:Yc,fontWeight:"bold",shadow:"#000000 0.8 1 1 1"},vd={tint:"#f5f5f5",fontSize:16,fontFamily:Yc,fontWeight:"bold",shadow:"#000000 0.8 1 1 1"},wd={tint:"#f5f5f5",fontSize:17,fontFamily:Yc,fontWeight:"bold",shadow:"#000000 1 1 1 1"},xd={tint:"#f5f5f5",fontSize:25,fontFamily:Yc,fontWeight:"bold",shadow:"#000000 1 1 1 1"},yd={tint:"#f5f5f5",fontSize:26,fontFamily:Yc,fontWeight:"bold",shadow:"#000000 0.6 1 1 1"},zd={fontSize:100,fontFamily:Yc,fontWeight:"bold",fill:"#ffffff, #d7d7d7"},Ad={fontSize:16,fontFamily:"Arial Black",fontWeight:"bold",fill:"#ffffff, #d7d7d7"},Bd={fontSize:20,fontFamily:"Arial Black",fontWeight:"bold",fill:"#ffffff, #d7d7d7",shadow:"#000000 0.6 1 1 1"},Cd={cooldown:1,lastAd:1,api:void 0,playing:!1,lookingForRewardAd:!1,rewardAdTries:0,notification:void 0,notification_initialized:!1,WatchRewardAd:function(){return 0===Dd.friendID?void xc.open("You must sign-in to Watch Reward Ads"):void(this.lookingForRewardAd||(this.lookingForRewardAd=!0,this.rewardAdTries=0,this.notification_initialized||(this.notification=new oc,this.notification.init(),this.notification.countText=new a.UI.DynamicText("0/20",{style:ld}),this.notification.countText.horizontalAlign="center",this.notification.countText.anchorTop=165,this.notification.countText.alpha=.5,this.notification.countText.pivot=.5,this.notification.container.addChild(this.notification.countText),this.notification_initialized=!0),this.notification.open("Looking for Reward Ad","Please wait while we are looking for a reward ad",function(){Cd.lookingForRewardAd=!1}),this.searchRewardAd()))},searchRewardAd:function(){Cd.playing=!0,(playerPro=d.playerPro||[]).push({id:"3VUS1xaSZLbvKCTFYPKh4J_PPSKq7wm56kKv5CqWLXpw8x_lHKqD",init:Cd.playerinit})},ingameAd:function(){if(Cd.playing=!0,0==Dd.friendID||0!=Dd.friendID&&!ng.Premium){var a=(new o).getTime()/1e3;a-this.lastAd>=this.cooldown&&(this.playProInGame(),this.lastAd=a)}},stopAd:function(a){if(this.playing){var b=this.api;b?(this.api=void 0,this.playing=!1,a?(b.stopAd(),b.remove(),u(function(){b.remove()},100)):(b.skipAd(),u(function(){b.skipAd(),u(function(){b.skipAd()},500)},500))):u(function(){Cd.stopAd(a)},1e3)}},PlReWatch:function(a){Cd.rewardAdTries++,this.notification.countText.text=Cd.rewardAdTries+"/20",a&&(a.on("AdLoaded",function(){}),a.on("AdStarted",function(){Cd.lookingForRewardAd=!1,Cd.notification.close()}),a.on("AdPlaying",function(){}),a.on("AdVideoComplete",function(){Cd.playing=!1,f.post("/reward/claim",{key:"rewardad"},function(a){if(a[0]){var b=a[0],c=a[1],d=a[2],e=bh[b];googa("send","event","RewardAd","RewardAd - Reward"),new Zb("Balance Rewarded",d+" "+e).addButton("OK",200,5592405,function(){}).show(5e3),pf.wallet.UpdateBalance(b,c)}else nc.open("Reward Ad Error!","Something went wrong!\neither no reward ads available or a fatal error has occured.","OK"),googa("send","event","RewardAd","RewardAd - No Reward")})}),a.on("AdError",function(a,b){Cd.lookingForRewardAd&&(Cd.rewardAdTries<20?u(function(){Cd.searchRewardAd()},2e3):(Cd.lookingForRewardAd=!1,Cd.notification.close(),nc.open("Reward Ad Error!","Something went wrong!\neither no reward ads available or a fatal error has occured.","OK"),googa("send","event","RewardAd","No Ad or fatal error - No Video seen")))}))},playProInGame:function(){(playerPro=d.playerPro||[]).push({id:"XiDp4fQJWN74XyoVuG5d96-33qHfFKWgnXonrhh-HwxX_NX0hGAC",init:Cd.playerInitIngame})},playerInitIngame:function(a){Cd.api=a,a.on("AdVideoComplete",function(){Cd.playing=!1})},playerinit:function(a){Cd.api=a,Cd.PlReWatch(a)}};d["ap"]=Cd;var Dd={Players:{},PlayersSorted:[],spectating:!1,width:1024,height:768,isMobile:a.utils.isMobile,initialized:!1,connectOnInit:!0,referralId:null,sessionRefId:null,allowTeamChange:!1,friendRefId:null,sessionID:void 0,friendsReferred:0,friendID:0,player:void 0,playerTank:void 0,playerKilledBy:void 0,isAlive:!0,selectedGM:void 0,currentGM:void 0,currentGameMode:void 0,developer:!1,version:0,joined:!1,started:!1,starting:!1,initCallbacks:[],initCallback:function(a){"function"==typeof a&&(this.initialized?a():this.initCallbacks.push(a))},init:function(a){this.selectedGM=a,this.InputManager.init(),this.Scene.init(),this.Gameloop.Start(),this.connectOnInit&&this.Connection.Connect(this.selectedGM,1e3);for(var b=0;b<this.initCallbacks.length;b++)this.initCallbacks[b]();if(this.initCallbacks=[],this.initialized=!0,this.sessionRefId=this.referralId=new URL(d.location.href).searchParams.get("r"),this.friendRefId=new URL(d.location.href).searchParams.get("f"),localStorage){if(this.friendRefId){var c=new o;c.setTime(c.getTime()+432e6),localStorage["friendRefId"]=this.friendRefId,localStorage["friendRefIdExpires"]=""+c}else if(localStorage["friendRefIdExpires"]&&localStorage["friendRefId"]){var c=new o(localStorage["friendRefIdExpires"]);c>new o?this.friendRefId=localStorage["friendRefId"]:(localStorage.removeItem("friendRefId"),localStorage.removeItem("friendRefIdExpires"))}if(this.referralId){var c=new o;c.setTime(c.getTime()+864e5),localStorage["referralId"]=this.referralId,localStorage["referralIdExpires"]=""+c}else if(localStorage["referralIdExpires"]&&localStorage["referralId"]){var c=new o(localStorage["referralIdExpires"]);c>new o?this.referralId=localStorage["referralId"]:(localStorage.removeItem("referralId"),localStorage.removeItem("referralIdExpires"))}}},mobileLogic:function(){pf.close(!0);var b=new a.UI.Container(700,290);b.align="center",b.valign="middle",b.pivot=.5,b.scale=1.5,Dd.Scene.PIXIUIStage.addChild(b);var c=a.UI.Sprite.fromFrame("UI/blank.png");c.tint=0,c.alpha=.5,c.width=c.height="100%",b.addChild(c);var d=new a.UI.DynamicText("<font size='40'>😢 SORRY! 😢</font>\n\n The game doesn't support mobile yet!\n\nPlease play from your computer!",{style:xd,allowTags:!0,width:"90%"});d.anchorLeft=d.anchorRight="5%",d.style.align="center",d.anchorTop=50,b.addChild(d)},effectAdded:!1,PlayerDie:function(){pi.initShowInfo(),this.isAlive=!1,Dd.Crosshair.hide(),Dd.UI.PlayerGUI.hide(),this.effectAdded||(Dd.UI.FilterGray.Add(),this.effectAdded=!0),Dd.Crosshair.clearPowerup(),Dd.Scene.layerGroundHelpers.visible=!1,Dd.Scene.layerSkyHelpers.visible=!1},PlayerRespawn:function(a){this.isAlive=!0,this.effectAdded&&(Dd.UI.FilterGray.Remove(),this.effectAdded=!1),Cd.stopAd(),Dd.Scene.layerGroundHelpers.visible=!0,Dd.Scene.layerSkyHelpers.visible=!0,a||(Dd.Crosshair.show(),Dd.UI.PlayerGUI.show(),Dd.playerUnit&&Dd.playerUnit.helper.PlaySpawn(),pe&&pe.visible&&pe.hide())},ClearGame:function(a){this.joined=!1,this.started=!1,this.player=void 0,this.playerUnit=void 0,this.UI.Gate.close(function(){Dd.PlayerRespawn(!0)}),this.UI.PowerUpBelt.ClearUI(),this.Effects.VFXHandler.ClearVFX(),oe&&oe.Clear(),pe&&pe.hide(),this.InputManager.Clear(),this.KillStreak.Clear(),this.UI.GuidingArrowController.Clear(),this.triggerStateChange(),a||pf.open()},Start:function(a){Dd.Connection.server.connected?(a=q(a),Dd.Connection.invoke("Start",ki.getMemberIdList(),a,q(rf.UserSettings["MaxTankTier"]))):(alert("Connect:"+a),Dd.Connection.Connect(a))},UpdatePlayerHelperVisuals:function(){for(var a in Dd.Players){var b=Dd.Players[a];b.unit&&b.unit.helper&&b.unit.helper.refreshVisual()}},resizeTimeout:void 0,onResizeEvents:[],onResize:function(a){"function"==typeof a&&this.onResizeEvents.indexOf(a)==-1&&this.onResizeEvents.push(a)},onResizeRemove:function(a){var b=this.onResizeEvents.indexOf(a);b!=-1&&this.onResizeEvents.splice(b,1)},onStateChangeEvents:[],onStateChange:function(a){"function"==typeof a&&this.onStateChangeEvents.indexOf(a)==-1&&this.onStateChangeEvents.push(a)},offStateChange:function(a){var b=this.onStateChangeEvents.indexOf(a);b!=-1&&this.onStateChangeEvents.splice(b,1)},triggerStateChange:function(){for(var a=0;a<Dd.onStateChangeEvents.length;a++)Dd.onStateChangeEvents[a]()},performResize:function(){t(Dd.resizeTimeout),Dd.resizeTimeout=u(function(){Dd.actualPerformResize()},100)},actualPerformResize:function(){for(var a=0;a<Dd.onResizeEvents.length;a++)Dd.onResizeEvents[a]()},UpdateColors:function(){Dd.TeamColors.UpdateColors()},shareWithOptions:function(a,b,c,d){var e=b||"Join Now! Awesome tanks are waiting for you. Take aim, fire on! Compete against players around the world in an epic battle",f=a||"Tankwars.io - Free to play!";c||(c="https://tankwars.io");var g={method:"feed",name:f,link:c,caption:"Tankwars.io",description:e,message:e};FB.ui(g,function(a){a&&!a.error_code&&d&&"function"==typeof d&&d()})},share:function(a,b){Dd.shareWithOptions(a,b,null,null)},twitterCb:void 0,tweetWithOptions:function(a,b,c,e){if(!c){var f=["indiegame","indiegames","game","games","gaming","videogame","html5","browsergames","browsergame","iogames","iogame","tank","tanks","free"];c="tankwars,"+f[k.floor(k.random()*f.length-.01)]}var g=a||"Ready to roll out!";b||(b="https://tankwars.io");var h=d.open("https://twitter.com/share?url="+b+"&amp;via=PlayOn_io&amp;text="+escape(g)+"&nbsp;test&nbsp;&amp;hashtags="+c,"Twitter share","width=500, height=400, resizable=yes");if(h.focus(),!Dd.twitterCb&&"function"==typeof e){Dd.twitterCb=e;var i=function(){return h.closed?(Dd.twitterCb(),void(Dd.twitterCb=void 0)):void u(i,500)};u(i,1e3)}},tweet:function(a,b){Dd.tweetWithOptions(a,null,b,null)},clearReferralData:function(){localStorage.removeItem("friendRefId"),localStorage.removeItem("friendRefIdExpires"),localStorage.removeItem("referralId"),localStorage.removeItem("referralIdExpires")}},Ed=!1;d["SPECTATE"]=function(){oe.signal(0),pf.close(!0)};var Fd;d["ADMIN"]=function(){if(!Ed){Ed=!0;var a=[[90,"dm_desert_01"],[97,"dm_desert_02"],[104,"dm_warzone_01"],[105,"dm_warzone_02"],[80,"dm_winter_01"],[84,"dm_winter_02"],[112,"cq_desert_01"],[114,"cq_warzone_01"],[111,"cq_winter_01"]],b=[[0,"KingDM"],[1,"Conquest"]],c=f("<div style='position:absolute; bottom: 10px; right:10px; z-index:9999999999; line-height:25px; width:250px;  background-color:rgba(0,0,0,0.3); color:#ffffff; padding:10px 20px; box-sizing: border-box;'>");c.append("<h2 style='margin-top:0px'>Realtime Settings</h2>");var d=f("<input type='range' max='10', min='0.1' step='0.1' value='1' style='position:absolute; right:0'>"),e=f("<span>Speed ("+PE.Settings.SpeedMultiplier+")</span>");c.append(f("<div style='width:100%; box-sizing: border-box; position:relative;'></div>").append(e).append(d)),d.on("input",function(){var a=p(d.val());e.text("Speed ("+a+")"),oe.signal(4,a)}),c.append("<br/><h2 style='margin-top:0px'>Game Start Settings</h2>");for(var g=f("<select style='width:110px; position:absolute; right:0; '>"),h=0;h<b.length;h++)g.append(f("<option value='"+b[h][0]+"'>"+b[h][1]+"</option>"));c.append(f("<div style='width:100%; box-sizing: border-box; position:relative;'>GameMode</div>").append(g));for(var i=f("<select style='width:110px; position:absolute; right:0'>"),h=0;h<a.length;h++)i.append(f("<option value='"+a[h][0]+"'>"+a[h][1]+"</option>"));c.append(f("<div style='width:100%; box-sizing: border-box; position:relative;'>Map</div>").append(i));var j=f("<input type='number' value='20' style='width:106px; position:absolute; right:0'>");c.append(f("<div style='width:100%; box-sizing: border-box; position:relative;'>Max Players</div>").append(j));var k=f("<input type='checkbox' style='position:absolute; right:0'>");c.append(f("<div style='width:100%; box-sizing: border-box; position:relative;'>Use Bots</div>").append(k));var l=f("<input type='button' value='START' style='width:100%'>");l.click(function(){var a=q(g.find("option:selected").val()),b=q(i.find("option:selected").val()),c=q(j.val()),d=k.prop("checked");confirm("Change map?")&&oe.signal(3,{GameMode:a,Map:b,MaxPlayers:c,UseBots:d})}),c.append(l),c.hide(),Fd=c,f("body").append(c)}Fd.toggle(100)},Dd.GameModes={Default:1,KingDM:0,Conquest:1,BattleRoyal:2},Dd.State={None:0,Warmup:1,Starting:2,Started:3,Ended:4,Terminated:5},F.prototype.SetTeam=function(a){var c=Dd.TeamColors.GetColor(a);b.to(this.barColor,.5,{colorProps:{tint:q(c.BorderColor),format:"number"}}),b.to(this.barFill,.5,{colorProps:{tint:q(c.Color),format:"number"}})},F.prototype.ClearTeam=function(){b.to(this.barColor,.5,{colorProps:{tint:12698049,format:"number"}}),b.to(this.barFill,.5,{colorProps:{tint:12698049,format:"number"}})},F.prototype.SetAmount=function(a){var c=122*(.01*a);this.text.text=a+"%",b.to(this.barFill,.5,{width:c})},G.prototype.SetLetter=function(a){this.text.text=(a+"").toUpperCase()},G.prototype.SetTeam=function(a){var c=Dd.TeamColors.GetColor(a);b.to(this.bg,.5,{colorProps:{tint:q(c.Color),format:"number"}});for(var d=0;d<this.sides;d++)b.to(this.bars[d],.5,{colorProps:{tint:q(c.Color),format:"number"}})},G.prototype.ClearTeam=function(){b.to(this.bg,.5,{colorProps:{tint:16777215,format:"number"}});for(var a=0;a<this.sides;a++)b.to(this.bars[a],.5,{colorProps:{tint:16777215,format:"number"}})},G.prototype.glowEffect=function(){this.glow.alpha=.8+.2*k.cos(.004*PE.GameLoop.time)},G.prototype.SetPresence=function(a){var c=Dd.TeamColors.GetColor(a);PE.GameLoop.onUpdate(this.glowEffect,this),b.to(this.glowContainer,.5,{alpha:.4}),b.to(this.glow,.5,{colorProps:{tint:q(c.Color),format:"number"}})},G.prototype.ClearPresence=function(){PE.GameLoop.offUpdate(this.glowEffect,this),b.to(this.glowContainer,.5,{alpha:0})},G.prototype.SetAmount=function(a){for(var c=100/this.sides,d=0;d<this.sides;d++){var e=d*c,f=e+c,g=this.bars[d];if(a<e)0!==g.width&&b.set(g,{width:0}),this.bars[d].visible=!1;else if(a>=f)g.width!==this.maxWidth&&b.set(g,{width:this.maxWidth}),this.bars[d].visible=!0;else{this.bars[d].visible=!0;var h=(a-e)/c;b.to(g,.15,{width:this.maxWidth*h})}}},I.prototype.SetTarget=function(a){this.target=a,this.targetUpdated=!0,Dd.Scene.layerUIArrows.addChildAt(this.arrow,0),Dd.Scene.layerUIArrows.addChild(this.icon)},I.prototype.ClearTarget=function(){this.target=void 0,this.targetUpdated=!0,Dd.Scene.layerUIArrows.removeChild(this.arrow),Dd.Scene.layerUIArrows.removeChild(this.icon)},J.prototype.setHealth=function(a){this.health=a,this.healthbarbg.width=82*a*.01},J.prototype.setColor=function(a){this.healthbarbg.tint=a.Color,this.healthbarfg.tint=a.GlassColor},J.prototype.TeamBadge=function(b){b?(this.teamBadge||(this.teamBadge=a.Sprite.fromFrame("teammate.png"),this.teamBadge.anchor.set(.5),this.teamBadge.position.set(0,7)),this.container.addChild(this.teamBadge)):this.TeamBadge&&this.container.removeChild(this.teamBadge)};var Gd={id:"id",height:"height",width:"width",background:"background",background_scale:"background_scale",background_tint:"background_tint",vignette:"vignette",brightness:"brightness",contrast:"contrast",saturation:"saturation",sceneData:"sceneData",spritesNormal:"spritesNormal",spritesMipmap:"spritesMipmap"};K.prototype.Load=function(a){if(!this.dataFetched&&!this.fetchingData){var b=this;return void this.FetchData(function(){b.Load(a)})}this.loadCallback=a;var c=this.data[Gd.vignette],d=this.data[Gd.brightness],e=this.data[Gd.contrast],f=this.data[Gd.saturation];c=0+2*(.01*c),d=1+.5*(.01*d),e=0+.5*(.01*e),f=0+.5*(.01*f),Dd.UI.FilterColor.Set(d,e,f),Dd.UI.FilterVignette.Set(c);var g=this.data[Gd.background_scale],h=this.data[Gd.background_tint];if(Dd.Scene.background.texture=this.backgroundTexture,Dd.Scene.background.tileScale.x=g.x/Wc,Dd.Scene.background.tileScale.y=g.y/Wc,Dd.Scene.background.tint=h,Dd.Scene.background.clampMargin=1.5,!this.loaded){var i=this.data[Gd.height],j=this.data[Gd.width];this.cullingInitialized=!1,this.height=i,this.width=j;this.loadObjectsFromData(this.data[Gd.sceneData]),this.gameObjects.merge(this.Above,this.Below),this.loaded=!0}Dd.Scene.background.width=this.width,Dd.Scene.background.height=this.height,this.appendToScene(),"function"==typeof this.loadCallback&&this.loadCallback()},K.prototype.appendToScene=function(){for(var a=Dd.Scene.layerLevelAbove,b=Dd.Scene.layerLevelBelow,c=a.children.concat(b.children),d=0;d<c.length;d++)c[d].parent.removeChild(c[d]);for(var d=0;d<this.Above.length;d++)a.addChild(this.Above[d]);for(var d=0;d<this.Below.length;d++)b.addChild(this.Below[d])},K.prototype.loadObjectsFromData=function(a){for(var b=0;b<a.length;b++){var c=!1,d=E(a[b],!1,this);"Below"===d.name&&(this.CurrentParent=this.Below,c=!0),"Above"===d.name&&(this.CurrentParent=this.Above,c=!0),c||this.CurrentParent.push(d),a[b].ch&&this.loadObjectsFromData(a[b].ch)}},K.prototype.getTexturePaths=function(a){var b=[];for(var c in a){var d=a[c],e=Qc.PATH.TEXTURE+c+"-"+(d*Wc*100).toFixed()+".png";b.indexOf(e)===-1&&b.push(e)}return b},K.prototype.FetchData=function(a){if(!this.fetchingData)if(this.dataFetched)"function"==typeof a&&a();else{this.fetchingData=!0;var b="Level/"+this.id+"/"+this.revision+"/data.json",c=this;f.getJSON(b,function(b){c.data=b,c.spritesNormal=b[Gd.spritesNormal],c.spritesMipmap=b[Gd.spritesMipmap];var d=c.getTexturePaths(c.spritesNormal),e=c.getTexturePaths(c.spritesMipmap),f=b[Gd.background],g=f.replace("/textures/","").replace(".png",""),h=c.spritesNormal[g]?c.spritesNormal[g]:1,i=Qc.PATH.TEXTURE+g+"-"+(h*Wc*100).toFixed()+".png",j=0,k=function(){2==++j&&(c.dataFetched=!0,c.fetchingData=!1,c.backgroundTexture=c.spritesheet.getTexture(i),"function"==typeof a&&a())};c.spritesheet.load(d,k),c.spritesheetMipmap.load(e,k)})}},K.prototype.InitCulling=function(){if(!this.cullingInitialized){Dd.Scene.layers.displayObjectUpdateTransform();var a=new Oc,b=new Oc;a.copy(Dd.Scene.layers.position),b.copy(Dd.Scene.layers.scale),Dd.Scene.layers.position.set(0),Dd.Scene.layers.scale.set(1),Dd.Scene.layers.updateTransform();for(var c=0;c<this.gameObjects.length;c++){var d=this.gameObjects[c];d._currentBounds=void 0;var e=d.getBounds();d.cullingArea=new H(e.x,e.x+e.width,e.y,e.y+e.height)}Dd.Scene.layers.position.copy(a),Dd.Scene.layers.scale.copy(b),this.cullingInitialized=!0}},L.prototype=Object.create(GameObject.prototype),L.prototype.constructor=L,PE.RegisterGameObject(3001,L),M.prototype.initGuidingArrows=function(){this.GuidingArrowsInitialized||(this.arrowContainer=new a.Container,this.arrowForward=a.Sprite.fromFrame("Helpers/arrow.png"),this.arrowContainer.addChild(this.arrowForward),this.arrowContainer.parentLayer=Dd.Scene.above3,this.arrowForward.anchor.set(.5),this.arrowForward.scale.set(1.5),this.arrowContainer.rotation=this.player.body.rotation,this.arrowForward.position.x=this.arrowDistance,Dd.Scene.layerGroundHelpers.addChild(this.arrowContainer),this.GuidingArrowsInitialized=!0)},M.prototype.Update=function(){this.playSpawnEffect&&this.player.visible&&Dd.Camera.isOnScreen(this.player.position,10,10)&&(this.playSpawnEffect=!1,this.Spawn()),this.arrowContainer.scale.x!=this.player.scale&&this.arrowContainer.scale.copy(this.player.scale),this.playerRingInitialized&&this.playerRing.position.copy(this.player.position),this.GuidingArrowsInitialized&&(this.arrowContainer.position.copy(this.player.position),rf.UserSettings["AdvancedControls"]?(this.arrowContainer.visible||(this.arrowContainer.visible=!0),this.arrowContainer.rotation=this.player.rotation):PE.InputManager.Custom("Drive")?(this.arrowContainer.visible||(this.arrowContainer.visible=!0),this.arrowContainer.rotation=PE.InputManager.Custom("DriveAngle")/100):this.arrowContainer.visible&&(this.arrowContainer.visible=!1))},M.prototype.initPlayerRing=function(){this.playerRingInitialized||(this.playerRing=a.Sprite.fromFrame("Helpers/ring_transparent.png"),this.playerRing.anchor.set(.5),this.playerRing.blendMode=a.BLEND_MODES.ADD,Dd.Scene.layerGroundHelpers.addChild(this.playerRing),this.playerRingInitialized=!0)},M.prototype.setMe=function(){this.initPlayerRing(),this.teammate=!0,this.refreshVisual()},M.prototype.setEnemy=function(){this.initPlayerRing(),this.player.me||(this.teammate=!1),this.refreshVisual()},M.prototype.setTeam=function(){this.initPlayerRing(),this.teammate=!0,this.refreshVisual()},M.prototype.PlaySpawn=function(){this.playSpawnEffect=!0},M.prototype.Spawn=function(){if(rf.UserSettings["HelperSpawn"]){var c=this;this.spawnRingInitialized||(this.spawnRing=a.Sprite.fromFrame("Helpers/ring_transparent.png"),this.spawnRing2=a.Sprite.fromFrame("Helpers/ring_transparent.png"),this.spawnRing.blendMode=this.spawnRing2.blendMode=a.BLEND_MODES.ADD,this.spawnRing.tint=this.spawnRing2.tint=16777215,this.spawnRing.alpha=this.spawnRing2.alpha=0,this.spawnRing.anchor.set(.5),this.spawnRing2.anchor.set(.5),Dd.Scene.layerGroundHelpers.addChild(this.spawnRing),Dd.Scene.layerGroundHelpers.addChild(this.spawnRing2),this.spawnRingInitialized=!0),this.spawnRing.position.copy(this.player.position),this.spawnRing2.position.copy(this.player.position),c.spawnRing.visible=!0,c.spawnRing2.visible=!0;var d=rf.UserSettings["HelperScaleMe"],e=rf.UserSettings["ColorAlphaMe"];b.fromTo(this.playerRing.scale,.7,{x:9,y:9},{x:d,y:d}),b.fromTo(this.playerRing,.7,{alpha:0},{alpha:e}),b.fromTo(this.spawnRing2.scale,1.2,{x:15,y:15},{x:d,y:d}),b.fromTo(this.spawnRing2,1.2,{alpha:.5},{alpha:0}),b.fromTo(this.spawnRing.scale,1.5,{x:20,y:20},{x:d,y:d}),b.fromTo(this.spawnRing,1.5,{alpha:.5},{alpha:0,onComplete:function(){c.spawnRing.visible=!1,c.spawnRing2.visible=!1}})}},M.prototype.refreshVisual=function(){this.player.me&&(this.initGuidingArrows(),this.arrowContainer.visible=!0),this.playerRing&&(this.player.me?(this.playerRing.tint=rf.UserSettings["ColorMe"].replace("#","0x"),this.playerRing.alpha=rf.UserSettings["ColorAlphaMe"],this.playerRing.scale.set(rf.UserSettings["HelperScaleMe"])):this.teammate?(this.playerRing.tint=rf.UserSettings["ColorTeam"].replace("#","0x"),this.playerRing.alpha=rf.UserSettings["ColorAlphaTeam"],this.playerRing.scale.set(rf.UserSettings["HelperScaleTeam"])):(this.playerRing.tint=rf.UserSettings["ColorEnemy"].replace("#","0x"),this.playerRing.alpha=rf.UserSettings["ColorAlphaEnemy"],this.playerRing.scale.set(rf.UserSettings["HelperScaleEnemy"])))},M.prototype.Dispose=function(){this.playerRing&&(this.playerRing.parent.removeChild(this.playerRing),this.playerRing.destroy()),this.spawnRing&&(this.spawnRing.parent.removeChild(this.spawnRing),this.spawnRing.destroy()),this.spawnRing2&&(this.spawnRing2.parent.removeChild(this.spawnRing2),this.spawnRing2.destroy()),this.arrowContainer&&(this.arrowContainer.parent.removeChild(this.arrowContainer),this.arrowContainer.destroy())},M.prototype.hide=function(){this.playerRing&&(this.playerRing.visible=!1),this.spawnRing&&(this.spawnRing.visible=!1),this.spawnRing2&&(this.spawnRing2.visible=!1),this.arrowContainer&&(this.arrowContainer.visible=!1)},M.prototype.show=function(){this.playerRing&&(this.playerRing.visible=!0),this.spawnRing&&(this.spawnRing.visible=!0),this.spawnRing2&&(this.spawnRing2.visible=!0),this.arrowContainer&&(this.arrowContainer.visible=!0)},O.prototype.init=function(){if(!this.audio){var a=this;
this.audio=new h({src:a.src,volume:0,loop:a.loop,rate:a.rate,autoplay:!1,pool:this.pool?this.pool:5})}},O.prototype.initStereo=function(){if(!this.audioStereo){var a=this,b={src:a.src,volume:0,loop:a.loop,autoplay:!1};this.html5?b.html5=!0:(b.pool=a.pool?a.pool:5,b.rate=a.rate),this.audioStereo=new h(b)}},O.prototype.SetVolume=function(){for(var a=this.volume,b=0;b<this.groups.length;b++)a*=this.groups[b].volume;this.audio&&this.audio.volume(a),this.audioStereo&&this.audioStereo.volume(a)},Object.defineProperties(O.prototype,{rate:{get:function(){var a=this.rateFrom;return this.rateTo&&this.rateTo!==this.rateFrom&&(a=k.random()*(this.rateFrom-this.rateTo)+this.rateTo),this.scaleSpeed&&(a*=PE.Settings.SpeedMultiplier),a}},volume:{get:function(){return this.volumeTo&&this.volumeTo!=this.volumeFrom?k.random()*(this.volumeFrom-this.volumeTo)+this.volumeTo:this.volumeFrom}}}),Object.defineProperties(P.prototype,{audio:{get:function(){return this.Stereo?this.base.audioStereo:this.base.audio}}}),P.prototype.isLoaded=function(){return!!this.audio&&"loaded"==this.audio._state},P.prototype.Preload=function(a){if(this.audio||(this.Stereo?this.base.initStereo():this.base.init()),!this.isLoaded()){return this.audio.once("load",function(){"function"==typeof a&&a()}),!0}"function"==typeof a&&a()},P.prototype.IsPlaying=function(){return!!this.isLoaded()&&this.audio.playing(this.id)},P.prototype.Play=function(a,b,c,d){if(!this.isLoaded()){var e=this;return void this.Preload(function(){e.stopped||e.Play(a,b,c,d)})}this.initialized=!0,this.stopped=!1,this.id=this.audio.play(),this.audio.rate(this.base.rate,this.id),this.SetVolume(),this.SetPosition(a,b),"function"==typeof c&&this.audio.once("end",function(){c()}),d&&this.audio.fade(0,this._vol,1e3*d,this.id)},P.prototype.SetVolume=function(a){this.initialized&&(this.currentVolume=this.GetVolume(a),this.Stereo?(this.audio.volume(this.currentVolume,this.id),this._vol=this.currentVolume):this.SetPosition(this.currX?this.currX:0,this.currY?this.currY:0))},P.prototype.GetVolume=function(a){void 0===a&&(a=this.base.volume);for(var b=0;b<this.base.groups.length;b++)a*=this.base.groups[b].volume;if(this.groups)for(var b=0;b<this.groups.length;b++)a*=this.groups[b].volume;return a>1?1:a},P.prototype.SetPosition=function(a,b){if(!this.Stereo&&this.initialized){void 0===a&&(a=Dd.Camera.audioCenter.x),void 0===b&&(b=Dd.Camera.audioCenter.y),this.currX=a,this.currY=b,this.distanceFactor=Oc.Distance(Dd.Camera.audioCenter.x,Dd.Camera.audioCenter.y,a,b);var c=this.distanceFactor/2500;c<1&&(c=k.sin(k.pow(c,.3)*k.PI*.5)),this.distanceFactor=z(1,0,c);var d=this.currentVolume*this.distanceFactor;d=k.round(1e5*d)/1e5,this._vol=d,this.audio.volume(d,this.id),this.lastPositionVolume=d}},P.prototype.Rate=function(a){if(this.initialized){if(void 0==a&&this.id)return this.audio.rate(this.id);this.base.scaleSpeed&&(a*=PE.Settings.SpeedMultiplier),this.audio.rate(a,this.id)}},P.prototype.Stop=function(){this.stopped=!0,this.initialized&&this.audio.stop(this.id)},P.prototype.FadeOut=function(a){var b=this.id,c=this,d=1e3*a;u(function(){c.audio.stop(b)},d);try{c.audio.fade(c._vol,0,d,b)}catch(a){}},P.prototype.Volume=function(a){this.initialized&&this.SetVolume(a)},P.prototype.Duration=function(){return this.audio.duration()},P.prototype.Seek=function(a){if(this.initialized)return void 0===a?this.audio.seek(this.id):this.audio.seek(k.max(0,k.min(this.audio.duration(),a)),this.id)},P.prototype.Mute=function(){this.initialized&&this.audio.mute(!0,this.id)},P.prototype.UnMute=function(){this.initialized&&this.audio.mute(!1,this.id)},Q.prototype.add=function(a,b,c){var d=this;w(this.rendercheck),this.rendercheck=v(function(){d.renderPending()},50);var e=new R(a,this,b,c);return this.pendingSprites.push(e),e},Q.prototype.renderPending=function(){this.pendingSprites.sort(function(a,b){return a.height<b.height?-1:1});for(var a=this.pendingSprites.length-1;a>=0;a--)this.render(this.pendingSprites[a]);this.pendingSprites.length<=0&&w(this.rendercheck)},Q.prototype.render=function(a){if(a.container&&a.container.isLoaded()){void 0===a.width&&(a.width=a.container.width),void 0===a.height&&(a.height=a.container.height);for(var b=!1,c=this.sprites.length-1;c>=0;c--)if(_obj=this.sprites[c],!_obj.active&&_obj.reservedWidth>=a.width&&_obj.reservedHeight>=a.height){b=!0,a.reservedHeight=_obj.reservedHeight,a.reservedWidth=_obj.reservedWidth,a.startX=_obj.startX,a.startY=_obj.startY,this.sprites.splice(c,1);break}if(b)this.objectCacheContainer.addChild(a.container),a.container.position.x=a.startX,a.container.position.y=a.startY,a.container.rotation=0;else{var d=k.ceil(a.width+this.currentX);d>this.resolution.x&&(d<=this.maxX?(this.resolution.x=d,this.resize=!0):(this.currentX=0,this.currentY=this.nextY,this.nextY=0,this.currentRow=[]));var e=k.ceil(a.height+this.currentY);if(e>this.nextY){this.nextY=k.ceil(a.height+this.currentY),e>this.resolution.y&&(this.resize=!0,this.resolution.y=e);for(var c=0;c<this.currentRow.length;c++)this.currentRow[c].reservedHeight=this.nextY-this.currentY}a.startX=this.currentX,a.startY=this.currentY,a.reservedWidth=a.width,a.reservedHeight=this.nextY-this.currentY,this.currentRow.push(a),this.objectCacheContainer.addChild(a.container),a.container.position.x=this.currentX,a.container.position.y=this.currentY,a.container.rotation=0,this.currentX+=k.ceil(a.width)}if(a.container.cacheAsBitmap=!0,this.pendingSprites.splice(this.pendingSprites.indexOf(a),1),!this.pendingSprites.length){if(this.DrawTexture(),this.onCompleteEvents)for(var c=0;c<this.onCompleteEvents.length;c++)this.onCompleteEvents[c]();this.onCompleteEvents=[]}}},Q.prototype.DrawTexture=function(){this.resize&&this.texture.resize(this.resolution.x,this.resolution.y),Dd.Scene.renderer.render(this.objectCacheContainer,this.texture,!0);for(var b=0;b<this.sprites.length;b++){var c=this.sprites[b];(c.sprite.texture===a.Texture.EMPTY||this.resize)&&(c.sprite.texture=new a.Texture(this.texture,new a.Rectangle(c.startX,c.startY,c.width,c.height)))}this.resize=!1,this.ready=!0},Q.prototype.isReady=function(){return this.ready||!this.pendingSprites.length},Q.prototype.onComplete=function(a){this.onCompleteEvents||(this.onCompleteEvents=[]),"function"==typeof a&&this.onCompleteEvents.push(a)},R.prototype.dispose=function(){this.sprite.texture=a.Texture.EMPTY,this.sprite.visible=!1,this.active=!1,this.spritesheet.objectCacheContainer.removeChild(this.container);var b=this.spritesheet.pendingSprites.indexOf(this);b!=-1&&this.spritesheet.pendingSprites.splice(b,1),this.sprite.parent&&this.sprite.parent.removeChild(this.sprite),this.container.destroy()};var Hd=!1,Id=[],Jd=[],Kd=new Nc(2048,0,(!0));U.modules=[],U.clearAll=function(){for(var a=U.modules.length-1;a>=0;a--)U.modules[a].unload();U.modules=[]},U.prototype.initialize=function(){this.initialized=!0},U.prototype.load=function(){this.loaded||(this.initialized||this.initialize(),this.loaded=!0,Dd.Scene.UI_Modules.addChild(this.container),U.modules.push(this))},U.prototype.unload=function(){this.loaded&&(this.loaded=!1,Dd.Scene.UI_Modules.removeChild(this.container),U.modules.splice(U.modules.indexOf(this),1))},U.prototype.clear=function(){},U.prototype.constructor=U,V.prototype=Object.create(U.prototype),V.prototype.constructor=V,W.prototype=Object.create(U.prototype),W.prototype.constructor=W,X.prototype=Object.create(U.prototype),X.prototype.constructor=X,Dd.Effects={},Dd.Effects.Decals={pool:[],Add:function(b,c,d,e,f){var g=this.pool[0];g?this.pool.splice(0,1):(g={container:new a.Container,sprite:a.Sprite.fromFrame("Events/Mine/mark.png"),ani:void 0,init:function(){this.container.addChild(this.sprite);var a=this;this.ani=new i({onComplete:function(){a.end()}}).to(this.sprite,.2,{alpha:p((k.random()*(.8-.5)+.5).toFixed(2))},0).to(this.sprite,2,{alpha:0},5),this.ani.stop(),this.sprite.anchor.set(.5),Dd.Scene.layerGroundDecals.addChild(this.container)},play:function(){this.sprite.visible=!0,this.sprite.alpha=0,this.ani.gotoAndPlay(0)},end:function(){this.sprite.visible=!1,Dd.Effects.Decals.pool.push(this)}},g.init());var h=1,j=p((6.29*k.random()+0).toFixed(3));d&&e&&(h=p((k.random()*(e-d)+d).toFixed(2))),g.sprite.position.set(b,c),g.sprite.scale.set(h),g.sprite.rotation=j,g.container.alpha=void 0===f?1:f,g.play()}};var Ld={alpha:{start:1,end:0},scale:{start:.5,end:2,minimumScaleMultiplier:1},color:{start:"#f4deaf",end:"#f4deaf"},speed:{start:0,end:0},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:-50,max:50},lifetime:{min:1,max:2},blendMode:"normal",frequency:.05,emitterLifetime:1.5,maxParticles:1e3,pos:{x:0,y:-10},addAtBack:!1,spawnType:"rect",spawnRect:{x:0,y:0,w:0,h:20}},Md={alpha:{start:1,end:1},scale:{start:1,end:.9,minimumScaleMultiplier:1},color:{start:"#ffffff",end:"#ffffff"},speed:{start:2500,end:2500},acceleration:{x:0,y:0},startRotation:{min:0,max:0},rotationSpeed:{min:0,max:0},lifetime:{min:.15,max:.15},blendMode:"add",frequency:.027,emitterLifetime:1.2,maxParticles:10,pos:{x:190,y:-10},addAtBack:!0,spawnType:"rect",spawnRect:{x:0,y:0,w:0,h:20}},Nd={alpha:{start:.2,end:1},scale:{start:.7,end:0,minimumScaleMultiplier:1},color:{start:"#ffffff",end:"#ffffff"},speed:{start:800,end:0},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:-522,max:500},lifetime:{min:.25,max:.5},blendMode:"normal",frequency:.05,emitterLifetime:-1,maxParticles:1e3,pos:{x:0,y:0},addAtBack:!0,spawnType:"ring",spawnCircle:{x:0,y:0,r:10,minR:0}},Od={alpha:{start:1,end:.03},scale:{start:.1,end:2,minimumScaleMultiplier:1.5},color:{start:"#ffffff",end:"#ffffff"},speed:{start:75,end:0},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:-100,max:100},lifetime:{min:1,max:3},blendMode:"normal",frequency:.1,emitterLifetime:-1,maxParticles:1e3,pos:{x:0,y:0},addAtBack:!1,spawnType:"rect",spawnRect:{x:-20,y:-20,w:40,h:40}},Pd={alpha:{start:.1,end:0},scale:{start:.3,end:1.5,minimumScaleMultiplier:1.5},color:{start:"#b3b3b3",end:"#d1b99d"},speed:{start:10,end:0},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:-50,max:50},lifetime:{min:1,max:3},blendMode:"add",frequency:.001,emitterLifetime:.1,maxParticles:35,pos:{x:0,y:0},addAtBack:!0,spawnType:"ring",spawnCircle:{x:0,y:0,r:150,minR:100}},Qd={alpha:{start:.1,end:0},scale:{start:.3,end:1.5,minimumScaleMultiplier:1.5},color:{start:"#b3b3b3",end:"#d1b99d"},speed:{start:10,end:0},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:-50,max:50},lifetime:{min:.5,max:2},blendMode:"add",frequency:.001,emitterLifetime:.1,maxParticles:35,pos:{x:0,y:0},addAtBack:!0,spawnType:"circle",spawnCircle:{x:0,y:0,r:100}},Rd={alpha:{start:1,end:.35},scale:{start:.1,end:.5,minimumScaleMultiplier:1},color:{start:"#ffffff",end:"#003780"},speed:{start:25,end:50,minimumSpeedMultiplier:1},acceleration:{x:0,y:0},maxSpeed:0,startRotation:{min:0,max:360},noRotation:!1,rotationSpeed:{min:1,max:0},lifetime:{min:.2,max:.5},blendMode:"add",ease:[{s:0,cp:.329,e:.548},{s:.548,cp:.767,e:.876},{s:.876,cp:.985,e:1}],frequency:.116,emitterLifetime:-1,maxParticles:100,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"},Sd={alpha:{start:.2,end:.8},scale:{start:1,end:.01,minimumScaleMultiplier:1},color:{start:"#FFFFFF",end:"#555555"},speed:{start:500,end:50},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:0,max:0},lifetime:{min:.2,max:.8},blendMode:"normal",frequency:.005,emitterLifetime:.1,maxParticles:500,pos:{x:0,y:0},addAtBack:!1,spawnType:"point"},Td={alpha:{start:1,end:0},scale:{start:2,end:3,minimumScaleMultiplier:1},color:{start:"#ff4800",end:"#ffe38f"},speed:{start:400,end:0},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:-50,max:50},lifetime:{min:.2,max:.8},blendMode:"add",ease:[{s:0,cp:.329,e:.548},{s:.548,cp:.767,e:.876},{s:.876,cp:.985,e:1}],frequency:.01,emitterLifetime:.1,maxParticles:100,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"},Ud={alpha:{start:1,end:0},scale:{start:.1,end:1.3,minimumScaleMultiplier:1},color:{start:"#ff4800",end:"#ffe38f"},speed:{start:200,end:0,minimumSpeedMultiplier:1},acceleration:{x:0,y:0},maxSpeed:0,startRotation:{min:-50,max:50},noRotation:!1,rotationSpeed:{min:-50,max:50},lifetime:{min:.2,max:1},blendMode:"add",ease:[{s:0,cp:.329,e:.548},{s:.548,cp:.767,e:.876},{s:.876,cp:.985,e:1}],frequency:.01,emitterLifetime:.1,maxParticles:10,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"},Vd={alpha:{start:1,end:0},scale:{start:.5,end:1.7,minimumScaleMultiplier:1.5},color:{start:"#ff4800",end:"#ffb866"},speed:{start:75,end:75},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:-100,max:100},lifetime:{min:.2,max:.3},blendMode:"add",frequency:.005,emitterLifetime:.1,maxParticles:2,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"},Wd={alpha:{start:.9,end:0},scale:{start:.1,end:.8,minimumScaleMultiplier:1},color:{start:"#ffec5c",end:"#ff4400"},speed:{start:800,end:400,minimumSpeedMultiplier:1},acceleration:{x:0,y:0},maxSpeed:0,startRotation:{min:265,max:275},noRotation:!1,rotationSpeed:{min:-100,max:100},lifetime:{min:.1,max:.4},blendMode:"add",frequency:.004,emitterLifetime:-1,maxParticles:1e3,pos:{x:0,y:0},addAtBack:!1,spawnType:"circle",spawnCircle:{x:0,y:0,r:5}},Xd={alpha:{start:.67,end:0},scale:{start:.2,end:.5,minimumScaleMultiplier:1},color:{start:"#ffec5c",end:"#ff4400"},speed:{start:200,end:200,minimumSpeedMultiplier:1},acceleration:{x:0,y:0},maxSpeed:0,startRotation:{min:0,max:180},noRotation:!1,rotationSpeed:{min:-50,max:50},lifetime:{min:.25,max:.2},blendMode:"add",frequency:.006,emitterLifetime:.2,maxParticles:1e3,pos:{x:0,y:0},addAtBack:!1,spawnType:"point"},Yd={alpha:{start:1,end:0},scale:{start:1,end:1,minimumScaleMultiplier:1},color:{start:"#e1ff4a",end:"#adff61"},speed:{start:100,end:0,minimumSpeedMultiplier:1},acceleration:{x:0,y:0},maxSpeed:0,startRotation:{min:-90,max:-90},noRotation:!1,rotationSpeed:{min:1,max:0},lifetime:{min:.5,max:1},blendMode:"add",ease:[{s:0,cp:.329,e:.548},{s:.548,cp:.767,e:.876},{s:.876,cp:.985,e:1}],frequency:.001,emitterLifetime:-1,maxParticles:7,pos:{x:0,y:0},addAtBack:!0,spawnType:"circle",spawnCircle:{x:0,y:0,r:50}},Zd={alpha:{start:.91,end:0},scale:{start:.6,end:1.7,minimumScaleMultiplier:1.5},color:{start:"#ffffff",end:"#ffc400"},speed:{start:10,end:200,minimumSpeedMultiplier:1},acceleration:{x:0,y:0},maxSpeed:0,startRotation:{min:-5,max:5},noRotation:!1,rotationSpeed:{min:0,max:0},lifetime:{min:.05,max:.15},blendMode:"add",frequency:.03,emitterLifetime:-1,maxParticles:1e3,pos:{x:20,y:0},addAtBack:!1,spawnType:"point"},$d={alpha:{start:1,end:.2},scale:{start:1.2,end:1.5,minimumScaleMultiplier:1},color:{start:"#ffffff",end:"#ffffff"},speed:{start:3500,end:3500,minimumSpeedMultiplier:1},acceleration:{x:0,y:0},maxSpeed:0,startRotation:{min:0,max:0},noRotation:!1,rotationSpeed:{min:0,max:0},lifetime:{min:.1,max:.75},blendMode:"add",frequency:.03,emitterLifetime:-1,maxParticles:1e3,pos:{x:0,y:0},addAtBack:!1,spawnType:"circle",spawnCircle:{x:0,y:0,r:9}},_d={alpha:{start:.69,end:0},scale:{start:.1,end:.4,minimumScaleMultiplier:1.5},color:{start:"#ffeee0",end:"#ffffff"},speed:{start:1,end:50,minimumSpeedMultiplier:1},acceleration:{x:0,y:0},maxSpeed:0,startRotation:{min:-180,max:180},noRotation:!1,rotationSpeed:{min:-100,max:100},lifetime:{min:.3,max:.6},blendMode:"normal",frequency:.02,emitterLifetime:-1,maxParticles:500,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"},ae={alpha:{start:0,end:.6},scale:{start:1,end:0,minimumScaleMultiplier:1.5},color:{start:"#9c71ff",end:"#9c71ff"},speed:{start:500,end:0},acceleration:{x:0,y:0},startRotation:{min:0,max:0},rotationSpeed:{min:-100,max:100},lifetime:{min:.3,max:.5},blendMode:"add",frequency:.001,emitterLifetime:.1,maxParticles:25,pos:{x:0,y:0},addAtBack:!1,spawnType:"ring",spawnCircle:{x:0,y:0,r:50,minR:0}},be={alpha:{start:1,end:0},scale:{start:.01,end:.55,minimumScaleMultiplier:1.5},color:{start:"#ff4800",end:"#ffe38f"},speed:{start:600,end:0},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:0,max:0},lifetime:{min:.2,max:.3},blendMode:"add",frequency:.01,emitterLifetime:.1,maxParticles:15,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"},ce={alpha:{start:1,end:0},scale:{start:.5,end:1.4,minimumScaleMultiplier:1.5},color:{start:"#ff4800",end:"#ffe38f"},speed:{start:1200,end:500},acceleration:{x:0,y:0},startRotation:{min:0,max:360},rotationSpeed:{min:0,max:0},lifetime:{min:.2,max:.3},blendMode:"add",frequency:.01,emitterLifetime:.1,maxParticles:15,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"},de={alpha:{start:.86,end:.2},scale:{start:.8,end:.001,minimumScaleMultiplier:1},color:{start:"#ffffff",end:"#e100ff"},speed:{start:100,end:0,minimumSpeedMultiplier:1},acceleration:{x:0,y:0},maxSpeed:0,startRotation:{min:0,max:360},noRotation:!1,rotationSpeed:{min:0,max:0},lifetime:{min:.4,max:1},blendMode:"add",frequency:.001,emitterLifetime:.15,maxParticles:35,pos:{x:0,y:0},addAtBack:!1,spawnType:"circle",spawnCircle:{x:0,y:0,r:100}},ee={alpha:{start:.1,end:.5},scale:{start:.25,end:.01,minimumScaleMultiplier:1},color:{start:"#94edff",end:"#ffffff"},speed:{start:0,end:0},acceleration:{x:0,y:0},startRotation:{min:0,max:0},rotationSpeed:{min:0,max:0},lifetime:{min:.55,max:.55},blendMode:"add",frequency:.005,emitterLifetime:-1,maxParticles:1e3,pos:{x:0,y:0},addAtBack:!0,spawnType:"point"},fe={alpha:{start:.3,end:0},scale:{start:.5,end:4,minimumScaleMultiplier:1},color:{start:"#ffffff",end:"#60fbfd"},speed:{start:-220,end:-220},acceleration:{x:0,y:0},startRotation:{min:0,max:0},rotationSpeed:{min:80,max:-80},lifetime:{min:.5,max:1.2},blendMode:"add",frequency:.001,emitterLifetime:.2,maxParticles:50,pos:{x:-1,y:0},addAtBack:!1,spawnType:"ring",spawnCircle:{x:0,y:0,r:310,minR:0}},ge=0;Y.Get=function(){return PE.ObjectCache.get(Y)},Z.Get=function(){return PE.ObjectCache.get(Z)},$.Get=function(){return PE.ObjectCache.get($)},_.Get=function(){return PE.ObjectCache.get(_)},aa.Get=function(){return PE.ObjectCache.get(aa)},ba.Get=function(){return PE.ObjectCache.get(ba)},ca.Get=function(){return PE.ObjectCache.get(ca)},da.Get=function(){return PE.ObjectCache.get(da)},ea.Count=0,ea.Get=function(){return PE.ObjectCache.get(ea)},fa.Count=0,fa.Get=function(){return PE.ObjectCache.get(fa)},ga.Count=0,ga.Get=function(){return PE.ObjectCache.get(ga)},ha.Get=function(){return PE.ObjectCache.get(ha)},ia.Get=function(){return PE.ObjectCache.get(ia)},ja.Get=function(){return PE.ObjectCache.get(ja)},ka.Get=function(){return PE.ObjectCache.get(ka)},la.Get=function(){return PE.ObjectCache.get(la)},ma.Get=function(){return PE.ObjectCache.get(ma)},na.Get=function(){return PE.ObjectCache.get(na)},oa.Get=function(){return PE.ObjectCache.get(oa)},pa.Get=function(){return PE.ObjectCache.get(pa)},qa.Get=function(){return PE.ObjectCache.get(qa)},ra.Get=function(){return PE.ObjectCache.get(ra)},sa.Get=function(){return PE.ObjectCache.get(sa)},ta.Get=function(){return PE.ObjectCache.get(ta)},ua.Count=0,ua.Get=function(){return PE.ObjectCache.get(ua)},va.Get=function(){return PE.ObjectCache.get(va)},wa.Get=function(){return PE.ObjectCache.get(wa)},xa.Get=function(){return PE.ObjectCache.get(xa)},ya.Get=function(){return PE.ObjectCache.get(ya)},za.Get=function(){return PE.ObjectCache.get(za)},Aa.Get=function(){return PE.ObjectCache.get(Aa)},Ba.Get=function(){return PE.ObjectCache.get(Ba)},Ca.Get=function(){return PE.ObjectCache.get(Ca)},Da.Count=0,Da.Get=function(){return PE.ObjectCache.get(Da)},Ea.Get=function(){return PE.ObjectCache.get(Ea)},Fa.Get=function(){return PE.ObjectCache.get(Fa)},Ga.Get=function(){return PE.ObjectCache.get(Ga)},Ha.Get=function(){return PE.ObjectCache.get(Ha)},Dd.Effects.VFXHandler={active:[],Add:function(a){this.active.indexOf(a)==-1&&this.active.push(a)},Remove:function(a){var b=this.active.indexOf(a);b!=-1&&this.active.splice(b,1)},UpdateEffects:function(a){for(var b=this.active.length-1;b>=0;b--)this.active[b].update(a)},ClearVFX:function(){for(var a=this.active.length-1;a>=0;a--)this.active[a].stop(!0)}},Dd.UI={};var he=function(b,c){this.setting=b;var d=this.container=new a.UI.Container(39,38),e=new a.UI.SliceSprite(a.Texture.fromFrame("UI/guide/key.png"),10,(!0),(!1),(!1));e.anchorLeft=e.anchorRight=e.anchorTop=e.anchorBottom=-5;var f=new a.UI.DynamicText("",{style:kd});f.align="center",f.valign="middle",this.container.addChild(e,f),this.update=function(){var a=rf.UserSettings[this.setting],b=Xc.InputManager.keyName[a];f.value=b?x(b):"",u(function(){d.width=c?k.max(f._width+20,39):39},100)}},ie=function(){this.container=new a.UI.Container(820,272);var b=a.UI.Sprite.fromFrame("UI/blank.png");b.width=b.height="100%",b.tint=0,b.alpha=.2,this.container.anchorTop=255,this.container.align="center";var c=new he("Input_Forward"),d=new he("Input_Backward"),e=new he("Input_Left"),f=new he("Input_Right"),g=new he("Input_AbilitySlot1"),h=new he("Input_AbilitySlot2"),i=new he("Input_AbilitySlot3"),j=new he("Input_AbilitySlot4"),k=new he("Input_AbilitySlot5"),l=new he("Input_WeaponReload",(!0)),m=new he("Input_ToggleScoreBoard",(!0)),n=new he("Input_Chat",(!0)),o=new he("Input_ChatTeam",(!0)),p=new he("Input_ChatParty",(!0));this.keys=[c,d,e,f,g,h,i,j,k,l,m,n,o,p];var q=a.UI.Sprite.fromFrame("UI/guide/mouse.png"),r=new a.UI.DynamicText("BASIC CONTROLS",{style:Bd}),s=new a.UI.DynamicText("ABILITIES",{style:kd}),t=new a.UI.DynamicText("MOVEMENT",{style:kd}),u=new a.UI.DynamicText("RELOAD",{style:kd}),v=new a.UI.DynamicText("SCOREBOARD",{style:kd}),w=new a.UI.DynamicText("<b>CHAT</b> (ALL)",{style:cd,allowTags:!0}),x=new a.UI.DynamicText("<b>CHAT</b> (TEAM)",{style:cd,allowTags:!0}),y=new a.UI.DynamicText("<b>CHAT</b> (PARTY)",{style:cd,allowTags:!0}),z=new a.UI.DynamicText("<b>FIRE</b>\n<font size='14'>PRIMARY</font>",{style:cd,allowTags:!0}),A=new a.UI.DynamicText("<b>FIRE</b>\n<font size='14'>SECONDARY</font>",{style:cd,allowTags:!0}),B=new a.UI.DynamicText("ZOOM",{style:kd}),C=new a.UI.Container(168,66),D=new a.UI.Container(125,66),E=new a.UI.Container(125,66),F=new a.UI.Container(170,175),G=new a.UI.Container(168,100);C.anchorLeft=G.anchorLeft=73,D.align=E.align="center",F.anchorRight=73,C.anchorBottom=D.anchorBottom=16,E.anchorBottom=152,G.anchorBottom=110,F.anchorBottom=44,g.container.anchorLeft=-20,h.container.anchorLeft=23,i.container.anchorLeft=66,j.container.anchorLeft=109,k.container.anchorLeft=152,g.container.anchorTop=h.container.anchorTop=i.container.anchorTop=j.container.anchorTop=k.container.anchorTop=0,s.anchorBottom=0,s.align="center",e.container.anchorLeft=0,d.container.anchorLeft=c.container.anchorLeft=43,f.container.anchorLeft=86,e.container.anchorTop=d.container.anchorTop=f.container.anchorTop=0,c.container.anchorTop=-42,t.anchorBottom=0,t.align="center",l.container.anchorLeft=43,l.container.anchorTop=0,u.anchorBottom=0,u.align="center",q.align="center",B.align="center",B.anchorTop=-20,z.style.align=A.style.align="center",z.anchorLeft=20,A.anchorLeft=157,z.anchorTop=A.anchorTop=15,v.anchorTop=10,w.anchorTop=55,x.anchorTop=100,y.anchorTop=145,m.container.anchorTop=0,n.container.anchorTop=45,o.container.anchorTop=90,p.container.anchorTop=135,m.container.anchorRight=n.container.anchorRight=o.container.anchorRight=p.container.anchorRight=0,r.align="center",r.anchorTop=10,C.addChild(g.container,h.container,i.container,j.container,k.container,s),D.addChild(c.container,d.container,e.container,f.container,t),E.addChild(l.container,u),F.addChild(m.container,n.container,o.container,p.container,v,w,x,y),G.addChild(q,z,A,B),this.container.addChild(b,C,D,E,F,G,r),this.show=function(){for(var b=0;b<this.keys.length;b++)this.keys[b].update();a.UI.Tween.to(this.container,2,{alpha:1},a.UI.Ease.Circ.CircOut)},this.hide=function(){a.UI.Tween.to(this.container,.5,{alpha:0},a.UI.Ease.Circ.CircOut)}};Dd.UI.FilterBlur={count:0,added:!1,initialized:!1,init:function(){this.filter=new a.filters.KawaseBlurFilter(4,3),this.initialized=!0},Add:function(){this.initialized||this.init(),this.count++,this.count>1||(this.added||(Dd.FilterManager.Add(this.filter),this.added=!0),b.to(this.filter,2,{blur:4}))},Remove:function(){this.count>0&&(this.count--,0===this.count&&b.to(this.filter,1,{blur:0,onComplete:function(){Dd.UI.FilterBlur.ActualRemove()}}))},ActualRemove:function(){this.added&&0===this.count&&(this.filter.blur=0,Dd.FilterManager.Remove(this.filter),this.added=!1)},toggle:function(){this.count>0?this.Remove():this.Add()}},Dd.UI.FilterColor={count:!1,initialized:!1,init:function(){this.filter=new a.filters.ColorMatrixFilter,this.initialized=!0},Add:function(){this.initialized||this.init(),this.count++,this.count>1||Dd.FilterManager.Add(this.filter)},Remove:function(){this.initialized&&(this.count--,this.count>0||Dd.FilterManager.Remove(this.filter))},Set:function(a,b,c){this.initialized||this.init(),this.filter.reset(),this.filter.contrast(b,!0),this.filter.saturate(c,!0),this.filter.brightness(a,!0)}},Dd.UI.FilterGray={count:0,added:!1,initialized:!1,init:function(){this.filter=new GrayFilter(0),this.filter.gray=0,this.initialized=!0},Add:function(){this.initialized||this.init(),this.count++,this.count>1||(this.added||(Dd.FilterManager.Add(this.filter),this.added=!0),b.to(this.filter,1,{gray:.6}))},Remove:function(){this.count>0&&(this.count--,0===this.count&&b.to(this.filter,.5,{gray:0,onComplete:function(){Dd.UI.FilterGray.ActualRemove()}}))},ActualRemove:function(){this.added&&0===this.count&&(this.filter.gray=0,Dd.FilterManager.Remove(this.filter),this.added=!1)},toggle:function(){this.count>0?this.Remove():this.Add()}},Dd.UI.FilterSepia={active:!1,removing:!1,initialized:!1,init:function(){this.filter=new a.filters.SepiaFilter,this.filter.sepia=0,this.initialized=!0},Add:function(){this.initialized||this.init(),this.active||(Dd.FilterManager.Add(this.filter),b.to(this.filter,1,{sepia:.9}),this.active=!0)},Remove:function(){this.active&&!this.removing&&this.initialized&&(this.removing=!0,b.to(this.filter,.5,{sepia:0}),b.delayedCall(2,function(){Dd.UI.FilterSepia.ActualRemove()}))},ActualRemove:function(){this.filter.sepia=0,Dd.FilterManager.Remove(this.filter),this.active=!1,this.removing=!1},toggle:function(){this.active?this.Remove():this.Add()}},Dd.UI.FilterVignette={active:!1,initialized:!1,init:function(){this.filter=new VignetteFilter({size:.2,amount:0,strength:.55}),this.initialized=!0},Add:function(){},Remove:function(){this.active&&this.initialized&&(Dd.FilterManager.Remove(this.filter),this.active=!1)},Set:function(a){this.initialized||this.init(),this.filter.amount=a},toggle:function(){this.active?this.Remove():this.Add()}},Dd.UI.Gate={loading:a.UI.Sprite.fromImage("content/gfx/loading.png"),sprite:null,texture:null,initialized:!1,isOpen:!0,filter:new GrayFilter(1),init:function(){this.texture=new a.RenderTexture.create(Dd.width,Dd.height),this.initialized=!0,this.sprite=new a.UI.Sprite(this.texture),this.sprite.sprite.filters=[this.filter],this.loading.width=this.loading.height=100,this.loading.align="center",this.loading.valign="middle",this.loading.alpha=.3,this.loading.pivot=.5,Dd.Scene.UI_Gate.visible=!1,Dd.Scene.UI_Gate.addChild(this.sprite),Dd.Scene.UI_Gate.addChild(this.loading)},bound:!1,boundCount:0,update:function(a){this.loading.rotation+=2*a},open:function(b){if(this.initialized||this.init(),!this.isOpen){if(b)return void u(function(){Dd.UI.Gate.open()},b);var c=this;Dd.Scene.gameStage.visible=!0,a.UI.Tween.to(Dd.Scene.UI_Gate,1.4,{alpha:0,onComplete:function(){Dd.UI.Gate.isOpen&&(Dd.Scene.UI_Gate.visible=!1),c.bound&&(c.boundCount--,PE.GameLoop.offUpdate(c.update,c),c.bound=!1)}}),this.isOpen=!0}},close:function(b){var c=b,d=Dd.UI.Gate;this.initialized||d.init(),d.isOpen&&(d.bound||(PE.GameLoop.onUpdate(this.update,this),this.bound=!0,this.boundCount++),Dd.Scene.gameStage.visible=!0,Dd.Scene.UI_Gate.visible=!0,d.texture.resize(Dd.width,Dd.height),Dd.Scene.renderer.render(Dd.Scene.gameStage,d.texture),d.sprite.sprite.texture=d.texture,d.sprite.minWidth=d.sprite.minHeight="100%",a.UI.Tween.to(Dd.Scene.UI_Gate,.4,{alpha:1,onComplete:function(){Dd.UI.Gate.isOpen||(Dd.Scene.gameStage.visible=!1),"function"==typeof c&&c()}}),d.isOpen=!1)},toggle:function(){this.isOpen?this.close():this.open()}},Dd.UI.GuidingArrowController={Arrows:[],PlayerPosition:new Oc,Add:function(a){this.Arrows.push(a)},Remove:function(a){this.Arrows.splice(this.Arrows.indexOf(a),1)},Clear:function(){for(var a=this.Arrows.length-1;a>=0;a--)this.Remove(this.Arrows[a]);this.Arrows=[]},DirectionVector:new Oc,tempPosition:new Oc,Update:function(a){if(Dd.started&&null!=Dd.Camera.target){Dd.Camera.globalPositionOf(Dd.Camera.target.position,this.PlayerPosition);for(var b=0;b<this.Arrows.length;b++){var c=this.Arrows[b];if(c.target&&c.target.visible){c.arrow.visible||(c.arrow.visible=!0,c.icon.visible=!0);var d=Dd.Camera.isOnScreen(c.target.position,10,10);if(Dd.Camera.globalPositionOf(c.target.position,c.targetPosition),!d&&c.targetVisible&&(c.arrow.alpha=.2),d&&!c.targetVisible&&(c.arrow.alpha=0,c.lerp=0),d){c.lerp=z(c.lerp,1,1*a);var e=c.targetPosition.x+c.snapOffset.x*Dd.Camera.zoom,f=c.targetPosition.y+c.snapOffset.y*Dd.Camera.zoom,g=1*Dd.Camera.zoom;c.icon.position.x=z(c.icon.position.x,e,c.lerp),c.icon.position.y=z(c.icon.position.y,f,c.lerp),c.icon.scale.x=c.icon.scale.y=z(c.icon.scale.x,g,c.lerp)}else{var h,i,j;h=i=j=0,c.icon.scale.set(c.iconScale);var l=k.atan2(this.PlayerPosition.x-c.targetPosition.x,this.PlayerPosition.y-c.targetPosition.y),m=75,n=this.PlayerPosition.x-m,o=this.PlayerPosition.y-m,p=c.targetPosition.x-m,q=c.targetPosition.y-m,r=Dd.width-2*m,s=Dd.height-2*m,t=p-n,u=q-o;t>0?i=(r-n)/t:t<0&&(i=(0-n)/t),u>0?j=(s-o)/u:u<0&&(j=(0-o)/u),h=k.abs(j)<k.abs(i)?j:i,this.tempPosition.x=t*h+n,this.tempPosition.y=u*h+o,this.tempPosition.x+=m,this.tempPosition.y+=m,c.arrow.rotation=-l,this.DirectionVector.x=k.sin(l),this.DirectionVector.y=k.cos(l),c.arrow.position.copy(this.tempPosition),c.icon.position.x=c.arrow.position.x+55*this.DirectionVector.x,c.icon.position.y=c.arrow.position.y+55*this.DirectionVector.y}c.targetVisible=d}else c.arrow.visible&&(c.arrow.visible=!1,c.icon.visible=!1)}}}};var je={tint:"#000000",fontSize:16,fontFamily:Yc,fontWeight:"bold",align:"center"},ke=!1,le=5,me=69;Dd.UI.PlayerGUI={initialized:!1,blocks:[],container:new a.UI.Container,primary:new a.UI.Container,secondary:new a.UI.Container,center:new a.UI.Container,hasPrimary:!1,hasSecondary:!1,currentScale:1,hide:function(){a.UI.Tween.to(this.container,.3,{anchorBottom:-150})},show:function(){a.UI.Tween.to(this.container,.3,{anchorBottom:0})},init:function(){if(!this.initialized){var b=89*le+me,c=this;this.initialized=!0,Dd.Scene.UI_PowerUp.addChild(this.container),this.container.height=0,this.container.width=b,this.container.anchorBottom=0,this.container.horizontalAlign="center",this.container.pivotX=.5,this.container.pivotY=1;var d=a.Texture.fromFrame("UI/ability_bg.png"),e=d.frame;e.width=.5*b,d.frame=e,d.width=.5*b,this.primaryText=new a.UI.DynamicText("Mouse 1",{style:td}),this.secondaryText=new a.UI.DynamicText("Mouse 2",{style:td}),this.primaryEmptyText=new a.UI.DynamicText("NO WEAPON",{style:td}),this.secondaryEmptyText=new a.UI.DynamicText("NO WEAPON",{style:td}),this.primaryBG=a.UI.Sprite.fromFrame("UI/weapon_bg.png"),this.secondaryBG=a.UI.Sprite.fromFrame("UI/weapon_bg.png"),this.centerLeftBG=new a.UI.Sprite(d),this.centerRightBG=new a.UI.Sprite(d),this.primaryBG.alpha=this.secondaryBG.alpha=this.centerLeftBG.alpha=this.centerRightBG.alpha=.9,this.primaryBG.pivotX=this.secondaryBG.pivotX=this.centerLeftBG.pivotX=this.centerRightBG.pivotX=1,this.primaryBG.pivotY=this.secondaryBG.pivotY=this.centerLeftBG.pivotY=this.centerRightBG.pivotY=1,this.secondaryBG.scaleX=this.centerRightBG.scaleX=-1,this.centerLeftBG.right=this.centerRightBG.right=.5*b,this.primaryBG.left=this.secondaryBG.right=26,this.primaryText.anchorLeft=this.secondaryText.anchorRight=-94,this.primaryText.anchorTop=this.secondaryText.anchorTop=-76,this.primaryEmptyText.anchorLeft=this.secondaryEmptyText.anchorRight=-108,this.primaryEmptyText.anchorTop=this.secondaryEmptyText.anchorTop=-23,
this.primaryEmptyText.alpha=this.secondaryEmptyText.alpha=.5,this.container.addChild(this.primaryBG,this.centerLeftBG,this.centerRightBG,this.secondaryBG,this.primary,this.secondary,this.primaryText,this.secondaryEmptyText,this.primaryEmptyText,this.secondaryText,this.center),this.center.width=b,this.center.horizontalAlign="center",this.center.height=100,this.center.anchorBottom=0,this.primary.width=this.secondary.width=153,this.primary.height=this.secondary.height=90,this.primary.anchorBottom=this.secondary.anchorBottom=0,this.secondary.right=this.primary.left=10,this.primary.pivotX=1;var f=function(){var a=c.container.actual_width/Dd.width,b=1;a>.6&&(b=.6*Dd.width/c.container.actual_width),b!=c.currentScale&&(c.currentScale=c.container.scale=b)};Dd.onResize(f),f()}},clearWeapons:function(){this.initialized&&(this.setWeapon(!0,!1),this.setWeapon(!1,!1))},setWeapon:function(a,b){this.init();var c=a?"_primary":"_secondary",d=a?"primary":"secondary",e=a?"primaryText":"secondaryText",f=a?"primaryBG":"secondaryBG",g=a?"primaryEmptyText":"secondaryEmptyText";this[c]&&this[d].removeChild(this[c]),b?(this[d].addChild(b),this[d].visible=!0,this[g].visible=!1,this[e].alpha=1,this[f].alpha=1):(this[d].visible=!1,this[g].visible=!0,this[e].alpha=.5,this[f].alpha=.5),this[c]=b},setCenter:function(a){this.init(),this._center&&this.center.removeChild(this._center),this.center.addChild(a),this._center=a}};var ne=function(b,c){var d=this,e=this.container=new a.UI.Container(88,100),f=new a.UI.Container(77,89),g=new a.UI.Container("100%","100%"),h=a.UI.Sprite.fromFrame("UI/PowerUp/empty.png"),i=a.UI.Sprite.fromFrame(c?"UI/PowerUp/frame_gold.png":"UI/PowerUp/frame_silver.png"),j=a.UI.Sprite.fromFrame("UI/PowerUp/white.png"),l=new a.UI.DynamicText("",{style:sd}),m=new a.UI.DynamicText("x1",{style:wd}),n=new a.UI.DynamicText("0",{style:xd}),o=new a.UI.DynamicText(""+(b+1),{style:je,width:.1,height:.1}),p=new a.Rectangle,q=new GrayFilter(0),s=new a.UI.SliceSprite(a.Texture.fromFrame(c?"UI/PowerUp/hotkey_gold.png":"UI/PowerUp/hotkey_silver.png"),5,(!0),(!1));this.focus=!1,this.index=b,q.gray=0,l.style.tint=m.style.tint=n.style.tint="#f5f5f5";for(var t=[],v=0;v<=14;v++)t.push(a.Texture.fromFrame("UI/PowerUp/ready_"+v+".png"));var w=new a.extras.AnimatedSprite(t);w.animationSpeed=.75,w.onLoop=function(){w.stop(),w.visible=!1},w.blendMode=1,i.verticalAlign="middle",i.horizontalAlign="center",h.alpha=0,j.visible=!0,j.alpha=.6,j.tint=4473924,o.right="50%",o.alpha=.7,s.addChild(o),s.pivot=.5,s.width=20,s.horizontalAlign="center",s.top=-1,e.top=-100,e.pivotX=.5,m.pivotX=1,m.right=5,m.anchorBottom=16,m.visible=!1,f.pivot=.5,f.anchorBottom=20,f.horizontalAlign=l.horizontalAlign="center",l.anchorBottom=0,n.pivot=.5,n.verticalAlign="middle",n.horizontalAlign="center";var y=new a.UI.Sprite(new a.Texture(j.sprite.texture.baseTexture,j.sprite.texture.frame));if(y.alpha=.2,y.blendMode=1,y.scaleX=-1,y.pivotX=1,p.copy(j.sprite.texture.frame),g.visible=!1,g.addChild(y,n),f.addChild(j,h,g,i),f.container.addChild(w),f.addChild(s),e.addChild(f,l,m),this.powerup=void 0,!c){e.draggable=!0,e.dragThreshold=10;var z=0,A=0,B=!1,C=!1,D=function(a){return B||32!==a.which||(B=!0,Dd.UI.PowerUpBelt.dropText.text="Drop "+d.powerup.name+"\n<font size='30'>x"+A+"</font><font valign='-5'>🔒</font>"),a.preventDefault(),a.stopPropagation(),!1},E=function(a){return B&&32===a.which&&(B=!1,Dd.UI.PowerUpBelt.dropText.text="Drop "+d.powerup.name+"\n<font size='30'>x"+A),a.preventDefault(),a.stopPropagation(),!1},F=function(){C||(r.addEventListener("keydown",D),r.addEventListener("keyup",E),C=!0,e.addChild(Dd.UI.PowerUpBelt.dropContainer),Dd.UI.PowerUpBelt.dropContainer.scaleX=.5,Dd.UI.PowerUpBelt.dropContainer.alpha=0,Dd.UI.PowerUpBelt.dropContainer.anchorLeft=84,a.UI.Tween.to(Dd.UI.PowerUpBelt.dropContainer,.5,{alpha:1,scaleX:1},a.UI.Ease.Bounce.BounceOut),B=!1,A=0,ke=!0)},G=function(){C&&(C=!1,a.UI.Tween.to(Dd.UI.PowerUpBelt.dropContainer,.2,{alpha:0,scaleX:0},a.UI.Ease.Power3.EaseOut),r.removeEventListener("keydown",D),r.removeEventListener("keyup",E),ke=!1)};e.on("draggablestart",function(a){B=!1,A=0,z=d.index,d.container.parent.addChild(d.container)}),e.on("draggablemove",function(a){var b=k.max(0,k.min(le-1,k.round((e.x-80)/88)));if(e.y<-180&&d.powerup){b=z;var c=k.round(d.powerup.qty*k.abs(e.y+180)*.01);c=k.max(1,k.min(d.powerup.qty,c)),c==A||B||(F(),A=c,Dd.UI.PowerUpBelt.dropText.text="Drop "+d.powerup.name+"\n<font size='30'>x"+c,u(function(){Dd.UI.PowerUpBelt.dropContainer.width=Dd.UI.PowerUpBelt.dropText.container.width+30},1))}else C&&G();b!=d.index&&Dd.UI.PowerUpBelt.moveSlot(d,b)}),e.on("draggableend",function(a){C&&(A>0&&d.powerup&&Dd.Connection.invoke("DropAbility",d.powerup.id,k.round(Dd.Scene.mousePosition.x),k.round(Dd.Scene.mousePosition.y),A),G()),Dd.UI.PowerUpBelt.arrange()})}new a.UI.Interaction.ClickEvent(e,(!1),(!0)).onPress=function(a,b){B=!!C&&b};var H=new a.UI.Interaction.ClickEvent(e);H.onHover=function(a,b){d.focus||(i.blendMode=b?3:0)},H.onClick=function(){d.focus?Dd.UI.PowerUpBelt.resetFocus():Dd.UI.PowerUpBelt.activate(d.index)},this.setPowerup=function(b){h.sprite.texture=a.Texture.fromFrame("UI/PowerUp/"+b.id+".png"),h.visible=!0,a.UI.Tween.to(h,.3,{alpha:1,onComplete:function(){d.powerup&&(j.visible=!1)}},a.UI.Ease.Power1.easeOut),this.powerup=b,l.text=this.powerup.name.toUpperCase(),m.visible=!0,a.UI.Tween.set(g,{alpha:0}),h.sprite.filters=null,this.updateHotkey(),this.powerup.cooldown>0?this.setCooldown(this.powerup.cooldown):this.playReadyAnimation()},this.updateHotkey=function(){if(this.powerup){var b=Xc.InputManager.keyName[rf.UserSettings["Input_AbilitySlot"+(this.index+1)]];rf.UserSettings["Input_Ability_"+this.powerup.id]&&(b=Xc.InputManager.keyName[rf.UserSettings["Input_Ability_"+this.powerup.id]]),b=x(b),b!==o.text&&(o.text=b.trim(),u(function(){a.UI.Tween.to(s,.3,{width:k.max(20,o.container.width)},a.UI.Ease.Circ.CircOut)},100)),s.visible=!0}else s.visible=!1},this.setAmount=function(a){m.text="x"+a,this.powerup.qty=a},this.clearCooldown=function(){},this.clear=function(){this.powerup=void 0,l.text="",a.UI.Tween.set(g,{alpha:0}),a.UI.Tween.to(h,.3,{alpha:0,onComplete:function(){d.powerup||(h.visible=!1)}},a.UI.Ease.Power1.easeOut),j.visible=!0,m.visible=!1,this.updateHotkey()};var I=0,J=0;this.setCooldown=function(b){I=k.ceil(b),this.powerup.cdMax?this.powerup.cdMax<b&&(this.powerup.cdMax=b):this.powerup.cdMax=b,J=this.powerup.cdMax,n.text=""+I,g.alpha=0,g.visible=!0,a.UI.Tween.to(g,.3,{alpha:1}),a.UI.Tween.to(q,.3,{gray:1}),h.sprite.filters=[q]},this.playReadyAnimation=function(){w.visible=!0,w.gotoAndPlay(0)},this.update=function(b){var c=k.ceil(this.powerup.cooldown);c!=I&&(I=c,n.text=""+I),this.powerup.cooldown<=0&&(this.playReadyAnimation(),a.UI.Tween.to(g,.3,{alpha:0},a.UI.Ease.Power1.easeOut),a.UI.Tween.to(q,.3,{gray:0,onComplete:function(){0===I&&(g.visible=!1,h.sprite.filters=null)}},a.UI.Ease.Power1.easeOut)),p.width=67*(1-this.powerup.cooldown/J)+5,y.sprite.texture.frame=p,y.sprite.width=p.width},this.activate=function(){if(!Dd.started||!Dd.isAlive)return!1;if(this.powerup){if(this.powerup.cooldown>0||this.powerup.qty<=0)return;return this.powerup.focus?(Dd.Crosshair.clearPowerup(),!1):(Dd.UI.PowerUpBelt.resetFocus(),this.powerup.abilityType==Pe.Activate?Dd.UI.PowerUpBelt.use(this.powerup.id):(a.UI.Tween.to(f,.3,{scale:1.1,anchorBottom:25},a.UI.Ease.Power1.easeOut),i.blendMode=1,this.focus=!0,this.powerup.focus=!0,Dd.Crosshair.ActivePowerup=this.powerup,this.powerup.crosshair&&this.powerup.crosshair.start()),!0)}return!1},this.unfocus=function(){this.focus=!1,i.blendMode=0,a.UI.Tween.to(f,.3,{scale:1,anchorBottom:20},a.UI.Ease.Power1.easeOut)}};Dd.UI.PowerUpBelt={dropText:new a.UI.DynamicText("",{style:wd,width:1,height:1,allowTags:!0}),dropContainer:null,initialized:!1,powerups:{},mapping:{},slots:[],container:new a.UI.Container,init:function(){if(this.dropText.style.tint="#f5f5f5",!this.initialized){this.initialized=!0,this.dropContainer=a.UI.Sprite.fromFrame("blank.png"),this.dropContainer.height=45,this.dropContainer.tint=0,this.dropContainer.sprite.alpha=.5,this.dropContainer.addChild(this.dropText),this.dropContainer.anchorLeft=0,this.dropContainer.top=14,this.dropText.left="50%",this.dropText.top=0,this.dropText.style.align="center",this.dropText.style.lineHeight=11,this.dropText.style.wrap=!1,this.dropText.pivot=.5,this.container.anchorBottom=0,this.container.height=0,this.container.width="100%",this.container.alpha=1;this.container.pivotY=1;for(var b=0;b<le;b++)!function(){var a=new ne(b,b>=le);Dd.UI.PowerUpBelt.container.addChild(a.container),Dd.UI.PowerUpBelt.slots.push(a)}();this.arrange(!0),Dd.UI.PlayerGUI.setCenter(this.container)}},add:function(a){var b=Dd.PowerUps[a],c=this.mapping[a];if(!c)for(var d=0;d<this.slots.length;d++)if(!this.slots[d].powerup){c=this.slots[d],c.setPowerup(b);break}return this.mapping[a]=c,c},updateQty:function(a,b,c){this.initialized||this.init();var d=this.add(a),e=Dd.PowerUps[a];b<=0?(d.clear(),this.mapping[a]=void 0):d.setAmount(b),void 0!==c&&c>0&&(e.cooldown=c,d.powerup==e&&d.setCooldown(c))},activateAbilityID:function(a){if(!Dd.started||!Dd.isAlive)return!1;var b=this.mapping[a];return!!b&&b.activate()},activate:function(a){if(!Dd.started||!Dd.isAlive)return!1;var b=this.slots[a];return!!b&&b.activate()},moveSlot:function(a,b){this.slots.splice(b,0,this.slots.splice(a.index,1)[0]);for(var c=0;c<this.slots.length;c++)this.slots[c].index=c;this.arrange()},arrange:function(b){for(var c=me+9,d=this.slots,e=0;e<this.slots.length;e++)!function(){var f=d[e];b?(f.container.x=c,f.container.top=-100):a.UI.Tween.to(f.container,.2,{top:-100,x:c},a.UI.Ease.Power1.easeOut),f.updateHotkey(),c+=89}()},resetFocus:function(){for(var a in Dd.PowerUps){var b=Dd.PowerUps[a];if(b.focus){b.focus=!1;var c=this.mapping[b.id];c&&c.unfocus(),b.crosshair&&b.crosshair.end()}Dd.Crosshair.ActivePowerup=void 0}},use:function(a,b,c,d){b=b||0,c=c||0,d=d||0,Dd.started&&Dd.isAlive&&(Dd.playerUnit.RemoveImmortalityEffect(),0==b&&0==c&&0==d?Dd.Connection.invoke("UseAbility",a):0!=b&&0==c&&0==d?Dd.Connection.invoke("UseAbility",a,b):Dd.Connection.invoke("UseAbility",a,b,c,d),this.resetFocus())},Update:function(a){for(var b in Dd.PowerUps){var c=Dd.PowerUps[b];if(c.cooldown>0){c.cooldown-=a;var d=this.mapping[b];d&&d.update(a)}}},ClearUI:function(){this.resetFocus();for(var a=0;a<this.slots.length;a++)slot=this.slots[a],slot.clear();this.mapping={}}};var oe=void 0;Ia.prototype=Object.create(GameObject.prototype),Ia.prototype.constructor=Ia,PE.RegisterGameObject(3e3,Ia);var pe=null;Ja.prototype=Object.create(GameObject.prototype),Ja.prototype.constructor=pe,PE.RegisterGameObject(3002,Ja);var qe=function(){var b,c,d,e,f,g,h,i,j,k,l,m,n=this,o=this.container=new a.UI.Container(147,99),p=new a.UI.Button({width:"100%",height:"100%",background:a.UI.Sprite.fromFrame("UI/crew/preview_bg.png")});p.background.alpha=.9;var q=new a.UI.Container;q.x=74,q.y=50,p.addChild(q),o.addChild(p);var r=new a.UI.DynamicText(" ",{style:gd});r.top=6,r.left=8,p.addChild(r);var s=a.UI.Sprite.fromFrame("UI/Spawn/livesBg.png");s.align="center",s.bottom=-1;var t=a.UI.Sprite.fromFrame("UI/Spawn/lives.png");t.top=0,t.left=-2;var v=new a.UI.DynamicText("∞",{style:wd,width:"100%"});v.style.align="right",v.anchorRight=5,v.top=0,s.addChild(t,v);var w=new a.UI.Container("100%","100%");w.anchorLeft=w.anchorTop=0,w.pivot=.5;var x=new a.UI.DynamicText("REPAIR",{style:wd});x.align="center",x.top=28;var y=new ec(0,ah.Gold,1);y.container.align="center",y.container.y=69,w.addChild(x,y.container),o.addChild(s,w);var z=new a.UI.DynamicText("TIER\nTOO HIGH",{style:wd,width:"100%"});z.top=28,z.style.align="center",o.addChild(z);var A=void 0;this.loadTank=function(a,b,c,d){r.text=vf[b];var e=tankClass[a];e&&(A||(A=new S),A.container.scale.set(1===e.WeightClass?.68:2===e.WeightClass?.65:.6),A.loadClass(a,d?d:e.DefaultSkinCannon,c?c:e.DefaultSkinBody),q.container.addChild(A.container),z.visible=e.RequiredCrewLevel>pe.maxTier)},this.setLevel=function(b){this.levelText||(this.levelText=new a.UI.DynamicText(" ",{style:$c,allowTags:!0}),this.levelText.anchorTop=6,this.levelText.anchorRight=8,p.addChild(this.levelText)),this.levelText.value="<font size='11' tint='#cccccc'>LEVEL</font> "+b},this.setLives=function(a){j=a,v.value=a===-1?"∞":""+j},this.setRepairCost=function(a,b){if(y.container.alpha=0,w.visible=!1,!a&&!m)return this.setFocus(!1),void(p.alpha=.5);if(h=a,g=b,a)return w.visible=!1,void(p.alpha=.9);this.setFocus(!1),p.alpha=.5;var c=b;y.container.alpha=0,y.updateAmount(c),w.visible=!0,u(function(){y.container.width=y.text.width+20,y.container.alpha=1},0)},this.setFocus=function(b){p.background.sprite.texture=a.Texture.fromFrame(b?"UI/crew/preview_bg_active.png":"UI/crew/preview_bg.png")},this.update=function(a){b=a[0],d=a[1],e=a[2],f=a[3],g=a[4],h=a[5],i=a[6],j=a[7],k=a[8],l={},a[9].length&&(l=JSON.parse(a[9])),m=a[10],c=tankClass[d].RequiredCrewLevel,this.loadTank(d,b,e,f),this.setLevel(_b(i)),this.setLives(j),this.setRepairCost(h,g)};var B=new a.UI.Container("100%",27),C=a.UI.Sprite.fromFrame("UI/blank.png"),D=new a.UI.DynamicText(" ",{style:vd});B.anchorBottom=5,B.anchorLeft=6,B.anchorRight=5,C.width="100%",C.height="100%",C.alpha=.5,D.align="center",D.valign="middle",B.addChild(C,D),B.alpha=0,o.addChild(B),this.showNeedGold=function(){D.value="Not enough gold!",C.tint=16711680,a.UI.Tween.fromTo(B,1.5,{alpha:1},{alpha:0})},this.showRepaired=function(){D.value="REPAIRED!",C.tint=10476032,a.UI.Tween.fromTo(B,1.5,{alpha:1},{alpha:0})},p.on("click",function(){return h?void pe.signal(0,b):void pe.signal(1,b)}),p.on("hover",function(b){b?(pe.preview.load(d,e,f,k,l),pe.preview.toggle(!0)):pe.preview.toggle(!1),h?(a.UI.Tween.to(q,.3,{scale:b?1.05:1},a.UI.Ease.Circ.CircOut),n.setFocus(b?!0:!1)):a.UI.Tween.to(w,.3,{scale:b?1.1:1},a.UI.Ease.Circ.CircOut)})},re=function(){var b=this.container=new a.UI.Container(420,20),c=a.UI.Sprite.fromFrame("UI/horizontal-gradient.png");c.height="100%",c.width="100%",c.alpha=.4,c.tint=0,b.addChild(c);var d=new a.UI.DynamicText("Gold balance <font size='14' color='#ffcc00' valign='-1'>1,500</font>",{style:$c,allowTags:!0});d.style.lineHeight=20,d.align="center",d.y=2;var e=a.UI.Sprite.fromFrame("UI/Menu/Currency/gold1.png");e.right=-2,e.y=1,d.addChild(e),b.addChild(d),this.setBalance=function(a){d.value="Gold balance <font size='14' color='#ffcc00' valign='-1'>"+Fc(a)+"</font>"}},se=function(){var b=this.container=new a.UI.Container(820,268);b.alpha=0;var c=new xh;b.addChild(c.container),c.container.anchorLeft=0,c.container.anchorTop=0;var d=new vh,e=new vh;d.container.y=0,e.container.y=135,d.container.x=e.container.x=329,d.container.width=e.container.width=190,b.addChild(d.container,e.container);var f=new wh(290,111,(!0));f.container.anchorTop=0,f.container.anchorRight=0,b.addChild(f.container);var g=new te;g.container.anchorBottom=0,g.container.anchorRight=0,b.addChild(g.container),this.toggle=function(c){pe.toggleGuide(!c),a.UI.Tween.to(b,.3,{alpha:c?1:0},a.UI.Ease.Circ.CircOut)},this.load=function(a,b,h,i,j){var k=tankClass[a];g.update(i,j),k&&(c.update(k,b,h),f.update(k),d.update(k.PrimaryWeapon,k.PrimaryConfig),e.update(k.SecondaryWeapon,k.SecondaryConfig))}},te=function(b,c){var d=this.container=new a.UI.Container(290,146),e=a.UI.Sprite.fromFrame("UI/blank.png");e.height="100%",e.width="100%",e.alpha=.2,e.tint=0,d.addChild(e);var f=new a.UI.DynamicText("NO COMMANDER",{style:vd});f.align="center",f.valign="middle",f.alpha=.3,d.addChild(f);var g=new a.UI.Container;g.anchorLeft=g.anchorRight=10,g.anchorTop=g.anchorBottom=10,g.alpha=0,d.addChild(g);var h=new a.UI.Container(130,"100%");h.anchorRight=0,g.addChild(h);var i=new a.UI.DynamicText(" ",{style:kd,width:"100%",allowTags:!0});i.style.align="center",i.style.lineHeight=13,i.y=0,h.addChild(i);var j=new hh(130);j.container.anchorTop=40,h.addChild(j.container);var k=new a.UI.Container(138,"100%");k.anchorBottom=4,k.pivotY=1,k.scale=.95,g.addChild(k);var l=a.UI.Sprite.fromFrame("UI/blank.png");l.height="100%",l.width="100%",l.alpha=.4,l.tint=0;var m=a.UI.Sprite.fromFrame("UI/blank.png");k.addChild(l,m),m.anchorBottom=0;var n=function(b){a.UI.Tween.to(g,.3,{alpha:b?1:0},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(f,.3,{alpha:b?0:.3},a.UI.Ease.Circ.CircOut)};this.update=function(a,b){return a===-1?void n(!1):(eg.loadItemInfo([a],function(){var b=eg.items[a],c=b.getTexture();m.sprite.texture=c,m.width=c.width,m.height=c.height,i.value=b.name+"\n<font size='12' valign='5' tint='#dedede'>"+b.title,n(!0)}),void j.update(b))}},ue=function(b){var c=this.container=new a.UI.Button({background:new a.UI.SliceSprite(kf,4),width:300,height:150,text:new a.UI.DynamicText("<b>JOIN</b>\nTeam "+b,{style:ed,allowTags:!0,width:"100%"})});c.background.alpha=.5,c.on("hover",function(b){a.UI.Tween.to(this.background,.6,{alpha:b?.9:.5},a.UI.Ease.Circ.CircOut)}),c.on("click",function(a){pe.signal(10,b)}),c.text.style.align="center",this.hide=function(){c.visible=c.interactive=!1},this.show=function(){c.visible=c.interactive=!0};var d=function(){c.background.tint=Dd.TeamColors.GetColor(b).Color};Dd.TeamColors.on("update",d),d()},ve=null;Ka.prototype=Object.create(GameObject.prototype),Ka.prototype.constructor=Ka,PE.RegisterGameObject(3003,Ka);var we=function(d,e){var f,g,h,i,j=this.container=new a.Container,l=!1,m=a.Sprite.fromFrame("UI/box.png");m.anchor.set(.5,1);var n=new a.Text("",{fontFamily:Yc,fontSize:"24px",fill:"#ffffff",fontWeight:"bold"}),o=new a.Text("",{fontFamily:"Calibri Light, Calibri, 'woffwoff'",fontSize:"24px",fill:"#ffffff"}),p=new a.Text("",{fontFamily:Yc,fontSize:"24px",fill:"#ffffff",fontWeight:"bold"}),q=new a.Container;p.anchor.set(.5),o.anchor.set(.5),n.anchor.set(.5),j.addChild(m),j.addChild(n),j.addChild(o),j.addChild(p),j.addChild(q),1===e&&(f=a.Sprite.fromFrame("Misc/crown.png"),f.anchor.set(.5),f.scale.set(1.5),j.addChild(f)),this.Show=function(){if(l){var a=d/337*1.5,c=-105*a;b.to(m,.8,{height:d,ease:Bounce.easeOut}),b.to(n,.8,{alpha:1,y:-d+25,ease:Bounce.easeOut}),b.to(o,.8,{alpha:1,y:-d+50,ease:Bounce.easeOut}),b.to(p,.8,{alpha:1,y:-30,ease:Bounce.easeOut}),b.to(q,.8,{alpha:1,y:c,ease:Bounce.easeOut}),b.to(q.scale,.8,{x:a,y:a}),f&&Dd.currentGM===Dd.GameModes.KingDM&&b.to(f,.8,{alpha:1,y:-d-40,ease:Bounce.easeOut})}},this.Hide=function(){m.height=0,p.alpha=o.alpha=n.alpha=0,q.y=p.y=o.y=n.y=0,q.alpha=0,q.scale.set(0),g&&(h.kill(),i.kill(),g.destroy(),g=void 0),f&&(f.alpha=0,f.y=0),l=!1},this.Set=function(a,b,d){var e=Dd.Players[a];if(e&&e.unit&&e.unit.tank){l=!0,g=e.unit.tank.clone(),q.addChild(g.container);var f=2*k.PI;return g.gun.rotation=k.random()*k.PI,g.body.rotation=k.random()*f,k.random()>.5&&(f=-f),h=c.to(g.gun,7.5,{rotation:g.gun.rotation+f,ease:Power0.easeNone,repeat:-1}),i=c.to(g.body,15,{rotation:g.body.rotation-f,ease:Power0.easeNone,repeat:-1}),n.text=b,o.text=e.name,void(p.text=d)}l=!1},this.Hide()},xe=function(b,d,e,f){var g=this.container=new a.UI.Container;g.width=644,g.height=37,g.horizontalAlign="center",g.pivot=.5,g.alpha=0,this.XP=d,this.Gold=e;var h=this.CrateId=f?f[0]:0,i=f?f.length:0,j=new a.UI.SliceSprite(new a.Texture.fromFrame("UI/ui-box-5.png"),10);j.width="100%",j.alpha=.17,j.tint=0,j.height=34,g.addChild(j);var k=new a.UI.DynamicText("+"+e,{style:md});k.right=81,k.top=-2,k.style.tint="#ffe139",g.addChild(k);var l=new a.UI.DynamicText(b,{style:ed,allowTags:!0});l.top=-2,l.x=15,g.addChild(l);var m;if(h){var n=new a.UI.Container;n.right=145,n.top=15,g.addChild(n),eg.loadItemInfo([h],function(){m=new a.UI.Sprite(eg.items[h].getTexture()),m.pivot=.5,m.scale=.35,n.addChild(m);var b=new a.UI.DynamicText("x"+i,{style:xd});b.anchorTop=-3,b.anchorLeft=10,n.addChild(b)})}else{var o=new a.UI.DynamicText("+"+d,{style:md});o.right=168,o.top=-2,g.addChild(o)}this.show=function(){c.set(g,{scale:2}),c.to(g,.3,{scale:1,alpha:1,ease:Sine.easeIn}),Dd.Audio.Common.ui_reward_impact.Play(),f&&m&&c.from(m,1,{scale:2.5*m.scale,alpha:1,ease:Sine.easeOut}),ve.shareArea.play()}},ye={levelInitialized:!1,levelUpContainer:new a.UI.Container,ShowLevelUp:function(b,d){var e=this;if(!this.levelInitialized){this.levelUpContainer.horizontalAlign="center",this.levelUpContainer.verticalAlign="middle",this.levelUpContainer.alpha=0,this.levelUpContainer.pivot=.5,this.dimm=new a.UI.Sprite(new a.Texture.fromFrame("UI/ui-white-box.png")),this.dimm.width="100%",this.dimm.height="100%",this.dimm.tint=0,this.dimm.alpha=0,this.levelInitialized=!0,this.levelUpIcon=new a.UI.Sprite(new a.Texture.fromImage("Content/Ranks/"+b+".png")),this.levelUpIcon.verticalAlign="middle",this.levelUpIcon.horizontalAlign="center",this.levelUpIcon.pivot=.5,this.levelUpIcon.scale=.7,this.levelUpIcon.width=132,this.levelUpIcon.height=176,this.levelUpIcon.alpha=1,Dd.Scene.UI_GameEnd.addChild(this.dimm,this.levelUpContainer);var f=new a.UI.Container;f.verticalAlign="middle",f.horizontalAlign="center",f.scale=1,f.alpha=0;var g=this.emitter=new a.particles.Emitter(f.container,[a.Texture.fromFrame("Particles/lightning1.png")],Od);g.particleBlendMode=a.BLEND_MODES.ADD;var h=new a.UI.Sprite(new a.Texture.fromFrame("Particles/whitesmoke.png"));h.verticalAlign="middle",h.horizontalAlign="center",h.pivot=.5,h.scale=.8,h.blendMode=1,h.alpha=.8;var i=new a.UI.Sprite(new a.Texture.fromFrame("Particles/particle_big.png"));i.verticalAlign="middle",i.horizontalAlign="center",i.pivot=.5,i.scale=4,i.blendMode=1,i.alpha=0,this.LevelUpText=new a.UI.Text("LEVEL "+b,{fill:"#ffffff",fontSize:80,fontFamily:Yc,fontWeight:"bold"}),this.LevelUpText.horizontalAlign="center",this.LevelUpText.y=-100,this.LevelUpText.pivotX=.5,this.LevelUpText.pivotY=.5,this.LevelUpText.scale=.7,this.LevelUpText.alpha=0,this.LevelUpText2=new a.UI.Text("GOLD GENERAL III",{fill:"#ffffff",fontSize:50,fontFamily:Yc,fontWeight:"bold"}),this.LevelUpText2.horizontalAlign="center",this.LevelUpText2.y=245,this.LevelUpText2.pivotX=.5,this.LevelUpText2.pivotY=.5,this.LevelUpText2.scale=1.4,this.LevelUpText2.alpha=0,this.levelUpIcon.addChild(this.LevelUpText,this.LevelUpText2),this.levelUpContainer.addChild(f,h,i,this.levelUpIcon),this.emitterUpdate=function(a){g.update(a)},this.levelupAnimation=(new j).to(this.levelUpContainer,2,{alpha:1,ease:Sine.easeOut},0).to(this.dimm,2,{alpha:.8,ease:Sine.easeOut},0).to(h,10,{scale:1.8,ease:Sine.easeOut},0).to(this.LevelUpText,3,{alpha:1,ease:Sine.easeOut},0).to(this.LevelUpText,10,{scale:1.4,ease:Sine.easeOut},0).to(f,3,{alpha:1,ease:Sine.easeOut},0).to(f,7,{scale:1.5,ease:Power0.easeNone},0).to(this.levelUpIcon,7,{scale:1.5,ease:Sine.easeOut},0).to(this.LevelUpText2,3,{alpha:1,ease:Sine.easeOut},4).to(this.LevelUpText2,5,{scale:.7,ease:Sine.easeOut},4).to(this.levelUpIcon,2,{scale:6.5,alpha:0,ease:Sine.easeIn},7).to(f,2,{scale:4,alpha:0,ease:Sine.easeIn},7).to(this.levelUpContainer,2,{alpha:0,ease:Sine.easeIn},7).to(this.dimm,2,{alpha:0,ease:Sine.easeOut},7).to(this.LevelUpText,5,{alpha:0,ease:Sine.easeOut},4).to(this.LevelUpText2,2,{alpha:0,ease:Sine.easeOut},7).to(i,.1,{alpha:1,ease:Sine.easeOut},7).to(i,.3,{alpha:0,ease:Sine.easeOut},7.1),this.levelupAnimation.stop()}this.levelUpIcon.sprite.texture=new a.Texture.fromImage("Content/Ranks/"+b+".png"),this.levelUpIcon.visible=!0,Dd.Audio.Common.ui_level_up.Play(),PE.GameLoop.onUpdate(e.emitterUpdate,e),this.LevelUpText.text="LEVEL "+b,this.LevelUpText2.text=Dd.XPSystem.GetRankName(b),this.levelupAnimation.gotoAndPlay(0),this.emitter.emit=!0,this.levelUpContainer.visible=!0,this.dimm.visible=!0,c.delayedCall(9,function(){PE.GameLoop.offUpdate(e.emitterUpdate,e),"function"==typeof d&&d()})},Clear:function(){this.levelInitialized&&(this.levelUpContainer.visible=!1)}};Qa.prototype=Object.create(GameObject.prototype),Qa.prototype.constructor=Qa,Qa.prototype.initialize=function(){Dd.currentGameMode=this},Ra.prototype=Object.create(Qa.prototype),Ra.prototype.constructor=Ra,PE.RegisterGameObject(1e3,Ra),Sa.prototype=Object.create(GameObject.prototype),Sa.prototype.constructor=Sa,PE.RegisterGameObject(300,Sa);var ze={None:-1,Captured:0,Capturing:1,Neutralizing:2,Paused:3};Ta.prototype=Object.create(GameObject.prototype),Ta.prototype.constructor=Ta,PE.RegisterGameObject(301,Ta),Ua.prototype=Object.create(Qa.prototype),Ua.prototype.constructor=Ua,PE.RegisterGameObject(1001,Ua),Va.prototype=Object.create(Qa.prototype),Va.prototype.constructor=Va,PE.RegisterGameObject(1002,Va),Wa.prototype=Object.create(GameObject.prototype),Wa.prototype.constructor=Wa,PE.RegisterGameObject(3,Wa),Ya.prototype=Object.create(GameObject.prototype),Ya.prototype.constructor=Ya,Ya.prototype.initialize=function(a){this.hide(),this.visibleLastUpdate=!1,this.playerEnter(a),Dd.TeamColors.on("update",this.updateColors,this)},Object.defineProperties(Ya.prototype,{position:{get:function(){return this.tank.container.position}},gunPosition:{get:function(){return this._gunPosition.set(this.class.CannonOffset.x,this.class.CannonOffset.y),this._gunPosition.rotate(this.tank.body.rotation),this._gunPosition.x+=this.tank.container.position.x,this._gunPosition.y+=this.tank.container.position.y,this._gunPosition}},rotation:{get:function(){return this.tank.body.rotation}},worldTransform:{get:function(){return this.tank.container.worldTransform}},scale:{get:function(){return this.tank.body.scale}},width:{get:function(){return this.tank.body.width}},height:{get:function(){return this.tank.body.height}},body:{get:function(){return this.tank.body}},gun:{get:function(){return this.tank.gun}}}),Za.prototype=Object.create(Ya.prototype),Za.prototype.constructor=Za,PE.RegisterGameObject(1,Za),$a.prototype=Object.create(Ya.prototype),$a.prototype.constructor=$a,PE.RegisterGameObject(2,$a),_a.prototype=Object.create(GameObject.prototype),_a.prototype.constructor=_a,PE.RegisterGameObject(7,_a),ab.prototype=Object.create(GameObject.prototype),ab.prototype.constructor=ab,PE.RegisterGameObject(8,ab),bb.prototype=Object.create(GameObject.prototype),bb.prototype.constructor=bb,PE.RegisterGameObject(9,bb),cb.prototype=Object.create(GameObject.prototype),cb.prototype.constructor=cb,PE.RegisterGameObject(100,cb),db.prototype=Object.create(GameObject.prototype),db.prototype.constructor=db,PE.RegisterGameObject(101,db),eb.prototype=Object.create(GameObject.prototype),eb.prototype.constructor=eb,PE.RegisterGameObject(102,eb),fb.prototype=Object.create(GameObject.prototype),fb.prototype.constructor=fb,PE.RegisterGameObject(105,fb),gb.prototype=Object.create(GameObject.prototype),gb.prototype.constructor=gb,PE.RegisterGameObject(106,gb),hb.prototype=Object.create(GameObject.prototype),hb.prototype.constructor=hb,PE.RegisterGameObject(30,hb),ib.prototype=Object.create(GameObject.prototype),ib.prototype.constructor=ib,PE.RegisterGameObject(31,ib),jb.prototype=Object.create(GameObject.prototype),jb.prototype.constructor=jb,PE.RegisterGameObject(32,jb),kb.prototype=Object.create(GameObject.prototype),kb.prototype.constructor=kb,PE.RegisterGameObject(33,kb),lb.prototype=Object.create(GameObject.prototype),lb.prototype.constructor=lb,PE.RegisterGameObject(34,lb),mb.prototype=Object.create(GameObject.prototype),mb.prototype.constructor=mb,PE.RegisterGameObject(35,mb),nb.prototype=Object.create(GameObject.prototype),nb.prototype.constructor=nb,PE.RegisterGameObject(36,nb),ob.prototype=Object.create(GameObject.prototype),ob.prototype.constructor=ob,PE.RegisterGameObject(37,ob);var Ae=[];pb.prototype=Object.create(GameObject.prototype),pb.prototype.constructor=pb,Object.defineProperties(pb.prototype,{position:{get:function(){return this.container.position}},rotation:{get:function(){return this.bodySprite.rotation}},worldTransform:{get:function(){return this.container.worldTransform}},scale:{get:function(){return this.container.scale}}}),pb.prototype.initialize=function(a,b){this.healthbar.container.alpha=this.hideHealthbar?0:1,this.healthbar.container.position.y=this.healthbarOffset,this.isNew=!0;var c=this.unit=b?getGameObject(b):void 0;Ae.add(this),this.isOwner=!1,c&&c.visible&&(this.isOwner=c.player&&c.player.sessionID==PE.Server.playerId,this.container.position.set(c.position.x,c.position.y)),this.setTeam(a),Dd.TeamColors.on("update",this.updateColors,this)},pb.prototype.updateColors=function(){this.setTeam(this.team)},pb.prototype.update=function(a,b){this.baseUpdate(a,b)},pb.prototype.destroy=function(a){GameObject.prototype.destroy.call(this),Ae.remove(this),Dd.TeamColors.off("update",this.updateColors)},pb.prototype.show=function(){this.visible||(this.container.x=this.data.x,this.container.y=this.data.y,this.bodySprite.rotation=this.data.bodyRotation,PE.GameLoop.onUpdate(this.update,this),this.container.visible=!0,GameObject.prototype.show.call(this),this.isNew&&this.unit&&this.unit.visible&&this.container.position.copy(this.unit.position),this.isNew=!1)},pb.prototype.hide=function(){this.visible&&(PE.GameLoop.offUpdate(this.update,this),this.container.visible=!1,GameObject.prototype.hide.call(this))},qb.prototype=Object.create(pb.prototype),qb.prototype.constructor=qb,qb.prototype.show=function(){this.visible||(this.topRotation=this.turretData.topRotation,pb.prototype.show.call(this),this.weapons.show(),PE.Server.onUpdate(this.servupdate,this))},qb.prototype.hide=function(){this.visible&&(pb.prototype.hide.call(this),this.weapons.hide(),PE.Server.offUpdate(this.servupdate,this))},qb.prototype.destroy=function(a){pb.prototype.destroy.call(this),this.clearTarget(),this.weapons.destroy()},Object.defineProperties(qb.prototype,{position:{get:function(){return this.container.position}},gun:{get:function(){return this.topSprite}}}),rb.prototype=Object.create(qb.prototype),rb.prototype.constructor=rb,PE.RegisterGameObject(50,rb),sb.prototype=Object.create(qb.prototype),sb.prototype.constructor=sb,PE.RegisterGameObject(51,sb),tb.prototype=Object.create(qb.prototype),tb.prototype.constructor=tb,PE.RegisterGameObject(52,tb),ub.prototype=Object.create(qb.prototype),ub.prototype.constructor=ub,PE.RegisterGameObject(53,ub),vb.prototype=Object.create(qb.prototype),vb.prototype.constructor=vb,PE.RegisterGameObject(54,vb),wb.prototype=Object.create(qb.prototype),wb.prototype.constructor=wb,PE.RegisterGameObject(55,wb),xb.prototype=Object.create(pb.prototype),xb.prototype.constructor=xb,PE.RegisterGameObject(60,xb),yb.prototype=Object.create(GameObject.prototype),yb.prototype.constructor=yb,PE.RegisterGameObject(2e3,yb),zb.prototype.activate=function(a,b,c,d,e){this.ammoMax=c,this.setAmmo(b),this.primary=a,this.gradeText.text=(""+d["Name"]).toUpperCase(),e&&this.reload(e),Dd.UI.PlayerGUI.setWeapon(this.primary,this.container)},zb.prototype.setAmmo=function(a){if(a!==this.ammo){this.icon&&(this.icon.visible=!0),this.ammoText.visible=!0,this.reloadText.visible=!1;var b=k.max(a*this.weapon.GUIMultiply,0).toFixed(this.weapon.GUIDecimals);if(b!==this._a){this._a=b;var c=k.max(this.ammoMax*this.weapon.GUIMultiply,0).toFixed(0),d="<font size='"+this.weapon.GUIAmmoMaxSize+"'>"+this.weapon.GUIPrepend+"</font>";this.ammoText.text="<font size='"+this.weapon.GUIAmmoSize+"'>"+b+"</font>"+(this.weapon.GUIShowMax?"<font size='"+this.weapon.GUIAmmoMaxSize+"'>/"+c+"</font>":"")+d}this.ammo=a}},zb.prototype.reload=function(a){this.icon&&(this.icon.visible=!1),this.reloadText.visible=!0,this.ammoText.visible=!1},zb.prototype.clear=function(){Dd.UI.PlayerGUI.setWeapon(this.primary,!1)},zb.prototype.constructor=zb,Ab.prototype=Object.create(GameObject.prototype),Ab.prototype.constructor=Ab,Ab.prototype.initialize=function(a,b){this.unit=getGameObject(a),this.me=this.unit.player&&PE.Server.playerId===this.unit.player.sessionID,this.primary=b,this.unit.weapons.addWeapon(this)},Ab.prototype.initGUI=function(a,b,c){this.weaponConfig=weapon[this.type]["Stats"][a],this.defaultAmmo=this.weaponConfig["Start_Ammo"],this.name=weapon[this.type]["Name"],this.ammo=b,this.GUIInitialized||(this.GUI=new this.GUIClass(weapon[this.type]["Name"],this),this.GUIInitialized=!0),this.GUI.activate(this.primary,this.ammo,this.defaultAmmo,this.weaponConfig,c)},Ab.prototype.updateAmmo=function(a,b){
if(this.GUIInitialized)if(a=k.min(this.defaultAmmo,k.max(0,a)),b){var c=this;c.GUI.reload(b),u(function(){c.sound_reload&&c.sound_reload.Play(c.unit.data.x,c.unit.data.y)},600),u(function(){c.ammo=a,c.GUI.setAmmo(c.ammo)},1e3*b-100)}else this.ammo=a,this.GUI.setAmmo(this.ammo)},Ab.prototype.show=function(){GameObject.prototype.show.call(this)},Ab.prototype.kick=function(a){var b=this.unit.tank;b||(b=this.unit),b&&c.fromTo(b.gun.pivot,.35,{x:a},{x:0})},Ab.prototype.hide=function(){GameObject.prototype.hide.call(this)},Ab.prototype.destroy=function(){GameObject.prototype.destroy.call(this)},Bb.prototype=Object.create(Ab.prototype),Bb.prototype.constructor=Bb,Cb.prototype=Object.create(Bb.prototype),Cb.prototype.constructor=Cb,PE.RegisterGameObject(200,Cb),Db.prototype=Object.create(Bb.prototype),Db.prototype.constructor=Db,PE.RegisterGameObject(201,Db),Eb.prototype=Object.create(Bb.prototype),Eb.prototype.constructor=Eb,PE.RegisterGameObject(202,Eb),Fb.prototype=Object.create(Ab.prototype),Fb.prototype.constructor=Fb,PE.RegisterGameObject(203,Fb),Gb.prototype=Object.create(Ab.prototype),Gb.prototype.constructor=Gb,PE.RegisterGameObject(204,Gb),Hb.prototype=Object.create(Ab.prototype),Hb.prototype.constructor=Hb,PE.RegisterGameObject(205,Hb),Ib.prototype=Object.create(Ab.prototype),Ib.prototype.constructor=Ib,PE.RegisterGameObject(206,Ib),Jb.prototype=Object.create(Ab.prototype),Jb.prototype.constructor=Jb,PE.RegisterGameObject(207,Jb),Kb.prototype=Object.create(Ab.prototype),Kb.prototype.constructor=Kb,PE.RegisterGameObject(208,Kb),Lb.prototype=Object.create(Ab.prototype),Lb.prototype.constructor=Lb,PE.RegisterGameObject(209,Lb),Mb.prototype=Object.create(Bb.prototype),Mb.prototype.constructor=Mb,PE.RegisterGameObject(210,Mb),Nb.prototype=Object.create(Ab.prototype),Nb.prototype.constructor=Nb,PE.RegisterGameObject(211,Nb),Ob.prototype=Object.create(Bb.prototype),Ob.prototype.constructor=Ob,PE.RegisterGameObject(212,Ob),Pb.prototype=Object.create(Ab.prototype),Pb.prototype.constructor=Pb,PE.RegisterGameObject(213,Pb),Qb.prototype=Object.create(Ab.prototype),Qb.prototype.constructor=Qb,PE.RegisterGameObject(214,Qb),Rb.prototype=Object.create(Bb.prototype),Rb.prototype.constructor=Rb,PE.RegisterGameObject(215,Rb),Sb.prototype=Object.create(GameObject.prototype),Sb.prototype.constructor=Sb,PE.RegisterGameObject(4,Sb),Tb.prototype=Object.create(GameObject.prototype),Tb.prototype.constructor=Tb,PE.RegisterGameObject(5,Tb),Ub.prototype=Object.create(GameObject.prototype),Ub.prototype.constructor=Ub,PE.RegisterGameObject(6,Ub),Vb.prototype=Object.create(GameObject.prototype),Vb.prototype.constructor=Vb,PE.RegisterGameObject(10,Vb);var Be={loaded:{},Load:function(b,c){for(var d=[],e=[],f=0;f<b.length;f++){var g=b[f];void 0===this.loaded[g]&&(this.loaded[g]=!1,e.indexOf(g)===-1&&e.push(g)),this.loaded[g]||d.indexOf(g)===-1&&d.push(g)}if(d.length){var h,i=function(a){t(h);for(var b=0;b<d.length;b++){if(!Be.loaded[d[b]])return void(h=u(function(){i(a)},100))}a()};if(e.length){for(var j=new a.loaders.Loader,k=0;k<e.length;k++)j.add(e[k]);j.load(function(){for(var a=0;a<e.length;a++)Be.loaded[e[a]]=!0;i(c)})}else i(c)}else c()}};Dd.Audio={Special:[],Base:{},Common:{},Groups:{Game:{volume:.5},Music:{volume:.5},Announcer:{volume:.5},MyTank:{volume:.5},MyShot:{volume:.5},UI:{volume:.5}},Update:function(){this.Groups.Game.volume=rf.UserSettings["VolumeGame"],this.Groups.Music.volume=rf.UserSettings["VolumeMusic"],this.Groups.Announcer.volume=rf.UserSettings["VolumeAnnouncer"],this.Groups.UI.volume=rf.UserSettings["VolumeUI"],this.Groups.MyTank.volume=rf.UserSettings["VolumeMeEngine"],this.Groups.MyShot.volume=rf.UserSettings["VolumeMeShoot"];for(var a in this.Base){this.Base[a].SetVolume()}for(var b=0;b<this.Special.length;b++){this.Special[b].SetVolume()}g.volume(rf.UserSettings["VolumeMaster"]),g.mute(rf.UserSettings["VolumeMute"])}};var Ce="/Content/Sounds/",De=.25,Ee=1,Fe=Ce+"Commander/",Ge=Ce+"Impact/",He=.8,Ie=.9,Je=1,Ke=Ce+"Announcer/",Le=Ce+"UI/";Dd.Audio.Base={music:new O(Ce+"music",["webm","mp3"],[Dd.Audio.Groups.Music],(!0),(!1),.3,.3,1,1,1,(!1)),flamethrower_activate:new O(Ce+"flame_start",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.6,.6,.9,1.1),flamethrower_loop:new O(Ce+"flame_loop",["webm","mp3"],[Dd.Audio.Groups.Game],(!0),(!0),.3,.3,.7,.7),flamethrower_hit_loop:new O(Ce+"flame_hit_loop",["webm","mp3"],[Dd.Audio.Groups.Game],(!0),(!0),2,2,1.2,1.5),flamethrower_reload:new O(Ce+"weapon_flamethrower_reload",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.5,.5,1,1.2),minigun_start:new O(Ce+"mini_start",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.1,.1,1,1),minigun_loop:new O(Ce+"mini_loop",["webm","mp3"],[Dd.Audio.Groups.Game],(!0),(!0),.1,.1,1,1),minigun_stop:new O(Ce+"mini_stop",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.1,.1,1,1),minigun_reload:new O(Ce+"weapon_minigun_reload",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.4,.4,1,1.2),cannon_long_shot:new O(Ce+"weapon_cannon_heavy",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.5,.5,1.3,1.5),cannon_heavy_shot:new O(Ce+"weapon_cannon_heavy",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.5,.5,.9,1.2),cannon_medium_shot:new O(Ce+"weapon_cannon_medium",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.5,.5,.9,1.2),cannon_small_shot:new O(Ce+"weapon_cannon_small",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.5,.5,.9,1.2),cannon_heavy_reload:new O(Ce+"weapon_cannon_heavy_reload",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.4,.4,.9,1.2),cannon_medium_reload:new O(Ce+"weapon_cannon_medium_reload",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.4,.4,.9,1.2),weapon_impact_heavy:new O(Ce+"weapon_impact_heavy",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.5,.5,.9,1.2),weapon_impact_medium:new O(Ce+"weapon_impact_medium",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.5,.5,.9,1.2),weapon_impact_small:new O(Ce+"weapon_impact_small",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.5,.5,.9,1.2),cloak_activate:new O(Ce+"cloak_activate",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1,1,1,1.2,1),cloak_deactivate:new O(Ce+"cloak_deactivate",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1,1,1,1.2,1),missile:new O(Ce+"missile",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.4,.4,.8,1.1),missile_reload:new O(Ce+"weapon_rocket_reload",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.3,.3,1.1,1.2),emp_air:new O(Ce+"emp_air",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1,1,.8,1.1),emp_explode:new O(Ce+"emp_explode",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1.25,1.25,1.1,1.2),emp_mark:new O(Ce+"emp_mark",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.6,.6,1,1.1),bomb_fall_explode:new O(Ce+"bomb_fall_explode",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1,1,.9,1.1),grenade_shot:new O(Ce+"grenade_shot",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.4,.4,1,1.3),grenade_bounce:new O(Ce+"grenade_bounce",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.9,1.1,.7,.8),grenade_reload:new O(Ce+"weapon_grenade_reload",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.4,.4,1,1.2),laser_shot:new O(Ce+"laser_shot",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.3,.3,.75,1.2),laser_reload:new O(Ce+"weapon_laser_reload",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.4,.4,1,1.1),tesla_shot:new O(Ce+"tesla_shot",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.6,.6,1.1,1.2),tesla_impact:new O(Ce+"tesla_impact",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.6,.7,.9,1.1),tesla_reload:new O(Ce+"weapon_tesla_reload",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.4,.4,1,1.1),healing_pulse:new O(Ce+"healing_pulse",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.2,.2,1.4,1.6),explosion_1:new O(Ce+"explosion_1",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.6,.8,.6,.8),explosion_2:new O(Ce+"explosion_2",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.6,.8,.9,1.2),explosion_3:new O(Ce+"explosion_3",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.7,1,.6,1.3),explosion_3_crate:new O(Ce+"explosion_3",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!1),1,1.5,1,1.4),projectile_impact:new O(Ce+"projectile_impact",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1,1.1,.7,1.5),projectile_groundhit:new O(Ce+"projectile_groundhit",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1.1,1.2,.75,1.1),airdrop_parashoot_open:new O(Ce+"airdrop_parashoot_open",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1,1.2,.75,1.1),airdrop_engine:new O(Ce+"airdrop_engine",["webm","mp3"],[Dd.Audio.Groups.Game],(!0),(!0),1.1,1.2,.75,1.1),airstrafe_engine:new O(Ce+"airstrafe_engine",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.8,.8,.85,1.1),airstrafe_fire:new O(Ce+"airstrafe_fire",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.6,.7,.95,1.15),mine_activate:new O(Ce+"mine_activate",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.5,.5,1,1.1),mine_explode:new O(Ce+"mine_explode",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.5,.7,.8,1.2),mine_place:new O(Ce+"mine_place",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1.5,1.5,.8,1.3),rapidfire_activate:new O(Ce+"rapidfire_activate",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.9,.9,.9,1.1),shield_activate:new O(Ce+"shield_activate",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.9,1,.7,.85),shield_absorb:new O(Ce+"shield_absorb",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1,1.1,1.05,1.65),forcefield_absorb:new O(Ce+"shield_absorb",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1,1,.75,.85),vacuum:new O(Ce+"vacuum",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1,1,1.1,1.3),stomp:new O(Ce+"stomp",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1,1,1.05,1.15),teleport:new O(Ce+"teleport",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.5,.5,1.1,1.3),drone_start:new O(Ce+"ability_drone_start",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.25,.3,1,1.3),drone_loop:new O(Ce+"ability_drone_loop",["webm","mp3"],[Dd.Audio.Groups.Game],(!0),(!0),.25,.3,1,1.3),music_game_end_winning:new O(Ce+"music_game_end_winning",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1,1,1,1),music_game_end_losing:new O(Ce+"music_game_end_losing",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1,1,1,1),kingdm_throne:new O(Ce+"kingdm_throne",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1,1,1,1),kingdm_dethrone:new O(Ce+"kingdm_dethrone",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),1,1,1,1),streak_02_1:new O(Ke+"streak_02_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_02_2:new O(Ke+"streak_02_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_03_1:new O(Ke+"streak_03_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_03_2:new O(Ke+"streak_03_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_04_1:new O(Ke+"streak_04_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_04_2:new O(Ke+"streak_04_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_05_1:new O(Ke+"streak_05_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_05_2:new O(Ke+"streak_05_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_06_1:new O(Ke+"streak_06_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_06_2:new O(Ke+"streak_06_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_07_1:new O(Ke+"streak_07_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_07_2:new O(Ke+"streak_07_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_08_1:new O(Ke+"streak_08_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_08_2:new O(Ke+"streak_08_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_09_1:new O(Ke+"streak_09_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_09_2:new O(Ke+"streak_09_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_10_1:new O(Ke+"streak_10_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_10_2:new O(Ke+"streak_10_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,Ie,Je,1),streak_11_1:new O(Ke+"streak_11_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,.75,Ie,1),streak_11_2:new O(Ke+"streak_11_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),He,He,.75,Ie,1),cmd_noice:new O(Fe+"noice",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!0),(!0),De,De,Ee,Ee,1),cmd_loc_alpha_1:new O(Fe+"location_alpha_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_alpha_2:new O(Fe+"location_alpha_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_bravo_1:new O(Fe+"location_bravo_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_bravo_2:new O(Fe+"location_bravo_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_charlie_1:new O(Fe+"location_charlie_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_charlie_2:new O(Fe+"location_charlie_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_delta_1:new O(Fe+"location_delta_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_delta_2:new O(Fe+"location_delta_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_echo_1:new O(Fe+"location_echo_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_echo_2:new O(Fe+"location_echo_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_foxtrot_1:new O(Fe+"location_foxtrot_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_foxtrot_2:new O(Fe+"location_foxtrot_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_tense_alpha_1:new O(Fe+"location_tense_alpha_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_tense_alpha_2:new O(Fe+"location_tense_alpha_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_tense_bravo_1:new O(Fe+"location_tense_bravo_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_tense_bravo_2:new O(Fe+"location_tense_bravo_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_tense_charlie_1:new O(Fe+"location_tense_charlie_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_tense_charlie_2:new O(Fe+"location_tense_charlie_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_tense_delta_1:new O(Fe+"location_tense_delta_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_tense_delta_2:new O(Fe+"location_tense_delta_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_tense_echo_1:new O(Fe+"location_tense_echo_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_tense_echo_2:new O(Fe+"location_tense_echo_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_tense_foxtrot_1:new O(Fe+"location_tense_foxtrot_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_tense_foxtrot_2:new O(Fe+"location_tense_foxtrot_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_calm_alpha_1:new O(Fe+"location_calm_alpha_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_calm_alpha_2:new O(Fe+"location_calm_alpha_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_calm_bravo_1:new O(Fe+"location_calm_bravo_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_calm_bravo_2:new O(Fe+"location_calm_bravo_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_calm_charlie_1:new O(Fe+"location_calm_charlie_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_calm_charlie_2:new O(Fe+"location_calm_charlie_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_calm_delta_1:new O(Fe+"location_calm_delta_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_calm_delta_2:new O(Fe+"location_calm_delta_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_calm_echo_1:new O(Fe+"location_calm_echo_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_calm_echo_2:new O(Fe+"location_calm_echo_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_calm_foxtrot_1:new O(Fe+"location_calm_foxtrot_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_loc_calm_foxtrot_2:new O(Fe+"location_calm_foxtrot_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_objective_1:new O(Fe+"objective_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_objective_2:new O(Fe+"objective_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_objective_3:new O(Fe+"objective_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_objective_4:new O(Fe+"objective_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_objective_5:new O(Fe+"objective_5",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_objective_6:new O(Fe+"objective_6",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_negative_1:new O(Fe+"negative_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_negative_2:new O(Fe+"negative_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_negative_3:new O(Fe+"negative_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_negative_4:new O(Fe+"negative_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_negative_5:new O(Fe+"negative_5",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_negative_6:new O(Fe+"negative_6",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_negative_7:new O(Fe+"negative_7",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_negative_8:new O(Fe+"negative_8",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_concern_calm_1:new O(Fe+"concern_calm_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_concern_tense_1:new O(Fe+"concern_tense_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_positive_1:new O(Fe+"positive_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_positive_2:new O(Fe+"positive_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_positive_3:new O(Fe+"positive_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_team_america_1:new O(Fe+"team_america_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_team_america_2:new O(Fe+"team_america_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_team_america_3:new O(Fe+"team_america_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_team_america_4:new O(Fe+"team_america_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_team_america_5:new O(Fe+"team_america_5",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_team_america_6:new O(Fe+"team_america_6",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_team_independent_1:new O(Fe+"team_independent_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_team_independent_2:new O(Fe+"team_independent_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_team_independent_3:new O(Fe+"team_independent_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_team_independent_4:new O(Fe+"team_independent_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_team_soviet_1:new O(Fe+"team_soviet_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_team_soviet_2:new O(Fe+"team_soviet_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_ending_losing_1:new O(Fe+"game_ending_losing_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_ending_losing_2:new O(Fe+"game_ending_losing_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_ending_losing_3:new O(Fe+"game_ending_losing_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_ending_losing_4:new O(Fe+"game_ending_losing_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_ending_neutral_1:new O(Fe+"game_ending_neutral_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_ending_neutral_2:new O(Fe+"game_ending_neutral_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_ending_winning_1:new O(Fe+"game_ending_winning_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_ending_winning_2:new O(Fe+"game_ending_winning_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_ending_winning_3:new O(Fe+"game_ending_winning_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_ending_winning_4:new O(Fe+"game_ending_winning_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_start_1:new O(Fe+"game_start_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_start_2:new O(Fe+"game_start_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_start_3:new O(Fe+"game_start_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_start_4:new O(Fe+"game_start_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_start_5:new O(Fe+"game_start_5",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_start_6:new O(Fe+"game_start_6",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_start_7:new O(Fe+"game_start_7",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_won_1:new O(Fe+"game_won_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_won_2:new O(Fe+"game_won_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_won_3:new O(Fe+"game_won_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_won_4:new O(Fe+"game_won_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_won_5:new O(Fe+"game_won_5",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_won_6:new O(Fe+"game_won_6",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_losing_1:new O(Fe+"location_losing_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_losing_2:new O(Fe+"location_losing_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_losing_3:new O(Fe+"location_losing_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_losing_4:new O(Fe+"location_losing_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_losing_5:new O(Fe+"location_losing_5",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_losing_6:new O(Fe+"location_losing_6",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_losing_7:new O(Fe+"location_losing_7",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_losing_8:new O(Fe+"location_losing_8",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_attacking_1:new O(Fe+"location_attacking_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_attacking_2:new O(Fe+"location_attacking_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_attacking_3:new O(Fe+"location_attacking_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_attacking_4:new O(Fe+"location_attacking_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_attacking_5:new O(Fe+"location_attacking_5",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_attacking_6:new O(Fe+"location_attacking_6",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_attacking_7:new O(Fe+"location_attacking_7",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_attacking_8:new O(Fe+"location_attacking_8",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_attacking_9:new O(Fe+"location_attacking_9",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_lost_1:new O(Fe+"game_lost_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_lost_2:new O(Fe+"game_lost_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_lost_3:new O(Fe+"game_lost_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_lost_4:new O(Fe+"game_lost_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_lost_5:new O(Fe+"game_lost_5",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_lost_6:new O(Fe+"game_lost_6",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_lost_7:new O(Fe+"game_lost_7",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_game_lost_8:new O(Fe+"game_lost_8",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_lost_1:new O(Fe+"location_lost_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_lost_2:new O(Fe+"location_lost_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_lost_3:new O(Fe+"location_lost_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_lost_4:new O(Fe+"location_lost_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_lost_5:new O(Fe+"location_lost_5",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_lost_6:new O(Fe+"location_lost_6",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_lost_7:new O(Fe+"location_lost_7",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_lost_8:new O(Fe+"location_lost_8",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_lost_9:new O(Fe+"location_lost_9",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_lost_all_1:new O(Fe+"location_lost_all_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_lost_all_2:new O(Fe+"location_lost_all_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_lost_all_3:new O(Fe+"location_lost_all_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_lost_all_4:new O(Fe+"location_lost_all_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_taken_1:new O(Fe+"location_taken_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_taken_2:new O(Fe+"location_taken_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_taken_3:new O(Fe+"location_taken_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_taken_4:new O(Fe+"location_taken_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_taken_all_1:new O(Fe+"location_taken_all_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_taken_all_2:new O(Fe+"location_taken_all_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_taken_all_3:new O(Fe+"location_taken_all_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_taken_all_4:new O(Fe+"location_taken_all_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_taken_all_5:new O(Fe+"location_taken_all_5",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_taken_all_6:new O(Fe+"location_taken_all_6",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_enemy_taken_1:new O(Fe+"location_enemy_taken_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_enemy_taken_2:new O(Fe+"location_enemy_taken_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_enemy_taken_3:new O(Fe+"location_enemy_taken_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_enemy_taken_4:new O(Fe+"location_enemy_taken_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_enemy_taken_5:new O(Fe+"location_enemy_taken_5",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_taking_1:new O(Fe+"location_taking_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_taking_2:new O(Fe+"location_taking_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_taking_3:new O(Fe+"location_taking_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_enemy_taking_1:new O(Fe+"location_enemy_taking_1",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_enemy_taking_2:new O(Fe+"location_enemy_taking_2",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_enemy_taking_3:new O(Fe+"location_enemy_taking_3",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_enemy_taking_4:new O(Fe+"location_enemy_taking_4",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_enemy_taking_5:new O(Fe+"location_enemy_taking_5",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),cmd_location_enemy_taking_6:new O(Fe+"location_enemy_taking_6",["webm","mp3"],[Dd.Audio.Groups.Announcer],(!1),(!0),De,De,Ee,Ee,1),wall_impact_light_1:new O(Ge+"wall_impact_light_01",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.6,.7,.8,1.3,2),wall_impact_light_2:new O(Ge+"wall_impact_light_02",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.6,.7,.8,1.3,2),wall_impact_light_3:new O(Ge+"wall_impact_light_03",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.6,.7,.8,1.3,2),wall_impact_light_4:new O(Ge+"wall_impact_light_04",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.6,.7,.8,1.3,2),wall_impact_light_5:new O(Ge+"wall_impact_light_05",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.6,.7,.8,1.3,2),impact_light_1:new O(Ge+"impact_light_01",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.5,.5,.8,1.3,2),impact_light_2:new O(Ge+"impact_light_02",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.5,.5,.8,1.3,2),impact_light_3:new O(Ge+"impact_light_03",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.5,.5,.8,1.3,2),impact_light_4:new O(Ge+"impact_light_04",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.5,.5,.8,1.3,2),impact_light_5:new O(Ge+"impact_light_05",["webm","mp3"],[Dd.Audio.Groups.Game],(!1),(!0),.5,.5,.8,1.3,2),tank_engine_small:new O(Ce+"tank_engine_scout",["webm","mp3"],[Dd.Audio.Groups.Game],(!0),(!0),1,1,1.1,1),tank_engine_medium:new O(Ce+"tank_engine_1",["webm","mp3"],[Dd.Audio.Groups.MyTank],(!0),(!0),1,1,1,1,1),tank_engine_large:new O(Ce+"tank_engine_mammoth",["webm","mp3"],[Dd.Audio.Groups.Game],(!0),(!0),1,1,1,1),ui_gain_xp:new O(Le+"gain_xp",["webm","mp3"],[Dd.Audio.Groups.UI],(!1),(!0),1,1,.8,.9,3),ui_reward_impact:new O(Le+"reward_impact",["webm","mp3"],[Dd.Audio.Groups.UI],(!1),(!0),1.5,1.5,1,1.1,1),ui_level_up:new O(Le+"level_up",["webm","mp3"],[Dd.Audio.Groups.UI],(!1),(!0),.7,.7,1,1,1),
ui_level_up_2:new O(Le+"level_up_2",["webm","mp3"],[Dd.Audio.Groups.UI],(!1),(!0),.7,.7,1,1,1),ui_coins:new O(Le+"coins",["webm","mp3"],[Dd.Audio.Groups.UI],(!1),(!0),.5,.5,1,1.1,1),ui_crate_open:new O(Le+"crate_open",["webm","mp3"],[Dd.Audio.Groups.UI],(!1),(!1),1.5,1.5,.9,1.1,1),ui_crate_shake:new O(Le+"crate_shake",["webm","mp3"],[Dd.Audio.Groups.UI],(!1),(!1),1.5,1.5,.9,1.1,1),ui_crate_wosh:new O(Le+"crate_wosh",["webm","mp3"],[Dd.Audio.Groups.UI],(!1),(!1),.5,.5,.9,1.1,1)},Dd.Audio.Common={music:new P(Dd.Audio.Base.music,(!0)),kingdm_throne:new P(Dd.Audio.Base.kingdm_throne,(!0)),kingdm_dethrone:new P(Dd.Audio.Base.kingdm_dethrone,(!0)),music_game_end_winning:new P(Dd.Audio.Base.music_game_end_winning,(!0)),music_game_end_losing:new P(Dd.Audio.Base.music_game_end_losing,(!0)),explosion_1:new P(Dd.Audio.Base.explosion_1),explosion_2:new P(Dd.Audio.Base.explosion_2),explosion_3:new P(Dd.Audio.Base.explosion_3),explosion_3_crate:new P(Dd.Audio.Base.explosion_3_crate,(!0)),projectile_groundhit:new P(Dd.Audio.Base.projectile_groundhit),projectile_impact:new P(Dd.Audio.Base.projectile_impact),mine_place:new P(Dd.Audio.Base.mine_place),shield_activate:new P(Dd.Audio.Base.shield_activate),shield_absorb:new P(Dd.Audio.Base.shield_absorb),rapidfire_activate:new P(Dd.Audio.Base.rapidfire_activate),teleport:new P(Dd.Audio.Base.teleport),ui_gain_xp:new P(Dd.Audio.Base.ui_gain_xp),ui_reward_impact:new P(Dd.Audio.Base.ui_reward_impact),ui_level_up:new P(Dd.Audio.Base.ui_level_up),ui_level_up_2:new P(Dd.Audio.Base.ui_level_up_2),ui_coins:new P(Dd.Audio.Base.ui_coins),ui_crate_open:new P(Dd.Audio.Base.ui_crate_open),ui_crate_shake:new P(Dd.Audio.Base.ui_crate_shake),ui_crate_wosh:new P(Dd.Audio.Base.ui_crate_wosh),impact_light:{sounds:[new P(Dd.Audio.Base.impact_light_1),new P(Dd.Audio.Base.impact_light_2),new P(Dd.Audio.Base.impact_light_3),new P(Dd.Audio.Base.impact_light_4),new P(Dd.Audio.Base.impact_light_5)],Play:function(a,b){this.sounds[k.floor(k.random()*this.sounds.length)].Play(a,b)}},wall_impact_light:{sounds:[new P(Dd.Audio.Base.wall_impact_light_1),new P(Dd.Audio.Base.wall_impact_light_2),new P(Dd.Audio.Base.wall_impact_light_3),new P(Dd.Audio.Base.wall_impact_light_4),new P(Dd.Audio.Base.wall_impact_light_5)],Play:function(a,b){this.sounds[k.floor(k.random()*this.sounds.length)].Play(a,b)}}};var Me=function(a,b){for(var c=a,d=[],e=[],f=[],g=0;g<b.length;g++){var h=b[g];if(isNaN(h)){var i=h.split("%"),j=i[0],m=i[1];d[g]=j,f[g]=m&&!isNaN(m)?.01*p(m):null}else d[g]=h,f[g]=null}this.Play=function(a,b,f,g){for(var h=0;h<d.length;h++){var i=d[h];e[h]=null,"sound"===i?e[h]=c:"location"===i||"location_tense"===i||"location_calm"===i?e[h]=Dd.Commander[i][a?a:0]:"objective"===i||"negative"===i||"positive"===i||"concern_calm"===i||"concern_tense"===i?e[h]=Wb(Dd.Commander[i]):"team"===i&&(e[h]=Dd.Commander[i][b?b-1:0]),l.isArray(e[h])&&(e[h]=Wb(e[h]))}f?u(function(){n(g)},f):n(g)};var n=function(a){for(var b=0;b<=e.length;b++){var c=e[b];if(c&&null!==c&&!c.isLoaded())return void c.Preload(function(){n(a)})}o(0,a)},o=function(a,b){if(a>=d.length)return void("function"==typeof b&&b());var c=d[a];return isNaN(c)?null!==f[a]&&k.random()>f[a]?void o(a+1,b):void e[a].Play(void 0,void 0,function(){o(a+1,b)}):void u(function(){o(a+1,b)},c)}};Dd.Commander={location:[[new P(Dd.Audio.Base.cmd_loc_alpha_1,(!0)),new P(Dd.Audio.Base.cmd_loc_alpha_2,(!0))],[new P(Dd.Audio.Base.cmd_loc_bravo_1,(!0)),new P(Dd.Audio.Base.cmd_loc_bravo_2,(!0))],[new P(Dd.Audio.Base.cmd_loc_charlie_1,(!0)),new P(Dd.Audio.Base.cmd_loc_charlie_2,(!0))],[new P(Dd.Audio.Base.cmd_loc_calm_delta_1,(!0)),new P(Dd.Audio.Base.cmd_loc_calm_delta_2,(!0))],[new P(Dd.Audio.Base.cmd_loc_echo_1,(!0)),new P(Dd.Audio.Base.cmd_loc_echo_2,(!0))],[new P(Dd.Audio.Base.cmd_loc_foxtrot_1,(!0)),new P(Dd.Audio.Base.cmd_loc_foxtrot_2,(!0))]],location_tense:[[new P(Dd.Audio.Base.cmd_loc_tense_alpha_1,(!0)),new P(Dd.Audio.Base.cmd_loc_tense_alpha_2,(!0))],[new P(Dd.Audio.Base.cmd_loc_tense_bravo_1,(!0)),new P(Dd.Audio.Base.cmd_loc_tense_bravo_2,(!0))],[new P(Dd.Audio.Base.cmd_loc_tense_charlie_1,(!0)),new P(Dd.Audio.Base.cmd_loc_tense_charlie_2,(!0))],[new P(Dd.Audio.Base.cmd_loc_tense_delta_1,(!0)),new P(Dd.Audio.Base.cmd_loc_tense_delta_2,(!0))],[new P(Dd.Audio.Base.cmd_loc_tense_echo_1,(!0)),new P(Dd.Audio.Base.cmd_loc_tense_echo_2,(!0))],[new P(Dd.Audio.Base.cmd_loc_tense_foxtrot_1,(!0)),new P(Dd.Audio.Base.cmd_loc_tense_foxtrot_2,(!0))]],location_calm:[[new P(Dd.Audio.Base.cmd_loc_calm_alpha_1,(!0)),new P(Dd.Audio.Base.cmd_loc_calm_alpha_2,(!0))],[new P(Dd.Audio.Base.cmd_loc_calm_bravo_1,(!0)),new P(Dd.Audio.Base.cmd_loc_calm_bravo_2,(!0))],[new P(Dd.Audio.Base.cmd_loc_calm_charlie_1,(!0)),new P(Dd.Audio.Base.cmd_loc_calm_charlie_2,(!0))],[new P(Dd.Audio.Base.cmd_loc_calm_delta_1,(!0)),new P(Dd.Audio.Base.cmd_loc_calm_delta_2,(!0))],[new P(Dd.Audio.Base.cmd_loc_calm_echo_1,(!0)),new P(Dd.Audio.Base.cmd_loc_calm_echo_2,(!0))],[new P(Dd.Audio.Base.cmd_loc_calm_foxtrot_1,(!0)),new P(Dd.Audio.Base.cmd_loc_calm_foxtrot_2,(!0))]],negative:[new P(Dd.Audio.Base.cmd_negative_1,(!0)),new P(Dd.Audio.Base.cmd_negative_2,(!0)),new P(Dd.Audio.Base.cmd_negative_3,(!0)),new P(Dd.Audio.Base.cmd_negative_4,(!0)),new P(Dd.Audio.Base.cmd_negative_5,(!0)),new P(Dd.Audio.Base.cmd_negative_6,(!0)),new P(Dd.Audio.Base.cmd_negative_7,(!0)),new P(Dd.Audio.Base.cmd_negative_8,(!0))],positive:[new P(Dd.Audio.Base.cmd_positive_1,(!0)),new P(Dd.Audio.Base.cmd_positive_2,(!0)),new P(Dd.Audio.Base.cmd_positive_3,(!0))],concern_calm:[new P(Dd.Audio.Base.cmd_concern_calm_1,(!0))],concern_tense:[new P(Dd.Audio.Base.cmd_concern_tense_1,(!0))],objective:[new P(Dd.Audio.Base.cmd_objective_1,(!0)),new P(Dd.Audio.Base.cmd_objective_2,(!0)),new P(Dd.Audio.Base.cmd_objective_3,(!0)),new P(Dd.Audio.Base.cmd_objective_4,(!0)),new P(Dd.Audio.Base.cmd_objective_5,(!0)),new P(Dd.Audio.Base.cmd_objective_6,(!0))],team:[[new P(Dd.Audio.Base.cmd_team_america_1,(!0)),new P(Dd.Audio.Base.cmd_team_america_2,(!0)),new P(Dd.Audio.Base.cmd_team_america_3,(!0)),new P(Dd.Audio.Base.cmd_team_america_4,(!0)),new P(Dd.Audio.Base.cmd_team_america_5,(!0)),new P(Dd.Audio.Base.cmd_team_america_6,(!0))],[new P(Dd.Audio.Base.cmd_team_soviet_1,(!0)),new P(Dd.Audio.Base.cmd_team_soviet_2,(!0))],[new P(Dd.Audio.Base.cmd_team_independent_1,(!0)),new P(Dd.Audio.Base.cmd_team_independent_2,(!0)),new P(Dd.Audio.Base.cmd_team_independent_3,(!0)),new P(Dd.Audio.Base.cmd_team_independent_4,(!0))]],events:{game_start:[new Me(new P(Dd.Audio.Base.cmd_game_start_1,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_start_2,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_start_3,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_start_4,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_start_5,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_start_6,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_start_7,(!0)),["sound"])],game_won:[new Me(new P(Dd.Audio.Base.cmd_game_won_1,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_won_2,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_won_3,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_won_4,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_won_5,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_won_6,(!0)),["sound"])],game_lost:[new Me(new P(Dd.Audio.Base.cmd_game_lost_1,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_lost_2,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_lost_3,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_lost_4,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_lost_5,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_lost_6,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_lost_7,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_lost_8,(!0)),["sound"])],game_ending_losing:[new Me(new P(Dd.Audio.Base.cmd_game_ending_losing_1,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_ending_losing_2,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_ending_losing_4,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_ending_losing_3,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_ending_neutral_1,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_ending_neutral_2,(!0)),["sound"])],game_ending_winning:[new Me(new P(Dd.Audio.Base.cmd_game_ending_winning_1,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_ending_winning_2,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_ending_winning_4,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_ending_winning_3,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_ending_neutral_1,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_game_ending_neutral_2,(!0)),["sound"])],location_losing:[new Me(new P(Dd.Audio.Base.cmd_location_losing_1,(!0)),["sound","location_tense","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_losing_2,(!0)),["sound","location_tense","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_losing_3,(!0)),["location_tense","sound","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_losing_4,(!0)),["location_tense","sound","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_losing_5,(!0)),["sound","location_tense","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_losing_6,(!0)),["sound","location_tense","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_losing_7,(!0)),["objective%25","location","sound","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_losing_8,(!0)),["location_tense","sound","negative%50"])],location_lost:[new Me(new P(Dd.Audio.Base.cmd_location_lost_1,(!0)),["location","sound","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_lost_2,(!0)),["sound",8,"location","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_lost_3,(!0)),["objective%25","location","sound","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_lost_4,(!0)),["objective%25","location","sound","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_lost_5,(!0)),["location","sound","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_lost_6,(!0)),["location_tense","sound","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_lost_7,(!0)),["sound",10,"location","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_lost_8,(!0)),["sound","location","negative%30"]),new Me(new P(Dd.Audio.Base.cmd_location_lost_9,(!0)),["sound","location",300,"concern_calm%40"])],location_lost_all:[new Me(new P(Dd.Audio.Base.cmd_location_lost_all_1,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_location_lost_all_2,(!0)),["sound","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_lost_all_3,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_location_lost_all_4,(!0)),["sound","negative%50"])],location_taken:[new Me(new P(Dd.Audio.Base.cmd_location_taken_1,(!0)),["sound",10,"location","positive%50"]),new Me(new P(Dd.Audio.Base.cmd_location_taken_2,(!0)),["location_calm","sound","positive%50"]),new Me(new P(Dd.Audio.Base.cmd_location_taken_3,(!0)),["sound",8,"location","positive%50"]),new Me(new P(Dd.Audio.Base.cmd_location_taken_4,(!0)),["location_tense","sound","positive%50"])],location_taken_all:[new Me(new P(Dd.Audio.Base.cmd_location_taken_all_1,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_location_taken_all_2,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_location_taken_all_3,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_location_taken_all_4,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_location_taken_all_5,(!0)),["sound"]),new Me(new P(Dd.Audio.Base.cmd_location_taken_all_6,(!0)),["sound"])],location_taking:[new Me(new P(Dd.Audio.Base.cmd_location_taking_1,(!0)),["sound","location"]),new Me(new P(Dd.Audio.Base.cmd_location_taking_2,(!0)),["sound","location"]),new Me(new P(Dd.Audio.Base.cmd_location_taking_3,(!0)),["sound","location"])],location_attacking:[new Me(new P(Dd.Audio.Base.cmd_location_attacking_1,(!0)),["sound","location",200,"concern_calm%20"]),new Me(new P(Dd.Audio.Base.cmd_location_attacking_2,(!0)),["sound","location_tense",100,"concern_tense%20"]),new Me(new P(Dd.Audio.Base.cmd_location_attacking_3,(!0)),["sound","location_tense",100,"concern_tense%20"]),new Me(new P(Dd.Audio.Base.cmd_location_attacking_4,(!0)),["sound","location_tense"]),new Me(new P(Dd.Audio.Base.cmd_location_attacking_5,(!0)),["sound","location"]),new Me(new P(Dd.Audio.Base.cmd_location_attacking_6,(!0)),["sound","location_tense",100,"concern_tense%20"]),new Me(new P(Dd.Audio.Base.cmd_location_attacking_7,(!0)),["sound","location","concern_tense%50"]),new Me(new P(Dd.Audio.Base.cmd_location_attacking_8,(!0)),["sound","location_tense","concern_tense%20"]),new Me(new P(Dd.Audio.Base.cmd_location_attacking_9,(!0)),["sound","location_tense"])],location_enemy_taken:[new Me(new P(Dd.Audio.Base.cmd_location_enemy_taken_1,(!0)),["sound","location_calm","concern_calm%20"]),new Me(new P(Dd.Audio.Base.cmd_location_enemy_taken_2,(!0)),["sound","location_tense","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_enemy_taken_3,(!0)),["sound","location_tense","negative%50"]),new Me(new P(Dd.Audio.Base.cmd_location_enemy_taken_4,(!0)),["sound","location_calm","concern_calm%20"]),new Me(new P(Dd.Audio.Base.cmd_location_enemy_taken_5,(!0)),["sound","location_tense","negative%50"])],location_enemy_taking:[new Me(new P(Dd.Audio.Base.cmd_location_enemy_taking_1,(!0)),["sound","location_calm","negative%20"]),new Me(new P(Dd.Audio.Base.cmd_location_enemy_taking_2,(!0)),["sound","location_tense","negative%20"]),new Me(new P(Dd.Audio.Base.cmd_location_enemy_taking_3,(!0)),["sound","location","negative%20"]),new Me(new P(Dd.Audio.Base.cmd_location_enemy_taking_4,(!0)),["sound","location_tense","negative%20"]),new Me(new P(Dd.Audio.Base.cmd_location_enemy_taking_5,(!0)),["sound",15,"location"]),new Me(new P(Dd.Audio.Base.cmd_location_enemy_taking_6,(!0)),["sound",3,"location_tense","negative%20"])]},Noice:new P(Dd.Audio.Base.cmd_noice,(!0)),CommandNo:0,radioStopTimeout:void 0,Talking:!1,Play:function(a,b){var c=this.events[a];if(c){if(this.Talking)return!1;t(this.radioStopTimeout),this.radioStopTimeout=u(function(){Dd.Commander.Talking=!1,Dd.Commander.Noice.Stop()},6e3),this.Talking=!0,this.CommandNo++;var d=this.CommandNo;this.Noice.IsPlaying()||this.Noice.Play();return c[k.floor(k.random()*c.length)].Play(b,void 0,200*k.random(),function(){Dd.Commander.Talking=!1,Dd.Commander.NoiceTimeout=u(function(){Dd.Commander.CommandNo==d&&(t(Dd.Commander.radioStopTimeout),Dd.Commander.Noice.Stop())},75*k.random())}),!0}return!1}};Dd.Camera={mousePosition:new Oc(10,10),targetId:null,target:null,newTarget:!1,position:new Oc,audioCenter:new Oc,cullingArea:new H,seeAll:!1,setTarget:function(a){this.target=null,this.targetId=a,this.newTarget=!0},init:function(){var a=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";f(d).bind(a,function(a){var b=void 0!==a.originalEvent.wheelDelta?a.originalEvent.wheelDelta:a.originalEvent.detail*-60;if(pf.isOpen||Dd.ScoreBoard.open||pi.isOpen&&(!pi.isOpen||pi.isHover)||(b>=0?Dd.Camera.zoomIn():Dd.Camera.zoomOut()),a.ctrlKey)return a.preventDefault(),!1}),this.initialized=!0},zoomSetting:1,targetZoom:1,zoom:1,zoomIn:function(){this.zoomSetting>0&&(this.zoomSetting-=.1)},zoomOut:function(){this.zoomSetting<1&&(this.zoomSetting+=.1)},dirtyZoom:!1,uiZoom:1,longRangeClasses:[103,104,105,115,116],update:function(a){if(Dd.Level.loaded){var c=3200,d=1800;Dd.playerUnit&&this.longRangeClasses.indexOf(Dd.playerUnit.class.ID)!==-1&&(c*=1.25,d*=1.25);var e=Dd.width/k.min(c,Dd.Level.width),g=Dd.height/k.min(d,Dd.Level.height),h=k.max(e,g),i=Dd.width/1600,j=Dd.height/900,l=k.max(i,j),m=this.zoom;if(this.targetZoom=z(l,h,this.zoomSetting),this.zoom=z(this.zoom,this.targetZoom,3*a),m!==this.zoom){this.dirtyZoom=!0,this.uiZoom=k.max(.5,k.min(2,1/this.zoom)),k.abs(this.targetZoom-this.zoom)<5e-4&&(this.zoom=this.targetZoom),b.set(f("#announcements"),{scale:k.min(this.zoom,1)});var n=(this.zoom-m)/this.zoom;this.position.x+=this.position.x*n,this.position.y+=this.position.y*n}else this.dirtyZoom=!1;if(this.newTarget){var o=getGameObject(this.targetId);o&&(this.target=o),this.newTarget=!1}this.initialized||this.init();var p=Dd.width/2,q=Dd.height/2,r=Dd.Level.width*this.zoom,s=Dd.Level.height*this.zoom;this.target?(this.position.x=z(this.position.x,this.target.position.x*this.zoom,4/(this.zoomSetting+.5)*a),this.position.y=z(this.position.y,this.target.position.y*this.zoom,4/(this.zoomSetting+.5)*a),this.audioCenter.copy(this.target.position)):this.audioCenter.copy(this.position),this.position.x-p<=0?this.position.x=p:this.position.x+p>r&&(this.position.x=r-p),this.position.y-q<=0?this.position.y=q:this.position.y+q>s&&(this.position.y=s-q),this.seeAll?(this.cullingArea.left=0,this.cullingArea.right=1e7,this.cullingArea.top=0,this.cullingArea.bottom=1e7):(this.cullingArea.left=this.position.x/this.zoom-p/this.zoom,this.cullingArea.right=this.position.x/this.zoom+p/this.zoom,this.cullingArea.top=this.position.y/this.zoom-q/this.zoom,this.cullingArea.bottom=this.position.y/this.zoom+q/this.zoom),Dd.Scene.layers.position.x=-this.position.x+Dd.width/2,Dd.Scene.layers.position.y=-this.position.y+Dd.height/2,Dd.Scene.layers.scale.set(this.zoom),this.PreformLevelCulling()}},PreformLevelCulling:function(){for(var a=0;a<Dd.Level.gameObjects.length;a++){var b=Dd.Level.gameObjects[a];b.visible=!!this.AreaIntersect(b.cullingArea,this.cullingArea)}},SS:function(){this.cullingArea.left=0,this.cullingArea.right=1e7,this.cullingArea.top=0,this.cullingArea.bottom=1e7,this.PreformLevelCulling(),Dd.Scene.layers.position.x=0,Dd.Scene.layers.position.y=0,Dd.Scene.layers.scale.set(1),Dd.Scene.renderer.render(Dd.Scene.renderStage);var a=new Image;a.src=Dd.Scene.layers.RenderBase64(Dd.Scene.renderer,!0,Dd.Level.width,Dd.Level.height),d.open("").document.write(a.outerHTML)},AreaIntersect:function(a,b){return!(b.left>a.right||b.right<a.left||b.top>a.bottom||b.bottom<a.top)},tempArea:new H,isOnScreen:function(a,b,c){return this.tempArea.left=a.x-.5*b,this.tempArea.right=a.x+.5*b,this.tempArea.top=a.y-.5*c,this.tempArea.bottom=a.y+.5*c,this.AreaIntersect(this.tempArea,this.cullingArea)},globalPositionOf:function(b,c){return c||(c=new a.Point),c.x=b.x*this.zoom+Dd.Scene.layers.position.x,c.y=b.y*this.zoom+Dd.Scene.layers.position.y,c}},Dd.Connection={gameToken:"",gameTokenExpiration:0,tokenExpired:function(){return n.now()>this.gameTokenExpiration||!this.gameToken.length},serverVersion:0,server:PE.Server.connection,prefServers:{},initialize:function(){if(!this.initialized){var a=this.server;a.on("ChangeServer",function(a){d.prefServers=Dd.Connection.prefServers=a,Dd.Connection.Connect(Dd.currentGM)}),a.on("PreloadLevel",function(a,b){Dd.PreloadLevel(a,b)}),a.on("UpdatePlayerXP",function(a){Dd.XPSystem.SetExperience(a)}),a.on("UpdateWallet",function(a,b){pf.wallet.UpdateBalance(a,b)}),a.on("PromptPassword",function(a,b,c){tc.open(a,b,c,!0)}),a.on("Reconnect",function(a){a&&a.length&&qf.OK(a,!1),Dd.Connection.Connect(Dd.currentGM)}),a.on("ReAuthenticate",function(){Zh.Authenticate()}),a.on("LeaveGame",function(){Dd.ClearGame()}),a.on("LeaveWarn",function(){yc.open("Leave Game?","Leaving this game might record as a lost game!","Leave","Cancel",!1,!0,function(){Dd.Connection.invoke("LeaveGame")})}),a.on("ChangeGame",function(){Dd.ClearGame(!0)}),a.on("Belt",function(a,b,c){Dd.UI.PowerUpBelt.updateQty(a,b,c)}),a.on("ClearBelt",function(){Dd.UI.PowerUpBelt.ClearUI()}),a.on("DrawLine",function(a,b,c,d){Dd.started&&Dd.Scene.drawLine(a,b,c,d)}),a.on("ConsoleLog",function(a){}),a.on("DrawCircle",function(a,b,c,d){Dd.started&&Dd.Scene.drawCircle(a,b,c,d)}),a.on("DrawIntRect",function(a,b,c,d,e,f){Dd.started&&Dd.Scene.drawIntRect(a,b,c,d,e,f)}),a.on("DrawNavGrid",function(a){Dd.started&&Dd.Scene.drawNavGrid(a)}),a.on("DrawWP",function(a){Dd.started&&Dd.Scene.drawWP(a)}),a.on("DrawWPCheck",function(a,b){Dd.started&&Dd.Scene.drawWPCheck(a,b)}),a.on("DrawRect",function(a,b,c,d,e,f){Dd.started&&Dd.Scene.drawRect(a,b,c,d,e,f)}),a.on("UpdateTankClass",function(a,b){var c=JSON.parse(b);tankClass[a]=c,Dd.Debug&&Dd.Debug.TankTester.class&&Dd.Debug.TankTester.class.ID==a&&Dd.Debug.TankTester.init(a);for(var d in Dd.Players){var e=Dd.Players[d];e.unit&&e.unit.tank&&e.unit.tank.refresh()}}),a.on("UpdateWeapon",function(a,b){var c=JSON.parse(b);weapon[a]=c,Dd.Debug&&Dd.Debug.WeaponTester.weaponId==a&&Dd.Debug.WeaponTester.init(a)}),a.on("ChatMsg",function(a,b,c){pi.RecieveMessage(a,b,c)}),a.on("SysErr",function(a){pi.systemError(a)}),a.on("SysMsg",function(a){pi.systemInfo(a)}),a.on("SignInNotification",function(a){uc.open(a)}),a.on("ServerNotifyMsg",function(a,b,c){nc.open(a,b,c),u(function(){pf.open(!1)},1500)}),this.initialized=!0}},InitializeUser:function(a,b,c){return Zh.authenticated&&Dd.Connection.tokenExpired()?void f.ajax({url:"/Account/RefreshGameToken"}).done(function(d){var e=d[0],f=d[1];Dd.Connection.gameToken=e,Dd.Connection.gameTokenExpiration=n.now()+f,Dd.Connection.InitializeUser(a,b,c)}):(c||(c=""),d["demoLevel"]?(Dd.Connection.invoke("InitDemo",Dd.Connection.gameToken,d["demoMode"],q(rf.UserSettings["MaxTankTier"]),d["demoLevel"],c),void zf(d["demoMode"])):(null!==Dd.currentGM&&void 0!==Dd.currentGM||(Dd.currentGM=Dd.GameModes.Default),Dd.Connection.invoke("Init",Dd.Connection.gameToken,Dd.currentGM,q(rf.UserSettings["MaxTankTier"]),ki.getMemberIdList(),a,c),void this.autoStart(a,b,0)))},autoStart:function(a,b,c){a&&c<50&&u(function(){a===PE.Server.currentRoom?pf.close(!0):Dd.Connection.autoStart(a,b,c++)},100)},currentServerUrl:null,ConnectServer:function(a,b,c,e,f){this.initialize(),Dd.ClearGame();var g=a.split(":");this.server.connect((d.SSL?"wss://":"ws://")+g[0]+":"+(d.SSL?g[1]:"2095"),function(){Dd.Connection.currentServerUrl=a,Dd.Connection.InitializeUser(b,c,e),"function"==typeof f&&f()})},Connect:function(a,b){if(b)return void u(function(){Dd.Connection.Connect(a)},b);if(void 0!==a&&(Dd.currentGM=a),Dd.developer)return void Dd.Connection.ConnectServer(d.location.hostname+":2096");var c=rf.UserSettings["Region"];if(null!=c){var e=this.prefServers[c["shortName"]];if(e)return void Dd.Connection.ConnectServer(e)}Dd.Region.AutoDetect(function(){var a=Dd.Region.bestServer;a?Dd.Connection.ConnectServer(a):qf.OK("Failed to connect to a server, please reload your browser and try again!")})},disconnect:function(){this.server.disconnect(),Dd.ClearGame()},invoke:function(){return this.server.invoke.apply(this.server,arguments)}},Dd.Crosshair={Group:void 0,Center:void 0,Left:void 0,Right:void 0,Distance:50,ActivePowerup:void 0,Position:new Oc,pressed:!1,clickPosition:new Oc,aimStartPosition:new Oc,aimEndPosition:new Oc,aimAngle:0,set:function(){return this.Center=a.Sprite.fromFrame("Helpers/Crosshair/center.png"),this.Left=a.Sprite.fromFrame("Helpers/Crosshair/left.png"),this.Right=a.Sprite.fromFrame("Helpers/Crosshair/right.png"),this.Center.anchor.set(.5),this.Left.anchor.set(.5),this.Right.anchor.set(.5),this.Group=new a.Container,this.Group.addChild(this.Center),this.Group.addChild(this.Left),this.Group.addChild(this.Right),Dd.Scene.layerSkyHelpers.addChild(this.Group),this.updateColor(),this},updateColor:function(){this.Center&&(this.Center.tint=this.Left.tint=this.Right.tint=rf.UserSettings["ColorCrosshair"].replace("#","0x"))},update:function(a){if(Dd.joined&&Dd.playerUnit&&!isNaN(Dd.Scene.mousePosition.x)){var b=Dd.playerUnit.gunPosition.x,c=Dd.playerUnit.gunPosition.y,d=Dd.Scene.mousePosition.x,e=Dd.Scene.mousePosition.y,f=this.Distance/6,g=z(500,1500,1);f<40&&(f=40),f>120&&(f=120),this.Left.position.x=-f,this.Right.position.x=f;if(this.Distance=p(z(this.Distance,Oc.Distance(b,c,d,e),3*a)),this.Distance<125?this.Distance=125:this.Distance>g&&(this.Distance=g),Oc.Forward(Dd.playerUnit.gunRotation,this.Distance,this.Position),this.Group.position.x=b+this.Position.x,this.Group.position.y=c+this.Position.y,this.Group.rotation=Dd.playerUnit.gunRotation-1.57,this.ActivePowerup&&this.ActivePowerup.crosshair&&(this.ActivePowerup.abilityType!=Pe.Ground&&this.ActivePowerup.abilityType!=Pe.GroundConstruction||this.ActivePowerup.crosshair.update(Dd.Scene.mousePosition.x,Dd.Scene.mousePosition.y,0),this.ActivePowerup.abilityType==Pe.GroundAngle)){var h=0;this.pressed?(h=this.clickPosition.angleTowards(Dd.playerUnit.gunPosition),Oc.Forward(h,25,this.aimStartPosition),this.aimStartPosition.x+=this.clickPosition.x,this.aimStartPosition.y+=this.clickPosition.y):(h=Dd.Scene.mousePosition.angleTowards(Dd.playerUnit.gunPosition),Oc.Forward(h,25,this.aimStartPosition),this.aimStartPosition.x+=Dd.Scene.mousePosition.x,this.aimStartPosition.y+=Dd.Scene.mousePosition.y),this.aimEndPosition.copy(Dd.Scene.mousePosition),this.aimAngle=this.aimStartPosition.angleTowards(this.aimEndPosition),this.ActivePowerup.crosshair.update(this.aimStartPosition.x,this.aimStartPosition.y,this.aimAngle)}}},leftDown:function(){return void 0==this.ActivePowerup?void(PE.InputManager.Fire1=!0):(this.pressed=!0,this.clickPosition.copy(Dd.Scene.mousePosition),this.ActivePowerup.abilityType==Pe.Aim?(Dd.UI.PowerUpBelt.use(this.ActivePowerup.id,0,0,0),void(this.ActivePowerup=void 0)):void 0)},leftUp:function(){if(PE.InputManager.Fire1=!1,this.pressed&&(this.pressed=!1,void 0!=this.ActivePowerup))return this.ActivePowerup.abilityType==Pe.Ground?(Dd.UI.PowerUpBelt.use(this.ActivePowerup.id,Dd.Scene.mousePosition.x,Dd.Scene.mousePosition.y,0),void(this.ActivePowerup=void 0)):this.ActivePowerup.abilityType==Pe.GroundConstruction?(Dd.UI.PowerUpBelt.use(this.ActivePowerup.id,k.round(this.ActivePowerup.crosshair.distance)),void(this.ActivePowerup=void 0)):this.ActivePowerup.abilityType==Pe.GroundAngle?(Dd.UI.PowerUpBelt.use(this.ActivePowerup.id,this.aimStartPosition.x,this.aimStartPosition.y,this.aimAngle),void(this.ActivePowerup=void 0)):void 0},clearPowerup:function(){return void 0!=this.ActivePowerup&&(Dd.UI.PowerUpBelt.resetFocus(),!0)},rightDown:function(){this.clearPowerup()||(PE.InputManager.Fire2=!0),this.pressed=!1},rightUp:function(){PE.InputManager.Fire2=!1},hide:function(){this.Group.visible=!1},show:function(){this.Group.visible=!0}},Dd.FilterManager={Add:function(a){var b=Dd.Scene.gameStage.filters;null==b&&(b=[]),b.push(a),Dd.Scene.gameStage.filters=b},Remove:function(a){var b=Dd.Scene.gameStage.filters;if(null!=b){var c=b.indexOf(a);c!=-1&&(b.splice(c,1),Dd.Scene.gameStage.filters=b)}}},Dd.Gameloop={time:-1,ms:0,delta:0,fps_frames:0,fps_time:0,draws_high:0,draws_low:1e3,showFPS:!1,visible:!0,fpsUpdateInterval:1,fpsContainer:r.getElementById("fps"),drawContainer:r.getElementById("draws"),drawhighContainer:r.getElementById("draws_high"),Start:function(){if(PE.GameLoop.autoUpdate=!1,a.UI.Ticker.disabled=!0,!this.started){c.lagSmoothing(500,32),c.ticker.addEventListener("tick",function(a){PE.GameLoop.update(n.now()),Dd.Gameloop.Animate()}),this.time=c.ticker.time;var b=function(){var a,b,c={hidden:"visibilitychange",webkitHidden:"webkitvisibilitychange",mozHidden:"mozvisibilitychange",msHidden:"msvisibilitychange"};for(a in c)if(a in r){b=c[a];break}return function(c){return c&&r.addEventListener(b,c),!r[a]}}();b(function(){b()?(c.lagSmoothing(500,32),rf.UserSettings["VolumeMute"]||g.volume(rf.UserSettings["VolumeMaster"]),c.ticker.useRAF(!0),c.ticker.fps(rf.UserSettings["MaxFPS"]),Dd.Gameloop.visible=!0):(c.lagSmoothing(0,0),g.volume(0),c.ticker.useRAF(!1),c.ticker.fps(1),Dd.Gameloop.visible=!1)})}},hasDrawCount:!1,LoadFPSSettings:function(){c.ticker.useRAF(!0),c.ticker.fps(rf.UserSettings["MaxFPS"]),this.showFPS=rf.UserSettings["ShowFPS"],this.hasDrawCount="undefined"!=typeof DRAWCOUNT,f("#draw_counter").toggle(this.hasDrawCount&&rf.UserSettings["ShowFPS"]),f("#fps_counter").toggle(rf.UserSettings["ShowFPS"])},_speed:1,Speed:function(a){return!a||isNaN(a)?this._speed:(this._speed=a,PE.Settings.SpeedMultiplier=a,void c.globalTimeScale(a))},Animate:function(b){PE.Settings.SpeedMultiplier!==this._speed&&this.Speed(PE.Settings.SpeedMultiplier),this.delta=(c.ticker.time-this.time)*this._speed,this.time=c.ticker.time,this.ms=1e3*this.delta,a.UI.Ticker.update(1e3*this.time),this.showFPS&&(this.fps_frames++,this.fps_time+=this.delta,this.hasDrawCount&&(DRAWCOUNT>this.draws_high?this.draws_high=DRAWCOUNT:DRAWCOUNT<this.draws_low&&(this.draws_low=DRAWCOUNT),DRAWCOUNT=0),this.fps_time>=this.fpsUpdateInterval*this._speed&&(this.fpsContainer.innerHTML=q(this.fps_frames/this.fpsUpdateInterval),this.fps_frames=0,this.fps_time-=this.fpsUpdateInterval*this._speed,this.drawhighContainer.innerHTML=this.draws_high,this.draws_high=0,this.drawContainer.innerHTML=this.draws_low,this.draws_low=1e3)),Dd.started&&(Dd.Scene.layers.worldTransform.applyInverse(Dd.Camera.mousePosition,Dd.Scene.mousePosition),Dd.Camera.update(this.delta),Dd.Crosshair.update(this.delta),Dd.UI.PowerUpBelt.Update(this.delta),Dd.Effects.VFXHandler.UpdateEffects(this.delta),Dd.UI.GuidingArrowController.Update(this.delta)),this.visible&&(Dd.Camera.dirtyZoom&&Dd.Scene.layerDisplacement.updateDisplacementScale(150*Dd.Camera.zoom),Dd.Scene.renderer.render(Dd.Scene.renderStage))}},Dd.InputManager={OverrideAbilityKeys:[],UpdateOverrideKeys:function(){this.OverrideAbilityKeys=[];for(var a in rf.UserSettings)rf.UserSettings.hasOwnProperty(a)&&a.indexOf("Input_Ability_")>-1&&rf.UserSettings[a]&&this.OverrideAbilityKeys.push(a)},init:function(){PE.InputManager.registerCustomInput("Drive",!0,0,1),PE.InputManager.registerCustomInput("DriveAngle",!1),PE.InputManager.registerCustomInput("TargetGunRotation",!1),PE.InputManager.registerCustomInput("WeaponReload",!0,0,1),Xc.InputManager.addKeyDownListener(null,100,function(a){if(pf.isOpen||pi.isOpen)return!1;if(a.which===rf.UserSettings["Input_Left"]||a.which===rf.UserSettings["Input_Left2"])return Dd.InputManager.Axis.left||(Dd.InputManager.Axis.left=!0,Dd.InputManager.SendInput()),!0;if(a.which===rf.UserSettings["Input_Right"]||a.which===rf.UserSettings["Input_Right2"])return Dd.InputManager.Axis.right||(Dd.InputManager.Axis.right=!0,Dd.InputManager.SendInput()),!0;if(a.which===rf.UserSettings["Input_Backward"]||a.which===rf.UserSettings["Input_Backward2"])return Dd.InputManager.Axis.down||(Dd.InputManager.Axis.down=!0,Dd.InputManager.SendInput()),!0;if(a.which===rf.UserSettings["Input_Forward"]||a.which===rf.UserSettings["Input_Forward2"])return Dd.InputManager.Axis.up||(Dd.InputManager.Axis.up=!0,Dd.InputManager.SendInput()),!0;if(a.which===rf.UserSettings["Input_EnterEject"])return Dd.InputManager.EnterEject||(Dd.InputManager.EnterEject=!0,PE.InputManager.Action2=!0),!0;if(a.which===rf.UserSettings["Input_WeaponReload"])return Dd.InputManager.WeaponReload||(Dd.InputManager.WeaponReload=!0,PE.InputManager.Custom("WeaponReload",1)),!0;if(a.which===rf.UserSettings["Input_AbilitySlot1"])return Dd.UI.PowerUpBelt.activate(0);if(a.which===rf.UserSettings["Input_AbilitySlot2"])return Dd.UI.PowerUpBelt.activate(1);if(a.which===rf.UserSettings["Input_AbilitySlot3"])return Dd.UI.PowerUpBelt.activate(2);if(a.which===rf.UserSettings["Input_AbilitySlot4"])return Dd.UI.PowerUpBelt.activate(3);if(a.which===rf.UserSettings["Input_AbilitySlot5"])return Dd.UI.PowerUpBelt.activate(4);if(a.which===rf.UserSettings["Input_AbilitySlot6"])return Dd.UI.PowerUpBelt.activate(5);if(Dd.InputManager.OverrideAbilityKeys.length)for(var b=0;b<Dd.InputManager.OverrideAbilityKeys.length;b++)if(a.which===rf.UserSettings[Dd.InputManager.OverrideAbilityKeys[b]])return Dd.UI.PowerUpBelt.activateAbilityID(q(Dd.InputManager.OverrideAbilityKeys[b].replace("Input_Ability_","")));return!1}),Xc.InputManager.addKeyUpListener(null,10,function(a){return!pf.isOpen&&!pi.isOpen&&(a.which===rf.UserSettings["Input_Left"]||a.which===rf.UserSettings["Input_Left2"]?(Dd.InputManager.Axis.left&&(Dd.InputManager.Axis.left=!1,Dd.InputManager.SendInput()),!0):a.which===rf.UserSettings["Input_Right"]||a.which===rf.UserSettings["Input_Right2"]?(Dd.InputManager.Axis.right&&(Dd.InputManager.Axis.right=!1,Dd.InputManager.SendInput()),!0):a.which===rf.UserSettings["Input_Backward"]||a.which===rf.UserSettings["Input_Backward2"]?(Dd.InputManager.Axis.down&&(Dd.InputManager.Axis.down=!1,Dd.InputManager.SendInput()),
!0):a.which===rf.UserSettings["Input_Forward"]||a.which===rf.UserSettings["Input_Forward2"]?(Dd.InputManager.Axis.up&&(Dd.InputManager.Axis.up=!1,Dd.InputManager.SendInput()),!0):a.which===rf.UserSettings["Input_EnterEject"]?(Dd.InputManager.EnterEject&&(Dd.InputManager.EnterEject=!1,PE.InputManager.Action2=!1),!0):a.which===rf.UserSettings["Input_WeaponReload"]&&(Dd.InputManager.WeaponReload&&(Dd.InputManager.WeaponReload=!1,PE.InputManager.Custom("WeaponReload",0)),!0))}),f(r).bind("mousedown",function(a){pf.isOpen||(1===a.which?Dd.Crosshair.leftDown():3===a.which&&(Dd.Crosshair.rightDown(),a.preventDefault()))}).bind("mouseup",function(a){pf.isOpen||(1===a.which?Dd.Crosshair.leftUp():3===a.which&&Dd.Crosshair.rightUp(),a.preventDefault())}).bind("contextmenu",function(a){a.preventDefault()}),this.SendInput()},Axis:{left:!1,right:!1,up:!1,down:!1,update:function(){return this.axis.x=0,this.axis.y=0,this.left&&(this.axis.x-=1),this.right&&(this.axis.x+=1),this.down&&(this.axis.y-=1),this.up&&(this.axis.y+=1),this.axis},axis:{x:0,y:0}},Shoot:!1,ShootSecondary:!1,EnterEject:!1,timeout:void 0,lastDrive:!1,lastDriveAngle:0,SendInput:function(){t(this.timeout),this.timeout=u(function(){Dd.InputManager.SendInput()},100);var a=q(k.max(Dd.width,Dd.width/Dd.Camera.zoom));a!==this.LastResX&&(PE.InputManager.ResolutionX=a,this.LastResX=a);var b=q(k.max(Dd.height,Dd.height/Dd.Camera.zoom));if(b!==this.LastResY&&(PE.InputManager.ResolutionY=b,this.LastResY=b),Dd.Connection.server.connected&&Dd.started&&Dd.playerUnit){this.Axis.update();if(Dd.isAlive&&Dd.joined&&!pf.isOpen){var c=this.Axis.axis.y,d=this.Axis.axis.x;if(rf.UserSettings["AdvancedControls"])c!==this.LastAxisY&&(PE.InputManager.AxisY=c,this.LastAxisY=c),rf.UserSettings["SimulateCarControls"]&&c===-1&&(d*=-1),d!==this.LastAxisX&&(PE.InputManager.AxisX=d,this.LastAxisX=d);else{var e=0!==d||0!==c?1:0;e!==this.lastDrive&&(PE.InputManager.Custom("Drive",e?1:0),this.lastDrive=e);var f=k.round(100*k.atan2(-c,d));f!==this.lastDriveAngle&&(PE.InputManager.Custom("DriveAngle",f),this.lastDriveAngle=f)}var g=k.round(100*k.atan2(Dd.Scene.mousePosition.y-Dd.playerUnit.gunPosition.y,Dd.Scene.mousePosition.x-Dd.playerUnit.gunPosition.x));g!==this.LastGunAngle&&(PE.InputManager.Custom("TargetGunRotation",g),this.LastGunAngle=g)}}},Clear:function(){this.LastAxisX=this.LastAxisY=this.LastGunAngle=this.LastShoot=this.LastResX=this.LastResY=this.lastInput=void 0}},Dd.KillLog={cachedObjects:[],activeObjects:[],uiContainer:f("#KillLog"),smoothAnimation:void 0,Log:function(a,b,d){var e;this.activeObjects.length>=15?(e=this.activeObjects[0],this.activeObjects.splice(0,1)):(e=this.cachedObjects[0],e?this.cachedObjects.splice(0,1):e=this.Create()),this.activeObjects.push(e),this.uiContainer.prepend(e.container),e.killerText.text(a?a.name:"Environment"),e.typeText.text(b!=a?"Killed":"commited suicide!"),e.victimText.text(b!=a?b.name:""),e.gotoAndPlay(0),c.set(this.uiContainer,{top:"-=24"}),c.to(this.uiContainer,.5,{top:10})},Create:function(){var a=f("<div class='Kill'>"),b=f("<span class='Killer'>"),c=f("<span class='Type'>"),d=f("<span class='Victim'>"),e=new j({onComplete:function(){Dd.KillLog.cachedObjects.push(e),Dd.KillLog.activeObjects.splice(Dd.KillLog.activeObjects.indexOf(e),1)}});return e.to(a,1.5,{alpha:0},5),e.container=a,e.killerText=b,e.typeText=c,e.victimText=d,a.append(b).append(c).append(d),e}},Dd.KillStreak={Me:void 0,StreakCooldown:10,StreakCheckTimeoutMS:500,KillAnnounceTimeoutMS:900,KillAnimationCache:[],PlayerStreakOnYou:{},PlayerStreakOnHim:{},CurrentStreak:0,LastKillTime:0,KillAnnouncmentQue:[],KillStreakAnimation:{},KillStreakText:{2:"Double Kill!",3:"Triple Kill!",4:"Multi Kill!",5:"Killing Spree!",6:"Ultra Kill!",7:"MEGA KILL!",8:"MASSACRE!",9:"RAMPAGE!",10:"INVINCIBLE!",11:"UNSTOPPABLE!"},KillStreaksSoundObjects:{2:[new P(Dd.Audio.Base.streak_02_1,(!0)),new P(Dd.Audio.Base.streak_02_2,(!0))],3:[new P(Dd.Audio.Base.streak_03_1,(!0)),new P(Dd.Audio.Base.streak_03_2,(!0))],4:[new P(Dd.Audio.Base.streak_04_1,(!0)),new P(Dd.Audio.Base.streak_04_2,(!0))],5:[new P(Dd.Audio.Base.streak_05_1,(!0)),new P(Dd.Audio.Base.streak_05_2,(!0))],6:[new P(Dd.Audio.Base.streak_06_1,(!0)),new P(Dd.Audio.Base.streak_06_2,(!0))],7:[new P(Dd.Audio.Base.streak_07_1,(!0)),new P(Dd.Audio.Base.streak_07_2,(!0))],8:[new P(Dd.Audio.Base.streak_08_1,(!0)),new P(Dd.Audio.Base.streak_08_2,(!0))],9:[new P(Dd.Audio.Base.streak_09_1,(!0)),new P(Dd.Audio.Base.streak_09_2,(!0))],10:[new P(Dd.Audio.Base.streak_10_1,(!0)),new P(Dd.Audio.Base.streak_10_2,(!0))],11:[new P(Dd.Audio.Base.streak_11_1,(!0)),new P(Dd.Audio.Base.streak_11_2,(!0))]},Init:function(){this.Initialized=!0},GameInit:function(){return this.Me=Dd.player,!!this.Me&&(this.Initialized||this.Init(),this.GameInitialized=!0,!0)},Update:function(a,b){if((this.GameInitialized||this.GameInit())&&a&&b&&a!=b&&(a==this.Me||b==this.Me)){if(b==this.Me)return void(this.PlayerStreakOnYou[a.sessionID]?this.PlayerStreakOnYou[a.sessionID]+=1:this.PlayerStreakOnYou[a.sessionID]=1);a==this.Me&&(this.PlayerStreakOnHim[b.sessionID]?this.PlayerStreakOnHim[b.sessionID]+=1:this.PlayerStreakOnHim[b.sessionID]=1);var c=n.now(),d=.001*(c-this.LastKillTime);if(this.LastKillTime=c,this.KillAnnouncmentQue.push(b),1==this.KillAnnouncmentQue.length&&this.AnnounceKill(),d>this.StreakCooldown)return void(this.CurrentStreak=1);this.CurrentStreak+=1,!this.AnnounceStreakTimer&&this.CurrentStreak>=2&&(this.AnnounceStreakTimer=u(function(){Dd.KillStreak.AnnounceStreak()},this.StreakCheckTimeoutMS))}},AnnounceStreakTimer:void 0,AnnounceStreak:function(){t(this.AnnounceStreakTimer),this.AnnounceStreakTimer=void 0;var a=this.CurrentStreak<=11?this.CurrentStreak:11;this.KillStreakAnimation[a]?this.KillStreakAnimation[a].gotoAndPlay(0):this.InitKillStreakAnimation(a),this.KillStreaksSoundObjects[a][Xb(0,this.KillStreaksSoundObjects[a].length-1)].Play()},AnnounceTimer:void 0,AnnounceKill:function(){var a=this.KillAnnouncmentQue[0];if(a){var b=this.KillAnimationCache[0];b?this.KillAnimationCache.splice(0,1):b=this.InitKillAnimation(),b.Container.find(".name").text(a.name);var c=b.Container.find(".text"),d=this.PlayerStreakOnHim[a.sessionID]||0,e=this.PlayerStreakOnYou[a.sessionID]&&this.PlayerStreakOnYou[a.sessionID]>=5;d>=10?c.text("DECIMATING"):d>=5?c.text("Dominating"):e?(c.text("REVENGE on"),this.PlayerStreakOnYou[a.sessionID]=0):c.text("You Killed"),b.gotoAndPlay(0),this.KillAnnouncmentQue.length>0?this.AnnounceTimer=u(function(){Dd.KillStreak.KillAnnouncmentQue.splice(0,1),Dd.KillStreak.AnnounceKill()},this.KillAnnounceTimeoutMS):(t(this.AnnounceTimer),this.AnnounceTimer=void 0)}},InitKillStreakAnimation:function(a){var c=f("<div class='streak_element'>"+this.KillStreakText[a]+"</div>"),d=Yb(c);b.set(c,{css:{perspective:400,perspectiveOrigin:"50% 50%",transformStyle:"preserve-3d"}}),this.KillStreakAnimation[a]=new i,this.KillStreakAnimation[a].staggerFrom(d.chars,.8,{scale:2,autoAlpha:0,rotationX:-180,transformOrigin:"-100% -50%",ease:Back.easeOut},.09),this.KillStreakAnimation[a].staggerTo(d.chars,.5,{color:"#ffffff",ease:Back.easeIn},.09,0),this.KillStreakAnimation[a].staggerTo(d.chars,.8,{scale:2,autoAlpha:0,rotationX:-180,transformOrigin:"100% 50%",ease:Back.easeIn},.09,.8),f("#announcements").append(c)},InitKillAnimation:function(){var a=f("<div class='kill_element'><span class='text'>You Killed</span> <span class='name'></span></div>"),c=new i;return c.from(a,.5,{scale:0,autoAlpha:0,ease:Back.easeOut},0),c.to(a,.8,{autoAlpha:0,ease:Power4.easeIn},.5),c.to(a,.8,{scale:3,ease:Power4.easeIn},.5),c.Container=a,b.delayedCall(2,function(){Dd.KillStreak.KillAnimationCache.push(c)}),f("#announcements").append(a),c},Clear:function(){this.Me=void 0,this.PlayerStreakOnYou={},this.PlayerStreakOnHim={},this.KillAnnouncmentQue=[],this.CurrentStreak=0,this.LastKillTime=0,this.GameInitialized=!1}},Dd.Level=new K,Dd.LevelCache={},Dd.ClearLoadCallback=function(){Dd.Level.loadCallback=null},Dd.PreloadLevel=function(a,b){PE.Server.connection.paused=!0,Dd.ClearGame(!0);var c=function(){return Dd.Scene.layerLevelBelow.isLoaded()&&Dd.Scene.layerLevelAbove.isLoaded()?(Dd.Level.loaded=!0,Dd.Level.InitCulling(),PE.Server.connection.paused=!1,Dd.UI.Gate.open(100),Dd.started=!0,void(Dd.starting=!1)):void u(function(){c()},100)};Dd.LoadLevel(a,b,c)},Dd.LoadLevel=function(a,b,c){var d=a+"-"+b;return Dd.Level&&Dd.Level.id==a&&Dd.Level.revision==b?void("function"==typeof c&&c()):(Dd.LevelCache[d]||(Dd.LevelCache[d]=new K(a,b)),Dd.Level=Dd.LevelCache[d],void Dd.Level.Load(c))};var Ne=0,Oe=[],Pe={None:-1,Activate:0,Aim:1,Target:2,Ground:3,GroundAngle:4,GroundConstruction:5};Dd.PowerUps={},Dd.PowerUps[-1]=new N((-1),"Random",Pe.None),Dd.PowerUps[0]=new N(0,"Haste",Pe.Activate),Dd.PowerUps[1]=new N(1,"Shield",Pe.Activate),Dd.PowerUps[2]=new N(2,"Air Strafe",Pe.GroundAngle),Dd.PowerUps[3]=new N(3,"Bombing Run",Pe.GroundAngle),Dd.PowerUps[4]=new N(4,"Vacuum",Pe.Ground),Dd.PowerUps[5]=new N(5,"Force Field",Pe.Ground),Dd.PowerUps[6]=new N(6,"Walls",Pe.GroundConstruction),Dd.PowerUps[7]=new N(7,"Rapid Fire",Pe.Activate),Dd.PowerUps[8]=new N(8,"Mines",Pe.Activate),Dd.PowerUps[9]=new N(9,"Teleport",Pe.Ground),Dd.PowerUps[10]=new N(10,"Stomp",Pe.Activate),Dd.PowerUps[11]=new N(11,"Missile (T)",Pe.GroundConstruction),Dd.PowerUps[14]=new N(14,"EMP",Pe.Ground),Dd.PowerUps[15]=new N(15,"Minigun (T)",Pe.GroundConstruction),Dd.PowerUps[16]=new N(16,"Laser (T)",Pe.GroundConstruction),Dd.PowerUps[17]=new N(17,"Tesla (T)",Pe.GroundConstruction),Dd.PowerUps[18]=new N(18,"Healing Beacon",Pe.GroundConstruction),Dd.PowerUps[19]=new N(19,"Laser Drone",Pe.Activate);var Qe=function(b,c,d,e,f,g,h){g=void 0!==g?g:3604224,f=void 0!==f?f:new Oc(.5,.5),h=void 0!==h?h:1,this.powerup=Dd.PowerUps[b],this.container=new a.Container,this.hideCrosshar=!0,this.distance=0;var i,j=new Oc,l=!1;this.start=function(){l||(l=!0,i=a.Sprite.fromFrame("Construction/"+c+"/crosshair.png"),i.blendMode=h,i.tint=g,i.anchor=f,this.container.addChild(i),Dd.Scene.layerSkyHelpers.addChild(this.container)),this.hideCrosshar&&Dd.Crosshair.hide(),this.container.visible=!0},this.update=function(a,b,c){var f=Dd.playerUnit.getWeaponOrientation(!0,!1);j.set(Dd.playerUnit.gunPosition.x,Dd.playerUnit.gunPosition.y),this.distance=Oc.Distance(a,b,Dd.playerUnit.gunPosition.x,Dd.playerUnit.gunPosition.y),this.distance=k.max(d,k.min(e,this.distance)),j.forward(f,this.distance,j),this.container.position.copy(j),this.container.rotation=f},this.end=function(){this.container.visible=!1,Dd.Crosshair.show()}};f("document").ready(function(){Dd.PowerUps[6].crosshair=new Qe(6,60,100*SETTINGS["Construction_General_MinPlacementDistance"],100*SETTINGS["Construction_General_MaxPlacementDistance"]),Dd.PowerUps[11].crosshair=new Qe(11,50,100*SETTINGS["Construction_General_MinPlacementDistance"],100*SETTINGS["Construction_General_MaxPlacementDistance"]),Dd.PowerUps[15].crosshair=new Qe(15,52,100*SETTINGS["Construction_General_MinPlacementDistance"],100*SETTINGS["Construction_General_MaxPlacementDistance"]),Dd.PowerUps[16].crosshair=new Qe(16,51,100*SETTINGS["Construction_General_MinPlacementDistance"],100*SETTINGS["Construction_General_MaxPlacementDistance"]),Dd.PowerUps[17].crosshair=new Qe(17,53,100*SETTINGS["Construction_General_MinPlacementDistance"],100*SETTINGS["Construction_General_MaxPlacementDistance"]),Dd.PowerUps[18].crosshair=new Qe(18,54,100*SETTINGS["Construction_General_MinPlacementDistance"],100*SETTINGS["Construction_General_MaxPlacementDistance"]),Dd.PowerUps[2].crosshair={powerup:Dd.PowerUps[2],rendered:!1,container:new a.Container,hideCrosshar:!0,start:function(){if(!this.rendered){this.rendered=!0;var b=a.Texture.fromFrame("Helpers/Abilities/AirStrafe/a10.png"),c=a.Texture.fromFrame("Helpers/Abilities/AirStrafe/start.png"),d=a.Texture.fromFrame("Helpers/Abilities/AirStrafe/mid.png"),e=a.Texture.fromFrame("Helpers/Abilities/AirStrafe/end.png"),f=new a.Container,g=new a.Sprite(c),h=new a.Sprite(e),i=new a.Sprite(b);g.blendMode=h.blendMode=i.blendMode=1,i.anchor.set(.5),i.position.x=90,g.anchor.y=h.anchor.y=.5;var j=0;for(f.addChild(g),j+=c.width;j<500;){var k=new a.Sprite(d);k.anchor.y=.5,k.position.x=j,k.blendMode=1,f.addChild(k),j+=d.width}h.position.x=j,f.addChild(h),f.addChild(i),f.position.x=-200,this.container.addChild(f),Dd.Scene.layerSkyHelpers.addChild(this.container)}this.hideCrosshar&&Dd.Crosshair.hide(),this.container.visible=!0},update:function(a,b,c){this.container.x=a,this.container.y=b,this.container.rotation=c},end:function(){this.container.visible=!1,Dd.Crosshair.show()}},Dd.PowerUps[3].crosshair={powerup:Dd.PowerUps[3],rendered:!1,container:new a.Container,hideCrosshar:!0,start:function(){if(!this.rendered){this.rendered=!0;var b=a.Texture.fromFrame("Helpers/Abilities/BombingRun/plane.png"),c=a.Texture.fromFrame("Helpers/Abilities/BombingRun/explosion.png"),d=new a.Container,e=new a.Sprite(b);e.blendMode=1,e.anchor.set(.5),e.position.x=120;for(var f=50;f<950;){var g=new a.Sprite(c);g.anchor.set(.5),g.position.x=f,g.position.y=10*k.random()-5,g.rotation=k.random()*k.PI,g.blendMode=1,g.alpha=.5,g.scale.set(.85+.3*k.random()),d.addChild(g),f+=75+20*k.random()}d.addChild(e),d.position.x=-200,this.container.addChild(d),Dd.Scene.layerSkyHelpers.addChild(this.container)}this.hideCrosshar&&Dd.Crosshair.hide(),this.container.visible=!0},update:function(a,b,c){this.container.x=a,this.container.y=b,this.container.rotation=c},end:function(){this.container.visible=!1,Dd.Crosshair.show()}},Dd.PowerUps[4].crosshair={powerup:Dd.PowerUps[4],rendered:!1,container:new a.Container,hideCrosshar:!0,start:function(){if(!this.rendered){this.rendered=!0;var b=new a.Graphics;b.lineStyle(2,65280,.5),b.beginFill(65280,.2),b.drawCircle(0,0,350),b.blendMode=1,b.endFill(),this.container.addChild(b),Dd.Scene.layerSkyHelpers.addChild(this.container)}this.hideCrosshar&&Dd.Crosshair.hide(),this.container.visible=!0},update:function(a,b,c){this.container.x=a,this.container.y=b,this.container.rotation=c},end:function(){this.container.visible=!1,Dd.Crosshair.show()}},Dd.PowerUps[5].crosshair={powerup:Dd.PowerUps[5],rendered:!1,container:new a.Container,hideCrosshar:!0,start:function(){if(!this.rendered){this.rendered=!0;var b=new a.Graphics;b.lineStyle(2,65280,.5),b.beginFill(65280,.2),b.drawCircle(0,0,250),b.blendMode=1,b.endFill(),this.container.addChild(b),Dd.Scene.layerSkyHelpers.addChild(this.container)}this.hideCrosshar&&Dd.Crosshair.hide(),this.container.visible=!0},update:function(a,b,c){this.container.x=a,this.container.y=b,this.container.rotation=c},end:function(){this.container.visible=!1,Dd.Crosshair.show()}},Dd.PowerUps[14].crosshair={powerup:Dd.PowerUps[14],rendered:!1,container:new a.Container,hideCrosshar:!0,start:function(){if(!this.rendered){this.rendered=!0;var b=a.Sprite.fromFrame("Helpers/Abilities/emp/emp.png");b.anchor.set(.5),b.blendMode=1,b.scale.set(2),this.container.addChild(b),Dd.Scene.layerSkyHelpers.addChild(this.container)}this.hideCrosshar&&Dd.Crosshair.hide(),this.container.visible=!0},update:function(a,b,c){this.container.x=a,this.container.y=b,this.container.rotation=c},end:function(){this.container.visible=!1,Dd.Crosshair.show()}},Dd.PowerUps[9].crosshair={powerup:Dd.PowerUps[9],rendered:!1,container:new a.Container,hideCrosshar:!0,tempPoint:new Oc,position:new Oc,start:function(){if(!this.rendered){this.rendered=!0;var b=new a.Graphics;b.lineStyle(2,65280,.5),b.beginFill(65280,.2),b.drawRoundedRect(0,0,Dd.playerUnit.width,Dd.playerUnit.height,20),b.endFill(),b.pivot.set(.5*Dd.playerUnit.width,.5*Dd.playerUnit.height),b.blendMode=1,this.container.addChild(b),Dd.Scene.layerSkyHelpers.addChild(this.container)}this.hideCrosshar&&Dd.Crosshair.hide(),this.container.visible=!0},update:function(a,b,c){this.position.set(a,b),Oc.Distance(a,b,Dd.playerUnit.position.x,Dd.playerUnit.position.y)>700&&(this.tempPoint.copy(Dd.playerUnit.position),this.tempPoint.pointTowards(this.position,700,this.position)),this.container.position.copy(this.position),this.container.rotation=Dd.playerUnit.rotation},end:function(){this.container.visible=!1,Dd.Crosshair.show()}}});var Re=function(a,b,c,d){this.shortName=a,this.name=b,this.speed=c};Dd.Region={bestServer:null,Regions:[new Re("EU","Europe",1e4),new Re("USE","US East",1e4),new Re("USW","US West",1e4),new Re("SEA","SE Asia",1e4)],Select:function(a){if(!rf.UserSettings["Region"]||rf.UserSettings["Region"]["shortName"]!==a){var a=f.grep(Dd.Region.Regions,function(b){return b.shortName===a})[0];a?(rf.UserSettings["AutoDetect"]=!1,rf.UserSettings["Region"]=a,Dd.Connection.Connect()):(rf.UserSettings["Region"]=null,rf.UserSettings["AutoDetect"]=!0,this.AutoDetect(function(){Dd.Connection.Connect()})),rf.saveUserSettings()}},Ajaxes:[],SelectedRegion:void 0,DetectSpeed:function(a){var b=f.Deferred(),c=prefServers[a.shortName];if(!c)return b.resolve(),b.promise();var e=c.split(":"),g=d.SSL?"https":"http",h=d.SSL?e[1]:"2095";return f.ajax({beforeSend:function(){a.startTime=o.now()},type:"GET",url:g+"://"+e[0]+":"+h+"/s",async:!0,timeout:3e3}).success(function(b){var d=o.now(),e=d-a.startTime;a.speed=e,(!Dd.Region.SelectedRegion||Dd.Region.SelectedRegion.speed>e)&&(Dd.Region.SelectedRegion=a,Dd.Region.bestServer=c)}).always(function(){b.resolve()}),b.promise()},AutoDetect:function(a){if(Dd.Region.SelectedRegion)return void Dd.Region.DetectFinished(a);var b=u(function(){Dd.Region.DetectFinished(a)},5e3),c=f.Deferred();rf.saveUserSettings(),this.bestServer=null;return Dd.Region.Regions.forEach(function(a){Dd.Region.Ajaxes.push(Dd.Region.DetectSpeed(a))}),f.when.apply(Dd.Region,Dd.Region.Ajaxes).then(function(){Dd.Region.SelectedRegion?(f("#AutoDetectLabel").text("("+Dd.Region.SelectedRegion.name+")"),Dd.Region.DetectFinished(a)):Dd.Region.DetectFinished(a),t(b),c.resolve(Dd.Region.SelectedRegion)},function(){}),c.promise()},DetectFinished:function(a){Dd.Region.SelectedRegion||(Dd.Region.SelectedRegion=Dd.Region.Regions[0]),"function"==typeof a&&a()}},a.display.DisplacementLayer=function(b,c,d){a.display.Layer.call(this);var e=a.RenderTexture.create(10,10,a.settings.SCALE_MODE,1),f=new a.Sprite(e),g=this.filter=new a.filters.DisplacementFilter(f,d/(devicePixelRatio||1)),h=!1,i=!1,j=new a.Sprite(a.Texture.WHITE);j.tint=8421504,this.addChild(j),this.renderable=!1,this.endWork=function(){a.display.Layer.prototype.endWork.call(this),this.updateDisplacement()},this.updateDisplacementScale=function(a){g.scale.set(a/(devicePixelRatio||1))},this.updateDisplacement=function(){b.screen.width==e.width&&b.screen.height==e.height||(j.width=b.screen.width,j.height=b.screen.height,e.resize(b.screen.width,b.screen.height));for(var a=0;a<this._activeChildren.length;a++){if(this._activeChildren[a].worldAlpha>0){h=!0;break}}if(h){if(this.renderable=!0,b.render(this,e),this.renderable=!1,h=!1,!i){if(null==c.filters)c.filters=[g];else{var d=c.filters;d.push(g),c.filters=d}i=!0}}else if(i){if(null!=c.filters)if(1==c.filters.length)c.filters=null;else{var d=c.filters;d.splice(d.indexOf(g),1),c.filters=d}i=!1}}},a.display.DisplacementLayer.prototype=Object.create(a.display.Layer.prototype),a.display.DisplacementLayer.prototype.constructor=a.display.DisplacementLayer,a.settings.GC_MODE=a.GC_MODES.AUTO,a.settings.SCALE_MODE=a.SCALE_MODES.LINEAR,a.settings.RESOLUTION=devicePixelRatio||1,Dd.Scene={screenActive:!0,renderer:new a.WebGLRenderer(d.innerWidth,d.innerHeight,{resolution:devicePixelRatio||1,powerPreference:"high-performance",antialias:!0}),filterArea:new a.Rectangle(0,0,0,0),TankSpritesheet:void 0,NameSpritesheet:void 0,renderStage:new a.display.Stage,gameStage:new a.display.Layer,UIStage:new a.display.Layer,layerUIArrows:new a.display.Layer,layerUIMid:new a.display.Layer,layerUIBottom:new a.display.Layer,layerUI_ADD:new a.display.Layer,layers:new a.Container,layerGroundHelpers:new a.display.Layer,layerLevelBelow:new a.display.Layer,layerGroundDecals:new a.display.Layer,layerGroundObjects_ADD:new a.display.Layer,layerGroundObjects:new a.display.Layer,layerTank:new a.display.Layer,layerDynamic:new a.display.Layer,layerConstructions:new a.display.Layer,layerProjectiles:new a.display.Layer,layerMapInterface:new a.display.Layer,layerHealth:new a.display.Layer,layerDebug:new a.display.Layer,layerDebugStage:new a.display.Layer,layerParticle:new a.display.Layer,layerParticle_ADD:new a.display.Layer,layerLevelAbove:new a.display.Layer,aboveShadow:new a.display.Layer,above2:new a.display.Layer,above3:new a.display.Layer,layerName:new a.display.Layer,layerText:new a.display.Layer,layerSkyHelpers:new a.display.Layer,layerUIText:new a.display.Layer,layerUITop:new a.display.Layer,layerDisplacement:null,PIXIUIStage:new a.UI.Stage(d.innerWidth,d.innerHeight),UI_INGAME:new a.UI.Container("100%","100%"),UI_Gate:new a.UI.Container("100%","100%"),UI_Leaderboard:new a.UI.Container("100%","100%"),UI_Respawn:new a.UI.Container("100%","100%"),UI_PowerUp:new a.UI.Container("100%","100%"),UI_GM_GUI:new a.UI.Container("100%","100%"),UI_GameEnd:new a.UI.Container("100%","100%"),UI_MainMenu:new a.UI.Container("100%","100%"),UI_Modules:new a.UI.Container("100%","100%"),UI_Notification:new a.UI.Container("100%","100%"),Crosshair:void 0,background:void 0,mousePosition:new Oc(10,10),interp:!0,init:function(){this.PIXIUIStage.minWidth=1220,this.PIXIUIStage.minHeight=840,Dd.Camera.mousePosition=this.renderer.plugins.interaction["mouse"].global;var b=this.renderer.plugins.interaction;b.cursorStyles["default"]="url('/content/gfx/cursor.png'), auto",b.cursorStyles["pointer"]="url('/content/gfx/pointer.png') 11 1, auto",f(this.renderer.view).attr("style","position:fixed; width:100% !important; height:100% !important"),r.body.appendChild(this.renderer.view),this.renderer.clearBeforeRender=!1,this.background=new a.extras.TilingSprite(a.Texture.fromFrame("dirt.jpg"),d.innerWidth,d.innerHeight),this.PIXIUIStage.addChild(this.UI_INGAME),this.UI_INGAME.addChild(this.UI_PowerUp),this.UI_INGAME.addChild(this.UI_GM_GUI),this.UI_INGAME.addChild(this.UI_GameEnd),this.UI_INGAME.addChild(this.UI_Modules),this.UI_INGAME.addChild(this.UI_Respawn),this.UI_INGAME.addChild(this.UI_Leaderboard),this.PIXIUIStage.addChild(this.UI_Gate),this.PIXIUIStage.addChild(this.UI_MainMenu),this.PIXIUIStage.addChild(this.UI_Notification),this.renderStage.addChild(this.gameStage),this.renderStage.addChild(this.UIStage),this.renderStage.addChild(this.PIXIUIStage),this.renderStage.addChild(this.layerUIText),this.renderStage.addChild(this.layerUITop),this.gameStage.addChild(this.layers);var c=new a.Container,e=new a.Container;this.layers.addChild(c,e),this.layerDisplacement=new a.display.DisplacementLayer(this.renderer,c,150),this.gameStage.addChild(this.layerDebugStage),c.addChild(this.background),c.addChild(this.layerLevelBelow),c.addChild(this.layerGroundDecals),c.addChild(this.layerGroundObjects),c.addChild(this.layerGroundObjects_ADD),c.addChild(this.layerGroundHelpers),c.addChild(this.layerDynamic),c.addChild(this.layerConstructions),c.addChild(this.layerTank),c.addChild(this.layerProjectiles),c.addChild(this.layerDisplacement),c.addChild(this.layerParticle),c.addChild(this.layerParticle_ADD),c.addChild(this.layerLevelAbove),c.addChild(this.aboveShadow),c.addChild(this.above2),c.addChild(this.above3),e.addChild(this.layerHealth),e.addChild(this.layerName),e.addChild(this.layerMapInterface),e.addChild(this.layerSkyHelpers),e.addChild(this.layerText),e.addChild(this.layerDebug),this.UIStage.addChild(this.layerUI_ADD),this.UIStage.addChild(this.layerUIArrows),this.UIStage.addChild(this.layerUIBottom),this.UIStage.addChild(this.layerUIMid),this.renderStage.filterArea=this.filterArea,this.gameStage.filterArea=this.filterArea,this.TankSpritesheet=new Q(2048,150,2048,2048,(!1)),this.NameSpritesheet=new Q(2048,22,2048,2048,(!1)),this.Crosshair=Dd.Crosshair.set(),d.addEventListener("blur",function(){Dd.Scene.screenActive=!1},!1),d.addEventListener("focus",function(){Dd.Scene.screenActive=!0},!1),Dd.ScoreBoard.init(),Dd.UI.FilterVignette.Add(),Dd.UI.FilterColor.Add(),Dd.Scene.FixSizeAndPosition(),Dd.onResize(function(){Dd.Scene.FixSizeAndPosition()})},FixSizeAndPosition:function(){var a=(devicePixelRatio||1,d.innerWidth),b=d.innerHeight;Dd.width=a,Dd.height=b,this.filterArea.width=a,this.filterArea.height=b,this.renderStage.filterArea=this.filterArea,this.gameStage.filterArea=this.filterArea,this.PIXIUIStage.resize(a,b),this.renderer.resize(a,b)},getPositionOf:function(a,b,c){return c||(c=new Oc),c.x=c.y=0,b&&a.updateTransform(),a.worldTransform.apply(c,c),Dd.Scene.layers.worldTransform.applyInverse(c,c),(isNaN(c.y)||isNaN(c.x))&&(c.x=c.y=-1e4),c},lines:{},circles:{},intrects:{},rects:{},drawLine:function(b,c,d,e){this.lines[d]||(this.lines[d]=new a.Graphics,this.layerDebug.addChild(this.lines[d]));var f=this.lines[d];f.clear(),f.lineStyle(2,e?16711680:3211008,1),f.moveTo(b.x,b.y),f.lineTo(c.x,c.y)},drawCircle:function(b,c,d,e){this.circles[d]||(this.circles[d]=new a.Graphics,this.layerDebug.addChild(this.circles[d]));var f=this.circles[d];f.clear(),f.lineStyle(2,e?16711680:3211008,1),f.drawCircle(b.x,b.y,c)},drawIntRect:function(b,c,d,e,f,g){if(this.intrects[g]){var h=this.intrects[g];h.data.x=b,h.data.y=c,h.data.w=d,h.data.h=e,h.data.r=f}else{this.intrects[g]={};var i=this.intrects[g];i.data={},i.x=i.data.x=b,i.y=i.data.y=c,i.w=i.data.w=d,i.h=i.data.h=e,i.r=i.data.r=f,i.g=new a.Graphics,this.layerDebug.addChild(i.g),i.update=function(a){var b=i.x=Interp(i.x,i.data.x),c=i.y=Interp(i.y,i.data.y),d=i.w=Interp(i.w,i.data.w),e=i.h=Interp(i.h,i.data.h),f=i.r=Interp(i.r,i.data.r);i.g.clear(),i.g.lineStyle(2,3211008,1),i.g.drawRect(.5*-d,.5*-e,d,e),i.g.position.set(b,c),i.g.rotation=f},PE.GameLoop.onUpdate(i.update,i)}},drawRect:function(b,c,d,e,f,g){var h=this.rects[g];h||(h=this.rects[g]=new a.Graphics,this.layerDebug.addChild(h)),h.clear(),h.lineStyle(2,16711680,1),h.drawRect(.5*-d,.5*-e,d,e),h.position.set(b,c),h.rotation=f},drawNavGrid:function(b){var c=k.floor(Dd.Level.width/80),d=k.floor(Dd.Level.height/80),e=new a.Graphics;this.layerDebug.addChild(e),e.lineStyle(3,15592941,.2);for(var f=0;f<c;f++)e.moveTo(80*f,0),e.lineTo(80*f,Dd.Level.height);for(var f=0;f<d;f++)e.moveTo(0,80*f),e.lineTo(Dd.Level.width,80*f);for(var g=0;g<d;g++)for(var h=0;h<c;h++){var i=!b[g][h];i&&(e.beginFill(16776971,.3),e.drawRect(80*h,80*g,80,80),e.endFill())}},drawWP:function(b){this.lines["WP"]||(this.lines["WP"]=new a.Graphics,this.layerDebug.addChild(this.lines["WP"]));var c=this.lines["WP"];c.clear(),this.lines["WPDot"]&&this.lines["WPDot"].clear();var d=b[0],e=b[1];this.drawWPCheck(d,e,!0),c.lineStyle(4,16777215,1);for(var f=0;f<b.length;f+=2){c.lineStyle(4,16777215,1);var g=b[f],h=b[f+1];c.moveTo(d,e),c.lineTo(g,h),d=g,e=h,this.drawWPCheck(d,e,!0)}},drawWPCheck:function(b,c,d){this.lines["WPDot"]||(this.lines["WPDot"]=new a.Graphics,this.layerDebug.addChild(this.lines["WPDot"]));var e=this.lines["WPDot"];d?(e.beginFill(16777215,1),e.drawCircle(b,c,14),e.endFill()):(e.beginFill(11465220,1),e.drawCircle(b,c,10),e.endFill())}};var Se=function(a,b,c,d,e,f,g){this.Name=a,this.Color="0x"+(b||"ffffff"),this.BorderColor="0x"+(c||"ffffff"),this.GlassColor="0x"+(d||"ffffff"),this.LBBackgroundColor="0x"+(e||"ffffff"),this.LBHeaderStroke="0x"+(f||"ffffff"),this.LBHeadlineTextFill=g||"#5ebef2, #26aff1"},Te=function(){a.utils.EventEmitter.call(this),this["default"]=new Se("FFA","58c74e","416200","fcffa7","252934","76c3f2","#5ebef2, #26aff1"),this["defaultNeutral"]=new Se("FFA","cfcfcf","5f5f5f","c3d3f6","393939","ededed","#ececec, #ffffff"),this["defaultBad"]=new Se("FFA","e91b00","6b2300","ffc8a7","252934","76c3f2","#5ebef2, #26aff1"),this[0]=new Se("Green","58c74e","416200","fcffa7","304514","82ce1c","#9cea33, #82ce1c"),this[1]=new Se("Red","e91b00","6b2300","ffc8a7","3b0000","ff6c6c","#ff6c6c, #ff3838"),this[2]=new Se("Blue","0052e9","1d3369","a7adff","252934","76c3f2","#5ebef2, #26aff1"),this[3]=new Se("Yellow","dbc114","766400","faffcf","3b3500","ddd842","#ede738, #c1bb22"),this[4]=new Se("Purple","c700df","820284","ffcffb","240126","db42dd","#e25ce4, #db42dd"),this[5]=new Se("Teal","00d0d2","005e69","bdfaff","144445","40dbd6","#48f2ec, #40dbd6"),this.GetColor=function(a,b){if(a==-1)return this["defaultNeutral"];if(0==a)return b?rf.UserSettings["ColorBlind"]?this[2]:this["default"]:this["defaultBad"];if(Dd.player){if(a>Dd.player.team)return this[a-=1];if(a<Dd.player.team)return this[a];if(a==Dd.player.team)return rf.UserSettings["ColorBlind"]?this[2]:this[0]}return this[a-=1]},this.UpdateColors=function(){this.emit("update"),Dd.ScoreBoard.UpdateTeamColors()}};Te.prototype=Object.create(a.utils.EventEmitter.prototype),Te.prototype.constructor=Te,Dd.TeamColors=new Te,Dd.XPSystem={Experience:0,Level:1,Levels:[],initialized:!1,onChangeFunction:[],onChange:function(a){"function"==typeof a&&this.onChangeFunction.push(a)},init:function(){if(!this.initialized){this.initialized=!0;for(var a=1.5,b=.955,c=0,d=150,e=150,f=150,g=1.01,h=1;h<=500;h++){var i={};i.Level=h,i.StartExperience=c,i.EndExperience=d,this.Levels.push(i),e=p((e*a).toFixed(2)),f+=e,c=d+1,d=k.floor(f),a=p(k.max(a*b,g).toFixed(4))}}},GetLevel:function(a){this.init();for(var b,c=0;c<this.Levels.length&&(b=this.Levels[c],!(b.StartExperience<=a&&b.EndExperience>=a));c++);return b},SetExperience:function(a){this.Experience=a;var b=this.GetLevel(a);this.level=b.Level,f("[data-userdata='rank']").each(function(){f(this).is("input[type=text]")?f(this).val("lvl "+b.Level):f(this).text("lvl "+b.Level)}),f("[data-userdata='rankiconmedium']").each(function(){f(this).attr("src","/Content/SpritesUI/UI/Rank/Medium/"+b.Level+".png")}),f("#myinfo_rank").show();for(var c=0;c<this.onChangeFunction.length;c++)this.onChangeFunction[c]()},GetLevelIconSrc:function(a,b){return"/Content/SpritesUI/UI/Rank/"+b+"/"+k.min(240,a)+".png"},Ranks:["Loader","Driver","Gunner","Commander","Platoon Commander","First Lieutenant","Captain","Major","Lieutenant Colonel","Colonel","Brigadier General","Major General","Lieutenant General","General","Field Marshal"],Metals:["Bronze ","Silver ","Golden ","Diamond "],Prestiges:[""," II"," III"," IV"],GetRankName:function(a){a=k.min(240,a)-1;var b=60,c=4,d=k.floor(a/b),e=a-d*b,f=k.floor(e/c);return this.Metals[e-f*c]+this.Ranks[f]+this.Prestiges[d]}},Dd.Payment={window:null,Close:function(){this.window&&this.window.close(),this.window=null,delete localStorage["checkoutData"]},BuyItem:function(a,b){this.Close(),this.window=cg("/payment/","Tankwars.io Payment Window",850,700),this.InitPaymentWindow(a,b)},InitPaymentWindow:function(a,b){if(this.window){if(!this.window.initialize)return u(function(){Dd.Payment.InitPaymentWindow(a,b)},10);this.window.initialize(a,b,livePay,Dd.sessionRefId),googa("send","event","BeginPayment",a+" ("+b+")"),fbq("track","AddPaymentInfo",{content_name:""+b,content_ids:[""+a],content_type:"product"})}}},d.purchaceResult=function(a,b){Dd.Payment.Close(),googa("send","event","Purchase Success",a.Name),nc.open("PURCHASE COMPLETE",a.Name,"OK");for(var c=a.Currencies,d=a.Items,e=a.Premium,f=0;f<c.length;f+=3){var g=c[f],h=c[f+1];new Zb("Balance Added",c[f+2]+" "+bh[g]).addButton("OK",200,5592405,function(){}).show(5e3),pf.wallet.UpdateBalance(g,h),g==ah.Gold&&Dd.joined&&Dd.Connection.invoke("UpdateGold")}for(var i=[],f=0;f<d.length;f+=2)i.push(d[f]);i.length&&eg.loadItemInfo(i,function(){for(var a=0;a<d.length;a+=2)!function(){new Zb("New Inventory Item",d[a+1]+"x "+eg.items[d[a]].name).addButton("Show Inventory",200,5592405,function(){pf.openSubMenu(pf.inventoryPage)}).show(5e3)}()}),null!=e&&e!=-1&&(PE.Server.connection.invoke("UpdatePremium"),pf.homePage.account.addBadge(0,e),new Zb("Premium Added "+(e>1e3?"(Lifetime)":"("+e+" days left)")).addButton("OK",200,5592405,function(){}).show(5e3)),b&&(googa("require","ecommerce"),googa("ecommerce:addTransaction",{id:""+b.saleId,revenue:""+b.total,shipping:"0",tax:""+b.tax}),googa("ecommerce:addItem",{id:""+b.saleId,name:""+b.productName,sku:""+b.productId,price:""+b.total,quantity:"1"}),googa("ecommerce:send"),
googa("ecommerce:clear"),fbq("track","Purchase",{value:b.total,currency:"USD",content_name:""+b.productName,content_ids:[""+b.productId],contents:[{id:""+b.productId,quantity:1,item_price:b.total}],content_type:"product"}))},Dd.SaleLog={itemName:"",initialized:!1,init:function(){this.initialized=!0;var a=this.container=f('<div class="notification_container">'),b=f('<span class="notification_headline" id="payment_headline">PURCHASE HISTORY</span>'),c=f('<div class="notification_dialog">'),d=f('<div class="close">x</div>'),e=f('<iframe src="/Shop/Log/1"></iframe>');f(r.body).append(a.append(c.append(b).append(e).append(d))),d.click(function(){a.hide()})},Open:function(){a.UI.Interaction.InputController.blur(),this.initialized||this.init(),this.container.show()}},Dd.NewUser={itemName:"",initialized:!1,init:function(a){function b(a){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/gim.test(a)}this.initialized=!0;var c=this,d=this.container=f('<div class="notification_container">'),e=f('<div class="notification_dialog">'),g=f('<div class="close">x</div>');this.newuserHeadline=f('<span class="notification_headline" id="newuser_headline">Registration</span>'),this.newuserText=f('<span class="notification_text">Almost there!</span>'),this.usernameInputLabel=f('<label for="userNick" class="termsCheck"><span class="label">Username:</span></label>'),this.usernameInput=f('<input type="text" id="userNick" value="" />'),this.usernameInputLabel.append(this.usernameInput).append(f('<span class="required">*</font>')),this.usernameError=f('<div class="tos_error">You must have a Nickname</div>'),this.emailInputLabel=f('<label for="userMail" class="termsCheck"><span class="label">Email:</span></label>'),this.emailInput=f('<input type="text" id="userMail" value="'+c.newuserData.mail+'" />'),this.emailInputLabel.append(this.emailInput).append(f('<span class="required">*</span>')),this.emailError=f('<div class="tos_error">You must insert a valid mail example@mail.com</div>'),this.tosContainer=f('<div class ="newuser_scrollarea">'),this.tosContainerContent=f('<span class ="newuser_scrolltext">'+c.newuserData.tos+"</span>"),this.tosContainer.append(this.tosContainerContent),this.tosCheckboxLabel=f('<label for="acceptCheck" class="termsCheck"> I accept Tankwars.io TERMS OF SERVICE</label>'),this.tosCheckbox=f('<input type="Checkbox" id="acceptCheck" />'),this.tosCheckboxLabel.prepend(this.tosCheckbox).append(f('<span class="required">*</span>')),this.tosError=f('<div class="tos_error">You must accept our TERMS OF SERVICE to complete the registration</div>'),this.ageCheckboxLabel=f('<label for="ageCheck" class="termsCheck"> I\'m at least 16 years old</label>'),this.ageCheckbox=f('<input type="Checkbox" id="ageCheck" />'),this.ageCheckboxLabel.prepend(this.ageCheckbox).append(f('<span class="required">*</span>')),this.ageError=f('<div class="tos_error">You need to confirm that you are at least 16 years old</div>'),this.newsletterCheckboxLabel=f('<label for="newsletterCheck" class="termsCheck"> I would like to receive TankWars.io Newsletters</label>'),this.newsletterCheckbox=f('<input type="Checkbox" id="newsletterCheck" checked />'),this.newsletterCheckboxLabel.prepend(this.newsletterCheckbox),this.cancelbtn=f('<div class="newuser_close_big">Cancel</div>'),this.acceptbtn=f('<div class="newuser_accept_big">Register</div>'),e.append(this.newuserHeadline).append(this.newuserText).append(g).append(this.usernameInputLabel).append(this.usernameError).append(this.emailInputLabel).append(this.emailError).append(this.tosContainer).append(this.tosCheckboxLabel).append(this.tosError).append(this.ageCheckboxLabel).append(this.ageError).append(this.newsletterCheckboxLabel).append(this.cancelbtn).append(this.acceptbtn),d.append(e),f(r.body).append(d),g.click(function(){c.cancelbtn.click()}),this.cancelbtn.click(function(){d.hide(),Zh.Logout()}),this.acceptbtn.click(function(){var a=c.usernameInput.prop("value"),e=b(c.emailInput.prop("value")),g=c.tosCheckbox.prop("checked"),h=c.ageCheckbox.prop("checked");g&&h&&e&&""!==a?f.post("/Account/AcceptTOS",{email:c.emailInput.val(),username:c.usernameInput.val(),newsletter:c.newsletterCheckbox.prop("checked")}).done(function(a){a.success?(d.hide(),Zh.Authenticate()):1==a.error?(c.usernameError.text(a.message),c.usernameError.show()):2==a.error&&(c.emailError.text(a.message),c.emailError.show())}):(""===a&&c.usernameError.show(),e||c.emailError.show(),g||c.tosError.show(),h||c.ageError.show())});var h;this.usernameInput.keyup(function(a){f(this).prop("value")&&(h&&t(h),h=u(function(){""===c.usernameInput.val()?(c.usernameError.text("You must have a Nickname"),c.usernameError.show()):f.post("/Account/UsernameTakenCheck",{username:c.usernameInput.val()}).done(function(a){a.success?c.usernameError.hide():(c.usernameError.text(a.message),c.usernameError.show())})},1500))}),this.emailInput.change(function(){f(this).prop("value")&&c.emailError.hide()}),this.tosCheckbox.change(function(){f(this).prop("checked")&&c.tosError.hide()}),this.ageCheckbox.change(function(){f(this).prop("checked")&&c.ageError.hide()})},Open:function(){return a.UI.Interaction.InputController.blur(),this.initialized?(this.usernameInput.val(""),this.emailInput.val(this.newuserData.mail),this.tosContainerContent=f('<span class ="newuser_scrolltext">'+this.newuserData.tos+"</span>"),this.usernameError.hide(),this.emailError.hide(),this.tosCheckbox.prop("checked",!1),this.tosError.hide(),this.ageCheckbox.prop("checked",!1),this.ageError.hide(),this.newsletterCheckbox.prop("checked",!0),this.emailInputLabel.show(),this.tosCheckboxLabel.show(),this.ageCheckboxLabel.show(),this.newsletterCheckboxLabel.show(),this.newuserHeadline.show(),this.newuserText.text(),this.newuserText.show(),void this.container.show()):void this.init()},ShowRegistration:function(){var a=this;f.post("/Account/NewuserData",{}).done(function(b){a.newuserData={mail:"",tos:""},a.newuserData.mail=b.mail,a.newuserData.tos=b.tos,Dd.NewUser.Open()})}};var Ue={initialized:!1,to:null,init:function(){this.initialized=!0,this.container=new a.UI.Container(100,100),this.container.visible=!1;var b=a.UI.Sprite.fromFrame("UI/blank.png");b.width=b.height="100%",b.tint=0,b.alpha=.8,this.text=new a.UI.DynamicText("",{style:$c,allowTags:!0,width:90,height:90}),this.text.anchorLeft=this.text.anchorRight=this.text.anchorTop=this.text.anchorBottom=5,this.container.addChild(b,this.text),Dd.Scene.UI_Notification.addChild(this.container)},hide:function(){t(this.to),this.container.visible=!1},show:function(a){if(a._hoverInitialized){this.initialized||this.init(),t(this.to);var b=a._hoverDelay;this.to=u(function(){var b=a.actual_height,c=a.actual_width,d=a.container.worldTransform.tx,e=a.container.worldTransform.ty,f=a.container.worldTransform.a,g=a.container.worldTransform.d,h=a._hoverWidth,i=a._hoverHeight,j=a._hoverCenter,k=a._hoverOffset,l=a._hoverText,m=(k?k.x*g+d:d)+.5*c*f,n=(k?k.y*g+e:e)+.5*b*g;Ue.container.visible=!0,Ue.container.height=i,Ue.container.width=h,Ue.container.x=m,Ue.container.y=n,Ue.text.style.align=j?"center":"left",Ue.text.value=l},b)}},add:function(b,c,d,e,f,g,h){if(b._hoverText=c,b._hoverOffset=h,b._hoverWidth=d,b._hoverHeight=e,b._hoverCenter=f,b._hoverDelay=g,!b._hoverInitialized){b._hoverInitialized=!0;new a.UI.Interaction.ClickEvent(b,(!0),(!1),(!1)).onHover=function(a,c){return c?void Ue.show(b):void Ue.hide()}}}},Ve={},We=function(){this.container=new a.UI.Container(70,"80%"),this.container.valign="middle";var b=a.UI.Sprite.fromFrame("UI/blank.png");b.width=b.height="100%",b.tint=0,b.alpha=.2,this.text=new a.UI.DynamicText("",{style:Zc}),this.text.anchorBottom=-2,this.headline=new a.UI.DynamicText("",{style:fd}),this.headline.anchorBottom=9,this.headline.align=this.text.align="center",this.container.addChild(b,this.headline,this.text)};We.prototype.load=function(a){},We.prototype.constructor=We;var Xe=function(){We.call(this),this.icon=a.UI.Sprite.fromFrame("UI/Menu/premium.png"),this.icon.pivot=.5,this.icon.scale=1,this.icon.anchorTop=-22,this.icon.align="center",this.container.addChild(this.icon),this.headline.value="PREMIUM"};Xe.prototype=Object.create(We.prototype),Xe.prototype.constructor=Xe,Ve[0]=Xe,Xe.prototype.load=function(a){this.headline.anchorBottom=a===-1?3:9,this.text.visible=a!==-1,this.text.value=a>1e4?"LIFETIME":a+" days"};var Ye=function(){We.call(this),this.icon=a.UI.Sprite.fromFrame("UI/Badge/Veteran/0.png"),this.icon.pivot=.5,this.icon.scale=1,this.icon.anchorTop=-5,this.icon.align="center",this.container.addChild(this.icon),this.headline.value="TANKWARS 1",this.text.value="VETERAN",this.quality=0};Ye.prototype=Object.create(We.prototype),Ye.prototype.constructor=Ye,Ve[1]=Ye,Ye.prototype.load=function(b){"string"==typeof b&&(b=JSON.parse(b));var c=b[0],d=b[1],e=b[2],f=b[3],g="#cea383";c!==this.quality&&(this.icon.sprite.texture=a.Texture.fromFrame("UI/Badge/Veteran/"+c+".png"),this.quality=c,g=0===c?"#e8bb66":1===c?"#c5bab2":"#cea383"),Ue.add(this.container,"<font size='25' lineHeight='40' tint='"+g+"'><b>TW1 VETERAN</b></font>\n<font size='18'>RANK #<b>"+d+"</b>\nLEVEL <b>"+e+"</b>\nKILLS <b>"+f+"</b>",190,120,!0,500,new Vector2(40,(-60)))};var Ze=function(){We.call(this),this.icon=a.UI.Sprite.fromFrame("UI/Badge/BetaTester/0.png"),this.icon.pivot=.5,this.icon.scale=1,this.icon.anchorTop=-5,this.icon.align="center",this.container.addChild(this.icon),this.headline.value="TANKWARS 2",this.text.value="BETA TESTER",this.quality=0};Ze.prototype=Object.create(We.prototype),Ze.prototype.constructor=Ze,Ve[2]=Ze,Ze.prototype.load=function(a){};var $e={monitorList:[],topZIndex:100,init:function(){function a(){new o-b<e?u(a,e):(c=!1,$e.checkAllWindows())}var b,c=!1,e=100;f(d).resize(function(){b=new o,c===!1&&(c=!0,u(a,e))})},checkAllWindows:function(){for(var a=this.monitorList.length-1;a>=0;a--){var b=this.monitorList[a];b.length&&$e.moveToScreenArea(b)}},bringToTop:function(a){f(".window").removeClass("focus"),a.css("z-index",this.topZIndex),a.addClass("focus"),this.topZIndex++,this.moveToScreenArea(a)},monitorPosition:function(a){a.draggable({iframeFix:!0,start:function(){f("iframe").css("pointer-events","none")},stop:function(){$e.moveToScreenArea(a),f("iframe").css("pointer-events","")}}),this.monitorList.push(a)},moveToScreenArea:function(a){var b=f(d).width(),c=f(d).height(),e=a.height(),g=a.width(),h=p(a.css("left").replace("px","")),i=p(a.css("top").replace("px","")),j=h+g,k=i+e;g>=b?a.css({left:b-g}):(j>b&&a.css({left:b-g}),h<0&&a.css({left:0})),e>=c?a.css({top:0}):(k>c&&a.css({top:c-e}),i<0&&a.css({top:0}))},positionMouseCenter:function(a){a.css({top:Dd.Camera.mousePosition.y-a.height()/2,left:Dd.Camera.mousePosition.x-a.width()/2}),this.moveToScreenArea(a)},positionMouseTopLeft:function(a){a.css({top:Dd.Camera.mousePosition.y-a.height(),left:Dd.Camera.mousePosition.x-a.width()}),this.moveToScreenArea(a)},positionMouseTopRight:function(a){a.css({top:Dd.Camera.mousePosition.y-a.height(),left:Dd.Camera.mousePosition.x}),this.moveToScreenArea(a)},positionMouseBottomLeft:function(a){a.css({top:Dd.Camera.mousePosition.y,left:Dd.Camera.mousePosition.x-a.width()}),this.moveToScreenArea(a)},positionMouseBottomRight:function(a){a.css({top:Dd.Camera.mousePosition.y,left:Dd.Camera.mousePosition.x}),this.moveToScreenArea(a)},centerOnScreen:function(a){var b=f(d).width()/2;a.css({top:f(d).height()/2-a.height()/2,left:b-a.width()/2})}},_e={TOS:1,PrivacyPolicy:3,CookiePolicy:4,About:6,Changelog:5},af={Pages:{},Open:function(a){var b=this.Pages[a];b||(this.Pages[a]=b=new bf(a)),b.open()}},bf=function(a,b){var c,d=this;b?(this.container=f("#windowUI").find("#"+b),this.content=this.container.find(".window_inner"),c=this.container.find(".close")):(this.container=f("<div class='window cms_page'>"),this.content=f("<div class='window_inner inner'>"),c=f("<div class='close'>"),this.container.append(c).append(this.content),f("#windowUI").append(this.container),f.ajax({type:"GET",url:"https://tankwars.io/game/page/"+a,success:function(a){d.content.html(a)}})),c.click(function(){d.container.hide()}),this.container.draggable({scroll:!1,cancel:".close"}).resizable({handles:"all",minHeight:400,minWidth:400,maxHeight:1200,maxWidth:2e3}).mousedown(function(){$e.bringToTop(f(this))}),$e.monitorPosition(this.container),this.open=function(){pf.isOpen||pf.open(),$e.bringToTop(this.container),$e.centerOnScreen(this.container),this.container.fadeIn(200)}};f(r).ready(function(){af.Pages[6]=new bf(6,"about")});var cf,df,ef,ff,gf,hf,jf,kf,lf,mf,nf=function(a){return a+""},of=function(b,c,d,e){var f=this;this.name=b,this.image=c,this.page=d,this.active=!!e;var g=this.button=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/TopIcons/"+this.image.toLowerCase()),text:new a.UI.DynamicText(nf(this.name),{style:ud})});g.background.tint=15592941,g.text.verticalAlign=null,g.text.bottom=-3,g.y=-35,g.pivotY=1,this.setActive=function(a){a?(pf.unselectButtons(),this.active=!0,g.background.tint=12906240,g.text.style.tint="#d9ff29"):(this.active=!1,g.background.tint=15592941,g.text.style.tint="#ffffff"),xf.setActive(!1)},g.on("hover",function(a){g.background.tint=f.active?a?14286633:12906240:a?16777215:15592941}),g.on("click",function(){if("Settings"==b)f.active||pf.settingsPage.openSubMenu("CONTROLS");else{if("Inventory"==b&&!Zh.authenticated)return void xc.open("You must sign-in to access inventory");pf.openSubMenu(f.page),googa("send","event","MainMenu","TopMenu - "+f.page+" Clicked")}f.setActive(!0)}),this.active&&this.setActive(!0)},pf={effectsAdded:!1,onOpenFunctions:[],onCloseFunctions:[],onOpen:function(a){"function"==typeof a&&this.onOpenFunctions.push(a)},onClose:function(a){"function"==typeof a&&this.onCloseFunctions.push(a)},init:function(){cf=a.Texture.fromFrame("UI/Menu/box-stripes-rounded.png"),ef=a.Texture.fromFrame("UI/Menu/box-header.png"),gf=a.Texture.fromFrame("UI/Menu/slider-knob.png"),hf=a.Texture.fromFrame("UI/Menu/slider-track.png"),jf=a.Texture.fromFrame("UI/Menu/slider-fill.png"),kf=a.Texture.fromFrame("UI/ui-box-0.png"),lf=a.Texture.fromFrame("UI/ui-box-6.png"),mf=a.Texture.fromFrame("UI/glow-box.png"),ff=a.Texture.fromFrame("UI/blank.png"),df=a.Texture.fromFrame("UI/grad-vertical.png"),rf.init(),this.homePage=new bg,this.inventoryPage=new pg,this.tanksPage=new vg,this.leaderboardPage=new yg,this.settingsPage=new zg,this.shopPage=new _g,this.crewPage=new dh,this.profilePage=new zh;var b=this.container=new a.UI.Container(1220,577);b.verticalAlign="middle",b.horizontalAlign="center",b.pivot=.5,Dd.Scene.UI_MainMenu.alpha=0,Dd.Scene.UI_MainMenu.addChild(b),Dd.Scene.UI_MainMenu.addChild(this.profilePage.container),this.crews=new Bf,b.addChild(this.crews.container),this.crateopen=new Gf,Dd.Scene.UI_MainMenu.addChild(this.crateopen.container);var c=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/logo.png")});c.pivotY=1,c.y=-5,c.x=-4,c.scale=.97,b.addChild(c),c.on("click",function(){pf.openSubMenu(pf.homePage),pf.buttons["Home"].setActive(!0),googa("send","event","MainMenu","Logo Clicked")}),this.buttons={},this.buttons["Home"]=new of("Home","Home.png",this.homePage,(!0)),this.buttons["Leaderboard"]=new of("Leaderboard","Leaderboard.png",this.leaderboardPage),this.buttons["Settings"]=new of("Settings","Settings.png",this.settingsPage),this.buttons["Tanks"]=new of("Tanks","Garage.png",this.tanksPage),this.buttons["Inventory"]=new of("Inventory","inventory.png",this.inventoryPage),this.buttons["Shop"]=new of("Shop","Shop.png",this.shopPage);var e=0;for(var g in this.buttons){var h=this.buttons[g];h.button.pivotX=.5,h.button.x=345+90*e,b.addChild(h.button),e++}for(var i=[["reddit","https://www.reddit.com/r/tankwars/"],["discord","https://discord.gg/tankwars"],["twitter","https://twitter.com/playon_io"],["youtube","https://www.youtube.com/channel/UCo24QM3HuBDhxEbHNa3fsRw"],["facebook","https://www.facebook.com/tankwarsio/"]],j=0;j<i.length;j++)!function(){var c=j,e=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Communities/"+i[j][0].toLowerCase()+".png")});e.right=266-59*j,e.y=-70,e.pivot=.5,e.target=0,b.addChild(e),e.on("hover",function(b){if(b){this.target+=2*k.PI;a.UI.Tween.to(this.background,(this.target-this.background.rotation)/(2*k.PI)*.9,{rotation:this.target},a.UI.Ease.Circ.CircOut)}}),e.on("press",function(b){a.UI.Tween.to(this.background,.4,{scale:b?.7:1},a.UI.Ease.Circ.CircOut)});var f=i[j][1];e.on("click",function(){d.open(f,"_blank"),googa("send","event","MainMenu","Community - "+i[c][0]+" Clicked")})}();var l=a.UI.Sprite.fromFrame("UI/Menu/Communities/text.png");l.anchorRight=54,l.y=-50,b.addChild(l);var m=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Share/tweet.png")});m.bottom=-8,m.anchorRight=4,m.on("click",Dd.tweet);var n=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Share/share.png")});n.bottom=-8,n.anchorRight=85,n.on("click",Dd.share),b.addChild(m,n),Xc.InputManager.addKeyUpListener(27,1,function(a){f("#GameChatContainer").find(".chat_message:first").is(":focus")||(pf.isOpen?Dd.joined&&pf.close():pf.open())}),b.addChild((this.wallet=new sf).container);var o=new a.UI.Container;o.height=20,o.anchorBottom=0,o.anchorLeft=0;var p=new a.UI.Button({text:new a.UI.DynamicText("Terms of Service  -",{style:pd,allowTags:!0})});p.anchorLeft=0,p.width=98,o.addChild(p);var q=new a.UI.Button({text:new a.UI.DynamicText("Privacy Policy  -",{style:pd,allowTags:!0})});q.anchorLeft=p.width,q.width=82,o.addChild(q);var r=new a.UI.Button({text:new a.UI.DynamicText("Cookie Policy",{style:pd,allowTags:!0})});r.anchorLeft=p.width+q.width,r.width=68,o.addChild(r),p.on("click",function(){af.Open(_e.TOS)}),q.on("click",function(){af.Open(_e.PrivacyPolicy)}),r.on("click",function(){af.Open(_e.CookiePolicy)}),o.addChild(p),Dd.Scene.UI_MainMenu.addChild(o),pf.openSubMenu(pf.homePage,!0),d["authenticated"]||Hf.init()},isOpen:!1,currentMenu:null,openSubMenu:function(b,c){this.currentMenu!==b&&(null!==this.currentMenu&&(this.currentMenu.close(c),this.currentMenu.container.interactiveChildren=!1,c?this.currentMenu.container.alpha=0:a.UI.Tween.to(this.currentMenu.container,.2,{alpha:0},a.UI.Ease.Cubic.easeOut)),this.currentMenu=b,b.open(c),b.container.interactiveChildren=!0,c?(b.container.scale=1,b.container.alpha=1):a.UI.Tween.fromTo(b.container,.5,{alpha:0,scale:.95},{alpha:1,scale:1},a.UI.Ease.Cubic.easeOut)),this.open(c)},close:function(b,c){if(pf.isOpen)if(Dd.joined||b){pf.isOpen=!1,this.stopMusic(),pf.container.interactiveChildren=!1,Dd.Scene.UI_INGAME.visible=!0,Dd.Scene.UI_INGAME.interactiveChildren=!0,this.effectsAdded&&(Dd.UI.FilterBlur.Remove(),Dd.UI.FilterGray.Remove(),this.effectsAdded=!1),a.UI.Tween.to(Dd.Scene.UI_MainMenu,.5,{alpha:0,onComplete:function(){pf.isOpen||(Dd.Scene.UI_MainMenu.visible=!1)}},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(this.container,.5,{scale:.7},a.UI.Ease.Circ.CircOut),f("._menu").hide(),f("#inGameUI").fadeIn(100),Dd.Scene.layerDebugStage.visible=!0,Dd.Scene.UIStage.visible=!0,Dd.isAlive&&(Dd.Scene.layerSkyHelpers.visible=!0);for(var d=0;d<this.onCloseFunctions.length;d++)this.onCloseFunctions[d]()}else this.openSubMenu(this.homePage,!0)},musicInitialized:!1,musicPlaying:!1,initMusic:function(){Dd.Audio.Common.music.Preload(function(){u(function(){pf.musicInitialized=!0,pf.isOpen&&pf.startMusic()},100)})},startMusic:function(){this.musicInitialized&&this.isOpen&&(this.musicPlaying||(Dd.Audio.Common.music.Play(),this.musicPlaying=!0),Dd.Audio.Common.music.Rate(rf.UserSettings["MusicPitch"]))},stopMusic:function(){this.musicPlaying&&(Dd.Audio.Common.music.Stop(),this.musicPlaying=!1)},open:function(b){if(!pf.isOpen&&(this.isOpen=!0,this.startMusic(),!Dd.isMobile.tablet&&!Dd.isMobile.phone)){Dd.Scene.UI_MainMenu.visible=!0,this.container.interactiveChildren=!0,f("._menu").show(),f("#inGameUI").fadeOut(100),Dd.Scene.layerSkyHelpers.visible=!1,Dd.Scene.UIStage.visible=!1,Dd.Scene.UI_INGAME.visible=!1,Dd.Scene.UI_INGAME.interactiveChildren=!1,b?(Dd.Scene.UI_MainMenu.alpha=1,this.container.scale=1):(a.UI.Tween.fromTo(Dd.Scene.UI_MainMenu,.5,{alpha:0},{alpha:1},a.UI.Ease.Circ.CircOut),a.UI.Tween.fromTo(this.container,.5,{scale:.7},{scale:1},a.UI.Ease.Circ.CircOut)),this.effectsAdded||(Dd.UI.FilterBlur.Add(),Dd.UI.FilterGray.Add(),this.effectsAdded=!0);for(var c=0;c<this.onOpenFunctions.length;c++)this.onOpenFunctions[c]()}},unselectButtons:function(){for(var a in this.buttons)var b=this.buttons[a].setActive(!1)}},qf={YesNo:function(a,b,c,d){var e=f("<div class='dialog'>"),g=f("<div class='dialog_text'>"),h=f("<div class='dialog_button dialog_confirm'>YES</div>"),i=f("<div class='dialog_button dialog_cancel'>NO</div>");g.html(a),e.append(g),e.append(h),e.append(i),f("#DialogUI").append(e),f("#DialogUI").show(),e.fadeIn(300),h.click(function(){"function"==typeof c&&c(),f("#DialogUI").hide(),e.remove()}),i.click(function(){"function"==typeof d&&d(),f("#DialogUI").hide(),e.remove()}),e.draggable({scroll:!1}),b?$e.positionMouseCenter(e):$e.centerOnScreen(e),$e.monitorPosition(e)},ConfirmCancel:function(a,b,c,d){alert('PopUp "confirm/cancel" not implemented yet')},OK:function(a,b){var c=f("<div class='dialog'>"),d=f("<div class='dialog_text'>"),e=f("<div class='dialog_button dialog_confirm'>OK</div>");d.html(a),c.append(d),c.append(e),f("#DialogUI").append(c),f("#DialogUI").show(),c.fadeIn(300),e.click(function(){f("#DialogUI").hide(),c.remove()}),c.draggable({scroll:!1}),b?$e.positionMouseCenter(c):$e.centerOnScreen(c),$e.monitorPosition(c)}},rf={storageKey:"usersettingsv18",UserSettings:{Region:null,AutoDetect:!0,MaxTankTier:"0",ColorBlind:!1,ColorMe:"#d2b48c",ColorTeam:"#00b3ff",ColorEnemy:"#e90c1c",ColorAlphaMe:.2,ColorAlphaTeam:.8,ColorAlphaEnemy:0,ColorCrosshair:"#11ff00",HelperScaleMe:1.3,HelperScaleTeam:.65,HelperScaleEnemy:.65,HelperControls:!0,HelperSpawn:!0,VolumeMute:!1,VolumeMaster:.75,VolumeGame:.75,VolumeMusic:.5,VolumeAnnouncer:.5,VolumeUI:.5,VolumeMeEngine:.5,VolumeMeShoot:.5,MusicPitch:1,UseRAF:!0,ShowFPS:!0,MaxFPS:180,RenderQuality:1,AdvancedControls:!1,SimulateCarControls:!1,Input_WeaponReload:82,Input_Chat:13,Input_ChatTeam:85,Input_ChatParty:73,Input_ChatQuickView:90,Input_ToggleScoreBoard:9,Input_Forward:87,Input_Backward:83,Input_Left:65,Input_Right:68,Input_Forward2:38,Input_Backward2:40,Input_Left2:37,Input_Right2:39,Input_EnterEject:70,Input_AbilitySlot1:49,Input_AbilitySlot2:50,Input_AbilitySlot3:51,Input_AbilitySlot4:52,Input_AbilitySlot5:53,Input_AbilitySlot6:54},init:function(){for(var a in Dd.PowerUps){this.UserSettings["Input_Ability_"+Dd.PowerUps[a].id]=0}this.loadUserSettings(),Wc=this.UserSettings["RenderQuality"],Dd.Gameloop.LoadFPSSettings(),Dd.InputManager.UpdateOverrideKeys(),Dd.Crosshair.updateColor(),this.initVolumeSettings()},initVolumeSettings:function(){g.volume(0);var a=function(b){if(!b){g.volume(0);var c=!(!(!g.usingWebAudio||g.masterGain&&g.masterGain.gain)||!Dd.started);return void u(function(){a(c)},500)}g.finallyStarted=!0,u(function(){Dd.Audio.Update(),g.usingWebAudio&&(pf.initMusic(),Dd.Audio.Update())},100)};a()},loadUserSettings:function(){if(!this.DefaultUserSettings){var a=JSON.stringify(this.UserSettings);this.DefaultUserSettings=JSON.parse(a)}if("undefined"!=typeof Storage){var a=localStorage.getObject(this.storageKey);if(a)for(var b in a)void 0!==this.UserSettings[b]&&(this.UserSettings[b]=a[b])}},saveUserSettings:function(){"undefined"!=typeof Storage&&localStorage.setObject(this.storageKey,this.UserSettings)}},sf=function(){var b={},c=this.container=new a.UI.Container(294,23);c.anchorRight=0,c.anchorTop=-30;var d=new a.UI.SliceSprite(cf,6,(!0),(!0));d.width=294,d.height=23,d.alpha=.2,d.tint=0,d.anchorRight=0;var e=new a.UI.SliceSprite(new a.Texture.fromFrame("UI/Menu/Wallet/background.png"),24,(!0),(!1));e.width="42%",e.alpha=.25,e.anchorRight=0;var f=new a.UI.SliceSprite(new a.Texture.fromFrame("UI/Menu/Wallet/background.png"),24,(!0),(!1));f.width="73%",f.alpha=.3,f.anchorRight=0;var g=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Wallet/button.png")});g.anchorRight=0,g.on("click",function(){pf.open(),pf.buttons.Shop.button.click(),pf.shopPage.menuButtons["GOLD"].click(),googa("send","event","Shop Menu","Wallet '+' Click")}),c.addChild(d,e,f,g);var h=b[ah.Gold]=new ec(0,ah.Gold,1);h.container.anchorRight=30,h.container.anchorBottom=2,c.addChild(h.container);var i=b[ah.Gems]=new ec(0,ah.Gems,1);i.container.anchorRight=117,i.container.anchorBottom=2,c.addChild(i.container);var j=b[ah.Talent]=new ec(0,ah.Talent,1);j.container.anchorRight=212,j.container.anchorBottom=2,c.addChild(j.container),this.UpdateBalance=function(a,c){var d=b[a];d&&d.updateAmount(c)},this.AddBalance=function(a,c){var d=b[a];d&&d.addAmount(c)}},tf={1:500,2:2e3,3:5e3,4:15e3,5:3e4,6:5e4,7:8e4,8:1e9},uf=function(a){this.index=a,this.xp=0,this.commanderId=-1,this.commanderInventoryId=-1,this.commanderData={},this.firstAbilityId=-1,this.firstAbilityInventoryId=-1,this.secondAbilityId=-1,this.secondAbilityInventoryId=-1,this.classId=-1,this.unlocked=!1,this.stat={experience:0,damage:0,health:0,speed:0,aimSpeed:0,explosiveResistance:0,fireResistance:0,piercingResistance:0,electricResistance:0,chemicalResistance:0},this.levelupStat={experience:0,damage:0,health:0,speed:0,aimSpeed:0,explosiveResistance:0,fireResistance:0,piercingResistance:0,electricResistance:0,chemicalResistance:0},this.resetLevelupStats=function(){for(var a in this.levelupStat)this.levelupStat[a]=0},this.getName=function(){return vf[this.index]},this.getLevel=function(){return _b(this.xp)},this.getLevelXPCurrent=function(){var a=this.getLevel();return a>1?this.xp-tf[a-1]:this.xp},this.getLevelXPMax=function(){var a=this.getLevel();return a>1?tf[a]-tf[a-1]:tf[a]},this.getLevelXPMissing=function(){return this.getLevelXPMax()-this.getLevelXPCurrent()},this.getStatPointCount=function(){var a=0;for(var b in this.stat)a+=this.stat[b];return a},this.getUsedStatPointCount=function(){var a=0;for(var b in this.levelupStat)a+=this.levelupStat[b];return a},this.getTotalStatPointCount=function(){return 3*this.getLevel()-3},this.getAvailableStatPoints=function(){return this.getTotalStatPointCount()-this.getStatPointCount()},this.getRemainingStatPoints=function(){return this.getAvailableStatPoints()-this.getUsedStatPointCount()},this.levelUp=function(){return this.getAvailableStatPoints()>0},this.update=function(a){this.clear(),this.unlocked=!0,this.index=a[0],this.commanderId=a[1],this.commanderInventoryId=a[2],this.commanderData=a[3]&&a[3].length?JSON.parse(a[3]):{},this.firstAbilityId=a[4],this.firstAbilityInventoryId=a[5],this.secondAbilityId=a[6],this.secondAbilityInventoryId=a[7],this.classId=a[8],this.xp=a[9],this.stat.experience=a[10],this.stat.damage=a[11],this.stat.health=a[12],this.stat.speed=a[13],this.stat.aimSpeed=a[14],this.stat.explosiveResistance=a[15],this.stat.fireResistance=a[16],this.stat.piercingResistance=a[17],this.stat.electricResistance=a[18],this.stat.chemicalResistance=a[19]},this.clear=function(){this.unlocked=!1;for(var a in this.stat)this.stat[a]=0,this.levelupStat[a]=0}},vf={0:"ALPHA",1:"BRAVO",2:"CHARLIE",3:"DELTA",4:"ECHO",5:"FOXTROT"},wf=function(){var b=this.container=new a.UI.Button({width:147,height:99,background:a.UI.Sprite.fromFrame("UI/crew/preview_bg.png")});b.background.tint=0,b.background.alpha=.2,b.on("click",function(){return 0===Dd.friendID?void xc.open("You must sign-in to recruit crews"):void f.post("/Shop/StartUnlockCrew").done(function(a){if(a.success){vc.open(a.price,a.currency,"UNLOCK CREW",-1,function(){pf.crews.getCrewCount();f.post("/Shop/UnlockCrew").done(function(a){a.success?(pf.wallet.UpdateBalance(a.currency,a.balance),nc.open("PURCHASE COMPLETE","UNLOCK CREW","OK"),pf.crews.AddCrew(a.data,!0),googa("send","event","Crew Purchase","Success UnlockCrew("+vf[a.data[0]]+")")):(a.message?nc.open("PURCHASE ERROR",a.message,"OK"):nc.open("PURCHASE ERROR","","OK"),googa("send","event","Crew Purchase","Error UnlockCrew"))})})}else{if(a.missing){pc.open(a.missing,a.currency),googa("send","event","Crew Purchase","Not Enough Money")}a.message&&nc.open("ERROR",a.message,"OK")}})}),b.on("hover",function(c){a.UI.Tween.to(b.background,.3,{alpha:c?.25:.2},a.UI.Ease.Circ.CircOut)});var c=new a.UI.DynamicText("RECRUIT CREW",{style:_c});c.top=32,c.horizontalAlign="center",b.addChild(c);var d=new ec(0,ah.Gems,1);d.container.horizontalAlign="center",d.container.y=69,b.addChild(d.container),this.update=function(a){d.container.alpha=0;var b=5e3,c=ah.Gold;4==a?(b=15e3,c=ah.Gold):5==a&&(b=150,c=ah.Gems),d.updateAmount(b),d.updateCurrency(c),u(function(){d.container.width=d.text.width+20,d.container.alpha=1},0)}},xf=function(b){var c=this;this.empty=!0,this.crew=b;var d=this.container=new a.UI.Button({width:147,height:99,background:a.UI.Sprite.fromFrame("UI/crew/preview_bg.png")});d.on("click",function(){pf.openSubMenu(pf.crewPage),pf.crewPage.load(c.crew),xf.setActive(c)}),d.on("hover",function(b){a.UI.Tween.to(d,.3,{alpha:b?1:.9},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(e,.3,{scale:b?1.05:1},a.UI.Ease.Circ.CircOut)}),d.alpha=.9;var e=new a.UI.Container;e.x=74,e.y=50,d.addChild(e);var f=new a.UI.DynamicText(" ",{style:gd});f.top=6,f.left=8,d.addChild(f);var g,h=void 0;this.loadTank=function(b,c){this.empty=!1,f.text=vf[c];var i=tankClass[b];h&&e.container.removeChild(h.container),i?(h=i.PreviewCrew,h||(h=i.PreviewCrew=new S,h.container.scale.set(1==i.WeightClass?.68:2==i.WeightClass?.65:.6)),h.loadClass(b,i.SkinCannon?i.SkinCannon:i.DefaultSkinCannon,i.SkinBody?i.SkinBody:i.DefaultSkinBody),e.container.addChild(h.container),g&&d.removeChild(g)):(g||(g=new a.UI.DynamicText("NO TANK EQUIPPED",{style:gd}),g.horizontalAlign="center",g.verticalAlign="middle",g.alpha=.6),d.addChild(g))},this.setLevel=function(b,c){if(this.levelText||(this.levelText=new a.UI.DynamicText(" ",{style:$c,allowTags:!0}),this.levelText.anchorTop=6,this.levelText.anchorRight=8,d.addChild(this.levelText)),this.levelText.value="<font size='11' tint='#cccccc'>LEVEL</font> "+b,c){if(!this.levelUpBox){this.levelUpBox=new a.UI.SliceSprite(cf,3,(!0),(!0)),this.levelUpBox.tint=0,this.levelUpBox.width=80,this.levelUpBox.height=24,this.levelUpBox.anchorBottom=-1,this.levelUpBox.anchorLeft=5,this.levelUpBox.alpha=0,d.addChild(this.levelUpBox);var e=new a.UI.DynamicText("<font tint='#ffde00' shadow='#ffde00 1 0 0 10'><b>LEVEL UP  </b></font>",{style:ad,allowTags:!0});e.anchorLeft=12,e.anchorTop=3,this.levelUpBox.addChild(e)}a.UI.Tween.to(this.levelUpBox,.3,{alpha:1},a.UI.Ease.Circ.CircOut)}else this.levelUpBox&&a.UI.Tween.to(this.levelUpBox,.3,{alpha:0},a.UI.Ease.Circ.CircOut)},this.setFocus=function(b){d.background.sprite.texture=a.Texture.fromFrame(b?"UI/crew/preview_bg_active.png":"UI/crew/preview_bg.png")},this.abilities=[],this.setAbility=function(b,c){if(0==c||1==c){var e=this.abilities[c];e?e.icon.texture=a.Texture.fromFrame("UI/PowerUp/"+b+".png"):(e=this.abilities[c]={container:new a.UI.Container,icon:a.UI.Sprite.fromFrame("UI/PowerUp/"+b+".png"),shadow:a.UI.Sprite.fromFrame("UI/PowerUp/white.png")},e.container.addChild(e.shadow,e.icon),e.icon.pivot=e.shadow.pivot=.5,e.shadow.tint=0,e.shadow.alpha=1,e.shadow.top=3,e.shadow.left=-1,e.shadow.scale=1.1,e.container.scale=.3,d.addChild(e.container),e.container.anchorBottom=12,e.container.anchorRight=0==c?41:16)}},this.update=function(){this.loadTank(b.classId,b.index),this.setLevel(b.getLevel(),b.getAvailableStatPoints()>0),this.setAbility(-2,0),this.setAbility(-2,1)}};xf.activeCrew=!1,xf.setActive=function(a){xf.activeCrew&&(xf.activeCrew.setFocus(!1),xf.activeCrew=!1),a&&(pf.unselectButtons(),xf.activeCrew=a,xf.activeCrew.setFocus(!0))};var yf,zf,Af,Bf=function(){var b=this,c=0,d=this.container=new a.UI.Container(500,90);d.bottom=-10,d.horizontalAlign="center";for(var e={},f=this.previews={},g=0;g<6;g++)e[g]=new uf(g),f[g]=new xf(e[g]);this.getCrew=function(a){return e[a]},this.getMaxLevel=function(){var a=1;for(var b in e){var c=e[b];c.unlocked&&(a=k.max(a,c.getLevel()));
}return a},this.getCrewCount=function(){var a=0;for(var b in e){e[b].unlocked&&a++}return a};var h=new wf;d.addChild(h.container);var i=function(){var a=10,b=140;c=0;var g=0;for(var i in e){var j=e[i],k=f[i];j.unlocked&&(k.container.anchorLeft=i*(b+a),g=q(i),c++)}c<6?(d.width=(c+1)*(b+a)-a,h.update(c),h.container.interactive=h.container.visible=!0):(d.width=c*(b+a)-a+10,h.container.interactive=h.container.visible=!1),h.container.anchorLeft=(g+1)*(b+a)};this.updatePreview=function(a){f[a].update()};var j=this.AddCrew=function(a,b){var c=a[0],g=e[c];g.update(a),f[c].update(),d.addChild(f[c].container),b&&i(),pf.crewPage.currentCrew==g&&pf.crewPage.refresh()};this.LoadCrews=function(a){this.Clear(),c=a.length;for(var b=0,d=0;d<a.length;d++)j(a[d],!1),b=d+1;i()},this.Clear=function(){for(var a in e)var b=e[a].clear();for(var a in f){var c=f[a];c.container.parent&&c.container.parent.removeChild(c.container)}},this.LoadGuestCrews=function(){this.LoadCrews([[0,-1,-1,"",-1,-1,-1,-1,100,0,0,0,0,0,0,0,0,0,0,0],[1,-1,-1,"",-1,-1,-1,-1,200,0,0,0,0,0,0,0,0,0,0,0],[2,-1,-1,"",-1,-1,-1,-1,300,0,0,0,0,0,0,0,0,0,0,0]])},b.LoadGuestCrews()},Cf=function(){var b=this,c=!1,d=0,e=3,f=new Oc,g=this.container=new a.UI.Container,h=!1,j=new a.particles.Emitter(g.container,[a.Texture.fromFrame("Particles/debris01.png"),a.Texture.fromFrame("Particles/debris02.png"),a.Texture.fromFrame("Particles/debris03.png"),a.Texture.fromFrame("Particles/debris04.png")],Sd),l=new a.particles.Emitter(g.container,[a.Texture.fromFrame("Particles/flame.png")],{alpha:{start:1,end:.2},scale:{start:2,end:.3,minimumScaleMultiplier:1},color:{start:"#ad6428",end:"#f7a134"},speed:{start:1e3,end:0},acceleration:{x:0,y:0},startRotation:{min:0,max:0},rotationSpeed:{min:0,max:0},lifetime:{min:.3,max:.5},blendMode:"add",frequency:1,emitterLifetime:2,maxParticles:500,pos:{x:0,y:0},addAtBack:!1,spawnType:"burst",particlesPerWave:30,particleSpacing:0,angleStart:0}),m=new a.particles.Emitter(g.container,[a.Texture.fromFrame("Particles/flame.png")],Td);j.emit=!1,m.emit=!1,l.emit=!1;var n=a.Sprite.fromFrame("Particles/particle_big.png");n.anchor.set(.5),n.scale.set(3.5),n.blendMode=a.BLEND_MODES.ADD,n.tint=16758886,g.container.addChild(n),n.alpha=0;var o=(new i).to(n,.35,{alpha:0});o.stop(),this.update=function(a){d+=a,c&&(j.ownerPos.set(f.x,f.y),m.ownerPos.set(f.x,f.y),l.ownerPos.set(f.x,f.y),j.update(a),m.update(a),l.update(a)),d>e&&b.stop()},this.stop=function(){h&&(j.cleanup(),m.cleanup(),l.cleanup(),n.visible=!1,PE.GameLoop.offUpdate(this.update,this),h=!1)},this.start=function(){h&&this.stop(),g.scale=.2*k.random()+.5,d=0,n.visible=!0,n.alpha=.35,o.gotoAndPlay(0),c=!0,j.emit=!0,m.emit=!0,l.emit=!0,PE.GameLoop.onUpdate(this.update,this),h=!0}},Df=function(b){var d=this;this.distance=0,this.angle=0,this.item=null;var e=!1,f=new Oc,g=new Cf,h=this.container=new a.UI.Container,i=new a.UI.Container;i.alpha=0,h.addChild(i);var l=a.UI.Sprite.fromFrame("UI/blank.png");i.addChild(l),h.addChild(g.container),i.pixelPerfect=h.pixelPerfect=l.pixelPerfect=!1,l.pivotY=.6,l.pivotX=.5;var m=new a.UI.DynamicText("0",{style:{tint:"#f5f5f5",fontSize:30,fontFamily:"impact",fontWeight:"bold",stroke:"2"}});m.align="center",m.anchorBottom=-50,m.visible=!1,i.addChild(m);var n=function(a){d.distance?Oc.Forward(d.angle,d.distance,f):f.set(0),h.x=f.x,h.y=f.y,d.angle+=1*a},o=(new j).to(i,0,{alpha:0}).to(l,0,{scale:0}).to(this,.4,{distance:200,ease:Sine.easeOut},.1*b+.3).fromTo(i,.3,{alpha:0},{alpha:1,ease:Sine.easeOut},.1*b+.3).fromTo(l,.3,{scale:0},{scale:.6,ease:Sine.easeOut},.1*b+.3);o.gotoAndStop(0),this.start=function(){e&&this.stop(),u(function(){Dd.Audio.Common.ui_crate_wosh.Play()},1e3*(.1*b+.3)),e=!0,this.angle=k.PI/5*b,o.gotoAndPlay(0),PE.GameLoop.onUpdate(n,this),i.alpha=0,i.visible=!0},this.stop=function(){e&&(d.distance=0,e=!1,PE.GameLoop.offUpdate(n,this),o.stop(),g.stop(),i.alpha=0,d.clearInfos())},this.explode=function(){Dd.Audio.Common.explosion_3_crate.Play(),g.start(),i.visible=!1},this.load=function(a){d.clearInfos(),this.item=a,0===this.item.Type||1===this.item.Type?this.loadItem(this.item):this.loadCurrency(this.item)};var p=function(a,b,c){var d=b/a.width,e=c/a.height,f=Mathf.min(d,e);a.width=k.round(a.width*f),a.height=k.round(a.height*f)};this.loadItem=function(b){var c=eg.items[b.Data],d=a.Texture.fromImage(c.imageURL);l.sprite.texture=d,l.width=d.width,l.height=d.height,p(l,200,200),b.Amount>1?(m.style.tint=16777215,m.visible=!0,m.value="x"+b.Amount):m.visible=!1},this.loadCurrency=function(b){var c=bh[b.Data],d=b.Amount,e=b.Rarity;m.text=d+"",m.visible=!0,"Gems"===c?m.style.tint="#d2fe8a":"Talent"===c?m.style.tint="#e4f7fe":"Gold"===c&&(m.style.tint="#ffdc41");var f="small";3===e?f="medium":4===e?f="large":e>4&&(f="big");var g=a.Texture.fromFrame("CrateCurrency/"+c+"/"+f+".png");l.sprite.texture=g,l.width=g.width,l.height=g.height,p(l,200,200)},this.focus=function(){o.stop(),c.set(i,{alpha:1}),c.to(this,1.5,{distance:0,ease:Sine.easeOut}),c.to(l,1.5,{scale:1,ease:Sine.easeOut}),1===this.item.Type&&this.item.UniqueData&&this.setCommanderInfo(JSON.parse(this.item.UniqueData))},this.clearInfos=function(){q&&(q.visible=!1)};var q,r;this.setCommanderInfo=function(b){if(!q){q=new a.UI.Container(150,90),q.top=-50;var c=a.UI.Sprite.fromFrame("UI/blank.png");c.tint=0,c.anchorLeft=c.anchorRight=c.anchorBottom=c.anchorTop=-10,c.alpha=.5,q.addChild(c);var d=new a.UI.DynamicText(nf("STATS"),{style:jd});d.align="center",q.addChild(d),r=new hh("100%"),r.container.top=20,q.addChild(r.container),h.addChild(q)}r.update(b),q.visible=!0,a.UI.Tween.fromTo(q,3,{alpha:0,left:0},{alpha:1,left:130},a.UI.Ease.Circ.CircOut)},i.alpha=0},Ef=function(b){var d=this,e=!1,f=[],g=[],h=1,i=this.container=new a.UI.Container,j=!1;i.left=i.top="50%",i.alpha=0;var k=this.animation=void 0,l=function(){for(var b=0;b<f.length;b++)g.push(a.Texture.fromFrame(f[b]));k=d.animation=new a.extras.AnimatedSprite(g),k.anchor.set(.5),k.loop=!1,i.container.addChild(k),k.onFrameChange=function(){k.currentFrame>=7&&j&&k.gotoAndPlay(0)}},m=this.reset=function(){k.scale.set(0),i.alpha=0,k.gotoAndStop(0)};this.shake=function(){Dd.Audio.Common.ui_crate_shake.Play(),k.animationSpeed=.8,j=!0,i.interactive=!1,k.gotoAndPlay(0)},this.open=function(){Dd.Audio.Common.ui_crate_shake.FadeOut(.5),Dd.Audio.Common.ui_crate_open.Play(),k.animationSpeed=1,j=!1,i.interactive=!0};var n=function(a){c.to(k.scale,1,{x:h,y:h,ease:Sine.easeOut}),c.to(i,1,{alpha:1,ease:Sine.easeOut}),a()};this.load=function(c){if(e)return m(),void n(c);e=!0;var d=new a.loaders.Loader;d.add("/Content/Crate/"+b+"/spritesheet.json"),d.add("/Content/CreateCurrency/spritesheet.json");for(var g=1;g<=7;g++){var h="Crate_"+b+"/shake-"+g+".png";f.push(h)}for(var g=1;g<=37;g++){var h="Crate_"+b+"/open-"+g+".png";f.push(h)}d.load(function(){l(),m(),n(c)})}},Ff={},Gf=function(){var b=this,d=!1,e=!1,g=this.container=new a.UI.Container("100%","100%"),h=new a.UI.Container;h.left=h.top="50%";var i=new a.UI.Container;i.left=i.top="50%";var j,k,l,m,o,p,q,s,v,w,x,y=void 0,z=!1,A=!1,B=!1,C=2,D=1,E=-1,F=[],G=[],H=function(){d=!0,v=a.UI.Sprite.fromFrame("UI/blank.png"),v.tint=0,v.width=v.height="100%",v.alpha=.5,g.addChild(v),v.interactive=!0;var c=new a.UI.Sprite(df);c.tint=0,c.height=400,c.scaleY=-1,c.pivotY=0,c.width="100%",c.alpha=1,c.bottom=0,g.addChild(c),k=new a.UI.Container,k.verticalAlign="middle",k.horizontalAlign="center",k.scale=1,k.alpha=0,j=new a.particles.Emitter(k.container,[a.Texture.fromFrame("Particles/lightning1.png")],Od),j.particleBlendMode=a.BLEND_MODES.ADD,g.addChild(k,h,i),l=new a.UI.DynamicText("Click the crate, to open it!",{style:md,width:"100%"}),l.style.align="center",l.anchorTop=20,g.addChild(l);for(var e=0;e<10;e++){var f=new Df(e);i.addChild(f.container),F.push(f)}s=new a.UI.Container(410,80),s.horizontalAlign="center",s.anchorBottom=0,o=new lh(200,60,function(){b.close()},new a.UI.DynamicText("CLOSE",{style:id})),o.anchorLeft=0,s.addChild(o),p=new lh(200,60,function(){b.show(E,D)},new a.UI.DynamicText("OPEN NEXT",{style:id})),p.anchorRight=0,s.addChild(p),q=new lh(200,60,function(){pf.open(),pf.buttons.Shop.button.click(),pf.shopPage.menuButtons["CRATES"].click(),googa("send","event","Crate Open","Buy More"),b.close()},new a.UI.DynamicText("BUY MORE",{style:id})),q.anchorRight=0,s.addChild(q),m=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/blank.png"),width:500,height:500}),m.verticalAlign="middle",m.horizontalAlign="center",m.background.alpha=0,m.width=m.height=400,m.on("click",function(){b.start()}),m.interactive=!1,g.addChild(m,s)},I=function(a){j.update(a),z&&A&&(C-=a,C<=0&&b.fire())},J=this.reset=function(){z=!1,A=!1,B=!1,y&&(y.container.visible=!1),l.value="Click the crate, to open it!",s.width=200,p.interactive=p.visible=!1,q.interactive=q.visible=!1,G=[],k&&c.to(k,1,{alpha:0,ease:Sine.easeOut});for(var a=0;a<F.length;a++)F[a].stop()};this.show=function(a,b){D=b,E=a,d||H(),e||(r.addEventListener("keydown",M,!1),e=!0,PE.GameLoop.onUpdate(I,this),g.visible=g.interactive=!0),J();var f=Ff[a];f||(f=Ff[a]=new Ef(a)),y=f,y.container.visible=!0,h.addChild(y.container),y.load(function(){c.fromTo(k,2,{alpha:0,scale:0},{alpha:.5,scale:1,ease:Sine.easeOut}),m.interactive=!0})},this.close=function(){e&&(PE.GameLoop.offUpdate(I,this),r.removeEventListener("keydown",M),e=!1,g.visible=g.interactive=!1)};var K;this.start=function(){return z?void this.fire():(z=!0,y.shake(),m.interactive=v.interactive=o.interactive=o.visible=!1,void f.post("/Inventory/OpenCrate",{id:D}).done(function(a){var c=[],d=a.Rewards;w=a.Index,x=d[w],D=a.Next;for(var e=0;e<d.length;e++){var f=d[e];0!==f.Type&&1!==f.Type||c.push(f.Data)}eg.loadItemInfo(c,function(){for(var a=0;a<d.length;a++){F[a].load(d[a])}l.value='Click to speed up! (or "press/hold" Space)',m.interactive=!0,B=!0;var c=Mathf.round(500*Mathf.random()+250);K=u(function(){b.openCrate()},c)})}))},this.openCrate=function(){t(K),C=2,A=!0,G=[];for(var a=0;a<F.length;a++){var b=F[a];b.start(),G.push(b)}y.open()};var L=0;this.complete=function(){l.value="Congratulations!";var a=D>0;if(L=n.now(),s.width=410,p.visible=p.interactive=a,q.visible=q.interactive=!p.visible,pf.isOpen&&pf.inventoryPage.isOpen&&(pf.inventoryPage.refresh(),pg.selectedItem&&pg.selectedItem.setActive(!1)),v.interactive=o.interactive=o.visible=!0,0===x.Type||1===x.Type){new Zb("New Inventory Item",x.Amount+"x "+eg.items[x.Data].name).addButton("Show Inventory",200,5592405,function(){pf.openSubMenu(pf.inventoryPage)}).show(5e3)}else if(2===x.Type){var b=bh[x.Data];pf.wallet.AddBalance(x.Data,x.Amount),new Zb("Balance Added",x.Amount+" "+b).addButton("OK",200,5592405,function(){}).show(5e3)}};var M=function(a){if(32===a.which){if(p.visible&&p.interactive&&n.now()-L>1500)return void p.click();m.interactive&&m.click()}};this.fire=function(){if(!A)return void(B&&this.openCrate());if(C=1,G.length>1){for(var a=G.random();a.item===x;)a=G.random();if(G.splice(G.indexOf(a),1),a.explode(),1==G.length){G[0].focus(),b.complete()}}}},Hf={container:new a.UI.Container(286,324),interval:15,hover:!1,cooldown:0,banners:[],index:0,current:null,banner_fb:null,banner_twitter:null,banner_premium:null,banner_rewardAd:null,banner_referral:null,banner_signup:null,update:function(b){if(this.hover?this.cooldown=k.max(this.cooldown,3):this.cooldown-=b,this.cooldown<=0&&(this.cooldown=this.interval,this.current&&this.current.stop(),this.index++,this.index>=this.banners.length&&(this.index=0),this.current=this.banners[this.index])){this.current.start();var c=this;u(function(){c.container.addChild(c.current.container),c.current.container.container.hitArea=new a.Rectangle(0,0,286,324)},1e3)}},started:!1,initialized:!1,menueventsBound:!1,start:function(){this.initialized&&(this.hover=!1,this.started||(this.started=!0,PE.GameLoop.onUpdate(this.update,this)))},stop:function(){this.started&&(this.started=!1,PE.GameLoop.offUpdate(this.update,this))},clear:function(){this.banners=[],this.index=-1,this.cooldown=0,this.hover=!1,this.current&&(this.current.stop(),this.current=null)},init:function(){this.initialized=!0,this.clear(),this.menueventsBound||(this.menueventsBound=!0,pf.onOpen(function(){Hf.start()}),pf.onClose(function(){Hf.stop()})),this.banner_rewardAd||(this.banner_rewardAd=new Jf),this.banners.push(this.banner_rewardAd),0==Dd.friendID&&(this.banner_signup||(this.banner_signup=new Lf),this.banners.push(this.banner_signup)),ng.TwitterShareReward&&(this.banner_twitter||(this.banner_twitter=new Mf),this.banners.push(this.banner_twitter)),0==Dd.friendID||ng.Premium||(this.banner_premium||(this.banner_premium=new If),this.banners.push(this.banner_premium)),0==Dd.friendID||ng.FacebookShareReward||ng.TwitterShareReward||(this.banner_referral||(this.banner_referral=new Kf),this.banners.push(this.banner_referral)),this.start()}},If=function(){var b=this.container=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/banners/bg1.png"),width:286,height:324}),e=new a.UI.Container("100%","100%");b.addChild(e),b.background.alpha=.85;var f=new a.UI.SliceSprite(a.Texture.fromFrame("UI/banners/stroke.png"),5);f.width=f.height="100%",e.addChild(f),f.tint=13739065;var g=new a.UI.DynamicText("GET PREMIUM",{style:yd});g.x=86,g.y=28,e.addChild(g);var h=a.UI.Sprite.fromFrame("UI/Menu/premium.png");h.anchorLeft=8,h.anchorTop=0,h.pivot=.5,e.addChild(h);for(var i=[],k=["Support The Developers","<font color='#e6c800'>50%</font> Bonus Gold","<font color='#d7f5ff'>50%</font> Bonus XP","Host Private Games","No In-Game Advertisement!"],l=0;l<k.length;l++)!function(){var c=new a.UI.Container("100%",37);c.y=80+37*l,b.addChild(c);var d=a.UI.Sprite.fromFrame("UI/banners/premium/checkbox.png");d.anchorLeft=33,d.anchorTop=0,d.pivot=.5,c.addChild(d);var e=a.UI.Sprite.fromFrame("UI/banners/premium/checkmark.png");e.anchorLeft=36,e.anchorTop=-2,e.pivot=.5,c.addChild(e);var f=new a.UI.DynamicText(k[l],{style:kd,allowTags:!0});f.x=67,f.y=-2,c.addChild(f),i.push({container:c,checkbox:d,checkmark:e,text:f})}();var m=a.UI.Sprite.fromFrame("UI/blank.png");m.width=265,m.height=53,m.align="center",m.tint=14724608,m.anchorBottom=11,m.pivot=.5,e.addChild(m);var n=new a.UI.DynamicText("UPGRADE NOW",{style:ld});n.align="center",n.y=12,m.addChild(n);var o=new j({repeat:0});d.tl=o,o.set(m,{alpha:0});for(var l=0;l<i.length;l++)!function(){var a=l;o.to(i[a].checkbox,0,{alpha:0}).to(i[a].checkmark,0,{alpha:0}).to(i[a].text,0,{alpha:0})}();o.fromTo(g,.6,{alpha:0,y:"-=30"},{alpha:1,y:"+=30"},"=+0.5"),o.fromTo(h,.6,{alpha:0,anchorTop:"-=30"},{alpha:1,anchorTop:"+=30"},"=-0.6");for(var l=0;l<i.length;l++)!function(){o.fromTo(i[l].text,.4,{alpha:0,x:"+=20"},{alpha:1,x:"-=20"},"=-0.4").fromTo(i[l].checkbox,.6,{alpha:0,scale:.5},{alpha:1,scale:1,ease:Elastic.easeOut},"=-0.3")}();for(var l=0;l<i.length;l++)!function(){o.fromTo(i[l].checkmark,.6,{alpha:0,scale:3},{alpha:1,scale:1,ease:Bounce.easeOut},"=-0.3")}();o.fromTo(m,1,{alpha:0,scale:.7},{alpha:1,scale:1}),o.stop(),b.on("hover",function(c){Hf.hover=c,a.UI.Tween.to(b.background,.3,{alpha:c?1:.85},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(m,.3,{tint:c?"#f5c51f":"#e0ae00"},a.UI.Ease.Circ.CircOut)}),b.on("click",function(){pf.open(),pf.buttons.Shop.button.click(),pf.shopPage.menuButtons["PREMIUM"].click(),googa("send","event","MainMenu","Premium-ad Clicked")});var p=!1;b.alpha=0,b.visible=!1,this.start=function(){p||(b.interactive=!0,b.visible=!0,p=!0,o.gotoAndPlay(0),c.to(b,1,{alpha:1}))},this.stop=function(){p&&(p=!1,b.interactive=!1,c.to(b,1,{alpha:0,onComplete:function(){p||(b.visible=!1)}}))}},Jf=function(){var b=this.container=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/banners/bg1.png"),width:286,height:324}),d=new a.UI.Container("100%","100%");b.addChild(d),b.background.alpha=.85;var e=new a.UI.SliceSprite(a.Texture.fromFrame("UI/banners/stroke.png"),5);e.width=e.height="100%",d.addChild(e),e.tint=8820535;var f=new a.UI.DynamicText("WATCH VIDEO AD",{style:ld});f.align="center",f.y=15,d.addChild(f);var g=a.UI.Sprite.fromFrame("UI/banners/video.png");g.align="center",g.pivot=.5,g.anchorTop=56,d.addChild(g);var h=a.UI.Sprite.fromFrame("UI/Menu/Currency/gem2.png");h.pivot=.5,h.anchorTop=180,h.anchorLeft=95,h.width=50,h.height=50;var i=a.UI.Sprite.fromFrame("UI/Menu/Currency/gem2.png");i.pivot=.5,i.anchorTop=180,i.anchorLeft=135,i.width=50,i.height=50,b.addChild(h),b.addChild(i);var k=new a.UI.DynamicText("And get",{style:qd});k.pivot=.5,k.align="center",k.anchorTop=143,d.addChild(k);var l=new a.UI.DynamicText("2 Gems",{style:xd});l.style.tint="#dbf791",l.pivot=.5,l.align="center",l.anchorTop=152,d.addChild(l);var m=a.UI.Sprite.fromFrame("UI/blank.png");m.width=265,m.height=53,m.align="center",m.tint=8820535,m.anchorBottom=11,m.pivot=.5,d.addChild(m);var n=new a.UI.DynamicText("WATCH NOW",{style:ld});n.x=80,n.y=12,m.addChild(n);var o=a.UI.Sprite.fromFrame("UI/banners/video.png");o.x=10,o.y=9,m.addChild(o);var p=new j({repeat:0});p.set(f,{alpha:0}).set(g,{alpha:0}).set(h,{alpha:0}).set(i,{alpha:0}).set(k,{alpha:0,anchorTop:143}).set(l,{alpha:0}).set(m,{alpha:0}),p.fromTo(f,.6,{alpha:0,y:-15},{alpha:1,y:15,ease:Bounce.easeOut},"=+0.5"),p.fromTo(g,.8,{alpha:0,scale:2},{alpha:1,scale:1.5,ease:Elastic.easeOut},"=-0.3"),p.fromTo(k,.2,{alpha:0,scale:.5},{alpha:1,scale:1}).to(k,.2,{anchorTop:133},"=+0.2"),p.fromTo(l,.2,{alpha:0,scale:.5},{alpha:1,scale:1},"=-0.2"),p.fromTo(h,.7,{alpha:0,scale:.5},{alpha:1,scale:1,ease:Elastic.easeOut},"=+0.1"),p.fromTo(i,.7,{alpha:0,scale:.5},{alpha:1,scale:1,ease:Elastic.easeOut},"=-0.3"),p.fromTo(m,1,{alpha:0,scale:.7},{alpha:1,scale:1},"=+0.2"),p.stop(),b.on("hover",function(c){Hf.hover=c,a.UI.Tween.to(b.background,.3,{alpha:c?1:.85},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(m,.3,{tint:c?"#a7bb4b":"#869737"},a.UI.Ease.Circ.CircOut)}),b.on("click",function(){pf.open(),pf.buttons.Shop.button.click(),pf.shopPage.menuButtons["FREE OFFERS"].click(),Cd.WatchRewardAd(),googa("send","event","MainMenu","RewardAd-Ad Clicked")});var q=!1;b.alpha=0,b.visible=!1,this.start=function(){q||(b.interactive=!0,b.visible=!0,q=!0,p.gotoAndPlay(0),c.to(b,1,{alpha:1}))},this.stop=function(){q&&(q=!1,b.interactive=!1,c.to(b,1,{alpha:0,onComplete:function(){q||(b.visible=!1)}}))}},Kf=function(){var b="https://tankwars.io/?f="+Dd.friendID,d=this.container=new a.UI.Container(286,324);d.addChild(d);var e=a.UI.Sprite.fromFrame("UI/banners/bg1.png");e.alpha=.85,d.addChild(e);var f=new a.UI.SliceSprite(a.Texture.fromFrame("UI/banners/stroke.png"),5);f.width=f.height="100%",d.addChild(f),f.tint=4437748;var g=new a.UI.DynamicText("Refer your Friends!",{style:ld});g.align="center",g.y=18,d.addChild(g);var h=new a.UI.DynamicText("And get",{style:cd});h.pivot=.5,h.align="center",h.anchorTop=65,d.addChild(h);var i=new ec(10,ah.Gems,2);i.container.anchorLeft=89,i.container.y=110,d.addChild(i.container);var k=new a.UI.DynamicText("for every new sign-up!",{style:kd});k.x=95,k.y=85,d.addChild(k);var l=new a.UI.Button({width:265,height:53,background:a.UI.Sprite.fromFrame("UI/blank.png")});l.align="center",l.background.tint=10017791,l.anchorBottom=127,l.pivot=.5,d.addChild(l);var m=a.UI.Sprite.fromFrame("UI/blank.png");m.width="100%",m.height=30,m.anchorBottom=4,l.addChild(m);var n=a.UI.Sprite.fromFrame("UI/blank.png");n.tint=5208490,n.width=80,n.height=30,n.sprite.alpha=.7,n.anchorBottom=4,n.anchorRight=0,l.addChild(n);var o=a.UI.Sprite.fromFrame("UI/Menu/Shop/offers/copy.png");o.anchorLeft=7,o.anchorTop=5,n.addChild(o);var p=new a.UI.DynamicText("copy to\nclipboard",{style:$c});p.style.lineHeight=14,p.anchorTop=2,p.anchorLeft=30,n.addChild(p);var q=new a.UI.DynamicText("Referral Url",{style:$c});q.style.tint="#22526c",q.align="center",q.y=3,l.addChild(q);var r=new a.UI.DynamicText("https://tankwars.io/?f=123456",{style:$c});r.style.tint="#474747",r.x=15,r.y=28,l.addChild(r);var s=a.UI.Sprite.fromFrame("UI/blank.png");s.height=30,s.width=180,s.anchorBottom=4,s.alpha=0,l.addChild(s);var t=new a.UI.DynamicText("Copied",{style:jd});t.verticalAlign="middle",t.horizontalAlign="center",t.style.tint="#000000",s.addChild(t);var u=new a.UI.Button({width:265,height:53,background:a.UI.Sprite.fromFrame("UI/blank.png")});u.align="center",u.background.tint=4437748,u.anchorBottom=69,u.pivot=.5,d.addChild(u);var v=new a.UI.DynamicText("TWEET NOW",{style:ld});v.x=80,v.y=12,u.addChild(v);var w=a.UI.Sprite.fromFrame("UI/banners/twitter/logo-small.png");w.x=45,w.y=12,u.addChild(w);var x=new a.UI.Button({width:265,height:53,background:a.UI.Sprite.fromFrame("UI/blank.png")});x.align="center",x.background.tint=4745130,x.anchorBottom=11,x.pivot=.5,d.addChild(x);var y=new a.UI.DynamicText("SHARE NOW",{style:ld});y.x=80,y.y=12,x.addChild(y);var z=a.UI.Sprite.fromFrame("UI/banners/facebook/logo-small.png");z.x=53,z.y=17,x.addChild(z);var A=new j({repeat:0});A.set(g,{alpha:0}).set(h,{alpha:0}).set(i.container,{alpha:0}).set(k,{alpha:0}).set(u,{alpha:0}),A.fromTo(g,.6,{alpha:0,y:-15},{alpha:1,y:18,ease:Bounce.easeOut},"=+0.5"),A.fromTo(h,.2,{alpha:0,scale:.5},{alpha:1,scale:1},"=+0.5"),A.fromTo(i.container,.6,{y:"-=30"},{alpha:1,y:"+=30",ease:Bounce.easeOut},"=-0.1"),A.fromTo(k,.6,{y:"-=30"},{alpha:1,y:"+=30",ease:Bounce.easeOut},"=-0.3"),A.fromTo(l,1.5,{alpha:0},{alpha:1},"=+0.2"),A.fromTo(u,1.5,{alpha:0},{alpha:1},"=-1.2"),A.fromTo(x,1.5,{alpha:0},{alpha:1},"=-1.2"),A.stop(),x.on("hover",function(b){Hf.hover=b,a.UI.Tween.to(e,.3,{alpha:b?1:.85},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(x.background,.3,{tint:b?"#5c7bbf":"#4867aa"},a.UI.Ease.Circ.CircOut)}),u.on("hover",function(b){Hf.hover=b,a.UI.Tween.to(e,.3,{alpha:b?1:.85},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(u.background,.3,{tint:b?"#6cc5f5":"#43b6f4"},a.UI.Ease.Circ.CircOut)}),l.on("hover",function(b){Hf.hover=b,a.UI.Tween.to(e,.3,{alpha:b?1:.85},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(n.sprite,.3,{alpha:b?1:.7},a.UI.Ease.Circ.CircOut)}),x.on("click",function(){googa("send","event","ReferFriendBanner","Facebook share Clicked"),Dd.shareWithOptions(null,"Join me! And become part of an epic free-to-play tank game today!",b,function(){googa("send","event","ReferFriendBanner","Facebook share Complete")})}),u.on("click",function(){googa("send","event","ReferFriendBanner","Twitter share Clicked"),Dd.tweetWithOptions("Join me! And become part of an epic free-to-play tank game today!",b,null,function(){googa("send","event","ReferFriendBanner","Twitter share Complete")})}),l.on("click",function(){Ic(b),a.UI.Tween.fromTo(s,1,{alpha:.8},{alpha:0}),googa("send","event","ReferFriendBanner","ReferURL Copied")});var B=!1;d.alpha=0,d.visible=!1,this.start=function(){b="https://tankwars.io/?f="+Dd.friendID,r.text=b,B||(d.interactive=!0,d.visible=!0,B=!0,A.gotoAndPlay(0),c.to(d,1,{alpha:1}))},this.stop=function(){B&&(B=!1,d.interactive=!1,c.to(d,1,{alpha:0,onComplete:function(){B||(d.visible=!1)}}))}},Lf=function(){var b=this.container=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/banners/bg1.png"),width:286,height:324}),d=new a.UI.Container("100%","100%");b.addChild(d),b.background.alpha=.85;var e=new a.UI.SliceSprite(a.Texture.fromFrame("UI/banners/stroke.png"),5);e.width=e.height="100%",d.addChild(e),e.tint=15644929;var f=new a.UI.DynamicText("No account yet?",{style:ld});f.align="center",f.y=26,d.addChild(f);var g=new a.UI.DynamicText("Sign up",{style:qd});g.pivot=.5,g.anchorLeft=63,g.anchorTop=55,d.addChild(g);var h=new a.UI.DynamicText("TODAY!",{style:xd});h.style.tint="#eeb901",h.pivot=.5,h.anchorLeft=139,h.anchorTop=54,d.addChild(h);var i=a.UI.Sprite.fromFrame("UI/Menu/premium.png");i.align="center",i.anchorTop=91,i.pivot=.5,d.addChild(i);var k=new a.UI.DynamicText("And get",{style:kd});k.x=88,k.y=160,d.addChild(k);var l=new a.UI.DynamicText("3 days",{style:kd});l.style.tint="#eeb901",l.x=153,l.y=160,d.addChild(l);var m=new a.UI.DynamicText("PREMIUM",{style:kd});m.align="center",m.y=180,d.addChild(m);var n=new a.UI.DynamicText("Absolutly FREE",{style:ld});n.style.tint="#eeb901",n.align="center",n.anchorTop=218,n.pivot=.5,d.addChild(n);var o=a.UI.Sprite.fromFrame("UI/blank.png");o.width=265,o.height=53,o.align="center",o.tint=14724608,o.anchorBottom=11,o.pivot=.5,d.addChild(o);var p=new a.UI.DynamicText("SIGN UP NOW",{style:ld});p.align="center",p.y=12,o.addChild(p);var q=new j({repeat:0});q.set(f,{alpha:0}).set(i,{alpha:0}).set(g,{alpha:0,anchorLeft:100}).set(h,{alpha:0}).set(k,{alpha:0}).set(l,{alpha:0}).set(m,{alpha:0}).set(n,{alpha:0}).set(o,{alpha:0}),q.fromTo(f,.6,{alpha:0,y:-15},{alpha:1,y:26,ease:Bounce.easeOut},"=+0.5"),q.fromTo(g,.2,{alpha:0,scale:.5},{alpha:1,scale:1},"=+0.4").to(g,.2,{anchorLeft:63}),q.fromTo(h,.2,{alpha:0,scale:.5},{alpha:1,scale:1},"=-0.2"),q.fromTo(k,.6,{y:"-=30"},{alpha:1,y:"+=30",ease:Bounce.easeOut},"=+0.5"),q.fromTo(l,.6,{y:"-=30"},{alpha:1,y:"+=30",ease:Bounce.easeOut},"=-0.4"),q.fromTo(m,.6,{y:"-=30"},{alpha:1,y:"+=30",ease:Bounce.easeOut},"=-0.4"),q.fromTo(i,1.5,{alpha:0,scale:1.5},{alpha:1,scale:1,ease:Elastic.easeOut},"=-0.5"),q.fromTo(n,.6,{scale:.5},{alpha:1,scale:1,ease:Bounce.easeOut},"=-0.3"),q.fromTo(o,1.3,{alpha:0,scale:.7},{alpha:1,scale:1},"=-0.6"),q.stop(),b.on("hover",function(c){Hf.hover=c,a.UI.Tween.to(b.background,.3,{alpha:c?1:.85},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(o,.3,{tint:c?"#efbe16":"#e0ae00"},a.UI.Ease.Circ.CircOut)}),b.on("click",function(){xc.open("Sign-in / Sign-up using one of the following methods!"),googa("send","event","MainMenu","Sign-up banner Clicked")});var r=!1;b.alpha=0,b.visible=!1,this.start=function(){r||(b.interactive=!0,b.visible=!0,r=!0,q.gotoAndPlay(0),c.to(b,1,{alpha:1}))},this.stop=function(){r&&(r=!1,b.interactive=!1,c.to(b,1,{alpha:0,onComplete:function(){r||(b.visible=!1)}}))}},Mf=function(){var b=this.container=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/banners/bg1.png"),width:286,height:324}),d=new a.UI.Container("100%","100%");b.addChild(d),b.background.alpha=.85;var e=new a.UI.SliceSprite(a.Texture.fromFrame("UI/banners/stroke.png"),5);e.width=e.height="100%",d.addChild(e),e.tint=5686527;var g=new a.UI.DynamicText("SHARE ON",{style:ld});g.x=89,g.y=15,d.addChild(g);var h=a.UI.Sprite.fromFrame("UI/banners/twitter/logo-big.png");h.align="center",h.pivot=.5,h.anchorTop=46,d.addChild(h);var i=a.UI.Sprite.fromFrame("UI/Crates/827.png");i.align="center",i.pivot=.5,i.anchorTop=125,d.addChild(i);var k=new a.UI.DynamicText("And get",{style:qd});k.pivot=.5,k.anchorLeft=90,k.anchorTop=103,d.addChild(k);var l=new a.UI.DynamicText("5x",{style:xd});l.style.tint="#ffe556",l.pivot=.5,l.anchorLeft=171,l.anchorTop=102,d.addChild(l);var m=new a.UI.DynamicText("+",{style:ld});m.x=19,m.y=225,d.addChild(m);var n=new ec(10,ah.Gems,2);n.container.anchorLeft=92,n.container.y=257,d.addChild(n.container);var o=new a.UI.DynamicText("for every new sign-up!",{style:kd});o.x=98,o.y=232,d.addChild(o);var p=a.UI.Sprite.fromFrame("UI/blank.png");p.width=265,p.height=53,p.align="center",p.tint=4437748,p.anchorBottom=11,p.pivot=.5,d.addChild(p);var q=new a.UI.DynamicText("TWEET NOW",{style:ld});q.x=80,q.y=12,p.addChild(q);var r=a.UI.Sprite.fromFrame("UI/banners/twitter/logo-small.png");r.x=45,r.y=12,p.addChild(r);var s=new j({repeat:0});s.set(g,{alpha:0}).set(h,{alpha:0}).set(i,{alpha:0}).set(k,{alpha:0,anchorLeft:105}).set(l,{alpha:0}).set(m,{alpha:0}).set(n.container,{alpha:0}).set(o,{alpha:0}).set(p,{alpha:0}),s.fromTo(g,.6,{alpha:0,y:-15},{alpha:1,y:15,ease:Bounce.easeOut},"=+0.5"),s.fromTo(h,.8,{alpha:0,scale:1.5},{alpha:1,scale:1,ease:Elastic.easeOut},"=-0.3"),s.fromTo(k,.2,{alpha:0,scale:.5},{alpha:1,scale:1}).to(k,.2,{anchorLeft:90},"=+0.2"),s.fromTo(l,.2,{alpha:0,scale:.5},{alpha:1,scale:1},"=-0.2"),s.fromTo(i,.7,{alpha:0,scale:.5},{alpha:1,scale:1,ease:Elastic.easeOut},"=+0.2"),s.fromTo(m,.6,{y:"-=30"},{alpha:1,y:"+=30",ease:Bounce.easeOut},"=-0.1"),s.fromTo(n.container,.6,{y:"-=30"},{alpha:1,y:"+=30",ease:Bounce.easeOut},"=-0.3"),s.fromTo(o,.6,{y:"-=30"},{alpha:1,y:"+=30",ease:Bounce.easeOut},"=-0.3"),s.fromTo(p,1,{alpha:0,scale:.7},{alpha:1,scale:1},"=+0.2"),s.stop(),b.on("hover",function(c){Hf.hover=c,a.UI.Tween.to(b.background,.3,{alpha:c?1:.85},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(p,.3,{tint:c?"#6cc5f5":"#43b6f4"},a.UI.Ease.Circ.CircOut)}),b.on("click",function(){googa("send","event","RewardShare","Twitter Clicked"),Dd.tweetWithOptions("Join me! And become part of an epic free-to-play tank game today!","https://tankwars.io?f="+Dd.friendID,null,function(){f.post("/reward/claim",{key:"twittershare"},function(a){a?(googa("send","event","RewardShare","Twitter Share - Reward"),ng.TwitterShareReward=!1,Hf.init(),new Zb("New Inventory Items","5x Supply Crates").addButton("Show Inventory",200,5592405,function(){pf.openSubMenu(pf.inventoryPage)}).show(5e3)):googa("send","event","RewardShare","Twitter Share - No Reward")})})});var t=!1;b.alpha=0,b.visible=!1,this.start=function(){t||(b.interactive=!0,b.visible=!0,t=!0,s.gotoAndPlay(0),c.to(b,1,{alpha:1}))},this.stop=function(){t&&(t=!1,b.interactive=!1,c.to(b,1,{alpha:0,onComplete:function(){t||(b.visible=!1)}}))}},Nf=new function(){function a(){return b&&b.initialize?void b.initialize(c,ng.Premium):void u(function(){a()},100)}var b,c=this;this.openLauncher=function(){return Zh.authenticated?(b=cg("/controlpanel/launch/","CUSTOM GAME LAUNCHPAD",720,1200),void a()):void xc.open("You must sign in to host custom games!")},this.startGame=function(a){return b.close(),b=null,Dd.developer?(server=Dd.Connection.currentServerUrl,void d(server,a)):"auto"===a.region?void Dd.Region.AutoDetect(function(){return null==Dd.Region.bestServer?void startGame(a):void d(Dd.Region.bestServer,a)}):void d(prefServers[a.region.toUpperCase()],a)};var d=function(a,b){return a?(Dd.developer&&(a=Dd.Connection.currentServerUrl),Dd.Connection.currentServerUrl!==a?void Dd.Connection.ConnectServer(a,null,null,function(){e(b)}):void e(b)):void nc.open("Woops!","Something went wrong connecting to the server!","OK")},e=function(a){Dd.Connection.invoke("LaunchServer",a),pf.close(!0)}},Of=function(){var b=!1,c=this.container=new a.UI.Container("100%","100%");c.visible=!1;var d,e,f,g,h,i=this;this.badges=[],this.badgeCache={},this.addBadge=function(a,b){var d=this.badgeCache[a];d||(this.badgeCache[a]=d=new Ve[a]),d.load(b),this.badges.indexOf(d)===-1&&(d.container.anchorRight=10+75*this.badges.length,d.container.visible=!0,this.badges.push(d),g.container.anchorRight=10+75*this.badges.length,c.addChild(d.container))},this.clearBadges=function(){for(var a=0;a<this.badges.length;a++)c.removeChild(this.badges[a].container);g.container.anchorRight=10,this.badges=[]};var j=function(){if(!b){b=!0;var i=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/grad-vertical-soft.png"),text:new a.UI.DynamicText(nf("Sign Out"),{style:$c}),width:64,height:20});i.anchorBottom=i.anchorLeft=5;var j=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/grad-vertical-soft.png"),text:new a.UI.DynamicText(nf("View Profile"),{style:$c}),width:81,height:20});j.anchorBottom=5,j.anchorLeft=72,j.on("click",function(){Zh.data["friendID"]&&(pf.profilePage.open(Zh.data["friendID"]),googa("send","event","MainMenu","View (me area) Profile Clicked"))});var k=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/grad-vertical-soft.png"),text:new a.UI.DynamicText(nf("Account Settings"),{style:$c}),width:100,height:20});k.anchorBottom=5,k.anchorLeft=156,g=new Pf,g.container.anchorRight=0,g.container.visible=!1,i.text.style.tint=j.text.style.tint=k.text.style.tint="#EDEDED",i.background.alpha=j.background.alpha=k.background.alpha=.38,i.background.tint=j.background.tint=k.background.tint=0;var l=function(a){this.background.alpha=a?.5:.38,this.text.style.tint=a?"#FF0000":"#ededed"};i.on("hover",l),j.on("hover",l),k.on("hover",l),i.on("click",function(){Zh.Logout()}),k.on("click",function(){pf.openSubMenu(pf.settingsPage),pf.settingsPage.openSubMenu("ACCOUNT"),googa("send","event","MainMenu","Account (me area) Settings Clicked")}),h=new a.UI.Container;var m=new a.UI.SliceSprite(kf,4);m.width=m.height=54,m.left=m.top=7,m.tint=10855845,d=new a.UI.Sprite(a.Texture.fromFrame("UI/avatar.png")),d.anchorLeft=d.anchorTop=d.anchorBottom=d.anchorRight=2,
m.addChild(d),e=new a.UI.DynamicText("",{style:jd,width:350}),e.style.wrap=!1,e.style.ellipsis=!0,e.style.overflowX="hidden",e.left=70,e.top=7,f=new a.UI.DynamicText(nf("Online"),{style:_c}),f.style.tint="#4fcfff",f.left=70,f.top=25,h.addChild(m,e,f),h.visible=!1,c.addChild(i,j,k,h,g.container)}};Dd.XPSystem.onChange(function(){j(),g&&(g.updateExperience(Dd.XPSystem.Experience),g.container.visible||(g.container.visible=!0,a.UI.Tween.fromTo(g.container,1,{alpha:0},{alpha:1},a.UI.Ease.Power2.easeOut)))}),Zh.onData(function(){return b||j(),""===Zh.data["friendID"]?(g.container.visible=!1,void(h.visible=!1)):(e.text=Zh.data["username"],d.sprite.texture=Zh.data["avatar"].length?new a.Texture.fromImage("/avatar?path="+Zh.data["avatar"]):a.Texture.fromFrame("UI/avatar.png"),void(h.visible||(h.visible=!0,a.UI.Tween.fromTo(h,1,{alpha:0},{alpha:1},a.UI.Ease.Power2.easeOut))))}),Zh.onAuthenticated(function(){b||j(),i.clearBadges(),ng.PremiumDays>0&&i.addBadge(0,ng.PremiumDays),null!==ng.BadgeType&&i.addBadge(ng.BadgeType,ng.BadgeData),c.visible=!0,c.interactiveChildren=!0,a.UI.Tween.to(c,1,{alpha:1},a.UI.Ease.Power2.easeOut)}),Zh.onLogout(function(){b&&a.UI.Tween.to(c,1,{alpha:0,onComplete:function(){Zh.authenticated||(c.visible=!1,c.interactiveChildren=!1)}},a.UI.Ease.Power2.easeOut)})},Pf=function(){var b=-1,c=-1;this.container=new a.UI.Container(175,"80%"),this.container.valign="middle";var d=a.UI.Sprite.fromFrame("UI/grad-horizontal.png");d.width=d.height="100%",d.tint=0,d.alpha=.2;var e=a.UI.Sprite.fromFrame("UI/Rank/Medium/1.png");e.anchorRight=6,e.top=4;var f=new a.UI.DynamicText("",{style:hd});f.top=4;var g=a.UI.Sprite.fromFrame("UI/blank.png");g.alpha=.12,g.width=124;var h=a.UI.Sprite.fromFrame("UI/blank.png");h.tint=14155594,h.alpha=.44,h.height=g.height=14,h.top=g.top=23;var i=new a.UI.DynamicText("",{style:Zc});i.top=42;var j=new a.UI.DynamicText("",{style:Zc});j.style.shadow="#000000 1 1 1 1",j.top=25,j.left=4,this.container.addChild(d,e,g,h,i,f,j),this.updateExperience=function(d){var l=Dd.XPSystem.GetLevel(d);if(c!==l.Level&&(e.sprite.texture=a.Texture.fromFrame("UI/Rank/Medium/"+k.min(240,l.Level)+".png"),f.text="Level "+l.Level,i.text=Dd.XPSystem.GetRankName(l.Level),c=l.Level),b!==d){h.width=g.width*((d-l.StartExperience)/(l.EndExperience-l.StartExperience)),j.text=d.toLocaleString()+" / "+(l.EndExperience+1).toLocaleString(),b=d}j.update()}},Qf=function(){var b=Changelog[0],c=Changelog[1],e="https://www.reddit.com/r/tankwars/comments/ajbrw9/changelogs_continuously_updated/",f=this.container=new a.UI.Container("100%","100%"),g=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));g.width=g.height="100%",g.alpha=.5,g.tint=10066329;var h=new a.UI.SliceSprite(ef,3);h.tint=0,h.width="100%",h.height=37,h.alpha=.35;var i=new a.UI.DynamicText(nf("CHANGELOG"),{style:kd});i.align="center",i.top=10;var j=a.UI.Sprite.fromFrame("UI/blank.png");j.height=22,j.width="100%",j.top=37,j.tint=9950720,j.alpha=.5;var k=new a.UI.DynamicText(b,{style:hd});k.align="center",k.top=40;var l=new a.UI.DynamicText(c,{style:gd});l.anchorLeft=20,l.top=66;var m=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/blank.png"),text:new a.UI.DynamicText("READ COMPLETE CHANGELOG",{style:hd}),width:280,height:30});m.background.tint=9950720,m.background.alpha=.2,m.anchorBottom=7,m.align="center",m.on("hover",function(b){a.UI.Tween.to(m.background,.3,{alpha:b?.4:.2},a.UI.Ease.Circ.CircOut)}),m.on("click",function(){d.open(e)}),f.addChild(g,h,j,k,l,i,m)},Rf=function(){var b=this.container=new a.UI.Container("100%","100%"),c=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/blank.png"),width:282,height:64});c.background.tint=0,c.background.alpha=1,c.horizontalAlign="center",c.anchorBottom=15;var e=new a.UI.DynamicText(nf("COMMUNITY & SUPPORT"),{style:Ad});e.horizontalAlign="center",e.top=10;var f=a.UI.Sprite.fromFrame("UI/Menu/discord.png");f.top=7,f.horizontalAlign="center",c.addChild(f),c.on("hover",function(a){c.background.alpha=a?.7:1}),c.on("click",function(){d.open("https://discord.gg/tankwars","_blank"),googa("send","event","MainMenu","Community - Discord Clicked")}),b.addChild(c,e)},Sf=function(){this.container=new a.UI.Container,this.container.anchorTop=7,this.container.anchorRight=10,this.container.width=286,this.container.height=456;var b=new a.UI.CheckBox({checked:!rf.UserSettings["VolumeMute"],background:a.UI.Sprite.fromFrame("UI/blank.png")});b.background.alpha=b.checked?.49:.15,b.background.tint=b.checked?11727872:16777215,b.width=36,b.height=31,b.top=1;var c=a.UI.Sprite.fromFrame(b.checked?"UI/Menu/Icons/volume.png":"UI/Menu/Icons/volume-mute.png");c.verticalAlign="middle",c.horizontalAlign="center",c.alpha=b.checked?1:.4,b.addChild(c),b.updateState=function(d){c.sprite.texture=a.Texture.fromFrame(d?"UI/Menu/Icons/volume.png":"UI/Menu/Icons/volume-mute.png"),a.UI.Tween.to(this.background,.4,{alpha:d?.49:.15,tint:d?"#b2f400":"#ffffff"},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(c,.4,{alpha:d?1:.4},a.UI.Ease.Circ.CircOut),e.handle.tint=d?10799912:12631224,b.checked=d},b.change=function(a){rf.UserSettings["VolumeMute"]=!a,rf.saveUserSettings(),Dd.Audio.Update(),b.updateState(a)};var d=a.UI.Sprite.fromFrame("UI/blank.png");d.tint=0,d.alpha=.35,d.top=1,d.anchorLeft=36,d.anchorRight=0,d.height=31;var e=new a.UI.Slider({value:100*rf.UserSettings["VolumeMaster"],track:new a.UI.SliceSprite(hf,10,(!0),(!1)),handle:new a.UI.Sprite(gf)});e.track.alpha=.5,e.anchorLeft=46,e.anchorRight=8,e.y=12,e.track.height=10,e.handle.tint=10799912,e.track.anchorLeft=e.track.anchorRight=2,e.handle.tint=b.checked?10799912:12631224,e.on("change",function(a){rf.UserSettings["VolumeMaster"]=a/100,Dd.Audio.Update(),rf.saveUserSettings()}),this.container.addChild(b,d,e);var f=new a.UI.Button({background:new a.UI.SliceSprite(a.Texture.fromFrame("UI/shadow-box.png"),5),text:new a.UI.DynamicText(nf("HOST CUSTOM GAME"),{style:jd}),width:"100%",height:67});f.anchorTop=42,f.background.tint=5658701,f.text.style.tint="#dadada",f.on("hover",function(a){this.background.tint=a?6382426:5658701,this.text.style.tint=a?"#eeefec":"#dadada"}),f.on("click",function(){Nf.openLauncher()}),f.anchorRight=f.anchorLeft=-2,this.container.addChild(f,Hf.container),Hf.container.anchorBottom=0,this.open=function(){e.value=100*rf.UserSettings["VolumeMaster"],b.updateState(!rf.UserSettings["VolumeMute"])}},Tf=function(){var b=this;this.empty=!0,this.friendId=0;var c=" ",d="",e="",f=!1,g=this.container=new a.UI.Container;g.width=g.height=48;var h=new a.UI.Button({background:new a.UI.SliceSprite(kf,4),width:"100%",height:"100%"});h.background.tint=10855845,h.background.alpha=.2,g.addChild(h);var i=new a.UI.DynamicText("Nicolai Mortensen",{style:gd,width:"100%",height:30});i.style.overflowX="hidden",i.style.elipsis=!0,i.style.wrap=!1,i.style.align="center",i.anchorBottom=-30,i.alpha=0,g.addChild(i);var j=new a.UI.Sprite(a.Texture.fromFrame("UI/avatar.png"));j.anchorLeft=j.anchorTop=j.anchorBottom=j.anchorRight=2,h.addChild(j),h.on("hover",function(c){0!==b.friendId&&(a.UI.Tween.to(i,.3,{alpha:c?1:0},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(h.background,.3,{alpha:c?.5:.2},a.UI.Ease.Circ.CircOut))}),new a.UI.Interaction.ClickEvent(h,(!1),(!0)).onClick=function(a){0!==b.friendId&&ci.open(b.friendId)};var k=function(){e!==d&&(e=d,j.sprite.texture=d.length?a.Texture.fromImage(Dc(d)):a.Texture.fromFrame("UI/avatar.png")),i.text=c,j.alpha=0===b.friendId?.3:1,h.interactive=0!==b.friendId,b.empty=0===b.friendId};this.setMember=function(a){b.friendId=a[bi.propertyName.Friend.FriendID],d=a[bi.propertyName.Friend.Avatar],c=a[bi.propertyName.Friend.Name],k()},this.setMe=function(){b.friendId=Zh.data["friendID"],d=Zh.data["avatar"],c=Zh.data["username"],Zh.onData(function(){b.friendId=Zh.data["friendID"],d=Zh.data["avatar"],c=Zh.data["username"],k()}),k()},this.clear=function(){b.friendId=0,d="",c=" ",f=!1,k()},k()},Uf=function(){var b=!1,c=1,d=this.container=new a.UI.Container("100%","0");d.anchorBottom=6,d.anchorLeft=6,d.anchorRight=6,d.alpha=0;var e=a.UI.Sprite.fromFrame("UI/blank.png");e.tint=0,e.alpha=.6,e.width=e.height="100%",d.addChild(e);var f=new a.UI.DynamicText("PARTY",{style:kd});f.anchorTop=8,f.anchorLeft=11,d.addChild(f);var g=new a.UI.Button({background:new a.UI.SliceSprite(kf,4),text:new a.UI.DynamicText("Leave Party",{style:id}),width:90,height:23});g.background.tint=16711680,g.background.alpha=.3,g.anchorTop=7,g.anchorRight=11,d.addChild(g),g.on("hover",function(b){a.UI.Tween.to(g.background,.3,{alpha:b?.5:.3},a.UI.Ease.Circ.CircOut)}),g.on("click",function(){ki.leaveParty()});var h=!1,i=[];this.toggle=function(){b?this.hide():this.show()},this.init=function(){if(!h){h=!0;for(var a=0;a<5;a++){var b=new Tf;i[a]=b,b.container.anchorBottom=15,b.container.anchorLeft=10+53*a,d.addChild(b.container),0===a&&b.setMe()}}};var j=function(){for(var a=1;a<5;a++)if(i[a].empty)return i[a]},k=function(a){for(var b=0;b<5;b++)if(i[b].friendId==a)return i[b]};this.addMember=function(a,b){if(this.show(),!b){var d=j();d&&(d.setMember(a),c++)}},this.removeMember=function(a){if(a==i[0].friendId)return void this.clear();var b=k(a);b&&(b.clear(),c--),c<=1&&this.clear()};var l=new a.UI.DynamicText("LEADER",{style:fd});l.anchorTop=-10,l.align="center",this.setLeader=function(a){var b=k(a);b&&b.container.addChild(l)},this.clearSlots=function(){for(var a=1;a<5;a++)i[a].clear()},this.clear=function(){c=1,this.clearSlots(),this.hide()},this.show=function(){b||(b=!0,this.init(),d.interactive=!0,a.UI.Tween.to(pf.homePage.friends.friendList.container,.3,{anchorBottom:111},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(d,.3,{height:100,alpha:1},a.UI.Ease.Circ.CircOut))},this.hide=function(){b&&(b=!1,d.interactive=!1,a.UI.Tween.to(pf.homePage.friends.friendList.container,.3,{anchorBottom:23},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(d,.3,{height:0,alpha:0},a.UI.Ease.Circ.CircOut))},yf=this},Vf=function(){var b=this.container=new a.UI.Container("100%","100%"),c=new a.UI.Container("100%","100%"),d=new a.UI.DynamicText(" ",{style:ad,allowTags:!0});d.anchorTop=11,d.anchorLeft=9;var e=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/blank.png"),width:119,height:29,text:new a.UI.DynamicText("+ ADD FRIEND",{style:id})});e.anchorTop=e.anchorRight=6,e.background.tint=3028840,e.background.alpha=.8,e.on("hover",function(b){a.UI.Tween.to(e.background,.15,{tint:b?"#4d527a":"#2e3768"})}),e.on("click",function(){a.UI.Interaction.InputController.blur(),di.open()}),this.friendList=new Xf,c.addChild(d,e,this.friendList.container);var f=a.UI.Sprite.fromFrame("UI/Menu/signinbanner.png");f.anchorTop=f.anchorLeft=6,b.addChild(f,c);var g=function(){f.visible=!Zh.authenticated,c.visible=Zh.authenticated,Zh.authenticated&&(d.value="<font color='#bebebe'>FRIEND ID:</font> <b>"+Dd.friendID+"</b>")};Zh.onAuthenticated(function(){g()}),Zh.onLogout(function(){g()}),g()},Wf=function(b){this.friend=b;var c=this.container=new a.UI.Container("100%",48);this.container.anchorRight=this.container.anchorLeft=6;var d=new a.UI.Button({background:new a.UI.Sprite(a.Texture.fromFrame("UI/grad-vertical.png")),width:"100%",height:"100%"});d.background.alpha=.07,this.container.addChild(d),d.on("focus",function(){d.blur()}),d.on("hover",function(b){a.UI.Tween.to(d.background,.3,{alpha:b?.2:.07},a.UI.Ease.Circ.CircOut)}),new a.UI.Interaction.ClickEvent(d,(!1),(!0),(!1)).onClick=function(a){ci.open(b.FriendID)},new a.UI.Interaction.ClickEvent(d,(!1),(!1),(!0)).onClick=function(a){b.FriendInvite||ei.startConversation(b,!0)};var e=new a.UI.DynamicText(b.Name,{style:hd}),f=new a.UI.DynamicText("Offline",{style:$c});e.y=5,f.y=24,e.x=f.x=52;var g=new a.UI.SliceSprite(kf,4);g.width=g.height=42,g.left=g.top=3,g.tint=10855845;var h=new a.UI.Sprite(a.Texture.fromFrame("UI/avatar.png"));h.anchorLeft=h.anchorTop=h.anchorBottom=h.anchorRight=2,g.addChild(h),d.addChild(g,e,f);var i,j,k,l=!1,m=function(){if(!l){l=!0,k=new a.UI.Container(120,20),k.anchorBottom=k.anchorRight=5;var d=function(b){a.UI.Tween.to(this,.3,{alpha:b?1:.8},a.UI.Ease.Circ.CircOut)};i=new a.UI.Button({background:new a.UI.SliceSprite(a.Texture.fromFrame("UI/ui-box-4.png"),4),width:59,height:"100%",text:new a.UI.DynamicText("Accept",{style:$c})}),j=new a.UI.Button({background:new a.UI.SliceSprite(a.Texture.fromFrame("UI/ui-box-4.png"),4),width:59,height:"100%",text:new a.UI.DynamicText("Decline",{style:$c})}),j.on("click",function(){$h.friendListEvents.declineFriendRequest(b.FriendID)}),i.on("click",function(){$h.friendListEvents.acceptFriendRequest(b.FriendID)}),i.background.tint=10995035,j.background.tint=13587026,j.alpha=i.alpha=.8,j.on("hover",d),i.on("hover",d),i.anchorRight=0,k.addChild(i,j),c.addChild(k)}k.visible=k.interactive=!0},n=function(){l&&(k.visible=k.interactive=!1)},o="";this.update=function(){o!==b.Avatar&&(o=b.Avatar,h.sprite.texture=b.Avatar&&b.Avatar.length?a.Texture.fromImage(Dc(b.Avatar)):a.Texture.fromFrame("UI/avatar.png")),e.value=b.Name,f.alpha=1,e.alpha=1,g.alpha=1,n(),f.value=b.Status,b.State===_h.Online?(g.tint=6932735,e.style.tint=f.style.tint=6932735):b.State===_h.Ingame?(g.tint=10995034,e.style.tint=f.style.tint=13893481):b.State===_h.Offline?(g.tint=10329501,e.style.tint=f.style.tint=14803425,e.alpha=.7,f.alpha=.5):b.State===_h.Blocked?(g.tint=11024697,e.style.tint=f.style.tint=16736352):b.State===_h.Invite&&(g.tint=16769385,e.style.tint=f.style.tint=16769385,f.alpha=1,e.alpha=.8,g.alpha=.8,m())},b.on("update",this.update),this.update()},Xf=function(){var b=this;this.container=new a.UI.Container("100%","100%"),this.container.anchorTop=39,this.container.anchorLeft=this.container.anchorRight=6,this.container.anchorBottom=23,this.friendItems={};var c=a.UI.Sprite.fromFrame("UI/blank.png");c.tint=0,c.alpha=.4,c.width=c.height="100%",this.container.addChild(c);var d=new Yf;this.container.addChild(d.container),ai.on("init",function(a){d.empty(),b.friendItems={};for(var c=0;c<a.length;c++){b.addFriendItem(a[c])}}),ai.on("friendRemoved",function(a){d.list.removeChild(b.friendItems[a].container),delete b.friendItems[a]}),ai.on("sort",function(){d.list.sort(!0)}),ai.on("friendAdded",function(a){b.addFriendItem(a)}),this.addFriendItem=function(a){var c=b.friendItems[a.FriendID];c||(c=b.friendItems[a.FriendID]=new Wf(a),d.list.addChild(c.container,function(){return c.friend.State},function(){return c.friend.Name}))}},Yf=function(){var b=(this.container=new a.UI.Container("100%","100%"),this.list=new a.UI.SortableList((!1),.1,a.UI.Ease.Circ.CircOut));b.height="100%",b.width="100%",b.anchorTop=b.anchorBottom=2;var c=new a.UI.ScrollingContainer({scrollX:!1,scrollY:!0});c.width=c.height="100%",c.dragThreshold=5,c.dragRestrictAxis="y",c.addChild(b);var d=new a.UI.ScrollBar({track:new a.UI.SliceSprite(a.Texture.fromFrame("UI/ui-box-2.png"),4),handle:new a.UI.SliceSprite(a.Texture.fromFrame("UI/ui-box-2.png"),4),vertical:!0,scrollingContainer:c,autohide:!0});d.anchorTop=1,d.width=8,d.track.width=d.handle.width=8,d.track.alpha=.5,d.anchorBottom=1,d.anchorRight=0,d.track.tint=2236962,d.track.blendMode=0,this.empty=function(){for(var a=b.items.length-1;a>=0;a--)b.removeChild(b.items[a])},this.container.addChild(c,d)},Zf=function(){var b=this.container=new a.UI.Container("100%","100%"),c=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));c.tint=15592941,c.width="100%",c.height="100%",c.alpha=.7;var e=new a.UI.SliceSprite(ef,3);e.tint=15992320,e.width="100%",e.height=37,e.alpha=.49;var f=a.UI.Sprite.fromFrame("UI/Menu/Icons/leaderboard.png");f.top=8,f.anchorRight=12;var g=new a.UI.DynamicText(nf("LEADERBOARD"),{style:id});g.left=12,g.top=10;var h=new a.UI.SortableList((!1),0);h.width="100%",h.top=37,h.height=210;for(var i=!1,j=0;j<d["topSeven"].length;j++)!function(){var a=new $f(d["topSeven"][j],i);h.addChild(a.container,function(){return a.Position}),i=!i}();var k=new a.UI.Button({background:new a.UI.SliceSprite(a.Texture.fromFrame("UI/Menu/box-border.png"),4),text:new a.UI.DynamicText(nf("SHOW MORE"),{style:jd})});k.height=41,k.anchorLeft=k.anchorRight=6,k.anchorBottom=6,k.background.alpha=.49,k.on("hover",function(b){a.UI.Tween.to(this.background,.4,{alpha:b?.7:.49},a.UI.Ease.Circ.CircOut)}),k.on("click",function(a){pf.openSubMenu(pf.leaderboardPage),pf.buttons["Leaderboard"].setActive(!0),googa("send","event","MainMenu","Leaderboard 'More' Clicked")}),b.addChild(c,e,f,g,h,k)},$f=function(b,c){var d=b[1],e=b[3],f=b[4],g=b[5];this.Position=d,this.container=new a.UI.Container(null,30),this.container.anchorLeft=this.container.anchorRight=2;var h=a.UI.Sprite.fromFrame("UI/blank.png");h.width=h.height="100%",h.alpha=c?.09:0,this.container.addChild(h);var i=new a.UI.DynamicText(d+".",{style:jd}),j=new a.UI.DynamicText(e,{style:bd,width:170}),l=a.UI.Sprite.fromFrame("UI/Rank/Small/"+k.min(f,240)+".png"),m=new a.UI.DynamicText(g,{style:jd});j.style.wrap=!1,j.style.overflowX="hidden",j.style.ellipsis=!0,i.style.tint=1==d?"#fdd103":2==d?"#e3e3e3":3==d?"#e4c383":"#ffffff",i.alpha=d<=3?1:.21,i.left=10,l.left=28,j.left=50,m.anchorRight=10,i.verticalAlign=j.verticalAlign=l.verticalAlign=m.verticalAlign="middle",this.container.addChild(l,i,j,m)},_f=function(){this.container=new a.UI.Container;var b=a.UI.Sprite.fromFrame("UI/blank.png");b.tint=0,b.alpha=.41,b.width=b.height="100%";var c=new a.UI.DynamicText("<b>PLAY TANKWARS.IO</b>",{style:bd,allowTags:!0});c.align="center",c.top=15;var d=new a.UI.Container(261,63),e=new a.UI.Container(261,63);d.align=e.align="center",d.top=e.top=45,e.visible=e.interactiveChildren=!1,Dd.onStateChange(function(){var a=Dd.Connection.server.connected&&Dd.joined;d.visible=d.interactiveChildren=!a,e.visible=e.interactiveChildren=a}),Zh.onData(function(){c.value=Zh.authenticated?"<b>PLAY AS</b> "+Zh.data.username:"<b>PLAY TANKWARS.IO</b>"});var f=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/blank.png"),text:new a.UI.DynamicText("LEAVE GAME",{style:jd}),width:261,height:22});f.on("click",function(){Dd.Connection.server.connected&&Dd.joined?Dd.Connection.invoke("LeaveCheck"):Dd.ClearGame(!1)}),e.addChild(f),f.background.tint=16711680,f.anchorBottom=0;var g=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/blank.png"),text:new a.UI.DynamicText("CONTINUE PLAYING",{style:kd}),width:261,height:38});g.on("click",function(){Dd.Connection.server.connected&&Dd.joined?pf.close():Dd.ClearGame(!1)}),e.addChild(g),g.background.tint=9811200,g.alpha=f.alpha=.8;var h=function(b){a.UI.Tween.to(this.background,.4,{alpha:b?1:.8},a.UI.Ease.Circ.CircOut)};f.on("hover",h),g.on("hover",h);var i=new a.UI.SliceSprite(mf,18);i.anchorLeft=i.anchorRight=i.anchorTop=i.anchorBottom=-12,i.blendMode=a.BLEND_MODES.ADD,i.tint=13813527,d.addChild(i);var j=function(a){l.isHover||(i.alpha=.4*k.cos(.002*PE.GameLoop.time)+.6)},l=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/blank.png"),text:new a.UI.DynamicText("PLAY",{style:md}),width:"100%",height:"100%"});d.addChild(l),l.background.tint=9811200,l.on("hover",function(a){a?(i.alpha=1,this.background.tint=10666507):this.background.tint=9811200});var m=[["Conquest",1,"cq.png"],["KingDM",0,"kdm.png"]],n=["AUTO","USE","USW","EU","SEA"];zf=function(a){return t(Dd.retryPlayTimeout),Dd.Connection.server.connected&&!Dd.starting&&Dd.Level.loaded?Zh.authenticated?(void 0===a&&(a=localStorage["gamemodeSelected"]),Dd.Start(a),void pf.close(!0,!0)):void u(function(){xc.open("You must sign-in to play Tankwars!")},100):void(Dd.retryPlayTimeout=u(function(){zf()},200))},l.on("click",zf),pf.onOpen(function(){PE.GameLoop.onUpdate(j)}),pf.onClose(function(){PE.GameLoop.offUpdate(j)});var o=new a.UI.DynamicText("GAMEMODE",{style:id});o.horizontalAlign="center",o.top=134;var p=this;this.container.addChild(b,c,o,d,e);var q=function(b){a.UI.Tween.to(this.background,.4,{alpha:b?.45:.15},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(this.background,.4,{tint:b?"#26c4ff":"#ffffff"},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(this.inner,.4,{alpha:b?1:.4},a.UI.Ease.Circ.CircOut),b&&(localStorage["gamemodeSelected"]=this.mode,Dd.selectedGM=this.mode,v())},r=localStorage["gamemodeSelected"];void 0===r&&(r=localStorage["gamemodeSelected"]=Dd.GameModes.Default);for(var s=0;s<m.length;s++)!function(){var b=m[s][0],c=m[s][1],d=m[s][2],e=new a.UI.CheckBox({checked:localStorage["gamemodeSelected"]==c,background:a.UI.Sprite.fromFrame("UI/blank.png"),value:c,checkgroup:"MainMenuGameMode"});e.mode=c,e.background.alpha=e.checked?.49:.15,e.background.tint=e.checked?2540799:16777215,e.width=228,e.height=37,e.horizontalAlign="center",e.top=162+42*s,e.inner=new a.UI.Container("100%","100%"),e.inner.alpha=e.checked?1:.4,e.addChild(e.inner),e.icon=a.UI.Sprite.fromFrame("UI/Menu/Gamemode/"+d),e.icon.anchorBottom=0,e.icon.anchorLeft=0,e.text=new a.UI.DynamicText(nf(b),{style:hd}),e.text.verticalAlign="middle",e.text.horizontalAlign="center",e.inner.addChild(e.icon,e.text),e.change=q,p.container.addChild(e)}();var v=function(){var b=!0;1==Dd.selectedGM&&(b=!1),b?(x.visible=b,y.visible=b,a.UI.Tween.fromTo(x,.5,{alpha:0,scale:1},{alpha:1,scale:1},a.UI.Ease.Cubic.easeOut),a.UI.Tween.fromTo(y,.5,{alpha:0,scale:1},{alpha:1,scale:1},a.UI.Ease.Cubic.easeOut)):(a.UI.Tween.fromTo(x,.5,{alpha:1,scale:1},{alpha:0,scale:1},a.UI.Ease.Cubic.easeOut),a.UI.Tween.fromTo(y,.5,{alpha:1,scale:1},{alpha:0,scale:1},a.UI.Ease.Cubic.easeOut),u(function(){y.alpha<.5?(x.visible=!1,y.visible=!1):(x.visible=!0,y.visible=!0)},1e3))},w=[["AUTO","0",78],["2","2",45],["5",5,45],["8","8",45]],x=new a.UI.DynamicText("MAX TANK TIER",{style:id});x.horizontalAlign="center",x.anchorBottom=175,this.container.addChild(x);var y=new a.UI.Container("100%",23);y.anchorBottom=145,this.container.addChild(y);for(var z=function(a){rf.UserSettings["MaxTankTier"]=a,rf.saveUserSettings()},A=37,s=0;s<w.length;s++)!function(){var b=w[s][0],c=w[s][1],d=w[s][2],e=new a.UI.CheckBox({checked:c==rf.UserSettings["MaxTankTier"],background:a.UI.Sprite.fromFrame("UI/blank.png"),checkgroup:"MAIN_MENU_TIERS",value:c});e.background.alpha=e.checked?.49:.15,e.background.tint=e.checked?2540799:16777215,e.text=new a.UI.DynamicText(b,{style:hd}),e.text.verticalAlign="middle",e.text.horizontalAlign="center",e.text.alpha=e.checked?1:.4,e.addChild(e.text),e.width=d,e.height=23,e.anchorLeft=A,A+=d+5,e.anchorBottom=0,e.change=function(b){a.UI.Tween.to(this.background,.4,{alpha:b?.45:.15},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(this.background,.4,{tint:b?"#26c4ff":"#ffffff"},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(this.text,.4,{alpha:b?1:.4},a.UI.Ease.Circ.CircOut),b&&z(this.value)},y.addChild(e)}(),v();var B=new a.UI.DynamicText("REGION",{style:id});B.horizontalAlign="center",B.anchorBottom=48,this.container.addChild(B);var C,D,E,F=new a.UI.Container("100%",23),G=function(b){a.UI.Interaction.InputController.blur(),a.UI.Tween.to(F,.5,{alpha:.2},a.UI.Ease.Circ.CircOut),F.interactive=F.interactiveChildren=!1,C=b,t(D),Dd.Connection.server.connecting?D=u(function(){G(C)},1e3):(Dd.Region.Select(b),E=u(function(){H()},1e3))},H=function(){t(E);var b=!Dd.Connection.server.connected&&!Dd.Connection.server.connecting;Dd.Connection.server.connected&&Dd.Level.loaded||b?(a.UI.Tween.to(F,.5,{alpha:1},a.UI.Ease.Circ.CircOut),F.interactive=F.interactiveChildren=!0,b&&qf.OK("Connection to the server failed!")):E=u(function(){H()},1e3)};F.anchorBottom=18,this.container.addChild(F);for(var s=0;s<n.length;s++)!function(){var b=n[s],c=new a.UI.CheckBox({checked:rf.UserSettings["AutoDetect"]&&"AUTO"==b||rf.UserSettings["Region"]&&rf.UserSettings["Region"]["shortName"]===b,background:a.UI.Sprite.fromFrame("UI/blank.png"),checkgroup:"MAIN_MENU_REGIONS",value:b});c.background.alpha=c.checked?.49:.15,c.background.tint=c.checked?2540799:16777215,c.text=new a.UI.DynamicText(b,{style:hd}),c.text.verticalAlign="middle",c.text.horizontalAlign="center",c.text.alpha=c.checked?1:.4,c.addChild(c.text),c.width=47,c.height=23,c.anchorLeft=24+52*s,c.anchorBottom=0,c.change=function(b){a.UI.Tween.to(this.background,.4,{alpha:b?.45:.15},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(this.background,.4,{tint:b?"#26c4ff":"#ffffff"},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(this.text,.4,{alpha:b?1:.4},a.UI.Ease.Circ.CircOut),b&&G(this.value)},F.addChild(c)}()},ag=function(){var b=this.container=new a.UI.Container("100%","100%"),c=new a.UI.DynamicText(nf("SIGN IN WITH"),{style:jd});c.left=22,c.top=12;var d=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Login/facebook.png")}),e=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Login/twitter.png")}),f=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Login/steam.png")}),g=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Login/google.png")}),h=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Login/vkontakte.png")});d.method="facebook",e.method="twitter",f.method="steam",g.method="google",h.method="vkontakte",d.tint=e.tint=f.tint=g.tint=h.tint=15592941,d.y=e.y=f.y=g.y=h.y=37,d.x=16,e.x=140,f.x=248,g.x=358,h.x=468;var i=function(a){this.background.tint=a?16777215:15592941},j=function(a){this.y=a?38:37},k=function(){var a=Dd.referralId?"&r="+Dd.referralId:"",b=Dd.friendRefId?"&f="+Dd.friendRefId:"";switch(this.method){case"facebook":dg("/Account/ExternalLogin?provider=Facebook"+a+b,"Facebook Login","700","600");break;case"twitter":dg("/Account/ExternalLogin?provider=Twitter"+a+b,"Twitter Login","900","500");break;case"steam":dg("/Account/ExternalLogin?provider=Steam"+a+b,"Steam Login","900","500");break;case"google":dg("/Account/ExternalLogin?provider=Google"+a+b+"&returnUrl=/","Google Login","900","500");break;case"vkontakte":dg("/Account/ExternalLogin?provider=VKontakte"+a+b,"VKontakte Login","700","600")}};d.on("hover",i),e.on("hover",i),f.on("hover",i),g.on("hover",i),h.on("hover",i),d.on("press",j),e.on("press",j),f.on("press",j),g.on("press",j),h.on("press",j),d.on("click",k),e.on("click",k),f.on("click",k),g.on("click",k),h.on("click",k),b.addChild(d,e,f,g,h,c),Zh.onAuthenticated(function(){a.UI.Tween.to(b,1,{alpha:0,onComplete:function(){Zh.authenticated&&(b.interactiveChildren=!1,b.visible=!1)}},a.UI.Ease.Power2.easeOut)}),Zh.onLogout(function(){b.visible=!0,b.interactiveChildren=!0,a.UI.Tween.to(b,1,{alpha:1},a.UI.Ease.Power2.easeOut)})},bg=function(){var b,c=!1;this.init=function(){c=!0;var d=this.container=new a.UI.Container(1220,577);d.verticalAlign="middle",d.horizontalAlign="center",d.pivot=.5,pf.container.addChild(d);var e=new a.UI.Container(294,314);e.addChild((new Zf).container);var f=new a.UI.Container(294,248);f.addChild((new Qf).container),f.anchorBottom=0;var g=new a.UI.Container(614,92),h=new ag,i=this.account=new Of,j=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));j.tint=7171437,j.width=j.height="100%",j.alpha=.65,g.addChild(j,h.container,i.container),g.left=303;var k=new a.UI.Container(614,470);k.x=303,k.y=107;var l=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));l.width=l.height="100%",l.alpha=.49,k.addChild(l);var m=new _f;m.container.width=302,m.container.anchorLeft=m.container.anchorTop=m.container.anchorBottom=6,k.addChild(m.container),b=new Sf,k.addChild(b.container);var n=new a.UI.Container(294,451),o=this.friends=new Vf,p=this.party=new Uf,q=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));q.width=q.height="100%",q.alpha=.5,q.tint=11902870,n.anchorRight=0,n.addChild(q,o.container,p.container);var r=new a.UI.Container(294,114),s=new Rf,t=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));t.tint=15592941,t.width=t.height="100%",t.alpha=.65,r.anchorBottom=0,r.anchorRight=0,r.addChild(t,s.container),d.addChild(e,f,g,k,n,r)},this.open=function(a){c||this.init(),b.open()},this.close=function(a){}},cg=function(a,b,c,e){var f=void 0!==d.screenLeft?d.screenLeft:screen.left,g=void 0!==d.screenTop?d.screenTop:screen.top;width=d.innerWidth?d.innerWidth:r.documentElement.clientWidth?r.documentElement.clientWidth:screen.width,height=d.innerHeight?d.innerHeight:r.documentElement.clientHeight?r.documentElement.clientHeight:screen.height;var h=width/2-c/2+f,i=height/2-e/2+g,j=d.open(a,b,"scrollbars=yes, width="+c+", height="+e+", top="+i+", left="+h);return d.focus&&j.focus(),j},dg=function(a,b,c,d,e){var f=cg(a,b,c,d),g=v(function(){f.closed&&(e?$h.SettingsEvents.GetNewLoginMethodInformation():Zh.Authenticate(),w(g),g=void 0)},100)},eg={spritesheet:new Nc(2048,2,(!0)),items:{},loaded:{},loadItemInfo:function(a,b){for(var c=[],d=[],e=0;e<a.length;e++){var g=a[e];this.items[g]||(void 0===this.loaded[g]&&(this.loaded[g]=!1,d.indexOf(g)===-1&&d.push(g)),this.loaded[g]||c.indexOf(g)===-1&&c.push(g))}if(c.length){var h=function(a){for(var b=0;b<c.length;b++){if(!eg.loaded[c[b]])return void u(function(){h(a)},100)}a()};d.length?f.post("/Inventory/GetInfo",{itemIds:d}).done(function(a){for(var c=[],d=[],e=0;e<a.length;e++){var f=new mg(a[e]);c.push(f),d.push(f.imageURL)}eg.spritesheet.load(d,function(){for(var a=0;a<c.length;a++){var d=c[a];eg.loaded[d.id]=!0,eg.items[d.id]=d}h(b)})}):h(b)}else b()}},fg=function(b,c){var d=void 0,e=void 0,g=c,h=!1,i=this.container=new a.UI.Button({width:63,height:37,background:new a.UI.SliceSprite(kf,3,(!0),(!0))});i.background.alpha=.48,i.background.tint=0;var j=new a.Sprite(a.Texture.EMPTY);j.alpha=.4,j.anchor.set(1,1),j.position.set(62,36),j.scale.set(.2),i.container.addChild(j);var k=new a.UI.DynamicText(vf[b],{style:Zc,width:"100%"});k.y=3,k.style.align="center",i.addChild(k),i.on("click",function(){h?f.post("/Inventory/UnEquipCommander",{id:e.inventoryId}).done(function(a){ng.UnequipInventoryItem(e.inventoryId,e.item),g.update(e)}):f.post("/Inventory/EquipCommander",{id:e.inventoryId,crewIndex:d.index}).done(function(a){ng.UnequipInventoryItem(e.inventoryId,e.item),a&&(d.commanderId=e.itemId,d.commanderInventoryId=e.inventoryId,d.commanderData=e.data,g.update(e))})}),this.update=function(c){return e=c,d=pf.crews.getCrew(b),d.unlocked?(i.visible=i.interactive=!0,d.commanderId<=0?j.visible=!1:(j.visible=!0,eg.loadItemInfo([d.commanderId],function(){j.texture=eg.items[d.commanderId].getTexture()})),h=e.inventoryId==d.commanderInventoryId,a.UI.Tween.to(i.background,.3,{tint:h?"#aedf29":"#000000"},a.UI.Ease.Circ.CircOut),void a.UI.Tween.to(j,.3,{alpha:h?1:.4},a.UI.Ease.Circ.CircOut)):void(i.visible=i.interactive=!1)}},gg=function(){var b=this,c=this.container=new a.UI.Container(198,100),d=new a.UI.DynamicText("EQUIP COMMANDER",{style:_c,width:"100%"});d.style.align="center",c.addChild(d);for(var e={},f=0;f<6;f++){var g=e[f]=new fg(f,b);c.addChild(g.container),g.container.x=68*f,g.container.y=21,f>=3&&(g.container.x-=204,g.container.y=63)}this.update=function(a){c.height=pf.crews.getCrew(3).unlocked?100:58;for(var b in e){e[b].update(a)}}},hg={all:1,crates:2,skins:3,commanders:4},ig={newest:1,quality:2},jg={0:{name:"None",text:"Common",textColor:"#ffffff",bgTint:"#ffffff",descriptionBgTint:"#b5b5b5"},1:{name:"Common",text:"Common",textColor:"#dedede",bgTint:"#ffffff",descriptionBgTint:"#b5b5b5"},2:{name:"Uncommon",text:"Uncommon",textColor:"#6e9ae4",bgTint:"#1651b3",descriptionBgTint:"#6e9ae4"},3:{name:"Rare",text:"Rare",textColor:"#b2e965",bgTint:"#92ce20",descriptionBgTint:"#b2e965"},4:{name:"Epic",text:"Epic",textColor:"#e965de",bgTint:"#af20ce",descriptionBgTint:"#e965de"},5:{name:"Legendary",text:"Legendary",textColor:"#ffcc00",bgTint:"#ff9600",descriptionBgTint:"#ffcc00"},6:{name:"Special",text:"Special",textColor:"#e96565",bgTint:"#ce2020",descriptionBgTint:"#e96565"},7:{name:"Crate",text:"Common",textColor:"#ffffff",bgTint:"#ffffff",descriptionBgTint:"#b5b5b5"}},kg={0:{name:"Skin"},1:{name:"Loot Crate"},2:{name:"Consumable"},3:{name:"Commander"},4:{name:"Taunt"}},lg={Skin:0,LootCrate:1,Consumable:2,Commander:3},mg=function(a){this.id=a[0],this.imageURL="/image/item-"+this.id+".png",this.name=a[1],this.description=a[2],this.rarity=a[3],this.type=a[4];var b=void 0;this.getTexture=function(){return b||(b=eg.spritesheet.getTexture(this.imageURL)),b},this.type==lg.Commander&&(this.title=a[5]),this.type==lg.Skin&&(this.classId=a[5])},ng={FacebookShareReward:!1,TwitterShareReward:!1,Premium:!1,PremiumDays:0,BadgeType:null,BadgeData:null,DataLoaded:!1,Clear:function(){this.PremiumDays=0,this.Premium=!1,this.BadgeType=null,this.BadgeData=null,this.FacebookShareReward=!1,
this.TwitterShareReward=!1,pf.wallet.UpdateBalance(ah.Gold,0),pf.wallet.UpdateBalance(ah.Talent,0),pf.wallet.UpdateBalance(ah.Gems,0);for(var a in tankClass){var b=tankClass[a];this.UpdateClassInfo(b.ID,b.DefaultSkinBody,-1,b.DefaultSkinCannon,-1,!1)}pf.tanksPage.refresh(),pf.crews.LoadGuestCrews()},Load:function(a,b,c,d,e,f,g,h,i,j){if(this.DataLoaded&&this.Clear(),pf.wallet.UpdateBalance(ah.Gold,c),pf.wallet.UpdateBalance(ah.Talent,d),pf.wallet.UpdateBalance(ah.Gems,e),this.PremiumDays=f,this.Premium=f>0,this.BadgeType=g,this.BadgeData=h,this.FacebookShareReward=i,this.TwitterShareReward=j,this.DataLoaded=!0,a)for(var k=0;k<a.length;k++){var l=a[k];this.UpdateClassInfo(l[0],l[1],l[2],l[3],l[4],l[5])}pf.tanksPage.refresh(),pf.crews.LoadCrews(b)},UpdateClassInfo:function(a,b,c,d,e,f){var g=tankClass[a];g&&(b!=g.DefaultSkinBody&&b!=-1?g.SkinBody=b:delete g.SkinBody,g.BodyInventoryId=c,d!=g.DefaultSkinCannon&&d!=-1?g.SkinCannon=d:delete g.SkinCannon,g.CannonInventoryId=e,g.owned=100==a||200==a||300==a||!!f,d=d!=-1?d:g.DefaultSkinCannon,b=b!=-1?b:g.DefaultSkinBody,g.PreviewCrew&&g.PreviewCrew.loadClass(a,d,b),g.PreviewTankTree&&g.PreviewTankTree.tank.loadClass(a,d,b))},UnequipInventoryItem:function(a,b){if(b.type==lg.Skin){var c=tankClass[b.classId],d=c.BodyInventoryId==a,e=c.CannonInventoryId==a;(d||e)&&this.UpdateClassInfo(c.ID,d?-1:c.SkinBody?c.SkinBody:c.DefaultSkinBody,d?-1:c.BodyInventoryId?c.BodyInventoryId:-1,e?-1:c.SkinCannon?c.SkinCannon:c.DefaultSkinCannon,e?-1:c.CannonInventoryId?c.CannonInventoryId:-1,c.owned)}else if(b.type==lg.Commander)for(var f=0;f<6;f++){var g=pf.crews.getCrew(f);g.commanderInventoryId==a&&(g.commanderId=-1,g.commanderInventoryId=-1,g.commanderData={})}}},og=function(b){var c=this;this.inventoryId=b[0],this.itemId=b[1],b[2]&&(this.data=JSON.parse(b[2])),this.container=new a.UI.Container(84,84);var d=this.item=eg.items[this.itemId],e=d.rarity;(e<1||e>6)&&(e=1);var f=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/inventory/item/bg/"+e+".png")});f.width=84,f.height=84;var g=new a.UI.Sprite(d.getTexture());g.x=g.y=42,g.pivot=.5;var h=k.min(60/g.width,60/g.height);g.scale=h;var i=a.UI.Sprite.fromFrame("UI/inventory/item/type/"+d.type+".png");i.anchorBottom=i.anchorRight=6,i.alpha=.5,c.container.addChild(f,g,i),f.background.alpha=.45,f.on("hover",function(b){pg.selectedItem!=c&&(a.UI.Tween.to(this.background,.4,{alpha:b?.75:.45},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(g,.4,{scale:b?1.1*h:h},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(i,.4,{alpha:b?1:.5},a.UI.Ease.Circ.CircOut),b?pf.inventoryPage.setPreview(c,!1):pf.inventoryPage.clearPreview())}),f.on("click",function(){c.setActive(!0)}),this.setActive=function(b){b?(pg.selectedItem&&pg.selectedItem.setActive(!1),pf.inventoryPage.setPreview(this,!0)):(pg.selectedItem=void 0,pf.inventoryPage.clearPreview()),a.UI.Tween.to(f.background,.4,{alpha:b?1:.45},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(g,.4,{scale:b?1.1*h:h},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(i,.4,{alpha:b?1:.5},a.UI.Ease.Circ.CircOut)}},pg=function(){var b,c,d,e,g,h=this,i=1,j=1,l=ig.newest,m=hg.all,n=!1,o={},p={};this.init=function(){n=!0;var b=this.container=new a.UI.Container("100%","100%");b.verticalAlign="middle",b.horizontalAlign="center",b.pivot=.5,pf.container.addChild(b),this.initPreviewContainer(),this.initInventoryContainer(),this.initInventoryMenu()},this.initPreviewContainer=function(){var b=this.previewContainer=new a.UI.Container(295,"100%");b.anchorRight=0,this.container.addChild(b);var c=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));c.tint=15848359,c.width="100%",c.height="100%",c.alpha=.5,b.addChild(c);var d=this.previewContent=new a.UI.Container;d.anchorLeft=d.anchorRight=d.anchorTop=d.anchorBottom=5,d.visible=!1,b.addChild(d);var e=a.UI.Sprite.fromFrame("UI/blank.png");e.height=182,e.width="100%",e.alpha=.35,d.addChild(e);var g=a.UI.Sprite.fromFrame("UI/grad-vertical.png");g.y=187,g.height=125,g.width="100%",g.alpha=.6,d.addChild(g);var i=new a.UI.DynamicText(" ",{style:jd,allowTags:!0}),n=new a.UI.DynamicText(" ",{style:$c,width:"90%",height:90});i.anchorTop=193,i.anchorLeft=10,n.horizontalAlign="center",n.anchorTop=220;var o=new a.UI.Sprite(a.Texture.EMPTY);o.x=142,o.y=91,o.pivot=.5,d.addChild(o);var p=new a.UI.DynamicText(" ",{style:td,allowTags:!0});p.x=4;var q=new a.UI.DynamicText(" ",{style:td});q.anchorRight=4,d.addChild(q,p,n,i);var r=new hh("95%");r.container.anchorTop=280,r.container.horizontalAlign="center",d.addChild(r.container);var s=function(b,c){var d=new a.UI.Button({background:new a.UI.SliceSprite(a.Texture.fromFrame("UI/Menu/box-border.png"),4),height:36,text:new a.UI.DynamicText(b,{style:hd})});return d.anchorLeft=d.anchorRight=12,d.background.alpha=.5,d.on("click",c),d.on("hover",function(b){a.UI.Tween.to(this.background,.4,{alpha:b?.9:.5},a.UI.Ease.Circ.CircOut)}),d},t=new a.UI.Container("100%",200);t.anchorBottom=0,d.addChild(t);var u=s("SALVAGE             ",function(){var a=pg.selectedItem;wc.open(a.item.name,function(){var b={id:a.inventoryId};f.post("/Inventory/Salvage",b).done(function(c){c&&(ng.UnequipInventoryItem(b.id,a.item),pf.wallet.UpdateBalance(ah.Gold,c),a.setActive(!1),h.refresh(),googa("send","event","InventorySalvage",a.item.name),nc.open("SALVAGE DONE","100 Gold has been added to your balance","OK"))})})});u.uiText.horizontalAlign=null,u.background.tint=16711680,u.anchorBottom=10;var v=new ec(100,ah.Gold,1);v.container.anchorBottom=9,u.uiText.anchorLeft=v.container.anchorRight=70,v.text.value="+"+v.text.value,u.addChild(v.container);var w=new gg;w.container.anchorBottom=58,w.container.horizontalAlign="center";var x=new a.UI.Container("100%","100%");x.anchorBottom=0;var y=s("OPEN LOOT CRATE",function(){pf.crateopen.show(pg.selectedItem.itemId,pg.selectedItem.inventoryId)});y.anchorBottom=10,x.addChild(y);var z=new a.UI.Container("100%","100%");z.anchorBottom=50;var A=new a.UI.Container;A.align="center",z.addChild(A);var B=new S;A.container.addChild(B.container);var C=function(a){if(!a)return void alert("error");ng.UpdateClassInfo(a[0],a[1],a[2],a[3],a[4],a[5]),h.updateSkinButtons();var b=pg.selectedItem.data,c=tankClass[b];B.loadClass(b,c.SkinCannon,c.SkinBody,!0)},D=s("EQUIP BOTH",function(){D.postData.id=pg.selectedItem.inventoryId,f.post("/Inventory/EquipSkin",D.postData).done(C)});D.postData={id:-1,body:!0,cannon:!0},D.anchorBottom=50;var E=s("EQUIP BODY",function(){E.postData.id=pg.selectedItem.inventoryId,f.post("/Inventory/EquipSkin",E.postData).done(C)});E.postData={id:-1,body:!0,cannon:!1},E.anchorBottom=10,E.anchorRight=144;var F=s("EQUIP CANNON",function(){F.postData.id=pg.selectedItem.inventoryId,f.post("/Inventory/EquipSkin",F.postData).done(C)});F.postData={id:-1,body:!1,cannon:!0},F.anchorBottom=10,F.anchorLeft=145,z.addChild(D,E,F),this.updateSkinButtons=function(){if(pg.selectedItem){var a=pg.selectedItem.data;if(pg.selectedItem.item.type==lg.Skin&&a){var b=tankClass[a],c=pg.selectedItem.inventoryId==b.BodyInventoryId,d=pg.selectedItem.inventoryId==b.CannonInventoryId;D.background.tint=c&&d?0:16777215,D.postData.body=!(c&&d),D.postData.cannon=!(c&&d),D.text=c&&d?"UNEQUIP BOTH":"EQUIP BOTH",E.background.tint=c?0:16777215,E.postData.body=!c,E.postData.cannon=d,E.text=c?"UNEQUIP BODY":"EQUIP BODY",F.background.tint=d?0:16777215,F.postData.body=c,F.postData.cannon=!d,F.text=d?"UNEQUIP CANNON":"EQUIP CANNON",B.loadClass(a,b.SkinCannon,b.SkinBody,!0)}}},t.addChild(u,x,z,w.container),this.setPreview=function(b,e){var f=!e;if(!f||!pg.selectedItem||pg.selectedItem==b||pg.selectedItem.itemId!=b.itemId){f||(pg.selectedItem=b);var h=b.item,j=jg[h.rarity],l=kg[h.type];p.text="<font tint='"+j.textColor+"'>"+j.text.toUpperCase()+"</font> RARITY",q.text=l.name.toUpperCase(),n.text=h.description,i.text=h.type==lg.Commander?h.name+"<font tint='#cccccc'> "+h.title:h.name,a.UI.Tween.to(c,.4,{tint:j.bgTint},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(g,.4,{tint:j.descriptionBgTint},a.UI.Ease.Circ.CircOut);var m=h.getTexture(),s=k.min(190/m.width,157/m.height);o.sprite.texture=m,o.width=m.width,o.height=m.height,o.scale=s,d.interactive=!0,d.visible=!0,t.visible=t.interactive=!!e,w.container.visible=w.container.interactive=h.type==lg.Commander,x.visible=x.interactive=h.type==lg.LootCrate,z.visible=z.interactive=h.type==lg.Skin,u.visible=h.type==lg.Skin||h.type==lg.Commander,r.container.visible=h.type==lg.Commander,h.type==lg.Commander&&r.update(b.data),e&&(h.type==lg.Skin?this.updateSkinButtons():h.type==lg.Commander&&w.update(b))}},this.clearPreview=function(){d.interactive=!1,d.visible=!1,pg.selectedItem&&this.setPreview(pg.selectedItem,!0)},this.refresh=function(){this.loadInventory(j,l,m,!1,!1,!0)}},this.initInventoryContainer=function(){var b=this.inventoryContainer=new a.UI.Container("100%","100%");b.anchorRight=303,b.anchorLeft=0,this.container.addChild(b);var c=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));c.tint=8947848,c.width="100%",c.height="100%",c.alpha=.5,b.addChild(c),this.itemContainer=new a.UI.Container,this.itemContainer.anchorTop=43,this.itemContainer.anchorLeft=10,this.itemContainer.anchorRight=10,this.itemContainer.anchorBottom=40,b.addChild(this.itemContainer)},this.initInventoryMenu=function(){var i=this.menuContainer=new a.UI.Container("100%",37);i.anchorTop=0,this.inventoryContainer.addChild(i);var k=new a.UI.SliceSprite(cf,3,(!0),(!0));k.tint=0,k.width="100%",k.height="100%",k.alpha=.5,i.addChild(k);var n=function(b,c,d,e,f){var g=new a.UI.CheckBox({checked:!!e,background:a.UI.Sprite.fromFrame("UI/blank.png"),checkgroup:b,value:d});return g.background.alpha=g.checked?.49:.15,g.background.tint=g.checked?2540799:16777215,g.text=new a.UI.DynamicText(c,{style:fd}),g.text.y=5,g.text.horizontalAlign="center",g.text.alpha=g.checked?1:.8,g.addChild(g.text),g.width=76,g.height=21,g.change=function(b){a.UI.Tween.to(this.background,.4,{alpha:b?.45:.15},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(this.background,.4,{tint:b?"#26c4ff":"#ffffff"},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(this.text,.4,{alpha:b?1:.8},a.UI.Ease.Circ.CircOut)},g.on("change",f),g};e=new a.UI.Container("100%",70),e.anchorBottom=0,g=new a.UI.Container("100%",30),this.inventoryContainer.addChild(e,g);for(var o=[{text:"NEWEST",value:ig.newest,checked:!0},{text:"QUALITY",value:ig.quality}],q=0;q<o.length;q++){var r=o[q],s=n("INVENTORY_SORT",r.text,r.value,r.checked,function(a){a&&h.loadInventory(1,this.value,m,!0,!0)});s.y=8,s.x=10+81*q,g.addChild(s)}for(var t=[{text:"SHOW ALL",value:hg.all,checked:!0},{text:"LOOT CRATES",value:hg.crates},{text:"SKINS",value:hg.skins},{text:"COMMANDERS",value:hg.commanders}],q=0;q<t.length;q++){var r=t[q],s=p[r.value]=n("INVENTORY_FILTER",r.text,r.value,r.checked,function(a){a&&h.loadInventory(1,l,this.value,!0,!0)});s.y=8,s.anchorRight=10+81*q,g.addChild(s)}var u=function(b,c){var d=new a.UI.Button({background:new a.UI.SliceSprite(a.Texture.fromFrame("UI/Menu/box-border.png"),4),width:60,height:50,text:new a.UI.DynamicText(b,{style:xd})});return d.alpha=.1,d.setActive=function(b){this.interactive=b,a.UI.Tween.to(this,.4,{alpha:b?.8:.1},a.UI.Ease.Circ.CircOut)},d.background.tint=0,d.background.alpha=1,d.on("click",c),d};b=u("◄",function(){h.loadInventory(j-1,l,m,!0)}),c=u("►",function(){h.loadInventory(j+1,l,m,!0)});var v=u("SALVAGE DUPLICATE",function(){var a=pg.selectedItem;yc.open("SALVAGE (All Duplicate Skins)","You are about to salvage all duplicate skins!\nYou will not be able to recover salvaged items!\nAre you sure about that?","CANCEL!","SALVAGE!",!0,!1,function(){},function(){var b=new oc;b.open("Salvaging All Duplicate Skins","Please Wait..."),f.post("/Inventory/SalvageAllDuplicates",{itemType:0}).done(function(c){b.close(),c[1]?(pf.wallet.UpdateBalance(ah.Gold,c[1]),a&&a.setActive(!1),h.refresh(),googa("send","event","InventorySalvageDuplicates","all"),nc.open("SALVAGE DONE",c[2]+" Duplicates were Salvaged\n"+(c[1]-c[0])+" Gold has been added to your balance","OK")):c[0]==-1&&0==c[1]?nc.open("SALVAGE FAILED","It seems you don't have any duplicate skins!","OK"):nc.open("SALVAGE FAILED","Something went wrong!","OK")})})});v.uiText.horizontalAlign="center",v.alpha=.9,v.background.tint=16711680,v.anchorRight=40,v.width=250,v.height=40,v.anchorBottom=25,d=new a.UI.DynamicText(" ",{style:xd,width:"100%"}),d.style.align="center",d.anchorBottom=30,d.horizontalAlign="center",d.alpha=1;var w=new a.UI.SliceSprite(a.Texture.fromFrame("UI/Menu/box-border.png"),4);w.height=50,w.width=130,w.tint=0,w.alpha=.2,w.horizontalAlign="center",b.anchorLeft=c.anchorRight=330,b.anchorBottom=c.anchorBottom=w.anchorBottom=20,e.addChild(b,c,v,w,d)},this.loadCommanders=function(){p[hg.commanders].click()},this.loadInventory=function(n,o,p,q,r,s){e.interactiveChildren=g.interactiveChildren=!1;var t=j>n;j=n,void 0!==o&&(l=o),void 0!==p&&(m=p),f.post("/Inventory/GetInventory",{page:j,sort:l,filter:m}).done(function(f){i=f[0],b.setActive(i>1&&j>1),c.setActive(i>1&&j<i),d.text=j+" / "+k.max(1,i),a.UI.Tween.to(d,.4,{alpha:i>1?.9:.1},a.UI.Ease.Circ.CircOut);for(var l=f[1],m=[],n=0;n<l.length;n++)m.push(l[n][1]);eg.loadItemInfo(m,function(){h.renderInventory(l,q,t,r,s),e.interactiveChildren=g.interactiveChildren=!0})})};var q=0;this.renderInventory=function(b,c,d,e,f){q++;for(var g=this.itemContainer.children.length-1;g>=0;g--){var i=this.itemContainer.children[g];i.renderId=q,this.itemContainer.removeChild(i)}for(var g=0;g<b.length;g++)!function(){var i=o[b[g][0]];i||(o[b[g][0]]=i=new og(b[g])),h.itemContainer.addChild(i.container);var j=k.floor(g/10),l=90*(g-10*j),m=90*j;c?(a.UI.Tween.set(i.container,{alpha:0}),u(function(){e?a.UI.Tween.fromTo(i.container,.6,{alpha:0,y:m-20,x:l},{alpha:1,y:m,x:l},a.UI.Ease.Power3.easeOut):a.UI.Tween.fromTo(i.container,.6,{alpha:0,x:l+(d?-20:20),y:m},{alpha:1,x:l,y:m},a.UI.Ease.Power3.easeOut)},5*g)):f?(i.container.renderId!=q&&a.UI.Tween.set(i.container,{alpha:0}),u(function(){i.container.renderId==q?(a.UI.Tween.set(i.container,{alpha:1}),a.UI.Tween.fromTo(i.container,1,{y:i.container.y,x:i.container.x},{y:m,x:l},a.UI.Ease.Power3.easeOut)):(a.UI.Tween.set(i.container,{x:l,y:m}),a.UI.Tween.fromTo(i.container,1,{alpha:0},{alpha:1},a.UI.Ease.Power3.easeOut))},10*g)):a.UI.Tween.set(i.container,{x:l,y:m,alpha:1})}()},this.open=function(a){n||this.init(),this.loadInventory(1,l,m,!1,!1),this.isOpen=!0},this.close=function(a){this.isOpen=!1}},qg=void 0,rg=function(b,c){var d,e=void 0,g=c,h=!1,i=this.container=new a.UI.Button({width:80,height:50,background:a.UI.Sprite.fromFrame("UI/blank.png")});i.background.alpha=.3,i.background.tint=16777215;var j=new S;j.container.alpha=.6,j.container.position.set(40,25),j.container.scale.set(.4),i.container.addChild(j.container);var k=new a.UI.DynamicText(" ",{style:$c,width:"100%",allowTags:!0});k.anchorBottom=-18,k.style.align="center",i.addChild(k),i.on("click",function(){return Zh.authenticated?d.RequiredCrewLevel>e.getLevel()?void nc.open("ERROR","Tank requires Crew Level "+d.RequiredCrewLevel,"OK"):(i.interactive=!1,void(h||f.post("/Crew/EquipTank",{classId:d.ID,crewIndex:e.index}).done(function(a){if(i.interactive=!0,a.success)for(var b=0;b<a.data.length;b++){var c=a.data[b][0],e=a.data[b][1],f=pf.crews.getCrew(c);f.classId=e,pf.crews.updatePreview(c),g.update(d)}else a.message&&nc.open("ERROR",a.message,"OK")}))):void xc.open("You must sign-in to change tanks")}),this.update=function(c){d=c,e=pf.crews.getCrew(b),k.value="<b>"+vf[b]+"</b> <font tint='#cccccc'>LVL "+e.getLevel();var f=tankClass[e.classId];if(!e.unlocked)return void(i.visible=i.interactive=!1);i.visible=i.interactive=!0,e.classId<=0?j.container.visible=!1:(j.container.visible=!0,j.loadClass(f.ID,f.SkinCannon?f.SkinCannon:f.DefaultSkinCannon,f.SkinBody?f.SkinBody:f.DefaultSkinBody));var g=d.RequiredCrewLevel<=e.getLevel();h=c.ID==e.classId,a.UI.Tween.to(i.background,.3,{tint:h?"#aedf29":"#ffffff",alpha:h?.5:.3},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(j.container,.3,{alpha:h?1:.4},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(i,.3,{alpha:g?1:.4},a.UI.Ease.Circ.CircOut)}},sg=function(){var b=this,c=this.container=new a.UI.Container(10,100);c.horizontalAlign="center";var d=this.headline=new a.UI.DynamicText("EQUIP TANK",{style:kd,width:"100%"});d.style.align="center",c.addChild(d);for(var e={},f=0;f<6;f++){var g=e[f]=new rg(f,b);c.addChild(g.container),g.container.x=85*f,g.container.y=27}this.update=function(a){var b=0;for(var d in e)g=e[d],g.update(a),g.container.visible&&(b=g.container.x);c.width=b+80}},tg=function(){var b=this.container=new a.UI.Container(240,50),c=function(){var b=this.container=new a.UI.Container("100%",20),c=a.Texture.fromFrame("UI/check_false.png"),d=a.Texture.fromFrame("UI/check_true.png"),e=new a.UI.Sprite(c);e.y=3;var f=new a.UI.DynamicText("hej",{style:ad});f.anchorLeft=20,b.addChild(e,f),this.update=function(a,b){f.value=a,e.sprite.texture=b?d:c,f.alpha=b?1:.7}},d=new a.UI.DynamicText("Requirements",{style:jd}),e=new c,f=new c;f.container.anchorTop=20,e.container.anchorTop=40,b.addChild(d,e.container,f.container),this.update=function(a){var b=!0;if(a.RequiredTankUnlock>0){e.container.visible=!0;var c=tankClass[a.RequiredTankUnlock];e.update("Unlock "+c.Name,c.owned),c.owned||(b=!1)}else e.container.visible=!1;var d=pf.crews.getMaxLevel(),g=d>=a.RequiredCrewLevel;return f.update("Reach Crew Level "+a.RequiredCrewLevel+(g?"":" (Current: "+d+")"),g),g||(b=!1),b}},ug=function(){var b,c=this.container=new a.UI.Container(523,"100%");c.alpha=0;var d=this,e=a.UI.Sprite.fromFrame("UI/blank.png");e.tint=8354161,e.width="100%",e.height="100%",e.alpha=.7;var g=new a.UI.Sprite(df);g.width="100%",g.height="100%",g.alpha=.3,g.tint=2490144,c.addChild(e,g);var h=new xh;h.container.anchorTop=19,c.addChild(h.container);var i=new vh,j=new vh;i.container.y=19,j.container.y=154,i.container.anchorRight=j.container.anchorRight=10,c.addChild(i.container,j.container);var k=a.UI.Sprite.fromFrame("UI/blank.png");k.tint=0,k.width=248,k.height=111,k.alpha=.15,k.anchorTop=292,k.anchorRight=10,c.addChild(k);var l=new a.UI.DynamicText(" ",{style:ad,width:237,height:100});l.anchorTop=297,l.anchorRight=10,c.addChild(l);var m=new wh;m.container.anchorTop=292,m.container.anchorLeft=10,c.addChild(m.container);var n=new tg;n.container.anchorLeft=13,n.container.anchorTop=410,c.addChild(n.container);var o=new sg;o.container.anchorTop=410,c.addChild(o.container);var p=new a.UI.Container("100%",150);p.anchorBottom=0,c.addChild(p);var q=lh(210,40,function(){f.post("/Shop/StartUnlockTank",{id:b.class.ID}).done(function(a){if(a.success){vc.open(a.price,a.currency,"Unlock "+b.class.Name,-1,function(){googa("send","event","TankPage","Purchase init - "+b.class.Name),f.post("/Shop/UnlockTank",{id:b.class.ID}).done(function(a){a.success?(pf.wallet.UpdateBalance(a.currency,a.balance),nc.open("PURCHASE COMPLETE","Unlock "+b.class.Name,"OK"),b.unlock(),d.load(b,!0),googa("send","event","TankPage","Purchase Success - "+b.class.Name)):(a.message?nc.open("PURCHASE ERROR",a.message,"OK"):nc.open("PURCHASE ERROR","","OK"),googa("send","event","TankPage","Purchase Error - "+b.class.Name))})})}else{if(a.missing){pc.open(a.missing,a.currency),googa("send","event","TankPage","Purchase Missing - "+b.class.Name)}a.message&&(nc.open("ERROR",a.message,"OK"),googa("send","event","TankPage","Purchase Error - "+b.class.Name))}})});q.anchorBottom=13,q.anchorRight=14,p.addChild(q);var r=lh(100,40,function(){d.unfocus()},new a.UI.DynamicText("CLOSE",{style:kd}));r.anchorBottom=13,r.anchorLeft=14,p.addChild(r);var s=new a.UI.DynamicText("UNLOCK",{style:kd});s.y=10,s.x=20,q.addChild(s);var v=new ec(0,ah.Gold,2);v.container.anchorRight=10,v.container.y=36,q.addChild(v.container);var w=new ec(0,ah.Gold,2);w.container.anchorBottom=17,w.container.anchorRight=24,c.addChild(w.container),this.unfocus=function(){c.interactive=!1,b=void 0,d.refresh()},this.load=function(f,k){var r=f.class;o.container.visible=p.visible=n.container.visible=w.container.visible=q.visible=q.interactive=!1;var s=n.update(r);return!s&&k?(k=!1,void d.unfocus()):(k&&(c.interactive=!0,b=f),a.UI.Tween.to(g,.3,{tint:1==r.WeightClass?"#25ff20":2==r.WeightClass?"#5b67ff":3==r.WeightClass?"#ff0000":"#ffa200"},a.UI.Ease.Circ.CircOut),1==r.WeightClass?a.UI.Tween.to(c,.3,{anchorLeft:395},a.UI.Ease.Circ.CircOut):2==r.WeightClass?a.UI.Tween.to(c,.3,{anchorLeft:0},a.UI.Ease.Circ.CircOut):3==r.WeightClass?a.UI.Tween.to(c,.3,{anchorLeft:365},a.UI.Ease.Circ.CircOut):a.UI.Tween.to(c,.3,{anchorLeft:532},a.UI.Ease.Circ.CircOut),l.value=r.Description,h.update(r),m.update(r),i.update(r.PrimaryWeapon,r.PrimaryConfig),j.update(r.SecondaryWeapon,r.SecondaryConfig),a.UI.Tween.to(e,.3,{alpha:k?1:.85},a.UI.Ease.Circ.CircOut),k?(p.visible=!0,r.owned?(o.container.visible=!0,o.headline.visible=!0):(n.container.visible=!0,s?q.container.visible=q.container.interactive=!0:w.container.visible=!0)):r.owned?(o.container.visible=!0,o.headline.visible=!1):(n.container.visible=!0,w.container.visible=!0),o.container.visible&&o.update(r),w.container.visible&&(w.updateAmount(r.UnlockPrice),w.updateCurrency(r.UnlockCurrency)),void(q.container.visible&&(v.updateAmount(r.UnlockPrice),v.updateCurrency(r.UnlockCurrency))))};var x;this.refresh=function(){b||(qg?(x&&t(x),x=void 0,a.UI.Tween.to(c,.3,{alpha:1},a.UI.Ease.Circ.CircOut),d.load(qg)):x=u(function(){d.clear()},250))},this.clear=function(){a.UI.Tween.to(c,.6,{alpha:0})}},vg=function(){var b,c=this,d=!1,e=new a.display.Layer,f=new a.display.Layer,g=new a.display.Layer,h=new a.display.Layer,i=new a.display.Layer,j=new a.display.Layer;this.init=function(){d=!0;var c=this.container=new a.UI.Container("100%","100%");c.verticalAlign="middle",c.horizontalAlign="center",c.pivot=.5,pf.container.addChild(c),tankClass[100].owned=!0,tankClass[200].owned=!0,tankClass[300].owned=!0,this.initTankLayout(),c.container.addChild(e,f,g,h,i,j),l(100,208,516),l(200,600,516),l(300,980,516),b=new ug,c.addChild(b.container),b.container.parentLayer=j},this.initTankLayout=function(){var b=this.inventoryContainer=new a.UI.Container("100%","100%");b.anchorRight=0,b.anchorLeft=0,this.container.addChild(b);var c=68,d=0,e=34,f=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));f.tint=10066329,f.width="100%",f.height="100%",f.alpha=.5,b.addChild(f);var g=new a.UI.Sprite(ff);g.tint=0,g.width=70,g.height="100%",g.alpha=.6,b.addChild(g);for(var h=!1,j=0;j<8;j++){if(!h){var k=new a.UI.Sprite(ff);k.tint=16777215,k.width="100%",k.height=c,k.alpha=.04,k.anchorBottom=d+c*j,b.addChild(k)}var l=new a.UI.DynamicText(""+(j+1),{style:ld});l.parentLayer=i,l.tint=16777215,l.anchorLeft=28,l.anchorBottom=d+17+c*j,b.addChild(l),h=!h}var k=new a.UI.Sprite(ff);k.tint=0,k.width=70,k.height=e,k.alpha=.5,k.anchorTop=0,b.addChild(k);var l=new a.UI.DynamicText("REQUIRED\nCREW LEVEL",{style:gd});l.parentLayer=i,l.style.lineHeight=12,l.style.align="center",l.width=70,l.tint=16777215,l.anchorTop=4,b.addChild(l);var k=new a.UI.Sprite(ff);k.tint=16777215,k.height=e,k.alpha=.1,k.anchorLeft=70,k.anchorRight=0,k.anchorTop=0,b.addChild(k);for(var j=0;j<3;j++){var m=new a.UI.Sprite(df);m.tint=0==j?2490144:1==j?5990399:2==j?16711680:16753152,m.height=e,m.alpha=.3,m.width=383,m.anchorLeft=70+383*j,m.anchorTop=0,m.anchorBottom=0,m.blendMode=2,b.addChild(m);var l=new a.UI.DynamicText(0==j?"LIGHT TANK":1==j?"MEDIUM TANK":2==j?"HEAVY TANK":"SPECIAL",{style:id});l.parentLayer=i,l.tint=16777215,l.anchorLeft=m.anchorLeft,l.anchorTop=8,l.width=m.width,l.style.align="center",b.addChild(l)}};var k=function(a){var b=[];for(var c in tankClass){tankClass[c].RequiredTankUnlock==a&&b.push(c)}return b},l=function(b,d,g,h){var i=tankClass[b],j=m(b);if(i.PreviewTankTree=j,d+=94*i.TreeOffset,j.container.parentLayer=f,j.container.x=d,j.container.y=g+68-68*i.RequiredCrewLevel,c.container.addChild(j.container),h){var n;if(0!=i.TreeOffset)n=a.UI.Sprite.fromFrame("UI/Menu/Tanks/tree-line-offset.png"),1===i.TreeOffset?(n.scaleX=-1,n.anchorLeft=-5+n.width):n.anchorRight=-5;else{n=a.UI.Sprite.fromFrame("UI/Menu/Tanks/tree-line.png");var o=j.class.RequiredCrewLevel-h.class.RequiredCrewLevel;n.height=16*o+52*(o-1),n.horizontalAlign="center"}n.parentLayer=e,n.bottom=4,j.container.addChild(n)}j.parent=h,j.children=[];for(var p=k(b),q=0;q<p.length;q++){j.children.push(l(p[q],d,g,j))}return j.update(),j},m=function(c){var d=tankClass[c],e=d.Name,f=new a.UI.Container(91,56),j=new a.UI.SliceSprite(lf,6,(!0),(!0));j.tint=2236962,j.alpha=.8,j.width=j.height="100%";var k=new a.UI.Button({background:j});k.pivot=.5,k.anchorLeft=0,k.anchorTop=0,k.width="100%",k.height="100%",f.addChild(k);var l=new S;l.loadClass(c,d.DefaultSkinCannon,d.DefaultSkinBody),l.container.scale.set(.45),l.container.x=f.width,l.container.y=f.height,l.container.parentLayer=g;var m=new a.UI.Container("100%","100%");m.pivot=.5,m.container.addChild(l.container),k.addChild(m);var n=new a.UI.DynamicText(e,{style:fd});n.parentLayer=i,n.horizontalAlign="center";var o=new a.UI.Sprite(ff);o.parentLayer=h,o.tint=0,o.height=12,o.width=60,o.horizontalAlign="center",o.anchorTop=-1,f.addChild(o),o.addChild(n),u(function(){o.width=n.width+6},200);var p={container:f,tank:l,class:d,parent:void 0,children:void 0,unlock:function(){if(!this.class.owned&&this.parent&&this.parent.class.owned){this.class.owned=!0,this.update();for(var a=0;a<this.children.length;a++)this.children[a].update()}},update:function(){this.class.owned?(a.UI.Tween.to(f,.4,{alpha:1}),j.tint=1==this.class.WeightClass?10538563:2==this.class.WeightClass?6385397:15286078):this.parent&&this.parent.class.owned?(a.UI.Tween.to(f,.4,{alpha:1}),j.tint=2236962):(a.UI.Tween.set(f,{alpha:.2}),j.tint=2236962),l.loadClass(c,d.SkinCannon?d.SkinCannon:d.DefaultSkinCannon,d.SkinBody?d.SkinBody:d.DefaultSkinBody)}};return k.on("hover",function(c){c?(a.UI.Tween.to(j,.1,{alpha:1}),a.UI.Tween.to(k,.1,{scale:1.07})):(a.UI.Tween.to(j,.1,{alpha:.8}),a.UI.Tween.to(k,.1,{scale:1})),c?qg=p:qg==p&&(qg=void 0),b.refresh()}),k.on("click",function(a){b.load(p,!0)}),p};this.refresh=function(){b&&b.unfocus();for(var a in tankClass){var c=tankClass[a];c.PreviewTankTree&&c.PreviewTankTree.update()}},this.open=function(a){d||this.init()},this.close=function(a){}},wg=function(b){var c=this.container=new a.UI.Container("100%","10%"),d=new a.UI.Container("100%","100%");if(b){var e=a.UI.Sprite.fromFrame("UI/blank.png");e.tint=0,e.width="100%",e.height="100%",e.alpha=.1,c.addChild(e)}c.addChild(d);var f=0,g=new a.UI.Button({width:37,height:37,background:a.UI.Sprite.fromFrame("UI/blank.png")});g.background.tint=13355979,g.y=3,g.x=5,d.addChild(g),g.background.alpha=.5,g.on("hover",function(a){g.background.alpha=a?1:.5}),g.on("click",function(){pf.profilePage.open(f)});var h=new a.UI.Sprite(a.Texture.fromFrame("UI/avatar.png"));h.anchorLeft=h.anchorTop=h.anchorBottom=h.anchorRight=2,g.addChild(h);var i=a.UI.Sprite.fromFrame("UI/Rank/Small/1.png");i.x=55,i.top=12,d.addChild(i);var j=new a.UI.DynamicText(" ",{style:bd,allowTags:!0});j.x=82,j.top=12,d.addChild(j);var l=new a.UI.DynamicText(" ",{style:jd});l.anchorRight=15,l.top=12,d.addChild(l),this.update=function(b,c,e,g,m,n){f=b,j.value="<b>"+g+".</b> "+m,l.value=n,i.sprite.texture=a.Texture.fromFrame("UI/Rank/Small/"+k.min(240,e)+".png"),h.sprite.texture=c?a.Texture.fromImage("/avatar?path="+c):a.Texture.fromFrame("UI/avatar.png"),d.visible=d.interactive=!0},this.clear=function(){d.visible=d.interactive=!1}},xg=function(){var b=1,c=-1,d=2,e=0,g=this,h=this.container=new a.UI.Container,i=new a.UI.Container;i.anchorTop=i.anchorLeft=i.anchorRight=0,i.anchorBottom=40,h.addChild(i);var j=a.UI.Sprite.fromFrame("UI/blank.png");j.tint=8027265,j.width="100%",j.height="100%",j.alpha=.5,i.addChild(j);var l=new a.UI.Button({width:50,height:35,background:a.UI.Sprite.fromFrame("UI/blank.png"),text:new a.UI.DynamicText("▶",{style:jd})}),m=new a.UI.Button({width:50,height:35,background:a.UI.Sprite.fromFrame("UI/blank.png"),text:new a.UI.DynamicText("◀",{style:jd})});l.anchorBottom=m.anchorBottom=0,l.anchorRight=0,m.anchorRight=55,l.background.tint=m.background.tint=3355443,h.addChild(l,m),l.setState=m.setState=function(a){this.interactive=a,this.alpha=a?1:.3,this.background.tint=a?10695212:3355443},l.on("click",function(){g.nextPage()}),m.on("click",function(){g.prevPage()});for(var n=[],o=!1,p=0;p<10;p++){var q=new wg(o);n.push(q),q.container.y=10*p+"%",i.addChild(q.container),o=!o}this.setPeriod=function(a){a!=d&&(d=a,b=1,this.load())},this.setGamemode=function(a){a!=c&&(c=a,b=1,this.load())},this.setType=function(a){a!=e&&(e=a,b=1,this.load())},this.setPage=function(a){a=k.min(20,k.max(1,a)),a!=b&&(b=a,this.load())},this.nextPage=function(){this.setPage(b+1)},this.prevPage=function(){this.setPage(b-1)},this.setSettings=function(a,f,g,h){d=a,c=g,e=f,b=k.min(20,k.max(1,h)),this.load()};var r=null;this.load=function(){var a={GameMode:c,Type:e,Period:d,Page:b,AmountPerPage:10};r&&r.abort(),r=f.ajax({type:"POST",url:"/leaderboard/",data:a,success:function(b){var c="";switch(a.Type){case 1:c+="Most Wins-";break;case 2:c+="Most Kills-";break;case 3:c+="Best K/D-"}switch(a.GameMode){case-1:c+="All Gamemode-";break;case 0:c+="King DM-";break;case 1:c+="Conquest-"}switch(a.Period){case 0:c+="Today-";break;case 1:c+="This Month-";break;case 2:c+="Alltime-"}googa("send","event","Leaderboard",c+"p"+a.Page);for(var d=0;d<n.length;d++)n[d].clear();for(var d=0;d<b.length;d++){n[d].update(b[d][0],b[d][2],b[d][4],b[d][1],b[d][3],b[d][5])}l.setState(b.length>=a.AmountPerPage),m.setState(a.Page>1)},dataType:"json"})},this.reset=function(){}},yg=function(){var b=!1;this.init=function(){b=!0;var c=this.container=new a.UI.Container("100%","100%");c.verticalAlign="middle",c.horizontalAlign="center",c.pivot=.5,pf.container.addChild(c);var d=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));d.tint=12105912,d.width="100%",d.height="100%",d.alpha=.7,c.addChild(d);var d=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));d.tint=0,d.width="100%",d.anchorTop=40,d.anchorBottom=0,d.alpha=.3,c.addChild(d);var e=a.UI.Sprite.fromFrame("UI/Menu/Icons/leaderboard.png");e.top=8,e.left=12;var f=new a.UI.DynamicText(nf("LEADERBOARD"),{style:id});f.left=60,f.top=10,c.addChild(e,f);var g=a.UI.Sprite.fromFrame("UI/blank.png");g.width=150,g.height=40,g.y=45,g.x=10,g.tint=8027265,c.addChild(g);var h=new a.UI.DynamicText("Top Level",{style:ld});h.verticalAlign="middle",h.horizontalAlign="center",g.addChild(h);var i=new xg;i.container.anchorTop=90,i.container.anchorLeft=i.container.anchorBottom=10,i.container.width=400,c.addChild(i.container),i.setSettings(2,0,-1,1);var j=new xg;j.container.anchorTop=90,j.container.anchorRight=j.container.anchorBottom=10,j.container.anchorLeft=420,j.setSettings(2,2,-1,1),c.addChild(j.container);var k=new a.UI.Container;k.height=40,k.anchorRight=10,k.anchorLeft=420,k.y=45,c.addChild(k);var l=new Qh([["Most Wins",2,267,!0],["Most Kills",1,267],["Best K/D",3,266]],0,function(a){j.setType(a)});c.addChild(l.container),l.container.anchorRight=0,l.marker.tint=10695212;var m=new Qh([["All Time",2,140,!0],["This Month",1,180],["Today",0,120]],0,function(a){j.setPeriod(a)});k.addChild(m.container),m.container.anchorRight=0,m.marker.tint=10695212;var n=new Nh(311,40,18,18,[["All Gamemodes","-1",!0],["King DM","0",!0],["Conquest","1",!0]],function(a){j.setGamemode(a)});n.container.anchorLeft=0,k.addChild(n.container)},this.open=function(a){b||this.init()},this.close=function(a){}},zg=function(){var b,c,d,e,f,g,h,i=!1,j=!1;this.init=function(){i=!0,c=this.container=new a.UI.Container("100%","100%"),c.verticalAlign="middle",c.horizontalAlign="center",c.pivot=.5,pf.container.addChild(c),d=new a.UI.Container(917,"100%"),d.anchorRight=0,h=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0)),h.tint=15592941,h.width="100%",h.height="100%",h.alpha=.6,g=new a.UI.SliceSprite(ef,3),g.tint=1118481,g.width="100%",g.height=37,g.alpha=.35,f=new a.UI.DynamicText(nf("SETTINGS"),{style:id}),f.left=12,f.top=10,d.addChild(h,g,f),e=new a.UI.Container("100%",540),e.anchorLeft=e.anchorRight=e.anchorBottom=0,d.addChild(e),c.addChild(d),b=this.menu=new Lg,c.addChild(b.container)},this.open=function(a){i||this.init(),j=!0},this.close=function(a){j=!1;
};var k,l={};this.openSubMenu=function(c){if(j||pf.openSubMenu(pf.settingsPage),!l[c])switch(c){case"GAME":l[c]=new Tg;break;case"CONTROLS":l[c]=new Rg;break;case"AUDIO":l[c]=new Qg;break;case"VIDEO / VISUAL":l[c]=new Ug;break;case"ACCOUNT":l[c]=new Mg;break;default:return}if(k){var d=k;d.active=!1,d.container.interactiveChildren=!1,a.UI.Tween.to(d.container,.2,{alpha:0,onComplete:function(){d.active||(d.container.visible=!1)}},a.UI.Ease.Cubic.easeOut)}var g=l[c];g.active=!0,g.container.interactiveChildren=!0,g.container.visible=!0,g.update(),k=g,null===g.container.parent&&(g.container.anchorRight=0,e.addChild(g.container)),f.value=nf(c),a.UI.Tween.fromTo(g.container,.5,{alpha:0,scale:.95},{alpha:1,scale:1},a.UI.Ease.Cubic.easeOut),b.buttons[c].setActive()}},Ag=function(){var b=this.container=new a.UI.Container("100%","100%"),c=new a.UI.ScrollingContainer((!1),(!0),(!0));b.addChild(c),c.height="100%",c.anchorLeft=0,c.anchorRight=12;var d=10,e=[];ScrollBar=new a.UI.ScrollBar({track:new a.UI.SliceSprite(hf,4),handle:new a.UI.SliceSprite(gf,4),vertical:!0,scrollingContainer:c,autohide:!0}),ScrollBar.width=ScrollBar.track.width=ScrollBar.handle.width=12,ScrollBar.anchorTop=5,ScrollBar.anchorBottom=5,ScrollBar.anchorRight=0,ScrollBar.track.tint=2236962,ScrollBar.track.blendMode=0,b.addChild(ScrollBar),this.addChild=function(a,b){e.push(a),a.container.y=d,b||(d+=10+a.container.height),c.addChild(a.container)},this.update=function(){for(var a=0;a<e.length;a++)e[a].update()}},Bg=function(b,c,d,e,f){var g=this,h=this.container=new a.UI.Container;h.height=30,h.anchorLeft=h.anchorRight=5,b.addChild(this);var i=new a.UI.DynamicText(c,{style:id});h.addChild(i),i.y=3,i.x=10;var j=this.check=new a.UI.CheckBox({background:a.UI.Sprite.fromFrame("UI/ui-box-4.png"),checkmark:a.UI.Sprite.fromFrame("UI/check_true.png"),checked:d[e]});j.y=5,j.anchorLeft=200,h.addChild(j),j.on("change",function(a){g.change(a)}),this.change=function(a){f()},this.update=function(){j.checked=d[e]}},Cg=function(b,c,d,e,f,g,h,i,j,k,l,m){var n=this.container=new a.UI.Container;n.height=30,n.anchorLeft=5,n.anchorRight=c+5,b.addChild(this);var o=new a.UI.DynamicText(d,{style:id});n.addChild(o),o.y=3,o.x=10;var p=new a.UI.DynamicText(g[h]*f+e,{style:id});n.addChild(p),p.y=3,p.right=50;var q=new a.UI.Slider({track:new a.UI.SliceSprite(hf,4,(!0),(!1)),fill:new a.UI.SliceSprite(jf,4,(!0),(!1)),handle:new a.UI.Sprite(gf),value:g[h],minValue:i,maxValue:j,decimals:k});q.fill.tint=65280,q.y=7,q.anchorLeft=200,q.anchorRight=55,n.addChild(q),q.on("changing",function(a){g[h]=a,p.value=(a*f).toFixed(0)+e,"function"!=typeof m||0!==l&&2!==l||m()}),q.on("change",function(a){g[h]=a,rf.saveUserSettings(),"function"!=typeof m||1!==l&&2!==l||m()}),this.update=function(){q.value=g[h],p.value=(g[h]*f).toFixed(0)+e}},Dg=function(b,c,d,e){var f=this.container=new a.UI.Container;f.height=d,f.anchorLeft=f.anchorRight=5,b.addChild(this);var g=a.UI.Sprite.fromFrame("UI/blank.png");f.addChild(g),g.width=g.height="100%",g.tint=4149889,g.alpha=.7;var h=new a.UI.DynamicText(c,{style:e,allowTags:!0,width:50});f.addChild(h),h.anchorLeft=h.anchorRight=10,h.y=5,this.update=function(){}},Eg=function(b,c,d,e,f,g,h,i,j,k){var l=this.container=new a.UI.Container;l.height=e+20,l.anchorLeft=l.anchorRight=5,b.addChild(this,k);var m=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/blank.png"),text:new a.UI.DynamicText(c,{style:id}),width:d,height:e});m.background.tint=h,m.background.alpha=i,m.y=g,m.anchorLeft=f,l.addChild(m),m.on("click",function(){"function"==typeof j&&j()}),this.update=function(){}},Fg=function(b,c,d,e,f,g,h,i,j){var k,l=this,m=this.container=new a.UI.Container;m.height=60,m.anchorLeft=m.anchorRight=5,b.addChild(this);var n=new a.UI.DynamicText(c,{style:id});m.addChild(n),n.y=3,n.x=10;var o=this.input=new a.UI.TextInput({value:f[g]||d||"",background:a.UI.Sprite.fromFrame("UI/blank.png"),style:{fontSize:15,fill:"#ffffff"},lineHeight:23,paddingLeft:10,maxLength:e}),p=new a.UI.Button({background:new a.UI.SliceSprite(a.Texture.fromFrame("UI/ui-box-line-green.png"),4),width:120,height:30});p.background.alpha=.5,p.on("hover",function(b){a.UI.Tween.to(this.background,.4,{alpha:b?1:.5},a.UI.Ease.Circ.CircOut)}),p.anchorTop=0,p.anchorLeft=465,m.addChild(p);var q=new a.UI.DynamicText("SAVE",{style:_c});if(q.anchorLeft=11,q.anchorTop=7,p.addChild(q),h){var r=new ec(0,i,1);r.container.anchorRight=6,r.container.y=25,p.addChild(r.container),r.updateAmount(h)}else q.align="center";o.background.alpha=.17,o.width=261,o.height=30,o.y=0,o.anchorLeft=200,o.on("keyup",function(a){l.keyup(a)}),m.addChild(o),o.on("focusChanged",function(b){a.UI.Tween.to(this.background,.4,{alpha:b?.25:.17},a.UI.Ease.Circ.CircOut)}),this.keyup=function(b){var c=o.value!==k;p.interactive=c,a.UI.Tween.to(p,.4,{alpha:c?1:0},a.UI.Ease.Circ.CircOut)},this.update=function(){o.value=k=f[g],this.keyup()},p.on("click",function(){j()})},Gg=function(b,c,d){var e=b[c],f=e?x(Xc.InputManager.keyName[b[c]]):" ",g=this.button=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/blank.png"),text:new a.UI.DynamicText(f,{style:id}),width:60,height:20});g.background.alpha=.2,g.y=5,g.on("hover",function(a){g.background.alpha=a?.25:.2}),g.on("click",function(){Ig.listen(b,c,d)})},Hg=function(){var b,c,d,e=!1,f=new a.UI.Container("100%","100%");f.onClick=function(){h()},f.interactive=!0;var g=function(e){if(27==e.which)this.clear();else{for(var f in d)f.indexOf("Input_")!=-1&&d[f]==e.which&&(d[f]=0);d[b]=e.which,rf.saveUserSettings()}return c(),e.preventDefault(),e.stopPropagation(),h(),a.UI.Interaction.InputController.blur(),!1};this.listen=function(a,h,i){d=a,c=i,b=h,Dd.Scene.UI_MainMenu.addChild(f),e||(r.addEventListener("keyup",g),Xc.InputManager.paused=!0)};var h=this.clear=function(){r.removeEventListener("keyup",g),Dd.Scene.UI_MainMenu.removeChild(f),Af.parent&&(Af.parent.removeChild(Af),Xc.InputManager.paused=!1)}},Ig=new Hg,Jg=function(b,c,d,e,f){var g=this.container=new a.UI.Container;g.height=30,g.anchorLeft=g.anchorRight=5,b.addChild(this);var h=new a.UI.DynamicText(c,{style:id});g.addChild(h),h.y=3,h.x=10;for(var i={},j=200,k=0;k<e.length;k++){var l=e[k],m=i[l]=new Gg(d,l,f);m.button.anchorLeft=200+70*k,g.addChild(m.button),j+=70,m.button.on("click",function(){if(!Af){Af=new a.UI.Container(290,20),Af.y=5;var b=new a.UI.DynamicText("Press any key to change, ESC to cancel!",{style:id,width:"100%"});b.style.align="center";var c=a.UI.Sprite.fromFrame("UI/blank.png");c.width=c.height="100%",c.tint=65280,c.alpha=.3,Af.addChild(c,b)}g.addChild(Af),Af.x=j})}this.update=function(){for(var a in i){i[a].button.text.value=d[a]?x(Xc.InputManager.keyName[d[a]]):" "}}},Kg=function(b){var c=this.container=new a.UI.Container;c.anchorLeft=c.anchorRight=c.top=15,c.height=40;var d=30,e=[],f=a.UI.Sprite.fromFrame("UI/blank.png");f.width=f.height="100%",f.alpha=.2,f.tint=1118481;var g=new a.UI.DynamicText(b,{style:jd});g.x=6,g.y=5,c.addChild(f,g),c.updateHeadline=function(a){g.value=a},this.addChild=function(a,b){e.push(a),c.addChild(a.container),b||(c.height+=a.container.height,a.container.y=d,d+=a.container.height)},this.update=function(){for(var a=0;a<e.length;a++)e[a].update()}},Lg=function(){var b=this.container=new a.UI.Container(294,"100%"),c=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));c.tint=15592941,c.width="100%",c.height="100%",c.alpha=.6;var d=new a.UI.SliceSprite(ef,3);d.tint=1118481,d.width="100%",d.height=37,d.alpha=.35;var e=a.UI.Sprite.fromFrame("UI/Menu/Icons/gear.png");e.top=8,e.anchorRight=8,e.width=e.height=23;var f=new a.UI.DynamicText(nf("SETTINGS"),{style:id});f.left=12,f.top=10,b.addChild(c,d,e,f);for(var g,h=this.buttons={},i=["CONTROLS","AUDIO","VIDEO / VISUAL","ACCOUNT"],j=0;j<i.length;j++)!function(){var c=i[j],d=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/blank.png"),text:new a.UI.DynamicText(nf(c),{style:jd})});d.height=41,d.anchorLeft=d.anchorRight=2,d.top=39+43*j,d.background.alpha=.49,d.background.tint=3355443,d.active=!1,d.on("hover",function(b){this.active||a.UI.Tween.to(this.background,.4,{alpha:b?.7:.49},a.UI.Ease.Circ.CircOut)}),d.setActive=function(){g&&(g.background.alpha=.49,g.background.tint=3355443,g.active=!1),g=d,d.active=!0,d.background.alpha=.7,d.background.tint=10147590},d.on("click",function(a){if(d.active===!1){if("ACCOUNT"==c&&!Zh.authenticated)return void xc.open("You must sign-in to access account settings");d.setActive(),pf.settingsPage.openSubMenu(c)}}),h[c]=d,b.addChild(d)}()},Mg=function(){Ag.call(this);var a,b=new Kg("USER"),c=new Kg("LOGIN METHODS"),e=new Kg("OTHER"),g=new Kg("DELETE ACCOUNT"),h=new Fg(b,"Nickname","Player",0,Zh.data,"username",50,ah.Gems,function(){f.post("/Account/StartChangeName",{}).done(function(a){if(a.success){vc.open(a.price,ah.Gems,"Name Change:\n"+Zh.data.username+" -> "+h.input.value,-1,function(){googa("send","event","Account","Purchase Init - ChangeName"),f.post("/Account/ChangeName",{name:h.input.value}).done(function(a){a.success?(Zh.data.username=a.name,Zh.updateUiValues(),pf.wallet.UpdateBalance(ah.Gems,a.gems),nc.open("NAME CHANGED","New Nickname: "+h.input.value,"OK"),googa("send","event","ChangeName","Success"),h.update()):(nc.open("ERROR CHANGING NAME",a.message,"OK"),googa("send","event","ChangeName","Error - "+a.message))})})}else{qc.open(a.missing),googa("send","event","Account ChangeName","Purchase Missing")}})}),i=new Fg(b,"Mail","",0,Zh.data,"email",0,0,function(){f.post("/Account/ChangeMail",{mail:i.input.value}).done(function(a){a.success?(Zh.data.email=a.mail,Zh.updateUiValues(),nc.open("EMAIL CHANGED","Succesfully changed email to "+a.mail,"OK"),googa("send","event","ChangeEmail","Success"),i.update()):(nc.open("ERROR CHANGING EMAIL",a.message,"OK"),googa("send","event","ChangeEmail","Error - "+a.message))})}),j=new Bg(b,"Allow Friend Requests",Zh.data,"acceptFriendRequests",function(){t(a),a=u(function(a){Zh.data["acceptFriendRequests"]=j.check.checked,$h.SettingsEvents.UpdateUserSetting("acceptFriendRequests",""+Zh.data["acceptFriendRequests"])},1500)});b.addChild(new Ng),c.addChild(new Pg);var k=new Eg(e,"Show Purchace History",200,40,"15%",5,0,.5,function(){Dd.SaleLog.Open()});k.container.anchorLeft=-135;var l=new Eg(e,"Delete stored payment details",240,40,"15%",5,0,.5,function(){f.post("/Shop/ClearCards").done(function(a){nc.open("Clear Payment Details",a?"Success":"Error","OK")})},(!0));l.container.y=k.container.y,l.container.anchorLeft=105;var m=new Eg(e,"Manage newsletter subscription",240,40,"15%",5,0,.5,function(){d.open("/Account/NewsLetter","_blank").focus()},(!0));m.container.y=k.container.y,m.container.anchorLeft=392,new Eg(g,"DELETE ACCOUNT",200,40,"15%",5,16711680,.5,function(){yc.open("DELETE ACCOUNT","You are about to delete your account PERMANENTLY!\nAre you sure about that?","DELETE","ABORT!",!1,!0,function(){pf.buttons.Home.button.click(),$h.SettingsEvents.DeleteUser()},function(){})}).container.anchorLeft=-135;new Dg(g,"* Clicking this button will delete your account permanently!",20,$c);this.addChild(b),this.addChild(c),this.addChild(e),this.addChild(g)},Ng=function(){var b=this,c=[["None","0"],["Facebook","1"],["Steam","2"],["Twitter","4"],["Gravatar","3"]],d=this.container=new a.UI.Container("100%",130),e=a.UI.Sprite.fromFrame("UI/avatar.png");Zh.data["avatar"].length&&(e.sprite.texture=new a.Texture.fromImage("/avatar?path="+Zh.data["avatar"])),e.height=100,e.width=100,e.anchorLeft=205,d.addChild(e);var f=new a.UI.DynamicText("Avatar",{style:id});d.addChild(f),f.y=3,f.x=13;var g={},h=205,i=30;Zh.onData(function(){b.update(),b.updateAvatar()});for(var j=0;j<c.length;j++)g[c[j][0]]=new Og(c[j][0],c[j][1],h,function(){}),h=g[c[j][0]].text.anchorLeft+8*g[c[j][0]].text.value.length+i,d.addChild(g[c[j][0]].container);this.updateAvatar=function(){e.sprite.texture=Zh.data["avatar"].length?new a.Texture.fromImage("/avatar?path="+Zh.data["avatar"]):a.Texture.fromFrame("UI/avatar.png")},this.update=function(){var a=!1;for(key in g)g[key].check.value!=Zh.data["avatarType"]||!Zh.data.loginMethods[key]&&"None"!=key&&"Gravatar"!=key?g[key].check.checked=!1:g[key].check.checked=a=!0,Zh.data.loginMethods[key]||"None"==key||"Gravatar"==key?(g[key].check.interactive=!0,g[key].check.alpha=1,g[key].text.interactive=!0,g[key].text.alpha=1):(g[key].check.interactive=!1,g[key].check.alpha=.7,g[key].text.interactive=!1,g[key].text.alpha=.7);0==a&&(g["None"].check.checked=!0)}},Og=function(b,c,d,e){var f=this.container=new a.UI.Container("20%",120),g=this.check=new a.UI.CheckBox({background:a.UI.Sprite.fromFrame("UI/ui-box-4.png"),checkmark:a.UI.Sprite.fromFrame("UI/check_true.png"),checkgroup:"chosenavatar",value:c});g.y=110,g.anchorLeft=d,f.addChild(g);var h=this.text=new a.UI.DynamicText(b,{style:id});h.anchorLeft=d+20,h.y=110,f.addChild(h),h.interactive=!0,h.onClick=function(){g.click()},g.on("change",function(a){a&&$h.SettingsEvents.UpdateUserSetting("avatarType",g.value)})},Pg=function(){var b=this.container=new a.UI.Container("100%",50),c=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Login/facebook.png")}),d=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Login/twitter.png")}),e=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Login/steam.png")}),f=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Login/google.png")}),g=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Login/vkontakte.png")});c.method="Facebook",c.val=1,d.method="Twitter",d.val=4,e.method="Steam",e.val=2,f.method="Google",g.method="VKontakte",c.tint=d.tint=e.tint=15592941,c.y=d.y=e.y=f.y=g.y=3,c.x=16,d.x=140,e.x=248,f.x=358,g.x=468;var h=function(a){this.background.tint=Zh.data.loginMethods[this.method]?a?16711680:15592941:a?16777215:15592941},i=function(a){this.y=a?4:3},j=function(){Zh.data.loginMethods[this.method]?($h.SettingsEvents.RemoveExternalLogin(this.method),Zh.data["avatarType"]==this.val&&$h.SettingsEvents.UpdateUserSetting("avatarType",0)):dg("/Account/AddExternalLogin?provider="+this.method,this.method+" Login","500","400",!0)};c.on("hover",h),d.on("hover",h),e.on("hover",h),f.on("hover",h),g.on("hover",h),c.on("press",i),d.on("press",i),e.on("press",i),f.on("press",i),g.on("press",i),c.on("click",j),d.on("click",j),e.on("click",j),f.on("click",j),g.on("click",j),b.addChild(c,d,e,f,g),this.update=function(){}};Mg.prototype=Object.create(Ag),Mg.prototype.constructor=Mg;var Qg=function(){Ag.call(this);var a=new Kg("AUDIO"),b=new Kg("VOLUME"),c=new Kg("MAIN MUSIC PITCH (Requested by Painkiller)");new Bg(a,"Mute",rf.UserSettings,"VolumeMute",function(){}).change=function(a){rf.UserSettings["VolumeMute"]=a,rf.saveUserSettings(),Dd.Audio.Update()};new Cg(b,0,"Master","%",100,rf.UserSettings,"VolumeMaster",0,1,2,0,function(){Dd.Audio.Update()}),new Cg(b,0,"Game","%",100,rf.UserSettings,"VolumeGame",0,1,2,0,function(){Dd.Audio.Update()}),new Cg(b,0,"Music","%",100,rf.UserSettings,"VolumeMusic",0,1,2,0,function(){Dd.Audio.Update()}),new Cg(b,0,"Announcer","%",100,rf.UserSettings,"VolumeAnnouncer",0,1,2,0,function(){Dd.Audio.Update()}),new Cg(b,0,"Interface","%",100,rf.UserSettings,"VolumeUI",0,1,2,0,function(){Dd.Audio.Update()}),new Cg(b,0,"Your Engine","%",100,rf.UserSettings,"VolumeMeEngine",0,1,2,0,function(){Dd.Audio.Update()}),new Cg(c,0,"Pitch","%",100,rf.UserSettings,"MusicPitch",0,4,2,0,function(){pf.startMusic()});this.addChild(a),this.addChild(b),this.addChild(c)};Qg.prototype=Object.create(Ag),Qg.prototype.constructor=Qg;var Rg=function(){Ag.call(this);var a=this,b=new Kg("STEERING METHOD"),c=new Kg("GAME"),d=new Kg("MOVEMENT"),e=new Kg("ABILITY SLOTS"),f=new Kg("ABILITY OVERRIDES"),g=new Kg("RESET");b.addChild(new Sg);new Jg(c,"Reload Weapons",rf.UserSettings,["Input_WeaponReload"],function(){a.update()}),new Jg(c,"Scoreboard",rf.UserSettings,["Input_ToggleScoreBoard"],function(){a.update()}),new Jg(c,"Chat",rf.UserSettings,["Input_Chat"],function(){a.update()}),new Jg(c,"Chat Team",rf.UserSettings,["Input_ChatTeam"],function(){a.update()}),new Jg(c,"Chat Party",rf.UserSettings,["Input_ChatParty"],function(){a.update()}),new Jg(c,"Chat (Quick Toggle)",rf.UserSettings,["Input_ChatQuickView"],function(){a.update()}),new Jg(d,"Drive Up/Forward",rf.UserSettings,["Input_Forward","Input_Forward2"],function(){a.update()}),new Jg(d,"Drive Down/Backwards",rf.UserSettings,["Input_Backward","Input_Backward2"],function(){a.update()}),new Jg(d,"Drive/Rotate Left",rf.UserSettings,["Input_Left","Input_Left2"],function(){a.update()}),new Jg(d,"Drive/Rotate Right",rf.UserSettings,["Input_Right","Input_Right2"],function(){a.update()}),new Jg(e,"Slot 1",rf.UserSettings,["Input_AbilitySlot1"],function(){a.update(),Dd.UI.PowerUpBelt.arrange()}),new Jg(e,"Slot 2",rf.UserSettings,["Input_AbilitySlot2"],function(){a.update(),Dd.UI.PowerUpBelt.arrange()}),new Jg(e,"Slot 3",rf.UserSettings,["Input_AbilitySlot3"],function(){a.update(),Dd.UI.PowerUpBelt.arrange()}),new Jg(e,"Slot 4",rf.UserSettings,["Input_AbilitySlot4"],function(){a.update(),Dd.UI.PowerUpBelt.arrange()}),new Jg(e,"Slot 5",rf.UserSettings,["Input_AbilitySlot5"],function(){a.update(),Dd.UI.PowerUpBelt.arrange()});for(var h in Dd.PowerUps)if(h!=-1){var i=Dd.PowerUps[h],j="Input_Ability_"+i.id,k=Dd.PowerUps[h].name;new Jg(f,k,rf.UserSettings,[j],function(){a.update(),Dd.UI.PowerUpBelt.arrange(),Dd.InputManager.UpdateOverrideKeys()})}new Eg(g,"RESET CONTROLS TO DEFAULT","70%",40,"15%",5,16711680,.7,function(){yc.open("RESET CONTROLS","You are about to reset your controls to default\nAre you sure about that?","RESET","KEEP CURRENT",!1,!0,function(){for(var b in rf.UserSettings)b.indexOf("Input_")!=-1&&(rf.UserSettings[b]=rf.DefaultUserSettings[b]);rf.UserSettings["SimulateCarControls"]=!1,rf.UserSettings["AdvancedControls"]=!1,rf.saveUserSettings(),a.update(),Dd.UI.PowerUpBelt.arrange()},function(){})}),new Dg(g,"* Clicking this button will reset your controls to their default setting!",20,$c);this.addChild(b),this.addChild(c),this.addChild(d),this.addChild(e),this.addChild(f),this.addChild(g)},Sg=function(){var b=this.container=new a.UI.Container;b.height=120,b.width="100%";var c=new a.UI.CheckBox({checked:!rf.UserSettings["AdvancedControls"],checkmark:a.UI.Sprite.fromFrame("UI/Menu/box-white.png"),background:new a.UI.SliceSprite(a.Texture.fromFrame("UI/Menu/box-border.png"),4),checkgroup:"mainmenu_simple_advanced",value:"simple"});c.checkmark.width=c.checkmark.height="100%",c.checkmark.tint=46335,c.checkmark.alpha=c.checked?.49:0,c.background.alpha=c.checked?0:.49,c.width=132,c.height=37,c.top=49,c.left=6,c.text=new a.UI.DynamicText(nf("SIMPLE CONTROLS"),{style:hd}),c.text.verticalAlign="middle",c.text.horizontalAlign="center",c.text.alpha=c.checked?1:.4,c.addChild(c.text);var d=new a.UI.CheckBox({checked:rf.UserSettings["AdvancedControls"],checkmark:a.UI.Sprite.fromFrame("UI/Menu/box-white.png"),background:new a.UI.SliceSprite(a.Texture.fromFrame("UI/Menu/box-border.png"),4),checkgroup:"mainmenu_simple_advanced",value:"advanced"});d.checkmark.width=d.checkmark.height="100%",d.checkmark.tint=46335,d.checkmark.alpha=d.checked?.49:0,d.background.alpha=d.checked?0:.49,d.width=147,d.height=37,d.top=49,d.left=142,d.text=new a.UI.DynamicText(nf("ADVANCED CONTROLS"),{style:hd}),d.text.verticalAlign="middle",d.text.horizontalAlign="center",d.text.alpha=d.checked?1:.4,d.addChild(d.text);var e=a.UI.Sprite.fromFrame("UI/Menu/guide-"+d.selectedValue+".png");e.pivot=.5,e.y=d.checked?45:60,e.left=750;var f=new a.UI.CheckBox({checked:rf.UserSettings["SimulateCarControls"],checkmark:a.UI.Sprite.fromFrame("UI/Menu/box-white.png"),background:new a.UI.SliceSprite(a.Texture.fromFrame("UI/Menu/box-border.png"),4)});f.checkmark.width=f.checkmark.height="100%",f.checkmark.tint=46335,f.checkmark.alpha=f.checked?.49:0,f.background.alpha=f.checked?0:.49,f.width=234,f.height=22,f.top=99,f.x=630,f.text=new a.UI.DynamicText(nf("FLIP CONTROLS IN REVERSE (SIMULATE CAR)"),{style:$c}),f.text.y=5,f.text.horizontalAlign="center",f.text.alpha=f.checked?1:.4,f.alpha=d.checked?1:0,f.interactive=d.checked,f.addChild(f.text),f.change=function(b){rf.UserSettings["SimulateCarControls"]=b,rf.saveUserSettings(),a.UI.Tween.to(this.checkmark,.4,{alpha:b?.49:0},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(this.background,.4,{alpha:b?0:.49},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(this.text,.4,{alpha:b?1:.4},a.UI.Ease.Circ.CircOut)};var g=function(b){a.UI.Tween.to(this.checkmark,.4,{alpha:b?.49:0},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(this.background,.4,{alpha:b?0:.49},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(this.text,.4,{alpha:b?1:.4},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(f,.4,{alpha:"advanced"===this.value?1:0},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(e,.6,{y:"advanced"===this.value?45:60},a.UI.Ease.Circ.CircOut),e.sprite.texture=a.Texture.fromFrame("UI/Menu/guide-"+this.selectedValue+".png"),f.interactive=d.checked,"advanced"===this.value&&(rf.UserSettings["AdvancedControls"]=d.checked,rf.saveUserSettings())};this.update=function(){f.checked=rf.UserSettings["SimulateCarControls"],d.checked=rf.UserSettings["AdvancedControls"],c.checked=!rf.UserSettings["AdvancedControls"]},b.addChild(c,d,e,f),c.change=g,d.change=g};Rg.prototype=Object.create(Ag),Rg.prototype.constructor=Rg;var Tg=function(){Ag.call(this),this.addChild(new Kg("Settings"))};Tg.prototype=Object.create(Ag),Tg.prototype.constructor=Tg;var Ug=function(){Ag.call(this);var a=new Kg("HELPERS"),b=new Kg("TANK MARKER"),c=new Kg("TEXTURE QUALITY"),d=new Kg("FRAMES PER SECOND");new Bg(a,"Spawn Location Effect",rf.UserSettings,"HelperSpawn",function(){}).change=function(a){rf.UserSettings["HelperSpawn"]=a,rf.saveUserSettings()},new Bg(a,"Colorblind Mode",rf.UserSettings,"ColorBlind",function(){}).change=function(a){rf.UserSettings["ColorBlind"]=a,rf.saveUserSettings(),Dd.UpdateColors()};var e=(new Wg(a,"Crosshair Color",rf.UserSettings["ColorCrosshair"],function(a){rf.UserSettings["ColorCrosshair"]=a.replace("0x","#"),rf.saveUserSettings(),Dd.Crosshair.updateColor()}),function(){rf.saveUserSettings(),Dd.UpdatePlayerHelperVisuals(),f.update()}),f=(new Wg(b,"Color",rf.UserSettings["ColorMe"],function(a){rf.UserSettings["ColorMe"]=a.replace("0x","#"),e()}),new Cg(b,350,"Alpha","%",100,rf.UserSettings,"ColorAlphaMe",0,1,2,0,function(){e()}),new Cg(b,350,"Size"," ",100,rf.UserSettings,"HelperScaleMe",0,2.5,2,0,function(){e()}),new Vg(c,function(){yc.open("IMPORTANT","You must reload your browser for this setting to take effect!\n Reload now??","YES","NO",!0,!1,function(){location.reload(!0)})}),new Yg(b));new Bg(d,"Show FPS",rf.UserSettings,"ShowFPS",function(a){}).change=function(a){rf.UserSettings["ShowFPS"]=a,rf.saveUserSettings(),Dd.Gameloop.LoadFPSSettings()};new Cg(d,0,"Limit FPS","FPS",1,rf.UserSettings,"MaxFPS",30,180,0,1,function(){Dd.Gameloop.LoadFPSSettings()});this.addChild(a),this.addChild(b),this.addChild(c),this.addChild(d)},Vg=function(b,c){var d=[["25%",.25],["50%",.5],["100%",1]],e=this.container=new a.UI.Container;e.height=60,e.anchorLeft=e.anchorRight=5,b.addChild(this);for(var f=0;f<d.length;f++)!function(){var b=d[f],g=b[0],h=b[1],i=new a.UI.CheckBox({checked:rf.UserSettings["RenderQuality"]==h,background:a.UI.Sprite.fromFrame("UI/blank.png"),checkgroup:"SETTINGS_QUALITY",value:h});i.background.alpha=i.checked?.49:.15,i.background.tint=i.checked?2540799:16777215,i.text=new a.UI.DynamicText(g,{style:hd}),i.text.verticalAlign="middle",i.text.horizontalAlign="center",i.text.alpha=i.checked?1:.4,i.addChild(i.text),i.width=120,i.height=50,i.anchorLeft=10+125*f,i.anchorBottom=0,i.change=function(b){a.UI.Tween.to(this.background,.4,{alpha:b?.45:.15},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(this.background,.4,{tint:b?"#26c4ff":"#ffffff"},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(this.text,.4,{alpha:b?1:.4},a.UI.Ease.Circ.CircOut),b&&(rf.UserSettings["RenderQuality"]=this.value,rf.saveUserSettings(),c())},e.addChild(i)}();this.update=function(){}},Wg=function(b,c,d,e){var f=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/blank.png"),width:90,height:25});f.background.tint=d.replace("#","0x"),f.anchorLeft=200;var g=["#ff0033","#ff0000","#8b0000","#ff9955","#ffa500","#ff8c00","#ffff75","#ffff00","#ffd700","#11ff00","#008000","#2f4f2f","#add8e6","#0000ff","#000080","#7cfff1","#00ffe4","#00a392","#cc99cc","#800080","#4b0082","#ee82ee","#da70d6","#ff00ff","#ffc0cb","#ff69b4","#ff1493","#d2b48c","#a52a2a","#5c4033"],h={},i=this.container=new a.UI.Container;i.height=30,i.anchorLeft=5,i.addChild(f),b.addChild(this);var j=new a.UI.DynamicText(c,{style:id});i.addChild(j),j.y=3,j.x=10;var k=1,l=0,m=new a.UI.Container(255,80);m.parentLayer=Dd.Scene.layerUITop,m.anchorLeft=290,m.anchorTop=-25,m.visible=m.interactiveChildren=!1;var n=function(){m.visible=m.interactiveChildren=!m.visible};f.on("click",n);var o=a.UI.Sprite.fromFrame("UI/blank.png");o.width=o.height="100%",o.tint=0,o.alpha=.8,m.addChild(o),i.addChild(m);for(var p=0;p<g.length;p++)h[g[p]]=new Xg(g[p],25*l+5,-20+25*k,function(a){f.background.tint=a.color.replace("#","0x"),n(),e(a.color)}),m.addChild(h[g[p]].container),l++,l>2&&(l=0,k++);this.update=function(){}},Xg=function(b,c,d,e){var f=this,g=this.container=new a.UI.Container("20%",120);this.color=b;var h=this.button=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/blank.png"),width:20,height:20});h.background.tint=this.color.replace("#","0x"),h.y=c,h.anchorLeft=d,g.addChild(h),h.on("click",function(a){"function"==typeof e&&e(f)})},Yg=function(b){var c=this.container=new a.UI.ScrollingContainer((!1),(!1));c.anchorLeft="60%",c.anchorRight=0,c.height="100%",c.interactive=!1,b.addChild(this,!0);var d=new a.UI.Container;d.verticalAlign="middle",d.horizontalAlign="center",c.addChild(d);var e=a.Sprite.fromFrame("Helpers/ring_transparent.png");e.anchor.set(.5),e.blendMode=a.BLEND_MODES.ADD,d.container.addChild(e);var f=new S;d.container.addChild(f.container),this.update=function(){var a=pf.crews.getCrew(0),b=tankClass[a.classId];f.loadClass(b.ID,b.SkinCannon?b.SkinCannon:b.DefaultSkinCannon,b.SkinBody?b.SkinBody:b.DefaultSkinBody),e.tint=rf.UserSettings["ColorMe"].replace("#","0x"),e.alpha=rf.UserSettings["ColorAlphaMe"],e.scale.set(rf.UserSettings["HelperScaleMe"])}};Ug.prototype=Object.create(Ag),Ug.prototype.constructor=Ug;var Zg=void 0,$g=function(b,c,d,e,f){this.active=!1;var g=this,h=a.UI.Sprite.fromFrame("UI/blank.png");h.width=h.height="100%",h.tint=f?7770392:0,h.alpha=.15;var i=new a.UI.DynamicText("       "+nf(b),{style:kd});i.horizontalAlign="center",i.y=36,i.pivot=.5;var j=a.UI.Sprite.fromFrame("UI/Menu/Shop/Icons/"+d);j.x=e.x,j.y=e.y,i.addChild(j),this.container=new a.UI.Button({background:h}),this.container.width=f?240:190,this.container.height="100%",this.container.on("hover",function(b){a.UI.Tween.to(i,.5,{scale:b?1.1:1},a.UI.Ease.Circ.CircOut),g.active||a.UI.Tween.to(h,.5,{alpha:b?.08:.15},a.UI.Ease.Circ.CircOut)}),this.setActive=function(b){if(b){if(Zg){if(Zg==this)return;Zg.setActive(!1)}Zg=this}a.UI.Tween.to(h,.5,{alpha:b?.3:.15},a.UI.Ease.Circ.CircOut),this.active=b},this.click=function(){this.container.click()},this.container.on("click",function(){g.setActive(!0),c.open(),googa("send","event","ShopMenu",b+" Clicked")}),this.container.addChild(h,i)},_g=function(){this.cratesPage=new hc,this.gemsPage=new ic,this.goldPage=new jc,this.premiumPage=new kc,this.talentPage=new lc,this.offerPage=new dc,this.menuPages=[["CRATES",this.cratesPage,"crate.png",{x:-21,y:-8}],["GEMS",this.gemsPage,"gem.png",{x:-8,y:-10}],["GOLD",this.goldPage,"gold.png",{x:-6,y:-2}],["TALENT",this.talentPage,"talent.png",{x:-8,y:-2}],["PREMIUM",this.premiumPage,"premium.png",{x:-8,y:-8}],["FREE OFFERS",this.offerPage,"offers.png",{x:-13,y:-9}]],this.menuButtons={};var b=!1;this.init=function(){b=!0;var c=this.container=new a.UI.Container("100%","100%");c.verticalAlign="middle",c.horizontalAlign="center",c.pivot=.5,pf.container.addChild(c),this.initShopContainer(),this.initMenu()},this.initMenu=function(){var b=this.previewContainer=new a.UI.Container("100%",69);this.container.addChild(b);var c=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));c.tint=14606046,c.width="100%",c.height="100%",c.alpha=.4,b.addChild(c);for(var d=0;d<this.menuPages.length;d++){var e=d==this.menuPages.length-1,f=new $g(this.menuPages[d][0],this.menuPages[d][1],this.menuPages[d][2],this.menuPages[d][3],e);e?f.container.anchorRight=5:f.container.x=5+194*d,this.menuButtons[this.menuPages[d][0]]=f,b.addChild(f.container),ch||f.container.click()}},this.initShopContainer=function(){var b=this.shopContainer=new a.UI.Container("100%","100%");b.anchorTop=79,b.anchorBottom=0,b.anchorRight=0,b.anchorLeft=0,this.container.addChild(b)},this.open=function(a){b||this.init(),Zg&&Zg.click()},this.close=function(a){}},ah={Gold:0,Gems:1,Talent:2,PremiumDays:3,Money:9},bh={0:"Gold",1:"Gems",2:"Talent",3:"PremiumDays",9:"Money"},ch=void 0;ac.prototype.init=function(){var b=this.container=new a.UI.Container("100%","100%");b.pivot=.5,b.anchorLeft=0,b.anchorTop=0,b.interactiveChildren=!1;var c=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));c.tint=14606046,c.width="100%",c.height="100%",c.alpha=.5,b.addChild(c);var d=a.UI.Sprite.fromFrame("UI/grad-horizontal.png");d.tint=0,d.anchorLeft=0,d.anchorTop=0,d.pivot=.5,d.scaleX=-1,d.height=127,d.width=870,d.alpha=.5;var e=this.headlineText=new a.UI.DynamicText(this.headline,{style:zd,allowTags:!0});e.x=68,e.y=-5,b.addChild(d,e),this.initialized=!0,pf.shopPage.shopContainer.addChild(b)},ac.prototype.open=function(){this.initialized||this.init(),ch&&ch==this||this.isOpen||(ch&&ch.close(),ch=this,this.isOpen=!0,a.UI.Tween.fromTo(this.headlineText,.5,{alpha:0,scale:.9},{alpha:1,scale:1},a.UI.Ease.Cubic.easeOut),a.UI.Tween.fromTo(this.container,.5,{alpha:0,scale:.9},{alpha:1,scale:1},a.UI.Ease.Cubic.easeOut),this.container.interactiveChildren=!0)},ac.prototype.close=function(){this.isOpen&&(this.container.interactiveChildren=!1,a.UI.Tween.to(this.container,.2,{alpha:0},a.UI.Ease.Cubic.easeOut),this.isOpen=!1)},ac.prototype.constructor=ac,dc.prototype=Object.create(ac.prototype),dc.prototype.constructor=dc,gc.prototype=Object.create(ac.prototype),gc.prototype.constructor=gc,gc.prototype.init=function(){ac.prototype.init.call(this);var b="";this.bulletHeadline.length&&(b+="<font color='"+this.bulletColor+"'>"+this.bulletHeadline+"</font>\n");for(var c=0;c<this.bulletTexts.length;c++)b+="<font color='"+this.bulletColor+"'>•</font> "+this.bulletTexts[c]+"\n";var d=this.bulletText=new a.UI.DynamicText(b,{style:id,allowTags:!0});this.container.addChild(d),d.x=this.bulletX,d.y=this.bulletY;for(var c=0;c<this.productData.length;c++){var e=new fc(this.productData[c]);e.container.x=200+277*c,e.container.anchorBottom=51,this.products.push(e),this.container.addChild(e.container)}},gc.prototype.open=function(){if(!this.isOpen){ac.prototype.open.call(this),a.UI.Tween.fromTo(this.bulletText,.8,{alpha:0,scale:.9},{alpha:1,scale:1},a.UI.Ease.Cubic.easeOut);for(var b=0;b<this.products.length;b++){this.products[b].show(50+100*b)}}},gc.prototype.close=function(){this.isOpen&&ac.prototype.close.call(this)},hc.prototype=Object.create(gc.prototype),hc.prototype.constructor=hc,ic.prototype=Object.create(gc.prototype),ic.prototype.constructor=ic,jc.prototype=Object.create(gc.prototype),jc.prototype.constructor=jc,kc.prototype=Object.create(gc.prototype),kc.prototype.constructor=kc,lc.prototype=Object.create(gc.prototype),lc.prototype.constructor=lc;var dh=function(){this.currentCrew=void 0;var b=!1;this.StatSection=void 0,this.TankSection=void 0,this.CommanaderSection=void 0,this.init=function(){b=!0;var c=this.container=new a.UI.Container("100%","100%");c.verticalAlign="middle",c.horizontalAlign="center",c.pivot=.5,pf.container.addChild(c),this.StatSection=new th(c),this.TankSection=new yh(c),this.CommanaderSection=new kh(c)},this.load=function(a,b){this.StatSection.load(a),this.TankSection.load(a),this.CommanaderSection.load(a),this.currentCrew=a},this.refresh=function(){this.load(this.currentCrew,!0)},this.open=function(a){b||this.init()},this.close=function(a){}},eh=function(b,c,d,e){
if(this.container=new a.UI.Container(d,e),b.addChild(this.container),this.bg=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0)),this.bg.tint=10461087,this.bg.width="100%",this.bg.height="100%",this.bg.alpha=.45,this.container.addChild(this.bg),c){var f=new a.UI.SliceSprite(ef,3);f.tint=0,f.width="100%",f.height=37,f.alpha=.6;var g=new a.UI.DynamicText(nf(c),{style:id});g.left=12,g.top=10,this.container.addChild(f,g)}};eh.prototype=eh,eh.prototype.constructor=eh,eh.prototype.load=function(a){};var fh=function(b,c,d,e,f,g,h,i){var j,k,l=this.container=new a.UI.Container("100%",15),m=a.UI.Sprite.fromFrame("UI/blank.png");m.height="100%",m.width="100%",m.alpha=h,m.tint=g,l.addChild(m);var n=new a.UI.DynamicText(b,{style:$c});if(n.y=1,n.x=6,l.addChild(n),e){var o=new a.UI.Container;o.anchorTop=o.anchorBottom=o.anchorRight=5,o.anchorLeft=i,l.addChild(o),j=a.UI.Sprite.fromFrame("UI/blank.png"),j.height="100%",j.width="50%",j.tint=8899383,l.addChild(j),o.addChild(j)}else k=new a.UI.DynamicText(" ",{style:$c}),k.y=2,i?k.anchorLeft=i:k.anchorRight=6,l.addChild(k);this.update=function(b){if(void 0!==b[c]){var g=b[c]*d;e?a.UI.Tween.to(j,.4,{width:g+f},a.UI.Ease.Circ.CircOut):(a.UI.Tween.to(k.style,.4,{tint:g>0?"#a4ff53":0==g?"#ffffff":"#e66565"},a.UI.Ease.Circ.CircOut),k.value=p(g.toFixed(2))+f)}},this.updateData=function(a,d,e,f){b=a,c=d,n.value=b,m.alpha=f,m.tint=e,l.visible=!0},this.hide=function(){l.visible=!1}},gh=function(b,c,d,e,f,g,h){var i=this.container=new a.UI.Container(c),j=[];this.update=function(a){for(var b=0;b<j.length;b++)j[b].update(a)},this.init=function(a){this.clear();for(var b=!0,c=0;c<a.length;c++){b=!b;var k=b?g:e,l=b?f:d,m=j[c];m?m.updateData(a[c][0],a[c][1],l,k):(m=new fh(a[c][0],a[c][1],a[c][2],a[c][3],a[c][4],l,k,h),m.container.y=15*c,i.addChild(m.container),j.push(m))}},this.clear=function(){for(var a=0;a<j.length;a++)j[a].hide()},this.init(b)},hh=function(b){var c=this.container=new a.UI.Container(b),d=new gh({},"100%",16777215,.1,16777215,.02);c.addChild(d.container);var e={0:["Experience","0",1,!1,"%"],1:["Damage","1",1,!1,"%"],2:["Health","2",1,!1,"%"],3:["Speed","3",1,!1,"%"],4:["Aim Speed","4",1,!1,"%"],5:["Turn Speed","5",1,!1,"%"],6:["Acceleration","6",1,!1,"%"],10:["Explosive Resist.","10",1,!1,"%"],11:["Fire Resist.","11",1,!1,"%"],12:["Piercing Resist.","12",1,!1,"%"],13:["Electric Resist.","13",1,!1,"%"],14:["Chemical Resist.","14",1,!1,"%"]};this.update=function(a){var b=[];for(var c in a)e[c]&&b.push(e[c]);d.init(b),d.update(a)}},ih=function(){var b=this.container=new a.UI.Container(240,111),c=a.UI.Sprite.fromFrame("UI/blank.png");c.height="100%",c.width="100%",c.alpha=.1,c.tint=0,b.addChild(c);var d=new a.UI.DynamicText("Modifiers",{style:jd});d.anchorTop=5,d.anchorLeft=10,this.container.addChild(d);var e=new a.UI.DynamicText("none",{style:gd,width:"100%"});e.alpha=.5,e.style.align="center",e.verticalAlign="middle",this.container.addChild(e),this.update=function(a){}},jh=function(){var b=this.container=new a.UI.Container;b.anchorTop=49,b.anchorLeft=b.anchorBottom=10,b.width=154;var c=a.UI.Sprite.fromFrame("UI/blank.png");c.height="100%",c.width="100%",c.alpha=.2,c.tint=0,b.addChild(c);var d=a.UI.Sprite.fromFrame("UI/blank.png");d.anchorLeft=d.anchorRight=d.anchorTop=8,d.height=134,d.alpha=.4,d.tint=0,b.addChild(d);var e=a.Sprite.fromFrame("UI/blank.png");e.y=142,e.anchor.y=1,e.x=8,b.container.addChild(e);var f=new hh(138);f.container.anchorRight=8,f.container.y=184,b.addChild(f.container);var g=new a.UI.DynamicText("<font><b>Name</b>\n \n<font size='12' tint='#c2c2c2'>Title",{style:cd,width:"100%",allowTags:!0});g.style.align="center",g.style.lineHeight=16,g.y=140,b.addChild(g),this.update=function(a,b){g.value="<b>"+a.name+"</b>\n<font size='12' tint='#c2c2c2'>"+a.title;var c=a.getTexture();e.texture=c,e.alpha=1,e.scale.set(c.width/138),f.update(b)}},kh=function(b){eh.call(this,b,"COMMANDER",423,327),this.container.anchorBottom=0,this.container.anchorLeft=0,this.bg.tint=9679502;var c=new jh;this.container.addChild(c.container);var d=new ih;d.container.anchorBottom=59,d.container.anchorRight=10,this.container.addChild(d.container);var e=lh(240,41,function(){return Zh.authenticated?(pf.buttons["Inventory"].button.click(),void pf.inventoryPage.loadCommanders()):void xc.open("You must sign-in to change commander")},new a.UI.DynamicText("CHANGE COMMANDER",{style:jd}));e.anchorBottom=10,e.anchorRight=10,this.container.addChild(e);var f=new a.UI.DynamicText(" ",{style:bd,width:215,height:100});f.anchorTop=49,f.anchorRight=30,this.container.addChild(f);var g=new a.UI.DynamicText("NO COMMANDER EQUIPPED",{style:jd,width:"100%"});g.alpha=0,g.style.align="center",g.verticalAlign="middle",this.container.addChild(g);var h=function(b){a.UI.Tween.to(c.container,.3,{alpha:b?1:0},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(d.container,.3,{alpha:b?1:0},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(f,.3,{alpha:b?1:0},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(g,.3,{alpha:b?0:.5},a.UI.Ease.Circ.CircOut)};this.load=function(a){eh.prototype.load.call(this,a),a.commanderId>0?eg.loadItemInfo([a.commanderId],function(){var b=eg.items[a.commanderId];c.update(b,a.commanderData),f.value=b.description,h(!0)}):h(!1)}};kh.prototype=Object.create(eh),kh.prototype.constructor=kh;var lh=function(b,c,d,e,f){var g;return g=new a.UI.Button(e?{background:new a.UI.SliceSprite(a.Texture.fromFrame("UI/Menu/box-border.png"),4),text:e}:{background:new a.UI.SliceSprite(a.Texture.fromFrame("UI/Menu/box-border.png"),4)}),g.height=c,g.width=b,g.background.alpha=f?1:.49,g.on("hover",function(b){a.UI.Tween.to(this.background,.4,{alpha:b?f?.8:.7:f?1:.49},a.UI.Ease.Circ.CircOut)}),g.on("click",function(a){d()}),g},mh=function(b){var c=this.container=new a.UI.Container;c.width=b,c.height=26,c.horizontalAlign="center";var d=600,e=1e3,f=a.UI.Sprite.fromFrame("UI/blank.png");f.height="100%",f.width="100%",f.alpha=.5,f.tint=0,c.addChild(f);var g=a.UI.Sprite.fromFrame("UI/blank.png");g.height="100%",g.alpha=.7,g.tint=15662902,g.width=(d/e*100).toFixed(1)+"%",c.addChild(g);var h=new a.UI.DynamicText(d+" / "+e,{style:vd,width:"100%"});h.anchorTop=3,h.style.align="center",c.addChild(h);var i=new a.UI.DynamicText("LEVEL 1",{style:jd});i.y=26,c.addChild(i);var j=new a.UI.DynamicText("LEVEL 2",{style:jd,width:100});j.y=26,j.anchorRight=0,j.style.align="right",c.addChild(j),this.set=function(a,b,c){d=a,e=b,g.width=(d/e*100).toFixed(1)+"%",h.value=d+" / "+e,i.value="LEVEL "+c,j.value="LEVEL "+(c+1)},this.setMax=function(a){g.width="100%",h.value="MAX",i.value="LEVEL "+(a-1),j.value="LEVEL "+a}},nh=function(){var b=void 0,c=this.container=new a.UI.Container;c.anchorBottom=c.anchorLeft=c.anchorTop=10,c.width=413;var d=a.UI.Sprite.fromFrame("UI/blank.png");d.height="100%",d.width="100%",d.alpha=.3,d.tint=0,c.addChild(d);var e=a.UI.Sprite.fromFrame("UI/blank.png");e.height=124,e.width="100%",e.alpha=.15,e.tint=0,e.anchorTop=50,c.addChild(e);var g=new a.UI.DynamicText("ALPHA CREW",{style:md});g.anchorLeft=14,g.anchorTop=7,c.addChild(g);var h=new a.UI.DynamicText("CREW LEVEL<font size='30' valign='1'> 1</font>",{style:jd,allowTags:!0});h.anchorRight=12,h.anchorBottom=3,c.addChild(h);var i=new mh(388);i.container.anchorTop=57,c.addChild(i.container);var j=lh(244,41,function(){return Zh.authenticated?void f.post("/Crew/StartBuyXP",{crewIndex:b.index}).done(function(a){if(a.success){var c=a.price;vc.open(c,2,c+" CREW XP",-1,function(){googa("send","event","CrewPage","Purchase Init - BuyXP lvl->"+b.getLevel()+1),f.post("/Crew/BuyXP",{crewIndex:b.index}).done(function(a){a.success?(pf.crews.AddCrew(a.data,!0),pf.wallet.UpdateBalance(2,a.talent),nc.open("PURCHASE COMPLETE",c+" CREW XP","OK"),googa("send","event","CrewPage","Purchase Success - BuyXP lvl->"+b.getLevel()+1)):(nc.open("PURCHASE ERROR","","OK"),googa("send","event","CrewPage","Purchase Error - BuyXP lvl->"+b.getLevel()+1))})})}else{sc.open(a.missing),googa("send","event","Crew Purchase Missing","Purchase Missing - BuyXP lvl ->"+b.getLevel()+1)}}):void xc.open("You must sign-in to instant upgrade")});j.anchorTop=112,j.horizontalAlign="center",c.addChild(j);var k=new a.UI.DynamicText("INSTANT LEVEL UP\n<font size='18' weight='bold><b>LEVEL 1</b></font>",{style:$c,allowTags:!0});k.anchorLeft=10,k.anchorTop=6,k.style.lineHeight=10,j.addChild(k);var l=new ec(0,ah.Talent,1);l.container.anchorRight=15,l.container.y=31,j.addChild(l.container),this.load=function(a){b=a;var c=b.getLevel();8==c?i.setMax(c):i.set(b.getLevelXPCurrent(),b.getLevelXPMax(),b.getLevel()),g.value=vf[b.index]+" CREW",h.value="CREW LEVEL<font size='30' valign='1'> "+c+"</font>",k.value="INSTANT LEVEL UP\n<font size='18'><b>LEVEL "+(c+1)+"</b></font>",j.visible=j.interactive=c<8,l.updateAmount(b.getLevelXPMissing())}},oh=function(b){var c,d=this.container=new a.UI.Container(360,25);d.anchorBottom=-17,d.horizontalAlign="center";var e=new a.UI.SliceSprite(cf,3,(!0),(!0));e.tint=0,e.width=e.height="100%",e.alpha=.8,d.addChild(e);var g=new a.UI.DynamicText("<font size='15' tint='#ffde00' valign='-1' shadow='#ffde00 1 0 0 10'><b>LEVEL UP  </b></font>SKILL POINTS:<font size='12'><b> 5</b></font>",{style:Zc,allowTags:!0});g.anchorLeft=12,g.anchorTop=4,d.addChild(g);var h=lh(44,15,function(){c.resetLevelupStats(),b.updateStats()},new a.UI.DynamicText("<font valign='1'>CLEAR",{style:Zc,allowTags:!0}));h.anchorRight=70,h.anchorTop=5;var i=lh(60,15,function(){if(c.getUsedStatPointCount()>0){f.post("/Crew/LevelUp",{crewIndex:c.index,statPoints:[c.levelupStat.experience,c.levelupStat.damage,c.levelupStat.health,c.levelupStat.speed,c.levelupStat.aimSpeed,c.levelupStat.explosiveResistance,c.levelupStat.fireResistance,c.levelupStat.piercingResistance,c.levelupStat.electricResistance,c.levelupStat.chemicalResistance]}).done(function(a){a&&pf.crews.AddCrew(a,!0)})}},new a.UI.DynamicText("<font valign='1'>CONFIRM",{style:Zc,allowTags:!0}),!0);i.background.tint=13238154,i.anchorRight=7,i.anchorTop=5,d.addChild(h,i),this.update=function(a){c=a,d.visible=d.interactive=c.levelUp(),g.value="<font size='15' tint='#ffde00' valign='-1' shadow='#ffde00 1 0 0 10'><b>LEVEL UP  </b></font>SKILL POINTS:<font size='12'><b> "+c.getRemainingStatPoints()+"</b></font>"}},ph=function(b,c,d,e){var f=void 0,g=this.container=new a.UI.Container(178,30),h=a.UI.Sprite.fromFrame("UI/grad-vertical.png");h.height="100%",h.width="100%",h.alpha=.1,g.addChild(h);var i=new a.UI.DynamicText(b,{style:_c});i.anchorLeft=8,i.anchorTop=1,g.addChild(i);var j=new a.UI.DynamicText("+1%",{style:hd});if(j.anchorRight=7,j.anchorTop=1,g.addChild(j),e){var k=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/crew/levelbutton.png")});k.anchorLeft=96,k.anchorBottom=2,g.addChild(k),k.on("click",function(){o()<5&&f.getRemainingStatPoints()>0&&(f.levelupStat[c]+=1,e.updateStats())})}for(var l=[],m=0;m<5;m++){var n=a.UI.Sprite.fromFrame("UI/crew/leveldot.png");n.x=17*m+8,n.anchorBottom=4,n.alpha=62,l.push(n),g.addChild(n)}var o=function(){return f.levelupStat?f.stat[c]+f.levelupStat[c]:f.stat[c]},p=function(){for(var b=o(),g=0;g<l.length;g++){var h=l[g];f.stat[c]>=g+1?a.UI.Tween.to(h,.3,{alpha:.62,tint:"#a4ff53"},a.UI.Ease.Circ.CircOut):b>=g+1?a.UI.Tween.to(h,.3,{alpha:.62,tint:"#f8fb0e"},a.UI.Ease.Circ.CircOut):a.UI.Tween.to(h,.3,{alpha:.2,tint:"#000000"},a.UI.Ease.Circ.CircOut)}e&&(k.visible=k.interactive=f.getRemainingStatPoints()>0),j.value="+"+d*b+"%",a.UI.Tween.to(j.style,.3,{tint:b>0?"#a4ff53":0==b?"#ffffff":"#e66565"},a.UI.Ease.Circ.CircOut)};this.update=function(a){f=a,p()}},qh=function(){var b=this,c=void 0,d=this.container=new a.UI.Container;d.anchorBottom=d.anchorTop=10,d.anchorLeft=435,d.anchorRight=394;var e=a.UI.Sprite.fromFrame("UI/blank.png");e.height="100%",e.width="100%",e.alpha=.12,e.tint=0,d.addChild(e);var g=new a.UI.DynamicText("STAT POINTS",{style:md});g.anchorLeft=14,g.anchorTop=7,d.addChild(g);var h=lh(101,21,function(){f.post("/Crew/StartBuyReset",{crewIndex:c.index}).done(function(a){if(a.success){vc.open(a.price,2,"CREW STATPOINT RESET",-1,function(){googa("send","event","CrewPage","Purchase Init - StatReset lvl "+c.getLevel()),f.post("/Crew/BuyReset",{crewIndex:c.index}).done(function(a){a.success?(pf.crews.AddCrew(a.data,!0),pf.wallet.UpdateBalance(2,a.talent),nc.open("PURCHASE COMPLETE","CREW STATPOINT RESET","OK"),googa("send","event","CrewPage","Purchase Success - StatReset")):(nc.open("PURCHASE ERROR","","OK"),googa("send","event","CrewPage","Purchase Error - StatReset"))})})}else{sc.open(a.missing),googa("send","event","Crew Purchase Missing","StatReset")}})});h.anchorTop=13,h.anchorRight=14,d.addChild(h);var i=new a.UI.DynamicText("RESET",{style:gd});i.anchorLeft=11,i.anchorTop=5,h.addChild(i);var j=new ec(0,ah.Talent,1);j.container.anchorRight=5,j.container.y=20,h.addChild(j.container),j.updateAmount(500);for(var k=[],l=[["Experience","experience",SETTINGS["StatMult_Crew_Experience"]],["Damage/DPS","damage",SETTINGS["StatMult_Crew_Damage"]],["Health","health",SETTINGS["StatMult_Crew_Health"]],["Speed","speed",SETTINGS["StatMult_Crew_Speed"]],["Aim Speed","aimSpeed",SETTINGS["StatMult_Crew_AimSpeed"]],["Explosive Resistance","explosiveResistance",SETTINGS["StatMult_Crew_Resist_Explosive"]],["Fire Resistance","fireResistance",SETTINGS["StatMult_Crew_Resist_Fire"]],["Piercing Resistance","piercingResistance",SETTINGS["StatMult_Crew_Resist_Piercing"]],["Electric Resistance","electricResistance",SETTINGS["StatMult_Crew_Resist_Electric"]]],m=0;m<l.length;m++){var n=new ph(l[m][0],l[m][1],l[m][2],b);n.container.y=49+30*m,n.container.x=13,m>=5&&(n.container.y-=150,n.container.x=199),k.push(n),d.addChild(n.container)}var o=new oh(b);d.addChild(o.container),this.load=function(a){c=a,h.visible=c.getStatPointCount()>0,this.updateStats()},this.updateStats=function(){for(var a=0;a<k.length;a++)k[a].update(c);o.update(c)}},rh=function(b,c,d){var e=88*c,f=100*c,g=this.container=new a.UI.Container(88*c,100*c),h=a.UI.Sprite.fromFrame(b?"UI/PowerUp/frame_gold.png":"UI/PowerUp/frame_silver.png");h.width=e,h.height=f;var i=a.UI.Sprite.fromFrame("UI/PowerUp/empty.png");i.pivot=.5,i.x=.5*e,i.y=.5*f,i.scale=c,g.addChild(i,h);var j=-1;d&&(d.anchorBottom=d.anchorRight=5,g.addChild(d)),this.update=function(b,c){var e=b;e!=j&&(j=e,i.sprite.texture=a.Texture.fromFrame(j!=-1?"UI/PowerUp/"+j+".png":"UI/PowerUp/empty.png")),d&&(d.value=c?"x"+c:"")}},sh=function(){var b=void 0,c=this.container=new a.UI.Container;c.anchorBottom=c.anchorRight=c.anchorTop=10,c.width=371;var d=a.UI.Sprite.fromFrame("UI/blank.png");d.height="100%",d.width="100%",d.alpha=.12,d.tint=0,c.addChild(d);var e=new a.UI.DynamicText("CREW ABILITIES",{style:md,width:"100%"});e.anchorTop=7,e.style.align="center",c.addChild(e);var f=new rh((!0),1),g=new rh((!0),1);f.container.y=g.container.y=62,f.container.anchorLeft=g.container.anchorRight=92,f.container.alpha=g.container.alpha=.1,this.load=function(a){b=a,f.update(b.firstAbilityId),g.update(b.secondAbilityId)},c.addChild(f.container,g.container);var h=new a.UI.DynamicText("COMING SOON",{style:cd,width:"100%"});h.anchorTop=100,h.style.align="center",c.addChild(h)},th=function(a){eh.call(this,a,void 0,1220,233),this.levelArea=new nh,this.container.addChild(this.levelArea.container),this.statArea=new qh,this.container.addChild(this.statArea.container),this.abilityArea=new sh,this.container.addChild(this.abilityArea.container),this.load=function(a){eh.prototype.load.call(this,a),this.levelArea.load(a),this.statArea.load(a),this.abilityArea.load(a)}};th.prototype=Object.create(eh),th.prototype.constructor=th;var uh={"-1":" ",0:"Pure",1:"Explosive",2:"Fire",3:"Piercing",4:"Electric",5:"Chemical",6:"Healing"},vh=function(){var b={},c={},d=void 0,e=this.container=new a.UI.Container(179),f=new a.UI.Container("100%","100%");e.addChild(f);var g=new a.UI.Container("100%","100%");e.addChild(g);var h=a.UI.Sprite.fromFrame("UI/blank.png");h.height=133,h.width="100%",h.alpha=.07,h.tint=0,g.addChild(h);var i=a.UI.Sprite.fromFrame("UI/blank.png");i.height=28,i.width="100%",i.alpha=.5,i.tint=0,f.addChild(i);var j=new a.UI.DynamicText(" ",{style:id});j.x=7,f.addChild(j);var k=new a.UI.DynamicText("test",{style:Zc});k.x=7,k.anchorTop=15,f.addChild(k);var l=new a.UI.DynamicText("PIERCING",{style:Zc});l.style.tint="#c2c2c2",l.anchorRight=3,l.anchorTop=15,f.addChild(l),b["default"]=[["Damage/DPS","Stat_Damage",10,!0,"%"],["Fire Rate","Stat_FireRate",10,!0,"%"],["Projectile Speed","Stat_ProjectileSpeed",10,!0,"%"],["Range","Stat_Range",10,!0,"%"],["Reload Speed","Stat_ReloadSpeed",10,!0,"%"],["Impact Force","Stat_ImpactForce",10,!0,"%"],["Ammo","Start_Ammo",1,!1,""]],b[204]=[["Damage/DPS","Stat_Damage",10,!0,"%"],["Fire Rate","Stat_FireRate",10,!0,"%"],["Projectile Speed","Stat_ProjectileSpeed",10,!0,"%"],["Range","Stat_Range",10,!0,"%"],["Reload Speed","Stat_ReloadSpeed",10,!0,"%"],["Impact Force","Stat_ImpactForce",10,!0,"%"],["Ammo","Start_Ammo",50,!1,""]],b[203]=[["Damage/DPS","Stat_Damage",10,!0,"%"],["Fire Rate","Stat_FireRate",10,!0,"%"],["Projectile Speed","Stat_ProjectileSpeed",10,!0,"%"],["Range","Stat_Range",10,!0,"%"],["Reload Speed","Stat_ReloadSpeed",10,!0,"%"],["Impact Force","Stat_ImpactForce",10,!0,"%"],["Fuel/Duration","Start_Ammo",1,!1," sec"]],b[208]=[["Pulse Heal/PS","Stat_Damage",10,!0,"%"],["Pulse Rate","Stat_FireRate",10,!0,"%"],["Pulse Range","Stat_Range",10,!0,"%"],["Reload Speed","Stat_ReloadSpeed",10,!0,"%"],["Pulses/Ammo","Start_Ammo",1,!1,""]],b[209]=[["Heal/PS","Stat_Damage",10,!0,"%"],["Healing Rate","Stat_FireRate",10,!0,"%"],["Max Range","Stat_Range",10,!0,"%"],["Max Duration","Start_Ammo",1,!1," sec"]],b[213]=[["Max Duration","Start_Ammo",1,!1," sec"]],this.update=function(a,e){if(f.alpha=a>0?1:0,g.alpha=a>0?0:1,!(a<=0)){var h=a,i=b[h];if(!i){var h="default";i=b[h]}var m=c[h];m||(m=c[h]=new gh(i,"100%",0,.09,0,.2,91),m.container.y=28),d!=m&&(d&&f.removeChild(d.container),f.addChild(m.container),d=m);var n=weapon[a],o=n["Stats"][e];j.value=n["Name"].toUpperCase(),k.value=o["Name"],l.value=uh[n.DamageType].toUpperCase(),d.update(o)}}},wh=function(b,c,d){var e=this.container=new a.UI.Container(b?b:250,c?c:111),f=new a.UI.Container("100%",80);f.y=35,f.x=7;var g=a.UI.Sprite.fromFrame("UI/blank.png");g.height="100%",g.width="100%",g.alpha=.2,g.tint=0,e.addChild(g);var h=new a.UI.DynamicText("START ABILITIES",{style:jd});h.x=11,h.y=6,e.addChild(h,f),d&&(h.align=f.align="center");for(var i={},j=0;j<4;j++){var k=i[j]=new rh((!1),.66,new a.UI.DynamicText(" ",{style:vd}));f.addChild(k.container),k.container.x=59*j}this.update=function(a){for(var b=0,c=0;c<4;c++){var d=i[c],e=a.StartAbilities[c];e?(d.container.alpha=1,d.update(e[0],e[1]),b++):d.container.alpha=0}f.width=59*b}},xh=function(){var b=this.container=new a.UI.Container;b.anchorTop=49,b.anchorLeft=10,b.width=319,b.height=268;var c=a.UI.Sprite.fromFrame("UI/blank.png");c.height="100%",c.width="100%",c.alpha=.2,c.tint=0,b.addChild(c);var d=new S,e=new a.UI.Container;e.horizontalAlign="center",e.y=60,e.container.addChild(d.container),b.addChild(e);var f=new a.UI.DynamicText(" ",{style:kd,width:"100%"});f.style.align="center",f.y=120,b.addChild(f);var g=new a.UI.DynamicText(" ",{style:$c,width:"100%"});g.style.align="center",g.style.tint="#c2c2c2",g.y=138,b.addChild(g);var h=[["Health","Stat_Health",10,!0,"%"],["Speed","Stat_Speed",10,!0,"%"],["Acceleration","Stat_Acceleration",10,!0,"%"],["Aim Speed","Stat_AimSpeed",10,!0,"%"],["Turn Speed","Stat_TurnSpeed",10,!0,"%"]],i=[["Explosive","Resist_Explosive",100,!1,"%"],["Fire","Resist_Fire",100,!1,"%"],["Piercing","Resist_Piercing",100,!1,"%"],["Electric","Resist_Electric",100,!1,"%"],["Chemical","Resist_Chemical",100,!1,"%"]],j=new gh(h,160,16777215,.1,16777215,.02,75),k=new gh(i,137,16777215,.1,16777215,.02);j.container.anchorLeft=k.container.anchorRight=7,j.container.y=k.container.y=184,b.addChild(j.container,k.container);var l=new a.UI.DynamicText("BASE STATS",{style:gd});l.anchorBottom=81,l.anchorLeft=13,b.addChild(l);var m=new a.UI.DynamicText("RESISTANCE",{style:gd});m.anchorBottom=81,m.anchorLeft=181,b.addChild(m),this.update=function(a,b,c){f.value=a.Name,g.value=1==a.WeightClass?"Light Tank":2==a.WeightClass?"Medium Tank":"Heavy Tank";var e=c?c:a.SkinCannon,h=b?b:a.SkinBody;d.loadClass(a.ID,e?e:a.DefaultSkinCannon,h?h:a.DefaultSkinBody),j.update(a),k.update(a)}},yh=function(b){eh.call(this,b,"TANK",788,327),this.container.anchorBottom=0,this.container.anchorRight=0,this.bg.tint=12369874;var c=new a.UI.Container("100%","100%");this.container.addChild(c);var d=new a.UI.DynamicText("NO TANK EQUIPPED",{style:jd,width:"100%"});d.alpha=0,d.style.align="center",d.verticalAlign="middle",this.container.addChild(d);var e=new xh;c.addChild(e.container);var f=new vh,g=new vh;f.container.y=49,g.container.y=184,f.container.x=g.container.x=339,c.addChild(f.container,g.container);var h=new a.UI.DynamicText(" ",{style:bd,width:245,height:100});h.anchorTop=49,h.anchorRight=10,c.addChild(h);var i=new wh;i.container.anchorBottom=59,i.container.anchorRight=10,c.addChild(i.container);var j=lh(250,41,function(){return Zh.authenticated?void pf.buttons["Tanks"].button.click():void xc.open("You must sign-in to change tanks")},new a.UI.DynamicText("CHANGE TANK",{style:jd}));j.anchorBottom=10,j.anchorRight=10,this.container.addChild(j);var k=function(b){a.UI.Tween.to(c,.3,{alpha:b?1:0},a.UI.Ease.Circ.CircOut),a.UI.Tween.to(d,.3,{alpha:b?0:.5},a.UI.Ease.Circ.CircOut)};this.load=function(a){eh.prototype.load.call(this,a);var b=tankClass[a.classId];b?(h.value=b.Description,e.update(b),i.update(b),f.update(b.PrimaryWeapon,b.PrimaryConfig),g.update(b.SecondaryWeapon,b.SecondaryConfig),k(!0)):k(!1)}};yh.prototype=Object.create(eh),yh.prototype.constructor=yh;var zh=function(){var b,c,d,e,g,h,i,j=this.container=new a.UI.Container("100%","100%"),k=!1,l=this;this.tanks=[],this.currentFriendID=0,this.badges=[],this.badgeCache={},this.addBadge=function(a,b){var c=this.badgeCache[a];c||(this.badgeCache[a]=c=new Ve[a]),c.load(b),this.badges.indexOf(c)===-1&&(c.container.anchorRight=10+75*this.badges.length,c.container.visible=!0,this.badges.push(c),d.container.addChild(c.container),d.levelContainer.anchorRight=10+75*this.badges.length)},this.clearBadges=function(){for(var a=0;a<this.badges.length;a++)d.container.removeChild(this.badges[a].container);d.levelContainer.anchorRight=10,this.badges=[]},this.init=function(){b=new a.UI.Sprite.fromFrame("UI/blank.png"),b.width=b.height="100%",b.tint=0,b.alpha=.5,j.addChild(b),b.interactive=!0,b.onClick=function(){l.close()},k=!0,c=this.content=new a.UI.Container(1220,577),c.verticalAlign="middle",c.horizontalAlign="center",c.pivot=.5,j.addChild(c);var f=new a.UI.SliceSprite(a.Texture.fromFrame("UI/profile/bg.png"),30);f.anchorLeft=f.anchorRight=f.anchorBottom=-25,f.anchorTop=-80,c.addChild(f),f.interactive=!0;var m=a.UI.Sprite.fromFrame("UI/profile/grad.png");m.width=m.height="100%",c.addChild(m);var n=new a.UI.Button({background:new a.UI.Sprite.fromFrame("UI/profile/close.png")});n.alpha=.8,n.anchorRight=0,n.anchorTop=-56,n.on("hover",function(a){n.alpha=a?1:.8}),n.on("click",function(){l.close()}),c.addChild(n);var o=new a.UI.DynamicText("PLAYER PROFILE",{style:ld});o.horizontalAlign="center",o.y=-50,c.addChild(o),d=new Bh(c),g=this.statPage=new Sh(c,l),h=this.crewPage=new Uh(c,l),i=this.achivementPage=new Vh(c,l),h.container.visible=h.container.interactive=i.container.visible=i.container.interactive=!1,e=new Ah(this)},this.activePage=null,this.openSubMenu=function(a){this.activePage&&(this.activePage.container.visible=this.activePage.container.interactive=!1),this.activePage=a,a.container.visible=a.container.interactive=!0,a.open(l.currentFriendID)},this.open=function(g){k||this.init(),l.currentFriendID=g,a.UI.Tween.set(c,{alpha:0}),a.UI.Tween.fromTo(b,1,{alpha:0},{alpha:.5},a.UI.Ease.Cubic.easeOut),c.visible=this.container.visible=this.container.interactive=!0,this.clearBadges(),f.post("/Profile/GetData",{id:g}).done(function(b){googa("send","event","ProfilePage",l.currentFriendID==Dd.friendID?"Viewed Profile (Self)":"Viewed Profile (Other)"),d.update(b),l.tanks=b[4];var e=b[5],f=b[6],g=b[7];e&&l.addBadge(0,-1),null!=f&&l.addBadge(f,g),a.UI.Tween.fromTo(c,.4,{alpha:0,scale:.8},{alpha:1,scale:1},a.UI.Ease.Cubic.easeOut)}),this.openSubMenu(this.statPage),e.update()},this.close=function(a){this.container.visible=this.container.interactive=!1,g.close()}},Ah=function(b){var c=this.container=new a.UI.Container(712,90);c.anchorRight=0,b.content.addChild(c);var d=new a.UI.TilingSprite(a.Texture.fromFrame("UI/stripebox.png"),"100%","100%");d.tint=2829099,d.alpha=.4,c.addChild(d);var e,f=[["UI/profile/icon_stats.png","STATISTICS",210,b.statPage],["UI/profile/icon_achievements.png","ACHIEVEMENTS",250,b.achivementPage],["UI/profile/icon_crews.png","CREWS",165,b.crewPage]],g=[],h=a.UI.Sprite.fromFrame("UI/blank.png");h.height="100%",h.width=210,h.alpha=.15,c.addChild(h),this.update=function(){for(var a=0;a<g.length;a++){var c=g[a];c.page==b.activePage&&c.setActive(!0)}};for(var i=0,j=0;j<f.length;j++)!function(){var d=f[j],k=d[0],l=d[1],m=d[2],n=d[3],o=new a.UI.Button({height:"100%",width:m});g.push(o),o.on("hover",function(a){}),o.page=n,o.setActive=function(b){b&&(e&&e.setActive(!1),e=o,b&&a.UI.Tween.to(h,.5,{x:o.x,width:o.width},a.UI.Ease.Cubic.easeOut)),o.alpha=b?1:.8},o.on("click",function(){b.openSubMenu(n),googa("send","event","ProfilePage",pf.profilePage.currentFriendID==Dd.friendID?"Viewed "+l+" Self":"Viewed "+l+"Other"),this.setActive(!0)});var p=new a.UI.DynamicText(l,{style:ld});p.verticalAlign="middle",p.x=65;var q=a.UI.Sprite.fromFrame(k);q.verticalAlign="middle",q.x=25,o.addChild(p,q),o.x=i,i+=o.width,o.setActive(!1),c.addChild(o)}();this.update()},Bh=function(b){var c=this.container=new a.UI.Container(500,90);b.addChild(c);var d=-1,e=this.levelContainer=new a.UI.Container(50,"100%");e.anchorRight=0;var f=new a.UI.TilingSprite(a.Texture.fromFrame("UI/stripebox.png"),"100%","100%");f.tint=2829099,f.alpha=.6,c.addChild(f);var g=a.UI.Sprite.fromFrame("UI/blank.png");g.width=g.height=56,g.tint=13355979,g.y=10,g.x=13,c.addChild(g);var h=new a.UI.Sprite(a.Texture.fromFrame("UI/avatar.png"));h.anchorLeft=h.anchorTop=h.anchorBottom=h.anchorRight=3,g.addChild(h);var i=a.UI.Sprite.fromFrame("UI/Rank/Medium/1.png");i.pivot=.5,i.right=41,i.top=34;var j=new a.UI.DynamicText("",{style:kd});j.y=9,j.x=75;var l=a.UI.Sprite.fromFrame("UI/blank.png");l.width=g.height=56,l.tint=13355979,l.y=10,l.x=13,c.addChild(g);var m=new a.UI.DynamicText("",{style:$c});m.y=28,m.x=75,m.style.tint="#d4d4d4";var n=new a.UI.DynamicText("",{style:jd,allowTags:!0});n.anchorRight=7,n.anchorBottom=3;var o=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/blank.png"),text:new a.UI.DynamicText("Add as Friend",{style:$c}),width:100,height:20});o.background.alpha=.2,o.x=75,o.y=43,c.addChild(o),o.on("click",function(){$h.friendListEvents.sendFriendRequest(d),o.visible=o.interactive=!1}),o.on("hover",function(a){o.background.alpha=a?.25:.2}),e.addChild(i,n),c.addChild(j,m,e),this.update=function(b){d=b[0];var c=b[1],e=b[2],f=b[3];i.sprite.texture=a.Texture.fromFrame("UI/Rank/Medium/"+k.min(240,e)+".png"),n.text="LEVEL <font size='25'>"+e+"</font>",j.text=c,m.text=Dd.XPSystem.GetRankName(e);var g=ai.getFriend(d),l=d==Zh.data["friendID"];o.visible=o.interactive=!g&&!l,h.sprite.texture=f.length?a.Texture.fromImage("/avatar?path="+f):a.Texture.fromFrame("UI/avatar.png")}},Ch=function(a,b){this.GameMode=b,this.TimePlayed=a["a"]?a["a"]:0,this.Kills=a["b"]?a["b"]:0,this.Deaths=a["c"]?a["c"]:0,this.Assists=a["d"]?a["d"]:0,this.Killsteals=a["e"]?a["e"]:0,this.GamesPlayed=a["f"]?a["f"]:0,this.GamesWon=a["g"]?a["g"]:0,this.FastestWin=a["h"]?a["h"]:0,this.FastestLoss=a["i"]?a["i"]:0,this.PlayersDominated=a["j"]?a["j"]:0,this.PlayersDecimated=a["k"]?a["k"]:0,this.PlayersRevenged=a["l"]?a["l"]:0,this.HealingGiven=a["m"]?a["m"]:0,this.HealingRecieved=a["mm"]?a["mm"]:0,this.DamageGiven=a["n"]?a["n"]:{},this.DamageTaken=a["o"]?a["o"]:{},this.PowerUpDamageGiven=a["p"]?a["p"]:{},this.PowerUpDamageTaken=a["q"]?a["q"]:{},this.PowerUpKills=a["r"]?a["r"]:{},this.PowerUpDeaths=a["s"]?a["s"]:{},this.PowerUpUsed=a["t"]?a["t"]:{},this.PowerUpHitsGiven=a["u"]?a["u"]:{},this.PowerUpHitsTaken=a["v"]?a["v"]:{},this.PowerUpHealingGiven=a["w"]?a["w"]:{},this.PowerUpHealingRecieved=a["x"]?a["x"]:{},this.ClassesUsed=a["y"]?a["y"]:{},this.MultiKills=a["z"]?a["z"]:{},this.GamesLost=this.GamesPlayed-this.GamesWon,this.WinRate=this.GamesPlayed?(this.GamesWon/this.GamesPlayed*100).toFixed(1)+"%":"0%",this.KD=this.Kills,this.KDA=this.Kills,this.Deaths>0&&(this.KD=p((this.Kills/this.Deaths).toFixed(2)),this.KDA=p(((this.Kills+this.Assists)/this.Deaths).toFixed(2))),this.TimeSpentAsKing=a["a0"]?a["a0"]:0,this.PointsCollected=a["b0"]?a["b0"]:0,this.PointsLost=a["c0"]?a["c0"]:0,this.ZonesCaptured=a["a1"]?a["a1"]:0,this.ZonesNeutralized=a["b1"]?a["b1"]:0,this.ZonesDefended=a["c1"]?a["c1"]:0,this.EnemiesKilledInZones=a["d1"]?a["d1"]:0,this.Top10Placements=a["a2"]?a["a2"]:{}},Dh=function(b,c,d,e){var f=this.text=new a.UI.DynamicText(b,{style:$c,width:e,allowTags:!0});f.style.align="center",f.style.wrap=!1,f.style.lineHeight=15,this.update=function(a){var e="<font size='14' lineheight='44'><b>"+b+"</b></font>\n<font valign='5'>";if("object"==typeof c)for(var g=0;g<c.length;g++)g>0&&(e+="/"),e+=a[c[g]];else if(0==d)e+=Fc(a[c]);else if(1==d){var h=q(a[c]);if(0==h)e+="0s";else{var i=k.floor(h/3600);i>0&&(e+=i+"h "),h-=3600*i;var j=k.floor(h/60);(i>0||j>0)&&(e+=j+"m ");var l=h-60*j;e+=l+"s",h-=3600*i}}f.value=e}},Eh=function(b,c){var d=this.container=new a.UI.Container("100%",30);this.max=0;var e=this.bg=a.UI.Sprite.fromFrame("UI/blank.png");e.width=e.height="100%",e.alpha=.1,d.addChild(e);var f=new a.UI.DynamicText(b,{style:hd});f.x=11,f.y=0;var g=new a.UI.DynamicText("Given",{style:gd,allowTags:!0,width:70}),h=new a.UI.DynamicText("Taken",{style:gd,allowTags:!0,width:70});g.style.align="right",h.style.align="right",g.style.y=h.style.y=3,g.anchorRight=75,h.anchorRight=7,g.style.lineHeight=h.style.lineHeight=14,d.addChild(f,g,h);var i=a.UI.Sprite.fromFrame("UI/blank.png"),j=a.UI.Sprite.fromFrame("UI/blank.png");i.height=j.height=5,i.x=j.x=11,i.anchorBottom=8,j.anchorBottom=2,i.tint=11785029,j.tint=12928582,d.addChild(i,j),this.update=function(b){var d=0;for(var e in b.DamageTaken)d=k.max(d,b.DamageTaken[e]);for(var e in b.DamageGiven)d=k.max(d,b.DamageGiven[e]);var f=b["DamageTaken"][c]?b["DamageTaken"][c]:0,l=b["DamageGiven"][c]?b["DamageGiven"][c]:0;this.max=k.max(f,l),h.text="Taken\n<font tint='#ff4b4b'>"+Fc(f),g.text="Given\n<font tint='#cbf04a'>"+Fc(l),a.UI.Tween.to(j,.4,{width:d?k.max(2,f/d*160):2},a.UI.Ease.Cubic.easeOut),a.UI.Tween.to(i,.4,{width:d?k.max(2,l/d*160):2},a.UI.Ease.Cubic.easeOut)}},Fh=function(b,c,d){var e=this.container=new a.UI.Container("100%",21);if(e.y=43+21*d,Gc(d)){var f=this.bg=a.UI.Sprite.fromFrame("UI/blank.png");f.width=f.height="100%",f.alpha=.1,e.addChild(f)}var g=new a.UI.DynamicText(b,{style:hd});g.x=11,g.y=2;var h=new a.UI.DynamicText("test",{style:hd});h.anchorRight=11,e.addChild(g,h),this.update=function(a){h.value=(a.MultiKills[c]?a.MultiKills[c]:0)+""}},Gh=function(b,c,d,e,f){var g=this.container=new a.UI.Container(b,c),h=a.UI.Sprite.fromFrame("UI/blank.png");if(h.width=h.height="100%",h.alpha=e,h.tint=d,g.addChild(h),f){var i=new a.UI.DynamicText(f,{style:kd,width:"100%"});i.y=10,i.style.align="center",g.addChild(i)}var j={},k=[],l=[],m=[];this.addStatItem=function(b,c,d,e,f,h,i,l,m){if(!j[e]&&i){var n=j[e]=a.UI.Sprite.fromFrame("UI/blank.png");n.width="100%",n.height=h,n.alpha=.1,n.y=f,g.addChild(n)}var o=100/m*l,p=f+5,q=0;3==m?(q="18.5%",o*=.74,o+=4):2==m&&(q=70/3+"%",o*=.7,o+=4);var r=new Dh(b,c,d,q);r.text.x=o+"%",r.text.y=p,g.addChild(r.text),k.push(r)},this.addDamageItem=function(a,b){var c=new Eh(a,b);g.addChild(c.container),l.push(c)},this.addStreakItem=function(a,b,c){var d=new Fh(a,b,c);g.addChild(d.container),m.push(d)},this.update=function(b){for(var c=0;c<k.length;c++)k[c].update(b);for(var c=0;c<m.length;c++)m[c].update(b);
if(l.length){for(var c=0;c<l.length;c++)l[c].update(b);l.sort(function(a,b){return a.max>b.max?-1:b.max>a.max?1:0});for(var d=!0,c=0;c<l.length;c++){var e=l[c];a.UI.Tween.to(e.container,.4,{y:43+30*c},a.UI.Ease.Cubic.easeOut),e.bg.alpha=d?.1:.04,d=!d}}}},Hh=function(){Gh.call(this,314,263,3030421,.24,"STATS OVERVIEW"),this.container.x=15,this.container.y=70,this.addStatItem("Games","GamesPlayed",0,1,39,44,1,0,3),this.addStatItem("Won","GamesWon",0,1,39,44,1,1,3),this.addStatItem("Lost","GamesLost",0,1,39,44,1,2,3),this.addStatItem("Winrate","WinRate",0,1,39,44,1,3,3),this.addStatItem("Kills","Kills",0,2,83,44,0,0,3),this.addStatItem("Deaths","Deaths",0,2,83,44,0,1,3),this.addStatItem("Assists","Assists",0,2,83,44,0,2,3),this.addStatItem("KD/KDA",["KD","KDA"],0,2,83,44,0,3,3),this.addStatItem("Healing Given","HealingGiven",0,3,127,44,1,0,2),this.addStatItem("Healing Recieved","HealingRecieved",0,3,127,44,1,1,2),this.addStatItem("Kill Steals","Killsteals",0,3,127,44,1,2,2),this.addStatItem("Dominated","PlayersDominated",0,4,171,44,0,0,2),this.addStatItem("Players Decimated","PlayersDecimated",0,4,171,44,0,1,2),this.addStatItem("Revenged","PlayersRevenged",0,4,171,44,0,2,2),this.addStatItem("Fastest Win","FastestWin",1,5,215,44,1,0,2),this.addStatItem("Fastest Loss","FastestLoss",1,5,215,44,1,1,2),this.addStatItem("Time Played","TimePlayed",1,5,215,44,1,2,2)},Ih=function(){Gh.call(this,294,111,3030421,.24,"KINGDM STATS"),this.container.x=338,this.container.y=222,this.addStatItem("Points\nCollected","PointsCollected",0,2,39,68,1,0,2),this.addStatItem("Points\nLost","PointsLost",0,2,39,68,1,1,2),this.addStatItem("Time Spent\nAs King","TimeSpentAsKing",1,2,39,68,1,2,2)},Jh=function(){Gh.call(this,294,111,3030421,.24,"CONQUEST STATS"),this.container.x=338,this.container.y=222,this.addStatItem("Zones\nCaptured","ZonesCaptured",0,1,39,68,1,0,3),this.addStatItem("Zones\nNeutralized","ZonesNeutralized",0,1,39,68,1,1,3),this.addStatItem("Zones\nDefended","ZonesDefended",0,1,39,80,1,2,3),this.addStatItem("Kills in\nZones","EnemiesKilledInZones",0,1,35,68,1,3,3)},Kh=function(){Gh.call(this,316,264,0,.43,"DAMAGE STATS"),this.container.x=643,this.container.y=70,this.addDamageItem("Pure Damage","0"),this.addDamageItem("Explosive Damage","1"),this.addDamageItem("Fire Damage","2"),this.addDamageItem("Piercing Damage","3"),this.addDamageItem("Electric Damage","4"),this.addDamageItem("Chemical Damage","5");var b=new a.UI.DynamicText("Total Damage Given",{style:hd,allowTags:!0,width:"50%"}),c=new a.UI.DynamicText("Total Damage Taken",{style:hd,allowTags:!0,width:"50%"});b.style.align=c.style.align="center",b.anchorLeft=c.anchorRight=4,b.bottom=c.bottom=38,c.style.lineHeight=b.style.lineHeight=16,this.container.addChild(b,c),this.updateBase=this.update,this.update=function(a){this.updateBase(a);var d=0,e=0;for(var f in a.DamageTaken)d+=a.DamageTaken[f];for(var f in a.DamageGiven)e+=a.DamageGiven[f];c.value="Total Damage Taken\n<font tint='#ff4b4b'>"+Fc(d),b.value="Total Damage Given\n<font tint='#cbf04a'>"+Fc(e)}},Lh=function(){Gh.call(this,234,264,987394,.4,"KILLSTREAKS"),this.container.x=970,this.container.y=70,this.addStreakItem("( 11+ ) UNSTOPPABLE",11,0),this.addStreakItem("( 10 ) INVINCIBLE",10,1),this.addStreakItem("( 9 ) RAMPAGE",9,2),this.addStreakItem("( 8 ) MASSACRE",8,3),this.addStreakItem("( 7 ) MEGA KILL",7,4),this.addStreakItem("( 6 ) Ultra Kill",6,5),this.addStreakItem("( 5 ) Killing Spree",5,6),this.addStreakItem("( 4 ) Multi Kill",4,7),this.addStreakItem("( 3 ) Triple Kill",3,8),this.addStreakItem("( 2 ) Double Kill",2,9)},Mh=function(){Gh.call(this,295,144,0,.24,"MOST USED TANK"),this.container.x=338,this.container.y=70;var b=new a.UI.Container;b.y=90,b.horizontalAlign="center",this.container.addChild(b);var c=new S;c.container.scale.set(.8),b.container.addChild(c.container);var d=new a.UI.DynamicText(" ",{style:hd,width:"100%"});d.anchorTop=30,d.style.align="center",d.style.tint="#CCCCCC",this.container.addChild(d),this.update=function(a,e){var f=-1,g=-1;for(var h in a.ClassesUsed){var i=a.ClassesUsed[h],j=tankClass[h];j&&i>g&&(g=i,f=h)}if(f!=-1){for(var j=tankClass[f],k=j.DefaultSkinBody,l=j.DefaultSkinCannon,m=0;m<e.length;m++){var n=e[m],h=n[0];h==f&&(n[1]!=-1&&(k=n[1]),n[2]!=-1&&(l=n[2]))}d.value=j.Name,c.loadClass(f,l,k,!0),b.visible=!0}else b.visible=!1}},Nh=function(b,c,d,e,f,g){var h=this.container=new a.UI.Container(b,c),i=!1,j=new a.UI.Button({width:"100%",height:"100%",background:a.UI.Sprite.fromFrame("UI/blank.png")});j.background.tint=8027265;var k=new a.UI.Button({width:38,height:"100%",background:a.UI.Sprite.fromFrame("UI/blank.png"),text:new a.UI.DynamicText("▼",{style:jd})});k.text.style.verticalAlign=1,k.anchorRight=0,k.background.tint=10330277,k.interactive=!1,h.addChild(j,k);var l=new a.UI.Interaction.ClickEvent(Dd.Scene.UI_MainMenu,(!1));l.stopEvent(),l.onClick=function(a){m(!1)};var m=function(b){b!=i&&(i=b,a.UI.Tween.to(o,.4,{height:i?n:0},a.UI.Ease.Cubic.easeOut),o.Interaction=i,b?l.startEvent():l.stopEvent())},n=f.length*c,o=new a.UI.ScrollingContainer({width:"100%",height:0,scrollX:!1,scrollY:!1});o.Interaction=!1,o.y=c,h.addChild(o),j.on("click",function(){m(!i)});var p=null,q={};this.select=function(a){for(var b in q)b==a&&q[b].setActive(!0,!1)};var r=new a.UI.DynamicText(" ",{style:ld,width:"100%"});r.style.overflowX="hidden",r.style.ellipsis=!0,r.verticalAlign="middle",r.anchorLeft=d,r.anchorRight=e,j.addChild(r);for(var s=0,t=f.length-1;t>=0;t--)!function(){var h=f[t][0],i=f[t][1],j=f[t][2],k=new a.UI.Button({width:b,height:c,background:a.UI.Sprite.fromFrame("UI/blank.png")});k.dropdownValue=i,q[i]=k,k.setActive=function(b,c){b&&(p&&p.setActive(!1,!1),p=this,c&&"function"==typeof g&&g(i)),r.value=h,a.UI.Tween.to(this.background,.4,{tint:b?"#9a9a9a":"#707173"},a.UI.Ease.Cubic.easeOut)},k.on("hover",function(b){this!=p&&a.UI.Tween.to(this.background,.4,{tint:b?"#848484":"#707173"},a.UI.Ease.Cubic.easeOut)}),k.on("click",function(a){this!=p&&this.setActive(!0,!0),m(!1)}),k.background.tint=7369075,k.anchorBottom=s*c,o.addChild(k);var l=new a.UI.DynamicText(h,{style:kd,width:"100%"});l.style.overflowX="hidden",l.style.ellipsis=!0,l.verticalAlign="middle",l.anchorLeft=d,l.anchorRight=e,k.addChild(l),j&&k.setActive(!0,!1),s++}()},Oh=function(b){var c=this,d=this.container=new a.UI.Container(81,94);this.hover=!1,this.used=0,this.id=b.id,d.anchorBottom=0,d.pivot=.5;var e=a.UI.Sprite.fromFrame("UI/blank.png");e.width=e.height="100%",e.tint=4408389,d.addChild(e);var f=new rh((!1),.8);f.container.pivot=.5,f.container.left="50%",f.container.y=16,d.addChild(f.container),f.update(b.id);var g=new a.UI.DynamicText(b.name.toUpperCase(),{style:rd,width:"100%"});g.style.align="center",g.style.overflowX="hidden",g.style.ellipsis=!0,g.style.wrap=!1,g.anchorLeft=g.anchorRight=5,g.y=60,d.addChild(g);var h=new a.UI.DynamicText(" ",{style:Zc,width:150,allowTags:!0});h.style.align="center",h.style.tint="#d9d9d9",h.style.wrap=!1,h.style.lineHeight=14,h.y=78,h.horizontalAlign="center",d.addChild(h),new a.UI.Interaction.ClickEvent(e,(!0)).onHover=function(a,b){c.hover=b,b?c.focus():c.blur()},this.focus=function(){d.parent.addChild(d),a.UI.Tween.to(d,.4,{width:150,height:185},a.UI.Ease.Cubic.easeOut),a.UI.Tween.to(e,.4,{tint:"#5b5b5b"},a.UI.Ease.Cubic.easeOut)},this.blur=function(){a.UI.Tween.to(d,.4,{width:81,height:94},a.UI.Ease.Cubic.easeOut),a.UI.Tween.to(e,.4,{tint:"#434445"},a.UI.Ease.Cubic.easeOut)},this.update=function(a){var c=void 0!==a.PowerUpUsed[b.id]?a.PowerUpUsed[b.id]:0,d=void 0!==a.PowerUpDamageGiven[b.id]?a.PowerUpDamageGiven[b.id]:0,e=void 0!==a.PowerUpDamageTaken[b.id]?a.PowerUpDamageTaken[b.id]:0,f=void 0!==a.PowerUpKills[b.id]?a.PowerUpKills[b.id]:0,g=void 0!==a.PowerUpDeaths[b.id]?a.PowerUpDeaths[b.id]:0,i=void 0!==a.PowerUpHitsGiven[b.id]?a.PowerUpHitsGiven[b.id]:0,j=void 0!==a.PowerUpHitsTaken[b.id]?a.PowerUpHitsTaken[b.id]:0,k=void 0!==a.PowerUpHealingGiven[b.id]?a.PowerUpHealingGiven[b.id]:0,l=void 0!==a.PowerUpHealingRecieved[b.id]?a.PowerUpHealingRecieved[b.id]:0;this.used=c;var m="Used:<b><font tint='#ffffff'> "+c+"</font></b>";0==f&&0==g||(m+="\nKills:<b><font tint='#ffffff'> "+Fc(f)+"</font></b>",m+="\nDeaths:<b><font tint='#ffffff'> "+Fc(g)+"</font></b>"),0==d&&0==e||(m+="\nDamage Given:<b><font tint='#ffffff'> "+Fc(d)+"</font></b>",m+="\nDamage Taken:<b><font tint='#ffffff'> "+Fc(e)+"</font></b>"),0==i&&0==j||(m+="\nHits Given:<b><font tint='#ffffff'> "+Fc(i)+"</font></b>",m+="\nHits Taken:<b><font tint='#ffffff'> "+Fc(j)+"</font></b>"),0==k&&0==l||(m+="\nHealing Given:<b><font tint='#ffffff'> "+Fc(q(k))+"</font></b>",m+="\nHealing Recieved:<b><font tint='#ffffff'> "+Fc(q(l))+"</font></b>"),h.text=m}},Ph=function(){var b=this.container=new a.UI.ScrollingContainer({width:"100%",height:150,scrollX:!1,scrollY:!1});b.anchorBottom=0;var c=new a.UI.Container(0,"100%");c.anchorBottom=0,b.addChild(c);var d=[],e=0,f=0,g=0;for(var h in Dd.PowerUps)if(q(h)>=0){var i=Dd.PowerUps[h],j=new Oh(i);j.container.x=f=84*e+40,a.UI.Tween.set(j.container,{x:j.container.x}),c.addChild(j.container),d.push(j),g=e,e++}c.width=84*e-3;var l=new a.Point,m=new a.UI.Interaction.ClickEvent(b,(!0));m.onMove=function(e){b.container.toLocal(Dd.Camera.mousePosition,null,l);var h=k.min(1,k.max(0,l.x/1220)),i=z(0,-(c.width-1220),h);a.UI.Tween.to(c,.4,{x:i},a.UI.Ease.Cubic.easeOut),d[0].hover?a.UI.Tween.to(d[0].container,.4,{x:75-i},a.UI.Ease.Cubic.easeOut):a.UI.Tween.set(d[0].container,{x:40}),d[g].hover?a.UI.Tween.to(d[g].container,.4,{x:f-35-(c.width-1220+i)},a.UI.Ease.Cubic.easeOut):a.UI.Tween.set(d[g].container,{x:f})},m.onHover=function(c,e){b.height=e?210:140,e||(a.UI.Tween.set(d[0].container,{x:40}),a.UI.Tween.set(d[g].container,{x:f}))},this.update=function(b){for(var c=0;c<d.length;c++)d[c].update(b);d.sort(function(a,b){return a.used>b.used?-1:b.used>a.used?1:a.id>b.id?1:-1});for(var c=0;c<d.length;c++)d[c].update(b),a.UI.Tween.to(d[c].container,.4,{x:84*c+40},a.UI.Ease.Cubic.easeOut)}},Qh=function(b,c,d){var e=b.length,f=this.container=new a.UI.Container(10,40),g=this,h={},i=c,j=0,k=this.marker=a.UI.Sprite.fromFrame("UI/blank.png");k.width=100,k.height="100%",k.tint=8027265;var l=b[0][1];f.addChild(k);for(var m=0;m<b.length;m++)!function(){var e=b[m][0],n=b[m][1],o=b[m][2],p=b[m][3];j+=o;var q=h[n]=new a.UI.Button({width:o,height:40,text:new a.UI.DynamicText(e,{style:ld})});q.period=n,q.on("click",function(){g.select(n),d(n)}),k.width=o,k.anchorLeft=q.anchorLeft=i,i+=o+c,f.addChild(q),p&&(l=n)}();f.width=j+e*c,(this.select=function(b){for(var c in h){var d=h[c],e=c==b;a.UI.Tween.to(d,.4,{alpha:e?1:.7},a.UI.Ease.Cubic.easeOut),e&&a.UI.Tween.to(k,.4,{width:d.width,anchorLeft:d.anchorLeft},a.UI.Ease.Cubic.easeOut)}})(l)},Rh=function(b){var c=this.container=new a.UI.Container("100%",40);c.y=12;var d=new Qh([["ALL TIME",2,140,!0],["THIS MONTH",1,180],["TODAY",0,120]],10,function(a){b.setPeriod(a)});c.addChild(d.container),d.container.anchorRight=10;var e=new Nh(311,40,18,18,[["ALL GAMEMODES","-1",!0],["KING DM","0",!0],["CONQUEST","1",!0]],function(a){b.setGamemode(a)});e.container.anchorLeft=17,c.addChild(e.container),this.update=function(a,b){e.select(b),d.select(a)}},Sh=function(b,c){var d=c,e=this.container=new a.UI.Container(1220,475);e.anchorBottom=0,b.addChild(e);var g,h=2,i=-1,j=0,k=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));k.tint=10461087,k.width=k.height="100%",k.alpha=.4,e.addChild(k);var l=new Hh;e.addChild(l.container);var m=new Ih;e.addChild(m.container);var n=new Jh;e.addChild(n.container);var o=new Kh;e.addChild(o.container);var p=new Lh;e.addChild(p.container);var q=new Mh;e.addChild(q.container);var r=new Ph;e.addChild(r.container);var s=new Rh(this);e.addChild(s.container),this.setPeriod=function(a){a!=h&&(h=a,s.update(h,i),this.loadData(j,i,h,function(){}))},this.setGamemode=function(a){a!=i&&(i=a,s.update(h,i),this.loadData(j,i,h,function(){}))},this.open=function(a){j!=a&&(j=a,h=2,i=-1,s.update(h,i),this.loadData(a,i,h,function(){}))},this.close=function(){},this.loadData=function(a,b,c,e){f.post("/Profile/GetStatData",{id:a,gamemode:b,period:c}).done(function(a){var f="";switch(b){case-1:f+="All Gamemodes-";break;case 0:f+="King DM-";break;case 1:f+="Conquest-"}switch(c){case-1:f+="All Time";break;case 0:f+="This Month";break;case 1:f+="Today"}googa("send","event","ProfilePage",self.currentFriendID==Dd.friendID?"STATISTICS Self "+f:"STATISTICS Other "+f),g=new Ch(a[1],a[0]),m.container.visible=0==b,n.container.visible=1==b,l.update(g),o.update(g),p.update(g),r.update(g),q.update(g,d.tanks),0==b&&m.update(g),1==b&&n.update(g),e()})}},Th=function(){var b=new uf,c=this.container=new a.UI.Container(190,"100%"),d=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));d.width=d.height="100%",d.alpha=.8,c.addChild(d);var e=new a.UI.DynamicText(" ",{style:jd,width:"100%"});e.y=10,e.style.align="center",c.addChild(e);var f=new a.UI.Container;f.bottom=75,f.horizontalAlign="center",c.addChild(f);var g=new S;g.container.scale.set(.8),f.container.addChild(g.container);var h=new a.Sprite(a.Texture.Empty);h.anchor.set(0,1),h.x=0,h.y=460,h.scale.set(.5),c.container.addChild(h);var i=new rh((!0),.5),j=new rh((!0),.5);i.container.anchorBottom=j.container.anchorBottom=-10,i.container.anchorRight=40,j.container.anchorRight=-5,c.addChild(i.container,j.container);for(var k=[],l=[["Experience","experience",SETTINGS.StatMult_Crew_Experience],["Damage","damage",SETTINGS.StatMult_Crew_Damage],["Health","health",SETTINGS.StatMult_Crew_Health],["Speed","speed",SETTINGS.StatMult_Crew_Speed],["Aim Speed","aimSpeed",SETTINGS.StatMult_Crew_AimSpeed],["Explosive Resistance","explosiveResistance",SETTINGS.StatMult_Crew_Resist_Explosive],["Fire Resistance","fireResistance",SETTINGS.StatMult_Crew_Resist_Fire],["Piercing Resistance","piercingResistance",SETTINGS.StatMult_Crew_Resist_Piercing],["Electric Resistance","electricResistance",SETTINGS.StatMult_Crew_Resist_Electric],["Chemical Resistance","chemicalResistance",SETTINGS.StatMult_Crew_Resist_Chemical]],m=0;m<l.length;m++){var n=new ph(l[m][0],l[m][1],l[m][2],(!1));n.container.y=35+30*m,n.container.x=6,k.push(n),c.addChild(n.container)}this.clear=function(){c.visible=!1},this.update=function(d,l){b.update(d),c.visible=!0;for(var m=0;m<k.length;m++)k[m].update(b);if(b.classId>0){f.visible=!0;for(var n=tankClass[b.classId],o=n.DefaultSkinBody,p=n.DefaultSkinCannon,m=0;m<l.tanks.length;m++){var q=l.tanks[m];q[0]==b.classId&&(q[1]!=-1&&(o=q[1]),q[2]!=-1&&(p=q[2]))}g.loadClass(b.classId,p,o,!0)}else f.visible=!1;b.commanderId>0?(h.texture=a.Texture.fromImage("/image/item-"+b.commanderId+".png"),h.visible=!0):h.visible=!1,i.update(b.firstAbilityId),i.container.alpha=b.firstAbilityId>=0?1:.2,j.update(b.secondAbilityId),j.container.alpha=b.secondAbilityId>=0?1:.2,e.text=vf[b.index]}},Uh=function(b,c){var d,e=this.container=new a.UI.Container(1220,475);e.anchorBottom=0,b.addChild(e);var g=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));g.tint=10461087,g.width=g.height="100%",g.alpha=.4,e.addChild(g);var h=new a.UI.Container("100%","97%");h.verticalAlign="middle",h.horizontalAlign="center",e.addChild(h);for(var i={},j=0;j<6;j++){var k=i[j]=new Th;k.container.x=200*j,h.addChild(k.container)}this.open=function(a){d=a,this.loadData(a,function(){})},this.loadData=function(a){for(var b in i)i[b].clear();f.post("/Profile/GetCrewData",{id:a}).done(function(a){for(var b=0;b<a.length;b++)i[b].update(a[b],c);h.width=200*a.length-10})}},Vh=function(b){var c=this.container=new a.UI.Container(1220,475);c.anchorBottom=0,b.addChild(c);var d=new a.UI.SliceSprite(cf,3,(!0),(!0),(!0));d.tint=10461087,d.width=d.height="100%",d.alpha=.4,c.addChild(d);var e=new a.UI.DynamicText("Coming Soon!",{style:ld,width:"100%"});e.style.align="center",e.verticalAlign="middle",c.addChild(e),e.alpha=.5,this.open=function(a){}},Wh=0,Xh=!1;mc.prototype.init=function(){Xh||this.initDimm(),this.initialized=!0;var b=this,c=this.container=new a.UI.Container(this.width,this.height);c.pivot=.5,c.horizontalAlign="center",c.verticalAlign="middle",c.interactiveChildren=!1;var d=new a.UI.SliceSprite(a.Texture.fromFrame("UI/Menu/notification-bg.png"),17,(!0),(!0));d.tint=14606046,d.width="100%",d.height="100%";var e=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/notification-close.png")});e.background.alpha=.8,e.anchorTop=20,e.anchorRight=20,e.on("hover",function(a){e.background.alpha=a?1:.8}),e.on("click",function(){b.closecallback&&b.closecallback(),b.close()}),c.addChild(d,e)},mc.prototype.open=function(){this.initialized||this.init(),this.isOpen||(a.UI.Tween.fromTo(this.container,.45,{alpha:0,scale:.5},{alpha:1,scale:1},a.UI.Ease.Bounce.BounceOut),this.isOpen=!0,this.container.visible=!0,Dd.Scene.UI_Notification.addChild(this.container),this.container.interactiveChildren=!0,Wh++,this.dimm())},mc.prototype.close=function(){this.isOpen&&(this.container.visible=!1,this.container.interactiveChildren=!1,this.isOpen=!1,Wh--,this.undimm())},mc.prototype.initDimm=function(){var b=mc.dimmBG=a.UI.Sprite.fromFrame("UI/blank.png");b.width=b.height="100%",b.alpha=0,b.tint=0,Xh=!0,Dd.Scene.UI_Notification.addChild(b)},mc.prototype.dimm=function(){1===Wh&&(a.UI.Tween.to(mc.dimmBG,.3,{alpha:.3}),mc.dimmBG.interactive=!0)},mc.prototype.undimm=function(){0===Wh&&Xh&&(a.UI.Tween.to(mc.dimmBG,.3,{alpha:0}),mc.dimmBG.interactive=!1)},mc.prototype.constructor=mc,nc.prototype=Object.create(mc.prototype),nc.prototype.constructor=nc,nc.prototype.init=function(){mc.prototype.init.call(this);var b=this;this.headline=new a.UI.DynamicText(" ",{style:nd}),this.headline.style.tint=16568833,this.headline.horizontalAlign="center",this.headline.anchorTop=50,this.subHeadline=new a.UI.DynamicText(" ",{style:jd}),this.subHeadline.horizontalAlign="center",this.subHeadline.anchorTop=93,this.button=new a.UI.Button({background:new a.UI.SliceSprite(lf,7,(!0),(!0)),width:340,height:65}),this.button.background.tint=14090035,this.button_Text=new a.UI.DynamicText(" ",{style:yd}),this.button.background.alpha=.9,this.button_Text.horizontalAlign="center",this.button_Text.anchorTop=15,this.button.addChild(this.button_Text),this.button.anchorBottom=55,this.button.horizontalAlign="center",this.button.on("hover",function(b){a.UI.Tween.to(this.background,.4,{alpha:b?1:.9},a.UI.Ease.Circ.CircOut)}),this.button.on("click",function(){b.close()}),this.container.addChild(this.headline,this.subHeadline,this.button)},nc.prototype.open=function(a,b,c){mc.prototype.open.call(this),this.headline.text=""+a,this.subHeadline.text=""+b,this.button_Text.text=""+c,this.button.focus()},nc.prototype.close=function(){mc.prototype.close.call(this)},nc.notfication=void 0,nc.open=function(a,b,c){nc.notfication||(nc.notification=new nc),nc.notification.open(a,b,c)},oc.prototype=Object.create(mc.prototype),oc.prototype.constructor=oc,oc.prototype.init=function(){mc.prototype.init.call(this);this.headline=new a.UI.DynamicText(" ",{style:nd}),this.headline.style.tint=16568833,this.headline.horizontalAlign="center",this.headline.anchorTop=50,this.subHeadline=new a.UI.DynamicText(" ",{style:jd}),this.subHeadline.horizontalAlign="center",this.subHeadline.anchorTop=93,this.loadingIcon=new a.UI.Sprite(new a.Texture.fromImage("content/gfx/loading.png")),this.loadingIcon.align="center",this.loadingIcon.pivot=.5,this.loadingIcon.top=180,this.loadingIcon.alpha=.8,this.loadingIcon.scale=.85,this.container.addChild(this.headline,this.subHeadline,this.loadingIcon)},oc.prototype.update=function(a){this.loadingIcon.rotation+=2*a},oc.prototype.open=function(a,b,c){mc.prototype.open.call(this),this.headline.text=""+a,this.subHeadline.text=""+b,this.closecallback=c,PE.GameLoop.onUpdate(this.update,this)},oc.prototype.close=function(){PE.GameLoop.offUpdate(this.update,this),mc.prototype.close.call(this)},oc.notfication=void 0,oc.open=function(a,b,c){oc.notfication||(oc.notification=new oc),oc.notification.open(a,b,c)},pc.prototype=Object.create(mc.prototype),pc.prototype.constructor=pc,pc.prototype.init=function(){mc.prototype.init.call(this);var b=this;this.headline=new a.UI.DynamicText(this.headlineText,{style:nd}),this.headline.style.tint=16568833,this.headline.horizontalAlign="center",this.headline.anchorTop=50,this.subHeadline=new a.UI.DynamicText(this.subHeadlineText,{style:jd}),this.subHeadline.horizontalAlign="center",this.subHeadline.anchorTop=93,this.button=new a.UI.Button({background:new a.UI.SliceSprite(lf,7,(!0),(!0)),width:340,height:65}),this.button.background.tint=14090035,this.button_Text=new a.UI.DynamicText(this.buttonText,{style:yd}),this.button.background.alpha=.9,this.button_Text.anchorLeft=30,this.button_Text.anchorTop=15,this.button.addChild(this.button_Text),this.button.anchorBottom=55,this.button.horizontalAlign="center",this.buttonIcon&&(this.button_Icon=a.UI.Sprite.fromFrame(this.buttonIcon),this.button_Icon.anchorBottom=this.buttonIconAnchorBottom,this.button_Icon.anchorRight=this.buttonIconAnchorRight,this.button.addChild(this.button_Icon)),this.button.on("hover",function(b){a.UI.Tween.to(this.background,.4,{alpha:b?1:.9},a.UI.Ease.Circ.CircOut)}),this.button.on("click",function(){b.buttonFn&&b.buttonFn(),b.close()}),this.container.addChild(this.headline,this.subHeadline,this.button)},pc.prototype.open=function(a){mc.prototype.open.call(this),this.subHeadline.text=this.subHeadlineText.replace("<amount>",a)},pc.prototype.close=function(){mc.prototype.close.call(this)},pc.open=function(a,b){b==ah.Gold?rc.open(a):b==ah.Talent?sc.open(a):b==ah.Gems&&qc.open(a)},qc.prototype=Object.create(pc.prototype),qc.prototype.constructor=qc,qc.notfication=void 0,qc.open=function(a){qc.notfication||(qc.notification=new qc),qc.notification.open(a)},rc.prototype=Object.create(pc.prototype),rc.prototype.constructor=rc,rc.notfication=void 0,rc.open=function(a){rc.notfication||(rc.notification=new rc),rc.notification.open(a)},sc.prototype=Object.create(pc.prototype),sc.prototype.constructor=sc,sc.notfication=void 0,sc.open=function(a){sc.notfication||(sc.notification=new sc),sc.notification.open(a)},tc.prototype=Object.create(mc.prototype),tc.prototype.constructor=tc,tc.prototype.init=function(){mc.prototype.init.call(this);var b=this;this.server="",this.room="",this.mode="",this.password="",this.container.height=325,this.headline=new a.UI.DynamicText("ENTER PASSWORD",{style:nd}),this.headline.style.tint=16568833,this.headline.horizontalAlign="center",this.headline.anchorTop=50,this.subHeadline=new a.UI.DynamicText("This game requires a password!",{style:jd}),this.subHeadline.horizontalAlign="center",this.subHeadline.anchorTop=93,this.confirmButton=new a.UI.Button({background:new a.UI.SliceSprite(lf,7,(!0),(!0)),width:280,height:65}),this.confirmButton_Text=new a.UI.DynamicText("CONNECT",{style:yd}),this.confirmButton.background.alpha=.9,this.confirmButton.background.tint=14090035,this.confirmButton_Text.horizontalAlign="center",this.confirmButton_Text.anchorTop=15,this.confirmButton.addChild(this.confirmButton_Text),this.confirmButton.anchorBottom=45,this.confirmButton.anchorRight=45,this.confirmButton.on("click",function(){b.password=b.passwordInput.value,Dd.Connection.ConnectServer(b.server,b.room,b.mode,b.password),b.close()}),this.confirmButton.on("hover",function(b){a.UI.Tween.to(this.background,.4,{alpha:b?1:.9},a.UI.Ease.Circ.CircOut)}),this.abortButton=new a.UI.Button({background:new a.UI.SliceSprite(lf,7,(!0),(!0)),width:215,height:65}),this.abortButton_Text=new a.UI.DynamicText("CANCEL",{style:yd}),this.abortButton.background.alpha=.9,this.abortButton.background.tint=5592405,this.abortButton_Text.horizontalAlign="center",this.abortButton_Text.anchorTop=15,this.abortButton.addChild(this.abortButton_Text),this.abortButton.anchorBottom=45,this.abortButton.anchorLeft=45,this.abortButton.on("click",function(){b.close()}),this.abortButton.on("hover",function(b){a.UI.Tween.to(this.background,.4,{alpha:b?1:.9},a.UI.Ease.Circ.CircOut)}),this.passwordInput=new a.UI.TextInput({value:"",background:a.UI.Sprite.fromFrame("UI/blank.png"),style:{fontSize:20,fill:"#ffffff"},lineHeight:35,paddingLeft:10}),this.passwordInput.background.alpha=.17,this.passwordInput.width=270,this.passwordInput.height=40,this.passwordInput.align="center",this.passwordInput.top=140,this.passwordInput.on("focusChanged",function(b){a.UI.Tween.to(this.background,.6,{alpha:b?.5:.3},a.UI.Ease.Circ.CircOut)}),this.container.addChild(this.headline,this.subHeadline,this.confirmButton,this.abortButton,this.passwordInput),this.confirmCallbackMethod=function(){},this.abortCallbackMethod=function(){}},tc.prototype.open=function(a,b,c,d){mc.prototype.open.call(this),this.headline.value=d?"WRONG PASSWORD":"ENTER PASSWORD",this.mode=c,this.server=a,this.room=b,this.passwordInput.value="",this.passwordInput.focus()},tc.prototype.close=function(){mc.prototype.close.call(this)},tc.notfication=void 0,tc.open=function(a,b,c,d){tc.notification||(tc.notification=new tc),tc.notification.open(a,b,c,d)},uc.prototype=Object.create(mc.prototype),uc.prototype.constructor=uc,uc.prototype.init=function(){mc.prototype.init.call(this);this.headline=new a.UI.DynamicText("PREMIUM FEATURE",{style:nd}),this.headline.style.tint=16568833,this.headline.horizontalAlign="center",this.headline.anchorTop=40,this.subHeadline=new a.UI.DynamicText("This is a premium feature",{style:jd}),this.subHeadline.horizontalAlign="center",this.subHeadline.anchorTop=83,this.button=new a.UI.Button({background:new a.UI.SliceSprite(lf,7,(!0),(!0)),text:new a.UI.DynamicText("UPGRADE NOW",{style:md}),width:340,height:65}),this.button.background.tint=16769075,this.button_Text=new a.UI.DynamicText(this.buttonText,{style:yd}),this.button.background.alpha=.9,this.button_Text.anchorLeft=30,this.button_Text.anchorTop=15,this.button.addChild(this.button_Text),this.button.anchorBottom=55,this.button.horizontalAlign="center",this.button.on("click",function(){pf.open(),pf.buttons.Shop.button.click(),pf.shopPage.menuButtons["PREMIUM"].click(),googa("send","event","RequirePremium","Upgrade Clicked")}),this.container.addChild(this.headline,this.subHeadline,this.button)},uc.prototype.open=function(a){mc.prototype.open.call(this),this.subHeadline.text=a?a:" "},uc.prototype.close=function(){mc.prototype.close.call(this)},uc.notfication=void 0,uc.open=function(a){uc.notfication||(uc.notification=new uc),uc.notification.open(a)},vc.prototype=Object.create(mc.prototype),vc.prototype.constructor=vc,vc.prototype.init=function(){mc.prototype.init.call(this);var b=this;this.headline=new a.UI.DynamicText("CONFIRM PURCHASE",{style:nd}),this.headline.style.tint=16568833,this.headline.horizontalAlign="center",this.headline.anchorTop=50,this.subHeadline=new a.UI.DynamicText(" ",{style:jd}),this.subHeadline.horizontalAlign="center",this.subHeadline.anchorTop=93,this.button=new a.UI.Button({background:new a.UI.SliceSprite(kf,4,(!0),(!0)),width:340,height:50}),this.button.background.tint=10666022,this.button_Text=new a.UI.DynamicText("CONFIRM",{style:yd}),this.button.background.alpha=.9,this.button_Text.anchorLeft=37,this.button_Text.anchorBottom=9,this.button.addChild(this.button_Text),this.button.anchorBottom=55,this.button.horizontalAlign="center";var c=this.priceBox=new a.UI.SliceSprite(kf,4,(!0),(!0));c.tint=5197647,c.width=150,c.height="100%",c.anchorRight=0,this.button.background.addChild(c),this.button.on("hover",function(b){a.UI.Tween.to(this.background,.4,{alpha:b?1:.9},a.UI.Ease.Circ.CircOut)}),this.button.on("click",function(){b.fn?b.fn():f.post("/Shop/BuyShopItem",{id:b.ProductID}).done(function(a){if(a.success){pf.wallet.UpdateBalance(a.currency,a.balance),d.purchaceResult(a.data)}}),b.close()}),this.container.addChild(this.headline,this.subHeadline,this.button)},vc.prototype.open=function(a,b,c,d,e){mc.prototype.open.call(this),this.fn=!!e&&e,this.subHeadline.text=c,this.ProductID=d,this.price&&this.button.removeChild(this.price),this.price=new ec(a,b).container,this.price.anchorBottom=9,this.price.anchorRight=17,this.button.addChild(this.price),this.button.focus()},vc.prototype.close=function(){mc.prototype.close.call(this)},vc.notfication=void 0,vc.open=function(a,b,c,d,e){vc.notfication||(vc.notification=new vc),vc.notification.open(a,b,c,d,e)},wc.prototype=Object.create(mc.prototype),wc.prototype.constructor=wc,wc.prototype.init=function(){mc.prototype.init.call(this);var b=this;this.headline=new a.UI.DynamicText("SALVAGE (item name)",{style:nd}),this.headline.style.tint=16568833,this.headline.horizontalAlign="center",this.headline.anchorTop=50,this.subHeadline=new a.UI.DynamicText("You will not be able to recover this item!\nAre you sure?",{style:jd,width:"100%"}),this.subHeadline.style.align="center",this.subHeadline.horizontalAlign="center",this.subHeadline.anchorTop=93,this.button=new a.UI.Button({background:new a.UI.SliceSprite(kf,4,(!0),(!0)),width:240,height:50}),this.button.background.tint=10666022,this.button_Text=new a.UI.DynamicText("CONFIRM",{style:yd}),this.button.background.alpha=.9,this.button_Text.anchorLeft=20,this.button_Text.anchorBottom=9,this.button.addChild(this.button_Text),this.button.anchorBottom=55,this.button.anchorRight=95,this.price=new ec(100,ah.Gold),this.price.container.anchorBottom=8,this.price.container.anchorRight=17,this.price.text.value="+"+this.price.text.value,this.button.addChild(this.price.container),this.button.on("hover",function(b){a.UI.Tween.to(this.background,.4,{alpha:b?1:.9},a.UI.Ease.Circ.CircOut)}),this.button.on("click",function(){b.buttonFn(),b.close()}),this.cancel=new a.UI.Button({text:new a.UI.DynamicText("CANCEL",{style:yd}),background:new a.UI.SliceSprite(kf,4,(!0),(!0)),width:150,height:50}),this.cancel.background.tint=5592405,this.cancel.background.alpha=.9,this.cancel.anchorBottom=55,this.cancel.anchorLeft=95,this.cancel.on("hover",function(b){a.UI.Tween.to(this.background,.4,{alpha:b?1:.9},a.UI.Ease.Circ.CircOut)}),this.cancel.on("click",function(){b.close()}),this.container.addChild(this.headline,this.subHeadline,this.cancel,this.button)},wc.prototype.open=function(a,b){mc.prototype.open.call(this),this.buttonFn=b,this.headline.value="SALVAGE ("+a+")",this.button.focus()},wc.prototype.close=function(){mc.prototype.close.call(this)},wc.notfication=void 0,wc.open=function(a,b){wc.notfication||(wc.notification=new wc),wc.notification.open(a,b)},xc.prototype=Object.create(mc.prototype),xc.prototype.constructor=xc,xc.prototype.init=function(){mc.prototype.init.call(this);var b=this,c=new a.UI.Container(600,90);c.anchorBottom=40,c.horizontalAlign="center";var d=a.UI.Sprite.fromFrame("UI/blank.png");d.width=d.height="100%",d.alpha=.2;var e=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Login/facebook.png")}),f=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Login/twitter.png")}),g=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Login/steam.png")}),h=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Login/google.png")}),i=new a.UI.Button({background:a.UI.Sprite.fromFrame("UI/Menu/Login/vkontakte.png")});e.method="facebook",f.method="twitter",g.method="steam",h.method="google",i.method="vkontakte",e.tint=f.tint=g.tint=h.tint=i.tint=15592941,e.y=f.y=g.y=h.y=i.y=37,e.x=16,f.x=140,g.x=248,h.x=358,i.x=468;var j=function(a){this.background.tint=a?16777215:15592941},k=function(a){this.y=a?38:37},l=function(){switch(b.close(),pf.buttons.Home.button.click(),this.method){case"facebook":dg("/Account/ExternalLogin?provider=Facebook","Facebook Login","700","600");break;case"twitter":dg("/Account/ExternalLogin?provider=Twitter","Twitter Login","900","500");break;case"steam":dg("/Account/ExternalLogin?provider=Steam","Steam Login","900","500");break;case"google":dg("/Account/ExternalLogin?provider=Google&returnUrl=/","Google Login","900","500");break;case"vkontakte":dg("/Account/ExternalLogin?provider=VKontakte","VKontakte Login","700","600")}};e.on("hover",j),f.on("hover",j),g.on("hover",j),h.on("hover",j),i.on("hover",j),e.on("press",k),f.on("press",k),g.on("press",k),h.on("press",k),i.on("press",k),e.on("click",l),
f.on("click",l),g.on("click",l),h.on("click",l),i.on("click",l),this.headline=new a.UI.DynamicText("SIGN IN",{style:nd}),this.headline.style.tint=16568833,this.headline.horizontalAlign="center",this.headline.anchorTop=40,this.subHeadline=new a.UI.DynamicText(" ",{style:jd}),this.subHeadline.horizontalAlign="center",this.subHeadline.anchorTop=83,c.addChild(d,e,f,g,h,i),this.container.addChild(this.headline,this.subHeadline,c)},xc.prototype.open=function(a){mc.prototype.open.call(this),this.subHeadline.text=a?a:" "},xc.prototype.close=function(){mc.prototype.close.call(this)},xc.notfication=void 0,xc.open=function(a){xc.notfication||(xc.notification=new xc),xc.notification.open(a)},yc.prototype=Object.create(mc.prototype),yc.prototype.constructor=yc,yc.prototype.init=function(){mc.prototype.init.call(this);var b=this;this.colorRed=16724787,this.colorGreen=14090035,this.headline=new a.UI.DynamicText(" ",{style:nd}),this.headline.style.tint=16568833,this.headline.horizontalAlign="center",this.headline.anchorTop=50,this.subHeadline=new a.UI.DynamicText(" ",{style:jd}),this.subHeadline.horizontalAlign="center",this.subHeadline.anchorTop=93,this.confirmButton=new a.UI.Button({background:new a.UI.SliceSprite(lf,7,(!0),(!0)),width:215,height:65}),this.confirmButton_Text=new a.UI.DynamicText(" ",{style:yd}),this.confirmButton.background.alpha=.9,this.confirmButton_Text.horizontalAlign="center",this.confirmButton_Text.anchorTop=15,this.confirmButton.addChild(this.confirmButton_Text),this.confirmButton.anchorBottom=55,this.confirmButton.anchorLeft=45,this.confirmButton.on("click",function(){"function"==typeof b.confirmCallbackMethod&&b.confirmCallbackMethod(),b.close()}),this.confirmButton.on("hover",function(b){a.UI.Tween.to(this.background,.4,{alpha:b?1:.9},a.UI.Ease.Circ.CircOut)}),this.abortButton=new a.UI.Button({background:new a.UI.SliceSprite(lf,7,(!0),(!0)),width:215,height:65}),this.abortButton_Text=new a.UI.DynamicText(" ",{style:yd}),this.abortButton.background.alpha=.9,this.abortButton_Text.horizontalAlign="center",this.abortButton_Text.anchorTop=15,this.abortButton.addChild(this.abortButton_Text),this.abortButton.anchorBottom=55,this.abortButton.anchorLeft=330,this.abortButton.on("click",function(){"function"==typeof b.abortCallbackMethod&&b.abortCallbackMethod(),b.close()}),this.abortButton.on("hover",function(b){a.UI.Tween.to(this.background,.4,{alpha:b?1:.9},a.UI.Ease.Circ.CircOut)}),this.container.addChild(this.headline,this.subHeadline,this.confirmButton,this.abortButton),this.confirmCallbackMethod=function(){},this.abortCallbackMethod=function(){}},yc.prototype.open=function(a,b,c,d,e,f,g,h){mc.prototype.open.call(this),this.headline.text=""+a,this.subHeadline.text=""+b,null!==e&&(this.confirmButton.background.tint=e?this.colorGreen:this.colorRed),null!==f&&(this.abortButton.background.tint=f?this.colorGreen:this.colorRed),this.confirmButton_Text.text=""+c,this.abortButton_Text.text=""+d,this.confirmCallbackMethod=g,this.abortCallbackMethod=h,this.confirmButton.focus()},yc.prototype.close=function(){mc.prototype.close.call(this)},yc.notfication=void 0,yc.open=function(a,b,c,d,e,f,g,h){yc.notfication||(yc.notification=new yc),yc.notification.open(a,b,c,d,e,f,g,h)};var Yh={1:{name:"Tankwars",modes:{0:"KingDM",1:"Conquest"}}},Zh={propertyName:{UserData:{FriendID:"FriendID",Username:"Username",Email:"Email",Avatar:"Avatar",AvatarType:"AvatarType",AcceptFriendRequests:"AcceptFriendRequests",LoginMethods:"LoginMethods"}},onAuthenticatedFunctions:[],onAuthenticated:function(a){"function"==typeof a&&(this.onAuthenticatedFunctions.push(a),this.authenticated&&a())},onDataFunctions:[],onData:function(a){"function"==typeof a&&this.onDataFunctions.push(a)},onLogoutFunctions:[],onLogout:function(a){"function"==typeof a&&this.onLogoutFunctions.push(a)},authenticated:!1,data:{friendID:"",username:"",email:"",avatar:"",avatarType:0,acceptFriendRequests:!1,loginMethods:{Facebook:!1,Steam:!1,Google:!1,Twitter:!1,VKontakte:!1}},Authenticate:function(a){f.ajax({url:"/Account/handshake",statusCode:{403:function(){Zh.Logout()}}}).done(function(b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=b[6],j=b[7],k=b[8],l=b[9],m=b[10],o=b[11],p=b[12],r=b[13],s=b[14],t=b[15],u=b[16];Dd.friendID=c,Dd.friendsReferred=o,Dd.XPSystem.SetExperience(m),Dd.Connection.gameToken=e,Dd.Connection.gameTokenExpiration=n.now()+f,ng.Load(g,h,j,k,l,i,r,s,t,u),a?Dd.initCallback(function(){Dd.Connection.Connect(Dd.selectedGM,1e3)}):Dd.Connection.invoke("IdentityChange",q(c),e),Zh.authenticated=!0,$h.connect(d);for(var v=0;v<Zh.onAuthenticatedFunctions.length;v++)Zh.onAuthenticatedFunctions[v]();p||Dd.NewUser.ShowRegistration(),Dd.clearReferralData(),Hf.init()})},initAuthUserData:function(a){this.data["friendID"]=a[this.propertyName.UserData.FriendID],this.data["username"]=a[this.propertyName.UserData.Username],this.data["email"]=a[this.propertyName.UserData.Email],this.data["avatar"]=a[this.propertyName.UserData.Avatar],this.data["avatarType"]=a[this.propertyName.UserData.AvatarType],this.data["acceptFriendRequests"]=a[this.propertyName.UserData.AcceptFriendRequests],this.data["loginMethods"]=a[this.propertyName.UserData.LoginMethods],this.updateUiValues()},Logout:function(){Dd.Connection.gameToken="",Dd.Connection.gameTokenExpiration=0,$h.disconnect(),this.clearAuth(),ng.Clear(),f.ajax({url:"/Account/LogOff"}).done(function(){Dd.Connection.invoke("IdentityChange",0,"")});for(var a=0;a<Zh.onLogoutFunctions.length;a++)Zh.onLogoutFunctions[a]();Hf.init()},clearAuth:function(){this.data["username"]=this.data["email"]=this.data["avatar"]="",this.data["friendID"]=this.data["avatarType"]=0,this.data["acceptFriendRequests"]=!1,this.authenticated=!1,Dd.friendID=this.data["friendID"],Dd.friendsReferred=0,Dd.XPSystem.SetExperience(0),this.updateUiValues()},NewLoginMethodInformation:function(a){this.data["loginMethods"]=a,this.updateUiValues()},updateUiValues:function(a){for(var b=0;b<this.onDataFunctions.length;b++)this.onDataFunctions[b]()}},$h={_onConnectFunction:[],onConnect:function(a){this._onConnectFunction.push(a)},CommunicationToken:void 0,propertyName:{WelcomeData:{UserData:"UserData",FriendList:"FriendList"}},server:new Internal.SocketConnection,initialize:function(){if(!this.initialized){var a=this.server;a.onOpen(function(){ni.clear(),$h.server.invoke("Connect",$h.CommunicationToken)}),a.on("ConnectCompleted",function(a){Zh.initAuthUserData(a[$h.propertyName.WelcomeData.UserData]);for(var b=0;b<$h._onConnectFunction.length;b++)$h._onConnectFunction[b]();ai.initFriendList(a[$h.propertyName.WelcomeData.FriendList])}),a.on("NewFriendList",function(a){ai.initFriendList(a)}),a.on("UpdateFriend",function(a){ai.updateFriendStatus(a),ai.sort()}),a.on("FriendDeleted",function(a){ai.removeFriend(a)}),a.on("FriendBlocked",function(a){ai.blockFriend(a),ai.sort()}),a.on("FriendUnblocked",function(a){var b=ai.blockedFriends.indexOf(a["FriendID"]);b>-1&&ai.blockedFriends.splice(b,1),ai.updateFriendStatus(a),ai.sort()}),a.on("FriendRequestSend",function(a,b){di.confirmRequest(a,b)}),a.on("FriendRequestReceived",function(a){var b=ai.updateFriendStatus(a,!0,!0);pf.isOpen||new Zb("New Friend Invite",b.Name).addButton("Show Friends",200,5592405,function(){pf.openSubMenu(pf.homePage)}).show(5e3)}),a.on("AddNewFriend",function(a){ai.updateFriendStatus(a,!1,!0)}),a.on("DeclineFriendRequest",function(a){ai.removeFriend(a)}),a.on("ReceiveMessage",function(a,b,c,d){ei.receiveMessage(a,b,c,d)}),a.on("FriendSearchResult",function(a){di.loadPeople(a)}),a.on("UserSettingUpdated",function(a,b,c){c&&(Zh.data[a]=b,Zh.updateUiValues())}),a.on("NewUserAvatar",function(a){Zh.data["avatar"]=a,Zh.updateUiValues()}),a.on("RemoveExternalLoginCallback",function(a,b){Zh.data["loginMethods"][a]=!b,b||qf.OK("You must have at least one loginmethod attached to your Account!",!1)}),a.on("NewLoginMethodInformation",function(a){Zh.NewLoginMethodInformation(a)}),a.on("ServerForceLogout",function(){Zh.Logout()}),a.on("ServerNotifyMsg",function(a,b,c){nc.open(a,b,c)}),a.on("ReceivePartyInvite",function(a,b,c,d){li.ReceiveInvite(a,b,c,d)}),a.on("JoinParty",function(a,b,c){ki.initParty(a,b,c)}),a.on("AddPartyMember",function(a){ki.addPartyMember(a,!0)}),a.on("RemovePartyMember",function(a){ki.removePartyMember(a)}),a.on("SetPartyLeader",function(a){ki.setPartyLeader(a)}),a.on("PartyGamePrompt",function(a,b,c,d,e){mi.ReceiveGamePrompt(a,b,c,d,e)}),a.on("JoinChannel",function(a,b,c){ni.initChannel(a,b,c)}),a.on("AddChannelMember",function(a,b){ni.addChannelMember(a,b)}),a.on("RemoveChannelMember",function(a,b){ni.removeChannelMember(a,b)}),a.on("ReceiveChannelMessage",function(a,b,c){ni.receiveMessage(a,b,c)}),this.initialized=!0}},connect:function(a){this.CommunicationToken=a,this.initialize(),this.server.connect(d["CommsServer"])},disconnect:function(){this.server.disconnect()}};$h.friendListEvents={blockFriend:function(a){a&&$h.server.invoke("BlockFriend",q(a))},unblockFriend:function(a){a&&$h.server.invoke("UnblockFriend",q(a))},removeFriend:function(a){a&&$h.server.invoke("RemoveFriend",q(a))},sendMessage:function(a,b){b=b.trim(),a&&""!==b&&$h.server.invoke("SendMessage",q(a),b)},sendFriendRequest:function(a){a&&$h.server.invoke("SendFriendRequest",q(a))},declineFriendRequest:function(a){a&&$h.server.invoke("DeclineFriendRequest",q(a))},acceptFriendRequest:function(a){a&&$h.server.invoke("AcceptFriendRequest",q(a))},findFriends:function(a){a.length>0?$h.server.invoke("FindFriends",a):di.loadPeople([])}},$h.SettingsEvents={UpdateUserSetting:function(a,b){a&&void 0!==b&&$h.server.invoke("UpdateUserSetting",a,b)},RemoveExternalLogin:function(a){a&&$h.server.invoke("RemoveExternalLogin",a)},GetNewLoginMethodInformation:function(){$h.server.invoke("GetNewLoginMethodInformation")},DeleteUser:function(){$h.server.invoke("DeleteUser")}},$h.PartyEvents={SendPartyInvite:function(a){a&&$h.server.invoke("SendPartyInvite",a,$h.CurrentGame)},AcceptPartyInvite:function(a){a&&$h.server.invoke("AcceptPartyInvite",a)},DeclinePartyInvite:function(a){a&&$h.server.invoke("DeclinePartyInvite",a)},LeaveParty:function(a){a&&$h.server.invoke("LeaveParty",a)},SetPartyLeader:function(a,b){a&&b&&$h.server.invoke("SetPartyLeader",a,b)},KickPartyMember:function(a,b){a&&b&&$h.server.invoke("KickPartyMember",a,b)}},$h.ChannelEvents={SendMessage:function(a,b){b&&$h.server.invoke("SendChannelMessage",a,b)}},$h.CurrentGame=1;var _h={None:0,Invite:1,Ingame:2,Online:3,Offline:4,Blocked:5};zc.prototype=Object.create(a.utils.EventEmitter.prototype),zc.prototype.constructor=zc,Ac.prototype=Object.create(a.utils.EventEmitter.prototype),Ac.prototype.constructor=Ac;var ai=new Ac,bi={propertyName:{FriendList:{BlockedFriends:"BlockedFriends",Friends:"Friends",FriendInvites:"FriendInvites"},Friend:{FriendID:"FriendID",Online:"Online",LastOnline:"LastOnline",Name:"Name",Server:"Server",Avatar:"Avatar"}},blockedFriends:[],open:function(){},close:function(){},init:function(){f("#friend_search").on("input",function(a){bi.findFriends(f(this).val())}).on("keyup",function(a){if(27===a.keyCode)return f("#friends").find(".friend").show(),f("#friend_search").val("").blur(),a.preventDefault(),!1}),v(function(){bi.updateLastOnline()},6e4),f("#add_friend").click(function(){di.open()})},arrangeFriends:function(){f("#friends").find(".friend_status_ingame").appendTo("#friends"),f("#friends").find(".friend_status_online").appendTo("#friends"),f("#friends").find(".friend_status_offline").appendTo("#friends"),f("#friends").find(".friend_status_blocked").appendTo("#friends")},CreateFriendHtml:function(a){var b=f("<div class='friend'>"),c=f("<div class='icon'>");c.append("<img src=''>");var d=f("<div class='info'>");return d.append("<span class='name'></span>"),d.append("<span class='status'></span>"),d.append("<span class='mode'></span>"),b.append(c),b.append(d),a?f("#friends").prepend(b):f("#friends").append(b),b.mousedown(function(a){return 2!==a.button||(ci.open(f(this).data("friend_id")),!1)}),b.dblclick(function(){ei.startConversation(b,!0)}),b},initFriendList:function(a){return},addNewFriend:function(a){var b=a[this.propertyName.Friend.FriendID];f("#friendInvite_"+b).remove(),f("#friend_"+b).remove(),friendContainer=this.CreateFriendHtml(!0),friendContainer.attr("id","friend_"+b),this.updateFriendStatus(a),this.arrangeFriends()},declineFriendRequest:function(a){f("#friendInvite_"+a).remove()},deleteFriend:function(a){f("#friend_"+a).remove()},blockFriend:function(a){this.blockedFriends.push(a),f("#friend_"+a).data("friend_blocked",!0),this.updateFriendStatus(!1,!0,a)},AppendFriendRequest:function(a,b){var c=a[this.propertyName.Friend.FriendID],d=a[this.propertyName.Friend.Name],e=a[this.propertyName.Friend.Avatar],g=f("<div class='friend friend_request'>"),h=f("<div class='icon'>");h.append("<img src='"+Dc(e)+"'>");var i=f("<div class='info'>"),j=f("<span class='name'>");j.text(d),i.append(j);var k=f("<div class='accept'>ACCEPT</div>"),l=f("<div class='decline'>DECLINE</div>");g.append(h).append(i).append(k).append(l),g.attr("id","friendInvite_"+c),f("#friend_invites").append(g),k.click(function(){$h.friendListEvents.acceptFriendRequest(c)}),l.click(function(){$h.friendListEvents.declineFriendRequest(c)}),b&&(g.hide(),g.show(200))},ReceiveFriendRequest:function(a){this.AppendFriendRequest(a,!0)},updateFriendStatus:function(a,b,c){var d;if(a){var e=a[this.propertyName.Friend.FriendID],g=a[this.propertyName.Friend.Online],h=a[this.propertyName.Friend.LastOnline],i=a[this.propertyName.Friend.Name],j=a[this.propertyName.Friend.Server],k=a[this.propertyName.Friend.Avatar];if(d=f("#friend_"+e),!d.length)return this.addNewFriend(a);d.data("friend_id",e),d.data("friend_online",g),d.data("friend_lastonline",h),d.data("friend_name",i),d.data("friend_server",j),d.data("friend_avatar",k)}else{if(void 0===c)return;d=f("#friend_"+c)}var l=this.blockedFriends.indexOf(d.data("friend_id"))!==-1;if(d.data("friend_blocked",l),d.length!==-1)if(d.removeClass("friend_status_ingame"),d.removeClass("friend_status_online"),d.removeClass("friend_status_offline"),d.removeClass("friend_status_blocked"),d.find(".name").text(d.data("friend_name")),d.find(".icon").find("img").attr("src",d.data("friend_avatar")),l)d.data("friend_status_class","friend_status_blocked"),d.addClass("friend_status_blocked"),d.find(".status").text("Blocked"),d.find(".mode").text("");else if(null!==d.data("friend_server")&&d.data("friend_server").length>0){var m=d.data("friend_server").split(","),n=m[0],o=m[1];d.data("friend_status_class","friend_status_ingame"),d.addClass("friend_status_ingame"),d.find(".status").text("In-Game ("+Yh[n].name+")"),d.find(".mode").text(Yh[n].modes[o])}else d.data("friend_online")?(d.data("friend_status_class","friend_status_online"),d.addClass("friend_status_online"),d.find(".status").text("Online"),d.find(".mode").text("")):(d.data("friend_status_class","friend_status_offline"),d.addClass("friend_status_offline"),d.find(".mode").text(""),this.updateLastOnline(d));b&&this.arrangeFriends();var p=ei.checkFriendChatWindow(e);p&&ei.setFriendInfo(d,p),f("#chat_tab_"+e).find(".name").text(i)},updateLastOnline:function(a){if(!a)return void f(".friend").each(function(){bi.updateLastOnline(f(this))});if(!a.data("friend_online")){var b="",c=a.data("friend_lastonline"),d=(new o).getTime(),e=(d-c)/1e3,g=e/60,h=g/60,i=h/24,j=i/7,l=j/30.4167,m=l/12;b=m>2?k.floor(m)+" years ago":m>1?"1 year ago":l>2?k.floor(l)+" months ago":l>1?"1 month ago":j>2?k.floor(j)+" weeks ago":j>1?"1 week ago":i>2?k.floor(i)+" days ago":i>1?"1 day ago":h>2?k.floor(h)+" hours ago":h>1?"1 hour ago":g>2?k.floor(g)+" minutes ago":"1 minute ago",a.find(".status").text("Last Online: "+b)}},findFriends:function(a){f(".friend .info .name:notcontains('"+a+"')").closest(".friend").hide(),f(".friend .info .name:contains('"+a+"')").closest(".friend").show()}},ci={container:f("#friend_context_menu"),isOpen:!1,selectedFriendID:0,options:{MuteGameChat:f('<div class="context_menu_item">Mute Game Chat</div>'),UnmuteGameChat:f('<div class="context_menu_item">Unmute Game Chat</div>'),SendMessage:f('<div class="context_menu_item">Send Message</div>'),ViewProfile:f('<div class="context_menu_item">View Profile</div>'),JoinGame:f('<div class="context_menu_item">Join Game</div>'),InviteParty:f('<div class="context_menu_item">Invite to Party</div>'),GivePartyLeader:f('<div class="context_menu_item">Give Party Leader</div>'),KickParty:f('<div class="context_menu_item">Kick from Party</div>'),BlockCommunication:f('<div class="context_menu_item">Block Communication</div>'),RemoveFriend:f('<div class="context_menu_item">Remove Friend</div>'),AddFriend:f('<div class="context_menu_item">Add Friend</div>'),Breaker1:f('<div class="context_menu_breaker" id="friendcontext_message_breaker"><hr /></div>'),Breaker2:f('<div class="context_menu_breaker" id="friendcontext_message_breaker"><hr /></div>')},insertBreaker:function(){this.container.append(f())},mouseDownFn:function(a){if(ci.isOpen){var b=f("#friend_context_menu");b.is(a.target)||0!==b.has(a.target).length||ci.close()}},init:function(){this.options.MuteGameChat.click(function(){oi.add(ci.selectedFriendID),ci.close()}),this.options.UnmuteGameChat.click(function(){oi.remove(ci.selectedFriendID),ci.close()}),this.options.SendMessage.click(function(){pf.isOpen||pf.openMainMenu(),ei.startConversation(ai.getFriend(ci.selectedFriendID),!0),ci.close()}),this.options.ViewProfile.click(function(){pf.isOpen||pf.open(),pf.profilePage.open(ci.selectedFriendID),ci.close()}),this.options.JoinGame.click(function(){pf.isOpen||pf.close();var a=ai.getFriend(ci.selectedFriendID),b=a.Server.split(","),c=b[1],d=b[2],e=b[3];1===q(b[4]);1===q(b[5])?tc.open(d,e,c):Dd.Connection.ConnectServer(d,e,c),ci.close()}),this.options.InviteParty.click(function(){$h.PartyEvents.SendPartyInvite(ci.selectedFriendID),ci.close()}),this.options.GivePartyLeader.click(function(){$h.PartyEvents.SetPartyLeader(ki.id,ci.selectedFriendID),ci.close()}),this.options.KickParty.click(function(){$h.PartyEvents.KickPartyMember(ki.id,ci.selectedFriendID),ci.close()}),this.options.AddFriend.click(function(){$h.friendListEvents.sendFriendRequest(ci.selectedFriendID),ci.close()}),this.options.BlockCommunication.on("click",function(){var a=ai.getFriend(ci.selectedFriendID);a.Blocked?$h.friendListEvents.unblockFriend(a.FriendID):$h.friendListEvents.blockFriend(a.FriendID),ci.close()}),this.options.RemoveFriend.click(function(){var a=ai.getFriend(ci.selectedFriendID);qf.YesNo("Are you sure you want to remove <b>"+a.Name+"</b> from your friends list?",!0,function(){$h.friendListEvents.removeFriend(a.FriendID)}),ci.close()}),this.options.MuteGameChat.appendTo(this.container),this.options.UnmuteGameChat.appendTo(this.container),this.options.SendMessage.appendTo(this.container),this.options.ViewProfile.appendTo(this.container),this.options.AddFriend.appendTo(this.container),this.options.Breaker1.appendTo(this.container),this.options.JoinGame.appendTo(this.container),this.options.InviteParty.appendTo(this.container),this.options.GivePartyLeader.appendTo(this.container),this.options.KickParty.appendTo(this.container),this.options.Breaker2.appendTo(this.container),this.options.BlockCommunication.appendTo(this.container),this.options.RemoveFriend.appendTo(this.container)},open:function(a,b){this.isOpen&&this.close(),r.addEventListener("pointerdown",ci.mouseDownFn),this.options.MuteGameChat.hide(),this.options.UnmuteGameChat.hide(),this.options.SendMessage.hide(),this.options.AddFriend.hide(),this.options.Breaker1.hide(),this.options.JoinGame.hide(),this.options.InviteParty.hide(),this.options.GivePartyLeader.hide(),this.options.KickParty.hide(),this.options.Breaker2.hide(),this.options.BlockCommunication.hide(),this.options.RemoveFriend.hide(),this.selectedFriendID=a;var c=ai.getFriend(a),d=a==Zh.data["friendID"],e=null!=c&&c.FriendInvite,f=null!=c&&!e,g=!!f&&c.Blocked;this.options.BlockCommunication.text(g?"Unblock Communication":"Block Communication");var h=!d&&b&&!oi.contains(this.selectedFriendID),i=!d&&b&&oi.contains(this.selectedFriendID),j=f&&!g,k=j,l=f&&!g&&c.Server&&c.Server.length>0,m=f&&!g&&!ki.Members[this.selectedFriendID],n=ki.isLeader&&ki.Members[this.selectedFriendID],o=n,p=l||m||n||o,q=f,s=!f&&!d&&!e,t=f;h&&this.options.MuteGameChat.show(),i&&this.options.UnmuteGameChat.show(),j&&this.options.SendMessage.show(),k&&this.options.Breaker1.show(),l&&this.options.JoinGame.show(),m&&this.options.InviteParty.show(),n&&this.options.GivePartyLeader.show(),o&&this.options.KickParty.show(),p&&this.options.Breaker2.show(),q&&this.options.BlockCommunication.show(),t&&this.options.RemoveFriend.show(),s&&this.options.AddFriend.show(),this.isOpen=!0,this.container.hide(),$e.positionMouseBottomRight(this.container),this.container.show(150)},close:function(){this.isOpen&&(r.removeEventListener("pointerdown",ci.mouseDownFn),this.isOpen=!1,this.selectedFriendID=0,this.container.hide())}};ci.init();var di={propertyName:{Person:{Username:"Username",FriendID:"FriendID",Avatar:"Avatar",Pending:"Pending",Friends:"Friends"}},container:void 0,resultContainer:void 0,input:void 0,lastKeyword:"",initialized:!1,init:function(){this.container=f("<div class='window friend_search' id='friend_search'>");var a=f("<div class='close'>"),b=f("<div class='title'>FIND A FRIEND</div>"),c=f("<div class='input_container'>");this.input=f("<input type='text' placeholder='Friend Id / Name' class='friend_search_input' maxlength='30'>");var d=f("<div class='friend_search_button'>Search</div>");this.resultContainer=f("<div class='friend_search_result'>"),c.append(this.input).append(d),this.container.append(a).append(b).append(c).append(this.resultContainer),f("#windowUI").append(this.container),a.click(function(){di.container.hide()}),this.container.draggable({scroll:!1,cancel:".close, input"}),this.container.resizable({handles:"all",minHeight:250,minWidth:320,maxHeight:800,maxWidth:500}),$e.monitorPosition(this.container),this.container.mousedown(function(){$e.bringToTop(f(this))}),d.click(function(){var a=di.input.val().trim();a!==di.lastKeyword&&di.search(a)}),this.input.keydown(function(a){return 13!==a.keyCode||(d.click(),!1)}),this.initialized=!0},open:function(){this.initialized||this.init(),$e.bringToTop(this.container),$e.positionMouseTopLeft(this.container),this.lastKeyword="",this.resultContainer.empty(),this.input.val(""),this.container.fadeIn(100),this.input.focus()},loadPeople:function(a){if(this.resultContainer.empty(),!a.length){var b=f("<div class='no_result'><b>Sorry!</b><br /> We didn't find any friends matching your search.</div>");return this.resultContainer.append(b),void b.fadeIn(350)}var c=f("<div>");c.hide(),this.resultContainer.append(c),f.each(a,function(a,b){var d=f("<div class='search_result' id='search_result_"+b[di.propertyName.Person.FriendID]+"'>"),e=f("<div class='avatar'>"),g=f("<img src='"+Dc(b[di.propertyName.Person.Avatar])+"' />"),h=f("<div class='name'>"),i=f("<div class='friendid'>FRIEND ID: <span class='id'>"+b[di.propertyName.Person.FriendID]+"</span></div>"),j=f("<div class='status'>");e.append(g),h.text(b[di.propertyName.Person.Username]),d.append(e).append(h).append(i).append(j),b[di.propertyName.Person.Pending]?(j.addClass("pending"),j.append("Pending Friend Request")):b[di.propertyName.Person.Friends]?(j.addClass("isfriend"),j.append("Already Friends")):(j.addClass("button"),j.append("Add Friend"),j.click(function(){$h.friendListEvents.sendFriendRequest(b[di.propertyName.Person.FriendID])})),c.append(d)}),c.fadeIn(350)},search:function(a){this.resultContainer.empty();var b=f("<img src='/Scripts/Communication/gfx/ajax-loader.gif' class='loading' />");this.resultContainer.append(b),b.fadeIn(500),$h.friendListEvents.findFriends(a),this.lastKeyword=a},confirmRequest:function(a,b){if(!b)return void qf.OK("Sorry, this user does't accept friend requests!",!0);var c=f("#search_result_"+a).find(".status");c.attr("class","status pending"),c.text("Pending Friend Request"),c.unbind("click")}},ei={conversations:{},buildFriendTab:function(a){var b=f("<div class='chat_tab'>"),c=f("<div class='icon'>"),d=f("<div class='name'>");return b.attr("id","chat_tab_"+a.FriendID),d.text(a.Name),b.append(d),b.append(c),b.click(function(){b.hasClass("active_tab")||ei.focusConversation(a)}),b.mousedown(function(b){if(2==b.which)return ei.closeConversation(a),b.preventDefault(),!1}),b.draggable({delay:150,scroll:!1,appendTo:"body",connectToSortable:".chat_tabs",revertDuration:0,revert:function(a){return a?f(this).data("valid_drop",!0):f(this).data("valid_drop",!1),!0},stop:function(){var a=f(this).data("valid_drop"),b=f(this).attr("id").replace("chat_tab_",""),c=ai.getFriend(b);if(!a){ei.closeConversation(c);ei.startConversation(c,!0,!0).css({top:Dd.Camera.mousePosition.y-15,left:Dd.Camera.mousePosition.x-30})}ei.focusConversation(c),f(".chat").each(function(){ei.checkFocusedOrClose(f(this))})}}),b},buildchatWindow:function(){var a=f("<div class='chat window'>"),b=f("<div class='chat_tabs'>"),c=f("<div class='close'>"),e=f("<div class='chat_friend_container'>"),g=f("<div class='chat_window_wrapper'>"),h=f("<div class='chat_message' contentEditable='true' hidefocus='true'>"),i=f("<div class='chat_button chat_emoji'>:)</div>"),j=f("<div class='chat_button chat_send_message'>SEND</div>");a.append(b).append(c).append(e).append(g).append(h).append(i).append(j);var k=f("<div class='show_all_tabs'>▼</div>");b.append(k);var l=f("<div class='chat_window_relative'>"),m=f("<div class='chat_window'>");g.append(l),l.append(m);var n=f("<div class='friend_info'>");e.append(n);var o=f("<div class='friend_icon'>"),p=f("<div class='friend_name'>"),q=f("<div class='friend_status'>"),s=f("<div class='friend_mode'>");n.append(o).append(p).append(q).append(s),a.draggable({scroll:!1,cancel:".chat_message, .close, .chat_button, .chat_tab, .message"});var t=a.find(".chat_window");return a.resizable({handles:"all",minHeight:250,minWidth:350,maxHeight:700,maxWidth:1e3,resize:function(){t.scrollTop(5*t[0].scrollHeight),ei.arrangeTabs(f(this))}}),i.click(function(){ji.open()}),k.click(function(){gi.open(a)}),$e.monitorPosition(a),a.mousedown(function(){$e.bringToTop(f(this))}),b.sortable({cancel:".show_all_tabs",connectWith:".cars",revert:!1,revertDuration:0}),h.on("input",function(){var b=ai.getFriend(a.data("active_friend_id"));b&&(b.unsend_message=h.text())}).on("keydown",function(a){return!(13==a.keyCode&&!a.shiftKey)||(j.click(),a.preventDefault(),!1)}).on("keyup",function(a){if(27==a.keyCode)return f(this).html("").blur(),a.preventDefault(),!1}).on("paste",function(a){a.preventDefault(),r.execCommand("insertHTML",!1,((a.originalEvent||a).clipboardData||d.clipboardData).getData("Text").replace(/(?:\r\n|\r|\n)/g,"<br />"))}),j.click(function(){ei.sendMessage(a.data("active_friend_id"),h.text()),h.text("")}),c.click(function(){ei.close(a)}),f("#windowUI").append(a),$e.bringToTop(a),a.fadeIn(200),a},getchatWindow:function(a){if(f(".chat").length&&!a)return f(".chat.focus").length?f(".chat.focus").first():f(".chat").first();var b=this.buildchatWindow();return b.css({top:k.max(Dd.Camera.mousePosition.y-450,0),left:k.max(Dd.Camera.mousePosition.x-450,0)}),b},startConversation:function(a,b,c,d){var e,g,h=a.FriendID;return f("#chat_tab_"+h).length?(g=f("#chat_tab_"+h),e=g.closest(".chat")):(e=this.getchatWindow(c),g=this.buildFriendTab(a),e.find(".chat_tabs").append(g),d||(b=!0)),b&&this.focusConversation(a),this.checkFocusedOrClose(e),e},focusConversation:function(a){var b,c,d=a.FriendID;f("#chat_tab_"+d).length||this.startConversation(a),c=f("#chat_tab_"+d),b=c.closest(".chat"),this.setFriendInfo(a,b),b.find(".chat_tab").removeClass("active_tab"),c.addClass("active_tab"),c.removeClass("alert"),b.data("active_friend_id",d),a.unsend_message?b.find(".chat_message").text(a.unsend_message):b.find(".chat_message").text(""),b.find(".chat_message").focus(),this.loadConversation(b,d),$e.bringToTop(b)},closeConversation:function(a){var b,c=a.FriendID,d=f("#chat_tab_"+c);if(d.length){b=d.closest(".chat");d.hasClass("active_tab");d.remove();b.find(".chat_tab");this.checkFocusedOrClose(b)}},checkFriendChatWindow:function(a){var b=!1;return f(".chat").each(function(){if(f(this).data("active_friend_id")==a)return b=f(this),!1}),b},checkFocusedOrClose:function(a){if(this.arrangeTabs(a),!a.find(".active_tab").length){var b=a.find(".chat_tab");if(b.length){var c=b.first().attr("id").replace("chat_tab_",""),d=ai.getFriend(c);d&&this.focusConversation(d)}else this.close(a)}},setFriendInfo:function(a,b){b.find(".chat_friend_container").attr("class","chat_friend_container"),b.find(".friend_icon").html("<img src='"+Dc(a.Avatar)+"'>"),b.find(".friend_name").text(a.Name),b.find(".friend_status").text(a.Status),b.find(".chat_friend_container").addClass(a.StatusClass)},arrangeTabs:function(a){var b=a.find(".chat_tab"),c=a.find(".chat_tabs"),d=a.find(".show_all_tabs");b.show(),d.show(),d.appendTo(c);var e=d.position().left+23,f=c.width();if(!c.is(":visible")||e<=f)d.hide();else for(;e>f;)c.find(".chat_tab:not(.active_tab):visible:last").hide(),e=d.position().left+23},close:function(a){a.remove()},loadConversation:function(a,b){if(a&&a.find(".chat_window").empty(),!this.conversations[b]){if("undefined"!=typeof Storage){var c=Zh.data["friendID"]+b;this.conversations[b]=localStorage.getObject(c)}this.conversations[b]||(this.conversations[b]={messages:[]})}if(a){var d=this.conversations[b];if(d)for(var e=0;e<d["messages"].length;e++)ei.addMessageToWindow(a,d["messages"][e])}},addMessageToWindow:function(a,b){var c,d=a.find(".chat_window"),e=a.find(".message").last();e.hasClass("message_me")&&b.me||e.hasClass("message_not_me")&&!b.me?c=e:(c=f("<div class='message selectable'>"),c.addClass(b.me?"message_me":"message_not_me"),d.append(c));var g=f("<p>"),h=b.message,i=RegExp(";","ig");h=h.replace(i,"[;]"),g.text(h),h=g.html();for(var j=0;j<hi.length;j++){var k=hi[j],i=RegExp(Bc(k.trigger),"ig");h=h.replace(i,'<img alt="'+k.trigger+'" src="/Scripts/Communication/emoji/'+k.filename+'" class="emoji">')}var i=RegExp(Bc("[;]"),"ig");h=h.replace(i,";"),g.html(h),c.append(g),d.scrollTop(5*d[0].scrollHeight)},sendMessage:function(a,b){var c=ai.getFriend(a);c&&(c.unsend_message="",$h.friendListEvents.sendMessage(a,b))},receiveMessage:function(a,b,c,d){var e=ai.getFriend(a);if(e){var g=new fi(b,c,d);if(this.conversations[a]||this.loadConversation(!1,a),this.conversations[a].messages.push(g),"undefined"!=typeof Storage){var h=Zh.data["friendID"]+a;this.conversations[a].messages.length>30&&this.conversations[a].messages.splice(0,this.conversations[a].messages.length-30),localStorage.setObject(h,this.conversations[a])}var i=this.checkFriendChatWindow(a);i?this.addMessageToWindow(i,g):this.startConversation(e,!1,!1,!0);var j;if(!c&&(j=f("#chat_tab_"+a),!j.hasClass("active_tab")&&(j.addClass("alert"),!j.is(":visible")))){var i=j.closest(".chat");j.prependTo(j.parent()),this.arrangeTabs(i),j.insertAfter(j.parent().find(".chat_tab:not(.active_tab):visible:last"))}if(!pf.isOpen){new Zb("Message from "+e.Name,b).addButton("Open Chat",200,5592405,function(){j&&j.click(),pf.open()}).show(5e3)}}}},fi=function(a,b,c){this.time=c||(new o).getTime(),this.me=b,this.message=a},gi={isOpen:!1,selectedFriendID:0,initialized:!1,container:f("#chat_context_menu"),init:function(){this.initialized=!0,f(r).mousedown(function(a){gi.isOpen&&(gi.container.is(a.target)||0!==gi.container.has(a.target).length||gi.close())})},open:function(a){this.initialized||this.init(),this.container.empty(),a.find(".chat_tab").each(function(){var b=f(this),c=f("<div class='context_menu_item'>");c.text(b.text()),c.click(function(){b.click(),ei.arrangeTabs(a),gi.close()}),gi.container.append(c)}),this.isOpen=!0,f("#chat_context_menu").hide(),$e.positionMouseBottomRight(f("#chat_context_menu")),f("#chat_context_menu").show(150)},close:function(){this.isOpen=!1,f("#chat_context_menu").hide()}},hi=[],ii=function(a,b){this.filename=a,this.trigger=b};hi.push(new ii("1f642.png",":)")),
hi.push(new ii("2639.png",":(")),hi.push(new ii("1f603.png",":d")),hi.push(new ii("1f606.png","[;]d")),hi.push(new ii("1f61d.png",":P")),hi.push(new ii("1f609.png","[;])")),hi.push(new ii("1f602.png","[lol]")),hi.push(new ii("1f62d.png",":'(")),hi.push(new ii("1f611.png",":|")),hi.push(new ii("1f632.png",":o")),hi.push(new ii("1f634.png","[sleepy]")),hi.push(new ii("1f60e.png","8)")),hi.push(new ii("1f2234.png","[thinking]")),hi.push(new ii("1f633.png","[embarrassed]")),hi.push(new ii("1f644.png","[rollseyes]")),hi.push(new ii("1f917.png","[hug]")),hi.push(new ii("1f60d.png","[inlove]")),hi.push(new ii("1f608.png","[devil]")),hi.push(new ii("1f635.png","[dead]")),hi.push(new ii("1f910.png","[zipper]")),hi.push(new ii("1f912.png","[sick]")),hi.push(new ii("1f3a9.png","[hat]")),hi.push(new ii("1f3b1.png","[eightball]")),hi.push(new ii("1f4a9.png","[poo]")),hi.push(new ii("1f31e.png","[sun]")),hi.push(new ii("1f42a.png","[camel]")),hi.push(new ii("1f42d.png","[mouse]")),hi.push(new ii("1f42f.png","[tiger]")),hi.push(new ii("1f43c.png","[panda]")),hi.push(new ii("1f43b.png","[bear]")),hi.push(new ii("1f428.png","[koala]")),hi.push(new ii("1f431.png","[cat]")),hi.push(new ii("1f434.png","[horse]")),hi.push(new ii("1f437.png","[pig]")),hi.push(new ii("1f981.png","[lion]")),hi.push(new ii("1f984.png","[unicorn]")),hi.push(new ii("262e.png","[hippie]")),hi.push(new ii("1f3fc.png","[peace]")),hi.push(new ii("262f.png","[jinjang]"));var ji={isOpen:!1,selectedFriendID:0,initialized:!1,container:f("#chat_context_menu_emoji"),init:function(){this.initialized=!0,f(r).mousedown(function(a){ji.isOpen&&(ji.container.is(a.target)||0!==ji.container.has(a.target).length||ji.close())}),f.each(hi,function(a,b){var c=b.trigger,d=f('<img alt="'+b.trigger+'" src="/Scripts/Communication/emoji/'+b.filename+'" class="emoji">');d.click(function(){Cc(c.replace("[;]",";")),ji.close()}),ji.container.append(d)});for(var a=0;a<hi.length;a++);},open:function(){this.initialized||this.init(),this.isOpen=!0,$e.positionMouseBottomRight(f("#chat_context_menu_emoji")),f("#chat_context_menu_emoji").show()},close:function(){this.isOpen=!1,f("#chat_context_menu_emoji").hide()}},ki={id:void 0,Members:{},isLeader:!1,initialized:!1,init:function(){this.initialized=!0,f("#leave_party").click(function(){ki.leaveParty()})},getMemberIdList:function(){var a=[];for(var b in this.Members){a.push(this.Members[b][bi.propertyName.Friend.FriendID])}return a},initParty:function(a,b,c){this.initialized||this.init(),this.resetParty(),this.id=a;for(var d=0;d<b.length;d++)this.addPartyMember(b[d],!1);this.setPartyLeader(c)},resetParty:function(){this.isLeader=!1,this.id=void 0,this.Members={}},addPartyMember:function(a,b){var c=a[bi.propertyName.Friend.FriendID],d=c==Zh.data["friendID"];pf.homePage.party.addMember(a,d),d||(this.Members[c]=a)},removePartyMember:function(a){return pf.homePage.party.removeMember(a),a==Zh.data["friendID"]?void this.resetParty():void(this.Members[a]&&delete this.Members[a])},setPartyLeader:function(a){pf.homePage.party.setLeader(a),this.isLeader=a==Zh.data["friendID"]},leaveParty:function(){$h.PartyEvents.LeaveParty(this.id)}},li={CreateHtml:function(a,b,c,d){var e=f("<div class='party_invite window'>");e.attr("id","party_invite_"+b);var g=f("<div class='close'>"),h=f("<div class='headline'>Party Invite</div>"),i=f("<div class='info'> invited you to play <span class='highlight'>"+Yh[d].name+"</span></div>"),j=f("<span class='highlight'>");i.prepend(j);var k=f("<div class='members'>");k.append(f("<div class='members_headline'>Party Members</div>"));var l=f("<div class='buttons'>"),m=f("<div class='button accept_invite'>Accept</div>"),n=f("<div class='button decline_invite'>Decline</div>");l.append(n).append(m),e.append(g).append(h).append(i).append(k).append(l);for(var o=0;o<c.length;o++){var p=c[o],q=p[bi.propertyName.Friend.FriendID],r=p[bi.propertyName.Friend.Name];k.append(f("<div class='slot'><img src='"+Dc(p[bi.propertyName.Friend.Avatar])+"' title='"+r.replace("'","'")+"' /></div>")),q==a&&j.text(r)}return f("#windowUI").append(e),e.draggable({scroll:!1,cancel:".close, .button"}),$e.centerOnScreen(e),$e.monitorPosition(e),g.click(function(){e.remove()}),n.click(function(){$h.PartyEvents.DeclinePartyInvite(b),e.remove()}),m.click(function(){$h.PartyEvents.AcceptPartyInvite(b),e.remove()}),e},ReceiveInvite:function(a,b,c,d){var e=f("#party_invite_"+b);if(e.length||(e=this.CreateHtml(a,b,c,d)),e.fadeIn(200),!pf.isOpen){var g=ai.getFriend(a);g&&new Zb("Party Invite","from "+g.Name).addButton("Show Invite",200,5592405,function(){pf.open()}).show(5e3)}}},mi={CreateHtml:function(a,b,c,d,e){var g=f("<div class='party_invite window'>");g.attr("id","party_game_prompt_"+c);var h=f("<div class='close'>"),i=f("<div class='headline'>Join party game</div>"),j=f("<div class='info'> just joined a game of <span class='highlight'>"+Yh[e].modes[d]+"</span></div>"),k=f("<span class='highlight'>");j.prepend(k);var l=f("<div class='buttons'>"),m=f("<div class='button accept_invite'>Join Game</div>"),n=f("<div class='button decline_invite'>Close</div>");l.append(n).append(m),g.append(h).append(i).append(j).append(l);var o=ki.Members[a];return o&&k.text(o[bi.propertyName.Friend.Name]),f("#windowUI").append(g),g.draggable({scroll:!1,cancel:".close, .button"}),$e.centerOnScreen(g),$e.monitorPosition(g),h.click(function(){g.remove()}),n.click(function(){g.remove()}),m.click(function(){Dd.Connection.ConnectServer(b,c,d),g.remove()}),g},ReceiveGamePrompt:function(a,b,c,d,e){if(!(PE.Server.currentRoom==c&&Dd.joined||a==Zh.data["friendID"])){var g=f("#party_game_prompt_"+c);g.length||(g=this.CreateHtml(a,b,c,d,e)),g.fadeIn(200)}}},ni={channels:{},currentChannelID:void 0,initialized:!1,init:function(){this.initialized=!0,f(".channel_emoji").click(function(){ji.open()}),f("#channel_send").click(function(){ni.sendMessage()}),f("#channel_input").keydown(function(a){if(13==a.keyCode)return f("#channel_send").click(),a.preventDefault(),!1}).keyup(function(a){ni.channels[ni.currentChannelID].CurrentMessage=f(this).text()})},clear:function(){this.resetChannel(),f(".channel_tab:not(#channel_tab_party)").remove(),this.channels={}},initChannel:function(a,b,c){if(this.initialized||this.init(),!this.channels[a]){var d;d=f(b=="Party_"+ki.id?"#channel_tab_party":"#channel_tab_"+a),d.length||(d=f("<div class='channel_tab'>"),d.attr("id","channel_tab_"+a),d.text(b),f(".channel_tabs").append(d)),this.channels[a]={ID:a,Name:b,Members:{},Conversation:[],Tab:d};for(var e=0;e<c.length;e++)this.addChannelMember(c[e],a,!1);d.unbind("click"),d.click(function(){ni.currentChannelID=a,ni.loadChannel()}),this.currentChannelID=a,this.loadChannel()}},resetChannel:function(){f("#channel_chat_window").empty(),f(".channel_user").remove(),f(".channel_tab").removeClass("active")},loadChannel:function(){this.resetChannel();var a=this.channels[this.currentChannelID];a.Tab.addClass("active");for(var b in a.Members)this.addChannelMember(a.Members[b],a.ID,!0);for(var c=0;c<a.Conversation.length;c++)this.renderMessage(a.Conversation[c]);a.CurrentMessage?f("#channel_input").html(a.CurrentMessage):f("#channel_input").html("")},addChannelMember:function(a,b,c){var d=a[bi.propertyName.Friend.FriendID],e=a[bi.propertyName.Friend.Name];if(this.channels[b].Members[d]||c||(this.channels[b].Members[d]=a),this.currentChannelID==b){var g=f("<div class='channel_user'>");g.text(e),g.attr("id","channel_user_"+d),f(".channel_user_list").append(g),d!=Zh.data["friendID"]&&g.mousedown(function(a){return 2!=a.button||(ci.open(d),!1)})}},removeChannelMember:function(a,b){return a==Zh.data["friendID"]?void this.resetChannel():void(this.channels[b].Members[a]&&(delete this.channels[b].Members[a],this.currentChannelID==b&&f("#channel_user_"+a).remove()))},leaveChannel:function(){$h.channelEvents.Leavechannel(this.id)},sendMessage:function(){var a=f("#channel_input").text().trim();a&&a.length>0&&($h.ChannelEvents.SendMessage(this.currentChannelID,a),f("#channel_input").empty())},receiveMessage:function(a,b,c){var d=this.channels[a];if(d){var e=d.Members[b];if(e){var f=e[bi.propertyName.Friend.Name],g={time:(new o).getTime(),rank:1,username:f,message:c};d.Conversation.push(g),a==this.currentChannelID&&this.renderMessage(g)}}},renderMessage:function(a){var b=f("<div class='channel_message'>"),c=f("<span class='icon'>"),d=f("<span class='name'>"),e=f("<span class='message'>"),g=a.message.replace(/\s\s+/g," "),h=f("<p>"),i=RegExp(";","ig");g=g.replace(i,"[;]"),h.text(g),g=h.html();for(var j=0;j<hi.length;j++){var k=hi[j],i=RegExp(Bc(k.trigger),"ig");g=g.replace(i,'<img alt="'+k.trigger+'" src="/Scripts/Communication/emoji/'+k.filename+'" class="emoji">')}var i=RegExp(Bc("[;]"),"ig");g=g.replace(i,";"),d.text(a.username),e.html(g),b.append(c).append(d).append(e),f("#channel_chat_window").append(b),f("#channel_chat_window").scrollTop(999999999999)}};!function(a){var b,c=a.createElement("span");c.innerHTML=l(10).join("wi"),c.style.cssText="position:absolute !important;width:auto !important;font-size:128px !important;left:-99999px";var e=function(d){return c.style.fontFamily=d,a.body.appendChild(c),b=c.clientWidth,a.body.removeChild(c),b},f=e("monospace"),g=e("serif"),h=e("sans-serif");d.isFontAvailable=function(a){return f!==e(a+",monospace")||h!==e(a+",sans-serif")||g!==e(a+",serif")},d.loadScript=function(b,c){var d=a.createElement("script");d.type="text/javascript",d.readyState?d.onreadystatechange=function(){"loaded"!=d.readyState&&"complete"!=d.readyState||(d.onreadystatechange=null,c())}:d.onload=function(){c()},d.src=b,a.getElementsByTagName("head")[0].appendChild(d)}}(r),f(r).ready(function(){Dd.developer=d["developerMode"],Dd.mobileClient=d["mobile"],Dd.Connection.prefServers=d["prefServers"],Dd.version=d["version"],d["conn"]=function(a,b){Dd.Connection.ConnectServer(a,b)},d.onbeforeunload=function(){if(!pf.isOpen)return"Are you sure you want to leave the game?"},Xc.InputManager.init();var b=function(){a.loader.add("/Content/SpritesUI9.json").add("/Content/Sprites7.json").add("/Content/SpritesDisplacement.json").add("/Content/Helpers1.json").load(function(){Dd.connectOnInit=!d["authenticated"];var a=Dd.GameModes.Default;void 0!==localStorage["gamemodeSelected"]&&(a=q(localStorage["gamemodeSelected"])),Dd.init(a),pf.init(),Dd.connectOnInit||Zh.Authenticate(!0),(Dd.isMobile.tablet||Dd.isMobile.phone)&&Dd.mobileLogic()})};f(r).bind("keydown",function(a){if(13===a.which&&a.altKey)return Jc(),a.preventDefault(),!1});try{isFontAvailable("Calibri")?b():loadScript("https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",function(){WebFont.load({custom:{families:["woffwoff"],urls:["/Stylesheet/woffwoff.css"]},active:function(){b()}})})}catch(a){b()}}),d.addEventListener("resize",Dd.performResize,!1);var oi={muteList:[],listId:null,init:function(){this.listId!=Zh.data["friendID"]&&this.load()},contains:function(a){return this.init(),this.muteList.indexOf(a)!=-1},add:function(a){this.init(),this.muteList.indexOf(a)==-1&&(this.muteList.push(a),this.save(),this.updateScoreboard())},remove:function(a){this.init();var b=this.muteList.indexOf(a);b!=-1&&(this.muteList.splice(b,1),this.save(),this.updateScoreboard())},updateScoreboard:function(){for(var a in Dd.Players){var b=Dd.Players[a];b.playerItem&&b.playerItem.updateMute()}},save:function(){localStorage["muteList"+Zh.data["friendID"]]=JSON.stringify(this.muteList)},load:function(){var a=localStorage["muteList"+Zh.data["friendID"]];a&&(this.muteList=JSON.parse(a))}},pi=new Kc;f("<div>");f(function(){}),pi.Command=function(a,b){f.isArray(a)||(a=[a]),this.command=a,this.callback=b},pi.commands.push(new pi.Command("/ignore",function(a){return""==a?void pi.systemInfo("Usage '/ignore PlayerName'"):(player=null,f.each(Dd.Players,function(b,c){c.name==a&&(player=c)}),void(null!=player&&f.inArray(player.sessionID,pi.ignoreList)==-1?(pi.ignoreList.push(player.sessionID),pi.hideChatFromUser(player.sessionID),pi.systemInfo("Ignored player '"+a+"'")):pi.systemError(null!=player&&f.inArray(player.sessionID,pi.ignoreList)!=-1?"Player '"+a+"' already on ignore list":"Player '"+a+"' not found")))})),pi.commands.push(new pi.Command("/unignore",function(a){return""==a?void pi.systemInfo("Usage '/unignore PlayerName'"):(player=null,f.each(Dd.Players,function(b,c){c.name==a&&(player=c)}),void(null!=player?f.inArray(player.sessionID,pi.ignoreList)!=-1?(pi.ignoreList.splice(pi.ignoreList.indexOf(player.sessionID)),pi.showChatFromUser(player.sessionID),pi.systemInfo("Unignored player '"+a+"'")):pi.systemInfo("Player '"+a+"' isn't on ignore list"):pi.systemError("Player '"+a+"' not found")))})),pi.commands.push(new pi.Command("/t",function(a){""!=a&&Dd.Connection.invoke("ChatTMsg",a)})),pi.commands.push(new pi.Command("/hide",function(a){""==a?pi.isHidden?(pi.isHidden=!1,pi.systemInfo("Chat is now visible")):(pi.systemInfo("Chat is now hidden"),pi.isHidden=!0):pi.systemInfo("Usage '/hide'")})),pi.commands.push(new pi.Command("/p",function(a){if(""!=a){Dd.Connection.invoke("ChatPMsg",ki.getMemberIdList(),a)}})),pi.commands.push(new pi.Command("/help",function(a){var b="2";return""==a?void pi.systemInfo("Usage /help 1-"+b):"1"==a?(pi.systemInfo("Hide/Show Chat: /hide"),pi.systemInfo("Team Chat: /t YourMessage"),void pi.systemInfo("Party Chat: /p YourMessage")):"2"==a?(pi.systemInfo("Ignore Player: /ignore PlayerName"),void pi.systemInfo("Unignore Player: /unignore PlayerName")):void pi.systemInfo("Usage /help 1-"+b)})),pi.Info=function(a,b){f.isArray(a)||(a=[a]),this.info=a,this.callback=b},pi.infos.push(new pi.Info(0,function(){0!=Dd.friendID&&pi.infoMsg("Did you know, writing '/help' in chat will show you the list of commands for chat?")})),pi.infos.push(new pi.Info(1,function(){0==Dd.friendID&&pi.infoMsg("Registering will save your progress and give you access to new tanks and much more!")})),pi.infos.push(new pi.Info(2,function(){0==Dd.friendID&&pi.infoMsg("Did you know you can use the chat when registered?")})),pi.infos.push(new pi.Info(3,function(){0==Dd.friendID&&pi.infoMsg("You can play with your friends on same team when you're registered!")})),pi.infos.push(new pi.Info(4,function(){d.location!==d.parent.location&&pi.infoMsg("Use Tankwars.io website and register for a better experience with progression and better tanks!")})),pi.infos.push(new pi.Info(5,function(){0!=Dd.friendID&&pi.infoMsg(ng.Premium?"Thank you for supporting the game!":"Did you know, being Premium removes in-game ads?")})),pi.infos.push(new pi.Info(6,function(){0!=Dd.friendID&&pi.infoMsg("Pressing U will direct chat to your teammates")})),Dd.ScoreBoard={teamCount:0,teamSection:{},open:!1,dirty:!1,dirtyScoreboard:!1,dirtySort:!1,setTeams:function(a){this.teamCount=a.length;for(var b in this.teamSection)this.teamSection[b].setVisible(!1);if(a&&a.length){this.container.width="95%",this.container.minWidth=400*a.length,this.container.maxWidth=600*a.length;for(var c=0;c<a.length;c++){var d=a[c],e=d[0],f=0===c,g=c===a.length-1,h=100/a.length,b=this.teamSection[e];b||(b=this.teamSection[e]=new Lc(e)),b.fixPosition(c,h,f,g),b.setVisible(!0)}}else this.container.width="50%",this.container.minWidth=600,this.container.maxWidth=800,this.teamSection[0]||(this.teamSection[0]=new Lc(0)),this.teamSection[0].fixPosition(0,100,!0,!0),this.teamSection[0].setVisible(!0);this.UpdateTeamColors()},UpdateTeamColors:function(){for(var a in this.teamSection)this.teamSection[a].setTeamColor(a)},addPlayer:function(a){var b=this.teamSection[a.team];a.playerItem||(a.playerItem=new Mc(a)),b&&b.addPlayer(a)},init:function(){var b=a.Texture.fromFrame("UI/ui-box-1.png"),c=(a.Texture.fromFrame("UI/solid-box.png"),this.container=new a.UI.SliceSprite(b,5));c.height=580,c.width="50%",c.verticalAlign="middle",c.horizontalAlign="center",c.minWidth=550,c.minHeight="200",c.maxHeight="80%",c.anchorLeft=0,c.visible=!1,Dd.Scene.UI_Leaderboard.addChild(c),Xc.InputManager.addKeyDownListener(null,10,function(a){if(a.which==rf.UserSettings["Input_ToggleScoreBoard"]&&!pf.isOpen)return a.preventDefault(),a.stopPropagation(),Dd.ScoreBoard.show(),!0}),Xc.InputManager.addKeyUpListener(null,10,function(a){if(a.which==rf.UserSettings["Input_ToggleScoreBoard"])return a.preventDefault(),a.stopPropagation(),Dd.ScoreBoard.hide(),!0}),PE.Server.onUpdate(this.update,this)},show:function(){this.open=!0,this.startUpdatePings(),this.update(),this.container.visible=!0},hide:function(){this.open=!1,this.stopUpdatePings(),this.container.visible=!1},setDirty:function(a){this.dirtyScoreboard=!0,this.dirty=!0,this.dirtySort=a},update:function(){var a=Dd.currentGM===Dd.GameModes.KingDM;if((a||this.dirtySort)&&(this.sortScoreboard(),this.dirtySort=!1),this.dirtyScoreboard&&(this.updateScoreboard(),this.dirtyScoreboard=!1),this.dirty){if(this.Events.length)for(var b=0;b<this.Events.length;b++)this.Events[b]();a&&Dd.ScoreBoard.KingDM.Update(),this.dirty=!1}},sortScoreboard:function(){var a=0,b=Dd.currentGM===Dd.GameModes.KingDM;for(var c in this.teamSection)this.teamSection[c].visible&&(this.teamSection[c].sort(b),this.teamSection[c].playerCount()>a&&(a=this.teamSection[c].playerCount()));var d=42*a+97;this.container.height!=d&&(this.container.height=d)},updateScoreboard:function(){if(this.dirty)for(var a in Dd.Players){var b=Dd.Players[a];b.playerItem&&(b.playerItem.updateName(),b.playerItem.updateScore(),b.playerItem.updateKDA())}},startUpdatePings:function(){this.stopUpdatePings(),Dd.ScoreBoard.UpdatePings(),this.pingUpdateTimer=v(function(){Dd.ScoreBoard.UpdatePings()},5e3)},stopUpdatePings:function(){this.pingUpdateTimer&&w(this.pingUpdateTimer)},UpdatePings:function(){for(var a in Dd.Players){var b=Dd.Players[a];b.playerItem&&b.playerItem.updatePing()}},Events:[],OnScoreboardChange:function(a){"function"==typeof a&&this.Events.indexOf(a)===-1&&this.Events.push(a)},OffScoreboardChange:function(a){if("function"==typeof a){var b=this.Events.indexOf(a);b!==-1&&this.Events.splice(b,1)}}};var qi=function(b){var c=this,d=this.container=new a.UI.Button({background:new a.UI.SliceSprite(kf,4),width:"80%",height:40,text:new a.UI.DynamicText("<b>JOIN</b> Team "+b,{style:dd,allowTags:!0,width:"100%"})});d.align="center",d.background.alpha=.5,d.on("hover",function(b){a.UI.Tween.to(this.background,.6,{alpha:b?.9:.5},a.UI.Ease.Circ.CircOut)}),d.on("click",function(a){pe.signal(10,b)}),d.text.style.align="center",this.hide=function(){d.visible=d.interactive=!1},this.show=function(){d.visible=d.interactive=!0};var e=function(){d.background.tint=Dd.TeamColors.GetColor(b).Color;var a=Dd.player?Dd.player.team:-1;!Dd.allowTeamChange||Dd.allowTeamChange&&a==b?c.hide():c.show()};Dd.TeamColors.on("update",e),e()};Dd.ScoreBoard.KingDM={Items:[],Init:function(b){if(!this.initialized){var c=a.Texture.fromFrame("UI/ui-box-3.png"),d=a.Texture.fromFrame("UI/ui-box-header.png"),e={fill:"#ffffff",fontSize:16,fontFamily:Yc,fontWeight:"bold"},f={fill:"#000000",fontSize:11,fontFamily:Yc,fontWeight:"bold"},g=this.container=new a.UI.Container(274,284);g.anchorTop=g.anchorRight=6,Dd.Scene.UI_Leaderboard.addChild(g);var h=new a.UI.SliceSprite(c,5);h.width="100%",h.height="100%",h.alpha=.5,g.addChild(h);var i=new a.UI.SliceSprite(d,3,(!0),(!1));i.anchorRight=i.anchorLeft=i.anchorTop=2,i.height=28,i.tint=686514,i.alpha=.45,g.addChild(i),this.hlText=new a.UI.Text("",e),this.hlText.horizontalAlign="center",this.hlText.top=7,g.addChild(this.hlText),this.initialized=!0;for(var j=!0,k=0;k<10;k++)this.Items[k]=new ri(k,j),j=!j;var l=new a.UI.Text("Press",e),m=new a.UI.Text("to toggle full leaderboard",e);l.anchorLeft=m.anchorRight=15,l.anchorBottom=m.anchorBottom=-20;var n=new a.UI.SliceSprite(a.Texture.fromFrame("UI/ui-box-4.png"),3);n.width=27,n.height=18,n.anchorLeft=56,n.anchorBottom=-21,this.hotkeyText=new a.UI.Text("TAB",f),this.hotkeyText.verticalAlign="middle",this.hotkeyText.horizontalAlign="center",n.addChild(this.hotkeyText),g.addChild(l,m,n)}this.container.visible=!0,this.hlText.text="[KingDM] Get "+Fc(b)+" to Win!",this.hotkeyText.text=x(Xc.InputManager.keyName[rf.UserSettings["Input_ToggleScoreBoard"]])},Clear:function(){this.initialized&&(this.container.visible=!1)},Update:function(){for(var a=0;a<this.Items.length;a++){var b=Dd.ScoreBoard.teamSection[0].items[a];b?this.Items[a].Update(b.player):this.Items[a].Update()}}};var ri=function(b,c){this.alt=c,this.index=b,this.lastVisible=!1;var d={fill:"#ffffff",fontSize:16,fontFamily:Yc,fontWeight:"bold"},e={fill:"#ffffff",fontSize:16,fontFamily:Yc},f=new a.UI.Container("100%",25);f.visible=!1,f.top=25*b+31;var g=new a.UI.Text(b+1,d),h=new a.UI.Text("Name",e),i=new a.UI.Text("0",d);g.verticalAlign=h.verticalAlign=i.verticalAlign="middle",g.left=6,h.left=g._text.width+8,i.anchorRight=4;var j=new a.UI.Sprite(a.Texture.fromFrame("UI/ui-white-box.png"));j.anchorLeft=j.anchorRight=3,j.height="100%",j.visible=c,j.alpha=.07,f.addChild(j,g,h,i);var k;0===b&&(k=new a.UI.Sprite(a.Texture.fromFrame("UI/small-crown.png")),k.verticalAlign="middle",f.addChild(k)),Dd.ScoreBoard.KingDM.container.addChild(f),this.Update=function(a){return a?(this.lastVisible||(this.lastVisible=f.visible=!0),a.Score!=this._lastScore&&(this._lastScore=a.Score,i.text=Fc(a.Score)),a.name!=this._lastName&&(this._lastName=a.name,h.text=a.name,0===this.index&&(k.left=h._text.width+g._text.width+8)),void(a.me&&!this._lastMe?(this._lastMe=!0,j.visible=!0,j.alpha=.35,j.tint=8572444):!a.me&&this._lastMe&&(this._lastMe=!1,j.visible=this.alt,j.alpha=.07,j.tint=16777215))):void(this.lastVisible&&(this.lastVisible=f.visible=!1))}};Dd.ScoreBoard.Conquest={TeamBars:{},Zones:{},UpdateTeamColors:function(){for(var a in this.TeamBars)this.TeamBars[a].SetTeamColor(a);for(var b in this.Zones)this.Zones[b].ForceUpdateValues()},UpdateTeamScore:function(a,b){this.TeamBars[a]&&this.TeamBars[a].SetAmount(b)},AddZone:function(a){this.Zones[a.zoneIndex]=a,this.zoneContainer.container.addChild(a.uiDot.container),this.ArrangeZones()},ArrangeZones:function(){var a=Object.keys(this.Zones).length,b=34*a,c=.5*-(b-34),d=c;for(var e in this.Zones)this.Zones[e].uiDot.container.position.set(d,0),d+=34;this.container.width=738+b},Init:function(b,c){if(!this.initialized){this.initialized=!0,this.container=new a.UI.Container(918,51),this.container.align="center",this.container.top=0;var d=new a.UI.SliceSprite(a.Texture.fromFrame("Conquest/top_bg.png"),5,(!0),(!1));d.width=d.height="100%";var e=new a.UI.SliceSprite(a.Texture.fromFrame("Conquest/title_bg.png"),22,(!0),(!1));e.align="center",e.width=216,e.bottom=0,e.tint=d.tint=0,e.alpha=d.alpha=.34;var f=a.UI.Sprite.fromFrame("Conquest/title.png");f.align="center",f.anchorBottom=-21,f.alpha=.9,this.zoneContainer=new a.UI.Container,this.zoneContainer.align="center",this.zoneContainer.top=26,this.container.addChild(d,e,f,this.zoneContainer)}if(c){for(var g=0;g<c.length;g++){var h=0!==g,i=c[g][0],j=c[g][1],k=this.TeamBars[i];k||(k=this.TeamBars[i]=new T,k.container.anchorTop=15),k.setData(h,j,b,338,23),k.container.anchorLeft=h?null:17,k.container.anchorRight=h?17:null,this.container.addChild(k.container)}this.UpdateTeamColors()}this.ArrangeZones(),Dd.Scene.UI_GM_GUI.addChild(this.container)},Clear:function(){for(var a in this.TeamBars)this.TeamBars[a].Clear();for(var b in this.Zones)this.zoneContainer.container.removeChild(this.Zones[b].uiDot.container);this.TeamBars={},this.Zones={},this.container&&this.container.parent&&this.container.parent.removeChild(this.container)}},Dd.ScoreBoard.BattleRoyale={UpdateTeamColors:function(){},UpdateTeamScore:function(a,b){},Init:function(a,b,c){},Clear:function(){}}}(PIXI,TweenLite,TweenMax,window,jQuery,$,Howler,Howl,TimelineLite,TimelineMax,Math,Array,Number,performance,Date,parseFloat,parseInt,document,TileRope,clearTimeout,setTimeout,setInterval,clearInterval);
