UNPKG

dragonbones-runtime

Version:

the tools to build dragonbones file for diffrent framework

2 lines 60.7 kB
var __reflect=this&&this.__reflect||function(t,e,r){t.__class__=e,r?r.push(e):r=[e],t.__types__=t.__types__?r.concat(t.__types__):r},__extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),egret;!function(t){var e;!function(e){var r=function(r){function i(e){var i=r.call(this)||this;return i.$startTime=0,i.audio=null,i.isStopped=!1,i.onPlayEnd=function(){return 1==i.$loops?(i.stop(),void i.dispatchEventWith(t.Event.SOUND_COMPLETE)):(i.$loops>0&&i.$loops--,void i.$play())},i.$volume=1,e.addEventListener("ended",i.onPlayEnd),i.audio=e,i}return __extends(i,r),i.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()}},i.prototype.stop=function(){if(this.audio){this.isStopped||t.sys.$popSoundChannel(this),this.isStopped=!0;var r=this.audio;r.pause(),r.removeEventListener("ended",this.onPlayEnd),this.audio=null,e.NativeSound.$recycle(this.$url,r)}},Object.defineProperty(i.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(i.prototype,"position",{get:function(){return this.audio?this.audio.currentTime:0},enumerable:!0,configurable:!0}),i}(t.EventDispatcher);e.NativeSoundChannel=r,__reflect(r.prototype,"egret.native.NativeSoundChannel",["egret.SoundChannel","egret.IEventDispatcher"])}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){function r(e,r,i,n,a){var o,s;if(-1!=r.indexOf(", ")?s=r.split(", "):-1!=r.indexOf(",")&&(s=r.split(",")),s)for(var h=s.length,u=0;h>u;u++){var l=s[u];if(t.fontMapping[l]){o=t.fontMapping[l];break}}else o=t.fontMapping[r];return o||(o="/system/fonts/DroidSansFallback.ttf"),egret_native.Label.createLabel(o,i,"",0),egret_native.Label.getTextSize(e)[0]}t.sys.measureText=r}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r={"source-over":[1,771],lighter:[770,1],"destination-out":[0,771],"destination-in":[0,770]},i=function(e){function i(){var r=null!==e&&e.apply(this,arguments)||this;return r.$matrix=new t.Matrix,r.$nativeContext=null,r.$globalCompositeOperation="source-over",r.$globalAlpha=1,r.$lineWidth=0,r.$strokeStyle="#000000",r.$fillStyle="#000000",r.$font="normal normal 10px sans-serif",r.$fontSize=10,r.$fontFamily="",r.clipRectArray=null,r.$saveList=[],r.$clipRectArray=[],r.$clipRect=new t.Rectangle,r.$saveCount=0,r.$clipList=[],r.savedMatrix=new t.Matrix,r.$hasStrokeText=!1,r}return __extends(i,e),Object.defineProperty(i.prototype,"globalCompositeOperation",{get:function(){return this.$globalCompositeOperation},set:function(t){this.$globalCompositeOperation=t;var e=r[t];e&&this.$nativeContext.setBlendArg(e[0],e[1])},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"globalAlpha",{get:function(){return this.$globalAlpha},set:function(t){this.$globalAlpha=t,this.$nativeContext.setGlobalAlpha(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"lineWidth",{get:function(){return this.$lineWidth},set:function(t){this.$lineWidth=t,this.$nativeContext.lineWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.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(i.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}),i.prototype.$fillColorStr=function(t){return t.length<2&&(t="0"+t),t},i.prototype.$parseRGBA=function(t){var e=t.indexOf("(");t=t.slice(e+1,t.length-1);var r=t.split(","),i=parseInt(255*parseFloat(r[3])).toString(16),n=parseInt(r[0]).toString(16),a=parseInt(r[1]).toString(16),o=parseInt(r[2]).toString(16);return t="#"+this.$fillColorStr(i)+this.$fillColorStr(n)+this.$fillColorStr(a)+this.$fillColorStr(o)},i.prototype.$parseRGB=function(t){var e=t.indexOf("(");t=t.slice(e+1,t.length-1);var r=t.split(","),i=parseInt(r[0]).toString(16),n=parseInt(r[1]).toString(16),a=parseInt(r[2]).toString(16);return t="#"+this.$fillColorStr(i)+this.$fillColorStr(n)+this.$fillColorStr(a)},Object.defineProperty(i.prototype,"font",{get:function(){return this.$font},set:function(e){this.$font=e;var r=e.split(" "),i=r[2];if(-1!=i.indexOf("px")&&(this.$fontSize=parseInt(i.replace("px",""))),t.useFontMapping){var n=void 0;n=4==r.length?r[3]:r.slice(3).join(" ");var a=void 0;if(-1!=n.indexOf(", ")?a=n.split(", "):-1!=n.indexOf(",")&&(a=n.split(",")),a)for(var o=a.length,s=0;o>s;s++){var h=a[s];if(t.fontMapping[h])return void(this.$fontFamily=t.fontMapping[h])}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}),i.prototype.arc=function(t,e,r,i,n,a){this.$nativeContext.arc(t,e,r,i,n,a)},i.prototype.quadraticCurveTo=function(t,e,r,i){this.$nativeContext.quadraticCurveTo(t,e,r,i)},i.prototype.lineTo=function(t,e){this.$nativeContext.lineTo(t,e)},i.prototype.fill=function(t){this.$nativeContext.fill(t)},i.prototype.closePath=function(){this.$nativeContext.closePath(),this.clipRectArray&&(this.$clipRectArray=this.clipRectArray,this.clipRectArray=null)},i.prototype.rect=function(t,e,r,i){this.$nativeContext.rect(t,e,r,i),this.$clipRectArray.push({x:t,y:e,w:r,h:i})},i.prototype.moveTo=function(t,e){this.$nativeContext.moveTo(t,e)},i.prototype.setLineDash=function(t){},i.prototype.fillRect=function(t,e,r,i){this.$nativeContext.fillRect(t,e,r,i)},i.prototype.bezierCurveTo=function(t,e,r,i,n,a){this.$nativeContext.bezierCurveTo(t,e,r,i,n,a)},i.prototype.stroke=function(){this.$nativeContext.stroke()},i.prototype.strokeRect=function(t,e,r,i){this.$nativeContext.strokeRect(t,e,r,i)},i.prototype.beginPath=function(){this.$nativeContext.beginPath(),this.clipRectArray=this.$clipRectArray.concat()},i.prototype.arcTo=function(t,e,r,i,n){this.$nativeContext.arcTo(t,e,r,i,n)},i.prototype.transform=function(t,e,r,i,n,a){this.$matrix.append(t,e,r,i,n,a),this.setTransformToNative()},i.prototype.translate=function(t,e){this.$matrix.translate(t,e),this.setTransformToNative()},i.prototype.scale=function(t,e){this.$matrix.scale(t,e),this.setTransformToNative()},i.prototype.rotate=function(t){this.$matrix.rotate(t),this.setTransformToNative()},i.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}},i.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()},i.prototype.clip=function(t){if(this.$clipRectArray.length>0){for(var e=[],r=0;r<this.$clipRectArray.length;r++){var i=this.$clipRectArray[r];e.push(i.x),e.push(i.y),e.push(i.w),e.push(i.h)}this.$nativeContext.pushRectStencils(e),this.$clipRectArray.length=0}},i.prototype.clearRect=function(t,e,r,i){this.$nativeContext.clearRect(t,e,r,i)},i.prototype.setTransform=function(t,e,r,i,n,a){this.$matrix.setTo(t,e,r,i,n,a),this.setTransformToNative()},i.prototype.setTransformToNative=function(){var t=this.$matrix;this.$nativeContext.setTransform(t.a,t.b,t.c,t.d,t.tx,t.ty)},i.prototype.saveTransform=function(){this.savedMatrix.copyFrom(this.$matrix)},i.prototype.restoreTransform=function(){this.$matrix.copyFrom(this.savedMatrix)},i.prototype.createLinearGradient=function(t,e,r,i){return this.$nativeContext.createLinearGradient(t,e,r,i)},i.prototype.createRadialGradient=function(t,e,r,i,n,a){return this.$nativeContext.createRadialGradient(t,e,r,i,n,a)},i.prototype.fillText=function(t,e,r,i){this.$nativeContext.createLabel(this.$fontFamily,this.$fontSize,"",this.$hasStrokeText?this.$lineWidth:0),this.$hasStrokeText=!1,this.$nativeContext.drawText(t,e,r)},i.prototype.strokeText=function(t,e,r,i){this.$hasStrokeText=!0},i.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]}},i.prototype.drawImage=function(t,e,r,i,n,a,o,s,h){var u,l;t.$nativeCanvas?(u=t.$nativeCanvas,l=!0):(u=t,l=!1),u&&(3==arguments.length?(a=e,o=r,e=0,r=0,i=s=t.width,n=h=t.height):5==arguments.length?(a=e,o=r,s=i,h=n,e=0,r=0,i=t.width,n=t.height):(void 0==i&&(i=t.width),void 0==n&&(n=t.height),void 0==a&&(a=0),void 0==o&&(o=0),void 0==s&&(s=i),void 0==h&&(h=n)),this.$nativeContext.drawImage(u,e,r,i,n,a,o,s,h))},i.prototype.drawMesh=function(t,e,r,i,n,a,o,s,h,u,l,c,f,p){var d;d=t.$nativeCanvas?t.$nativeCanvas:t,d&&(3==arguments.length?(a=e,o=r,e=0,r=0,i=s=t.width,n=h=t.height):5==arguments.length?(a=e,o=r,s=i,h=n,e=0,r=0,i=t.width,n=t.height):(i||(i=t.width),n||(n=t.height),a||(a=0),o||(o=0),s||(s=i),h||(h=n)),this.vertices=new Float32Array(f.length/2*5),this.indicesForMesh=new Uint32Array(p.length),this.cacheArrays(this.$matrix,1,e,r,i,n,a,o,s,h,u,l,c,f,p),this.$nativeContext.drawMesh(d,this.vertices,this.indicesForMesh,this.vertices.length,this.indicesForMesh.length))},i.prototype.cacheArrays=function(t,e,r,i,n,a,o,s,h,u,l,c,f,p,d){var v=t,g=v.a,y=v.b,$=v.c,x=v.d,m=v.tx,_=v.ty;(0!=o||0!=s)&&v.append(1,0,0,1,o,s),(n/h!=1||a/u!=1)&&v.append(h/n,0,0,u/a,0,0);var C=v.a,b=v.b,S=v.c,T=v.d,w=v.tx,L=v.ty;if(v.a=g,v.b=y,v.c=$,v.d=x,v.tx=m,v.ty=_,p){var E=this.vertices,B=0,O=0,A=0,R=0,M=0,F=0,P=0;for(B=0,A=f.length;A>B;B+=2)O=5*B/2,F=p[B],P=p[B+1],R=f[B],M=f[B+1],E[O+0]=C*F+S*P+w,E[O+1]=b*F+T*P+L,E[O+2]=(r+R*n)/l,E[O+3]=(i+M*a)/c,E[O+4]=e;for(B=0;B<d.length;B++)this.indicesForMesh[B]=d[B]}else console.log("meshVertices not exist")},i.prototype.createPattern=function(t,e){return null},i.prototype.getImageData=function(t,e,r,i){var n;return t!=Math.floor(t)&&(t=Math.floor(t),r++),e!=Math.floor(e)&&(e=Math.floor(e),i++),n=this.$nativeContext.getPixels(t,e,r,i),n.pixelData&&(n.data=n.pixelData),n},i.prototype.setGlobalShader=function(t){egret_native.Graphics.setGlobalShader(t)},i}(t.HashObject);e.OldNativeCanvasRenderContext=i,__reflect(i.prototype,"egret.native.OldNativeCanvasRenderContext")}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=function(t){function r(){var r=t.call(this)||this;return r.$width=0,r.$height=0,r.renderContext=e.$supportCmdBatch?new e.NativeCanvasRenderContext:new e.OldNativeCanvasRenderContext,r}return __extends(r,t),r.prototype.toDataURL=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return this.$nativeCanvas?this.$nativeCanvas.toDataURL.apply(this.$nativeCanvas,arguments):null},r.prototype.saveToFile=function(t,r){this.$nativeCanvas&&this.$nativeCanvas.saveToFile&&(e.$supportCmdBatch&&e.$cmdManager.flush(),this.$nativeCanvas.saveToFile(t,r))},Object.defineProperty(r.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 r=this.$nativeCanvas.getContext("2d");e.$supportCmdBatch?(e.$cmdManager.setContext(r),e.$cmdManager.clearScreen(0,0,0,0)):r.clearScreen(0,0,0,0),this.renderContext.$nativeContext=r}},enumerable:!0,configurable:!0}),Object.defineProperty(r.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 r=this.$nativeCanvas.getContext("2d");e.$supportCmdBatch?(e.$cmdManager.setContext(r),e.$cmdManager.clearScreen(0,0,0,0)):r.clearScreen(0,0,0,0),this.renderContext.$nativeContext=r}},enumerable:!0,configurable:!0}),r.prototype.getContext=function(t){return this.renderContext},r}(t.HashObject);e.NativeCanvas=r,__reflect(r.prototype,"egret.native.NativeCanvas")}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){function e(e,r){var i=new t.NativeCanvas;return isNaN(e)||isNaN(r)||(i.width=e,i.height=r),i}var r=function(){function r(t,r){this.surface=e(t,r),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,r,i){t.$supportCmdBatch&&t.$cmdManager.flush();var n=this.surface;n.width=e,n.height=r,this.clear()},r.prototype.getPixels=function(t,e,r,i){return void 0===r&&(r=1),void 0===i&&(i=1),this.context.getImageData(t,e,r,i).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 r(e,r){var i=t.sys.canvasHitTestBuffer,n=e.$getTextureWidth(),a=e.$getTextureHeight();null==r&&(r=t.$TempRectangle,r.x=0,r.y=0,r.width=n,r.height=a),r.x=Math.min(r.x,n-1),r.y=Math.min(r.y,a-1),r.width=Math.min(r.width,n-r.x),r.height=Math.min(r.height,a-r.y);var o=r.width,s=r.height;i.surface;i.resize(o,s);var h=e,u=Math.round(h.$offsetX),l=Math.round(h.$offsetY),c=h.$bitmapWidth,f=h.$bitmapHeight;return i.context.drawImage(h.$bitmapData.source,h.$bitmapX+r.x/t.$TextureScaleFactor,h.$bitmapY+r.y/t.$TextureScaleFactor,c*r.width/n,f*r.height/a,u,l,r.width,r.height),i}function i(e,i,n){try{var a=r(this,i),o=a.toDataURL(e);return o}catch(s){return t.$error(1033),null}}function n(e,i,n){try{var a=r(this,n);a.surface.saveToFile(e,i)}catch(o){t.$error(1033)}}function a(e,r){return t.$warn(1041,"getPixel32","getPixels"),this.getPixels(e,r)}function o(e,i,n,a){void 0===n&&(n=1),void 0===a&&(a=1);var o=this;if(o.$renderBuffer)return o.$renderBuffer.getPixels(e,i,n,a);try{var s=r(this);return s.getPixels(e,i,n,a)}catch(h){t.$error(1033)}}t.Texture.prototype.toDataURL=i,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 r=function(r){function i(){var t=r.call(this)||this;return t.init(i.option),t}return __extends(i,r),i.prototype.init=function(r){var i=new t.Stage;i.$screen=this,i.$scaleMode=r.scaleMode,i.$maxTouches=r.maxTouches,i.textureScaleFactor=r.textureScaleFactor,i.frameRate=r.frameRate;var n=new t.sys.RenderBuffer(void 0,void 0,!0),a=n.surface;a.$isRoot=!0;var o=new e.NativeTouchHandler(i),s=new t.sys.Player(n,i,r.entryClassName);if(t.lifecycle.stage=i,t.lifecycle.addLifecycleListener(e.NativeLifeCycleHandler),r.showFPS||r.showLog){for(var h=r.fpsStyles||"",u=h.split(","),l={},c=0;c<u.length;c++){var f=u[c].split(":");l[f[0]]=f[1]}r.fpsStyles=l,s.displayFPS(r.showFPS,r.showLog,r.logFilter,r.fpsStyles)}this.playerOption=r,this.$stage=i,this.player=s,this.nativeTouch=o,this.updateScreenSize(),this.updateMaxTouches(),s.start()},i.prototype.updateScreenSize=function(){var e=this.playerOption,r=egret_native.EGTView.getFrameWidth(),i=egret_native.EGTView.getFrameHeight();t.Capabilities.$boundingClientWidth=r,t.Capabilities.$boundingClientHeight=i;var n=t.sys.screenAdapter.calculateStageSize(this.$stage.$scaleMode,r,i,e.contentWidth,e.contentHeight),a=n.stageWidth,o=n.stageHeight,s=n.displayWidth,h=n.displayHeight,u=(i-h)/2,l=(r-s)/2;egret_native.EGTView.setVisibleRect(l,u,s,h),egret_native.EGTView.setDesignSize(a,o),this.player.updateStageSize(a,o)},i.prototype.setContentSize=function(t,e){var r=this.playerOption;r.contentWidth=t,r.contentHeight=e,this.updateScreenSize()},i.prototype.updateMaxTouches=function(){this.nativeTouch.$updateMaxTouches()},i}(t.HashObject);e.NativePlayer=r,__reflect(r.prototype,"egret.native.NativePlayer",["egret.sys.Screen"])}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){function r(r){if(!s){s=!0,r||(r={}),i(r.renderMode);try{t.Capabilities.$setNativeCapabilities(egret_native.getVersion())}catch(n){}var a=t.ticker,o=e.$supportCmdBatch?function(){a.update(),e.$cmdManager.flush()}:function(){a.update()};egret_native.executeMainLoop(o,a),t.sys.screenAdapter||(r.screenAdapter?t.sys.screenAdapter=r.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}}function i(r){t.sys.RenderBuffer=e.NativeCanvasRenderBuffer,t.sys.CanvasRenderBuffer=e.NativeCanvasRenderBuffer,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=[],r=0;r<t.length;r++)e.push(t[r]);return e}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,r=this.arrayBufferLen;e[r++]=1e3;var i=t.___native_texture__p;e[r++]=i/4294967296>>>0,e[r++]=(4294967295&i)>>>0,this.arrayBufferLen=r}},t.prototype.clear=function(){this.arrayBufferLen=0,this.strArray.length=0},t.prototype.pushString=function(t){var e=this.strArray,r=e.length;return e[r]=t,r},t.prototype.clearScreen=function(t,e,r,i){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++]=r,n[a++]=i,this.arrayBufferLen=a},t.prototype.drawImage=function(t,e,r,i,n,a,o,s,h){this.arrayBufferLen+11>this.maxArrayBufferLen&&this.flush();var u=this.uint32View,l=this.float32View,c=this.arrayBufferLen;u[c++]=101,u[c++]=t/4294967296>>>0,u[c++]=(4294967295&t)>>>0,l[c++]=e,l[c++]=r,l[c++]=i,l[c++]=n,l[c++]=a,l[c++]=o,l[c++]=s,l[c++]=h,this.arrayBufferLen=c},t.prototype.setTransform=function(t,e,r,i,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++]=r,s[h++]=i,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,r=this.float32View,i=this.arrayBufferLen;e[i++]=106,r[i++]=t,this.arrayBufferLen=i},t.prototype.pushRectStencils=function(t){var e=t.length;this.arrayBufferLen+e+1>this.maxArrayBufferLen&&this.flush();var r=this.uint32View,i=this.float32View,n=this.arrayBufferLen;r[n++]=113,r[n++]=e;for(var a=0;e>a;a++)i[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 r=this.uint32View,i=this.float32View,n=this.arrayBufferLen;r[n++]=120,i[n++]=t,i[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,r,i){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++]=r,a[o++]=i,this.arrayBufferLen=o},t.prototype.clearRect=function(t,e,r,i){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++]=r,a[o++]=i,this.arrayBufferLen=o},t.prototype.createLabel=function(t,e,r,i){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++]=r,a[o++]=i,this.arrayBufferLen=o},t.prototype.drawText=function(t,e,r){this.arrayBufferLen+4>this.maxArrayBufferLen&&this.flush();var i=this.uint32View,n=this.float32View,a=this.arrayBufferLen;i[a++]=301,i[a++]=t,n[a++]=e,n[a++]=r,this.arrayBufferLen=a},t.prototype.setTextColor=function(t){this.arrayBufferLen+2>this.maxArrayBufferLen&&this.flush();var e=this.uint32View,r=this.arrayBufferLen;e[r++]=302,e[r++]=t,this.arrayBufferLen=r},t.prototype.setStrokeColor=function(t){this.arrayBufferLen+2>this.maxArrayBufferLen&&this.flush();var e=this.uint32View,r=this.arrayBufferLen;e[r++]=303,e[r++]=t,this.arrayBufferLen=r},t.prototype.setFillStyle=function(t){this.arrayBufferLen+2>this.maxArrayBufferLen&&this.flush();var e=this.uint32View,r=this.arrayBufferLen;e[r++]=1200,e[r++]=t,this.arrayBufferLen=r},t.prototype.setStrokeStyle=function(t){this.arrayBufferLen+2>this.maxArrayBufferLen&&this.flush();var e=this.uint32View,r=this.arrayBufferLen;e[r++]=1201,e[r++]=t,this.arrayBufferLen=r},t.prototype.setLineWidth=function(t){this.arrayBufferLen+2>this.maxArrayBufferLen&&this.flush();var e=this.uint32View,r=this.float32View,i=this.arrayBufferLen;e[i++]=1202,r[i++]=t,this.arrayBufferLen=i},t.prototype.moveTo=function(t,e){this.arrayBufferLen+3>this.maxArrayBufferLen&&this.flush();var r=this.uint32View,i=this.float32View,n=this.arrayBufferLen;r[n++]=207,i[n++]=t,i[n++]=e,this.arrayBufferLen=n},t.prototype.lineTo=function(t,e){this.arrayBufferLen+3>this.maxArrayBufferLen&&this.flush();var r=this.uint32View,i=this.float32View,n=this.arrayBufferLen;r[n++]=208,i[n++]=t,i[n++]=e,this.arrayBufferLen=n},t.prototype.fill=function(t){this.arrayBufferLen+2>this.maxArrayBufferLen&&this.flush();var e=this.uint32View,r=this.arrayBufferLen;e[r++]=203,e[r++]=t,this.arrayBufferLen=r},t.prototype.pushClip=function(t,e,r,i){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++]=r,a[o++]=i,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,r,i,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++]=r,s[h++]=i,s[h++]=n,o[h++]=a,this.arrayBufferLen=h},t.prototype.quadraticCurveTo=function(t,e,r,i){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++]=r,a[o++]=i,this.arrayBufferLen=o},t.prototype.fillRect=function(t,e,r,i){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++]=r,a[o++]=i,this.arrayBufferLen=o},t.prototype.strokeRect=function(t,e,r,i){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++]=r,a[o++]=i,this.arrayBufferLen=o},t.prototype.bezierCurveTo=function(t,e,r,i,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++]=r,s[h++]=i,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,r=this.arrayBufferLen;e[r++]=111,e[r++]=t,this.arrayBufferLen=r},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(){if(console.assert)console.assert.apply(console,a(arguments));else{var t=a(arguments);if(!t[0]){for(var e=[],r=1;r<t.length;r++)e.push(t[r]);console.error.apply(console,e)}}},t.log=function(){console.log.apply(console,a(arguments))},t.runEgret=r,t.updateAllScreens=n}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=function(e){function r(r,i,n,a,o){var s=e.call(this)||this;return s.arrFps=[],s.arrLog=[],(i||n)&&(s.panelX=void 0===o.x?0:parseInt(o.x),s.panelY=void 0===o.y?0:parseInt(o.y),s._stage=r,s.showFps=i,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),i&&s.addFps(),n&&s.addLog()),s}return __extends(r,e),r.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}}]},r.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},r.prototype.update=function(e){this.arrFps.push(e.fps);var r=0,i=this.arrFps.length;i>101&&(i=101,this.arrFps.shift());for(var n=this.arrFps[0],a=this.arrFps[0],o=0;i>o;o++){var s=this.arrFps[o];r+=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(r/i)+"\n"},{text:"Draw: "+e.draw+"\n"},{text:"Cost: "},{text:e.costTicker+" ",style:{textColor:1638142}},{text:e.costRender+" ",style:{textColor:16711680}}],this.updateLayout()},r.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()},r.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()}},r}(t.Sprite);e.NativeFps=r,__reflect(r.prototype,"egret.native.NativeFps",["egret.FPSDisplay","egret.DisplayObject"]),t.FPSDisplay=r}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){function r(t){return egret_native.getOption(t)}e.getOption=r,t.getOption=r}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){function r(e){var r=JSON.parse(e),n=r.functionName,a=i[n];if(a){var o=r.value;a.call(null,o)}else t.$warn(1050,n)}var i={},n=function(){function t(){}return t.call=function(t,e){var r={};r.functionName=t,r.value=e,egret_native.sendInfoToPlugin(JSON.stringify(r))},t.addCallback=function(t,e){i[t]=e},t}();e.NativeExternalInterface=n,__reflect(n.prototype,"egret.native.NativeExternalInterface",["egret.ExternalInterface"]),t.ExternalInterface=n,egret_native.receivedPluginInfo=r}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=function(r){function i(){var t=r.call(this)||this;return t.loaded=!1,t}return __extends(i,r),Object.defineProperty(i.prototype,"length",{get:function(){if(this.originAudio)return this.originAudio.duration;throw new Error("sound not loaded!")},enumerable:!0,configurable:!0}),i.prototype.load=function(e){function r(){var r=t.PromiseObject.create();r.onSuccessFunc=n,r.onErrorFunc=o,egret_native.download(e,e,r)}function n(){u.load(),i.clearAudios[this.url]&&delete i.clearAudios[this.url],i.$recycle(e,u)}function a(){s(),h.loaded=!0,h.dispatchEventWith(t.Event.COMPLETE)}function o(){s(),h.dispatchEventWith(t.IOErrorEvent.IO_ERROR)}function s(){u.removeEventListener("canplaythrough",a),u.removeEventListener("error",o)}var h=this;this.url=e;var u=new Audio(e);u.addEventListener("canplaythrough",a),u.addEventListener("error",o),this.originAudio=u,egret_native.isFileExists(e)?n():r()},i.prototype.play=function(r,n){r=+r||0,n=+n||0;var a=i.$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=r,o.$play(),t.sys.$pushSoundChannel(o),o},i.prototype.close=function(){0==this.loaded&&this.originAudio&&(this.originAudio.src=""),this.originAudio&&(this.originAudio=null),i.$clear(this.url)},i.$clear=function(t){i.clearAudios[t]=!0;var e=i.audios[t];e&&(e.length=0)},i.$pop=function(t){var e=i.audios[t];return e&&e.length>0?e.pop():null},i.$recycle=function(t,e){if(!i.clearAudios[t]){var r=i.audios[t];null==i.audios[t]&&(r=i.audios[t]=[]),r.push(e)}},i.MUSIC="music",i.EFFECT="effect",i.audios={},i.clearAudios={},i}(t.EventDispatcher);e.NativeSound=r,__reflect(r.prototype,"egret.native.NativeSound",["egret.Sound"]),__global.Audio&&(t.Sound=r)}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r={"source-over":[1,771],lighter:[770,1],"destination-out":[0,771],"destination-in":[0,770]},i=function(i){function n(){var e=null!==i&&i.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,i),Object.defineProperty(n.prototype,"globalCompositeOperation",{get:function(){return this.$globalCompositeOperation},set:function(t){this.$globalCompositeOperation=t;var i=r[t];i&&(e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.setBlendArg(i[0],i[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 r=e.$cmdManager.pushString(t);e.$cmdManager.setStrokeStyle(r)},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 r=e.$cmdManager.pushString(t);e.$cmdManager.setFillStyle(r)},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 r=t.split(","),i=parseInt(255*parseFloat(r[3])).toString(16),n=parseInt(r[0]).toString(16),a=parseInt(r[1]).toString(16),o=parseInt(r[2]).toString(16);return t="#"+this.$fillColorStr(i)+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 r=t.split(","),i=parseInt(r[0]).toString(16),n=parseInt(r[1]).toString(16),a=parseInt(r[2]).toString(16);return t="#"+this.$fillColorStr(i)+this.$fillColorStr(n)+this.$fillColorStr(a)},Object.defineProperty(n.prototype,"font",{get:function(){return this.$font},set:function(e){this.$font=e;var r=e.split(" "),i=r[2];if(-1!=i.indexOf("px")&&(this.$fontSize=parseInt(i.replace("px",""))),t.useFontMapping){var n=void 0;n=4==r.length?r[3]:r.slice(3).join(" ");var a=void 0;if(-1!=n.indexOf(", ")?a=n.split(", "):-1!=n.indexOf(",")&&(a=n.split(",")),a)for(var o=a.length,s=0;o>s;s++){var h=a[s];if(t.fontMapping[h])return void(this.$fontFamily=t.fontMapping[h])}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,r,i,n,a,o){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.arc(t,r,i,n,a,o?1:0)},n.prototype.quadraticCurveTo=function(t,r,i,n){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.quadraticCurveTo(t,r,i,n)},n.prototype.lineTo=function(t,r){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.lineTo(t,r)},n.prototype.fill=function(t){e.$cmdManager.setContext(this.$nativeContext);var r=e.$cmdManager.pushString(t);e.$cmdManager.fill(r)},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,r,i,n){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.rect(t,r,i,n),this.$clipRectArray.push({x:t,y:r,w:i,h:n})},n.prototype.moveTo=function(t,r){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.moveTo(t,r)},n.prototype.setLineDash=function(t){},n.prototype.fillRect=function(t,r,i,n){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.fillRect(t,r,i,n)},n.prototype.bezierCurveTo=function(t,r,i,n,a,o){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.bezierCurveTo(t,r,i,n,a,o)},n.prototype.stroke=function(){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.stroke()},n.prototype.strokeRect=function(t,r,i,n){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.strokeRect(t,r,i,n)},n.prototype.beginPath=function(){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.beginPath(),this.clipRectArray=this.$clipRectArray.concat()},n.prototype.arcTo=function(t,e,r,i,n){this.$nativeContext.arcTo(t,e,r,i,n)},n.prototype.transform=function(t,e,r,i,n,a){this.$matrix.append(t,e,r,i,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 r in t)this[r]=t[r];this.setTransformToNative(),e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.restore(),this.clipRectArray=null}},n.prototype.save=function(){var r=new t.Matrix;r.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:r,$clipRectArray:this.$clipRectArray.concat()}),e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.save()},n.prototype.clip=function(t){if(this.$clipRectArray.length>0){for(var r=[],i=0;i<this.$clipRectArray.length;i++){var n=this.$clipRectArray[i];r.push(n.x),r.push(n.y),r.push(n.w),r.push(n.h)}e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.pushRectStencils(r),this.$clipRectArray.length=0}},n.prototype.clearRect=function(t,r,i,n){e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.clearRect(t,r,i,n)},n.prototype.setTransform=function(t,e,r,i,n,a){this.$matrix.setTo(t,e,r,i,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,r,i){return this.$nativeContext.createLinearGradient(t,e,r,i)},n.prototype.createRadialGradient=function(t,e,r,i,n,a){return this.$nativeContext.createRadialGradient(t,e,r,i,n,a)},n.prototype.fillText=function(t,r,i,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,r,i)},n.prototype.strokeText=function(t,e,r,i){this.$hasStrokeText=!0},n.prototype.measureText=function(t){e.$cmdManager.setContext(egret_native.Label);var r=e.$cmdManager.pushString(this.$fontFamily),i=e.$cmdManager.pushString("");return e.$cmdManager.createLabel(r,this.$fontSize,i,this.$hasStrokeText?this.$lineWidth:0),e.$cmdManager.flush(),{width:egret_native.Label.getTextSize(t)[0]}},n.prototype.drawImage=function(t,r,i,n,a,o,s,h,u){var l,c;if(t.$nativeCanvas?(l=t.$nativeCanvas,c=!0):(l=t,c=!1),l){3==arguments.length?(o=r,s=i,r=0,i=0,n=h=t.width,a=u=t.height):5==arguments.length?(o=r,s=i,h=n,u=a,r=0,i=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==u&&(u=a));var f;c?f=l.___native_texture__p:(l._native_tex_loc||(l._native_tex_loc=l.___native_texture__p),f=l._native_tex_loc),e.$cmdManager.setContext(this.$nativeContext),e.$cmdManager.drawImage(f,r,i,n,a,o,s,h,u)}},n.prototype.drawMesh=function(t,r,i,n,a,o,s,h,u,l,c,f,p,d){var v;v=t.$nativeCanvas?t.$nativeCanvas:t,v&&(3==arguments.length?(o=r,s=i,r=0,i=0,n=h=t.width,a=u=t.height):5==arguments.length?(o=r,s=i,h=n,u=a,r=0,i=0,n=t.width,a=t.height):(n||(n=t.width),a||(a=t.height),o||(o=0),s||(s=0),h||(h=n),u||(u=a)),this.vertices=new Float32Array(p.length/2*5),this.indicesForMesh=new Uint32Array(d.length),this.cacheArrays(this.$matrix,1,r,i,n,a,o,s,h,u,l,c,f,p,d),e.$cmdManager.flush(),this.$nativeContext.drawMesh(v,this.vertices,this.indicesForMesh,this.vertices.length,this.indicesForMesh.length))},n.prototype.cacheArrays=function(t,e,r,i,n,a,o,s,h,u,l,c,f,p,d){var v=t,g=v.a,y=v.b,$=v.c,x=v.d,m=v.tx,_=v.ty;(0!=o||0!=s)&&v.append(1,0,0,1,o,s),(n/h!=1||a/u!=1)&&v.append(h/n,0,0,u/a,0,0);var C=v.a,b=v.b,S=v.c,T=v.d,w=v.tx,L=v.ty;if(v.a=g,v.b=y,v.c=$,v.d=x,v.tx=m,v.ty=_,p){var E=this.vertices,B=0,O=0,A=0,R=0,M=0,F=0,P=0;for(B=0,A=f.length;A>B;B+=2)O=5*B/2,F=p[B],P=p[B+1],R=f[B],M=f[B+1],E[O+0]=C*F+S*P+w,E[O+1]=b*F+T*P+L,E[O+2]=(r+R*n)/l,E[O+3]=(i+M*a)/c,E[O+4]=e;for(B=0;B<d.length;B++)this.indicesForMesh[B]=d[B]}else console.log("meshVertices not exist")},n.prototype.createPattern=function(t,e){return null},n.prototype.getImageData=function(t,r,i,n){e.$cmdManager.flush();var a;return t!=Math.floor(t)&&(t=Math.floor(t),i++),r!=Math.floor(r)&&(r=Math.floor(r),n++),a=this.$nativeContext.getPixels(t,r,i,n),a.pixelData&&(a.data=a.pixelData),a},n.prototype.setGlobalShader=function(t){e.$cmdManager.setContext(this.$nativeContext);var r;r=t?e.$cmdManager.pushString(t.$toJson()):e.$cmdManager.pushString(""),e.$cmdManager.setGlobalShader(r)},n}(t.HashObject);e.NativeCanvasRenderContext=i,__reflect(i.prototype,"egret.native.NativeCanvasRenderContext")}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=function(r){function i(){var t=r.call(this)||this;return t.loaded=!1,t}return __extends(i,r),Object.defineProperty(i.prototype,"length",{get:function(){throw new Error("sound length not supported")},enumerable:!0,configurable:!0}),i.prototype.load=function(e){function r(){var r=t.PromiseObject.create();r.onSuccessFunc=i,r.onErrorFunc=function(){t.IOErrorEvent.dispatchIOErrorEvent(n)},egret_native.download(e,e,r)}function i(){n.loaded=!0,n.preload()}var n=this;this.url=e,egret_native.isFileExists(e)?__global.setTimeout?__global.setTimeout(i,0):t.$callAsync(i,n):r()},i.prototype.preload=function(){var e=this;if(e.type==t.Sound.EFFECT){var r=new t.PromiseObject;r.onSuccessFunc=function(r){e.dispatchEventWith(t.Event.COMPLETE)},egret_native.Audio.preloadEffectAsync(e.url,r)}else e.dispatchEventWith(t.Event.COMPLETE)},i.prototype.play=function(r,i){r=+r||0,i=+i||0;var n=new e.NaSoundChannel;return n.$url=this.url,n.$loops=i,n.$type=this.type,n.$startTime=r,n.$play(),t.sys.$pushSoundChannel(n),n},i.prototype.close=function(){},i.MUSIC="music",i.EFFECT="effect",i}(t.EventDispatcher);e.NaSound=r,__reflect(r.prototype,"egret.native.NaSound",["egret.Sound"]),__global.Audio||(t.Sound=r)}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=function(e){function r(){var t=e.call(this)||this;return t.$startTime=0,t.isStopped=!1,t._startTime=0,t}return __extends(r,e),r.prototype.$play=function(){this.isStopped=!1,this.$type==t.Sound.EFFECT?this._effectId=egret_native.Audio.playEffect(this.$url,1!=this.$loops):(r.currentPath=this.$url,egret_native.Audio.playBackgroundMusic(this.$url,1!=this.$loops)),this._startTime=Date.now()},r.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==r.currentPath&&egret_native.Audio.stopBackgroundMusic(!1)},Object.defineProperty(r.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(r.prototype,"position",{get:function(){return(Date.now()-this._startTime)/1e3},enumerable:!0,configurable:!0}),r}(t.EventDispatcher);e.NaSoundChannel=r,__reflect(r.prototype,"egret.native.NaSoundChannel",["egret.SoundChannel","egret.IEventDispatcher"])}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=function(r){function i(e,i){void 0===i&&(i=!0);var n=r.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=i,__global.Video||t.$error(1044),e&&n.load(e,i),n}return __extends(i,r),i.prototype.load=function(e,r){if(void 0===r&&(r=!0),!this.loading)if(0==e.indexOf("/")&&(e=e.slice(1,e.length)),this.src=e,this.loading=!0,this.loaded=!1,r&&!egret_native.isFileExists(e)){var i=this,n=t.PromiseObject.create();n.onSuccessFunc=function(){i.loadEnd()},n.onErrorFunc=function(){t.$warn(1048),i.dispatchEventWith(t.IOErrorEvent.IO_ERROR)},egret_native.download(e,e,n)}else this.loadEnd()},i.prototype.loadEnd=function(){function e(){a.setVideoRect(0,0,1,1),a.play()}function r(){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 i(){n(),o.dispatchEventWith(t.IOErrorEvent.IO_ERROR)}function n(){a.removeEventListener("canplaythrough",e),a.removeEventListener("error",i),a.removeEventListener("playing",r)}var a=new __global.Video(this.src);a.setVideoRect(0,0,1,1),a.setKeepRatio(!1),a.addEventListener("canplaythrough",e),a.addEventListener("error",i),a.addEventListener("playing",r),a.load();var o=this},i.prototype.play=function(e,r){var i=this;if(void 0===r&&(r=!1),this.loop=r,!this.loaded)return this.load(this.src),void this.once(t.Event.COMPLETE,function(t){return i.play(e,r)},this);var n=!1;void 0!=e&&e!=this.originVideo.currentTime&&(this.originVideo.currentTime=e||0,n=!0),this.startPlay(n)},i.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))},i.prototype.stopPlay=function(){t.stopTick(this.markDirty,this),this.isPlayed&&(this.isPlayed=!1,this.originVideo.pause())},i.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(i.prototype,"poster",{get:function(){return this.posterUrl},set:function(r){var i=this;this.posterUrl=r;var n=new e.NativeImageLoader;n.load(r),n.addEventListener(t.Event.COMPLETE,function(){i.posterData=n.data,i.markDirty()},this)},enumerable:!0,configurable:!0}),Object.defineProperty(i.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(i.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(i.prototype,"position",{get:function(){return this.originVideo.currentTime},set:function(t){this.loaded&&(this.originVideo.currentTime=t)},enumerable:!0,configurable:!0}),i.prototype.pause=function(){this.originVideo.pause()},Object.defineProperty(i.prototype,"bitmapData",{get:function(){return this._bitmapData},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"length",{get:function(){if(this.loaded)return this.originVideo.duration;throw new Error("Video not loaded!")},enumerable:!0,configurable:!0}),i.prototype.$onAddToStage=function(t,e){this.isAddToStage=!0,this.originVideo&&this.originVideo.setVideoVisible(!0),r.prototype.$onAddToStage.call(this,t,e)},i.prototype.$onRemoveFromStage=function(){this.isAddToStage=!1,this.originVideo&&(this.stopPlay(),this.originVideo.setVideoVisible(!1)),r.prototype.$onRemoveFromStage.call(this)},i.prototype.getPlayWidth=function(){return isNaN(this.widthSet)?this.bitmapData?this.bitmapData.width:this.posterData?this.posterData.width:0/0:this.widthSet},i.prototype.getPlayHeight=function(){return isNaN(this.heightSet)?this.bitmapData?this.bitmapData.height:this.posterData?this.posterData.height:0/0:this.heightSet},i.prototype.$setHeight=function(t){this.heightSet=+t||0,this.setVideoSize(),r.prototype.$setHeight.call(this,t)},i.prototype.$setWidth=function(t){this.widthSet=+t||0,this.setVideoSize(),r.prototype.$setWidth.call(this,t)},i.prototype.$setX=function(t){var e=r.prototype.$setX.call(this,t);return this.setVideoSize(),e},i.prototype.$setY=function(t){var e=r.prototype.$setY.call(this,t);return this.setVideoSize(),e},i.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))},i.prototype.$measureContentBounds=function(t){var e=this.posterData;e?t.setTo(0,0,this.getPlayWidth(),this.getPlayHeight()):t.setEmpty()},i.prototype.$updateRenderNode=function(){var t=this.$renderNode,e=this.posterData,r=this.getPlayWidth(),i=this.getPlayHeight();0>=r||0>=i||(!this.isPlayed&&e?(t.image=e,t.drawImage(0,0,e.width,e.height,0,0,r,i)):this.isPlayed&&this.setVideoSize())},i.prototype.markDirty=function(){return this.$renderDirty=!0,!0},i}(t.DisplayObject);e.NativeVideo=r,__reflect(r.prototype,"egret.native.NativeVideo",["egret.Video","egret.DisplayObject"]),__global.Video?t.Video=r:t.$warn(1044)}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r;!function(r){function i(t){return u[t]}function n(e,r){r=void 0===r?"undefined":null===r?"null":r.toString(),u[e]=r;try{return s(),!0}catch(i){return t.$warn(1018,e,r),!1}}function a(t){delete u[t],s()}function o(){for(var t in u)delete u[t];s()}function s(){egret_native.saveRecord(h,JSON.stringify(u))}var h="LocalStorage.local",u={};if(egret_native.isRecordExists(h)){var l=egret_native.loadRecord(h);try{u=JSON.parse(l)}catch(c){u={}}}else u={};e.getItem=i,e.setItem=n,e.removeItem=a,e.clear=o}(r=e["native"]||(e["native"]={}))}(e=t.localStorage||(t.localStorage={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){t.NativeLifeCycleHandler=function(t){egret_native.pauseApp=function(){t.pause(),egret_native.Audio.pauseBackgroundMusic(),egret_native.Audio.pauseAllEffects()},egret_native.resumeApp=function(){t.resume(),egret_native.Audio.resumeBackgroundMusic(),egret_native.Audio.resumeAllEffects()}}}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t._downCount=0,t._path=null,t._bytesTotal=0,t}return __extends(r,e),r.prototype.load=function(t,e){this._downCount=0,this._path=t,this._bytesTotal=e,this.reload()},r.prototype.reload=function(){if(this._downCount>=3)return void this.downloadFileError();this._downCount++;var e=t.PromiseObject.create(),r=this;e.onSuccessFunc=function(){r.loadOver()},e.onErrorFunc=function(){r.reload()},e.downloadingSizeFunc=function(t){r.downloadingProgress(t)},egret_native.download(this._path,this._path,e)},r.prototype.downloadingProgress=function(e){t.ProgressEvent.dispatchProgressEvent(this,t.ProgressEvent.PROGRESS,e,this._bytesTotal)},r.prototype.downloadFileError=function(){this.dispatchEvent(new t.Event(t.IOErrorEvent.IO_ERROR))},r.prototype.loadOver=function(){this.dispatchEvent(new t.Event(t.Event.COMPLETE))},r}(t.EventDispatcher);t.NativeResourceLoader=e,__reflect(e.prototype,"egret.NativeResourceLoader")}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=function(e){function r(r){var i=e.call(this)||this;i.$touch=new t.sys.TouchHandler(r);var n=i;return egret_native.onTouchesBegin=function(t,e,r,i){n.$executeTouchCallback(t,e,r,i,n.$touch.onTouchBegin)},egret_native.onTouchesMove=function(t,e,r,i){n.$executeTouchCallback(t,e,r,i,n.$touch.onTouchMove)},egret_native.onTouchesEnd=function(t,e,r,i){n.$executeTouchCallback(t,e,r,i,n.$touch.onTouchEnd)},egret_native.onTouchesCancel=function(t,e,r,i){},i}return __extends(r,e),r.prototype.$executeTouchCallback=function(t,e,r,i,n){for(var a=0;t>a;a++){var o=e[a],s=r[a],h=i[a];n.call(this.$touch,s,h,o)}},r.prototype.$updateMaxTouches=function(){this.$touch.$initMaxTouches()},r}(t.HashObject);e.NativeTouchHandler=r,__reflect(r.prototype,"egret.native.NativeTouchHandler")}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=function(e){function r(){var t=e.call(this)||this;return t._url="",t._method="",t.urlData={},t.responseHeader="",t}return __extends(r,e),Object.defineProperty(r.prototype,"response",{get:function(){return this._response},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"responseType",{get:function(){return this._responseType},set:function(t){this._responseType=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"withCredentials",{get:function(){return this._withCredentials},set:function(t){this._withCredentials=t},enumerable:!0,configurable:!0}),r.prototype.open=function(t,e){void 0===e&&(e="GET"),this._url=t,this._method=e},r.prototype.send=function(e){function r(){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 i(){var e=t.PromiseObject.create();e.onSuccessFunc=r,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)?r():i()},r.prototype.isNetUrl=function(t){return-1!=t.indexOf("http://")||-1!=t.indexOf("HTTP://")||-1!=t.indexOf("https://")||-1!=t.indexOf("HTTPS://")},r.prototype.abort=function(){},r.prototype.onResponseHeader=function(t){this.responseHeader="";var e=JSON.parse(t);for(var r in e)this.responseHeader+=r+": "+e[r]+"\r\n"},r.prototype.getAllResponseHeaders=function(){return this.responseHeader},r.prototype.setRequestHeader=function(t,e){this.headerObj||(this.headerObj={}),this.headerObj[t]=e},r.prototype.getResponseHeader=function(t){return""},r}(t.EventDispatcher);e.NativeHttpRequest=r,__reflect(r.prototype,"egret.native.NativeHttpRequest",["egret.HttpRequest"]),t.HttpRequest=r}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.data=null,t._crossOrigin=null,t}return __extends(r,e),Object.defineProperty(r.prototype,"crossOrigin",{get:function(){return this._crossOrigin},set:function(t){this._crossOrigin=t},enumerable:!0,configurable:!0}),r.prototype.load=function(t){this.check(t)},r.prototype.check=function(t){var e=this;e.isNetUrl(t)?e.download(t):egret_native.isFileExists(t)?e.loadTexture(t):e.download(t)},r.prototype.download=function(e){var r=this,i=t.PromiseObject.create();i.onSuccessFunc=function(){r.loadTexture(e)},i.onErrorFunc=function(){r.dispatchEventWith(t.IOErrorEvent.IO_ERROR)},egret_native.download(e,e,i)},r.prototype.loadTexture=function(e){var r=this,i=new t.PromiseObject;i.onSuccessFunc=function(e){r.data=new t.BitmapData(e),r.dispatchEventWith(t.Event.COMPLETE)},i.onErrorFunc=function(){r.dispatchEventWith(t.IOErrorEvent.IO_ERROR)},egret_native.Texture.addTextureAsyn(e,i)},r.prototype.isNetUrl=function(t){return-1!=t.indexOf("http://")||-1!=t.indexOf("HTTP://")||-1!=t.indexOf("https://")||-1!=t.indexOf("HTTPS://")},r.crossOrigin=null,r}(t.EventDispatcher);e.NativeImageLoader=r,__reflect(r.prototype,"egret.native.NativeImageLoader",["egret.ImageLoader"]),t.ImageLoader=r}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=function(e){function r(){var t=e.call(this)||this;return t.textValue="",t.colorValue=16777215,t.isFinishDown=!1,t.textValue="",t}return __extends(r,e),r.prototype.$getText=function(){return this.textValue||(this.textValue=""),this.textValue},r.prototype.$setText=function(t){return this.textValue=t,!0},r.prototype.$setColor=function(t){return this.colorValue=t,!0},r.prototype.$onBlur=function(){},r.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(r){e.$textfield.multiline?(e.textValue=r,e.dispatchEvent(new t.Event("updateText")),e.isFinishDown&&(e.isFinishDown=!1,e.dispatchEvent(new t.Event("blur")))):(e.textValue=r.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)}},r.prototype.$show=function(){var e=this,r=this.$textfield,i=r.$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:i[2]}))},egret_native.EGT_keyboardDidHide=function(){},egret_native.EGT_deleteBackward=function(){};var n=i[37],a=i[30]?0:6,o=-1;n==t.TextFieldInputType.PASSWORD?o=0:n==t.TextFieldInputType.TEL&&(a=3);var s=1,h=i[21]<=0?-1:i[21],u=(r.$getRenderNode(),this.$textfield.localToGlobal(0,0));egret_native.TextInputOp.setKeybordOpen(!0,JSON.stringify({inputMode:a,inputFlag:o,returnType:s,maxLength:h,x:u.x,y:u.y,width:r.width,height:r.height,font_size:i[0],font_color:i[2],textAlign:i[9],verticalAlign:i[10]}))},r.prototype.$hide=function(){egret_native.TextInputOp.setKeybordOpen(!1),this.dispatchEvent(new t.Event("blur"))},r.prototype.$resetStageText=function(){},r.prototype.$addToStage=function(){},r.prototype.$removeFromStage=function(){},r.prototype.$setTextField=function(t){return this.$textfield=t,!0},r}(t.EventDispatcher);e.NativeStageText=r,__reflect(r.prototype,"egret.native.NativeStageText",["egret.StageText"]),t.StageText=r}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){function r(t){var e=egret_native.xmlStr2JsonStr(t);e=e.replace(/\n/g,"\\n");var r=JSON.parse(e);return i(r,null)}function i(t,e){if("parsererror"==t.localName)throw new Error(t.textContent);var r=new a(t.localName,e,t.prefix,t.namespace,t.name),n=t.attributes,s=r.attributes;for(var h in n)s[h]=r["$"+h]=n[h];for(var u=t.children,l=u.length,c=r.children,f=0;l>f;f++){var p=u[f],d=p.nodeType,v=null;if(1==d)v=i(p,r);else if(3==d){var g=p.text.trim();g&&(v=new o(g,r))}v&&c.push(v)}return r}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,r,i,n,a){var o=t.call(this,1,r)||this;return o.attributes={},o.children=[],o.localName=e,o.prefix=i,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,r){var i=t.call(this,3,r)||this;return i.text=e,i}return __extends(e,t),e}(n);e.XMLText=o,__reflect(o.prototype,"egret.web.XMLText"),t.XML={parse:r}}(e=t.web||(t.web={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));