diff --git a/battle_srv/models/room.go b/battle_srv/models/room.go index 4422fcf..7ea409f 100644 --- a/battle_srv/models/room.go +++ b/battle_srv/models/room.go @@ -424,9 +424,9 @@ func (pR *Room) StartBattle() { Logger.Error("battleMainLoop, recovery spot#1, recovered from: ", zap.Any("roomId", pR.Id), zap.Any("panic", r)) } pR.StopBattleForSettlement() - rdfIdToActuallyUsedInputDump := pR.rdfIdToActuallyUsedInputString() Logger.Info(fmt.Sprintf("The `battleMainLoop` for roomId=%v is stopped@renderFrameId=%v, with battleDurationFrames=%v:\n%v", pR.Id, pR.RenderFrameId, pR.BattleDurationFrames, pR.InputsBufferString(false))) // This takes sometime to print - os.WriteFile(fmt.Sprintf("room_%d.txt", pR.Id), []byte(rdfIdToActuallyUsedInputDump), 0644) // DEBUG ONLY + //rdfIdToActuallyUsedInputDump := pR.rdfIdToActuallyUsedInputString() + //os.WriteFile(fmt.Sprintf("room_%d.txt", pR.Id), []byte(rdfIdToActuallyUsedInputDump), 0644) // DEBUG ONLY pR.onBattleStoppedForSettlement() }() @@ -773,7 +773,7 @@ func (pR *Room) OnDismissed() { pR.RollbackEstimatedDtNanos = 16666666 // A little smaller than the actual per frame time, just for logging FAST FRAME dilutedServerFps := float64(58.0) // Don't set this value too small, otherwise we might miss force confirmation needs for slow tickers! pR.dilutedRollbackEstimatedDtNanos = int64(float64(pR.RollbackEstimatedDtNanos) * float64(pR.ServerFps) / dilutedServerFps) - pR.BattleDurationFrames = 15 * pR.ServerFps + pR.BattleDurationFrames = 60 * pR.ServerFps pR.BattleDurationNanos = int64(pR.BattleDurationFrames) * (pR.RollbackEstimatedDtNanos + 1) pR.InputFrameUpsyncDelayTolerance = (pR.NstDelayFrames >> pR.InputScaleFrames) - 1 // this value should be strictly smaller than (NstDelayFrames >> InputScaleFrames), otherwise "type#1 forceConfirmation" might become a lag avalanche pR.MaxChasingRenderFramesPerUpdate = 12 // Don't set this value too high to avoid exhausting frontend CPU within a single frame diff --git a/collider_visualizer/worldColliderDisplay.go b/collider_visualizer/worldColliderDisplay.go index c25281a..bd526e0 100644 --- a/collider_visualizer/worldColliderDisplay.go +++ b/collider_visualizer/worldColliderDisplay.go @@ -64,7 +64,7 @@ func NewWorldColliderDisplay(game *Game, stageDiscreteW, stageDiscreteH, stageTi if moveToCollide { effPushback := Vec2D{X: float64(0), Y: float64(0)} colliderWidth, colliderHeight := playerColliderRadius*2, playerColliderRadius*4 - playerColliders[0].X, playerColliders[0].Y = VirtualGridToPolygonColliderBLPos(int32(-139000-2000), int32(-474500+2000), colliderWidth, colliderHeight, topPadding, bottomPadding, leftPadding, rightPadding, spaceOffsetX, spaceOffsetY, virtualGridToWorldRatio) + playerColliders[0].X, playerColliders[0].Y = VirtualGridToPolygonColliderBLPos(int32(-139000), int32(-474500), colliderWidth, colliderHeight, topPadding, bottomPadding, leftPadding, rightPadding, spaceOffsetX, spaceOffsetY, virtualGridToWorldRatio) playerColliders[0].Update() playerColliders[1].X, playerColliders[1].Y = VirtualGridToPolygonColliderBLPos(int32(-163000), int32(-520000), colliderWidth, colliderHeight, topPadding, bottomPadding, leftPadding, rightPadding, spaceOffsetX, spaceOffsetY, virtualGridToWorldRatio) @@ -84,9 +84,9 @@ func NewWorldColliderDisplay(game *Game, stageDiscreteW, stageDiscreteH, stageTi Logger.Warn(fmt.Sprintf("Collided BUT not overlapped: a=%v, b=%v, overlapResult=%v", ConvexPolygonStr(playerShape), ConvexPolygonStr(bShape), overlapResult)) } } - toTestPlayerCollider.X -= effPushback.X - toTestPlayerCollider.Y -= effPushback.Y - toTestPlayerCollider.Update() + //toTestPlayerCollider.X -= effPushback.X + //toTestPlayerCollider.Y -= effPushback.Y + //toTestPlayerCollider.Update() Logger.Info(fmt.Sprintf("effPushback={%v, %v}", effPushback.X, effPushback.Y)) } } diff --git a/frontend/assets/plugin_scripts/jsexport.js b/frontend/assets/plugin_scripts/jsexport.js index 774cf5a..6de7e6a 100644 --- a/frontend/assets/plugin_scripts/jsexport.js +++ b/frontend/assets/plugin_scripts/jsexport.js @@ -7,13 +7,13 @@ Error.stackTraceLimit=1/0;var $global,$module,$NaN=NaN;if("undefined"!=typeof wi $packages["github.com/gopherjs/gopherjs/js"]=(function(){var $pkg={},$init,A,B,J,K,M,O,P,Q,R,S,T,E,G,H,L;A=$pkg.Object=$newType(0,$kindStruct,"js.Object",true,"github.com/gopherjs/gopherjs/js",true,function(object_){this.$val=this;if(arguments.length===0){this.object=null;return;}this.object=object_;});B=$pkg.Error=$newType(0,$kindStruct,"js.Error",true,"github.com/gopherjs/gopherjs/js",true,function(Object_){this.$val=this;if(arguments.length===0){this.Object=null;return;}this.Object=Object_;});J=$pkg.M=$newType(4,$kindMap,"js.M",true,"github.com/gopherjs/gopherjs/js",true,null);K=$pkg.S=$newType(12,$kindSlice,"js.S",true,"github.com/gopherjs/gopherjs/js",true,null);M=$sliceType($emptyInterface);O=$ptrType(A);P=$sliceType(O);Q=$funcType([P],[O],true);R=$funcType([],[O],false);S=$funcType([O],[],false);T=$ptrType(B);A.ptr.prototype.Get=function(a){var a,b;b=this;return b.object[$externalize(a,$String)];};A.prototype.Get=function(a){return this.$val.Get(a);};A.ptr.prototype.Set=function(a,b){var a,b,c;c=this;c.object[$externalize(a,$String)]=$externalize(b,$emptyInterface);};A.prototype.Set=function(a,b){return this.$val.Set(a,b);};A.ptr.prototype.Delete=function(a){var a,b;b=this;delete b.object[$externalize(a,$String)];};A.prototype.Delete=function(a){return this.$val.Delete(a);};A.ptr.prototype.Length=function(){var a;a=this;return $parseInt(a.object.length);};A.prototype.Length=function(){return this.$val.Length();};A.ptr.prototype.Index=function(a){var a,b;b=this;return b.object[a];};A.prototype.Index=function(a){return this.$val.Index(a);};A.ptr.prototype.SetIndex=function(a,b){var a,b,c;c=this;c.object[a]=$externalize(b,$emptyInterface);};A.prototype.SetIndex=function(a,b){return this.$val.SetIndex(a,b);};A.ptr.prototype.Call=function(a,b){var a,b,c,d;c=this;return(d=c.object,d[$externalize(a,$String)].apply(d,$externalize(b,M)));};A.prototype.Call=function(a,b){return this.$val.Call(a,b);};A.ptr.prototype.Invoke=function(a){var a,b;b=this;return b.object.apply(undefined,$externalize(a,M));};A.prototype.Invoke=function(a){return this.$val.Invoke(a);};A.ptr.prototype.New=function(a){var a,b;b=this;return new($global.Function.prototype.bind.apply(b.object,[undefined].concat($externalize(a,M))));};A.prototype.New=function(a){return this.$val.New(a);};A.ptr.prototype.Bool=function(){var a;a=this;return!!(a.object);};A.prototype.Bool=function(){return this.$val.Bool();};A.ptr.prototype.String=function(){var a;a=this;return $internalize(a.object,$String);};A.prototype.String=function(){return this.$val.String();};A.ptr.prototype.Int=function(){var a;a=this;return $parseInt(a.object)>>0;};A.prototype.Int=function(){return this.$val.Int();};A.ptr.prototype.Int64=function(){var a;a=this;return $internalize(a.object,$Int64);};A.prototype.Int64=function(){return this.$val.Int64();};A.ptr.prototype.Uint64=function(){var a;a=this;return $internalize(a.object,$Uint64);};A.prototype.Uint64=function(){return this.$val.Uint64();};A.ptr.prototype.Float=function(){var a;a=this;return $parseFloat(a.object);};A.prototype.Float=function(){return this.$val.Float();};A.ptr.prototype.Interface=function(){var a;a=this;return $internalize(a.object,$emptyInterface);};A.prototype.Interface=function(){return this.$val.Interface();};A.ptr.prototype.Unsafe=function(){var a;a=this;return a.object;};A.prototype.Unsafe=function(){return this.$val.Unsafe();};B.ptr.prototype.Error=function(){var a;a=this;return"JavaScript error: "+$internalize(a.Object.message,$String);};B.prototype.Error=function(){return this.$val.Error();};B.ptr.prototype.Stack=function(){var a;a=this;return $internalize(a.Object.stack,$String);};B.prototype.Stack=function(){return this.$val.Stack();};E=function(a){var a;return $makeFunc(a);};$pkg.MakeFunc=E;G=function(a){var a,b,c,d,e,f;b=a;c=new($global.Object)();c.__internal_object__=b;d=b.constructor.methods;e=0;while(true){if(!(e<$parseInt(d.length))){break;}f=[f];f[0]=d[e];if(!($internalize(f[0].pkg,$String)==="")){e=e+(1)>>0;continue;}c[$externalize($internalize(f[0].name,$String),$String)]=$externalize((function(f){return function(g){var g;return $externalizeFunction(b[$externalize($internalize(f[0].prop,$String),$String)],f[0].typ,$externalize(true,$Bool)).apply(b,$externalize(g,P));};})(f),Q);e=e+(1)>>0;}return c;};$pkg.MakeWrapper=G;H=function(a){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=[b];c=[c];b[0]=a;d=b[0].constructor;c[0]=new($global.Object)();e=(function(b,c){return function(e,f){var e,f;$global.Object.defineProperty(c[0],$externalize(e,$String),$externalize(f,J));};})(b,c);$r=e("__internal_object__",$makeMap($String.keyFor,[{k:"value",v:new $jsObjectPtr(b[0])}]));$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}f=$internalize(d.string,$String);g=$internalize(d.pkg,$String);h="";if(f.charCodeAt(0)===42){h="*";}i=0;while(true){if(!(i>0));break;}i=i+(1)>>0;}j=g+"."+h+f;$r=e("$type",$makeMap($String.keyFor,[{k:"value",v:new $String(j)}]));$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}k=null;l=new($global.Array)();m=d.methods;if(!(m===undefined)){l=l.concat(m);}n=d.elem;if(!(n===undefined)){k=n.fields;l=l.concat(n.methods);}else{k=d.fields;}o=0;case 3:if(!(o<$parseInt(l.length))){$s=4;continue;}p=[p];p[0]=l[o];if(!($internalize(p[0].pkg,$String)==="")){o=o+(1)>>0;$s=3;continue;}$r=e($internalize(p[0].prop,$String),$makeMap($String.keyFor,[{k:"value",v:new Q((function(b,c,p){return function(q){var q;return $externalizeFunction(b[0][$externalize($internalize(p[0].prop,$String),$String)],p[0].typ,$externalize(true,$Bool),H).apply(b[0],$externalize(q,P));};})(b,c,p))}]));$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}o=o+(1)>>0;$s=3;continue;case 4:if(!(k===undefined)){$s=6;continue;}$s=7;continue;case 6:q=0;case 8:if(!(q<$parseInt(k.length))){$s=9;continue;}r=[r];r[0]=k[q];if(!!!(r[0].exported)){q=q+(1)>>0;$s=8;continue;}$r=e($internalize(r[0].prop,$String),$makeMap($String.keyFor,[{k:"get",v:new R((function(b,c,r){return function(){var s;s=$copyIfRequired(b[0].$val[$externalize($internalize(r[0].prop,$String),$String)],r[0].typ);return $externalize(s,r[0].typ,H);};})(b,c,r))},{k:"set",v:new S((function(b,c,r){return function(s){var s,t;t=$internalize(s,r[0].typ,H);b[0].$val[$externalize($internalize(r[0].prop,$String),$String)]=t;};})(b,c,r))}]));$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}q=q+(1)>>0;$s=8;continue;case 9:case 7:$s=-1;return c[0];}return;}var $f={$blk:H,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,$s};return $f;};$pkg.MakeFullWrapper=H;L=function(){var a;a=new B.ptr(null);$unused(a);};O.methods=[{prop:"Get",name:"Get",pkg:"",typ:$funcType([$String],[O],false)},{prop:"Set",name:"Set",pkg:"",typ:$funcType([$String,$emptyInterface],[],false)},{prop:"Delete",name:"Delete",pkg:"",typ:$funcType([$String],[],false)},{prop:"Length",name:"Length",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Index",name:"Index",pkg:"",typ:$funcType([$Int],[O],false)},{prop:"SetIndex",name:"SetIndex",pkg:"",typ:$funcType([$Int,$emptyInterface],[],false)},{prop:"Call",name:"Call",pkg:"",typ:$funcType([$String,M],[O],true)},{prop:"Invoke",name:"Invoke",pkg:"",typ:$funcType([M],[O],true)},{prop:"New",name:"New",pkg:"",typ:$funcType([M],[O],true)},{prop:"Bool",name:"Bool",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"Int",name:"Int",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Int64",name:"Int64",pkg:"",typ:$funcType([],[$Int64],false)},{prop:"Uint64",name:"Uint64",pkg:"",typ:$funcType([],[$Uint64],false)},{prop:"Float",name:"Float",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Interface",name:"Interface",pkg:"",typ:$funcType([],[$emptyInterface],false)},{prop:"Unsafe",name:"Unsafe",pkg:"",typ:$funcType([],[$Uintptr],false)}];T.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)},{prop:"Stack",name:"Stack",pkg:"",typ:$funcType([],[$String],false)}];A.init("github.com/gopherjs/gopherjs/js",[{prop:"object",name:"object",embedded:false,exported:false,typ:O,tag:""}]);B.init("",[{prop:"Object",name:"Object",embedded:true,exported:true,typ:O,tag:""}]);J.init($String,$emptyInterface);K.init($emptyInterface);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:L();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["runtime"]=(function(){var $pkg={},$init,A,C,D,AT,AZ,BD,AM,E,AU;A=$packages["github.com/gopherjs/gopherjs/js"];C=$pkg._type=$newType(0,$kindStruct,"runtime._type",true,"runtime",false,function(str_){this.$val=this;if(arguments.length===0){this.str="";return;}this.str=str_;});D=$pkg.TypeAssertionError=$newType(0,$kindStruct,"runtime.TypeAssertionError",true,"runtime",true,function(_interface_,concrete_,asserted_,missingMethod_){this.$val=this;if(arguments.length===0){this._interface=AZ.nil;this.concrete=AZ.nil;this.asserted=AZ.nil;this.missingMethod="";return;}this._interface=_interface_;this.concrete=concrete_;this.asserted=asserted_;this.missingMethod=missingMethod_;});AT=$pkg.errorString=$newType(8,$kindString,"runtime.errorString",true,"runtime",false,null);AZ=$ptrType(C);BD=$ptrType(D);C.ptr.prototype.string=function(){var a;a=this;return a.str;};C.prototype.string=function(){return this.$val.string();};C.ptr.prototype.pkgpath=function(){var a;a=this;return"";};C.prototype.pkgpath=function(){return this.$val.pkgpath();};D.ptr.prototype.RuntimeError=function(){};D.prototype.RuntimeError=function(){return this.$val.RuntimeError();};D.ptr.prototype.Error=function(){var a,b,c,d,e;a=this;b="interface";if(!(a._interface===AZ.nil)){b=a._interface.string();}c=a.asserted.string();if(a.concrete===AZ.nil){return"interface conversion: "+b+" is nil, not "+c;}d=a.concrete.string();if(a.missingMethod===""){e="interface conversion: "+b+" is "+d+", not "+c;if(d===c){if(!(a.concrete.pkgpath()===a.asserted.pkgpath())){e=e+(" (types from different packages)");}else{e=e+(" (types from different scopes)");}}return e;}return"interface conversion: "+d+" is not "+c+": missing method "+a.missingMethod;};D.prototype.Error=function(){return this.$val.Error();};E=function(){var a,b;a=$packages[$externalize("github.com/gopherjs/gopherjs/js",$String)];$jsObjectPtr=a.Object.ptr;$jsErrorPtr=a.Error.ptr;$throwRuntimeError=AU;AM=$internalize($goVersion,$String);b=$ifaceNil;b=new D.ptr(AZ.nil,AZ.nil,AZ.nil,"");$unused(b);};AT.prototype.RuntimeError=function(){var a;a=this.$val;};$ptrType(AT).prototype.RuntimeError=function(){return new AT(this.$get()).RuntimeError();};AT.prototype.Error=function(){var a;a=this.$val;return"runtime error: "+(a);};$ptrType(AT).prototype.Error=function(){return new AT(this.$get()).Error();};AU=function(a){var a;$panic(new AT((a)));};AZ.methods=[{prop:"string",name:"string",pkg:"runtime",typ:$funcType([],[$String],false)},{prop:"pkgpath",name:"pkgpath",pkg:"runtime",typ:$funcType([],[$String],false)}];BD.methods=[{prop:"RuntimeError",name:"RuntimeError",pkg:"",typ:$funcType([],[],false)},{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];AT.methods=[{prop:"RuntimeError",name:"RuntimeError",pkg:"",typ:$funcType([],[],false)},{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];C.init("runtime",[{prop:"str",name:"str",embedded:false,exported:false,typ:$String,tag:""}]);D.init("runtime",[{prop:"_interface",name:"_interface",embedded:false,exported:false,typ:AZ,tag:""},{prop:"concrete",name:"concrete",embedded:false,exported:false,typ:AZ,tag:""},{prop:"asserted",name:"asserted",embedded:false,exported:false,typ:AZ,tag:""},{prop:"missingMethod",name:"missingMethod",embedded:false,exported:false,typ:$String,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}AM="";E();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["math/bits"]=(function(){var $pkg={},$init;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); -$packages["math"]=(function(){var $pkg={},$init,B,A,IT,IU,IV,IW,FL,FM,FN,FO,FP,HH,EI,EX,EY,FK,GA,GH,GK,GL,GM,GS,GT,GW,GX,GZ,HA,HD,HI,HL,HM;B=$packages["github.com/gopherjs/gopherjs/js"];A=$packages["math/bits"];IT=$arrayType($Uint32,2);IU=$arrayType($Float32,2);IV=$arrayType($Float64,1);IW=$structType("math",[{prop:"uint32array",name:"uint32array",embedded:false,exported:false,typ:IT,tag:""},{prop:"float32array",name:"float32array",embedded:false,exported:false,typ:IU,tag:""},{prop:"float64array",name:"float64array",embedded:false,exported:false,typ:IV,tag:""}]);EI=function(av){var av,aw,ax,ay,az,ba,bb;aw=HL(av);ax=((($shiftRightUint64(aw,52).$low>>>0))&2047)>>>0;if(ax<1023){aw=(ay=new $Uint64(2147483648,0),new $Uint64(aw.$high&ay.$high,(aw.$low&ay.$low)>>>0));if(ax===1022){aw=(az=new $Uint64(1072693248,0),new $Uint64(aw.$high|az.$high,(aw.$low|az.$low)>>>0));}}else if(ax<1075){ax=ax-(1023)>>>0;aw=(ba=$shiftRightUint64(new $Uint64(524288,0),ax),new $Uint64(aw.$high+ba.$high,aw.$low+ba.$low));aw=(bb=$shiftRightUint64(new $Uint64(1048575,4294967295),ax),new $Uint64(aw.$high&~bb.$high,(aw.$low&~bb.$low)>>>0));}return HM(aw);};$pkg.Round=EI;EX=function(av,aw){var av,aw;if(GL(av,1)||GL(aw,1)){return GK(1);}else if(GM(av)||GM(aw)){return GW();}else if((av===0)&&(av===aw)){if(GZ(av)){return aw;}return av;}if(av>aw){return av;}return aw;};EY=function(av,aw){var av,aw;if(GL(av,-1)||GL(aw,-1)){return GK(-1);}else if(GM(av)||GM(aw)){return GW();}else if((av===0)&&(av===aw)){if(GZ(av)){return av;}return aw;}if(av>>0)));};$pkg.Abs=FK;GA=function(av){var av;return $parseFloat(FL.cos(av));};$pkg.Cos=GA;GH=function(av){var av;return $parseFloat(FL.floor(av));};$pkg.Floor=GH;GK=function(av){var av;if(av>=0){return FN;}else{return FO;}};$pkg.Inf=GK;GL=function(av,aw){var av,aw;if(av===FN){return aw>=0;}if(av===FO){return aw<=0;}return false;};$pkg.IsInf=GL;GM=function(av){var av,aw;aw=false;aw=!((av===av));return aw;};$pkg.IsNaN=GM;GS=function(av,aw){var av,aw;return EX(av,aw);};$pkg.Max=GS;GT=function(av,aw){var av,aw;return EY(av,aw);};$pkg.Min=GT;GW=function(){return FP;};$pkg.NaN=GW;GX=function(av,aw){var av,aw;if((av===1)||((av===-1)&&((aw===FN)||(aw===FO)))){return 1;}return $parseFloat(FL.pow(av,aw));};$pkg.Pow=GX;GZ=function(av){var av;return av<0||(1/av===FO);};$pkg.Signbit=GZ;HA=function(av){var av;return $parseFloat(FL.sin(av));};$pkg.Sin=HA;HD=function(av){var av;return $parseFloat(FL.sqrt(av));};$pkg.Sqrt=HD;HI=function(){var av;av=new($global.ArrayBuffer)(8);HH.uint32array=new($global.Uint32Array)(av);HH.float32array=new($global.Float32Array)(av);HH.float64array=new($global.Float64Array)(av);};HL=function(av){var av,aw,ax;HH.float64array[0]=av;return(aw=$shiftLeft64((new $Uint64(0,HH.uint32array[1])),32),ax=(new $Uint64(0,HH.uint32array[0])),new $Uint64(aw.$high+ax.$high,aw.$low+ax.$low));};$pkg.Float64bits=HL;HM=function(av){var av;HH.uint32array[0]=((av.$low>>>0));HH.uint32array[1]=(($shiftRightUint64(av,32).$low>>>0));return HH.float64array[0];};$pkg.Float64frombits=HM;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=B.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}HH=new IW.ptr(IT.zero(),IU.zero(),IV.zero());FL=$global.Math;FM=0;FN=1/FM;FO=-1/FM;FP=$parseFloat($NaN);HI();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["math"]=(function(){var $pkg={},$init,B,A,IT,IU,IV,IW,FL,FM,FN,FO,FP,HH,EX,EY,FK,GA,GH,GK,GL,GM,GS,GT,GW,GX,GZ,HA,HD,HI,HL,HM;B=$packages["github.com/gopherjs/gopherjs/js"];A=$packages["math/bits"];IT=$arrayType($Uint32,2);IU=$arrayType($Float32,2);IV=$arrayType($Float64,1);IW=$structType("math",[{prop:"uint32array",name:"uint32array",embedded:false,exported:false,typ:IT,tag:""},{prop:"float32array",name:"float32array",embedded:false,exported:false,typ:IU,tag:""},{prop:"float64array",name:"float64array",embedded:false,exported:false,typ:IV,tag:""}]);EX=function(av,aw){var av,aw;if(GL(av,1)||GL(aw,1)){return GK(1);}else if(GM(av)||GM(aw)){return GW();}else if((av===0)&&(av===aw)){if(GZ(av)){return aw;}return av;}if(av>aw){return av;}return aw;};EY=function(av,aw){var av,aw;if(GL(av,-1)||GL(aw,-1)){return GK(-1);}else if(GM(av)||GM(aw)){return GW();}else if((av===0)&&(av===aw)){if(GZ(av)){return av;}return aw;}if(av>>0)));};$pkg.Abs=FK;GA=function(av){var av;return $parseFloat(FL.cos(av));};$pkg.Cos=GA;GH=function(av){var av;return $parseFloat(FL.floor(av));};$pkg.Floor=GH;GK=function(av){var av;if(av>=0){return FN;}else{return FO;}};$pkg.Inf=GK;GL=function(av,aw){var av,aw;if(av===FN){return aw>=0;}if(av===FO){return aw<=0;}return false;};$pkg.IsInf=GL;GM=function(av){var av,aw;aw=false;aw=!((av===av));return aw;};$pkg.IsNaN=GM;GS=function(av,aw){var av,aw;return EX(av,aw);};$pkg.Max=GS;GT=function(av,aw){var av,aw;return EY(av,aw);};$pkg.Min=GT;GW=function(){return FP;};$pkg.NaN=GW;GX=function(av,aw){var av,aw;if((av===1)||((av===-1)&&((aw===FN)||(aw===FO)))){return 1;}return $parseFloat(FL.pow(av,aw));};$pkg.Pow=GX;GZ=function(av){var av;return av<0||(1/av===FO);};$pkg.Signbit=GZ;HA=function(av){var av;return $parseFloat(FL.sin(av));};$pkg.Sin=HA;HD=function(av){var av;return $parseFloat(FL.sqrt(av));};$pkg.Sqrt=HD;HI=function(){var av;av=new($global.ArrayBuffer)(8);HH.uint32array=new($global.Uint32Array)(av);HH.float32array=new($global.Float32Array)(av);HH.float64array=new($global.Float64Array)(av);};HL=function(av){var av,aw,ax;HH.float64array[0]=av;return(aw=$shiftLeft64((new $Uint64(0,HH.uint32array[1])),32),ax=(new $Uint64(0,HH.uint32array[0])),new $Uint64(aw.$high+ax.$high,aw.$low+ax.$low));};$pkg.Float64bits=HL;HM=function(av){var av;HH.uint32array[0]=((av.$low>>>0));HH.uint32array[1]=(($shiftRightUint64(av,32).$low>>>0));return HH.float64array[0];};$pkg.Float64frombits=HM;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=B.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}HH=new IW.ptr(IT.zero(),IU.zero(),IV.zero());FL=$global.Math;FM=0;FN=1/FM;FO=-1/FM;FP=$parseFloat($NaN);HI();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["internal/goarch"]=(function(){var $pkg={},$init;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["internal/unsafeheader"]=(function(){var $pkg={},$init;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["internal/reflectlite"]=(function(){var $pkg={},$init,D,A,B,C,E,F,I,O,P,Q,R,S,T,U,V,W,X,Y,Z,AA,AB,AC,AG,AH,AI,AT,AV,BL,BN,BO,BP,CU,CW,DU,DV,DW,DX,DY,DZ,EA,EC,ED,EE,EF,EG,EH,EI,EJ,EK,EL,EM,EN,EO,ES,ET,EU,EV,EW,EX,EY,EZ,AD,AR,BB,BD,BE,BF,BG,BH,BM,BQ,BS,BU,DH,DN,AK,AL,AM,AN,AP,AQ,AU,BA,BC,BI,BJ,BK,BR,BT,BV,BW,BX,BY,BZ,CB,CC,CF,CH,CJ,CM,CQ,CR,CV,CX,CY,CZ,DC,DD,DE,DF,DG,DI,DJ,DK,DL,DM;D=$packages["github.com/gopherjs/gopherjs/js"];A=$packages["internal/goarch"];B=$packages["internal/unsafeheader"];C=$packages["runtime"];E=$pkg.Value=$newType(0,$kindStruct,"reflectlite.Value",true,"internal/reflectlite",true,function(typ_,ptr_,flag_){this.$val=this;if(arguments.length===0){this.typ=DU.nil;this.ptr=0;this.flag=0;return;}this.typ=typ_;this.ptr=ptr_;this.flag=flag_;});F=$pkg.flag=$newType(4,$kindUintptr,"reflectlite.flag",true,"internal/reflectlite",false,null);I=$pkg.ValueError=$newType(0,$kindStruct,"reflectlite.ValueError",true,"internal/reflectlite",true,function(Method_,Kind_){this.$val=this;if(arguments.length===0){this.Method="";this.Kind=0;return;}this.Method=Method_;this.Kind=Kind_;});O=$pkg.Type=$newType(8,$kindInterface,"reflectlite.Type",true,"internal/reflectlite",true,null);P=$pkg.Kind=$newType(4,$kindUint,"reflectlite.Kind",true,"internal/reflectlite",true,null);Q=$pkg.tflag=$newType(1,$kindUint8,"reflectlite.tflag",true,"internal/reflectlite",false,null);R=$pkg.rtype=$newType(0,$kindStruct,"reflectlite.rtype",true,"internal/reflectlite",false,function(size_,ptrdata_,hash_,tflag_,align_,fieldAlign_,kind_,equal_,gcdata_,str_,ptrToThis_){this.$val=this;if(arguments.length===0){this.size=0;this.ptrdata=0;this.hash=0;this.tflag=0;this.align=0;this.fieldAlign=0;this.kind=0;this.equal=$throwNilPointerError;this.gcdata=EG.nil;this.str=0;this.ptrToThis=0;return;}this.size=size_;this.ptrdata=ptrdata_;this.hash=hash_;this.tflag=tflag_;this.align=align_;this.fieldAlign=fieldAlign_;this.kind=kind_;this.equal=equal_;this.gcdata=gcdata_;this.str=str_;this.ptrToThis=ptrToThis_;});S=$pkg.method=$newType(0,$kindStruct,"reflectlite.method",true,"internal/reflectlite",false,function(name_,mtyp_,ifn_,tfn_){this.$val=this;if(arguments.length===0){this.name=0;this.mtyp=0;this.ifn=0;this.tfn=0;return;}this.name=name_;this.mtyp=mtyp_;this.ifn=ifn_;this.tfn=tfn_;});T=$pkg.chanDir=$newType(4,$kindInt,"reflectlite.chanDir",true,"internal/reflectlite",false,null);U=$pkg.arrayType=$newType(0,$kindStruct,"reflectlite.arrayType",true,"internal/reflectlite",false,function(rtype_,elem_,slice_,len_){this.$val=this;if(arguments.length===0){this.rtype=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);this.elem=DU.nil;this.slice=DU.nil;this.len=0;return;}this.rtype=rtype_;this.elem=elem_;this.slice=slice_;this.len=len_;});V=$pkg.chanType=$newType(0,$kindStruct,"reflectlite.chanType",true,"internal/reflectlite",false,function(rtype_,elem_,dir_){this.$val=this;if(arguments.length===0){this.rtype=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);this.elem=DU.nil;this.dir=0;return;}this.rtype=rtype_;this.elem=elem_;this.dir=dir_;});W=$pkg.imethod=$newType(0,$kindStruct,"reflectlite.imethod",true,"internal/reflectlite",false,function(name_,typ_){this.$val=this;if(arguments.length===0){this.name=0;this.typ=0;return;}this.name=name_;this.typ=typ_;});X=$pkg.interfaceType=$newType(0,$kindStruct,"reflectlite.interfaceType",true,"internal/reflectlite",false,function(rtype_,pkgPath_,methods_){this.$val=this;if(arguments.length===0){this.rtype=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);this.pkgPath=new BO.ptr(EG.nil);this.methods=EK.nil;return;}this.rtype=rtype_;this.pkgPath=pkgPath_;this.methods=methods_;});Y=$pkg.mapType=$newType(0,$kindStruct,"reflectlite.mapType",true,"internal/reflectlite",false,function(rtype_,key_,elem_,bucket_,hasher_,keysize_,valuesize_,bucketsize_,flags_){this.$val=this;if(arguments.length===0){this.rtype=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);this.key=DU.nil;this.elem=DU.nil;this.bucket=DU.nil;this.hasher=$throwNilPointerError;this.keysize=0;this.valuesize=0;this.bucketsize=0;this.flags=0;return;}this.rtype=rtype_;this.key=key_;this.elem=elem_;this.bucket=bucket_;this.hasher=hasher_;this.keysize=keysize_;this.valuesize=valuesize_;this.bucketsize=bucketsize_;this.flags=flags_;});Z=$pkg.ptrType=$newType(0,$kindStruct,"reflectlite.ptrType",true,"internal/reflectlite",false,function(rtype_,elem_){this.$val=this;if(arguments.length===0){this.rtype=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);this.elem=DU.nil;return;}this.rtype=rtype_;this.elem=elem_;});AA=$pkg.sliceType=$newType(0,$kindStruct,"reflectlite.sliceType",true,"internal/reflectlite",false,function(rtype_,elem_){this.$val=this;if(arguments.length===0){this.rtype=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);this.elem=DU.nil;return;}this.rtype=rtype_;this.elem=elem_;});AB=$pkg.structField=$newType(0,$kindStruct,"reflectlite.structField",true,"internal/reflectlite",false,function(name_,typ_,offsetEmbed_){this.$val=this;if(arguments.length===0){this.name=new BO.ptr(EG.nil);this.typ=DU.nil;this.offsetEmbed=0;return;}this.name=name_;this.typ=typ_;this.offsetEmbed=offsetEmbed_;});AC=$pkg.structType=$newType(0,$kindStruct,"reflectlite.structType",true,"internal/reflectlite",false,function(rtype_,pkgPath_,fields_){this.$val=this;if(arguments.length===0){this.rtype=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);this.pkgPath=new BO.ptr(EG.nil);this.fields=EL.nil;return;}this.rtype=rtype_;this.pkgPath=pkgPath_;this.fields=fields_;});AG=$pkg.nameOff=$newType(4,$kindInt32,"reflectlite.nameOff",true,"internal/reflectlite",false,null);AH=$pkg.typeOff=$newType(4,$kindInt32,"reflectlite.typeOff",true,"internal/reflectlite",false,null);AI=$pkg.textOff=$newType(4,$kindInt32,"reflectlite.textOff",true,"internal/reflectlite",false,null);AT=$pkg.errorString=$newType(0,$kindStruct,"reflectlite.errorString",true,"internal/reflectlite",false,function(s_){this.$val=this;if(arguments.length===0){this.s="";return;}this.s=s_;});AV=$pkg.Method=$newType(0,$kindStruct,"reflectlite.Method",true,"internal/reflectlite",true,function(Name_,PkgPath_,Type_,Func_,Index_){this.$val=this;if(arguments.length===0){this.Name="";this.PkgPath="";this.Type=$ifaceNil;this.Func=new E.ptr(DU.nil,0,0);this.Index=0;return;}this.Name=Name_;this.PkgPath=PkgPath_;this.Type=Type_;this.Func=Func_;this.Index=Index_;});BL=$pkg.uncommonType=$newType(0,$kindStruct,"reflectlite.uncommonType",true,"internal/reflectlite",false,function(pkgPath_,mcount_,xcount_,moff_,_methods_){this.$val=this;if(arguments.length===0){this.pkgPath=0;this.mcount=0;this.xcount=0;this.moff=0;this._methods=ED.nil;return;}this.pkgPath=pkgPath_;this.mcount=mcount_;this.xcount=xcount_;this.moff=moff_;this._methods=_methods_;});BN=$pkg.funcType=$newType(0,$kindStruct,"reflectlite.funcType",true,"internal/reflectlite",false,function(rtype_,inCount_,outCount_,_in_,_out_){this.$val=this;if(arguments.length===0){this.rtype=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);this.inCount=0;this.outCount=0;this._in=DW.nil;this._out=DW.nil;return;}this.rtype=rtype_;this.inCount=inCount_;this.outCount=outCount_;this._in=_in_;this._out=_out_;});BO=$pkg.name=$newType(0,$kindStruct,"reflectlite.name",true,"internal/reflectlite",false,function(bytes_){this.$val=this;if(arguments.length===0){this.bytes=EG.nil;return;}this.bytes=bytes_;});BP=$pkg.nameData=$newType(0,$kindStruct,"reflectlite.nameData",true,"internal/reflectlite",false,function(name_,tag_,exported_){this.$val=this;if(arguments.length===0){this.name="";this.tag="";this.exported=false;return;}this.name=name_;this.tag=tag_;this.exported=exported_;});CU=$pkg.mapIter=$newType(0,$kindStruct,"reflectlite.mapIter",true,"internal/reflectlite",false,function(t_,m_,keys_,i_,last_){this.$val=this;if(arguments.length===0){this.t=$ifaceNil;this.m=null;this.keys=null;this.i=0;this.last=null;return;}this.t=t_;this.m=m_;this.keys=keys_;this.i=i_;this.last=last_;});CW=$pkg.TypeEx=$newType(8,$kindInterface,"reflectlite.TypeEx",true,"internal/reflectlite",true,null);DU=$ptrType(R);DV=$sliceType(BO);DW=$sliceType(DU);DX=$sliceType($String);DY=$sliceType($emptyInterface);DZ=$ptrType(D.Object);EA=$funcType([DY],[DZ],true);EC=$ptrType(BL);ED=$sliceType(S);EE=$ptrType(BN);EF=$sliceType(E);EG=$ptrType($Uint8);EH=$ptrType($UnsafePointer);EI=$sliceType(O);EJ=$sliceType(DZ);EK=$sliceType(W);EL=$sliceType(AB);EM=$ptrType(BP);EN=$structType("internal/reflectlite",[{prop:"str",name:"str",embedded:false,exported:false,typ:$String,tag:""}]);EO=$ptrType(CU);ES=$arrayType($Uintptr,2);ET=$sliceType($Uint8);EU=$ptrType(I);EV=$funcType([$UnsafePointer,$UnsafePointer],[$Bool],false);EW=$ptrType(X);EX=$funcType([$UnsafePointer,$Uintptr],[$Uintptr],false);EY=$ptrType(AB);EZ=$ptrType(AT);F.prototype.kind=function(){var m;m=this.$val;return((((m&31)>>>0)>>>0));};$ptrType(F).prototype.kind=function(){return new F(this.$get()).kind();};F.prototype.ro=function(){var m;m=this.$val;if(!((((m&96)>>>0)===0))){return 32;}return 0;};$ptrType(F).prototype.ro=function(){return new F(this.$get()).ro();};E.ptr.prototype.pointer=function(){var m;m=this;if(!((m.typ.size===4))||!m.typ.pointers()){$panic(new $String("can't call pointer on a non-pointer Value"));}if(!((((m.flag&128)>>>0)===0))){return(m.ptr).$get();}return m.ptr;};E.prototype.pointer=function(){return this.$val.pointer();};I.ptr.prototype.Error=function(){var m;m=this;if(m.Kind===0){return"reflect: call of "+m.Method+" on zero Value";}return"reflect: call of "+m.Method+" on "+new P(m.Kind).String()+" Value";};I.prototype.Error=function(){return this.$val.Error();};F.prototype.mustBeExported=function(){var m;m=this.$val;if(m===0){$panic(new I.ptr(DF(),0));}if(!((((m&96)>>>0)===0))){$panic(new $String("reflect: "+DF()+" using value obtained using unexported field"));}};$ptrType(F).prototype.mustBeExported=function(){return new F(this.$get()).mustBeExported();};F.prototype.mustBeAssignable=function(){var m;m=this.$val;if(m===0){$panic(new I.ptr(DF(),0));}if(!((((m&96)>>>0)===0))){$panic(new $String("reflect: "+DF()+" using value obtained using unexported field"));}if(((m&256)>>>0)===0){$panic(new $String("reflect: "+DF()+" using unaddressable value"));}};$ptrType(F).prototype.mustBeAssignable=function(){return new F(this.$get()).mustBeAssignable();};E.ptr.prototype.CanSet=function(){var m;m=this;return((m.flag&352)>>>0)===256;};E.prototype.CanSet=function(){return this.$val.CanSet();};E.ptr.prototype.IsValid=function(){var m;m=this;return!((m.flag===0));};E.prototype.IsValid=function(){return this.$val.IsValid();};E.ptr.prototype.Kind=function(){var m;m=this;return new F(m.flag).kind();};E.prototype.Kind=function(){return this.$val.Kind();};E.ptr.prototype.Type=function(){var m,n;m=this;n=m.flag;if(n===0){$panic(new I.ptr("reflectlite.Value.Type",0));}return m.typ;};E.prototype.Type=function(){return this.$val.Type();};AB.ptr.prototype.embedded=function(){var m;m=this;return!((((m.offsetEmbed&1)>>>0)===0));};AB.prototype.embedded=function(){return this.$val.embedded();};P.prototype.String=function(){var m;m=this.$val;if(((m>>0))=AD.$length)?($throwRuntimeError("index out of range"),undefined):AD.$array[AD.$offset+m]);}return(0>=AD.$length?($throwRuntimeError("index out of range"),undefined):AD.$array[AD.$offset+0]);};$ptrType(P).prototype.String=function(){return new P(this.$get()).String();};R.ptr.prototype.String=function(){var m,n;m=this;n=$clone(m.nameOff(m.str),BO).name();if(!((((m.tflag&2)>>>0)===0))){return $substring(n,1);}return n;};R.prototype.String=function(){return this.$val.String();};R.ptr.prototype.Size=function(){var m;m=this;return m.size;};R.prototype.Size=function(){return this.$val.Size();};R.ptr.prototype.Kind=function(){var m;m=this;return((((m.kind&31)>>>0)>>>0));};R.prototype.Kind=function(){return this.$val.Kind();};R.ptr.prototype.pointers=function(){var m;m=this;return!((m.ptrdata===0));};R.prototype.pointers=function(){return this.$val.pointers();};R.ptr.prototype.common=function(){var m;m=this;return m;};R.prototype.common=function(){return this.$val.common();};R.ptr.prototype.exportedMethods=function(){var m,n;m=this;n=m.uncommon();if(n===EC.nil){return ED.nil;}return n.exportedMethods();};R.prototype.exportedMethods=function(){return this.$val.exportedMethods();};R.ptr.prototype.NumMethod=function(){var m,n;m=this;if(m.Kind()===20){n=(m.kindType);return n.NumMethod();}return m.exportedMethods().$length;};R.prototype.NumMethod=function(){return this.$val.NumMethod();};R.ptr.prototype.PkgPath=function(){var m,n;m=this;if(((m.tflag&4)>>>0)===0){return"";}n=m.uncommon();if(n===EC.nil){return"";}return $clone(m.nameOff(n.pkgPath),BO).name();};R.prototype.PkgPath=function(){return this.$val.PkgPath();};R.ptr.prototype.hasName=function(){var m;m=this;return!((((m.tflag&4)>>>0)===0));};R.prototype.hasName=function(){return this.$val.hasName();};R.ptr.prototype.Name=function(){var m,n,o;m=this;if(!m.hasName()){return"";}n=m.String();o=n.length-1>>0;while(true){if(!(o>=0&&!((n.charCodeAt(o)===46)))){break;}o=o-(1)>>0;}return $substring(n,(o+1>>0));};R.prototype.Name=function(){return this.$val.Name();};R.ptr.prototype.chanDir=function(){var m,n;m=this;if(!((m.Kind()===18))){$panic(new $String("reflect: chanDir of non-chan type"));}n=(m.kindType);return((n.dir>>0));};R.prototype.chanDir=function(){return this.$val.chanDir();};R.ptr.prototype.Elem=function(){var m,n,o,p,q,r,s;m=this;n=m.Kind();if(n===(17)){o=(m.kindType);return AP(o.elem);}else if(n===(18)){p=(m.kindType);return AP(p.elem);}else if(n===(21)){q=(m.kindType);return AP(q.elem);}else if(n===(22)){r=(m.kindType);return AP(r.elem);}else if(n===(23)){s=(m.kindType);return AP(s.elem);}$panic(new $String("reflect: Elem of invalid type"));};R.prototype.Elem=function(){return this.$val.Elem();};R.ptr.prototype.In=function(m){var m,n,o,p;n=this;if(!((n.Kind()===19))){$panic(new $String("reflect: In of non-func type"));}o=(n.kindType);return AP((p=o.in$(),((m<0||m>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+m])));};R.prototype.In=function(m){return this.$val.In(m);};R.ptr.prototype.Len=function(){var m,n;m=this;if(!((m.Kind()===17))){$panic(new $String("reflect: Len of non-array type"));}n=(m.kindType);return((n.len>>0));};R.prototype.Len=function(){return this.$val.Len();};R.ptr.prototype.NumIn=function(){var m,n;m=this;if(!((m.Kind()===19))){$panic(new $String("reflect: NumIn of non-func type"));}n=(m.kindType);return((n.inCount>>0));};R.prototype.NumIn=function(){return this.$val.NumIn();};R.ptr.prototype.NumOut=function(){var m,n;m=this;if(!((m.Kind()===19))){$panic(new $String("reflect: NumOut of non-func type"));}n=(m.kindType);return n.out().$length;};R.prototype.NumOut=function(){return this.$val.NumOut();};R.ptr.prototype.Out=function(m){var m,n,o,p;n=this;if(!((n.Kind()===19))){$panic(new $String("reflect: Out of non-func type"));}o=(n.kindType);return AP((p=o.out(),((m<0||m>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+m])));};R.prototype.Out=function(m){return this.$val.Out(m);};X.ptr.prototype.NumMethod=function(){var m;m=this;return m.methods.$length;};X.prototype.NumMethod=function(){return this.$val.NumMethod();};R.ptr.prototype.Implements=function(m){var{m,n,o,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=this;if($interfaceIsEqual(m,$ifaceNil)){$panic(new $String("reflect: nil type passed to Type.Implements"));}o=m.Kind();$s=3;case 3:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}if(!((o===20))){$s=1;continue;}$s=2;continue;case 1:$panic(new $String("reflect: non-interface type passed to Type.Implements"));case 2:$s=-1;return AK($assertType(m,DU),n);}return;}var $f={$blk:R.ptr.prototype.Implements,$c:true,$r,m,n,o,$s};return $f;};R.prototype.Implements=function(m){return this.$val.Implements(m);};R.ptr.prototype.AssignableTo=function(m){var{m,n,o,p,q,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=this;if($interfaceIsEqual(m,$ifaceNil)){$panic(new $String("reflect: nil type passed to Type.AssignableTo"));}o=$assertType(m,DU);p=AL(o,n);$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}q=p||AK(o,n);$s=2;case 2:return q;}return;}var $f={$blk:R.ptr.prototype.AssignableTo,$c:true,$r,m,n,o,p,q,$s};return $f;};R.prototype.AssignableTo=function(m){return this.$val.AssignableTo(m);};AK=function(m,n){var aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,m,n,o,p,q,r,s,t,u,v,w,x,y,z;if(!((m.Kind()===20))){return false;}o=(m.kindType);if(o.methods.$length===0){return true;}if(n.Kind()===20){p=(n.kindType);q=0;r=0;while(true){if(!(r=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+q]));u=$clone(o.rtype.nameOff(t.name),BO);w=(v=p.methods,((r<0||r>=v.$length)?($throwRuntimeError("index out of range"),undefined):v.$array[v.$offset+r]));x=$clone(n.nameOff(w.name),BO);if($clone(x,BO).name()===$clone(u,BO).name()&&n.typeOff(w.typ)===o.rtype.typeOff(t.typ)){if(!$clone(u,BO).isExported()){y=$clone(u,BO).pkgPath();if(y===""){y=$clone(o.pkgPath,BO).name();}z=$clone(x,BO).pkgPath();if(z===""){z=$clone(p.pkgPath,BO).name();}if(!(y===z)){r=r+(1)>>0;continue;}}q=q+(1)>>0;if(q>=o.methods.$length){return true;}}r=r+(1)>>0;}return false;}aa=n.uncommon();if(aa===EC.nil){return false;}ab=0;ac=aa.methods();ad=0;while(true){if(!(ad<((aa.mcount>>0)))){break;}af=(ae=o.methods,((ab<0||ab>=ae.$length)?($throwRuntimeError("index out of range"),undefined):ae.$array[ae.$offset+ab]));ag=$clone(o.rtype.nameOff(af.name),BO);ah=$clone(((ad<0||ad>=ac.$length)?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+ad]),S);ai=$clone(n.nameOff(ah.name),BO);if($clone(ai,BO).name()===$clone(ag,BO).name()&&n.typeOff(ah.mtyp)===o.rtype.typeOff(af.typ)){if(!$clone(ag,BO).isExported()){aj=$clone(ag,BO).pkgPath();if(aj===""){aj=$clone(o.pkgPath,BO).name();}ak=$clone(ai,BO).pkgPath();if(ak===""){ak=$clone(n.nameOff(aa.pkgPath),BO).name();}if(!(aj===ak)){ad=ad+(1)>>0;continue;}}ab=ab+(1)>>0;if(ab>=o.methods.$length){return true;}}ad=ad+(1)>>0;}return false;};AL=function(m,n){var{m,n,o,p,$s,$r,$c}=$restore(this,{m,n});$s=$s||0;s:while(true){switch($s){case 0:if(m===n){$s=-1;return true;}if(m.hasName()&&n.hasName()||!((m.Kind()===n.Kind()))){$s=-1;return false;}o=AN(m,n,true);$s=1;case 1:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}p=o;$s=2;case 2:return p;}return;}var $f={$blk:AL,$c:true,$r,m,n,o,p,$s};return $f;};AM=function(m,n,o){var{m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{m,n,o});$s=$s||0;s:while(true){switch($s){case 0:if(o){$s=-1;return $interfaceIsEqual(m,n);}q=m.Name();$s=4;case 4:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}r=n.Name();$s=5;case 5:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}if(!(q===r)){p=true;$s=3;continue s;}s=m.Kind();$s=6;case 6:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}t=n.Kind();$s=7;case 7:if($c){$c=false;t=t.$blk();}if(t&&t.$blk!==undefined){break s;}p=!((s===t));case 3:if(p){$s=1;continue;}$s=2;continue;case 1:$s=-1;return false;case 2:u=m.common();$s=8;case 8:if($c){$c=false;u=u.$blk();}if(u&&u.$blk!==undefined){break s;}v=u;w=n.common();$s=9;case 9:if($c){$c=false;w=w.$blk();}if(w&&w.$blk!==undefined){break s;}x=w;y=AN(v,x,false);$s=10;case 10:if($c){$c=false;y=y.$blk();}if(y&&y.$blk!==undefined){break s;}z=y;$s=11;case 11:return z;}return;}var $f={$blk:AM,$c:true,$r,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};AN=function(m,n,o){var{aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{m,n,o});$s=$s||0;s:while(true){switch($s){case 0:if(m===n){$s=-1;return true;}p=m.Kind();if(!((p===n.Kind()))){$s=-1;return false;}if(1<=p&&p<=16||(p===24)||(p===26)){$s=-1;return true;}q=p;if(q===(17)){$s=2;continue;}if(q===(18)){$s=3;continue;}if(q===(19)){$s=4;continue;}if(q===(20)){$s=5;continue;}if(q===(21)){$s=6;continue;}if((q===(22))||(q===(23))){$s=7;continue;}if(q===(25)){$s=8;continue;}$s=9;continue;case 2:if(!(m.Len()===n.Len())){r=false;$s=10;continue s;}s=AM(m.Elem(),n.Elem(),o);$s=11;case 11:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}r=s;case 10:t=r;$s=12;case 12:return t;case 3:if(!(n.chanDir()===3)){u=false;$s=15;continue s;}v=AM(m.Elem(),n.Elem(),o);$s=16;case 16:if($c){$c=false;v=v.$blk();}if(v&&v.$blk!==undefined){break s;}u=v;case 15:if(u){$s=13;continue;}$s=14;continue;case 13:$s=-1;return true;case 14:if(!(n.chanDir()===m.chanDir())){w=false;$s=17;continue s;}x=AM(m.Elem(),n.Elem(),o);$s=18;case 18:if($c){$c=false;x=x.$blk();}if(x&&x.$blk!==undefined){break s;}w=x;case 17:y=w;$s=19;case 19:return y;case 4:z=(m.kindType);aa=(n.kindType);if(!((z.outCount===aa.outCount))||!((z.inCount===aa.inCount))){$s=-1;return false;}ab=0;case 20:if(!(ab>0;$s=20;continue;case 21:ad=0;case 25:if(!(ad>0;$s=25;continue;case 26:$s=-1;return true;case 5:af=(m.kindType);ag=(n.kindType);if((af.methods.$length===0)&&(ag.methods.$length===0)){$s=-1;return true;}$s=-1;return false;case 6:ai=AM(m.Key(),n.Key(),o);$s=31;case 31:if($c){$c=false;ai=ai.$blk();}if(ai&&ai.$blk!==undefined){break s;}if(!(ai)){ah=false;$s=30;continue s;}aj=AM(m.Elem(),n.Elem(),o);$s=32;case 32:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}ah=aj;case 30:ak=ah;$s=33;case 33:return ak;case 7:al=AM(m.Elem(),n.Elem(),o);$s=34;case 34:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}am=al;$s=35;case 35:return am;case 8:an=(m.kindType);ao=(n.kindType);if(!((an.fields.$length===ao.fields.$length))){$s=-1;return false;}if(!($clone(an.pkgPath,BO).name()===$clone(ao.pkgPath,BO).name())){$s=-1;return false;}ap=an.fields;aq=0;case 36:if(!(aq=as.$length)?($throwRuntimeError("index out of range"),undefined):as.$array[as.$offset+ar]));av=(au=ao.fields,((ar<0||ar>=au.$length)?($throwRuntimeError("index out of range"),undefined):au.$array[au.$offset+ar]));if(!($clone(at.name,BO).name()===$clone(av.name,BO).name())){$s=-1;return false;}aw=AM(at.typ,av.typ,o);$s=40;case 40:if($c){$c=false;aw=aw.$blk();}if(aw&&aw.$blk!==undefined){break s;}if(!aw){$s=38;continue;}$s=39;continue;case 38:$s=-1;return false;case 39:if(o&&!($clone(at.name,BO).tag()===$clone(av.name,BO).tag())){$s=-1;return false;}if(!((at.offsetEmbed===av.offsetEmbed))){$s=-1;return false;}aq++;$s=36;continue;case 37:$s=-1;return true;case 9:case 1:$s=-1;return false;}return;}var $f={$blk:AN,$c:true,$r,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};AP=function(m){var m;if(m===DU.nil){return $ifaceNil;}return m;};AQ=function(m){var m;return((m.kind&32)>>>0)===0;};E.ptr.prototype.object=function(){var m,n,o,p;m=this;if((m.typ.Kind()===17)||(m.typ.Kind()===25)){return m.ptr;}if(!((((m.flag&128)>>>0)===0))){n=m.ptr.$get();if(!(n===$ifaceNil)&&!(n.constructor===BI(m.typ))){switch(0){default:o=m.typ.Kind();if((o===(11))||(o===(6))){n=new(BI(m.typ))(n.$high,n.$low);}else if((o===(15))||(o===(16))){n=new(BI(m.typ))(n.$real,n.$imag);}else if(o===(23)){if(n===n.constructor.nil){n=BI(m.typ).nil;break;}p=new(BI(m.typ))(n.$array);p.$offset=n.$offset;p.$length=n.$length;p.$capacity=n.$capacity;n=p;}}}return n;}return m.ptr;};E.prototype.object=function(){return this.$val.object();};E.ptr.prototype.assignTo=function(m,n,o){var{m,n,o,p,q,r,s,t,u,$s,$r,$c}=$restore(this,{m,n,o});$s=$s||0;s:while(true){switch($s){case 0:p=this;if(!((((p.flag&512)>>>0)===0))){$s=1;continue;}$s=2;continue;case 1:q=DG(m,$clone(p,E));$s=3;case 3:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}E.copy(p,q);case 2:r=AL(n,p.typ);$s=8;case 8:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}if(r){$s=5;continue;}if(AK(n,p.typ)){$s=6;continue;}$s=7;continue;case 5:s=(((p.flag&384)>>>0)|new F(p.flag).ro())>>>0;s=(s|(((n.Kind()>>>0))))>>>0;$s=-1;return new E.ptr(n,p.ptr,s);case 6:if(o===0){o=CJ(n);}t=DD($clone(p,E));$s=9;case 9:if($c){$c=false;t=t.$blk();}if(t&&t.$blk!==undefined){break s;}u=t;if(n.NumMethod()===0){(o).$set(u);}else{DE(n,u,o);}$s=-1;return new E.ptr(n,o,148);case 7:case 4:$panic(new $String(m+": value of type "+p.typ.String()+" is not assignable to type "+n.String()));$s=-1;return new E.ptr(DU.nil,0,0);}return;}var $f={$blk:E.ptr.prototype.assignTo,$c:true,$r,m,n,o,p,q,r,s,t,u,$s};return $f;};E.prototype.assignTo=function(m,n,o){return this.$val.assignTo(m,n,o);};E.ptr.prototype.Cap=function(){var m,n,o;m=this;n=new F(m.flag).kind();o=n;if(o===(17)){return m.typ.Len();}else if((o===(18))||(o===(23))){return $parseInt($clone(m,E).object().$capacity)>>0;}$panic(new I.ptr("reflect.Value.Cap",n));};E.prototype.Cap=function(){return this.$val.Cap();};E.ptr.prototype.Index=function(m){var{aa,ab,ac,ad,ae,af,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:m=[m];n=[n];o=[o];p=[p];q=[q];r=[r];s=this;t=new F(s.flag).kind();u=t;if(u===(17)){$s=2;continue;}if(u===(23)){$s=3;continue;}if(u===(24)){$s=4;continue;}$s=5;continue;case 2:v=(s.typ.kindType);if(m[0]<0||m[0]>((v.len>>0))){$panic(new $String("reflect: array index out of range"));}q[0]=v.elem;w=(((((s.flag&384)>>>0)|new F(s.flag).ro())>>>0)|((q[0].Kind()>>>0)))>>>0;n[0]=s.ptr;if(!((((w&128)>>>0)===0))&&!((q[0].Kind()===17))&&!((q[0].Kind()===25))){$s=7;continue;}$s=8;continue;case 7:$s=-1;return new E.ptr(q[0],(new(BI(DL(q[0])))((function(m,n,o,p,q,r){return function(){return DI(q[0],n[0][m[0]]);};})(m,n,o,p,q,r),(function(m,n,o,p,q,r){return function(x){var x;n[0][m[0]]=DJ(q[0],x);};})(m,n,o,p,q,r))),w);case 8:x=BZ(q[0],DI(q[0],n[0][m[0]]),w);$s=9;case 9:if($c){$c=false;x=x.$blk();}if(x&&x.$blk!==undefined){break s;}y=x;$s=10;case 10:return y;case 3:z=$clone(s,E).object();if(m[0]<0||m[0]>=($parseInt(z.$length)>>0)){$panic(new $String("reflect: slice index out of range"));}aa=(s.typ.kindType);r[0]=aa.elem;ab=(((384|new F(s.flag).ro())>>>0)|((r[0].Kind()>>>0)))>>>0;m[0]=m[0]+(($parseInt(z.$offset)>>0))>>0;o[0]=z.$array;if(!((((ab&128)>>>0)===0))&&!((r[0].Kind()===17))&&!((r[0].Kind()===25))){$s=11;continue;}$s=12;continue;case 11:$s=-1;return new E.ptr(r[0],(new(BI(DL(r[0])))((function(m,n,o,p,q,r){return function(){return DI(r[0],o[0][m[0]]);};})(m,n,o,p,q,r),(function(m,n,o,p,q,r){return function(ac){var ac;o[0][m[0]]=DJ(r[0],ac);};})(m,n,o,p,q,r))),ab);case 12:ac=BZ(r[0],DI(r[0],o[0][m[0]]),ab);$s=13;case 13:if($c){$c=false;ac=ac.$blk();}if(ac&&ac.$blk!==undefined){break s;}ad=ac;$s=14;case 14:return ad;case 4:ae=(s.ptr).$get();if(m[0]<0||m[0]>=ae.length){$panic(new $String("reflect: string index out of range"));}af=(((new F(s.flag).ro()|8)>>>0)|128)>>>0;p[0]=ae.charCodeAt(m[0]);$s=-1;return new E.ptr(BD,((p.$ptr||(p.$ptr=new EG(function(){return this.$target[0];},function($v){this.$target[0]=$v;},p)))),af);case 5:$panic(new I.ptr("reflect.Value.Index",t));case 6:case 1:$s=-1;return new E.ptr(DU.nil,0,0);}return;}var $f={$blk:E.ptr.prototype.Index,$c:true,$r,aa,ab,ac,ad,ae,af,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};E.prototype.Index=function(m){return this.$val.Index(m);};E.ptr.prototype.InterfaceData=function(){var m;m=this;$panic(new $String("InterfaceData is not supported by GopherJS"));};E.prototype.InterfaceData=function(){return this.$val.InterfaceData();};E.ptr.prototype.IsNil=function(){var m,n,o;m=this;n=new F(m.flag).kind();o=n;if((o===(22))||(o===(23))){return $clone(m,E).object()===BI(m.typ).nil;}else if(o===(18)){return $clone(m,E).object()===$chanNil;}else if(o===(19)){return $clone(m,E).object()===$throwNilPointerError;}else if(o===(21)){return $clone(m,E).object()===false;}else if(o===(20)){return $clone(m,E).object()===$ifaceNil;}else if(o===(26)){return $clone(m,E).object()===0;}else{$panic(new I.ptr("reflect.Value.IsNil",n));}};E.prototype.IsNil=function(){return this.$val.IsNil();};E.ptr.prototype.Len=function(){var m,n,o;m=this;n=new F(m.flag).kind();o=n;if((o===(17))||(o===(24))){return $parseInt($clone(m,E).object().length);}else if(o===(23)){return $parseInt($clone(m,E).object().$length)>>0;}else if(o===(18)){return $parseInt($clone(m,E).object().$buffer.length)>>0;}else if(o===(21)){return $parseInt($keys($clone(m,E).object()).length);}else{$panic(new I.ptr("reflect.Value.Len",n));}};E.prototype.Len=function(){return this.$val.Len();};E.ptr.prototype.Pointer=function(){var m,n,o;m=this;n=new F(m.flag).kind();o=n;if((o===(18))||(o===(21))||(o===(22))||(o===(26))){if($clone(m,E).IsNil()){return 0;}return $clone(m,E).object();}else if(o===(19)){if($clone(m,E).IsNil()){return 0;}return 1;}else if(o===(23)){if($clone(m,E).IsNil()){return 0;}return $clone(m,E).object().$array;}else{$panic(new I.ptr("reflect.Value.Pointer",n));}};E.prototype.Pointer=function(){return this.$val.Pointer();};E.ptr.prototype.Set=function(m){var{m,n,o,p,q,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=this;new F(n.flag).mustBeAssignable();new F(m.flag).mustBeExported();o=$clone(m,E).assignTo("reflect.Set",n.typ,0);$s=1;case 1:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}E.copy(m,o);if(!((((n.flag&128)>>>0)===0))){$s=2;continue;}$s=3;continue;case 2:p=n.typ.Kind();if(p===(17)){$s=5;continue;}if(p===(20)){$s=6;continue;}if(p===(25)){$s=7;continue;}$s=8;continue;case 5:BI(n.typ).copy(n.ptr,m.ptr);$s=9;continue;case 6:q=DD($clone(m,E));$s=10;case 10:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}n.ptr.$set(q);$s=9;continue;case 7:BY(n.ptr,m.ptr,n.typ);$s=9;continue;case 8:n.ptr.$set($clone(m,E).object());case 9:case 4:$s=-1;return;case 3:n.ptr=m.ptr;$s=-1;return;}return;}var $f={$blk:E.ptr.prototype.Set,$c:true,$r,m,n,o,p,q,$s};return $f;};E.prototype.Set=function(m){return this.$val.Set(m);};E.ptr.prototype.SetBytes=function(m){var{m,n,o,p,q,r,s,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=this;new F(n.flag).mustBeAssignable();new F(n.flag).mustBe(23);o=n.typ.Elem().Kind();$s=3;case 3:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}if(!((o===8))){$s=1;continue;}$s=2;continue;case 1:$panic(new $String("reflect.Value.SetBytes of non-byte slice"));case 2:p=m;if(!(n.typ.Name()==="")){q=true;$s=6;continue s;}r=n.typ.Elem().Name();$s=7;case 7:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}q=!(r==="");case 6:if(q){$s=4;continue;}$s=5;continue;case 4:s=new(BI(n.typ))(p.$array);s.$offset=p.$offset;s.$length=p.$length;s.$capacity=p.$capacity;p=s;case 5:n.ptr.$set(p);$s=-1;return;}return;}var $f={$blk:E.ptr.prototype.SetBytes,$c:true,$r,m,n,o,p,q,r,s,$s};return $f;};E.prototype.SetBytes=function(m){return this.$val.SetBytes(m);};E.ptr.prototype.SetCap=function(m){var m,n,o,p;n=this;new F(n.flag).mustBeAssignable();new F(n.flag).mustBe(23);o=n.ptr.$get();if(m<($parseInt(o.$length)>>0)||m>($parseInt(o.$capacity)>>0)){$panic(new $String("reflect: slice capacity out of range in SetCap"));}p=new(BI(n.typ))(o.$array);p.$offset=o.$offset;p.$length=o.$length;p.$capacity=m;n.ptr.$set(p);};E.prototype.SetCap=function(m){return this.$val.SetCap(m);};E.ptr.prototype.SetLen=function(m){var m,n,o,p;n=this;new F(n.flag).mustBeAssignable();new F(n.flag).mustBe(23);o=n.ptr.$get();if(m<0||m>($parseInt(o.$capacity)>>0)){$panic(new $String("reflect: slice length out of range in SetLen"));}p=new(BI(n.typ))(o.$array);p.$offset=o.$offset;p.$length=m;p.$capacity=o.$capacity;n.ptr.$set(p);};E.prototype.SetLen=function(m){return this.$val.SetLen(m);};E.ptr.prototype.Slice=function(m,n){var{m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{m,n});$s=$s||0;s:while(true){switch($s){case 0:o=this;p=0;q=$ifaceNil;r=null;s=new F(o.flag).kind();t=s;if(t===(17)){$s=2;continue;}if(t===(23)){$s=3;continue;}if(t===(24)){$s=4;continue;}$s=5;continue;case 2:if(((o.flag&256)>>>0)===0){$panic(new $String("reflect.Value.Slice: slice of unaddressable array"));}u=(o.typ.kindType);p=((u.len>>0));q=CH(u.elem);r=new(BI(q))($clone(o,E).object());$s=6;continue;case 3:q=o.typ;r=$clone(o,E).object();p=$parseInt(r.$capacity)>>0;$s=6;continue;case 4:v=(o.ptr).$get();if(m<0||nv.length){$panic(new $String("reflect.Value.Slice: string slice index out of bounds"));}w=CC(new $String($substring(v,m,n)));$s=7;case 7:if($c){$c=false;w=w.$blk();}if(w&&w.$blk!==undefined){break s;}x=w;$s=8;case 8:return x;case 5:$panic(new I.ptr("reflect.Value.Slice",s));case 6:case 1:if(m<0||np){$panic(new $String("reflect.Value.Slice: slice index out of bounds"));}y=BZ(q,$subslice(r,m,n),new F(o.flag).ro());$s=9;case 9:if($c){$c=false;y=y.$blk();}if(y&&y.$blk!==undefined){break s;}z=y;$s=10;case 10:return z;}return;}var $f={$blk:E.ptr.prototype.Slice,$c:true,$r,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};E.prototype.Slice=function(m,n){return this.$val.Slice(m,n);};E.ptr.prototype.Slice3=function(m,n,o){var{m,n,o,p,q,r,s,t,u,v,w,x,$s,$r,$c}=$restore(this,{m,n,o});$s=$s||0;s:while(true){switch($s){case 0:p=this;q=0;r=$ifaceNil;s=null;t=new F(p.flag).kind();u=t;if(u===(17)){if(((p.flag&256)>>>0)===0){$panic(new $String("reflect.Value.Slice: slice of unaddressable array"));}v=(p.typ.kindType);q=((v.len>>0));r=CH(v.elem);s=new(BI(r))($clone(p,E).object());}else if(u===(23)){r=p.typ;s=$clone(p,E).object();q=$parseInt(s.$capacity)>>0;}else{$panic(new I.ptr("reflect.Value.Slice3",t));}if(m<0||nq){$panic(new $String("reflect.Value.Slice3: slice index out of bounds"));}w=BZ(r,$subslice(s,m,n,o),new F(p.flag).ro());$s=1;case 1:if($c){$c=false;w=w.$blk();}if(w&&w.$blk!==undefined){break s;}x=w;$s=2;case 2:return x;}return;}var $f={$blk:E.ptr.prototype.Slice3,$c:true,$r,m,n,o,p,q,r,s,t,u,v,w,x,$s};return $f;};E.prototype.Slice3=function(m,n,o){return this.$val.Slice3(m,n,o);};E.ptr.prototype.Close=function(){var m;m=this;new F(m.flag).mustBe(18);new F(m.flag).mustBeExported();$close($clone(m,E).object());};E.prototype.Close=function(){return this.$val.Close();};E.ptr.prototype.Elem=function(){var{m,n,o,p,q,r,s,t,u,v,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:m=this;n=new F(m.flag).kind();o=n;if(o===(20)){$s=2;continue;}if(o===(22)){$s=3;continue;}$s=4;continue;case 2:p=$clone(m,E).object();if(p===$ifaceNil){$s=-1;return new E.ptr(DU.nil,0,0);}q=BJ(p.constructor);r=BZ(q,p.$val,new F(m.flag).ro());$s=6;case 6:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}s=r;$s=7;case 7:return s;case 3:if($clone(m,E).IsNil()){$s=-1;return new E.ptr(DU.nil,0,0);}t=$clone(m,E).object();u=(m.typ.kindType);v=(((((m.flag&96)>>>0)|128)>>>0)|256)>>>0;v=(v|(((u.elem.Kind()>>>0))))>>>0;$s=-1;return new E.ptr(u.elem,(DI(u.elem,t)),v);case 4:$panic(new I.ptr("reflect.Value.Elem",n));case 5:case 1:$s=-1;return new E.ptr(DU.nil,0,0);}return;}var $f={$blk:E.ptr.prototype.Elem,$c:true,$r,m,n,o,p,q,r,s,t,u,v,$s};return $f;};E.prototype.Elem=function(){return this.$val.Elem();};E.ptr.prototype.NumField=function(){var m,n;m=this;new F(m.flag).mustBe(25);n=(m.typ.kindType);return n.fields.$length;};E.prototype.NumField=function(){return this.$val.NumField();};E.ptr.prototype.MapKeys=function(){var{m,n,o,p,q,r,s,t,u,v,w,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:m=this;new F(m.flag).mustBe(21);n=(m.typ.kindType);o=n.key;p=(new F(m.flag).ro()|((o.Kind()>>>0)))>>>0;q=$clone(m,E).pointer();r=0;if(!(q===0)){r=CZ(q);}s=CV(m.typ,q);t=$makeSlice(EF,r);u=0;u=0;case 1:if(!(u=t.$length)?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+u]),DM(o,p,w));CY(s);u=u+(1)>>0;$s=1;continue;case 2:$s=-1;return $subslice(t,0,u);}return;}var $f={$blk:E.ptr.prototype.MapKeys,$c:true,$r,m,n,o,p,q,r,s,t,u,v,w,$s};return $f;};E.prototype.MapKeys=function(){return this.$val.MapKeys();};E.ptr.prototype.MapIndex=function(m){var{m,n,o,p,q,r,s,t,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=this;new F(n.flag).mustBe(21);o=(n.typ.kindType);p=$clone(m,E).assignTo("reflect.Value.MapIndex",o.key,0);$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}E.copy(m,p);q=0;if(!((((m.flag&128)>>>0)===0))){q=m.ptr;}else{q=((m.$ptr_ptr||(m.$ptr_ptr=new EH(function(){return this.$target.ptr;},function($v){this.$target.ptr=$v;},m))));}r=CR(n.typ,$clone(n,E).pointer(),q);if(r===0){$s=-1;return new E.ptr(DU.nil,0,0);}s=o.elem;t=new F((((n.flag|m.flag)>>>0))).ro();t=(t|(((s.Kind()>>>0))))>>>0;$s=-1;return DM(s,t,r);}return;}var $f={$blk:E.ptr.prototype.MapIndex,$c:true,$r,m,n,o,p,q,r,s,t,$s};return $f;};E.prototype.MapIndex=function(m){return this.$val.MapIndex(m);};E.ptr.prototype.Field=function(m){var{aa,ab,ac,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=[n];o=[o];p=[p];q=[q];r=this;if(!((new F(r.flag).kind()===25))){$panic(new I.ptr("reflect.Value.Field",new F(r.flag).kind()));}s=(r.typ.kindType);if(((m>>>0))>=((s.fields.$length>>>0))){$panic(new $String("reflect: Field index out of range"));}o[0]=$internalize(BI(r.typ).fields[m].prop,$String);u=(t=s.fields,((m<0||m>=t.$length)?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+m]));q[0]=u.typ;v=(((r.flag&416)>>>0)|((q[0].Kind()>>>0)))>>>0;if(!$clone(u.name,BO).isExported()){if(u.embedded()){v=(v|(64))>>>0;}else{v=(v|(32))>>>0;}}x=$clone((w=s.fields,((m<0||m>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+m])).name,BO).tag();if(!(x==="")&&!((m===0))){$s=1;continue;}$s=2;continue;case 1:n[0]=DK(x);if(!(n[0]==="")){$s=3;continue;}$s=4;continue;case 3:case 5:y=[y];z=$clone(r,E).Field(0);$s=7;case 7:if($c){$c=false;z=z.$blk();}if(z&&z.$blk!==undefined){break s;}E.copy(r,z);if(r.typ===DH){$s=8;continue;}$s=9;continue;case 8:y[0]=$clone(r,E).object().object;$s=-1;return new E.ptr(q[0],(new(BI(DL(q[0])))((function(n,o,p,q,y){return function(){return $internalize(y[0][$externalize(n[0],$String)],BI(q[0]));};})(n,o,p,q,y),(function(n,o,p,q,y){return function(aa){var aa;y[0][$externalize(n[0],$String)]=$externalize(aa,BI(q[0]));};})(n,o,p,q,y))),v);case 9:if(r.typ.Kind()===22){$s=10;continue;}$s=11;continue;case 10:aa=$clone(r,E).Elem();$s=12;case 12:if($c){$c=false;aa=aa.$blk();}if(aa&&aa.$blk!==undefined){break s;}E.copy(r,aa);case 11:$s=5;continue;case 6:case 4:case 2:p[0]=r.ptr;if(!((((v&128)>>>0)===0))&&!((q[0].Kind()===17))&&!((q[0].Kind()===25))){$s=13;continue;}$s=14;continue;case 13:$s=-1;return new E.ptr(q[0],(new(BI(DL(q[0])))((function(n,o,p,q){return function(){return DI(q[0],p[0][$externalize(o[0],$String)]);};})(n,o,p,q),(function(n,o,p,q){return function(ab){var ab;p[0][$externalize(o[0],$String)]=DJ(q[0],ab);};})(n,o,p,q))),v);case 14:ab=BZ(q[0],DI(q[0],p[0][$externalize(o[0],$String)]),v);$s=15;case 15:if($c){$c=false;ab=ab.$blk();}if(ab&&ab.$blk!==undefined){break s;}ac=ab;$s=16;case 16:return ac;}return;}var $f={$blk:E.ptr.prototype.Field,$c:true,$r,aa,ab,ac,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};E.prototype.Field=function(m){return this.$val.Field(m);};AT.ptr.prototype.Error=function(){var m;m=this;return m.s;};AT.prototype.Error=function(){return this.$val.Error();};AU=function(m){var m;if(m.length<2){return[m,$ifaceNil];}if((m.charCodeAt(0)===39)||(m.charCodeAt(0)===34)){if(m.charCodeAt((m.length-1>>0))===m.charCodeAt(0)){return[$substring(m,1,(m.length-1>>0)),$ifaceNil];}return["",$pkg.ErrSyntax];}return[m,$ifaceNil];};F.prototype.mustBe=function(m){var m,n;n=this.$val;if(!((((((n&31)>>>0)>>>0))===m))){$panic(new I.ptr(DF(),new F(n).kind()));}};$ptrType(F).prototype.mustBe=function(m){return new F(this.$get()).mustBe(m);};R.ptr.prototype.Comparable=function(){var{m,n,o,p,q,r,s,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:m=this;n=m.Kind();if((n===(19))||(n===(23))||(n===(21))){$s=2;continue;}if(n===(17)){$s=3;continue;}if(n===(25)){$s=4;continue;}$s=5;continue;case 2:$s=-1;return false;case 3:o=m.Elem().Comparable();$s=6;case 6:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}p=o;$s=7;case 7:return p;case 4:q=0;case 8:if(!(q>0;$s=8;continue;case 9:case 5:case 1:$s=-1;return true;}return;}var $f={$blk:R.ptr.prototype.Comparable,$c:true,$r,m,n,o,p,q,r,s,$s};return $f;};R.prototype.Comparable=function(){return this.$val.Comparable();};R.ptr.prototype.IsVariadic=function(){var m,n;m=this;if(!((m.Kind()===19))){$panic(new $String("reflect: IsVariadic of non-func type"));}n=(m.kindType);return!((((n.outCount&32768)>>>0)===0));};R.prototype.IsVariadic=function(){return this.$val.IsVariadic();};R.ptr.prototype.Field=function(m){var m,n,o,p;n=this;if(!((n.Kind()===25))){$panic(new $String("reflect: Field of non-struct type"));}o=(n.kindType);if(m<0||m>=o.fields.$length){$panic(new $String("reflect: Field index out of bounds"));}return(p=o.fields,((m<0||m>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+m]));};R.prototype.Field=function(m){return this.$val.Field(m);};R.ptr.prototype.Key=function(){var m,n;m=this;if(!((m.Kind()===21))){$panic(new $String("reflect: Key of non-map type"));}n=(m.kindType);return AP(n.key);};R.prototype.Key=function(){return this.$val.Key();};R.ptr.prototype.NumField=function(){var m,n;m=this;if(!((m.Kind()===25))){$panic(new $String("reflect: NumField of non-struct type"));}n=(m.kindType);return n.fields.$length;};R.prototype.NumField=function(){return this.$val.NumField();};R.ptr.prototype.Method=function(m){var{aa,ab,ac,ad,ae,af,ag,ah,ai,aj,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=[n];o=new AV.ptr("","",$ifaceNil,new E.ptr(DU.nil,0,0),0);p=this;if(p.Kind()===20){$s=1;continue;}$s=2;continue;case 1:q=(p.kindType);r=q.rtype.Method(m);$s=3;case 3:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}AV.copy(o,r);s=o;$s=4;case 4:return s;case 2:t=p.exportedMethods();if(m<0||m>=t.$length){$panic(new $String("reflect: Method index out of range"));}u=$clone(((m<0||m>=t.$length)?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+m]),S);v=$clone(p.nameOff(u.name),BO);o.Name=$clone(v,BO).name();w=19;x=p.typeOff(u.mtyp);y=(x.kindType);z=$makeSlice(EI,0,(1+y.in$().$length>>0));z=$append(z,p);aa=y.in$();ab=0;while(true){if(!(ab=aa.$length)?($throwRuntimeError("index out of range"),undefined):aa.$array[aa.$offset+ab]);z=$append(z,ac);ab++;}ad=$makeSlice(EI,0,y.out().$length);ae=y.out();af=0;while(true){if(!(af=ae.$length)?($throwRuntimeError("index out of range"),undefined):ae.$array[ae.$offset+af]);ad=$append(ad,ag);af++;}ah=CF(z,ad,y.rtype.IsVariadic());$s=5;case 5:if($c){$c=false;ah=ah.$blk();}if(ah&&ah.$blk!==undefined){break s;}ai=ah;o.Type=ai;n[0]=$internalize($methodSet(p[$externalize(BE,$String)])[m].prop,$String);aj=D.MakeFunc((function(n){return function(aj,ak){var aj,ak,al;al=(0>=ak.$length?($throwRuntimeError("index out of range"),undefined):ak.$array[ak.$offset+0]);return new $jsObjectPtr(al[$externalize(n[0],$String)].apply(al,$externalize($subslice(ak,1),EJ)));};})(n));E.copy(o.Func,new E.ptr($assertType(ai,DU),(aj),w));o.Index=m;AV.copy(o,o);$s=-1;return o;}return;}var $f={$blk:R.ptr.prototype.Method,$c:true,$r,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};R.prototype.Method=function(m){return this.$val.Method(m);};BA=function(m){var{m,n,o,p,q,r,s,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=[n];o=[o];p=[p];q=CC(m);$s=1;case 1:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}r=$clone(q,E);if(!(($clone(r,E).Kind()===23))){$panic(new I.ptr("Swapper",$clone(r,E).Kind()));}p[0]=(($clone(r,E).Len()>>>0));s=p[0];if(s===(0)){$s=-1;return(function(n,o,p){return function(t,u){var t,u;$panic(new $String("reflect: slice index out of range"));};})(n,o,p);}else if(s===(1)){$s=-1;return(function(n,o,p){return function(t,u){var t,u;if(!((t===0))||!((u===0))){$panic(new $String("reflect: slice index out of range"));}};})(n,o,p);}n[0]=m.$array;o[0]=$parseInt(m.$offset)>>0;$s=-1;return(function(n,o,p){return function(t,u){var t,u,v;if(((t>>>0))>=p[0]||((u>>>0))>=p[0]){$panic(new $String("reflect: slice index out of range"));}t=t+(o[0])>>0;u=u+(o[0])>>0;v=n[0][t];n[0][t]=n[0][u];n[0][u]=v;};})(n,o,p);}return;}var $f={$blk:BA,$c:true,$r,m,n,o,p,q,r,s,$s};return $f;};$pkg.Swapper=BA;BC=function(){var{m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:m=(function(m){var m;});$r=m((n=new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),new n.constructor.elem(n)));$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((o=new BL.ptr(0,0,0,0,ED.nil),new o.constructor.elem(o)));$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((p=new S.ptr(0,0,0,0),new p.constructor.elem(p)));$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((q=new U.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),DU.nil,DU.nil,0),new q.constructor.elem(q)));$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((r=new V.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),DU.nil,0),new r.constructor.elem(r)));$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((s=new BN.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),0,0,DW.nil,DW.nil),new s.constructor.elem(s)));$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((t=new X.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),new BO.ptr(EG.nil),EK.nil),new t.constructor.elem(t)));$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((u=new Y.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),DU.nil,DU.nil,DU.nil,$throwNilPointerError,0,0,0,0),new u.constructor.elem(u)));$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((v=new Z.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),DU.nil),new v.constructor.elem(v)));$s=9;case 9:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((w=new AA.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),DU.nil),new w.constructor.elem(w)));$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((x=new AC.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),new BO.ptr(EG.nil),EL.nil),new x.constructor.elem(x)));$s=11;case 11:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((y=new W.ptr(0,0),new y.constructor.elem(y)));$s=12;case 12:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=m((z=new AB.ptr(new BO.ptr(EG.nil),DU.nil,0),new z.constructor.elem(z)));$s=13;case 13:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}BB=true;BD=$assertType(CB(new $Uint8(0)),DU);$s=-1;return;}return;}var $f={$blk:BC,$c:true,$r,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};BI=function(m){var m;return m[$externalize(BE,$String)];};BJ=function(m){var aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,m,n,o,p,q,r,s,t,u,v,w,x,y,z;if(m[$externalize(BF,$String)]===undefined){n=new R.ptr(((($parseInt(m.size)>>0)>>>0)),0,0,0,0,0,((($parseInt(m.kind)>>0)<<24>>>24)),$throwNilPointerError,EG.nil,BT($clone(BR(BW(m.string),"",!!(m.exported)),BO)),0);n[$externalize(BE,$String)]=m;m[$externalize(BF,$String)]=n;o=$methodSet(m);if(!(($parseInt(o.length)===0))||!!(m.named)){n.tflag=(n.tflag|(1))>>>0;if(!!(m.named)){n.tflag=(n.tflag|(4))>>>0;}p=ED.nil;q=0;while(true){if(!(q<$parseInt(o.length))){break;}r=o[q];s=BW(r.pkg)==="";if(!s){q=q+(1)>>0;continue;}p=$append(p,new S.ptr(BT($clone(BR(BW(r.name),"",s),BO)),BV(BJ(r.typ)),0,0));q=q+(1)>>0;}t=((p.$length<<16>>>16));u=0;while(true){if(!(u<$parseInt(o.length))){break;}v=o[u];w=BW(v.pkg)==="";if(w){u=u+(1)>>0;continue;}p=$append(p,new S.ptr(BT($clone(BR(BW(v.name),"",w),BO)),BV(BJ(v.typ)),0,0));u=u+(1)>>0;}x=new BL.ptr(BT($clone(BR(BW(m.pkg),"",false),BO)),(($parseInt(o.length)<<16>>>16)),t,0,p);y=n;(BM||$throwRuntimeError("assignment to entry in nil map"))[DU.keyFor(y)]={k:y,v:x};x[$externalize(BE,$String)]=m;}z=n.Kind();if(z===(17)){BK(n,new U.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),BJ(m.elem),DU.nil,((($parseInt(m.len)>>0)>>>0))));}else if(z===(18)){aa=3;if(!!(m.sendOnly)){aa=2;}if(!!(m.recvOnly)){aa=1;}BK(n,new V.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),BJ(m.elem),((aa>>>0))));}else if(z===(19)){ab=m.params;ac=$makeSlice(DW,$parseInt(ab.length));ad=ac;ae=0;while(true){if(!(ae=ac.$length)?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+af]=BJ(ab[af]));ae++;}ag=m.results;ah=$makeSlice(DW,$parseInt(ag.length));ai=ah;aj=0;while(true){if(!(aj=ah.$length)?($throwRuntimeError("index out of range"),undefined):ah.$array[ah.$offset+ak]=BJ(ag[ak]));aj++;}al=(($parseInt(ag.length)<<16>>>16));if(!!(m.variadic)){al=(al|(32768))>>>0;}BK(n,new BN.ptr($clone(n,R),(($parseInt(ab.length)<<16>>>16)),al,ac,ah));}else if(z===(20)){am=m.methods;an=$makeSlice(EK,$parseInt(am.length));ao=an;ap=0;while(true){if(!(ap=an.$length)?($throwRuntimeError("index out of range"),undefined):an.$array[an.$offset+aq]),new W.ptr(BT($clone(BR(BW(ar.name),"",BW(ar.pkg)===""),BO)),BV(BJ(ar.typ))));ap++;}BK(n,new X.ptr($clone(n,R),$clone(BR(BW(m.pkg),"",false),BO),an));}else if(z===(21)){BK(n,new Y.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),BJ(m.key),BJ(m.elem),DU.nil,$throwNilPointerError,0,0,0,0));}else if(z===(22)){BK(n,new Z.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),BJ(m.elem)));}else if(z===(23)){BK(n,new AA.ptr(new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0),BJ(m.elem)));}else if(z===(25)){as=m.fields;at=$makeSlice(EL,$parseInt(as.length));au=at;av=0;while(true){if(!(av>>0))<<1>>>0;if(!!(ax.embedded)){ay=(ay|(1))>>>0;}AB.copy(((aw<0||aw>=at.$length)?($throwRuntimeError("index out of range"),undefined):at.$array[at.$offset+aw]),new AB.ptr($clone(BR(BW(ax.name),BW(ax.tag),!!(ax.exported)),BO),BJ(ax.typ),ay));av++;}BK(n,new AC.ptr($clone(n,R),$clone(BR(BW(m.pkgPath),"",false),BO),at));}}return((m[$externalize(BF,$String)]));};BK=function(m,n){var m,n;m[$externalize(BG,$String)]=n;n[$externalize(BH,$String)]=m;};BL.ptr.prototype.methods=function(){var m;m=this;return m._methods;};BL.prototype.methods=function(){return this.$val.methods();};BL.ptr.prototype.exportedMethods=function(){var m;m=this;return $subslice(m._methods,0,m.xcount,m.xcount);};BL.prototype.exportedMethods=function(){return this.$val.exportedMethods();};R.ptr.prototype.uncommon=function(){var m,n;m=this;return(n=BM[DU.keyFor(m)],n!==undefined?n.v:EC.nil);};R.prototype.uncommon=function(){return this.$val.uncommon();};BN.ptr.prototype.in$=function(){var m;m=this;return m._in;};BN.prototype.in$=function(){return this.$val.in$();};BN.ptr.prototype.out=function(){var m;m=this;return m._out;};BN.prototype.out=function(){return this.$val.out();};BO.ptr.prototype.name=function(){var m,n,o;m="";n=this;m=(o=BQ[EG.keyFor(n.bytes)],o!==undefined?o.v:EM.nil).name;return m;};BO.prototype.name=function(){return this.$val.name();};BO.ptr.prototype.tag=function(){var m,n,o;m="";n=this;m=(o=BQ[EG.keyFor(n.bytes)],o!==undefined?o.v:EM.nil).tag;return m;};BO.prototype.tag=function(){return this.$val.tag();};BO.ptr.prototype.pkgPath=function(){var m;m=this;return"";};BO.prototype.pkgPath=function(){return this.$val.pkgPath();};BO.ptr.prototype.isExported=function(){var m,n;m=this;return(n=BQ[EG.keyFor(m.bytes)],n!==undefined?n.v:EM.nil).exported;};BO.prototype.isExported=function(){return this.$val.isExported();};BR=function(m,n,o){var m,n,o,p,q;p=$newDataPointer(0,EG);q=p;(BQ||$throwRuntimeError("assignment to entry in nil map"))[EG.keyFor(q)]={k:q,v:new BP.ptr(m,n,o)};return new BO.ptr(p);};R.ptr.prototype.nameOff=function(m){var m,n,o;n=this;return(o=((m>>0)),((o<0||o>=BS.$length)?($throwRuntimeError("index out of range"),undefined):BS.$array[BS.$offset+o]));};R.prototype.nameOff=function(m){return this.$val.nameOff(m);};BT=function(m){var m,n;n=BS.$length;BS=$append(BS,m);return((n>>0));};R.ptr.prototype.typeOff=function(m){var m,n,o;n=this;return(o=((m>>0)),((o<0||o>=BU.$length)?($throwRuntimeError("index out of range"),undefined):BU.$array[BU.$offset+o]));};R.prototype.typeOff=function(m){return this.$val.typeOff(m);};BV=function(m){var m,n;n=BU.$length;BU=$append(BU,m);return((n>>0));};BW=function(m){var m,n;n=new EN.ptr("");n.str=m;return n.str;};BX=function(m){var m;return!!(BI(m).wrapped);};BY=function(m,n,o){var m,n,o,p,q,r;p=BI(o).fields;q=0;while(true){if(!(q<$parseInt(p.length))){break;}r=$internalize(p[q].prop,$String);m[$externalize(r,$String)]=n[$externalize(r,$String)];q=q+(1)>>0;}};BZ=function(m,n,o){var{m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{m,n,o});$s=$s||0;s:while(true){switch($s){case 0:p=m.common();$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}q=p;t=m.Kind();$s=6;case 6:if($c){$c=false;t=t.$blk();}if(t&&t.$blk!==undefined){break s;}if(t===17){s=true;$s=5;continue s;}u=m.Kind();$s=7;case 7:if($c){$c=false;u=u.$blk();}if(u&&u.$blk!==undefined){break s;}s=u===25;case 5:if(s){r=true;$s=4;continue s;}v=m.Kind();$s=8;case 8:if($c){$c=false;v=v.$blk();}if(v&&v.$blk!==undefined){break s;}r=v===22;case 4:if(r){$s=2;continue;}$s=3;continue;case 2:w=m.Kind();$s=9;case 9:if($c){$c=false;w=w.$blk();}if(w&&w.$blk!==undefined){break s;}x=new E.ptr(q,(n),(o|((w>>>0)))>>>0);$s=10;case 10:return x;case 3:y=m.Kind();$s=11;case 11:if($c){$c=false;y=y.$blk();}if(y&&y.$blk!==undefined){break s;}z=new E.ptr(q,($newDataPointer(n,BI(q.ptrTo()))),(((o|((y>>>0)))>>>0)|128)>>>0);$s=12;case 12:return z;}return;}var $f={$blk:BZ,$c:true,$r,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};CB=function(m){var m;if(!BB){return new R.ptr(0,0,0,0,0,0,0,$throwNilPointerError,EG.nil,0,0);}if($interfaceIsEqual(m,$ifaceNil)){return $ifaceNil;}return BJ(m.constructor);};$pkg.TypeOf=CB;CC=function(m){var{m,n,o,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:if($interfaceIsEqual(m,$ifaceNil)){$s=-1;return new E.ptr(DU.nil,0,0);}n=BZ(BJ(m.constructor),m.$val,0);$s=1;case 1:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}o=n;$s=2;case 2:return o;}return;}var $f={$blk:CC,$c:true,$r,m,n,o,$s};return $f;};$pkg.ValueOf=CC;CF=function(m,n,o){var{aa,ab,ac,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{m,n,o});$s=$s||0;s:while(true){switch($s){case 0:if(!(o)){p=false;$s=3;continue s;}if(m.$length===0){q=true;$s=4;continue s;}s=(r=m.$length-1>>0,((r<0||r>=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+r])).Kind();$s=5;case 5:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}q=!((s===23));case 4:p=q;case 3:if(p){$s=1;continue;}$s=2;continue;case 1:$panic(new $String("reflect.FuncOf: last arg of variadic func must be slice"));case 2:t=$makeSlice(EJ,m.$length);u=m;v=0;while(true){if(!(v=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+v]);((w<0||w>=t.$length)?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+w]=BI(x));v++;}y=$makeSlice(EJ,n.$length);z=n;aa=0;while(true){if(!(aa=z.$length)?($throwRuntimeError("index out of range"),undefined):z.$array[z.$offset+aa]);((ab<0||ab>=y.$length)?($throwRuntimeError("index out of range"),undefined):y.$array[y.$offset+ab]=BI(ac));aa++;}$s=-1;return BJ($funcType($externalize(t,EJ),$externalize(y,EJ),$externalize(o,$Bool)));}return;}var $f={$blk:CF,$c:true,$r,aa,ab,ac,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};$pkg.FuncOf=CF;R.ptr.prototype.ptrTo=function(){var m;m=this;return BJ($ptrType(BI(m)));};R.prototype.ptrTo=function(){return this.$val.ptrTo();};CH=function(m){var m;return BJ($sliceType(BI(m)));};$pkg.SliceOf=CH;CJ=function(m){var m,n;n=m.Kind();if(n===(25)){return(new(BI(m).ptr)());}else if(n===(17)){return(BI(m).zero());}else{return($newDataPointer(BI(m).zero(),BI(m.ptrTo())));}};CM=function(m,n,o){var m,n,o;n.$set(o.$get());};CQ=function(m,n){var m,n,o,p;o=n;if(!(o.$get===undefined)){o=o.$get();}p=$internalize(BI(m.Key()).keyFor(o),$String);return[o,p];};CR=function(m,n,o){var m,n,o,p,q,r;p=CQ(m,o);q=p[1];r=n[$externalize(q,$String)];if(r===undefined){return 0;}return($newDataPointer(r.v,BI(DL(m.Elem()))));};CU.ptr.prototype.skipUntilValidKey=function(){var m,n;m=this;while(true){if(!(m.i<$parseInt(m.keys.length))){break;}n=m.keys[m.i];if(!(m.m[$externalize($internalize(n,$String),$String)]===undefined)){break;}m.i=m.i+(1)>>0;}};CU.prototype.skipUntilValidKey=function(){return this.$val.skipUntilValidKey();};CV=function(m,n){var m,n;return(new CU.ptr(m,n,$keys(n),0,null));};CX=function(m){var{m,n,o,p,q,r,s,t,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:n=($pointerOfStructConversion(m,EO));o=null;if(!(n.last===null)){o=n.last;}else{n.skipUntilValidKey();if(n.i===$parseInt(n.keys.length)){$s=-1;return 0;}p=n.keys[n.i];o=n.m[$externalize($internalize(p,$String),$String)];n.last=o;}q=$assertType(n.t,CW).Key();$s=1;case 1:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}r=DL(q);$s=2;case 2:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}s=BI(r);$s=3;case 3:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}t=($newDataPointer(o.k,s));$s=4;case 4:return t;}return;}var $f={$blk:CX,$c:true,$r,m,n,o,p,q,r,s,t,$s};return $f;};CY=function(m){var m,n;n=($pointerOfStructConversion(m,EO));n.last=null;n.i=n.i+(1)>>0;};CZ=function(m){var m;return $parseInt($keys(m).length);};DC=function(m,n,o){var m,n,o,p,q,r,s,t,u,v,w,x,y;p=DU.nil;q=EE.nil;r=0;s="";if(n.typ.Kind()===20){t=(n.typ.kindType);if(o<0||o>=t.methods.$length){$panic(new $String("reflect: internal error: invalid method index"));}v=(u=t.methods,((o<0||o>=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+o]));if(!$clone(t.rtype.nameOff(v.name),BO).isExported()){$panic(new $String("reflect: "+m+" of unexported method"));}q=(t.rtype.typeOff(v.typ).kindType);s=$clone(t.rtype.nameOff(v.name),BO).name();}else{w=n.typ.exportedMethods();if(((o>>>0))>=((w.$length>>>0))){$panic(new $String("reflect: internal error: invalid method index"));}x=$clone(((o<0||o>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+o]),S);if(!$clone(n.typ.nameOff(x.name),BO).isExported()){$panic(new $String("reflect: "+m+" of unexported method"));}q=(n.typ.typeOff(x.mtyp).kindType);s=$internalize($methodSet(BI(n.typ))[o].prop,$String);}y=$clone(n,E).object();if(BX(n.typ)){y=new(BI(n.typ))(y);}r=(y[$externalize(s,$String)]);return[p,q,r];};DD=function(m){var{m,n,$s,$r,$c}=$restore(this,{m});$s=$s||0;s:while(true){switch($s){case 0:if(m.flag===0){$panic(new I.ptr("reflect.Value.Interface",0));}if(!((((m.flag&512)>>>0)===0))){$s=1;continue;}$s=2;continue;case 1:n=DG("Interface",$clone(m,E));$s=3;case 3:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}E.copy(m,n);case 2:if(BX(m.typ)){$s=-1;return((new(BI(m.typ))($clone(m,E).object())));}$s=-1;return(($clone(m,E).object()));}return;}var $f={$blk:DD,$c:true,$r,m,n,$s};return $f;};DE=function(m,n,o){var m,n,o;o.$set(n);};DF=function(){return"?FIXME?";};DG=function(m,n){var{m,n,o,p,q,r,s,t,$s,$r,$c}=$restore(this,{m,n});$s=$s||0;s:while(true){switch($s){case 0:o=[o];p=[p];if(((n.flag&512)>>>0)===0){$panic(new $String("reflect: internal error: invalid use of makePartialFunc"));}q=DC(m,$clone(n,E),((n.flag>>0))>>10>>0);o[0]=q[2];p[0]=$clone(n,E).object();if(BX(n.typ)){p[0]=new(BI(n.typ))(p[0]);}r=D.MakeFunc((function(o,p){return function(r,s){var r,s;return new $jsObjectPtr(o[0].apply(p[0],$externalize(s,EJ)));};})(o,p));s=$clone(n,E).Type().common();$s=1;case 1:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}t=new E.ptr(s,(r),(new F(n.flag).ro()|19)>>>0);$s=2;case 2:return t;}return;}var $f={$blk:DG,$c:true,$r,m,n,o,p,q,r,s,t,$s};return $f;};DI=function(m,n){var m,n;if($interfaceIsEqual(m,DH)){return new(BI(DH))(n);}return n;};DJ=function(m,n){var m,n;if($interfaceIsEqual(m,DH)){return n.object;}return n;};DK=function(m){var m,n,o,p,q,r;while(true){if(!(!(m===""))){break;}n=0;while(true){if(!(n>0;}m=$substring(m,n);if(m===""){break;}n=0;while(true){if(!(n>0;}if((n+1>>0)>=m.length||!((m.charCodeAt(n)===58))||!((m.charCodeAt((n+1>>0))===34))){break;}o=($substring(m,0,n));m=$substring(m,(n+1>>0));n=1;while(true){if(!(n>0;}n=n+(1)>>0;}if(n>=m.length){break;}p=($substring(m,0,(n+1>>0)));m=$substring(m,(n+1>>0));if(o==="js"){q=AU(p);r=q[0];return r;}}return"";};DL=function(m){var m;return $assertType(m,DU).ptrTo();};$pkg.PtrTo=DL;DM=function(m,n,o){var m,n,o,p;if(AQ(m)){p=CJ(m);CM(m,p,o);return new E.ptr(m,p,(n|128)>>>0);}return new E.ptr(m,(o).$get(),n);};E.methods=[{prop:"pointer",name:"pointer",pkg:"internal/reflectlite",typ:$funcType([],[$UnsafePointer],false)},{prop:"CanSet",name:"CanSet",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"IsValid",name:"IsValid",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Kind",name:"Kind",pkg:"",typ:$funcType([],[P],false)},{prop:"numMethod",name:"numMethod",pkg:"internal/reflectlite",typ:$funcType([],[$Int],false)},{prop:"Type",name:"Type",pkg:"",typ:$funcType([],[O],false)},{prop:"object",name:"object",pkg:"internal/reflectlite",typ:$funcType([],[DZ],false)},{prop:"assignTo",name:"assignTo",pkg:"internal/reflectlite",typ:$funcType([$String,DU,$UnsafePointer],[E],false)},{prop:"call",name:"call",pkg:"internal/reflectlite",typ:$funcType([$String,EF],[EF],false)},{prop:"Cap",name:"Cap",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Index",name:"Index",pkg:"",typ:$funcType([$Int],[E],false)},{prop:"InterfaceData",name:"InterfaceData",pkg:"",typ:$funcType([],[ES],false)},{prop:"IsNil",name:"IsNil",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Len",name:"Len",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Pointer",name:"Pointer",pkg:"",typ:$funcType([],[$Uintptr],false)},{prop:"Set",name:"Set",pkg:"",typ:$funcType([E],[],false)},{prop:"SetBytes",name:"SetBytes",pkg:"",typ:$funcType([ET],[],false)},{prop:"SetCap",name:"SetCap",pkg:"",typ:$funcType([$Int],[],false)},{prop:"SetLen",name:"SetLen",pkg:"",typ:$funcType([$Int],[],false)},{prop:"Slice",name:"Slice",pkg:"",typ:$funcType([$Int,$Int],[E],false)},{prop:"Slice3",name:"Slice3",pkg:"",typ:$funcType([$Int,$Int,$Int],[E],false)},{prop:"Close",name:"Close",pkg:"",typ:$funcType([],[],false)},{prop:"Elem",name:"Elem",pkg:"",typ:$funcType([],[E],false)},{prop:"NumField",name:"NumField",pkg:"",typ:$funcType([],[$Int],false)},{prop:"MapKeys",name:"MapKeys",pkg:"",typ:$funcType([],[EF],false)},{prop:"MapIndex",name:"MapIndex",pkg:"",typ:$funcType([E],[E],false)},{prop:"Field",name:"Field",pkg:"",typ:$funcType([$Int],[E],false)}];F.methods=[{prop:"kind",name:"kind",pkg:"internal/reflectlite",typ:$funcType([],[P],false)},{prop:"ro",name:"ro",pkg:"internal/reflectlite",typ:$funcType([],[F],false)},{prop:"mustBeExported",name:"mustBeExported",pkg:"internal/reflectlite",typ:$funcType([],[],false)},{prop:"mustBeAssignable",name:"mustBeAssignable",pkg:"internal/reflectlite",typ:$funcType([],[],false)},{prop:"mustBe",name:"mustBe",pkg:"internal/reflectlite",typ:$funcType([P],[],false)}];EU.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];P.methods=[{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}];DU.methods=[{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"Size",name:"Size",pkg:"",typ:$funcType([],[$Uintptr],false)},{prop:"Kind",name:"Kind",pkg:"",typ:$funcType([],[P],false)},{prop:"pointers",name:"pointers",pkg:"internal/reflectlite",typ:$funcType([],[$Bool],false)},{prop:"common",name:"common",pkg:"internal/reflectlite",typ:$funcType([],[DU],false)},{prop:"exportedMethods",name:"exportedMethods",pkg:"internal/reflectlite",typ:$funcType([],[ED],false)},{prop:"NumMethod",name:"NumMethod",pkg:"",typ:$funcType([],[$Int],false)},{prop:"PkgPath",name:"PkgPath",pkg:"",typ:$funcType([],[$String],false)},{prop:"hasName",name:"hasName",pkg:"internal/reflectlite",typ:$funcType([],[$Bool],false)},{prop:"Name",name:"Name",pkg:"",typ:$funcType([],[$String],false)},{prop:"chanDir",name:"chanDir",pkg:"internal/reflectlite",typ:$funcType([],[T],false)},{prop:"Elem",name:"Elem",pkg:"",typ:$funcType([],[O],false)},{prop:"In",name:"In",pkg:"",typ:$funcType([$Int],[O],false)},{prop:"Len",name:"Len",pkg:"",typ:$funcType([],[$Int],false)},{prop:"NumIn",name:"NumIn",pkg:"",typ:$funcType([],[$Int],false)},{prop:"NumOut",name:"NumOut",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Out",name:"Out",pkg:"",typ:$funcType([$Int],[O],false)},{prop:"Implements",name:"Implements",pkg:"",typ:$funcType([O],[$Bool],false)},{prop:"AssignableTo",name:"AssignableTo",pkg:"",typ:$funcType([O],[$Bool],false)},{prop:"Comparable",name:"Comparable",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"IsVariadic",name:"IsVariadic",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"kindType",name:"kindType",pkg:"internal/reflectlite",typ:$funcType([],[DU],false)},{prop:"Field",name:"Field",pkg:"",typ:$funcType([$Int],[AB],false)},{prop:"Key",name:"Key",pkg:"",typ:$funcType([],[O],false)},{prop:"NumField",name:"NumField",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Method",name:"Method",pkg:"",typ:$funcType([$Int],[AV],false)},{prop:"uncommon",name:"uncommon",pkg:"internal/reflectlite",typ:$funcType([],[EC],false)},{prop:"nameOff",name:"nameOff",pkg:"internal/reflectlite",typ:$funcType([AG],[BO],false)},{prop:"typeOff",name:"typeOff",pkg:"internal/reflectlite",typ:$funcType([AH],[DU],false)},{prop:"ptrTo",name:"ptrTo",pkg:"internal/reflectlite",typ:$funcType([],[DU],false)}];EW.methods=[{prop:"NumMethod",name:"NumMethod",pkg:"",typ:$funcType([],[$Int],false)}];EY.methods=[{prop:"offset",name:"offset",pkg:"internal/reflectlite",typ:$funcType([],[$Uintptr],false)},{prop:"embedded",name:"embedded",pkg:"internal/reflectlite",typ:$funcType([],[$Bool],false)}];EZ.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];EC.methods=[{prop:"methods",name:"methods",pkg:"internal/reflectlite",typ:$funcType([],[ED],false)},{prop:"exportedMethods",name:"exportedMethods",pkg:"internal/reflectlite",typ:$funcType([],[ED],false)}];EE.methods=[{prop:"in$",name:"in",pkg:"internal/reflectlite",typ:$funcType([],[DW],false)},{prop:"out",name:"out",pkg:"internal/reflectlite",typ:$funcType([],[DW],false)}];BO.methods=[{prop:"data",name:"data",pkg:"internal/reflectlite",typ:$funcType([$Int,$String],[EG],false)},{prop:"hasTag",name:"hasTag",pkg:"internal/reflectlite",typ:$funcType([],[$Bool],false)},{prop:"readVarint",name:"readVarint",pkg:"internal/reflectlite",typ:$funcType([$Int],[$Int,$Int],false)},{prop:"name",name:"name",pkg:"internal/reflectlite",typ:$funcType([],[$String],false)},{prop:"tag",name:"tag",pkg:"internal/reflectlite",typ:$funcType([],[$String],false)},{prop:"pkgPath",name:"pkgPath",pkg:"internal/reflectlite",typ:$funcType([],[$String],false)},{prop:"isExported",name:"isExported",pkg:"internal/reflectlite",typ:$funcType([],[$Bool],false)}];EO.methods=[{prop:"skipUntilValidKey",name:"skipUntilValidKey",pkg:"internal/reflectlite",typ:$funcType([],[],false)}];E.init("internal/reflectlite",[{prop:"typ",name:"typ",embedded:false,exported:false,typ:DU,tag:""},{prop:"ptr",name:"ptr",embedded:false,exported:false,typ:$UnsafePointer,tag:""},{prop:"flag",name:"flag",embedded:true,exported:false,typ:F,tag:""}]);I.init("",[{prop:"Method",name:"Method",embedded:false,exported:true,typ:$String,tag:""},{prop:"Kind",name:"Kind",embedded:false,exported:true,typ:P,tag:""}]);O.init([{prop:"AssignableTo",name:"AssignableTo",pkg:"",typ:$funcType([O],[$Bool],false)},{prop:"Comparable",name:"Comparable",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Elem",name:"Elem",pkg:"",typ:$funcType([],[O],false)},{prop:"Implements",name:"Implements",pkg:"",typ:$funcType([O],[$Bool],false)},{prop:"Kind",name:"Kind",pkg:"",typ:$funcType([],[P],false)},{prop:"Name",name:"Name",pkg:"",typ:$funcType([],[$String],false)},{prop:"PkgPath",name:"PkgPath",pkg:"",typ:$funcType([],[$String],false)},{prop:"Size",name:"Size",pkg:"",typ:$funcType([],[$Uintptr],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"common",name:"common",pkg:"internal/reflectlite",typ:$funcType([],[DU],false)},{prop:"uncommon",name:"uncommon",pkg:"internal/reflectlite",typ:$funcType([],[EC],false)}]);R.init("internal/reflectlite",[{prop:"size",name:"size",embedded:false,exported:false,typ:$Uintptr,tag:""},{prop:"ptrdata",name:"ptrdata",embedded:false,exported:false,typ:$Uintptr,tag:""},{prop:"hash",name:"hash",embedded:false,exported:false,typ:$Uint32,tag:""},{prop:"tflag",name:"tflag",embedded:false,exported:false,typ:Q,tag:""},{prop:"align",name:"align",embedded:false,exported:false,typ:$Uint8,tag:""},{prop:"fieldAlign",name:"fieldAlign",embedded:false,exported:false,typ:$Uint8,tag:""},{prop:"kind",name:"kind",embedded:false,exported:false,typ:$Uint8,tag:""},{prop:"equal",name:"equal",embedded:false,exported:false,typ:EV,tag:""},{prop:"gcdata",name:"gcdata",embedded:false,exported:false,typ:EG,tag:""},{prop:"str",name:"str",embedded:false,exported:false,typ:AG,tag:""},{prop:"ptrToThis",name:"ptrToThis",embedded:false,exported:false,typ:AH,tag:""}]);S.init("internal/reflectlite",[{prop:"name",name:"name",embedded:false,exported:false,typ:AG,tag:""},{prop:"mtyp",name:"mtyp",embedded:false,exported:false,typ:AH,tag:""},{prop:"ifn",name:"ifn",embedded:false,exported:false,typ:AI,tag:""},{prop:"tfn",name:"tfn",embedded:false,exported:false,typ:AI,tag:""}]);U.init("internal/reflectlite",[{prop:"rtype",name:"rtype",embedded:true,exported:false,typ:R,tag:""},{prop:"elem",name:"elem",embedded:false,exported:false,typ:DU,tag:""},{prop:"slice",name:"slice",embedded:false,exported:false,typ:DU,tag:""},{prop:"len",name:"len",embedded:false,exported:false,typ:$Uintptr,tag:""}]);V.init("internal/reflectlite",[{prop:"rtype",name:"rtype",embedded:true,exported:false,typ:R,tag:""},{prop:"elem",name:"elem",embedded:false,exported:false,typ:DU,tag:""},{prop:"dir",name:"dir",embedded:false,exported:false,typ:$Uintptr,tag:""}]);W.init("internal/reflectlite",[{prop:"name",name:"name",embedded:false,exported:false,typ:AG,tag:""},{prop:"typ",name:"typ",embedded:false,exported:false,typ:AH,tag:""}]);X.init("internal/reflectlite",[{prop:"rtype",name:"rtype",embedded:true,exported:false,typ:R,tag:""},{prop:"pkgPath",name:"pkgPath",embedded:false,exported:false,typ:BO,tag:""},{prop:"methods",name:"methods",embedded:false,exported:false,typ:EK,tag:""}]);Y.init("internal/reflectlite",[{prop:"rtype",name:"rtype",embedded:true,exported:false,typ:R,tag:""},{prop:"key",name:"key",embedded:false,exported:false,typ:DU,tag:""},{prop:"elem",name:"elem",embedded:false,exported:false,typ:DU,tag:""},{prop:"bucket",name:"bucket",embedded:false,exported:false,typ:DU,tag:""},{prop:"hasher",name:"hasher",embedded:false,exported:false,typ:EX,tag:""},{prop:"keysize",name:"keysize",embedded:false,exported:false,typ:$Uint8,tag:""},{prop:"valuesize",name:"valuesize",embedded:false,exported:false,typ:$Uint8,tag:""},{prop:"bucketsize",name:"bucketsize",embedded:false,exported:false,typ:$Uint16,tag:""},{prop:"flags",name:"flags",embedded:false,exported:false,typ:$Uint32,tag:""}]);Z.init("internal/reflectlite",[{prop:"rtype",name:"rtype",embedded:true,exported:false,typ:R,tag:""},{prop:"elem",name:"elem",embedded:false,exported:false,typ:DU,tag:""}]);AA.init("internal/reflectlite",[{prop:"rtype",name:"rtype",embedded:true,exported:false,typ:R,tag:""},{prop:"elem",name:"elem",embedded:false,exported:false,typ:DU,tag:""}]);AB.init("internal/reflectlite",[{prop:"name",name:"name",embedded:false,exported:false,typ:BO,tag:""},{prop:"typ",name:"typ",embedded:false,exported:false,typ:DU,tag:""},{prop:"offsetEmbed",name:"offsetEmbed",embedded:false,exported:false,typ:$Uintptr,tag:""}]);AC.init("internal/reflectlite",[{prop:"rtype",name:"rtype",embedded:true,exported:false,typ:R,tag:""},{prop:"pkgPath",name:"pkgPath",embedded:false,exported:false,typ:BO,tag:""},{prop:"fields",name:"fields",embedded:false,exported:false,typ:EL,tag:""}]);AT.init("internal/reflectlite",[{prop:"s",name:"s",embedded:false,exported:false,typ:$String,tag:""}]);AV.init("",[{prop:"Name",name:"Name",embedded:false,exported:true,typ:$String,tag:""},{prop:"PkgPath",name:"PkgPath",embedded:false,exported:true,typ:$String,tag:""},{prop:"Type",name:"Type",embedded:false,exported:true,typ:O,tag:""},{prop:"Func",name:"Func",embedded:false,exported:true,typ:E,tag:""},{prop:"Index",name:"Index",embedded:false,exported:true,typ:$Int,tag:""}]);BL.init("internal/reflectlite",[{prop:"pkgPath",name:"pkgPath",embedded:false,exported:false,typ:AG,tag:""},{prop:"mcount",name:"mcount",embedded:false,exported:false,typ:$Uint16,tag:""},{prop:"xcount",name:"xcount",embedded:false,exported:false,typ:$Uint16,tag:""},{prop:"moff",name:"moff",embedded:false,exported:false,typ:$Uint32,tag:""},{prop:"_methods",name:"_methods",embedded:false,exported:false,typ:ED,tag:""}]);BN.init("internal/reflectlite",[{prop:"rtype",name:"rtype",embedded:true,exported:false,typ:R,tag:"reflect:\"func\""},{prop:"inCount",name:"inCount",embedded:false,exported:false,typ:$Uint16,tag:""},{prop:"outCount",name:"outCount",embedded:false,exported:false,typ:$Uint16,tag:""},{prop:"_in",name:"_in",embedded:false,exported:false,typ:DW,tag:""},{prop:"_out",name:"_out",embedded:false,exported:false,typ:DW,tag:""}]);BO.init("internal/reflectlite",[{prop:"bytes",name:"bytes",embedded:false,exported:false,typ:EG,tag:""}]);BP.init("internal/reflectlite",[{prop:"name",name:"name",embedded:false,exported:false,typ:$String,tag:""},{prop:"tag",name:"tag",embedded:false,exported:false,typ:$String,tag:""},{prop:"exported",name:"exported",embedded:false,exported:false,typ:$Bool,tag:""}]);CU.init("internal/reflectlite",[{prop:"t",name:"t",embedded:false,exported:false,typ:O,tag:""},{prop:"m",name:"m",embedded:false,exported:false,typ:DZ,tag:""},{prop:"keys",name:"keys",embedded:false,exported:false,typ:DZ,tag:""},{prop:"i",name:"i",embedded:false,exported:false,typ:$Int,tag:""},{prop:"last",name:"last",embedded:false,exported:false,typ:DZ,tag:""}]);CW.init([{prop:"AssignableTo",name:"AssignableTo",pkg:"",typ:$funcType([O],[$Bool],false)},{prop:"Comparable",name:"Comparable",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Elem",name:"Elem",pkg:"",typ:$funcType([],[O],false)},{prop:"Implements",name:"Implements",pkg:"",typ:$funcType([O],[$Bool],false)},{prop:"Key",name:"Key",pkg:"",typ:$funcType([],[O],false)},{prop:"Kind",name:"Kind",pkg:"",typ:$funcType([],[P],false)},{prop:"Name",name:"Name",pkg:"",typ:$funcType([],[$String],false)},{prop:"PkgPath",name:"PkgPath",pkg:"",typ:$funcType([],[$String],false)},{prop:"Size",name:"Size",pkg:"",typ:$funcType([],[$Uintptr],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"common",name:"common",pkg:"internal/reflectlite",typ:$funcType([],[DU],false)},{prop:"uncommon",name:"uncommon",pkg:"internal/reflectlite",typ:$funcType([],[EC],false)}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=D.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}BD=DU.nil;BS=DV.nil;BU=DW.nil;AD=new DX(["invalid","bool","int","int8","int16","int32","int64","uint","uint8","uint16","uint32","uint64","uintptr","float32","float64","complex64","complex128","array","chan","func","interface","map","ptr","slice","string","struct","unsafe.Pointer"]);AR=$assertType($internalize($call,$emptyInterface),EA);$pkg.ErrSyntax=new AT.ptr("invalid syntax");BB=false;BE="_jsType";BF="_reflectType";BG="kindType";BH="_rtype";BM={};BQ={};DH=BJ($jsObjectPtr);DN=$assertType($internalize($select,$emptyInterface),EA);$r=BC();$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["sort"]=(function(){var $pkg={},$init,A,V,AZ,BA,AN,AO,B,C,D,E,G,H,U,AP;A=$packages["internal/reflectlite"];V=$pkg.lessSwap=$newType(0,$kindStruct,"sort.lessSwap",true,"sort",false,function(Less_,Swap_){this.$val=this;if(arguments.length===0){this.Less=$throwNilPointerError;this.Swap=$throwNilPointerError;return;}this.Less=Less_;this.Swap=Swap_;});AZ=$funcType([$Int,$Int],[$Bool],false);BA=$funcType([$Int,$Int],[],false);B=function(a,b,c){var{a,b,c,d,e,f,g,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=b+1>>0;case 1:if(!(db)){f=false;$s=5;continue s;}g=a.Less(e,e-1>>0);$s=6;case 6:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}f=g;case 5:if(!(f)){$s=4;continue;}$r=a.Swap(e,e-1>>0);$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}e=e-(1)>>0;$s=3;continue;case 4:d=d+(1)>>0;$s=1;continue;case 2:$s=-1;return;}return;}var $f={$blk:B,$c:true,$r,a,b,c,d,e,f,g,$s};return $f;};C=function(a,b,c,d){var{a,b,c,d,e,f,g,h,i,$s,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;s:while(true){switch($s){case 0:e=b;case 1:f=($imul(2,e))+1>>0;if(f>=c){$s=2;continue;}if(!((f+1>>0)>0,(d+f>>0)+1>>0);$s=6;case 6:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}g=h;case 5:if(g){$s=3;continue;}$s=4;continue;case 3:f=f+(1)>>0;case 4:i=a.Less(d+e>>0,d+f>>0);$s=9;case 9:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}if(!i){$s=7;continue;}$s=8;continue;case 7:$s=-1;return;case 8:$r=a.Swap(d+e>>0,d+f>>0);$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}e=f;$s=1;continue;case 2:$s=-1;return;}return;}var $f={$blk:C,$c:true,$r,a,b,c,d,e,f,g,h,i,$s};return $f;};D=function(a,b,c){var{a,b,c,d,e,f,g,h,i,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=b;e=0;f=c-b>>0;h=(g=((f-1>>0))/2,(g===g&&g!==1/0&&g!==-1/0)?g>>0:$throwRuntimeError("integer divide by zero"));case 1:if(!(h>=0)){$s=2;continue;}$r=C($clone(a,V),h,f,d);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}h=h-(1)>>0;$s=1;continue;case 2:i=f-1>>0;case 4:if(!(i>=0)){$s=5;continue;}$r=a.Swap(d,d+i>>0);$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C($clone(a,V),e,i,d);$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}i=i-(1)>>0;$s=4;continue;case 5:$s=-1;return;}return;}var $f={$blk:D,$c:true,$r,a,b,c,d,e,f,g,h,i,$s};return $f;};E=function(a,b,c,d){var{a,b,c,d,e,f,g,$s,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;s:while(true){switch($s){case 0:e=a.Less(b,c);$s=3;case 3:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}if(e){$s=1;continue;}$s=2;continue;case 1:$r=a.Swap(b,c);$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:f=a.Less(d,b);$s=7;case 7:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}if(f){$s=5;continue;}$s=6;continue;case 5:$r=a.Swap(d,b);$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}g=a.Less(b,c);$s=11;case 11:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}if(g){$s=9;continue;}$s=10;continue;case 9:$r=a.Swap(b,c);$s=12;case 12:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 10:case 6:$s=-1;return;}return;}var $f={$blk:E,$c:true,$r,a,b,c,d,e,f,g,$s};return $f;};G=function(a,b,c){var{a,aa,ab,ac,ad,ae,af,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=0;e=0;f=((((((b+c>>0)>>>0))>>>1>>>0)>>0));if((c-b>>0)>40){$s=1;continue;}$s=2;continue;case 1:h=(g=((c-b>>0))/8,(g===g&&g!==1/0&&g!==-1/0)?g>>0:$throwRuntimeError("integer divide by zero"));$r=E($clone(a,V),b,b+h>>0,b+($imul(2,h))>>0);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=E($clone(a,V),f,f-h>>0,f+h>>0);$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=E($clone(a,V),c-1>>0,(c-1>>0)-h>>0,(c-1>>0)-($imul(2,h))>>0);$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:$r=E($clone(a,V),b,f,c-1>>0);$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}i=b;j=b+1>>0;k=c-1>>0;l=j;m=k;case 7:if(!(l>0;$s=7;continue;case 8:p=l;case 11:case 13:if(!(p>0;$s=13;continue;case 14:case 17:if(!(p>0);$s=20;case 20:if($c){$c=false;t=t.$blk();}if(t&&t.$blk!==undefined){break s;}s=t;case 19:if(!(s)){$s=18;continue;}m=m-(1)>>0;$s=17;continue;case 18:if(p>=m){$s=12;continue;}$r=a.Swap(p,m-1>>0);$s=21;case 21:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}p=p+(1)>>0;m=m-(1)>>0;$s=11;continue;case 12:u=(c-m>>0)<5;if(!u&&(c-m>>0)<(v=((c-b>>0))/4,(v===v&&v!==1/0&&v!==-1/0)?v>>0:$throwRuntimeError("integer divide by zero"))){$s=22;continue;}$s=23;continue;case 22:w=0;x=a.Less(i,c-1>>0);$s=26;case 26:if($c){$c=false;x=x.$blk();}if(x&&x.$blk!==undefined){break s;}if(!x){$s=24;continue;}$s=25;continue;case 24:$r=a.Swap(m,c-1>>0);$s=27;case 27:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}m=m+(1)>>0;w=w+(1)>>0;case 25:y=a.Less(p-1>>0,i);$s=30;case 30:if($c){$c=false;y=y.$blk();}if(y&&y.$blk!==undefined){break s;}if(!y){$s=28;continue;}$s=29;continue;case 28:p=p-(1)>>0;w=w+(1)>>0;case 29:z=a.Less(f,i);$s=33;case 33:if($c){$c=false;z=z.$blk();}if(z&&z.$blk!==undefined){break s;}if(!z){$s=31;continue;}$s=32;continue;case 31:$r=a.Swap(f,p-1>>0);$s=34;case 34:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}p=p-(1)>>0;w=w+(1)>>0;case 32:u=w>1;case 23:if(u){$s=35;continue;}$s=36;continue;case 35:case 37:case 39:if(!(l>0,i);$s=42;case 42:if($c){$c=false;ab=ab.$blk();}if(ab&&ab.$blk!==undefined){break s;}aa=!ab;case 41:if(!(aa)){$s=40;continue;}p=p-(1)>>0;$s=39;continue;case 40:case 43:if(!(l>0;$s=43;continue;case 44:if(l>=p){$s=38;continue;}$r=a.Swap(l,p-1>>0);$s=47;case 47:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}l=l+(1)>>0;p=p-(1)>>0;$s=37;continue;case 38:case 36:$r=a.Swap(i,p-1>>0);$s=48;case 48:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}ae=p-1>>0;af=m;d=ae;e=af;$s=-1;return[d,e];}return;}var $f={$blk:G,$c:true,$r,a,aa,ab,ac,ad,ae,af,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};H=function(a,b,c,d){var{a,b,c,d,e,f,g,h,i,j,$s,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;s:while(true){switch($s){case 0:case 1:if(!((c-b>>0)>12)){$s=2;continue;}if(d===0){$s=3;continue;}$s=4;continue;case 3:$r=D($clone(a,V),b,c);$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;return;case 4:d=d-(1)>>0;f=G($clone(a,V),b,c);$s=6;case 6:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}e=f;g=e[0];h=e[1];if((g-b>>0)<(c-h>>0)){$s=7;continue;}$s=8;continue;case 7:$r=H($clone(a,V),b,g,d);$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}b=h;$s=9;continue;case 8:$r=H($clone(a,V),h,c,d);$s=11;case 11:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}c=g;case 9:$s=1;continue;case 2:if((c-b>>0)>1){$s=12;continue;}$s=13;continue;case 12:i=b+6>>0;case 14:if(!(i>0);$s=18;case 18:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}if(j){$s=16;continue;}$s=17;continue;case 16:$r=a.Swap(i,i-6>>0);$s=19;case 19:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 17:i=i+(1)>>0;$s=14;continue;case 15:$r=B($clone(a,V),b,c);$s=20;case 20:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 13:$s=-1;return;}return;}var $f={$blk:H,$c:true,$r,a,b,c,d,e,f,g,h,i,j,$s};return $f;};U=function(a){var a,b,c;b=0;c=a;while(true){if(!(c>0)){break;}b=b+(1)>>0;c=(c>>$min((1),31))>>0;}return $imul(b,2);};AP=function(a,b){var{a,b,c,d,e,f,g,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=AN(a);$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}d=$clone(c,A.Value);e=AO(a);$s=2;case 2:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}f=e;g=$clone(d,A.Value).Len();$r=H(new V.ptr(b,f),0,g,U(g));$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;return;}return;}var $f={$blk:AP,$c:true,$r,a,b,c,d,e,f,g,$s};return $f;};$pkg.Slice=AP;V.init("",[{prop:"Less",name:"Less",embedded:false,exported:true,typ:AZ,tag:""},{prop:"Swap",name:"Swap",embedded:false,exported:true,typ:BA,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}AN=A.ValueOf;AO=A.Swapper;}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["resolv"]=(function(){var $pkg={},$init,A,B,C,D,O,Q,R,T,V,Y,AA,AB,AF,AH,AJ,AK,AL,AM,AN,AO,AP,AQ,AR,AS,AT,AU,AV,AW,AX,AY,AZ,L,P,S,U,W,X,Z,AC,AD,AE,AG,AI;A=$packages["math"];B=$packages["sort"];C=$pkg.Vector=$newType(12,$kindSlice,"resolv.Vector",true,"resolv",true,null);D=$pkg.Axis=$newType(4,$kindInt,"resolv.Axis",true,"resolv",true,null);O=$pkg.Space=$newType(0,$kindStruct,"resolv.Space",true,"resolv",true,function(Cells_,CellWidth_,CellHeight_){this.$val=this;if(arguments.length===0){this.Cells=AM.nil;this.CellWidth=0;this.CellHeight=0;return;}this.Cells=Cells_;this.CellWidth=CellWidth_;this.CellHeight=CellHeight_;});Q=$pkg.Shape=$newType(8,$kindInterface,"resolv.Shape",true,"resolv",true,null);R=$pkg.Line=$newType(0,$kindStruct,"resolv.Line",true,"resolv",true,function(Start_,End_){this.$val=this;if(arguments.length===0){this.Start=C.nil;this.End=C.nil;return;}this.Start=Start_;this.End=End_;});T=$pkg.ConvexPolygon=$newType(0,$kindStruct,"resolv.ConvexPolygon",true,"resolv",true,function(Points_,X_,Y_,Closed_){this.$val=this;if(arguments.length===0){this.Points=AQ.nil;this.X=0;this.Y=0;this.Closed=false;return;}this.Points=Points_;this.X=X_;this.Y=Y_;this.Closed=Closed_;});V=$pkg.ContactSet=$newType(0,$kindStruct,"resolv.ContactSet",true,"resolv",true,function(Points_,MTV_,Center_){this.$val=this;if(arguments.length===0){this.Points=AQ.nil;this.MTV=C.nil;this.Center=C.nil;return;}this.Points=Points_;this.MTV=MTV_;this.Center=Center_;});Y=$pkg.Circle=$newType(0,$kindStruct,"resolv.Circle",true,"resolv",true,function(X_,Y_,Radius_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;this.Radius=0;return;}this.X=X_;this.Y=Y_;this.Radius=Radius_;});AA=$pkg.Projection=$newType(0,$kindStruct,"resolv.Projection",true,"resolv",true,function(Min_,Max_){this.$val=this;if(arguments.length===0){this.Min=0;this.Max=0;return;}this.Min=Min_;this.Max=Max_;});AB=$pkg.Object=$newType(0,$kindStruct,"resolv.Object",true,"resolv",true,function(Shape_,Space_,X_,Y_,W_,H_,TouchingCells_,Data_,ignoreList_,tags_){this.$val=this;if(arguments.length===0){this.Shape=$ifaceNil;this.Space=AN.nil;this.X=0;this.Y=0;this.W=0;this.H=0;this.TouchingCells=AL.nil;this.Data=$ifaceNil;this.ignoreList=false;this.tags=AW.nil;return;}this.Shape=Shape_;this.Space=Space_;this.X=X_;this.Y=Y_;this.W=W_;this.H=H_;this.TouchingCells=TouchingCells_;this.Data=Data_;this.ignoreList=ignoreList_;this.tags=tags_;});AF=$pkg.Collision=$newType(0,$kindStruct,"resolv.Collision",true,"resolv",true,function(checkingObject_,dx_,dy_,Objects_,Cells_){this.$val=this;if(arguments.length===0){this.checkingObject=AO.nil;this.dx=0;this.dy=0;this.Objects=AP.nil;this.Cells=AL.nil;return;}this.checkingObject=checkingObject_;this.dx=dx_;this.dy=dy_;this.Objects=Objects_;this.Cells=Cells_;});AH=$pkg.Cell=$newType(0,$kindStruct,"resolv.Cell",true,"resolv",true,function(X_,Y_,Objects_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;this.Objects=AP.nil;return;}this.X=X_;this.Y=Y_;this.Objects=Objects_;});AJ=$sliceType($Float64);AK=$ptrType(AH);AL=$sliceType(AK);AM=$sliceType(AL);AN=$ptrType(O);AO=$ptrType(AB);AP=$sliceType(AO);AQ=$sliceType(C);AR=$ptrType(R);AS=$sliceType(AR);AT=$ptrType(Y);AU=$ptrType(T);AV=$ptrType(V);AW=$sliceType($String);AX=$ptrType(AF);AY=$sliceType(D);AZ=$mapType(AO,$Bool);C.prototype.Clone=function(){var a,b;a=this;b=$makeSlice(C,a.$length);$copySlice(b,a);return b;};$ptrType(C).prototype.Clone=function(){return this.$get().Clone();};C.prototype.Add=function(a){var a,b,c,d,e,f;b=this;c=b.$length;d=a;e=0;while(true){if(!(e=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]).$length>c){AD($convertSliceType(b,AJ),1,$convertSliceType(b,AJ),$convertSliceType($subslice(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),0,c),AJ));}else{AD($convertSliceType(b,AJ),1,$convertSliceType(b,AJ),$convertSliceType(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),AJ));}e++;}return b;};$ptrType(C).prototype.Add=function(a){return this.$get().Add(a);};C.prototype.Sub=function(a){var a,b,c,d,e,f;b=this;c=b.$length;d=a;e=0;while(true){if(!(e=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]).$length>c){AD($convertSliceType(b,AJ),-1,$convertSliceType($subslice(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),0,c),AJ),$convertSliceType(b,AJ));}else{AD($convertSliceType(b,AJ),-1,$convertSliceType(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),AJ),$convertSliceType(b,AJ));}e++;}return b;};$ptrType(C).prototype.Sub=function(a){return this.$get().Sub(a);};C.prototype.Scale=function(a){var a,b;b=this;AE($convertSliceType(b,AJ),a,$convertSliceType(b,AJ));return b;};$ptrType(C).prototype.Scale=function(a){return this.$get().Scale(a);};C.prototype.Equal=function(a){var a,b,c,d,e;b=this;if(!((b.$length===a.$length))){return false;}c=b;d=0;while(true){if(!(d=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+e])-((e<0||e>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+e]))>1e-08){return false;}d++;}return true;};$ptrType(C).prototype.Equal=function(a){return this.$get().Equal(a);};C.prototype.Magnitude=function(){var a;a=this;return A.Sqrt(a.Magnitude2());};$ptrType(C).prototype.Magnitude=function(){return this.$get().Magnitude();};C.prototype.Magnitude2=function(){var a,b,c,d,e;a=this;b=0;c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=b+(e*e);d++;}return b;};$ptrType(C).prototype.Magnitude2=function(){return this.$get().Magnitude2();};C.prototype.Unit=function(){var a,b,c,d,e;a=this;b=a.Magnitude();if(b<1e-08){return a;}c=a;d=0;while(true){if(!(d=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+e]=((e<0||e>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+e])/b);d++;}return a;};$ptrType(C).prototype.Unit=function(){return this.$get().Unit();};L=function(a,b){var a,b,c,d,e,f,g,h,i,j,k;c=0;d=a.$length;e=b.$length;f=c;g=d;h=e;if(g>h){b=$appendSlice(b,$convertSliceType($makeSlice(C,(g-h>>0)),AJ));}if(g>0)),AJ));}i=a;j=0;while(true){if(!(j=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+k])*((k<0||k>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+k]));j++;}return f;};$pkg.Dot=L;C.prototype.Dot=function(a){var a,b;b=this;return L(b,a);};$ptrType(C).prototype.Dot=function(a){return this.$get().Dot(a);};C.prototype.Cross=function(a){var a,b;b=this;if(!((b.$length===3))||!((a.$length===3))){return C.nil;}return new C([(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])*(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2])-(2>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+2])*(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]),(2>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+2])*(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0])-(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])*(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2]),(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])*(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2])-(2>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+2])*(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0])]);};$ptrType(C).prototype.Cross=function(a){return this.$get().Cross(a);};C.prototype.Rotate=function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;c=this;d=2;e=c.$length;f=d;g=e;if(g===0){return c;}if(b.$length>0){f=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]);}if((g===1)&&!((f===2))){c=$append(c,0,0);}if((g<2&&(f===2))||((g===2)&&!((f===2)))){c=$append(c,0);}h=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]);i=(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);j=h;k=i;l=A.Cos(a);m=A.Sin(a);n=l;o=m;p=f;if(p===(0)){q=(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]);(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=k*n-q*o);(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]=k*o+q*n);}else if(p===(1)){r=(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]);(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=j*n+r*o);(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]=-j*o+r*n);}else if(p===(2)){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=j*n-k*o);(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=j*o+k*n);}if(g>3){return $subslice(c,0,3);}return c;};$ptrType(C).prototype.Rotate=function(a,b){return this.$get().Rotate(a,b);};C.prototype.X=function(){var a;a=this;if(a.$length<1){return 0;}return(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0]);};$ptrType(C).prototype.X=function(){return this.$get().X();};C.prototype.Y=function(){var a;a=this;if(a.$length<2){return 0;}return(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]);};$ptrType(C).prototype.Y=function(){return this.$get().Y();};C.prototype.Z=function(){var a;a=this;if(a.$length<3){return 0;}return(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2]);};$ptrType(C).prototype.Z=function(){return this.$get().Z();};P=function(a,b,c,d){var a,b,c,d,e,f,g;e=new O.ptr(AM.nil,c,d);e.Resize((f=a/c,(f===f&&f!==1/0&&f!==-1/0)?f>>0:$throwRuntimeError("integer divide by zero")),(g=b/d,(g===g&&g!==1/0&&g!==-1/0)?g>>0:$throwRuntimeError("integer divide by zero")));return e;};$pkg.NewSpace=P;O.ptr.prototype.Add=function(a){var{a,b,c,d,e,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=this;if(b===AN.nil){$panic(new $String("ERROR: space is nil"));}c=a;d=0;case 1:if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);e.Space=b;$r=e.Update();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}d++;$s=1;continue;case 2:$s=-1;return;}return;}var $f={$blk:O.ptr.prototype.Add,$c:true,$r,a,b,c,d,e,$s};return $f;};O.prototype.Add=function(a){return this.$val.Add(a);};O.ptr.prototype.Remove=function(a){var a,b,c,d,e,f,g,h;b=this;if(b===AN.nil){$panic(new $String("ERROR: space is nil"));}c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=e.TouchingCells;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);h.unregister(e);g++;}e.TouchingCells=new AL([]);e.Space=AN.nil;d++;}};O.prototype.Remove=function(a){return this.$val.Remove(a);};O.ptr.prototype.Objects=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;a=this;b=$makeMap(AO.keyFor,[]);c=new AP([]);d=a.Cells;e=0;while(true){if(!(e=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+f]));i=0;while(true){if(!(i=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+f])),((j<0||j>=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+j])).Objects;n=0;while(true){if(!(n=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+n]);p=(q=b[AO.keyFor(o)],q!==undefined?[q.v,true]:[false,false]);r=p[1];if(!r){c=$append(c,o);s=o;(b||$throwRuntimeError("assignment to entry in nil map"))[AO.keyFor(s)]={k:s,v:true};}n++;}i++;}e++;}return c;};O.prototype.Objects=function(){return this.$val.Objects();};O.ptr.prototype.Resize=function(a,b){var a,b,c,d,e,f,g;c=this;c.Cells=new AM([]);d=0;while(true){if(!(d=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+d]=$append((f=c.Cells,((d<0||d>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+d])),AI(e,d))));e=e+(1)>>0;}d=d+(1)>>0;}};O.prototype.Resize=function(a,b){return this.$val.Resize(a,b);};O.ptr.prototype.Cell=function(a,b){var a,b,c,d,e,f;c=this;if(b>=0&&b=0&&a<(d=c.Cells,((b<0||b>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+b])).$length){return(e=(f=c.Cells,((b<0||b>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+b])),((a<0||a>=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+a]));}return AK.nil;};O.prototype.Cell=function(a,b){return this.$val.Cell(a,b);};O.ptr.prototype.CheckCells=function(a,b,c,d,e){var a,b,c,d,e,f,g,h,i,j,k,l,m;f=this;g=a;while(true){if(!(g<(a+c>>0))){break;}h=b;while(true){if(!(h<(b+d>>0))){break;}i=f.Cell(g,h);if(!(i===AK.nil)){if(e.$length>0){if(i.ContainsTags(e)){j=i.Objects;k=0;while(true){if(!(k=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+k]);if(l.HasTags(e)){return l;}k++;}}}else if(i.Occupied()){return(m=i.Objects,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0]));}}h=h+(1)>>0;}g=g+(1)>>0;}return AO.nil;};O.prototype.CheckCells=function(a,b,c,d,e){return this.$val.CheckCells(a,b,c,d,e);};O.ptr.prototype.CheckCellsWorld=function(a,b,c,d,e){var a,b,c,d,e,f,g,h,i,j,k,l;f=this;g=f.WorldToSpace(a,b);h=g[0];i=g[1];j=f.WorldToSpace(c,d);k=j[0];l=j[1];return f.CheckCells(h,i,k,l,e);};O.prototype.CheckCellsWorld=function(a,b,c,d,e){return this.$val.CheckCellsWorld(a,b,c,d,e);};O.ptr.prototype.UnregisterAllObjects=function(){var a,b,c,d,e,f,g;a=this;b=0;while(true){if(!(b=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+b])).$length)){break;}g=(e=(f=a.Cells,((b<0||b>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+b])),((c<0||c>=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+c]));a.Remove(g.Objects);c=c+(1)>>0;}b=b+(1)>>0;}};O.prototype.UnregisterAllObjects=function(){return this.$val.UnregisterAllObjects();};O.ptr.prototype.WorldToSpace=function(a,b){var a,b,c,d,e;c=this;d=((A.Floor(a/(c.CellWidth))>>0));e=((A.Floor(b/(c.CellHeight))>>0));return[d,e];};O.prototype.WorldToSpace=function(a,b){return this.$val.WorldToSpace(a,b);};O.ptr.prototype.SpaceToWorld=function(a,b){var a,b,c,d,e;c=this;d=(($imul(a,c.CellWidth)));e=(($imul(b,c.CellHeight)));return[d,e];};O.prototype.SpaceToWorld=function(a,b){return this.$val.SpaceToWorld(a,b);};O.ptr.prototype.Height=function(){var a;a=this;return a.Cells.$length;};O.prototype.Height=function(){return this.$val.Height();};O.ptr.prototype.Width=function(){var a,b;a=this;if(a.Cells.$length>0){return(b=a.Cells,(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])).$length;}return 0;};O.prototype.Width=function(){return this.$val.Width();};O.ptr.prototype.CellsInLine=function(a,b,c,d){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;e=this;f=new AL([]);g=e.Cell(a,b);h=e.Cell(c,d);if(!(g===AK.nil)&&!(h===AK.nil)){i=new C([((c-a>>0)),((d-b>>0))]).Unit();(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0]=(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])*(((j=e.CellWidth/2,(j===j&&j!==1/0&&j!==-1/0)?j>>0:$throwRuntimeError("integer divide by zero")))));(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1]=(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1])*(((k=e.CellHeight/2,(k===k&&k!==1/0&&k!==-1/0)?k>>0:$throwRuntimeError("integer divide by zero")))));l=e.SpaceToWorld(a,b);m=l[0];n=l[1];q=new C([m+((o=e.CellWidth/2,(o===o&&o!==1/0&&o!==-1/0)?o>>0:$throwRuntimeError("integer divide by zero"))),n+((p=e.CellHeight/2,(p===p&&p!==1/0&&p!==-1/0)?p>>0:$throwRuntimeError("integer divide by zero")))]);r=false;while(true){if(!(!(g===AK.nil))){break;}if(g===h){f=$append(f,g);break;}f=$append(f,g);if(r){(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]=(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1])+((1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1])));}else{(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0]=(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0])+((0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])));}s=e.WorldToSpace((0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0]),(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]));t=s[0];u=s[1];v=e.Cell(t,u);if(!(v===g)){g=v;}r=!r;}}return f;};O.prototype.CellsInLine=function(a,b,c,d){return this.$val.CellsInLine(a,b,c,d);};S=function(a,b,c,d){var a,b,c,d;return new R.ptr(new C([a,b]),new C([c,d]));};$pkg.NewLine=S;R.ptr.prototype.Project=function(a){var a,b;b=this;return b.Vector().Scale(a.Dot(b.Start.Sub(new AQ([b.End]))));};R.prototype.Project=function(a){return this.$val.Project(a);};R.ptr.prototype.Normal=function(){var a,b;a=this;b=a.Vector();return new C([(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1]),-(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])]).Unit();};R.prototype.Normal=function(){return this.$val.Normal();};R.ptr.prototype.Vector=function(){var a;a=this;return a.End.Clone().Sub(new AQ([a.Start])).Unit();};R.prototype.Vector=function(){return this.$val.Vector();};R.ptr.prototype.IntersectionPointsLine=function(a){var a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;b=this;k=((c=b.End,(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]))-(d=b.Start,(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0])))*((e=a.End,(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]))-(f=a.Start,(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1])))-((g=a.End,(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]))-(h=a.Start,(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])))*((i=b.End,(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1]))-(j=b.Start,(1>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+1])));if(!((k===0))){t=((((l=b.Start,(1>=l.$length?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+1]))-(m=a.Start,(1>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+1])))*((n=a.End,(0>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+0]))-(o=a.Start,(0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0]))))-(((p=b.Start,(0>=p.$length?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+0]))-(q=a.Start,(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0])))*((r=a.End,(1>=r.$length?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+1]))-(s=a.Start,(1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1]))))+1)/k;ac=((((u=b.Start,(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]))-(v=a.Start,(1>=v.$length?($throwRuntimeError("index out of range"),undefined):v.$array[v.$offset+1])))*((w=b.End,(0>=w.$length?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+0]))-(x=b.Start,(0>=x.$length?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+0]))))-(((y=b.Start,(0>=y.$length?($throwRuntimeError("index out of range"),undefined):y.$array[y.$offset+0]))-(z=a.Start,(0>=z.$length?($throwRuntimeError("index out of range"),undefined):z.$array[z.$offset+0])))*((aa=b.End,(1>=aa.$length?($throwRuntimeError("index out of range"),undefined):aa.$array[aa.$offset+1]))-(ab=b.Start,(1>=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+1]))))+1)/k;if((0=ad.$length?($throwRuntimeError("index out of range"),undefined):ad.$array[ad.$offset+0]))-(ae=b.Start,(0>=ae.$length?($throwRuntimeError("index out of range"),undefined):ae.$array[ae.$offset+0]));ai=(ag=b.End,(1>=ag.$length?($throwRuntimeError("index out of range"),undefined):ag.$array[ag.$offset+1]))-(ah=b.Start,(1>=ah.$length?($throwRuntimeError("index out of range"),undefined):ah.$array[ah.$offset+1]));return new C([(aj=b.Start,(0>=aj.$length?($throwRuntimeError("index out of range"),undefined):aj.$array[aj.$offset+0]))+(t*af),(ak=b.Start,(1>=ak.$length?($throwRuntimeError("index out of range"),undefined):ak.$array[ak.$offset+1]))+(t*ai)]);}}return C.nil;};R.prototype.IntersectionPointsLine=function(a){return this.$val.IntersectionPointsLine(a);};R.ptr.prototype.IntersectionPointsCircle=function(a){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;b=this;c=new AQ([]);d=new C([a.X,a.Y]);e=b.Start.Sub(new AQ([d]));f=b.End.Sub(new AQ([d]));g=f.Sub(new AQ([e]));h=(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])+(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1]);i=2*(((0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])*(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]))+((1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])*(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])));j=((0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])*(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]))+((1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])*(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]))-(a.Radius*a.Radius);k=i*i-(4*h*j);if(k<0){}else if(k===0){l=-i/(2*h);if(l>=0&&l<=1){c=$append(c,new C([(m=b.Start,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0]))+l*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(n=b.Start,(1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1]))+l*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])]));}}else{o=(-i+A.Sqrt(k))/(2*h);if(o>=0&&o<=1){c=$append(c,new C([(p=b.Start,(0>=p.$length?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+0]))+o*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(q=b.Start,(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]))+o*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])]));}o=(-i-A.Sqrt(k))/(2*h);if(o>=0&&o<=1){c=$append(c,new C([(r=b.Start,(0>=r.$length?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+0]))+o*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(s=b.Start,(1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1]))+o*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])]));}}return c;};R.prototype.IntersectionPointsCircle=function(a){return this.$val.IntersectionPointsCircle(a);};U=function(a){var a,b;b=new T.ptr(new AQ([]),0,0,true);b.AddPoints(a);return b;};$pkg.NewConvexPolygon=U;T.ptr.prototype.Clone=function(){var a,b,c,d,e,f;a=this;b=new AQ([]);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=$append(b,e.Clone());d++;}f=U(AJ.nil);f.X=a.X;f.Y=a.Y;f.AddPointsVec(b);f.Closed=a.Closed;return f;};T.prototype.Clone=function(){return this.$val.Clone();};T.ptr.prototype.AddPointsVec=function(a){var a,b;b=this;b.Points=$appendSlice(b.Points,a);};T.prototype.AddPointsVec=function(a){return this.$val.AddPointsVec(a);};T.ptr.prototype.AddPoints=function(a){var a,b,c,d;b=this;c=0;while(true){if(!(c=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+c]),(d=c+1>>0,((d<0||d>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+d]))]));c=c+(2)>>0;}};T.prototype.AddPoints=function(a){return this.$val.AddPoints(a);};T.ptr.prototype.Lines=function(){var a,b,c,d,e,f,g,h,i,j;a=this;b=new AS([]);c=a.Transformed();d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]);g=e;h=f;if(d<(c.$length-1>>0)){h=(i=d+1>>0,((i<0||i>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+i]));}else if(!a.Closed){break;}j=S((0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1]),(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]),(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1]));b=$append(b,j);d=d+(1)>>0;}return b;};T.prototype.Lines=function(){return this.$val.Lines();};T.ptr.prototype.Transformed=function(){var a,b,c,d,e;a=this;b=new AQ([]);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=$append(b,new C([(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])+a.X,(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])+a.Y]));d++;}return b;};T.prototype.Transformed=function(){return this.$val.Transformed();};T.ptr.prototype.Bounds=function(){var a,b,c,d,e,f,g,h;a=this;b=a.Transformed();e=new C([(c=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]),(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])),(d=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]),(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]))]);f=e.Clone();g=0;while(true){if(!(g=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+g]);if((0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])<(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])){(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]=(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]));}else if((0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])>(0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0])){(0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0]=(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]));}if((1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])<(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])){(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]=(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1]));}else if((1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])>(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1])){(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1]=(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1]));}g=g+(1)>>0;}return[e,f];};T.prototype.Bounds=function(){return this.$val.Bounds();};T.ptr.prototype.Position=function(){var a;a=this;return[a.X,a.Y];};T.prototype.Position=function(){return this.$val.Position();};T.ptr.prototype.SetPosition=function(a,b){var a,b,c;c=this;c.X=a;c.Y=b;};T.prototype.SetPosition=function(a,b){return this.$val.SetPosition(a,b);};T.ptr.prototype.SetPositionVec=function(a){var a,b;b=this;b.X=a.X();b.Y=a.Y();};T.prototype.SetPositionVec=function(a){return this.$val.SetPositionVec(a);};T.ptr.prototype.Move=function(a,b){var a,b,c;c=this;c.X=c.X+(a);c.Y=c.Y+(b);};T.prototype.Move=function(a,b){return this.$val.Move(a,b);};T.ptr.prototype.MoveVec=function(a){var a,b;b=this;b.X=b.X+(a.X());b.Y=b.Y+(a.Y());};T.prototype.MoveVec=function(a){return this.$val.MoveVec(a);};T.ptr.prototype.Center=function(){var a,b,c,d,e;a=this;b=new C([0,0]);c=a.Transformed();d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b.Add(new AQ([e]));d++;}(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])/((a.Transformed().$length)));(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1]=(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])/((a.Transformed().$length)));return b;};T.prototype.Center=function(){return this.$val.Center();};T.ptr.prototype.Project=function(a){var a,b,c,d,e,f,g,h,i,j,k;b=this;a=a.Unit();c=b.Transformed();f=a.Dot(new C([(d=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]),(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0])),(e=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]),(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]))]));g=f;h=1;while(true){if(!(h=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+h]),(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])),(j=((h<0||h>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+h]),(1>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+1]))]));if(kg){g=k;}h=h+(1)>>0;}return new AA.ptr(f,g);};T.prototype.Project=function(a){return this.$val.Project(a);};T.ptr.prototype.SATAxes=function(){var a,b,c,d,e;a=this;b=new AQ([]);c=a.Lines();d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=$append(b,e.Normal());d++;}return b;};T.prototype.SATAxes=function(){return this.$val.SATAxes();};T.ptr.prototype.PointInside=function(a){var a,b,c,d,e,f,g;b=this;c=S((0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0]),(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]),(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0])+9.99999999999e+11,(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]));d=0;e=b.Lines();f=0;while(true){if(!(f=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+f]);if(!(g.IntersectionPointsLine(c)===C.nil)){d=d+(1)>>0;}f++;}return d===1;};T.prototype.PointInside=function(a){return this.$val.PointInside(a);};W=function(){return new V.ptr(new AQ([]),new C([0,0]),new C([0,0]));};$pkg.NewContactSet=W;V.ptr.prototype.LeftmostPoint=function(){var a,b,c,d,e;a=this;b=C.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===C.nil||(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])<(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])){b=e;}d++;}return b;};V.prototype.LeftmostPoint=function(){return this.$val.LeftmostPoint();};V.ptr.prototype.RightmostPoint=function(){var a,b,c,d,e;a=this;b=C.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===C.nil||(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])>(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])){b=e;}d++;}return b;};V.prototype.RightmostPoint=function(){return this.$val.RightmostPoint();};V.ptr.prototype.TopmostPoint=function(){var a,b,c,d,e;a=this;b=C.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===C.nil||(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])<(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])){b=e;}d++;}return b;};V.prototype.TopmostPoint=function(){return this.$val.TopmostPoint();};V.ptr.prototype.BottommostPoint=function(){var a,b,c,d,e;a=this;b=C.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===C.nil||(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])>(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])){b=e;}d++;}return b;};V.prototype.BottommostPoint=function(){return this.$val.BottommostPoint();};T.ptr.prototype.Intersection=function(a,b,c){var{a,aa,ab,ac,ad,ae,af,ag,ah,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=this;e=W();f=d.X;g=d.Y;d.X=d.X+(a);d.Y=d.Y+(b);h=$assertType(c,AT,true);i=h[0];j=h[1];if(j){k=d.Lines();l=0;while(true){if(!(l=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+l]);e.Points=$appendSlice(e.Points,m.IntersectionPointsCircle(i));l++;}}else{n=$assertType(c,AU,true);o=n[0];p=n[1];if(p){q=d.Lines();r=0;while(true){if(!(r=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+r]);t=o.Lines();u=0;while(true){if(!(u=t.$length)?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+u]);w=s.IntersectionPointsLine(v);if(!(w===C.nil)){e.Points=$append(e.Points,w);}u++;}r++;}}}if(e.Points.$length>0){$s=1;continue;}$s=2;continue;case 1:x=e.Points;y=0;while(true){if(!(y=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+y]);e.Center=e.Center.Add(new AQ([z]));y++;}(ab=e.Center,(0>=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+0]=(aa=e.Center,(0>=aa.$length?($throwRuntimeError("index out of range"),undefined):aa.$array[aa.$offset+0]))/((e.Points.$length))));(ad=e.Center,(1>=ad.$length?($throwRuntimeError("index out of range"),undefined):ad.$array[ad.$offset+1]=(ac=e.Center,(1>=ac.$length?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+1]))/((e.Points.$length))));ae=d.calculateMTV(e,c);$s=4;case 4:if($c){$c=false;ae=ae.$blk();}if(ae&&ae.$blk!==undefined){break s;}af=ae;if(!(af===C.nil)){e.MTV=af;}$s=3;continue;case 2:e=AV.nil;case 3:if(!(e===AV.nil)&&(!((a===0))||!((b===0)))){ag=new C([a,b]).Magnitude();ah=e.MTV.Magnitude();e.MTV=e.MTV.Unit().Scale(ah-ag);}d.X=f;d.Y=g;$s=-1;return e;}return;}var $f={$blk:T.ptr.prototype.Intersection,$c:true,$r,a,aa,ab,ac,ad,ae,af,ag,ah,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};T.prototype.Intersection=function(a,b,c){return this.$val.Intersection(a,b,c);};T.ptr.prototype.calculateMTV=function(a,b){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=[c];d=[d];e=this;f=new C([0,0]);g=new C([1.7976931348623157e+308,0]);h=b;if($assertType(h,AU,true)[1]){$s=1;continue;}if($assertType(h,AT,true)[1]){$s=2;continue;}$s=3;continue;case 1:i=h.$val;k=e.SATAxes();l=0;while(true){if(!(l=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+l]);if(!$clone(e.Project(m),AA).Overlapping($clone(i.Project(m),AA))){$s=-1;return C.nil;}n=$clone(e.Project(m),AA).Overlap($clone(i.Project(m),AA));if(g.Magnitude()>n){g=m.Scale(n);}l++;}o=i.SATAxes();p=0;while(true){if(!(p=o.$length)?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+p]);if(!$clone(e.Project(q),AA).Overlapping($clone(i.Project(q),AA))){$s=-1;return C.nil;}r=$clone(e.Project(q),AA).Overlap($clone(i.Project(q),AA));if(g.Magnitude()>r){g=q.Scale(r);}p++;}$s=3;continue;case 2:j=h.$val;d[0]=$appendSlice(new AQ([]),e.Transformed());d[0]=$append(d[0],a.Center);c[0]=new C([j.X,j.Y]);$r=B.Slice(d[0],(function(c,d){return function(s,t){var s,t;return((s<0||s>=d[0].$length)?($throwRuntimeError("index out of range"),undefined):d[0].$array[d[0].$offset+s]).Sub(new AQ([c[0]])).Magnitude()<((t<0||t>=d[0].$length)?($throwRuntimeError("index out of range"),undefined):d[0].$array[d[0].$offset+t]).Sub(new AQ([c[0]])).Magnitude();};})(c,d));$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}g=new C([(0>=c[0].$length?($throwRuntimeError("index out of range"),undefined):c[0].$array[c[0].$offset+0])-(s=(0>=d[0].$length?($throwRuntimeError("index out of range"),undefined):d[0].$array[d[0].$offset+0]),(0>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+0])),(1>=c[0].$length?($throwRuntimeError("index out of range"),undefined):c[0].$array[c[0].$offset+1])-(t=(0>=d[0].$length?($throwRuntimeError("index out of range"),undefined):d[0].$array[d[0].$offset+0]),(1>=t.$length?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+1]))]);g=g.Unit().Scale(g.Magnitude()-j.Radius);case 3:(0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0]=(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]));(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1]=(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1]));$s=-1;return f;}return;}var $f={$blk:T.ptr.prototype.calculateMTV,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,$s};return $f;};T.prototype.calculateMTV=function(a,b){return this.$val.calculateMTV(a,b);};T.ptr.prototype.ContainedBy=function(a){var a,b,c,d,e,f,g,h,i,j;b=this;c=a;if($assertType(c,AU,true)[1]){d=c.$val;e=b.SATAxes();f=0;while(true){if(!(f=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+f]);if(!$clone(b.Project(g),AA).IsInside($clone(d.Project(g),AA))){return false;}f++;}h=d.SATAxes();i=0;while(true){if(!(i=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]);if(!$clone(b.Project(j),AA).IsInside($clone(d.Project(j),AA))){return false;}i++;}}return true;};T.prototype.ContainedBy=function(a){return this.$val.ContainedBy(a);};T.ptr.prototype.FlipH=function(){var a,b,c,d;a=this;b=a.Points;c=0;while(true){if(!(c=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+c]);(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0]=-(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0]));c++;}a.ReverseVertexOrder();};T.prototype.FlipH=function(){return this.$val.FlipH();};T.ptr.prototype.FlipV=function(){var a,b,c,d;a=this;b=a.Points;c=0;while(true){if(!(c=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+c]);(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]=-(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]));c++;}a.ReverseVertexOrder();};T.prototype.FlipV=function(){return this.$val.FlipV();};T.ptr.prototype.ReverseVertexOrder=function(){var a,b,c,d,e;a=this;c=new AQ([(b=a.Points,(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]))]);d=a.Points.$length-1>>0;while(true){if(!(d>=1)){break;}c=$append(c,(e=a.Points,((d<0||d>=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+d])));d=d-(1)>>0;}a.Points=c;};T.prototype.ReverseVertexOrder=function(){return this.$val.ReverseVertexOrder();};X=function(a,b,c,d){var a,b,c,d;return U(new AJ([a,b,a+c,b,a+c,b+d,a,b+d]));};$pkg.NewRectangle=X;Z=function(a,b,c){var a,b,c,d;d=new Y.ptr(a,b,c);return d;};$pkg.NewCircle=Z;Y.ptr.prototype.Clone=function(){var a;a=this;return Z(a.X,a.Y,a.Radius);};Y.prototype.Clone=function(){return this.$val.Clone();};Y.ptr.prototype.Bounds=function(){var a;a=this;return[new C([a.X-a.Radius,a.Y-a.Radius]),new C([a.X+a.Radius,a.Y+a.Radius])];};Y.prototype.Bounds=function(){return this.$val.Bounds();};Y.ptr.prototype.Intersection=function(a,b,c){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=this;e=AV.nil;f=d.X;g=d.Y;d.X=d.X+(a);d.Y=d.Y+(b);h=c;if($assertType(h,AU,true)[1]){$s=1;continue;}if($assertType(h,AT,true)[1]){$s=2;continue;}$s=3;continue;case 1:i=h.$val;k=i.Intersection(-a,-b,d);$s=4;case 4:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}e=k;if(!(e===AV.nil)){e.MTV=e.MTV.Scale(-1);}$s=3;continue;case 2:j=h.$val;e=W();e.Points=d.IntersectionPointsCircle(j);if(e.Points.$length===0){$s=-1;return AV.nil;}e.MTV=new C([d.X-j.X,d.Y-j.Y]);l=e.MTV.Magnitude();e.MTV=e.MTV.Unit().Scale(d.Radius+j.Radius-l);m=e.Points;n=0;while(true){if(!(n=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+n]);e.Center=e.Center.Add(new AQ([o]));n++;}(q=e.Center,(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0]=(p=e.Center,(0>=p.$length?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+0]))/((e.Points.$length))));(s=e.Center,(1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1]=(r=e.Center,(1>=r.$length?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+1]))/((e.Points.$length))));case 3:d.X=f;d.Y=g;$s=-1;return e;}return;}var $f={$blk:Y.ptr.prototype.Intersection,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,$s};return $f;};Y.prototype.Intersection=function(a,b,c){return this.$val.Intersection(a,b,c);};Y.ptr.prototype.Move=function(a,b){var a,b,c;c=this;c.X=c.X+(a);c.Y=c.Y+(b);};Y.prototype.Move=function(a,b){return this.$val.Move(a,b);};Y.ptr.prototype.MoveVec=function(a){var a,b;b=this;b.X=b.X+(a.X());b.Y=b.Y+(a.Y());};Y.prototype.MoveVec=function(a){return this.$val.MoveVec(a);};Y.ptr.prototype.SetPosition=function(a,b){var a,b,c;c=this;c.X=a;c.Y=b;};Y.prototype.SetPosition=function(a,b){return this.$val.SetPosition(a,b);};Y.ptr.prototype.SetPositionVec=function(a){var a,b;b=this;b.X=a.X();b.Y=a.Y();};Y.prototype.SetPositionVec=function(a){return this.$val.SetPositionVec(a);};Y.ptr.prototype.Position=function(){var a;a=this;return[a.X,a.Y];};Y.prototype.Position=function(){return this.$val.Position();};Y.ptr.prototype.PointInside=function(a){var a,b;b=this;return a.Sub(new AQ([new C([b.X,b.Y])])).Magnitude()<=b.Radius;};Y.prototype.PointInside=function(a){return this.$val.PointInside(a);};Y.ptr.prototype.IntersectionPointsCircle=function(a){var a,b,c,d,e,f,g;b=this;c=A.Sqrt(A.Pow(a.X-b.X,2)+A.Pow(a.Y-b.Y,2));if(c>b.Radius+a.Radius||c0;};AA.prototype.Overlapping=function(a){return this.$val.Overlapping(a);};AA.ptr.prototype.Overlap=function(a){var a,b;b=this;return A.Min(b.Max,a.Max)-A.Max(b.Min,a.Min);};AA.prototype.Overlap=function(a){return this.$val.Overlap(a);};AA.ptr.prototype.IsInside=function(a){var a,b;b=this;return b.Min>=a.Min&&b.Max<=a.Max;};AA.prototype.IsInside=function(a){return this.$val.IsInside(a);};AC=function(a,b,c,d,e){var a,b,c,d,e,f;f=new AB.ptr($ifaceNil,AN.nil,a,b,c,d,AL.nil,$ifaceNil,$makeMap(AO.keyFor,[]),new AW([]));if(e.$length>0){f.AddTags(e);}return f;};$pkg.NewObject=AC;AB.ptr.prototype.Clone=function(){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:a=this;b=AC(a.X,a.Y,a.W,a.H,a.Tags());b.Data=a.Data;if(!($interfaceIsEqual(a.Shape,$ifaceNil))){$s=1;continue;}$s=2;continue;case 1:c=a.Shape.Clone();$s=3;case 3:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$r=b.SetShape(c);$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:d=a.ignoreList;e=0;f=$keys(d);while(true){if(!(e>0;}h=h+(1)>>0;}}if(!($interfaceIsEqual(a.Shape,$ifaceNil))){$s=1;continue;}$s=2;continue;case 1:$r=a.Shape.SetPosition(a.X,a.Y);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:$s=-1;return;}return;}var $f={$blk:AB.ptr.prototype.Update,$c:true,$r,a,b,c,d,e,f,g,h,i,j,$s};return $f;};AB.prototype.Update=function(){return this.$val.Update();};AB.ptr.prototype.AddTags=function(a){var a,b;b=this;b.tags=$appendSlice(b.tags,a);};AB.prototype.AddTags=function(a){return this.$val.AddTags(a);};AB.ptr.prototype.RemoveTags=function(a){var a,b,c,d,e,f,g,h,i;b=this;c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=b.tags;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);if(i===e){b.tags=$appendSlice($subslice(b.tags,0,h),$subslice(b.tags,(h+1>>0)));break;}g++;}d++;}};AB.prototype.RemoveTags=function(a){return this.$val.RemoveTags(a);};AB.ptr.prototype.HasTags=function(a){var a,b,c,d,e,f,g,h;b=this;c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=b.tags;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);if(h===e){return true;}g++;}d++;}return false;};AB.prototype.HasTags=function(a){return this.$val.HasTags(a);};AB.ptr.prototype.Tags=function(){var a;a=this;return $appendSlice(new AW([]),a.tags);};AB.prototype.Tags=function(){return this.$val.Tags();};AB.ptr.prototype.SetShape=function(a){var{a,b,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=this;if(!($interfaceIsEqual(b.Shape,a))){$s=1;continue;}$s=2;continue;case 1:b.Shape=a;$r=b.Update();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:$s=-1;return;}return;}var $f={$blk:AB.ptr.prototype.SetShape,$c:true,$r,a,b,$s};return $f;};AB.prototype.SetShape=function(a){return this.$val.SetShape(a);};AB.ptr.prototype.BoundsToSpace=function(a,b){var a,b,c,d,e,f,g,h,i;c=this;d=c.Space.WorldToSpace(c.X+a,c.Y+b);e=d[0];f=d[1];g=c.Space.WorldToSpace(c.X+c.W+a-1,c.Y+c.H+b-1);h=g[0];i=g[1];return[e,f,h,i];};AB.prototype.BoundsToSpace=function(a,b){return this.$val.BoundsToSpace(a,b);};AB.ptr.prototype.SharesCells=function(a){var a,b,c,d,e;b=this;c=b.TouchingCells;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.Contains(a)){return true;}d++;}return false;};AB.prototype.SharesCells=function(a){return this.$val.SharesCells(a);};AB.ptr.prototype.SharesCellsTags=function(a){var a,b,c,d,e;b=this;c=b.TouchingCells;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.ContainsTags(a)){return true;}d++;}return false;};AB.prototype.SharesCellsTags=function(a){return this.$val.SharesCellsTags(a);};AB.ptr.prototype.Center=function(){var a;a=this;return[a.X+(a.W/2),a.Y+(a.H/2)];};AB.prototype.Center=function(){return this.$val.Center();};AB.ptr.prototype.SetCenter=function(a,b){var a,b,c;c=this;c.X=a-(c.W/2);c.Y=b-(c.H/2);};AB.prototype.SetCenter=function(a,b){return this.$val.SetCenter(a,b);};AB.ptr.prototype.CellPosition=function(){var a,b;a=this;b=a.Center();return a.Space.WorldToSpace(b[0],b[1]);};AB.prototype.CellPosition=function(){return this.$val.CellPosition();};AB.ptr.prototype.SetRight=function(a){var a,b;b=this;b.X=a-b.W;};AB.prototype.SetRight=function(a){return this.$val.SetRight(a);};AB.ptr.prototype.SetBottom=function(a){var a,b;b=this;b.Y=a-b.H;};AB.prototype.SetBottom=function(a){return this.$val.SetBottom(a);};AB.ptr.prototype.Bottom=function(){var a;a=this;return a.Y+a.H;};AB.prototype.Bottom=function(){return this.$val.Bottom();};AB.ptr.prototype.Right=function(){var a;a=this;return a.X+a.W;};AB.prototype.Right=function(){return this.$val.Right();};AB.ptr.prototype.SetBounds=function(a,b){var a,b,c;c=this;c.X=(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0]);c.Y=(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]);c.W=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])-c.X;c.H=(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])-c.Y;};AB.prototype.SetBounds=function(a,b){return this.$val.SetBounds(a,b);};AB.ptr.prototype.Check=function(a,b,c){var{a,aa,ab,ac,ad,ae,af,ag,ah,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=[d];e=[e];f=[f];g=[g];h=this;if(h.Space===AN.nil){$s=-1;return AX.nil;}d[0]=AG();d[0].checkingObject=h;if(a<0){a=A.Min(a,-1);}else if(a>0){a=A.Max(a,1);}if(b<0){b=A.Min(b,-1);}else if(b>0){b=A.Max(b,1);}d[0].dx=a;d[0].dy=b;i=h.BoundsToSpace(a,b);j=i[0];k=i[1];l=i[2];m=i[3];n=$makeMap(AO.keyFor,[]);o=$makeMap(AK.keyFor,[]);p=k;while(true){if(!(p<=m)){break;}q=j;while(true){if(!(q<=l)){break;}r=h.Space.Cell(q,p);if(!(r===AK.nil)){s=r.Objects;t=0;while(true){if(!(t=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);w=(v=h.ignoreList[AO.keyFor(u)],v!==undefined?v.v:false);if(u===h||w){t++;continue;}x=(y=n[AO.keyFor(u)],y!==undefined?[y.v,true]:[false,false]);z=x[1];if(((c.$length===0)||u.HasTags(c))&&!z){d[0].Objects=$append(d[0].Objects,u);aa=u;(n||$throwRuntimeError("assignment to entry in nil map"))[AO.keyFor(aa)]={k:aa,v:true};ab=(ac=o[AK.keyFor(r)],ac!==undefined?[ac.v,true]:[false,false]);ad=ab[1];if(!ad){d[0].Cells=$append(d[0].Cells,r);ae=r;(o||$throwRuntimeError("assignment to entry in nil map"))[AK.keyFor(ae)]={k:ae,v:true};}t++;continue;}t++;}}q=q+(1)>>0;}p=p+(1)>>0;}if(d[0].Objects.$length===0){$s=-1;return AX.nil;}af=d[0].checkingObject.Center();ag=af[0];ah=af[1];g[0]=new C([ag,ah]);$r=B.Slice(d[0].Objects,(function(d,e,f,g){return function(ai,aj){var ai,aj,ak,al,am,an,ao,ap,aq,ar;ak=(al=d[0].Objects,((ai<0||ai>=al.$length)?($throwRuntimeError("index out of range"),undefined):al.$array[al.$offset+ai])).Center();am=ak[0];an=ak[1];ao=(ap=d[0].Objects,((aj<0||aj>=ap.$length)?($throwRuntimeError("index out of range"),undefined):ap.$array[ap.$offset+aj])).Center();aq=ao[0];ar=ao[1];return new C([am,an]).Sub(new AQ([g[0]])).Magnitude2()=ak.$length)?($throwRuntimeError("index out of range"),undefined):ak.$array[ak.$offset+ai])).X,f[0]))+((al=f[0]/2,(al===al&&al!==1/0&&al!==-1/0)?al>>0:$throwRuntimeError("integer divide by zero")))>>0)),((($imul((am=d[0].Cells,((ai<0||ai>=am.$length)?($throwRuntimeError("index out of range"),undefined):am.$array[am.$offset+ai])).Y,e[0]))+((an=e[0]/2,(an===an&&an!==1/0&&an!==-1/0)?an>>0:$throwRuntimeError("integer divide by zero")))>>0))]).Sub(new AQ([g[0]])).Magnitude2()=ao.$length)?($throwRuntimeError("index out of range"),undefined):ao.$array[ao.$offset+aj])).X,f[0]))+((ap=f[0]/2,(ap===ap&&ap!==1/0&&ap!==-1/0)?ap>>0:$throwRuntimeError("integer divide by zero")))>>0)),((($imul((aq=d[0].Cells,((aj<0||aj>=aq.$length)?($throwRuntimeError("index out of range"),undefined):aq.$array[aq.$offset+aj])).Y,e[0]))+((ar=e[0]/2,(ar===ar&&ar!==1/0&&ar!==-1/0)?ar>>0:$throwRuntimeError("integer divide by zero")))>>0))]).Sub(new AQ([g[0]])).Magnitude2();};})(d,e,f,g));$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;return d[0];}return;}var $f={$blk:AB.ptr.prototype.Check,$c:true,$r,a,aa,ab,ac,ad,ae,af,ag,ah,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};AB.prototype.Check=function(a,b,c){return this.$val.Check(a,b,c);};AB.ptr.prototype.Overlaps=function(a){var a,b;b=this;return a.X<=b.X+b.W&&a.X+a.W>=b.X&&a.Y<=b.Y+b.H&&a.Y+a.H>=b.Y;};AB.prototype.Overlaps=function(a){return this.$val.Overlaps(a);};AB.ptr.prototype.AddToIgnoreList=function(a){var a,b,c;b=this;c=a;(b.ignoreList||$throwRuntimeError("assignment to entry in nil map"))[AO.keyFor(c)]={k:c,v:true};};AB.prototype.AddToIgnoreList=function(a){return this.$val.AddToIgnoreList(a);};AB.ptr.prototype.RemoveFromIgnoreList=function(a){var a,b;b=this;delete b.ignoreList[AO.keyFor(a)];};AB.prototype.RemoveFromIgnoreList=function(a){return this.$val.RemoveFromIgnoreList(a);};AD=function(a,b,c,d){var a,b,c,d,e,f,g,h,i;e=d.$length;f=c;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);if(h===e){return;}((h<0||h>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+h]=b*i+((h<0||h>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+h]));g++;}};AE=function(a,b,c){var a,b,c,d,e,f;d=c;e=0;while(true){if(!(e=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]=((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f])*(b));e++;}};AG=function(){return new AF.ptr(AO.nil,0,0,new AP([]),AL.nil);};$pkg.NewCollision=AG;AF.ptr.prototype.HasTags=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e===b.checkingObject){d++;continue;}if(e.HasTags(a)){return true;}d++;}return false;};AF.prototype.HasTags=function(a){return this.$val.HasTags(a);};AF.ptr.prototype.ObjectsByTags=function(a){var a,b,c,d,e,f;b=this;c=new AP([]);d=b.Objects;e=0;while(true){if(!(e=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]);if(f===b.checkingObject){e++;continue;}if(f.HasTags(a)){c=$append(c,f);}e++;}return c;};AF.prototype.ObjectsByTags=function(a){return this.$val.ObjectsByTags(a);};AF.ptr.prototype.ContactWithObject=function(a){var a,b,c;b=this;c=new C([0,0]);if(b.dx<0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=a.X+a.W-b.checkingObject.X);}else if(b.dx>0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=a.X-b.checkingObject.W-b.checkingObject.X);}if(b.dy<0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=a.Y+a.H-b.checkingObject.Y);}else if(b.dy>0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=a.Y-b.checkingObject.H-b.checkingObject.Y);}return c;};AF.prototype.ContactWithObject=function(a){return this.$val.ContactWithObject(a);};AF.ptr.prototype.ContactWithCell=function(a){var a,b,c,d,e;b=this;c=new C([0,0]);d=(($imul(a.X,b.checkingObject.Space.CellWidth)));e=(($imul(a.Y,b.checkingObject.Space.CellHeight)));if(b.dx<0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=d+(b.checkingObject.Space.CellWidth)-b.checkingObject.X);}else if(b.dx>0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=d-b.checkingObject.W-b.checkingObject.X);}if(b.dy<0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=e+(b.checkingObject.Space.CellHeight)-b.checkingObject.Y);}else if(b.dy>0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=e-b.checkingObject.H-b.checkingObject.Y);}return c;};AF.prototype.ContactWithCell=function(a){return this.$val.ContactWithCell(a);};AF.ptr.prototype.SlideAgainstCell=function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;c=this;d=c.checkingObject.Space;f=(e=c.Cells,(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]));g=d.SpaceToWorld(f.X,f.Y);h=g[0];i=g[1];j=(d.CellWidth)/2;k=(d.CellHeight)/2;h=h+(j);i=i+(k);l=c.checkingObject.Center();m=l[0];n=l[1];o=m-h;p=n-i;q=d.Cell(f.X-1>>0,f.Y);r=d.Cell(f.X+1>>0,f.Y);s=d.Cell(f.X,f.Y-1>>0);t=d.Cell(f.X,f.Y+1>>0);u=new C([0,0]);if(!((c.dy===0))){if(o>0&&(r===AK.nil||!r.ContainsTags(b))){(0>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+0]=h+j-c.checkingObject.X);}else if(o<0&&(q===AK.nil||!q.ContainsTags(b))){(0>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+0]=h-j-(c.checkingObject.X+c.checkingObject.W));}else{return C.nil;}}if(!((c.dx===0))){if(p>0&&(t===AK.nil||!t.ContainsTags(b))){(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]=i+k-c.checkingObject.Y);}else if(p<0&&(s===AK.nil||!s.ContainsTags(b))){(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]=i-k-(c.checkingObject.Y+c.checkingObject.H));}else{return C.nil;}}return u;};AF.prototype.SlideAgainstCell=function(a,b){return this.$val.SlideAgainstCell(a,b);};AI=function(a,b){var a,b;return new AH.ptr(a,b,new AP([]));};AH.ptr.prototype.register=function(a){var a,b;b=this;if(!b.Contains(a)){b.Objects=$append(b.Objects,a);}};AH.prototype.register=function(a){return this.$val.register(a);};AH.ptr.prototype.unregister=function(a){var a,b,c,d,e,f,g,h,i;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(f===a){(i=b.Objects,((e<0||e>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+e]=(g=b.Objects,h=b.Objects.$length-1>>0,((h<0||h>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+h]))));b.Objects=$subslice(b.Objects,0,(b.Objects.$length-1>>0));break;}d++;}};AH.prototype.unregister=function(a){return this.$val.unregister(a);};AH.ptr.prototype.Contains=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e===a){return true;}d++;}return false;};AH.prototype.Contains=function(a){return this.$val.Contains(a);};AH.ptr.prototype.ContainsTags=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.HasTags(a)){return true;}d++;}return false;};AH.prototype.ContainsTags=function(a){return this.$val.ContainsTags(a);};AH.ptr.prototype.Occupied=function(){var a;a=this;return a.Objects.$length>0;};AH.prototype.Occupied=function(){return this.$val.Occupied();};C.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[C],false)},{prop:"Add",name:"Add",pkg:"",typ:$funcType([AQ],[C],true)},{prop:"Sub",name:"Sub",pkg:"",typ:$funcType([AQ],[C],true)},{prop:"Scale",name:"Scale",pkg:"",typ:$funcType([$Float64],[C],false)},{prop:"Equal",name:"Equal",pkg:"",typ:$funcType([C],[$Bool],false)},{prop:"Magnitude",name:"Magnitude",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Magnitude2",name:"Magnitude2",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Unit",name:"Unit",pkg:"",typ:$funcType([],[C],false)},{prop:"Dot",name:"Dot",pkg:"",typ:$funcType([C],[$Float64],false)},{prop:"Cross",name:"Cross",pkg:"",typ:$funcType([C],[C],false)},{prop:"Rotate",name:"Rotate",pkg:"",typ:$funcType([$Float64,AY],[C],true)},{prop:"X",name:"X",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Y",name:"Y",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Z",name:"Z",pkg:"",typ:$funcType([],[$Float64],false)}];AN.methods=[{prop:"Add",name:"Add",pkg:"",typ:$funcType([AP],[],true)},{prop:"Remove",name:"Remove",pkg:"",typ:$funcType([AP],[],true)},{prop:"Objects",name:"Objects",pkg:"",typ:$funcType([],[AP],false)},{prop:"Resize",name:"Resize",pkg:"",typ:$funcType([$Int,$Int],[],false)},{prop:"Cell",name:"Cell",pkg:"",typ:$funcType([$Int,$Int],[AK],false)},{prop:"CheckCells",name:"CheckCells",pkg:"",typ:$funcType([$Int,$Int,$Int,$Int,AW],[AO],true)},{prop:"CheckCellsWorld",name:"CheckCellsWorld",pkg:"",typ:$funcType([$Float64,$Float64,$Float64,$Float64,AW],[AO],true)},{prop:"UnregisterAllObjects",name:"UnregisterAllObjects",pkg:"",typ:$funcType([],[],false)},{prop:"WorldToSpace",name:"WorldToSpace",pkg:"",typ:$funcType([$Float64,$Float64],[$Int,$Int],false)},{prop:"SpaceToWorld",name:"SpaceToWorld",pkg:"",typ:$funcType([$Int,$Int],[$Float64,$Float64],false)},{prop:"Height",name:"Height",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Width",name:"Width",pkg:"",typ:$funcType([],[$Int],false)},{prop:"CellsInLine",name:"CellsInLine",pkg:"",typ:$funcType([$Int,$Int,$Int,$Int],[AL],false)}];AR.methods=[{prop:"Project",name:"Project",pkg:"",typ:$funcType([C],[C],false)},{prop:"Normal",name:"Normal",pkg:"",typ:$funcType([],[C],false)},{prop:"Vector",name:"Vector",pkg:"",typ:$funcType([],[C],false)},{prop:"IntersectionPointsLine",name:"IntersectionPointsLine",pkg:"",typ:$funcType([AR],[C],false)},{prop:"IntersectionPointsCircle",name:"IntersectionPointsCircle",pkg:"",typ:$funcType([AT],[AQ],false)}];AU.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[Q],false)},{prop:"AddPointsVec",name:"AddPointsVec",pkg:"",typ:$funcType([AQ],[],true)},{prop:"AddPoints",name:"AddPoints",pkg:"",typ:$funcType([AJ],[],true)},{prop:"Lines",name:"Lines",pkg:"",typ:$funcType([],[AS],false)},{prop:"Transformed",name:"Transformed",pkg:"",typ:$funcType([],[AQ],false)},{prop:"Bounds",name:"Bounds",pkg:"",typ:$funcType([],[C,C],false)},{prop:"Position",name:"Position",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"SetPosition",name:"SetPosition",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"SetPositionVec",name:"SetPositionVec",pkg:"",typ:$funcType([C],[],false)},{prop:"Move",name:"Move",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"MoveVec",name:"MoveVec",pkg:"",typ:$funcType([C],[],false)},{prop:"Center",name:"Center",pkg:"",typ:$funcType([],[C],false)},{prop:"Project",name:"Project",pkg:"",typ:$funcType([C],[AA],false)},{prop:"SATAxes",name:"SATAxes",pkg:"",typ:$funcType([],[AQ],false)},{prop:"PointInside",name:"PointInside",pkg:"",typ:$funcType([C],[$Bool],false)},{prop:"Intersection",name:"Intersection",pkg:"",typ:$funcType([$Float64,$Float64,Q],[AV],false)},{prop:"calculateMTV",name:"calculateMTV",pkg:"resolv",typ:$funcType([AV,Q],[C],false)},{prop:"ContainedBy",name:"ContainedBy",pkg:"",typ:$funcType([Q],[$Bool],false)},{prop:"FlipH",name:"FlipH",pkg:"",typ:$funcType([],[],false)},{prop:"FlipV",name:"FlipV",pkg:"",typ:$funcType([],[],false)},{prop:"ReverseVertexOrder",name:"ReverseVertexOrder",pkg:"",typ:$funcType([],[],false)}];AV.methods=[{prop:"LeftmostPoint",name:"LeftmostPoint",pkg:"",typ:$funcType([],[C],false)},{prop:"RightmostPoint",name:"RightmostPoint",pkg:"",typ:$funcType([],[C],false)},{prop:"TopmostPoint",name:"TopmostPoint",pkg:"",typ:$funcType([],[C],false)},{prop:"BottommostPoint",name:"BottommostPoint",pkg:"",typ:$funcType([],[C],false)}];AT.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[Q],false)},{prop:"Bounds",name:"Bounds",pkg:"",typ:$funcType([],[C,C],false)},{prop:"Intersection",name:"Intersection",pkg:"",typ:$funcType([$Float64,$Float64,Q],[AV],false)},{prop:"Move",name:"Move",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"MoveVec",name:"MoveVec",pkg:"",typ:$funcType([C],[],false)},{prop:"SetPosition",name:"SetPosition",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"SetPositionVec",name:"SetPositionVec",pkg:"",typ:$funcType([C],[],false)},{prop:"Position",name:"Position",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"PointInside",name:"PointInside",pkg:"",typ:$funcType([C],[$Bool],false)},{prop:"IntersectionPointsCircle",name:"IntersectionPointsCircle",pkg:"",typ:$funcType([AT],[AQ],false)}];AA.methods=[{prop:"Overlapping",name:"Overlapping",pkg:"",typ:$funcType([AA],[$Bool],false)},{prop:"Overlap",name:"Overlap",pkg:"",typ:$funcType([AA],[$Float64],false)},{prop:"IsInside",name:"IsInside",pkg:"",typ:$funcType([AA],[$Bool],false)}];AO.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[AO],false)},{prop:"Update",name:"Update",pkg:"",typ:$funcType([],[],false)},{prop:"AddTags",name:"AddTags",pkg:"",typ:$funcType([AW],[],true)},{prop:"RemoveTags",name:"RemoveTags",pkg:"",typ:$funcType([AW],[],true)},{prop:"HasTags",name:"HasTags",pkg:"",typ:$funcType([AW],[$Bool],true)},{prop:"Tags",name:"Tags",pkg:"",typ:$funcType([],[AW],false)},{prop:"SetShape",name:"SetShape",pkg:"",typ:$funcType([Q],[],false)},{prop:"BoundsToSpace",name:"BoundsToSpace",pkg:"",typ:$funcType([$Float64,$Float64],[$Int,$Int,$Int,$Int],false)},{prop:"SharesCells",name:"SharesCells",pkg:"",typ:$funcType([AO],[$Bool],false)},{prop:"SharesCellsTags",name:"SharesCellsTags",pkg:"",typ:$funcType([AW],[$Bool],true)},{prop:"Center",name:"Center",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"SetCenter",name:"SetCenter",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"CellPosition",name:"CellPosition",pkg:"",typ:$funcType([],[$Int,$Int],false)},{prop:"SetRight",name:"SetRight",pkg:"",typ:$funcType([$Float64],[],false)},{prop:"SetBottom",name:"SetBottom",pkg:"",typ:$funcType([$Float64],[],false)},{prop:"Bottom",name:"Bottom",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Right",name:"Right",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"SetBounds",name:"SetBounds",pkg:"",typ:$funcType([C,C],[],false)},{prop:"Check",name:"Check",pkg:"",typ:$funcType([$Float64,$Float64,AW],[AX],true)},{prop:"Overlaps",name:"Overlaps",pkg:"",typ:$funcType([AO],[$Bool],false)},{prop:"AddToIgnoreList",name:"AddToIgnoreList",pkg:"",typ:$funcType([AO],[],false)},{prop:"RemoveFromIgnoreList",name:"RemoveFromIgnoreList",pkg:"",typ:$funcType([AO],[],false)}];AX.methods=[{prop:"HasTags",name:"HasTags",pkg:"",typ:$funcType([AW],[$Bool],true)},{prop:"ObjectsByTags",name:"ObjectsByTags",pkg:"",typ:$funcType([AW],[AP],true)},{prop:"ContactWithObject",name:"ContactWithObject",pkg:"",typ:$funcType([AO],[C],false)},{prop:"ContactWithCell",name:"ContactWithCell",pkg:"",typ:$funcType([AK],[C],false)},{prop:"SlideAgainstCell",name:"SlideAgainstCell",pkg:"",typ:$funcType([AK,AW],[C],true)}];AK.methods=[{prop:"register",name:"register",pkg:"resolv",typ:$funcType([AO],[],false)},{prop:"unregister",name:"unregister",pkg:"resolv",typ:$funcType([AO],[],false)},{prop:"Contains",name:"Contains",pkg:"",typ:$funcType([AO],[$Bool],false)},{prop:"ContainsTags",name:"ContainsTags",pkg:"",typ:$funcType([AW],[$Bool],true)},{prop:"Occupied",name:"Occupied",pkg:"",typ:$funcType([],[$Bool],false)}];C.init($Float64);O.init("",[{prop:"Cells",name:"Cells",embedded:false,exported:true,typ:AM,tag:""},{prop:"CellWidth",name:"CellWidth",embedded:false,exported:true,typ:$Int,tag:""},{prop:"CellHeight",name:"CellHeight",embedded:false,exported:true,typ:$Int,tag:""}]);Q.init([{prop:"Bounds",name:"Bounds",pkg:"",typ:$funcType([],[C,C],false)},{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[Q],false)},{prop:"Intersection",name:"Intersection",pkg:"",typ:$funcType([$Float64,$Float64,Q],[AV],false)},{prop:"Position",name:"Position",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"SetPosition",name:"SetPosition",pkg:"",typ:$funcType([$Float64,$Float64],[],false)}]);R.init("",[{prop:"Start",name:"Start",embedded:false,exported:true,typ:C,tag:""},{prop:"End",name:"End",embedded:false,exported:true,typ:C,tag:""}]);T.init("",[{prop:"Points",name:"Points",embedded:false,exported:true,typ:AQ,tag:""},{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Closed",name:"Closed",embedded:false,exported:true,typ:$Bool,tag:""}]);V.init("",[{prop:"Points",name:"Points",embedded:false,exported:true,typ:AQ,tag:""},{prop:"MTV",name:"MTV",embedded:false,exported:true,typ:C,tag:""},{prop:"Center",name:"Center",embedded:false,exported:true,typ:C,tag:""}]);Y.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Radius",name:"Radius",embedded:false,exported:true,typ:$Float64,tag:""}]);AA.init("",[{prop:"Min",name:"Min",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Max",name:"Max",embedded:false,exported:true,typ:$Float64,tag:""}]);AB.init("resolv",[{prop:"Shape",name:"Shape",embedded:false,exported:true,typ:Q,tag:""},{prop:"Space",name:"Space",embedded:false,exported:true,typ:AN,tag:""},{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"W",name:"W",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"H",name:"H",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"TouchingCells",name:"TouchingCells",embedded:false,exported:true,typ:AL,tag:""},{prop:"Data",name:"Data",embedded:false,exported:true,typ:$emptyInterface,tag:""},{prop:"ignoreList",name:"ignoreList",embedded:false,exported:false,typ:AZ,tag:""},{prop:"tags",name:"tags",embedded:false,exported:false,typ:AW,tag:""}]);AF.init("resolv",[{prop:"checkingObject",name:"checkingObject",embedded:false,exported:false,typ:AO,tag:""},{prop:"dx",name:"dx",embedded:false,exported:false,typ:$Float64,tag:""},{prop:"dy",name:"dy",embedded:false,exported:false,typ:$Float64,tag:""},{prop:"Objects",name:"Objects",embedded:false,exported:true,typ:AP,tag:""},{prop:"Cells",name:"Cells",embedded:false,exported:true,typ:AL,tag:""}]);AH.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Int,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Int,tag:""},{prop:"Objects",name:"Objects",embedded:false,exported:true,typ:AP,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); -$packages["jsexport/battle"]=(function(){var $pkg={},$init,A,B,C,D,E,F,H,I,J,M,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR,AS,AT,AU,L,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,AA,AB;A=$packages["math"];B=$packages["resolv"];C=$pkg.Vec2D=$newType(0,$kindStruct,"battle.Vec2D",true,"jsexport/battle",true,function(X_,Y_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;return;}this.X=X_;this.Y=Y_;});D=$pkg.Polygon2D=$newType(0,$kindStruct,"battle.Polygon2D",true,"jsexport/battle",true,function(Anchor_,Points_){this.$val=this;if(arguments.length===0){this.Anchor=AS.nil;this.Points=AT.nil;return;}this.Anchor=Anchor_;this.Points=Points_;});E=$pkg.PlayerDownsync=$newType(0,$kindStruct,"battle.PlayerDownsync",true,"jsexport/battle",true,function(Id_,VirtualGridX_,VirtualGridY_,DirX_,DirY_,VelX_,VelY_,Speed_,BattleState_,JoinIndex_,ColliderRadius_,Removed_,Score_,LastMoveGmtMillis_,FramesToRecover_,Hp_,MaxHp_,CharacterState_,InAir_){this.$val=this;if(arguments.length===0){this.Id=0;this.VirtualGridX=0;this.VirtualGridY=0;this.DirX=0;this.DirY=0;this.VelX=0;this.VelY=0;this.Speed=0;this.BattleState=0;this.JoinIndex=0;this.ColliderRadius=0;this.Removed=false;this.Score=0;this.LastMoveGmtMillis=0;this.FramesToRecover=0;this.Hp=0;this.MaxHp=0;this.CharacterState=0;this.InAir=false;return;}this.Id=Id_;this.VirtualGridX=VirtualGridX_;this.VirtualGridY=VirtualGridY_;this.DirX=DirX_;this.DirY=DirY_;this.VelX=VelX_;this.VelY=VelY_;this.Speed=Speed_;this.BattleState=BattleState_;this.JoinIndex=JoinIndex_;this.ColliderRadius=ColliderRadius_;this.Removed=Removed_;this.Score=Score_;this.LastMoveGmtMillis=LastMoveGmtMillis_;this.FramesToRecover=FramesToRecover_;this.Hp=Hp_;this.MaxHp=MaxHp_;this.CharacterState=CharacterState_;this.InAir=InAir_;});F=$pkg.InputFrameDecoded=$newType(0,$kindStruct,"battle.InputFrameDecoded",true,"jsexport/battle",true,function(Dx_,Dy_,BtnALevel_,BtnBLevel_){this.$val=this;if(arguments.length===0){this.Dx=0;this.Dy=0;this.BtnALevel=0;this.BtnBLevel=0;return;}this.Dx=Dx_;this.Dy=Dy_;this.BtnALevel=BtnALevel_;this.BtnBLevel=BtnBLevel_;});H=$pkg.Barrier=$newType(0,$kindStruct,"battle.Barrier",true,"jsexport/battle",true,function(Boundary_){this.$val=this;if(arguments.length===0){this.Boundary=AU.nil;return;}this.Boundary=Boundary_;});I=$pkg.MeleeBullet=$newType(0,$kindStruct,"battle.MeleeBullet",true,"jsexport/battle",true,function(BattleLocalId_,StartupFrames_,ActiveFrames_,RecoveryFrames_,RecoveryFramesOnBlock_,RecoveryFramesOnHit_,HitboxOffset_,OriginatedRenderFrameId_,HitStunFrames_,BlockStunFrames_,Pushback_,ReleaseTriggerType_,Damage_,OffenderJoinIndex_,OffenderPlayerId_,SelfMoveforwardX_,SelfMoveforwardY_,HitboxSizeX_,HitboxSizeY_){this.$val=this;if(arguments.length===0){this.BattleLocalId=0;this.StartupFrames=0;this.ActiveFrames=0;this.RecoveryFrames=0;this.RecoveryFramesOnBlock=0;this.RecoveryFramesOnHit=0;this.HitboxOffset=0;this.OriginatedRenderFrameId=0;this.HitStunFrames=0;this.BlockStunFrames=0;this.Pushback=0;this.ReleaseTriggerType=0;this.Damage=0;this.OffenderJoinIndex=0;this.OffenderPlayerId=0;this.SelfMoveforwardX=0;this.SelfMoveforwardY=0;this.HitboxSizeX=0;this.HitboxSizeY=0;return;}this.BattleLocalId=BattleLocalId_;this.StartupFrames=StartupFrames_;this.ActiveFrames=ActiveFrames_;this.RecoveryFrames=RecoveryFrames_;this.RecoveryFramesOnBlock=RecoveryFramesOnBlock_;this.RecoveryFramesOnHit=RecoveryFramesOnHit_;this.HitboxOffset=HitboxOffset_;this.OriginatedRenderFrameId=OriginatedRenderFrameId_;this.HitStunFrames=HitStunFrames_;this.BlockStunFrames=BlockStunFrames_;this.Pushback=Pushback_;this.ReleaseTriggerType=ReleaseTriggerType_;this.Damage=Damage_;this.OffenderJoinIndex=OffenderJoinIndex_;this.OffenderPlayerId=OffenderPlayerId_;this.SelfMoveforwardX=SelfMoveforwardX_;this.SelfMoveforwardY=SelfMoveforwardY_;this.HitboxSizeX=HitboxSizeX_;this.HitboxSizeY=HitboxSizeY_;});J=$pkg.RoomDownsyncFrame=$newType(0,$kindStruct,"battle.RoomDownsyncFrame",true,"jsexport/battle",true,function(Id_,PlayersArr_,CountdownNanos_,MeleeBullets_,BackendUnconfirmedMask_,ShouldForceResync_){this.$val=this;if(arguments.length===0){this.Id=0;this.PlayersArr=AL.nil;this.CountdownNanos=new $Int64(0,0);this.MeleeBullets=AQ.nil;this.BackendUnconfirmedMask=new $Uint64(0,0);this.ShouldForceResync=false;return;}this.Id=Id_;this.PlayersArr=PlayersArr_;this.CountdownNanos=CountdownNanos_;this.MeleeBullets=MeleeBullets_;this.BackendUnconfirmedMask=BackendUnconfirmedMask_;this.ShouldForceResync=ShouldForceResync_;});M=$pkg.SatResult=$newType(0,$kindStruct,"battle.SatResult",true,"jsexport/battle",true,function(Overlap_,OverlapX_,OverlapY_,AContainedInB_,BContainedInA_,Axis_){this.$val=this;if(arguments.length===0){this.Overlap=0;this.OverlapX=0;this.OverlapY=0;this.AContainedInB=false;this.BContainedInA=false;this.Axis=B.Vector.nil;return;}this.Overlap=Overlap_;this.OverlapX=OverlapX_;this.OverlapY=OverlapY_;this.AContainedInB=AContainedInB_;this.BContainedInA=BContainedInA_;this.Axis=Axis_;});AC=$sliceType($Int32);AD=$sliceType(AC);AE=$ptrType(M);AF=$sliceType(C);AG=$sliceType($String);AH=$ptrType(B.Collision);AI=$ptrType(H);AJ=$ptrType(B.ConvexPolygon);AK=$ptrType(E);AL=$sliceType(AK);AM=$sliceType(AF);AN=$sliceType($Uint64);AO=$ptrType(B.Object);AP=$ptrType(I);AQ=$sliceType(AP);AR=$sliceType($Float64);AS=$ptrType(C);AT=$sliceType(AS);AU=$ptrType(D);L=function(a){var a,b,c,d,e,f,g,h;b=new $Uint64(a.$high&0,(a.$low&15)>>>0);d=(((c=$shiftRightUint64(a,4),new $Uint64(c.$high&0,(c.$low&1)>>>0)).$low>>0));f=(((e=$shiftRightUint64(a,5),new $Uint64(e.$high&0,(e.$low&1)>>>0)).$low>>0));return new F.ptr((g=(($flatten64(b)<0||$flatten64(b)>=$pkg.DIRECTION_DECODER.$length)?($throwRuntimeError("index out of range"),undefined):$pkg.DIRECTION_DECODER.$array[$pkg.DIRECTION_DECODER.$offset+$flatten64(b)]),(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])),(h=(($flatten64(b)<0||$flatten64(b)>=$pkg.DIRECTION_DECODER.$length)?($throwRuntimeError("index out of range"),undefined):$pkg.DIRECTION_DECODER.$array[$pkg.DIRECTION_DECODER.$offset+$flatten64(b)]),(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])),d,f);};N=function(a,b,c,d){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$curGoroutine.deferStack.push($deferred);c=[c];e=[e];f=[f];g=c[0].Position();e[0]=g[0];f[0]=g[1];$deferred.push([(function(c,e,f){return function(){c[0].SetPosition(e[0],f[0]);};})(c,e,f),[]]);c[0].SetPosition(e[0]+a,f[0]+b);h=new M.ptr(0,0,0,true,true,new B.Vector([0,0]));i=O(c[0],d,h);if(i){$s=1;continue;}$s=2;continue;case 1:j=h.Overlap*h.OverlapX;k=h.Overlap*h.OverlapY;l=j;m=k;n=[true,l,m,h];$s=4;case 4:return n;case 2:o=[false,0,0,h];$s=5;case 5:return o;case 3:$s=-1;return[false,0,0,AE.nil];}return;}}catch(err){$err=err;$s=-1;return[false,0,0,AE.nil];}finally{$callDeferred($deferred,$err);if($curGoroutine.asleep){var $f={$blk:N,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred};return $f;}}};$pkg.CalcPushbacks=N;O=function(a,b,c){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;d=a.Points.$length;e=b.Points.$length;f=d;g=e;if((1===f)&&(1===g)){if(!(AE.nil===c)){c.Overlap=0;}return((h=(i=a.Points,(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])),(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]))===(j=(k=b.Points,(0>=k.$length?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+0])),(0>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+0])))&&((l=(m=a.Points,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0])),(1>=l.$length?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+1]))===(n=(o=b.Points,(0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0])),(1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1])));}if(1=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);if(P(a,b,r.Unit(),c)){return false;}q++;}}if(1=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);if(P(a,b,u.Unit(),c)){return false;}t++;}}return true;};P=function(a,b,c,d){var a,aa,ab,ac,ad,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;e=1.7e+308;f=-1.7e+308;g=1.7e+308;h=-1.7e+308;i=e;j=f;k=g;l=h;m=a.Points;n=0;while(true){if(!(n=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+n]);p=((0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0])+a.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+1])+a.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(i>p){i=p;}if(j=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+r]);t=((0>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+0])+b.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1])+b.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(k>t){k=t;}if(ll||jl){u=i-l;d.AContainedInB=false;}else{x=j-k;y=l-i;if(x=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+0])))&&(0===(ac=d.Axis,(1>=ac.$length?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+1]))))||z>aa){ad=1;if(u<0){ad=-1;}d.Overlap=aa;d.OverlapX=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])*ad;d.OverlapY=(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1])*ad;}d.Axis=c;}return false;};Q=function(a,b,c){var a,b,c,d,e;d=((A.Round(a*c)>>0));e=((A.Round(b*c)>>0));return[d,e];};$pkg.WorldToVirtualGridPos=Q;R=function(a,b,c){var a,b,c,d,e;d=(a)*c;e=(b)*c;return[d,e];};$pkg.VirtualGridToWorldPos=R;S=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j;return[a-c-g+i,b-d-f+j];};$pkg.WorldToPolygonColliderBLPos=S;T=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j;return[a+c+g-i,b+d+f-j];};$pkg.PolygonColliderBLToWorldPos=T;U=function(a,b,c,d,e,f,g,h,i,j,k){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;l=T(a,b,c,d,e,f,g,h,i,j);m=l[0];n=l[1];return Q(m,n,k);};$pkg.PolygonColliderBLToVirtualGridPos=U;V=function(a,b,c,d,e,f,g,h,i,j,k){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;l=R(a,b,k);m=l[0];n=l[1];return S(m,n,c,d,e,f,g,h,i,j);};$pkg.VirtualGridToPolygonColliderBLPos=V;W=function(a,b,c,d){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,$s,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;s:while(true){switch($s){case 0:e=$makeSlice(AF,0,10);f=a.Check(0,0,new AG([]));$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=f;if(AH.nil===g){$s=-1;return e;}h=g.Objects;i=0;case 2:if(!(i=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]);k=j.Data;if($assertType(k,AI,true)[1]){$s=4;continue;}$s=5;continue;case 4:l=$assertType(j.Shape,AJ);n=N(0,0,b,l);$s=7;case 7:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}m=n;o=m[0];p=m[1];q=m[2];r=m[3];if(!o){i++;$s=2;continue;}s=(r.Overlap-c)*r.OverlapX;t=(r.Overlap-c)*r.OverlapY;p=s;q=t;e=$append(e,new C.ptr(r.OverlapX,r.OverlapY));d.X=d.X+(p);d.Y=d.Y+(q);$s=6;continue;case 5:case 6:i++;$s=2;continue;case 3:$s=-1;return e;}return;}var $f={$blk:W,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,$s};return $f;};X=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){var{a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,b,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,c,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,d,da,db,dc,dd,de,df,dg,dh,di,dj,dk,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p});$s=$s||0;s:while(true){switch($s){case 0:q=c.PlayersArr.$length;r=$makeSlice(AL,q);s=c.PlayersArr;t=0;while(true){if(!(t=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]=new E.ptr(v.Id,v.VirtualGridX,v.VirtualGridY,v.DirX,v.DirY,v.VelX,v.VelY,v.Speed,v.BattleState,v.JoinIndex,0,v.Removed,v.Score,0,v.FramesToRecover-1>>0,v.Hp,v.MaxHp,v.CharacterState,true));if(((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]).FramesToRecover<0){((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]).FramesToRecover=0;}t++;}w=$makeSlice(AF,q);x=$makeSlice(AM,q);if(!(AN.nil===a)){y=c.PlayersArr;z=0;while(true){if(!(z=y.$length)?($throwRuntimeError("index out of range"),undefined):y.$array[y.$offset+z]);ac=ab.JoinIndex;ad=((aa<0||aa>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+aa]);if(0>0,((ae<0||ae>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+ae])));ag=0;if(!(AN.nil===b)){ai=L((ah=ac-1>>0,((ah<0||ah>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+ah])));ag=ai.BtnBLevel;}if(af.BtnBLevel>ag){aj=false;if((4===ad.CharacterState)||(5===ad.CharacterState)||(6===ad.CharacterState)){aj=true;}ak=false;if((0===ad.CharacterState)||(1===ad.CharacterState)||(4===ad.CharacterState)){ak=true;}if(!aj&&ak){ad.VelY=h;}}if(!((0===af.Dx))||!((0===af.Dy))){ad.DirX=af.Dx;ad.DirY=af.Dy;ad.VelX=$imul(af.Dx,ab.Speed);ad.CharacterState=1;}else{ad.CharacterState=0;ad.VelX=0;}z++;}}al=c.PlayersArr;am=0;case 1:if(!(am=al.$length)?($throwRuntimeError("index out of range"),undefined):al.$array[al.$offset+am]);ap=ao.JoinIndex;aq=0;ar=0;(as=ap-1>>0,((as<0||as>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+as])).X=aq;(at=ap-1>>0,((at<0||at>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+at])).Y=ar;au=131072+ap>>0;aw=(av=e[$Int32.keyFor(au)],av!==undefined?av.v:AO.nil);ax=((an<0||an>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+an]);ay=ao.VirtualGridX+ao.VelX>>0;az=ao.VirtualGridY+ao.VelY>>0;ba=ay;bb=az;if(ax.VelY===h){bb=bb+(ax.VelY)>>0;}bc=V(ba,bb,aw.W*0.5,aw.H*0.5,0,0,0,0,k,l,p);aw.X=bc[0];aw.Y=bc[1];$r=aw.Update();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if(ao.InAir){ax.VelX=ax.VelX+(f)>>0;ax.VelY=ax.VelY+(g)>>0;}am++;$s=1;continue;case 2:bd=c.PlayersArr;be=0;case 4:if(!(be=bd.$length)?($throwRuntimeError("index out of range"),undefined):bd.$array[bd.$offset+be]);bh=bg.JoinIndex;bi=131072+bh>>0;bk=(bj=e[$Int32.keyFor(bi)],bj!==undefined?bj.v:AO.nil);bl=$assertType(bk.Shape,AJ);bn=W(bk,bl,m,(bm=bh-1>>0,((bm<0||bm>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+bm])));$s=6;case 6:if($c){$c=false;bn=bn.$blk();}if(bn&&bn.$blk!==undefined){break s;}(bo=bh-1>>0,((bo<0||bo>=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+bo]=bn));bp=((bf<0||bf>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+bf]);bq=false;br=bk.Check(0,0,new AG([]));$s=7;case 7:if($c){$c=false;br=br.$blk();}if(br&&br.$blk!==undefined){break s;}bs=br;if(!(AH.nil===bs)){$s=8;continue;}$s=9;continue;case 8:bt=bs.Objects;bu=0;case 10:if(!(bu=bt.$length)?($throwRuntimeError("index out of range"),undefined):bt.$array[bt.$offset+bu]);bw=false;bx=false;by=false;bz=bw;ca=bx;cb=by;cc=bv.Data;if($assertType(cc,AK,true)[1]){ca=true;}else if($assertType(cc,AP,true)[1]){cb=true;}else{bz=true;}if(cb){bu++;$s=10;continue;}cd=$assertType(bv.Shape,AJ);cf=N(0,0,bl,cd);$s=12;case 12:if($c){$c=false;cf=cf.$blk();}if(cf&&cf.$blk!==undefined){break s;}ce=cf;cg=ce[0];ch=ce[1];ci=ce[2];cj=ce[3];if(!cg){bu++;$s=10;continue;}ck=cj.OverlapX*0+cj.OverlapY*-1;cl=n>0,((cr<0||cr>=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+cr]));cs=0;while(true){if(!(cs=cq.$length)?($throwRuntimeError("index out of range"),undefined):cq.$array[cq.$offset+cs]),C);cu=ch*ct.X+ci*ct.Y;if(bz||(ca&&0>cu)){ch=ch-(cu*ct.X);ci=ci-(cu*ct.Y);}cs++;}cv=bh-1>>0;((cv<0||cv>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cv]).X=((cv<0||cv>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cv]).X+(ch);cw=bh-1>>0;((cw<0||cw>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cw]).Y=((cw<0||cw>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cw]).Y+(ci);if(bg.InAir&&cl){bq=true;}bu++;$s=10;continue;case 11:case 9:if(bq){bp.VelX=0;bp.VelY=0;bp.CharacterState=0;bp.FramesToRecover=0;}if(bg.InAir){cx=bp.CharacterState;cy=cx;if((cy===(0))||(cy===(1))){bp.CharacterState=4;}else if(cy===(2)){bp.CharacterState=5;}else if(cy===(3)){bp.CharacterState=6;}}be++;$s=4;continue;case 5:cz=c.PlayersArr;da=0;while(true){if(!(da=cz.$length)?($throwRuntimeError("index out of range"),undefined):cz.$array[cz.$offset+da]);dd=dc.JoinIndex;de=131072+dd>>0;dg=(df=e[$Int32.keyFor(de)],df!==undefined?df.v:AO.nil);dh=((db<0||db>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+db]);di=U(dg.X-(dj=dd-1>>0,((dj<0||dj>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+dj])).X,dg.Y-(dk=dd-1>>0,((dk<0||dk>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+dk])).Y,dg.W*0.5,dg.H*0.5,0,0,0,0,k,l,o);dh.VirtualGridX=di[0];dh.VirtualGridY=di[1];da++;}$s=-1;return new J.ptr(c.Id+1>>0,r,new $Int64(0,0),AQ.nil,new $Uint64(0,0),false);}return;}var $f={$blk:X,$c:true,$r,a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,b,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,c,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,d,da,db,dc,dd,de,df,dg,dh,di,dj,dk,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame=X;Y=function(a,b,c,d,e,f,g,h,i,j,k,l){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l});$s=$s||0;s:while(true){switch($s){case 0:m=S(a,b,c*0.5,d*0.5,e,f,g,h,i,j);n=m[0];o=m[1];p=Z(n,o,g+c+h,f+d+e,k,l);$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}q=p;$s=2;case 2:return q;}return;}var $f={$blk:Y,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s};return $f;};$pkg.GenerateRectCollider=Y;Z=function(a,b,c,d,e,f){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a,b,c,d,e,f});$s=$s||0;s:while(true){switch($s){case 0:g=B.NewObject(a,b,c,d,new AG([f]));h=B.NewRectangle(0,0,c,d);$r=g.SetShape(h);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}g.Data=e;$s=-1;return g;}return;}var $f={$blk:Z,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};AA=function(a,b,c,d,e){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,$s,$r,$c}=$restore(this,{a,b,c,d,e});$s=$s||0;s:while(true){switch($s){case 0:f=AB(a);g=0;h=0;i=g;j=h;k=B.NewConvexPolygon(AR.nil);l=f.Points;m=0;while(true){if(!(m=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+m]);p=f.Points;q=0;while(true){if(!(q=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);if(n===r){q++;continue;}if(A.Abs(s.X-o.X)>i){i=A.Abs(s.X-o.X);}if(A.Abs(s.Y-o.Y)>j){j=A.Abs(s.Y-o.Y);}q++;}m++;}t=0;while(true){if(!(t=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+t]));k.AddPoints(new AR([v.X,v.Y]));t=t+(1)>>0;}w=B.NewObject(f.Anchor.X+b,f.Anchor.Y+c,i,j,new AG([e]));$r=w.SetShape(k);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}w.Data=d;$s=-1;return w;}return;}var $f={$blk:AA,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,$s};return $f;};$pkg.GenerateConvexPolygonCollider=AA;AB=function(a){var a,b,c,d,e,f,g,h,i,j,k;b=new C.ptr(1.7e+308,1.7e+308);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.X=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+h]);(k=f.Points,((i<0||i>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+i]=new C.ptr(j.X-b.X,j.Y-b.Y)));h++;}return f;};$pkg.AlignPolygon2DToBoundingBox=AB;C.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""}]);D.init("",[{prop:"Anchor",name:"Anchor",embedded:false,exported:true,typ:AS,tag:""},{prop:"Points",name:"Points",embedded:false,exported:true,typ:AT,tag:""}]);E.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridX",name:"VirtualGridX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridY",name:"VirtualGridY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirX",name:"DirX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirY",name:"DirY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelX",name:"VelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelY",name:"VelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Speed",name:"Speed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BattleState",name:"BattleState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"JoinIndex",name:"JoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ColliderRadius",name:"ColliderRadius",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Removed",name:"Removed",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Score",name:"Score",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"LastMoveGmtMillis",name:"LastMoveGmtMillis",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesToRecover",name:"FramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Hp",name:"Hp",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"MaxHp",name:"MaxHp",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CharacterState",name:"CharacterState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"InAir",name:"InAir",embedded:false,exported:true,typ:$Bool,tag:""}]);F.init("",[{prop:"Dx",name:"Dx",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Dy",name:"Dy",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BtnALevel",name:"BtnALevel",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BtnBLevel",name:"BtnBLevel",embedded:false,exported:true,typ:$Int32,tag:""}]);H.init("",[{prop:"Boundary",name:"Boundary",embedded:false,exported:true,typ:AU,tag:""}]);I.init("",[{prop:"BattleLocalId",name:"BattleLocalId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"StartupFrames",name:"StartupFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ActiveFrames",name:"ActiveFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFrames",name:"RecoveryFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFramesOnBlock",name:"RecoveryFramesOnBlock",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFramesOnHit",name:"RecoveryFramesOnHit",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxOffset",name:"HitboxOffset",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OriginatedRenderFrameId",name:"OriginatedRenderFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitStunFrames",name:"HitStunFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BlockStunFrames",name:"BlockStunFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Pushback",name:"Pushback",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"ReleaseTriggerType",name:"ReleaseTriggerType",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Damage",name:"Damage",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OffenderJoinIndex",name:"OffenderJoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OffenderPlayerId",name:"OffenderPlayerId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SelfMoveforwardX",name:"SelfMoveforwardX",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"SelfMoveforwardY",name:"SelfMoveforwardY",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"HitboxSizeX",name:"HitboxSizeX",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"HitboxSizeY",name:"HitboxSizeY",embedded:false,exported:true,typ:$Float64,tag:""}]);J.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PlayersArr",name:"PlayersArr",embedded:false,exported:true,typ:AL,tag:""},{prop:"CountdownNanos",name:"CountdownNanos",embedded:false,exported:true,typ:$Int64,tag:""},{prop:"MeleeBullets",name:"MeleeBullets",embedded:false,exported:true,typ:AQ,tag:""},{prop:"BackendUnconfirmedMask",name:"BackendUnconfirmedMask",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"ShouldForceResync",name:"ShouldForceResync",embedded:false,exported:true,typ:$Bool,tag:""}]);M.init("",[{prop:"Overlap",name:"Overlap",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OverlapX",name:"OverlapX",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OverlapY",name:"OverlapY",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"AContainedInB",name:"AContainedInB",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"BContainedInA",name:"BContainedInA",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Axis",name:"Axis",embedded:false,exported:true,typ:B.Vector,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$pkg.DIRECTION_DECODER=new AD([new AC([0,0]),new AC([0,2]),new AC([0,-2]),new AC([2,0]),new AC([-2,0]),new AC([1,1]),new AC([-1,-1]),new AC([1,-1]),new AC([-1,1])]);}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["jsexport/battle"]=(function(){var $pkg={},$init,A,B,C,D,E,F,H,I,J,M,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR,AS,AT,AU,L,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,AA,AB;A=$packages["math"];B=$packages["resolv"];C=$pkg.Vec2D=$newType(0,$kindStruct,"battle.Vec2D",true,"jsexport/battle",true,function(X_,Y_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;return;}this.X=X_;this.Y=Y_;});D=$pkg.Polygon2D=$newType(0,$kindStruct,"battle.Polygon2D",true,"jsexport/battle",true,function(Anchor_,Points_){this.$val=this;if(arguments.length===0){this.Anchor=AS.nil;this.Points=AT.nil;return;}this.Anchor=Anchor_;this.Points=Points_;});E=$pkg.PlayerDownsync=$newType(0,$kindStruct,"battle.PlayerDownsync",true,"jsexport/battle",true,function(Id_,VirtualGridX_,VirtualGridY_,DirX_,DirY_,VelX_,VelY_,Speed_,BattleState_,JoinIndex_,ColliderRadius_,Removed_,Score_,LastMoveGmtMillis_,FramesToRecover_,Hp_,MaxHp_,CharacterState_,InAir_){this.$val=this;if(arguments.length===0){this.Id=0;this.VirtualGridX=0;this.VirtualGridY=0;this.DirX=0;this.DirY=0;this.VelX=0;this.VelY=0;this.Speed=0;this.BattleState=0;this.JoinIndex=0;this.ColliderRadius=0;this.Removed=false;this.Score=0;this.LastMoveGmtMillis=0;this.FramesToRecover=0;this.Hp=0;this.MaxHp=0;this.CharacterState=0;this.InAir=false;return;}this.Id=Id_;this.VirtualGridX=VirtualGridX_;this.VirtualGridY=VirtualGridY_;this.DirX=DirX_;this.DirY=DirY_;this.VelX=VelX_;this.VelY=VelY_;this.Speed=Speed_;this.BattleState=BattleState_;this.JoinIndex=JoinIndex_;this.ColliderRadius=ColliderRadius_;this.Removed=Removed_;this.Score=Score_;this.LastMoveGmtMillis=LastMoveGmtMillis_;this.FramesToRecover=FramesToRecover_;this.Hp=Hp_;this.MaxHp=MaxHp_;this.CharacterState=CharacterState_;this.InAir=InAir_;});F=$pkg.InputFrameDecoded=$newType(0,$kindStruct,"battle.InputFrameDecoded",true,"jsexport/battle",true,function(Dx_,Dy_,BtnALevel_,BtnBLevel_){this.$val=this;if(arguments.length===0){this.Dx=0;this.Dy=0;this.BtnALevel=0;this.BtnBLevel=0;return;}this.Dx=Dx_;this.Dy=Dy_;this.BtnALevel=BtnALevel_;this.BtnBLevel=BtnBLevel_;});H=$pkg.Barrier=$newType(0,$kindStruct,"battle.Barrier",true,"jsexport/battle",true,function(Boundary_){this.$val=this;if(arguments.length===0){this.Boundary=AU.nil;return;}this.Boundary=Boundary_;});I=$pkg.MeleeBullet=$newType(0,$kindStruct,"battle.MeleeBullet",true,"jsexport/battle",true,function(BattleLocalId_,StartupFrames_,ActiveFrames_,RecoveryFrames_,RecoveryFramesOnBlock_,RecoveryFramesOnHit_,HitboxOffset_,OriginatedRenderFrameId_,HitStunFrames_,BlockStunFrames_,Pushback_,ReleaseTriggerType_,Damage_,OffenderJoinIndex_,OffenderPlayerId_,SelfMoveforwardX_,SelfMoveforwardY_,HitboxSizeX_,HitboxSizeY_){this.$val=this;if(arguments.length===0){this.BattleLocalId=0;this.StartupFrames=0;this.ActiveFrames=0;this.RecoveryFrames=0;this.RecoveryFramesOnBlock=0;this.RecoveryFramesOnHit=0;this.HitboxOffset=0;this.OriginatedRenderFrameId=0;this.HitStunFrames=0;this.BlockStunFrames=0;this.Pushback=0;this.ReleaseTriggerType=0;this.Damage=0;this.OffenderJoinIndex=0;this.OffenderPlayerId=0;this.SelfMoveforwardX=0;this.SelfMoveforwardY=0;this.HitboxSizeX=0;this.HitboxSizeY=0;return;}this.BattleLocalId=BattleLocalId_;this.StartupFrames=StartupFrames_;this.ActiveFrames=ActiveFrames_;this.RecoveryFrames=RecoveryFrames_;this.RecoveryFramesOnBlock=RecoveryFramesOnBlock_;this.RecoveryFramesOnHit=RecoveryFramesOnHit_;this.HitboxOffset=HitboxOffset_;this.OriginatedRenderFrameId=OriginatedRenderFrameId_;this.HitStunFrames=HitStunFrames_;this.BlockStunFrames=BlockStunFrames_;this.Pushback=Pushback_;this.ReleaseTriggerType=ReleaseTriggerType_;this.Damage=Damage_;this.OffenderJoinIndex=OffenderJoinIndex_;this.OffenderPlayerId=OffenderPlayerId_;this.SelfMoveforwardX=SelfMoveforwardX_;this.SelfMoveforwardY=SelfMoveforwardY_;this.HitboxSizeX=HitboxSizeX_;this.HitboxSizeY=HitboxSizeY_;});J=$pkg.RoomDownsyncFrame=$newType(0,$kindStruct,"battle.RoomDownsyncFrame",true,"jsexport/battle",true,function(Id_,PlayersArr_,CountdownNanos_,MeleeBullets_,BackendUnconfirmedMask_,ShouldForceResync_){this.$val=this;if(arguments.length===0){this.Id=0;this.PlayersArr=AM.nil;this.CountdownNanos=new $Int64(0,0);this.MeleeBullets=AQ.nil;this.BackendUnconfirmedMask=new $Uint64(0,0);this.ShouldForceResync=false;return;}this.Id=Id_;this.PlayersArr=PlayersArr_;this.CountdownNanos=CountdownNanos_;this.MeleeBullets=MeleeBullets_;this.BackendUnconfirmedMask=BackendUnconfirmedMask_;this.ShouldForceResync=ShouldForceResync_;});M=$pkg.SatResult=$newType(0,$kindStruct,"battle.SatResult",true,"jsexport/battle",true,function(Overlap_,OverlapX_,OverlapY_,AContainedInB_,BContainedInA_,Axis_){this.$val=this;if(arguments.length===0){this.Overlap=0;this.OverlapX=0;this.OverlapY=0;this.AContainedInB=false;this.BContainedInA=false;this.Axis=B.Vector.nil;return;}this.Overlap=Overlap_;this.OverlapX=OverlapX_;this.OverlapY=OverlapY_;this.AContainedInB=AContainedInB_;this.BContainedInA=BContainedInA_;this.Axis=Axis_;});AC=$sliceType($Int32);AD=$sliceType(AC);AE=$ptrType(M);AF=$sliceType(C);AG=$sliceType($String);AH=$ptrType(B.Collision);AI=$ptrType(AF);AJ=$ptrType(E);AK=$ptrType(I);AL=$ptrType(B.ConvexPolygon);AM=$sliceType(AJ);AN=$sliceType(AI);AO=$sliceType($Uint64);AP=$ptrType(B.Object);AQ=$sliceType(AK);AR=$sliceType($Float64);AS=$ptrType(C);AT=$sliceType(AS);AU=$ptrType(D);L=function(a){var a,b,c,d,e,f,g,h;b=new $Uint64(a.$high&0,(a.$low&15)>>>0);d=(((c=$shiftRightUint64(a,4),new $Uint64(c.$high&0,(c.$low&1)>>>0)).$low>>0));f=(((e=$shiftRightUint64(a,5),new $Uint64(e.$high&0,(e.$low&1)>>>0)).$low>>0));return new F.ptr((g=(($flatten64(b)<0||$flatten64(b)>=$pkg.DIRECTION_DECODER.$length)?($throwRuntimeError("index out of range"),undefined):$pkg.DIRECTION_DECODER.$array[$pkg.DIRECTION_DECODER.$offset+$flatten64(b)]),(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])),(h=(($flatten64(b)<0||$flatten64(b)>=$pkg.DIRECTION_DECODER.$length)?($throwRuntimeError("index out of range"),undefined):$pkg.DIRECTION_DECODER.$array[$pkg.DIRECTION_DECODER.$offset+$flatten64(b)]),(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])),d,f);};N=function(a,b,c,d){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$curGoroutine.deferStack.push($deferred);c=[c];e=[e];f=[f];g=c[0].Position();e[0]=g[0];f[0]=g[1];$deferred.push([(function(c,e,f){return function(){c[0].SetPosition(e[0],f[0]);};})(c,e,f),[]]);c[0].SetPosition(e[0]+a,f[0]+b);h=new M.ptr(0,0,0,true,true,new B.Vector([0,0]));i=O(c[0],d,h);if(i){$s=1;continue;}$s=2;continue;case 1:j=h.Overlap*h.OverlapX;k=h.Overlap*h.OverlapY;l=j;m=k;n=[true,l,m,h];$s=4;case 4:return n;case 2:o=[false,0,0,h];$s=5;case 5:return o;case 3:$s=-1;return[false,0,0,AE.nil];}return;}}catch(err){$err=err;$s=-1;return[false,0,0,AE.nil];}finally{$callDeferred($deferred,$err);if($curGoroutine.asleep){var $f={$blk:N,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred};return $f;}}};$pkg.CalcPushbacks=N;O=function(a,b,c){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;d=a.Points.$length;e=b.Points.$length;f=d;g=e;if((1===f)&&(1===g)){if(!(AE.nil===c)){c.Overlap=0;}return((h=(i=a.Points,(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])),(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]))===(j=(k=b.Points,(0>=k.$length?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+0])),(0>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+0])))&&((l=(m=a.Points,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0])),(1>=l.$length?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+1]))===(n=(o=b.Points,(0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0])),(1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1])));}if(1=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);if(P(a,b,r.Unit(),c)){return false;}q++;}}if(1=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);if(P(a,b,u.Unit(),c)){return false;}t++;}}return true;};P=function(a,b,c,d){var a,aa,ab,ac,ad,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;e=1.7e+308;f=-1.7e+308;g=1.7e+308;h=-1.7e+308;i=e;j=f;k=g;l=h;m=a.Points;n=0;while(true){if(!(n=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+n]);p=((0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0])+a.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+1])+a.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(i>p){i=p;}if(j=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+r]);t=((0>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+0])+b.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1])+b.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(k>t){k=t;}if(ll||jl){u=i-l;d.AContainedInB=false;}else{x=j-k;y=l-i;if(x=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+0])))&&(0===(ac=d.Axis,(1>=ac.$length?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+1]))))||z>aa){ad=1;if(u<0){ad=-1;}d.Overlap=aa;d.OverlapX=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])*ad;d.OverlapY=(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1])*ad;}d.Axis=c;}return false;};Q=function(a,b,c){var a,b,c,d,e;d=((A.Floor(a*c)>>0));e=((A.Floor(b*c)>>0));return[d,e];};$pkg.WorldToVirtualGridPos=Q;R=function(a,b,c){var a,b,c,d,e;d=(a)*c;e=(b)*c;return[d,e];};$pkg.VirtualGridToWorldPos=R;S=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j;return[a-c-g+i,b-d-f+j];};$pkg.WorldToPolygonColliderBLPos=S;T=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j;return[a+c+g-i,b+d+f-j];};$pkg.PolygonColliderBLToWorldPos=T;U=function(a,b,c,d,e,f,g,h,i,j,k){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;l=T(a,b,c,d,e,f,g,h,i,j);m=l[0];n=l[1];return Q(m,n,k);};$pkg.PolygonColliderBLToVirtualGridPos=U;V=function(a,b,c,d,e,f,g,h,i,j,k){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;l=R(a,b,k);m=l[0];n=l[1];return S(m,n,c,d,e,f,g,h,i,j);};$pkg.VirtualGridToPolygonColliderBLPos=V;W=function(a,b,c,d,e){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,$s,$r,$c}=$restore(this,{a,b,c,d,e});$s=$s||0;s:while(true){switch($s){case 0:f=[f];f[0]=$makeSlice(AF,0,10);g=b.Check(0,0,new AG([]));$s=1;case 1:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}h=g;if(AH.nil===h){$s=-1;return(f.$ptr||(f.$ptr=new AI(function(){return this.$target[0];},function($v){this.$target[0]=$v;},f)));}i=h.Objects;j=0;case 2:if(!(j=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+j]);l=false;m=k.Data;if($assertType(m,AJ,true)[1]){}else if($assertType(m,AK,true)[1]){}else{l=true;}if(!l){j++;$s=2;continue;}n=$assertType(k.Shape,AL);p=N(0,0,c,n);$s=4;case 4:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}o=p;q=o[0];r=o[1];s=o[2];t=o[3];if(!q){j++;$s=2;continue;}u=(t.Overlap-d)*t.OverlapX;v=(t.Overlap-d)*t.OverlapY;r=u;s=v;f[0]=$append(f[0],new C.ptr(t.OverlapX,t.OverlapY));e.X=e.X+(r);e.Y=e.Y+(s);j++;$s=2;continue;case 3:$s=-1;return(f.$ptr||(f.$ptr=new AI(function(){return this.$target[0];},function($v){this.$target[0]=$v;},f)));}return;}var $f={$blk:W,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,$s};return $f;};X=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){var{a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,b,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,c,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,d,da,db,dc,dd,de,df,dg,dh,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p});$s=$s||0;s:while(true){switch($s){case 0:q=c.PlayersArr.$length;r=$makeSlice(AM,q);s=c.PlayersArr;t=0;while(true){if(!(t=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]=new E.ptr(v.Id,v.VirtualGridX,v.VirtualGridY,v.DirX,v.DirY,v.VelX,v.VelY,v.Speed,v.BattleState,v.JoinIndex,0,v.Removed,v.Score,0,v.FramesToRecover-1>>0,v.Hp,v.MaxHp,v.CharacterState,true));if(((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]).FramesToRecover<0){((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]).FramesToRecover=0;}t++;}w=$makeSlice(AF,q);x=$makeSlice(AN,q);if(!(AO.nil===a)){y=c.PlayersArr;z=0;while(true){if(!(z=y.$length)?($throwRuntimeError("index out of range"),undefined):y.$array[y.$offset+z]);ac=ab.JoinIndex;ad=((aa<0||aa>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+aa]);if(0>0,((ae<0||ae>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+ae])));ag=0;if(!(AO.nil===b)){ai=L((ah=ac-1>>0,((ah<0||ah>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+ah])));ag=ai.BtnBLevel;}if(af.BtnBLevel>ag){aj=false;if((4===ad.CharacterState)||(5===ad.CharacterState)||(6===ad.CharacterState)){aj=true;}ak=false;if((0===ad.CharacterState)||(1===ad.CharacterState)||(4===ad.CharacterState)){ak=true;}if(!aj&&ak){ad.VelY=h;}}if(!((0===af.Dx))||!((0===af.Dy))){ad.DirX=af.Dx;ad.DirY=af.Dy;ad.VelX=$imul(af.Dx,ab.Speed);ad.CharacterState=1;}else{ad.CharacterState=0;ad.VelX=0;}z++;}}al=c.PlayersArr;am=0;case 1:if(!(am=al.$length)?($throwRuntimeError("index out of range"),undefined):al.$array[al.$offset+am]);ap=ao.JoinIndex;aq=0;ar=0;(as=ap-1>>0,((as<0||as>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+as])).X=aq;(at=ap-1>>0,((at<0||at>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+at])).Y=ar;au=131072+ap>>0;aw=(av=e[$Int32.keyFor(au)],av!==undefined?av.v:AP.nil);ax=((an<0||an>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+an]);ay=ao.VirtualGridX+ao.VelX>>0;az=ao.VirtualGridY+ao.VelY>>0;ba=ay;bb=az;if(ax.VelY===h){bb=bb+(ax.VelY)>>0;}bc=V(ba,bb,aw.W*0.5,aw.H*0.5,0,0,0,0,k,l,p);aw.X=bc[0];aw.Y=bc[1];$r=aw.Update();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if(ao.InAir){ax.VelX=ax.VelX+(f)>>0;ax.VelY=ax.VelY+(g)>>0;}am++;$s=1;continue;case 2:bd=c.PlayersArr;be=0;case 4:if(!(be=bd.$length)?($throwRuntimeError("index out of range"),undefined):bd.$array[bd.$offset+be]);bh=bg.JoinIndex;bi=131072+bh>>0;bk=(bj=e[$Int32.keyFor(bi)],bj!==undefined?bj.v:AP.nil);bl=$assertType(bk.Shape,AL);bn=W(bh,bk,bl,m,(bm=bh-1>>0,((bm<0||bm>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+bm])));$s=6;case 6:if($c){$c=false;bn=bn.$blk();}if(bn&&bn.$blk!==undefined){break s;}(bo=bh-1>>0,((bo<0||bo>=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+bo]=bn));bp=((bf<0||bf>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+bf]);bq=false;br=bk.Check(0,0,new AG([]));$s=7;case 7:if($c){$c=false;br=br.$blk();}if(br&&br.$blk!==undefined){break s;}bs=br;if(!(AH.nil===bs)){$s=8;continue;}$s=9;continue;case 8:bt=bs.Objects;bu=0;case 10:if(!(bu=bt.$length)?($throwRuntimeError("index out of range"),undefined):bt.$array[bt.$offset+bu]);bw=false;bx=false;by=false;bz=bw;ca=bx;cb=by;cc=bv.Data;if($assertType(cc,AJ,true)[1]){ca=true;}else if($assertType(cc,AK,true)[1]){cb=true;}else{bz=true;}if(cb){bu++;$s=10;continue;}cd=$assertType(bv.Shape,AL);cf=N(0,0,bl,cd);$s=12;case 12:if($c){$c=false;cf=cf.$blk();}if(cf&&cf.$blk!==undefined){break s;}ce=cf;cg=ce[0];ch=ce[1];ci=ce[2];cj=ce[3];if(!cg){bu++;$s=10;continue;}ck=cj.OverlapX*0+cj.OverlapY*-1;if(ca){cl=(cj.Overlap-m*2)*cj.OverlapX;cm=(cj.Overlap-m*2)*cj.OverlapY;ch=cl;ci=cm;}cn=(co=bh-1>>0,((co<0||co>=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+co])).$get();cp=0;while(true){if(!(cp=cn.$length)?($throwRuntimeError("index out of range"),undefined):cn.$array[cn.$offset+cp]),C);cr=ch*cq.X+ci*cq.Y;if(bz||(ca&&0>cr)){ch=ch-(cr*cq.X);ci=ci-(cr*cq.Y);}cp++;}cs=bh-1>>0;((cs<0||cs>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cs]).X=((cs<0||cs>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cs]).X+(ch);ct=bh-1>>0;((ct<0||ct>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+ct]).Y=((ct<0||ct>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+ct]).Y+(ci);if(n=cw.$length)?($throwRuntimeError("index out of range"),undefined):cw.$array[cw.$offset+cx]);da=cz.JoinIndex;db=131072+da>>0;dd=(dc=e[$Int32.keyFor(db)],dc!==undefined?dc.v:AP.nil);de=((cy<0||cy>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+cy]);df=U(dd.X-(dg=da-1>>0,((dg<0||dg>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+dg])).X,dd.Y-(dh=da-1>>0,((dh<0||dh>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+dh])).Y,dd.W*0.5,dd.H*0.5,0,0,0,0,k,l,o);de.VirtualGridX=df[0];de.VirtualGridY=df[1];cx++;}$s=-1;return new J.ptr(c.Id+1>>0,r,new $Int64(0,0),AQ.nil,new $Uint64(0,0),false);}return;}var $f={$blk:X,$c:true,$r,a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,b,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,c,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,d,da,db,dc,dd,de,df,dg,dh,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame=X;Y=function(a,b,c,d,e,f,g,h,i,j,k,l){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l});$s=$s||0;s:while(true){switch($s){case 0:m=S(a,b,c*0.5,d*0.5,e,f,g,h,i,j);n=m[0];o=m[1];p=Z(n,o,g+c+h,f+d+e,k,l);$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}q=p;$s=2;case 2:return q;}return;}var $f={$blk:Y,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s};return $f;};$pkg.GenerateRectCollider=Y;Z=function(a,b,c,d,e,f){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a,b,c,d,e,f});$s=$s||0;s:while(true){switch($s){case 0:g=B.NewObject(a,b,c,d,new AG([f]));h=B.NewRectangle(0,0,c,d);$r=g.SetShape(h);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}g.Data=e;$s=-1;return g;}return;}var $f={$blk:Z,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};AA=function(a,b,c,d,e){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,$s,$r,$c}=$restore(this,{a,b,c,d,e});$s=$s||0;s:while(true){switch($s){case 0:f=AB(a);g=0;h=0;i=g;j=h;k=B.NewConvexPolygon(AR.nil);l=f.Points;m=0;while(true){if(!(m=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+m]);p=f.Points;q=0;while(true){if(!(q=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);if(n===r){q++;continue;}if(A.Abs(s.X-o.X)>i){i=A.Abs(s.X-o.X);}if(A.Abs(s.Y-o.Y)>j){j=A.Abs(s.Y-o.Y);}q++;}m++;}t=0;while(true){if(!(t=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+t]));k.AddPoints(new AR([v.X,v.Y]));t=t+(1)>>0;}w=B.NewObject(f.Anchor.X+b,f.Anchor.Y+c,i,j,new AG([e]));$r=w.SetShape(k);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}w.Data=d;$s=-1;return w;}return;}var $f={$blk:AA,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,$s};return $f;};$pkg.GenerateConvexPolygonCollider=AA;AB=function(a){var a,b,c,d,e,f,g,h,i,j,k;b=new C.ptr(1.7e+308,1.7e+308);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.X=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+h]);(k=f.Points,((i<0||i>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+i]=new C.ptr(j.X-b.X,j.Y-b.Y)));h++;}return f;};$pkg.AlignPolygon2DToBoundingBox=AB;C.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""}]);D.init("",[{prop:"Anchor",name:"Anchor",embedded:false,exported:true,typ:AS,tag:""},{prop:"Points",name:"Points",embedded:false,exported:true,typ:AT,tag:""}]);E.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridX",name:"VirtualGridX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridY",name:"VirtualGridY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirX",name:"DirX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirY",name:"DirY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelX",name:"VelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelY",name:"VelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Speed",name:"Speed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BattleState",name:"BattleState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"JoinIndex",name:"JoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ColliderRadius",name:"ColliderRadius",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Removed",name:"Removed",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Score",name:"Score",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"LastMoveGmtMillis",name:"LastMoveGmtMillis",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesToRecover",name:"FramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Hp",name:"Hp",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"MaxHp",name:"MaxHp",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CharacterState",name:"CharacterState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"InAir",name:"InAir",embedded:false,exported:true,typ:$Bool,tag:""}]);F.init("",[{prop:"Dx",name:"Dx",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Dy",name:"Dy",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BtnALevel",name:"BtnALevel",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BtnBLevel",name:"BtnBLevel",embedded:false,exported:true,typ:$Int32,tag:""}]);H.init("",[{prop:"Boundary",name:"Boundary",embedded:false,exported:true,typ:AU,tag:""}]);I.init("",[{prop:"BattleLocalId",name:"BattleLocalId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"StartupFrames",name:"StartupFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ActiveFrames",name:"ActiveFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFrames",name:"RecoveryFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFramesOnBlock",name:"RecoveryFramesOnBlock",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFramesOnHit",name:"RecoveryFramesOnHit",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxOffset",name:"HitboxOffset",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OriginatedRenderFrameId",name:"OriginatedRenderFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitStunFrames",name:"HitStunFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BlockStunFrames",name:"BlockStunFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Pushback",name:"Pushback",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"ReleaseTriggerType",name:"ReleaseTriggerType",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Damage",name:"Damage",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OffenderJoinIndex",name:"OffenderJoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OffenderPlayerId",name:"OffenderPlayerId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SelfMoveforwardX",name:"SelfMoveforwardX",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"SelfMoveforwardY",name:"SelfMoveforwardY",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"HitboxSizeX",name:"HitboxSizeX",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"HitboxSizeY",name:"HitboxSizeY",embedded:false,exported:true,typ:$Float64,tag:""}]);J.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PlayersArr",name:"PlayersArr",embedded:false,exported:true,typ:AM,tag:""},{prop:"CountdownNanos",name:"CountdownNanos",embedded:false,exported:true,typ:$Int64,tag:""},{prop:"MeleeBullets",name:"MeleeBullets",embedded:false,exported:true,typ:AQ,tag:""},{prop:"BackendUnconfirmedMask",name:"BackendUnconfirmedMask",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"ShouldForceResync",name:"ShouldForceResync",embedded:false,exported:true,typ:$Bool,tag:""}]);M.init("",[{prop:"Overlap",name:"Overlap",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OverlapX",name:"OverlapX",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OverlapY",name:"OverlapY",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"AContainedInB",name:"AContainedInB",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"BContainedInA",name:"BContainedInA",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Axis",name:"Axis",embedded:false,exported:true,typ:B.Vector,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$pkg.DIRECTION_DECODER=new AD([new AC([0,0]),new AC([0,2]),new AC([0,-2]),new AC([2,0]),new AC([-2,0]),new AC([1,1]),new AC([-1,-1]),new AC([1,-1]),new AC([-1,1])]);}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["jsexport"]=(function(){var $pkg={},$init,A,B,C,P,Q,R,S,T,U,V,W,X,Y,Z,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,D,E,F,G,H,J,K,L,M,N,O;A=$packages["github.com/gopherjs/gopherjs/js"];B=$packages["jsexport/battle"];C=$packages["resolv"];P=$ptrType(B.Vec2D);Q=$sliceType(P);R=$ptrType(B.Polygon2D);S=$ptrType(B.PlayerDownsync);T=$sliceType(S);U=$ptrType(B.MeleeBullet);V=$sliceType(U);W=$ptrType(A.Object);X=$sliceType(W);Y=$funcType([$Float64,$Float64],[W],false);Z=$funcType([P,Q],[W],false);AA=$funcType([R],[W],false);AB=$funcType([$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Bool,$Float64],[W],false);AC=$funcType([$Int32,T,V],[W],false);AD=$funcType([$Int,$Int,$Int,$Int],[W],false);AE=$funcType([$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$emptyInterface,$String],[W],false);AF=$funcType([R,$Float64,$Float64,$emptyInterface,$String],[W],false);AG=$ptrType(C.Space);AH=$funcType([AG],[X],false);AI=$sliceType($Uint64);AJ=$ptrType(B.RoomDownsyncFrame);AK=$ptrType(C.Object);AL=$mapType($Int32,AK);AM=$funcType([AI,AI,AJ,AG,AL,$Int32,$Int32,$Int32,$Int32,$Uint32,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64],[W],false);AN=$funcType([$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64],[$Float64,$Float64],false);AO=$mapType($String,$emptyInterface);D=function(a,b,c,d){var a,b,c,d;return A.MakeWrapper(C.NewSpace(a,b,c,d));};$pkg.NewCollisionSpaceJs=D;E=function(a,b){var{a,b,c,d,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=A.MakeFullWrapper(new B.Vec2D.ptr(a,b));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}d=c;$s=2;case 2:return d;}return;}var $f={$blk:E,$c:true,$r,a,b,c,d,$s};return $f;};$pkg.NewVec2DJs=E;F=function(a,b){var{a,b,c,d,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=A.MakeFullWrapper(new B.Polygon2D.ptr(a,b));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}d=c;$s=2;case 2:return d;}return;}var $f={$blk:F,$c:true,$r,a,b,c,d,$s};return $f;};$pkg.NewPolygon2DJs=F;G=function(a){var a;return A.MakeWrapper(new B.Barrier.ptr(a));};$pkg.NewBarrierJs=G;H=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;return A.MakeWrapper(new B.PlayerDownsync.ptr(a,b,c,d,e,f,g,h,i,k,o,false,0,0,0,l,m,j,n));};$pkg.NewPlayerDownsyncJs=H;J=function(a,b,c){var{a,b,c,d,e,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=A.MakeFullWrapper(new B.RoomDownsyncFrame.ptr(a,b,new $Int64(0,0),c,new $Uint64(0,0),false));$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}e=d;$s=2;case 2:return e;}return;}var $f={$blk:J,$c:true,$r,a,b,c,d,e,$s};return $f;};$pkg.NewRoomDownsyncFrameJs=J;K=function(a){var{a,b,c,d,e,f,g,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=a.Objects();c=$makeSlice(X,0,b.$length);d=b;e=0;case 1:if(!(e=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]);g=A.MakeFullWrapper(f);$s=3;case 3:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}c=$append(c,g);e++;$s=1;continue;case 2:$s=-1;return c;}return;}var $f={$blk:K,$c:true,$r,a,b,c,d,e,f,g,$s};return $f;};$pkg.GetCollisionSpaceObjsJs=K;L=function(a,b,c,d,e,f,g,h,i,j,k,l){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l});$s=$s||0;s:while(true){switch($s){case 0:m=B.GenerateRectCollider(a,b,c,d,e,f,g,h,i,j,k,l);$s=1;case 1:if($c){$c=false;m=m.$blk();}if(m&&m.$blk!==undefined){break s;}n=A.MakeFullWrapper(m);$s=2;case 2:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}o=n;$s=3;case 3:return o;}return;}var $f={$blk:L,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s};return $f;};$pkg.GenerateRectColliderJs=L;M=function(a,b,c,d,e){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a,b,c,d,e});$s=$s||0;s:while(true){switch($s){case 0:f=B.GenerateConvexPolygonCollider(a,b,c,d,e);$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=A.MakeFullWrapper(f);$s=2;case 2:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}h=g;$s=3;case 3:return h;}return;}var $f={$blk:M,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};$pkg.GenerateConvexPolygonColliderJs=M;N=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p});$s=$s||0;s:while(true){switch($s){case 0:q=B.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);$s=1;case 1:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}r=A.MakeFullWrapper(q);$s=2;case 2:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}s=r;$s=3;case 3:return s;}return;}var $f={$blk:N,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,$s};return $f;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs=N;O=function(){$global.gopkgs=$externalize($makeMap($String.keyFor,[{k:"NewVec2DJs",v:new Y(E)},{k:"NewPolygon2DJs",v:new Z(F)},{k:"NewBarrierJs",v:new AA(G)},{k:"NewPlayerDownsyncJs",v:new AB(H)},{k:"NewRoomDownsyncFrameJs",v:new AC(J)},{k:"NewCollisionSpaceJs",v:new AD(D)},{k:"GenerateRectColliderJs",v:new AE(L)},{k:"GenerateConvexPolygonColliderJs",v:new AF(M)},{k:"GetCollisionSpaceObjsJs",v:new AH(K)},{k:"ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs",v:new AM(N)},{k:"WorldToPolygonColliderBLPos",v:new AN(B.WorldToPolygonColliderBLPos)},{k:"PolygonColliderBLToWorldPos",v:new AN(B.PolygonColliderBLToWorldPos)}]),AO);};$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if($pkg===$mainPkg){O();$mainFinished=true;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $synthesizeMethods(); $initAllLinknames(); diff --git a/frontend/assets/resources/map/dungeon/map.tmx b/frontend/assets/resources/map/dungeon/map.tmx index b853993..b7e54a3 100644 --- a/frontend/assets/resources/map/dungeon/map.tmx +++ b/frontend/assets/resources/map/dungeon/map.tmx @@ -12,7 +12,7 @@ - + diff --git a/frontend/assets/scenes/offline_map.fire b/frontend/assets/scenes/offline_map.fire index 8d08a41..9aba249 100644 --- a/frontend/assets/scenes/offline_map.fire +++ b/frontend/assets/scenes/offline_map.fire @@ -461,7 +461,7 @@ "array": [ 0, 0, - 217.37237634989413, + 216.79265527990535, 0, 0, 0, diff --git a/frontend/assets/scripts/Map.js b/frontend/assets/scripts/Map.js index f98c3a8..db3b0b0 100644 --- a/frontend/assets/scripts/Map.js +++ b/frontend/assets/scripts/Map.js @@ -920,8 +920,7 @@ batchInputFrameIdRange=[${batch[0].inputFrameId}, ${batch[batch.length - 1].inpu if (self.lastAllConfirmedInputFrameId >= delayedInputFrameId && !self.equalRoomDownsyncFrames(othersForcedDownsyncRenderFrame, rdf)) { console.warn(`Mismatched render frame@rdf.id=${rdf.id} w/ inputFrameId=${delayedInputFrameId}: rdf=${JSON.stringify(rdf)} -othersForcedDownsyncRenderFrame=${JSON.stringify(othersForcedDownsyncRenderFrame)} -${self._stringifyRdfIdToActuallyUsedInput()}`); +othersForcedDownsyncRenderFrame=${JSON.stringify(othersForcedDownsyncRenderFrame)}`); // closeWSConnection(constants.RET_CODE.CLIENT_MISMATCHED_RENDER_FRAME, ""); // self.onManualRejoinRequired("[DEBUG] CLIENT_MISMATCHED_RENDER_FRAME"); rdf = othersForcedDownsyncRenderFrame; diff --git a/frontend/assets/scripts/WsSessionMgr.js b/frontend/assets/scripts/WsSessionMgr.js index 8c4f056..353aad8 100644 --- a/frontend/assets/scripts/WsSessionMgr.js +++ b/frontend/assets/scripts/WsSessionMgr.js @@ -197,7 +197,7 @@ window.initPersistentSessionClient = function(onopenCb, expectedRoomId) { break; case constants.RET_CODE.BATTLE_STOPPED: // deliberately do nothing - console.warn(`${mapIns._stringifyRdfIdToActuallyUsedInput()}`); + //console.warn(`${mapIns._stringifyRdfIdToActuallyUsedInput()}`); break; case constants.RET_CODE.PLAYER_NOT_ADDABLE_TO_ROOM: case constants.RET_CODE.PLAYER_NOT_READDABLE_TO_ROOM: @@ -212,7 +212,7 @@ window.initPersistentSessionClient = function(onopenCb, expectedRoomId) { case constants.RET_CODE.PLAYER_NOT_FOUND: case constants.RET_CODE.PLAYER_CHEATING: case 1006: // Peer(i.e. the backend) gone unexpectedly - console.warn(`${mapIns._stringifyRdfIdToActuallyUsedInput()}`); + //console.warn(`${mapIns._stringifyRdfIdToActuallyUsedInput()}`); window.clearLocalStorageAndBackToLoginScene(true); break; default: diff --git a/jsexport/battle/battle.go b/jsexport/battle/battle.go index dee470b..1e41e14 100644 --- a/jsexport/battle/battle.go +++ b/jsexport/battle/battle.go @@ -224,8 +224,8 @@ func isPolygonPairSeparatedByDir(a, b *resolv.ConvexPolygon, e resolv.Vector, re func WorldToVirtualGridPos(wx, wy, worldToVirtualGridRatio float64) (int32, int32) { // [WARNING] Introduces loss of precision! // In JavaScript floating numbers suffer from seemingly non-deterministic arithmetics, and even if certain libs solved this issue by approaches such as fixed-point-number, they might not be used in other libs -- e.g. the "collision libs" we're interested in -- thus couldn't kill all pains. - var virtualGridX int32 = int32(math.Round(wx * worldToVirtualGridRatio)) - var virtualGridY int32 = int32(math.Round(wy * worldToVirtualGridRatio)) + var virtualGridX int32 = int32(math.Floor(wx * worldToVirtualGridRatio)) + var virtualGridY int32 = int32(math.Floor(wy * worldToVirtualGridRatio)) return virtualGridX, virtualGridY } @@ -254,30 +254,42 @@ func VirtualGridToPolygonColliderBLPos(vx, vy int32, halfBoundingW, halfBounding return WorldToPolygonColliderBLPos(wx, wy, halfBoundingW, halfBoundingH, topPadding, bottomPadding, leftPadding, rightPadding, collisionSpaceOffsetX, collisionSpaceOffsetY) } -func calcHardPushbacksNorms(playerCollider *resolv.Object, playerShape *resolv.ConvexPolygon, snapIntoPlatformOverlap float64, pEffPushback *Vec2D) []Vec2D { +func calcHardPushbacksNorms(joinIndex int32, playerCollider *resolv.Object, playerShape *resolv.ConvexPolygon, snapIntoPlatformOverlap float64, pEffPushback *Vec2D) *[]Vec2D { ret := make([]Vec2D, 0, 10) // no one would simultaneously have more than 5 hardPushbacks collision := playerCollider.Check(0, 0) if nil == collision { - return ret + return &ret } + + //playerColliderCenterX, playerColliderCenterY := playerCollider.Center() + //fmt.Printf("joinIndex=%d calcHardPushbacksNorms has non-empty collision;playerColliderPos=(%.2f,%.2f)\n", joinIndex, playerColliderCenterX, playerColliderCenterY) for _, obj := range collision.Objects { + isBarrier := false switch obj.Data.(type) { - case *Barrier: - barrierShape := obj.Shape.(*resolv.ConvexPolygon) - overlapped, pushbackX, pushbackY, overlapResult := CalcPushbacks(0, 0, playerShape, barrierShape) - if !overlapped { - continue - } - // ALWAY snap into hardPushbacks! - // [OverlapX, OverlapY] is the unit vector that points into the platform - pushbackX, pushbackY = (overlapResult.Overlap-snapIntoPlatformOverlap)*overlapResult.OverlapX, (overlapResult.Overlap-snapIntoPlatformOverlap)*overlapResult.OverlapY - ret = append(ret, Vec2D{X: overlapResult.OverlapX, Y: overlapResult.OverlapY}) - pEffPushback.X += pushbackX - pEffPushback.Y += pushbackY + case *PlayerDownsync: + case *MeleeBullet: default: + // By default it's a regular barrier, even if data is nil, note that Golang syntax of switch-case is kind of confusing, this "default" condition is met only if "!*PlayerDownsync && !*MeleeBullet". + isBarrier = true } + + if !isBarrier { + continue + } + barrierShape := obj.Shape.(*resolv.ConvexPolygon) + overlapped, pushbackX, pushbackY, overlapResult := CalcPushbacks(0, 0, playerShape, barrierShape) + if !overlapped { + continue + } + // ALWAY snap into hardPushbacks! + // [OverlapX, OverlapY] is the unit vector that points into the platform + pushbackX, pushbackY = (overlapResult.Overlap-snapIntoPlatformOverlap)*overlapResult.OverlapX, (overlapResult.Overlap-snapIntoPlatformOverlap)*overlapResult.OverlapY + ret = append(ret, Vec2D{X: overlapResult.OverlapX, Y: overlapResult.OverlapY}) + pEffPushback.X += pushbackX + pEffPushback.Y += pushbackY + //fmt.Printf("joinIndex=%d calcHardPushbacksNorms found one hardpushback; immediatePushback=(%.2f,%.2f)\n", joinIndex, pushbackX, pushbackY) } - return ret + return &ret } // [WARNING] The params of this method is carefully tuned such that only "battle.RoomDownsyncFrame" is a necessary custom struct. @@ -312,7 +324,7 @@ func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputList, delaye } effPushbacks := make([]Vec2D, roomCapacity) - hardPushbackNorms := make([][]Vec2D, roomCapacity) + hardPushbackNorms := make([]*[]Vec2D, roomCapacity) // 1. Process player inputs if nil != delayedInputList { @@ -385,13 +397,12 @@ func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputList, delaye collisionPlayerIndex := COLLISION_PLAYER_INDEX_PREFIX + joinIndex playerCollider := collisionSysMap[collisionPlayerIndex] playerShape := playerCollider.Shape.(*resolv.ConvexPolygon) - hardPushbackNorms[joinIndex-1] = calcHardPushbacksNorms(playerCollider, playerShape, snapIntoPlatformOverlap, &(effPushbacks[joinIndex-1])) + hardPushbackNorms[joinIndex-1] = calcHardPushbacksNorms(joinIndex, playerCollider, playerShape, snapIntoPlatformOverlap, &(effPushbacks[joinIndex-1])) thatPlayerInNextFrame := nextRenderFramePlayers[i] - fallStopping := false + landedOnGravityPushback := false if collision := playerCollider.Check(0, 0); nil != collision { for _, obj := range collision.Objects { isBarrier, isAnotherPlayer, isBullet := false, false, false - // TODO: Make this part work in JavaScript without having to expose all types Barrier/PlayerDownsync/MeleeBullet by js.MakeWrapper. switch obj.Data.(type) { case *PlayerDownsync: isAnotherPlayer = true @@ -411,17 +422,11 @@ func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputList, delaye continue } normAlignmentWithGravity := (overlapResult.OverlapX*float64(0) + overlapResult.OverlapY*float64(-1.0)) - landedOnGravityPushback := (snapIntoPlatformThreshold < normAlignmentWithGravity) // prevents false snapping on the lateral sides - if landedOnGravityPushback { - // kindly note that one player might land on top of another player, and snapping is also required in such case - pushbackX, pushbackY = (overlapResult.Overlap-snapIntoPlatformOverlap)*overlapResult.OverlapX, (overlapResult.Overlap-snapIntoPlatformOverlap)*overlapResult.OverlapY - thatPlayerInNextFrame.InAir = false - } if isAnotherPlayer { // [WARNING] The "zero overlap collision" might be randomly detected/missed on either frontend or backend, to have deterministic result we added paddings to all sides of a playerCollider. As each velocity component of (velX, velY) being a multiple of 0.5 at any renderFrame, each position component of (x, y) can only be a multiple of 0.5 too, thus whenever a 1-dimensional collision happens between players from [player#1: i*0.5, player#2: j*0.5, not collided yet] to [player#1: (i+k)*0.5, player#2: j*0.5, collided], the overlap becomes (i+k-j)*0.5+2*s, and after snapping subtraction the effPushback magnitude for each player is (i+k-j)*0.5, resulting in 0.5-multiples-position for the next renderFrame. pushbackX, pushbackY = (overlapResult.Overlap-snapIntoPlatformOverlap*2)*overlapResult.OverlapX, (overlapResult.Overlap-snapIntoPlatformOverlap*2)*overlapResult.OverlapY } - for _, hardPushbackNorm := range hardPushbackNorms[joinIndex-1] { + for _, hardPushbackNorm := range *hardPushbackNorms[joinIndex-1] { projectedMagnitude := pushbackX*hardPushbackNorm.X + pushbackY*hardPushbackNorm.Y if isBarrier || (isAnotherPlayer && 0 > projectedMagnitude) { pushbackX -= projectedMagnitude * hardPushbackNorm.X @@ -430,16 +435,23 @@ func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputList, delaye } effPushbacks[joinIndex-1].X += pushbackX effPushbacks[joinIndex-1].Y += pushbackY - if currPlayerDownsync.InAir && landedOnGravityPushback { - fallStopping = true + + if snapIntoPlatformThreshold < normAlignmentWithGravity { + landedOnGravityPushback = true + //playerColliderCenterX, playerColliderCenterY := playerCollider.Center() + //fmt.Printf("joinIndex=%d landedOnGravityPushback\n{renderFrame.id: %d, isBarrier: %v, isAnotherPlayer: %v}\nhardPushbackNormsOfThisPlayer=%v, playerColliderPos=(%.2f,%.2f), immediatePushback={%.3f, %.3f}, effPushback={%.3f, %.3f}, overlapMag=%.4f\n", joinIndex, currRenderFrame.Id, isBarrier, isAnotherPlayer, *hardPushbackNorms[joinIndex-1], playerColliderCenterX, playerColliderCenterY, pushbackX, pushbackY, effPushbacks[joinIndex-1].X, effPushbacks[joinIndex-1].Y, overlapResult.Overlap) } } } - if fallStopping { - thatPlayerInNextFrame.VelX = 0 - thatPlayerInNextFrame.VelY = 0 - thatPlayerInNextFrame.CharacterState = ATK_CHARACTER_STATE_IDLE1 - thatPlayerInNextFrame.FramesToRecover = 0 + if landedOnGravityPushback { + thatPlayerInNextFrame.InAir = false + if currPlayerDownsync.InAir { + // fallStopping + thatPlayerInNextFrame.VelX = 0 + thatPlayerInNextFrame.VelY = 0 + thatPlayerInNextFrame.CharacterState = ATK_CHARACTER_STATE_IDLE1 + thatPlayerInNextFrame.FramesToRecover = 0 + } } if currPlayerDownsync.InAir { oldNextCharacterState := thatPlayerInNextFrame.CharacterState