var ns_egret;(function(c){var e=function(){function c(){this._hashCode=c.hashCount++}Object.defineProperty(c.prototype,"hashCode",{get:function(){return this._hashCode},enumerable:!0,configurable:!0});c.hashCount=1;return c}();c.HashObject=e})(ns_egret||(ns_egret={}));var __extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(c){function a(b){"undefined"===typeof b&&(b=300);c.call(this);this.objectPool=[];this._length=0;1>b&&(b=1);this.autoDisposeTime=b;this.frameCount=0}__extends(a,c);a.prototype._checkFrame=function(){this.frameCount--;0>=this.frameCount&&this.dispose()};Object.defineProperty(a.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0});a.prototype.push=function(b){var f=this.objectPool;-1==f.indexOf(b)&&(f.push(b),this._length++,0==this.frameCount&& (this.frameCount=this.autoDisposeTime,a._callBackList.push(this)))};a.prototype.pop=function(){if(0==this._length)return null;this._length--;return this.objectPool.pop()};a.prototype.dispose=function(){0=c&&(d.unregister(arguments.callee,a),b.apply(a)))},a)};a.prototype.setTimeout=function(b,a,c){for(var d=[],e=0;e=c&&(k.unregister(arguments.callee,a),b.apply(a,d)))},a)};a.prototype.setTimeScale=function(b){this._timeScale=b};a.prototype.getTimeScale=function(){return this._timeScale};a.prototype.pause=function(){this._paused=!0};a.prototype.resume=function(){this._paused=!1};a.getInstance=function(){null==a.instance&&(a.instance=new a);return a.instance};a.now=function(){return c.getTimer()};return a}(c.EventDispatcher);c.Ticker=e})(ns_egret||(ns_egret= {}));(function(c){var e=function(){function c(){}c.LEFT="left";c.RIGHT="right";c.CENTER="center";c.JUSTIFY="justify";c.CONTENT_JUSTIFY="contentJustify";return c}();c.HorizontalAlign=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.TOP="top";c.BOTTOM="bottom";c.MIDDLE="middle";c.JUSTIFY="justify";c.CONTENT_JUSTIFY="contentJustify";return c}();c.VerticalAlign=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(b,a){"undefined"===typeof b&&(b=1E3);"undefined"===typeof a&&(a=0);d.call(this);this._currentCount=0;this.delay=b;this.repeatCount=a}__extends(a,d);a.prototype.currentCount=function(){return this._currentCount};a.prototype.running=function(){return this._running};a.prototype.reset=function(){this.stop();this._currentCount=0};a.prototype.start=function(){this._running||(this.lastTime=c.getTimer(),0!=this._currentCount&&(this._currentCount=0),c.Ticker.getInstance().register(this.onEnterFrame, this),this._running=!0)};a.prototype.stop=function(){this._running&&(c.Ticker.getInstance().unregister(this.onEnterFrame,this),this._running=!1)};a.prototype.onEnterFrame=function(b){a.timerEvent||(a.timerEvent=new c.TimerEvent(c.TimerEvent.TIMER));b=a.timerEvent;var f=c.getTimer();f-this.lastTime>this.delay&&(this.lastTime=f,this._currentCount++,b._type=c.TimerEvent.TIMER,this.dispatchEvent(b),0=this.repeatCount&&(this.stop(),b._type=c.TimerEvent.TIMER_COMPLETE, this.dispatchEvent(b)))};return a}(c.EventDispatcher);c.Timer=e})(ns_egret||(ns_egret={}));(function(c){c.getQualifiedClassName=function(c){var a;c=c.prototype?c.prototype.constructor:c.__proto__.constructor;if(!e[c]){a=c.toString();var b=a.indexOf("(");a=a.substring(9,b);e[c]=a}return e[c]};var e={}})(ns_egret||(ns_egret={}));(function(c){var e={};c.getDefinitionByName=function(c){if(!c)return null;var a=e[c];if(a)return a;for(var b=c.split("."),f=b.length,a=window,m=0;mc)c=0;16777215c.length;)c="0"+c;return"#"+c}})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(b,a,c,e,g,k){"undefined"===typeof b&&(b=1);"undefined"===typeof a&&(a=0);"undefined"===typeof c&&(c=0);"undefined"===typeof e&&(e=1);"undefined"===typeof g&&(g=0);"undefined"===typeof k&&(k=0);d.call(this);this.a=b;this.b=a;this.c=c;this.d=e;this.tx=g;this.ty=k;this.invert=function(){var b=this.a,a=this.b,f=this.c,c=this.d,d=this.tx,m=b*c-a*f;this.a=c/m;this.b=-a/m;this.c=-f/m;this.d=b/m;this.tx=(f*this.ty-c*d)/m;this.ty=-(b*this.ty-a*d)/m;return this}}__extends(a, d);a.prototype.prepend=function(b,a,c,d,e,k){var l=this.tx;if(1!=b||0!=a||0!=c||1!=d){var n=this.a,p=this.c;this.a=n*b+this.b*c;this.b=n*a+this.b*d;this.c=p*b+this.d*c;this.d=p*a+this.d*d}this.tx=l*b+this.ty*c+e;this.ty=l*a+this.ty*d+k;return this};a.prototype.append=function(b,a,c,d,e,k){var l=this.a,n=this.b,p=this.c,q=this.d;this.a=b*l+a*p;this.b=b*n+a*q;this.c=c*l+d*p;this.d=c*n+d*q;this.tx=e*l+k*p+this.tx;this.ty=e*n+k*q+this.ty;return this};a.prototype.prependMatrix=function(b){this.prepend(b.a, b.b,b.c,b.d,b.tx,b.ty);return this};a.prototype.appendMatrix=function(b){this.append(b.a,b.b,b.c,b.d,b.tx,b.ty);return this};a.prototype.prependTransform=function(b,f,c,d,e,k,l,n,p){if(e%360){var q=e*a.DEG_TO_RAD;e=Math.cos(q);q=Math.sin(q)}else e=1,q=0;if(n||p)this.tx-=n,this.ty-=p;k||l?(k*=a.DEG_TO_RAD,l*=a.DEG_TO_RAD,this.prepend(e*c,q*c,-q*d,e*d,0,0),this.prepend(Math.cos(l),Math.sin(l),-Math.sin(k),Math.cos(k),b,f)):this.prepend(e*c,q*c,-q*d,e*d,b,f);return this};a.prototype.appendTransform= function(b,f,c,d,e,k,l,n,p){if(e%360){var q=e*a.DEG_TO_RAD;e=Math.cos(q);q=Math.sin(q)}else e=1,q=0;k||l?(k*=a.DEG_TO_RAD,l*=a.DEG_TO_RAD,this.append(Math.cos(l),Math.sin(l),-Math.sin(k),Math.cos(k),b,f),this.append(e*c,q*c,-q*d,e*d,0,0)):this.append(e*c,q*c,-q*d,e*d,b,f);if(n||p)this.tx-=n*this.a+p*this.c,this.ty-=n*this.b+p*this.d;return this};a.prototype.appendTransformFromDisplay=function(b){var a,c;0!=b.anchorX||0!=b.anchorY?(c=b.getBounds(),a=c.width*b.anchorX,c=c.height*b.anchorY):(a=b.anchorOffsetX, c=b.anchorOffsetY);this.identity();this.appendTransform(b.x,b.y,b.scaleX,b.scaleY,b.rotation,b.skewX,b.skewY,a,c);return this};a.prototype.rotate=function(b){var a=Math.cos(b);b=Math.sin(b);var c=this.a,d=this.c,e=this.tx;this.a=c*a-this.b*b;this.b=c*b+this.b*a;this.c=d*a-this.d*b;this.d=d*b+this.d*a;this.tx=e*a-this.ty*b;this.ty=e*b+this.ty*a;return this};a.prototype.skew=function(b,f){b*=a.DEG_TO_RAD;f*=a.DEG_TO_RAD;this.append(Math.cos(f),Math.sin(f),-Math.sin(b),Math.cos(b),0,0);return this}; a.prototype.scale=function(b,a){this.a*=b;this.d*=a;this.c*=b;this.b*=a;this.tx*=b;this.ty*=a;return this};a.prototype.translate=function(b,a){this.tx+=b;this.ty+=a;return this};a.prototype.identity=function(){this.a=this.d=1;this.b=this.c=this.tx=this.ty=0;return this};a.prototype.isIdentity=function(){return 0==this.tx&&0==this.ty&&1==this.a&&0==this.b&&0==this.c&&1==this.d};a.prototype.transformPoint=function(b,a,c){c=c||{};c.x=b*this.a+a*this.c+this.tx;c.y=b*this.b+a*this.d+this.ty;return c}; a.prototype.decompose=function(b){null==b&&(b={});b.x=this.tx;b.y=this.ty;b.scaleX=Math.sqrt(this.a*this.a+this.b*this.b);b.scaleY=Math.sqrt(this.c*this.c+this.d*this.d);var f=Math.atan2(-this.c,this.d),c=Math.atan2(this.b,this.a);f==c?(b.rotation=c/a.DEG_TO_RAD,0>this.a&&0<=this.d&&(b.rotation+=0>=b.rotation?180:-180),b.skewX=b.skewY=0):(b.skewX=f/a.DEG_TO_RAD,b.skewY=c/a.DEG_TO_RAD);return b};a.transformCoords=function(b,a,d){var e=new c.Point(0,0);e.x=b.a*a+b.c*d+b.tx;e.y=b.d*d+b.b*a+b.ty;return e}; a.identity=new a;a.DEG_TO_RAD=Math.PI/180;return a}(c.HashObject);c.Matrix=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(b,a){"undefined"===typeof b&&(b=0);"undefined"===typeof a&&(a=0);c.call(this);this.x=b;this.y=a}__extends(a,c);a.prototype.clone=function(){return new a(this.x,this.y)};a.identity=new a(0,0);return a}(c.HashObject);c.Point=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(c){function a(b,a,m,e){"undefined"===typeof b&&(b=0);"undefined"===typeof a&&(a=0);"undefined"===typeof m&&(m=0);"undefined"===typeof e&&(e=0);c.call(this);this.x=b;this.y=a;this.width=m;this.height=e}__extends(a,c);Object.defineProperty(a.prototype,"right",{get:function(){return this.x+this.width},set:function(b){this.width=b-this.x},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"bottom",{get:function(){return this.y+this.height},set:function(b){this.height= b-this.y},enumerable:!0,configurable:!0});a.prototype.initialize=function(b,a,c,d){this.x=b;this.y=a;this.width=c;this.height=d;return this};a.prototype.contains=function(b,a){return this.x<=b&&this.x+this.width>=b&&this.y<=a&&this.y+this.height>=a};a.prototype.intersects=function(b){return this.contains(b.x,b.y)||this.contains(b.x,b.bottom)||this.contains(b.right,b.y)||this.contains(b.right,b.bottom)?!0:!1};a.prototype.clone=function(){return new a(this.x,this.y,this.width,this.height)};a.identity= new a(0,0,0,0);return a}(c.HashObject);c.Rectangle=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function d(){}d.fatal=function(a,b){"undefined"===typeof b&&(b=null);c.Logger.traceToConsole("Fatal",a,b);throw Error(c.Logger.getTraceCode("Fatal",a,b));};d.info=function(a,b){"undefined"===typeof b&&(b=null);c.Logger.traceToConsole("Info",a,b)};d.warning=function(a,b){"undefined"===typeof b&&(b=null);c.Logger.traceToConsole("Warning",a,b)};d.traceToConsole=function(a,b,f){console.log(c.Logger.getTraceCode(a,b,f))};d.getTraceCode=function(a,b,f){return"["+a+"]"+b+":"+ (null==f?"":f)};return d}();c.Logger=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(b){function m(){b.call(this);this._originalDesignHeight=this._originalDesignWidth=this._designHeight=this._designWidth=0;this._scaleY=this._scaleX=1;this._frame=document.getElementById(m.canvas_div_name);var a=document.getElementById(m.canvas_name),f=a.width,a=a.height;this._designWidth=f;this._designHeight=a;this._originalDesignWidth=f;this._originalDesignHeight=a}__extends(m,b);m.getInstance=function(){null==m.instance&&(a.initialize(),f.initialize(),m.instance=new m); return m.instance};m.prototype.setFrameSize=function(b,a){throw Error("\u8be5\u65b9\u6cd5\u5df2\u7ecf\u88ab\u5e9f\u5f03\uff0c\u4f1a\u5728\u4e0b\u4e2a\u7248\u672c\u4e2d\u5220\u9664");};m.prototype.setDesignSize=function(b,a,f){isNaN(b)||0==b||isNaN(a)||0==a?c.Logger.info("Resolution Error"):(this.setResolutionPolicy(f),this._designWidth=b,this._designHeight=a,this._originalDesignWidth=b,this._originalDesignHeight=a,this._resolutionPolicy.apply(this,this._designWidth,this._designHeight))};m.prototype.setResolutionPolicy= function(b){if(b instanceof d)this._resolutionPolicy=b;else switch(b){case d.FIXED_HEIGHT:this._resolutionPolicy=new d(a.EQUAL_TO_FRAME,f.FIXED_HEIGHT);break;case d.FIXED_WIDTH:this._resolutionPolicy=new d(a.EQUAL_TO_FRAME,f.FIXED_WIDTH)}null!=this._resolutionPolicy?this._resolutionPolicy.init(this):c.Logger.fatal("\u9700\u8981\u5148\u8bbe\u7f6eresolutionPolicy")};m.prototype.getScaleX=function(){return this._scaleX};m.prototype.getScaleY=function(){return this._scaleY};m.canvas_name="gameCanvas"; m.canvas_div_name="gameDiv";return m}(c.HashObject);c.StageDelegate=e;var d=function(){function b(a,f){this.setContainerStrategy(a);this.setContentStrategy(f)}b.prototype.init=function(b){this._containerStrategy.init(b);this._contentStrategy.init(b)};b.prototype.apply=function(b,a,f){this._containerStrategy.apply(b,a,f);return this._contentStrategy.apply(b,a,f)};b.prototype.setContainerStrategy=function(b){b instanceof a&&(this._containerStrategy=b)};b.prototype.setContentStrategy=function(b){b instanceof f&&(this._contentStrategy=b)};b.FIXED_HEIGHT=1;b.FIXED_WIDTH=2;return b}();c.ResolutionPolicy=d;var a=function(){function a(){}a.initialize=function(){a.EQUAL_TO_FRAME=new b};a.prototype.init=function(b){};a.prototype.apply=function(b,a,f){};a.prototype._setupContainer=function(){var b=document.body,a;if(b&&(a=b.style))a.paddingTop=a.paddingTop||"0px",a.paddingRight=a.paddingRight||"0px",a.paddingBottom=a.paddingBottom||"0px",a.paddingLeft=a.paddingLeft||"0px",a.borderTop=a.borderTop||"0px",a.borderRight= a.borderRight||"0px",a.borderBottom=a.borderBottom||"0px",a.borderLeft=a.borderLeft||"0px",a.marginTop=a.marginTop||"0px",a.marginRight=a.marginRight||"0px",a.marginBottom=a.marginBottom||"0px",a.marginLeft=a.marginLeft||"0px"};return a}();c.ContainerStrategy=a;var b=function(b){function a(){b.apply(this,arguments)}__extends(a,b);a.prototype.apply=function(b){this._setupContainer()};return a}(a);c.EqualToFrame=b;var f=function(){function b(){}b.initialize=function(){b.FIXED_HEIGHT=new m;b.FIXED_WIDTH= new h};b.prototype.init=function(b){};b.prototype.apply=function(b,a,f){};b.FIXED_HEIGHT=null;b.FIXED_WIDTH=null;return b}();c.ContentStrategy=f;var m=function(b){function a(){b.apply(this,arguments)}__extends(a,b);a.prototype.apply=function(b,a,f){var c=document.getElementById(e.canvas_name),d=document.getElementById(e.canvas_div_name),m=c.height/f,h=window.innerHeight,m=h/f,g=a*m;c.width=a;c.height=f;c.style.width=g+"px";c.style.height=h+"px";d.style.width=g+"px";d.style.height=h+"px";b._scaleX= m;b._scaleY=m};return a}(f);c.FixedHeight=m;var h=function(b){function a(){b.apply(this,arguments)}__extends(a,b);a.prototype.apply=function(b,a,f){f=document.getElementById(e.canvas_name);var c=document.getElementById(e.canvas_div_name),d=document.documentElement.clientWidth,m=document.documentElement.clientHeight,h=d/a;f.width=a;f.height=m/h;f.style.width=d+"px";f.style.height=m+"px";c.style.width=d+"px";c.style.height=m+"px";b._scaleX=h;b._scaleY=h};return a}(f);c.FixedWidth=h;var g=function(b){function a(f, c){b.call(this);this.width=f;this.height=c}__extends(a,b);a.prototype.apply=function(b,a,f){f=document.getElementById(e.canvas_name);var c=document.getElementById(e.canvas_div_name),d=this.width,m=this.height,h=d/a;f.width=a;f.height=m/h;f.style.width=d+"px";f.style.height=m+"px";c.style.width=d+"px";c.style.height=m+"px";b._scaleX=h;b._scaleY=h};return a}(f);c.FixedSize=g})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this._originalData={};this._drawAreaList=[]}__extends(a,d);a.getInstance=function(){null==a.instance&&(a.instance=new a);return a.instance};a.prototype.addDrawArea=function(b){this._drawAreaList.push(b)};a.prototype.clearDrawArea=function(){this._drawAreaList=[]};a.prototype.drawImage=function(b,a,d,e,g,k,l,n,p,q){l=l||0;n=n||0;var v=a._texture_to_render;if(null!=v){this._originalData.sourceX=d;this._originalData.sourceY=e;this._originalData.sourceWidth= g;this._originalData.sourceHeight=k;this._originalData.destX=l;this._originalData.destY=n;this._originalData.destWidth=p;this._originalData.destHeight=q;for(var F=this.getDrawAreaList(),r=0;rD.x+D.width||a.worldBounds.y+a.worldBounds.height+this._originalData.destY>D.y+D.height){c.Logger.fatal("\u8bf7\u4e0d\u8981\u8ba9\u5e26\u6709\u65cb\u8f6c\u548c\u659c\u5207\u7684\u663e\u793a\u5bf9\u8c61\u8de8\u8fc7\u91cd\u7ed8\u533a\u57df");break}}else{var x=a.worldTransform.a,C=a.worldTransform.d,A;a.worldBounds.x+this._originalData.destXD.x+D.width&&(A=(a.worldBounds.x+a.worldBounds.width-D.x-D.width)/x+this._originalData.destX,g-=A/(p/g),p-=A);a.worldBounds.y+a.worldBounds.height+this._originalData.destY>D.y+D.height&&(A=(a.worldBounds.y+a.worldBounds.height-D.y-D.height)/C+this._originalData.destY,k-=A/(q/k),q-=A)}b.drawImage(v,d,e,g,k,l,n,p,q);d=this._originalData.sourceX;e=this._originalData.sourceY; g=this._originalData.sourceWidth;k=this._originalData.sourceHeight;l=this._originalData.destX;n=this._originalData.destY;p=this._originalData.destWidth;q=this._originalData.destHeight}}}};a.prototype.ignoreRender=function(b,a,c,d){var e=b.worldBounds;c*=b.worldTransform.a;d*=b.worldTransform.d;return e.x+e.width+c<=a.x||e.x+c>=a.x+a.width||e.y+e.height+d<=a.y||e.y+d>=a.y+a.height?!0:!1};a.prototype.getDrawAreaList=function(){var b;0==this._drawAreaList.length?(this._defaultDrawAreaList||(this._defaultDrawAreaList= [new c.Rectangle(0,0,c.MainContext.instance.stage.stageWidth,c.MainContext.instance.stage.stageHeight)]),b=this._defaultDrawAreaList):b=this._drawAreaList;return b};return a}(c.HashObject);c.RenderFilter=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function d(){}d.mapClass=function(a,b,f){"undefined"===typeof f&&(f="");a=this.getKey(a)+"#"+f;this.mapClassDic[a]=b};d.getKey=function(a){return"string"==typeof a?a:c.getQualifiedClassName(a)};d.mapValue=function(a,b,f){"undefined"===typeof f&&(f="");a=this.getKey(a)+"#"+f;this.mapValueDic[a]=b};d.hasMapRule=function(a,b){"undefined"===typeof b&&(b="");var f=this.getKey(a)+"#"+b;return this.mapValueDic[f]||this.mapClassDic[f]?!0:!1};d.getInstance=function(a,b){"undefined"=== typeof b&&(b="");var f=this.getKey(a)+"#"+b;if(this.mapValueDic[f])return this.mapValueDic[f];var c=this.mapClassDic[f];if(c)return c=new c,this.mapValueDic[f]=c,delete this.mapClassDic[f],c;throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219\uff01any#named:"+f+"\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002");};d.mapClassDic={};d.mapValueDic={};return d}(); c.Injector=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this._parent=null;this._cacheAsBitmap=!1;this._y=this._x=0;this._scaleY=this._scaleX=1;this._anchorY=this._anchorX=this._anchorOffsetY=this._anchorOffsetX=0;this.visible=!0;this._rotation=0;this._alpha=1;this._skewY=this._skewX=0;this._hasHeightSet=this._hasWidthSet=!1;this.worldAlpha=1;this.worldTransform=new c.Matrix;this.worldBounds=new c.Rectangle(0,0,0,0)}__extends(a,d);Object.defineProperty(a.prototype,"parent",{get:function(){return this._parent}, enumerable:!0,configurable:!0});a.prototype._parentChanged=function(b){this._parent=b};Object.defineProperty(a.prototype,"x",{get:function(){return this._x},set:function(b){c.NumberUtils.isNumber(b)&&(this._x=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"y",{get:function(){return this._y},set:function(b){c.NumberUtils.isNumber(b)&&(this._y=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"scaleX",{get:function(){return this._scaleX},set:function(b){c.NumberUtils.isNumber(b)&& (this._scaleX=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"scaleY",{get:function(){return this._scaleY},set:function(b){c.NumberUtils.isNumber(b)&&(this._scaleY=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"anchorPointX",{get:function(){return this._anchorOffsetX},set:function(b){c.NumberUtils.isNumber(b)&&(this._anchorOffsetX=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"anchorOffsetX",{get:function(){return this._anchorOffsetX}, set:function(b){c.NumberUtils.isNumber(b)&&(this._anchorOffsetX=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"anchorPointY",{get:function(){return this._anchorOffsetY},set:function(b){c.NumberUtils.isNumber(b)&&(this._anchorOffsetY=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"anchorOffsetY",{get:function(){return this._anchorOffsetY},set:function(b){c.NumberUtils.isNumber(b)&&(this._anchorOffsetY=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype, "relativeAnchorPointX",{get:function(){return this._anchorX},set:function(b){c.NumberUtils.isNumber(b)&&(this._anchorX=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"anchorX",{get:function(){return this._anchorX},set:function(b){c.NumberUtils.isNumber(b)&&(this._anchorX=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"relativeAnchorPointY",{get:function(){return this._anchorY},set:function(b){c.NumberUtils.isNumber(b)&&(this._anchorY=b)},enumerable:!0, configurable:!0});Object.defineProperty(a.prototype,"anchorY",{get:function(){return this._anchorY},set:function(b){c.NumberUtils.isNumber(b)&&(this._anchorY=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rotation",{get:function(){return this._rotation},set:function(b){c.NumberUtils.isNumber(b)&&(this._rotation=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"alpha",{get:function(){return this._alpha},set:function(b){c.NumberUtils.isNumber(b)&&(this._alpha= b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"skewX",{get:function(){return this._skewX},set:function(b){c.NumberUtils.isNumber(b)&&(this._skewX=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"skewY",{get:function(){return this._skewY},set:function(b){c.NumberUtils.isNumber(b)&&(this._skewY=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"touchEnabled",{get:function(){return this._touchEnabled},set:function(b){this._touchEnabled= b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"scrollRect",{get:function(){return this._scrollRect},set:function(b){this._scrollRect=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"measuredWidth",{get:function(){return this._measureBounds().width},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"measuredHeight",{get:function(){return this._measureBounds().height},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"explicitWidth", {get:function(){return this._explicitWidth},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"explicitHeight",{get:function(){return this._explicitHeight},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"width",{get:function(){return this.getBounds().width},set:function(b){this._explicitWidth=b;this._hasWidthSet=c.NumberUtils.isNumber(b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"height",{get:function(){return this.getBounds().height},set:function(b){this._explicitHeight= b;this._hasHeightSet=c.NumberUtils.isNumber(b)},enumerable:!0,configurable:!0});a.prototype.draw=function(b){if(this.visible&&!this.drawCacheTexture(b)){b.setAlpha(this.worldAlpha,this.blendMode);b.setTransform(this.worldTransform);if(this.mask||this._scrollRect)b.save(),this._scrollRect?b.clip(this._scrollRect.x,this._scrollRect.y,this._scrollRect.width,this._scrollRect.height):b.clip(this.mask.x,this.mask.y,this.mask.width,this.mask.height);this.render(b);(this.mask||this._scrollRect)&&b.restore()}}; a.prototype.drawCacheTexture=function(b){if(this._cacheAsBitmap){var a=this._texture_to_render,d=a.offsetX,e=a.offsetY,g=a._textureWidth,a=a._textureHeight;this.updateTransform();b.setAlpha(this.worldAlpha,this.blendMode);b.setTransform(this.worldTransform);this.mask&&(b.save(),b.clip(this.mask.x,this.mask.y,this.mask.width,this.mask.height));var k=c.MainContext.instance.rendererContext.texture_scale_factor;c.RenderFilter.getInstance().drawImage(b,this,0,0,g*k,a*k,d,e,g,a);this.mask&&b.restore(); return!0}return!1};a.prototype.updateTransform=function(){this.worldTransform.identity();this.worldTransform=this.worldTransform.appendMatrix(this._parent.worldTransform);var b,f;0!=this._anchorX||0!=this._anchorY?(f=this.getBounds(),b=f.width*this._anchorX,f=f.height*this._anchorY):(b=this._anchorOffsetX,f=this._anchorOffsetY);this.worldTransform.appendTransform(this._x,this._y,this._scaleX,this._scaleY,this._rotation,this._skewX,this._skewY,b,f);this._scrollRect&&this.worldTransform.append(1,0, 0,1,-this._scrollRect.x,-this._scrollRect.y);f=a.getTransformBounds(this.getBounds(),this.worldTransform);this.worldBounds.initialize(f.x,f.y,f.width,f.height);this.worldAlpha=this._parent.worldAlpha*this._alpha};a.prototype.render=function(b){};a.prototype.getBounds=function(){var b=this._measureBounds(),a=this._hasWidthSet?this._explicitWidth:b.width,d=this._hasHeightSet?this._explicitHeight:b.height,e=b.x,b=b.y,g,k;0!=this._anchorX||0!=this._anchorY?(g=a*this._anchorX,k=d*this._anchorY):(g=this._anchorOffsetX, k=this._anchorOffsetY);return c.Rectangle.identity.initialize(e-g,b-k,a,d)};a.prototype.getConcatenatedMatrix=function(){for(var b=a.identityMatrixForGetConcatenated.identity(),f=this;null!=f;){if(0!=f.anchorX||0!=f.anchorY){var c=f.getBounds();b.prependTransform(f.x,f.y,f.scaleX,f.scaleY,f.rotation,f.skewX,f.skewY,c.width*f.anchorX,c.height*f.anchorY)}else b.prependTransform(f.x,f.y,f.scaleX,f.scaleY,f.rotation,f.skewX,f.skewY,f.anchorOffsetX,f.anchorOffsetY);f=f.parent}return b};a.prototype.localToGlobal= function(b,a){"undefined"===typeof b&&(b=0);"undefined"===typeof a&&(a=0);var d=this.getConcatenatedMatrix();d.append(1,0,0,1,b,a);var e=c.Point.identity;e.x=d.tx;e.y=d.ty;return e};a.prototype.globalToLocal=function(b,a){"undefined"===typeof b&&(b=0);"undefined"===typeof a&&(a=0);var d=this.getConcatenatedMatrix();d.invert();d.append(1,0,0,1,b,a);var e=c.Point.identity;e.x=d.tx;e.y=d.ty;return e};a.prototype.hitTest=function(b,a,c){"undefined"===typeof c&&(c=!1);if(!this.visible||!c&&!this._touchEnabled)return null; c=this.getBounds();return 0F&&(F=c);(c=l+n+p)F&&(F=c);(c=n+p)F&&(F=c);(d=e+q)D&&(D=d);(d=e+k+q)D&&(D=d);(d=k+q)D&& (D=d);return b.initialize(v,r,F-v,D-r)};a.identityMatrixForGetConcatenated=new c.Matrix;a._enterFrameCallBackList=[];a._renderCallBackList=[];return a}(c.EventDispatcher);c.DisplayObject=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this._touchChildren=!0;this._children=[]}__extends(a,d);Object.defineProperty(a.prototype,"touchChildren",{get:function(){return this._touchChildren},set:function(b){this._touchChildren=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"numChildren",{get:function(){return this._children.length},enumerable:!0,configurable:!0});a.prototype.setChildIndex=function(b,a){this.doSetChildIndex(b,a)};a.prototype.doSetChildIndex=function(b, a){var d=this._children.indexOf(b);0>d&&c.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");this._children.splice(d,1);0>a||this._children.length<=a?this._children.push(b):this._children.splice(a,0,b)};a.prototype.addChild=function(b){var a=this.numChildren;b.parent==this&&a--;return this.childAdded(b,a)};a.prototype.addChildAt=function(b,a){return this.childAdded(b,a)};a.prototype.childAdded=function(b,a){if(b==this)return b;if(0>a||a>this._children.length)return c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"), b;var d=b.parent;if(d==this)return this.doSetChildIndex(b,a),b;d&&d.removeChild(b);this._children.splice(a,0,b);b._parentChanged(this);b.dispatchEventWith(c.Event.ADDED,!0);this._stage&&b._onAddToStage();return b};a.prototype.removeChild=function(b){b=this._children.indexOf(b);if(0<=b)return this.childRemoved(b);c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent")};a.prototype.removeChildAt=function(b){if(0<=b&&ba){var c=a;a=b;b=c}else if(b==a)return;var c=this._children,d=c[b],e=c[a];c.splice(a, 1);c.splice(b,1);c.splice(b,0,e);c.splice(a,0,d)};a.prototype.getChildIndex=function(b){return this._children.indexOf(b)};a.prototype.removeChildren=function(){for(var b=this._children.length-1;0<=b;b--)this.childRemoved(b)};a.prototype.updateTransform=function(){if(this.visible){d.prototype.updateTransform.call(this);for(var b=0,a=this._children.length;ba||0==k)a=q;if(pe||0==k)e=v}}return c.Rectangle.identity.initialize(b,d,a-b,e-d)};a.prototype.hitTest=function(b,a){var d;if(!this.visible)return null;if(this._scrollRect){if(b>this._scrollRect.width||a>this._scrollRect.height)return null}else if(this.mask&& (this.mask.x>b||b>this.mask.x+this.mask.width||this.mask.y>a||a>this.mask.y+this.mask.height))return null;var e=this._children,g=e.length;if(0==g)return d;for(var k=this._touchChildren,l=this;l._parent;)k=k&&l._parent._touchChildren,l=l._parent;for(g-=1;0<=g;g--){var n=l=e[g],p=n.getOffsetPoint(),q=n._x,v=n._y;this._scrollRect&&(q-=this._scrollRect.x,v-=this._scrollRect.y);n=c.Matrix.identity.identity().prependTransform(q,v,n._scaleX,n._scaleY,n._rotation,0,0,p.x,p.y);n.invert();n=c.Matrix.transformCoords(n, b,a);if(l=l.hitTest(n.x,n.y,!0)){if(l._touchEnabled&&k)return l;if(this._touchEnabled)return this;null==d&&(d=l)}}return d};a.prototype._onAddToStage=function(){d.prototype._onAddToStage.call(this);for(var b=this.numChildren,a=0;aa.height&&(a.height=l+k.h)}return a};a.prototype._measureBounds=function(){return this._renderText(!0)};return a}(c.DisplayObjectContainer);c.BitmapText=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function a(b){this.renderContext=b;this.canvasContext=b.canvasContext;this.commandQueue=[]}a.prototype.beginFill=function(b,a){this.commandQueue.push(new d(this._setStyle,this,["rgba("+(b>>16)+","+((b&65280)>>8)+","+(b&255)+","+a+")"]))};a.prototype._setStyle=function(b){this.canvasContext.fillStyle=b};a.prototype.drawRect=function(b,a,c,e){this.canvasContext.fill();var g=this.renderContext;this.commandQueue.push(new d(function(b,a,c,f){this.canvasContext.fillRect(g._transformTx+ b,g._transformTy+a,c,f)},this,[b,a,c,e]))};a.prototype.lineStyle=function(b,a,c,e,g,k,l,n){"undefined"===typeof b&&(b=NaN);"undefined"===typeof a&&(a=0);"undefined"===typeof c&&(c=1);"undefined"===typeof e&&(e=!1);"undefined"===typeof g&&(g="normal");"undefined"===typeof k&&(k=null);"undefined"===typeof l&&(l=null);"undefined"===typeof n&&(n=3);this.commandQueue.push(new d(function(a,f){var d="rgba("+(f>>16)+","+((f&65280)>>8)+","+(f&255)+","+c+")";this.canvasContext.lineWidth=b;this.canvasContext.strokeStyle= d},this,[b,a]))};a.prototype.lineTo=function(b,a){var c=this.renderContext;this.commandQueue.push(new d(function(b,a){var f=this.canvasContext;f.beginPath();f.moveTo(c._transformTx,c._transformTx);f.lineTo(c._transformTx+b,c._transformTx+a);f.stroke()},this,[b,a]))};a.prototype.clear=function(){this.commandQueue.length=0};a.prototype.endFill=function(){};a.prototype._draw=function(){for(var b=0,a=this.commandQueue.length;be&&(e=F)}p=0;for(q=n;p< q;p++)v=g[p],this._drawTextLine(b,v,k,e),k+=l}else{e=d;p=0;for(q=g.length;pd)for(var F=v,r=0,v="",D=0;Dd?0==r?(r+=x,v+=F[D],e=x):(this._drawTextLine(b,v,k,e),n++,D--,v="",r=0,k+=l):(r+=x,v+=F[D])}this._drawTextLine(b,v,k,e);n++;k+=l}}this._numLines=n;d=c.Rectangle.identity;a&&(d.x=d.y=0,d.width=e,d.height=n*l,this.__hackIgnoreDrawText=!1);return d};a.prototype._drawTextLine=function(b,a,c,d){this.__hackIgnoreDrawText|| b.drawText(this,a,"left"==this.textAlign?0:"center"==this.textAlign?d/2:d,c,d)};return a}(c.DisplayObject);c.TextField=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(a){function b(b){a.call(this);this.frames=b.frames}__extends(b,a);b.prototype.getFrame=function(b){var a=this.frames[b];null==a&&c.Logger.fatal("\u6ca1\u6709\u627e\u5230\u76f8\u5e94\u7684frame\uff1a",b);return a};b.parseFromDragonBones=function(a){var c=new b(a);c.frames={};a=a.SubTexture;for(var e in a){var g=a[e],k=new d;k.w=g.width;k.h=g.height;k.x=g.x;k.y=g.y;c.frames[g.name]=k}return c};return b}(c.HashObject);c.SpriteSheet=e;var d=function(){return function(){this.offY= this.offX=0}}();c.SpriteSheetFrame=d})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.apply(this,arguments);this._placeholderText="";this._edFontSize=14;this._textColor=16711680;this._placeholderFontSize=14;this._placeholderColor=16776960;this._preY=this._preX=0}__extends(a,d);a.prototype._onAddToStage=function(){d.prototype._onAddToStage.call(this);var b=this.localToGlobal(),a=new c.StageText;a.open(b.x,b.y,this._explicitWidth,this._explicitHeight);this.addEventListener(c.TouchEvent.TOUCH_BEGAN,this.onMouseDownHandler,this);this.stageText= a};a.prototype.setText=function(b){this.stageText.setText(b)};a.prototype.getText=function(){return this.stageText.getText()};a.prototype.setTextType=function(b){this.stageText.setTextType(b)};a.prototype.getTextType=function(){return this.stageText.getTextType()};a.prototype.onMouseDownHandler=function(b){};a.prototype._onRemoveFromStage=function(){this.stageText.remove()};a.prototype._measureBounds=function(){return c.Rectangle.identity};a.prototype.hitTest=function(b,a,c){return null};return a}(c.DisplayObject); c.TextInput=e;e=function(){function c(){}c.prototype.editBoxEditingDidBegin=function(a){};c.prototype.editBoxEditingDidEnd=function(a){};c.prototype.editBoxTextChanged=function(a,b){};c.prototype.editBoxReturn=function(a){};return c}();c.TextInputDegelete=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(b,a){d.call(this);this.data=b;this.texture=a;this._resPool={};this._currentInterval=this._interval=this._totalFrame=this._currentFrameIndex=0;this._isPlaying=!1;this._passTime=0;this._oneFrameTime=1E3/60;this._frameData=b;this._oneFrameTime=1E3/c.MainContext.instance.deviceContext.frameRate}__extends(a,d);a.prototype.gotoAndPlay=function(b){this.checkHasFrame(b);this._isPlaying=!0;this._currentInterval=this._currentFrameIndex=0;this._currentFrameName=b;this._totalFrame= this._frameData.frames[b].totalFrame;this.playNextFrame();this._passTime=0;c.Ticker.getInstance().register(this.update,this)};a.prototype.gotoAndStop=function(b){this.checkHasFrame(b);this.stop();this._currentInterval=this._currentFrameIndex=0;this._currentFrameName=b;this._totalFrame=this._frameData.frames[b].totalFrame;this.playNextFrame()};a.prototype.checkHasFrame=function(b){void 0==this._frameData.frames[b]&&c.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a",b)};a.prototype.stop= function(){this._isPlaying=!1;c.Ticker.getInstance().unregister(this.update,this)};a.prototype.update=function(b){if(this._interval!=this._currentInterval)this._currentInterval++;else{for(var a=Math.floor((this._passTime%this._oneFrameTime+b)/this._oneFrameTime);1<=a;)1==a?this.playNextFrame():this.playNextFrame(!1),a--;this._passTime+=b}};a.prototype.playNextFrame=function(b){"undefined"===typeof b&&(b=!0);this._currentInterval=0;var a=this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex]; b&&(b=this.getBitmap(a.res),b.x=a.x,b.y=a.y,this.removeChildren(),this.addChild(b));null!=a.action&&this.dispatchEventWith(a.action);this._currentFrameIndex++;this._currentFrameIndex==this._totalFrame&&(this._currentFrameIndex=0)};a.prototype.getBitmap=function(b){var a;if(null!=this._resPool[b])a=this._resPool[b];else{var d=this._frameData.res[b];a=c.Bitmap.initWithTexture(this.texture);a.spriteFrame=d;this._resPool[b]=a}return a};a.prototype.release=function(){this._resPool={}};a.prototype.getCurrentFrameIndex= function(){return this._currentFrameIndex};a.prototype.getTotalFrame=function(){return this._totalFrame};a.prototype.setInterval=function(b){this._interval=b};a.prototype.getIsPlaying=function(){return this._isPlaying};return a}(c.DisplayObjectContainer);c.MovieClip=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this)}__extends(a,d);a.prototype.getText=function(){return this.inputElement.value};a.prototype.setText=function(b){this.inputElement.value=b};a.prototype.setTextType=function(b){this.inputElement.type=b};a.prototype.getTextType=function(){return this.inputElement.type};a.prototype.open=function(b,a,d,e){"undefined"===typeof d&&(d=160);"undefined"===typeof e&&(e=21);var g=c.StageDelegate.getInstance().getScaleX(),k=c.StageDelegate.getInstance().getScaleY(), l=document.createElement("input");l.type="text";l.style.fontSize="20px";l.style.color="#FFFFFF";l.style.borderStyle="none";l.style.background="none";l.style.width=d*g+"px";l.style.height=e*k+"px";l.style.outline="medium";var n=c.Browser.getInstance().$new("div");n.style.position="absolute";n.position.x=b*g;n.style.width=d*g+"px";n.style.height=e*k+"px";n.position.y=a*k;n.transforms();n.appendChild(l);b=c.Browser.getInstance().$("#StageDelegateDiv");b||(d=document.getElementById(c.StageDelegate.canvas_div_name), e=d.clientHeight,d=d.clientWidth,b=c.Browser.getInstance().$new("div"),b.id="StageDelegateDiv",b.style.position="absolute",b.style.width=d+"px",b.style.maxHeight=e+"px",b.style.margin="0px",document.getElementById(c.StageDelegate.canvas_div_name).appendChild(b),b.position.y=-e,b.transforms());b.appendChild(n);this.div=n;this.inputElement=l};a.prototype.remove=function(){var b=this.div;b&&b.parentNode&&b.parentNode.removeChild(b)};return a}(c.HashObject);c.StageText=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this.renderCost=0;this.texture_scale_factor=1}__extends(a,d);a.prototype.clearScreen=function(){};a.prototype.clearRect=function(b,a,c,d){};a.prototype.drawImage=function(b,a,d,e,g,k,l,n,p){c.Profiler.getInstance().onDrawImage()};a.prototype.setTransform=function(b){};a.prototype.save=function(){};a.prototype.restore=function(){};a.prototype.setAlpha=function(b,a){};a.prototype.setupFont=function(b,a,c){};a.prototype.measureText=function(b){return 0}; a.prototype.drawText=function(b,a,d,e,g){c.Profiler.getInstance().onDrawImage()};a.prototype.clip=function(b,a,c,d){};a.prototype.strokeRect=function(b,a,c,d,e){};return a}(c.HashObject);c.RendererContext=e;e=function(){function d(a){this.type=a;switch(a){case "add":case "layer":this.value="lighter";break;default:this.value="source-over"}}d.getBlendMode=function(a){return!a?c.BlendMode.NORMAL:c.BlendMode[a.toUpperCase()]};d.NORMAL=new d("normal");d.ADD=new d("add");d.LAYER=new d("layer");return d}(); c.BlendMode=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.MOUSE="mouse";c.TOUCH="touch";c.mode="touch";return c}();c.InteractionMode=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this._currentTouchTarget={};this.maxTouches=2;this.touchDownTarget={}}__extends(a,d);a.prototype.run=function(){};a.prototype.getTouchData=function(b,a,c){var d=this._currentTouchTarget[b];null==d&&(d={},this._currentTouchTarget[b]=d);d.stageX=a;d.stageY=c;d.identifier=b;return d};a.prototype.dispatchEvent=function(b,c){var d=c.target,e=a.touchEvent;e._type=b;e.touchPointID=c.identifier;e.touchDown=!0==this.touchDownTarget[c.identifier];e._stageX= c.stageX;e._stageY=c.stageY;d.dispatchEvent(e)};a.prototype.onTouchBegan=function(b,a,d){var e=c.MainContext.instance.stage.hitTest(b,a);e&&(b=this.getTouchData(d,b,a),this.touchDownTarget[d]=!0,b.target=e,b.beginTarget=e,this.dispatchEvent(c.TouchEvent.TOUCH_BEGAN,b))};a.prototype.onTouchMove=function(b,a,d){var e=c.MainContext.instance.stage.hitTest(b,a);e&&(b=this.getTouchData(d,b,a),b.target=e,this.dispatchEvent(c.TouchEvent.TOUCH_MOVE,b))};a.prototype.onTouchEnd=function(b,a,d){var e=c.MainContext.instance.stage.hitTest(b, a);e&&(b=this.getTouchData(d,b,a),delete this.touchDownTarget[d],d=b.beginTarget,b.target=e,this.dispatchEvent(c.TouchEvent.TOUCH_END,b),d==e?this.dispatchEvent(c.TouchEvent.TOUCH_TAP,b):b.beginTarget&&(b.target=b.beginTarget,this.dispatchEvent(c.TouchEvent.TOUCH_RELEASE_OUTSIDE,b)),delete this._currentTouchTarget[b.identifier])};a.touchEvent=new c.TouchEvent("");return a}(c.HashObject);c.TouchContext=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function d(){this.textureCache=c.TextureCache.getInstance()}d.prototype.load=function(a,b,c){};d.prototype.createLoadingController=function(){return null};d.prototype.getAssets=function(a){return null};d.prototype.getTexture=function(a){return this.textureCache.getTexture(a)};return d}();c.AssetsContext=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(b,c){d.call(this);this.type=this.url=null;this.state=a.LOAD_STATE_INIT;this.fixedUrl=this.data=null;this.preFixUrl="";this.url=b;var e=b.indexOf("?");this.fixedUrl=-1this._currentIndex)this._currentResource=this._resourceUrlList[this._currentIndex],this._currentIndex++,this._currentResource.addEventListener(c.ResourceLoader.LOAD_COMPLETE,this.next,this),this._currentResource.load();else this.onComplete()};a.prototype.removeResourceEvent=function(){this._currentResource&&(this._currentResource.removeEventListener(c.ResourceLoader.LOAD_COMPLETE,this.next, this),this._currentResource=null)};a.prototype.onProgress=function(){if(null!=this._loadingView)this._loadingView.onProgress(this._currentIndex,this._resourceUrlList.length)};a.prototype.setLoadingView=function(b){null!=this._loadingView&&(this._loadingView.removeFromStage(),this._loadingView=null);this._loadingView=b};a.prototype.destroy=function(){this.removeResourceEvent();null!=this._loadingView&&(this._loadingView.removeFromStage(),this._loadingView=null);this._resourceUrlList=null};a.LOAD_STATE_IDLE= 0;a.LOAD_STATE_LOADING=1;return a}(c.EventDispatcher);c.LoadingController=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.apply(this,arguments);this._textureHeight=this._textureWidth=this.offsetY=this.offsetX=0}__extends(a,d);Object.defineProperty(a.prototype,"bitmapData",{get:function(){return this._bitmapData},set:function(b){var a=c.MainContext.instance.rendererContext.texture_scale_factor;this._bitmapData=b;this._textureWidth=b.width*a;this._textureHeight=b.height*a},enumerable:!0,configurable:!0});a.prototype.getTextureWidth=function(){return this._textureWidth};a.prototype.getTextureHeight= function(){return this._textureHeight};a.create=function(b){var c=new a;c._path=b;return c};a.createWithBase64=function(b){var c=new a,d=new Image;d.src=b;c.bitmapData=d;return c};return a}(c.HashObject);c.Texture=e;e=function(d){function a(){d.call(this);this.cacheCanvas=document.createElement("canvas")}__extends(a,d);a.prototype.drawToTexture=function(b){var a=this.cacheCanvas,d=b.getBounds();a.width=d.width;a.height=d.height;b.worldTransform.identity();b.worldAlpha=1;if(b instanceof c.DisplayObjectContainer){this.offsetX= d.x;this.offsetY=d.y;b.worldTransform.append(1,0,0,1,-d.x,-d.y);for(var d=b._children,e=0,g=d.length;ea&&(a=0);b.scaleX=a};a.prototype.setChildScaleY=function(b,a){0>a&&(a=0);b.scaleY=a};return a}(c.DisplayObjectContainer);c.Scale9Bitmap=e})(ns_egret||(ns_egret={}));ns_egret.Codec={name:"Jacob__Codec"};ns_egret.Utils={};ns_egret.Utils.unzip=function(){return ns_egret.Codec.GZip.gunzip.apply(ns_egret.Codec.GZip,arguments)};ns_egret.Utils.unzipBase64=function(){var c=ns_egret.Codec.Base64.decode.apply(ns_egret.Codec.Base64,arguments);return ns_egret.Codec.GZip.gunzip.apply(ns_egret.Codec.GZip,[c])}; ns_egret.Utils.unzipBase64AsArray=function(c,e){e=e||1;var d=this.unzipBase64(c),a=[],b,f,m;b=0;for(m=d.length/e;b>4,a=(a&15)<<4|f>>2,b=(f&3)<<6|m,e.push(String.fromCharCode(d)),64!=f&&e.push(String.fromCharCode(a)),64!=m&&e.push(String.fromCharCode(b));return e=e.join("")}; ns_egret.Codec.Base64.decodeAsArray=function(c,e){var d=this.decode(c),a=[],b,f,m;b=0;for(m=d.length/e;b>=1;0==this.bb&&(this.bb=this.readByte(),c=this.bb&1,this.bb=this.bb>>1|128);return c};ns_egret.Codec.GZip.prototype.readBits=function(c){for(var e=0,d=c;d--;)e=e<<1|this.readBit();c&&(e=ns_egret.Codec.GZip.bitReverse[e]>>8-c);return e};ns_egret.Codec.GZip.prototype.flushBuffer=function(){this.bIdx=0}; ns_egret.Codec.GZip.prototype.addBuffer=function(c){this.buf32k[this.bIdx++]=c;this.outputArr.push(String.fromCharCode(c));32768==this.bIdx&&(this.bIdx=0)};ns_egret.Codec.GZip.prototype.IsPat=function(){for(;;){if(this.fpos[this.len]>=this.fmax)return-1;if(this.flens[this.fpos[this.len]]==this.len)return this.fpos[this.len]++;this.fpos[this.len]++}}; ns_egret.Codec.GZip.prototype.Rec=function(){var c=this.Places[this.treepos],e;if(17==this.len)return-1;this.treepos++;this.len++;e=this.IsPat();if(0<=e)c.b0=e;else if(c.b0=32768,this.Rec())return-1;e=this.IsPat();if(0<=e)c.b1=e,c.jump=null;else if(c.b1=32768,c.jump=this.Places[this.treepos],c.jumppos=this.treepos,this.Rec())return-1;this.len--;return 0}; ns_egret.Codec.GZip.prototype.CreateTree=function(c,e,d,a){this.Places=c;this.treepos=0;this.flens=d;this.fmax=e;for(c=0;17>c;c++)this.fpos[c]=0;this.len=0;return this.Rec()?-1:0};ns_egret.Codec.GZip.prototype.DecodeValue=function(c){for(var e,d,a=0,b=c[a];;)if(e=this.readBit()){if(!(b.b1&32768))return b.b1;b=b.jump;e=c.length;for(d=0;d>1,23d)this.addBuffer(d); else if(256==d)break;else{var f;d-=257;b=this.readBits(ns_egret.Codec.GZip.cplext[d])+ns_egret.Codec.GZip.cplens[d];d=ns_egret.Codec.GZip.bitReverse[this.readBits(5)]>>3;8d;d++)m[d]=0;for(d=0;dd)m[a++]=d;else if(16==d){var g;d=3+this.readBits(2);if(a+d>b)return this.flushBuffer(),1;for(g=a?m[a-1]:0;d--;)m[a++]=g}else{d=17==d?3+this.readBits(3): 11+this.readBits(7);if(a+d>b)return this.flushBuffer(),1;for(;d--;)m[a++]=0}b=this.literalTree.length;for(a=0;a>>0}a=1;c=0;for(var f=b.length,d,e=0;0>>0}function a(b,a){this.index="number"===typeof a? a:0;this.i=0;this.buffer=b instanceof(z?Uint8Array:Array)?b:new (z?Uint8Array:Array)(32768);2*this.buffer.length<=this.index&&c(Error("invalid index"));this.buffer.length<=this.index&&this.f()}function b(b){this.buffer=new (z?Uint16Array:Array)(2*b);this.length=0}function f(b){var a=b.length,c=0,f=Number.POSITIVE_INFINITY,d,e,m,h,t,g,O,s,y;for(s=0;sc&&(c=b[s]),b[s]>=1;for(y=g;y=b:return[265,b-11,1];case 14>=b:return[266,b-13,1];case 16>=b:return[267,b-15,1];case 18>=b:return[268,b-17,1];case 22>=b:return[269,b-19,2];case 26>=b:return[270,b-23,2];case 30>=b:return[271,b-27,2];case 34>=b:return[272,b-31,2];case 42>=b:return[273,b-35,3];case 50>= b:return[274,b-43,3];case 58>=b:return[275,b-51,3];case 66>=b:return[276,b-59,3];case 82>=b:return[277,b-67,4];case 98>=b:return[278,b-83,4];case 114>=b:return[279,b-99,4];case 130>=b:return[280,b-115,4];case 162>=b:return[281,b-131,5];case 194>=b:return[282,b-163,5];case 226>=b:return[283,b-195,5];case 257>=b:return[284,b-227,5];case 258===b:return[285,b-258,0];default:c("invalid length: "+b)}}function k(b,a){function f(b,a){var d=b.G,e=[],m=0,h;h=M[b.length];e[m++]=h&65535;e[m++]=h>>16&255;e[m++]= h>>24;var t;switch(C){case 1===d:t=[0,d-1,0];break;case 2===d:t=[1,d-2,0];break;case 3===d:t=[2,d-3,0];break;case 4===d:t=[3,d-4,0];break;case 6>=d:t=[4,d-5,1];break;case 8>=d:t=[5,d-7,1];break;case 12>=d:t=[6,d-9,2];break;case 16>=d:t=[7,d-13,2];break;case 24>=d:t=[8,d-17,3];break;case 32>=d:t=[9,d-25,3];break;case 48>=d:t=[10,d-33,4];break;case 64>=d:t=[11,d-49,4];break;case 96>=d:t=[12,d-65,5];break;case 128>=d:t=[13,d-97,5];break;case 192>=d:t=[14,d-129,6];break;case 256>=d:t=[15,d-193,6];break; case 384>=d:t=[16,d-257,7];break;case 512>=d:t=[17,d-385,7];break;case 768>=d:t=[18,d-513,8];break;case 1024>=d:t=[19,d-769,8];break;case 1536>=d:t=[20,d-1025,9];break;case 2048>=d:t=[21,d-1537,9];break;case 3072>=d:t=[22,d-2049,10];break;case 4096>=d:t=[23,d-3073,10];break;case 6144>=d:t=[24,d-4097,11];break;case 8192>=d:t=[25,d-6145,11];break;case 12288>=d:t=[26,d-8193,12];break;case 16384>=d:t=[27,d-12289,12];break;case 24576>=d:t=[28,d-16385,13];break;case 32768>=d:t=[29,d-24577,13];break;default:c("invalid distance")}h= t;e[m++]=h[0];e[m++]=h[1];e[m++]=h[2];d=0;for(m=e.length;d=m;)Q[m++]=0;for(m=0;29>=m;)w[m++]=0}Q[256]=1;d=0;for(e=a.length;d=e){s&&f(s,-1);m=0; for(t=e-d;mH&&d+Hq&&(g=t,q=H);if(258===H)break}t=new h(q,d-g);s?s.length2*t[w-1]+e[w]&&(t[w]=2*t[w-1]+e[w]),g[w]=Array(t[w]),y[w]=Array(t[w]);for(k=0;kh[k]?(g[w][Q]=p,y[w][Q]=O,l+=2):(g[w][Q]=h[k], y[w][Q]=k,++k);r[w]=0;1===e[w]&&f(w)}h=s;t=0;for(g=d.length;t1<e&&c("undercommitted");m=0;for(h=b.length;m>>=1}return a}function p(b,a){this.input=b;this.a=new (z?Uint8Array:Array)(32768);this.h= L.j;var c={},f;if((a||!(a={}))&&"number"===typeof a.compressionType)this.h=a.compressionType;for(f in a)c[f]=a[f];c.outputBuffer=this.a;this.z=new m(this.input,c)}function q(b,a){this.k=[];this.l=32768;this.e=this.g=this.c=this.q=0;this.input=z?new Uint8Array(b):b;this.s=!1;this.m=P;this.B=!1;if(a||!(a={}))a.index&&(this.c=a.index),a.bufferSize&&(this.l=a.bufferSize),a.bufferType&&(this.m=a.bufferType),a.resize&&(this.B=a.resize);switch(this.m){case R:this.b=32768;this.a=new (z?Uint8Array:Array)(32768+ this.l+258);break;case P:this.b=0;this.a=new (z?Uint8Array:Array)(this.l);this.f=this.J;this.t=this.H;this.o=this.I;break;default:c(Error("invalid inflate mode"))}}function v(b,a){for(var f=b.g,d=b.e,e=b.input,m=b.c,h;d>>a;b.e=d-a;b.c=m;return f&(1<>>16;b.g=f>>h;b.e= d-h;b.c=m;return e&65535}function r(b){function a(b,c,f){var d,e,m,h;for(h=0;h>>8&255]<<16|E[b>>>16&255]<<8|E[b>>>24&255])>>32-a:E[b]>>8-a);if(8>a+e)m=m<>a-c-1&1,8===++e&&(e=0,f[d++]=E[m],m=0,d===f.length&&(f=this.f())); f[d]=m;this.buffer=f;this.i=e;this.index=d};a.prototype.finish=function(){var b=this.buffer,a=this.index,c;0J;++J){for(var B=J,K=B,I=7,B=B>>>1;B;B>>>=1)K<<=1,K|=B&1,--I;u[J]=(K<>>0}var E=u,u=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049, 498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275, 3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277, 2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143, 2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112, 2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746, 711928724,3020668471,3272380065,1510334235,755167117];z&&new Uint32Array(u);b.prototype.getParent=function(b){return 2*((b-2)/4|0)};b.prototype.push=function(b,a){var c,f,d=this.buffer,e;c=this.length;d[this.length++]=a;for(d[this.length++]=b;0d[f])e=d[c],d[c]=d[f],d[f]=e,e=d[c+1],d[c+1]=d[f+1],d[f+1]=e,c=f;else break;return this.length};b.prototype.pop=function(){var b,a,c=this.buffer,f,d,e;a=c[0];b=c[1];this.length-=2;c[0]=c[this.length];c[1]=c[this.length+1];for(e= 0;;){d=2*e+2;if(d>=this.length)break;d+2c[d]&&(d+=2);if(c[d]>c[e])f=c[e],c[e]=c[d],c[d]=f,f=c[e+1],c[e+1]=c[d+1],c[d+1]=f;else break;e=d}return{index:b,value:a,length:this.length}};var s=2,u={NONE:0,r:1,j:s,N:3},w=[];for(J=0;288>J;J++)switch(C){case 143>=J:w.push([J+48,8]);break;case 255>=J:w.push([J-144+400,9]);break;case 279>=J:w.push([J-256+0,7]);break;case 287>=J:w.push([J-280+192,8]);break;default:c("invalid literal: "+J)}m.prototype.n=function(){var b,f,d,e,m=this.input; switch(this.h){case 0:d=0;for(e=m.length;d>>8&255;O[y++]=g&255;O[y++]=g>>>8&255;if(z)O.set(f,y),y+=f.length,O=O.subarray(0,y);else{t=0;for(g=f.length;tv)for(;0v?v:138,D>v-3&&D=D?(P[L++]=17,P[L++]=D-3,H[17]++):(P[L++]=18,P[L++]=D-11,H[18]++),v-=D;else if(P[L++]= b[N],H[b[N]]++,v--,3>v)for(;0v?v:6,D>v-3&&DN;N++)t[N]=H[q[N]];for(p=19;4=G;G++)B=g(),J[G]=B[2]<<24|B[1]<<16|B[0];var M=z?new Uint32Array(J):J,L=u;p.prototype.n=function(){var b,a,f,e,m=0;e=this.a;b=S;switch(b){case S:a=Math.LOG2E*Math.log(32768)-8;break;default:c(Error("invalid compression method"))}a= a<<4|b;e[m++]=a;switch(b){case S:switch(this.h){case L.NONE:f=0;break;case L.r:f=1;break;case L.j:f=2;break;default:c(Error("unsupported compression type"))}break;default:c(Error("invalid compression method"))}b=f<<6|0;e[m++]=b|31-(256*a+b)%31;b=d(this.input);this.z.b=m;e=this.z.n();m=e.length;z&&(e=new Uint8Array(e.buffer),e.length<=m+4&&(this.a=new Uint8Array(e.length+4),this.a.set(e),e=this.a),e=e.subarray(0,m+4));e[m++]=b>>24&255;e[m++]=b>>16&255;e[m++]=b>>8&255;e[m++]=b&255;return e};e("Zlib.Deflate", p);e("Zlib.Deflate.compress",function(b,a){return(new p(b,a)).n()});e("Zlib.Deflate.CompressionType",L);e("Zlib.Deflate.CompressionType.NONE",L.NONE);e("Zlib.Deflate.CompressionType.FIXED",L.r);e("Zlib.Deflate.CompressionType.DYNAMIC",L.j);var R=0,P=1,u={D:R,C:P};q.prototype.p=function(){for(;!this.s;){var b=v(this,3);b&1&&(this.s=C);b>>>=1;switch(b){case 0:var b=this.input,a=this.c,f=this.a,d=this.b,e=x,m=x,h=x,t=f.length,e=x;this.e=this.g=0;e=b[a++];e===x&&c(Error("invalid uncompressed block header: LEN (first byte)")); m=e;e=b[a++];e===x&&c(Error("invalid uncompressed block header: LEN (second byte)"));m|=e<<8;e=b[a++];e===x&&c(Error("invalid uncompressed block header: NLEN (first byte)"));h=e;e=b[a++];e===x&&c(Error("invalid uncompressed block header: NLEN (second byte)"));h|=e<<8;m===~h&&c(Error("invalid uncompressed block header: length verify"));a+m>b.length&&c(Error("input buffer is broken"));switch(this.m){case R:for(;d+m>f.length;){e=t-d;m-=e;if(z)f.set(b.subarray(a,a+e),d),d+=e,a+=e;else for(;e--;)f[d++]= b[a++];this.b=d;f=this.f();d=this.b}break;case P:for(;d+m>f.length;)f=this.f({v:2});break;default:c(Error("invalid inflate mode"))}if(z)f.set(b.subarray(a,a+m),d),d+=m,a+=m;else for(;m--;)f[d++]=b[a++];this.c=a;this.b=d;this.a=f;break;case 1:this.o(N,T);break;case 2:r(this);break;default:c(Error("unknown BTYPE: "+b))}}return this.t()};J=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var t=z?new Uint16Array(J):J;J=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227, 258,258,258];var y=z?new Uint16Array(J):J;J=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0];var H=z?new Uint8Array(J):J;J=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];var O=z?new Uint16Array(J):J;J=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var Q=z?new Uint8Array(J):J;J=new (z?Uint8Array:Array)(288);B=0;for(K=J.length;B=B?8:255>=B?9:279>=B?7:8;var N=f(J);J=new (z?Uint8Array: Array)(30);B=0;for(K=J.length;Be)f>=d&&(this.b=f,c=this.f(),f=this.b),c[f++]=e;else{e-=257;h=y[e];0=d&&(this.b=f,c=this.f(),f=this.b);h--;)c[f]=c[f++-m]}for(;8<=this.e;)this.e-=8,this.c--;this.b=f};q.prototype.I=function(b,a){var c=this.a,f=this.b;this.u=b;for(var d=c.length,e,m,h;256!== (e=F(this,b));)if(256>e)f>=d&&(c=this.f(),d=c.length),c[f++]=e;else{e-=257;h=y[e];0d&&(c=this.f(),d=c.length);h--;)c[f]=c[f++-m]}for(;8<=this.e;)this.e-=8,this.c--;this.b=f};q.prototype.f=function(){var b=new (z?Uint8Array:Array)(this.b-32768),a=this.b-32768,c,f,d=this.a;if(z)b.set(d.subarray(32768,b.length));else{c=0;for(f=b.length;cc;++c)d[c]=d[a+c];this.b=32768;return d};q.prototype.J=function(b){var a,c=this.input.length/this.c+1|0,f,d,e,m=this.input,h=this.a;b&&("number"===typeof b.v&&(c=b.v),"number"===typeof b.F&&(c+=b.F));2>c?(f=(m.length-this.c)/this.u[2],e=258*(f/2)|0,d=ea&&(this.a.length=a),b=this.a);return this.buffer=b};D.prototype.p=function(){var b=this.input,a,f;a=this.A.p();this.c=this.A.c;this.M&&(f=(b[this.c++]<<24|b[this.c++]<< 16|b[this.c++]<<8|b[this.c++])>>>0,f!==d(a)&&c(Error("invalid adler-32 checksum")));return a};e("Zlib.Inflate",D);e("Zlib.Inflate.BufferType",u);u.ADAPTIVE=u.C;u.BLOCK=u.D;e("Zlib.Inflate.prototype.decompress",D.prototype.p);u=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];z&&new Uint16Array(u);u=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258];z&&new Uint16Array(u);u=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0];z&&new Uint8Array(u); u=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];z&&new Uint16Array(u);u=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];z&&new Uint8Array(u);u=new (z?Uint8Array:Array)(288);J=0;for(B=u.length;J=J?8:255>=J?9:279>=J?7:8;f(u);u=new (z?Uint8Array:Array)(30);J=0;for(B=u.length;Jb&&(b=0);var c=b,d=!1;c>=this.duration&&(this.loop?c%=this.duration:(c=this.duration,d=!0));if(c==this._prevPos)return d;var e=this._prevPos;this.position=this._prevPos=c;this._prevPosition=b;if(this._target)if(d)this._updateTargetProps(null, 1);else if(0c);k++);k=this._steps[k-1];this._updateTargetProps(k,(this._stepPosition=c-k.t)/k.d)}0!=a&&0a&&(d=a,e=b,k=l,l=n=-1);for(;(k+=n)!=l;){a=this._actions[k];var p=a.t;(p==e||p>d&&p=b)return this;var c=this._cloneProps(this._curQueueProps);return this._addStep({d:b,p0:c,p1:c,v:a})};a.prototype.to=function(b,a,c){"undefined"===typeof c&&(c=void 0);if(isNaN(a)||0>a)a=0;return this._addStep({d:a||0,p0:this._cloneProps(this._curQueueProps),e:c,p1:this._cloneProps(this._appendQueueProps(b))})};a.prototype.call=function(b,a,c){"undefined"===typeof a&&(a=void 0);"undefined"===typeof c&& (c=void 0);return this._addAction({f:b,p:c?c:[this],o:a?a:this._target})};a.prototype.set=function(b,a){"undefined"===typeof a&&(a=null);return this._addAction({f:this._set,o:this,p:[b,a?a:this._target]})};a.prototype.play=function(b){b||(b=this);return this.call(b.setPaused,[!1],b)};a.prototype.pause=function(b){b||(b=this);return this.call(b.setPaused,[!0],b)};a.prototype.tick=function(b){this.paused||this.setPosition(this._prevPosition+b)};a.NONE=0;a.LOOP=1;a.REVERSE=2;a._tweens=[];a.IGNORE={}; a._plugins={};a._inited=!1;return a}(c.EventDispatcher);c.Tween=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function d(){c.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")}d.get=function(a){-1>a&&(a=-1);1a?b*(b*-a+1+a):b*((2-b)*a+(1-a))}};d.getPowIn=function(a){return function(b){return Math.pow(b,a)}};d.getPowOut=function(a){return function(b){return 1-Math.pow(1-b,a)}};d.getPowInOut=function(a){return function(b){return 1>(b*=2)?0.5*Math.pow(b,a):1-0.5*Math.abs(Math.pow(2-b,a))}};d.sineIn=function(a){return 1-Math.cos(a* Math.PI/2)};d.sineOut=function(a){return Math.sin(a*Math.PI/2)};d.sineInOut=function(a){return-0.5*(Math.cos(Math.PI*a)-1)};d.getBackIn=function(a){return function(b){return b*b*((a+1)*b-a)}};d.getBackOut=function(a){return function(b){b-=1;return b*b*((a+1)*b+a)+1}};d.getBackInOut=function(a){a*=1.525;return function(b){return 1>(b*=2)?0.5*b*b*((a+1)*b-a):0.5*((b-=2)*b*((a+1)*b+a)+2)}};d.circIn=function(a){return-(Math.sqrt(1-a*a)-1)};d.circOut=function(a){return Math.sqrt(1-a*a)};d.circInOut=function(a){return 1> (a*=2)?-0.5*(Math.sqrt(1-a*a)-1):0.5*(Math.sqrt(1-(a-=2)*a)+1)};d.bounceIn=function(a){return 1-d.bounceOut(1-a)};d.bounceOut=function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+0.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+0.9375:7.5625*(a-=2.625/2.75)*a+0.984375};d.bounceInOut=function(a){return 0.5>a?0.5*d.bounceIn(2*a):0.5*d.bounceOut(2*a-1)+0.5};d.getElasticIn=function(a,b){var c=2*Math.PI;return function(d){if(0==d||1==d)return d;var e=b/c*Math.asin(1/a);return-(a*Math.pow(2,10* (d-=1))*Math.sin((d-e)*c/b))}};d.getElasticOut=function(a,b){var c=2*Math.PI;return function(d){if(0==d||1==d)return d;var e=b/c*Math.asin(1/a);return a*Math.pow(2,-10*d)*Math.sin((d-e)*c/b)+1}};d.getElasticInOut=function(a,b){var c=2*Math.PI;return function(d){var e=b/c*Math.asin(1/a);return 1>(d*=2)?-0.5*a*Math.pow(2,10*(d-=1))*Math.sin((d-e)*c/b):0.5*a*Math.pow(2,-10*(d-=1))*Math.sin((d-e)*c/b)+1}};d.quadIn=d.getPowIn(2);d.quadOut=d.getPowOut(2);d.quadInOut=d.getPowInOut(2);d.cubicIn=d.getPowIn(3); d.cubicOut=d.getPowOut(3);d.cubicInOut=d.getPowInOut(3);d.quartIn=d.getPowIn(4);d.quartOut=d.getPowOut(4);d.quartInOut=d.getPowInOut(4);d.quintIn=d.getPowIn(5);d.quintOut=d.getPowOut(5);d.quintInOut=d.getPowInOut(5);d.backIn=d.getBackIn(1.7);d.backOut=d.getBackOut(1.7);d.backInOut=d.getBackInOut(1.7);d.elasticIn=d.getElasticIn(1,0.3);d.elasticOut=d.getElasticOut(1,0.3);d.elasticInOut=d.getElasticInOut(1,0.3*1.5);return d}();c.Ease=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(d){function a(){d.call(this)}__extends(a,d);a.getInstance=function(){return c.MainContext.instance.soundContext};a.prototype.preloadSound=function(b){};a.prototype.playMusic=function(b,a){};a.prototype.stopMusic=function(b){};a.isMusicPlaying=!1;return a}(c.HashObject);c.SoundContext=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.apply(this,arguments);this.viewPortWidth=400}__extends(a,d);a.createWithFile=function(b){var c=new a;c.initWithTMXFile(b);return c};a.prototype.initWithTMXFile=function(b){(!b||0==b.length)&&c.Logger.fatal("TMXTiledMap.initWithTMXFile(): tmxFile\u5e94\u8be5\u662f\u4e0d\u4e3anull\u7684string");var a=c.TMXMapInfo.createWithFile(b);if(a){var d=a.getTilesets();(!d||0===d.length)&&c.Logger.info("TMXTiledMap.initWithTMXFile(): Map\u6ca1\u6709",b);this.buildWithMapInfo(a)}}; a.prototype.buildWithMapInfo=function(b){this.mapInfo=b;var a=0,c=b.getLayers();if(c)for(var e=null,g=0,k=c.length;g>>0>=l.firstGid)return l}}c.Logger.warning("TMXLayer"+b.name+"\u6ca1\u6709tiles");return null};a.prototype.getLayer=function(b){(!b||0===b.length)&&c.Logger.fatal("TMXTiledMap.getLayer(): layerName\u5e94\u8be5\u662f\u4e0d\u4e3anull\u7684string");for(var a=this.numChildren,e=0;e-this.x+this.viewPortWidth?g.visible=!1:g.visible=!0}}else e=d.getBounds(),d.visible=d.x+e.width-d.anchorOffsetX<-this.x||d.x-d.anchorOffsetX>-this.x+this.viewPortWidth?!1:!0}};return a}(c.DisplayObjectContainer);c.TMXTiledMap=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.apply(this,arguments);this._properties=this._layerOrientation=this._tileSet=this._tiles=this._mapTileHeight=this._mapTileWidth=this._layerHeight=this._layerWidth=this._texture=null;this._layerName="";this._opacity=1;this._maxGID=this._minGID=null}__extends(a,d);a.create=function(b,c,d){var e=new a;e.initWithTilesetInfo(b,c,d);return e};a.prototype.initWithTilesetInfo=function(b,a,d){this._texture=c.TextureCache.getInstance().getTexture(b.sourceImage); this._layerName=a.name;this._layerWidth=a.layerWidth;this._layerHeight=a.layerHeight;this._tiles=a._tiles;this._minGID=a._minGID;this._maxGID=a._maxGID;this._opacity=a.opacity;this.setProperties(a.getProperties());this._tileSet=b;this._mapTileWidth=d.getTileWidth();this._mapTileHeight=d.getTileHeight();this._layerOrientation=d.getOrientation();b=this.calculateLayerOffset(a.layerX,a.layerY);this.x=b.x;this.y=b.y};a.prototype.calculateLayerOffset=function(b,a){var d=c.Point.identity;switch(this._layerOrientation){case c.TMX.ORIENTATION_ORTHO:d.x= b*this._mapTileWidth;d.y=-a*this._mapTileHeight;break;case c.TMX.ORIENTATION_ISO:d.x=this._mapTileWidth/2*(b-a);d.y=this._mapTileHeight/2*(-b-a);break;case c.TMX.ORIENTATION_HEX:(0!==b||0!==a)&&c.Logger.info("hexagonal map\u8fd8\u6ca1\u6709\u5b8c\u6210")}return d};a.prototype.setupTiles=function(){this._tileSet.imageWidth=this._texture._textureWidth;this._tileSet.imageHeight=this._texture._textureHeight;for(var b=this._layerHeight,a=this._layerWidth,d=0;d=this._tileSet.firstGid&&this._minGID>=this._tileSet.firstGid||c.Logger.warning("\u6bcf\u4e2alayer\u53ea\u652f\u63011\u4e2atileset")};a.prototype.appendTileForGID=function(b,a,c){var e=this._tileSet.rectForGID(b),e=this.reusedTileWithRect(e);this.setupTileSprite(e,a,c,b);d.prototype.addChild.call(this,e);return e};a.prototype.reusedTileWithRect=function(b){var a=c.Bitmap.initWithTexture(c.TextureCache.getInstance().getTexture(this._tileSet.sourceImage)), d=new c.SpriteSheetFrame;d.x=b.x;d.y=b.y;d.w=this._mapTileWidth;d.h=this._mapTileHeight;a.spriteFrame=d;return a};a.prototype.setupTileSprite=function(b,a,c,d){a=this.getPositionAt(a,c);b.x=a.x;b.y=a.y};a.prototype.getPositionAt=function(b,a){var d=c.Point.identity;switch(this._layerOrientation){case c.TMX.ORIENTATION_ORTHO:d=this.positionForOrthoAt(b,a);break;case c.TMX.ORIENTATION_ISO:d=this.positionForIsoAt(b,a);break;case c.TMX.ORIENTATION_HEX:d=this.positionForHexAt(b,a);break;default:d.x=0, d.y=0}return d};a.prototype.positionForIsoAt=function(b,a){c.Point.identity.x=this._mapTileWidth/2*(this._layerWidth+b-a-1);c.Point.identity.y=-this._mapTileHeight/2*(2*this._layerHeight-b-a-2);return c.Point.identity};a.prototype.positionForOrthoAt=function(b,a){c.Point.identity.x=b*this._mapTileWidth;c.Point.identity.y=-(this._layerHeight-a-1)*this._mapTileHeight;return c.Point.identity};a.prototype.positionForHexAt=function(b,a){var d=1==b%2?-this._mapTileHeight/2:0;c.Point.identity.x=3*b*this._mapTileWidth/ 4;c.Point.identity.y=-((this._layerHeight-a-1)*this._mapTileHeight+d);return c.Point.identity};a.prototype.getTileGIDAt=function(b,a){(b>=this._layerWidth||a>=this._layerHeight||0>b||0>a)&&c.Logger.fatal("TMXLayer.getTileGIDAt():\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");return!this._tiles?(c.Logger.info("TMXLayer.getTileGIDAt(): tileMap\u5df2\u7ecf\u88ab\u9500\u6bc1"),null):(this._tiles[0|b+a*this._layerWidth]&c.TMX.TILE_FLIPPED_MASK)>>>0};a.prototype.getProperties=function(){return this._properties}; a.prototype.setProperties=function(b){this._properties=b};a.prototype.getProperty=function(b){return this._properties[b]};a.prototype.getLayerName=function(){return this._layerName};return a}(c.DisplayObjectContainer);c.TMXLayer=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.TILE_HORIZONTAL_FLAG=2147483648;c.TILE_VERTICAL_FLAG=1073741824;c.TILE_DIAGONAL_FLAG=536870912;c.TILE_FLIPPED_ALL=(c.TILE_HORIZONTAL_FLAG|c.TILE_VERTICAL_FLAG|c.TILE_DIAGONAL_FLAG)>>>0;c.TILE_FLIPPED_MASK=~c.TILE_FLIPPED_ALL>>>0;c.LAYER_ATTRIB_NONE=1;c.LAYER_ATTRIB_BASE64=2;c.LAYER_ATTRIB_GZIP=4;c.LAYER_ATTRIB_ZLIB=8;c.PROPERTY_NONE=0;c.PROPERTY_MAP=1;c.PROPERTY_LAYER=2;c.PROPERTY_OBJECTGROUP=3;c.PROPERTY_OBJECT=4;c.PROPERTY_TILE=5;c.ORIENTATION_ORTHO= 0;c.ORIENTATION_HEX=1;c.ORIENTATION_ISO=2;return c}();c.TMX=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function f(){this._parentGID=this._objectGroups=this._tileSets=this._layers=this._tileHeight=this._tileWidth=this._mapHeight=this._mapWidth=this._orientation=null;this._storingCharacters=!1;this._tileProperties=this._currentString=this._TMXFileName=this._properties=null}f.createWithFile=function(b){var a=new f;a.initWithTMXFile(b);return a};f.prototype.initWithTMXFile=function(b){this.internalInit(b);this.parseXMLFile(this._TMXFileName)};f.prototype.internalInit=function(b){this._tileSets= [];this._layers=[];this._TMXFileName=b;this._objectGroups=[];this._properties=[];this._tileProperties=[];this._currentString="";this._storingCharacters=!1};f.prototype.parseXMLFile=function(f){var e=c.ResourceLoader.create(f).data;null==e&&c.Logger.fatal("tmx\u6587\u4ef6\u6ca1\u6709\u52a0\u8f7d\uff1a"+f);var g;f=c.SAXParser.getInstance().tmxParse(e,!0).documentElement;f.getAttribute("version");e=f.getAttribute("orientation");if("map"==f.nodeName&&("orthogonal"==e?this.setOrientation(c.TMX.ORIENTATION_ORTHO): "isometric"==e?this.setOrientation(c.TMX.ORIENTATION_ISO):"hexagonal"==e?this.setOrientation(c.TMX.ORIENTATION_HEX):null!==e&&c.Logger.info("TMXFomat: Unsupported orientation:"+this.getOrientation()),this._mapWidth=parseFloat(f.getAttribute("width")),this._mapHeight=parseFloat(f.getAttribute("height")),this._tileWidth=parseFloat(f.getAttribute("tilewidth")),this._tileHeight=parseFloat(f.getAttribute("tileheight")),g=f.querySelectorAll("map \x3e properties \x3e property"))){for(var k={},e=0;eb||b>=this._source.length)throw new RangeError('\u7d22\u5f15:"'+b+'"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4');};Object.defineProperty(a.prototype,"length",{get:function(){return this._source.length},enumerable:!0,configurable:!0});a.prototype.addItem=function(b){this._source.push(b);this.dispatchCoEvent(c.CollectionEventKind.ADD,this._source.length-1,-1,[b])};a.prototype.addItemAt=function(b,a){if(0>a||a>this._source.length)throw new RangeError('\u7d22\u5f15:"'+ a+'"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4');this._source.splice(a,0,b);this.dispatchCoEvent(c.CollectionEventKind.ADD,a,-1,[b])};a.prototype.getItemAt=function(b){return this._source[b]};a.prototype.getItemIndex=function(b){for(var a=this._source.length,c=0;c=c?this.addItemAt(b[d],d):this.replaceItemAt(b[d],d);this._source=b};a.prototype.moveItemAt=function(b,a){this.checkIndex(b);this.checkIndex(a);var d=this._source.splice(b,1)[0];this._source.splice(a,0,d);this.dispatchCoEvent(c.CollectionEventKind.MOVE,a,b,[d]);return d};a.prototype.dispatchCoEvent=function(b,d,e,h,g){"undefined"===typeof b&&(b=null);"undefined"===typeof d&&(d=-1);"undefined"===typeof e&&(e=-1);"undefined"===typeof h&&(h=null);"undefined"=== typeof g&&(g=null);var k=a.coEventRecycler,l=k.pop();l||(l=new c.CollectionEvent(c.CollectionEvent.COLLECTION_CHANGE));l.kind=b;l.location=d;l.oldLocation=e;l.items=h;l.oldItems=g;this.dispatchEvent(l);k.push(l)};a.coEventRecycler=new c.Recycler;return a}(c.EventDispatcher);c.ArrayCollection=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(b,a){"undefined"===typeof b&&(b="children");"undefined"===typeof a&&(a="parent");d.call(this);this.nodeList=[];this._openNodes=[];this._showRoot=!1;this.childrenKey=b;this.parentKey=a}__extends(a,d);Object.defineProperty(a.prototype,"source",{get:function(){return this._source},set:function(b){this._source=b;this._openNodes=[];this.nodeList=[];this._source&&(this._showRoot?this.nodeList.push(this._source):(this._openNodes=[this._source],this.addChildren(this._source, this.nodeList)));this.dispatchCoEvent(c.CollectionEventKind.RESET)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"openNodes",{get:function(){return this._openNodes.concat()},set:function(b){this._openNodes=b?b.concat():[];this.refresh()},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"length",{get:function(){return this.nodeList.length},enumerable:!0,configurable:!0});a.prototype.getItemAt=function(b){return this.nodeList[b]};a.prototype.getItemIndex=function(b){for(var a= this.nodeList.length,c=0;cb++;)this.doPhasedInstantiationCallBack()};a.prototype.validateClient=function(b,a){"undefined"===typeof a&&(a=!1); var d,e=!1,g=this.targetLevel;this.targetLevel==Number.MAX_VALUE&&(this.targetLevel=b.nestLevel);for(;!e;){e=!0;for(d=this.invalidatePropertiesQueue.removeSmallestChild(b);d;)d.parent&&(d.validateProperties(),d.updateCompletePendingFlag||(this.updateCompleteQueue.insert(d),d.updateCompletePendingFlag=!0)),d=this.invalidatePropertiesQueue.removeSmallestChild(b);this.invalidatePropertiesQueue.isEmpty()&&(this.invalidatePropertiesFlag=!1);this.invalidateClientPropertiesFlag=!1;for(d=this.invalidateSizeQueue.removeLargestChild(b);d;){d.parent&& (d.validateSize(),d.updateCompletePendingFlag||(this.updateCompleteQueue.insert(d),d.updateCompletePendingFlag=!0));if(this.invalidateClientPropertiesFlag&&(d=this.invalidatePropertiesQueue.removeSmallestChild(b))){this.invalidatePropertiesQueue.insert(d);e=!1;break}d=this.invalidateSizeQueue.removeLargestChild(b)}this.invalidateSizeQueue.isEmpty()&&(this.invalidateSizeFlag=!1);this.invalidateClientSizeFlag=this.invalidateClientPropertiesFlag=!1;if(!a){for(d=this.invalidateDisplayListQueue.removeSmallestChild(b);d;){d.parent&& (d.validateDisplayList(),d.updateCompletePendingFlag||(this.updateCompleteQueue.insert(d),d.updateCompletePendingFlag=!0));if(this.invalidateClientPropertiesFlag&&(d=this.invalidatePropertiesQueue.removeSmallestChild(b))){this.invalidatePropertiesQueue.insert(d);e=!1;break}if(this.invalidateClientSizeFlag&&(d=this.invalidateSizeQueue.removeLargestChild(b))){this.invalidateSizeQueue.insert(d);e=!1;break}d=this.invalidateDisplayListQueue.removeSmallestChild(b)}this.invalidateDisplayListQueue.isEmpty()&& (this.invalidateDisplayListFlag=!1)}}if(g==Number.MAX_VALUE&&(this.targetLevel=Number.MAX_VALUE,!a))for(d=this.updateCompleteQueue.removeLargestChild(b);d;)d.initialized||(d.initialized=!0),d.hasEventListener(c.UIEvent.UPDATE_COMPLETE)&&d.dispatchEvent(new c.UIEvent(c.UIEvent.UPDATE_COMPLETE)),d.updateCompletePendingFlag=!1,d=this.updateCompleteQueue.removeLargestChild(b)};return a}(c.EventDispatcher);c.LayoutManager=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function a(){this.depthBins=[];this.minDepth=0;this.maxDepth=-1}a.prototype.insert=function(b){var a=b.nestLevel,c=b.hashCode;this.maxDepththis.maxDepth&&(this.maxDepth=a));var e=this.depthBins[a];e?null==e.items[c]&&(e.items[c]=b,e.length++):(e=new d,this.depthBins[a]=e,e.items[c]=b,e.length++)};a.prototype.pop=function(){var b=null;if(this.minDepth<=this.maxDepth){for(var a=this.depthBins[this.maxDepth];!a|| 0==a.length;){this.maxDepth--;if(this.maxDepththis.maxDepth)return null;a=this.depthBins[this.minDepth]}var c= a.items,d;for(d in c){b=c[d];this.remove(b,this.minDepth);break}for(;!a||0==a.length;){this.minDepth++;if(this.minDepth>this.maxDepth)break;a=this.depthBins[this.minDepth]}}return b};a.prototype.removeLargestChild=function(b){for(var a=this.maxDepth,d=b.nestLevel,e=b.hashCode;d<=a;){var g=this.depthBins[a];if(g&&0this.maxDepth)break}return null};a.prototype.remove=function(b,a){"undefined"===typeof a&&(a=-1);var c=b.hashCode,d=this.depthBins[0<=a?a:b.nestLevel];return d&&null!=d.items[c]?(delete d.items[c],d.length--,b):null};a.prototype.removeAll=function(){this.minDepth=this.depthBins.length=0;this.maxDepth=-1};a.prototype.isEmpty=function(){return this.minDepth>this.maxDepth};return a}();c.DepthQueue=e;var d=function(){return function(){this.length=0;this.items=[]}}();c.DepthBin=d})(ns_egret||(ns_egret= {}));(function(c){var e=function(){function d(){}Object.defineProperty(d,"stage",{get:function(){return d._stage},enumerable:!0,configurable:!0});d.initlize=function(a){d.initlized||(d._stage=a,d.layoutManager=new c.LayoutManager,d.initlized=!0)};Object.defineProperty(d,"systemManager",{get:function(){return this._systemManager},enumerable:!0,configurable:!0});d.useUpdateAfterEvent=!0;d.initlized=!1;return d}();c.UIGlobals=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this.initializeCalled=this._initialized=this._updateCompletePendingFlag=!1;this._nestLevel=0;this._enabled=!0;this._minWidth=0;this._maxWidth=1E4;this._minHeight=0;this._maxHeight=1E4;this._measuredHeight=this._measuredWidth=0;this.validateNowFlag=this.invalidateDisplayListFlag=this.invalidateSizeFlag=this.invalidatePropertiesFlag=!1;this._includeInLayout=!0;this.layoutHeightExplicitlySet=this.layoutWidthExplicitlySet=!1;this.touchEnabled=!0; this.addEventListener(c.Event.ADDED_TO_STAGE,this.onAddedToStage,this);this.addEventListener(c.Event.ADDED_TO_STAGE,this.checkInvalidateFlag,this)}__extends(a,d);a.prototype.onAddedToStage=function(b){this.removeEventListener(c.Event.ADDED_TO_STAGE,this.onAddedToStage,this);this.initialize();c.UIGlobals.initlize(this.stage);0this.maxWidth&&(this.measuredWidth=this.maxWidth),this.measuredHeightthis.maxHeight&&(this.measuredHeight=this.maxHeight));if(isNaN(this.oldPreferWidth))this.oldPreferWidth=this.preferredWidth,this.oldPreferHeight=this.preferredHeight,b=!0;else{if(this.preferredWidth!=this.oldPreferWidth||this.preferredHeight!=this.oldPreferHeight)b=!0;this.oldPreferWidth=this.preferredWidth;this.oldPreferHeight=this.preferredHeight}return b}; a.prototype.invalidateDisplayList=function(){this.invalidateDisplayListFlag||(this.invalidateDisplayListFlag=!0,this.parent&&c.UIGlobals.layoutManager&&c.UIGlobals.layoutManager.invalidateDisplayList(this))};a.prototype.validateDisplayList=function(){if(this.invalidateDisplayListFlag){var b=0,a=0,b=this.layoutWidthExplicitlySet?this._width:isNaN(this.explicitWidth)?this.measuredWidth:this._explicitWidth,a=this.layoutHeightExplicitlySet?this._height:isNaN(this.explicitHeight)?this.measuredHeight:this._explicitHeight; isNaN(b)&&(b=0);isNaN(a)&&(a=0);this.setActualSize(b,a);this.updateDisplayList(b,a);this.invalidateDisplayListFlag=!1}};a.prototype.validateNow=function(b){"undefined"===typeof b&&(b=!1);!this.validateNowFlag&&null!=c.UIGlobals.layoutManager?c.UIGlobals.layoutManager.validateClient(this,b):this.validateNowFlag=!0};a.prototype.invalidateParentSizeAndDisplayList=function(){if(this.parent&&this._includeInLayout&&"invalidateSize"in this.parent){var b=this.parent;b.invalidateSize();b.invalidateDisplayList()}}; a.prototype.updateDisplayList=function(b,a){};a.prototype.canSkipMeasurement=function(){return!isNaN(this._explicitWidth)&&!isNaN(this._explicitHeight)};a.prototype.commitProperties=function(){(this.oldWidth!=this._width||this.oldHeight!=this._height)&&this.dispatchResizeEvent();(this.oldX!=this.x||this.oldY!=this.y)&&this.dispatchMoveEvent()};a.prototype.measure=function(){this._measuredWidth=this._measuredHeight=0};a.prototype.dispatchMoveEvent=function(){if(this.hasEventListener(c.MoveEvent.MOVE)){var b= new c.MoveEvent(c.MoveEvent.MOVE,this.oldX,this.oldY);this.dispatchEvent(b)}this.oldX=this.x;this.oldY=this.y};a.prototype.childXYChanged=function(){};a.prototype.dispatchResizeEvent=function(){if(this.hasEventListener(c.ResizeEvent.RESIZE)){var b=new c.ResizeEvent(c.ResizeEvent.RESIZE,this.oldWidth,this.oldHeight);this.dispatchEvent(b)}this.oldWidth=this._width;this.oldHeight=this._height};a.prototype.dispatchPropertyChangeEvent=function(b,a,d){this.hasEventListener("propertyChange")&&this.dispatchEvent(c.PropertyChangeEvent.createUpdateEvent(this, b,a,d))};Object.defineProperty(a.prototype,"includeInLayout",{get:function(){return this._includeInLayout},set:function(b){this._includeInLayout!=b&&(this._includeInLayout=!0,this.invalidateParentSizeAndDisplayList(),this._includeInLayout=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"left",{get:function(){return this._left},set:function(b){this._left!=b&&(this._left=b,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype, "right",{get:function(){return this._right},set:function(b){this._right!=b&&(this._right=b,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"top",{get:function(){return this._top},set:function(b){this._top!=b&&(this._top=b,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"bottom",{get:function(){return this._bottom},set:function(b){this._bottom!=b&&(this._bottom=b,this.invalidateParentSizeAndDisplayList())}, enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"horizontalCenter",{get:function(){return this._horizontalCenter},set:function(b){this._horizontalCenter!=b&&(this._horizontalCenter=b,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"verticalCenter",{get:function(){return this._verticalCenter},set:function(b){this._verticalCenter!=b&&(this._verticalCenter=b,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0}); Object.defineProperty(a.prototype,"percentWidth",{get:function(){return this._percentWidth},set:function(b){this._percentWidth!=b&&(this._percentWidth=b,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"percentHeight",{get:function(){return this._percentHeight},set:function(b){this._percentHeight!=b&&(this._percentHeight=b,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});a.prototype.setLayoutBoundsSize=function(b, a){b/=this.scaleX;a/=this.scaleY;isNaN(b)?(this.layoutWidthExplicitlySet=!1,b=this.preferredWidth):this.layoutWidthExplicitlySet=!0;isNaN(a)?(this.layoutHeightExplicitlySet=!1,a=this.preferredHeight):this.layoutHeightExplicitlySet=!0;this.setActualSize(b,a)};a.prototype.setLayoutBoundsPosition=function(b,a){var c=!1;this._x!=b&&(this._x=b,c=!0);this._y!=a&&(this._y=a,c=!0);c&&this.dispatchMoveEvent()};Object.defineProperty(a.prototype,"preferredWidth",{get:function(){var b=isNaN(this._explicitWidth)? this.measuredWidth:this._explicitWidth;return isNaN(b)?0:b*this.scaleX},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"preferredHeight",{get:function(){var b=isNaN(this._explicitHeight)?this.measuredHeight:this._explicitHeight;return isNaN(b)?0:b*this.scaleY},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"preferredX",{get:function(){return this._x},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"preferredY",{get:function(){return this._y}, enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"layoutBoundsX",{get:function(){return this._x},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"layoutBoundsY",{get:function(){return this._y},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"layoutBoundsWidth",{get:function(){var b=0,b=this.layoutWidthExplicitlySet?this._width:isNaN(this.explicitWidth)?this.measuredWidth:this._explicitWidth;return this.escapeNaN(b*this.scaleX)},enumerable:!0,configurable:!0}); Object.defineProperty(a.prototype,"layoutBoundsHeight",{get:function(){var b=0,b=this.layoutHeightExplicitlySet?this._height:isNaN(this.explicitHeight)?this.measuredHeight:this._explicitHeight;return this.escapeNaN(b*this.scaleY)},enumerable:!0,configurable:!0});return a}(c.DisplayObjectContainer);c.UIComponent=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.ABOVE="above";c.BELOW="below";c.CENTER="center";c.TOP_LEFT="topLeft";c.LEFT="left";c.RIGHT="right";return c}();c.PopUpPosition=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.HOME=36;c.END=35;c.UP=38;c.DOWN=40;c.LEFT=37;c.RIGHT=39;c.PAGE_UP=33;c.PAGE_DOWN=34;c.PAGE_LEFT=9111;c.PAGE_RIGHT=9112;return c}();c.NavigationUnit=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.AUTO="auto";c.OFF="off";c.ON="on";return c}();c.ScrollPolicy=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(b){"undefined"===typeof b&&(b=null);c.call(this);this.generator=b}__extends(a,c);a.prototype.newInstance=function(){return new this.generator};return a}(c.HashObject);c.ClassFactory=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(){c.call(this)}__extends(a,c);a.prototype.initialize=function(b){};a.prototype.apply=function(b){};a.prototype.remove=function(b){};a.prototype.initializeFromObject=function(b){for(var a in b)this[a]=b[a];return this};return a}(c.HashObject);c.OverrideBase=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this.propertyName="";this.position=a.LAST}__extends(a,d);a.prototype.initialize=function(b){if((b=b[this.target])&&!(b instanceof c.SkinnableComponent)&&"initialize"in b)try{b.initialize()}catch(a){}};a.prototype.apply=function(b){var c,d;try{d=b[this.relativeTo]}catch(e){}var g=b[this.target];b=this.propertyName?b[this.propertyName]:b;if(g&&b){switch(this.position){case a.FIRST:c=0;break;case a.LAST:c=-1;break;case a.BEFORE:c=b.getElementIndex(d); break;case a.AFTER:c=b.getElementIndex(d)+1}-1==c&&(c=b.numElements);b.addElementAt(g,c)}};a.prototype.remove=function(b){var a=null==this.propertyName||""==this.propertyName?b:b[this.propertyName];(b=b[this.target])&&a&&-1!=a.getElementIndex(b)&&a.removeElement(b)};a.FIRST="first";a.LAST="last";a.BEFORE="before";a.AFTER="after";return a}(c.OverrideBase);c.AddItems=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(c){function a(){c.call(this)}__extends(a,c);a.prototype.apply=function(b){b=null==this.target||""==this.target?b:b[this.target];null!=b&&(this.oldValue=b[this.name],this.setPropertyValue(b,this.name,this.value,this.oldValue))};a.prototype.remove=function(b){b=null==this.target||""==this.target?b:b[this.target];null!=b&&(this.setPropertyValue(b,this.name,this.oldValue,this.oldValue),this.oldValue=null)};a.prototype.setPropertyValue=function(b,a,c,d){b[a]=void 0===c||null=== c?c:"boolean"==typeof d?this.toBoolean(c):c};a.prototype.toBoolean=function(b){return"string"==typeof b?"true"==b.toLowerCase():!1!=b};return a}(c.OverrideBase);c.SetProperty=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(b){"undefined"===typeof b&&(b=null);d.call(this);this.initialized=!1;this.overrides=[];this.stateGroups=[];for(var a in b)this[a]=b[a]}__extends(a,d);a.prototype.initialize=function(b){if(!this.initialized){this.initialized=!0;for(var a=0;athis.aspectRatio?(g=a*this.aspectRatio,c=Math.round(0.5*(b-g)),b=g):(g=b/this.aspectRatio,e=Math.round(0.5*(a-g)),a=g),"setLayoutBoundsPosition"in this._skin?this._skin.includeInLayout&&this._skin.setLayoutBoundsPosition(c, e):(this._skin.x=c,this._skin.y=e))}"setLayoutBoundsSize"in this._skin?this._skin.includeInLayout&&this._skin.setLayoutBoundsSize(b,a):(this._skin.scaleX=b/this._skin.width,this._skin.scaleY=a/this._skin.height,"validateNow"in this._skin&&this._skin.validateNow())}};a.prototype._addToDisplayList=function(b){return d.prototype.addChild.call(this,b)};a.prototype._addToDisplayListAt=function(b,a){return d.prototype.addChildAt.call(this,b,a)};a.prototype._removeFromDisplayList=function(b){return d.prototype.removeChild.call(this, b)};a.prototype.addChild=function(b){throw Error("addChild()"+a.errorStr+"addElement()\u4ee3\u66ff");};a.prototype.addChildAt=function(b,c){throw Error("addChildAt()"+a.errorStr+"addElementAt()\u4ee3\u66ff");};a.prototype.removeChild=function(b){throw Error("removeChild()"+a.errorStr+"removeElement()\u4ee3\u66ff");};a.prototype.removeChildAt=function(b){throw Error("removeChildAt()"+a.errorStr+"removeElementAt()\u4ee3\u66ff");};a.prototype.setChildIndex=function(b,c){throw Error("setChildIndex()"+ a.errorStr+"setElementIndex()\u4ee3\u66ff");};a.prototype.swapChildren=function(b,c){throw Error("swapChildren()"+a.errorStr+"swapElements()\u4ee3\u66ff");};a.prototype.swapChildrenAt=function(b,c){throw Error("swapChildrenAt()"+a.errorStr+"swapElementsAt()\u4ee3\u66ff");};a.errorStr="\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";return a}(c.UIComponent);c.UIAsset=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this.stateIsDirty=this.hasCreatedSkinParts=!1;this.touchChildren=this.explicitMouseEnabled=this.explicitMouseChildren=this._autoMouseEnabled=!0}__extends(a,d);a.prototype.createChildren=function(){if(null==this.skinName)this.onGetSkin(null,null);d.prototype.createChildren.call(this)};Object.defineProperty(a.prototype,"skinObject",{get:function(){return this._skinObject},enumerable:!0,configurable:!0});a.prototype.onGetSkin=function(b,a){this.detachSkin(this._skinObject); this._skin&&this._skin.parent==this&&this._removeFromDisplayList(this._skin);b instanceof c.DisplayObject?(this._skin=b,this._addToDisplayListAt(this._skin,0)):this._skin=null;this._skinObject=b;this.attachSkin(this._skinObject);this.aspectRatio=NaN;this.invalidateSkinState();this.invalidateSize();this.invalidateDisplayList()};a.prototype.attachSkin=function(b){b&&"hostComponent"in b?(b.hostComponent=this,this.findSkinParts()):this.hasCreatedSkinParts||(this.createSkinParts(),this.hasCreatedSkinParts= !0);this.skinLayoutEnabled=b&&"hostComponent"in b&&b instanceof c.DisplayObject?!1:!0};a.prototype.findSkinParts=function(){var b=this._skinObject;if(b&&"skinParts"in b)for(var a=b.skinParts,c=a.length,d=0;db.maxWidth&&(a=b.maxWidth),b.hasOwnProperty("minHeight")&&cb.maxHeight&&(c=b.maxHeight),this.measuredWidth=a,this.measuredHeight=c}catch(e){}}};a.prototype.updateDisplayList=function(b,a){d.prototype.updateDisplayList.call(this,b,a);this.skinLayout&&this.skinLayout.updateDisplayList(b,a)};return a}(c.UIAsset);c.SkinnableComponent=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function d(){}d.prototype.getSkin=function(a,b,d,e){a instanceof c.DisplayObject?b.call(d,a,a):b.call(d,new a,a)};return d}();c.DefaultSkinAdapter=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(c){function a(){c.call(this)}__extends(a,c);Object.defineProperty(a.prototype,"target",{get:function(){return this._target},set:function(b){this._target=b},enumerable:!0,configurable:!0});a.prototype.measure=function(){if(null!=this.target){for(var b=0,a=0,c=this._target.skin,d=this.target.numChildren,e=0;ea)return!1;this._isPlaying|| (this._isPlaying=!0,0==this.playedTimes&&null!=this.startFunction&&this.startFunction.call(this.thisObject,this));var b=0==this._duration?1:Math.min(a,this._duration)/this._duration;this.caculateCurrentValue(b);null!=this.updateFunction&&this.updateFunction.call(this.thisObject,this);if(a=a>=this._duration)this.playedTimes++,this._isPlaying=!1,this.startTime=d.currentTime,0==this._repeatCount||this.playedTimesthis.maximum&&(this.maxChanged?this._maximum=this._minimum:this._minimum=this._maximum);if(this.valueChanged||this.maxChanged||this.minChanged|| this.snapIntervalChanged){var b=this.valueChanged?this._changedValue:this._value;this.snapIntervalChanged=this.minChanged=this.maxChanged=this.valueChanged=!1;this.setValue(this.nearestValidValue(b,this.snapInterval))}this.stepSizeChanged&&(this._explicitSnapInterval?this._stepSize=this.nearestValidSize(this._stepSize):(this._snapInterval=this._stepSize,this.setValue(this.nearestValidValue(this._value,this.snapInterval))),this.stepSizeChanged=!1)};a.prototype.nearestValidSize=function(b){var a=this.snapInterval; if(0==a)return b;b=Math.round(b/a)*a;return Math.abs(b)=(c-e)/2?c:e)/d+this.minimum};a.prototype.setValue=function(b){this._value!=b&& (isNaN(b)&&(b=0),!isNaN(this.maximum)&&!isNaN(this.minimum)&&this.maximum>this.minimum?this._value=Math.min(this.maximum,Math.max(this.minimum,b)):this._value=b,this.valueChanged=!1)};a.prototype.changeValueByStep=function(b){"undefined"===typeof b&&(b=!0);0!=this.stepSize&&this.setValue(this.nearestValidValue(b?this.value+this.stepSize:this.value-this.stepSize,this.snapInterval))};return a}(c.SkinnableComponent);c.Range=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this._slideDuration=300;this.needUpdateValue=!1;this.addEventListener(c.Event.ADDED_TO_STAGE,this.addedToStageHandler,this);this.addEventListener(c.TouchEvent.TOUCH_BEGAN,this.mouseDownHandler,this)}__extends(a,d);Object.defineProperty(a.prototype,"slideDuration",{get:function(){return this._slideDuration},set:function(b){this._slideDuration=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"maximum",{get:function(){return this._maximum}, set:function(b){b!=this._maximum&&(this._setMaximun(b),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"minimum",{get:function(){return this._minimum},set:function(b){b!=this._minimum&&(this._setMinimun(b),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"value",{get:function(){return this._getValue()},set:function(b){b!=this._getValue()&&(this._setValue(b),this.invalidateDisplayList())},enumerable:!0, configurable:!0});a.prototype.setValue=function(b){d.prototype.setValue.call(this,b);this.invalidateDisplayList()};a.prototype.pointToValue=function(b,a){return this.minimum};a.prototype.changeValueByStep=function(b){"undefined"===typeof b&&(b=!0);var a=this.value;d.prototype.changeValueByStep.call(this,b);this.value!=a&&this.dispatchEvent(new c.Event(c.Event.CHANGE))};a.prototype.partAdded=function(b,a){d.prototype.partAdded.call(this,b,a);a==this.thumb?(this.thumb.addEventListener(c.TouchEvent.TOUCH_BEGAN, this.thumb_mouseDownHandler,this),this.thumb.addEventListener(c.ResizeEvent.RESIZE,this.thumb_resizeHandler,this),this.thumb.addEventListener(c.UIEvent.UPDATE_COMPLETE,this.thumb_updateCompleteHandler,this),this.thumb.stickyHighlighting=!0):a==this.track&&(this.track.addEventListener(c.TouchEvent.TOUCH_BEGAN,this.track_mouseDownHandler,this),this.track.addEventListener(c.ResizeEvent.RESIZE,this.track_resizeHandler,this))};a.prototype.partRemoved=function(b,a){d.prototype.partRemoved.call(this,b,a); a==this.thumb?(this.thumb.removeEventListener(c.TouchEvent.TOUCH_BEGAN,this.thumb_mouseDownHandler,this),this.thumb.removeEventListener(c.ResizeEvent.RESIZE,this.thumb_resizeHandler,this),this.thumb.removeEventListener(c.UIEvent.UPDATE_COMPLETE,this.thumb_updateCompleteHandler,this)):a==this.track&&(this.track.removeEventListener(c.TouchEvent.TOUCH_BEGAN,this.track_mouseDownHandler,this),this.track.removeEventListener(c.ResizeEvent.RESIZE,this.track_resizeHandler,this))};a.prototype.updateDisplayList= function(b,a){d.prototype.updateDisplayList.call(this,b,a);this.updateSkinDisplayList()};a.prototype.updateSkinDisplayList=function(){};a.prototype.addedToStageHandler=function(b){this.updateSkinDisplayList()};a.prototype.track_resizeHandler=function(b){this.updateSkinDisplayList()};a.prototype.thumb_resizeHandler=function(b){this.updateSkinDisplayList()};a.prototype.thumb_updateCompleteHandler=function(b){this.updateSkinDisplayList();this.thumb.removeEventListener(c.UIEvent.UPDATE_COMPLETE,this.thumb_updateCompleteHandler, this)};a.prototype.thumb_mouseDownHandler=function(b){c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE,this.stage_mouseMoveHandler,this);c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this);c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this);this.addEventListener(c.Event.ENTER_FRAME,this.onEnterFrame,this);b=this.thumb.globalToLocal(b.stageX,b.stageY);this._clickOffsetX=b.x;this._clickOffsetY=b.y;this.dispatchEvent(new c.TrackBaseEvent(c.TrackBaseEvent.THUMB_PRESS)); this.dispatchEvent(new c.UIEvent(c.UIEvent.CHANGE_START))};a.prototype.onEnterFrame=function(b){this.needUpdateValue&&this.track&&(this.updateWhenMouseMove(),this.needUpdateValue=!1)};a.prototype.updateWhenMouseMove=function(){if(this.track){var b=this.track.globalToLocal(this._moveStageX,this._moveStageY),b=this.pointToValue(b.x-this._clickOffsetX,b.y-this._clickOffsetY),b=this.nearestValidValue(b,this.snapInterval);b!=this.value&&(this.setValue(b),this.validateDisplayList(),this.dispatchEvent(new c.TrackBaseEvent(c.TrackBaseEvent.THUMB_DRAG)), this.dispatchEventWith(c.Event.CHANGE))}};a.prototype.stage_mouseMoveHandler=function(b){this._moveStageX=b.stageX;this._moveStageY=b.stageY;this.needUpdateValue||(this.needUpdateValue=!0)};a.prototype.stage_mouseUpHandler=function(b){c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE,this.stage_mouseMoveHandler,this);c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this);c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE,this.stage_mouseUpHandler, this);this.removeEventListener(c.Event.ENTER_FRAME,this.updateWhenMouseMove,this);this.needUpdateValue&&(this.updateWhenMouseMove(),this.needUpdateValue=!1);this.dispatchEvent(new c.TrackBaseEvent(c.TrackBaseEvent.THUMB_RELEASE));this.dispatchEvent(new c.UIEvent(c.UIEvent.CHANGE_END))};a.prototype.track_mouseDownHandler=function(b){};a.prototype.mouseDownHandler=function(b){c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END,this.system_mouseUpSomewhereHandler,this);c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.system_mouseUpSomewhereHandler,this);this.mouseDownTarget=b.target};a.prototype.system_mouseUpSomewhereHandler=function(b){c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END,this.system_mouseUpSomewhereHandler,this);c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE,this.system_mouseUpSomewhereHandler,this);if(this.mouseDownTarget!=b.target&&b instanceof c.TouchEvent&&this.contains(b.target)){var a=b.target.localToGlobal(b.localX,b.localY);b=new c.TouchEvent(c.TouchEvent.TOUCH_TAP, b.bubbles,b.cancelable,b.touchPointID,a.x,a.y,b.ctrlKey,b.altKey,b.shiftKey,b.touchDown);this.dispatchEvent(b)}this.mouseDownTarget=null};return a}(c.Range);c.TrackBase=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this._showTrackHighlight=!0;this._pendingValue=0;this._liveDragging=!0;this.maximum=10}__extends(a,d);Object.defineProperty(a.prototype,"showTrackHighlight",{get:function(){return this._showTrackHighlight},set:function(b){this._showTrackHighlight!=b&&(this._showTrackHighlight=b,this.trackHighlight&&(this.trackHighlight.visible=b),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"pendingValue", {get:function(){return this._pendingValue},set:function(b){b!=this._pendingValue&&(this._pendingValue=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});a.prototype.setValue=function(b){this._pendingValue=b;d.prototype.setValue.call(this,b)};a.prototype.animationUpdateHandler=function(b){this.pendingValue=b.currentValue.value};a.prototype.animationEndHandler=function(b){this.setValue(this.slideToValue);this.dispatchEvent(new c.Event(c.Event.CHANGE));this.dispatchEvent(new c.UIEvent(c.UIEvent.CHANGE_END))}; a.prototype.stopAnimation=function(){this.animator.stop();this.setValue(this.nearestValidValue(this.pendingValue,this.snapInterval));this.dispatchEvent(new c.Event(c.Event.CHANGE));this.dispatchEvent(new c.UIEvent(c.UIEvent.CHANGE_END))};a.prototype.thumb_mouseDownHandler=function(b){this.animator&&this.animator.isPlaying&&this.stopAnimation();d.prototype.thumb_mouseDownHandler.call(this,b)};Object.defineProperty(a.prototype,"liveDragging",{get:function(){return this._liveDragging},set:function(b){this._liveDragging= b},enumerable:!0,configurable:!0});a.prototype.updateWhenMouseMove=function(){if(this.track){var b=this.track.globalToLocal(this._moveStageX,this._moveStageY),b=this.pointToValue(b.x-this._clickOffsetX,b.y-this._clickOffsetY),b=this.nearestValidValue(b,this.snapInterval);b!=this.pendingValue&&(this.dispatchEvent(new c.TrackBaseEvent(c.TrackBaseEvent.THUMB_DRAG)),!0==this.liveDragging?(this.setValue(b),this.dispatchEvent(new c.Event(c.Event.CHANGE))):this.pendingValue=b)}};a.prototype.stage_mouseUpHandler= function(b){d.prototype.stage_mouseUpHandler.call(this,b);!1==this.liveDragging&&this.value!=this.pendingValue&&(this.setValue(this.pendingValue),this.dispatchEvent(new c.Event(c.Event.CHANGE)))};a.prototype.track_mouseDownHandler=function(b){this.enabled&&(b=this.track.globalToLocal(b.stageX-(this.thumb?this.thumb.width:0)/2,b.stageY-(this.thumb?this.thumb.height:0)/2),b=this.pointToValue(b.x,b.y),b=this.nearestValidValue(b,this.snapInterval),b!=this.pendingValue&&(0!=this.slideDuration?(this.animator|| (this.animator=new c.Animation(this.animationUpdateHandler,this),this.animator.endFunction=this.animationEndHandler),this.animator.isPlaying&&this.stopAnimation(),this.slideToValue=b,this.animator.duration=this.slideDuration*(Math.abs(this.pendingValue-this.slideToValue)/(this.maximum-this.minimum)),this.animator.motionPaths=[{prop:"value",from:this.pendingValue,to:this.slideToValue}],this.dispatchEvent(new c.UIEvent(c.UIEvent.CHANGE_START)),this.animator.play()):(this.setValue(b),this.dispatchEvent(new c.Event(c.Event.CHANGE)))))}; a.prototype.partAdded=function(b,a){d.prototype.partAdded.call(this,b,a);a==this.trackHighlight&&(this.trackHighlight.touchEnabled=!1,this.trackHighlight instanceof c.DisplayObjectContainer&&(this.trackHighlight.touchChildren=!1),this.trackHighlight.visible=this._showTrackHighlight)};return a}(c.TrackBase);c.SliderBase=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this._maxDisplayedLines=0;this.lastUnscaledWidth=NaN;this._padding=0;this._paddingBottom=this._paddingTop=this._paddingRight=this._paddingLeft=NaN;this.addEventListener(c.UIEvent.UPDATE_COMPLETE,this.updateCompleteHandler,this)}__extends(a,d);a.prototype.updateCompleteHandler=function(b){this.lastUnscaledWidth=NaN};Object.defineProperty(a.prototype,"maxDisplayedLines",{get:function(){return this._maxDisplayedLines},set:function(b){this._maxDisplayedLines!= b&&(this._maxDisplayedLines=b,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"padding",{get:function(){return this._padding},set:function(b){this._padding!=b&&(this._padding=b,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"paddingLeft",{get:function(){return this._paddingLeft},set:function(b){this._paddingLeft!=b&&(this._paddingLeft=b,this.invalidateSize(), this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"paddingRight",{get:function(){return this._paddingRight},set:function(b){this._paddingRight!=b&&(this._paddingRight=b,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"paddingTop",{get:function(){return this._paddingTop},set:function(b){this._paddingTop!=b&&(this._paddingTop=b,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0, configurable:!0});Object.defineProperty(a.prototype,"paddingBottom",{get:function(){return this._paddingBottom},set:function(b){this._paddingBottom!=b&&(this._paddingBottom=b,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});a.prototype.measure=function(){this.invalidatePropertiesFlag&&this.validateProperties();if(this.isSpecialCase())if(isNaN(this.lastUnscaledWidth))this.oldPreferHeight=this.oldPreferWidth=NaN;else{this.measureUsingWidth(this.lastUnscaledWidth); return}var b;isNaN(this.explicitWidth)?1E4!=this.maxWidth&&(b=this.maxWidth):b=this.explicitWidth;this.measureUsingWidth(b)};a.prototype.isSpecialCase=function(){return 1!=this._maxDisplayedLines&&(!isNaN(this.percentWidth)||!isNaN(this.left)&&!isNaN(this.right))&&isNaN(this.explicitHeight)&&isNaN(this.percentHeight)};a.prototype.measureUsingWidth=function(b){var a=this._textField.text;this.textChanged&&(this._textField.text=this._text);var c=isNaN(this._padding)?0:this._padding,d=isNaN(this._paddingLeft)? c:this._paddingLeft,e=isNaN(this._paddingRight)?c:this._paddingRight,k=isNaN(this._paddingTop)?c:this._paddingTop,c=isNaN(this._paddingBottom)?c:this._paddingBottom;this._textField.width=NaN;this._textField.height=NaN;isNaN(b)||(this._textField.width=b-d-e);this.measuredWidth=Math.ceil(this._textField.measuredWidth);this.measuredHeight=Math.ceil(this._textField.measuredHeight);0this._maxDisplayedLines&&(b=this._textField.lineSpacing,this.measuredHeight= (this._textField.size+b)*this._maxDisplayedLines-b);this.measuredWidth+=d+e;this.measuredHeight+=k+c;this._textField.text=a};a.prototype.updateDisplayList=function(b,a){this.$updateDisplayList(b,a);var c=isNaN(this._padding)?0:this._padding,d=isNaN(this._paddingLeft)?c:this._paddingLeft,e=isNaN(this._paddingRight)?c:this._paddingRight,k=isNaN(this._paddingTop)?c:this._paddingTop,c=isNaN(this._paddingBottom)?c:this._paddingBottom;this._textField.x=d;this._textField.y=k;if(this.isSpecialCase()){var l= isNaN(this.lastUnscaledWidth)||this.lastUnscaledWidth!=b;this.lastUnscaledWidth=b;if(l){this.oldPreferHeight=this.oldPreferWidth=NaN;this.invalidateSize();return}}this.invalidateSizeFlag&&this.validateSize();this._textField.visible||(this._textField.visible=!0);this._textField.width=b-d-e;d=a-k-c;this._textField.height=d;0this._maxDisplayedLines&&(e=this._textField.lineSpacing,this._textField.height=Math.min(d,(this._textField.size+e)*this._maxDisplayedLines- e))};return a}(c.TextBase);c.Label=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this._fillColor=16777215;this._fillAlpha=1;this._strokeColor=4473924;this._strokeAlpha=0;this._strokeWeight=1;this.touchChildren=!1}__extends(a,d);a.prototype.createChildren=function(){d.prototype.createChildren.call(this);this.shapeRect=new c.Shape;this.addChild(this.shapeRect)};Object.defineProperty(a.prototype,"fillColor",{get:function(){return this._fillColor},set:function(b){this._fillColor!=b&&(this._fillColor=b,this.invalidateDisplayList())}, enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"fillAlpha",{get:function(){return this._fillAlpha},set:function(b){this._fillAlpha!=b&&(this._fillAlpha=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"strokeColor",{get:function(){return this._strokeColor},set:function(b){this._strokeColor!=b&&(this._strokeColor=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"strokeAlpha",{get:function(){return this._strokeAlpha}, set:function(b){this._strokeAlpha!=b&&(this._strokeAlpha=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"strokeWeight",{get:function(){return this._strokeWeight},set:function(b){this._strokeWeight!=b&&(this._strokeWeight=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});a.prototype.updateDisplayList=function(b,a){d.prototype.updateDisplayList.call(this,b,b);var c=this.shapeRect.graphics;c.clear();c.beginFill(this._fillColor,this._fillAlpha); 0k||l>n?1:gl?-1:b==a?0:this.breadthOrderCompare(d,e)};a.prototype.radioButton_addedHandler=function(b){if(b=b.target)b.removeEventListener(c.Event.ADDED,this.radioButton_addedHandler,this),this.addInstance(b)};a.prototype.radioButton_removedHandler=function(b){if(b=b.target)b.removeEventListener(c.Event.REMOVED, this.radioButton_removedHandler,this),this.doRemoveInstance(b)};a.groupCount=0;return a}(c.EventDispatcher);c.RadioButtonGroup=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this.indexNumber=0;this.radioButtonGroup=null;this.groupChanged=!1;this.groupName=this._groupName="radioGroup"}__extends(a,d);Object.defineProperty(a.prototype,"enabled",{get:function(){return!this._enabled?!1:!this.radioButtonGroup||this.radioButtonGroup.enabled},set:function(b){this._setEnabled(b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"group",{get:function(){if(!this._group&&this._groupName){a.automaticRadioButtonGroups|| (a.automaticRadioButtonGroups={});var b=a.automaticRadioButtonGroups[this._groupName];b||(b=new c.RadioButtonGroup,b.name=this._groupName,a.automaticRadioButtonGroups[this._groupName]=b);this._group=b}return this._group},set:function(b){this._group!=b&&(this.radioButtonGroup&&this.radioButtonGroup.removeInstance(this),this._groupName=(this._group=b)?this.group.name:"radioGroup",this.groupChanged=!0,this.invalidateProperties(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype, "groupName",{get:function(){return this._groupName},set:function(b){b&&""!=b&&(this._groupName=b,this.radioButtonGroup&&this.radioButtonGroup.removeInstance(this),this._group=null,this.groupChanged=!0,this.invalidateProperties(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});a.prototype._setSelected=function(b){d.prototype._setSelected.call(this,b);this.invalidateDisplayList()};Object.defineProperty(a.prototype,"value",{get:function(){return this._value},set:function(b){this._value!= b&&(this._value=b,this.selected&&this.group&&this.group.dispatchEvent(new c.UIEvent(c.UIEvent.VALUE_COMMIT)))},enumerable:!0,configurable:!0});a.prototype.commitProperties=function(){this.groupChanged&&(this.addToGroup(),this.groupChanged=!1);d.prototype.commitProperties.call(this)};a.prototype.updateDisplayList=function(b,a){d.prototype.updateDisplayList.call(this,b,a);this.group&&(this.selected?this._group.selection=this:this.group.selection==this&&(this._group.selection=null))};a.prototype.buttonReleased= function(){this.enabled&&!this.selected&&(this.radioButtonGroup||this.addToGroup(),d.prototype.buttonReleased.call(this),this.group.setSelection(this))};a.prototype.addToGroup=function(){var b=this.group;b&&b.addInstance(this);return b};return a}(c.ToggleButtonBase);c.RadioButton=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this.elementsContentChanged=this.createChildrenCalled=!1;this._elementsContent=[]}__extends(a,d);a.prototype.createChildren=function(){d.prototype.createChildren.call(this);this.createChildrenCalled=!0;this.elementsContentChanged&&(this.elementsContentChanged=!1,this.setElementsContent(this._elementsContent))};a.prototype.getElementsContent=function(){return this._elementsContent};Object.defineProperty(a.prototype,"elementsContent",{set:function(b){null== b&&(b=[]);if(b!=this._elementsContent)if(this.createChildrenCalled)this.setElementsContent(b);else{this.elementsContentChanged=!0;for(var a=this._elementsContent.length-1;0<=a;a--)this.elementRemoved(this._elementsContent[a],a);this._elementsContent=b}},enumerable:!0,configurable:!0});a.prototype.setElementsContent=function(b){var a;for(a=this._elementsContent.length-1;0<=a;a--)this.elementRemoved(this._elementsContent[a],a);this._elementsContent=b.concat();b=this._elementsContent.length;for(a=0;a< b;a++){var c=this._elementsContent[a];c.parent&&"removeElement"in c.parent?c.parent.removeElement(c):c.owner&&"removeElement"in c.owner&&c.owner.removeElement(c);this.elementAdded(c,a)}};Object.defineProperty(a.prototype,"numElements",{get:function(){return this._elementsContent.length},enumerable:!0,configurable:!0});a.prototype.getElementAt=function(b){this.checkForRangeError(b);return this._elementsContent[b]};a.prototype.checkForRangeError=function(b,a){"undefined"===typeof a&&(a=!1);var c=this._elementsContent.length- 1;a&&c++;if(0>b||b>c)throw new RangeError('\u7d22\u5f15:"'+b+'"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');};a.prototype.addElement=function(b){var a=this.numElements;b.parent==this&&(a=this.numElements-1);return this.addElementAt(b,a)};a.prototype.addElementAt=function(b,a){if(b==this)return b;this.checkForRangeError(a,!0);var c=b.parent;if(c==this)return this.setElementIndex(b,a),b;c&&"removeElement"in c?c.removeElement(b):b.owner&&"removeElement"in b.owner&&b.owner.removeElement(b); this._elementsContent.splice(a,0,b);this.elementsContentChanged||this.elementAdded(b,a);return b};a.prototype.removeElement=function(b){return this.removeElementAt(this.getElementIndex(b))};a.prototype.removeElementAt=function(b){this.checkForRangeError(b);var a=this._elementsContent[b];this.elementsContentChanged||this.elementRemoved(a,b);this._elementsContent.splice(b,1);return a};a.prototype.removeAllElements=function(){for(var b=this.numElements-1;0<=b;b--)this.removeElementAt(b)};a.prototype.getElementIndex= function(b){return this._elementsContent.indexOf(b)};a.prototype.setElementIndex=function(b,a){this.checkForRangeError(a);var c=this.getElementIndex(b);-1==c||c==a||(this.elementsContentChanged||this.elementRemoved(b,c,!1),this._elementsContent.splice(c,1),this._elementsContent.splice(a,0,b),this.elementsContentChanged||this.elementAdded(b,a,!1))};a.prototype.swapElements=function(b,a){this.swapElementsAt(this.getElementIndex(b),this.getElementIndex(a))};a.prototype.swapElementsAt=function(b,a){this.checkForRangeError(b); this.checkForRangeError(a);if(b>a){var c=a;a=b;b=c}else if(b==a)return;var c=this._elementsContent[b],d=this._elementsContent[a];this.elementsContentChanged||(this.elementRemoved(c,b,!1),this.elementRemoved(d,a,!1));this._elementsContent.splice(a,1);this._elementsContent.splice(b,1);this._elementsContent.splice(b,0,d);this._elementsContent.splice(a,0,c);this.elementsContentChanged||(this.elementAdded(d,b,!1),this.elementAdded(c,a,!1))};a.prototype.elementAdded=function(b,a,d){"undefined"===typeof d&& (d=!0);b instanceof c.DisplayObject&&this._addToDisplayList(b,a);d&&this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD)&&this.dispatchEvent(new c.ElementExistenceEvent(c.ElementExistenceEvent.ELEMENT_ADD,!1,!1,b,a));this.invalidateSize();this.invalidateDisplayList()};a.prototype.elementRemoved=function(b,a,e){"undefined"===typeof e&&(e=!0);e&&this.hasEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE)&&this.dispatchEvent(new c.ElementExistenceEvent(c.ElementExistenceEvent.ELEMENT_REMOVE, !1,!1,b,a));b&&b.parent==this&&d.prototype.removeChild.call(this,b);this.invalidateSize();this.invalidateDisplayList()};a.prototype._addToDisplayList=function(b,a){"undefined"===typeof a&&(a=-1);b.parent==this?d.prototype.setChildIndex.call(this,b,-1!=a?a:this.numChildren-1):d.prototype.addChildAt.call(this,b,-1!=a?a:this.numChildren)};a.prototype.addChild=function(b){throw Error("addChild()"+a.errorStr+"addElement()\u4ee3\u66ff");};a.prototype.addChildAt=function(b,c){throw Error("addChildAt()"+ a.errorStr+"addElementAt()\u4ee3\u66ff");};a.prototype.removeChild=function(b){throw Error("removeChild()"+a.errorStr+"removeElement()\u4ee3\u66ff");};a.prototype.removeChildAt=function(b){throw Error("removeChildAt()"+a.errorStr+"removeElementAt()\u4ee3\u66ff");};a.prototype.setChildIndex=function(b,c){throw Error("setChildIndex()"+a.errorStr+"setElementIndex()\u4ee3\u66ff");};a.prototype.swapChildren=function(b,c){throw Error("swapChildren()"+a.errorStr+"swapElements()\u4ee3\u66ff");};a.prototype.swapChildrenAt= function(b,c){throw Error("swapChildrenAt()"+a.errorStr+"swapElementsAt()\u4ee3\u66ff");};a.errorStr="\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";return a}(c.GroupBase);c.Group=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this._createAllChildren=!1;this.proposedSelectedIndex=a.NO_PROPOSED_SELECTION;this._selectedIndex=-1;this.childOrderingChanged=this.notifyTabBar=!1;this._setLayout(new c.BasicLayout)}__extends(a,d);Object.defineProperty(a.prototype,"layout",{get:function(){return this._layout},set:function(b){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"createAllChildren",{get:function(){return this._createAllChildren},set:function(b){if(this._createAllChildren!= b&&(this._createAllChildren=b)){b=this.getElementsContent();for(var a=b.length,d=0;db||b>c)throw new RangeError('\u7d22\u5f15:"'+b+'"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');};a.prototype.addElement=function(b){var a=this.numElements;b.owner==this&&(a=this.numElements-1);return this.addElementAt(b,a)};a.prototype.addElementAt=function(b,a){this.checkForRangeError(a,!0);var c=b.owner;if(c==this)return this.setElementIndex(b,a),b;b.parent&&"removeElement"in b.parent? b.parent.removeElement(b):c&&"removeElement"in c&&c.removeElement(b);this._elementsContent.splice(a,0,b);this._hostComponent&&this.elementAdded(b,a);return b};a.prototype.removeElement=function(b){return this.removeElementAt(this.getElementIndex(b))};a.prototype.removeElementAt=function(b){this.checkForRangeError(b);var a=this._elementsContent[b];this._hostComponent&&this.elementRemoved(a,b);this._elementsContent.splice(b,1);return a};a.prototype.getElementIndex=function(b){return this._elementsContent.indexOf(b)}; a.prototype.setElementIndex=function(b,a){this.checkForRangeError(a);var c=this.getElementIndex(b);-1==c||c==a||(this._hostComponent&&this.elementRemoved(b,c,!1),this._elementsContent.splice(c,1),this._elementsContent.splice(a,0,b),this._hostComponent&&this.elementAdded(b,a,!1))};a.prototype.elementAdded=function(b,a,d){"undefined"===typeof d&&(d=!0);b.ownerChanged(this);b instanceof c.DisplayObject&&this._hostComponent._addToDisplayListAt(b,a);d&&this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD)&& this.dispatchEvent(new c.ElementExistenceEvent(c.ElementExistenceEvent.ELEMENT_ADD,!1,!1,b,a));this._hostComponent.invalidateSize();this._hostComponent.invalidateDisplayList()};a.prototype.elementRemoved=function(b,a,d){"undefined"===typeof d&&(d=!0);d&&this.hasEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE)&&this.dispatchEvent(new c.ElementExistenceEvent(c.ElementExistenceEvent.ELEMENT_REMOVE,!1,!1,b,a));b&&b.parent==this._hostComponent&&this._hostComponent._removeFromDisplayList(b);b.ownerChanged(null); this._hostComponent.invalidateSize();this._hostComponent.invalidateDisplayList()};return a}(c.EventDispatcher);c.StateSkin=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this.useVirtualLayoutChanged=!1;this.rendererToClassMap=[];this.freeRenderers=[];this.dataProviderChanged=this.createNewRendererFlag=!1;this.recyclerDic=[];this.typicalItemChanged=this.virtualLayoutUnderway=this.itemRendererSkinNameChange=!1;this.indexToRenderer=[];this.renderersBeingUpdated=this.cleanFreeRenderer=!1}__extends(a,d);Object.defineProperty(a.prototype,"rendererOwner",{get:function(){return this._rendererOwner},set:function(b){this._rendererOwner= b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"layout",{get:function(){return this._layout},set:function(b){b!=this.layout&&(this.layout&&(this.layout.typicalLayoutRect=null,this.layout.removeEventListener("useVirtualLayoutChanged",this.layout_useVirtualLayoutChangedHandler,this)),this.layout&&(b&&this.layout.useVirtualLayout!=b.useVirtualLayout)&&this.changeUseVirtualLayout(),this._setLayout(b),b&&(b.typicalLayoutRect=this.typicalLayoutRect,b.addEventListener("useVirtualLayoutChanged", this.layout_useVirtualLayoutChangedHandler,this)))},enumerable:!0,configurable:!0});a.prototype.layout_useVirtualLayoutChangedHandler=function(b){this.changeUseVirtualLayout()};a.prototype.setVirtualElementIndicesInView=function(b,a){if(this.layout&&this.layout.useVirtualLayout){this.virtualRendererIndices=[];for(var c=b;c<=a;c++)this.virtualRendererIndices.push(c);for(var d in this.indexToRenderer)-1==this.virtualRendererIndices.indexOf(d)&&this.freeRendererByIndex(d)}};a.prototype.getVirtualElementAt= function(b){if(0>b||b>=this.dataProvider.length)return null;var a=this.indexToRenderer[b];if(!a){var a=this.dataProvider.getItemAt(b),d=this.createVirtualRenderer(b);this.indexToRenderer[b]=d;this.updateRenderer(d,b,a);this.createNewRendererFlag&&("validateNow"in d&&d.validateNow(),this.createNewRendererFlag=!1,this.dispatchEvent(new c.RendererExistenceEvent(c.RendererExistenceEvent.RENDERER_ADD,!1,!1,d,b,a)));a=d}return a};a.prototype.freeRendererByIndex=function(b){if(this.indexToRenderer[b]){var a= this.indexToRenderer[b];delete this.indexToRenderer[b];a&&a instanceof c.DisplayObject&&this.doFreeRenderer(a)}};a.prototype.doFreeRenderer=function(b){var a=this.rendererToClassMap[b.hashCode].hashCode;this.freeRenderers[a]||(this.freeRenderers[a]=[]);this.freeRenderers[a].push(b);b.visible=!1};a.prototype.invalidateSize=function(){this.createNewRendererFlag||d.prototype.invalidateSize.call(this)};a.prototype.createVirtualRenderer=function(b){b=this.dataProvider.getItemAt(b);b=this.itemToRendererClass(b); var a=b.hashCode,c=this.freeRenderers;if(c[a]&&0=a&&(d[g]= k+1)}this.indexToRenderer.splice(a,0,null)}}else d=this.itemToRendererClass(b),d=this.createOneRenderer(d),this.indexToRenderer.splice(a,0,d),d&&(this.updateRenderer(d,a,b),this.dispatchEvent(new c.RendererExistenceEvent(c.RendererExistenceEvent.RENDERER_ADD,!1,!1,d,a,b)))};a.prototype.itemRemoved=function(b,a){this.layout&&this.layout.elementRemoved(a);var d=this.virtualRendererIndices;if(d&&0a&&(d[k]=l-1)}-1!=e&&d.splice(e,1)}d= this.indexToRenderer[a];this.indexToRenderer.length>a&&this.indexToRenderer.splice(a,1);this.dispatchEvent(new c.RendererExistenceEvent(c.RendererExistenceEvent.RENDERER_REMOVE,!1,!1,d,a,b));d&&d instanceof c.DisplayObject&&(this.recycle(d),this.dispatchEvent(new c.RendererExistenceEvent(c.RendererExistenceEvent.RENDERER_REMOVE,!1,!1,d,d.itemIndex,d.data)))};a.prototype.recycle=function(b){d.prototype.removeChild.call(this,b);"ownerChanged"in b&&b.ownerChanged(null);var a=this.rendererToClassMap[b.hashCode].hashCode; this.recyclerDic[a]||(this.recyclerDic[a]=new c.Recycler);this.recyclerDic[a].push(b)};a.prototype.resetRenderersIndices=function(){if(0!=this.indexToRenderer.length)if(this.layout&&this.layout.useVirtualLayout)for(var b=this.virtualRendererIndices,a=b.length,c=0;cthis.selectedIndex?this.dataProvider.getItemAt(this.selectedIndex):void 0},set:function(b){this.setSelectedItem(b,!1)},enumerable:!0,configurable:!0});a.prototype.setSelectedItem=function(b, a){"undefined"===typeof a&&(a=!1);this.selectedItem!==b&&(a&&(this.dispatchChangeAfterSelection=this.dispatchChangeAfterSelection||a),this._pendingSelectedItem=b,this.invalidateProperties())};Object.defineProperty(a.prototype,"useVirtualLayout",{get:function(){return this._getUseVirtualLayout()},set:function(b){this._setUseVirtualLayout(b)},enumerable:!0,configurable:!0});a.prototype._getUseVirtualLayout=function(){return this.layout?this.layout.useVirtualLayout:this._useVirtualLayout};a.prototype._setUseVirtualLayout= function(b){b!=this.useVirtualLayout&&(this._useVirtualLayout=b,this.layout&&(this.layout.useVirtualLayout=b))};a.prototype.commitProperties=function(){d.prototype.commitProperties.call(this);this.dataProviderChanged&&(this.doingWholesaleChanges=this.dataProviderChanged=!1,0<=this.selectedIndex&&this.dataProvider&&this.selectedIndexd&&(this._proposedSelectedIndex=d),this.requireSelection&&this._proposedSelectedIndex==a.NO_SELECTION&&this.dataProvider&& 0b.x+this.moveArea.width&&(a=35-this.moveArea.width);b.x>this.stage.stageWidth-20&&(a=this.stage.stageWidth-20);20>b.y+this.moveArea.height&&(c=20-this.moveArea.height);b.y>this.stage.stageHeight-20&&(c=this.stage.stageHeight-20);this.x+=a-b.x;this.y+=c-b.y}};return a}(c.Panel);c.TitleWindow=e})(ns_egret||(ns_egret= {}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this._contentText=this._secondButtonLabel=this._firstButtonLabel=""}__extends(a,d);a.show=function(b,d,e,h,g,k,l){"undefined"===typeof b&&(b="");"undefined"===typeof d&&(d="");"undefined"===typeof e&&(e=null);"undefined"===typeof h&&(h="\u786e\u5b9a");"undefined"===typeof g&&(g="");"undefined"===typeof k&&(k=!0);"undefined"===typeof l&&(l=!0);var n=new a;n.contentText=b;n.title=d;n._firstButtonLabel=h;n._secondButtonLabel=g;n.closeHandler=e; c.PopUpManager.addPopUp(n,k,l);return n};Object.defineProperty(a.prototype,"firstButtonLabel",{get:function(){return this._firstButtonLabel},set:function(b){this._firstButtonLabel!=b&&(this._firstButtonLabel=b,this.firstButton&&(this.firstButton.label=b))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"secondButtonLabel",{get:function(){return this._secondButtonLabel},set:function(b){if(this._secondButtonLabel!=b&&(this._secondButtonLabel=b,this.secondButton&&(null==b||""==b)))this.secondButton.includeInLayout= this.secondButton.visible=""!=this._secondButtonLabel&&null!=this._secondButtonLabel},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"contentText",{get:function(){return this._contentText},set:function(b){this._contentText!=b&&(this._contentText=b,this.contentDisplay&&(this.contentDisplay.text=b))},enumerable:!0,configurable:!0});a.prototype.onClose=function(b){c.PopUpManager.removePopUp(this);if(null!=this.closeHandler){var d=new c.CloseEvent(c.CloseEvent.CLOSE);switch(b.currentTarget){case this.firstButton:d.detail= a.FIRST_BUTTON;break;case this.secondButton:d.detail=a.SECOND_BUTTON}this.closeHandler(d)}};a.prototype.closeButton_clickHandler=function(b){d.prototype.closeButton_clickHandler.call(this,b);c.PopUpManager.removePopUp(this);b=new c.CloseEvent(c.CloseEvent.CLOSE,!1,!1,a.CLOSE_BUTTON);null!=this.closeHandler&&this.closeHandler(b)};a.prototype.partAdded=function(b,a){d.prototype.partAdded.call(this,b,a);a==this.contentDisplay?this.contentDisplay.text=this._contentText:a==this.firstButton?(this.firstButton.label= this._firstButtonLabel,this.firstButton.addEventListener(c.TouchEvent.TOUCH_TAP,this.onClose,this)):a==this.secondButton&&(this.secondButton.label=this._secondButtonLabel,this.secondButton.includeInLayout=this.secondButton.visible=""!=this._secondButtonLabel&&null!=this._secondButtonLabel,this.secondButton.addEventListener(c.TouchEvent.TOUCH_TAP,this.onClose,this))};a.prototype.partRemoved=function(b,a){d.prototype.partRemoved.call(this,b,a);a==this.firstButton?this.firstButton.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onClose,this):a==this.secondButton&&this.secondButton.removeEventListener(c.TouchEvent.TOUCH_TAP,this.onClose,this)};a.FIRST_BUTTON="firstButton";a.SECOND_BUTTON="secondButton";a.CLOSE_BUTTON="closeButton";return a}(c.TitleWindow);c.Alert=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this._slideDuration=500;this._direction=c.ProgressBarDirection.LEFT_TO_RIGHT;this.trackResizedOrMoved=!1}__extends(a,d);Object.defineProperty(a.prototype,"labelFunction",{get:function(){return this._labelFunction},set:function(b){this._labelFunction!=b&&(this._labelFunction=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});a.prototype.valueToLabel=function(b,a){return null!=this.labelFunction?this._labelFunction(b,a):b+" / "+ a};Object.defineProperty(a.prototype,"slideDuration",{get:function(){return this._slideDuration},set:function(b){this._slideDuration!=b&&(this._slideDuration=b,this.animator&&this.animator.isPlaying&&(this.animator.stop(),this._setValue(this.slideToValue)))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"direction",{get:function(){return this._direction},set:function(b){this._direction!=b&&(this._direction=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype, "value",{get:function(){return this._getValue()},set:function(b){this._getValue()!=b&&(0==this._slideDuration||!this.stage?this._setValue(b):(this.validateProperties(),this.slideToValue=this.nearestValidValue(b,this.snapInterval),this.slideToValue!=this._getValue()&&(this.animator||(this.animator=new c.Animation(this.animationUpdateHandler,this)),this.animator.isPlaying&&(this.setValue(this.nearestValidValue(this.animator.motionPaths[0].valueTo,this.snapInterval)),this.animator.stop()),b=this._slideDuration* (Math.abs(this._getValue()-this.slideToValue)/(this.maximum-this.minimum)),this.animator.duration=Infinity===b?0:b,this.animator.motionPaths=[{prop:"value",from:this._getValue(),to:this.slideToValue}],this.animator.play())))},enumerable:!0,configurable:!0});a.prototype.animationUpdateHandler=function(b){this.setValue(this.nearestValidValue(b.currentValue.value,this.snapInterval))};a.prototype.setValue=function(b){d.prototype.setValue.call(this,b);this.invalidateDisplayList()};a.prototype.updateDisplayList= function(b,a){d.prototype.updateDisplayList.call(this,b,a);this.updateSkinDisplayList()};a.prototype.partAdded=function(b,a){a==this.track&&this.track instanceof c.UIComponent&&(this.track.addEventListener(c.ResizeEvent.RESIZE,this.onTrackResizeOrMove,this),this.track.addEventListener(c.MoveEvent.MOVE,this.onTrackResizeOrMove,this))};a.prototype.partRemoved=function(b,a){a==this.track&&this.track instanceof c.UIComponent&&(this.track.removeEventListener(c.ResizeEvent.RESIZE,this.onTrackResizeOrMove, this),this.track.removeEventListener(c.MoveEvent.MOVE,this.onTrackResizeOrMove,this))};a.prototype.onTrackResizeOrMove=function(b){this.trackResizedOrMoved=!0;this.invalidateProperties()};a.prototype.commitProperties=function(){d.prototype.commitProperties.call(this);this.trackResizedOrMoved&&(this.trackResizedOrMoved=!1,this.updateSkinDisplayList())};a.prototype.updateSkinDisplayList=function(){this.trackResizedOrMoved=!1;var b=isNaN(this.value)?0:this.value,a=isNaN(this.maximum)?0:this.maximum; if(this.thumb&&this.track){var d=isNaN(this.track.width)?0:this.track.width,d=d*this.track.scaleX,e=isNaN(this.track.height)?0:this.track.height,e=e*this.track.scaleY,g=Math.round(b/a*d);if(isNaN(g)||0>g||Infinity===g)g=0;var k=Math.round(b/a*e);if(isNaN(k)||0>k||Infinity===k)k=0;var l=this.track.localToGlobal(0,0),n=this.globalToLocal(l.x,l.y),l=n.x,n=n.y;switch(this._direction){case c.ProgressBarDirection.LEFT_TO_RIGHT:this.thumb.width=g;this.thumb.x=l;break;case c.ProgressBarDirection.RIGHT_TO_LEFT:this.thumb.width= g;this.thumb.x=l+d-g;break;case c.ProgressBarDirection.TOP_TO_BOTTOM:this.thumb.height=k;this.thumb.y=n;break;case c.ProgressBarDirection.BOTTOM_TO_TOP:this.thumb.height=k,this.thumb.y=n+e-k}}this.labelDisplay&&(this.labelDisplay.text=this.valueToLabel(b,a))};return a}(c.Range);c.ProgressBar=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.LEFT_TO_RIGHT="leftToRight";c.RIGHT_TO_LEFT="rightToLeft";c.TOP_TO_BOTTOM="topToBottom";c.BOTTOM_TO_TOP="bottomToTop";return c}();c.ProgressBarDirection=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(c){function a(){c.call(this)}__extends(a,c);a.prototype.pointToValue=function(b,a){if(!this.thumb||!this.track)return 0;var c=this.maximum-this.minimum,d=this.track.layoutBoundsWidth-this.thumb.layoutBoundsWidth;return this.minimum+(0!=d?b/d*c:0)};a.prototype.updateSkinDisplayList=function(){if(this.thumb&&this.track){var b=this.track.layoutBoundsWidth-this.thumb.layoutBoundsWidth,a=this.maximum-this.minimum,b=0 c.ListBase.NO_SELECTION&&(this._proposedSelectedIndices?-1==this._proposedSelectedIndices.indexOf(this.selectedIndex)&&this._proposedSelectedIndices.push(this.selectedIndex):this._proposedSelectedIndices=[this.selectedIndex]);this._proposedSelectedIndices&&(-1!=this._proposedSelectedIndices.indexOf(a)&&this.itemSelected(a,!0),this.commitMultipleSelection());b&&e&&(this.dispatchChangeAfterSelection&&(b=new c.IndexChangeEvent(c.IndexChangeEvent.CHANGE),b.oldIndex=a,b.newIndex=this._selectedIndex,this.dispatchEvent(b), this.dispatchChangeAfterSelection=!1),this.dispatchEvent(new c.UIEvent(c.UIEvent.VALUE_COMMIT)));return e};a.prototype.isValidIndex=function(b,a,c){return this.dataProvider&&0<=b&&b=b;a--)d.splice(0,0,a);else if(c)if(0b.width?!0:!1;break;case "on":this._horizontalCanScroll=!0;break;case "off":this._horizontalCanScroll=!1}switch(this._verticalScrollPolicy){case "auto":this._verticalCanScroll=b.contentHeight>b.height?!0:!1;break;case "on":this._verticalCanScroll=!0;break;case "off":this._verticalCanScroll=!1}};a.prototype.onTouchBegan=function(b){this.verticalAnimator&& this.verticalAnimator.isPlaying&&this.verticalAnimator.stop();this.horizontalAnimator&&this.horizontalAnimator.isPlaying&&this.horizontalAnimator.stop();this.checkScrollPolicy();var a=this._viewport,d=a.horizontalScrollPosition,a=a.verticalScrollPosition;this._offsetPointX=d+b.stageX;this._offsetPointY=a+b.stageY;this._velocityY=this._velocityX=0;this._previousVelocityX.length=0;this._previousVelocityY.length=0;this._previousTouchTime=c.getTimer();this._previousTouchX=this._startTouchX=this._currentTouchX= b.stageX;this._previousTouchY=this._startTouchY=this._currentTouchY=b.stageY;this._startHorizontalScrollPosition=d;this._startVerticalScrollPosition=a;c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE,this.onTouchMove,this);c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END,this.onTouchEnd,this);c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE,this.onTouchEnd,this);this.addEventListener(c.Event.ENTER_FRAME,this.enterFrameHandler,this)};a.prototype.onTouchMove=function(b){this._currentTouchX= b.stageX;this._currentTouchY=b.stageY;var a=this._viewport;if(this._horizontalCanScroll){var c=this._offsetPointX-b.stageX;0>c&&(c*=0.5);c>a.contentWidth-a.width&&(c=0.5*(c+a.contentWidth-a.width));a.horizontalScrollPosition=c}this._verticalCanScroll&&(b=this._offsetPointY-b.stageY,0>b&&(b*=0.5),b>a.contentHeight-a.height&&(b=0.5*(b+a.contentHeight-a.height)),a.verticalScrollPosition=b)};a.prototype.onTouchEnd=function(b){c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE,this.onTouchMove, this);c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END,this.onTouchEnd,this);c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE,this.onTouchEnd,this);this.removeEventListener(c.Event.ENTER_FRAME,this.enterFrameHandler,this);this._horizontalCanScroll&&this.checkHorizontalScrollPosition();this._verticalCanScroll&&this.checkVerticalScrollPosition()};a.easeOut=function(b){b-=1;return b*b*b+1};a.prototype.enterFrameHandler=function(b){b=c.getTimer();var a=b-this._previousTouchTime;0< a&&(this._previousVelocityX[this._previousVelocityX.length]=this._velocityX,4=Math.abs(d)?this.finishScrollingHorizontally():(c=this.getAnimationDatas(d,c,b),this.throwHorizontally(c[0],c[1]))};a.prototype.checkVerticalScrollPosition=function(){for(var b=this._viewport,c=b.verticalScrollPosition,b=b.contentHeight-b.height,d=2.33*this._velocityY,e=this._previousVelocityY.length,g=2.33,k=0;k=Math.abs(d)?this.finishScrollingVertically():(c=this.getAnimationDatas(d,c,b),this.throwVertically(c[0],c[1]))};a.prototype.getAnimationDatas=function(b,c,d){var e=Math.abs(b),g=0,k=c+(b-0.02)/Math.log(0.998);if(0>k||k>d)for(k=c;0.02k||k>d?b*0.998*0.95:0.998*b,g++;else g=Math.log(0.02/e)/Math.log(0.998);a.animationData||(a.animationData=[0,0]);b=a.animationData;b[0]=k;b[1]=g;return b};a.prototype.finishScrollingHorizontally= function(b){var a=this._viewport;b=a.horizontalScrollPosition;var a=a.contentWidth-a.width,c=b;0>b&&(c=0);b>a&&(c=a);this.throwHorizontally(c,300)};a.prototype.throwHorizontally=function(b,d){"undefined"===typeof d&&(d=500);var e=this._viewport.horizontalScrollPosition;e!=b&&(this.horizontalAnimator||(this.horizontalAnimator=new c.Animation(this.horizontalUpdateHandler,this),this.horizontalAnimator.endFunction=this.finishScrollingHorizontally,this.horizontalAnimator.easerFunction=a.easeOut),this.horizontalAnimator.isPlaying&& this.horizontalAnimator.stop(),this.horizontalAnimator.duration=d,this.horizontalAnimator.motionPaths=[{prop:"hsp",from:e,to:b}],this.horizontalAnimator.play())};a.prototype.horizontalUpdateHandler=function(b){this._viewport.horizontalScrollPosition=b.currentValue.hsp};a.prototype.finishScrollingVertically=function(b){var a=this._viewport;b=a.verticalScrollPosition;var a=a.contentHeight-a.height,c=b;0>b&&(c=0);b>a&&(c=a);this.throwVertically(c,300)};a.prototype.throwVertically=function(b,d){"undefined"=== typeof d&&(d=500);var e=this._viewport.verticalScrollPosition;e!=b&&(this.verticalAnimator||(this.verticalAnimator=new c.Animation(this.verticalUpdateHandler,this),this.verticalAnimator.endFunction=this.finishScrollingVertically,this.verticalAnimator.easerFunction=a.easeOut),this.verticalAnimator.isPlaying&&this.verticalAnimator.stop(),this.verticalAnimator.duration=d,this.verticalAnimator.motionPaths=[{prop:"vsp",from:e,to:b}],this.verticalAnimator.play())};a.prototype.verticalUpdateHandler=function(b){this._viewport.verticalScrollPosition= b.currentValue.vsp};Object.defineProperty(a.prototype,"numElements",{get:function(){return this.viewport?1:0},enumerable:!0,configurable:!0});a.prototype.throwRangeError=function(b){throw new RangeError('\u7d22\u5f15:"'+b+'"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');};a.prototype.getElementAt=function(b){if(this.viewport&&0==b)return this.viewport;this.throwRangeError(b);return null};a.prototype.getElementIndex=function(b){return null!=b&&b==this.viewport?0:-1};a.prototype.containsElement= function(b){return null!=b&&b==this.viewport?!0:!1};a.prototype.throwNotSupportedError=function(){throw Error("\u6b64\u65b9\u6cd5\u5728Scroller\u7ec4\u4ef6\u5185\u4e0d\u53ef\u7528!");};a.prototype.addElement=function(b){this.throwNotSupportedError();return null};a.prototype.addElementAt=function(b,a){this.throwNotSupportedError();return null};a.prototype.removeElement=function(b){this.throwNotSupportedError();return null};a.prototype.removeElementAt=function(b){this.throwNotSupportedError();return null}; a.prototype.removeAllElements=function(){this.throwNotSupportedError()};a.prototype.setElementIndex=function(b,a){this.throwNotSupportedError()};a.prototype.swapElements=function(b,a){this.throwNotSupportedError()};a.prototype.swapElementsAt=function(b,a){this.throwNotSupportedError()};a.prototype.addChild=function(b){this.throwNotSupportedError();return null};a.prototype.addChildAt=function(b,a){this.throwNotSupportedError();return null};a.prototype.removeChild=function(b){this.throwNotSupportedError(); return null};a.prototype.removeChildAt=function(b){this.throwNotSupportedError();return null};a.prototype.setChildIndex=function(b,a){this.throwNotSupportedError()};a.prototype.swapChildren=function(b,a){this.throwNotSupportedError()};a.prototype.swapChildrenAt=function(b,a){this.throwNotSupportedError()};a.VELOCITY_WEIGHTS=[1,1.33,1.66,2];return a}(c.UIComponent);c.Scroller=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(c){function a(b,a,e){"undefined"===typeof a&&(a=!1);"undefined"===typeof e&&(e=!1);c.call(this,b,a,e)}__extends(a,c);a.INITIALIZE="initialize";a.CREATION_COMPLETE="creationComplete";a.UPDATE_COMPLETE="updateComplete";a.BUTTON_DOWN="buttonDown";a.CHANGE_END="changeEnd";a.CHANGE_START="changeStart";a.CHANGING="changing";a.VALUE_COMMIT="valueCommit";a.SKIN_CHANGED="skinChanged";a.OPEN="open";a.CLOSE="close";a.PLAY_COMPLETE="playComplete";return a}(c.Event);c.UIEvent=e})(ns_egret|| (ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(b,a,c,e,g,k,l,n){"undefined"===typeof a&&(a=!1);"undefined"===typeof c&&(c=!1);"undefined"===typeof e&&(e=null);"undefined"===typeof g&&(g=null);"undefined"===typeof k&&(k=null);"undefined"===typeof l&&(l=null);"undefined"===typeof n&&(n=null);d.call(this,b,a,c);this.kind=e;this.property=g;this.oldValue=k;this.newValue=l;this.source=n}__extends(a,d);a.createUpdateEvent=function(b,d,e,h){var g=new a(this.PROPERTY_CHANGE);g.kind=c.PropertyChangeEventKind.UPDATE; g.oldValue=e;g.newValue=h;g.source=b;g.property=d;return g};a.PROPERTY_CHANGE="propertyChange";return a}(c.Event);c.PropertyChangeEvent=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.UPDATE="update";c.DELETE="delete";return c}();c.PropertyChangeEventKind=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(b,a,e,h,g){"undefined"===typeof a&&(a=NaN);"undefined"===typeof e&&(e=NaN);"undefined"===typeof h&&(h=!1);"undefined"===typeof g&&(g=!1);c.call(this,b,h,g);this.oldX=a;this.oldY=e}__extends(a,c);a.MOVE="move";return a}(c.Event);c.MoveEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(b,a,e,h,g){"undefined"===typeof a&&(a=NaN);"undefined"===typeof e&&(e=NaN);"undefined"===typeof h&&(h=!1);"undefined"===typeof g&&(g=!1);c.call(this,b,h,g);this.oldWidth=a;this.oldHeight=e}__extends(a,c);a.RESIZE="resize";return a}(c.Event);c.ResizeEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(c){function a(b,a,e,h,g){"undefined"===typeof a&&(a=!1);"undefined"===typeof e&&(e=!1);"undefined"===typeof h&&(h=null);"undefined"===typeof g&&(g=null);c.call(this,b,a,e);this.partName=h;this.instance=g}__extends(a,c);a.PART_ADDED="partAdded";a.PART_REMOVED="partRemoved";return a}(c.Event);c.SkinPartEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(b,a,e,h){"undefined"===typeof a&&(a=!1);"undefined"===typeof e&&(e=!1);"undefined"===typeof h&&(h=-1);c.call(this,b,a,e);this.detail=h}__extends(a,c);a.CLOSE="close";return a}(c.Event);c.CloseEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(c){function a(a,e,m,h,g,k,l,n){"undefined"===typeof e&&(e=!1);"undefined"===typeof m&&(m=!1);"undefined"===typeof h&&(h=null);"undefined"===typeof g&&(g=-1);"undefined"===typeof k&&(k=-1);"undefined"===typeof l&&(l=null);"undefined"===typeof n&&(n=null);c.call(this,a,e,m);this.kind=h;this.location=g;this.oldLocation=k;this.items=l?l:[];this.oldItems=n?n:[]}__extends(a,c);a.COLLECTION_CHANGE="collectionChange";return a}(c.Event);c.CollectionEvent=e})(ns_egret||(ns_egret= {}));(function(c){var e=function(){function c(){}c.ADD="add";c.MOVE="move";c.REFRESH="refresh";c.REMOVE="remove";c.REPLACE="replace";c.RESET="reset";c.UPDATE="update";c.OPEN="open";c.CLOSE="close";return c}();c.CollectionEventKind=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(c){function a(a,e,m,h,g){"undefined"===typeof e&&(e=!1);"undefined"===typeof m&&(m=!1);"undefined"===typeof h&&(h=null);"undefined"===typeof g&&(g=-1);c.call(this,a,e,m);this.element=h;this.index=g}__extends(a,c);a.ELEMENT_ADD="elementAdd";a.ELEMENT_REMOVE="elementRemove";return a}(c.Event);c.ElementExistenceEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(c){function a(a,e,m,h,g){"undefined"===typeof e&&(e=!1);"undefined"===typeof m&&(m=!1);"undefined"===typeof h&&(h=-1);"undefined"===typeof g&&(g=-1);c.call(this,a,e,m);this.oldIndex=h;this.newIndex=g}__extends(a,c);a.CHANGE="change";a.CHANGING="changing";return a}(c.Event);c.IndexChangeEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(c){function a(a,e,m,h,g,k,l,n,p,q,v,F,r){"undefined"===typeof e&&(e=!0);"undefined"===typeof m&&(m=!0);"undefined"===typeof h&&(h=0);"undefined"===typeof g&&(g=0);"undefined"===typeof k&&(k=0);"undefined"===typeof l&&(l=!1);"undefined"===typeof n&&(n=!1);"undefined"===typeof p&&(p=!1);"undefined"===typeof q&&(q=!1);"undefined"===typeof v&&(v=-1);"undefined"===typeof F&&(F=null);"undefined"===typeof r&&(r=null);c.call(this,a,e,m,h,g,k,l,n,p,q);this.itemIndex=v;this.item= F;this.itemRenderer=r}__extends(a,c);a.ITEM_ROLL_OUT="itemRollOut";a.ITEM_ROLL_OVER="itemRollOver";a.ITEM_CLICK="itemClick";return a}(c.TouchEvent);c.ListEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(c){function a(a,e,m,h,g){"undefined"===typeof e&&(e=!1);"undefined"===typeof m&&(m=!1);"undefined"===typeof h&&(h=null);"undefined"===typeof g&&(g=!1);c.call(this,a,e,m);this.popUp=h;this.modal=g}__extends(a,c);a.ADD_POPUP="addPopUp";a.REMOVE_POPUP="removePopUp";a.BRING_TO_FRONT="bringToFront";return a}(c.Event);c.PopUpEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(c){function a(a,e,m,h,g,k){"undefined"===typeof e&&(e=!1);"undefined"===typeof m&&(m=!1);"undefined"===typeof h&&(h=null);"undefined"===typeof g&&(g=-1);"undefined"===typeof k&&(k=null);c.call(this,a,e,m);this.renderer=h;this.index=g;this.data=k}__extends(a,c);a.RENDERER_ADD="rendererAdd";a.RENDERER_REMOVE="rendererRemove";return a}(c.Event);c.RendererExistenceEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(c){function a(a,e,m,h,g){"undefined"===typeof e&&(e=!1);"undefined"===typeof m&&(m=!1);"undefined"===typeof h&&(h=null);"undefined"===typeof g&&(g=null);c.call(this,a,e,m);this.oldState=h;this.newState=g}__extends(a,c);a.CURRENT_STATE_CHANGE="currentStateChange";a.CURRENT_STATE_CHANGING="currentStateChanging";return a}(c.Event);c.StateChangeEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(a,e,m){"undefined"===typeof e&&(e=!1);"undefined"===typeof m&&(m=!1);c.call(this,a,e,m)}__extends(a,c);a.THUMB_DRAG="thumbDrag";a.THUMB_PRESS="thumbPress";a.THUMB_RELEASE="thumbRelease";return a}(c.Event);c.TrackBaseEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(c){function a(a,e,m,h,g,k){"undefined"===typeof e&&(e=!1);"undefined"===typeof m&&(m=!0);"undefined"===typeof h&&(h=-1);"undefined"===typeof g&&(g=null);"undefined"===typeof k&&(k=null);c.call(this,a,e,m);this.item=g;this.itemRenderer=k;this.itemIndex=h}__extends(a,c);a.ITEM_CLOSE="itemClose";a.ITEM_OPEN="itemOpen";a.ITEM_OPENING="itemOpening";return a}(c.Event);c.TreeEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this._verticalScrollPosition=this._horizontalScrollPosition=0;this._useVirtualLayout=this._clipAndEnableScrolling=!1}__extends(a,d);Object.defineProperty(a.prototype,"target",{get:function(){return this._target},set:function(a){this._target!=a&&(this._target=a,this.clearVirtualLayoutCache())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"horizontalScrollPosition",{get:function(){return this._horizontalScrollPosition},set:function(a){if(a!= this._horizontalScrollPosition){var d=this._horizontalScrollPosition;this._horizontalScrollPosition=a;this.scrollPositionChanged();this.dispatchEvent(c.PropertyChangeEvent.createUpdateEvent(this,"horizontalScrollPosition",d,a))}},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"verticalScrollPosition",{get:function(){return this._verticalScrollPosition},set:function(a){if(a!=this._verticalScrollPosition){var d=this._verticalScrollPosition;this._verticalScrollPosition=a;this.scrollPositionChanged(); this.dispatchEvent(c.PropertyChangeEvent.createUpdateEvent(this,"verticalScrollPosition",d,a))}},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"clipAndEnableScrolling",{get:function(){return this._clipAndEnableScrolling},set:function(a){a!=this._clipAndEnableScrolling&&(this._clipAndEnableScrolling=a,null!=this.target&&this.updateScrollRect(this.target.width,this.target.height))},enumerable:!0,configurable:!0});a.prototype.getHorizontalScrollPositionDelta=function(a){var d=this.target; if(!d)return 0;var e=this.getScrollRect();if(!e||0==e.x&&e.width>=d.contentWidth)return 0;var d=d.contentWidth-e.right,h=-e.x,g;switch(a){case c.NavigationUnit.LEFT:case c.NavigationUnit.PAGE_LEFT:g=this.getElementBoundsLeftOfScrollRect(e);break;case c.NavigationUnit.RIGHT:case c.NavigationUnit.PAGE_RIGHT:g=this.getElementBoundsRightOfScrollRect(e);break;case c.NavigationUnit.HOME:return h;case c.NavigationUnit.END:return d;default:return 0}if(!g)return 0;var k=0;switch(a){case c.NavigationUnit.LEFT:k= Math.max(g.x-e.x,-e.width);break;case c.NavigationUnit.RIGHT:k=Math.min(g.right-e.right,e.width);break;case c.NavigationUnit.PAGE_LEFT:k=g.right-e.right;0<=k&&(k=Math.max(g.x-e.x,-e.width));break;case c.NavigationUnit.PAGE_RIGHT:k=g.x-e.x,0>=k&&(k=Math.min(g.right-e.right,e.width))}return Math.min(d,Math.max(h,k))};a.prototype.getVerticalScrollPositionDelta=function(a){var d=this.target;if(!d)return 0;var e=this.getScrollRect();if(!e||0==e.y&&e.height>=d.contentHeight)return 0;var d=d.contentHeight- e.bottom,h=-e.y,g;switch(a){case c.NavigationUnit.UP:case c.NavigationUnit.PAGE_UP:g=this.getElementBoundsAboveScrollRect(e);break;case c.NavigationUnit.DOWN:case c.NavigationUnit.PAGE_DOWN:g=this.getElementBoundsBelowScrollRect(e);break;case c.NavigationUnit.HOME:return h;case c.NavigationUnit.END:return d;default:return 0}if(!g)return 0;var k=0;switch(a){case c.NavigationUnit.UP:k=Math.max(g.y-e.y,-e.height);break;case c.NavigationUnit.DOWN:k=Math.min(g.bottom-e.bottom,e.height);break;case c.NavigationUnit.PAGE_UP:k= g.bottom-e.bottom;0<=k&&(k=Math.max(g.y-e.y,-e.height));break;case c.NavigationUnit.PAGE_DOWN:k=g.y-e.y,0>=k&&(k=Math.min(g.bottom-e.bottom,e.height))}return Math.min(d,Math.max(h,k))};a.prototype.getScrollRect=function(){var a=this.target;return!a||!a.clipAndEnableScrolling?null:new c.Rectangle(a.horizontalScrollPosition,a.verticalScrollPosition,a.width,a.height)};a.prototype.getElementBoundsLeftOfScrollRect=function(a){var d=new c.Rectangle;d.x=a.x-1;d.right=a.x;return d};a.prototype.getElementBoundsRightOfScrollRect= function(a){var d=new c.Rectangle;d.x=a.right;d.right=a.right+1;return d};a.prototype.getElementBoundsAboveScrollRect=function(a){var d=new c.Rectangle;d.y=a.y-1;d.bottom=a.y;return d};a.prototype.getElementBoundsBelowScrollRect=function(a){var d=new c.Rectangle;d.y=a.bottom;d.bottom=a.bottom+1;return d};a.prototype.scrollPositionChanged=function(){null!=this.target&&(this.updateScrollRect(this.target.width,this.target.height),this.target.invalidateDisplayListExceptLayout())};a.prototype.updateScrollRect= function(a,d){null!=this.target&&(this.target.scrollRect=this._clipAndEnableScrolling?new c.Rectangle(this._horizontalScrollPosition,this._verticalScrollPosition,a,d):null)};Object.defineProperty(a.prototype,"useVirtualLayout",{get:function(){return this._useVirtualLayout},set:function(a){this._useVirtualLayout!=a&&(this._useVirtualLayout=a,this.dispatchEvent(new c.Event("useVirtualLayoutChanged")),this._useVirtualLayout&&!a&&this.clearVirtualLayoutCache(),this.target&&this.target.invalidateDisplayList())}, enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"typicalLayoutRect",{get:function(){return this._typicalLayoutRect},set:function(a){this._typicalLayoutRect!=a&&(this._typicalLayoutRect=a,this.target&&this.target.invalidateSize())},enumerable:!0,configurable:!0});a.prototype.clearVirtualLayoutCache=function(){};a.prototype.elementAdded=function(a){};a.prototype.elementRemoved=function(a){};a.prototype.measure=function(){};a.prototype.updateDisplayList=function(a,c){};return a}(c.EventDispatcher); c.LayoutBase=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d}; (function(c){var e=function(d){function a(){d.call(this);this._mouseWheelSpeed=20}__extends(a,d);Object.defineProperty(a.prototype,"useVirtualLayout",{set:function(a){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"mouseWheelSpeed",{get:function(){return this._mouseWheelSpeed},set:function(a){0==a&&(a=1);this._mouseWheelSpeed=a},enumerable:!0,configurable:!0});a.prototype.getElementBoundsLeftOfScrollRect=function(a){var d=new c.Rectangle;d.x=a.x-this._mouseWheelSpeed;d.right= a.x;return d};a.prototype.getElementBoundsRightOfScrollRect=function(a){var d=new c.Rectangle;d.x=a.right;d.right=a.right+this._mouseWheelSpeed;return d};a.prototype.getElementBoundsAboveScrollRect=function(a){var d=new c.Rectangle;d.y=a.y-this._mouseWheelSpeed;d.bottom=a.y;return d};a.prototype.getElementBoundsBelowScrollRect=function(a){var d=new c.Rectangle;d.y=a.bottom;d.bottom=a.bottom+this._mouseWheelSpeed;return d};a.prototype.measure=function(){d.prototype.measure.call(this);if(null!=this.target){for(var a= 0,c=0,e=this.target.numElements,h=0;h=e&&ad-c)return this.endIndex=this.startIndex=-1,!1;c=this.target.verticalScrollPosition+this.target.height;if(cE){s=I/x;for(z=0;zE&&u.preferredHeight>s&&(C=I/w),isNaN(C)||(x=Math.round(C+q),q+=C-x)):x=G[u.hashCode], F?(C=g,u.setLayoutBoundsSize(K,x)):(C=NaN,isNaN(u.percentWidth)||(C=Math.min(100,u.percentWidth),C=Math.round(0.01*p*C)),u.setLayoutBoundsSize(C,x),C=(p-u.layoutBoundsWidth)*r,C=0=l||(b-=l-n);l=!1;break}else if(F>v.max){l=v.max;v.size=l;d[q]=d[--e];d[e]=v;c-=v.percent;n>=l||(b-=l-n);l=!1;break}else v.size=F}}while(!l)};b.prototype.getElementBoundsAboveScrollRect=function(a){var b=new c.Rectangle;if(!this.target)return b;var d=this.findIndexAt(a.y,0,this.target.numElements-1),e=isNaN(this._padding)?0:this._padding,k=isNaN(this._paddingTop)?e:this._paddingTop, e=isNaN(this._paddingBottom)?e:this._paddingBottom;if(-1==d)return a.y>this.target.contentHeight-e?(b.y=this.target.contentHeight-e,b.bottom=this.target.contentHeight):(b.y=0,b.bottom=k),b;b.y=this.getStartPosition(d);b.bottom=this.getElementSize(d)+b.y;b.y==a.y&&(d--,-1!=d?(b.y=this.getStartPosition(d),b.bottom=this.getElementSize(d)+b.y):(b.y=0,b.bottom=k));return b};b.prototype.getElementBoundsBelowScrollRect=function(a){var b=new c.Rectangle;if(!this.target)return b;var d=this.target.numElements, e=this.findIndexAt(a.bottom,0,d-1),k=isNaN(this._padding)?0:this._padding,l=isNaN(this._paddingTop)?k:this._paddingTop,k=isNaN(this._paddingBottom)?k:this._paddingBottom;if(-1==e)return a.right=e&&ad-c)return this.endIndex=this.startIndex=-1,!1;c=this.target.horizontalScrollPosition+this.target.width;if(cE){s=I/x;for(z=0;zE&&u.preferredWidth>s&&(A=I/w),isNaN(A)||(x=Math.round(A+p),p+=A-x)):x=G[u.hashCode],F?(A=l,u.setLayoutBoundsSize(x,K)):(A=NaN,isNaN(u.percentHeight)||(A=Math.min(100,u.percentHeight),A=Math.round(0.01*q*A)),u.setLayoutBoundsSize(x,A),A=(q-u.layoutBoundsHeight)*r,A=0=l||(b-=l-n);l=!1;break}else if(F>v.max){l=v.max;v.size=l;d[q]=d[--e];d[e]=v;c-=v.percent;n>=l||(b-=l-n);l=!1;break}else v.size=F}}while(!l)};b.prototype.getElementBoundsLeftOfScrollRect=function(a){var b=new c.Rectangle;if(!this.target)return b;var d=isNaN(this._padding)? 0:this._padding,e=isNaN(this._paddingLeft)?d:this._paddingLeft,d=isNaN(this._paddingRight)?d:this._paddingRight,k=this.findIndexAt(a.x,0,this.target.numElements-1);if(-1==k)return a.x>this.target.contentWidth-d?(b.x=this.target.contentWidth-d,b.right=this.target.contentWidth):(b.x=0,b.right=e),b;b.x=this.getStartPosition(k);b.right=this.getElementSize(k)+b.x;b.x==a.x&&(k--,-1!=k?(b.x=this.getStartPosition(k),b.right=this.getElementSize(k)+b.x):(b.x=0,b.right=e));return b};b.prototype.getElementBoundsRightOfScrollRect= function(a){var b=new c.Rectangle;if(!this.target)return b;var d=this.target.numElements,e=isNaN(this._padding)?0:this._padding,k=isNaN(this._paddingLeft)?e:this._paddingLeft,e=isNaN(this._paddingRight)?e:this._paddingRight,l=this.findIndexAt(a.right,0,d-1);if(-1==l)return a.right=k&&(k=1);l=this._rowHeight+h;0>=l&&(l=1);var n=this.orientation==c.TileOrientation.COLUMNS,p=!isNaN(a),q=!isNaN(d),v=isNaN(this._padding)?0:this._padding,F=isNaN(this._paddingLeft)?v:this._paddingLeft,r=isNaN(this._paddingRight)?v:this._paddingRight,D=isNaN(this._paddingTop)?v:this._paddingTop,v=isNaN(this._paddingBottom)?v:this._paddingBottom;0=k)return this.startIndex=0,this.endIndex=a-1, !1;l=this.target.horizontalScrollPosition+this.target.width;h=Math.floor((this.target.horizontalScrollPosition-g)/k);0>h&&(h=0);g=Math.ceil((l-g)/k);0>g&&(g=0);this.startIndex=Math.min(a-1,Math.max(0,h*this._rowCount));this.endIndex=Math.min(a-1,Math.max(0,g*this._rowCount-1))}else{k=this._rowHeight+l;if(0>=k)return this.startIndex=0,this.endIndex=a-1,!1;l=this.target.verticalScrollPosition+this.target.height;g=Math.floor((this.target.verticalScrollPosition-h)/k);0>g&&(g=0);h=Math.ceil((l-h)/k);0> h&&(h=0);this.startIndex=Math.min(a-1,Math.max(0,g*this._columnCount));this.endIndex=Math.min(a-1,Math.max(0,h*this._columnCount-1))}return this.startIndex!=d||this.endIndex!=e};a.prototype.updateDisplayList=function(a,e){d.prototype.updateDisplayList.call(this,a,e);if(this.target){var m=isNaN(this._padding)?0:this._padding,h=isNaN(this._paddingLeft)?m:this._paddingLeft,g=isNaN(this._paddingRight)?m:this._paddingRight,k=isNaN(this._paddingTop)?m:this._paddingTop,l=isNaN(this._paddingBottom)?m:this._paddingBottom, m=isNaN(this._horizontalGap)?0:this._horizontalGap,n=isNaN(this._verticalGap)?0:this._verticalGap;if(this.indexInViewCalculated)this.indexInViewCalculated=!1;else{this.calculateRowAndColumn(a,e);if(0==this._rowCount||0==this._columnCount){this.target.setContentSize(h+g,k+l);return}this.adjustForJustify(a,e);this.getIndexInView()}this.useVirtualLayout&&(this.calculateRowAndColumn(a,e),this.adjustForJustify(a,e));if(-1==this.startIndex||-1==this.endIndex)this.target.setContentSize(0,0);else{this.target.setVirtualElementIndicesInView(this.startIndex, this.endIndex);for(var p,q,v,F=this.orientation==c.TileOrientation.COLUMNS,r=this.startIndex,D=this.startIndex;D<=this.endIndex;D++)p=this.useVirtualLayout?this.target.getVirtualElementAt(D):this.target.getElementAt(D),null!=p&&p.includeInLayout&&(F?(q=Math.ceil((r+1)/this._rowCount)-1,v=Math.ceil((r+1)%this._rowCount)-1,-1==v&&(v=this._rowCount-1)):(q=Math.ceil((r+1)%this._columnCount)-1,-1==q&&(q=this._columnCount-1),v=Math.ceil((r+1)/this._columnCount)-1),q=q*(this._columnWidth+m)+h,v=v*(this._rowHeight+ n)+k,this.sizeAndPositionElement(p,q,v,this._columnWidth,this.rowHeight),r++);k+=l;n=(this._rowHeight+n)*this._rowCount-n;this.target.setContentSize(Math.ceil((this._columnWidth+m)*this._columnCount-m+(h+g)),Math.ceil(n+k))}}};a.prototype.sizeAndPositionElement=function(a,d,e,h,g){var k=NaN,l=NaN;this.horizontalAlign==c.HorizontalAlign.JUSTIFY?k=h:isNaN(a.percentWidth)||(k=0.01*h*a.percentWidth);this.verticalAlign==c.VerticalAlign.JUSTIFY?l=g:isNaN(a.percentHeight)||(l=0.01*g*a.percentHeight);a.setLayoutBoundsSize(Math.round(k), Math.round(l));k=d;switch(this.horizontalAlign){case c.HorizontalAlign.RIGHT:k+=h-a.layoutBoundsWidth;break;case c.HorizontalAlign.CENTER:k=d+(h-a.layoutBoundsWidth)/2}d=e;switch(this.verticalAlign){case c.VerticalAlign.BOTTOM:d+=g-a.layoutBoundsHeight;break;case c.VerticalAlign.MIDDLE:d+=(g-a.layoutBoundsHeight)/2}a.setLayoutBoundsPosition(Math.round(k),Math.round(d))};a.prototype.adjustForJustify=function(a,d){var e=isNaN(this._padding)?0:this._padding,h=isNaN(this._paddingLeft)?e:this._paddingLeft, g=isNaN(this._paddingRight)?e:this._paddingRight,k=isNaN(this._paddingTop)?e:this._paddingTop,e=isNaN(this._paddingBottom)?e:this._paddingBottom,h=Math.max(0,a-h-g),k=Math.max(0,d-k-e);isNaN(this.explicitVerticalGap)||(this._verticalGap=this.explicitVerticalGap);isNaN(this.explicitHorizontalGap)||(this._horizontalGap=this.explicitHorizontalGap);this._verticalGap=isNaN(this._verticalGap)?0:this._verticalGap;this._horizontalGap=isNaN(this._horizontalGap)?0:this._horizontalGap;k-=this._rowHeight*this._rowCount; h-=this._columnWidth*this._columnCount;0this.target.contentWidth-e?(d.x=this.target.contentWidth-e,d.right=this.target.contentWidth):a.x>h?(a=Math.floor((a.x-1-h)/(this._columnWidth+g)),d.x=this.leftEdge(a),d.right=this.rightEdge(a)): (d.x=0,d.right=h);return d};a.prototype.getElementBoundsRightOfScrollRect=function(a){var d=isNaN(this._padding)?0:this._padding,e=isNaN(this._paddingLeft)?d:this._paddingLeft,h=isNaN(this._paddingRight)?d:this._paddingRight,g=isNaN(this._horizontalGap)?0:this._horizontalGap,d=new c.Rectangle;a.rightthis.target.contentHeight-h?(d.y=this.target.contentHeight-h,d.bottom=this.target.contentHeight):a.y>e?(a=Math.floor((a.y-1-e)/(this._rowHeight+g)),d.y=this.topEdge(a),d.bottom=this.bottomEdge(a)):(d.y=0,d.bottom=e);return d};a.prototype.getElementBoundsBelowScrollRect= function(a){var d=isNaN(this._padding)?0:this._padding,e=isNaN(this._paddingTop)?d:this._paddingTop,h=isNaN(this._paddingBottom)?d:this._paddingBottom,g=isNaN(this._verticalGap)?0:this._verticalGap,d=new c.Rectangle;a.bottom a)return 0;var c=isNaN(this._padding)?0:this._padding,c=isNaN(this._paddingLeft)?c:this._paddingLeft,d=isNaN(this._horizontalGap)?0:this._horizontalGap;return Math.max(0,a*(this._columnWidth+d))+c};a.prototype.rightEdge=function(a){if(0>a)return 0;var c=isNaN(this._padding)?0:this._padding,c=isNaN(this._paddingLeft)?c:this._paddingLeft,d=isNaN(this._horizontalGap)?0:this._horizontalGap;return Math.min(this.target.contentWidth,a*(this._columnWidth+d)+this._columnWidth)+c};a.prototype.topEdge=function(a){if(0> a)return 0;var c=isNaN(this._padding)?0:this._padding,c=isNaN(this._paddingTop)?c:this._paddingTop,d=isNaN(this._verticalGap)?0:this._verticalGap;return Math.max(0,a*(this._rowHeight+d))+c};a.prototype.bottomEdge=function(a){if(0>a)return 0;var c=isNaN(this._padding)?0:this._padding,c=isNaN(this._paddingTop)?c:this._paddingTop,d=isNaN(this._verticalGap)?0:this._verticalGap;return Math.min(this.target.contentHeight,a*(this._rowHeight+d)+this._rowHeight)+c};return a}(c.LayoutBase);c.TileLayout=e})(ns_egret|| (ns_egret={}));(function(c){var e=function(){function c(a,b,d){this.raw_getElementAt="raw_getElementAt";this.raw_addElementAt="raw_addElementAt";this.raw_getElementIndex="raw_getElementIndex";this.raw_removeElement="raw_removeElement";this.raw_removeElementAt="raw_removeElementAt";this.raw_setElementIndex="raw_setElementIndex";this.owner=a;this.lowerBoundReference=b;this.upperBoundReference=d}Object.defineProperty(c.prototype,"numElements",{get:function(){return this.owner[this.upperBoundReference]-this.owner[this.lowerBoundReference]}, enumerable:!0,configurable:!0});c.prototype.getElementAt=function(a){return this.owner[this.raw_getElementAt](this.owner[this.lowerBoundReference]+a)};c.prototype.addElement=function(a){var b=this.owner[this.upperBoundReference];a.parent===this.owner&&b--;this.owner[this.upperBoundReference]++;this.owner[this.raw_addElementAt](a,b);a.ownerChanged(this);return a};c.prototype.addElementAt=function(a,b){this.owner[this.upperBoundReference]++;this.owner[this.raw_addElementAt](a,this.owner[this.lowerBoundReference]+ b);a.ownerChanged(this);return a};c.prototype.removeElement=function(a){var b=this.owner[this.raw_getElementIndex](a);this.owner[this.lowerBoundReference]<=b&&b=this._noTopMostIndex&&e=this._topMostIndex&&ethis._noTopMostIndex&&c<=this._topMostIndex?this.topMostIndex++:c>this._topMostIndex&&c<=this._toolTipIndex?this.toolTipIndex++:this.cursorIndex++;return d.prototype.addElementAt.call(this,a,c)};a.prototype.removeElement=function(a){return this.removeElementAt(d.prototype.getElementIndex.call(this, a))};a.prototype.removeElementAt=function(a){var c=d.prototype.removeElementAt.call(this,a);a=this._noTopMostIndex&&a=this._topMostIndex&&a=this._noTopMostIndex&&e=this._topMostIndex&&ea){var b=0.001*(new Date).getTime();a=b-this.time;this.time=b}a*=this.timeScale;b=this._animatableList.length;if(0!=b){for(var c=0,d=0;da._pool.indexOf(b)&&(a._pool[a._pool.length]=b);b.clear()};a._clear=function(){for(var b=a._pool.length;b--;)a._pool[b].clear();a._pool.length=0};a.getEaseValue=function(b,c){if(1c&&(d=1-Math.cos(b*a.HALF_PI)-b,c*=-1);return d*c+b};a.prototype.fadeIn=function(a,b,c){this._bone=a;this._animationState=b;this._timeline=c;this._originTransform=this._timeline.originTransform; this._originPivot=this._timeline.originPivot;this._tweenColor=this._tweenTransform=!1;this._totalTime=this._animationState.totalTime;this.transform.x=0;this.transform.y=0;this.transform.scaleX=0;this.transform.scaleY=0;this.transform.skewX=0;this.transform.skewY=0;this.pivot.x=0;this.pivot.y=0;this._durationTransform.x=0;this._durationTransform.y=0;this._durationTransform.scaleX=0;this._durationTransform.scaleY=0;this._durationTransform.skewX=0;this._durationTransform.skewY=0;this._durationPivot.x= 0;this._durationPivot.y=0;this._currentFrame=null;switch(this._timeline.getFrameList().length){case 0:this._bone._arriveAtFrame(null,this,this._animationState,!1);this._updateState=0;break;case 1:this._updateState=-1;break;default:this._updateState=1}};a.prototype.fadeOut=function(){this.transform.skewX=f.TransformUtil.formatRadian(this.transform.skewX);this.transform.skewY=f.TransformUtil.formatRadian(this.transform.skewY)};a.prototype.update=function(b){if(this._updateState)if(0this._currentFramePosition+this._currentFrameDuration||d=this._timeline.getFrameList().length&&(h=0),this._currentFrame=this._timeline.getFrameList()[h]): (h=0,this._currentFrame=this._timeline.getFrameList()[0]),this._currentFrameDuration=this._currentFrame.duration,this._currentFramePosition=this._currentFrame.position;e&&(this.tweenActive=0<=this._currentFrame.displayIndex,h++,h>=this._timeline.getFrameList().length&&(h=0),e=this._timeline.getFrameList()[h],0==h&&this._animationState.loop&&this._animationState.loopCount>=Math.abs(this._animationState.loop)-1&&0.99999999<((this._currentFramePosition+this._currentFrameDuration)/this._totalTime+c-this._timeline.offset)* this._timeline.scale?(this._updateState=0,this._tweenEasing=NaN):0>this._currentFrame.displayIndex||0>e.displayIndex||!this._animationState.tweenEnabled?this._tweenEasing=NaN:isNaN(this._animationState.clip.tweenEasing)?this._tweenEasing=this._currentFrame.tweenEasing:this._tweenEasing=this._animationState.clip.tweenEasing,isNaN(this._tweenEasing)?this._tweenColor=this._tweenTransform=!1:(this._durationTransform.x=e.transform.x-this._currentFrame.transform.x,this._durationTransform.y=e.transform.y- this._currentFrame.transform.y,this._durationTransform.skewX=e.transform.skewX-this._currentFrame.transform.skewX,this._durationTransform.skewY=e.transform.skewY-this._currentFrame.transform.skewY,this._durationTransform.scaleX=e.transform.scaleX-this._currentFrame.transform.scaleX,this._durationTransform.scaleY=e.transform.scaleY-this._currentFrame.transform.scaleY,0==h&&(this._durationTransform.skewX=f.TransformUtil.formatRadian(this._durationTransform.skewX),this._durationTransform.skewY=f.TransformUtil.formatRadian(this._durationTransform.skewY)), this._durationPivot.x=e.pivot.x-this._currentFrame.pivot.x,this._durationPivot.y=e.pivot.y-this._currentFrame.pivot.y,this._tweenTransform=0!=this._durationTransform.x||0!=this._durationTransform.y||0!=this._durationTransform.skewX||0!=this._durationTransform.skewY||0!=this._durationTransform.scaleX||0!=this._durationTransform.scaleY||0!=this._durationPivot.x||0!=this._durationPivot.y?!0:!1,this._currentFrame.color&&e.color?(this._durationColor.alphaOffset=e.color.alphaOffset-this._currentFrame.color.alphaOffset, this._durationColor.redOffset=e.color.redOffset-this._currentFrame.color.redOffset,this._durationColor.greenOffset=e.color.greenOffset-this._currentFrame.color.greenOffset,this._durationColor.blueOffset=e.color.blueOffset-this._currentFrame.color.blueOffset,this._durationColor.alphaMultiplier=e.color.alphaMultiplier-this._currentFrame.color.alphaMultiplier,this._durationColor.redMultiplier=e.color.redMultiplier-this._currentFrame.color.redMultiplier,this._durationColor.greenMultiplier=e.color.greenMultiplier- this._currentFrame.color.greenMultiplier,this._durationColor.blueMultiplier=e.color.blueMultiplier-this._currentFrame.color.blueMultiplier,this._tweenColor=0!=this._durationColor.alphaOffset||0!=this._durationColor.redOffset||0!=this._durationColor.greenOffset||0!=this._durationColor.blueOffset||0!=this._durationColor.alphaMultiplier||0!=this._durationColor.redMultiplier||0!=this._durationColor.greenMultiplier||0!=this._durationColor.blueMultiplier?!0:!1):this._currentFrame.color?(this._tweenColor= !0,this._durationColor.alphaOffset=-this._currentFrame.color.alphaOffset,this._durationColor.redOffset=-this._currentFrame.color.redOffset,this._durationColor.greenOffset=-this._currentFrame.color.greenOffset,this._durationColor.blueOffset=-this._currentFrame.color.blueOffset,this._durationColor.alphaMultiplier=1-this._currentFrame.color.alphaMultiplier,this._durationColor.redMultiplier=1-this._currentFrame.color.redMultiplier,this._durationColor.greenMultiplier=1-this._currentFrame.color.greenMultiplier, this._durationColor.blueMultiplier=1-this._currentFrame.color.blueMultiplier):e.color?(this._tweenColor=!0,this._durationColor.alphaOffset=e.color.alphaOffset,this._durationColor.redOffset=e.color.redOffset,this._durationColor.greenOffset=e.color.greenOffset,this._durationColor.blueOffset=e.color.blueOffset,this._durationColor.alphaMultiplier=e.color.alphaMultiplier-1,this._durationColor.redMultiplier=e.color.redMultiplier-1,this._durationColor.greenMultiplier=e.color.greenMultiplier-1,this._durationColor.blueMultiplier= e.color.blueMultiplier-1):this._tweenColor=!1),this._tweenTransform||(this._animationState.blend?(this.transform.x=this._originTransform.x+this._currentFrame.transform.x,this.transform.y=this._originTransform.y+this._currentFrame.transform.y,this.transform.skewX=this._originTransform.skewX+this._currentFrame.transform.skewX,this.transform.skewY=this._originTransform.skewY+this._currentFrame.transform.skewY,this.transform.scaleX=this._originTransform.scaleX+this._currentFrame.transform.scaleX,this.transform.scaleY= this._originTransform.scaleY+this._currentFrame.transform.scaleY,this.pivot.x=this._originPivot.x+this._currentFrame.pivot.x,this.pivot.y=this._originPivot.y+this._currentFrame.pivot.y):(this.transform.x=this._currentFrame.transform.x,this.transform.y=this._currentFrame.transform.y,this.transform.skewX=this._currentFrame.transform.skewX,this.transform.skewY=this._currentFrame.transform.skewY,this.transform.scaleX=this._currentFrame.transform.scaleX,this.transform.scaleY=this._currentFrame.transform.scaleY, this.pivot.x=this._currentFrame.pivot.x,this.pivot.y=this._currentFrame.pivot.y)),this._tweenColor||(this._currentFrame.color?this._bone._updateColor(this._currentFrame.color.alphaOffset,this._currentFrame.color.redOffset,this._currentFrame.color.greenOffset,this._currentFrame.color.blueOffset,this._currentFrame.color.alphaMultiplier,this._currentFrame.color.redMultiplier,this._currentFrame.color.greenMultiplier,this._currentFrame.color.blueMultiplier,!0):this._bone._isColorChanged&&this._bone._updateColor(0, 0,0,0,1,1,1,1,!1)),this._bone._arriveAtFrame(this._currentFrame,this,this._animationState,!1));if(this._tweenTransform||this._tweenColor)b=(d-this._currentFramePosition)/this._currentFrameDuration,this._tweenEasing&&(b=a.getEaseValue(b,this._tweenEasing));this._tweenTransform&&(c=this._currentFrame.transform,d=this._currentFrame.pivot,this._animationState.blend?(this.transform.x=this._originTransform.x+c.x+this._durationTransform.x*b,this.transform.y=this._originTransform.y+c.y+this._durationTransform.y* b,this.transform.skewX=this._originTransform.skewX+c.skewX+this._durationTransform.skewX*b,this.transform.skewY=this._originTransform.skewY+c.skewY+this._durationTransform.skewY*b,this.transform.scaleX=this._originTransform.scaleX+c.scaleX+this._durationTransform.scaleX*b,this.transform.scaleY=this._originTransform.scaleY+c.scaleY+this._durationTransform.scaleY*b,this.pivot.x=this._originPivot.x+d.x+this._durationPivot.x*b,this.pivot.y=this._originPivot.y+d.y+this._durationPivot.y*b):(this.transform.x= c.x+this._durationTransform.x*b,this.transform.y=c.y+this._durationTransform.y*b,this.transform.skewX=c.skewX+this._durationTransform.skewX*b,this.transform.skewY=c.skewY+this._durationTransform.skewY*b,this.transform.scaleX=c.scaleX+this._durationTransform.scaleX*b,this.transform.scaleY=c.scaleY+this._durationTransform.scaleY*b,this.pivot.x=d.x+this._durationPivot.x*b,this.pivot.y=d.y+this._durationPivot.y*b));this._tweenColor&&(this._currentFrame.color?this._bone._updateColor(this._currentFrame.color.alphaOffset+ this._durationColor.alphaOffset*b,this._currentFrame.color.redOffset+this._durationColor.redOffset*b,this._currentFrame.color.greenOffset+this._durationColor.greenOffset*b,this._currentFrame.color.blueOffset+this._durationColor.blueOffset*b,this._currentFrame.color.alphaMultiplier+this._durationColor.alphaMultiplier*b,this._currentFrame.color.redMultiplier+this._durationColor.redMultiplier*b,this._currentFrame.color.greenMultiplier+this._durationColor.greenMultiplier*b,this._currentFrame.color.blueMultiplier+ this._durationColor.blueMultiplier*b,!0):this._bone._updateColor(this._durationColor.alphaOffset*b,this._durationColor.redOffset*b,this._durationColor.greenOffset*b,this._durationColor.blueOffset*b,1+this._durationColor.alphaMultiplier*b,1+this._durationColor.redMultiplier*b,1+this._durationColor.greenMultiplier*b,1+this._durationColor.blueMultiplier*b,!0))}else this._updateState=0,this._animationState.blend?(this.transform.copy(this._originTransform),this.pivot.x=this._originPivot.x,this.pivot.y= this._originPivot.y):(this.transform.x=this.transform.y=this.transform.skewX=this.transform.skewY=this.transform.scaleX=this.transform.scaleY=0,this.pivot.x=0,this.pivot.y=0),this._currentFrame=this._timeline.getFrameList()[0],this.tweenActive=0<=this._currentFrame.displayIndex,this._currentFrame.color?this._bone._updateColor(this._currentFrame.color.alphaOffset,this._currentFrame.color.redOffset,this._currentFrame.color.greenOffset,this._currentFrame.color.blueOffset,this._currentFrame.color.alphaMultiplier, this._currentFrame.color.redMultiplier,this._currentFrame.color.greenMultiplier,this._currentFrame.color.blueMultiplier,!0):this._bone._updateColor(0,0,0,0,1,1,1,1,!1),this._bone._arriveAtFrame(this._currentFrame,this,this._animationState,!1)};a.prototype.clear=function(){this._updateState=0;this._originPivot=this._originTransform=this._currentFrame=this._timeline=this._animationState=this._bone=null};a.HALF_PI=0.5*Math.PI;a._pool=[];return a}();a.TimelineState=h;var g=function(){function a(){this.layer= this.loop=0;this._timelineStates={}}a._borrowObject=function(){return 0==a._pool.length?new a:a._pool.pop()};a._returnObject=function(b){0>a._pool.indexOf(b)&&(a._pool[a._pool.length]=b);b.clear()};a._clear=function(){for(var b=a._pool.length;b--;)a._pool[b].clear();a._pool.length=0};a.prototype.fadeIn=function(a,b,c,d,e,f,h,g){this.layer=f;this.clip=b;this.name=this.clip.name;this.totalTime=this.clip.duration;this._armature=a;2>Math.round(this.clip.duration*this.clip.frameRate)||Infinity==d?(this.timeScale= 1,this.currentTime=this.totalTime,this.loop=0<=this.loop?1:-1):(this.timeScale=d,this.currentTime=0,this.loop=e);this._pauseBeforeFadeInComplete=g;this._fadeInTime=c*this.timeScale;this._fadeState=1;this._fadeOutBeginTime=0;this._fadeOutWeight=-1;this._fadeWeight=0;this._fadeIn=!0;this._fadeOut=!1;this.loopCount=-1;this.displayControl=h;this.isPlaying=!0;this.isComplete=!1;this.weight=1;this.tweenEnabled=this.enabled=this.blend=!0;this.updateTimelineStates()};a.prototype.fadeOut=function(a,b){"undefined"=== typeof b&&(b=!1);if(this._armature&&!(0<=this._fadeOutWeight)){this._fadeState=-1;this._fadeOutWeight=this._fadeWeight;this._fadeOutTime=a*this.timeScale;this._fadeOutBeginTime=this.currentTime;this._fadeOut=!0;this.isPlaying=!b;this.displayControl=!1;for(var c in this._timelineStates)this._timelineStates[c].fadeOut();this.enabled=!0}};a.prototype.play=function(){this.isPlaying=!0};a.prototype.stop=function(){this.isPlaying=!1};a.prototype.getMixingTransform=function(a){return this._mixingTransforms? Number(this._mixingTransforms[a]):-1};a.prototype.addMixingTransform=function(a,b,c){"undefined"===typeof b&&(b=2);"undefined"===typeof c&&(c=!0);if(this.clip&&this.clip.getTimeline(a)){this._mixingTransforms||(this._mixingTransforms={});if(c){c=this._armature._boneList.length;for(var d,e;c--;)if(d=this._armature._boneList[c],d.name==a&&(e=d),e&&(e==d||e.contains(d)))this._mixingTransforms[d.name]=b}else this._mixingTransforms[a]=b;this.updateTimelineStates()}else throw Error();};a.prototype.removeMixingTransform= function(a,b){"undefined"===typeof a&&(a=null);"undefined"===typeof b&&(b=!0);if(a){if(b)for(var c=this._armature._boneList.length,d,e;c--;)d=this._armature._boneList[c],d.name==a&&(e=d),e&&(e==d||e.contains(d))&&delete this._mixingTransforms[d.name];else delete this._mixingTransforms[a];for(var f in this._mixingTransforms){var h=!0;break}h||(this._mixingTransforms=null)}else this._mixingTransforms=null;this.updateTimelineStates()};a.prototype.advanceTime=function(a){if(!this.enabled)return!1;var b, c;this._fadeIn&&(this._fadeIn=!1,this._armature.hasEventListener(d.AnimationEvent.FADE_IN)&&(b=new d.AnimationEvent(d.AnimationEvent.FADE_IN),b.animationState=this,this._armature._eventList.push(b)));this._fadeOut&&(this._fadeOut=!1,this._armature.hasEventListener(d.AnimationEvent.FADE_OUT)&&(b=new d.AnimationEvent(d.AnimationEvent.FADE_OUT),b.animationState=this,this._armature._eventList.push(b)));this.currentTime+=a*this.timeScale;if(this.isPlaying&&!this.isComplete){var e;if(this._pauseBeforeFadeInComplete)this.isPlaying= this._pauseBeforeFadeInComplete=!1,a=0,e=Math.floor(a);else if(a=this.currentTime/this.totalTime,e=Math.floor(a),e!=this.loopCount&&(-1==this.loopCount&&this._armature.hasEventListener(d.AnimationEvent.START)&&(b=new d.AnimationEvent(d.AnimationEvent.START),b.animationState=this,this._armature._eventList.push(b)),this.loopCount=e))this.loop&&this.loopCount*this.loopCount>=this.loop*this.loop-1?(c=!0,a=1,e=0,this._armature.hasEventListener(d.AnimationEvent.COMPLETE)&&(b=new d.AnimationEvent(d.AnimationEvent.COMPLETE), b.animationState=this,this._armature._eventList.push(b))):this._armature.hasEventListener(d.AnimationEvent.LOOP_COMPLETE)&&(b=new d.AnimationEvent(d.AnimationEvent.LOOP_COMPLETE),b.animationState=this,this._armature._eventList.push(b));for(var f in this._timelineStates)this._timelineStates[f].update(a);b=this.clip.getFrameList();if(0this._currentFrame.position+this._currentFrame.duration||a=b.length&&(f=0),this._currentFrame=b[f]):this._currentFrame=b[0];e&&this._armature._arriveAtFrame(this._currentFrame,null,this,!1)}}if(0this._fadeState){if(0==this._fadeOutTime)return this._fadeState=this._fadeWeight=0,this._armature.hasEventListener(d.AnimationEvent.FADE_OUT_COMPLETE)&& (b=new d.AnimationEvent(d.AnimationEvent.FADE_OUT_COMPLETE),b.animationState=this,this._armature._eventList.push(b)),!0;this._fadeWeight=(1-(this.currentTime-this._fadeOutBeginTime)/this._fadeOutTime)*this._fadeOutWeight;if(0>=this._fadeWeight)return this._fadeState=this._fadeWeight=0,this._armature.hasEventListener(d.AnimationEvent.FADE_OUT_COMPLETE)&&(b=new d.AnimationEvent(d.AnimationEvent.FADE_OUT_COMPLETE),b.animationState=this,this._armature._eventList.push(b)),!0}c&&(this.isComplete=!0,0>this.loop&& this.fadeOut((this._fadeOutWeight||this._fadeInTime)/this.timeScale,!0));return!1};a.prototype.updateTimelineStates=function(){if(this._mixingTransforms){for(var a in this._timelineStates)null==this._mixingTransforms[a]&&this.removeTimelineState(a);for(a in this._mixingTransforms)this._timelineStates[a]||this.addTimelineState(a)}else for(a in this.clip.getTimelines())this._timelineStates[a]||this.addTimelineState(a)};a.prototype.addTimelineState=function(a){var b=this._armature.getBone(a);if(b){var c= h._borrowObject(),d=this.clip.getTimeline(a);c.fadeIn(b,this,d);this._timelineStates[a]=c}};a.prototype.removeTimelineState=function(a){h._returnObject(this._timelineStates[a]);delete this._timelineStates[a]};a.prototype.clear=function(){this.clip=null;this.enabled=!1;this._mixingTransforms=this._currentFrame=this._armature=null;for(var a in this._timelineStates)this.removeTimelineState(a)};a._pool=[];return a}();a.AnimationState=g;c=function(){function a(b){this._armature=b;this._animationLayer= [];this._isPlaying=!1;this.animationNameList=[];this.tweenEnabled=!0;this.timeScale=1}a.prototype.getLastAnimationName=function(){return this._lastAnimationState?this._lastAnimationState.name:null};a.prototype.getLastAnimationState=function(){return this._lastAnimationState};a.prototype.getAnimationDataList=function(){return this._animationDataList};a.prototype.setAnimationDataList=function(a){this._animationDataList=a;this.animationNameList.length=0;for(var b in this._animationDataList)this.animationNameList[this.animationNameList.length]= this._animationDataList[b].name};a.prototype.getIsPlaying=function(){return this._isPlaying&&!this.getIsComplete()};a.prototype.getIsComplete=function(){if(this._lastAnimationState){if(!this._lastAnimationState.isComplete)return!1;for(var a=this._animationLayer.length;a--;)for(var b=this._animationLayer[a],c=b.length;c--;)if(!b[c].isComplete)return!1;return!0}return!1};a.prototype.dispose=function(){if(this._armature){this.stop();for(var a=this._animationLayer.length;a--;){for(var b=this._animationLayer[a], c=b.length;c--;)g._returnObject(b[c]);b.length=0}this._animationLayer.length=0;this.animationNameList.length=0;this.animationNameList=this._animationDataList=this._animationLayer=this._armature=null}};a.prototype.gotoAndPlay=function(b,c,d,e,f,h,k,p,l,m){"undefined"===typeof c&&(c=-1);"undefined"===typeof d&&(d=-1);"undefined"===typeof e&&(e=NaN);"undefined"===typeof f&&(f=0);"undefined"===typeof h&&(h=null);"undefined"===typeof k&&(k=a.SAME_LAYER_AND_GROUP);"undefined"===typeof p&&(p=!0);"undefined"=== typeof l&&(l=!0);"undefined"===typeof m&&(m=!0);if(!this._animationDataList)return null;for(var n=this._animationDataList.length,I;n--;)if(this._animationDataList[n].name==b){I=this._animationDataList[n];break}if(!I)return null;this._isPlaying=!0;c=0>c?0>I.fadeInTime?0.3:I.fadeInTime:c;d=0>d?0>I.scale?1:I.scale:d/I.duration;e=isNaN(e)?I.loop:e;f=this.addLayer(f);var E;switch(k){case a.NONE:break;case a.SAME_LAYER:E=this._animationLayer[f];for(n=E.length;n--;)k=E[n],k.fadeOut(c,l);break;case a.SAME_GROUP:for(s= this._animationLayer.length;s--;){E=this._animationLayer[s];for(n=E.length;n--;)k=E[n],k.group==h&&k.fadeOut(c,l)}break;case a.ALL:for(var s=this._animationLayer.length;s--;){E=this._animationLayer[s];for(n=E.length;n--;)k=E[n],k.fadeOut(c,l)}break;default:E=this._animationLayer[f];for(n=E.length;n--;)k=E[n],k.group==h&&k.fadeOut(c,l)}this._lastAnimationState=g._borrowObject();this._lastAnimationState.group=h;this._lastAnimationState.tweenEnabled=this.tweenEnabled;this._lastAnimationState.fadeIn(this._armature, I,c,1/d,e,f,p,m);this.addState(this._lastAnimationState);e=this._armature._slotList;for(n=e.length;n--;)f=e[n],(f=f.getChildArmature())&&f.animation.gotoAndPlay(b,c);return this._lastAnimationState};a.prototype.play=function(){this._animationDataList&&0!=this._animationDataList.length&&(this._lastAnimationState?this._isPlaying?this.gotoAndPlay(this._lastAnimationState.name):this._isPlaying=!0:this.gotoAndPlay(this._animationDataList[0].name))};a.prototype.stop=function(){this._isPlaying=!1};a.prototype.getState= function(a,b){"undefined"===typeof b&&(b=0);var c=this._animationLayer.length;if(0==c)return null;b>=c&&(b=c-1);c=this._animationLayer[b];if(!c)return null;for(var d=c.length;d--;)if(c[d].name==a)return c[d];return null};a.prototype.hasAnimation=function(a){for(var b=this._animationDataList.length;b--;)if(this._animationDataList[b].name==a)return!0;return!1};a.prototype.advanceTime=function(a){if(this._isPlaying){a*=this.timeScale;var b=this._armature._boneList.length,c,d,e=b,f,h,g,k,p,l,m,q,s,w, G,M,n,R,P,t,y;for(b--;e--;){h=this._armature._boneList[e];g=h.name;k=1;M=G=w=s=q=m=l=p=0;for(c=this._animationLayer.length;c--;){n=0;R=this._animationLayer[c];f=R.length;for(d=0;d=k)break;else k-=n}y=h.tween;t=h._tweenPivot;y.x=p;y.y= l;y.skewX=m;y.skewY=q;y.scaleX=s;y.scaleY=w;t.x=G;t.y=M}}};a.prototype.addLayer=function(a){a>=this._animationLayer.length&&(a=this._animationLayer.length,this._animationLayer[a]=[]);return a};a.prototype.addState=function(a){this._animationLayer[a.layer].push(a)};a.prototype.removeState=function(a){var b=a.layer,c=this._animationLayer[b];c.splice(c.indexOf(a),1);g._returnObject(a);0==c.length&&b==this._animationLayer.length-1&&this._animationLayer.length--};a.NONE="none";a.SAME_LAYER="sameLayer"; a.SAME_GROUP="sameGroup";a.SAME_LAYER_AND_GROUP="sameLayerAndGroup";a.ALL="all";return a}();a.Animation=c})(c.animation||(c.animation={}));var a=c.animation;(function(a){var b=function(){function a(){this.skewY=this.skewX=this.y=this.x=0;this.scaleY=this.scaleX=1}a.prototype.getRotation=function(){return this.skewX};a.prototype.setRotation=function(a){this.skewX=this.skewY=a};a.prototype.copy=function(a){this.x=a.x;this.y=a.y;this.skewX=a.skewX;this.skewY=a.skewY;this.scaleX=a.scaleX;this.scaleY= a.scaleY};a.prototype.toString=function(){return"[DBTransform (x\x3d"+this.x+" y\x3d"+this.y+" skewX\x3d"+this.skewX+" skewY\x3d"+this.skewY+" scaleX\x3d"+this.scaleX+" scaleY\x3d"+this.scaleY+")]"};return a}();a.DBTransform=b;var c=function(){function a(){this.duration=this.position=0}a.prototype.dispose=function(){};return a}();a.Frame=c;var d=function(a){function c(){a.call(this);this.displayIndex=this.tweenRotate=this.tweenEasing=0;this.zOrder=NaN;this.visible=!0;this.global=new b;this.transform= new b;this.pivot=new e.Point}__extends(c,a);c.prototype.dispose=function(){a.prototype.dispose.call(this);this.color=this.pivot=this.transform=this.global=null};return c}(c);a.TransformFrame=d;var h=function(){function a(){this._frameList=[];this.duration=0;this.scale=1}a.prototype.getFrameList=function(){return this._frameList};a.prototype.dispose=function(){for(var a=this._frameList.length;a--;)this._frameList[a].dispose();this._frameList.length=0;this._frameList=null};a.prototype.addFrame=function(a){if(!a)throw Error(); if(0>this._frameList.indexOf(a))this._frameList[this._frameList.length]=a;else throw Error();};return a}();a.Timeline=h;var g=function(a){function c(){a.call(this);this.originTransform=new b;this.originPivot=new e.Point;this.offset=0;this.transformed=!1}__extends(c,a);c.prototype.dispose=function(){this!=c.HIDE_TIMELINE&&(a.prototype.dispose.call(this),this.originPivot=this.originTransform=null)};c.HIDE_TIMELINE=new c;return c}(h);a.TransformTimeline=g;var k=function(a){function b(){a.call(this); this.loop=this.frameRate=0;this.tweenEasing=NaN;this.fadeInTime=0;this._timelines={}}__extends(b,a);b.prototype.getTimelines=function(){return this._timelines};b.prototype.dispose=function(){a.prototype.dispose.call(this);for(var b in this._timelines)this._timelines[b].dispose();this._timelines=null};b.prototype.getTimeline=function(a){return this._timelines[a]};b.prototype.addTimeline=function(a,b){if(!a)throw Error();this._timelines[b]=a};return b}(h);a.AnimationData=k;var m=function(){function a(){this.transform= new b}a.prototype.dispose=function(){this.pivot=this.transform=null};a.ARMATURE="armature";a.IMAGE="image";return a}();a.DisplayData=m;var x=function(){function a(){this._displayDataList=[];this.zOrder=0;this.blendMode="normal"}a.prototype.getDisplayDataList=function(){return this._displayDataList};a.prototype.dispose=function(){for(var a=this._displayDataList.length;a--;)this._displayDataList[a].dispose();this._displayDataList.length=0;this._displayDataList=null};a.prototype.addDisplayData=function(a){if(!a)throw Error(); if(0>this._displayDataList.indexOf(a))this._displayDataList[this._displayDataList.length]=a;else throw Error();};a.prototype.getDisplayData=function(a){for(var b=this._displayDataList.length;b--;)if(this._displayDataList[b].name==a)return this._displayDataList[b];return null};return a}();a.SlotData=x;var C=function(){function a(){this.length=0;this.global=new b;this.transform=new b;this.scaleMode=1;this.fixedRotation=!1}a.prototype.dispose=function(){this.transform=this.global=null};return a}();a.BoneData= C;var A=function(){function a(){this._slotDataList=[]}a.prototype.getSlotDataList=function(){return this._slotDataList};a.prototype.dispose=function(){for(var a=this._slotDataList.length;a--;)this._slotDataList[a].dispose();this._slotDataList.length=0;this._slotDataList=null};a.prototype.getSlotData=function(a){for(var b=this._slotDataList.length;b--;)if(this._slotDataList[b].name==a)return this._slotDataList[b];return null};a.prototype.addSlotData=function(a){if(!a)throw Error();if(0>this._slotDataList.indexOf(a))this._slotDataList[this._slotDataList.length]= a;else throw Error();};return a}();a.SkinData=A;var z=function(){function a(){this._boneDataList=[];this._skinDataList=[];this._animationDataList=[]}a.prototype.getBoneDataList=function(){return this._boneDataList};a.prototype.getSkinDataList=function(){return this._skinDataList};a.prototype.getAnimationDataList=function(){return this._animationDataList};a.prototype.dispose=function(){for(var a=this._boneDataList.length;a--;)this._boneDataList[a].dispose();for(a=this._skinDataList.length;a--;)this._skinDataList[a].dispose(); for(a=this._animationDataList.length;a--;)this._animationDataList[a].dispose();this._boneDataList.length=0;this._skinDataList.length=0;this._animationDataList.length=0;this._animationDataList=this._skinDataList=this._boneDataList=null};a.prototype.getBoneData=function(a){for(var b=this._boneDataList.length;b--;)if(this._boneDataList[b].name==a)return this._boneDataList[b];return null};a.prototype.getSkinData=function(a){if(!a)return this._skinDataList[0];for(var b=this._skinDataList.length;b--;)if(this._skinDataList[b].name== a)return this._skinDataList[b];return null};a.prototype.getAnimationData=function(a){for(var b=this._animationDataList.length;b--;)if(this._animationDataList[b].name==a)return this._animationDataList[b];return null};a.prototype.addBoneData=function(a){if(!a)throw Error();if(0>this._boneDataList.indexOf(a))this._boneDataList[this._boneDataList.length]=a;else throw Error();};a.prototype.addSkinData=function(a){if(!a)throw Error();if(0>this._skinDataList.indexOf(a))this._skinDataList[this._skinDataList.length]= a;else throw Error();};a.prototype.addAnimationData=function(a){if(!a)throw Error();0>this._animationDataList.indexOf(a)&&(this._animationDataList[this._animationDataList.length]=a)};a.prototype.sortBoneDataList=function(){var a=this._boneDataList.length;if(0!=a){for(var b=[];a--;){for(var c=this._boneDataList[a],d=0,e=c;e&&e.parent;)d++,e=this.getBoneData(e.parent);b[a]={level:d,boneData:c}}b.sort(this.sortBoneData);for(a=b.length;a--;)this._boneDataList[a]=b[a].boneData}};a.prototype.sortBoneData= function(a,b){return a.level>b.level?1:-1};return a}();a.ArmatureData=z;var u=function(){function a(){this._armatureDataList=[];this._subTexturePivots={}}a.prototype.getArmatureNames=function(){var a=[],b;for(b in this._armatureDataList)a[a.length]=this._armatureDataList[b].name;return a};a.prototype.getArmatureDataList=function(){return this._armatureDataList};a.prototype.dispose=function(){for(var a in this._armatureDataList)this._armatureDataList[a].dispose();this._armatureDataList.length=0;this._subTexturePivots= this._armatureDataList=null};a.prototype.getArmatureData=function(a){for(var b=this._armatureDataList.length;b--;)if(this._armatureDataList[b].name==a)return this._armatureDataList[b];return null};a.prototype.addArmatureData=function(a){if(!a)throw Error();if(0>this._armatureDataList.indexOf(a))this._armatureDataList[this._armatureDataList.length]=a;else throw Error();};a.prototype.removeArmatureData=function(a){a=this._armatureDataList.indexOf(a);0<=a&&this._armatureDataList.splice(a,1)};a.prototype.removeArmatureDataByName= function(a){for(var b=this._armatureDataList.length;b--;)this._armatureDataList[b].name==a&&this._armatureDataList.splice(b,1)};a.prototype.getSubTexturePivot=function(a){return this._subTexturePivots[a]};a.prototype.addSubTexturePivot=function(a,b,c){var d=this._subTexturePivots[c];d?(d.x=a,d.y=b):this._subTexturePivots[c]=d=new e.Point(a,b);return d};a.prototype.removeSubTexturePivot=function(a){if(a)delete this._subTexturePivots[a];else for(a in this._subTexturePivots)delete this._subTexturePivots[a]}; return a}();a.SkeletonData=u;h=function(){function a(){}a.parseTextureAtlasData=function(a,b){"undefined"===typeof b&&(b=1);if(!a)throw Error();var c={};c.__name=a[f.ConstValues.A_NAME];var d=a[f.ConstValues.SUB_TEXTURE],h;for(h in d){var g=d[h],k=g[f.ConstValues.A_NAME],g=new e.Rectangle(Number(g[f.ConstValues.A_X])/b,Number(g[f.ConstValues.A_Y])/b,Number(g[f.ConstValues.A_WIDTH])/b,Number(g[f.ConstValues.A_HEIGHT])/b);c[k]=g}return c};a.parseSkeletonData=function(b){if(!b)throw Error();var c=Number(b[f.ConstValues.A_FRAME_RATE]), d=new u;d.name=b[f.ConstValues.A_NAME];b=b[f.ConstValues.ARMATURE];for(var e in b)d.addArmatureData(a.parseArmatureData(b[e],d,c));return d};a.parseArmatureData=function(b,c,d){var e=new z;e.name=b[f.ConstValues.A_NAME];var h=b[f.ConstValues.BONE],g;for(g in h)e.addBoneData(a.parseBoneData(h[g]));h=b[f.ConstValues.SKIN];for(g in h)e.addSkinData(a.parseSkinData(h[g],c));f.DBDataUtil.transformArmatureData(e);e.sortBoneDataList();b=b[f.ConstValues.ANIMATION];for(g in b)e.addAnimationData(a.parseAnimationData(b[g], e,d));return e};a.parseBoneData=function(b){var c=new C;c.name=b[f.ConstValues.A_NAME];c.parent=b[f.ConstValues.A_PARENT];c.length=Number(b[f.ConstValues.A_LENGTH])||0;var d=Number(b[f.ConstValues.A_SCALE_MODE]);!isNaN(d)&&d&&(c.scaleMode=d);if(d=b[f.ConstValues.A_FIXED_ROTATION])c.fixedRotation=d;a.parseTransform(b[f.ConstValues.TRANSFORM],c.global);c.transform.copy(c.global);return c};a.parseSkinData=function(b,c){var d=new A;d.name=b[f.ConstValues.A_NAME];var e=b[f.ConstValues.SLOT],h;for(h in e)d.addSlotData(a.parseSlotData(e[h], c));return d};a.parseSlotData=function(b,c){var d=new x;d.name=b[f.ConstValues.A_NAME];d.parent=b[f.ConstValues.A_PARENT];d.zOrder=Number(b[f.ConstValues.A_Z_ORDER]);d.blendMode=b[f.ConstValues.A_BLENDMODE];d.blendMode||(d.blendMode="normal");var e=b[f.ConstValues.DISPLAY],h;for(h in e)d.addDisplayData(a.parseDisplayData(e[h],c));return d};a.parseDisplayData=function(b,c){var d=new m;d.name=b[f.ConstValues.A_NAME];d.type=b[f.ConstValues.A_TYPE];d.pivot=c.addSubTexturePivot(0,0,d.name);a.parseTransform(b[f.ConstValues.TRANSFORM], d.transform,d.pivot);return d};a.parseAnimationData=function(b,c,d){var e=new k;e.name=b[f.ConstValues.A_NAME];e.frameRate=d;e.loop=Number(b[f.ConstValues.A_LOOP])||0;e.fadeInTime=Number(b[f.ConstValues.A_FADE_IN_TIME]);e.duration=Number(b[f.ConstValues.A_DURATION])/d;e.scale=Number(b[f.ConstValues.A_SCALE]);if(b.hasOwnProperty(f.ConstValues.A_TWEEN_EASING)){var h=b[f.ConstValues.A_TWEEN_EASING];e.tweenEasing=void 0==h||null==h?NaN:Number(h)}else e.tweenEasing=NaN;a.parseTimeline(b,e,a.parseMainFrame, d);var g,h=b[f.ConstValues.TIMELINE],p;for(p in h)g=h[p],b=a.parseTransformTimeline(g,e.duration,d),g=g[f.ConstValues.A_NAME],e.addTimeline(b,g);f.DBDataUtil.addHideTimeline(e,c);f.DBDataUtil.transformAnimationData(e,c);return e};a.parseTimeline=function(a,b,c,d){var e=0,h;a=a[f.ConstValues.FRAME];for(var g in a)h=c(a[g],d),h.position=e,b.addFrame(h),e+=h.duration;h&&(h.duration=b.duration-h.position)};a.parseTransformTimeline=function(b,c,d){var e=new g;e.duration=c;a.parseTimeline(b,e,a.parseTransformFrame, d);e.scale=Number(b[f.ConstValues.A_SCALE]);e.offset=Number(b[f.ConstValues.A_OFFSET]);return e};a.parseFrame=function(a,b,c){b.duration=Number(a[f.ConstValues.A_DURATION])/c;b.action=a[f.ConstValues.A_ACTION];b.event=a[f.ConstValues.A_EVENT];b.sound=a[f.ConstValues.A_SOUND]};a.parseMainFrame=function(b,d){var e=new c;a.parseFrame(b,e,d);return e};a.parseTransformFrame=function(b,c){var h=new d;a.parseFrame(b,h,c);h.visible=1!=Number(b[f.ConstValues.A_HIDE]);if(b.hasOwnProperty(f.ConstValues.A_TWEEN_EASING)){var g= b[f.ConstValues.A_TWEEN_EASING];h.tweenEasing=void 0==g||null==g?NaN:Number(g)}else h.tweenEasing=0;h.tweenRotate=Number(b[f.ConstValues.A_TWEEN_ROTATE])||0;h.displayIndex=Number(b[f.ConstValues.A_DISPLAY_INDEX])||0;h.zOrder=Number(b[f.ConstValues.A_Z_ORDER])||0;a.parseTransform(b[f.ConstValues.TRANSFORM],h.global,h.pivot);h.transform.copy(h.global);if(g=b[f.ConstValues.COLOR_TRANSFORM])h.color=new e.ColorTransform,h.color.alphaOffset=Number(g[f.ConstValues.A_ALPHA_OFFSET]),h.color.redOffset=Number(g[f.ConstValues.A_RED_OFFSET]), h.color.greenOffset=Number(g[f.ConstValues.A_GREEN_OFFSET]),h.color.blueOffset=Number(g[f.ConstValues.A_BLUE_OFFSET]),h.color.alphaMultiplier=0.01*Number(g[f.ConstValues.A_ALPHA_MULTIPLIER]),h.color.redMultiplier=0.01*Number(g[f.ConstValues.A_RED_MULTIPLIER]),h.color.greenMultiplier=0.01*Number(g[f.ConstValues.A_GREEN_MULTIPLIER]),h.color.blueMultiplier=0.01*Number(g[f.ConstValues.A_BLUE_MULTIPLIER]);return h};a.parseTransform=function(a,b,c){"undefined"===typeof c&&(c=null);a&&(b&&(b.x=Number(a[f.ConstValues.A_X]), b.y=Number(a[f.ConstValues.A_Y]),b.skewX=Number(a[f.ConstValues.A_SKEW_X])*f.ConstValues.ANGLE_TO_RADIAN,b.skewY=Number(a[f.ConstValues.A_SKEW_Y])*f.ConstValues.ANGLE_TO_RADIAN,b.scaleX=Number(a[f.ConstValues.A_SCALE_X]),b.scaleY=Number(a[f.ConstValues.A_SCALE_Y])),c&&(c.x=Number(a[f.ConstValues.A_PIVOT_X]),c.y=Number(a[f.ConstValues.A_PIVOT_Y])))};return a}();a.DataParser=h})(c.objects||(c.objects={}));var b=c.objects;(function(a){var e=function(a){function d(){a.call(this);this._dataDic={};this._textureAtlasDic= {};this._textureAtlasLoadingDic={}}__extends(d,a);d.prototype.getSkeletonData=function(a){return this._dataDic[a]};d.prototype.addSkeletonData=function(a,b){"undefined"===typeof b&&(b=null);if(!a)throw Error();b=b||a.name;if(!b)throw Error("Unnamed data!");this._dataDic[b]=a};d.prototype.removeSkeletonData=function(a){delete this._dataDic[a]};d.prototype.getTextureAtlas=function(a){return this._textureAtlasDic[a]};d.prototype.addTextureAtlas=function(a,b){"undefined"===typeof b&&(b=null);if(!a)throw Error(); b=b||a.name;if(!b)throw Error("Unnamed data!");this._textureAtlasDic[b]=a};d.prototype.removeTextureAtlas=function(a){delete this._textureAtlasDic[a]};d.prototype.dispose=function(a){"undefined"===typeof a&&(a=!0);if(a){for(var b in this._dataDic)this._dataDic[b].dispose();for(b in this._textureAtlasDic)this._textureAtlasDic[b].dispose()}this._currentTextureAtlasName=this._currentDataName=this._textureAtlasLoadingDic=this._textureAtlasDic=this._dataDic=null};d.prototype.buildArmature=function(a,d, e,f,h){if(e){var g=this._dataDic[e];if(g)var k=g.getArmatureData(a)}else for(e in this._dataDic)if(g=this._dataDic[e],k=g.getArmatureData(a))break;if(!k)return null;this._currentDataName=e;this._currentTextureAtlasName=f||e;f=this._generateArmature();f.name=a;var p,l,m=k.getBoneDataList(),q;for(q in m)l=m[q],p=new c.Bone,p.name=l.name,p.fixedRotation=l.fixedRotation,p.scaleMode=l.scaleMode,p.origin.copy(l.transform),k.getBoneData(l.parent)?f.addChild(p,l.parent):f.addChild(p,null);if(d&&d!=a){var n= g.getArmatureData(d);if(!n)for(e in this._dataDic)if(g=this._dataDic[e],n=g.getArmatureData(d))break}n?f.animation.setAnimationDataList(n.getAnimationDataList()):f.animation.setAnimationDataList(k.getAnimationDataList());p=k.getSkinData(h);if(!p)throw Error();a=[];e=p.getSlotDataList();for(q in e)if(g=e[q],p=f.getBone(g.parent)){h=g.getDisplayDataList();d=this._generateSlot();d.name=g.name;d._blendMode=g.blendMode;d._originZOrder=g.zOrder;d._dislayDataList=h;a.length=0;for(g=h.length;g--;)switch(k= h[g],k.type){case b.DisplayData.ARMATURE:(k=this.buildArmature(k.name,null,this._currentDataName,this._currentTextureAtlasName,null))&&(a[g]=k);break;default:a[g]=this._generateDisplay(this._textureAtlasDic[this._currentTextureAtlasName],k.name,k.pivot.x,k.pivot.y)}d.setDisplayList(a);d._changeDisplay(0);p.addChild(d)}f._slotsZOrderChanged=!0;f.advanceTime(0);return f};d.prototype.getTextureDisplay=function(a,b,c,d){if(b)var e=this._textureAtlasDic[b];if(!e&&!b)for(b in this._textureAtlasDic){e=this._textureAtlasDic[b]; if(e.getRegion(a))break;e=null}if(e){if(isNaN(c)||isNaN(d))if(b=this._dataDic[b])if(b=b.getSubTexturePivot(a))c=b.x,d=b.y;return this._generateDisplay(e,a,c,d)}return null};d.prototype._generateArmature=function(){return null};d.prototype._generateSlot=function(){return null};d.prototype._generateDisplay=function(a,b,c,d){return null};return d}(d.EventDispatcher);a.BaseFactory=e})(c.factorys||(c.factorys={}));(function(c){var d=function(){function a(){}a.ANGLE_TO_RADIAN=Math.PI/180;a.DRAGON_BONES= "dragonBones";a.ARMATURE="armature";a.SKIN="skin";a.BONE="bone";a.SLOT="slot";a.DISPLAY="display";a.ANIMATION="animation";a.TIMELINE="timeline";a.FRAME="frame";a.TRANSFORM="transform";a.COLOR_TRANSFORM="colorTransform";a.TEXTURE_ATLAS="TextureAtlas";a.SUB_TEXTURE="SubTexture";a.A_VERSION="version";a.A_IMAGE_PATH="imagePath";a.A_FRAME_RATE="frameRate";a.A_NAME="name";a.A_PARENT="parent";a.A_LENGTH="length";a.A_TYPE="type";a.A_FADE_IN_TIME="fadeInTime";a.A_DURATION="duration";a.A_SCALE="scale";a.A_OFFSET= "offset";a.A_LOOP="loop";a.A_EVENT="event";a.A_SOUND="sound";a.A_ACTION="action";a.A_HIDE="hide";a.A_TWEEN_EASING="tweenEasing";a.A_TWEEN_ROTATE="tweenRotate";a.A_DISPLAY_INDEX="displayIndex";a.A_Z_ORDER="z";a.A_BLENDMODE="blendMode";a.A_WIDTH="width";a.A_HEIGHT="height";a.A_SCALE_MODE="scaleMode";a.A_FIXED_ROTATION="fixedRotation";a.A_X="x";a.A_Y="y";a.A_SKEW_X="skX";a.A_SKEW_Y="skY";a.A_SCALE_X="scX";a.A_SCALE_Y="scY";a.A_PIVOT_X="pX";a.A_PIVOT_Y="pY";a.A_ALPHA_OFFSET="aO";a.A_RED_OFFSET="rO";a.A_GREEN_OFFSET= "gO";a.A_BLUE_OFFSET="bO";a.A_ALPHA_MULTIPLIER="aM";a.A_RED_MULTIPLIER="rM";a.A_GREEN_MULTIPLIER="gM";a.A_BLUE_MULTIPLIER="bM";return a}();c.ConstValues=d;var f=function(){function a(){}a.transformPointWithParent=function(b,c){var d=a._helpMatrix;a.transformToMatrix(c,d);d.invert();var e=b.x,f=b.y;b.x=d.a*e+d.c*f+d.tx;b.y=d.d*f+d.b*e+d.ty;b.skewX=a.formatRadian(b.skewX-c.skewX);b.skewY=a.formatRadian(b.skewY-c.skewY)};a.transformToMatrix=function(a,b){b.a=a.scaleX*Math.cos(a.skewY);b.b=a.scaleX*Math.sin(a.skewY); b.c=-a.scaleY*Math.sin(a.skewX);b.d=a.scaleY*Math.cos(a.skewX);b.tx=a.x;b.ty=a.y};a.formatRadian=function(b){b%=a.DOUBLE_PI;b>Math.PI&&(b-=a.DOUBLE_PI);b<-Math.PI&&(b+=a.DOUBLE_PI);return b};a.DOUBLE_PI=2*Math.PI;a._helpMatrix=new e.Matrix;return a}();c.TransformUtil=f;d=function(){function c(){}c.transformArmatureData=function(a){for(var b=a.getBoneDataList(),c=b.length,d,e;c--;)if(d=b[c],d.parent&&(e=a.getBoneData(d.parent)))d.transform.copy(d.global),f.transformPointWithParent(d.transform,e.global)}; c.transformArmatureDataAnimations=function(a){for(var b=a.getAnimationDataList(),d=b.length;d--;)c.transformAnimationData(b[d],a)};c.transformAnimationData=function(a,b){for(var d=b.getSkinData(null),e=b.getBoneDataList(),d=d.getSlotDataList(),h=e.length,g,k,l,m,n,B,K,I,E,s;h--;)if(g=e[h],k=a.getTimeline(g.name)){l=null;for(var w in d)if(l=d[w],l.parent==g.name)break;m=g.parent?a.getTimeline(g.parent):null;n=k.getFrameList();I=K=B=null;s=n.length;for(var G=0;GM&&(E.transform.skewX+=2*Math.PI,E.transform.skewY+=2*Math.PI),1I.tweenRotate&&(E.transform.skewX+=2*Math.PI*(I.tweenRotate+1),E.transform.skewY+=2*Math.PI*(I.tweenRotate+1))):(E.transform.skewX=I.transform.skewX+f.formatRadian(E.transform.skewX-I.transform.skewX),E.transform.skewY=I.transform.skewY+f.formatRadian(E.transform.skewY-I.transform.skewY))}I=E}k.transformed=!0}};c.getTimelineTransform= function(b,c,d){for(var e=b.getFrameList(),h=e.length,g;h--;)if(b=e[h],b.position<=c&&b.position+b.duration>c){g=b.tweenEasing;h==e.length-1||isNaN(g)||c==b.position?d.copy(b.global):(c=(c-b.position)/b.duration,g&&(c=a.TimelineState.getEaseValue(c,g)),e=e[h+1],d.x=b.global.x+(e.global.x-b.global.x)*c,d.y=b.global.y+(e.global.y-b.global.y)*c,d.skewX=f.formatRadian(b.global.skewX+(e.global.skewX-b.global.skewX)*c),d.skewY=f.formatRadian(b.global.skewY+(e.global.skewY-b.global.skewY)*c),d.scaleX=b.global.scaleX+ (e.global.scaleX-b.global.scaleX)*c,d.scaleY=b.global.scaleY+(e.global.scaleY-b.global.scaleY)*c);break}};c.addHideTimeline=function(a,c){for(var d=c.getBoneDataList(),e=d.length,f;e--;)f=d[e],f=f.name,a.getTimeline(f)||a.addTimeline(b.TransformTimeline.HIDE_TIMELINE,f)};c._helpTransform1=new b.DBTransform;c._helpTransform2=new b.DBTransform;return c}();c.DBDataUtil=d})(c.utils||(c.utils={}));var f=c.utils,m=function(){function a(){this.global=new b.DBTransform;this.origin=new b.DBTransform;this.offset= new b.DBTransform;this.tween=new b.DBTransform;this.tween.scaleX=this.tween.scaleY=0;this._globalTransformMatrix=new e.Matrix;this._visible=!0;this._isDisplayOnStage=this._isColorChanged=!1;this._scaleType=0;this.fixedRotation=!1}a.prototype.getVisible=function(){return this._visible};a.prototype.setVisible=function(a){this._visible=a};a.prototype._setParent=function(a){this.parent=a};a.prototype._setArmature=function(a){this.armature&&this.armature._removeDBObject(this);(this.armature=a)&&this.armature._addDBObject(this)}; a.prototype.dispose=function(){this._globalTransformMatrix=this.tween=this.offset=this.origin=this.global=this.armature=this.parent=null};a.prototype._update=function(){this.global.scaleX=(this.origin.scaleX+this.tween.scaleX)*this.offset.scaleX;this.global.scaleY=(this.origin.scaleY+this.tween.scaleY)*this.offset.scaleY;if(this.parent){var a=this.origin.x+this.offset.x+this.tween.x,b=this.origin.y+this.offset.y+this.tween.y,c=this.parent._globalTransformMatrix;this._globalTransformMatrix.tx=this.global.x= c.a*a+c.c*b+c.tx;this._globalTransformMatrix.ty=this.global.y=c.d*b+c.b*a+c.ty;this.fixedRotation?(this.global.skewX=this.origin.skewX+this.offset.skewX+this.tween.skewX,this.global.skewY=this.origin.skewY+this.offset.skewY+this.tween.skewY):(this.global.skewX=this.origin.skewX+this.offset.skewX+this.tween.skewX+this.parent.global.skewX,this.global.skewY=this.origin.skewY+this.offset.skewY+this.tween.skewY+this.parent.global.skewY);this.parent.scaleMode>=this._scaleType&&(this.global.scaleX*=this.parent.global.scaleX, this.global.scaleY*=this.parent.global.scaleY)}else this._globalTransformMatrix.tx=this.global.x=this.origin.x+this.offset.x+this.tween.x,this._globalTransformMatrix.ty=this.global.y=this.origin.y+this.offset.y+this.tween.y,this.global.skewX=this.origin.skewX+this.offset.skewX+this.tween.skewX,this.global.skewY=this.origin.skewY+this.offset.skewY+this.tween.skewY;this._globalTransformMatrix.a=this.global.scaleX*Math.cos(this.global.skewY);this._globalTransformMatrix.b=this.global.scaleX*Math.sin(this.global.skewY); this._globalTransformMatrix.c=-this.global.scaleY*Math.sin(this.global.skewX);this._globalTransformMatrix.d=this.global.scaleY*Math.cos(this.global.skewX)};return a}();c.DBObject=m;var h=function(a){function b(c){a.call(this);this._displayBridge=c;this._displayList=[];this._displayIndex=-1;this._scaleType=1;this._offsetZOrder=this._tweenZorder=this._originZOrder=0;this._isHideDisplay=this._isDisplayOnStage=!1;this._blendMode="normal";this._displayBridge.updateBlendMode(this._blendMode)}__extends(b, a);b.prototype.getZOrder=function(){return this._originZOrder+this._tweenZorder+this._offsetZOrder};b.prototype.setZOrder=function(a){this.getZOrder()!=a&&(this._offsetZOrder=a-this._originZOrder-this._tweenZorder,this.armature&&(this.armature._slotsZOrderChanged=!0))};b.prototype.getDisplay=function(){var a=this._displayList[this._displayIndex];return a instanceof k?a.getDisplay():a};b.prototype.setDisplay=function(a){this._displayList[this._displayIndex]=a;this._setDisplay(a)};b.prototype.getBlendMode= function(){return this._blendMode};b.prototype.setBlendMode=function(a){this._blendMode!=a&&(this._blendMode=a,this._displayBridge.getDisplay()&&this._displayBridge.updateBlendMode(this._blendMode))};b.prototype.getChildArmature=function(){var a=this._displayList[this._displayIndex];return a instanceof k?a:null};b.prototype.setChildArmature=function(a){(this._displayList[this._displayIndex]=a)&&this._setDisplay(a.getDisplay())};b.prototype.getDisplayList=function(){return this._displayList};b.prototype.setDisplayList= function(a){if(!a)throw Error();for(var b=this._displayList.length=a.length;b--;)this._displayList[b]=a[b];0<=this._displayIndex&&(a=this._displayIndex,this._displayIndex=-1,this._changeDisplay(a))};b.prototype._setDisplay=function(a){this._displayBridge.getDisplay()?this._displayBridge.setDisplay(a):(this._displayBridge.setDisplay(a),this.armature&&(this._displayBridge.addDisplay(this.armature.getDisplay(),-1),this.armature._slotsZOrderChanged=!0));this.updateChildArmatureAnimation();a&&this._displayBridge.updateBlendMode(this._blendMode); !this._isHideDisplay&&this._displayBridge.getDisplay()?this._isDisplayOnStage=!0:this._isDisplayOnStage=!1};b.prototype._changeDisplay=function(a){if(0>a)this._isHideDisplay||(this._isHideDisplay=!0,this._displayBridge.removeDisplay(),this.updateChildArmatureAnimation());else{if(this._isHideDisplay){this._isHideDisplay=!1;var b=!0;this.armature&&(this._displayBridge.addDisplay(this.armature.getDisplay(),-1),this.armature._slotsZOrderChanged=!0)}var c=this._displayList.length;a>=c&&0this._slotList.indexOf(a)&&(this._slotList[this._slotList.length]=a):a instanceof g&&0>this._boneList.indexOf(a)&&(this._boneList[this._boneList.length]=a,this._sortBoneList())};c.prototype._removeDBObject=function(a){a instanceof h?(a=this._slotList.indexOf(a), 0<=a&&this._slotList.splice(a,1)):a instanceof g&&(a=this._boneList.indexOf(a),0<=a&&this._boneList.splice(a,1))};c.prototype._sortBoneList=function(){var a=this._boneList.length;if(0!=a){for(var b=[],c,d,e;a--;){c=0;for(e=d=this._boneList[a];e;)c++,e=e.parent;b[a]={level:c,bone:d}}b.sort(this.sortBone);for(a=b.length;a--;)this._boneList[a]=b[a].bone}};c.prototype._arriveAtFrame=function(a,b,e,f){a.event&&this.hasEventListener(d.FrameEvent.ANIMATION_FRAME_EVENT)&&(b=new d.FrameEvent(d.FrameEvent.ANIMATION_FRAME_EVENT), b.animationState=e,b.frameLabel=a.event,this._eventList.push(b));a.sound&&c._soundManager.hasEventListener(d.SoundEvent.SOUND)&&(b=new d.SoundEvent(d.SoundEvent.SOUND),b.armature=this,b.animationState=e,b.sound=a.sound,c._soundManager.dispatchEvent(b));a.action&&e.isPlaying&&this.animation.gotoAndPlay(a.action)};c.prototype.sortSlot=function(a,b){return a.getZOrder()b?a.addChild(this._display):a.addChildAt(this._display,Math.min(b,a.numChildren)))};a.prototype.removeDisplay=function(){this._display&&this._display.parent&&this._display.parent.removeChild(this._display)};a.RADIAN_TO_ANGLE=180/Math.PI;return a}();c.DragonBonesEgretBridge=a})(c.display||(c.display={}));var e=c.display;(function(d){var a=function(){function a(b,c,d){"undefined"===typeof d&&(d=1);this.texture=b;this.scale=d;this.parseData(c)}a.prototype.dispose=function(){this.texture=null};a.prototype.getRegion= function(a){throw Error("error");};a.prototype.parseData=function(a){this.name=a[c.utils.ConstValues.A_NAME];this.spriteSheet=ns_egret.SpriteSheet.parseFromDragonBones(a)};return a}();d.EgretTextureAtlas=a})(c.textures||(c.textures={}));(function(d){var a=function(a){function d(){a.call(this)}__extends(d,a);d.prototype._generateArmature=function(){return new c.Armature(new ns_egret.DisplayObjectContainer)};d.prototype._generateSlot=function(){return new c.Slot(new e.DragonBonesEgretBridge)};d.prototype._generateDisplay= function(a,b,c,d){var e=ns_egret.Bitmap.initWithTexture(a.texture);a=a.spriteSheet.getFrame(b);e.spriteFrame=a;e.anchorOffsetX=c;e.anchorOffsetY=d;return e};return d}(c.factorys.BaseFactory);d.EgretFactory=a})(c.factorys||(c.factorys={}))})(dragonBones||(dragonBones={}));(function(c){var e=function(){function d(){}d.checkDrawImage=function(a,b,d,e,h,g,k,l,n){null==a&&c.Logger.fatal("texture\u4e3a\u7a7a");(a._textureWidthparseInt(b)||0>parseInt(d)||0>parseInt(e)||0>parseInt(h))&&c.Logger.fatal("\u4f20\u5165\u7684\u503c\u4e0d\u80fd\u4e3a\u8d1f\u6570");a._textureWidthk&&(H=w,w=k,k=H,H=1),w>c&&(s.x=H,s.y=0,c=w),d=Math.min(d,k),c>d)return!1;if(yk&&(H=w,w=k,k=H,H=1),w>c&&(s.y=H,s.x=0,c=w),d=Math.min(d,k),c>d)return!1; a.fraction=c;return!0};g.prototype.TestOverlap=function(a){var b=a.lowerBound.y-this.upperBound.y,c=this.lowerBound.y-a.upperBound.y;return 0=g&&a[t++].Set(b[0]);0>=e&&a[t++].Set(b[1]);0>g*e&&(c=g/(g-e),e=a[t],e=e.v,e.x=f.x+c*(h.x-f.x),e.y=f.y+c*(h.y-f.y),e=a[t],e.id=(0k&&(k=h,y=w);f=n.EdgeSeparation(b,c,y,d,e);h=parseInt(0<=y-1?y-1: t-1);g=n.EdgeSeparation(b,c,h,d,e);var s=parseInt(y+1f&&g>k)M=-1,w=h,H=g;else if(k>f)M=1,w=s,H=k;else return a[0]=y,f;for(;;)if(y=-1==M?0<=w-1?w-1:t-1:w+1H)w=y,H=f;else break;a[0]=w;return H};n.FindIncidentEdge=function(a,b,c,d,e,t){void 0===d&&(d=0);parseInt(b.m_vertexCount);var f=b.m_normals,h=parseInt(e.m_vertexCount);b=e.m_vertices;e=e.m_normals;var g;g=c.R;c=f[d];var f=g.col1.x*c.x+g.col2.x*c.y,y= g.col1.y*c.x+g.col2.y*c.y;g=t.R;c=g.col1.x*f+g.col1.y*y;y=g.col2.x*f+g.col2.y*y;f=c;g=0;for(var s=Number.MAX_VALUE,k=0;kh)){var y;n.s_edgeBO[0]=0;var s=n.FindMaxSeparation(n.s_edgeBO,e,t,c,d);y=n.s_edgeBO[0];if(!(s>h)){var k=0,w=0;s>0.98*g+0.001?(g=e,e= c,c=t,k=y,b.m_type=u.e_faceB,w=1):(g=c,c=d,d=t,k=f,b.m_type=u.e_faceA,w=0);f=n.s_incidentEdge;n.FindIncidentEdge(f,g,c,k,e,d);y=parseInt(g.m_vertexCount);t=g.m_vertices;var g=t[k],H;H=k+1m)&&(m=n.ClipSegmentToLine(g,H,s,y),!(2>m))){b.m_localPlaneNormal.SetV(t);b.m_localPoint.SetV(e);for(e=t=0;et*t||(a.m_type=u.e_circles,a.m_localPoint.SetV(b.m_p),a.m_localPlaneNormal.SetZero(),a.m_pointCount=1,a.m_points[0].m_localPoint.SetV(d.m_p),a.m_points[0].m_id.key=0)};n.CollidePolygonAndCircle=function(a,b,c,d,e){var t=a.m_pointCount=0,f=0,g,h;h=e.R;g=d.m_p;var y=e.position.y+(h.col1.y*g.x+h.col2.y*g.y),t=e.position.x+(h.col1.x*g.x+h.col2.x*g.y)-c.position.x,f=y-c.position.y;h=c.R;c=t*h.col1.x+f*h.col1.y;h=t*h.col2.x+f*h.col2.y;var s=0,y=-Number.MAX_VALUE;e=b.m_radius+d.m_radius;var k=parseInt(b.m_vertexCount), w=b.m_vertices;b=b.m_normals;for(var H=0;He)return;t>y&&(y=t,s=H)}t=parseInt(s);f=parseInt(t+1=(c-g.x)*(w.x-g.x)+(h-g.y)*(w.y-g.y)?(c-g.x)*(c-g.x)+(h-g.y)*(h-g.y)>e* e||(a.m_pointCount=1,a.m_type=u.e_faceA,a.m_localPlaneNormal.x=c-g.x,a.m_localPlaneNormal.y=h-g.y,a.m_localPlaneNormal.Normalize(),a.m_localPoint.SetV(g),a.m_points[0].m_localPoint.SetV(d.m_p),a.m_points[0].m_id.key=0):0>=y?(c-w.x)*(c-w.x)+(h-w.y)*(h-w.y)>e*e||(a.m_pointCount=1,a.m_type=u.e_faceA,a.m_localPlaneNormal.x=c-w.x,a.m_localPlaneNormal.y=h-w.y,a.m_localPlaneNormal.Normalize(),a.m_localPoint.SetV(w),a.m_points[0].m_localPoint.SetV(d.m_p),a.m_points[0].m_id.key=0):(s=0.5*(g.x+w.x),g=0.5*(g.y+ w.y),y=(c-s)*b[t].x+(h-g)*b[t].y,y>e||(a.m_pointCount=1,a.m_type=u.e_faceA,a.m_localPlaneNormal.x=b[t].x,a.m_localPlaneNormal.y=b[t].y,a.m_localPlaneNormal.Normalize(),a.m_localPoint.Set(s,g),a.m_points[0].m_localPoint.SetV(d.m_p),a.m_points[0].m_id.key=0)))};n.TestOverlap=function(a,b){var c=b.lowerBound,d=a.upperBound,e=c.x-d.x,t=c.y-d.y,c=a.lowerBound,d=b.upperBound,f=c.y-d.y;return 0>8&255;this.features._incidentVertex=(this._key&16711680)>>16&255;this.features._flip=(this._key&4278190080)>>24&255}});q.b2ContactPoint=function(){this.position=new h;this.velocity=new h;this.normal=new h;this.id=new p};v.b2Distance=function(){};v.Distance=function(c,d,e){++v.b2_gjkCalls;var t= e.proxyA,f=e.proxyB,g=e.transformA,y=e.transformB,s=v.s_simplex;s.ReadCache(d,t,g,f,y);var k=s.m_vertices,w=v.s_saveA,H=v.s_saveB,M=0;s.GetClosestPoint().LengthSquared();for(var l=0,m,r=0;20>r;){M=s.m_count;for(l=0;ld+f&&c.distance>Number.MIN_VALUE?(c.distance-=d+f,e=b.SubtractVV(c.pointB,c.pointA),e.Normalize(),c.pointA.x+=d*e.x,c.pointA.y+=d*e.y,c.pointB.x-=f*e.x,c.pointB.y-=f*e.y):(m=new h,m.x=0.5*(c.pointA.x+c.pointB.x),m.y=0.5*(c.pointA.y+c.pointB.y),c.pointA.x=c.pointB.x=m.x,c.pointA.y=c.pointB.y=m.y,c.distance=0))};Box2D.postDefs.push(function(){Box2D.Collision.b2Distance.s_simplex=new w;Box2D.Collision.b2Distance.s_saveA=new Vector_a2j_Number(3);Box2D.Collision.b2Distance.s_saveB= new Vector_a2j_Number(3)});F.b2DistanceInput=function(){};r.b2DistanceOutput=function(){this.pointA=new h;this.pointB=new h};D.b2DistanceProxy=function(){};D.prototype.Set=function(b){switch(b.GetType()){case d.e_circleShape:b=b instanceof c?b:null;this.m_vertices=new Vector(1,!0);this.m_vertices[0]=b.m_p;this.m_count=1;this.m_radius=b.m_radius;break;case d.e_polygonShape:b=b instanceof e?b:null;this.m_vertices=b.m_vertices;this.m_count=b.m_vertexCount;this.m_radius=b.m_radius;break;default:a.b2Assert(!1)}}; D.prototype.GetSupport=function(a){for(var b=0,c=this.m_vertices[0].x*a.x+this.m_vertices[0].y*a.y,d=1;dc&&(b=d,c=e)}return b};D.prototype.GetSupportVertex=function(a){for(var b=0,c=this.m_vertices[0].x*a.x+this.m_vertices[0].y*a.y,d=1;dc&&(b=d,c=e)}return this.m_vertices[b]};D.prototype.GetVertexCount=function(){return this.m_count};D.prototype.GetVertex= function(b){void 0===b&&(b=0);a.b2Assert(0<=b&&b>d&1?c.child2:c.child1,d=d+1&31;++this.m_path;this.RemoveLeaf(c);this.InsertLeaf(c)}};x.prototype.GetFatAABB=function(a){return a.aabb};x.prototype.GetUserData=function(a){return a.userData};x.prototype.Query=function(a,b){if(null!=this.m_root){var c=new Vector,d=0;for(c[d++]=this.m_root;0=d?a:d;++b.m_pairCount;return!0},e)}for(c=b.m_moveBuffer.length=0;ch){var s=e.x-this.p1.x,k=e.y-this.p1.y,e=s*c+k*g;if(0<=e&&e<=d*y&&(d=-t*k+f*s,-h*y<=d&&d<=y*(1+h)))return e/=y,d=Math.sqrt(c*c+g*g),a[0]=e,b.Set(c/d,g/d),!0}return!1};E.prototype.Extend=function(a){this.ExtendForward(a);this.ExtendBackward(a)};E.prototype.ExtendForward=function(a){var b=this.p2.x- this.p1.x,c=this.p2.y-this.p1.y;a=Math.min(0b?(a.lowerBound.x-this.p1.x)/b:Number.POSITIVE_INFINITY,0c?(a.lowerBound.y-this.p1.y)/c:Number.POSITIVE_INFINITY);this.p2.x=this.p1.x+b*a;this.p2.y=this.p1.y+c*a};E.prototype.ExtendBackward=function(a){var b=-this.p2.x+this.p1.x,c=-this.p2.y+this.p1.y;a=Math.min(0b?(a.lowerBound.x-this.p2.x)/b:Number.POSITIVE_INFINITY,0 c?(a.lowerBound.y-this.p2.y)/c:Number.POSITIVE_INFINITY);this.p1.x=this.p2.x+b*a;this.p1.y=this.p2.y+c*a};s.b2SeparationFunction=function(){this.m_localPoint=new h;this.m_axis=new h};s.prototype.Initialize=function(c,d,e,t,f){this.m_proxyA=d;this.m_proxyB=t;var g=parseInt(c.count);a.b2Assert(0g);var y,k,w,H,m=H=w=t=d=0,l=0,m=0;1==g?(this.m_type=s.e_points,y=this.m_proxyA.GetVertex(c.indexA[0]),k=this.m_proxyB.GetVertex(c.indexB[0]),g=y,c=e.R,d=e.position.x+(c.col1.x*g.x+c.col2.x*g.y),t=e.position.y+ (c.col1.y*g.x+c.col2.y*g.y),g=k,c=f.R,w=f.position.x+(c.col1.x*g.x+c.col2.x*g.y),H=f.position.y+(c.col1.y*g.x+c.col2.y*g.y),this.m_axis.x=w-d,this.m_axis.y=H-t,this.m_axis.Normalize()):(c.indexB[0]==c.indexB[1]?(this.m_type=s.e_faceA,d=this.m_proxyA.GetVertex(c.indexA[0]),t=this.m_proxyA.GetVertex(c.indexA[1]),k=this.m_proxyB.GetVertex(c.indexB[0]),this.m_localPoint.x=0.5*(d.x+t.x),this.m_localPoint.y=0.5*(d.y+t.y),this.m_axis=b.CrossVF(b.SubtractVV(t,d),1),this.m_axis.Normalize(),g=this.m_axis,c= e.R,m=c.col1.x*g.x+c.col2.x*g.y,l=c.col1.y*g.x+c.col2.y*g.y,g=this.m_localPoint,c=e.R,d=e.position.x+(c.col1.x*g.x+c.col2.x*g.y),t=e.position.y+(c.col1.y*g.x+c.col2.y*g.y),g=k,c=f.R,w=f.position.x+(c.col1.x*g.x+c.col2.x*g.y),H=f.position.y+(c.col1.y*g.x+c.col2.y*g.y),m=(w-d)*m+(H-t)*l):c.indexA[0]==c.indexA[0]?(this.m_type=s.e_faceB,w=this.m_proxyB.GetVertex(c.indexB[0]),H=this.m_proxyB.GetVertex(c.indexB[1]),y=this.m_proxyA.GetVertex(c.indexA[0]),this.m_localPoint.x=0.5*(w.x+H.x),this.m_localPoint.y= 0.5*(w.y+H.y),this.m_axis=b.CrossVF(b.SubtractVV(H,w),1),this.m_axis.Normalize(),g=this.m_axis,c=f.R,m=c.col1.x*g.x+c.col2.x*g.y,l=c.col1.y*g.x+c.col2.y*g.y,g=this.m_localPoint,c=f.R,w=f.position.x+(c.col1.x*g.x+c.col2.x*g.y),H=f.position.y+(c.col1.y*g.x+c.col2.y*g.y),g=y,c=e.R,d=e.position.x+(c.col1.x*g.x+c.col2.x*g.y),t=e.position.y+(c.col1.y*g.x+c.col2.y*g.y),m=(d-w)*m+(t-H)*l):(d=this.m_proxyA.GetVertex(c.indexA[0]),t=this.m_proxyA.GetVertex(c.indexA[1]),w=this.m_proxyB.GetVertex(c.indexB[0]), H=this.m_proxyB.GetVertex(c.indexB[1]),b.MulX(e,y),y=b.MulMV(e.R,b.SubtractVV(t,d)),b.MulX(f,k),m=b.MulMV(f.R,b.SubtractVV(H,w)),f=y.x*y.x+y.y*y.y,k=m.x*m.x+m.y*m.y,c=b.SubtractVV(m,y),e=y.x*c.x+y.y*c.y,c=m.x*c.x+m.y*c.y,y=y.x*m.x+y.y*m.y,l=f*k-y*y,m=0,0!=l&&(m=b.Clamp((y*c-e*k)/l,0,1)),0>(y*m+c)/k&&(m=b.Clamp((y-e)/f,0,1)),y=new h,y.x=d.x+m*(t.x-d.x),y.y=d.y+m*(t.y-d.y),k=new h,k.x=w.x+m*(H.x-w.x),k.y=w.y+m*(H.y-w.y),0==m||1==m?(this.m_type=s.e_faceB,this.m_axis=b.CrossVF(b.SubtractVV(H,w),1),this.m_axis.Normalize(), this.m_localPoint=k):(this.m_type=s.e_faceA,this.m_axis=b.CrossVF(b.SubtractVV(t,d),1),this.m_localPoint=y)),0>m&&this.m_axis.NegativeSelf())};s.prototype.Evaluate=function(c,d){var e,t,f=0;switch(this.m_type){case s.e_points:return e=b.MulTMV(c.R,this.m_axis),t=b.MulTMV(d.R,this.m_axis.GetNegative()),e=this.m_proxyA.GetSupportVertex(e),t=this.m_proxyB.GetSupportVertex(t),e=b.MulX(c,e),t=b.MulX(d,t),f=(t.x-e.x)*this.m_axis.x+(t.y-e.y)*this.m_axis.y;case s.e_faceA:return f=b.MulMV(c.R,this.m_axis), e=b.MulX(c,this.m_localPoint),t=b.MulTMV(d.R,f.GetNegative()),t=this.m_proxyB.GetSupportVertex(t),t=b.MulX(d,t),f=(t.x-e.x)*f.x+(t.y-e.y)*f.y;case s.e_faceB:return f=b.MulMV(d.R,this.m_axis),t=b.MulX(d,this.m_localPoint),e=b.MulTMV(c.R,f.GetNegative()),e=this.m_proxyA.GetSupportVertex(e),e=b.MulX(c,e),f=(e.x-t.x)*f.x+(e.y-t.y)*f.y;default:return a.b2Assert(!1),0}};Box2D.postDefs.push(function(){Box2D.Collision.b2SeparationFunction.e_points=1;Box2D.Collision.b2SeparationFunction.e_faceA=2;Box2D.Collision.b2SeparationFunction.e_faceB= 4});w.b2Simplex=function(){this.m_v1=new M;this.m_v2=new M;this.m_v3=new M;this.m_vertices=new Vector(3)};w.prototype.b2Simplex=function(){this.m_vertices[0]=this.m_v1;this.m_vertices[1]=this.m_v2;this.m_vertices[2]=this.m_v3};w.prototype.ReadCache=function(c,d,e,t,f){a.b2Assert(0<=c.count&&3>=c.count);var g,h;this.m_count=c.count;for(var y=this.m_vertices,s=0;s=a?this.m_count=this.m_v1.a=1:(c=c.x*d.x+c.y*d.y,0>=c?(this.m_count=this.m_v2.a=1,this.m_v1.Set(this.m_v2)):(d=1/(c+a),this.m_v1.a=c*d,this.m_v2.a=a*d,this.m_count=2))};w.prototype.Solve3=function(){var a=this.m_v1.w,c=this.m_v2.w,d=this.m_v3.w,e=b.SubtractVV(c,a),t=b.Dot(a,e),f=b.Dot(c,e),t=-t,g=b.SubtractVV(d,a),h=b.Dot(a,g),y=b.Dot(d,g),h=-h,s=b.SubtractVV(d,c),k=b.Dot(c,s),s=b.Dot(d,s),k=-k,g=b.CrossVV(e,g), e=g*b.CrossVV(c,d),d=g*b.CrossVV(d,a),a=g*b.CrossVV(a,c);0>=t&&0>=h?this.m_count=this.m_v1.a=1:0=a?(y=1/(f+t),this.m_v1.a=f*y,this.m_v2.a=t*y,this.m_count=2):0=d?(f=1/(y+h),this.m_v1.a=y*f,this.m_v3.a=h*f,this.m_count=2,this.m_v2.Set(this.m_v3)):0>=f&&0>=k?(this.m_count=this.m_v2.a=1,this.m_v1.Set(this.m_v2)):0>=y&&0>=s?(this.m_count=this.m_v3.a=1,this.m_v1.Set(this.m_v3)):0=e?(f=1/(s+k),this.m_v2.a=s*f,this.m_v3.a=k*f,this.m_count=2,this.m_v1.Set(this.m_v3)):(f=1/ (e+d+a),this.m_v1.a=e*f,this.m_v2.a=d*f,this.m_v3.a=a*f,this.m_count=3)};G.b2SimplexCache=function(){this.indexA=new Vector_a2j_Number(3);this.indexB=new Vector_a2j_Number(3)};M.b2SimplexVertex=function(){};M.prototype.Set=function(a){this.wA.SetV(a.wA);this.wB.SetV(a.wB);this.w.SetV(a.w);this.a=a.a;this.indexA=a.indexA;this.indexB=a.indexB};L.b2TimeOfImpact=function(){};L.TimeOfImpact=function(c){++L.b2_toiCalls;var d=c.proxyA,e=c.proxyB,t=c.sweepA,f=c.sweepB;a.b2Assert(t.t0==f.t0);a.b2Assert(1- t.t0>Number.MIN_VALUE);var g=d.m_radius+e.m_radius;c=c.tolerance;var h=0,y=0,s=0;L.s_cache.count=0;for(L.s_distanceInput.useRadii=!1;;){t.GetTransform(L.s_xfA,h);f.GetTransform(L.s_xfB,h);L.s_distanceInput.proxyA=d;L.s_distanceInput.proxyB=e;L.s_distanceInput.transformA=L.s_xfA;L.s_distanceInput.transformB=L.s_xfB;v.Distance(L.s_distanceOutput,L.s_cache,L.s_distanceInput);if(0>=L.s_distanceOutput.distance){h=1;break}L.s_fcn.Initialize(L.s_cache,d,L.s_xfA,e,L.s_xfB);var k=L.s_fcn.Evaluate(L.s_xfA, L.s_xfB);if(0>=k){h=1;break}0==y&&(s=k>g?b.Max(g-c,0.75*g):b.Max(k-c,0.02*g));if(k-s<0.5*c){if(0==y){h=1;break}break}var w=h,H=h,m=1;t.GetTransform(L.s_xfA,m);f.GetTransform(L.s_xfB,m);var l=L.s_fcn.Evaluate(L.s_xfA,L.s_xfB);if(l>=s){h=1;break}for(var M=0;;){var r=0,r=M&1?H+(s-k)*(m-H)/(l-k):0.5*(H+m);t.GetTransform(L.s_xfA,r);f.GetTransform(L.s_xfB,r);var G=L.s_fcn.Evaluate(L.s_xfA,L.s_xfB);if(b.Abs(G-s)<0.025*c){w=r;break}G>s?(H=r,k=G):(m=r,l=G);++M;++L.b2_toiRootIters;if(50==M)break}L.b2_toiMaxRootIters= b.Max(L.b2_toiMaxRootIters,M);if(w<(1+100*Number.MIN_VALUE)*h)break;h=w;y++;++L.b2_toiIters;if(1E3==y)break}L.b2_toiMaxIters=b.Max(L.b2_toiMaxIters,y);return h};Box2D.postDefs.push(function(){Box2D.Collision.b2TimeOfImpact.b2_toiCalls=0;Box2D.Collision.b2TimeOfImpact.b2_toiIters=0;Box2D.Collision.b2TimeOfImpact.b2_toiMaxIters=0;Box2D.Collision.b2TimeOfImpact.b2_toiRootIters=0;Box2D.Collision.b2TimeOfImpact.b2_toiMaxRootIters=0;Box2D.Collision.b2TimeOfImpact.s_cache=new G;Box2D.Collision.b2TimeOfImpact.s_distanceInput= new F;Box2D.Collision.b2TimeOfImpact.s_xfA=new m;Box2D.Collision.b2TimeOfImpact.s_xfB=new m;Box2D.Collision.b2TimeOfImpact.s_fcn=new s;Box2D.Collision.b2TimeOfImpact.s_distanceOutput=new r});R.b2TOIInput=function(){this.proxyA=new D;this.proxyB=new D;this.sweepA=new f;this.sweepB=new f};P.b2WorldManifold=function(){this.m_normal=new h};P.prototype.b2WorldManifold=function(){this.m_points=new Vector(a.b2_maxManifoldPoints);for(var b=0;bNumber.MIN_VALUE*Number.MIN_VALUE?(h=Math.sqrt(h),this.m_normal.x=f/h,this.m_normal.y=g/h):(this.m_normal.x= 1,this.m_normal.y=0);f=b+c*this.m_normal.y;d-=e*this.m_normal.y;this.m_points[0].x=0.5*(t+c*this.m_normal.x+(a-e*this.m_normal.x));this.m_points[0].y=0.5*(f+d);break;case u.e_faceA:g=b.R;f=a.m_localPlaneNormal;h=g.col1.x*f.x+g.col2.x*f.y;y=g.col1.y*f.x+g.col2.y*f.y;g=b.R;f=a.m_localPoint;s=b.position.x+g.col1.x*f.x+g.col2.x*f.y;k=b.position.y+g.col1.y*f.x+g.col2.y*f.y;this.m_normal.x=h;this.m_normal.y=y;for(t=0;tk||hthis.m_radius)return d.SetV(c),Math.PI*this.m_radius*this.m_radius;b=this.m_radius*this.m_radius;var f=e*e,e=b*(Math.asin(e/this.m_radius)+Math.PI/2)+e*Math.sqrt(b-f);b=-2/3*Math.pow(b-f,1.5)/e;d.x=c.x+a.x*b;d.y=c.y+a.y*b;return e};e.prototype.GetLocalPosition=function(){return this.m_p}; e.prototype.SetLocalPosition=function(a){this.m_p.SetV(a)};e.prototype.GetRadius=function(){return this.m_radius};e.prototype.SetRadius=function(a){void 0===a&&(a=0);this.m_radius=a};e.prototype.b2CircleShape=function(a){void 0===a&&(a=0);this.__super.b2Shape.call(this);this.m_type=m.e_circleShape;this.m_radius=a};d.b2EdgeChainDef=function(){};d.prototype.b2EdgeChainDef=function(){this.vertexCount=0;this.isALoop=!0;this.vertices=[]};Box2D.inherit(a,Box2D.Collision.Shapes.b2Shape);a.prototype.__super= Box2D.Collision.Shapes.b2Shape.prototype;a.b2EdgeShape=function(){Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this,arguments);this.s_supportVec=new l;this.m_v1=new l;this.m_v2=new l;this.m_coreV1=new l;this.m_coreV2=new l;this.m_normal=new l;this.m_direction=new l;this.m_cornerDir1=new l;this.m_cornerDir2=new l};a.prototype.TestPoint=function(a,b){return!1};a.prototype.RayCast=function(a,b,c){var d,e=b.p2.x-b.p1.x,f=b.p2.y-b.p1.y;d=c.R;var g=c.position.x+(d.col1.x*this.m_v1.x+d.col2.x*this.m_v1.y), h=c.position.y+(d.col1.y*this.m_v1.x+d.col2.y*this.m_v1.y),k=c.position.y+(d.col1.y*this.m_v2.x+d.col2.y*this.m_v2.y)-h;c=-(c.position.x+(d.col1.x*this.m_v2.x+d.col2.x*this.m_v2.y)-g);d=100*Number.MIN_VALUE;var m=-(e*k+f*c);if(m>d){var g=b.p1.x-g,l=b.p1.y-h,h=g*k+l*c;if(0<=h&&h<=b.maxFraction*m&&(b=-e*l+f*g,-d*m<=b&&b<=m*(1+d)))return a.fraction=h/m,b=Math.sqrt(k*k+c*c),a.normal.x=k/b,a.normal.y=c/b,!0}return!1};a.prototype.ComputeAABB=function(a,b){var c=b.R,d=b.position.x+(c.col1.x*this.m_v1.x+ c.col2.x*this.m_v1.y),e=b.position.y+(c.col1.y*this.m_v1.x+c.col2.y*this.m_v1.y),f=b.position.x+(c.col1.x*this.m_v2.x+c.col2.x*this.m_v2.y),c=b.position.y+(c.col1.y*this.m_v2.x+c.col2.y*this.m_v2.y);dg*b+a*c?(this.s_supportVec.x=e,this.s_supportVec.y=f):(this.s_supportVec.x=g,this.s_supportVec.y=a);return this.s_supportVec};a.prototype.b2EdgeShape=function(a,b){this.__super.b2Shape.call(this);this.m_type=m.e_edgeShape;this.m_nextEdge=this.m_prevEdge=null;this.m_v1=a;this.m_v2=b;this.m_direction.Set(this.m_v2.x-this.m_v1.x,this.m_v2.y- this.m_v1.y);this.m_length=this.m_direction.Normalize();this.m_normal.Set(this.m_direction.y,-this.m_direction.x);this.m_coreV1.Set(-c.b2_toiSlop*(this.m_normal.x-this.m_direction.x)+this.m_v1.x,-c.b2_toiSlop*(this.m_normal.y-this.m_direction.y)+this.m_v1.y);this.m_coreV2.Set(-c.b2_toiSlop*(this.m_normal.x+this.m_direction.x)+this.m_v2.x,-c.b2_toiSlop*(this.m_normal.y+this.m_direction.y)+this.m_v2.y);this.m_cornerDir1=this.m_normal;this.m_cornerDir2.Set(-this.m_normal.x,-this.m_normal.y)};a.prototype.SetPrevEdge= function(a,b,c,d){this.m_prevEdge=a;this.m_coreV1=b;this.m_cornerDir1=c;this.m_cornerConvex1=d};a.prototype.SetNextEdge=function(a,b,c,d){this.m_nextEdge=a;this.m_coreV2=b;this.m_cornerDir2=c;this.m_cornerConvex2=d};b.b2MassData=function(){this.mass=0;this.center=new l(0,0);this.I=0};Box2D.inherit(f,Box2D.Collision.Shapes.b2Shape);f.prototype.__super=Box2D.Collision.Shapes.b2Shape.prototype;f.b2PolygonShape=function(){Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this,arguments)};f.prototype.Copy= function(){var a=new f;a.Set(this);return a};f.prototype.Set=function(a){this.__super.Set.call(this,a);if(Box2D.is(a,f)){a=a instanceof f?a:null;this.m_centroid.SetV(a.m_centroid);this.m_vertexCount=a.m_vertexCount;this.Reserve(this.m_vertexCount);for(var b=0;bNumber.MIN_VALUE);this.m_normals[d].SetV(g.CrossVF(e, 1));this.m_normals[d].Normalize()}this.m_centroid=f.ComputeCentroid(this.m_vertices,this.m_vertexCount)};f.AsVector=function(a,b){void 0===b&&(b=0);var c=new f;c.SetAsVector(a,b);return c};f.prototype.SetAsBox=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);this.m_vertexCount=4;this.Reserve(4);this.m_vertices[0].Set(-a,-b);this.m_vertices[1].Set(a,-b);this.m_vertices[2].Set(a,b);this.m_vertices[3].Set(-a,b);this.m_normals[0].Set(0,-1);this.m_normals[1].Set(1,0);this.m_normals[2].Set(0,1);this.m_normals[3].Set(-1, 0);this.m_centroid.SetZero()};f.AsBox=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);var c=new f;c.SetAsBox(a,b);return c};f.prototype.SetAsOrientedBox=function(a,b,c,d){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=null);void 0===d&&(d=0);this.m_vertexCount=4;this.Reserve(4);this.m_vertices[0].Set(-a,-b);this.m_vertices[1].Set(a,-b);this.m_vertices[2].Set(a,b);this.m_vertices[3].Set(-a,b);this.m_normals[0].Set(0,-1);this.m_normals[1].Set(1,0);this.m_normals[2].Set(0,1);this.m_normals[3].Set(-1, 0);this.m_centroid=c;a=new k;a.position=c;a.R.Set(d);for(c=0;cf)return!1}else 0>g&&fm?g:m,h=h>d?h:d;a.lowerBound.x=e-this.m_radius; a.lowerBound.y=f-this.m_radius;a.upperBound.x=g+this.m_radius;a.upperBound.y=h+this.m_radius};f.prototype.ComputeMass=function(a,b){void 0===b&&(b=0);if(2==this.m_vertexCount)a.center.x=0.5*(this.m_vertices[0].x+this.m_vertices[1].x),a.center.y=0.5*(this.m_vertices[0].y+this.m_vertices[1].y),a.mass=0,a.I=0;else{for(var c=0,d=0,e=0,f=0,g=1/3,h=0;hc&&(b=d,c=e)}return b};f.prototype.GetSupportVertex=function(a){for(var b=0,c=this.m_vertices[0].x*a.x+this.m_vertices[0].y*a.y,d=1;dc&&(b=d,c=e)}return this.m_vertices[b]};f.prototype.Validate=function(){return!1};f.prototype.b2PolygonShape=function(){this.__super.b2Shape.call(this);this.m_type=m.e_polygonShape;this.m_centroid= new l;this.m_vertices=new Vector;this.m_normals=new Vector};f.prototype.Reserve=function(a){void 0===a&&(a=0);for(var b=parseInt(this.m_vertices.length);bs&&(s=p);M>w&&(w=M)}G=(s-k)*(w-n);G<0.95*b&&(b=G,a.R.col1.x=g,a.R.col1.y=h,a.R.col2.x=m,a.R.col2.y=l,g=0.5*(k+s),h=0.5*(n+w),m=a.R,a.center.x=f.x+(m.col1.x* g+m.col2.x*h),a.center.y=f.y+(m.col1.y*g+m.col2.y*h),a.extents.x=0.5*(s-k),a.extents.y=0.5*(w-n))}};Box2D.postDefs.push(function(){Box2D.Collision.Shapes.b2PolygonShape.s_mat=new h});m.b2Shape=function(){};m.prototype.Copy=function(){return null};m.prototype.Set=function(a){this.m_radius=a.m_radius};m.prototype.GetType=function(){return this.m_type};m.prototype.TestPoint=function(a,b){return!1};m.prototype.RayCast=function(a,b,c){return!1};m.prototype.ComputeAABB=function(a,b){};m.prototype.ComputeMass= function(a,b){};m.prototype.ComputeSubmergedArea=function(a,b,c,d){return 0};m.TestOverlap=function(a,b,c,d){var e=new p;e.proxyA=new v;e.proxyA.Set(a);e.proxyB=new v;e.proxyB.Set(c);e.transformA=b;e.transformB=d;e.useRadii=!0;a=new F;a.count=0;b=new q;n.Distance(b,a,e);return b.distance<10*Number.MIN_VALUE};m.prototype.b2Shape=function(){this.m_type=m.e_unknownShape;this.m_radius=c.b2_linearSlop};Box2D.postDefs.push(function(){Box2D.Collision.Shapes.b2Shape.e_unknownShape=-1;Box2D.Collision.Shapes.b2Shape.e_circleShape= 0;Box2D.Collision.Shapes.b2Shape.e_polygonShape=1;Box2D.Collision.Shapes.b2Shape.e_edgeShape=2;Box2D.Collision.Shapes.b2Shape.e_shapeTypeCount=3;Box2D.Collision.Shapes.b2Shape.e_hitCollide=1;Box2D.Collision.Shapes.b2Shape.e_missCollide=0;Box2D.Collision.Shapes.b2Shape.e_startsInsideCollide=-1})})(); (function(){var c=Box2D.Common.b2Color,e=Box2D.Common.b2Settings,d=Box2D.Common.Math.b2Math;c.b2Color=function(){this._b=this._g=this._r=0};c.prototype.b2Color=function(a,b,c){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=0);this._r=Box2D.parseUInt(255*d.Clamp(a,0,1));this._g=Box2D.parseUInt(255*d.Clamp(b,0,1));this._b=Box2D.parseUInt(255*d.Clamp(c,0,1))};c.prototype.Set=function(a,b,c){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=0);this._r=Box2D.parseUInt(255*d.Clamp(a,0,1));this._g= Box2D.parseUInt(255*d.Clamp(b,0,1));this._b=Box2D.parseUInt(255*d.Clamp(c,0,1))};Object.defineProperty(c.prototype,"r",{enumerable:!1,configurable:!0,set:function(a){void 0===a&&(a=0);this._r=Box2D.parseUInt(255*d.Clamp(a,0,1))}});Object.defineProperty(c.prototype,"g",{enumerable:!1,configurable:!0,set:function(a){void 0===a&&(a=0);this._g=Box2D.parseUInt(255*d.Clamp(a,0,1))}});Object.defineProperty(c.prototype,"b",{enumerable:!1,configurable:!0,set:function(a){void 0===a&&(a=0);this._b=Box2D.parseUInt(255* d.Clamp(a,0,1))}});Object.defineProperty(c.prototype,"color",{enumerable:!1,configurable:!0,get:function(){return this._r<<16|this._g<<8|this._b}});e.b2Settings=function(){};e.b2MixFriction=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);return Math.sqrt(a*b)};e.b2MixRestitution=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);return a>b?a:b};e.b2Assert=function(a){if(!a)throw"Assertion Failed";};Box2D.postDefs.push(function(){Box2D.Common.b2Settings.VERSION="2.1alpha";Box2D.Common.b2Settings.USHRT_MAX= 65535;Box2D.Common.b2Settings.b2_pi=Math.PI;Box2D.Common.b2Settings.b2_maxManifoldPoints=2;Box2D.Common.b2Settings.b2_aabbExtension=0.1;Box2D.Common.b2Settings.b2_aabbMultiplier=2;Box2D.Common.b2Settings.b2_polygonRadius=2*e.b2_linearSlop;Box2D.Common.b2Settings.b2_linearSlop=0.005;Box2D.Common.b2Settings.b2_angularSlop=2/180*e.b2_pi;Box2D.Common.b2Settings.b2_toiSlop=8*e.b2_linearSlop;Box2D.Common.b2Settings.b2_maxTOIContactsPerIsland=32;Box2D.Common.b2Settings.b2_maxTOIJointsPerIsland=32;Box2D.Common.b2Settings.b2_velocityThreshold= 1;Box2D.Common.b2Settings.b2_maxLinearCorrection=0.2;Box2D.Common.b2Settings.b2_maxAngularCorrection=8/180*e.b2_pi;Box2D.Common.b2Settings.b2_maxTranslation=2;Box2D.Common.b2Settings.b2_maxTranslationSquared=e.b2_maxTranslation*e.b2_maxTranslation;Box2D.Common.b2Settings.b2_maxRotation=0.5*e.b2_pi;Box2D.Common.b2Settings.b2_maxRotationSquared=e.b2_maxRotation*e.b2_maxRotation;Box2D.Common.b2Settings.b2_contactBaumgarte=0.2;Box2D.Common.b2Settings.b2_timeToSleep=0.5;Box2D.Common.b2Settings.b2_linearSleepTolerance= 0.01;Box2D.Common.b2Settings.b2_angularSleepTolerance=2/180*e.b2_pi})})(); (function(){var c=Box2D.Common.Math.b2Mat22,e=Box2D.Common.Math.b2Mat33,d=Box2D.Common.Math.b2Math,a=Box2D.Common.Math.b2Sweep,b=Box2D.Common.Math.b2Transform,f=Box2D.Common.Math.b2Vec2,m=Box2D.Common.Math.b2Vec3;c.b2Mat22=function(){this.col1=new f;this.col2=new f};c.prototype.b2Mat22=function(){this.SetIdentity()};c.FromAngle=function(a){void 0===a&&(a=0);var b=new c;b.Set(a);return b};c.FromVV=function(a,b){var d=new c;d.SetVV(a,b);return d};c.prototype.Set=function(a){void 0===a&&(a=0);var b= Math.cos(a);a=Math.sin(a);this.col1.x=b;this.col2.x=-a;this.col1.y=a;this.col2.y=b};c.prototype.SetVV=function(a,b){this.col1.SetV(a);this.col2.SetV(b)};c.prototype.Copy=function(){var a=new c;a.SetM(this);return a};c.prototype.SetM=function(a){this.col1.SetV(a.col1);this.col2.SetV(a.col2)};c.prototype.AddM=function(a){this.col1.x+=a.col1.x;this.col1.y+=a.col1.y;this.col2.x+=a.col2.x;this.col2.y+=a.col2.y};c.prototype.SetIdentity=function(){this.col1.x=1;this.col2.x=0;this.col1.y=0;this.col2.y=1}; c.prototype.SetZero=function(){this.col1.x=0;this.col2.x=0;this.col1.y=0;this.col2.y=0};c.prototype.GetAngle=function(){return Math.atan2(this.col1.y,this.col1.x)};c.prototype.GetInverse=function(a){var b=this.col1.x,c=this.col2.x,d=this.col1.y,e=this.col2.y,f=b*e-c*d;0!=f&&(f=1/f);a.col1.x=f*e;a.col2.x=-f*c;a.col1.y=-f*d;a.col2.y=f*b;return a};c.prototype.Solve=function(a,b,c){void 0===b&&(b=0);void 0===c&&(c=0);var d=this.col1.x,e=this.col2.x,f=this.col1.y,m=this.col2.y,v=d*m-e*f;0!=v&&(v=1/v); a.x=v*(m*b-e*c);a.y=v*(d*c-f*b);return a};c.prototype.Abs=function(){this.col1.Abs();this.col2.Abs()};e.b2Mat33=function(){this.col1=new m;this.col2=new m;this.col3=new m};e.prototype.b2Mat33=function(a,b,c){void 0===a&&(a=null);void 0===b&&(b=null);void 0===c&&(c=null);!a&&!b&&!c?(this.col1.SetZero(),this.col2.SetZero(),this.col3.SetZero()):(this.col1.SetV(a),this.col2.SetV(b),this.col3.SetV(c))};e.prototype.SetVVV=function(a,b,c){this.col1.SetV(a);this.col2.SetV(b);this.col3.SetV(c)};e.prototype.Copy= function(){return new e(this.col1,this.col2,this.col3)};e.prototype.SetM=function(a){this.col1.SetV(a.col1);this.col2.SetV(a.col2);this.col3.SetV(a.col3)};e.prototype.AddM=function(a){this.col1.x+=a.col1.x;this.col1.y+=a.col1.y;this.col1.z+=a.col1.z;this.col2.x+=a.col2.x;this.col2.y+=a.col2.y;this.col2.z+=a.col2.z;this.col3.x+=a.col3.x;this.col3.y+=a.col3.y;this.col3.z+=a.col3.z};e.prototype.SetIdentity=function(){this.col1.x=1;this.col2.x=0;this.col3.x=0;this.col1.y=0;this.col2.y=1;this.col3.y=0; this.col1.z=0;this.col2.z=0;this.col3.z=1};e.prototype.SetZero=function(){this.col1.x=0;this.col2.x=0;this.col3.x=0;this.col1.y=0;this.col2.y=0;this.col3.y=0;this.col1.z=0;this.col2.z=0;this.col3.z=0};e.prototype.Solve22=function(a,b,c){void 0===b&&(b=0);void 0===c&&(c=0);var d=this.col1.x,e=this.col2.x,f=this.col1.y,m=this.col2.y,v=d*m-e*f;0!=v&&(v=1/v);a.x=v*(m*b-e*c);a.y=v*(d*c-f*b);return a};e.prototype.Solve33=function(a,b,c,d){void 0===b&&(b=0);void 0===c&&(c=0);void 0===d&&(d=0);var e=this.col1.x, f=this.col1.y,m=this.col1.z,v=this.col2.x,F=this.col2.y,r=this.col2.z,D=this.col3.x,x=this.col3.y,C=this.col3.z,A=e*(F*C-r*x)+f*(r*D-v*C)+m*(v*x-F*D);0!=A&&(A=1/A);a.x=A*(b*(F*C-r*x)+c*(r*D-v*C)+d*(v*x-F*D));a.y=A*(e*(c*C-d*x)+f*(d*D-b*C)+m*(b*x-c*D));a.z=A*(e*(F*d-r*c)+f*(r*b-v*d)+m*(v*c-F*b));return a};d.b2Math=function(){};d.IsValid=function(a){void 0===a&&(a=0);return isFinite(a)};d.Dot=function(a,b){return a.x*b.x+a.y*b.y};d.CrossVV=function(a,b){return a.x*b.y-a.y*b.x};d.CrossVF=function(a, b){void 0===b&&(b=0);return new f(b*a.y,-b*a.x)};d.CrossFV=function(a,b){void 0===a&&(a=0);return new f(-a*b.y,a*b.x)};d.MulMV=function(a,b){return new f(a.col1.x*b.x+a.col2.x*b.y,a.col1.y*b.x+a.col2.y*b.y)};d.MulTMV=function(a,b){return new f(d.Dot(b,a.col1),d.Dot(b,a.col2))};d.MulX=function(a,b){var c=d.MulMV(a.R,b);c.x+=a.position.x;c.y+=a.position.y;return c};d.MulXT=function(a,b){var c=d.SubtractVV(b,a.position),e=c.x*a.R.col1.x+c.y*a.R.col1.y;c.y=c.x*a.R.col2.x+c.y*a.R.col2.y;c.x=e;return c}; d.AddVV=function(a,b){return new f(a.x+b.x,a.y+b.y)};d.SubtractVV=function(a,b){return new f(a.x-b.x,a.y-b.y)};d.Distance=function(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)};d.DistanceSquared=function(a,b){var c=a.x-b.x,d=a.y-b.y;return c*c+d*d};d.MulFV=function(a,b){void 0===a&&(a=0);return new f(a*b.x,a*b.y)};d.AddMM=function(a,b){return c.FromVV(d.AddVV(a.col1,b.col1),d.AddVV(a.col2,b.col2))};d.MulMM=function(a,b){return c.FromVV(d.MulMV(a,b.col1),d.MulMV(a,b.col2))};d.MulTMM=function(a, b){var e=new f(d.Dot(a.col1,b.col1),d.Dot(a.col2,b.col1)),m=new f(d.Dot(a.col1,b.col2),d.Dot(a.col2,b.col2));return c.FromVV(e,m)};d.Abs=function(a){void 0===a&&(a=0);return 0b?a:b};d.MaxV=function(a,b){return new f(d.Max(a.x,b.x),d.Max(a.y,b.y))};d.Clamp=function(a,b,c){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=0);return ac?c:a};d.ClampV=function(a,b,c){return d.MaxV(b,d.MinV(a,c))};d.Swap=function(a,b){var c=a[0];a[0]=b[0];b[0]=c};d.Random=function(){return 2*Math.random()-1};d.RandomRange=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);var c=Math.random();return(b-a)*c+a};d.NextPowerOfTwo=function(a){void 0===a&&(a=0);a|=a>>1&2147483647;a|= a>>2&1073741823;a|=a>>4&268435455;a|=a>>8&16777215;return(a|a>>16&65535)+1};d.IsPowerOfTwo=function(a){void 0===a&&(a=0);return 0Number.MIN_VALUE){var b=(a-this.t0)/(1-this.t0);this.c0.x=(1-b)*this.c0.x+b*this.c.x;this.c0.y=(1-b)*this.c0.y+b*this.c.y;this.a0=(1-b)*this.a0+b*this.a;this.t0=a}};b.b2Transform=function(){this.position=new f;this.R=new c};b.prototype.b2Transform=function(a,b){void 0===a&&(a=null);void 0===b&&(b=null);a&&(this.position.SetV(a),this.R.SetM(b))};b.prototype.Initialize=function(a, b){this.position.SetV(a);this.R.SetM(b)};b.prototype.SetIdentity=function(){this.position.SetZero();this.R.SetIdentity()};b.prototype.Set=function(a){this.position.SetV(a.position);this.R.SetM(a.R)};b.prototype.GetAngle=function(){return Math.atan2(this.R.col1.y,this.R.col1.x)};f.b2Vec2=function(){};f.prototype.b2Vec2=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);this.x=a;this.y=b};f.prototype.SetZero=function(){this.y=this.x=0};f.prototype.Set=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0); this.x=a;this.y=b};f.prototype.SetV=function(a){this.x=a.x;this.y=a.y};f.prototype.GetNegative=function(){return new f(-this.x,-this.y)};f.prototype.NegativeSelf=function(){this.x=-this.x;this.y=-this.y};f.Make=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);return new f(a,b)};f.prototype.Copy=function(){return new f(this.x,this.y)};f.prototype.Add=function(a){this.x+=a.x;this.y+=a.y};f.prototype.Subtract=function(a){this.x-=a.x;this.y-=a.y};f.prototype.Multiply=function(a){void 0===a&&(a=0);this.x*= a;this.y*=a};f.prototype.MulM=function(a){var b=this.x;this.x=a.col1.x*b+a.col2.x*this.y;this.y=a.col1.y*b+a.col2.y*this.y};f.prototype.MulTM=function(a){var b=d.Dot(this,a.col1);this.y=d.Dot(this,a.col2);this.x=b};f.prototype.CrossVF=function(a){void 0===a&&(a=0);var b=this.x;this.x=a*this.y;this.y=-a*b};f.prototype.CrossFV=function(a){void 0===a&&(a=0);var b=this.x;this.x=-a*this.y;this.y=a*b};f.prototype.MinV=function(a){this.x=this.xa.x?this.x:a.x;this.y=this.y>a.y?this.y:a.y};f.prototype.Abs=function(){0>this.x&&(this.x=-this.x);0>this.y&&(this.y=-this.y)};f.prototype.Length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)};f.prototype.LengthSquared=function(){return this.x*this.x+this.y*this.y};f.prototype.Normalize=function(){var a=Math.sqrt(this.x*this.x+this.y*this.y);if(a=this.m_mass&&(this.m_mass=1);this.m_invMass=1/this.m_mass;0f.b2_maxTranslationSquared&&(g.m_linearVelocity.Normalize(),g.m_linearVelocity.x*=f.b2_maxTranslation*a.inv_dt,g.m_linearVelocity.y*= f.b2_maxTranslation*a.inv_dt);h=a.dt*g.m_angularVelocity;h*h>f.b2_maxRotationSquared&&(g.m_angularVelocity=0>g.m_angularVelocity?-f.b2_maxRotation*a.inv_dt:f.b2_maxRotation*a.inv_dt);g.m_sweep.c0.SetV(g.m_sweep.c);g.m_sweep.a0=g.m_sweep.a;g.m_sweep.c.x+=a.dt*g.m_linearVelocity.x;g.m_sweep.c.y+=a.dt*g.m_linearVelocity.y;g.m_sweep.a+=a.dt*g.m_angularVelocity;g.SynchronizeTransform()}for(e=0;eh||c.Dot(g.m_linearVelocity,g.m_linearVelocity)> b?d=g.m_sleepTime=0:(g.m_sleepTime+=a.dt,d=c.Min(d,g.m_sleepTime)));if(d>=f.b2_timeToSleep)for(e=0;ef.b2_maxTranslationSquared&&(c.m_linearVelocity.Normalize(),c.m_linearVelocity.x*=f.b2_maxTranslation*a.inv_dt,c.m_linearVelocity.y*=f.b2_maxTranslation*a.inv_dt);e=a.dt*c.m_angularVelocity;e*e>f.b2_maxRotationSquared&&(c.m_angularVelocity=0>c.m_angularVelocity?-f.b2_maxRotation*a.inv_dt:f.b2_maxRotation*a.inv_dt);c.m_sweep.c0.SetV(c.m_sweep.c);c.m_sweep.a0= c.m_sweep.a;c.m_sweep.c.x+=a.dt*c.m_linearVelocity.x;c.m_sweep.c.y+=a.dt*c.m_linearVelocity.y;c.m_sweep.a+=a.dt*c.m_angularVelocity;c.SynchronizeTransform()}for(b=0;b=b);0b&&(b=(1-b)*k+b,1-1.5*z.b2_linearSlop};Box2D.postDefs.push(function(){Box2D.Dynamics.Contacts.b2ContactSolver.s_worldManifold=new G;Box2D.Dynamics.Contacts.b2ContactSolver.s_psm=new x});Box2D.inherit(q,Box2D.Dynamics.Contacts.b2Contact);q.prototype.__super=Box2D.Dynamics.Contacts.b2Contact.prototype;q.b2EdgeAndCircleContact=function(){Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this,arguments)};q.Create=function(a){return new q};q.Destroy=function(a, b){};q.prototype.Reset=function(a,b){this.__super.Reset.call(this,a,b)};q.prototype.Evaluate=function(){var a=this.m_fixtureA.GetBody(),b=this.m_fixtureB.GetBody();this.b2CollideEdgeAndCircle(this.m_manifold,this.m_fixtureA.GetShape()instanceof e?this.m_fixtureA.GetShape():null,a.m_xf,this.m_fixtureB.GetShape()instanceof c?this.m_fixtureB.GetShape():null,b.m_xf)};q.prototype.b2CollideEdgeAndCircle=function(a,b,c,d,e){};Box2D.inherit(v,Box2D.Dynamics.Contacts.b2Contact);v.prototype.__super=Box2D.Dynamics.Contacts.b2Contact.prototype; v.b2NullContact=function(){Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this,arguments)};v.prototype.b2NullContact=function(){this.__super.b2Contact.call(this)};v.prototype.Evaluate=function(){};Box2D.inherit(F,Box2D.Dynamics.Contacts.b2Contact);F.prototype.__super=Box2D.Dynamics.Contacts.b2Contact.prototype;F.b2PolyAndCircleContact=function(){Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this,arguments)};F.Create=function(a){return new F};F.Destroy=function(a,b){};F.prototype.Reset=function(b, c){this.__super.Reset.call(this,b,c);z.b2Assert(b.GetType()==a.e_polygonShape);z.b2Assert(c.GetType()==a.e_circleShape)};F.prototype.Evaluate=function(){var a=this.m_fixtureA.m_body,b=this.m_fixtureB.m_body;K.CollidePolygonAndCircle(this.m_manifold,this.m_fixtureA.GetShape()instanceof d?this.m_fixtureA.GetShape():null,a.m_xf,this.m_fixtureB.GetShape()instanceof c?this.m_fixtureB.GetShape():null,b.m_xf)};Box2D.inherit(r,Box2D.Dynamics.Contacts.b2Contact);r.prototype.__super=Box2D.Dynamics.Contacts.b2Contact.prototype; r.b2PolyAndEdgeContact=function(){Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this,arguments)};r.Create=function(a){return new r};r.Destroy=function(a,b){};r.prototype.Reset=function(b,c){this.__super.Reset.call(this,b,c);z.b2Assert(b.GetType()==a.e_polygonShape);z.b2Assert(c.GetType()==a.e_edgeShape)};r.prototype.Evaluate=function(){var a=this.m_fixtureA.GetBody(),b=this.m_fixtureB.GetBody();this.b2CollidePolyAndEdge(this.m_manifold,this.m_fixtureA.GetShape()instanceof d?this.m_fixtureA.GetShape(): null,a.m_xf,this.m_fixtureB.GetShape()instanceof e?this.m_fixtureB.GetShape():null,b.m_xf)};r.prototype.b2CollidePolyAndEdge=function(a,b,c,d,e){};Box2D.inherit(D,Box2D.Dynamics.Contacts.b2Contact);D.prototype.__super=Box2D.Dynamics.Contacts.b2Contact.prototype;D.b2PolygonContact=function(){Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this,arguments)};D.Create=function(a){return new D};D.Destroy=function(a,b){};D.prototype.Reset=function(a,b){this.__super.Reset.call(this,a,b)};D.prototype.Evaluate= function(){var a=this.m_fixtureA.GetBody(),b=this.m_fixtureB.GetBody();K.CollidePolygons(this.m_manifold,this.m_fixtureA.GetShape()instanceof d?this.m_fixtureA.GetShape():null,a.m_xf,this.m_fixtureB.GetShape()instanceof d?this.m_fixtureB.GetShape():null,b.m_xf)};x.b2PositionSolverManifold=function(){};x.prototype.b2PositionSolverManifold=function(){this.m_normal=new B;this.m_separations=new Vector_a2j_Number(z.b2_maxManifoldPoints);this.m_points=new Vector(z.b2_maxManifoldPoints);for(var a=0;aNumber.MIN_VALUE*Number.MIN_VALUE?(s=Math.sqrt(s),this.m_normal.x= d/s,this.m_normal.y=g/s):(this.m_normal.x=1,this.m_normal.y=0);this.m_points[0].x=0.5*(b+f);this.m_points[0].y=0.5*(c+e);this.m_separations[0]=d*this.m_normal.x+g*this.m_normal.y-a.radius;break;case E.e_faceA:e=a.bodyA.m_xf.R;d=a.localPlaneNormal;this.m_normal.x=e.col1.x*d.x+e.col2.x*d.y;this.m_normal.y=e.col1.y*d.x+e.col2.y*d.y;e=a.bodyA.m_xf.R;d=a.localPoint;f=a.bodyA.m_xf.position.x+(e.col1.x*d.x+e.col2.x*d.y);g=a.bodyA.m_xf.position.y+(e.col1.y*d.x+e.col2.y*d.y);e=a.bodyB.m_xf.R;for(b=0;bthis.maxTimestep&&0c.b2_linearSlop?this.m_u.Multiply(1/d):this.m_u.SetZero();b=g*this.m_u.y-h*this.m_u.x;var l=k*this.m_u.y-m*this.m_u.x;b=e.m_invMass+e.m_invI* b*b+f.m_invMass+f.m_invI*l*l;this.m_mass=0!=b?1/b:0;if(0d*d&&(this.m_linearImpulse.Normalize(),this.m_linearImpulse.Multiply(d));d=a.SubtractVV(this.m_linearImpulse,e);h.x-=n*d.x;h.y-=n*d.y;k-=p*(v*d.y-u*d.x);m.x+=q*d.x;m.y+=q*d.y;l+=r*(x*d.y-z*d.x);f.m_angularVelocity=k;g.m_angularVelocity=l};g.prototype.SolvePositionConstraints=function(a){return!0};Box2D.inherit(k,Box2D.Dynamics.Joints.b2JointDef);k.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;k.b2FrictionJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);this.localAnchorA=new b;this.localAnchorB=new b};k.prototype.b2FrictionJointDef=function(){this.__super.b2JointDef.call(this);this.type=q.e_frictionJoint;this.maxTorque=this.maxForce=0};k.prototype.Initialize=function(a,b,c){this.bodyA=a;this.bodyB=b;this.localAnchorA.SetV(this.bodyA.GetLocalPoint(c));this.localAnchorB.SetV(this.bodyB.GetLocalPoint(c))};Box2D.inherit(l,Box2D.Dynamics.Joints.b2Joint);l.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;l.b2GearJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);this.m_groundAnchor1=new b;this.m_groundAnchor2=new b;this.m_localAnchor1=new b;this.m_localAnchor2=new b;this.m_J=new p};l.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)};l.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)};l.prototype.GetReactionForce=function(a){void 0===a&&(a=0);return new b(a*this.m_impulse*this.m_J.linearB.x,a*this.m_impulse*this.m_J.linearB.y)};l.prototype.GetReactionTorque=function(a){void 0=== a&&(a=0);var b=this.m_bodyB.m_xf.R,c=this.m_localAnchor1.x-this.m_bodyB.m_sweep.localCenter.x,d=this.m_localAnchor1.y-this.m_bodyB.m_sweep.localCenter.y,e=b.col1.x*c+b.col2.x*d,d=b.col1.y*c+b.col2.y*d;return a*(this.m_impulse*this.m_J.angularB-e*this.m_impulse*this.m_J.linearB.y+d*this.m_impulse*this.m_J.linearB.x)};l.prototype.GetRatio=function(){return this.m_ratio};l.prototype.SetRatio=function(a){void 0===a&&(a=0);this.m_ratio=a};l.prototype.b2GearJoint=function(a){this.__super.b2Joint.call(this, a);var b=parseInt(a.joint1.m_type),c=parseInt(a.joint2.m_type);this.m_prismatic2=this.m_revolute2=this.m_prismatic1=this.m_revolute1=null;var d=0,e=0;this.m_ground1=a.joint1.GetBodyA();this.m_bodyA=a.joint1.GetBodyB();b==q.e_revoluteJoint?(this.m_revolute1=a.joint1 instanceof B?a.joint1:null,this.m_groundAnchor1.SetV(this.m_revolute1.m_localAnchor1),this.m_localAnchor1.SetV(this.m_revolute1.m_localAnchor2),d=this.m_revolute1.GetJointAngle()):(this.m_prismatic1=a.joint1 instanceof A?a.joint1:null, this.m_groundAnchor1.SetV(this.m_prismatic1.m_localAnchor1),this.m_localAnchor1.SetV(this.m_prismatic1.m_localAnchor2),d=this.m_prismatic1.GetJointTranslation());this.m_ground2=a.joint2.GetBodyA();this.m_bodyB=a.joint2.GetBodyB();c==q.e_revoluteJoint?(this.m_revolute2=a.joint2 instanceof B?a.joint2:null,this.m_groundAnchor2.SetV(this.m_revolute2.m_localAnchor1),this.m_localAnchor2.SetV(this.m_revolute2.m_localAnchor2),e=this.m_revolute2.GetJointAngle()):(this.m_prismatic2=a.joint2 instanceof A?a.joint2: null,this.m_groundAnchor2.SetV(this.m_prismatic2.m_localAnchor1),this.m_localAnchor2.SetV(this.m_prismatic2.m_localAnchor2),e=this.m_prismatic2.GetJointTranslation());this.m_ratio=a.ratio;this.m_constant=d+this.m_ratio*e;this.m_impulse=0};l.prototype.InitVelocityConstraints=function(a){var b=this.m_ground1,c=this.m_ground2,d=this.m_bodyA,e=this.m_bodyB,f=0,g=0,h=0,k=0,m=h=0,l=0;this.m_J.SetZero();this.m_revolute1?(this.m_J.angularA=-1,l+=d.m_invI):(b=b.m_xf.R,g=this.m_prismatic1.m_localXAxis1,f=b.col1.x* g.x+b.col2.x*g.y,g=b.col1.y*g.x+b.col2.y*g.y,b=d.m_xf.R,h=this.m_localAnchor1.x-d.m_sweep.localCenter.x,k=this.m_localAnchor1.y-d.m_sweep.localCenter.y,m=b.col1.x*h+b.col2.x*k,k=b.col1.y*h+b.col2.y*k,h=m*g-k*f,this.m_J.linearA.Set(-f,-g),this.m_J.angularA=-h,l+=d.m_invMass+d.m_invI*h*h);this.m_revolute2?(this.m_J.angularB=-this.m_ratio,l+=this.m_ratio*this.m_ratio*e.m_invI):(b=c.m_xf.R,g=this.m_prismatic2.m_localXAxis1,f=b.col1.x*g.x+b.col2.x*g.y,g=b.col1.y*g.x+b.col2.y*g.y,b=e.m_xf.R,h=this.m_localAnchor2.x- e.m_sweep.localCenter.x,k=this.m_localAnchor2.y-e.m_sweep.localCenter.y,m=b.col1.x*h+b.col2.x*k,k=b.col1.y*h+b.col2.y*k,h=m*g-k*f,this.m_J.linearB.Set(-this.m_ratio*f,-this.m_ratio*g),this.m_J.angularB=-this.m_ratio*h,l+=this.m_ratio*this.m_ratio*(e.m_invMass+e.m_invI*h*h));this.m_mass=0Number.MIN_VALUE?1/this.m_motorMass:0;this.m_perp.SetV(a.MulMV(h.R,this.m_localYAxis1));this.m_s1=(f+k)*this.m_perp.y-(g+m)*this.m_perp.x;this.m_s2=l*this.m_perp.y-n*this.m_perp.x;h=this.m_invMassA;k=this.m_invMassB;m=this.m_invIA;l=this.m_invIB;this.m_K.col1.x=h+k+m*this.m_s1* this.m_s1+l*this.m_s2*this.m_s2;this.m_K.col1.y=m*this.m_s1*this.m_a1+l*this.m_s2*this.m_a2;this.m_K.col2.x=this.m_K.col1.y;this.m_K.col2.y=h+k+m*this.m_a1*this.m_a1+l*this.m_a2*this.m_a2;this.m_enableLimit?(f=this.m_axis.x*f+this.m_axis.y*g,a.Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*c.b2_linearSlop?this.m_limitState=q.e_equalLimits:f<=this.m_lowerTranslation?this.m_limitState!=q.e_atLowerLimit&&(this.m_limitState=q.e_atLowerLimit,this.m_impulse.y=0):f>=this.m_upperTranslation?this.m_limitState!= q.e_atUpperLimit&&(this.m_limitState=q.e_atUpperLimit,this.m_impulse.y=0):(this.m_limitState=q.e_inactiveLimit,this.m_impulse.y=0)):this.m_limitState=q.e_inactiveLimit;!1==this.m_enableMotor&&(this.m_motorImpulse=0);b.warmStarting?(this.m_impulse.x*=b.dtRatio,this.m_impulse.y*=b.dtRatio,this.m_motorImpulse*=b.dtRatio,b=this.m_impulse.x*this.m_perp.x+(this.m_motorImpulse+this.m_impulse.y)*this.m_axis.x,f=this.m_impulse.x*this.m_perp.y+(this.m_motorImpulse+this.m_impulse.y)*this.m_axis.y,g=this.m_impulse.x* this.m_s1+(this.m_motorImpulse+this.m_impulse.y)*this.m_a1,h=this.m_impulse.x*this.m_s2+(this.m_motorImpulse+this.m_impulse.y)*this.m_a2,d.m_linearVelocity.x-=this.m_invMassA*b,d.m_linearVelocity.y-=this.m_invMassA*f,d.m_angularVelocity-=this.m_invIA*g,e.m_linearVelocity.x+=this.m_invMassB*b,e.m_linearVelocity.y+=this.m_invMassB*f,e.m_angularVelocity+=this.m_invIB*h):(this.m_impulse.SetZero(),this.m_motorImpulse=0)};r.prototype.SolveVelocityConstraints=function(c){var d=this.m_bodyA,e=this.m_bodyB, f=d.m_linearVelocity,g=d.m_angularVelocity,h=e.m_linearVelocity,k=e.m_angularVelocity,m=0,l=0,n=0,p=0;this.m_enableMotor&&this.m_limitState!=q.e_equalLimits&&(p=this.m_motorMass*(this.m_motorSpeed-(this.m_axis.x*(h.x-f.x)+this.m_axis.y*(h.y-f.y)+this.m_a2*k-this.m_a1*g)),m=this.m_motorImpulse,l=c.dt*this.m_maxMotorForce,this.m_motorImpulse=a.Clamp(this.m_motorImpulse+p,-l,l),p=this.m_motorImpulse-m,m=p*this.m_axis.x,l=p*this.m_axis.y,n=p*this.m_a1,p*=this.m_a2,f.x-=this.m_invMassA*m,f.y-=this.m_invMassA* l,g-=this.m_invIA*n,h.x+=this.m_invMassB*m,h.y+=this.m_invMassB*l,k+=this.m_invIB*p);l=this.m_perp.x*(h.x-f.x)+this.m_perp.y*(h.y-f.y)+this.m_s2*k-this.m_s1*g;this.m_enableLimit&&this.m_limitState!=q.e_inactiveLimit?(n=this.m_axis.x*(h.x-f.x)+this.m_axis.y*(h.y-f.y)+this.m_a2*k-this.m_a1*g,m=this.m_impulse.Copy(),c=this.m_K.Solve(new b,-l,-n),this.m_impulse.Add(c),this.m_limitState==q.e_atLowerLimit?this.m_impulse.y=a.Max(this.m_impulse.y,0):this.m_limitState==q.e_atUpperLimit&&(this.m_impulse.y= a.Min(this.m_impulse.y,0)),l=-l-(this.m_impulse.y-m.y)*this.m_K.col2.x,n=0,n=0!=this.m_K.col1.x?l/this.m_K.col1.x+m.x:m.x,this.m_impulse.x=n,c.x=this.m_impulse.x-m.x,c.y=this.m_impulse.y-m.y,m=c.x*this.m_perp.x+c.y*this.m_axis.x,l=c.x*this.m_perp.y+c.y*this.m_axis.y,n=c.x*this.m_s1+c.y*this.m_a1,p=c.x*this.m_s2+c.y*this.m_a2):(c=0,c=0!=this.m_K.col1.x?-l/this.m_K.col1.x:0,this.m_impulse.x+=c,m=c*this.m_perp.x,l=c*this.m_perp.y,n=c*this.m_s1,p=c*this.m_s2);f.x-=this.m_invMassA*m;f.y-=this.m_invMassA* l;g-=this.m_invIA*n;h.x+=this.m_invMassB*m;h.y+=this.m_invMassB*l;k+=this.m_invIB*p;d.m_linearVelocity.SetV(f);d.m_angularVelocity=g;e.m_linearVelocity.SetV(h);e.m_angularVelocity=k};r.prototype.SolvePositionConstraints=function(d){d=this.m_bodyA;var f=this.m_bodyB,g=d.m_sweep.c,h=d.m_sweep.a,k=f.m_sweep.c,m=f.m_sweep.a,l,t=0,n=0,q=0,p=0,r=l=0,v=0,n=!1,u=0,x=e.FromAngle(h),q=e.FromAngle(m);l=x;var v=this.m_localAnchor1.x-this.m_localCenterA.x,z=this.m_localAnchor1.y-this.m_localCenterA.y,t=l.col1.x* v+l.col2.x*z,z=l.col1.y*v+l.col2.y*z,v=t;l=q;q=this.m_localAnchor2.x-this.m_localCenterB.x;p=this.m_localAnchor2.y-this.m_localCenterB.y;t=l.col1.x*q+l.col2.x*p;p=l.col1.y*q+l.col2.y*p;q=t;l=k.x+q-g.x-v;t=k.y+p-g.y-z;if(this.m_enableLimit){this.m_axis=a.MulMV(x,this.m_localXAxis1);this.m_a1=(l+v)*this.m_axis.y-(t+z)*this.m_axis.x;this.m_a2=q*this.m_axis.y-p*this.m_axis.x;var A=this.m_axis.x*l+this.m_axis.y*t;a.Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*c.b2_linearSlop?(u=a.Clamp(A,-c.b2_maxLinearCorrection, c.b2_maxLinearCorrection),r=a.Abs(A),n=!0):A<=this.m_lowerTranslation?(u=a.Clamp(A-this.m_lowerTranslation+c.b2_linearSlop,-c.b2_maxLinearCorrection,0),r=this.m_lowerTranslation-A,n=!0):A>=this.m_upperTranslation&&(u=a.Clamp(A-this.m_upperTranslation+c.b2_linearSlop,0,c.b2_maxLinearCorrection),r=A-this.m_upperTranslation,n=!0)}this.m_perp=a.MulMV(x,this.m_localYAxis1);this.m_s1=(l+v)*this.m_perp.y-(t+z)*this.m_perp.x;this.m_s2=q*this.m_perp.y-p*this.m_perp.x;x=new b;z=this.m_perp.x*l+this.m_perp.y* t;r=a.Max(r,a.Abs(z));v=0;n?(n=this.m_invMassA,q=this.m_invMassB,p=this.m_invIA,l=this.m_invIB,this.m_K.col1.x=n+q+p*this.m_s1*this.m_s1+l*this.m_s2*this.m_s2,this.m_K.col1.y=p*this.m_s1*this.m_a1+l*this.m_s2*this.m_a2,this.m_K.col2.x=this.m_K.col1.y,this.m_K.col2.y=n+q+p*this.m_a1*this.m_a1+l*this.m_a2*this.m_a2,this.m_K.Solve(x,-z,-u)):(n=this.m_invMassA,q=this.m_invMassB,p=this.m_invIA,l=this.m_invIB,u=n+q+p*this.m_s1*this.m_s1+l*this.m_s2*this.m_s2,x.x=0!=u?-z/u:0,x.y=0);u=x.x*this.m_perp.x+x.y* this.m_axis.x;n=x.x*this.m_perp.y+x.y*this.m_axis.y;z=x.x*this.m_s1+x.y*this.m_a1;x=x.x*this.m_s2+x.y*this.m_a2;g.x-=this.m_invMassA*u;g.y-=this.m_invMassA*n;h-=this.m_invIA*z;k.x+=this.m_invMassB*u;k.y+=this.m_invMassB*n;m+=this.m_invIB*x;d.m_sweep.a=h;f.m_sweep.a=m;d.SynchronizeTransform();f.SynchronizeTransform();return r<=c.b2_linearSlop&&v<=c.b2_angularSlop};Box2D.inherit(D,Box2D.Dynamics.Joints.b2JointDef);D.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;D.b2LineJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);this.localAnchorA=new b;this.localAnchorB=new b;this.localAxisA=new b};D.prototype.b2LineJointDef=function(){this.__super.b2JointDef.call(this);this.type=q.e_lineJoint;this.localAxisA.Set(1,0);this.enableLimit=!1;this.upperTranslation=this.lowerTranslation=0;this.enableMotor=!1;this.motorSpeed=this.maxMotorForce=0};D.prototype.Initialize=function(a,b,c,d){this.bodyA=a;this.bodyB=b;this.localAnchorA=this.bodyA.GetLocalPoint(c);this.localAnchorB=this.bodyB.GetLocalPoint(c);this.localAxisA= this.bodyA.GetLocalVector(d)};Box2D.inherit(x,Box2D.Dynamics.Joints.b2Joint);x.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;x.b2MouseJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.K=new e;this.K1=new e;this.K2=new e;this.m_localAnchor=new b;this.m_target=new b;this.m_impulse=new b;this.m_mass=new e;this.m_C=new b};x.prototype.GetAnchorA=function(){return this.m_target};x.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor)}; x.prototype.GetReactionForce=function(a){void 0===a&&(a=0);return new b(a*this.m_impulse.x,a*this.m_impulse.y)};x.prototype.GetReactionTorque=function(a){return 0};x.prototype.GetTarget=function(){return this.m_target};x.prototype.SetTarget=function(a){!1==this.m_bodyB.IsAwake()&&this.m_bodyB.SetAwake(!0);this.m_target=a};x.prototype.GetMaxForce=function(){return this.m_maxForce};x.prototype.SetMaxForce=function(a){void 0===a&&(a=0);this.m_maxForce=a};x.prototype.GetFrequency=function(){return this.m_frequencyHz}; x.prototype.SetFrequency=function(a){void 0===a&&(a=0);this.m_frequencyHz=a};x.prototype.GetDampingRatio=function(){return this.m_dampingRatio};x.prototype.SetDampingRatio=function(a){void 0===a&&(a=0);this.m_dampingRatio=a};x.prototype.b2MouseJoint=function(a){this.__super.b2Joint.call(this,a);this.m_target.SetV(a.target);var b=this.m_target.x-this.m_bodyB.m_xf.position.x,c=this.m_target.y-this.m_bodyB.m_xf.position.y,d=this.m_bodyB.m_xf.R;this.m_localAnchor.x=b*d.col1.x+c*d.col1.y;this.m_localAnchor.y= b*d.col2.x+c*d.col2.y;this.m_maxForce=a.maxForce;this.m_impulse.SetZero();this.m_frequencyHz=a.frequencyHz;this.m_dampingRatio=a.dampingRatio;this.m_gamma=this.m_beta=0};x.prototype.InitVelocityConstraints=function(a){var b=this.m_bodyB,c=b.GetMass(),d=2*Math.PI*this.m_frequencyHz,e=c*d*d;this.m_gamma=a.dt*(2*c*this.m_dampingRatio*d+a.dt*e);this.m_gamma=0!=this.m_gamma?1/this.m_gamma:0;this.m_beta=a.dt*e*this.m_gamma;var e=b.m_xf.R,c=this.m_localAnchor.x-b.m_sweep.localCenter.x,d=this.m_localAnchor.y- b.m_sweep.localCenter.y,f=e.col1.x*c+e.col2.x*d,d=e.col1.y*c+e.col2.y*d,c=f,e=b.m_invMass,f=b.m_invI;this.K1.col1.x=e;this.K1.col2.x=0;this.K1.col1.y=0;this.K1.col2.y=e;this.K2.col1.x=f*d*d;this.K2.col2.x=-f*c*d;this.K2.col1.y=-f*c*d;this.K2.col2.y=f*c*c;this.K.SetM(this.K1);this.K.AddM(this.K2);this.K.col1.x+=this.m_gamma;this.K.col2.y+=this.m_gamma;this.K.GetInverse(this.m_mass);this.m_C.x=b.m_sweep.c.x+c-this.m_target.x;this.m_C.y=b.m_sweep.c.y+d-this.m_target.y;b.m_angularVelocity*=0.98;this.m_impulse.x*= a.dtRatio;this.m_impulse.y*=a.dtRatio;b.m_linearVelocity.x+=e*this.m_impulse.x;b.m_linearVelocity.y+=e*this.m_impulse.y;b.m_angularVelocity+=f*(c*this.m_impulse.y-d*this.m_impulse.x)};x.prototype.SolveVelocityConstraints=function(a){var b=this.m_bodyB,c,d=0,e=0;c=b.m_xf.R;var f=this.m_localAnchor.x-b.m_sweep.localCenter.x,g=this.m_localAnchor.y-b.m_sweep.localCenter.y,d=c.col1.x*f+c.col2.x*g,g=c.col1.y*f+c.col2.y*g,f=d,d=b.m_linearVelocity.x+-b.m_angularVelocity*g,h=b.m_linearVelocity.y+b.m_angularVelocity* f;c=this.m_mass;d=d+this.m_beta*this.m_C.x+this.m_gamma*this.m_impulse.x;e=h+this.m_beta*this.m_C.y+this.m_gamma*this.m_impulse.y;h=-(c.col1.x*d+c.col2.x*e);e=-(c.col1.y*d+c.col2.y*e);c=this.m_impulse.x;d=this.m_impulse.y;this.m_impulse.x+=h;this.m_impulse.y+=e;a=a.dt*this.m_maxForce;this.m_impulse.LengthSquared()>a*a&&this.m_impulse.Multiply(a/this.m_impulse.Length());h=this.m_impulse.x-c;e=this.m_impulse.y-d;b.m_linearVelocity.x+=b.m_invMass*h;b.m_linearVelocity.y+=b.m_invMass*e;b.m_angularVelocity+= b.m_invI*(f*e-g*h)};x.prototype.SolvePositionConstraints=function(a){return!0};Box2D.inherit(C,Box2D.Dynamics.Joints.b2JointDef);C.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;C.b2MouseJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,arguments);this.target=new b};C.prototype.b2MouseJointDef=function(){this.__super.b2JointDef.call(this);this.type=q.e_mouseJoint;this.maxForce=0;this.frequencyHz=5;this.dampingRatio=0.7};Box2D.inherit(A,Box2D.Dynamics.Joints.b2Joint); A.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;A.b2PrismaticJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.m_localAnchor1=new b;this.m_localAnchor2=new b;this.m_localXAxis1=new b;this.m_localYAxis1=new b;this.m_axis=new b;this.m_perp=new b;this.m_K=new d;this.m_impulse=new f};A.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)};A.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)}; A.prototype.GetReactionForce=function(a){void 0===a&&(a=0);return new b(a*(this.m_impulse.x*this.m_perp.x+(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.x),a*(this.m_impulse.x*this.m_perp.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.y))};A.prototype.GetReactionTorque=function(a){void 0===a&&(a=0);return a*this.m_impulse.y};A.prototype.GetJointTranslation=function(){var a=this.m_bodyA,b=this.m_bodyB,c=a.GetWorldPoint(this.m_localAnchor1),d=b.GetWorldPoint(this.m_localAnchor2),b=d.x-c.x, c=d.y-c.y,a=a.GetWorldVector(this.m_localXAxis1);return a.x*b+a.y*c};A.prototype.GetJointSpeed=function(){var a=this.m_bodyA,b=this.m_bodyB,c;c=a.m_xf.R;var d=this.m_localAnchor1.x-a.m_sweep.localCenter.x,e=this.m_localAnchor1.y-a.m_sweep.localCenter.y,f=c.col1.x*d+c.col2.x*e,e=c.col1.y*d+c.col2.y*e,d=f;c=b.m_xf.R;var g=this.m_localAnchor2.x-b.m_sweep.localCenter.x,h=this.m_localAnchor2.y-b.m_sweep.localCenter.y,f=c.col1.x*g+c.col2.x*h,h=c.col1.y*g+c.col2.y*h,g=f;c=b.m_sweep.c.x+g-(a.m_sweep.c.x+ d);var f=b.m_sweep.c.y+h-(a.m_sweep.c.y+e),k=a.GetWorldVector(this.m_localXAxis1),m=a.m_linearVelocity,l=b.m_linearVelocity,a=a.m_angularVelocity,b=b.m_angularVelocity;return c*-a*k.y+f*a*k.x+(k.x*(l.x+-b*h-m.x- -a*e)+k.y*(l.y+b*g-m.y-a*d))};A.prototype.IsLimitEnabled=function(){return this.m_enableLimit};A.prototype.EnableLimit=function(a){this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0);this.m_enableLimit=a};A.prototype.GetLowerLimit=function(){return this.m_lowerTranslation};A.prototype.GetUpperLimit= function(){return this.m_upperTranslation};A.prototype.SetLimits=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0);this.m_lowerTranslation=a;this.m_upperTranslation=b};A.prototype.IsMotorEnabled=function(){return this.m_enableMotor};A.prototype.EnableMotor=function(a){this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0);this.m_enableMotor=a};A.prototype.SetMotorSpeed=function(a){void 0===a&&(a=0);this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0); this.m_motorSpeed=a};A.prototype.GetMotorSpeed=function(){return this.m_motorSpeed};A.prototype.SetMaxMotorForce=function(a){void 0===a&&(a=0);this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0);this.m_maxMotorForce=a};A.prototype.GetMotorForce=function(){return this.m_motorImpulse};A.prototype.b2PrismaticJoint=function(a){this.__super.b2Joint.call(this,a);this.m_localAnchor1.SetV(a.localAnchorA);this.m_localAnchor2.SetV(a.localAnchorB);this.m_localXAxis1.SetV(a.localAxisA);this.m_localYAxis1.x=-this.m_localXAxis1.y; this.m_localYAxis1.y=this.m_localXAxis1.x;this.m_refAngle=a.referenceAngle;this.m_impulse.SetZero();this.m_motorImpulse=this.m_motorMass=0;this.m_lowerTranslation=a.lowerTranslation;this.m_upperTranslation=a.upperTranslation;this.m_maxMotorForce=a.maxMotorForce;this.m_motorSpeed=a.motorSpeed;this.m_enableLimit=a.enableLimit;this.m_enableMotor=a.enableMotor;this.m_limitState=q.e_inactiveLimit;this.m_axis.SetZero();this.m_perp.SetZero()};A.prototype.InitVelocityConstraints=function(b){var d=this.m_bodyA, e=this.m_bodyB,f,g=0;this.m_localCenterA.SetV(d.GetLocalCenter());this.m_localCenterB.SetV(e.GetLocalCenter());var h=d.GetTransform();e.GetTransform();f=d.m_xf.R;var k=this.m_localAnchor1.x-this.m_localCenterA.x,m=this.m_localAnchor1.y-this.m_localCenterA.y,g=f.col1.x*k+f.col2.x*m,m=f.col1.y*k+f.col2.y*m,k=g;f=e.m_xf.R;var l=this.m_localAnchor2.x-this.m_localCenterB.x,n=this.m_localAnchor2.y-this.m_localCenterB.y,g=f.col1.x*l+f.col2.x*n,n=f.col1.y*l+f.col2.y*n,l=g;f=e.m_sweep.c.x+l-d.m_sweep.c.x- k;g=e.m_sweep.c.y+n-d.m_sweep.c.y-m;this.m_invMassA=d.m_invMass;this.m_invMassB=e.m_invMass;this.m_invIA=d.m_invI;this.m_invIB=e.m_invI;this.m_axis.SetV(a.MulMV(h.R,this.m_localXAxis1));this.m_a1=(f+k)*this.m_axis.y-(g+m)*this.m_axis.x;this.m_a2=l*this.m_axis.y-n*this.m_axis.x;this.m_motorMass=this.m_invMassA+this.m_invMassB+this.m_invIA*this.m_a1*this.m_a1+this.m_invIB*this.m_a2*this.m_a2;this.m_motorMass>Number.MIN_VALUE&&(this.m_motorMass=1/this.m_motorMass);this.m_perp.SetV(a.MulMV(h.R,this.m_localYAxis1)); this.m_s1=(f+k)*this.m_perp.y-(g+m)*this.m_perp.x;this.m_s2=l*this.m_perp.y-n*this.m_perp.x;h=this.m_invMassA;k=this.m_invMassB;m=this.m_invIA;l=this.m_invIB;this.m_K.col1.x=h+k+m*this.m_s1*this.m_s1+l*this.m_s2*this.m_s2;this.m_K.col1.y=m*this.m_s1+l*this.m_s2;this.m_K.col1.z=m*this.m_s1*this.m_a1+l*this.m_s2*this.m_a2;this.m_K.col2.x=this.m_K.col1.y;this.m_K.col2.y=m+l;this.m_K.col2.z=m*this.m_a1+l*this.m_a2;this.m_K.col3.x=this.m_K.col1.z;this.m_K.col3.y=this.m_K.col2.z;this.m_K.col3.z=h+k+m*this.m_a1* this.m_a1+l*this.m_a2*this.m_a2;this.m_enableLimit?(f=this.m_axis.x*f+this.m_axis.y*g,a.Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*c.b2_linearSlop?this.m_limitState=q.e_equalLimits:f<=this.m_lowerTranslation?this.m_limitState!=q.e_atLowerLimit&&(this.m_limitState=q.e_atLowerLimit,this.m_impulse.z=0):f>=this.m_upperTranslation?this.m_limitState!=q.e_atUpperLimit&&(this.m_limitState=q.e_atUpperLimit,this.m_impulse.z=0):(this.m_limitState=q.e_inactiveLimit,this.m_impulse.z=0)):this.m_limitState= q.e_inactiveLimit;!1==this.m_enableMotor&&(this.m_motorImpulse=0);b.warmStarting?(this.m_impulse.x*=b.dtRatio,this.m_impulse.y*=b.dtRatio,this.m_motorImpulse*=b.dtRatio,b=this.m_impulse.x*this.m_perp.x+(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.x,f=this.m_impulse.x*this.m_perp.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.y,g=this.m_impulse.x*this.m_s1+this.m_impulse.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_a1,h=this.m_impulse.x*this.m_s2+this.m_impulse.y+(this.m_motorImpulse+ this.m_impulse.z)*this.m_a2,d.m_linearVelocity.x-=this.m_invMassA*b,d.m_linearVelocity.y-=this.m_invMassA*f,d.m_angularVelocity-=this.m_invIA*g,e.m_linearVelocity.x+=this.m_invMassB*b,e.m_linearVelocity.y+=this.m_invMassB*f,e.m_angularVelocity+=this.m_invIB*h):(this.m_impulse.SetZero(),this.m_motorImpulse=0)};A.prototype.SolveVelocityConstraints=function(c){var d=this.m_bodyA,e=this.m_bodyB,g=d.m_linearVelocity,h=d.m_angularVelocity,k=e.m_linearVelocity,m=e.m_angularVelocity,l=0,n=0,p=0,r=0;this.m_enableMotor&& this.m_limitState!=q.e_equalLimits&&(r=this.m_motorMass*(this.m_motorSpeed-(this.m_axis.x*(k.x-g.x)+this.m_axis.y*(k.y-g.y)+this.m_a2*m-this.m_a1*h)),l=this.m_motorImpulse,c=c.dt*this.m_maxMotorForce,this.m_motorImpulse=a.Clamp(this.m_motorImpulse+r,-c,c),r=this.m_motorImpulse-l,l=r*this.m_axis.x,n=r*this.m_axis.y,p=r*this.m_a1,r*=this.m_a2,g.x-=this.m_invMassA*l,g.y-=this.m_invMassA*n,h-=this.m_invIA*p,k.x+=this.m_invMassB*l,k.y+=this.m_invMassB*n,m+=this.m_invIB*r);p=this.m_perp.x*(k.x-g.x)+this.m_perp.y* (k.y-g.y)+this.m_s2*m-this.m_s1*h;n=m-h;this.m_enableLimit&&this.m_limitState!=q.e_inactiveLimit?(c=this.m_axis.x*(k.x-g.x)+this.m_axis.y*(k.y-g.y)+this.m_a2*m-this.m_a1*h,l=this.m_impulse.Copy(),c=this.m_K.Solve33(new f,-p,-n,-c),this.m_impulse.Add(c),this.m_limitState==q.e_atLowerLimit?this.m_impulse.z=a.Max(this.m_impulse.z,0):this.m_limitState==q.e_atUpperLimit&&(this.m_impulse.z=a.Min(this.m_impulse.z,0)),p=-p-(this.m_impulse.z-l.z)*this.m_K.col3.x,n=-n-(this.m_impulse.z-l.z)*this.m_K.col3.y, n=this.m_K.Solve22(new b,p,n),n.x+=l.x,n.y+=l.y,this.m_impulse.x=n.x,this.m_impulse.y=n.y,c.x=this.m_impulse.x-l.x,c.y=this.m_impulse.y-l.y,c.z=this.m_impulse.z-l.z,l=c.x*this.m_perp.x+c.z*this.m_axis.x,n=c.x*this.m_perp.y+c.z*this.m_axis.y,p=c.x*this.m_s1+c.y+c.z*this.m_a1,r=c.x*this.m_s2+c.y+c.z*this.m_a2):(c=this.m_K.Solve22(new b,-p,-n),this.m_impulse.x+=c.x,this.m_impulse.y+=c.y,l=c.x*this.m_perp.x,n=c.x*this.m_perp.y,p=c.x*this.m_s1+c.y,r=c.x*this.m_s2+c.y);g.x-=this.m_invMassA*l;g.y-=this.m_invMassA* n;h-=this.m_invIA*p;k.x+=this.m_invMassB*l;k.y+=this.m_invMassB*n;m+=this.m_invIB*r;d.m_linearVelocity.SetV(g);d.m_angularVelocity=h;e.m_linearVelocity.SetV(k);e.m_angularVelocity=m};A.prototype.SolvePositionConstraints=function(d){d=this.m_bodyA;var g=this.m_bodyB,h=d.m_sweep.c,k=d.m_sweep.a,m=g.m_sweep.c,l=g.m_sweep.a,n,t=0,q=0,p=0,r=t=n=0,v=0,q=!1,u=0,x=e.FromAngle(k),z=e.FromAngle(l);n=x;var v=this.m_localAnchor1.x-this.m_localCenterA.x,A=this.m_localAnchor1.y-this.m_localCenterA.y,t=n.col1.x* v+n.col2.x*A,A=n.col1.y*v+n.col2.y*A,v=t;n=z;z=this.m_localAnchor2.x-this.m_localCenterB.x;p=this.m_localAnchor2.y-this.m_localCenterB.y;t=n.col1.x*z+n.col2.x*p;p=n.col1.y*z+n.col2.y*p;z=t;n=m.x+z-h.x-v;t=m.y+p-h.y-A;if(this.m_enableLimit){this.m_axis=a.MulMV(x,this.m_localXAxis1);this.m_a1=(n+v)*this.m_axis.y-(t+A)*this.m_axis.x;this.m_a2=z*this.m_axis.y-p*this.m_axis.x;var B=this.m_axis.x*n+this.m_axis.y*t;a.Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*c.b2_linearSlop?(u=a.Clamp(B,-c.b2_maxLinearCorrection, c.b2_maxLinearCorrection),r=a.Abs(B),q=!0):B<=this.m_lowerTranslation?(u=a.Clamp(B-this.m_lowerTranslation+c.b2_linearSlop,-c.b2_maxLinearCorrection,0),r=this.m_lowerTranslation-B,q=!0):B>=this.m_upperTranslation&&(u=a.Clamp(B-this.m_upperTranslation+c.b2_linearSlop,0,c.b2_maxLinearCorrection),r=B-this.m_upperTranslation,q=!0)}this.m_perp=a.MulMV(x,this.m_localYAxis1);this.m_s1=(n+v)*this.m_perp.y-(t+A)*this.m_perp.x;this.m_s2=z*this.m_perp.y-p*this.m_perp.x;x=new f;A=this.m_perp.x*n+this.m_perp.y* t;z=l-k-this.m_refAngle;r=a.Max(r,a.Abs(A));v=a.Abs(z);q?(q=this.m_invMassA,p=this.m_invMassB,n=this.m_invIA,t=this.m_invIB,this.m_K.col1.x=q+p+n*this.m_s1*this.m_s1+t*this.m_s2*this.m_s2,this.m_K.col1.y=n*this.m_s1+t*this.m_s2,this.m_K.col1.z=n*this.m_s1*this.m_a1+t*this.m_s2*this.m_a2,this.m_K.col2.x=this.m_K.col1.y,this.m_K.col2.y=n+t,this.m_K.col2.z=n*this.m_a1+t*this.m_a2,this.m_K.col3.x=this.m_K.col1.z,this.m_K.col3.y=this.m_K.col2.z,this.m_K.col3.z=q+p+n*this.m_a1*this.m_a1+t*this.m_a2*this.m_a2, this.m_K.Solve33(x,-A,-z,-u)):(q=this.m_invMassA,p=this.m_invMassB,n=this.m_invIA,t=this.m_invIB,u=n*this.m_s1+t*this.m_s2,B=n+t,this.m_K.col1.Set(q+p+n*this.m_s1*this.m_s1+t*this.m_s2*this.m_s2,u,0),this.m_K.col2.Set(u,B,0),u=this.m_K.Solve22(new b,-A,-z),x.x=u.x,x.y=u.y,x.z=0);u=x.x*this.m_perp.x+x.z*this.m_axis.x;q=x.x*this.m_perp.y+x.z*this.m_axis.y;A=x.x*this.m_s1+x.y+x.z*this.m_a1;x=x.x*this.m_s2+x.y+x.z*this.m_a2;h.x-=this.m_invMassA*u;h.y-=this.m_invMassA*q;k-=this.m_invIA*A;m.x+=this.m_invMassB* u;m.y+=this.m_invMassB*q;l+=this.m_invIB*x;d.m_sweep.a=k;g.m_sweep.a=l;d.SynchronizeTransform();g.SynchronizeTransform();return r<=c.b2_linearSlop&&v<=c.b2_angularSlop};Box2D.inherit(z,Box2D.Dynamics.Joints.b2JointDef);z.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;z.b2PrismaticJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,arguments);this.localAnchorA=new b;this.localAnchorB=new b;this.localAxisA=new b};z.prototype.b2PrismaticJointDef=function(){this.__super.b2JointDef.call(this); this.type=q.e_prismaticJoint;this.localAxisA.Set(1,0);this.referenceAngle=0;this.enableLimit=!1;this.upperTranslation=this.lowerTranslation=0;this.enableMotor=!1;this.motorSpeed=this.maxMotorForce=0};z.prototype.Initialize=function(a,b,c,d){this.bodyA=a;this.bodyB=b;this.localAnchorA=this.bodyA.GetLocalPoint(c);this.localAnchorB=this.bodyB.GetLocalPoint(c);this.localAxisA=this.bodyA.GetLocalVector(d);this.referenceAngle=this.bodyB.GetAngle()-this.bodyA.GetAngle()};Box2D.inherit(u,Box2D.Dynamics.Joints.b2Joint); u.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;u.b2PulleyJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.m_groundAnchor1=new b;this.m_groundAnchor2=new b;this.m_localAnchor1=new b;this.m_localAnchor2=new b;this.m_u1=new b;this.m_u2=new b};u.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)};u.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)};u.prototype.GetReactionForce=function(a){void 0=== a&&(a=0);return new b(a*this.m_impulse*this.m_u2.x,a*this.m_impulse*this.m_u2.y)};u.prototype.GetReactionTorque=function(a){return 0};u.prototype.GetGroundAnchorA=function(){var a=this.m_ground.m_xf.position.Copy();a.Add(this.m_groundAnchor1);return a};u.prototype.GetGroundAnchorB=function(){var a=this.m_ground.m_xf.position.Copy();a.Add(this.m_groundAnchor2);return a};u.prototype.GetLength1=function(){var a=this.m_bodyA.GetWorldPoint(this.m_localAnchor1),b=a.x-(this.m_ground.m_xf.position.x+this.m_groundAnchor1.x), a=a.y-(this.m_ground.m_xf.position.y+this.m_groundAnchor1.y);return Math.sqrt(b*b+a*a)};u.prototype.GetLength2=function(){var a=this.m_bodyB.GetWorldPoint(this.m_localAnchor2),b=a.x-(this.m_ground.m_xf.position.x+this.m_groundAnchor2.x),a=a.y-(this.m_ground.m_xf.position.y+this.m_groundAnchor2.y);return Math.sqrt(b*b+a*a)};u.prototype.GetRatio=function(){return this.m_ratio};u.prototype.b2PulleyJoint=function(b){this.__super.b2Joint.call(this,b);this.m_ground=this.m_bodyA.m_world.m_groundBody;this.m_groundAnchor1.x= b.groundAnchorA.x-this.m_ground.m_xf.position.x;this.m_groundAnchor1.y=b.groundAnchorA.y-this.m_ground.m_xf.position.y;this.m_groundAnchor2.x=b.groundAnchorB.x-this.m_ground.m_xf.position.x;this.m_groundAnchor2.y=b.groundAnchorB.y-this.m_ground.m_xf.position.y;this.m_localAnchor1.SetV(b.localAnchorA);this.m_localAnchor2.SetV(b.localAnchorB);this.m_ratio=b.ratio;this.m_constant=b.lengthA+this.m_ratio*b.lengthB;this.m_maxLength1=a.Min(b.maxLengthA,this.m_constant-this.m_ratio*u.b2_minPulleyLength); this.m_maxLength2=a.Min(b.maxLengthB,(this.m_constant-u.b2_minPulleyLength)/this.m_ratio);this.m_limitImpulse2=this.m_limitImpulse1=this.m_impulse=0};u.prototype.InitVelocityConstraints=function(a){var b=this.m_bodyA,d=this.m_bodyB,e;e=b.m_xf.R;var f=this.m_localAnchor1.x-b.m_sweep.localCenter.x,g=this.m_localAnchor1.y-b.m_sweep.localCenter.y,h=e.col1.x*f+e.col2.x*g,g=e.col1.y*f+e.col2.y*g,f=h;e=d.m_xf.R;var k=this.m_localAnchor2.x-d.m_sweep.localCenter.x,m=this.m_localAnchor2.y-d.m_sweep.localCenter.y, h=e.col1.x*k+e.col2.x*m,m=e.col1.y*k+e.col2.y*m,k=h;e=d.m_sweep.c.x+k;var h=d.m_sweep.c.y+m,l=this.m_ground.m_xf.position.x+this.m_groundAnchor2.x,n=this.m_ground.m_xf.position.y+this.m_groundAnchor2.y;this.m_u1.Set(b.m_sweep.c.x+f-(this.m_ground.m_xf.position.x+this.m_groundAnchor1.x),b.m_sweep.c.y+g-(this.m_ground.m_xf.position.y+this.m_groundAnchor1.y));this.m_u2.Set(e-l,h-n);e=this.m_u1.Length();h=this.m_u2.Length();e>c.b2_linearSlop?this.m_u1.Multiply(1/e):this.m_u1.SetZero();h>c.b2_linearSlop? this.m_u2.Multiply(1/h):this.m_u2.SetZero();0c.b2_linearSlop?this.m_u1.Multiply(1/e):this.m_u1.SetZero(),r>c.b2_linearSlop?this.m_u2.Multiply(1/r):this.m_u2.SetZero(),e=this.m_constant-e-this.m_ratio*r,x=a.Max(x,-e),e=a.Clamp(e+c.b2_linearSlop,-c.b2_maxLinearCorrection,0),u=-this.m_pulleyMass*e,e=-u*this.m_u1.x,r=-u*this.m_u1.y,v=-this.m_ratio*u*this.m_u2.x,u=-this.m_ratio*u*this.m_u2.y, b.m_sweep.c.x+=b.m_invMass*e,b.m_sweep.c.y+=b.m_invMass*r,b.m_sweep.a+=b.m_invI*(m*r-l*e),d.m_sweep.c.x+=d.m_invMass*v,d.m_sweep.c.y+=d.m_invMass*u,d.m_sweep.a+=d.m_invI*(n*u-p*v),b.SynchronizeTransform(),d.SynchronizeTransform());this.m_limitState1==q.e_atUpperLimit&&(e=b.m_xf.R,m=this.m_localAnchor1.x-b.m_sweep.localCenter.x,l=this.m_localAnchor1.y-b.m_sweep.localCenter.y,r=e.col1.x*m+e.col2.x*l,l=e.col1.y*m+e.col2.y*l,m=r,e=b.m_sweep.c.x+m,r=b.m_sweep.c.y+l,this.m_u1.Set(e-f,r-g),e=this.m_u1.Length(), e>c.b2_linearSlop?(this.m_u1.x*=1/e,this.m_u1.y*=1/e):this.m_u1.SetZero(),e=this.m_maxLength1-e,x=a.Max(x,-e),e=a.Clamp(e+c.b2_linearSlop,-c.b2_maxLinearCorrection,0),u=-this.m_limitMass1*e,e=-u*this.m_u1.x,r=-u*this.m_u1.y,b.m_sweep.c.x+=b.m_invMass*e,b.m_sweep.c.y+=b.m_invMass*r,b.m_sweep.a+=b.m_invI*(m*r-l*e),b.SynchronizeTransform());this.m_limitState2==q.e_atUpperLimit&&(e=d.m_xf.R,n=this.m_localAnchor2.x-d.m_sweep.localCenter.x,p=this.m_localAnchor2.y-d.m_sweep.localCenter.y,r=e.col1.x*n+e.col2.x* p,p=e.col1.y*n+e.col2.y*p,n=r,v=d.m_sweep.c.x+n,u=d.m_sweep.c.y+p,this.m_u2.Set(v-h,u-k),r=this.m_u2.Length(),r>c.b2_linearSlop?(this.m_u2.x*=1/r,this.m_u2.y*=1/r):this.m_u2.SetZero(),e=this.m_maxLength2-r,x=a.Max(x,-e),e=a.Clamp(e+c.b2_linearSlop,-c.b2_maxLinearCorrection,0),u=-this.m_limitMass2*e,v=-u*this.m_u2.x,u=-u*this.m_u2.y,d.m_sweep.c.x+=d.m_invMass*v,d.m_sweep.c.y+=d.m_invMass*u,d.m_sweep.a+=d.m_invI*(n*u-p*v),d.SynchronizeTransform());return x=this.m_upperAngle?(this.m_limitState!= q.e_atUpperLimit&&(this.m_impulse.z=0),this.m_limitState=q.e_atUpperLimit):(this.m_limitState=q.e_inactiveLimit,this.m_impulse.z=0)}else this.m_limitState=q.e_inactiveLimit;b.warmStarting?(this.m_impulse.x*=b.dtRatio,this.m_impulse.y*=b.dtRatio,this.m_motorImpulse*=b.dtRatio,b=this.m_impulse.x,r=this.m_impulse.y,d.m_linearVelocity.x-=f*b,d.m_linearVelocity.y-=f*r,d.m_angularVelocity-=n*(h*r-k*b+this.m_motorImpulse+this.m_impulse.z),e.m_linearVelocity.x+=g*b,e.m_linearVelocity.y+=g*r,e.m_angularVelocity+= p*(m*r-l*b+this.m_motorImpulse+this.m_impulse.z)):(this.m_impulse.SetZero(),this.m_motorImpulse=0)};B.prototype.SolveVelocityConstraints=function(b){var c=this.m_bodyA,d=this.m_bodyB,e=0,f=e=0,g=0,h=0,k=0,m=c.m_linearVelocity,l=c.m_angularVelocity,n=d.m_linearVelocity,p=d.m_angularVelocity,r=c.m_invMass,v=d.m_invMass,u=c.m_invI,x=d.m_invI;this.m_enableMotor&&this.m_limitState!=q.e_equalLimits&&(f=this.m_motorMass*-(p-l-this.m_motorSpeed),g=this.m_motorImpulse,h=b.dt*this.m_maxMotorTorque,this.m_motorImpulse= a.Clamp(this.m_motorImpulse+f,-h,h),f=this.m_motorImpulse-g,l-=u*f,p+=x*f);if(this.m_enableLimit&&this.m_limitState!=q.e_inactiveLimit){b=c.m_xf.R;f=this.m_localAnchor1.x-c.m_sweep.localCenter.x;g=this.m_localAnchor1.y-c.m_sweep.localCenter.y;e=b.col1.x*f+b.col2.x*g;g=b.col1.y*f+b.col2.y*g;f=e;b=d.m_xf.R;h=this.m_localAnchor2.x-d.m_sweep.localCenter.x;k=this.m_localAnchor2.y-d.m_sweep.localCenter.y;e=b.col1.x*h+b.col2.x*k;k=b.col1.y*h+b.col2.y*k;h=e;b=n.x+-p*k-m.x- -l*g;var z=n.y+p*h-m.y-l*f;this.m_mass.Solve33(this.impulse3, -b,-z,-(p-l));this.m_limitState==q.e_equalLimits?this.m_impulse.Add(this.impulse3):this.m_limitState==q.e_atLowerLimit?(e=this.m_impulse.z+this.impulse3.z,0>e&&(this.m_mass.Solve22(this.reduced,-b,-z),this.impulse3.x=this.reduced.x,this.impulse3.y=this.reduced.y,this.impulse3.z=-this.m_impulse.z,this.m_impulse.x+=this.reduced.x,this.m_impulse.y+=this.reduced.y,this.m_impulse.z=0)):this.m_limitState==q.e_atUpperLimit&&(e=this.m_impulse.z+this.impulse3.z,0z*z&&(r=1/(h+v),k=r*-k,m=r*-m,b.m_sweep.c.x-=0.5*h*k,b.m_sweep.c.y-=0.5*h*m,f.m_sweep.c.x+=0.5*v*k,f.m_sweep.c.y+=0.5*v*m,k=f.m_sweep.c.x+n-b.m_sweep.c.x- l,m=f.m_sweep.c.y+p-b.m_sweep.c.y-d);this.K1.col1.x=h+v;this.K1.col2.x=0;this.K1.col1.y=0;this.K1.col2.y=h+v;this.K2.col1.x=u*d*d;this.K2.col2.x=-u*l*d;this.K2.col1.y=-u*l*d;this.K2.col2.y=u*l*l;this.K3.col1.x=x*p*p;this.K3.col2.x=-x*n*p;this.K3.col1.y=-x*n*p;this.K3.col2.y=x*n*n;this.K.SetM(this.K1);this.K.AddM(this.K2);this.K.AddM(this.K3);this.K.Solve(B.tImpulse,-k,-m);k=B.tImpulse.x;m=B.tImpulse.y;b.m_sweep.c.x-=b.m_invMass*k;b.m_sweep.c.y-=b.m_invMass*m;b.m_sweep.a-=b.m_invI*(l*m-d*k);f.m_sweep.c.x+= f.m_invMass*k;f.m_sweep.c.y+=f.m_invMass*m;f.m_sweep.a+=f.m_invI*(n*m-p*k);b.SynchronizeTransform();f.SynchronizeTransform();return e<=c.b2_linearSlop&&g<=c.b2_angularSlop};Box2D.postDefs.push(function(){Box2D.Dynamics.Joints.b2RevoluteJoint.tImpulse=new b});Box2D.inherit(K,Box2D.Dynamics.Joints.b2JointDef);K.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;K.b2RevoluteJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,arguments);this.localAnchorA=new b;this.localAnchorB= new b};K.prototype.b2RevoluteJointDef=function(){this.__super.b2JointDef.call(this);this.type=q.e_revoluteJoint;this.localAnchorA.Set(0,0);this.localAnchorB.Set(0,0);this.motorSpeed=this.maxMotorTorque=this.upperAngle=this.lowerAngle=this.referenceAngle=0;this.enableMotor=this.enableLimit=!1};K.prototype.Initialize=function(a,b,c){this.bodyA=a;this.bodyB=b;this.localAnchorA=this.bodyA.GetLocalPoint(c);this.localAnchorB=this.bodyB.GetLocalPoint(c);this.referenceAngle=this.bodyB.GetAngle()-this.bodyA.GetAngle()}; Box2D.inherit(I,Box2D.Dynamics.Joints.b2Joint);I.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;I.b2WeldJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.m_localAnchorA=new b;this.m_localAnchorB=new b;this.m_impulse=new f;this.m_mass=new d};I.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchorA)};I.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchorB)};I.prototype.GetReactionForce=function(a){void 0=== a&&(a=0);return new b(a*this.m_impulse.x,a*this.m_impulse.y)};I.prototype.GetReactionTorque=function(a){void 0===a&&(a=0);return a*this.m_impulse.z};I.prototype.b2WeldJoint=function(a){this.__super.b2Joint.call(this,a);this.m_localAnchorA.SetV(a.localAnchorA);this.m_localAnchorB.SetV(a.localAnchorB);this.m_referenceAngle=a.referenceAngle;this.m_impulse.SetZero();this.m_mass=new d};I.prototype.InitVelocityConstraints=function(a){var b,c=0,d=this.m_bodyA,e=this.m_bodyB;b=d.m_xf.R;var f=this.m_localAnchorA.x- d.m_sweep.localCenter.x,g=this.m_localAnchorA.y-d.m_sweep.localCenter.y,c=b.col1.x*f+b.col2.x*g,g=b.col1.y*f+b.col2.y*g,f=c;b=e.m_xf.R;var h=this.m_localAnchorB.x-e.m_sweep.localCenter.x,k=this.m_localAnchorB.y-e.m_sweep.localCenter.y,c=b.col1.x*h+b.col2.x*k,k=b.col1.y*h+b.col2.y*k,h=c;b=d.m_invMass;var c=e.m_invMass,m=d.m_invI,l=e.m_invI;this.m_mass.col1.x=b+c+g*g*m+k*k*l;this.m_mass.col2.x=-g*f*m-k*h*l;this.m_mass.col3.x=-g*m-k*l;this.m_mass.col1.y=this.m_mass.col2.x;this.m_mass.col2.y=b+c+f*f* m+h*h*l;this.m_mass.col3.y=f*m+h*l;this.m_mass.col1.z=this.m_mass.col3.x;this.m_mass.col2.z=this.m_mass.col3.y;this.m_mass.col3.z=m+l;a.warmStarting?(this.m_impulse.x*=a.dtRatio,this.m_impulse.y*=a.dtRatio,this.m_impulse.z*=a.dtRatio,d.m_linearVelocity.x-=b*this.m_impulse.x,d.m_linearVelocity.y-=b*this.m_impulse.y,d.m_angularVelocity-=m*(f*this.m_impulse.y-g*this.m_impulse.x+this.m_impulse.z),e.m_linearVelocity.x+=c*this.m_impulse.x,e.m_linearVelocity.y+=c*this.m_impulse.y,e.m_angularVelocity+=l* (h*this.m_impulse.y-k*this.m_impulse.x+this.m_impulse.z)):this.m_impulse.SetZero()};I.prototype.SolveVelocityConstraints=function(a){var b,c=0;a=this.m_bodyA;var d=this.m_bodyB,e=a.m_linearVelocity,g=a.m_angularVelocity,h=d.m_linearVelocity,k=d.m_angularVelocity,m=a.m_invMass,l=d.m_invMass,n=a.m_invI,p=d.m_invI;b=a.m_xf.R;var q=this.m_localAnchorA.x-a.m_sweep.localCenter.x,r=this.m_localAnchorA.y-a.m_sweep.localCenter.y,c=b.col1.x*q+b.col2.x*r,r=b.col1.y*q+b.col2.y*r,q=c;b=d.m_xf.R;var v=this.m_localAnchorB.x- d.m_sweep.localCenter.x,u=this.m_localAnchorB.y-d.m_sweep.localCenter.y,c=b.col1.x*v+b.col2.x*u,u=b.col1.y*v+b.col2.y*u,v=c;b=h.x-k*u-e.x+g*r;var c=h.y+k*v-e.y-g*q,x=k-g,z=new f;this.m_mass.Solve33(z,-b,-c,-x);this.m_impulse.Add(z);e.x-=m*z.x;e.y-=m*z.y;g-=n*(q*z.y-r*z.x+z.z);h.x+=l*z.x;h.y+=l*z.y;k+=p*(v*z.y-u*z.x+z.z);a.m_angularVelocity=g;d.m_angularVelocity=k};I.prototype.SolvePositionConstraints=function(b){var d,e=0;b=this.m_bodyA;var g=this.m_bodyB;d=b.m_xf.R;var h=this.m_localAnchorA.x-b.m_sweep.localCenter.x, k=this.m_localAnchorA.y-b.m_sweep.localCenter.y,e=d.col1.x*h+d.col2.x*k,k=d.col1.y*h+d.col2.y*k,h=e;d=g.m_xf.R;var m=this.m_localAnchorB.x-g.m_sweep.localCenter.x,l=this.m_localAnchorB.y-g.m_sweep.localCenter.y,e=d.col1.x*m+d.col2.x*l,l=d.col1.y*m+d.col2.y*l,m=e;d=b.m_invMass;var e=g.m_invMass,n=b.m_invI,p=g.m_invI,q=g.m_sweep.c.x+m-b.m_sweep.c.x-h,r=g.m_sweep.c.y+l-b.m_sweep.c.y-k,v=g.m_sweep.a-b.m_sweep.a-this.m_referenceAngle,u=10*c.b2_linearSlop,x=Math.sqrt(q*q+r*r),z=a.Abs(v);x>u&&(n*=1,p*=1); this.m_mass.col1.x=d+e+k*k*n+l*l*p;this.m_mass.col2.x=-k*h*n-l*m*p;this.m_mass.col3.x=-k*n-l*p;this.m_mass.col1.y=this.m_mass.col2.x;this.m_mass.col2.y=d+e+h*h*n+m*m*p;this.m_mass.col3.y=h*n+m*p;this.m_mass.col1.z=this.m_mass.col3.x;this.m_mass.col2.z=this.m_mass.col3.y;this.m_mass.col3.z=n+p;u=new f;this.m_mass.Solve33(u,-q,-r,-v);b.m_sweep.c.x-=d*u.x;b.m_sweep.c.y-=d*u.y;b.m_sweep.a-=n*(h*u.y-k*u.x+u.z);g.m_sweep.c.x+=e*u.x;g.m_sweep.c.y+=e*u.y;g.m_sweep.a+=p*(m*u.y-l*u.x+u.z);b.SynchronizeTransform(); g.SynchronizeTransform();return x<=c.b2_linearSlop&&z<=c.b2_angularSlop};Box2D.inherit(E,Box2D.Dynamics.Joints.b2JointDef);E.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;E.b2WeldJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,arguments);this.localAnchorA=new b;this.localAnchorB=new b};E.prototype.b2WeldJointDef=function(){this.__super.b2JointDef.call(this);this.type=q.e_weldJoint;this.referenceAngle=0};E.prototype.Initialize=function(a,b,c){this.bodyA=a; this.bodyB=b;this.localAnchorA.SetV(this.bodyA.GetLocalPoint(c));this.localAnchorB.SetV(this.bodyB.GetLocalPoint(c));this.referenceAngle=this.bodyB.GetAngle()-this.bodyA.GetAngle()}})(); (function(){var c=Box2D.Dynamics.b2DebugDraw;c.b2DebugDraw=function(){this.m_xformScale=this.m_fillAlpha=this.m_alpha=this.m_lineThickness=this.m_drawScale=1;var c=this;this.m_sprite={graphics:{clear:function(){c.m_ctx.clearRect(0,0,c.m_ctx.canvas.width,c.m_ctx.canvas.height)}}}};c.prototype._color=function(c,d){return"rgba("+((c&16711680)>>16)+","+((c&65280)>>8)+","+(c&255)+","+d+")"};c.prototype.b2DebugDraw=function(){this.m_drawFlags=0};c.prototype.SetFlags=function(c){void 0===c&&(c=0);this.m_drawFlags= c};c.prototype.GetFlags=function(){return this.m_drawFlags};c.prototype.AppendFlags=function(c){void 0===c&&(c=0);this.m_drawFlags|=c};c.prototype.ClearFlags=function(c){void 0===c&&(c=0);this.m_drawFlags&=~c};c.prototype.SetSprite=function(c){this.m_ctx=c};c.prototype.GetSprite=function(){return this.m_ctx};c.prototype.SetDrawScale=function(c){void 0===c&&(c=0);this.m_drawScale=c};c.prototype.GetDrawScale=function(){return this.m_drawScale};c.prototype.SetLineThickness=function(c){void 0===c&&(c= 0);this.m_lineThickness=c;this.m_ctx.strokeWidth=c};c.prototype.GetLineThickness=function(){return this.m_lineThickness};c.prototype.SetAlpha=function(c){void 0===c&&(c=0);this.m_alpha=c};c.prototype.GetAlpha=function(){return this.m_alpha};c.prototype.SetFillAlpha=function(c){void 0===c&&(c=0);this.m_fillAlpha=c};c.prototype.GetFillAlpha=function(){return this.m_fillAlpha};c.prototype.SetXFormScale=function(c){void 0===c&&(c=0);this.m_xformScale=c};c.prototype.GetXFormScale=function(){return this.m_xformScale}; c.prototype.DrawPolygon=function(c,d,a){if(d){var b=this.m_ctx,f=this.m_drawScale;b.beginPath();b.strokeStyle=this._color(a.color,this.m_alpha);b.moveTo(c[0].x*f,c[0].y*f);for(a=1;a=c.length?e():a()})};a()},loadSingleScript:function(c,e){var d=document.createElement("script");d.hasOwnProperty("async")&&(d.async=!1);d.src=c;d.addEventListener("load",function(){this.removeEventListener("load",arguments.callee,!1);e()},!1);document.body.appendChild(d)},startGame:function(){var c=document.getElementById(ns_egret.StageDelegate.canvas_name);context=ns_egret.MainContext.instance; context.rendererContext=new ns_egret.HTML5CanvasRenderer(c);context.netContext=new ns_egret.HTML5NetContext;context.touchContext=new ns_egret.HTML5TouchContext(c);context.deviceContext=new ns_egret.HTML5DeviceContext;var e=new ns_egret.EqualToFrame,d=ns_egret.Browser.getInstance().isMobile?new ns_egret.FixedWidth:new ns_egret.FixedSize(480,800),e=new ns_egret.ResolutionPolicy(e,d);ns_egret.StageDelegate.getInstance().setDesignSize(480,800,e);context.stage=new ns_egret.Stage(c.width,c.height);ns_egret.ResourceLoader.prefix= "assets/480/";ns_egret.RendererContext.CONTENT_SCALE_FACTOR=1;context.run();app&&app.startGame&&app.startGame()},preloadScript:function(c,e){egret_h5.preloadList||(egret_h5.preloadList=[]);egret_h5.preloadList=egret_h5.preloadList.concat(c.map(function(c){return e+c}))},startLoading:function(){egret_h5.loadScript(egret_h5.preloadList,egret_h5.startGame)}};var __extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d},GameApp=function(){function c(){}c.prototype.startGame=function(){ns_egret.ResourceLoader.registerHandler("png",ImageResourceLoader);ns_egret.ResourceLoader.registerHandler("jpg",ImageResourceLoader);ns_egret.ResourceLoader.registerHandler("json",MovieClipDataResourceLoader);var c=new LoadingManager(this.loadAssets,this,null),d=["images/background/loadingmap.jpg", "images/background/loadingbar_01.png","images/background/loadingbar_02.png"],a;for(a in d)c.addPreLoad(d[a],LoadingManager.DATA_TYPE_IMAGE);c.startLoading();this.systemManager=new ns_egret.SystemManager;ns_egret.MainContext.instance.stage.addChild(this.systemManager)};c.prototype.loadAssets=function(){var c=new LoadingManager(this.onResourceLoadComplete,this,new LoadingUI),d=loli_img_str.split(" "), a;for(a in d){var b=d[a];c.addPreLoad(b,LoadingManager.DATA_TYPE_IMAGE)}d=["ui/Result.jmc","ui/MainMenuSkin.jmc"];for(a in d)b=d[a],c.addPreLoad(b,LoadingManager.DATA_TYPE_MC);c.addPreLoad("images/table/wave.xml",LoadingManager.DATA_TYPE_TEXT);c.addPreLoad("images/table/monster.xml",LoadingManager.DATA_TYPE_TEXT);c.addPreLoad("images/table/drop.xml",LoadingManager.DATA_TYPE_TEXT);c.startLoading()};c.prototype.onResourceLoadComplete=function(){utils.Config.initConfig();this.createGameScene()};c.prototype.createGameScene= function(){this.stateMachine=new StateMachine;this.stateMachine.changeState(new MainMenuState)};return c}(),ImageResourceLoader=function(c){function e(d){c.call(this,d,ns_egret.ResourceLoader.DATA_TYPE_IMAGE)}__extends(e,c);return e}(ns_egret.ResourceLoader),MovieClipDataResourceLoader=function(c){function e(d){c.call(this,d,ns_egret.ResourceLoader.DATA_TYPE_TEXT);this.onLoadComplete=function(a){this.data=JSON.parse(a)}}__extends(e,c);return e}(ns_egret.ResourceLoader),TextResourceLoader=function(c){function e(d){c.call(this, d,ns_egret.ResourceLoader.DATA_TYPE_TEXT);this.onLoadComplete=function(a){this.data=a}}__extends(e,c);return e}(ns_egret.ResourceLoader),utils; (function(c){c.createBitmap=function(c){var a=new ns_egret.Bitmap;c=ns_egret.TextureCache.getInstance().getTexture(c);a.texture=c;return a};c.createMovieClip=function(c){var a=ns_egret.ResourceLoader.create(c+".json").data;c=ns_egret.TextureCache.getInstance().getTexture(c+".png");return new ns_egret.MovieClip(a,c)};c.getGameHeight=function(){return ns_egret.MainContext.instance.stage.stageHeight};c.getGameWidth=function(){return ns_egret.MainContext.instance.stage.stageWidth};var e=function(){function c(){} c.initConfig=function(){var a=ns_egret.ResourceLoader.create("images/table/monster.xml").data;c.enemyData=new ns_egret.XML(a);a=ns_egret.ResourceLoader.create("images/table/drop.xml").data;c.dropData=new ns_egret.XML(a)};return c}();c.Config=e;c.getEnemyConfigById=function(c){return e.enemyData.elements[0].element[c-1]};c.getItemConfigById=function(c){return e.dropData.items[0].element[c-1]}})(utils||(utils={}));var movieclip; (function(c){var e=function(c){function a(a){c.call(this);this._duringTime=0;a=utils.createBitmap("images/enemy/enemy0_PList.Dir/black_gui-wring_l.png");this.addChild(a);a.x=33.75;a.y=60;a.relativeAnchorPointX=1;a.scaleX=-1;var e=utils.createBitmap("images/enemy/enemy0_PList.Dir/black_gui-wring_l.png");this.addChild(e);e.x=63.75;e.y=60;e.relativeAnchorPointX=1;var m=utils.createBitmap(loli_icon_img);this.addChild(m);m=utils.createBitmap("images/enemy/enemy0_PList.Dir/black_gui-eye_1.png"); this.addChild(m);m.x=30;m.y=45;this.wing_left=a;this.wing_right=e}__extends(a,c);a.prototype.onTicker=function(a){this._duringTime+=a;a=20*Math.sin(10*this._duringTime/1E3%180);this.wing_left.rotation=a+90;this.wing_right.rotation=-a-90};a.create=function(b){return new a(b)};return a}(ns_egret.DisplayObjectContainer);c.EnemyMovieClip=e})(movieclip||(movieclip={}));var app=new GameApp;var __extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d},LoadingUI=function(){function c(){}c.prototype.addToStage=function(){this.bg=new ns_egret.UIAsset;this.bg.skinName=utils.createBitmap(loli_background_img);ns_egret.PopUpManager.addPopUp(this.bg,!1,!1);this.progress=new ns_egret.ProgressBar;this.progress.slideDuration=0;this.progress.horizontalCenter=0;this.progress.bottom= 105;this.progress.skinName=new ProgressBarSkin;this.progress.labelFunction=function(c,d){return"\u6e38\u620f\u52a0\u8f7d\u4e2d..."+c+"/"+d};ns_egret.PopUpManager.addPopUp(this.progress,!1,!1)};c.prototype.removeFromStage=function(){ns_egret.PopUpManager.removePopUp(this.bg);ns_egret.PopUpManager.removePopUp(this.progress)};c.prototype.onProgress=function(c,d){this.progress.maximum=d;this.progress.value=c};return c}(),ProgressBarSkin=function(c){function e(){c.call(this)}__extends(e,c);Object.defineProperty(e.prototype, "skinParts",{get:function(){return e._skinParts},enumerable:!0,configurable:!0});e.prototype.createChildren=function(){c.prototype.createChildren.call(this);var d=new ns_egret.UIAsset;d.left=-64;d.top=-64;d.skinName=utils.createBitmap("images/background/loadingbar_01.png");this.addElement(d);this.thumb=new ns_egret.UIAsset;d=utils.createBitmap("images/background/loadingbar_02.png");this.thumb.skinName=d;this.addElement(this.thumb);d=d.getBounds();this.width=d.width;this.height=d.height;this.track= new ns_egret.UIAsset;this.track.width=d.width;this.track.height=d.height;this.addElement(this.track);this.labelDisplay=new ns_egret.Label;this.labelDisplay.textAlign=ns_egret.HorizontalAlign.CENTER;this.labelDisplay.verticalAlign=ns_egret.VerticalAlign.MIDDLE;this.labelDisplay.maxDisplayedLines=1;this.labelDisplay.size=24;this.labelDisplay.left=5;this.labelDisplay.right=5;this.labelDisplay.top=3;this.labelDisplay.bottom=3;this.labelDisplay.textColor=16777215;this.addElement(this.labelDisplay)};e._skinParts= ["thumb","track","labelDisplay"];return e}(ns_egret.Skin);var __extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d},GameObject=function(){function c(){this.collisionBounds=new ns_egret.Rectangle(0,0,1,1)}c.prototype.onCreate=function(){};c.prototype.onDestroy=function(){};c.prototype.onEnterFrame=function(c){};c.prototype.addToCollision=function(){this.collisionBounds=this.view.getBounds().clone();GameScene.collision.addInitiativeObject(this)};c.prototype.getCollisionBounds= function(){return this.view.worldBounds};c.prototype.onHit=function(c){};return c}(),GameScene=function(c){function e(){c.call(this);this._lastTime=0;this._flag=!1;var d=ns_egret.ResourceLoader.create("images/table/wave.xml").data;this.enemyData=new ns_egret.XML(d);e.collision=new CollisionManager;this.container=new ns_egret.DisplayObjectContainer;this.view=e.container=this.container;for(d=0;50>=d;d++)ObjectPool.getInstance().destroyObject(ObjectPool.getInstance().createObject(Bullet));e.instance= this;this.uiContainer=new ns_egret.DisplayObjectContainer;d=utils.createBitmap("images/object/U_2_PList.Dir/s_gold1.png");d.y=35;this.uiContainer.addChild(d);this.scoreLabel=new ns_egret.TextField;this.scoreLabel.stroke=2;this.uiContainer.addChild(this.scoreLabel);this.goldLabel=new ns_egret.TextField;this.goldLabel.stroke=2;this.goldLabel.x=35;this.goldLabel.y=35;this.uiContainer.addChild(this.goldLabel);this.distanceLabel=new ns_egret.TextField;this.distanceLabel.stroke=2;this.distanceLabel.width= 200;this.distanceLabel.x=265;this.distanceLabel.textAlign=ns_egret.HorizontalAlign.RIGHT;this.uiContainer.addChild(this.distanceLabel);this.warnMark=utils.createBitmap("images/object/U_2_PList.Dir/warn_mark.png");this.warnMark.anchorX=0.5;this.warnLine=utils.createBitmap("images/object/U_2_PList.Dir/warn_line.png");this.warnLine.scaleY=4;this.warnLine.y=50;this.pkLine=utils.createBitmap("images/object/U_2_PList.Dir/pk_line.png");this.pkLine.y=100;this.uiContainer.addChild(this.pkLine);this.head=utils.createBitmap("images/object/U_2_PList.Dir/char_s1.png"); this.uiContainer.addChild(this.head)}__extends(e,c);e.prototype.onCreate=function(){var c=ObjectPool.getInstance().createObject(Background);this.container.addChild(c.view);c=ObjectPool.getInstance().createObject(Hero);this.container.addChild(c.view);e.hero=c;this.scoreLabel.text=FightInfo.instance.score.toString();this.distanceLabel.text=FightInfo.instance.distance.toString()+"M";this.goldLabel.text=FightInfo.instance.gold.toString();this.head.y=400+this.pkLine.y;this._lastTime=this._wave=this.godEnemyLeft= 0};e.prototype.onEnterFrame=function(c){if(!(5E3b;b++){var f=parseInt(a["$slot"+b]),m=ObjectPool.getInstance().createObject(Enemy);m.configId=f;this.container.addChild(m.view);m.moveTo(125*b-120);this._lastTime-=300}0==this._wave%3&&15=this.godEnemyLeft&&(this.godEnemyLeft=0,this.container.removeChild(this.warnLine),this.container.removeChild(this.warnMark),ns_egret.Tween.removeTweens(this.warnLine),c=ObjectPool.getInstance().createObject(GodEnemy),this.container.addChild(c.view),c.moveTo(this.godEnemyX)));e.collision.hitTest();FightInfo.instance.distance+=0.1;this.distanceLabel.text=Math.floor(FightInfo.instance.distance)+ "M";this.head.y-=0.01;this.head.y<=this.pkLine.y&&(this.head.y=400+this.pkLine.y)}};e.prototype.onGetGold=function(){FightInfo.instance.gold++;this.goldLabel.text=FightInfo.instance.gold.toString()};e.prototype.onKillMonster=function(c){FightInfo.instance.score+=c;this.scoreLabel.text=FightInfo.instance.score.toString();FightInfo.instance.monsterKill++};e.prototype.getEnemyConfig=function(){return this.enemyData.elements[0].element[this._wave]};e.prototype.onDestroy=function(){ns_egret.Tween.removeTweens(this.warnLine); this.container.removeChildren()};e.key="gamescene";return e}(GameObject),ObjectPool=function(){function c(){this._pool={};this._list=[];ns_egret.Ticker.getInstance().register(this.onEnterFrame,this)}c.prototype.onEnterFrame=function(c){for(var d=this._list.concat(),a=0,b=d.length;a=this.max&&this.addTile()};e.key= "background";return e}(GameObject),Hero=function(c){function e(){c.call(this);this._isDead=!1;this.view=this.container=new ns_egret.DisplayObjectContainer;var d=utils.createMovieClip("hero10");this.container.addChild(d);d.setInterval(4);this.hero=d}__extends(e,c);e.prototype.onCreate=function(){this._isDead=!1;GameScene.collision.addInitiativeObject(this);this.hero.gotoAndPlay("run");this.view.x=240+400*Math.random()-200;this.view.y=utils.getGameHeight()-100;this._doubleTime=this._lastTime=0};e.prototype.onDestroy= function(){this.hero.gotoAndStop("run");this._isDead=!0;GameScene.collision.removeInitiativeObject(this)};e.prototype.onEnterFrame=function(c){for(this._lastTime+=c;100=this.view.y&&this.view.parent&&(this.view.parent.removeChild(this.view),ObjectPool.getInstance().destroyObject(this))};e.key="bullet";return e}(GameObject),Enemy=function(c){function e(){c.call(this);var d=new ns_egret.DisplayObjectContainer;this.view=d;this.progress=new ns_egret.ProgressBar;this.progress.slideDuration=0;this.progress.horizontalCenter= 0;this.progress.x=3;this.progress.y=95;this.progress.skinName=new EnemyProgressBarSkin;d.addChild(this.progress)}__extends(e,c);Object.defineProperty(e.prototype,"configId",{set:function(c){this._configId!=c&&(this._configId=c,c=utils.getEnemyConfigById(c),this.hpMax=parseInt(c.$hp),this.hp=parseInt(c.$hp),this.mc&&this.view.removeChild(this.mc),this.mc=movieclip.EnemyMovieClip.create(this._configId),this.view.addChild(this.mc))},enumerable:!0,configurable:!0});e.prototype.onCreate=function(){GameScene.collision.addPassiveObject(this); this.view.y=-120;this.progress.maximum=1;this.progress.value=1;this.progress.visible=!1};e.prototype.onDestroy=function(){GameScene.collision.removePassiveObject(this)};e.prototype.onHit=function(c){c instanceof Bullet&&-90this.hp?(this.dead(),this.dropItem(),GameScene.instance.onKillMonster(Math.floor(this.hpMax/10))):(this.progress.maximum=this.hpMax,this.progress.value=this.hp,this.progress.visible=!0))};e.prototype.onEnterFrame=function(c){this.mc.onTicker(c); this.view.y+=0.3*c;this.view.y>utils.getGameHeight()&&this.dead()};e.prototype.moveTo=function(c){this.view.x=c};e.prototype.dead=function(){this.view.parent.removeChild(this.view);ObjectPool.getInstance().destroyObject(this)};e.prototype.dropItem=function(){for(var c=9939*Math.random(),a=1,b=utils.getItemConfigById(a);parseInt(b.$rangmax)utils.getGameHeight()&&this.dead()};e.prototype.moveTo=function(c){this.view.x= c};e.prototype.dead=function(){this.view.parent.removeChild(this.view);ObjectPool.getInstance().destroyObject(this)};e.key="godEnemy";return e}(GameObject),EnemyProgressBarSkin=function(c){function e(){c.call(this)}__extends(e,c);Object.defineProperty(e.prototype,"skinParts",{get:function(){return e._skinParts},enumerable:!0,configurable:!0});e.prototype.createChildren=function(){c.prototype.createChildren.call(this);var d=new ns_egret.UIAsset;d.skinName=utils.createBitmap("images/progress_monsterBg.png"); this.addElement(d);this.thumb=new ns_egret.UIAsset;d=utils.createBitmap("images/progress_monsterBar.png");this.thumb.skinName=d;this.addElement(this.thumb);d=d.getBounds();this.width=d.width;this.height=d.height;this.track=new ns_egret.UIAsset;this.track.width=d.width;this.track.height=d.height;this.addElement(this.track)};e._skinParts=["thumb","track"];return e}(ns_egret.Skin),Item=function(c){function e(){c.call(this);this._acc=0.04;this._maxY=1}__extends(e,c);Object.defineProperty(e.prototype, "config",{set:function(c){this._configId=parseInt(c.$type);var a=utils.createBitmap("images/object/U_2_PList.Dir/"+c.$img);a.scaleX=a.scaleY=parseFloat(c.$scale);this.view=a;this.view.anchorX=this.view.anchorY=0.5},enumerable:!0,configurable:!0});e.prototype.onCreate=function(){GameScene.collision.addPassiveObject(this);this._velocityX=Math.floor(20*Math.random()-10)/100;this._rotation=5*(this._velocityX/Math.abs(this._velocityX));this._velocityY=-0.3+this._velocityX};e.prototype.onDestroy=function(){GameScene.collision.removePassiveObject(this)}; e.prototype.onHit=function(c){if(c instanceof Hero)if(this.remove(),1==this._configId)GameScene.instance.onGetGold();else if(2==this._configId)GameScene.hero.onGetDouble()};e.prototype.onEnterFrame=function(c){this.view.x+=this._velocityX*c;this.view.x>utils.getGameWidth()-15?this.view.x=utils.getGameWidth()-15:15>this.view.x&&(this.view.x=15);this._velocityY+this._accutils.getGameHeight()&& this.remove();this.view.rotation+=this._rotation};e.prototype.moveTo=function(c){this.view.x=c};e.prototype.remove=function(){this.view.parent&&(this.view.parent.removeChild(this.view),ObjectPool.getInstance().destroyObject(this))};e.key="item";return e}(GameObject),FightInfo=function(){function c(){this.distance=this.gold=this.bestScore=this.score=this.monsterKill=0}c.prototype.clear=function(){this.bestScoreMath.abs(a.stageX-this._startX)&&10>Math.abs(d-this._startY)||(this._isMoved=!0,this.setChoose(!1),c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE,this.mouseMove,this))};a.prototype.addOnClick=function(a,c){this._callBack=a;this._target=c};a.prototype.onClick=function(){this._callBack&&this._target&&this._callBack.apply(this._target,[this])};a.prototype.setEnabled=function(a){this.touchEnabled=a};a.prototype.useZoomOut= function(a){this._canScale=a};a.prototype.initFontTextField=function(a){this._textField=a;a instanceof c.TextField&&(a.stroke=2);if(a&&null!=a.parent){if(a.parent==this)return;a&&a.parent&&a.parent.removeChild(a)}this.addChild(a)};a.prototype.setFontText=function(a,d){"undefined"===typeof d&&(d=30);if(null==this._textField){this._textField=new c.TextField;this._textField.textColor=16777215;this._textField.textAlign="center";this._textField.fontFamily="Courier-Bold";this._textField.size=d;this._textField.stroke= 2;this.addChild(this._textField);this._textField.anchorX=0.5;this._textField.anchorY=0.5;var e=this.getBounds();this._textField.x=e.width/2;this._textField.y=e.height/2}this._textField.text=a};a.prototype.setFontColor=function(a){};a.prototype.setChoose=function(a){this.playZoomOut(!a);this.setFrameChild(a?2:1)};a.prototype.playZoomOut=function(a){this._canScale&&(this.scaleX=a?this._initScaleX:this._initScaleX*this._scale,this.scaleY=a?this._initScaleY:this._initScaleY*this._scale)};a.prototype.initFrameRes= function(a,c,d){this._currentFrame=c;this._frameRes=a;this._frames[c-1]=d};a.prototype.changeBtn=function(a){if(this._frameRes!=a){this._frameRes=a;for(var c=a=0;c