window.es={},window.__extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var __generator=this&&this.__generator||function(e,t){var n,r,i,a,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=this._duration?(r=this._elapsedTime-this._duration,this._elapsedTime=this._duration,this._tweenState=n.complete):this._isRunningInReverse&&this._elapsedTime<=0&&(r=0-this._elapsedTime,this._elapsedTime=0,this._tweenState=n.complete),this._elapsedTime>=0&&this._elapsedTime<=this._duration&&this.updateValue(),this._loopType!=t.none&&this._tweenState==n.complete&&0!=this._loops&&this.handleLooping(r);var i=this._isTimeScaleIndependent?e.Time.unscaledDeltaTime:e.Time.deltaTime;return i*=this._timeScale,this._isRunningInReverse?this._elapsedTime-=i:this._elapsedTime+=i,this._tweenState==n.complete&&(this._completionHandler&&this._completionHandler(this),null!=this._nextTween&&(this._nextTween.start(),this._nextTween=null),!0)},r.prototype.recycleSelf=function(){this._shouldRecycleTween&&(this._target=null,this._nextTween=null)},r.prototype.isRunning=function(){return this._tweenState==n.running},r.prototype.start=function(){this._isFromValueOverridden||(this._fromValue=this._target.getTargetObject()),this._tweenState==n.complete&&(this._tweenState=n.running,e.TweenManager.addTween(this))},r.prototype.pause=function(){this._tweenState=n.paused},r.prototype.resume=function(){this._tweenState=n.running},r.prototype.stop=function(r){void 0===r&&(r=!1),this._tweenState=n.complete,r?(this._elapsedTime=this._isRunningInReverse?0:this._duration,this._loopType=t.none,this._loops=0):e.TweenManager.removeTween(this)},r.prototype.jumpToElapsedTime=function(t){this._elapsedTime=e.MathHelper.clamp(t,0,this._duration),this.updateValue()},r.prototype.reverseTween=function(){this._isRunningInReverse=!this._isRunningInReverse},r.prototype.waitForCompletion=function(){return __generator(this,function(e){switch(e.label){case 0:return this._tweenState==n.complete?[3,2]:[4,null];case 1:return e.sent(),[3,0];case 2:return[2]}})},r.prototype.getTargetObject=function(){return this._target.getTargetObject()},r.prototype.resetState=function(){this.context=null,this._completionHandler=this._loopCompleteHandler=null,this._isFromValueOverridden=!1,this._isTimeScaleIndependent=!1,this._tweenState=n.complete,this._isRelative=!1,this._easeType=e.TweenManager.defaultEaseType,null!=this._nextTween&&(this._nextTween.recycleSelf(),this._nextTween=null),this._delay=0,this._duration=0,this._timeScale=1,this._elapsedTime=0,this._loopType=t.none,this._delayBetweenLoops=0,this._loops=0,this._isRunningInReverse=!1},r.prototype.initialize=function(e,t,n){this.resetState(),this._target=e,this._toValue=t,this._duration=n},r.prototype.handleLooping=function(e){this._loops--,this._loopType==t.pingpong&&this.reverseTween(),this._loopType!=t.restartFromBeginning&&this._loops%2!=0||this._loopCompleteHandler&&this._completionHandler(this),0!=this._loops&&(this._tweenState=n.running,this._loopType==t.restartFromBeginning?this._elapsedTime=e-this._delayBetweenLoops:this._isRunningInReverse?this._elapsedTime+=this._delayBetweenLoops-e:this._elapsedTime=e-this._delayBetweenLoops,0==this._delayBetweenLoops&&e>0&&this.updateValue())},r}();e.Tween=r}(es||(es={})),function(e){var t=function(t){function n(e,n,r){var i=t.call(this)||this;return i.initialize(e,n,r),i}return __extends(n,t),n.create=function(){return e.TweenManager.cacheNumberTweens?e.Pool.obtain(n):new n},n.prototype.setIsRelative=function(){return this._isRelative=!0,this._toValue+=this._fromValue,this},n.prototype.updateValue=function(){this._target.setTweenedValue(e.Lerps.ease(this._easeType,this._fromValue,this._toValue,this._elapsedTime,this._duration))},n.prototype.recycleSelf=function(){t.prototype.recycleSelf.call(this),this._shouldRecycleTween&&e.TweenManager.cacheNumberTweens&&e.Pool.free(this)},n}(e.Tween);e.NumberTween=t;var n=function(t){function n(e,n,r){var i=t.call(this)||this;return i.initialize(e,n,r),i}return __extends(n,t),n.create=function(){return e.TweenManager.cacheVector2Tweens?e.Pool.obtain(n):new n},n.prototype.setIsRelative=function(){return this._isRelative=!0,this._toValue.add(this._fromValue),this},n.prototype.updateValue=function(){this._target.setTweenedValue(e.Lerps.easeVector2(this._easeType,this._fromValue,this._toValue,this._elapsedTime,this._duration))},n.prototype.recycleSelf=function(){t.prototype.recycleSelf.call(this),this._shouldRecycleTween&&e.TweenManager.cacheVector2Tweens&&e.Pool.free(this)},n}(e.Tween);e.Vector2Tween=n;var r=function(t){function n(e,n,r){var i=t.call(this)||this;return i.initialize(e,n,r),i}return __extends(n,t),n.create=function(){return e.TweenManager.cacheRectTweens?e.Pool.obtain(n):new n},n.prototype.setIsRelative=function(){return this._isRelative=!0,this._toValue=new e.Rectangle(this._toValue.x+this._fromValue.x,this._toValue.y+this._fromValue.y,this._toValue.width+this._fromValue.width,this._toValue.height+this._fromValue.height),this},n.prototype.updateValue=function(){this._target.setTweenedValue(e.Lerps.easeRectangle(this._easeType,this._fromValue,this._toValue,this._elapsedTime,this._duration))},n.prototype.recycleSelf=function(){t.prototype.recycleSelf.call(this),this._shouldRecycleTween&&e.TweenManager.cacheRectTweens&&e.Pool.free(this)},n}(e.Tween);e.RectangleTween=r}(es||(es={})),function(e){var t;!function(e){e[e.position=0]="position",e[e.localPosition=1]="localPosition",e[e.scale=2]="scale",e[e.localScale=3]="localScale",e[e.rotationDegrees=4]="rotationDegrees",e[e.localRotationDegrees=5]="localRotationDegrees"}(t=e.TransformTargetType||(e.TransformTargetType={}));var n=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return __extends(r,n),r.prototype.setTweenedValue=function(e){switch(this._targetType){case t.position:this._transform.position=e;break;case t.localPosition:this._transform.localPosition=e;break;case t.scale:this._transform.scale=e;break;case t.localScale:this._transform.localScale=e;break;case t.rotationDegrees:this._transform.rotationDegrees=e.x;case t.localRotationDegrees:this._transform.localRotationDegrees=e.x}},r.prototype.getTweenedValue=function(){switch(this._targetType){case t.position:return this._transform.position;case t.localPosition:return this._transform.localPosition;case t.scale:return this._transform.scale;case t.localScale:return this._transform.localScale;case t.rotationDegrees:return new e.Vector2(this._transform.rotationDegrees);case t.localRotationDegrees:return new e.Vector2(this._transform.localRotationDegrees,0)}},r.prototype.getTargetObject=function(){return this._transform},r.prototype.setTargetAndType=function(e,t){this._transform=e,this._targetType=t},r.prototype.updateValue=function(){this._targetType!=t.rotationDegrees&&this._targetType!=t.localRotationDegrees||this._isRelative?this.setTweenedValue(e.Lerps.easeVector2(this._easeType,this._fromValue,this._toValue,this._elapsedTime,this._duration)):this.setTweenedValue(e.Lerps.easeAngle(this._easeType,this._fromValue,this._toValue,this._elapsedTime,this._duration))},r.prototype.recycleSelf=function(){this._shouldRecycleTween&&(this._target=null,this._nextTween=null,this._transform=null,e.Pool.free(this))},r}(e.Vector2Tween);e.TransformVector2Tween=n}(es||(es={})),function(e){var t;!function(e){e[e.linear=0]="linear",e[e.sineIn=1]="sineIn",e[e.sineOut=2]="sineOut",e[e.sineInOut=3]="sineInOut",e[e.quadIn=4]="quadIn",e[e.quadOut=5]="quadOut",e[e.quadInOut=6]="quadInOut",e[e.quintIn=7]="quintIn",e[e.quintOut=8]="quintOut",e[e.quintInOut=9]="quintInOut",e[e.cubicIn=10]="cubicIn",e[e.cubicOut=11]="cubicOut",e[e.cubicInOut=12]="cubicInOut",e[e.quartIn=13]="quartIn",e[e.quartOut=14]="quartOut",e[e.quartInOut=15]="quartInOut",e[e.expoIn=16]="expoIn",e[e.expoOut=17]="expoOut",e[e.expoInOut=18]="expoInOut",e[e.circleIn=19]="circleIn",e[e.circleOut=20]="circleOut",e[e.circleInOut=21]="circleInOut",e[e.elasticIn=22]="elasticIn",e[e.elasticOut=23]="elasticOut",e[e.elasticInOut=24]="elasticInOut",e[e.punch=25]="punch",e[e.backIn=26]="backIn",e[e.backOut=27]="backOut",e[e.backInOut=28]="backInOut",e[e.bounceIn=29]="bounceIn",e[e.bounceOut=30]="bounceOut",e[e.bounceInOut=31]="bounceInOut"}(t=e.EaseType||(e.EaseType={}));var n=function(){function n(){}return n.oppositeEaseType=function(e){switch(e){case t.linear:return e;case t.backIn:return t.backOut;case t.backOut:return t.backIn;case t.backInOut:return e;case t.bounceIn:return t.bounceOut;case t.bounceOut:return t.bounceIn;case t.bounceInOut:return e;case t.circleIn:return t.circleOut;case t.circleOut:return t.circleIn;case t.circleInOut:return e;case t.cubicIn:return t.cubicOut;case t.cubicOut:return t.cubicIn;case t.circleInOut:case t.punch:return e;case t.expoIn:return t.expoOut;case t.expoOut:return t.expoIn;case t.expoInOut:return e;case t.quadIn:return t.quadOut;case t.quadOut:return t.quadIn;case t.quadInOut:return e;case t.quartIn:return t.quadOut;case t.quartOut:return t.quartIn;case t.quadInOut:return e;case t.sineIn:return t.sineOut;case t.sineOut:return t.sineIn;case t.sineInOut:default:return e}},n.ease=function(n,r,i){switch(n){case t.linear:return e.Easing.Linear.easeNone(r,i);case t.backIn:return e.Easing.Back.easeIn(r,i);case t.backOut:return e.Easing.Back.easeOut(r,i);case t.backInOut:return e.Easing.Back.easeInOut(r,i);case t.bounceIn:return e.Easing.Bounce.easeIn(r,i);case t.bounceOut:return e.Easing.Bounce.easeOut(r,i);case t.bounceInOut:return e.Easing.Bounce.easeInOut(r,i);case t.circleIn:return e.Easing.Circular.easeIn(r,i);case t.circleOut:return e.Easing.Circular.easeOut(r,i);case t.circleInOut:return e.Easing.Circular.easeInOut(r,i);case t.cubicIn:return e.Easing.Cubic.easeIn(r,i);case t.cubicOut:return e.Easing.Cubic.easeOut(r,i);case t.cubicInOut:return e.Easing.Cubic.easeInOut(r,i);case t.elasticIn:return e.Easing.Elastic.easeIn(r,i);case t.elasticOut:return e.Easing.Elastic.easeOut(r,i);case t.elasticInOut:return e.Easing.Elastic.easeInOut(r,i);case t.punch:return e.Easing.Elastic.punch(r,i);case t.expoIn:return e.Easing.Exponential.easeIn(r,i);case t.expoOut:return e.Easing.Exponential.easeOut(r,i);case t.expoInOut:return e.Easing.Exponential.easeInOut(r,i);case t.quadIn:return e.Easing.Quadratic.easeIn(r,i);case t.quadOut:return e.Easing.Quadratic.easeOut(r,i);case t.quadInOut:return e.Easing.Quadratic.easeInOut(r,i);case t.quadIn:return e.Easing.Quadratic.easeIn(r,i);case t.quadOut:return e.Easing.Quadratic.easeOut(r,i);case t.quadInOut:return e.Easing.Quadratic.easeInOut(r,i);case t.quintIn:return e.Easing.Quintic.easeIn(r,i);case t.quintOut:return e.Easing.Quintic.easeOut(r,i);case t.quintInOut:return e.Easing.Quintic.easeInOut(r,i);case t.sineIn:return e.Easing.Sinusoidal.easeIn(r,i);case t.sineOut:return e.Easing.Sinusoidal.easeOut(r,i);case t.sineInOut:return e.Easing.Sinusoidal.easeInOut(r,i);default:return e.Easing.Linear.easeNone(r,i)}},n}();e.EaseHelper=n}(es||(es={})),function(e){var t=function(t){function n(){var e=t.call(this)||this;return e._activeTweens=[],e._tempTweens=[],n._instance=e,e}return __extends(n,t),n.prototype.update=function(){this._isUpdating=!0;for(var e=this._activeTweens.length-1;e>=0;--e){var t=this._activeTweens[e];t.tick()&&this._tempTweens.push(t)}this._isUpdating=!1;for(e=0;e=0;--t)n._instance._activeTweens[t].stop(e)},n.allTweensWithContext=function(e){for(var t=[],r=0;r=0;--r)n._instance._activeTweens[r].context==e&&n._instance._activeTweens[r].stop(t)},n.allTweenWithTarget=function(e){for(var t=[],r=0;r=0;--r)if(n._instance._activeTweens[r]){var i=n._instance._activeTweens[r];i.getTargetObject()==e&&i.stop(t)}},n.defaultEaseType=e.EaseType.quartIn,n.removeAllTweensOnLevelLoad=!1,n.cacheNumberTweens=!0,n.cacheVector2Tweens=!0,n.cacheRectTweens=!0,n}(e.GlobalManager);e.TweenManager=t}(es||(es={})),function(e){!function(e){var t=function(){function e(){}return e.easeNone=function(e,t){return e/t},e}();e.Linear=t;var n=function(){function e(){}return e.easeIn=function(e,t){return(e/=t)*e},e.easeOut=function(e,t){return-1*(e/=t)*(e-2)},e.easeInOut=function(e,t){return(e/=t/2)<1?.5*e*e:-.5*(--e*(e-2)-1)},e}();e.Quadratic=n;var r=function(){function e(){}return e.easeIn=function(e,t){return(e/=t)*e*(2.70158*e-1.70158)},e.easeOut=function(e,t){return(e=e/t-1)*e*(2.70158*e+1.70158)+1},e.easeInOut=function(e,t){var n=1.70158;return(e/=t/2)<1?e*e*((1+(n*=1.525))*e-n)*.5:.5*((e-=2)*e*((1+(n*=1.525))*e+n)+2)},e}();e.Back=r;var i=function(){function e(){}return e.easeOut=function(e,t){return(e/=t)<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},e.easeIn=function(e,t){return 1-this.easeOut(t-e,t)},e.easeInOut=function(e,t){return e