美素佳儿 litter wizard小游戏
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

5 年之前
123
  1. var __reflect=this&&this.__reflect||function(t,e,i){t.__class__=e,i?i.push(e):i=[e],t.__types__=t.__types__?i.concat(t.__types__):i},__extends=this&&this.__extends||function(t,e){function i(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},egret;!function(t){var e;!function(e){function i(e,i,r,n,a){var o,s;if(-1!=i.indexOf(", "))s=i.split(", ");else if(-1!=i.indexOf(",")){s=i.split(",");for(var h=s.length,c=0;h>c;c++){var u=s[c];if(t.fontMapping[u]){o=t.fontMapping[u];break}}}else o=t.fontMapping[i];return o||(o="/system/fonts/DroidSansFallback.ttf"),egret_native.Label.createLabel(o,r,"",0),egret_native.Label.getTextSize(e)[0]}t.sys.measureText=i}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i={"source-over":[1,771],lighter:[770,1],"destination-out":[0,771],"destination-in":[0,770]},r=function(r){function n(){var e=r.apply(this,arguments)||this;return e.$matrix=new t.Matrix,e.$nativeContext=egret_native.Graphics,e.$nativeGraphicsContext=egret_native.rastergl,e.$globalCompositeOperation="source-over",e.$globalAlpha=1,e.$lineWidth=0,e.$strokeStyle="#000000",e.$fillStyle="#000000",e.$font="normal normal 10px sans-serif",e.$fontSize=10,e.$fontFamily="",e.clipRectArray=null,e.$saveList=[],e.$clipRect=new t.Rectangle,e.$saveCount=0,e.$clipList=[],e.$hasStrokeText=!1,e}return __extends(n,r),Object.defineProperty(n.prototype,"globalCompositeOperation",{get:function(){return this.$globalCompositeOperation},set:function(t){this.$globalCompositeOperation=t;var r=i[t];r&&(this.checkSurface(),e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.setBlendArg(r[0],r[1]))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"globalAlpha",{get:function(){return this.$globalAlpha},set:function(t){this.$globalAlpha=t,this.checkSurface(),e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.setGlobalAlpha(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"lineWidth",{get:function(){return this.$lineWidth},set:function(t){this.$lineWidth=t,e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.setLineWidth(t),this.checkSurface(),e.$cmdManager.setContext(this.$nativeGraphicsContext),e.$cmdManager.setLineWidth(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"strokeStyle",{get:function(){return this.$strokeStyle},set:function(t){this.$strokeStyle=t,null!=t&&(-1!=t.indexOf("rgba")?t=this.$parseRGBA(t):-1!=t.indexOf("rgb")&&(t=this.$parseRGB(t)),e.$cmdManager.setContext(egret_native.Label),e.$cmdManager.setStrokeColor(parseInt(t.replace("#","0x")))),this.checkSurface(),e.$cmdManager.setContext(this.$nativeGraphicsContext);var i=e.$cmdManager.pushString(t);e.$cmdManager.setStrokeStyle(i)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"fillStyle",{get:function(){return this.$fillStyle},set:function(t){this.$fillStyle=t,null!=t&&(-1!=t.indexOf("rgba")?t=this.$parseRGBA(t):-1!=t.indexOf("rgb")&&(t=this.$parseRGB(t)),e.$cmdManager.setContext(egret_native.Label),e.$cmdManager.setTextColor(parseInt(t.replace("#","0x")))),this.checkSurface(),e.$cmdManager.setContext(this.$nativeGraphicsContext);var i=e.$cmdManager.pushString(t);e.$cmdManager.setFillStyle(i)},enumerable:!0,configurable:!0}),n.prototype.$fillColorStr=function(t){return t.length<2&&(t="0"+t),t},n.prototype.$parseRGBA=function(t){var e=t.indexOf("(");t=t.slice(e+1,t.length-1);var i=t.split(","),r=parseInt(255*parseFloat(i[3])).toString(16),n=parseInt(i[0]).toString(16),a=parseInt(i[1]).toString(16),o=parseInt(i[2]).toString(16);return t="#"+this.$fillColorStr(r)+this.$fillColorStr(n)+this.$fillColorStr(a)+this.$fillColorStr(o)},n.prototype.$parseRGB=function(t){var e=t.indexOf("(");t=t.slice(e+1,t.length-1);var i=t.split(","),r=parseInt(i[0]).toString(16),n=parseInt(i[1]).toString(16),a=parseInt(i[2]).toString(16);return t="#"+this.$fillColorStr(r)+this.$fillColorStr(n)+this.$fillColorStr(a)},Object.defineProperty(n.prototype,"font",{get:function(){return this.$font},set:function(e){this.$font=e;var i=e.split(" "),r=i[2];if(-1!=r.indexOf("px")&&(this.$fontSize=parseInt(r.replace("px",""))),t.useFontMapping){var n=void 0;if(n=4==i.length?i[3]:i.slice(3).join(" "),-1!=n.indexOf(", "))i=n.split(", ");else if(-1!=n.indexOf(",")){i=n.split(",");for(var a=i.length,o=0;a>o;o++){var s=i[o];if(t.fontMapping[s])return void(this.$fontFamily=t.fontMapping[s])}}else this.$fontFamily=t.fontMapping[n];this.$fontFamily||(this.$fontFamily="/system/fonts/DroidSansFallback.ttf")}else this.$fontFamily=t.TextField.default_fontFamily},enumerable:!0,configurable:!0}),n.prototype.arc=function(t,i,r,n,a,o){this.checkSurface(),e.$cmdManager.setContext(this.$nativeGraphicsContext),e.$cmdManager.arc(t,i,r,n,a,o?1:0)},n.prototype.quadraticCurveTo=function(t,i,r,n){this.checkSurface(),e.$cmdManager.setContext(this.$nativeGraphicsContext),e.$cmdManager.quadraticCurveTo(t,i,r,n)},n.prototype.lineTo=function(t,i){this.checkSurface(),e.$cmdManager.setContext(this.$nativeGraphicsContext),e.$cmdManager.lineTo(t,i)},n.prototype.fill=function(t){this.checkSurface(),e.$cmdManager.setContext(this.$nativeGraphicsContext);var i=e.$cmdManager.pushString(t);e.$cmdManager.fill(i)},n.prototype.closePath=function(){this.checkSurface(),e.$cmdManager.setContext(this.$nativeGraphicsContext),e.$cmdManager.closePath()},n.prototype.rect=function(t,i,r,n){this.checkSurface(),e.$cmdManager.setContext(this.$nativeGraphicsContext),e.$cmdManager.rect(t,i,r,n),this.$clipRect.setTo(t,i,r,n)},n.prototype.moveTo=function(t,i){this.checkSurface(),e.$cmdManager.setContext(this.$nativeGraphicsContext),e.$cmdManager.moveTo(t,i)},n.prototype.fillRect=function(t,i,r,n){this.checkSurface(),e.$cmdManager.setContext(this.$nativeGraphicsContext),e.$cmdManager.fillRect(t,i,r,n)},n.prototype.bezierCurveTo=function(t,i,r,n,a,o){this.checkSurface(),e.$cmdManager.setContext(this.$nativeGraphicsContext),e.$cmdManager.bezierCurveTo(t,i,r,n,a,o)},n.prototype.stroke=function(){this.checkSurface(),e.$cmdManager.setContext(this.$nativeGraphicsContext),e.$cmdManager.stroke()},n.prototype.strokeRect=function(t,i,r,n){this.checkSurface(),e.$cmdManager.setContext(this.$nativeGraphicsContext),e.$cmdManager.strokeRect(t,i,r,n)},n.prototype.beginPath=function(){this.checkSurface(),e.$cmdManager.setContext(this.$nativeGraphicsContext),e.$cmdManager.beginPath()},n.prototype.arcTo=function(t,e,i,r,n){this.checkSurface(),this.$nativeGraphicsContext.arcTo(t,e,i,r,n)},n.prototype.transform=function(t,e,i,r,n,a){this.$matrix.append(t,e,i,r,n,a),this.setTransformToNative()},n.prototype.translate=function(t,e){this.$matrix.translate(t,e),this.setTransformToNative()},n.prototype.scale=function(t,e){this.$matrix.scale(t,e),this.setTransformToNative()},n.prototype.rotate=function(t){this.$matrix.rotate(t),this.setTransformToNative()},n.prototype.restore=function(){if(this.$saveCount>0){if(this.$saveList.length){var t=this.$saveList.pop();for(var i in t)this[i]=t[i];this.setTransformToNative()}var r=this.$clipList.indexOf(this.$saveCount);if(-1!=r){var n=this.$clipList.length;for(this.$clipList.splice(r,n-r);n>r;r++)this.checkSurface(),e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.popClip()}this.$saveCount--}},n.prototype.save=function(){var e=new t.Matrix;e.copyFrom(this.$matrix),this.$saveList.push({lineWidth:this.$lineWidth,globalCompositeOperation:this.$globalCompositeOperation,globalAlpha:this.$globalAlpha,strokeStyle:this.$strokeStyle,fillStyle:this.$fillStyle,font:this.$font,$matrix:e}),this.$saveCount++},n.prototype.clip=function(t){this.$clipRect.width>0&&this.$clipRect.height>0&&(this.checkSurface(),e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.pushClip(this.$clipRect.x,this.$clipRect.y,this.$clipRect.width,this.$clipRect.height),this.$clipRect.setEmpty(),this.$clipList.push(this.$saveCount))},n.prototype.clearRect=function(t,i,r,n){this.checkSurface(),e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.clearScreen(0,0,0,0)},n.prototype.setTransform=function(t,e,i,r,n,a){this.$matrix.setTo(t,e,i,r,n,a),this.setTransformToNative()},n.prototype.setTransformToNative=function(){var t=this.$matrix;this.checkSurface(),e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.setTransform(t.a,t.b,t.c,t.d,t.tx,t.ty)},n.prototype.createLinearGradient=function(t,e,i,r){return this.checkSurface(),this.$nativeGraphicsContext.createLinearGradient(t,e,i,r)},n.prototype.createRadialGradient=function(t,e,i,r,n,a){return this.checkSurface(),this.$nativeGraphicsContext.createRadialGradient(t,e,i,r,n,a)},n.prototype.fillText=function(t,i,r,n){e.$cmdManager.setContext(egret_native.Label);var a=e.$cmdManager.pushString(this.$fontFamily),o=e.$cmdManager.pushString("");e.$cmdManager.createLabel(a,this.$fontSize,o,this.$hasStrokeText?this.$lineWidth:0),this.$hasStrokeText=!1;var s=e.$cmdManager.pushString(t);e.$cmdManager.drawText(s,i,r)},n.prototype.strokeText=function(t,e,i,r){this.$hasStrokeText=!0},n.prototype.measureText=function(t){e.$cmdManager.setContext(egret_native.Label);var i=e.$cmdManager.pushString(this.$fontFamily),r=e.$cmdManager.pushString("");return e.$cmdManager.createLabel(i,this.$fontSize,r,this.$hasStrokeText?this.$lineWidth:0),{width:egret_native.Label.getTextSize(t)[0]}},n.prototype.drawImage=function(t,i,r,n,a,o,s,h,c){var u,l;if(t.$nativeRenderTexture?(u=t.$nativeRenderTexture,l=!0):(u=t,l=!1),u){3==arguments.length?(o=i,s=r,i=0,r=0,n=h=t.width,a=c=t.height):5==arguments.length?(o=i,s=r,h=n,c=a,i=0,r=0,n=t.width,a=t.height):(void 0==n&&(n=t.width),void 0==a&&(a=t.height),void 0==o&&(o=0),void 0==s&&(s=0),void 0==h&&(h=n),void 0==c&&(c=a)),this.checkSurface();var p;l?p=u.___native_texture__p:(u._native_tex_loc||(u._native_tex_loc=u.___native_texture__p),p=u._native_tex_loc),e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.drawImage(p,i,r,n,a,o,s,h,c)}},n.prototype.createPattern=function(t,e){return null},n.prototype.getImageData=function(t,i,r,n){e.$cmdManager.flush();var a;return e.$currentSurface==this.surface&&null!=e.$currentSurface&&e.$currentSurface.end(),a=this.surface.getImageData(t,i,r,n),a.pixelData&&(a.data=a.pixelData),a},n.prototype.checkSurface=function(){e.$currentSurface!=this.surface&&(null!=e.$currentSurface&&e.$currentSurface.end(),this.surface&&this.surface.begin())},n}(t.HashObject);e.NativeRenderTextureRenderContext=r,__reflect(r.prototype,"egret.native.NativeRenderTextureRenderContext")}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i={"source-over":[1,771],lighter:[770,1],"destination-out":[0,771],"destination-in":[0,770]},r=function(r){function n(){var e=r.apply(this,arguments)||this;return e.$matrix=new t.Matrix,e.$nativeContext=egret_native.Graphics,e.$nativeGraphicsContext=egret_native.rastergl,e.$globalCompositeOperation="source-over",e.$globalAlpha=1,e.$lineWidth=0,e.$strokeStyle="#000000",e.$fillStyle="#000000",e.$font="normal normal 10px sans-serif",e.$fontSize=10,e.$fontFamily="",e.clipRectArray=null,e.$saveList=[],e.$clipRect=new t.Rectangle,e.$saveCount=0,e.$clipList=[],e.$hasStrokeText=!1,e}return __extends(n,r),Object.defineProperty(n.prototype,"globalCompositeOperation",{get:function(){return this.$globalCompositeOperation},set:function(t){this.$globalCompositeOperation=t;var e=i[t];e&&(this.checkSurface(),this.$nativeContext.setBlendArg(e[0],e[1]))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"globalAlpha",{get:function(){return this.$globalAlpha},set:function(t){this.$globalAlpha=t,this.checkSurface(),this.$nativeContext.setGlobalAlpha(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"lineWidth",{get:function(){return this.$lineWidth},set:function(t){this.$lineWidth=t,this.$nativeContext.lineWidth=t,this.checkSurface(),this.$nativeGraphicsContext.lineWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"strokeStyle",{get:function(){return this.$strokeStyle},set:function(t){this.$strokeStyle=t,null!=t&&(-1!=t.indexOf("rgba")?t=this.$parseRGBA(t):-1!=t.indexOf("rgb")&&(t=this.$parseRGB(t)),egret_native.Label.setStrokeColor(parseInt(t.replace("#","0x")))),this.checkSurface(),this.$nativeGraphicsContext.strokeStyle=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"fillStyle",{get:function(){return this.$fillStyle},set:function(t){this.$fillStyle=t,null!=t&&(-1!=t.indexOf("rgba")?t=this.$parseRGBA(t):-1!=t.indexOf("rgb")&&(t=this.$parseRGB(t)),egret_native.Label.setTextColor(parseInt(t.replace("#","0x")))),this.checkSurface(),this.$nativeGraphicsContext.fillStyle=t},enumerable:!0,configurable:!0}),n.prototype.$fillColorStr=function(t){return t.length<2&&(t="0"+t),t},n.prototype.$parseRGBA=function(t){var e=t.indexOf("(");t=t.slice(e+1,t.length-1);var i=t.split(","),r=parseInt(255*parseFloat(i[3])).toString(16),n=parseInt(i[0]).toString(16),a=parseInt(i[1]).toString(16),o=parseInt(i[2]).toString(16);return t="#"+this.$fillColorStr(r)+this.$fillColorStr(n)+this.$fillColorStr(a)+this.$fillColorStr(o)},n.prototype.$parseRGB=function(t){var e=t.indexOf("(");t=t.slice(e+1,t.length-1);var i=t.split(","),r=parseInt(i[0]).toString(16),n=parseInt(i[1]).toString(16),a=parseInt(i[2]).toString(16);return t="#"+this.$fillColorStr(r)+this.$fillColorStr(n)+this.$fillColorStr(a)},Object.defineProperty(n.prototype,"font",{get:function(){return this.$font},set:function(e){this.$font=e;var i=e.split(" "),r=i[2];if(-1!=r.indexOf("px")&&(this.$fontSize=parseInt(r.replace("px",""))),t.useFontMapping){var n=void 0;if(n=4==i.length?i[3]:i.slice(3).join(" "),-1!=n.indexOf(", "))i=n.split(", ");else if(-1!=n.indexOf(",")){i=n.split(",");for(var a=i.length,o=0;a>o;o++){var s=i[o];if(t.fontMapping[s])return void(this.$fontFamily=t.fontMapping[s])}}else this.$fontFamily=t.fontMapping[n];this.$fontFamily||(this.$fontFamily="/system/fonts/DroidSansFallback.ttf")}else this.$fontFamily=t.TextField.default_fontFamily},enumerable:!0,configurable:!0}),n.prototype.arc=function(t,e,i,r,n,a){this.checkSurface(),this.$nativeGraphicsContext.arc(t,e,i,r,n,a)},n.prototype.quadraticCurveTo=function(t,e,i,r){this.checkSurface(),this.$nativeGraphicsContext.quadraticCurveTo(t,e,i,r)},n.prototype.lineTo=function(t,e){this.checkSurface(),this.$nativeGraphicsContext.lineTo(t,e)},n.prototype.fill=function(t){this.checkSurface(),this.$nativeGraphicsContext.fill(t)},n.prototype.closePath=function(){this.checkSurface(),this.$nativeGraphicsContext.closePath()},n.prototype.rect=function(t,e,i,r){this.checkSurface(),this.$nativeGraphicsContext.rect(t,e,i,r),this.$clipRect.setTo(t,e,i,r)},n.prototype.moveTo=function(t,e){this.checkSurface(),this.$nativeGraphicsContext.moveTo(t,e)},n.prototype.fillRect=function(t,e,i,r){this.checkSurface(),this.$nativeGraphicsContext.fillRect(t,e,i,r)},n.prototype.bezierCurveTo=function(t,e,i,r,n,a){this.checkSurface(),this.$nativeGraphicsContext.bezierCurveTo(t,e,i,r,n,a)},n.prototype.stroke=function(){this.checkSurface(),this.$nativeGraphicsContext.stroke()},n.prototype.strokeRect=function(t,e,i,r){this.checkSurface(),this.$nativeGraphicsContext.strokeRect(t,e,i,r)},n.prototype.beginPath=function(){this.checkSurface(),this.$nativeGraphicsContext.beginPath()},n.prototype.arcTo=function(t,e,i,r,n){this.checkSurface(),this.$nativeGraphicsContext.arcTo(t,e,i,r,n)},n.prototype.transform=function(t,e,i,r,n,a){this.$matrix.append(t,e,i,r,n,a),this.setTransformToNative()},n.prototype.translate=function(t,e){this.$matrix.translate(t,e),this.setTransformToNative()},n.prototype.scale=function(t,e){this.$matrix.scale(t,e),this.setTransformToNative()},n.prototype.rotate=function(t){this.$matrix.rotate(t),this.setTransformToNative()},n.prototype.restore=function(){if(this.$saveCount>0){if(this.$saveList.length){var t=this.$saveList.pop();for(var e in t)this[e]=t[e];this.setTransformToNative()}var i=this.$clipList.indexOf(this.$saveCount);if(-1!=i){var r=this.$clipList.length;for(this.$clipList.splice(i,r-i);r>i;i++)this.checkSurface(),this.$nativeContext.popClip()}this.$saveCount--}},n.prototype.save=function(){var e=new t.Matrix;e.copyFrom(this.$matrix),this.$saveList.push({lineWidth:this.$lineWidth,globalCompositeOperation:this.$globalCompositeOperation,globalAlpha:this.$globalAlpha,strokeStyle:this.$strokeStyle,fillStyle:this.$fillStyle,font:this.$font,$matrix:e}),this.$saveCount++},n.prototype.clip=function(t){this.$clipRect.width>0&&this.$clipRect.height>0&&(this.checkSurface(),this.$nativeContext.pushClip(this.$clipRect.x,this.$clipRect.y,this.$clipRect.width,this.$clipRect.height),this.$clipRect.setEmpty(),this.$clipList.push(this.$saveCount))},n.prototype.clearRect=function(t,e,i,r){this.checkSurface(),this.$nativeContext.clearScreen(0,0,0)},n.prototype.setTransform=function(t,e,i,r,n,a){this.$matrix.setTo(t,e,i,r,n,a),this.setTransformToNative()},n.prototype.setTransformToNative=function(){var t=this.$matrix;this.checkSurface(),this.$nativeContext.setTransform(t.a,t.b,t.c,t.d,t.tx,t.ty)},n.prototype.createLinearGradient=function(t,e,i,r){return this.checkSurface(),this.$nativeGraphicsContext.createLinearGradient(t,e,i,r)},n.prototype.createRadialGradient=function(t,e,i,r,n,a){return this.checkSurface(),this.$nativeGraphicsContext.createRadialGradient(t,e,i,r,n,a)},n.prototype.fillText=function(t,e,i,r){egret_native.Label.createLabel(this.$fontFamily,this.$fontSize,"",this.$hasStrokeText?this.$lineWidth:0),this.$hasStrokeText=!1,egret_native.Label.drawText(t,e,i)},n.prototype.strokeText=function(t,e,i,r){this.$hasStrokeText=!0},n.prototype.measureText=function(t){return egret_native.Label.createLabel(this.$fontFamily,this.$fontSize,"",this.$hasStrokeText?this.$lineWidth:0),{width:egret_native.Label.getTextSize(t)[0]}},n.prototype.drawImage=function(t,e,i,r,n,a,o,s,h){var c,u;t.$nativeRenderTexture?(c=t.$nativeRenderTexture,u=!0):(c=t,u=!1),c&&(3==arguments.length?(a=e,o=i,e=0,i=0,r=s=t.width,n=h=t.height):5==arguments.length?(a=e,o=i,s=r,h=n,e=0,i=0,r=t.width,n=t.height):(void 0==r&&(r=t.width),void 0==n&&(n=t.height),void 0==a&&(a=0),void 0==o&&(o=0),void 0==s&&(s=r),void 0==h&&(h=n)),this.checkSurface(),this.$nativeContext.drawImage(c,e,i,r,n,a,o,s,h))},n.prototype.createPattern=function(t,e){return null},n.prototype.getImageData=function(t,i,r,n){var a;return e.$currentSurface==this.surface&&null!=e.$currentSurface&&e.$currentSurface.end(),a=this.surface.getImageData(t,i,r,n),a.pixelData&&(a.data=a.pixelData),a},n.prototype.checkSurface=function(){e.$currentSurface!=this.surface&&(null!=e.$currentSurface&&e.$currentSurface.end(),this.surface&&this.surface.begin())},n}(t.HashObject);e.OldNativeRenderTextureRenderContext=r,__reflect(r.prototype,"egret.native.OldNativeRenderTextureRenderContext")}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(t){function i(){var i=t.call(this)||this;return i.$widthReadySet=!1,i.$heightReadySet=!1,i.$isRoot=!1,i.$isDispose=!1,i.renderContext=e.$supportCmdBatch?new e.NativeRenderTextureRenderContext:new e.OldNativeRenderTextureRenderContext,i}return __extends(i,t),i.prototype.toDataURL=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return this.$nativeRenderTexture?this.$nativeRenderTexture.toDataURL.apply(this.$nativeRenderTexture,arguments):null},i.prototype.saveToFile=function(t,e){this.$nativeRenderTexture&&this.$nativeRenderTexture.saveToFile&&this.$nativeRenderTexture.saveToFile(t,e)},Object.defineProperty(i.prototype,"width",{get:function(){return this.$width},set:function(t){this.$width!=t&&(this.$width=t,this.$isDispose||(this.$widthReadySet=!0,this.createRenderTexture()))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.$height},set:function(t){this.$height!=t&&(this.$height=t,this.$isDispose||(this.$heightReadySet=!0,this.createRenderTexture()))},enumerable:!0,configurable:!0}),i.prototype.getImageData=function(t,e,i,r){return t!=Math.floor(t)&&(t=Math.floor(t),i++),e!=Math.floor(e)&&(e=Math.floor(e),r++),this.$nativeRenderTexture.getPixels(t,e,i,r)},i.prototype.createRenderTexture=function(){this.$isRoot||(this.$nativeRenderTexture||this.$widthReadySet&&this.$heightReadySet)&&(this.$nativeRenderTexture&&this.$nativeRenderTexture.dispose(),this.$nativeRenderTexture=new egret_native.RenderTexture(this.$width,this.$height),this.renderContext.globalAlpha=1,this.renderContext.globalCompositeOperation="source-over",this.renderContext.setTransform(1,0,0,1,0,0),this.$widthReadySet=!1,this.$heightReadySet=!1)},i.prototype.begin=function(){this.$nativeRenderTexture&&(e.$currentSurface=this,this.$nativeRenderTexture.getIn?this.$nativeRenderTexture.getIn():this.$nativeRenderTexture.begin())},i.prototype.end=function(){this.$nativeRenderTexture&&(e.$currentSurface=null,this.$nativeRenderTexture.getOut?this.$nativeRenderTexture.getOut():this.$nativeRenderTexture.end())},i.prototype.getContext=function(t){return this.renderContext},i}(t.HashObject);e.NativeRenderTexture=i,__reflect(i.prototype,"egret.native.NativeRenderTexture")}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){function e(e,i){var r=new t.NativeRenderTexture;return isNaN(e)||isNaN(i)||(r.width=e,r.height=i),r}var i,r=function(){function t(t,i){this.surface=e(t,i),this.context=this.surface.getContext("2d")}return Object.defineProperty(t.prototype,"width",{get:function(){return this.surface.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.surface.height},enumerable:!0,configurable:!0}),t.prototype.resize=function(t,e,i){var r=this.surface;i?(r.width<t&&(r.width=t),r.height<e&&(r.height=e)):(r.width!=t&&(r.width=t),r.height!=e&&(r.height=e)),this.clear()},t.prototype.resizeTo=function(t,r,n,a){i||(i=e());var o=(this.context,this.surface),s=i,h=s.getContext("2d");i=o,this.context=h,this.surface=s,s.width=Math.max(t,1),s.height=Math.max(r,1),h.setTransform(1,0,0,1,0,0),h.drawImage(o,n,a),o.height=1,o.width=1},t.prototype.setDirtyRegionPolicy=function(t){},t.prototype.beginClip=function(t,e,i){e=+e||0,i=+i||0;var r=this.context;r.save(),r.beginPath(),r.setTransform(1,0,0,1,e,i);for(var n=t.length,a=0;n>a;a++){var o=t[a];r.clearRect(o.minX,o.minY,o.width,o.height),r.rect(o.minX,o.minY,o.width,o.height)}r.clip()},t.prototype.endClip=function(){this.context.restore()},t.prototype.getPixels=function(t,e,i,r){return void 0===i&&(i=1),void 0===r&&(r=1),this.context.getImageData(t,e,i,r).data},t.prototype.toDataURL=function(t,e){return this.surface.toDataURL(t,e)},t.prototype.clear=function(){var t=this.surface.width,e=this.surface.height;t>0&&e>0&&(this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,t,e))},t.prototype.destroy=function(){this.surface.width=this.surface.height=1},t}();t.NativeRenderTextureRenderBuffer=r,__reflect(r.prototype,"egret.native.NativeRenderTextureRenderBuffer",["egret.sys.RenderBuffer"])}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i={"source-over":[1,771],lighter:[770,1],"destination-out":[0,771],"destination-in":[0,770]},r=function(r){function n(){var e=r.apply(this,arguments)||this;return e.$matrix=new t.Matrix,e.$nativeContext=null,e.$globalCompositeOperation="source-over",e.$globalAlpha=1,e.$lineWidth=0,e.$strokeStyle="#000000",e.$fillStyle="#000000",e.$font="normal normal 10px sans-serif",e.$fontSize=10,e.$fontFamily="",e.clipRectArray=null,e.$saveList=[],e.$clipRectArray=[],e.$clipRect=new t.Rectangle,e.$saveCount=0,e.$clipList=[],e.savedMatrix=new t.Matrix,e.$hasStrokeText=!1,e}return __extends(n,r),Object.defineProperty(n.prototype,"globalCompositeOperation",{get:function(){return this.$globalCompositeOperation},set:function(t){this.$globalCompositeOperation=t;var r=i[t];r&&(e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.setBlendArg(r[0],r[1]))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"globalAlpha",{get:function(){return this.$globalAlpha},set:function(t){this.$globalAlpha=t,e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.setGlobalAlpha(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"lineWidth",{get:function(){return this.$lineWidth},set:function(t){this.$lineWidth=t,e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.setLineWidth(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"strokeStyle",{get:function(){return this.$strokeStyle},set:function(t){this.$strokeStyle=t,null!=t&&(-1!=t.indexOf("rgba")?t=this.$parseRGBA(t):-1!=t.indexOf("rgb")&&(t=this.$parseRGB(t)),e.$cmdManager.setContext(egret_native.Label),e.$cmdManager.setStrokeColor(parseInt(t.replace("#","0x")))),e.$cmdManager.setContext(this.$nativeContext);var i=e.$cmdManager.pushString(t);e.$cmdManager.setStrokeStyle(i)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"fillStyle",{get:function(){return this.$fillStyle},set:function(t){this.$fillStyle=t,null!=t&&(-1!=t.indexOf("rgba")?t=this.$parseRGBA(t):-1!=t.indexOf("rgb")&&(t=this.$parseRGB(t)),e.$cmdManager.setContext(egret_native.Label),e.$cmdManager.setTextColor(parseInt(t.replace("#","0x")))),e.$cmdManager.setContext(this.$nativeContext);var i=e.$cmdManager.pushString(t);e.$cmdManager.setFillStyle(i)},enumerable:!0,configurable:!0}),n.prototype.$fillColorStr=function(t){return t.length<2&&(t="0"+t),t},n.prototype.$parseRGBA=function(t){var e=t.indexOf("(");t=t.slice(e+1,t.length-1);var i=t.split(","),r=parseInt(255*parseFloat(i[3])).toString(16),n=parseInt(i[0]).toString(16),a=parseInt(i[1]).toString(16),o=parseInt(i[2]).toString(16);return t="#"+this.$fillColorStr(r)+this.$fillColorStr(n)+this.$fillColorStr(a)+this.$fillColorStr(o)},n.prototype.$parseRGB=function(t){var e=t.indexOf("(");t=t.slice(e+1,t.length-1);var i=t.split(","),r=parseInt(i[0]).toString(16),n=parseInt(i[1]).toString(16),a=parseInt(i[2]).toString(16);return t="#"+this.$fillColorStr(r)+this.$fillColorStr(n)+this.$fillColorStr(a)},Object.defineProperty(n.prototype,"font",{get:function(){return this.$font},set:function(e){this.$font=e;var i=e.split(" "),r=i[2];if(-1!=r.indexOf("px")&&(this.$fontSize=parseInt(r.replace("px",""))),t.useFontMapping){var n=void 0;if(n=4==i.length?i[3]:i.slice(3).join(" "),-1!=n.indexOf(", "))i=n.split(", ");else if(-1!=n.indexOf(",")){i=n.split(",");for(var a=i.length,o=0;a>o;o++){var s=i[o];if(t.fontMapping[s])return void(this.$fontFamily=t.fontMapping[s])}}else this.$fontFamily=t.fontMapping[n];this.$fontFamily||(this.$fontFamily="/system/fonts/DroidSansFallback.ttf")}else this.$fontFamily=t.TextField.default_fontFamily},enumerable:!0,configurable:!0}),n.prototype.arc=function(t,i,r,n,a,o){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.arc(t,i,r,n,a,o?1:0)},n.prototype.quadraticCurveTo=function(t,i,r,n){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.quadraticCurveTo(t,i,r,n)},n.prototype.lineTo=function(t,i){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.lineTo(t,i)},n.prototype.fill=function(t){e.$cmdManager.setContext(this.$nativeContext);var i=e.$cmdManager.pushString(t);e.$cmdManager.fill(i)},n.prototype.closePath=function(){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.closePath(),this.clipRectArray&&(this.$clipRectArray=this.clipRectArray,this.clipRectArray=null)},n.prototype.rect=function(t,i,r,n){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.rect(t,i,r,n),this.$clipRectArray.push({x:t,y:i,w:r,h:n})},n.prototype.moveTo=function(t,i){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.moveTo(t,i)},n.prototype.fillRect=function(t,i,r,n){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.fillRect(t,i,r,n)},n.prototype.bezierCurveTo=function(t,i,r,n,a,o){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.bezierCurveTo(t,i,r,n,a,o)},n.prototype.stroke=function(){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.stroke()},n.prototype.strokeRect=function(t,i,r,n){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.strokeRect(t,i,r,n)},n.prototype.beginPath=function(){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.beginPath(),this.clipRectArray=this.$clipRectArray.concat()},n.prototype.arcTo=function(t,e,i,r,n){this.$nativeContext.arcTo(t,e,i,r,n)},n.prototype.transform=function(t,e,i,r,n,a){this.$matrix.append(t,e,i,r,n,a),this.setTransformToNative()},n.prototype.translate=function(t,e){this.$matrix.translate(t,e),this.setTransformToNative()},n.prototype.scale=function(t,e){this.$matrix.scale(t,e),this.setTransformToNative()},n.prototype.rotate=function(t){this.$matrix.rotate(t),this.setTransformToNative()},n.prototype.restore=function(){if(this.$saveList.length){var t=this.$saveList.pop();for(var i in t)this[i]=t[i];this.setTransformToNative(),e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.restore(),this.clipRectArray=null}},n.prototype.save=function(){var i=new t.Matrix;i.copyFrom(this.$matrix),this.$saveList.push({lineWidth:this.$lineWidth,globalCompositeOperation:this.$globalCompositeOperation,globalAlpha:this.$globalAlpha,strokeStyle:this.$strokeStyle,fillStyle:this.$fillStyle,font:this.$font,$matrix:i,$clipRectArray:this.$clipRectArray.concat()}),e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.save()},n.prototype.clip=function(t){if(this.$clipRectArray.length>0){for(var i=[],r=0;r<this.$clipRectArray.length;r++){var n=this.$clipRectArray[r];i.push(n.x),i.push(n.y),i.push(n.w),i.push(n.h)}e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.pushRectStencils(i),this.$clipRectArray.length=0}},n.prototype.clearRect=function(t,i,r,n){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.clearRect(t,i,r,n)},n.prototype.setTransform=function(t,e,i,r,n,a){this.$matrix.setTo(t,e,i,r,n,a),this.setTransformToNative()},n.prototype.setTransformToNative=function(){var t=this.$matrix;e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.setTransform(t.a,t.b,t.c,t.d,t.tx,t.ty)},n.prototype.saveTransform=function(){this.savedMatrix.copyFrom(this.$matrix)},n.prototype.restoreTransform=function(){this.$matrix.copyFrom(this.savedMatrix)},n.prototype.createLinearGradient=function(t,e,i,r){return this.$nativeContext.createLinearGradient(t,e,i,r)},n.prototype.createRadialGradient=function(t,e,i,r,n,a){return this.$nativeContext.createRadialGradient(t,e,i,r,n,a)},n.prototype.fillText=function(t,i,r,n){e.$cmdManager.setContext(this.$nativeContext);var a=e.$cmdManager.pushString(this.$fontFamily),o=e.$cmdManager.pushString("");e.$cmdManager.createLabel(a,this.$fontSize,o,this.$hasStrokeText?this.$lineWidth:0),this.$hasStrokeText=!1;var s=e.$cmdManager.pushString(t);e.$cmdManager.drawText(s,i,r)},n.prototype.strokeText=function(t,e,i,r){this.$hasStrokeText=!0},n.prototype.measureText=function(t){e.$cmdManager.setContext(egret_native.Label);var i=e.$cmdManager.pushString(this.$fontFamily),r=e.$cmdManager.pushString("");return e.$cmdManager.createLabel(i,this.$fontSize,r,this.$hasStrokeText?this.$lineWidth:0),e.$cmdManager.flush(),{width:egret_native.Label.getTextSize(t)[0]}},n.prototype.drawImage=function(t,i,r,n,a,o,s,h,c){var u,l;if(t.$nativeCanvas?(u=t.$nativeCanvas,l=!0):(u=t,l=!1),u){3==arguments.length?(o=i,s=r,i=0,r=0,n=h=t.width,a=c=t.height):5==arguments.length?(o=i,s=r,h=n,c=a,i=0,r=0,n=t.width,a=t.height):(void 0==n&&(n=t.width),void 0==a&&(a=t.height),void 0==o&&(o=0),void 0==s&&(s=0),void 0==h&&(h=n),void 0==c&&(c=a));var p;l?p=u.___native_texture__p:(u._native_tex_loc||(u._native_tex_loc=u.___native_texture__p),p=u._native_tex_loc),e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.drawImage(p,i,r,n,a,o,s,h,c)}},n.prototype.drawMesh=function(t,i,r,n,a,o,s,h,c,u,l,p,f,d){var v;v=t.$nativeCanvas?t.$nativeCanvas:t,v&&(3==arguments.length?(o=i,s=r,i=0,r=0,n=h=t.width,a=c=t.height):5==arguments.length?(o=i,s=r,h=n,c=a,i=0,r=0,n=t.width,a=t.height):(n||(n=t.width),a||(a=t.height),o||(o=0),s||(s=0),h||(h=n),c||(c=a)),this.vertices=new Float32Array(f.length/2*5),this.indicesForMesh=new Uint32Array(d.length),this.cacheArrays(this.$matrix,1,i,r,n,a,o,s,h,c,u,l,p,f,d),e.$cmdManager.flush(),this.$nativeContext.drawMesh(v,this.vertices,this.indicesForMesh,this.vertices.length,this.indicesForMesh.length))
  2. },n.prototype.cacheArrays=function(t,e,i,r,n,a,o,s,h,c,u,l,p,f,d){var v=t,g=v.a,y=v.b,$=v.c,x=v.d,m=v.tx,C=v.ty;(0!=o||0!=s)&&v.append(1,0,0,1,o,s),(n/h!=1||a/c!=1)&&v.append(h/n,0,0,c/a,0,0);var S=v.a,T=v.b,b=v.c,_=v.d,w=v.tx,R=v.ty;if(v.a=g,v.b=y,v.c=$,v.d=x,v.tx=m,v.ty=C,f){var L=this.vertices,M=0,O=0,E=0,B=0,A=0,F=0,k=0;for(M=0,E=p.length;E>M;M+=2)O=5*M/2,F=f[M],k=f[M+1],B=p[M],A=p[M+1],L[O+0]=S*F+b*k+w,L[O+1]=T*F+_*k+R,L[O+2]=(i+B*n)/u,L[O+3]=(r+A*a)/l,L[O+4]=e;for(M=0;M<d.length;M++)this.indicesForMesh[M]=d[M]}else console.log("meshVertices not exist")},n.prototype.createPattern=function(t,e){return null},n.prototype.getImageData=function(t,i,r,n){e.$cmdManager.flush();var a;return t!=Math.floor(t)&&(t=Math.floor(t),r++),i!=Math.floor(i)&&(i=Math.floor(i),n++),a=this.$nativeContext.getPixels(t,i,r,n),a.pixelData&&(a.data=a.pixelData),a},n.prototype.setGlobalShader=function(t){e.$cmdManager.setContext(this.$nativeContext);var i;i=t?e.$cmdManager.pushString(t.$toJson()):e.$cmdManager.pushString(""),e.$cmdManager.setGlobalShader(i)},n}(t.HashObject);e.NativeCanvasRenderContext=r,__reflect(r.prototype,"egret.native.NativeCanvasRenderContext")}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i={"source-over":[1,771],lighter:[770,1],"destination-out":[0,771],"destination-in":[0,770]},r=function(e){function r(){var i=e.apply(this,arguments)||this;return i.$matrix=new t.Matrix,i.$nativeContext=null,i.$globalCompositeOperation="source-over",i.$globalAlpha=1,i.$lineWidth=0,i.$strokeStyle="#000000",i.$fillStyle="#000000",i.$font="normal normal 10px sans-serif",i.$fontSize=10,i.$fontFamily="",i.clipRectArray=null,i.$saveList=[],i.$clipRectArray=[],i.$clipRect=new t.Rectangle,i.$saveCount=0,i.$clipList=[],i.savedMatrix=new t.Matrix,i.$hasStrokeText=!1,i}return __extends(r,e),Object.defineProperty(r.prototype,"globalCompositeOperation",{get:function(){return this.$globalCompositeOperation},set:function(t){this.$globalCompositeOperation=t;var e=i[t];e&&this.$nativeContext.setBlendArg(e[0],e[1])},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"globalAlpha",{get:function(){return this.$globalAlpha},set:function(t){this.$globalAlpha=t,this.$nativeContext.setGlobalAlpha(t)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"lineWidth",{get:function(){return this.$lineWidth},set:function(t){this.$lineWidth=t,this.$nativeContext.lineWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"strokeStyle",{get:function(){return this.$strokeStyle},set:function(t){this.$strokeStyle=t,null!=t&&(-1!=t.indexOf("rgba")?t=this.$parseRGBA(t):-1!=t.indexOf("rgb")&&(t=this.$parseRGB(t)),egret_native.Label.setStrokeColor(parseInt(t.replace("#","0x")))),this.$nativeContext.strokeStyle=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"fillStyle",{get:function(){return this.$fillStyle},set:function(t){this.$fillStyle=t,null!=t&&(-1!=t.indexOf("rgba")?t=this.$parseRGBA(t):-1!=t.indexOf("rgb")&&(t=this.$parseRGB(t)),egret_native.Label.setTextColor(parseInt(t.replace("#","0x")))),this.$nativeContext.fillStyle=t},enumerable:!0,configurable:!0}),r.prototype.$fillColorStr=function(t){return t.length<2&&(t="0"+t),t},r.prototype.$parseRGBA=function(t){var e=t.indexOf("(");t=t.slice(e+1,t.length-1);var i=t.split(","),r=parseInt(255*parseFloat(i[3])).toString(16),n=parseInt(i[0]).toString(16),a=parseInt(i[1]).toString(16),o=parseInt(i[2]).toString(16);return t="#"+this.$fillColorStr(r)+this.$fillColorStr(n)+this.$fillColorStr(a)+this.$fillColorStr(o)},r.prototype.$parseRGB=function(t){var e=t.indexOf("(");t=t.slice(e+1,t.length-1);var i=t.split(","),r=parseInt(i[0]).toString(16),n=parseInt(i[1]).toString(16),a=parseInt(i[2]).toString(16);return t="#"+this.$fillColorStr(r)+this.$fillColorStr(n)+this.$fillColorStr(a)},Object.defineProperty(r.prototype,"font",{get:function(){return this.$font},set:function(e){this.$font=e;var i=e.split(" "),r=i[2];if(-1!=r.indexOf("px")&&(this.$fontSize=parseInt(r.replace("px",""))),t.useFontMapping){var n=void 0;if(n=4==i.length?i[3]:i.slice(3).join(" "),-1!=n.indexOf(", "))i=n.split(", ");else if(-1!=n.indexOf(",")){i=n.split(",");for(var a=i.length,o=0;a>o;o++){var s=i[o];if(t.fontMapping[s])return void(this.$fontFamily=t.fontMapping[s])}}else this.$fontFamily=t.fontMapping[n];this.$fontFamily||(this.$fontFamily="/system/fonts/DroidSansFallback.ttf")}else this.$fontFamily=t.TextField.default_fontFamily},enumerable:!0,configurable:!0}),r.prototype.arc=function(t,e,i,r,n,a){this.$nativeContext.arc(t,e,i,r,n,a)},r.prototype.quadraticCurveTo=function(t,e,i,r){this.$nativeContext.quadraticCurveTo(t,e,i,r)},r.prototype.lineTo=function(t,e){this.$nativeContext.lineTo(t,e)},r.prototype.fill=function(t){this.$nativeContext.fill(t)},r.prototype.closePath=function(){this.$nativeContext.closePath(),this.clipRectArray&&(this.$clipRectArray=this.clipRectArray,this.clipRectArray=null)},r.prototype.rect=function(t,e,i,r){this.$nativeContext.rect(t,e,i,r),this.$clipRectArray.push({x:t,y:e,w:i,h:r})},r.prototype.moveTo=function(t,e){this.$nativeContext.moveTo(t,e)},r.prototype.fillRect=function(t,e,i,r){this.$nativeContext.fillRect(t,e,i,r)},r.prototype.bezierCurveTo=function(t,e,i,r,n,a){this.$nativeContext.bezierCurveTo(t,e,i,r,n,a)},r.prototype.stroke=function(){this.$nativeContext.stroke()},r.prototype.strokeRect=function(t,e,i,r){this.$nativeContext.strokeRect(t,e,i,r)},r.prototype.beginPath=function(){this.$nativeContext.beginPath(),this.clipRectArray=this.$clipRectArray.concat()},r.prototype.arcTo=function(t,e,i,r,n){this.$nativeContext.arcTo(t,e,i,r,n)},r.prototype.transform=function(t,e,i,r,n,a){this.$matrix.append(t,e,i,r,n,a),this.setTransformToNative()},r.prototype.translate=function(t,e){this.$matrix.translate(t,e),this.setTransformToNative()},r.prototype.scale=function(t,e){this.$matrix.scale(t,e),this.setTransformToNative()},r.prototype.rotate=function(t){this.$matrix.rotate(t),this.setTransformToNative()},r.prototype.restore=function(){if(this.$saveList.length){var t=this.$saveList.pop();for(var e in t)this[e]=t[e];this.setTransformToNative(),this.$nativeContext.restore(),this.clipRectArray=null}},r.prototype.save=function(){var e=new t.Matrix;e.copyFrom(this.$matrix),this.$saveList.push({lineWidth:this.$lineWidth,globalCompositeOperation:this.$globalCompositeOperation,globalAlpha:this.$globalAlpha,strokeStyle:this.$strokeStyle,fillStyle:this.$fillStyle,font:this.$font,$matrix:e,$clipRectArray:this.$clipRectArray.concat()}),this.$nativeContext.save()},r.prototype.clip=function(t){if(this.$clipRectArray.length>0){for(var e=[],i=0;i<this.$clipRectArray.length;i++){var r=this.$clipRectArray[i];e.push(r.x),e.push(r.y),e.push(r.w),e.push(r.h)}this.$nativeContext.pushRectStencils(e),this.$clipRectArray.length=0}},r.prototype.clearRect=function(t,e,i,r){this.$nativeContext.clearRect(t,e,i,r)},r.prototype.setTransform=function(t,e,i,r,n,a){this.$matrix.setTo(t,e,i,r,n,a),this.setTransformToNative()},r.prototype.setTransformToNative=function(){var t=this.$matrix;this.$nativeContext.setTransform(t.a,t.b,t.c,t.d,t.tx,t.ty)},r.prototype.saveTransform=function(){this.savedMatrix.copyFrom(this.$matrix)},r.prototype.restoreTransform=function(){this.$matrix.copyFrom(this.savedMatrix)},r.prototype.createLinearGradient=function(t,e,i,r){return this.$nativeContext.createLinearGradient(t,e,i,r)},r.prototype.createRadialGradient=function(t,e,i,r,n,a){return this.$nativeContext.createRadialGradient(t,e,i,r,n,a)},r.prototype.fillText=function(t,e,i,r){this.$nativeContext.createLabel(this.$fontFamily,this.$fontSize,"",this.$hasStrokeText?this.$lineWidth:0),this.$hasStrokeText=!1,this.$nativeContext.drawText(t,e,i)},r.prototype.strokeText=function(t,e,i,r){this.$hasStrokeText=!0},r.prototype.measureText=function(t){return egret_native.Label.createLabel(this.$fontFamily,this.$fontSize,"",this.$hasStrokeText?this.$lineWidth:0),{width:egret_native.Label.getTextSize(t)[0]}},r.prototype.drawImage=function(t,e,i,r,n,a,o,s,h){var c,u;t.$nativeCanvas?(c=t.$nativeCanvas,u=!0):(c=t,u=!1),c&&(3==arguments.length?(a=e,o=i,e=0,i=0,r=s=t.width,n=h=t.height):5==arguments.length?(a=e,o=i,s=r,h=n,e=0,i=0,r=t.width,n=t.height):(void 0==r&&(r=t.width),void 0==n&&(n=t.height),void 0==a&&(a=0),void 0==o&&(o=0),void 0==s&&(s=r),void 0==h&&(h=n)),this.$nativeContext.drawImage(c,e,i,r,n,a,o,s,h))},r.prototype.drawMesh=function(t,e,i,r,n,a,o,s,h,c,u,l,p,f){var d;d=t.$nativeCanvas?t.$nativeCanvas:t,d&&(3==arguments.length?(a=e,o=i,e=0,i=0,r=s=t.width,n=h=t.height):5==arguments.length?(a=e,o=i,s=r,h=n,e=0,i=0,r=t.width,n=t.height):(r||(r=t.width),n||(n=t.height),a||(a=0),o||(o=0),s||(s=r),h||(h=n)),this.vertices=new Float32Array(p.length/2*5),this.indicesForMesh=new Uint32Array(f.length),this.cacheArrays(this.$matrix,1,e,i,r,n,a,o,s,h,c,u,l,p,f),this.$nativeContext.drawMesh(d,this.vertices,this.indicesForMesh,this.vertices.length,this.indicesForMesh.length))},r.prototype.cacheArrays=function(t,e,i,r,n,a,o,s,h,c,u,l,p,f,d){var v=t,g=v.a,y=v.b,$=v.c,x=v.d,m=v.tx,C=v.ty;(0!=o||0!=s)&&v.append(1,0,0,1,o,s),(n/h!=1||a/c!=1)&&v.append(h/n,0,0,c/a,0,0);var S=v.a,T=v.b,b=v.c,_=v.d,w=v.tx,R=v.ty;if(v.a=g,v.b=y,v.c=$,v.d=x,v.tx=m,v.ty=C,f){var L=this.vertices,M=0,O=0,E=0,B=0,A=0,F=0,k=0;for(M=0,E=p.length;E>M;M+=2)O=5*M/2,F=f[M],k=f[M+1],B=p[M],A=p[M+1],L[O+0]=S*F+b*k+w,L[O+1]=T*F+_*k+R,L[O+2]=(i+B*n)/u,L[O+3]=(r+A*a)/l,L[O+4]=e;for(M=0;M<d.length;M++)this.indicesForMesh[M]=d[M]}else console.log("meshVertices not exist")},r.prototype.createPattern=function(t,e){return null},r.prototype.getImageData=function(t,e,i,r){var n;return t!=Math.floor(t)&&(t=Math.floor(t),i++),e!=Math.floor(e)&&(e=Math.floor(e),r++),n=this.$nativeContext.getPixels(t,e,i,r),n.pixelData&&(n.data=n.pixelData),n},r.prototype.setGlobalShader=function(t){egret_native.Graphics.setGlobalShader(t)},r}(t.HashObject);e.OldNativeCanvasRenderContext=r,__reflect(r.prototype,"egret.native.OldNativeCanvasRenderContext")}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(t){function i(){var i=t.call(this)||this;return i.$width=0,i.$height=0,i.renderContext=e.$supportCmdBatch?new e.NativeCanvasRenderContext:new e.OldNativeCanvasRenderContext,i}return __extends(i,t),i.prototype.toDataURL=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return this.$nativeCanvas?this.$nativeCanvas.toDataURL.apply(this.$nativeCanvas,arguments):null},i.prototype.saveToFile=function(t,e){this.$nativeCanvas&&this.$nativeCanvas.saveToFile&&this.$nativeCanvas.saveToFile(t,e)},Object.defineProperty(i.prototype,"width",{get:function(){return this.$width},set:function(t){if(t>0)if(this.$width=t,this.$nativeCanvas)this.$nativeCanvas.width=t;else{this.$nativeCanvas=new egret_native.Canvas(t,1),this.$isRoot&&egret_native.setScreenCanvas(this.$nativeCanvas);var i=this.$nativeCanvas.getContext("2d");e.$supportCmdBatch?(e.$cmdManager.setContext(i),e.$cmdManager.clearScreen(0,0,0,0)):i.clearScreen(0,0,0,0),this.renderContext.$nativeContext=i}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.$height},set:function(t){if(t>0)if(this.$height=t,this.$nativeCanvas)this.$nativeCanvas.height=t;else{this.$nativeCanvas=new egret_native.Canvas(1,t),this.$isRoot&&egret_native.setScreenCanvas(this.$nativeCanvas);var i=this.$nativeCanvas.getContext("2d");e.$supportCmdBatch?(e.$cmdManager.setContext(i),e.$cmdManager.clearScreen(0,0,0,0)):i.clearScreen(0,0,0,0),this.renderContext.$nativeContext=i}},enumerable:!0,configurable:!0}),i.prototype.getContext=function(t){return this.renderContext},i}(t.HashObject);e.NativeCanvas=i,__reflect(i.prototype,"egret.native.NativeCanvas")}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){function e(e,i){var r=new t.NativeCanvas;return isNaN(e)||isNaN(i)||(r.width=e,r.height=i),r}var i,r=function(){function r(t,i){this.surface=e(t,i),this.context=this.surface.getContext("2d")}return Object.defineProperty(r.prototype,"width",{get:function(){return this.surface.width},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.surface.height},enumerable:!0,configurable:!0}),r.prototype.resize=function(e,i,r){t.$supportCmdBatch&&t.$cmdManager.flush();var n=this.surface;n.width=e,n.height=i,this.clear()},r.prototype.resizeTo=function(r,n,a,o){t.$supportCmdBatch&&t.$cmdManager.flush(),i||(i=e());var s=(this.context,this.surface),h=i,c=h.getContext("2d");i=s,this.context=c,this.surface=h,h.width=Math.max(r,1),h.height=Math.max(n,1),c.setTransform(1,0,0,1,0,0),c.drawImage(s,a,o),s.height=1,s.width=1},r.prototype.setDirtyRegionPolicy=function(t){},r.prototype.beginClip=function(t,e,i){e=+e||0,i=+i||0;var r=this.context;r.save(),r.beginPath(),r.setTransform(1,0,0,1,e,i);for(var n=t.length,a=0;n>a;a++){var o=t[a];r.clearRect(o.minX,o.minY,o.width,o.height),r.rect(o.minX,o.minY,o.width,o.height)}r.clip()},r.prototype.endClip=function(){this.context.restore()},r.prototype.getPixels=function(t,e,i,r){return void 0===i&&(i=1),void 0===r&&(r=1),this.context.getImageData(t,e,i,r).data},r.prototype.toDataURL=function(t,e){return this.surface.toDataURL(t,e)},r.prototype.clear=function(){var t=this.surface.width,e=this.surface.height;t>0&&e>0&&(this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,t,e))},r.prototype.destroy=function(){this.surface.width=this.surface.height=1},r}();t.NativeCanvasRenderBuffer=r,__reflect(r.prototype,"egret.native.NativeCanvasRenderBuffer",["egret.sys.RenderBuffer"])}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){function i(e,i){var r=t.sys.canvasHitTestBuffer,n=e.$getTextureWidth(),a=e.$getTextureHeight();null==i&&(i=t.$TempRectangle,i.x=0,i.y=0,i.width=n,i.height=a),i.x=Math.min(i.x,n-1),i.y=Math.min(i.y,a-1),i.width=Math.min(i.width,n-i.x),i.height=Math.min(i.height,a-i.y);var o=i.width,s=i.height,h=r.surface;r.resize(o,s);var c=e,u=Math.round(c._offsetX),l=Math.round(c._offsetY),p=c._bitmapWidth,f=c._bitmapHeight;return r.context.drawImage(c._bitmapData.source,c._bitmapX+i.x/t.$TextureScaleFactor,c._bitmapY+i.y/t.$TextureScaleFactor,p*i.width/n,f*i.height/a,u,l,i.width,i.height),h}function r(e,r){try{var n=i(this,r),a=n.toDataURL(e);return a}catch(o){return t.$error(1033),null}}function n(e,r,n){try{var a=i(this,n);a.saveToFile(e,r)}catch(o){t.$error(1033)}}function a(e,i){return t.$error(1035),null}function o(e,i,r,n){return t.$error(1035),null}t.Texture.prototype.toDataURL=r,t.Texture.prototype.saveToFile=n,t.Texture.prototype.getPixel32=a,t.Texture.prototype.getPixels=o}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(i){function r(){var t=i.call(this)||this;return t.init(r.option),t}return __extends(r,i),r.prototype.init=function(i){i.showPaintRect=!1;var r=new t.Stage;r.$screen=this,r.$scaleMode=i.scaleMode,r.$maxTouches=i.maxTouches,r.textureScaleFactor=i.textureScaleFactor,r.frameRate=i.frameRate,t["native"].$supportCanvas||r.addEventListener(t.Event.ENTER_FRAME,function(){e.$currentSurface&&e.$currentSurface.end()},this);var n=new t.sys.RenderBuffer(void 0,void 0,!0),a=n.surface;a.$isRoot=!0;var o=new e.NativeTouchHandler(r),s=new t.sys.Player(n,r,i.entryClassName);if(new e.NativeHideHandler(r),s.showPaintRect(i.showPaintRect),i.showFPS||i.showLog){for(var h=i.fpsStyles||"",c=h.split(","),u={},l=0;l<c.length;l++){var p=c[l].split(":");u[p[0]]=p[1]}i.fpsStyles=u,s.displayFPS(i.showFPS,i.showLog,i.logFilter,i.fpsStyles)}this.playerOption=i,this.$stage=r,this.player=s,this.nativeTouch=o,this.updateScreenSize(),this.updateMaxTouches(),s.start()},r.prototype.updateScreenSize=function(){var e=this.playerOption,i=egret_native.EGTView.getFrameWidth(),r=egret_native.EGTView.getFrameHeight();t.Capabilities.$boundingClientWidth=i,t.Capabilities.$boundingClientHeight=r;var n=t.sys.screenAdapter.calculateStageSize(this.$stage.$scaleMode,i,r,e.contentWidth,e.contentHeight),a=n.stageWidth,o=n.stageHeight,s=n.displayWidth,h=n.displayHeight,c=(r-h)/2,u=(i-s)/2;egret_native.EGTView.setVisibleRect(u,c,s,h),egret_native.EGTView.setDesignSize(a,o),this.player.updateStageSize(a,o)},r.prototype.setContentSize=function(t,e){var i=this.playerOption;i.contentWidth=t,i.contentHeight=e,this.updateScreenSize()},r.prototype.updateMaxTouches=function(){this.nativeTouch.$updateMaxTouches()},r}(t.HashObject);e.NativePlayer=i,__reflect(i.prototype,"egret.native.NativePlayer",["egret.sys.Screen"])}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){function i(i){if(!s){s=!0,i||(i={}),r(i.renderMode);var n="zh_CN";n in t.$locale_strings&&(t.$language=n);try{t.Capabilities.$setNativeCapabilities(egret_native.getVersion())}catch(a){}var o=t.sys.$ticker,c=e.$supportCmdBatch?function(){o.update(),e.$cmdManager.flush()}:function(){o.update()};egret_native.executeMainLoop(c,o),t.sys.screenAdapter||(i.screenAdapter?t.sys.screenAdapter=i.screenAdapter:t.sys.screenAdapter=new t.sys.DefaultScreenAdapter);var u=new e.NativePlayer;h.push(u),t.sys.customHitTestBuffer=new e.NativeCanvasRenderBuffer(3,3),t.sys.canvasHitTestBuffer=t.sys.customHitTestBuffer,e.$supportCanvas||(u.$stage.dirtyRegionPolicy=t.DirtyRegionPolicy.OFF,t.sys.DisplayList.prototype.setDirtyRegionPolicy=function(){})}}function r(i){e.$supportCanvas?(t.sys.RenderBuffer=e.NativeCanvasRenderBuffer,t.sys.CanvasRenderBuffer=e.NativeCanvasRenderBuffer):(t.sys.RenderBuffer=e.NativeRenderTextureRenderBuffer,t.sys.CanvasRenderBuffer=e.NativeRenderTextureRenderBuffer),t.sys.systemRenderer=new t.CanvasRenderer,t.sys.canvasRenderer=t.sys.systemRenderer,t.Capabilities.$renderMode="canvas"}function n(){for(var t=h.length,e=0;t>e;e++)h[e].updateScreenSize()}function a(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i]);return e}e.$supportCanvas=egret_native.Canvas?!0:!1,e.$supportCmdBatch=egret_native.sendToC?!0:!1;var o=function(){function t(){this.maxArrayBufferLen=8e4,this.arrayBuffer=new ArrayBuffer(4*this.maxArrayBufferLen),this.uint32View=new Uint32Array(this.arrayBuffer),this.float32View=new Float32Array(this.arrayBuffer),this.arrayBufferLen=0,this.strArray=[]}return t.prototype.flush=function(){egret_native.sendToC(this.float32View,this.arrayBufferLen,this.strArray),this.clear()},t.prototype.setContext=function(t){if(this.context!=t){this.arrayBufferLen+3>this.maxArrayBufferLen&&this.flush(),this.context=t;var e=this.uint32View,i=this.arrayBufferLen;e[i++]=1e3;var r=t.___native_texture__p;e[i++]=r/4294967296>>>0,e[i++]=(4294967295&r)>>>0,this.arrayBufferLen=i}},t.prototype.clear=function(){this.arrayBufferLen=0,this.strArray.length=0},t.prototype.pushString=function(t){var e=this.strArray,i=e.length;return e[i]=t,i},t.prototype.clearScreen=function(t,e,i,r){this.arrayBufferLen+5>this.maxArrayBufferLen&&this.flush();var n=this.uint32View,a=this.arrayBufferLen;n[a++]=100,n[a++]=t,n[a++]=e,n[a++]=i,n[a++]=r,this.arrayBufferLen=a},t.prototype.drawImage=function(t,e,i,r,n,a,o,s,h){this.arrayBufferLen+11>this.maxArrayBufferLen&&this.flush();var c=this.uint32View,u=this.float32View,l=this.arrayBufferLen;c[l++]=101,c[l++]=t/4294967296>>>0,c[l++]=(4294967295&t)>>>0,u[l++]=e,u[l++]=i,u[l++]=r,u[l++]=n,u[l++]=a,u[l++]=o,u[l++]=s,u[l++]=h,this.arrayBufferLen=l},t.prototype.setTransform=function(t,e,i,r,n,a){this.arrayBufferLen+7>this.maxArrayBufferLen&&this.flush();var o=this.uint32View,s=this.float32View,h=this.arrayBufferLen;o[h++]=103,s[h++]=t,s[h++]=e,s[h++]=i,s[h++]=r,s[h++]=n,s[h++]=a,this.arrayBufferLen=h},t.prototype.setGlobalAlpha=function(t){this.arrayBufferLen+2>this.maxArrayBufferLen&&this.flush();var e=this.uint32View,i=this.float32View,r=this.arrayBufferLen;e[r++]=106,i[r++]=t,this.arrayBufferLen=r},t.prototype.pushRectStencils=function(t){var e=t.length;this.arrayBufferLen+e+1>this.maxArrayBufferLen&&this.flush();var i=this.uint32View,r=this.float32View,n=this.arrayBufferLen;i[n++]=113,i[n++]=e;for(var a=0;e>a;a++)r[n++]=t[a];this.arrayBufferLen=n},t.prototype.restore=function(){this.arrayBufferLen+1>this.maxArrayBufferLen&&this.flush(),this.uint32View[this.arrayBufferLen++]=116},t.prototype.save=function(){this.arrayBufferLen+1>this.maxArrayBufferLen&&this.flush(),this.uint32View[this.arrayBufferLen++]=117},t.prototype.setBlendArg=function(t,e){this.arrayBufferLen+3>this.maxArrayBufferLen&&this.flush();var i=this.uint32View,r=this.float32View,n=this.arrayBufferLen;i[n++]=120,r[n++]=t,r[n++]=e,this.arrayBufferLen=n},t.prototype.beginPath=function(){this.arrayBufferLen+1>this.maxArrayBufferLen&&this.flush(),this.uint32View[this.arrayBufferLen++]=204},t.prototype.closePath=function(){this.arrayBufferLen+1>this.maxArrayBufferLen&&this.flush(),this.uint32View[this.arrayBufferLen++]=205},t.prototype.rect=function(t,e,i,r){this.arrayBufferLen+5>this.maxArrayBufferLen&&this.flush();var n=this.uint32View,a=this.float32View,o=this.arrayBufferLen;n[o++]=210,a[o++]=t,a[o++]=e,a[o++]=i,a[o++]=r,this.arrayBufferLen=o},t.prototype.clearRect=function(t,e,i,r){this.arrayBufferLen+5>this.maxArrayBufferLen&&this.flush();var n=this.uint32View,a=this.float32View,o=this.arrayBufferLen;n[o++]=214,a[o++]=t,a[o++]=e,a[o++]=i,a[o++]=r,this.arrayBufferLen=o},t.prototype.createLabel=function(t,e,i,r){this.arrayBufferLen+5>this.maxArrayBufferLen&&this.flush();var n=this.uint32View,a=this.float32View,o=this.arrayBufferLen;n[o++]=300,n[o++]=t,a[o++]=e,n[o++]=i,a[o++]=r,this.arrayBufferLen=o},t.prototype.drawText=function(t,e,i){this.arrayBufferLen+4>this.maxArrayBufferLen&&this.flush();var r=this.uint32View,n=this.float32View,a=this.arrayBufferLen;r[a++]=301,r[a++]=t,n[a++]=e,n[a++]=i,this.arrayBufferLen=a},t.prototype.setTextColor=function(t){this.arrayBufferLen+2>this.maxArrayBufferLen&&this.flush();var e=this.uint32View,i=this.arrayBufferLen;e[i++]=302,e[i++]=t,this.arrayBufferLen=i},t.prototype.setStrokeColor=function(t){this.arrayBufferLen+2>this.maxArrayBufferLen&&this.flush();var e=this.uint32View,i=this.arrayBufferLen;e[i++]=303,e[i++]=t,this.arrayBufferLen=i},t.prototype.setFillStyle=function(t){this.arrayBufferLen+2>this.maxArrayBufferLen&&this.flush();var e=this.uint32View,i=this.arrayBufferLen;e[i++]=1200,e[i++]=t,this.arrayBufferLen=i},t.prototype.setStrokeStyle=function(t){this.arrayBufferLen+2>this.maxArrayBufferLen&&this.flush();var e=this.uint32View,i=this.arrayBufferLen;e[i++]=1201,e[i++]=t,this.arrayBufferLen=i},t.prototype.setLineWidth=function(t){this.arrayBufferLen+2>this.maxArrayBufferLen&&this.flush();var e=this.uint32View,i=this.float32View,r=this.arrayBufferLen;e[r++]=1202,i[r++]=t,this.arrayBufferLen=r},t.prototype.moveTo=function(t,e){this.arrayBufferLen+3>this.maxArrayBufferLen&&this.flush();var i=this.uint32View,r=this.float32View,n=this.arrayBufferLen;i[n++]=207,r[n++]=t,r[n++]=e,this.arrayBufferLen=n},t.prototype.lineTo=function(t,e){this.arrayBufferLen+3>this.maxArrayBufferLen&&this.flush();var i=this.uint32View,r=this.float32View,n=this.arrayBufferLen;i[n++]=208,r[n++]=t,r[n++]=e,this.arrayBufferLen=n},t.prototype.fill=function(t){this.arrayBufferLen+2>this.maxArrayBufferLen&&this.flush();var e=this.uint32View,i=this.arrayBufferLen;e[i++]=203,e[i++]=t,this.arrayBufferLen=i},t.prototype.pushClip=function(t,e,i,r){this.arrayBufferLen+5>this.maxArrayBufferLen&&this.flush();var n=this.uint32View,a=this.float32View,o=this.arrayBufferLen;n[o++]=107,a[o++]=t,a[o++]=e,a[o++]=i,a[o++]=r,this.arrayBufferLen=o},t.prototype.popClip=function(){this.arrayBufferLen+1>this.maxArrayBufferLen&&this.flush(),this.uint32View[this.arrayBufferLen++]=108},t.prototype.stroke=function(){this.arrayBufferLen+1>this.maxArrayBufferLen&&this.flush(),this.uint32View[this.arrayBufferLen++]=206},t.prototype.arc=function(t,e,i,r,n,a){this.arrayBufferLen+7>this.maxArrayBufferLen&&this.flush();var o=this.uint32View,s=this.float32View,h=this.arrayBufferLen;o[h++]=209,s[h++]=t,s[h++]=e,s[h++]=i,s[h++]=r,s[h++]=n,o[h++]=a,this.arrayBufferLen=h},t.prototype.quadraticCurveTo=function(t,e,i,r){this.arrayBufferLen+5>this.maxArrayBufferLen&&this.flush();var n=this.uint32View,a=this.float32View,o=this.arrayBufferLen;n[o++]=211,a[o++]=t,a[o++]=e,a[o++]=i,a[o++]=r,this.arrayBufferLen=o},t.prototype.fillRect=function(t,e,i,r){this.arrayBufferLen+5>this.maxArrayBufferLen&&this.flush();var n=this.uint32View,a=this.float32View,o=this.arrayBufferLen;n[o++]=212,a[o++]=t,a[o++]=e,a[o++]=i,a[o++]=r,this.arrayBufferLen=o},t.prototype.strokeRect=function(t,e,i,r){this.arrayBufferLen+5>this.maxArrayBufferLen&&this.flush();var n=this.uint32View,a=this.float32View,o=this.arrayBufferLen;n[o++]=213,a[o++]=t,a[o++]=e,a[o++]=i,a[o++]=r,this.arrayBufferLen=o},t.prototype.bezierCurveTo=function(t,e,i,r,n,a){this.arrayBufferLen+7>this.maxArrayBufferLen&&this.flush();var o=this.uint32View,s=this.float32View,h=this.arrayBufferLen;o[h++]=215,s[h++]=t,s[h++]=e,s[h++]=i,s[h++]=r,s[h++]=n,s[h++]=a,this.arrayBufferLen=h},t.prototype.setGlobalShader=function(t){this.arrayBufferLen+2>this.maxArrayBufferLen&&this.flush();var e=this.uint32View,i=this.arrayBufferLen;e[i++]=111,e[i++]=t,this.arrayBufferLen=i},t}();__reflect(o.prototype,"CmdManager"),e.$cmdManager=new o;var s=!1,h=[];t.warn=function(){console.warn.apply(console,a(arguments))},t.error=function(){console.error.apply(console,a(arguments))},t.assert=function(){console.assert.apply(console,a(arguments))},t.log=function(){for(var e=arguments.length,i="",r=0;e>r;r++)i+=arguments[r]+" ";t.sys.$logToFPS(i),console.log.apply(console,a(arguments))},t.runEgret=i,t.updateAllScreens=n}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(e){function i(i,r,n,a,o){var s=e.call(this)||this;return s.arrFps=[],s.arrLog=[],(r||n)&&(s.panelX=void 0===o.x?0:parseInt(o.x),s.panelY=void 0===o.y?0:parseInt(o.y),s._stage=i,s.showFps=r,s.showLog=n,s.fontColor=void 0===o.textColor?16777215:parseInt(o.textColor),s.fontSize=void 0===o.size?24:parseInt(o.size),s.bgAlpha=o.bgAlpha||.9,s.shape=new t.Shape,s.addChild(s.shape),r&&s.addFps(),n&&s.addLog()),s}return __extends(i,e),i.prototype.addFps=function(){var e=new t.TextField;e.x=e.y=4,this.textFps=e,this.addChild(e),e.lineSpacing=2,e.size=this.fontSize,e.textColor=this.fontColor,e.textFlow=[{text:"0 FPS "+t.Capabilities.renderMode+"\n"},{text:"Draw: 0\nDirty: 0%\n"},{text:"Cost: "},{text:"0 ",style:{textColor:1638142}},{text:"0 ",style:{textColor:16776960}},{text:"0 ",style:{textColor:16711680}}]},i.prototype.addLog=function(){var e=new t.TextField;e.size=this.fontSize,e.textColor=this.fontColor,e.x=4,this.addChild(e),this.textLog=e},i.prototype.update=function(e){this.arrFps.push(e.fps);var i=0,r=this.arrFps.length;r>101&&(r=101,this.arrFps.shift());for(var n=this.arrFps[0],a=this.arrFps[0],o=0;r>o;o++){var s=this.arrFps[o];i+=s,n>s?n=s:s>a&&(a=s)}this.textFps.textFlow=[{text:e.fps+" FPS "+t.Capabilities.renderMode+"\n"},{text:"min"+n+" max"+a+" avg"+Math.floor(i/r)+"\n"},{text:"Draw: "+e.draw+"\nDirty: "+e.dirty+"%\n"},{text:"Cost: "},{text:e.costTicker+" ",style:{textColor:1638142}},{text:e.costDirty+" ",style:{textColor:16776960}},{text:e.costRender+" ",style:{textColor:16711680}}],this.updateLayout()},i.prototype.updateInfo=function(t){var e=0;if(this.showFps&&(e=this.textFps.height,this.textLog.y=e+4),this.arrLog.push(t),this.textLog.text=this.arrLog.join("\n"),this._stage.stageHeight>0)for(this.textLog.textWidth>this._stage.stageWidth-20-this.panelX&&(this.textLog.width=this._stage.stageWidth-20-this.panelX);this.textLog.textHeight>this._stage.stageHeight-e-20-this.panelY;)this.arrLog.shift(),this.textLog.text=this.arrLog.join("\n");this.updateLayout()},i.prototype.updateLayout=function(){if(t.Capabilities.runtimeType!=t.RuntimeType.NATIVE){var e=this.shape.$graphics;e.clear(),e.beginFill(0,this.bgAlpha),e.drawRect(0,0,this.width+8,this.height+8),e.endFill()}},i}(t.Sprite);e.NativeFps=i,__reflect(i.prototype,"egret.native.NativeFps",["egret.FPSDisplay"]),t.FPSDisplay=i}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){function i(t){egret_native.loglevel(t)}Object.defineProperty(t.Logger,"logLevel",{set:i,enumerable:!0,configurable:!0})}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){function i(e){var i=JSON.parse(e),n=i.functionName,a=r[n];if(a){var o=i.value;a.call(null,o)}else t.$warn(1050,n)}var r={},n=function(){function t(){}return t.call=function(t,e){var i={};i.functionName=t,i.value=e,egret_native.sendInfoToPlugin(JSON.stringify(i))},t.addCallback=function(t,e){r[t]=e},t}();e.NativeExternalInterface=n,__reflect(n.prototype,"egret.native.NativeExternalInterface",["egret.ExternalInterface"]),t.ExternalInterface=n,egret_native.receivedPluginInfo=i}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(i){function r(){var t=i.call(this)||this;return t.loaded=!1,t}return __extends(r,i),Object.defineProperty(r.prototype,"length",{get:function(){if(this.originAudio)return this.originAudio.duration;throw new Error("sound not loaded!")},enumerable:!0,configurable:!0}),r.prototype.load=function(e){function i(){var i=t.PromiseObject.create();i.onSuccessFunc=n,i.onErrorFunc=o,egret_native.download(e,e,i)}function n(){c.load(),r.$recycle(e,c)}function a(){s(),h.loaded=!0,h.dispatchEventWith(t.Event.COMPLETE)}function o(){s(),h.dispatchEventWith(t.IOErrorEvent.IO_ERROR)}function s(){c.removeEventListener("canplaythrough",a),c.removeEventListener("error",o)}var h=this;this.url=e,e||t.$error(3002);var c=new Audio(e);c.addEventListener("canplaythrough",a),c.addEventListener("error",o),this.originAudio=c,egret_native.isFileExists(e)?n():i()},r.prototype.play=function(i,n){i=+i||0,n=+n||0,0==this.loaded&&t.$error(1049);var a=r.$pop(this.url);null==a&&(a=new Audio(this.url)),a.autoplay=!0;var o=new e.NativeSoundChannel(a);return o.$url=this.url,o.$loops=n,o.$startTime=i,o.$play(),t.sys.$pushSoundChannel(o),o},r.prototype.close=function(){0==this.loaded&&this.originAudio&&(this.originAudio.src=""),this.originAudio&&(this.originAudio=null),r.$clear(this.url)},r.$clear=function(t){var e=r.audios[t];e&&(e.length=0)},r.$pop=function(t){var e=r.audios[t];return e&&e.length>0?e.pop():null},r.$recycle=function(t,e){var i=r.audios[t];null==r.audios[t]&&(i=r.audios[t]=[]),i.push(e)},r}(t.EventDispatcher);i.MUSIC="music",i.EFFECT="effect",i.audios={},e.NativeSound=i,__reflect(i.prototype,"egret.native.NativeSound",["egret.Sound"]),__global.Audio&&(t.Sound=i)}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(i){function r(e){var r=i.call(this)||this;return r.$startTime=0,r.audio=null,r.isStopped=!1,r.onPlayEnd=function(){return 1==r.$loops?(r.stop(),void r.dispatchEventWith(t.Event.SOUND_COMPLETE)):(r.$loops>0&&r.$loops--,void r.$play())},r.$volume=1,e.addEventListener("ended",r.onPlayEnd),r.audio=e,r}return __extends(r,i),r.prototype.$play=function(){if(this.isStopped)return void t.$error(1036);try{this.audio.currentTime=this.$startTime}catch(e){}finally{this.audio.volume=this.$volume,this.audio.play()}},r.prototype.stop=function(){if(this.audio){this.isStopped||t.sys.$popSoundChannel(this),this.isStopped=!0;var i=this.audio;i.pause(),i.removeEventListener("ended",this.onPlayEnd),this.audio=null,e.NativeSound.$recycle(this.$url,i)}},Object.defineProperty(r.prototype,"volume",{get:function(){return this.$volume},set:function(e){return this.isStopped?void t.$error(1036):(this.$volume=e,void(this.audio&&(this.audio.volume=e)))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"position",{get:function(){return this.audio?this.audio.currentTime:0},enumerable:!0,configurable:!0}),r}(t.EventDispatcher);e.NativeSoundChannel=i,__reflect(i.prototype,"egret.native.NativeSoundChannel",["egret.SoundChannel","egret.IEventDispatcher"])
  3. }(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(i){function r(){var t=i.call(this)||this;return t.loaded=!1,t}return __extends(r,i),Object.defineProperty(r.prototype,"length",{get:function(){throw new Error("sound length not supported")},enumerable:!0,configurable:!0}),r.prototype.load=function(e){function i(){var i=t.PromiseObject.create();i.onSuccessFunc=r,i.onErrorFunc=function(){t.IOErrorEvent.dispatchIOErrorEvent(n)},egret_native.download(e,e,i)}function r(){n.loaded=!0,n.preload()}var n=this;this.url=e,e||t.$error(3002),egret_native.isFileExists(e)?__global.setTimeout?__global.setTimeout(r,0):t.$callAsync(r,n):i()},r.prototype.preload=function(){var e=this;if(e.type==t.Sound.EFFECT){var i=new t.PromiseObject;i.onSuccessFunc=function(i){e.dispatchEventWith(t.Event.COMPLETE)},egret_native.Audio.preloadEffectAsync(e.url,i)}else e.dispatchEventWith(t.Event.COMPLETE)},r.prototype.play=function(i,r){i=+i||0,r=+r||0,0==this.loaded&&t.$error(1049);var n=new e.NaSoundChannel;return n.$url=this.url,n.$loops=r,n.$type=this.type,n.$startTime=i,n.$play(),t.sys.$pushSoundChannel(n),n},r.prototype.close=function(){},r}(t.EventDispatcher);i.MUSIC="music",i.EFFECT="effect",e.NaSound=i,__reflect(i.prototype,"egret.native.NaSound",["egret.Sound"]),__global.Audio||(t.Sound=i)}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(e){function i(){var t=e.call(this)||this;return t.$startTime=0,t.isStopped=!1,t._startTime=0,t}return __extends(i,e),i.prototype.$play=function(){this.isStopped=!1,this.$type==t.Sound.EFFECT?this._effectId=egret_native.Audio.playEffect(this.$url,1!=this.$loops):(i.currentPath=this.$url,egret_native.Audio.playBackgroundMusic(this.$url,1!=this.$loops)),this._startTime=Date.now()},i.prototype.stop=function(){this.isStopped||t.sys.$popSoundChannel(this),this.isStopped=!0,this.$type==t.Sound.EFFECT?this._effectId&&(egret_native.Audio.stopEffect(this._effectId),this._effectId=null):this.$url==i.currentPath&&egret_native.Audio.stopBackgroundMusic(!1)},Object.defineProperty(i.prototype,"volume",{get:function(){return this.$type==t.Sound.EFFECT?egret_native.Audio.getEffectsVolume():egret_native.Audio.getBackgroundMusicVolume()},set:function(e){this.$type==t.Sound.EFFECT?egret_native.Audio.setEffectsVolume(e):egret_native.Audio.setBackgroundMusicVolume(e)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"position",{get:function(){return(Date.now()-this._startTime)/1e3},enumerable:!0,configurable:!0}),i}(t.EventDispatcher);e.NaSoundChannel=i,__reflect(i.prototype,"egret.native.NaSoundChannel",["egret.SoundChannel","egret.IEventDispatcher"])}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(i){function r(e,r){void 0===r&&(r=!0);var n=i.call(this)||this;return n.loaded=!1,n.loading=!1,n.loop=!1,n.isPlayed=!1,n.firstPlay=!0,n.src="",n._fullscreen=!0,n._bitmapData=null,n.paused=!1,n.isAddToStage=!1,n.heightSet=0,n.widthSet=0,n.$renderNode=new t.sys.BitmapNode,n.cache=r,__global.Video||t.$error(1044),e&&n.load(e,r),n}return __extends(r,i),r.prototype.load=function(e,i){if(void 0===i&&(i=!0),!e)return void t.$error(3002);if(!this.loading)if(0==e.indexOf("/")&&(e=e.slice(1,e.length)),this.src=e,this.loading=!0,this.loaded=!1,i&&!egret_native.isFileExists(e)){var r=this,n=t.PromiseObject.create();n.onSuccessFunc=function(){r.loadEnd()},n.onErrorFunc=function(){t.$warn(1048),r.dispatchEventWith(t.IOErrorEvent.IO_ERROR)},egret_native.download(e,e,n)}else this.loadEnd()},r.prototype.loadEnd=function(){function e(){a.setVideoRect(0,0,1,1),a.play()}function i(){a.setVideoRect(0,0,1,1),__global.setTimeout(function(){a.pause(),o._fullscreen&&(a.fullScreen=!0),a.currentTime=0,o.originVideo=a,o.loaded=!0,o.loading=!1,n(),o.dispatchEventWith(t.Event.COMPLETE),a.addEventListener("pause",function(){o.paused=!0}),a.addEventListener("playing",function(){o.paused=!1}),a.addEventListener("ended",function(){o.dispatchEventWith(t.Event.ENDED),o.loop&&o.play(0,!0)})},1)}function r(){n(),o.dispatchEventWith(t.IOErrorEvent.IO_ERROR)}function n(){a.removeEventListener("canplaythrough",e),a.removeEventListener("error",r),a.removeEventListener("playing",i)}var a=new __global.Video(this.src);a.setVideoRect(0,0,1,1),a.setKeepRatio(!1),a.addEventListener("canplaythrough",e),a.addEventListener("error",r),a.addEventListener("playing",i),a.load();var o=this},r.prototype.play=function(e,i){var r=this;if(void 0===i&&(i=!1),this.loop=i,!this.loaded)return this.load(this.src),void this.once(t.Event.COMPLETE,function(t){return r.play(e,i)},this);var n=!1;void 0!=e&&e!=this.originVideo.currentTime&&(this.originVideo.currentTime=e||0,n=!0),this.startPlay(n)},r.prototype.startPlay=function(e){void 0===e&&(e=!1),this.isAddToStage&&this.loaded&&(this.firstPlay=!1,this.setVideoSize(),this.isPlayed=!0,!e&&this.paused&&0!=this.position?this.originVideo.resume():this.originVideo.play(),t.startTick(this.markDirty,this))},r.prototype.stopPlay=function(){t.stopTick(this.markDirty,this),this.isPlayed&&(this.isPlayed=!1,this.originVideo.pause())},r.prototype.close=function(){this.originVideo&&this.originVideo.destroy(),this.loaded=!1,this.loading=!1,this.originVideo=null,this.loop=!1,this.src=null},Object.defineProperty(r.prototype,"poster",{get:function(){return this.posterUrl},set:function(i){var r=this;this.posterUrl=i;var n=new e.NativeImageLoader;n.load(i),n.addEventListener(t.Event.COMPLETE,function(){r.posterData=n.data,r.markDirty(),r.$invalidateContentBounds()},this)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"fullscreen",{get:function(){return this.originVideo?this.originVideo.fullScreen:this._fullscreen},set:function(t){this._fullscreen=t,this.originVideo&&(this.originVideo.fullScreen=t)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"volume",{get:function(){return this.loaded?this.originVideo.volume:0},set:function(t){this.loaded&&(this.originVideo.volume=t)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"position",{get:function(){return this.originVideo.currentTime},set:function(t){this.loaded&&(this.originVideo.currentTime=t)},enumerable:!0,configurable:!0}),r.prototype.pause=function(){this.originVideo.pause()},Object.defineProperty(r.prototype,"bitmapData",{get:function(){return this._bitmapData},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"length",{get:function(){if(this.loaded)return this.originVideo.duration;throw new Error("Video not loaded!")},enumerable:!0,configurable:!0}),r.prototype.$onAddToStage=function(t,e){this.isAddToStage=!0,this.originVideo&&this.originVideo.setVideoVisible(!0),this.$invalidate(),this.$invalidateContentBounds(),i.prototype.$onAddToStage.call(this,t,e)},r.prototype.$onRemoveFromStage=function(){this.isAddToStage=!1,this.originVideo&&(this.stopPlay(),this.originVideo.setVideoVisible(!1)),i.prototype.$onRemoveFromStage.call(this)},r.prototype.getPlayWidth=function(){return isNaN(this.widthSet)?this.bitmapData?this.bitmapData.width:this.posterData?this.posterData.width:0/0:this.widthSet},r.prototype.getPlayHeight=function(){return isNaN(this.heightSet)?this.bitmapData?this.bitmapData.height:this.posterData?this.posterData.height:0/0:this.heightSet},r.prototype.$setHeight=function(t){return this.heightSet=+t||0,this.setVideoSize(),this.$invalidate(),this.$invalidateContentBounds(),i.prototype.$setHeight.call(this,t)},r.prototype.$setWidth=function(t){return this.widthSet=+t||0,this.setVideoSize(),this.$invalidate(),this.$invalidateContentBounds(),i.prototype.$setWidth.call(this,t)},r.prototype.$setX=function(t){var e=i.prototype.$setX.call(this,t);return this.setVideoSize(),e},r.prototype.$setY=function(t){var e=i.prototype.$setY.call(this,t);return this.setVideoSize(),e},r.prototype.setVideoSize=function(){var t=this.originVideo;t&&!this.fullscreen&&(this.firstPlay?t.setVideoRect(this.x,this.y,0,0):t.setVideoRect(this.x,this.y,this.widthSet,this.heightSet))},r.prototype.$measureContentBounds=function(t){var e=this.posterData;e?t.setTo(0,0,this.getPlayWidth(),this.getPlayHeight()):t.setEmpty()},r.prototype.$render=function(){var t=this.$renderNode,e=this.posterData,i=this.getPlayWidth(),r=this.getPlayHeight();0>=i||0>=r||(!this.isPlayed&&e?(t.image=e,t.drawImage(0,0,e.width,e.height,0,0,i,r)):this.isPlayed&&this.setVideoSize())},r.prototype.markDirty=function(){return this.$invalidate(),!0},r}(t.DisplayObject);e.NativeVideo=i,__reflect(i.prototype,"egret.native.NativeVideo",["egret.Video"]),__global.Video?t.Video=i:t.$warn(1044)}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i;!function(i){function r(t){return c[t]}function n(e,i){i=void 0===i?"undefined":null===i?"null":i.toString(),c[e]=i;try{return s(),!0}catch(r){return t.$warn(1018,e,i),!1}}function a(t){delete c[t],s()}function o(){for(var t in c)delete c[t];s()}function s(){egret_native.saveRecord(h,JSON.stringify(c))}var h="LocalStorage.local",c={};if(egret_native.isRecordExists(h)){var u=egret_native.loadRecord(h);try{c=JSON.parse(u)}catch(l){c={}}}else c={};e.getItem=r,e.setItem=n,e.removeItem=a,e.clear=o}(i=e["native"]||(e["native"]={}))}(e=t.localStorage||(t.localStorage={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(e){function i(i){var r=e.call(this)||this;return egret_native.pauseApp=function(){i.dispatchEvent(new t.Event(t.Event.DEACTIVATE)),egret_native.Audio.pauseBackgroundMusic(),egret_native.Audio.pauseAllEffects()},egret_native.resumeApp=function(){i.dispatchEvent(new t.Event(t.Event.ACTIVATE)),egret_native.Audio.resumeBackgroundMusic(),egret_native.Audio.resumeAllEffects()},r}return __extends(i,e),i}(t.HashObject);e.NativeHideHandler=i,__reflect(i.prototype,"egret.native.NativeHideHandler")}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(){var t=e.apply(this,arguments)||this;return t._downCount=0,t._path=null,t._bytesTotal=0,t}return __extends(i,e),i.prototype.load=function(t,e){this._downCount=0,this._path=t,this._bytesTotal=e,this.reload()},i.prototype.reload=function(){if(this._downCount>=3)return void this.downloadFileError();this._downCount++;var e=t.PromiseObject.create(),i=this;e.onSuccessFunc=function(){i.loadOver()},e.onErrorFunc=function(){i.reload()},e.downloadingSizeFunc=function(t){i.downloadingProgress(t)},egret_native.download(this._path,this._path,e)},i.prototype.downloadingProgress=function(e){t.ProgressEvent.dispatchProgressEvent(this,t.ProgressEvent.PROGRESS,e,this._bytesTotal)},i.prototype.downloadFileError=function(){this.dispatchEvent(new t.Event(t.IOErrorEvent.IO_ERROR))},i.prototype.loadOver=function(){this.dispatchEvent(new t.Event(t.Event.COMPLETE))},i}(t.EventDispatcher);t.NativeResourceLoader=e,__reflect(e.prototype,"egret.NativeResourceLoader")}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(e){function i(i){var r=e.call(this)||this;r.$touch=new t.sys.TouchHandler(i);var n=r;return egret_native.onTouchesBegin=function(t,e,i,r){n.$executeTouchCallback(t,e,i,r,n.$touch.onTouchBegin)},egret_native.onTouchesMove=function(t,e,i,r){n.$executeTouchCallback(t,e,i,r,n.$touch.onTouchMove)},egret_native.onTouchesEnd=function(t,e,i,r){n.$executeTouchCallback(t,e,i,r,n.$touch.onTouchEnd)},egret_native.onTouchesCancel=function(t,e,i,r){},r}return __extends(i,e),i.prototype.$executeTouchCallback=function(t,e,i,r,n){for(var a=0;t>a;a++){var o=e[a],s=i[a],h=r[a];n.call(this.$touch,s,h,o)}},i.prototype.$updateMaxTouches=function(){this.$touch.$initMaxTouches()},i}(t.HashObject);e.NativeTouchHandler=i,__reflect(i.prototype,"egret.native.NativeTouchHandler")}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(e){function i(){var t=e.call(this)||this;return t._url="",t._method="",t.urlData={},t.responseHeader="",t}return __extends(i,e),Object.defineProperty(i.prototype,"response",{get:function(){return this._response},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"responseType",{get:function(){return this._responseType},set:function(t){this._responseType=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"withCredentials",{get:function(){return this._withCredentials},set:function(t){this._withCredentials=t},enumerable:!0,configurable:!0}),i.prototype.open=function(t,e){void 0===e&&(e="GET"),this._url=t,this._method=e},i.prototype.send=function(e){function i(){var e=new t.PromiseObject;e.onSuccessFunc=function(e){n._response=e,t.Event.dispatchEvent(n,t.Event.COMPLETE)},e.onErrorFunc=function(){t.Event.dispatchEvent(n,t.IOErrorEvent.IO_ERROR)},n._responseType==t.HttpResponseType.ARRAY_BUFFER?egret_native.readFileAsync(n._url,e,"ArrayBuffer"):egret_native.readFileAsync(n._url,e)}function r(){var e=t.PromiseObject.create();e.onSuccessFunc=i,e.onErrorFunc=function(){t.Event.dispatchEvent(n,t.IOErrorEvent.IO_ERROR)},e.onResponseHeaderFunc=this.onResponseHeader,e.onResponseHeaderThisObject=this,egret_native.download(n._url,n._url,e)}var n=this;if(n.isNetUrl(n._url)){n.urlData.type=n._method,n._method==t.HttpMethod.POST&&e?e instanceof ArrayBuffer?n.urlData.data=e:n.urlData.data=e.toString():delete n.urlData.data,n._responseType==t.HttpResponseType.ARRAY_BUFFER?n.urlData.binary=!0:n.urlData.header=!1,this.headerObj?n.urlData.header=JSON.stringify(this.headerObj):delete n.urlData.header;var a=t.PromiseObject.create();a.onSuccessFunc=function(e){n._response=e,t.$callAsync(t.Event.dispatchEvent,t.Event,n,t.Event.COMPLETE)},a.onErrorFunc=function(e){t.$warn(1019,e),t.Event.dispatchEvent(n,t.IOErrorEvent.IO_ERROR)},a.onResponseHeaderFunc=this.onResponseHeader,a.onResponseHeaderThisObject=this,egret_native.requireHttp(n._url,n.urlData,a)}else egret_native.isFileExists(n._url)?i():r()},i.prototype.isNetUrl=function(t){return-1!=t.indexOf("http://")||-1!=t.indexOf("HTTP://")||-1!=t.indexOf("https://")||-1!=t.indexOf("HTTPS://")},i.prototype.abort=function(){},i.prototype.onResponseHeader=function(t){this.responseHeader="";var e=JSON.parse(t);for(var i in e)this.responseHeader+=i+": "+e[i]+"\r\n"},i.prototype.getAllResponseHeaders=function(){return this.responseHeader},i.prototype.setRequestHeader=function(t,e){this.headerObj||(this.headerObj={}),this.headerObj[t]=e},i.prototype.getResponseHeader=function(t){return""},i}(t.EventDispatcher);e.NativeHttpRequest=i,__reflect(i.prototype,"egret.native.NativeHttpRequest",["egret.HttpRequest"]),t.HttpRequest=i,t.$markReadOnly(i,"response")}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(e){function i(){var t=e.apply(this,arguments)||this;return t.data=null,t._crossOrigin=null,t}return __extends(i,e),Object.defineProperty(i.prototype,"crossOrigin",{get:function(){return this._crossOrigin},set:function(t){this._crossOrigin=t},enumerable:!0,configurable:!0}),i.prototype.load=function(t){this.check(t)},i.prototype.check=function(t){var e=this;e.isNetUrl(t)?e.download(t):egret_native.isFileExists(t)?e.loadTexture(t):e.download(t)},i.prototype.download=function(e){var i=this,r=t.PromiseObject.create();r.onSuccessFunc=function(){i.loadTexture(e)},r.onErrorFunc=function(){i.dispatchEventWith(t.IOErrorEvent.IO_ERROR)},egret_native.download(e,e,r)},i.prototype.loadTexture=function(e){var i=this,r=new t.PromiseObject;r.onSuccessFunc=function(e){i.data=new t.BitmapData(e),i.dispatchEventWith(t.Event.COMPLETE)},r.onErrorFunc=function(){i.dispatchEventWith(t.IOErrorEvent.IO_ERROR)},egret_native.Texture.addTextureAsyn(e,r)},i.prototype.isNetUrl=function(t){return-1!=t.indexOf("http://")||-1!=t.indexOf("HTTP://")||-1!=t.indexOf("https://")||-1!=t.indexOf("HTTPS://")},i}(t.EventDispatcher);i.crossOrigin=null,e.NativeImageLoader=i,__reflect(i.prototype,"egret.native.NativeImageLoader",["egret.ImageLoader"]),t.ImageLoader=i}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(e){function i(){var t=e.call(this)||this;return t.textValue="",t.colorValue=16777215,t.isFinishDown=!1,t.textValue="",t}return __extends(i,e),i.prototype.$getText=function(){return this.textValue||(this.textValue=""),this.textValue},i.prototype.$setText=function(t){return this.textValue=t,!0},i.prototype.$setColor=function(t){return this.colorValue=t,!0},i.prototype.$onBlur=function(){},i.prototype.showScreenKeyboard=function(){var e=this;e.dispatchEvent(new t.Event("focus")),t.Event.dispatchEvent(e,"focus",!1,{showing:!0}),egret_native.EGT_TextInput=function(i){e.$textfield.multiline?(e.textValue=i,e.dispatchEvent(new t.Event("updateText")),e.isFinishDown&&(e.isFinishDown=!1,e.dispatchEvent(new t.Event("blur")))):(e.textValue=i.replace(/[\n|\r]/,""),egret_native.TextInputOp.setKeybordOpen(!1),e.dispatchEvent(new t.Event("updateText")),e.dispatchEvent(new t.Event("blur")))},egret_native.EGT_keyboardFinish=function(){e.$textfield.multiline&&(e.isFinishDown=!0)}},i.prototype.$show=function(){var e=this,i=this.$textfield,r=i.$TextField;egret_native.TextInputOp.setKeybordOpen(!1),egret_native.EGT_getTextEditerContentText=function(){return e.$getText()},egret_native.EGT_keyboardDidShow=function(){e.showScreenKeyboard(),egret_native.EGT_keyboardDidShow=function(){},egret_native.TextInputOp.updateConfig&&egret_native.TextInputOp.updateConfig(JSON.stringify({font_color:r[2]}))},egret_native.EGT_keyboardDidHide=function(){},egret_native.EGT_deleteBackward=function(){};var n=r[37],a=r[30]?0:6,o=-1;n==t.TextFieldInputType.PASSWORD?o=0:n==t.TextFieldInputType.TEL&&(a=3);var s=1,h=r[21]<=0?-1:r[21],c=(i.$getRenderNode(),this.$textfield.localToGlobal(0,0));egret_native.TextInputOp.setKeybordOpen(!0,JSON.stringify({inputMode:a,inputFlag:o,returnType:s,maxLength:h,x:c.x,y:c.y,width:i.width,height:i.height,font_size:r[0],font_color:r[2],textAlign:r[9],verticalAlign:r[10]}))},i.prototype.$hide=function(){egret_native.TextInputOp.setKeybordOpen(!1),this.dispatchEvent(new t.Event("blur"))},i.prototype.$resetStageText=function(){},i.prototype.$addToStage=function(){},i.prototype.$removeFromStage=function(){},i.prototype.$setTextField=function(t){return this.$textfield=t,!0},i}(t.EventDispatcher);e.NativeStageText=i,__reflect(i.prototype,"egret.native.NativeStageText",["egret.StageText"]),t.StageText=i}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){function i(t){var e=egret_native.xmlStr2JsonStr(t);e=e.replace(/\n/g,"\\n");var i=JSON.parse(e);return r(i,null)}function r(t,e){if("parsererror"==t.localName)throw new Error(t.textContent);var i=new a(t.localName,e,t.prefix,t.namespace,t.name),n=t.attributes,s=i.attributes;for(var h in n)s[h]=i["$"+h]=n[h];for(var c=t.children,u=c.length,l=i.children,p=0;u>p;p++){var f=c[p],d=f.nodeType,v=null;if(1==d)v=r(f,i);else if(3==d){var g=f.text.trim();g&&(v=new o(g,i))}v&&l.push(v)}return i}var n=function(){function t(t,e){this.nodeType=t,this.parent=e}return t}();e.XMLNode=n,__reflect(n.prototype,"egret.web.XMLNode");var a=function(t){function e(e,i,r,n,a){var o=t.call(this,1,i)||this;return o.attributes={},o.children=[],o.localName=e,o.prefix=r,o.namespace=n,o.name=a,o}return __extends(e,t),e}(n);e.XML=a,__reflect(a.prototype,"egret.web.XML");var o=function(t){function e(e,i){var r=t.call(this,3,i)||this;return r.text=e,r}return __extends(e,t),e}(n);e.XMLText=o,__reflect(o.prototype,"egret.web.XMLText"),t.XML={parse:i}}(e=t.web||(t.web={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){function i(t){return egret_native.getOption(t)}e.getOption=i,t.getOption=i}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));