qqPlayCore.js 553 KB

1
  1. var qqPlayCoreBuildInfo = { buildPath:'/branches/7.8.0_dev',version:'5608',creator:'wesleyxiao',buildTime:'Wed Oct 24 2018 21:53:12 GMT+0800 (GMT+08:00)'};function clone_(t){var e,i,r;if("object"!=typeof t||null===t)return t;if(t instanceof Array)for(e=[],i=0,r=t.length;i<r;i++)"object"==typeof t[i]&&null!=t[i]?e[i]=arguments.callee(t[i]):e[i]=t[i];else{e={};for(i in t)"object"==typeof t[i]&&null!=t[i]?e[i]=arguments.callee(t[i]):e[i]=t[i]}return e}function Canvas(){var t=arguments.length;this._shadowColor={r:0,g:0,b:0,a:0},this._shadowOffset={x:0,y:0},this._shadowRadius=0,this._textBaseLine=0,this._textAlign=0,this._useH5Mode=0,this._a=1,this._b=0,this._c=0,this._d=1,this._tx=0,this._ty=0,2==t&&(this.__nativeObj=new BK.CanvasNode(arguments[0],arguments[1]),this.setFlipXY(0,1),Object.getOwnPropertyNames(this.__nativeObj).forEach(function(t){var e=t;"scale"!=e&&"transform"!=e&&"contentSize"!=e&&"size"!=e&&"fontPath"!=e&&Object.defineProperty(this,e,{get:function(){return this.__nativeObj[e]},set:function(t){this.__nativeObj[e]=t}})},this),Object.defineProperty(Canvas.prototype,"fontPath",{get:function(){return this.__nativeObj.fontPath},set:function(t){BK.FileUtil.isFileExist(t)&&(this.__nativeObj.fontPath=t)},enumerable:!0,configurable:!0}),Object.defineProperty(Canvas.prototype,"contentSize",{get:function(){return this.__nativeObj.contentSize},set:function(t){this.__nativeObj.contentSize=t,this.__nativeObj.resetCanvas()},enumerable:!0,configurable:!0}),Object.defineProperty(Canvas.prototype,"size",{get:function(){return this.__nativeObj.size},set:function(t){this.__nativeObj.size=t,this.__nativeObj.resetCanvas()},enumerable:!0,configurable:!0}),Object.defineProperty(Canvas.prototype,"textBaseline",{get:function(){return this._textBaseLine},set:function(t){switch(t){case 0:case 1:case 2:this._textBaseLine=t;break;case"bottom":case"Bottom":this._textBaseLine=0;break;case"Middle":case"middle":this._textBaseLine=1;break;case"Top":case"top":this._textBaseLine=2}},enumerable:!0,configurable:!0}),Object.defineProperty(Canvas.prototype,"textAlign",{get:function(){return this._textAlign},set:function(t){switch(t){case 0:case 1:case 2:this._textAlign=t;break;case"left":this._textAlign=0;break;case"center":this._textAlign=1;break;case"right":this._textAlign=2}this.__nativeObj.setTextAlign(this._textAlign)},enumerable:!0,configurable:!0}),Object.defineProperty(Canvas.prototype,"lineWidth",{get:function(){return this.__nativeObj.lineWidth},set:function(t){this.__nativeObj.lineWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(Canvas.prototype,"globalAlpha",{get:function(){return this.__nativeObj.globalAlpha},set:function(t){t=Math.min(1,t),t=Math.max(0,t),this.__nativeObj.globalAlpha=t},enumerable:!0,configurable:!0}),Object.defineProperty(Canvas.prototype,"fillColor",{get:function(){return this.__nativeObj.fillColor},set:function(t){this.__nativeObj.fillColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(Canvas.prototype,"strokeColor",{get:function(){return this.__nativeObj.strokeColor},set:function(t){this.__nativeObj.strokeColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(Canvas.prototype,"lineCap",{get:function(){return this.__nativeObj.lineCap},set:function(t){this.__nativeObj.lineCap=t},enumerable:!0,configurable:!0}),Object.defineProperty(Canvas.prototype,"lineJoin",{get:function(){return this.__nativeObj.lineJoin},set:function(t){this.__nativeObj.lineJoin=t},enumerable:!0,configurable:!0}),Object.defineProperty(Canvas.prototype,"miterLimit",{get:function(){return this.__nativeObj.miterLimit},set:function(t){this.__nativeObj.miterLimit=t},enumerable:!0,configurable:!0}))}function inverseMatrix(t,e,i,r,n,o){var a=t,s=i,h=n,c=e,l=r,u=o,d=a*l*1+s*u*0+h*c*0-h*l*0-s*c*1-a*u*0,_=-1*(1*c-0*u)/d,f=1*(0*c-0*l)/d,g=-1*(1*s-0*h)/d,p=-1*(0*a-0*s)/d,m=1*(s*u-h*l)/d,v=-1*(a*u-h*c)/d,S=g;g=_,_=S;S=m;m=f,f=S;S=p;return p=v,v=S,[1*(1*l-0*u)/d,g,_,1*(1*a-0*h)/d,f,p]}function bkWebGLGetInstance(){return gl||(gl=new BK.WebGL,attatchConst(),attachMethod(),gl.OpenOptMode=OpenOptMode,gl.viewport(0,0,BK.Director.screenPixelSize.width,BK.Director.screenPixelSize.height)),Object.prototype.hasOwnProperty.call(this,"renderTicker")&&renderTicker.setTickerCallBack(function(t,e){}),gl}function __bkIsSupportTypedArray(){if(void 0==isSupportTA){"android"==GameStatusInfo.platform&&(isSupportTA=!0);var t=BK.Director.queryDeviceInfo(),e=t.version.split(".");"ios"==t.platform&&Number(e[0])>=10||"android"==t.platform?isSupportTA=!0:(BK.Script.log(1,0,"Current Device dont supoort TypedArray.[info = "+JSON.stringify(t)+"]"),isSupportTA=!1)}return isSupportTA}function __TypedArrayGetData(t){if(Object.prototype.hasOwnProperty.call(t,"__rawBKData"))return t.__rawBKData;if(Object.prototype.hasOwnProperty.call(t,"__nativeObj"))return t.__nativeObj;if(0==__bkIsSupportTypedArray()){var e=t instanceof ArrayBuffer;return BK.Misc.arrayBufferToBKBuffer(e?t:t.buffer,e?0:t.byteOffset,t.byteLength)}return t}function checkFirstFrames(){0==firstFrameUpload&&(BK.MQQ.SsoRequest.send({},"cs.first_frame_drawn.local"),firstFrameUpload=!0)}function activeTexture(t){glpause||gl.glActiveTexture(t)}function attachShader(t,e){glpause||gl.glAttachShader(t,e)}function bindAttribLocation(t,e,i){glpause||gl.glBindAttribLocation(t,e,i)}function bindBuffer(t,e){glpause||gl.glBindBuffer(t,e)}function bindFramebuffer(t,e){glpause||gl.glBindFramebuffer(t,e)}function bindRenderbuffer(t,e){glpause||gl.glBindRenderbuffer(t,e)}function bindTexture(t,e){glpause||gl.glBindTexture(t,e)}function blendColor(t,e,i,r){glpause||gl.glBlendColor(t,e,i,r)}function blendEquation(t){glpause||gl.glBlendEquation(t)}function blendEquationSeparate(t,e){glpause||gl.glBlendEquationSeparate(t,e)}function blendFunc(t,e){glpause||gl.glBlendFunc(t,e)}function blendFuncSeparate(t,e,i,r){glpause||gl.glBlendFuncSeparate(t,e,i,r)}function bufferData(t,e,i){glpause||("number"!=typeof e?gl.glBufferData(t,__TypedArrayGetData(e),i):gl.glBufferData(t,e,i))}function bufferSubData(t,e,i){glpause||gl.glBufferSubData(t,e,__TypedArrayGetData(i))}function checkFramebufferStatus(t){if(!glpause)return gl.glCheckFramebufferStatus(t)}function clear(t){glpause||gl.glClear(t)}function clearColor(t,e,i,r){glpause||gl.glClearColor(t,e,i,r)}function clearDepth(t){glpause||gl.glClearDepth(t)}function clearStencil(t){glpause||gl.glClearStencil(t)}function colorMask(t,e,i,r){glpause||gl.glColorMask(t,e,i,r)}function compileShader(t){glpause||gl.glCompileShader(t)}function compressedTexImage2D(t,e,i,r,n,o,a){glpause||gl.glCompressedTexImage2D(t,e,i,r,n,o,a)}function compressedTexSubImage2D(t,e,i,r,n,o,a,s){glpause||gl.glCompressedTexSubImage2D(t,e,i,r,n,o,a,s)}function copyTexImage2D(t,e,i,r,n,o,a,s){glpause||gl.glCopyTexImage2D(t,e,i,r,n,o,a,s)}function copyTexSubImage2D(t,e,i,r,n,o,a,s){glpause||gl.glCopyTexSubImage2D(t,e,i,r,n,o,a,s)}function createBuffer(){return glpause?-1:gl.glCreateBuffer()}function createFramebuffer(){return glpause?-1:gl.glCreateFramebuffer()}function createProgram(){return glpause?-1:gl.glCreateProgram()}function createRenderbuffer(){return glpause?-1:gl.glCreateRenderbuffer()}function createShader(t){return glpause?-1:gl.glCreateShader(t)}function createTexture(){return glpause?-1:gl.glCreateTexture()}function cullFace(t){glpause||gl.glCullFace(t)}function deleteBuffer(t){glpause||gl.glDeleteBuffer(t)}function deleteFramebuffer(t){glpause||gl.glDeleteFramebuffer(t)}function deleteProgram(t){glpause||gl.glDeleteProgram(t)}function deleteRenderbuffer(t){glpause||gl.glDeleteRenderbuffer(t)}function deleteShader(t){glpause||gl.glDeleteShader(t)}function deleteTexture(t){glpause||gl.glDeleteTexture(t)}function depthFunc(t){glpause||gl.glDepthFunc(t)}function depthMask(t){glpause||gl.glDepthMask(t)}function depthRange(t,e){glpause||gl.glDepthRange(t,e)}function detachShader(t,e){glpause||gl.glDetachShader(t,e)}function disable(t){glpause||gl.glDisable(t)}function disableVertexAttribArray(t){glpause||gl.glDisableVertexAttribArray(t)}function drawArrays(t,e,i){glpause||(gl.glDrawArrays(t,e,i),i>0&&checkFirstFrames())}function drawElements(t,e,i,r){glpause||(gl.glDrawElements(t,e,i,r),e>0&&checkFirstFrames())}function enable(t){glpause||gl.glEnable(t)}function enableVertexAttribArray(t){glpause||gl.glEnableVertexAttribArray(t)}function finish(){glpause||gl.glFinish()}function flush(){glpause||gl.glFlush()}function framebufferRenderbuffer(t,e,i,r){glpause||gl.glFramebufferRenderbuffer(t,e,i,r)}function framebufferTexture2D(t,e,i,r,n){glpause||gl.glFramebufferTexture2D(t,e,i,r,n)}function frontFace(t){glpause||gl.glFrontFace(t)}function generateMipmap(t){glpause||gl.glGenerateMipmap(t)}function getAttribLocation(t,e){return glpause?-1:gl.glGetAttribLocation(t,e)}function getError(){return glpause?null:gl.glGetError()}function getShaderPrecisionFormat(t,e){return glpause?-1:gl.glGetShaderPrecisionFormat(t,e)}function getProgramInfoLog(t){return glpause?null:gl.glGetProgramInfoLog(t)}function getShaderInfoLog(t){return glpause?null:gl.glGetShaderInfoLog(t)}function getShaderSource(t){return glpause?null:gl.glGetShaderSource(t)}function getUniformLocation(t,e){return glpause?-1:gl.glGetUniformLocation(t,e)}function getVertexAttribOffset(t,e){return glpause?-1:gl.glGetVertexAttribOffset(t,e)}function hint(t,e){glpause||gl.glHint(t,e)}function isBuffer(t){return!glpause&&gl.glIsBuffer(t)}function isEnabled(t){return!glpause&&gl.glIsEnabled(t)}function isFramebuffer(t){return!glpause&&gl.glIsFramebuffer(t)}function isProgram(t){return!glpause&&gl.glIsProgram(t)}function isRenderbuffer(t){return!glpause&&gl.glIsRenderbuffer(t)}function isShader(t){return!glpause&&gl.glIsShader(t)}function isTexture(t){return!glpause&&gl.glIsTexture(t)}function lineWidth(t){glpause||gl.glLineWidth(t)}function linkProgram(t){glpause||gl.glLinkProgram(t)}function pixelStorei(t,e){glpause||gl.glPixelStorei(t,e)}function polygonOffset(t,e){glpause||gl.glPolygonOffset(t,e)}function readPixels(t,e,i,r,n,o,a){}function renderbufferStorage(t,e,i,r){glpause||gl.glRenderbufferStorage(t,e,i,r)}function sampleCoverage(t,e){glpause||gl.glSampleCoverage(t,e)}function scissor(t,e,i,r){glpause||gl.glScissor(t,e,i,r)}function shaderSource(t,e){glpause||gl.glShaderSource(t,e)}function stencilFunc(t,e,i){glpause||gl.glStencilFunc(t,e,i)}function stencilFuncSeparate(t,e,i,r){glpause||gl.glStencilFuncSeparate(t,e,i,r)}function stencilMask(t){glpause||gl.glStencilMask(t)}function stencilMaskSeparate(t,e){glpause||gl.glStencilMaskSeparate(t,e)}function stencilOp(t,e,i){glpause||gl.glStencilOp(t,e,i)}function stencilOpSeparate(t,e,i,r){glpause||gl.glStencilOpSeparate(t,e,i,r)}function texImage2D(t,e,i){if(!glpause)switch(arguments.length){case 6:var r=arguments[3],n=arguments[4],o=arguments[5];Object.prototype.hasOwnProperty.call(o,"__nativeObj")?gl.glTexImage2D(t,e,i,r,n,o.__nativeObj):Object.prototype.hasOwnProperty.call(o,"buffer")&&Object.prototype.hasOwnProperty.call(o.buffer,"eof")&&Object.prototype.hasOwnProperty.call(o.buffer,"pointer")&&Object.prototype.hasOwnProperty.call(o.buffer,"netOrder")&&o.width>0&&o.height>0?gl.glTexImage2D(t,e,i,r,n,o):Object.prototype.hasOwnProperty.call(o,"buffer")&&o.buffer.__proto__.hasOwnProperty("eof")&&o.buffer.__proto__.hasOwnProperty("pointer")&&o.buffer.__proto__.hasOwnProperty("netOrder")&&o.width>0&&o.height>0&&gl.glTexImage2D(t,e,i,r,n,o);break;case 9:var a=arguments[3],s=arguments[4],h=arguments[5],r=arguments[6],n=arguments[7],c=arguments[8];gl.glTexImage2D(t,e,i,a,s,h,r,n,c)}}function texParameterf(t,e,i){glpause||gl.glTexParameterf(t,e,i)}function texParameteri(t,e,i){glpause||gl.glTexParameteri(t,e,i)}function texSubImage2D(t,e,i,r){if(!glpause)switch(arguments.length){case 7:var n=arguments[4],o=arguments[5],a=arguments[6];Object.prototype.hasOwnProperty.call(a,"__nativeObj")?gl.glTexSubImage2D(t,e,i,r,n,o,a.__nativeObj):gl.glTexSubImage2D(t,e,i,r,n,o,a);break;case 9:var s=arguments[4],h=arguments[5],n=arguments[6],o=arguments[7],c=arguments[8];gl.glTexSubImage2D(t,e,i,r,s,h,n,o,c)}}function uniform1f(t,e){glpause||gl.glUniform1f(t,e)}function uniform2f(t,e,i){glpause||gl.glUniform2f(t,e,i)}function uniform3f(t,e,i,r){glpause||gl.glUniform3f(t,e,i,r)}function uniform4f(t,e,i,r,n){glpause||gl.glUniform4f(t,e,i,r,n)}function uniform1i(t,e){glpause||gl.glUniform1i(t,e)}function uniform2i(t,e,i){glpause||gl.glUniform2i(t,e,i)}function uniform3i(t,e,i,r){glpause||gl.glUniform3i(t,e,i,r)}function uniform4i(t,e,i,r,n){glpause||gl.glUniform4i(t,e,i,r,n)}function uniform1fv(t,e){glpause||gl.glUniform1fv(t,__TypedArrayGetData(e instanceof Array==1?new Float32Array(e):e))}function uniform2fv(t,e){glpause||gl.glUniform2fv(t,__TypedArrayGetData(e instanceof Array==1?new Float32Array(e):e))}function uniform3fv(t,e){glpause||gl.glUniform3fv(t,__TypedArrayGetData(e instanceof Array==1?new Float32Array(e):e))}function uniform4fv(t,e){glpause||gl.glUniform4fv(t,__TypedArrayGetData(e instanceof Array==1?new Float32Array(e):e))}function uniform1iv(t,e){glpause||gl.glUniform1iv(t,__TypedArrayGetData(e instanceof Array==1?new Int32Array(e):e))}function uniform2iv(t,e){glpause||gl.glUniform2iv(t,__TypedArrayGetData(e instanceof Array==1?new Int32Array(e):e))}function uniform3iv(t,e){glpause||gl.glUniform3iv(t,__TypedArrayGetData(e instanceof Array==1?new Int32Array(e):e))}function uniform4iv(t,e){glpause||gl.glUniform4iv(t,__TypedArrayGetData(e instanceof Array==1?new Int32Array(e):e))}function uniformMatrix2fv(t,e,i){glpause||gl.glUniformMatrix2fv(t,e,__TypedArrayGetData(i instanceof Array==1?new Float32Array(i):i))}function uniformMatrix3fv(t,e,i){glpause||gl.glUniformMatrix3fv(t,e,__TypedArrayGetData(i instanceof Array==1?new Float32Array(i):i))}function uniformMatrix4fv(t,e,i){glpause||gl.glUniformMatrix4fv(t,e,__TypedArrayGetData(i instanceof Array==1?new Float32Array(i):i))}function useProgram(t){glpause||gl.glUseProgram(t)}function validateProgram(t){glpause||gl.glValidateProgram(t)}function vertexAttrib1f(t,e){glpause||gl.glVertexAttrib1f(t,e)}function vertexAttrib2f(t,e,i){glpause||gl.glVertexAttrib2f(t,e,i)}function vertexAttrib3f(t,e,i,r){glpause||gl.glVertexAttrib3f(t,e,i,r)}function vertexAttrib4f(t,e,i,r,n){glpause||gl.glVertexAttrib4f(t,e,i,r,n)}function vertexAttrib1fv(t,e){glpause||gl.glVertexAttrib1fv(t,__TypedArrayGetData(e instanceof Array==1?new Float32Array(e):e))}function vertexAttrib2fv(t,e){glpause||gl.glVertexAttrib2fv(t,__TypedArrayGetData(e instanceof Array==1?new Float32Array(e):e))}function vertexAttrib3fv(t,e){glpause||gl.glVertexAttrib3fv(t,__TypedArrayGetData(e instanceof Array==1?new Float32Array(e):e))}function vertexAttrib4fv(t,e){glpause||gl.glVertexAttrib4fv(t,__TypedArrayGetData(e instanceof Array==1?new Float32Array(e):e))}function vertexAttribPointer(t,e,i,r,n,o,a){if(!glpause){if(void 0===a){var s={index:t,size:e,type:i,normalized:r,stride:n,offset:o};void 0===gl.recordVertexAttribPointer&&(gl.recordVertexAttribPointer=[]);for(var h=!1,c=0;c<gl.recordVertexAttribPointer.length;c++)if(gl.recordVertexAttribPointer[c].index==s.index){h=!0,gl.recordVertexAttribPointer[c]=s;break}0==h&&gl.recordVertexAttribPointer.push(s)}gl.glVertexAttribPointer(t,e,i,r,n,o)}}function viewport(t,e,i,r){glpause||gl.glViewport(t,e,i,r)}function getActiveAttrib(t,e){if(!glpause)return gl.glGetActiveAttrib(t,e)}function getActiveUniform(t,e){if(!glpause)return gl.glGetActiveUniform(t,e)}function getAttachedShaders(t){if(!glpause)return gl.glGetAttachedShaders(t)}function getBufferParameter(t,e){if(!glpause)return gl.glGetBufferParameter(t,e)}function getFramebufferAttachmentParameter(t,e,i){if(!glpause)return gl.glGetFramebufferAttachmentParameter(t,e,i)}function getProgramParameter(t,e){if(!glpause)return gl.glGetProgramParameter(t,e)}function getRenderbufferParameter(t,e){if(!glpause)return gl.glGetRenderbufferParameter(t,e)}function getShaderParameter(t,e){if(!glpause)return gl.glGetShaderParameter(t,e)}function getTexParameter(t,e){if(!glpause)return gl.glGetTexParameter(t,e)}function getVertexAttrib(t,e){if(!glpause)return gl.glGetVertexAttrib(t,e)}function getUniform(t,e){if(!glpause)return gl.glGetUniform(t,e)}function getParameter(t){if(!glpause)switch(t){case gl.ACTIVE_TEXTURE:case gl.ALPHA_BITS:case gl.ARRAY_BUFFER_BINDING:case gl.BLUE_BITS:case gl.CULL_FACE_MODE:case gl.CURRENT_PROGRAM:case gl.DEPTH_BITS:case gl.DEPTH_FUNC:case gl.ELEMENT_ARRAY_BUFFER_BINDING:case gl.FRAMEBUFFER_BINDING:case gl.FRONT_FACE:case gl.GENERATE_MIPMAP_HINT:case gl.GREEN_BITS:case gl.IMPLEMENTATION_COLOR_READ_FORMAT:case gl.IMPLEMENTATION_COLOR_READ_TYPE:case gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS:case gl.MAX_CUBE_MAP_TEXTURE_SIZE:case gl.MAX_FRAGMENT_UNIFORM_VECTORS:case gl.MAX_RENDERBUFFER_SIZE:case gl.MAX_TEXTURE_IMAGE_UNITS:case gl.MAX_TEXTURE_SIZE:case gl.MAX_VARYING_VECTORS:case gl.MAX_VERTEX_ATTRIBS:case gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS:case gl.MAX_VERTEX_UNIFORM_VECTORS:case gl.MAX_VIEWPORT_DIMS:case gl.NUM_COMPRESSED_TEXTURE_FORMATS:case gl.NUM_SHADER_BINARY_FORMATS:case gl.PACK_ALIGNMENT:case gl.RED_BITS:case gl.RENDERBUFFER_BINDING:case gl.SAMPLE_BUFFERS:case gl.SAMPLES:case gl.STENCIL_BACK_FAIL:case gl.STENCIL_BACK_FUNC:case gl.STENCIL_BACK_PASS_DEPTH_FAIL:case gl.STENCIL_BACK_PASS_DEPTH_PASS:case gl.STENCIL_BACK_REF:case gl.STENCIL_BACK_VALUE_MASK:case gl.STENCIL_BACK_WRITEMASK:case gl.STENCIL_BITS:case gl.STENCIL_CLEAR_VALUE:case gl.STENCIL_FAIL:case gl.STENCIL_FUNC:case gl.STENCIL_PASS_DEPTH_FAIL:case gl.STENCIL_PASS_DEPTH_PASS:case gl.STENCIL_REF:case gl.STENCIL_VALUE_MASK:case gl.STENCIL_WRITEMASK:case gl.SUBPIXEL_BITS:case gl.TEXTURE_BINDING_2D:case gl.TEXTURE_BINDING_CUBE_MAP:case gl.UNPACK_ALIGNMENT:case gl.BLEND_DST_ALPHA:case gl.BLEND_DST_RGB:case gl.BLEND_EQUATION_ALPHA:case gl.BLEND_EQUATION_RGB:case gl.BLEND_SRC_ALPHA:case gl.BLEND_SRC_RGB:return gl.glGetParameterInt(t,1);case gl.ALIASED_LINE_WIDTH_RANGE:case gl.ALIASED_POINT_SIZE_RANGE:case gl.DEPTH_RANGE:case gl.MAX_VIEWPORT_DIMS:return gl.glGetParameterFloat(t,2);case gl.BLEND:case gl.CULL_FACE:case gl.DEPTH_TEST:case gl.DEPTH_WRITEMASK:case gl.DITHER:case gl.POLYGON_OFFSET_FILL:case gl.SAMPLE_ALPHA_TO_COVERAGE:case gl.SAMPLE_COVERAGE:case gl.SAMPLE_COVERAGE_INVERT:case gl.SCISSOR_TEST:case gl.SHADER_COMPILER:case gl.STENCIL_TEST:return gl.glGetParameterBool(t,1);case gl.BLEND_COLOR:case gl.COLOR_CLEAR_VALUE:return gl.glGetParameterFloat(t,4);case gl.SCISSOR_BOX:case gl.VIEWPORT:return gl.glGetParameterInt(t,4);case gl.COLOR_WRITEMASK:return gl.glGetParameterBool(t,4);case gl.POLYGON_OFFSET_FACTOR:case gl.POLYGON_OFFSET_UNITS:case gl.SAMPLE_COVERAGE_VALUE:return gl.glGetParameterFloat(t,1);case gl.SHADER_BINARY_FORMATS:e=gl.glGetParameterInt(gl.NUM_SHADER_BINARY_FORMATS,1);return gl.glGetParameterInt(t,e);case gl.COMPRESSED_TEXTURE_FORMATS:var e=gl.glGetParameterInt(gl.NUM_COMPRESSED_TEXTURE_FORMATS,1);return gl.glGetParameterInt(t,e)}}function voidFunc(t,e,i,r,n,o,a,s,h,c){}function attchVoidMethod(){gl.methodWorking=!1,gl.activeTexture=voidFunc,gl.attachShader=voidFunc,gl.bindAttribLocation=voidFunc,gl.bindBuffer=voidFunc,gl.bindFramebuffer=voidFunc,gl.bindRenderbuffer=voidFunc,gl.bindTexture=voidFunc,gl.blendColor=voidFunc,gl.blendEquation=voidFunc,gl.blendEquationSeparate=voidFunc,gl.blendFunc=voidFunc,gl.blendFuncSeparate=voidFunc,gl.bufferData=voidFunc,gl.bufferData=voidFunc,gl.bufferSubData=voidFunc,gl.checkFramebufferStatus=voidFunc,gl.clear=voidFunc,gl.clearColor=voidFunc,gl.clearDepth=voidFunc,gl.clearStencil=voidFunc,gl.colorMask=voidFunc,gl.compileShader=voidFunc,gl.compressedTexImage2D=voidFunc,gl.compressedTexSubImage2D=voidFunc,gl.copyTexImage2D=voidFunc,gl.copyTexSubImage2D=voidFunc,gl.createBuffer=voidFunc,gl.createFramebuffer=voidFunc,gl.createProgram=voidFunc,gl.createRenderbuffer=voidFunc,gl.createShader=voidFunc,gl.createTexture=voidFunc,gl.cullFace=voidFunc,gl.deleteBuffer=voidFunc,gl.deleteFramebuffer=voidFunc,gl.deleteProgram=voidFunc,gl.deleteRenderbuffer=voidFunc,gl.deleteShader=voidFunc,gl.deleteTexture=voidFunc,gl.depthFunc=voidFunc,gl.depthMask=voidFunc,gl.depthRange=voidFunc,gl.detachShader=voidFunc,gl.disable=voidFunc,gl.disableVertexAttribArray=voidFunc,gl.drawArrays=voidFunc,gl.drawElements=voidFunc,gl.enable=voidFunc,gl.enableVertexAttribArray=voidFunc,gl.finish=voidFunc,gl.flush=voidFunc,gl.framebufferRenderbuffer=voidFunc,gl.framebufferTexture2D=voidFunc,gl.frontFace=voidFunc,gl.generateMipmap=voidFunc,gl.getAttribLocation=voidFunc,gl.getError=voidFunc,gl.getProgramInfoLog=voidFunc,gl.getShaderInfoLog=voidFunc,gl.getShaderSource=voidFunc,gl.getUniformLocation=voidFunc,gl.getVertexAttribOffset=voidFunc,gl.hint=voidFunc,gl.isBuffer=voidFunc,gl.isEnabled=voidFunc,gl.isFramebuffer=voidFunc,gl.isProgram=voidFunc,gl.isRenderbuffer=voidFunc,gl.isShader=voidFunc,gl.isTexture=voidFunc,gl.lineWidth=voidFunc,gl.linkProgram=voidFunc,gl.pixelStorei=voidFunc,gl.polygonOffset=voidFunc,gl.readPixels=voidFunc,gl.renderbufferStorage=voidFunc,gl.sampleCoverage=voidFunc,gl.scissor=voidFunc,gl.shaderSource=voidFunc,gl.stencilFunc=voidFunc,gl.stencilFuncSeparate=voidFunc,gl.stencilMask=voidFunc,gl.stencilMaskSeparate=voidFunc,gl.stencilOp=voidFunc,gl.stencilOpSeparate=voidFunc,gl.texImage2D=voidFunc,gl.texSubImage2D=voidFunc,gl.texParameterf=voidFunc,gl.texParameteri=voidFunc,gl.uniform1f=voidFunc,gl.uniform2f=voidFunc,gl.uniform3f=voidFunc,gl.uniform4f=voidFunc,gl.uniform1i=voidFunc,gl.uniform2i=voidFunc,gl.uniform3i=voidFunc,gl.uniform4i=voidFunc,gl.uniform1fv=voidFunc,gl.uniform2fv=voidFunc,gl.uniform3fv=voidFunc,gl.uniform4fv=voidFunc,gl.uniform1iv=voidFunc,gl.uniform2iv=voidFunc,gl.uniform3iv=voidFunc,gl.uniform4iv=voidFunc,gl.uniformMatrix2fv=voidFunc,gl.uniformMatrix3fv=voidFunc,gl.uniformMatrix4fv=voidFunc,gl.useProgram=voidFunc,gl.validateProgram=voidFunc,gl.vertexAttrib1f=voidFunc,gl.vertexAttrib2f=voidFunc,gl.vertexAttrib3f=voidFunc,gl.vertexAttrib4f=voidFunc,gl.vertexAttrib1fv=voidFunc,gl.vertexAttrib2fv=voidFunc,gl.vertexAttrib3fv=voidFunc,gl.vertexAttrib4fv=voidFunc,gl.vertexAttribPointer=voidFunc,gl.viewport=voidFunc,gl.getActiveAttrib=voidFunc,gl.getActiveUniform=voidFunc,gl.getAttachedShaders=voidFunc,gl.getBufferParameter=voidFunc,gl.getFramebufferAttachmentParameter=voidFunc,gl.getProgramParameter=voidFunc,gl.getRenderbufferParameter=voidFunc,gl.getShaderParameter=voidFunc,gl.getTexParameter=voidFunc,gl.getVertexAttrib=voidFunc,gl.getParameter=voidFunc,gl.getUniform=voidFunc,gl.getShaderPrecisionFormat=voidFunc}function attachMethod(){gl.methodWorking=!0,gl.activeTexture=activeTexture,gl.attachShader=attachShader,gl.bindAttribLocation=bindAttribLocation,gl.bindBuffer=bindBuffer,gl.bindFramebuffer=bindFramebuffer,gl.bindRenderbuffer=bindRenderbuffer,gl.bindTexture=bindTexture,gl.blendColor=blendColor,gl.blendEquation=blendEquation,gl.blendEquationSeparate=blendEquationSeparate,gl.blendFunc=blendFunc,gl.blendFuncSeparate=blendFuncSeparate,gl.bufferData=bufferData,gl.bufferData=bufferData,gl.bufferSubData=bufferSubData,gl.checkFramebufferStatus=checkFramebufferStatus,gl.clear=clear,gl.clearColor=clearColor,gl.clearDepth=clearDepth,gl.clearStencil=clearStencil,gl.colorMask=colorMask,gl.compileShader=compileShader,gl.compressedTexImage2D=compressedTexImage2D,gl.compressedTexSubImage2D=compressedTexSubImage2D,gl.copyTexImage2D=copyTexImage2D,gl.copyTexSubImage2D=copyTexSubImage2D,gl.createBuffer=createBuffer,gl.createFramebuffer=createFramebuffer,gl.createProgram=createProgram,gl.createRenderbuffer=createRenderbuffer,gl.createShader=createShader,gl.createTexture=createTexture,gl.cullFace=cullFace,gl.deleteBuffer=deleteBuffer,gl.deleteFramebuffer=deleteFramebuffer,gl.deleteProgram=deleteProgram,gl.deleteRenderbuffer=deleteRenderbuffer,gl.deleteShader=deleteShader,gl.deleteTexture=deleteTexture,gl.depthFunc=depthFunc,gl.depthMask=depthMask,gl.depthRange=depthRange,gl.detachShader=detachShader,gl.disable=disable,gl.disableVertexAttribArray=disableVertexAttribArray,gl.drawArrays=drawArrays,gl.drawElements=drawElements,gl.enable=enable,gl.enableVertexAttribArray=enableVertexAttribArray,gl.finish=finish,gl.flush=flush,gl.framebufferRenderbuffer=framebufferRenderbuffer,gl.framebufferTexture2D=framebufferTexture2D,gl.frontFace=frontFace,gl.generateMipmap=generateMipmap,gl.getAttribLocation=getAttribLocation,gl.getError=getError,gl.getProgramInfoLog=getProgramInfoLog,gl.getShaderInfoLog=getShaderInfoLog,gl.getShaderSource=getShaderSource,gl.getUniformLocation=getUniformLocation,gl.getVertexAttribOffset=getVertexAttribOffset,gl.hint=hint,gl.isBuffer=isBuffer,gl.isEnabled=isEnabled,gl.isFramebuffer=isFramebuffer,gl.isProgram=isProgram,gl.isRenderbuffer=isRenderbuffer,gl.isShader=isShader,gl.isTexture=isTexture,gl.lineWidth=lineWidth,gl.linkProgram=linkProgram,gl.pixelStorei=pixelStorei,gl.polygonOffset=polygonOffset,gl.readPixels=readPixels,gl.glReadPixels=voidFunc,gl.renderbufferStorage=renderbufferStorage,gl.sampleCoverage=sampleCoverage,gl.scissor=scissor,gl.shaderSource=shaderSource,gl.stencilFunc=stencilFunc,gl.stencilFuncSeparate=stencilFuncSeparate,gl.stencilMask=stencilMask,gl.stencilMaskSeparate=stencilMaskSeparate,gl.stencilOp=stencilOp,gl.stencilOpSeparate=stencilOpSeparate,gl.texImage2D=texImage2D,gl.texSubImage2D=texSubImage2D,gl.texParameterf=texParameterf,gl.texParameteri=texParameteri,gl.uniform1f=uniform1f,gl.uniform2f=uniform2f,gl.uniform3f=uniform3f,gl.uniform4f=uniform4f,gl.uniform1i=uniform1i,gl.uniform2i=uniform2i,gl.uniform3i=uniform3i,gl.uniform4i=uniform4i,gl.uniform1fv=uniform1fv,gl.uniform2fv=uniform2fv,gl.uniform3fv=uniform3fv,gl.uniform4fv=uniform4fv,gl.uniform1iv=uniform1iv,gl.uniform2iv=uniform2iv,gl.uniform3iv=uniform3iv,gl.uniform4iv=uniform4iv,gl.uniformMatrix2fv=uniformMatrix2fv,gl.uniformMatrix3fv=uniformMatrix3fv,gl.uniformMatrix4fv=uniformMatrix4fv,gl.useProgram=useProgram,gl.validateProgram=validateProgram,gl.vertexAttrib1f=vertexAttrib1f,gl.vertexAttrib2f=vertexAttrib2f,gl.vertexAttrib3f=vertexAttrib3f,gl.vertexAttrib4f=vertexAttrib4f,gl.vertexAttrib1fv=vertexAttrib1fv,gl.vertexAttrib2fv=vertexAttrib2fv,gl.vertexAttrib3fv=vertexAttrib3fv,gl.vertexAttrib4fv=vertexAttrib4fv,gl.vertexAttribPointer=vertexAttribPointer,gl.viewport=viewport,gl.getActiveAttrib=getActiveAttrib,gl.getActiveUniform=getActiveUniform,gl.getAttachedShaders=getAttachedShaders,gl.getBufferParameter=getBufferParameter,gl.getFramebufferAttachmentParameter=getFramebufferAttachmentParameter,gl.getProgramParameter=getProgramParameter,gl.getRenderbufferParameter=getRenderbufferParameter,gl.getShaderParameter=getShaderParameter,gl.getTexParameter=getTexParameter,gl.getVertexAttrib=getVertexAttrib,gl.getParameter=getParameter,gl.getUniform=getUniform,gl.getShaderPrecisionFormat=getShaderPrecisionFormat}function attatchConst(){gl.DEPTH_BUFFER_BIT=256,gl.STENCIL_BUFFER_BIT=1024,gl.COLOR_BUFFER_BIT=16384,gl.POINTS=0,gl.LINES=1,gl.LINE_LOOP=2,gl.LINE_STRIP=3,gl.TRIANGLES=4,gl.TRIANGLE_STRIP=5,gl.TRIANGLE_FAN=6,gl.ZERO=0,gl.ONE=1,gl.SRC_COLOR=768,gl.ONE_MINUS_SRC_COLOR=769,gl.SRC_ALPHA=770,gl.ONE_MINUS_SRC_ALPHA=771,gl.DST_ALPHA=772,gl.ONE_MINUS_DST_ALPHA=773,gl.DST_COLOR=774,gl.ONE_MINUS_DST_COLOR=775,gl.SRC_ALPHA_SATURATE=776,gl.FUNC_ADD=32774,gl.BLEND_EQUATION=32777,gl.BLEND_EQUATION_RGB=32777,gl.BLEND_EQUATION_ALPHA=34877,gl.FUNC_SUBTRACT=32778,gl.FUNC_REVERSE_SUBTRACT=32779,gl.BLEND_DST_RGB=32968,gl.BLEND_SRC_RGB=32969,gl.BLEND_DST_ALPHA=32970,gl.BLEND_SRC_ALPHA=32971,gl.CONSTANT_COLOR=32769,gl.ONE_MINUS_CONSTANT_COLOR=32770,gl.CONSTANT_ALPHA=32771,gl.ONE_MINUS_CONSTANT_ALPHA=32772,gl.BLEND_COLOR=32773,gl.ARRAY_BUFFER=34962,gl.ELEMENT_ARRAY_BUFFER=34963,gl.ARRAY_BUFFER_BINDING=34964,gl.ELEMENT_ARRAY_BUFFER_BINDING=34965,gl.STREAM_DRAW=35040,gl.STATIC_DRAW=35044,gl.DYNAMIC_DRAW=35048,gl.BUFFER_SIZE=34660,gl.BUFFER_USAGE=34661,gl.CURRENT_VERTEX_ATTRIB=34342,gl.FRONT=1028,gl.BACK=1029,gl.FRONT_AND_BACK=1032,gl.CULL_FACE=2884,gl.BLEND=3042,gl.DITHER=3024,gl.STENCIL_TEST=2960,gl.DEPTH_TEST=2929,gl.SCISSOR_TEST=3089,gl.POLYGON_OFFSET_FILL=32823,gl.SAMPLE_ALPHA_TO_COVERAGE=32926,gl.SAMPLE_COVERAGE=32928,gl.NO_ERROR=0,gl.INVALID_ENUM=1280,gl.INVALID_VALUE=1281,gl.INVALID_OPERATION=1282,gl.OUT_OF_MEMORY=1285,gl.CW=2304,gl.CCW=2305,gl.LINE_WIDTH=2849,gl.ALIASED_POINT_SIZE_RANGE=33901,gl.ALIASED_LINE_WIDTH_RANGE=33902,gl.CULL_FACE_MODE=2885,gl.FRONT_FACE=2886,gl.DEPTH_RANGE=2928,gl.DEPTH_WRITEMASK=2930,gl.DEPTH_CLEAR_VALUE=2931,gl.DEPTH_FUNC=2932,gl.STENCIL_CLEAR_VALUE=2961,gl.STENCIL_FUNC=2962,gl.STENCIL_FAIL=2964,gl.STENCIL_PASS_DEPTH_FAIL=2965,gl.STENCIL_PASS_DEPTH_PASS=2966,gl.STENCIL_REF=2967,gl.STENCIL_VALUE_MASK=2963,gl.STENCIL_WRITEMASK=2968,gl.STENCIL_BACK_FUNC=34816,gl.STENCIL_BACK_FAIL=34817,gl.STENCIL_BACK_PASS_DEPTH_FAIL=34818,gl.STENCIL_BACK_PASS_DEPTH_PASS=34819,gl.STENCIL_BACK_REF=36003,gl.STENCIL_BACK_VALUE_MASK=36004,gl.STENCIL_BACK_WRITEMASK=36005,gl.VIEWPORT=2978,gl.SCISSOR_BOX=3088,gl.COLOR_CLEAR_VALUE=3106,gl.COLOR_WRITEMASK=3107,gl.UNPACK_ALIGNMENT=3317,gl.PACK_ALIGNMENT=3333,gl.MAX_TEXTURE_SIZE=3379,gl.MAX_VIEWPORT_DIMS=3386,gl.SUBPIXEL_BITS=3408,gl.RED_BITS=3410,gl.GREEN_BITS=3411,gl.BLUE_BITS=3412,gl.ALPHA_BITS=3413,gl.DEPTH_BITS=3414,gl.STENCIL_BITS=3415,gl.POLYGON_OFFSET_UNITS=10752,gl.POLYGON_OFFSET_FACTOR=32824,gl.TEXTURE_BINDING_2D=32873,gl.SAMPLE_BUFFERS=32936,gl.SAMPLES=32937,gl.SAMPLE_COVERAGE_VALUE=32938,gl.SAMPLE_COVERAGE_INVERT=32939,gl.COMPRESSED_TEXTURE_FORMATS=34467,gl.DONT_CARE=4352,gl.FASTEST=4353,gl.NICEST=4354,gl.GENERATE_MIPMAP_HINT=33170,gl.BYTE=5120,gl.UNSIGNED_BYTE=5121,gl.SHORT=5122,gl.UNSIGNED_SHORT=5123,gl.INT=5124,gl.UNSIGNED_INT=5125,gl.FLOAT=5126,gl.DEPTH_COMPONENT=6402,gl.ALPHA=6406,gl.RGB=6407,gl.RGBA=6408,gl.LUMINANCE=6409,gl.LUMINANCE_ALPHA=6410,gl.UNSIGNED_SHORT_4_4_4_4=32819,gl.UNSIGNED_SHORT_5_5_5_1=32820,gl.UNSIGNED_SHORT_5_6_5=33635,gl.FRAGMENT_SHADER=35632,gl.VERTEX_SHADER=35633,gl.MAX_VERTEX_ATTRIBS=34921,gl.MAX_VERTEX_UNIFORM_VECTORS=36347,gl.MAX_VARYING_VECTORS=36348,gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661,gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660,gl.MAX_TEXTURE_IMAGE_UNITS=34930,gl.MAX_FRAGMENT_UNIFORM_VECTORS=36349,gl.SHADER_TYPE=35663,gl.DELETE_STATUS=35712,gl.LINK_STATUS=35714,gl.VALIDATE_STATUS=35715,gl.ATTACHED_SHADERS=35717,gl.ACTIVE_UNIFORMS=35718,gl.ACTIVE_ATTRIBUTES=35721,gl.SHADING_LANGUAGE_VERSION=35724,gl.CURRENT_PROGRAM=35725,gl.NEVER=512,gl.LESS=513,gl.EQUAL=514,gl.LEQUAL=515,gl.GREATER=516,gl.NOTEQUAL=517,gl.GEQUAL=518,gl.ALWAYS=519,gl.KEEP=7680,gl.REPLACE=7681,gl.INCR=7682,gl.DECR=7683,gl.INVERT=5386,gl.INCR_WRAP=34055,gl.DECR_WRAP=34056,gl.VENDOR=7936,gl.RENDERER=7937,gl.VERSION=7938,gl.NEAREST=9728,gl.LINEAR=9729,gl.NEAREST_MIPMAP_NEAREST=9984,gl.LINEAR_MIPMAP_NEAREST=9985,gl.NEAREST_MIPMAP_LINEAR=9986,gl.LINEAR_MIPMAP_LINEAR=9987,gl.TEXTURE_MAG_FILTER=10240,gl.TEXTURE_MIN_FILTER=10241,gl.TEXTURE_WRAP_S=10242,gl.TEXTURE_WRAP_T=10243,gl.TEXTURE_2D=3553,gl.TEXTURE=5890,gl.TEXTURE_CUBE_MAP=34067,gl.TEXTURE_BINDING_CUBE_MAP=34068,gl.TEXTURE_CUBE_MAP_POSITIVE_X=34069,gl.TEXTURE_CUBE_MAP_NEGATIVE_X=34070,gl.TEXTURE_CUBE_MAP_POSITIVE_Y=34071,gl.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072,gl.TEXTURE_CUBE_MAP_POSITIVE_Z=34073,gl.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074,gl.MAX_CUBE_MAP_TEXTURE_SIZE=34076,gl.TEXTURE0=33984,gl.TEXTURE1=33985,gl.TEXTURE2=33986,gl.TEXTURE3=33987,gl.TEXTURE4=33988,gl.TEXTURE5=33989,gl.TEXTURE6=33990,gl.TEXTURE7=33991,gl.TEXTURE8=33992,gl.TEXTURE9=33993,gl.TEXTURE10=33994,gl.TEXTURE11=33995,gl.TEXTURE12=33996,gl.TEXTURE13=33997,gl.TEXTURE14=33998,gl.TEXTURE15=33999,gl.TEXTURE16=34e3,gl.TEXTURE17=34001,gl.TEXTURE18=34002,gl.TEXTURE19=34003,gl.TEXTURE20=34004,gl.TEXTURE21=34005,gl.TEXTURE22=34006,gl.TEXTURE23=34007,gl.TEXTURE24=34008,gl.TEXTURE25=34009,gl.TEXTURE26=34010,gl.TEXTURE27=34011,gl.TEXTURE28=34012,gl.TEXTURE29=34013,gl.TEXTURE30=34014,gl.TEXTURE31=34015,gl.ACTIVE_TEXTURE=34016,gl.REPEAT=10497,gl.CLAMP_TO_EDGE=33071,gl.MIRRORED_REPEAT=33648,gl.FLOAT_VEC2=35664,gl.FLOAT_VEC3=35665,gl.FLOAT_VEC4=35666,gl.INT_VEC2=35667,gl.INT_VEC3=35668,gl.INT_VEC4=35669,gl.BOOL=35670,gl.BOOL_VEC2=35671,gl.BOOL_VEC3=35672,gl.BOOL_VEC4=35673,gl.FLOAT_MAT2=35674,gl.FLOAT_MAT3=35675,gl.FLOAT_MAT4=35676,gl.SAMPLER_2D=35678,gl.SAMPLER_CUBE=35680,gl.VERTEX_ATTRIB_ARRAY_ENABLED=34338,gl.VERTEX_ATTRIB_ARRAY_SIZE=34339,gl.VERTEX_ATTRIB_ARRAY_STRIDE=34340,gl.VERTEX_ATTRIB_ARRAY_TYPE=34341,gl.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922,gl.VERTEX_ATTRIB_ARRAY_POINTER=34373,gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975,gl.IMPLEMENTATION_COLOR_READ_TYPE=35738,gl.IMPLEMENTATION_COLOR_READ_FORMAT=35739,gl.COMPILE_STATUS=35713,gl.LOW_FLOAT=36336,gl.MEDIUM_FLOAT=36337,gl.HIGH_FLOAT=36338,gl.LOW_INT=36339,gl.MEDIUM_INT=36340,gl.HIGH_INT=36341,gl.FRAMEBUFFER=36160,gl.RENDERBUFFER=36161,gl.RGBA4=32854,gl.RGB5_A1=32855,gl.RGB565=36194,gl.DEPTH_COMPONENT16=33189,gl.STENCIL_INDEX8=36168,gl.DEPTH_STENCIL=34041,gl.RENDERBUFFER_WIDTH=36162,gl.RENDERBUFFER_HEIGHT=36163,gl.RENDERBUFFER_INTERNAL_FORMAT=36164,gl.RENDERBUFFER_RED_SIZE=36176,gl.RENDERBUFFER_GREEN_SIZE=36177,gl.RENDERBUFFER_BLUE_SIZE=36178,gl.RENDERBUFFER_ALPHA_SIZE=36179,gl.RENDERBUFFER_DEPTH_SIZE=36180,gl.RENDERBUFFER_STENCIL_SIZE=36181,gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048,gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049,gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050,gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051,gl.COLOR_ATTACHMENT0=36064,gl.DEPTH_ATTACHMENT=36096,gl.STENCIL_ATTACHMENT=36128,gl.DEPTH_STENCIL_ATTACHMENT=33306,gl.NONE=0,gl.FRAMEBUFFER_COMPLETE=36053,gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054,gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055,gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057,gl.FRAMEBUFFER_UNSUPPORTED=36061,gl.FRAMEBUFFER_BINDING=36006,gl.RENDERBUFFER_BINDING=36007,gl.MAX_RENDERBUFFER_SIZE=34024,gl.INVALID_FRAMEBUFFER_OPERATION=1286,gl.UNPACK_FLIP_Y_WEBGL=37440,gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441,gl.CONTEXT_LOST_WEBGL=37442,gl.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443,gl.BROWSER_DEFAULT_WEBGL=37444,gl.SHADER_BINARY_FORMATS=36344,gl.NUM_SHADER_BINARY_FORMATS=36345,gl.NUM_COMPRESSED_TEXTURE_FORMATS=34466}function OpenOptMode(){gl.flushCommand&&isSupportTypeArray()&&attachMethodOpt(),buffer_data=new Float32Array(total_size)}function closeOptMode(){attachMethod()}function flushCommand(){next_index>0&&(gl.flushCommand(next_index,buffer_data),next_index=0)}function glCommitOpt(){flushCommand(),gl.commit()}function activeTextureOpt(t){next_index+2>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_ACTIVE_TEXTURE,buffer_data[next_index+1]=t,next_index+=2}function attachShaderOpt(t,e){next_index+3>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_ATTACH_SHADER,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,next_index+=3}function bindAttribLocationOpt(t,e,i){flushCommand(),bindAttribLocation(t,e,i)}function bindBufferOpt(t,e){next_index+3>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_BIND_BUFFER,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,next_index+=3}function bindFramebufferOpt(t,e){flushCommand(),bindFramebuffer(t,e)}function bindRenderbufferOpt(t,e){flushCommand(),bindRenderbuffer(t,e)}function bindTextureOpt(t,e){next_index+3>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_BIND_TEXTURE,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,next_index+=3}function blendColorOpt(t,e,i,r){next_index+5>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_BLEND_COLOR,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,next_index+=5}function blendEquationOpt(t){next_index+2>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_BLEND_EQUATION,buffer_data[next_index+1]=t,next_index+=2}function blendEquationSeparateOpt(t,e){next_index+3>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_BLEND_EQUATION_SEPARATE,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,next_index+=3}function blendFuncOpt(t,e){next_index+3>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_BLEND_FUNC,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,next_index+=3}function blendFuncSeparateOpt(t,e,i,r){next_index+5>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_BLEND_FUNC_SEPARATE,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,next_index+=5}function bufferDataOpt(t,e,i){flushCommand(),bufferData(t,e,i)}function bufferSubDataOpt(t,e,i){flushCommand(),bufferSubData(t,e,i)}function checkFramebufferStatusOpt(t){flushCommand(),checkFramebufferStatus(t)}function clearOpt(t){next_index+2>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_CLEAR,buffer_data[next_index+1]=t,next_index+=2}function clearColorOpt(t,e,i,r){next_index+5>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_CLEAR_COLOR,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,next_index+=5}function clearDepthOpt(t){next_index+2>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_CLEAR_DEPTH,buffer_data[next_index+1]=t,next_index+=2}function clearStencilOpt(t){next_index+2>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_CLEAR_STENCIL,buffer_data[next_index+1]=t,next_index+=2}function colorMaskOpt(t,e,i,r){next_index+5>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_COLOR_MASK,buffer_data[next_index+1]=t?1:0,buffer_data[next_index+2]=e?1:0,buffer_data[next_index+3]=i?1:0,buffer_data[next_index+4]=r?1:0,next_index+=5}function compileShaderOpt(t){next_index+2>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_COMPILE_SHADER,buffer_data[next_index+1]=t,next_index+=2}function compressedTexImage2DOpt(t,e,i,r,n,o,a){flushCommand(),compressedTexImage2D(t,e,i,r,n,o,a)}function compressedTexSubImage2DOpt(t,e,i,r,n,o,a,s){flushCommand(),compressedTexSubImage2D(t,e,i,r,n,o,a,s)}function copyTexImage2DOpt(t,e,i,r,n,o,a,s){next_index+9>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_COPY_TEX_IMAGE_2D,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,buffer_data[next_index+5]=n,buffer_data[next_index+6]=o,buffer_data[next_index+7]=a,buffer_data[next_index+8]=s,next_index+=9}function copyTexSubImage2DOpt(t,e,i,r,n,o,a,s){next_index+9>total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_COPY_TEX_SUB_IMAGE_2D,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,buffer_data[next_index+5]=n,buffer_data[next_index+6]=o,buffer_data[next_index+7]=a,buffer_data[next_index+8]=s,next_index+=9}function createBufferOpt(){return flushCommand(),createBuffer()}function createFramebufferOpt(){return flushCommand(),createFramebuffer()}function createProgramOpt(){return flushCommand(),createProgram()}function createRenderbufferOpt(){return flushCommand(),createRenderbuffer()}function createShaderOpt(t){return flushCommand(),createShader(t)}function createTextureOpt(){return flushCommand(),createTexture()}function cullFaceOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_CULL_FACE,buffer_data[next_index+1]=t,next_index+=2}function deleteBufferOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_DELETE_BUFFER,buffer_data[next_index+1]=t,next_index+=2}function deleteFramebufferOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_DELETE_FRAME_BUFFER,buffer_data[next_index+1]=t,next_index+=2}function deleteProgramOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_DELETE_PROGRAM,buffer_data[next_index+1]=t,next_index+=2}function deleteRenderbufferOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_DELETE_RENDER_BUFFER,buffer_data[next_index+1]=t,next_index+=2}function deleteShaderOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_DELETE_SHADER,buffer_data[next_index+1]=t,next_index+=2}function deleteTextureOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_DELETE_TEXTURE,buffer_data[next_index+1]=t,next_index+=2}function depthFuncOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_DEPTH_FUNC,buffer_data[next_index+1]=t,next_index+=2}function depthMaskOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_DEPTH_MASK,buffer_data[next_index+1]=t?1:0,next_index+=2}function depthRangeOpt(t,e){next_index+3>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_DEPTH_RANGE,buffer_data[next_index+1]=t,buffer_data[next_index+1]=e,next_index+=3}function detachShaderOpt(t,e){next_index+3>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_DETACH_SHADER,buffer_data[next_index+1]=t,buffer_data[next_index+1]=e,next_index+=3}function disableOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_DISABLE,buffer_data[next_index+1]=t,next_index+=2}function disableVertexAttribArrayOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_DISABLE_VERTEX_ATTRIB_ARRAY,buffer_data[next_index+1]=t,next_index+=2}function drawArraysOpt(t,e,i){next_index+4>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_DRAW_ARRAYS,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,next_index+=4,i>0&&checkFirstFrames()}function drawElementsOpt(t,e,i,r){next_index+5>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_DRAW_ELEMENTS,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,next_index+=5,e>0&&checkFirstFrames()}function enableOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_ENABLE,buffer_data[next_index+1]=t,next_index+=2}function enableVertexAttribArrayOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_ENABLE_VERTEX_ATTRIB_ARRAY,buffer_data[next_index+1]=t,next_index+=2}function finishOpt(){next_index+1>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_FINISH,next_index+=1}function flushOpt(){next_index+1>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_FLUSH,next_index+=1}function framebufferRenderbufferOpt(t,e,i,r){next_index+5>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_FRAME_BUFFER_RENDER_BUFFER,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,next_index+=5}function framebufferTexture2DOpt(t,e,i,r,n){next_index+6>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_FRAME_BUFFER_TEXTURE_2D,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,buffer_data[next_index+5]=n,next_index+=6}function frontFaceOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_FRONT_FACE,buffer_data[next_index+1]=t,next_index+=2}function generateMipmapOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_GENERATE_MIPMAP,buffer_data[next_index+1]=t,next_index+=2}function getActiveAttribOpt(t,e){return flushCommand(),getActiveAttrib(t,e)}function getActiveUniformOpt(t,e){return flushCommand(),getActiveUniform(t,e)}function getAttachedShadersOpt(t){return flushCommand(),getAttachedShaders(t)}function getAttribLocationOpt(t,e){return flushCommand(),getAttribLocation(t,e)}function getBufferParameterOpt(t,e){return flushCommand(),getBufferParameter(t,e)}function getParameterOpt(t){return flushCommand(),getParameter(t)}function getErrorOpt(){return flushCommand(),getError()}function getFramebufferAttachmentParameterOpt(t,e,i){return flushCommand(),getFramebufferAttachmentParameter(t,e,i)}function getProgramParameterOpt(t,e){return flushCommand(),getProgramParameter(t,e)}function getProgramInfoLogOpt(t){return flushCommand(),getProgramInfoLog(t)}function getRenderbufferParameterOpt(t,e){return flushCommand(),getRenderbufferParameter(t,e)}function getShaderParameterOpt(t,e){return flushCommand(),getShaderParameter(t,e)}function getShaderPrecisionFormatOpt(t,e){return flushCommand(),getShaderPrecisionFormat(t,e)}function getShaderInfoLogOpt(t){return flushCommand(),getShaderInfoLog(t)}function getShaderSourceOpt(t){return flushCommand(),getShaderSource(t)}function getTexParameterOpt(t,e){return flushCommand(),getTexParameter(t,e)}function getUniformOpt(t,e){return flushCommand(),getUniform(t,e)}function getUniformLocationOpt(t,e){return flushCommand(),getUniformLocation(t,e)}function getVertexAttribOpt(t,e){return flushCommand(),getVertexAttrib(t,e)}function getVertexAttribOffsetOpt(t,e){return flushCommand(),getVertexAttribOffset(t,e)}function hintOpt(t,e){next_index+3>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_HINT,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,next_index+=3}function isBufferOpt(t){return flushCommand(),isBuffer(t)}function isEnabledOpt(t){return flushCommand(),isEnabled(t)}function isFramebufferOpt(t){return flushCommand(),isFramebuffer(t)}function isProgramOpt(t){return flushCommand(),isProgram(t)}function isRenderbufferOpt(t){return flushCommand(),isRenderbuffer(t)}function isShaderOpt(t){return flushCommand(),isShader(t)}function isTextureOpt(t){return flushCommand(),isTexture(t)}function lineWidthOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_LINE_WIDTH,buffer_data[next_index+1]=t,next_index+=2}function linkProgramOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_LINK_PROGRAM,buffer_data[next_index+1]=t,next_index+=2}function pixelStoreiOpt(t,e){flushCommand(),pixelStorei(t,e)}function polygonOffsetOpt(t,e){next_index+3>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_POLYGON_OFFSET,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,next_index+=3}function readPixelsOpt(t,e,i,r,n,o,a){}function renderbufferStorageOpt(t,e,i,r){next_index+5>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_RENDER_BUFFER_STORAGE,buffer_data[next_index+1]=t,buffer_data[next_index+2]=internalformat,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,next_index+=5}function sampleCoverageOpt(t,e){next_index+3>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_SAMPLE_COVERAGE,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e?1:0,next_index+=3}function scissorOpt(t,e,i,r){next_index+5>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_SCISSOR,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,next_index+=5}function shaderSourceOpt(t,e){flushCommand(),shaderSource(t,e)}function stencilFuncOpt(t,e,i){next_index+4>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_STENCIL_FUNC,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,next_index+=4}function stencilFuncSeparateOpt(t,e,i,r){next_index+5>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_STENCIL_FUNC_SEPARATE,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,next_index+=5}function stencilMaskOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_STENCIL_MASK,buffer_data[next_index+1]=t,next_index+=2}function stencilMaskSeparateOpt(t,e){next_index+3>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_STENCIL_MASK_SEPARATE,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,next_index+=3}function stencilOpOpt(t,e,i){next_index+4>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_STENCIL_OP,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,next_index+=4}function stencilOpSeparateOpt(t,e,i,r){next_index+5>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_STENCIL_OP_SEPARATE,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,next_index+=5}function texImage2DOpt(t,e,i){switch(flushCommand(),arguments.length){case 6:var r=arguments[3],n=arguments[4],o=arguments[5];Object.prototype.hasOwnProperty.call(o,"__nativeObj")?gl.glTexImage2D(t,e,i,r,n,o.__nativeObj):Object.prototype.hasOwnProperty.call(o,"buffer")&&Object.prototype.hasOwnProperty.call(o.buffer,"eof")&&Object.prototype.hasOwnProperty.call(o.buffer,"pointer")&&Object.prototype.hasOwnProperty.call(o.buffer,"netOrder")&&o.width>0&&o.height>0&&gl.glTexImage2D(t,e,i,r,n,o);break;case 9:var a=arguments[3],s=arguments[4],h=arguments[5],r=arguments[6],n=arguments[7],c=arguments[8];gl.glTexImage2D(t,e,i,a,s,h,r,n,c)}}function texParameterfOpt(t,e,i){next_index+4>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_TEX_PARAMETER_F,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,next_index+=4}function texParameteriOpt(t,e,i){next_index+4>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_TEX_PARAMETER_I,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,next_index+=4}function texSubImage2DOpt(t,e,i,r,n,o,a,s,h){flushCommand(),texSubImage2D(t,e,i,r,n,o,a,s,h)}function texSubImage2DOpt(t,e,i,r,n,o,a){flushCommand(),texSubImage2D(t,e,i,r,n,o,a)}function uniform1fOpt(t,e){next_index+3>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_1F,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,next_index+=3}function uniform2fOpt(t,e,i){next_index+4>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_2F,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,next_index+=4}function uniform3fOpt(t,e,i,r){next_index+5>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_3F,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,next_index+=5}function uniform4fOpt(t,e,i,r,n){next_index+6>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_4F,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,buffer_data[next_index+5]=n,next_index+=6}function uniform1iOpt(t,e){next_index+3>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_1I,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,next_index+=3}function uniform2iOpt(t,e,i){next_index+4>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_2I,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,next_index+=4}function uniform3iOpt(t,e,i,r){next_index+5>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_3I,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,next_index+=5}function uniform4iOpt(t,e,i,r,n){next_index+6>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_4I,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,buffer_data[next_index+5]=n,next_index+=6}function uniform1fvOpt(t,e){next_index+3+e.length>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_1FV,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e.length,buffer_data.set(e,next_index+3),next_index+=3+e.length}function uniform2fvOpt(t,e){next_index+3+e.length>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_2FV,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e.length,buffer_data.set(e,next_index+3),next_index+=3+e.length}function uniform3fvOpt(t,e){next_index+3+e.length>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_3FV,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e.length,buffer_data.set(e,next_index+3),next_index+=3+e.length}function uniform4fvOpt(t,e){next_index+3+e.length>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_4FV,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e.length,buffer_data.set(e,next_index+3),next_index+=3+e.length}function uniform1ivOpt(t,e){next_index+3+e.length>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_1IV,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e.length,buffer_data.set(e,next_index+3),next_index+=3+e.length}function uniform2ivOpt(t,e){next_index+3+e.length>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_2IV,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e.length,buffer_data.set(e,next_index+3),next_index+=3+e.length}function uniform3ivOpt(t,e){next_index+3+e.length>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_3IV,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e.length,buffer_data.set(e,next_index+3),next_index+=3+e.length}function uniform4ivOpt(t,e){next_index+3+e.length>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_4IV,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e.length,buffer_data.set(e,next_index+3),next_index+=3+e.length}function uniformMatrix2fvOpt(t,e,i){next_index+4+i.length>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_MATRIX_2FV,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i.length,buffer_data.set(i,next_index+4),next_index+=4+i.length}function uniformMatrix3fvOpt(t,e,i){next_index+4+i.length>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_MATRIX_3FV,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i.length,buffer_data.set(i,next_index+4),next_index+=4+i.length}function uniformMatrix4fvOpt(t,e,i){next_index+4+i.length>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_UNIFORM_MATRIX_4FV,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i.length,buffer_data.set(i,next_index+4),next_index+=4+i.length}function useProgramOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_USE_PROGRAM,buffer_data[next_index+1]=t,next_index+=2}function validateProgramOpt(t){next_index+2>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_VALIDATE_PROGRAM,buffer_data[next_index+1]=t,next_index+=2}function vertexAttrib1fOpt(t,e){next_index+3>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_VERTEX_ATTRIB_1F,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,next_index+=3}function vertexAttrib2fOpt(t,e,i){next_index+4>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_VERTEX_ATTRIB_2F,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,next_index+=4}function vertexAttrib3fOpt(t,e,i,r){next_index+5>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_VERTEX_ATTRIB_3F,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,next_index+=5}function vertexAttrib4fOpt(t,e,i,r,n){next_index+6>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_VERTEX_ATTRIB_4F,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,buffer_data[next_index+5]=n,next_index+=6}function vertexAttrib1fvOpt(t,e){next_index+3+e.length>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_VERTEX_ATTRIB_1FV,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e.length,buffer_data.set(e,next_index+3),next_index+=3+e.length}function vertexAttrib2fvOpt(t,e){next_index+3+e.length>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_VERTEX_ATTRIB_2FV,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e.length,buffer_data.set(e,next_index+3),next_index+=3+e.length}function vertexAttrib3fvOpt(t,e){next_index+3+e.length>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_VERTEX_ATTRIB_3FV,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e.length,buffer_data.set(e,next_index+3),next_index+=3+e.length}function vertexAttrib4fvOpt(t,e){next_index+3+e.length>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_VERTEX_ATTRIB_4FV,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e.length,buffer_data.set(e,next_index+3),next_index+=3+e.length}function vertexAttribPointerOpt(t,e,i,r,n,o){next_index+7>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_VERTEX_ATTRIB_POINTER,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r?1:0,buffer_data[next_index+5]=n,buffer_data[next_index+6]=o,next_index+=7}function viewportOpt(t,e,i,r){next_index+5>=total_size&&flushCommand(),buffer_data[next_index]=GL_COMMAND_VIEW_PORT,buffer_data[next_index+1]=t,buffer_data[next_index+2]=e,buffer_data[next_index+3]=i,buffer_data[next_index+4]=r,next_index+=5}function isSupportTypeArray(){if("android"==GameStatusInfo.platform)return!0;var t=BK.Director.queryDeviceInfo(),e=t.version.split(".");return"ios"==t.platform&&Number(e[0])>=10}function attachMethodOpt(){gl.activeTexture=activeTextureOpt,gl.attachShader=attachShaderOpt,gl.bindAttribLocation=bindAttribLocationOpt,gl.bindBuffer=bindBufferOpt,gl.bindFramebuffer=bindFramebufferOpt,gl.bindRenderbuffer=bindRenderbufferOpt,gl.bindTexture=bindTextureOpt,gl.blendColor=blendColorOpt,gl.blendEquation=blendEquationOpt,gl.blendEquationSeparate=blendEquationSeparateOpt,gl.blendFunc=blendFuncOpt,gl.blendFuncSeparate=blendFuncSeparateOpt,gl.bufferData=bufferDataOpt,gl.bufferData=bufferDataOpt,gl.bufferSubData=bufferSubDataOpt,gl.checkFramebufferStatus=checkFramebufferStatusOpt,gl.clear=clearOpt,gl.clearColor=clearColorOpt,gl.clearDepth=clearDepthOpt,gl.clearStencil=clearStencilOpt,gl.colorMask=colorMaskOpt,gl.compileShader=compileShaderOpt,gl.compressedTexImage2D=compressedTexImage2DOpt,gl.compressedTexSubImage2D=compressedTexSubImage2DOpt,gl.copyTexImage2D=copyTexImage2DOpt,gl.copyTexSubImage2D=copyTexSubImage2DOpt,gl.createBuffer=createBufferOpt,gl.createFramebuffer=createFramebufferOpt,gl.createProgram=createProgramOpt,gl.createRenderbuffer=createRenderbufferOpt,gl.createShader=createShaderOpt,gl.createTexture=createTextureOpt,gl.cullFace=cullFaceOpt,gl.deleteBuffer=deleteBufferOpt,gl.deleteFramebuffer=deleteFramebufferOpt,gl.deleteProgram=deleteProgramOpt,gl.deleteRenderbuffer=deleteRenderbufferOpt,gl.deleteShader=deleteShaderOpt,gl.deleteTexture=deleteTextureOpt,gl.depthFunc=depthFuncOpt,gl.depthMask=depthMaskOpt,gl.depthRange=depthRangeOpt,gl.detachShader=detachShaderOpt,gl.disable=disableOpt,gl.disableVertexAttribArray=disableVertexAttribArrayOpt,gl.drawArrays=drawArraysOpt,gl.drawElements=drawElementsOpt,gl.enable=enableOpt,gl.enableVertexAttribArray=enableVertexAttribArrayOpt,gl.finish=finishOpt,gl.flush=flushOpt,gl.framebufferRenderbuffer=framebufferRenderbufferOpt,gl.framebufferTexture2D=framebufferTexture2DOpt,gl.frontFace=frontFaceOpt,gl.generateMipmap=generateMipmapOpt,gl.getActiveAttrib=getActiveAttribOpt,gl.getActiveUniform=getActiveUniformOpt,gl.getAttachedShaders=getAttachedShadersOpt,gl.getAttribLocation=getAttribLocationOpt,gl.getBufferParameter=getBufferParameterOpt,gl.getParameter=getParameterOpt,gl.getError=getErrorOpt,gl.getFramebufferAttachmentParameter=getFramebufferAttachmentParameterOpt,gl.getProgramParameter=getProgramParameterOpt,gl.getProgramInfoLog=getProgramInfoLogOpt,gl.getRenderbufferParameter=getRenderbufferParameterOpt,gl.getShaderParameter=getShaderParameterOpt,gl.getShaderPrecisionFormat=getShaderPrecisionFormatOpt,gl.getShaderInfoLog=getShaderInfoLogOpt,gl.getShaderSource=getShaderSourceOpt,gl.getTexParameter=getTexParameterOpt,gl.getUniform=getUniformOpt,gl.getUniformLocation=getUniformLocationOpt,gl.getVertexAttrib=getVertexAttribOpt,gl.getVertexAttribOffset=getVertexAttribOffsetOpt,gl.hint=hintOpt,gl.isBuffer=isBufferOpt,gl.isEnabled=isEnabledOpt,gl.isFramebuffer=isFramebufferOpt,gl.isProgram=isProgramOpt,gl.isRenderbuffer=isRenderbufferOpt,gl.isShader=isShaderOpt,gl.isTexture=isTextureOpt,gl.lineWidth=lineWidthOpt,gl.linkProgram=linkProgramOpt,gl.pixelStorei=pixelStoreiOpt,gl.polygonOffset=polygonOffsetOpt,gl.readPixels=readPixelsOpt,gl.renderbufferStorage=renderbufferStorageOpt,gl.sampleCoverage=sampleCoverageOpt,gl.scissor=scissorOpt,gl.shaderSource=shaderSourceOpt,gl.stencilFunc=stencilFuncOpt,gl.stencilFuncSeparate=stencilFuncSeparateOpt,gl.stencilMask=stencilMaskOpt,gl.stencilMaskSeparate=stencilMaskSeparateOpt,gl.stencilOp=stencilOpOpt,gl.stencilOpSeparate=stencilOpSeparateOpt,gl.texImage2D=texImage2DOpt,gl.texImage2D=texImage2DOpt,gl.texParameterf=texParameterfOpt,gl.texParameteri=texParameteriOpt,gl.texSubImage2D=texSubImage2DOpt,gl.texSubImage2D=texSubImage2DOpt,gl.uniform1f=uniform1fOpt,gl.uniform2f=uniform2fOpt,gl.uniform3f=uniform3fOpt,gl.uniform4f=uniform4fOpt,gl.uniform1i=uniform1iOpt,gl.uniform2i=uniform2iOpt,gl.uniform3i=uniform3iOpt,gl.uniform4i=uniform4iOpt,gl.uniform1fv=uniform1fvOpt,gl.uniform2fv=uniform2fvOpt,gl.uniform3fv=uniform3fvOpt,gl.uniform4fv=uniform4fvOpt,gl.uniform1iv=uniform1ivOpt,gl.uniform2iv=uniform2ivOpt,gl.uniform3iv=uniform3ivOpt,gl.uniform4iv=uniform4ivOpt,gl.uniformMatrix2fv=uniformMatrix2fvOpt,gl.uniformMatrix3fv=uniformMatrix3fvOpt,gl.uniformMatrix4fv=uniformMatrix4fvOpt,gl.useProgram=useProgramOpt,gl.validateProgram=validateProgramOpt,gl.vertexAttrib1f=vertexAttrib1fOpt,gl.vertexAttrib2f=vertexAttrib2fOpt,gl.vertexAttrib3f=vertexAttrib3fOpt,gl.vertexAttrib4f=vertexAttrib4fOpt,gl.vertexAttrib1fv=vertexAttrib1fvOpt,gl.vertexAttrib2fv=vertexAttrib2fvOpt,gl.vertexAttrib3fv=vertexAttrib3fvOpt,gl.vertexAttrib4fv=vertexAttrib4fvOpt,gl.vertexAttribPointer=vertexAttribPointerOpt,gl.viewport=viewportOpt,gl.glCommit=glCommitOpt}function SandBoxCanvas(){var t=arguments.length;this._shadowColor={r:0,g:0,b:0,a:0},this._shadowOffset={x:0,y:0},this._shadowRadius=0,this._textBaseLine=0,this._textAlign=0,this._useH5Mode=0,this._a=1,this._b=0,this._c=0,this._d=1,this._tx=0,this._ty=0,2==t&&(this.__nativeObj=new BK.SandBoxCanvasNode(arguments[0],arguments[1]),this.setFlipXY(0,1),Object.getOwnPropertyNames(this.__nativeObj).forEach(function(t){var e=t;"scale"!=e&&"transform"!=e&&"contentSize"!=e&&"size"!=e&&"fontPath"!=e&&Object.defineProperty(this,e,{get:function(){return this.__nativeObj[e]},set:function(t){this.__nativeObj[e]=t}})},this),Object.defineProperty(SandBoxCanvas.prototype,"fontPath",{get:function(){return this.__nativeObj.fontPath},set:function(t){BK.FileUtil.isFileExist(t)&&(this.__nativeObj.fontPath=t)},enumerable:!0,configurable:!0}),Object.defineProperty(SandBoxCanvas.prototype,"contentSize",{get:function(){return this.__nativeObj.contentSize},set:function(t){this.__nativeObj.contentSize=t,this.__nativeObj.resetCanvas()},enumerable:!0,configurable:!0}),Object.defineProperty(SandBoxCanvas.prototype,"size",{get:function(){return this.__nativeObj.size},set:function(t){this.__nativeObj.size=t,this.__nativeObj.resetCanvas()},enumerable:!0,configurable:!0}),Object.defineProperty(SandBoxCanvas.prototype,"textBaseline",{get:function(){return this._textBaseLine},set:function(t){switch(t){case 0:case 1:case 2:this._textBaseLine=t;break;case"bottom":case"Bottom":this._textBaseLine=0;break;case"Middle":case"middle":this._textBaseLine=1;break;case"Top":case"top":this._textBaseLine=2}},enumerable:!0,configurable:!0}),Object.defineProperty(SandBoxCanvas.prototype,"textAlign",{get:function(){return this._textAlign},set:function(t){switch(t){case 0:case 1:case 2:this._textAlign=t;break;case"left":this._textAlign=0;break;case"center":this._textAlign=1;break;case"right":this._textAlign=2}this.__nativeObj.setTextAlign(this._textAlign)},enumerable:!0,configurable:!0}),Object.defineProperty(SandBoxCanvas.prototype,"lineWidth",{get:function(){return this.__nativeObj.lineWidth},set:function(t){this.__nativeObj.lineWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(SandBoxCanvas.prototype,"globalAlpha",{get:function(){return this.__nativeObj.globalAlpha},set:function(t){t=Math.min(1,t),t=Math.max(0,t),this.__nativeObj.globalAlpha=t},enumerable:!0,configurable:!0}),Object.defineProperty(SandBoxCanvas.prototype,"fillColor",{get:function(){return this.__nativeObj.fillColor},set:function(t){this.__nativeObj.fillColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(SandBoxCanvas.prototype,"strokeColor",{get:function(){return this.__nativeObj.strokeColor},set:function(t){this.__nativeObj.strokeColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(SandBoxCanvas.prototype,"lineCap",{get:function(){return this.__nativeObj.lineCap},set:function(t){this.__nativeObj.lineCap=t},enumerable:!0,configurable:!0}),Object.defineProperty(SandBoxCanvas.prototype,"lineJoin",{get:function(){return this.__nativeObj.lineJoin},set:function(t){this.__nativeObj.lineJoin=t},enumerable:!0,configurable:!0}),Object.defineProperty(SandBoxCanvas.prototype,"miterLimit",{get:function(){return this.__nativeObj.miterLimit},set:function(t){this.__nativeObj.miterLimit=t},enumerable:!0,configurable:!0}))}function __dispatchEvent(t,e,i){BK.Script.log(0,0,"__dispatchEvent err:"+t+" cmd:"+e+" data:"+i),Array.isArray(__browserMsgHdl.listenerInfos)&&__browserMsgHdl.listenerInfos.length<=0&&"sc.init_global_var.local"==e&&(GameStatusInfo=JSON.parse(i)),__browserMsgHdl.listenerInfos.forEach(function(r){if(r.cmd==e){var n=r.callback;try{n(t,e,JSON.parse(i))}catch(t){console.log(t),BK.Script.log(0,0,"JSON parse error:"+t+" data: "+i)}}},this),BK.MQQ.SsoRequest.listenerInfos.forEach(function(r){if(r.cmd==e){var n=r.callback;try{"cs.get_file_data.local"==e?n(t,e,i):n(t,e,JSON.parse(i))}catch(t){console.log(t),BK.Script.log(0,0,"JSON parse error:"+t+" data: "+i)}}},this)}function registerRedPackageListener(){function t(){BK.Script.log(1,0,"on onGameLoad for redpackage "+localStorage.loadRedpackage),"1"!==localStorage.loadRedpackage&&(localStorage.loadRedpackage="1",BK.QQ.isOpenActivityPage()&&BK.QQ.showRedPackageActivityPage())}function e(){BK.Script.log(1,0,"on onGameForeground for redpackage "+localStorage.loadRedpackage),localStorage.loadRedpackage="0"}function i(){BK.Script.log(1,0,"on onGameLoad for redpackage not H5"),BK.QQ.isOpenActivityPage()&&BK.QQ.showRedPackageActivityPage()}BK.isBrowser?(BK.Script.log(1,0,"set listener for notifyJSEVent redpackage h5"),BK.MQQ.SsoRequest.addListener("sc.init_global_var.local",this,t),BK.MQQ.SsoRequest.addListener("sc.game_enter_foreground.local",this,e)):(BK.Script.log(1,0,"set listener for notifyJSEVent redpackage not h5"),BK.MQQ.SsoRequest.addListener("sc.init_global_var.local",this,i)),BK.MQQ.SsoRequest.addListener("apollo_router_light.apollo_activity_linkcmd_query_new_redpacket",BK.QQ,BK.QQ.onNewRedPackage.bind(BK.QQ))}var hasBK=!("object"!=typeof BK),isBrowser=!hasBK;if(isBrowser){"undefined"!=typeof BK==0&&(BK={},BK.isBrowser=!0),function(t,e){if("object"==typeof t){var i=function(){var t=function(){function t(){}return t.open=function(t){e.send({url:t},"cs.openWebView.local")},t.openTransparent=function(t,i,r){void 0===i&&(i=1);var n="cs.openWebViewWithoutUrl.local";r&&(__browserMsgHdl.removeListener(n,this),__browserMsgHdl.addListener(n,this,r)),e.send({url:t},n)},t.closeTransparent=function(t){e.send({taskId:t},"cs.closeWebview.local")},t.onMessageHandle=function(t){},t}(),e=function(){function t(){}return t.ssoRequestCallBack=function(t,e,i){BK.Script.log(0,0,"ssoRequestCallBack cmd:"+e+" errCode:"+t+" data:"+JSON.stringify(i)),__dispatchEvent(t,i.cmd,JSON.stringify(i.data))},t.sendSSO=function(e,i){__browserMsgHdl.addListener("cs.ssoMessage.local",this,this.ssoRequestCallBack),t.send({cmd:i,data:JSON.stringify(e)},"cs.ssoMessage.local")},t.addListener=function(t,e,i){__browserMsgHdl.addListener(t,e,i)},t.removeListener=function(t,e){__browserMsgHdl.removeListener(t,e)},t.send=function(t,e){-1!=e.indexOf("cs.")&&-1!=e.indexOf(".local")?"undefined"!=typeof __browserMsg?__browserMsg.send(JSON.stringify(t),e):void 0!==window.webkit.messageHandlers&&window.webkit.messageHandlers.cmWebGameSend.postMessage({data:JSON.stringify(t),cmd:e}):BK.MQQ.SsoRequest.sendSSO(t,e)},t.sendWebMessage=function(e,i){t.send({cmd:i,data:JSON.stringify(e)},"sc.web_callback_game.local")},t}(),i=function(){function t(){}return t.accountCallBack=function(e,i,r){var n="0";1===r.nickname?n="1":1===r.avatar&&(n="2");var o=i+"_"+n;t.accountCallBackArr[o]&&(0,t.accountCallBackArr[o])(r.openId,r.data)},t.getNick=function(e,i){t.accountCallBackArr["cs.get_userInfo.local_1"]=i,BK.MQQ.SsoRequest.addListener("cs.get_userInfo.local",this,this.accountCallBack),BK.MQQ.SsoRequest.send({openId:e,nickname:1},"cs.get_userInfo.local")},t.getHead=function(e,i){t.accountCallBackArr["cs.get_userInfo.local_2"]=i,BK.MQQ.SsoRequest.addListener("cs.get_userInfo.local",this,this.accountCallBack),BK.MQQ.SsoRequest.send({openId:e,avatar:1},"cs.get_userInfo.local")},t.accountCallBackArr=[],t}(),r=function(){function t(){}return t.log=function(t,e,i){"undefined"!=typeof GameStatusInfo&&this.compareVersion(GameStatusInfo.QQVer,"7.6.0")>=0&&("undefined"!=typeof __browserMsg?__browserMsg.log(t,e,"webGame_log",i,""):void 0!==window.webkit.messageHandlers&&window.webkit.messageHandlers.cmWebGameLog.postMessage({level:t,errcode:e,info1:"webGame_log",info2:i,info3:""}))},t.compareVersion=function(e,i){var r=e.split("."),n=i.split("."),o=r[0]-n[0];return 0==o&&e!=i?t.compareVersion(r.splice(1).join("."),n.splice(1).join(".")):o},t}(),n=function(){function t(){}return t.base64ToUint8Array=function(t){var e,i,r,n,o,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=.75*t.length,h=t.length,c=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var l=new ArrayBuffer(s),u=new Uint8Array(l);for(e=0;e<h;e+=4)i=a.indexOf(t[e]),r=a.indexOf(t[e+1]),n=a.indexOf(t[e+2]),o=a.indexOf(t[e+3]),u[c++]=i<<2|r>>4,u[c++]=(15&r)<<4|n>>2,u[c++]=(3&n)<<6|63&o;return u},t.upload=function(t,e,i){for(var r=t.length>1024?1024:t.length,n=new Uint8Array(r),o=0;o<r/2;o++)n[o]=t[o];for(o=t.length-r/2;o<t.length;o++)n[o]=t[o];var a=BK.Crypt.core_md5(n,r),s=new Date,h=s.getFullYear()+(s.getMonth()+1<10?0+(s.getMonth()+1):s.getMonth()+1)+s.getDate(),c=e.tmpSecretId,l=e.upLoadPrefUrl,u=e.downloadUrl,d=e.sessionToken,_=e.signature,f=e.signTime,g="/"+GameStatusInfo.gameId+"_"+BK.Crypt.bin2hex(a)+GameStatusInfo.gameId+"_"+h+".png";l=l.replace(new RegExp("http://","gm"),"");var p="put\n"+g+"\n\nhost="+l+"&x-cos-storage-class=nearline\n",m="sha1\n"+f+"\n"+BK.Crypt.hex_sha1(p)+"\n",v="q-sign-algorithm=sha1&q-ak="+c+"&q-sign-time="+f+"&q-key-time="+f+"&q-header-list=host;x-cos-storage-class&q-url-param-list=&q-signature="+BK.Crypt.hex_hmac_sha1(_,m),S=new XMLHttpRequest;S.onreadystatechange=function(){4==this.readyState&&(200==this.status?(BK.Script.log(0,0," on response res = "+this.status+" "+JSON.stringify(this.HEADERS_RECEIVED)),u.charAt(u.length-1)==g.charAt(0)&&"/"==g.charAt(0)&&(u=u.slice(0,u.length-1)),i(this.status,u+g)):i(this.status,""))},S.open("put","https://"+l+g,!0),S.setRequestHeader("x-cos-storage-class","nearline"),S.setRequestHeader("x-cos-security-token",d),S.setRequestHeader("authorization",v),S.send(t)},t.uploadFromFile=function(t,e){var i="cs.get_file_data.local",r={cmd:i,path:t};e&&(BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,function(t,i,r){var n=BK.FileUtil.base64ToUint8Array(r);BK.FileUtil.uploadFromBuff(n,e)}),BK.MQQ.SsoRequest.send(r,i))},t.uploadFromBuff=function(t,e){BK.QQ.queryCloudSignature(function(i,r){BK.FileUtil.upload(t,r,e)})},t}(),o=function(){function t(){}return t.share=function(t,e){if(t.inner=1,e){var i="sc.share_game_to_friend_result.local";BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,function(t,i,r){e(t,i,r),this.shareUpload(0==t?0:1),BK.MQQ.SsoRequest.removeListener(i,this)}.bind(this))}BK.Script.log(0,0,"share "+JSON.stringify(t)),BK.MQQ.SsoRequest.send(t,"cs.game_shell_share_callback.local")},t.shareToMQQ=function(t,i,r,n){var o="cs.share_game_result.local",a={cmd:o,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId,gameVersion:GameStatusInfo.gameVersion,roomId:GameStatusInfo.roomId,title:t,summary:i,detailUrl:r,picUrl:n};e.send(a,o)},t.getRankList=function(e,i){var r={cmd:this.CMSHOW_SRV_GET_RANK_LIST,from:"default",objType:1,objId:0,busType:3,busId:GameStatusInfo.gameId.toString()};i&&(i.objType&&(r.objType=i.objType),i.objId&&(r.objId=i.objId),i.from&&(r.from=i.from)),BK.Script.log(1,1,"BK.QQ.reqGetRankList! "+JSON.stringify(r)),void 0!=r?(t._getRankListCallBack=e,BK.MQQ.SsoRequest.removeListener(this.CMSHOW_SRV_GET_RANK_LIST,this),BK.MQQ.SsoRequest.addListener(this.CMSHOW_SRV_GET_RANK_LIST,this,this._event4GetRankList),BK.MQQ.SsoRequest.sendSSO(r,this.CMSHOW_SRV_GET_RANK_LIST)):BK.Script.log(0,0,"reqGetRankList data undefined!")},t.consumeItems=function(t,e){var i="apollo_game_item.consume_game_items",r={cmd:i,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId,items:t};e&&(BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,function(t,i,r){var n=[],o=[];0==t&&(n=r.data.succList,o=r.data.failList),e(t,n,o)})),BK.MQQ.SsoRequest.sendSSO(r,i)},t.getUserGameItems=function(t){var e="apollo_aio_game.get_user_game_items",i={cmd:e,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId};t&&(BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,function(e,i,r){if(void 0!=r){var n={};n.data=r.data,t(e,i,n)}})),BK.MQQ.SsoRequest.sendSSO(i,e)},t.buyGameItems=function(t,e,i){var r="apollo_aio_game.buy_game_items",n={cmd:r,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,curreType:t,itemIdList:e};i&&(BK.MQQ.SsoRequest.removeListener(r,this),BK.MQQ.SsoRequest.addListener(r,this,function(t,e,r){if(void 0!=r){var n={};n.data=r.data,i(t,e,n)}})),BK.MQQ.SsoRequest.sendSSO(n,r)},t.queryCloudSignature=function(t){var e="cs.fetch_cloud_signature.local",i={cmd:e,now:(new Date).getTime()/1e3-1,delta:600};t&&(BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,function(e,i,r){t(e,r)}),BK.MQQ.SsoRequest.send(i,e))},t.notifyCloseGame=function(){var t={gameId:GameStatusInfo.gameId,roomId:0};BK.Script.log(0,0,"BK.QQ.notifyCloseGame!gameId = "+t.gameId+", roomId = "+t.roomId),BK.MQQ.SsoRequest.send(t,"cs.close_room.local")},t.CMSHOW_SRV_GET_RANK_LIST="apollo_router_game.game_rank_linkcmd_get_fri_rank_for_engine",t.shareToArk=function(t,i,r,n,o,a){"boolean"==typeof n&&(n=1==n?1:0);var s="cs.share_game_in_ark.local",h="sc.share_game_to_friend_result.local";"android"==GameStatusInfo.platform&&0==GameStatusInfo.QQVer.indexOf("7.6.0")&&(s="cs.game_shell_share_callback.local");var c={cmd:s,summary:i,picUrl:r,gameId:GameStatusInfo.gameId,roomId:t,gameMode:GameStatusInfo.gameMode,isSelectFriend:n,extendInfo:o};BK.Script.log(0,0,"ShareToArk summary="+c.summary+" roomId="+c.roomId+" gameMode="+c.gameMode+"picUrl="+c.picUrl+" gameId="+c.gameId),a&&(BK.MQQ.SsoRequest.removeListener(h,this),BK.MQQ.SsoRequest.addListener(h,this,a)),e.send(c,s)},t.shareToArkFromFile=function(t,e,i,r){BK.FileUtil.uploadFromFile(r,function(r,n){BK.QQ.shareToArk(t,e,n,!0,i)})},t.shareToArkFromBuff=function(t,e,i,r){BK.FileUtil.uploadFromBuff(r,function(r,n){200==r&&BK.QQ.shareToArk(t,e,n,!0,i)})},t.createShortCut=function(t,e){var i="";t&&(i=t);var r={extendInfo:i};if(e){var n="cs.create_xy_shortcut.local";BK.MQQ.SsoRequest.removeListener(n,this),BK.MQQ.SsoRequest.addListener(n,this,function(t,i,r){e(t,i,r),BK.MQQ.SsoRequest.removeListener(i,this)})}BK.MQQ.SsoRequest.send(r,"cs.create_xy_shortcut.local"),BK.Script.log(0,0,"createShortCut")},t.fetchOpenKey=function(t){var e="cs.on_get_open_key.local",i={gameId:GameStatusInfo.gameId};t&&(BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,t)),BK.MQQ.SsoRequest.send(i,e)},t.scoreUpload=function(t,e,i){var r="apollo_aio_game.report_user_score_3rd",n={cmd:r,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId,version:GameStatusInfo.gameVersion,roomId:GameStatusInfo.roomId,gData:t};i&&(n.arkData=i),e&&(BK.MQQ.SsoRequest.removeListener(r,this),BK.MQQ.SsoRequest.addListener(r,this,e)),BK.MQQ.SsoRequest.sendSSO(n,r)},t._getRankListCallBack=void 0,t._event4GetRankList=function(e,i,r){BK.Script.log(1,1,"BK.QQ.reqGetRankList! callback cmd:"+i+" errCode:"+e+" data:"+JSON.stringify(r)),void 0!=t._getRankListCallBack&&t._getRankListCallBack(e,i,r),BK.MQQ.SsoRequest.removeListener(this.CMSHOW_SRV_GET_RANK_LIST,this)},t.uploadScoreWithoutRoom=function(t,e,i){var r="apollo_report_result.single_user_result",n=Math.floor((new Date).getTime()/1e3),o={from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId,version:GameStatusInfo.gameVersion,aioType:1,ts:n.toString(),src:GameStatusInfo.src,mode:void 0!==t?t:1,userData:e.userData,attr:e.attr};i&&(BK.MQQ.SsoRequest.removeListener(r,this),BK.MQQ.SsoRequest.addListener(r,this,i)),BK.MQQ.SsoRequest.sendSSO(o,r)},t.getRankListWithoutRoom=function(t,e,i,r){var n="apollo_router_game.apollo_user_rankinglist_linkcmd_custom_ranking",o=Math.floor((new Date).getTime()/1e3),a={from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId,version:GameStatusInfo.gameVersion,ts:o.toString(),attr:void 0!==t?t:"score",order:void 0!==e?e:1,rankType:void 0!==i?i:0};r&&(BK.MQQ.SsoRequest.removeListener(n,this),BK.MQQ.SsoRequest.addListener(n,this,r)),BK.MQQ.SsoRequest.sendSSO(a,n)},t.qPayPurchase=function(t,e,i,r){var n=1,o={gameOrientation:t,transparent:n=1==e?1:0,businessType:2,url:"https://cmshow.qq.com/apollo/html/game-platform/buy-props.html?_wv=3&adtag=inside_game&gameId="+GameStatusInfo.gameId+"&gameOrientation="+t+"&itemList="+encodeURI(JSON.stringify(i))};if(r){var a="sc.apolloGameWebMessage.local";BK.MQQ.SsoRequest.removeListener(a,this),BK.MQQ.SsoRequest.addListener(a,this,function(t,e,i){0==t&&i.op&&"apolloGamePlatform.buyProps"==i.op&&r(i.data.code,i.data)}.bind(this))}BK.MQQ.SsoRequest.send(o,"cs.openWebViewWithoutUrl.local")},t.getGameItemList=function(t){var e="apollo_aio_game.get_game_itemList",i={cmd:e,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId};t&&(BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,t)),BK.MQQ.SsoRequest.sendSSO(i,e)},t.rollbackGameItems=function(t,e){var i="apollo_game_item.rollback_game_items",r={cmd:i,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId,items:t};e&&(BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,function(t,i,r){var n=[],o=[];0==t&&(n=r.data.succList,o=r.data.failList),e(t,n,o)}.bind(this))),BK.MQQ.SsoRequest.sendSSO(r,i)},t.shareUpload=function(t){var e=t.toString();BK.QQ.uploadData("clickShowOffButton","",e,"","","")},t.uploadData=function(t,e,i,r,n,o){var a="cs.report_data_2_compass.local",s=GameStatusInfo.gameId;"ios"==GameStatusInfo.platform&&(t=t.toString(),i=i.toString());var h={cmd:a,actionName:t,enter:e,entry:e,result:i,r2:s.toString(),r3:r,r4:n,r5:o};BK.MQQ.SsoRequest.sendSSO(h,a)},t.saveGameData=function(t,e){var i="apollo_private_data.set_user_data",r=Math.floor((new Date).getTime()/1e3),n={openId:GameStatusInfo.openId,gameId:GameStatusInfo.gameId,version:GameStatusInfo.gameVersion,from:GameStatusInfo.platform,ts:r.toString(),data:t};e&&(BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,e)),BK.MQQ.SsoRequest.send(n,i)},t.loadGameData=function(t){var e="apollo_private_data.get_user_data",i=Math.floor((new Date).getTime()/1e3),r={openId:GameStatusInfo.openId,gameId:GameStatusInfo.gameId,version:GameStatusInfo.gameVersion,from:GameStatusInfo.platform,ts:i.toString()};t&&(BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,t)),BK.MQQ.SsoRequest.send(r,e)},t.reportGameResult=function(t,e){var i="apollo_router_game.apollo_reportcm_linkcmd_game_result";t.gameId=GameStatusInfo.gameId,GameStatusInfo.isWhiteUser>0&&BK.Script.log(1,1,"reportGameResult :"+t),BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,function(t,i,r){BK.QQ.checkNewRedPackage(),e&&e(t,i,r)}),BK.MQQ.SsoRequest.send(t,i)},t.sendB2CRedPacket=function(t,e){if(e){var i="sc.send_b2c_redpacket_result.local";BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,function(t,i,r){e(t,i,r),BK.MQQ.SsoRequest.removeListener(i,this)})}var r={groupPushData:{gameRedPacketId:1,gameId:GameStatusInfo.gameId,extraInfo:t}};BK.Script.log(1,1,"sendB2CRedPacket:"+JSON.stringify(r)),BK.MQQ.SsoRequest.send(r,"cs.send_b2c_redpacket.local"),BK.Script.log(0,0,"sendB2CRedPacket")},t}(),a=function(){function t(){}return t.close=function(){BK.MQQ.SsoRequest.sendWebMessage({},"cs.close_room.local")},t.packUp=function(){BK.MQQ.SsoRequest.sendWebMessage({},"cs.make_room_min.local")},t}(),s=function(){function t(){}return t}();return{Webview:t,SsoRequest:e,Account:i,Script:r,FileUtil:n,QQ:o,Game:a,Misc:s}}();void 0===t.MQQ&&(t.MQQ={Webview:i.Webview,SsoRequest:i.SsoRequest,Account:i.Account}),void 0===t.FileUtil&&(t.FileUtil=i.FileUtil),void 0===t.Script&&(t.Script=i.Script),void 0===t.QQ&&(t.QQ=i.QQ),void 0===t.Game&&(t.Game=i.Game),void 0===t.Misc&&(t.Misc=i.Misc)}}(BK),function(t,e){e.Script.setErrorObserver=function(t){},t._globalErrorCallback_=function(t){}}(this,BK),BK.Misc.compQQVersion||(BK.Misc.compQQVersion=function(t,e){for(var i=t.split("."),r=e.split("."),n=Math.min(3,Math.min(i.length,r.length)),o=0;o<n;o++)if(i[o]!=r[o])return i[o]<r[o];return!0},BK.Misc.qqVerLessthan=function(t,e){for(var i=t.split("."),r=e.split("."),n=Math.min(3,Math.min(i.length,r.length)),o=0;o<n;o++)if(i[o]<r[o])return!0;return!1});var CMSHOW_SRV_CHECK_NEW_RED_PACKAGE="apollo_router_light.apollo_activity_linkcmd_query_new_redpacket",redPackageOpenCount=0;BK.QQ.showRedPackageActivityPage=function(){if(BK.QQ.isOpenActivityPage()&&0===redPackageOpenCount){var t="http://cmshow.qq.com/act_apollo/h5_act/gameRedPacket/html/popup.html?game_id="+GameStatusInfo.gameId+"&page=ad&_cwv=1&wv=3&adtag=engine";BK.Script.log(1,0,"redPackage 打开游戏浮层 :"+t),BK.MQQ.Webview.openTransparent(t),redPackageOpenCount++}},BK.QQ.checkNewRedPackage=function(){if(BK.QQ.isUserInRedPackageActivity()){var t={cmd:CMSHOW_SRV_CHECK_NEW_RED_PACKAGE,gameId:GameStatusInfo.gameId.toString()};BK.MQQ.SsoRequest.send(t,CMSHOW_SRV_CHECK_NEW_RED_PACKAGE)}},BK.QQ.onNewRedPackage=function(t,e,i){if(BK.Script.log(1,0,"BK.QQ.onNewRedPackage redPackage errCode = "+t+" cmd = "+e+" data = "+JSON.stringify(i)),0==t)if(i.data&&i.data.redPacket&&i.data.redPacket.actId&&i.data.redPacket.taskId){var r=i.data.redPacket,n="http://cmshow.qq.com/act_apollo/h5_act/gameRedPacket/html/popup.html?game_id="+GameStatusInfo.gameId+"&page=task&task_id="+r.taskId+"&_cwv=1&wv=3&adtag=engine";BK.MQQ.Webview.openTransparent(n)}else BK.Script.log(1,0,"request new red package redPackage ,没有新红包任务触发");else BK.Script.log(1,0,"request new red package Failed! redPackage ErrCode:"+t)}}else{!function(t,e){"object"==typeof t&&("object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Emitter=e())}(BK,function(){var t=function(){function t(t,e,i){this.once=i,this.target=t,this.callback=e}return t}();return function(){function e(){this._emits={}}return e.prototype.__emit_get=function(t){return this._emits[t]||(this._emits[t]=new Array),this._emits[t]},e.prototype.__emit_put=function(t,e){this.__emit_get(t).push(e)},e.prototype.__emit_exists=function(t,e){for(var i=this.__emit_get(t),r=!1,n=0;n<i.length;n++)if(i[n].target==e){r=!0;break}return r},e.prototype.dispose=function(){delete this._emits},e.prototype.on=function(e,i,r,n){if(0==this.__emit_exists(e,i)){var o=new t(i,r,n);this.__emit_put(e,o)}else BK.Script.log(0,0,"BK.bkEmitter.on!has found, event = "+e+", target = "+JSON.stringify(i))},e.prototype.off=function(t,e){for(var i=this.__emit_get(t),r=0;r<i.length;r++)if(i[r].target==e){i.splice(r,1);break}},e.prototype.offAll=function(t){Object.keys(this._emits).forEach(function(e){this.off(e,t)}.bind(this))},e.prototype.emitAll=function(t,e){for(var i=new Array,r=this.__emit_get(t),n=0;n<r.length;n++){var o={event:t,source:this,target:r[n].target,extras:e};r[n].callback&&r[n].callback(o),1==r[n].once&&i.push(r[n].target)}for(var a=0;a<i.length;a++)this.off(t,i[a])},e.prototype.emitOnce=function(t,e){for(var i=new Array,r=this.__emit_get(t),n=0;n<r.length;n++)if(1==r[n].once){var o={event:t,source:this,target:r[n].target,extras:e};i.push(r[n].target),r[n].callback&&r[n].callback(o)}for(var a=0;a<i.length;a++)this.off(t,i[a])},e}()}),function(){function t(t){var e,i,n,o,a,s=.75*t.length,h=t.length,c=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var l=new ArrayBuffer(s);for(bytes=new Uint8Array(l),e=0;e<h;e+=4)i=r.indexOf(t[e]),n=r.indexOf(t[e+1]),o=r.indexOf(t[e+2]),a=r.indexOf(t[e+3]),bytes[c++]=i<<2|n>>4,bytes[c++]=(15&n)<<4|o>>2,bytes[c++]=(3&o)<<6|63&a;return l}function e(t,e,i){var n,o=new Uint8Array(t,e||0,i||t.byteLength),a=o.length,s="";for(n=0;n<a;n+=3)s+=r[o[n]>>2],s+=r[(3&o[n])<<4|o[n+1]>>4],s+=r[(15&o[n+1])<<2|o[n+2]>>6],s+=r[63&o[n+2]];return a%3==2?s=s.substring(0,s.length-1)+"=":a%3==1&&(s=s.substring(0,s.length-2)+"=="),s}function i(t){function e(t,e){var i=e.length,r={type:t};switch(t){case 0:for(a=0;i>0;){var n=Math.min(i,4096),o=new Int8Array(e.buffer,a*Int8Array.BYTES_PER_ELEMENT,n);BK.Misc.transferArrayBuffer.apply(r,o),a+=4096,i-=4096}break;case 1:for(a=0;i>0;){var n=Math.min(i,4096),o=new Int16Array(e.buffer,a*Int16Array.BYTES_PER_ELEMENT,n);BK.Misc.transferArrayBuffer.apply(r,o),a+=4096,i-=4096}break;case 2:for(a=0;i>0;){var n=Math.min(i,4096),o=new Int32Array(e.buffer,a*Int32Array.BYTES_PER_ELEMENT,n);BK.Misc.transferArrayBuffer.apply(r,o),a+=4096,i-=4096}break;case 3:for(a=0;i>0;){var n=Math.min(i,4096),o=new Uint8Array(e.buffer,a*Uint8Array.BYTES_PER_ELEMENT,n);BK.Misc.transferArrayBuffer.apply(r,o),a+=4096,i-=4096}break;case 5:for(a=0;i>0;){var n=Math.min(i,4096),o=new Uint16Array(e.buffer,a*Uint16Array.BYTES_PER_ELEMENT,n);BK.Misc.transferArrayBuffer.apply(r,o),a+=4096,i-=4096}break;case 6:for(a=0;i>0;){var n=Math.min(i,4096),o=new Uint32Array(e.buffer,a*Uint32Array.BYTES_PER_ELEMENT,n);BK.Misc.transferArrayBuffer.apply(r,o),a+=4096,i-=4096}break;case 7:for(var a=0;i>0;){var n=Math.min(i,4096),o=new Float32Array(e.buffer,a*Float32Array.BYTES_PER_ELEMENT,n);BK.Misc.transferArrayBuffer.apply(r,o),a+=4096,i-=4096}}}return t instanceof Int8Array==!0?e(0,t):t instanceof Int16Array==!0?e(1,t):t instanceof Int32Array==!0?e(2,t):t instanceof Uint8Array==!0?e(3,t):t instanceof Uint16Array==!0?e(5,t):t instanceof Uint32Array==!0?e(6,t):t instanceof Float32Array==!0&&e(7,t),BK.Misc.getTransferedArrayBuffer()}var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";BK.Misc.BKBufferToArrayBuffer=function(e){return e.rewind(),t(BK.Misc.encodeBase64FromBuffer(e))},BK.Misc.arrayBufferToBKBuffer=function(t,i,r){var n=e(t,i,r);return BK.Misc.decodeBase64FromString(n)},BK.Misc.typedArrayToBKBuffer=function(t){return BK.Misc.transferArrayBuffer?i(t):BK.Misc.arrayBufferToBKBuffer(t.buffer,t.byteOffset,t.byteLength)}}(),enGameHallSucc=0,eReqDataLenErr=1e3,eReqMagicErr=1001,eReqFrontCmdErr=1002,eReqBackCmdErr=1003,eReqBackSrcErr=1004,eReqFromIdErr=1005,eSTDecryErr=1006,eReqDecryErr=1007,eSTExpire=1008,eSystmeErr=1009,eVerUnvalid=1010,eReqLimit=1011,eGetSvrErr=1012,eInitMemErr=2001,eQueryMemErr=2002,eUpdateMemErr=2003,eDelMemErr=2004,eGetConfigErr=2005,eNotifyCreateErr=2006,eGetRoomIdErr=2007,eCmdInvalid=2008,eRoomNotExist=2009,eInBlackList=2010,eMatchTimeOut=2011,eGetRoomErr=3e3,eRoomStatusErr=3001,eIsNotCreator=3002,eIsNotInRoom=3003,eFlushTsErr=3004,eLogoutIdErr=3005,eIsNotInSvc=3006,eUsrOverFlow=3007,eRoomOverFlow=3008,eRoomIsExist=3009,eRmvUsrErr=3010,eLoginSysErr=3011,eUsrHasLoginErr=3012,eRoomIsFullErr=3013,eCreateRoomErr=3014,ePlayerHasJoin=3015,eUgcDataAnti=3020,eFowardToClientErr=4e3,eFowardToSvrErr=4001;var DebugRecommandRoomSvrHost="139.199.216.130",DebugRecommandRoomSvrPort=10060,NormalRecommandRoomSvrHost="139.199.216.128",NormalRecommandRoomSvrPort=10060,TLVType=new Object;TLVType.Int8=33,TLVType.Uint8=34,TLVType.Int16=33,TLVType.Uint16=36,TLVType.Int32=37,TLVType.Uint32=38,TLVType.Int64=39,TLVType.Uint64=40,TLVType.Byte=41,TLVType.Double=42,TLVType.Float=43,TLVType.Int8Repeated=49,TLVType.Uint8Repeated=50,TLVType.Int16Repeated=51,TLVType.Uint16Repeated=52,TLVType.Int32Repeated=53,TLVType.Uint32Repeated=54,TLVType.Int64Repeated=55,TLVType.Uint64Repeated=56,TLVType.ByteRepeated=57,TLVType.DoubleRepeated=58,TLVType.FloatRepeated=59;var fixedHeaderLen=120,HeaderLen=12,currentGameMode=GameStatusInfo.gameMode,fromPlatform=GameStatusInfo.platform,currentAioType=GameStatusInfo.aioType,currentPlayerOpenId=GameStatusInfo.openId,isMaster=GameStatusInfo.isMaster;NETWORK_ENVIRONMENT_QQ_RELEASE=0,NETWORK_ENVIRONMENT_QQ_DEBUG=1,NETWORK_ENVIRONMENT_DEMO_DEV=2,CMSHOW_SRV_CMD_JOIN_ROOM="apollo_aio_game.join_room",CMSHOW_SRV_CMD_QUIT_GAME="apollo_aio_game.quit_room",CMSHOW_SRV_CMD_START_GAME="apollo_aio_game.start_game",CMSHOW_SRV_CMD_CANCEL_GAME="apollo_aio_game.cancel_game_room",CMSHOW_SRV_CMD_CUSTOM_GAME_LOGIC="apollo_game_openapi.custom_game_logic",CMSHOW_SRV_GET_RANK_LIST="apollo_router_game.game_rank_linkcmd_get_fri_rank_for_engine",CMSHOW_SC_CMD_STOP_GAME="sc.force_stop_game.local",CMSHOW_CS_CMD_MINI_WND="cs.make_room_min.local",CMSHOW_CS_CMD_CLOSE_WND="cs.close_room.local",CMSHOW_CS_CMD_CREATE_ROOM="cs.create_room.local",CMSHOW_CS_CMD_JOIN_ROOM="cs.join_room.local",CMSHOW_CS_CMD_SEND_GAME_MSG="cs.send_game_msg.local",CMSHOW_CS_CMD_GAME_TIPS="cs.game_tips.local",CMSHOW_CS_CMD_GET_PLAYER_DRESS="cs.get_dress_path.local",CMSHOW_CS_CMD_GAME_READY="cs.game_ready.local",CMSHOW_CS_CMD_GAME_START="cs.game_start.local",CMSHOW_CS_CMD_SAVE_RECOMM_VIP="cs.save_recommend_ip.local",CMSHOW_CS_CMD_GET_SRV_IP_PORT="cs.get_server_ip_port.local",CMSHOW_CS_CMD_CHECK_PUBACCOUNT_STATE="cs.check_pubAccount_state.local",CMSHOW_CS_CMD_ENTER_PUBACCOUNT_CARD="cs.enter_pubAccount_card.local",CMSHOW_CS_CMD_SHARE_PIC="cs.share_pic.local",CMSHOW_CS_CMD_SHARE_IN_ARK="cs.share_game_in_ark.local",CMSHOW_CS_CMD_QUERY_CLOUD_SIGNATURE="cs.fetch_cloud_signature.local",CMSHOW_AIO_PAUSE="sc.aio_pause.local",CMSHOW_AIO_RESUME="sc.aio_resume.local",CMD_CMSHOW_GAME_ENTER_BACKGROUND="sc.game_enter_background.local",CMD_CMSHOW_GAME_ENTER_FORGROUND="sc.game_enter_foreground.local",CMD_CMSHOW_GAME_MAXIMIZE="sc.game_maximize.local",CMD_CMSHOW_GAME_MINIMIZE="sc.game_minimize.local",CMSHOW_CS_CMD_AUDIOROOM_ENTERN="cs.audioRoom_enter.local",CMSHOW_CS_CMD_AUDIOROOM_EXIT="cs.audioRoom_exit.local",CMSHOW_CS_CMD_AUDIOROOM_UPDATEUSERINFO="cs.audioRoom_update_userinfo.local",CMSHOW_CS_CMD_AUDIOROOM_SET_MIC="cs.audioRoom_set_mic.local",CMSHOW_CS_CMD_AUDIOROOM_SET_SPEAKER="cs.audioRoom_set_speaker.local",CMSHOW_CS_CMD_AUDIOROOM_INIT="cs.audioRoom_init.local",CMSHOW_CS_CMD_AUDIOROOM_DISCONNECT="cs.audioRoom_disconnect.local",CMSHOW_CS_CMD_AUDIOROOM_CAMERASWITCH="cs.audioRoom_cameraswitch.local",CMSHOW_CS_CMD_AUDIOROOM_SET_BEAUTY="cs.audioRoom_set_beauty.local",CMSHOW_CS_CMD_AUDIOROOM_REQ_AUDIO_SESSION="cs.audioRoom_req_audio_session.local",CMSHOW_CS_CMD_LOAD_PACKAGE="cs.load_subpackage.local",CMSHOW_CS_CMD_LOAD_PERCENTAGE_NOTIFY="sc.load_percentage_nofity.local",CMSHOW_CS_CMD_FILE_CORRECTNESS_CHECK="cs.file_correctness_check.local",CMSHOW_CS_CMD_SHOW_ONE_MORE_PAGE="cs.show_one_more_page.local";var currentRenderMode,glpause;checkRenderMode=function(){0==currentRenderMode&&(BK.Script.renderMode=1,currentRenderMode=1)}(function(t,e){t.QQ=function(){return new function(){this.gameCfg=clone_(GameStatusInfo),this.gameCfg.gameId=parseInt(this.gameCfg.gameId),this.gameCfg.gameMode=0,GameStatusInfo.gameMode=0,this.hasJoinRoomSucc=!1,this.arkData={modeWording:""},this.setArkData=function(t){this.arkData.modeWording=t},this.gameCfg.roomId&&(this.gameCfg.roomId=parseInt(this.gameCfg.roomId)),1==this.gameCfg.isMaster?this.gameCfg.isCreator=!0:this.gameCfg.isCreator=!1,this.delegate={},this.ssoJoinRoomCallback,this.ssoJoinRoomCallbackPublic,BK.MQQ.SsoRequest.addListener(CMD_CMSHOW_GAME_ENTER_BACKGROUND,this,function(){BK.Director.tickerPause()}.bind(this)),BK.MQQ.SsoRequest.addListener(CMD_CMSHOW_GAME_ENTER_FORGROUND,this,function(){BK.Director.tickerResume()}.bind(this)),BK.MQQ.SsoRequest.addListener(CMD_CMSHOW_GAME_MINIMIZE,this,function(){renderTicker.paused=!0,glpause=!0}.bind(this)),BK.MQQ.SsoRequest.addListener(CMD_CMSHOW_GAME_MAXIMIZE,this,function(){renderTicker.paused=!1,glpause=!1}.bind(this)),this.queryCloudSignature=function(t){if(BK.Misc.compQQVersion(GameStatusInfo.QQVer,"7.6.3")){if(t){var e=JSON.parse(GameStatusInfo.extInfo),i=e.certInfo.credentials,r=i.tmpSecretId,n=i.sessionToken,o=e.certInfo.upLoadPrefUrl,a=e.certInfo.downLoadPrefUrl,s=((c=new Date).getFullYear(),c.getMonth()+1<10?c.getMonth():c.getMonth(),c.getDate(),(l=c.getTime()/1e3-1)+";"+(l+600)),h=BK.Crypt.hex_hmac_sha1(i.tmpSecretKey,s);t(0,u={tmpSecretId:r,upLoadPrefUrl:o,downloadUrl:a,sessionToken:n,signature:h,signTime:s})}}else{var c=new Date,l=parseInt(c.getTime()/1e3)-1,u={cmd:CMSHOW_CS_CMD_QUERY_CLOUD_SIGNATURE,now:l,delta:600};t&&(BK.MQQ.SsoRequest.removeListener(CMSHOW_CS_CMD_QUERY_CLOUD_SIGNATURE,this),BK.MQQ.SsoRequest.addListener(CMSHOW_CS_CMD_QUERY_CLOUD_SIGNATURE,this,function(e,i,r){t(e,r)}),BK.MQQ.SsoRequest.send(u,CMSHOW_CS_CMD_QUERY_CLOUD_SIGNATURE))}},this.qGetRankBoard=function(t,e,i,r){var n={gameOrientation:t,openId:GameStatusInfo.openId,transparent:1,businessType:2,url:"http://cmshow.qq.com/apollo/html/game-platform/general-chart.html?gameId="+GameStatusInfo.gameId+"&_wwv=2&gameOrientation="+t};BK.MQQ.SsoRequest.send(n,"cs.openWebViewWithoutUrl.local")},this.qPayPurchase=function(t,e,i,r){var n=1;n=1==e?1:0;var o={gameOrientation:t,openId:GameStatusInfo.openId,transparent:n,businessType:1,itemList:i};if(r){var a="sc.apolloGameWebMessage.local";BK.MQQ.SsoRequest.removeListener(a,this),BK.MQQ.SsoRequest.addListener(a,this,function(t,e,i){0==t&&i.op&&"apolloGamePlatform.buyProps"==i.op&&r(i.data.code,i.data)}.bind(this))}BK.MQQ.SsoRequest.send(o,"cs.openWebViewWithoutUrl.local")},this.consumeItems=function(t,e){var i="apollo_game_item.consume_game_items",r={cmd:i,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId,items:t};e&&(BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,function(t,i,r){var n=[],o=[];0==t&&(n=r.data.succList,o=r.data.failList),e(t,n,o)}.bind(this))),BK.MQQ.SsoRequest.send(r,i)},this.rollbackGameItems=function(t,e){var i="apollo_game_item.rollback_game_items",r={cmd:i,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId,items:t};e&&(BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,function(t,i,r){var n=[],o=[];0==t&&(n=r.data.succList,o=r.data.failList),e(t,n,o)}.bind(this))),BK.MQQ.SsoRequest.send(r,i)},this.shareToMQQ=function(t,e,i,r){var n="cs.share_game_result.local",o={cmd:n,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId,gameVersion:GameStatusInfo.gameVersion,roomId:GameStatusInfo.roomId,title:t,summary:e,detailUrl:i,picUrl:r};BK.MQQ.SsoRequest.send(o,n)},this.scoreUpload=function(t,e,i){BK.Script.log(1,1,"成绩上报 scoreData:"+JSON.stringify(t));var r="apollo_aio_game.report_user_score_3rd",n={cmd:r,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId,version:GameStatusInfo.gameVersion,roomId:GameStatusInfo.roomId,gData:t,src:GameStatusInfo.src};i&&(n.arkData=i),e&&(BK.MQQ.SsoRequest.removeListener(r,this),BK.MQQ.SsoRequest.addListener(r,this,e)),BK.MQQ.SsoRequest.send(n,r)},this.getRoomUserScoreInfo=function(t,e){var i="apollo_aio_game.get_room_info_3rd",r={cmd:i,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,version:GameStatusInfo.gameVersion,roomId:t};e&&(BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,e)),BK.MQQ.SsoRequest.send(r,i)},this.getUserGameinfo=function(t,e,i){var r="apollo_aio_game.get_user_gameinfo_3rd",n={cmd:r,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId,version:GameStatusInfo.gameVersion,roomId:GameStatusInfo.roomId,toOpenId:t,cycleNum:e};i&&(BK.MQQ.SsoRequest.removeListener(r,this),BK.MQQ.SsoRequest.addListener(r,this,i)),BK.MQQ.SsoRequest.send(n,r)},this.getUserCurrencyInfo=function(t,e){var i="apollo_aio_game.get_user_curreInfo",r={cmd:i,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId,version:GameStatusInfo.gameVersion,mask:t};e&&(BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,e)),BK.MQQ.SsoRequest.send(r,i)},this.getCmshowDressInfo=function(t,e){var i="cs.get_dress_path.local";e&&(BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,e));var r={openId:t};BK.MQQ.SsoRequest.send(r,"cs.get_dress_path.local")},this.getGameItemList=function(t){var e="apollo_aio_game.get_game_itemList",i={cmd:e,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId};t&&(BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,t)),BK.MQQ.SsoRequest.send(i,e)},this.getUserGameItems=function(t){var e="apollo_aio_game.get_user_game_items",i={cmd:e,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId};t&&(BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,t)),BK.MQQ.SsoRequest.send(i,e)},this.buyGameItems=function(t,e,i){var r="apollo_aio_game.buy_game_items",n={cmd:r,from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,curreType:t,itemIdList:e};i&&(BK.MQQ.SsoRequest.removeListener(r,this),BK.MQQ.SsoRequest.addListener(r,this,i)),BK.MQQ.SsoRequest.send(n,r)},this.notifyNewRoom=function(t,e){var i={gameId:this.gameCfg.gameId,roomId:t,retcode:e};this.gameCfg.roomId||(this.gameCfg.roomId=t),BK.Script.log(0,0,"BK.QQ.notifyNewRoom!gameId = "+i.gameId+", roomId = "+i.roomId+", retCode = "+e),BK.MQQ.SsoRequest.send(i,CMSHOW_CS_CMD_CREATE_ROOM)},this.notifyHideGame=function(){var t={gameId:this.gameCfg.gameId,roomId:this.gameCfg.roomId};BK.Script.log(0,0,"BK.QQ.notifyHideGame!gameId = "+t.gameId+", roomId = "+t.roomId),1==("android"==GameStatusInfo.platform?1:2)&&(BK.Script.renderMode=0,currentRenderMode=0),BK.MQQ.SsoRequest.send(t,CMSHOW_CS_CMD_MINI_WND)},this.notifyCloseGame=function(){this._closeRoom();var t={gameId:this.gameCfg.gameId,roomId:this.gameCfg.roomId};BK.Script.log(0,0,"BK.QQ.notifyCloseGame!gameId = "+t.gameId+", roomId = "+t.roomId),BK.MQQ.SsoRequest.send(t,CMSHOW_CS_CMD_CLOSE_WND)},this.notifyReadyGame=function(){var t={gameId:this.gameCfg.gameId,roomId:this.gameCfg.roomId};BK.MQQ.SsoRequest.send(t,CMSHOW_CS_CMD_GAME_READY)},this.notifyGameTips=function(t){var e={gameId:this.gameCfg.gameId,roomId:this.gameCfg.roomId,tips:t};BK.MQQ.SsoRequest.send(e,CMSHOW_CS_CMD_GAME_TIPS)},this.notifyGameTipsWaiting=function(){this.notifyGameTips("等待玩家加入")},this.notifyGameTipsSomeOneJoinRoom=function(t){this.notifyGameTips(t+"加入房间")},this.notifyGameTipsSomeOneLeaveRoom=function(t){this.notifyGameTips(t+"离开房间")},this.notifyGameTipsReady=function(){this.notifyGameTips("游戏即将开始")},this.notifyGameTipsPlaying=function(){this.notifyGameTips("游戏进行中")},this.notifyGameTipsGameOver=function(){this.notifyGameTips("游戏已结束")},this.inviteFriend=function(t,e){var i="cs.invite_friends.local",r={cmd:i,wording:t,gameId:this.gameCfg.gameId,gameMode:8,extendInfo:{}};e&&(r.roomId=e),BK.MQQ.SsoRequest.send(r,i)},this.uploadData=function(t,e,i,r,n,o){var a="cs.report_data_2_compass.local",s=this.gameCfg.gameId;"ios"==this.gameCfg.platform&&(t=t.toString(),i=i.toString());var h={cmd:a,actionName:t,enter:e,entry:e,result:i,r2:s.toString(),r3:r,r4:n,r5:o};BK.MQQ.SsoRequest.send(h,a)},this.sharePic=function(t){var e={gameId:this.gameCfg.gameId,roomId:this.gameCfg.roomId,path:t};BK.MQQ.SsoRequest.send(e,CMSHOW_CS_CMD_SHARE_PIC)};var t={},e={};this.loadPackage=function(i,r,n){if(!GameStatusInfo||"xcode"===GameStatusInfo.devPlatform)return BK.Script.log(1,1,"bk.qq.loadpackage xcode demo ."),r(i,0);var o=GameStatusInfo.QQVer.split(".");if(Number(o[0])<7||7==Number(o[0])&&Number(o[1])<7||7==Number(o[0])&&7==Number(o[1])&&Number(o[2])<5)return BK.Script.log(1,1,"bk.qq.loadpackage old version before 775 ."),r(i,0);var a={xyId:GameStatusInfo.gameId,packName:i};r&&(t[i]=r),n&&(e[i]=n),BK.MQQ.SsoRequest.send(a,CMSHOW_CS_CMD_LOAD_PACKAGE)},this.onLoadPackageFinish=function(e,i,r){BK.Script.log(0,0,"BK.QQ.onLoadPackageFinish errCode = "+e+" cmd = "+i+" data = "+JSON.stringify(r)),r.packName&&t[r.packName]&&(t[r.packName](r.packName,r.result),t[r.packName]=void 0)},BK.MQQ.SsoRequest.addListener(CMSHOW_CS_CMD_LOAD_PACKAGE,this,this.onLoadPackageFinish.bind(this)),this.onLoadPackagePercentage=function(t,i,r){BK.Script.log(0,0,"BK.QQ.onLoadPackagePercentage errCode = "+t+" cmd = "+i+" data = "+JSON.stringify(r)),r.packName&&e[r.packName]&&(e[r.packName](r.packName,r.percentage),e[r.packName]=void 0)},BK.MQQ.SsoRequest.addListener(CMSHOW_CS_CMD_LOAD_PERCENTAGE_NOTIFY,this,this.onLoadPackagePercentage.bind(this)),this.checkPakcage=function(t,e){var i={xyId:GameStatusInfo.gameId,packName:t};this.checkpakcageCallback=e,BK.MQQ.SsoRequest.removeListener(CMSHOW_CS_CMD_FILE_CORRECTNESS_CHECK,this),BK.MQQ.SsoRequest.addListener(CMSHOW_CS_CMD_FILE_CORRECTNESS_CHECK,this,this._evnet4Checkpackage.bind(this)),BK.MQQ.SsoRequest.send(i,CMSHOW_CS_CMD_FILE_CORRECTNESS_CHECK)},this.checkpakcageCallback=void 0,this._evnet4Checkpackage=function(t,e,i){BK.Script.log(0,0,"BK.QQ._evnet4Checkpackage!errCode = "+t+", cmd = "+e+", data = "+JSON.stringify(i)),this.checkpakcageCallback&&this.checkpakcageCallback(i.packName,i.result),this.checkpakcageCallback=void 0,BK.MQQ.SsoRequest.removeListener(CMSHOW_CS_CMD_FILE_CORRECTNESS_CHECK,this)},this.addSSOJoinRoomCallBack=function(t){this.ssoJoinRoomCallbackPublic=t},this.checkPubAccountState=function(t,e){e&&(BK.MQQ.SsoRequest.removeListener(CMSHOW_CS_CMD_CHECK_PUBACCOUNT_STATE,this),BK.MQQ.SsoRequest.addListener(CMSHOW_CS_CMD_CHECK_PUBACCOUNT_STATE,this,e));var i=CMSHOW_CS_CMD_CHECK_PUBACCOUNT_STATE,r={cmd:i,puin:t};BK.MQQ.SsoRequest.send(r,i)},this.enterPubAccountCard=function(t){var e=CMSHOW_CS_CMD_ENTER_PUBACCOUNT_CARD,i={cmd:e,puin:t};BK.MQQ.SsoRequest.send(i,e)},this.fetchOpenKey=function(t){var e="cs.on_get_open_key.local",i={gameId:GameStatusInfo.gameId};t&&(BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,t)),BK.MQQ.SsoRequest.send(i,e)},this.listenGameEventEnterBackground=function(t,e){var i="sc.game_enter_background.local";e&&(BK.MQQ.SsoRequest.removeListener(i,t),BK.MQQ.SsoRequest.addListener(i,t,e))},this.listenGameEventEnterForeground=function(t,e){var i="sc.game_enter_foreground.local";e&&(BK.MQQ.SsoRequest.removeListener(i,t),BK.MQQ.SsoRequest.addListener(i,t,e))},this.listenGameEventMaximize=function(t,e){var i="sc.game_maximize.local";e&&(BK.MQQ.SsoRequest.removeListener(i,t),BK.MQQ.SsoRequest.addListener(i,t,e))},this.listenGameEventMinimize=function(t,e){var i="sc.game_minimize.local";e&&(BK.MQQ.SsoRequest.removeListener(i,t),BK.MQQ.SsoRequest.addListener(i,t,e))},this._event4GetVIPInfo=function(t,e,i){BK.Script.log(0,0,"BK.QQ._event4GetVIPInfo!errCode = "+t+" cmd = "+e+" data = "+JSON.stringify(i)),this.delegate.onGetVIPInfoEvent&&this.delegate.onGetVIPInfoEvent(t,e,i),BK.MQQ.SsoRequest.removeListener(CMSHOW_CS_CMD_GET_SRV_IP_PORT,this)},this.notifyGetVIPInfo=function(){BK.MQQ.SsoRequest.send({},CMSHOW_CS_CMD_GET_SRV_IP_PORT),BK.MQQ.SsoRequest.removeListener(CMSHOW_CS_CMD_GET_SRV_IP_PORT,this),BK.MQQ.SsoRequest.addListener(CMSHOW_CS_CMD_GET_SRV_IP_PORT,this,this._event4GetVIPInfo.bind(this))},this.notifySaveRecommVIP=function(t,e){BK.Script.log(0,0,"BK.QQ.notifySaveRecommVIP!ip = "+t+", port = "+e);var i={gameId:this.gameCfg.gameId,roomId:this.game.roomId,ip:t,port:e};BK.MQQ.SsoRequest.send(i,CMSHOW_CS_CMD_SAVE_RECOMM_VIP)},this._event4GetPlayerDress=function(t,e,i){BK.Script.log(0,0,"BK.QQ._event4GetPlayerDress!errCode = "+t+", cmd = "+e+", data = "+JSON.stringify(i)),this.delegate.onGetPlayerDressEvent&&this.delegate.onGetPlayerDressEvent(t,e,i),BK.MQQ.SsoRequest.removeListener(CMSHOW_CS_CMD_GET_PLAYER_DRESS,this)},this.notifyGetPlayerDress=function(t){var e={openId:t};BK.MQQ.SsoRequest.removeListener(CMSHOW_CS_CMD_GET_PLAYER_DRESS,this),BK.MQQ.SsoRequest.addListener(CMSHOW_CS_CMD_GET_PLAYER_DRESS,this,this._event4GetPlayerDress.bind(this)),BK.MQQ.SsoRequest.send(e,CMSHOW_CS_CMD_GET_PLAYER_DRESS)},this._startGameLocal=function(t,e){var i={gameId:this.gameCfg.gameId,roomId:this.gameCfg.roomId,resp:e,retcode:t,gameMode:this.gameCfg.gameMode};BK.MQQ.SsoRequest.send(i,CMSHOW_CS_CMD_GAME_START)},this.notifyJoinRoom=function(t,e,i){t&&t.length>0?t.forEach(function(t){var r=t.openId==currentPlayerOpenId;BK.Script.log(1,1,"player.openid="+t.openId+" currentPlayerOpenId="+currentPlayerOpenId);var n=0;e&&e.data&&e.data.avRoomId&&(n=e.data.avRoomId);var o=0;e&&e.data&&e.data.sdkAppId&&(o=e.data.sdkAppId);var a=0;e&&e.data&&e.data.accountType&&(a=e.data.accountType);var s={gameId:this.gameCfg.gameId,openId:t.openId,isCreator:this.gameCfg.isCreator&&t.openId==currentPlayerOpenId?1:0,roomId:this.gameCfg.roomId,resp:e,retcode:i,gameMode:this.gameCfg.gameMode,avRoomId:n,sdkAppId:o,accountType:a,isMine:r,isDisableSendMsg:1};BK.Script.log(0,0,"BK.QQ.notifyJoinroom isDisableSendMsg: "+s.isDisableSendMsg),BK.MQQ.SsoRequest.send(s,CMSHOW_CS_CMD_JOIN_ROOM)},this):BK.Script.log(0,0,"BK.QQ.notifyJoinRoom!newJoinPlayers data error")},this.sendGameMsg=function(){if(this.gameCfg.roomId&&this.gameCfg.roomId>0){var t={gameId:this.gameCfg.gameId,openId:GameStatusInfo.openId,roomId:this.gameCfg.roomId,gameMode:this.gameCfg.gameMode};BK.Script.log(0,0,"SendGameMsg : gameId="+t.gameId+" openId="+t.openId+" roomId="+t.roomId+" gameMode="+t.gameMode),BK.MQQ.SsoRequest.send(t,CMSHOW_CS_CMD_SEND_GAME_MSG)}},this.shareToArk=function(t,e,i,r,n,o){if(BK.Misc.compQQVersion(GameStatusInfo.QQVer,"7.6.3"))this._oldShareToArk(t,e,i,r,n,o);else{var a={summary:e,extendInfo:n,localPicPath:"",picUrl:"",activityId:0,reqCode:1};0==i.indexOf("GameRes://")||0==i.indexOf("GameSandBox://")?a.localPicPath=i:a.picUrl=i,this._share(a,o)}},this._share=function(t,e){if(t.inner=1,t.localPicPath){if(e){var i="sc.share_game_to_friend_result.local";BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,function(t,i,r){e(t,i,r),this.shareUpload(0==t?0:1),BK.MQQ.SsoRequest.removeListener(i,this)}.bind(this))}BK.Script.log(0,0,"share "+JSON.stringify(t)),BK.MQQ.SsoRequest.send(t,"cs.game_shell_share_callback.local")}else{var r="轻游戏";t.gameName&&(r=t.gameName);var n="一起来玩游戏吧~";t.summary&&(n=t.summary),BK.QQ.defaultSharePic(r,n,function(i,r,n){if(e){var o="sc.share_game_to_friend_result.local";BK.MQQ.SsoRequest.removeListener(o,this),BK.MQQ.SsoRequest.addListener(o,this,function(t,i,r){e(t,i,r),this.shareUpload(0==t?0:1),BK.MQQ.SsoRequest.removeListener(i,this)}.bind(this))}0==i&&(t.localPicPath=n),BK.Script.log(0,0,"share with default pic"+JSON.stringify(t)),BK.MQQ.SsoRequest.send(t,"cs.game_shell_share_callback.local")}.bind(this))}},this.share=function(t,e){this._share(t,function(t,i,r){if(0==t){var n=r.ret,o=r.shareTo,a=1==r.isFirstShare;e(n,o,a)}else e(t,-1,!1)}.bind(this))},this.shareUpload=function(t){var e=t.toString();BK.QQ.uploadData("clickShowOffButton","",e,"","","")},this._oldShareToArk=function(t,e,i,r,n,o){"boolean"==typeof r&&(r=1==r?1:0);var a={summary:e,picUrl:i,gameId:this.gameCfg.gameId,roomId:t,gameMode:this.gameCfg.gameMode,isSelectFriend:r,extendInfo:n};if(o){var s="sc.share_game_to_friend_result.local";BK.MQQ.SsoRequest.removeListener(s,this),BK.MQQ.SsoRequest.addListener(s,this,function(t,e,i){o(t,e,i),this.shareUpload(0==t?0:1),BK.MQQ.SsoRequest.removeListener(e,this)}.bind(this))}BK.Script.log(0,0,"ShareToArk summary="+a.summary+" roomId="+a.roomId+" gameMode="+a.gameMode+"picUrl="+a.picUrl+" gameId="+a.gameId),BK.MQQ.SsoRequest.send(a,CMSHOW_CS_CMD_SHARE_IN_ARK)},this.sendB2CRedPacket=function(t,e){if(e){var i="sc.send_b2c_redpacket_result.local";BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,function(t,i,r){e(t,i,r),BK.MQQ.SsoRequest.removeListener(i,this)}.bind(this))}var r={groupPushData:{gameRedPacketId:1,gameId:GameStatusInfo.gameId,extraInfo:t}};BK.Script.log(1,1,"sendB2CRedPacket:"+JSON.stringify(r)),BK.MQQ.SsoRequest.send(r,"cs.send_b2c_redpacket.local"),BK.Script.log(0,0,"sendB2CRedPacket")},this.createShortCut=function(t,e){var i="";t&&(i=t);var r={extendInfo:i};if(e){var n="cs.create_xy_shortcut.local";BK.MQQ.SsoRequest.removeListener(n,this),BK.MQQ.SsoRequest.addListener(n,this,function(t,i,r){e(t,i,r),BK.MQQ.SsoRequest.removeListener(i,this)}.bind(this))}BK.MQQ.SsoRequest.send(r,"cs.create_xy_shortcut.local"),BK.Script.log(0,0,"createShortCut")},this.defaultSharePic=function(t,e,i){t||(t="轻游戏"),e||(e="一起来玩吧!");var r=1;if(BK.FileUtil.isFileExist("GameRes://inviteIcon.png")){var n=BK.Image.loadImage("GameRes://inviteIcon.png");if(n){var o=n.height,a=n.width;r=Math.abs(o/a-304/540)<.01?3:2}else BK.Script.log(1,1,"defaultSharePic loadImage inviteIcon failed.")}else r=1;1==r?i(-1,r,null):3==r?this.generateQRCodeAnd169(t,e,function(t,e){i(t,r,e)}.bind(this),"GameSandBox://shareDefault.png"):i(-1,r,null)},this.generateQRCodeAnd169=function(t,e,i,r){i(0,this.composeShare(t,e,"GameRes://inviteIcon.png","GameRes://share_logo.png",r))},this.composeShare=function(t,e,i,r,n){var o="GameSandBox://compose.png";n&&(o=n);var a=BK.Image.loadImage(i),s=new BK.Canvas(750,750);if(s.fillColor={r:1,g:1,b:1,a:1},s.fillRect(0,0,750,750),BK.FileUtil.isFileExist(r)){s.drawImage(r,0,0,125,28,32,32,126,27)}a&&s.drawImage(i,0,0,a.width,a.height,0,330,750,420);s.fillColor={r:0,g:0,b:0,a:1},s.drawStyle=0,s.setTextAlign(1),s.setTextSize(40),s.textBaseLine="bottom",s.textAlign="left",s.fillText(t,35,258);s.fillColor={r:137/255,g:137/255,b:137/255,a:.5},s.drawStyle=0,s.setTextAlign(1),s.setTextSize(30),s.textBaseLine="bottom",s.textAlign="left",s.fillText(e,35,215);s.fillColor={r:1,g:1,b:1,a:1};var h=this.generatePureQRCode();s.drawImage(h,0,0,256,256,600,64,120,120);return s.fillColor={r:0,g:0,b:0,a:1},s.drawStyle=0,s.setTextAlign(1),s.setTextSize(19),s.textBaseLine="bottom",s.textAlign="left",s.fillText("长按扫码即玩",600,28),s.saveTo(o),s.dispose(),o},this.generatePureQRCode=function(t){var e="GameSandBox://qrcode.png";t&&(e=t);var i={width:256,height:256,colorDark:{r:0,g:0,b:0,a:1},colorLight:{r:1,g:1,b:1,a:1},correctLevel:2},r="http://cmshow.qq.com/apollo/html/game-platform/scan-game.html?gameId="+GameStatusInfo.gameId.toString()+"&src=203";return BK.QRCode.createQRCodeToFile(e,r,i),e},this._event4QuitGame=function(t,e,i){BK.Script.log(0,0,"BK.QQ._event4QuitGame errCode = "+t+" cmd = "+e+" data = "+JSON.stringify(i)),this.delegate.onQuitGameEvent&&this.delegate.onQuitGameEvent(t,e,i),BK.MQQ.SsoRequest.removeListener(CMSHOW_SRV_CMD_QUIT_GAME,this)},this._event4CancelGame=function(t,e,i){BK.Script.log(0,0,"BK.QQ._event4CancelGame errCode = "+t+" cmd = "+e+" data = "+JSON.stringify(i)),this.delegate.onCancelGameEvent&&this.delegate.onCancelGameEvent(t,e,i),BK.MQQ.SsoRequest.removeListener(CMSHOW_SRV_CMD_CANCEL_GAME,this)},this.notifyQuitGameSrv=function(){var t={cmd:CMSHOW_SRV_CMD_QUIT_GAME,from:this.gameCfg.platform,gameId:this.gameCfg.gameId,roomId:this.gameCfg.roomId};BK.Script.log(0,0,"BK.QQ.notifyQuitGameSrv!, cmd = "+t.cmd+", from = "+t.from+", gameId = "+t.gameId+", roomId = "+t.roomId),BK.MQQ.SsoRequest.removeListener(CMSHOW_SRV_CMD_QUIT_GAME,this),BK.MQQ.SsoRequest.addListener(CMSHOW_SRV_CMD_QUIT_GAME,this,this._event4QuitGame.bind(this)),BK.MQQ.SsoRequest.send(t,CMSHOW_SRV_CMD_QUIT_GAME)},this.notifyCancelGameSrv=function(){var t={cmd:CMSHOW_SRV_CMD_CANCEL_GAME,from:this.gameCfg.platform,gameId:this.gameCfg.gameId,roomId:this.gameCfg.roomId};BK.Script.log(0,0,"BK.QQ.notifyCancelGameSrv!, cmd = "+t.cmd+", from = "+t.from+", gameId = "+t.gameId+", roomId = "+t.roomId),BK.MQQ.SsoRequest.removeListener(CMSHOW_SRV_CMD_CANCEL_GAME,this),BK.MQQ.SsoRequest.addListener(CMSHOW_SRV_CMD_CANCEL_GAME,this,this._event4CancelGame.bind(this)),BK.MQQ.SsoRequest.send(t,CMSHOW_SRV_CMD_CANCEL_GAME)},this._event4StartGame=function(t,e,i){BK.Script.log(0,0,"BK.QQ._event4StartGame! errCode = "+t+" cmd = "+e+" data = "+JSON.stringify(i)),this.hasStartGameSucc=0==t,this._startGameLocal(t,i),this.delegate.onStartGameEvent&&this.delegate.onStartGameEvent(t,e,i),BK.MQQ.SsoRequest.removeListener(CMSHOW_SRV_CMD_START_GAME,this)},this.notifyStartGameSrv=function(){var t={cmd:CMSHOW_SRV_CMD_START_GAME,from:this.gameCfg.platform,gameId:this.gameCfg.gameId,roomId:this.gameCfg.roomId};BK.Script.log(0,0,"BK.QQ.notifyStartGameSrv!, cmd = "+t.cmd+", from = "+t.from+", gameId = "+t.gameId+", roomId = "+t.roomId),BK.MQQ.SsoRequest.removeListener(CMSHOW_SRV_CMD_START_GAME,this),BK.MQQ.SsoRequest.addListener(CMSHOW_SRV_CMD_START_GAME,this,this._event4StartGame.bind(this)),BK.MQQ.SsoRequest.send(t,CMSHOW_SRV_CMD_START_GAME)},this._event4JoinRoom=function(t,e,i){BK.Script.log(0,0,"BK.QQ._event4JoinRoom errCode = "+t+" cmd = "+e+" data = "+JSON.stringify(i)),this.hasJoinRoomSucc=0==t,this.delegate.onJoinRoomEvent&&this.delegate.onJoinRoomEvent(t,e,i),BK.QQ.notifyJoinRoom(this.newJoinPlayers,i,t),BK.MQQ.SsoRequest.removeListener(CMSHOW_SRV_CMD_JOIN_ROOM,this),this.ssoJoinRoomCallback&&this.ssoJoinRoomCallback(t,e,i),this.ssoJoinRoomCallbackPublic&&(i.gameId=this.gameCfg.gameId,i.gameRoomId=this.gameCfg.roomId,i.avRoomId=i.data.avRoomId?i.data.avRoomId:0,i.sdkAppId=i.data.sdkAppId?i.data.sdkAppId:0,i.accountType=i.data.accountType?i.data.accountType:0,this.ssoJoinRoomCallbackPublic(t,e,i))},this.notifyNewOrJoinRoomSrv=function(t,e,i,r){var n={cmd:CMSHOW_SRV_CMD_JOIN_ROOM,from:this.gameCfg.platform,aioType:this.gameCfg.aioType,gameId:this.gameCfg.gameId,version:this.gameCfg.gameVersion,roomId:e,opType:i,gameMode:this.gameCfg.gameMode,roomVol:this.roomVol,arkData:this.arkData,src:r};BK.Script.log(1,1,"BK.QQ.notifyNewOrJoinRoomSrv!, cmd = "+n.cmd+", from = "+n.from+", aioType = "+n.aioType+", gameId = "+n.gameId+", version = "+n.version+", roomId = "+n.roomId+", opType = "+n.opType),this.newJoinPlayers=t,BK.MQQ.SsoRequest.removeListener(CMSHOW_SRV_CMD_JOIN_ROOM,this),BK.MQQ.SsoRequest.addListener(CMSHOW_SRV_CMD_JOIN_ROOM,this,this._event4JoinRoom.bind(this)),BK.MQQ.SsoRequest.send(n,CMSHOW_SRV_CMD_JOIN_ROOM)},this._customGameLogicCallBack=void 0,this._event4CustomLogic=function(t,e,i){void 0!=this._customGameLogicCallBack&&this._customGameLogicCallBack(t,e,i),BK.MQQ.SsoRequest.removeListener(CMSHOW_SRV_CMD_CUSTOM_GAME_LOGIC,this)},this.reqCustomLogic=function(t,e){void 0!=t?(this._customGameLogicCallBack=e,BK.MQQ.SsoRequest.removeListener(CMSHOW_SRV_CMD_CUSTOM_GAME_LOGIC,this),BK.MQQ.SsoRequest.addListener(CMSHOW_SRV_CMD_CUSTOM_GAME_LOGIC,this,this._event4CustomLogic.bind(this)),BK.MQQ.SsoRequest.send(t,CMSHOW_SRV_CMD_CUSTOM_GAME_LOGIC)):BK.Script.log(0,0,"reqCustomLogic data undefined!")},this._getRankListLogicCallBack=void 0,this._event4GetRankList=function(t,e,i){BK.Script.log(1,1,"BK.QQ.reqGetRankList! callback cmd"+e+" errCode:"+t+" data:"+JSON.stringify(i)),void 0!=this._getRankListLogicCallBack&&this._getRankListLogicCallBack(t,e,i),BK.MQQ.SsoRequest.removeListener(CMSHOW_SRV_GET_RANK_LIST,this)},this.getRankList=function(t,e){var i={cmd:CMSHOW_SRV_GET_RANK_LIST,from:"default",objType:1,objId:0,busType:3,busId:this.gameCfg.gameId.toString()};e&&(e.objType&&(i.objType=e.objType),e.objId&&(i.objId=e.objId),e.from&&(i.from=e.from)),BK.Script.log(1,1,"BK.QQ.reqGetRankList! "+JSON.stringify(i)),void 0!=i?(this._getRankListLogicCallBack=t,BK.MQQ.SsoRequest.removeListener(CMSHOW_SRV_GET_RANK_LIST,this),BK.MQQ.SsoRequest.addListener(CMSHOW_SRV_GET_RANK_LIST,this,this._event4GetRankList.bind(this)),BK.MQQ.SsoRequest.send(i,CMSHOW_SRV_GET_RANK_LIST)):BK.Script.log(0,0,"reqGetRankList data undefined!")},this._pushPublicMsgCallBack=void 0,this._event4PushPublicMsg=function(t,e,i){BK.Script.log(1,1,"BK.QQ.pushPublicMsg! callback cmd"+e+" errCode:"+t+" data:"+JSON.stringify(i)),void 0!=this._pushPublicMsgCallBack&&this._pushPublicMsgCallBack(t,e,i)},this.pushPublicMsg=function(t,e){var i={gameid:this.gameCfg.gameId,templateid:e.templateid,report_ts:e.report_ts,tmpl_param:e.tmpl_param};BK.Script.log(1,1,"BK.QQ.pushPublicMsg! "+JSON.stringify(i)),void 0!=i?(this._pushPublicMsgCallBack=t,BK.MQQ.SsoRequest.removeListener(CMSHOW_SRV_PUSH_PUBLIC_MSG,this),BK.MQQ.SsoRequest.addListener(CMSHOW_SRV_PUSH_PUBLIC_MSG,this,this._event4PushPublicMsg.bind(this)),BK.MQQ.SsoRequest.send(i,CMSHOW_SRV_PUSH_PUBLIC_MSG)):BK.Script.log(0,0,"pushPublicMsg data undefined!")},this.hasJoinRoom=function(){return this.hasJoinRoomSucc},this.hasStartGame=function(){return this.hasStartGameSucc},this._event4StopGame=function(t,e,i){BK.Script.log(0,0,"BK.QQ._event4StopGame!errCode = "+t+" cmd = "+e+" data = "+JSON.stringify(i)),this._closeRoom(),this.delegate.onStopGameEvent&&this.delegate.onStopGameEvent(t,e,i)},this._closeRoom=function(t){BK.QQ.isNeedSSOServer=void 0==t||null==t||t,1==Boolean(BK.QQ.isNeedSSOServer)&&(this.hasStartGameSucc||this.gameCfg.roomId&&0!=this.gameCfg.roomId&&(this.gameCfg.isCreator?this.notifyCancelGameSrv():this.notifyQuitGameSrv()))},this.uploadScoreWithoutRoom=function(t,e,i){var r="apollo_report_result.single_user_result",n=Math.floor((new Date).getTime()/1e3),o={from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId,version:GameStatusInfo.gameVersion,aioType:GameStatusInfo.aioType,ts:n.toString(),src:GameStatusInfo.src,mode:void 0!==t?t:1,userData:e.userData,attr:e.attr};i&&(BK.MQQ.SsoRequest.removeListener(r,this),BK.MQQ.SsoRequest.addListener(r,this,i)),BK.MQQ.SsoRequest.send(o,r)},this.getRankListWithoutRoom=function(t,e,i,r){var n="apollo_router_game.apollo_user_rankinglist_linkcmd_custom_ranking",o=Math.floor((new Date).getTime()/1e3),a={from:GameStatusInfo.platform,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId,version:GameStatusInfo.gameVersion,ts:o.toString(),attr:void 0!==t?t:"score",order:void 0!==e?e:1,rankType:void 0!==i?i:0};r&&(BK.MQQ.SsoRequest.removeListener(n,this),BK.MQQ.SsoRequest.addListener(n,this,r)),BK.MQQ.SsoRequest.send(a,n)},this.saveGameData=function(t,e){var i="apollo_private_data.set_user_data",r=Math.floor((new Date).getTime()/1e3),n={openId:GameStatusInfo.openId,gameId:GameStatusInfo.gameId,version:GameStatusInfo.gameVersion,from:GameStatusInfo.platform,ts:r.toString(),data:t};e&&(BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,e)),BK.MQQ.SsoRequest.send(n,i)},this.loadGameData=function(t){var e="apollo_private_data.get_user_data",i=Math.floor((new Date).getTime()/1e3),r={openId:GameStatusInfo.openId,gameId:GameStatusInfo.gameId,version:GameStatusInfo.gameVersion,from:GameStatusInfo.platform,ts:i.toString()};t&&(BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,t)),BK.MQQ.SsoRequest.send(r,e)},this.reportGameResult=function(t,e){var i="apollo_router_game.apollo_reportcm_linkcmd_game_result";t.gameId=GameStatusInfo.gameId,GameStatusInfo.isWhiteUser>0&&BK.Script.log(1,1,"reportGameResult :"+t),BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,function(t,i,r){this.checkNewRedPackage(),e&&e(t,i,r)}.bind(this)),BK.MQQ.SsoRequest.send(t,i)},this.updateScoreLocal=function(t){BK.MQQ.SsoRequest.send({gameId:GameStatusInfo.gameId,score:t},"cs.game_update_score.local")},this.getRedPacketResult=function(t,e){var i="cs.get_redPacket_result.local";e&&(BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,e)),BK.MQQ.SsoRequest.send({gameId:GameStatusInfo.gameId,score:t},i)},this.listenRedPacketEvent=function(t){var e="sc.web_callback_game.local";t&&(BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,t))},this.skipGame=function(t,e){var i={xyId:t,extendInfo:e,src:302};BK.MQQ.SsoRequest.send(i,"cs.create_xy.local");var r=new Date,n=r.getFullYear(),o=r.getMonth()+1,a=r.getDate(),s=r.getHours(),h=""+n+(o=(""+o).length<2?"0"+o:o)+(a=""+a<2?"0"+a:a)+(s=""+s<2?"0"+s:s);BK.QQ.uploadData("gameAtoB","302",1,t,h,"")},BK.MQQ.SsoRequest.addListener(CMSHOW_SC_CMD_STOP_GAME,this,this._event4StopGame.bind(this)),CMSHOW_SRV_CHECK_NEW_RED_PACKAGE="apollo_router_light.apollo_activity_linkcmd_query_new_redpacket",GameStatusInfo.commFlagBits||(GameStatusInfo.commFlagBits=0),BK.Script.log(1,1,"redPackage commonFlagBits : "+GameStatusInfo.commFlagBits),this.isUserInRedPackageActivity=function(){var t=GameStatusInfo.commFlagBits>>1&1;return t=t&&310!==GameStatusInfo.src,BK.Script.log(1,1,"redPackage isUserInRedPackageActivity: "+t),t},this.isOpenActivityPage=function(){var t=GameStatusInfo.commFlagBits>>2&1;return t=t&&310!==GameStatusInfo.src,BK.Script.log(1,1,"redPackage isOpenActivityPage: "+t),t},this.showRedPackageActivityPage=function(){BK.Director.ticker.setTimeout(function(){var t="http://cmshow.qq.com/act_apollo/h5_act/gameRedPacket/html/popup.html?game_id="+GameStatusInfo.gameId+"&page=ad&_cwv=1&wv=3&adtag=engine";BK.MQQ.Webview.openTransparent(t)}.bind(this),100,this)},this.checkNewRedPackage=function(){if(this.isUserInRedPackageActivity()){var t={cmd:CMSHOW_SRV_CHECK_NEW_RED_PACKAGE,gameId:GameStatusInfo.gameId.toString()};BK.Script.log(1,1,"redPackage 发送新红包检查:"+JSON.stringify(t)),BK.MQQ.SsoRequest.send(t,CMSHOW_SRV_CHECK_NEW_RED_PACKAGE)}},this.onNewRedPackage=function(t,e,i){if(BK.Script.log(0,0,"BK.QQ.onNewRedPackage redPackage errCode = "+t+" cmd = "+e+" data = "+JSON.stringify(i)),0==t)if(i.data&&i.data.redPacket&&i.data.redPacket.actId&&i.data.redPacket.taskId){var r=i.data.redPacket,n="http://cmshow.qq.com/act_apollo/h5_act/gameRedPacket/html/popup.html?game_id="+GameStatusInfo.gameId+"&page=task&task_id="+r.taskId+"&_cwv=1&wv=3&adtag=engine";BK.MQQ.Webview.openTransparent(n)}else BK.Script.log(1,1,"request new red package redPackage ,没有新红包任务触发");else BK.Script.log(1,1,"request new red package Failed! redPackage ErrCode:"+t)}}}()}(BK)),BK.Room=function(){this.roomId,this.gameId,this.mId,this.ownerId,this.createTs,this.status,this.playerNum,this.ip0,this.ip1,this.msgSeq=1,this.ackSeq,this.lastFrame=0,this.startGameTs=0,this.createRoomCallBack,this.queryRoomInfoCallBack,this.joinRoomCallBack,this.leaveRoomCallBack,this.startGameCallBack,this.broadcastDataCallBack,this.sensitiveWordCallBack,this.setUserDataCallBack,this.getUserDataCallBack,this.sendSyncOptCallBack,this.forceStopGameCallBack,this.frameSyncListener,this.queryFrameDataCallBack,this.matchGameCallBack,this.queryMatchGameCallBack,this.quitMatchGameCallBack,this.disconnectNetCallBack,this.reJoinRoomCallBack,this.socket=new BK.Socket,this.reqArray=new Array,this.newJoinPlayers=[],this.currentPlayers=[],this.isCreator=1==GameStatusInfo.isMaster,this.gameStatusInfo=GameStatusInfo,this.serverConnected,this._environment=GameStatusInfo.isWhiteUser,this.headerVersion=769,this.recommandRoomSvrHost=NormalRecommandRoomSvrHost,this.recommandRoomSvrPort=NormalRecommandRoomSvrPort,this.netTimeOutTs=0,this.options=null,this.setArkData=function(t){BK.QQ.setArkData(t)},this.setRoomVol=function(t){BK.QQ.roomVol=t},this.read32BytesToString=function(t){for(var e="",i=0;i<32;i++){var r=t.readUint8Buffer();e+=String.fromCharCode(r)}return e},this.writeOpenIdIntoBuffer=function(t,e){var i=new BK.Buffer(32);if(32==e.length)for(n=0;n<32;n++){var r=e.charCodeAt(n);i.writeUint8Buffer(r)}else{for(var n=0;n<32;n++)i.writeUint8Buffer(0);BK.Script.log(0,0,"writeOpenIdIntoBuffer.length is not 32 bytes,Write empty data")}t.writeBuffer(i)},this.addHeader=function(t,e,i){t.writeUint16Buffer(4660),t.writeUint16Buffer(this.headerVersion),t.writeUint16Buffer(0),t.writeUint16Buffer(i),t.writeUint32Buffer(e)},this.addFixedHeader=function(t,e,i,r,n,o,a,s,h){void 0==o&&(o=""),void 0==a&&(a=0),void 0==s&&(s=0),void 0==h&&(h=0),t.writeUint16Buffer(72),t.writeUint16Buffer(e),t.writeUint32Buffer(0),t.writeUint64Buffer(1111),t.writeUint64Buffer(i),t.writeUint64Buffer(r),this.writeOpenIdIntoBuffer(t,n),this.writeOpenIdIntoBuffer(t,o),t.writeUint64Buffer(a),t.writeUint64Buffer(s),t.writeUint64Buffer(h)},this.getHeader=function(t){var e=t.readUint16Buffer(),i=t.readUint16Buffer(),r=t.readUint16Buffer(),n=t.readUint16Buffer(),o=t.readUint32Buffer(),a=new Object;return a.magic=e,a.ver=i,a.stlen=n,a.bodyLen=o,a.seq=r,a},this.getFixedHeader=function(t){var e=t.readUint16Buffer(),i=t.readUint16Buffer(),r=t.readUint32Buffer(),n=t.readUint64Buffer(),o=t.readUint64Buffer(),a=t.readUint64Buffer(),s="",h="";s=this.read32BytesToString(t),h=this.read32BytesToString(t);var c=t.readUint64Buffer(),l=t.readUint64Buffer(),u=t.readUint64Buffer(),d=new Object;return d.fixLen=e,d.cmd=i,d.ret=r,d.date=n,d.gameId=o,d.roomId=a,d.fromId=s,d.toId=h,d.token=c,d.appId=l,d.accessToken=u,d},this.getRequestCommonBuffer=function(t,e,i,r,n,o,a){var s,h,c=0;if(a&&(a.rewind(),c=a.length),h=new BK.Stream(BK.Security.getST()),s=new BK.Stream(fixedHeaderLen+c+n,1),this.addFixedHeader(s,t,e,i,r),c>0)for(u=0;u<c;u++)s.writeUint8Buffer(a.readUint8Buffer());if(n>0)for(var l=new BK.Stream(o.bkJSTLVGetBuffer()),u=0;u<l.length;u++)s.writeUint8Buffer(l.readUint8Buffer());s=BK.Misc.arrayBufferToBKBuffer(s.data),BK.Security.encrypt(s),s=new BK.Stream(s);var d=new BK.Stream(HeaderLen+s.length+h.length);return this.addHeader(d,s.length,h.length),d.writeBuffer(h),d.writeBuffer(s),d.data},this.matchGame=function(t,e,i){this.mId=e,this.gameId=parseInt(t),BK.QQ.gameCfg.gameMode=6,GameStatusInfo.gameMode=6;var r=this.socket.connect(this.recommandRoomSvrHost,this.recommandRoomSvrPort);BK.Script.log(0,0,"socket con ="+r),-1==r?BK.Script.log(0,0,"socket connect failed! "+r):this.serverConnected=1,this.matchGameCallBack=i;var n=new Object;n.cmd=36,n.arg0=t,n.arg1=e,this.reqArray.push(n),BK.Script.log(0,0,"createRoom ")},this.requestMatch=function(t,e){BK.Script.log(0,0,"match game request in");var i=new BK.Buffer(fixedHeaderLen,1);this.addFixedHeader(i,36,t,0,e);var r=BK.Security.getST();BK.Security.encrypt(i);var n=r.bufferLength(),o=new BK.Buffer(HeaderLen+i.bufferLength()+n,1);return this.addHeader(o,i.bufferLength(),n),o.writeBuffer(r),o.writeBuffer(i),BK.Script.log(0,0,"match game request buffer : "+o.bufferLength()+" body len:"+i.bufferLength()),o},this.queryMatchGame=function(t,e,i){BK.Script.log(0,0,"queryMatchGame in "),this.mId=e,this.gameId=parseInt(t),this.queryMatchGameCallBack=i;var r=new Object;r.cmd=38,r.arg0=t,r.arg1=e,this.reqArray.push(r)},this.requestQueryMatch=function(t,e){BK.Script.log(0,0,"query match game request in");var i=new BK.Buffer(fixedHeaderLen,1);this.addFixedHeader(i,38,t,0,e);var r=BK.Security.getST();BK.Security.encrypt(i);var n=r.bufferLength(),o=new BK.Buffer(HeaderLen+i.bufferLength()+n,1);return this.addHeader(o,i.bufferLength(),n),o.writeBuffer(r),o.writeBuffer(i),BK.Script.log(0,0,"query match game request buffer : "+o.bufferLength()+" body len:"+i.bufferLength()),o},this.quitMatchGame=function(t,e,i){BK.Script.log(0,0,"quitMatchGame in "),this.mId=e,this.gameId=parseInt(t),this.quitMatchGameCallBack=i;var r=new Object;r.cmd=40,r.arg0=t,r.arg1=e,this.reqArray.push(r)},this.requestQuitMatch=function(t,e){BK.Script.log(0,0,"quit match game request in");var i=new BK.Buffer(fixedHeaderLen,1);this.addFixedHeader(i,40,t,0,e);var r=BK.Security.getST();BK.Security.encrypt(i);var n=r.bufferLength(),o=new BK.Buffer(HeaderLen+i.bufferLength()+n,1);return this.addHeader(o,i.bufferLength(),n),o.writeBuffer(r),o.writeBuffer(i),BK.Script.log(0,0,"quit match game request buffer : "+o.bufferLength()+" body len:"+i.bufferLength()),o},this.createRoom=function(t,e,i){if(this.mId=e,this.gameId=parseInt(t),1!=this.serverConnected){var r=this.socket.connect(this.recommandRoomSvrHost,this.recommandRoomSvrPort);BK.Script.log(0,0,"socket con ="+r),-1==r?BK.Script.log(0,0,"socket connect failed! "+r):this.serverConnected=1}this.createRoomCallBack=i;var n=new Object;n.cmd=6,n.arg0=t,n.arg1=e,this.reqArray.push(n),BK.Script.log(0,0,"createRoom ")},this.requestCreateRoom=function(t,e){var i=Number(this.roomId);i||(i=0),BK.Script.log(0,0,"create room request ");var r=new BK.Buffer(fixedHeaderLen,1);this.addFixedHeader(r,6,t,i,e);var n=BK.Security.getST();BK.Security.encrypt(r);var o=n.bufferLength(),a=new BK.Buffer(HeaderLen+r.bufferLength()+o,1);return this.addHeader(a,r.bufferLength(),o),a.writeBuffer(n),a.writeBuffer(r),BK.Script.log(0,0,"create room request buffer : "+a.bufferLength()+" body len:"+r.bufferLength()),a},this.requestQueryRoom=function(){var t=new BK.Buffer(fixedHeaderLen,1);this.addFixedHeader(t,10,this.gameId,this.roomId,this.mId);var e=BK.Security.getST();BK.Security.encrypt(t);var i=e.bufferLength(),r=new BK.Buffer(HeaderLen+t.bufferLength()+i,1);return this.addHeader(r,t.bufferLength(),i),r.writeBuffer(e),r.writeBuffer(t),r},this.queryRoom=function(t,e,i,r){this.mId=i,this.roomId=parseFloat(e),this.gameId=parseInt(t),this.queryRoomInfoCallBack=r;var n=new Object;n.cmd=10,this.reqArray.push(n),BK.Script.log(0,0,"queryRoom push")},this.joinRoom=function(t,e,i,r){this.joinRoomCallBack=e,BK.QQ.isNeedSSOServer=void 0==r||null==r||r,BK.Script.log(0,0,"BK.QQ.notifyJoinroom isDisableSendMsg isAuto: "+i+",isAutoSendJoin: "+BK.QQ.isAutoSendJoinRoomNotify);var n=new Object;n.cmd=2,n.arg0=t,this.reqArray.push(n)},this.requestJoinRoom=function(t){BK.Script.log(0,0,"join room request");var e=new BK.Buffer(fixedHeaderLen+5,1);this.addFixedHeader(e,2,this.gameId,this.roomId,this.mId);var i=new BK.TLV(5);i.bkJSTLVWriteUInt8(t,TLVType.Uint8,201),e.writeBuffer(i.bkJSTLVGetBuffer());var r=BK.Security.getST();BK.Security.encrypt(e);var n=r.bufferLength(),o=new BK.Buffer(HeaderLen+e.bufferLength()+n,1);return this.addHeader(o,e.bufferLength(),n),o.writeBuffer(r),o.writeBuffer(e),o},this.setReJoinRoomCallBack=function(t){this.reJoinRoomCallBack=t},this.reConnectAndJoinRoom=function(){var t=this.socket.connect(this.gameSvrIp,this.gameSvrPort);if(BK.Script.log(0,0,"socket con ="+t),-1==t)return BK.Script.log(0,0,"socket connect failed! "+t),-1;this.serverConnected=1,0==t&&BK.Script.log(0,0,"socket connect =0 "),t>=0&&(BK.Script.log(0,0,"rejoinroom send"),this.joinRoom(1,function(t,e){BK.Script.log(0,0,"rejoinroom statusCode:"+t+" roomid is "+e.roomId),this.reJoinRoomCallBack&&this.reJoinRoomCallBack(t,this)}))},this.leaveRoom=function(t,e){void 0==e&&(e=-1);var i=new Object;i.cmd=4,i.arg0=e,this.reqArray.push(i),this.leaveRoomCallBack=t,BK.Script.log(0,0,"leaveRoom push")},this.setLeaveRoomCallback=function(t){this.leaveRoomCallBack=t},this.requestLeaveRoom=function(t){var e=new BK.TLV(44),i=new BK.Buffer(40,1);this.writeOpenIdIntoBuffer(i,this.mId),i.writeUint64Buffer(t),e.bkJSTLVWriteBuffer(i,TLVType.Byte,201);var r=new BK.Buffer(fixedHeaderLen+e.bkJSTLVGetLength(),1);this.addFixedHeader(r,4,this.gameId,this.roomId,this.mId),r.writeBuffer(e.bkJSTLVGetBuffer());var n=BK.Security.getST(),o=n.bufferLength();return BK.Security.encrypt(r),buff=new BK.Buffer(HeaderLen+r.bufferLength()+o,1),this.addHeader(buff,r.bufferLength(),o),buff.writeBuffer(n),buff.writeBuffer(r),BK.Script.log(0,0,"leave room buffer : "+buff.bufferLength()+" body len:"+r.bufferLength()),buff},this._startGame=function(t){this.startGameCallBack=t;var e=new Object;e.cmd=8,this.reqArray.push(e),BK.Script.log(0,0,"startGame push")},this.startGame=function(t){GameStatusInfo.devPlatform?(BK.Script.log(0,0,"startGame dev:"),this._startGame(t)):1==BK.QQ.hasJoinRoomSucc?(BK.Script.log(0,0,"startGame qq:cmsrv confirm joinRoom response"),this._startGame(t)):(BK.Script.log(0,0,"startGame qq:waiting cmsvr joiroom response"),BK.QQ.delegate.onJoinRoomEvent=function(e,i,r){BK.Script.log(0,0,"startGame qq:wait finish.start Game"),this._startGame(t)}.bind(this))},this.setStartGameCallback=function(t){this.startGameCallBack=t},this.requestStartGame=function(){var t=new BK.Buffer(fixedHeaderLen,1);this.addFixedHeader(t,8,this.gameId,this.roomId,this.mId);var e=BK.Security.getST();BK.Security.encrypt(t);var i=e.bufferLength(),r=new BK.Buffer(HeaderLen+t.bufferLength()+i,1);return this.addHeader(r,t.bufferLength(),i),r.writeBuffer(e),r.writeBuffer(t),r},this.setBroadcastDataCallBack=function(t){this.broadcastDataCallBack=t},this.sendBroadcastData=function(t){var e=new Object;e.cmd=1,e.arg0=t,this.reqArray.push(e)},this.requestsendBroadcastData=function(t){var e=t.capacity?t.capacity:t.bufferLength(),i=new BK.Buffer(fixedHeaderLen+e,1);this.addFixedHeader(i,1,this.gameId,this.roomId,this.mId),i.writeBuffer(t);var r=BK.Security.getST();BK.Security.encrypt(i);var n=r.bufferLength(),o=new BK.Buffer(HeaderLen+i.bufferLength()+n,1);return this.addHeader(o,i.bufferLength(),n),o.writeBuffer(r),o.writeBuffer(i),o},this.setSensitiveWordCallBack=function(t){this.sensitiveWordCallBack=t},this.sendSensitiveWordData=function(t){var e=new Object;e.cmd=50,e.arg0=t,this.reqArray.push(e)},this.requestSendSendSensitiveWordData=function(t){var e=t.capacity?t.capacity:t.bufferLength(),i=new BK.Buffer(fixedHeaderLen+e,1);this.addFixedHeader(i,50,this.gameId,this.roomId,this.mId),i.writeBuffer(t);var r=BK.Security.getST();BK.Security.encrypt(i);var n=r.bufferLength(),o=new BK.Buffer(HeaderLen+i.bufferLength()+n,1);return this.addHeader(o,i.bufferLength(),n),o.writeBuffer(r),o.writeBuffer(i),o},this.setUserData=function(t,e){BK.Script.log(0,0,"setUserData call"),this.setUserDataCallBack=e;var i=new Object;i.cmd=32,i.arg0=t,this.reqArray.push(i),BK.Script.log(0,0,"setUserData push")},this.requestSetUserData=function(t){var e=t.capacity?t.capacity:t.bufferLength(),i=new BK.Buffer(fixedHeaderLen+e,1);this.addFixedHeader(i,32,this.gameId,this.roomId,this.mId),i.writeBuffer(t);var r=BK.Security.getST();BK.Security.encrypt(i);var n=r.bufferLength(),o=new BK.Buffer(HeaderLen+i.bufferLength()+n,1);return this.addHeader(o,i.bufferLength(),n),o.writeBuffer(r),o.writeBuffer(i),o},this.getUserData=function(t,e){void 0==t&&(t=0),this.getUserDataCallBack=e;var i=new Object;i.cmd=34,i.arg0=t,this.reqArray.push(i),BK.Script.log(0,0,"getUserData push roomId = "+t)},this.requestGetUserData=function(t){var e=new BK.Buffer(fixedHeaderLen,1);this.addFixedHeader(e,34,this.gameId,this.roomId,this.mId);var i=BK.Security.getST();BK.Security.encrypt(e);var r=i.bufferLength(),n=new BK.Buffer(HeaderLen+e.bufferLength()+r,1);return this.addHeader(n,e.bufferLength(),r),n.writeBuffer(i),n.writeBuffer(e),n},this.syncOpt=function(t,e,i,r,n){this.sendSyncOptCallBack=n;var o=new Object;o.cmd=14,o.arg0=t,o.arg1=e,o.arg2=i,o.arg3=r,this.reqArray.push(o)},this.sendSyncOpt=function(t,e){var i=new BK.Buffer(1,1);i.writeUint8Buffer(0);var r=new BK.Buffer(1,1);r.writeUint8Buffer(0),this.syncOpt(i,t,r,void 0,e)},this.requestSyncOpt=function(t,e,i,r){var n=20+(t.capacity?t.capacity:t.bufferLength())+4+(e.capacity?e.capacity:e.bufferLength())+4+(i.capacity?i.capacity:i.bufferLength());if(r){var o=r.capacity?r.capacity:r.bufferLength();n=n+4+o,BK.Script.log(0,0,"requestSyncOpt with item len"+o)}var a=new BK.TLV(n);a.bkJSTLVWriteUInt32(this.msgSeq,TLVType.Uint32,201),a.bkJSTLVWriteUInt32(this.lastFrame,TLVType.Uint32,202),a.bkJSTLVWriteBuffer(t,TLVType.Byte,203),a.bkJSTLVWriteBuffer(e,TLVType.Byte,204),a.bkJSTLVWriteBuffer(i,TLVType.Byte,205),r&&a.bkJSTLVWriteBuffer(r,TLVType.Byte,206),BK.Script.log(0,0,"requestSyncOpt this.msgSeq:"+this.msgSeq+" this.lastFrame:"+this.lastFrame);a.bkJSParseTLV();BK.Script.log(0,0,"requestSyncOpt tlv len:"+a.bkJSTLVGetLength()+" fix header:"+fixedHeaderLen);var s=new BK.Buffer(fixedHeaderLen+a.bkJSTLVGetLength(),1);this.addFixedHeader(s,14,this.gameId,this.roomId,this.mId),s.writeBuffer(a.bkJSTLVGetBuffer());var h=BK.Security.getST();BK.Security.encrypt(s);var c=h.bufferLength(),l=new BK.Buffer(HeaderLen+s.bufferLength()+c,1);return this.addHeader(l,s.bufferLength(),c),l.writeBuffer(h),l.writeBuffer(s),this.msgSeq+=1,l},this.setFrameSyncListener=function(t){this.frameSyncListener=t},this.queryFrameData=function(t,e,i){this.queryFrameDataCallBack=i;var r=new Object;r.cmd=18,r.arg0=t,r.arg1=e,this.reqArray.push(r)},this.requestQueryFrameData=function(t,e){var i=new BK.TLV(22);i.bkJSTLVWriteUInt32(this.lastFrame,TLVType.Uint32,201),i.bkJSTLVWriteUInt32(t,TLVType.Uint32,202),i.bkJSTLVWriteUInt16(e,TLVType.Uint16,203);var r=new BK.Buffer(fixedHeaderLen+i.bkJSTLVGetLength(),1);this.addFixedHeader(r,18,this.gameId,this.roomId,this.mId),r.writeBuffer(i.bkJSTLVGetBuffer());var n=BK.Security.getST();BK.Security.encrypt(r);var o=n.bufferLength(),a=new BK.Buffer(HeaderLen+r.bufferLength()+o,1);return this.addHeader(a,r.bufferLength(),o),a.writeBuffer(n),a.writeBuffer(r),a},this.sendControlCommand=function(t,e,i,r){var n=new Object;n.cmd=48,n.arg0=t,n.arg1=e,n.arg2=i,this.reqArray.push(n),this.controlCommandCallback=r},this.requestControlCommand=function(t,e,i){var r=new BK.TLV(14+e.bufferLength()+i.bufferLength());r.bkJSTLVWriteBuffer(e,TLVType.Byte,201),r.bkJSTLVWriteUInt16(t,TLVType.Uint16,202),r.bkJSTLVWriteBuffer(i,TLVType.Byte,203);var n=new BK.Buffer(fixedHeaderLen+r.bkJSTLVGetLength(),1);this.addFixedHeader(n,48,this.gameId,this.roomId,this.mId),n.writeBuffer(r.bkJSTLVGetBuffer()),BK.Security.encrypt(n);var o=BK.Security.getST(),a=o.bufferLength(),s=new BK.Buffer(HeaderLen+n.bufferLength()+a,1);return this.addHeader(s,n.bufferLength(),a),s.writeBuffer(o),s.writeBuffer(n),s},this.sendKeepAlive=function(){var t=new Object;t.cmd=12,this.reqArray.push(t),0!=this.netTimeOutTs&&BK.Time.timestamp-this.netTimeOutTs>5&&this.disconnectNetCallBack&&this.disconnectNetCallBack()},this.requestSendKeepAlive=function(){var t=new BK.Buffer(fixedHeaderLen,1);this.addFixedHeader(t,12,this.gameId,this.roomId,this.mId);var e=BK.Security.getST();BK.Security.encrypt(t);var i=e.bufferLength(),r=new BK.Buffer(HeaderLen+t.bufferLength()+i,1);return this.addHeader(r,t.bufferLength(),i),r.writeBuffer(e),r.writeBuffer(t),r},this.recvCreateRoom=function(t,e){BK.Script.log(0,0,"recvCreateRoom bodyLen="+e);var i=t.readBuffer(e),r=new BK.TLV(i).bkJSParseTLV();if(r){var n=r.tag202,o=n.readUint8Buffer(),a=n.readUint8Buffer(),s=n.readUint16Buffer();n.readUint64Buffer(),n.readUint32Buffer();var h=n.readUint8Buffer(),c=n.readUint8Buffer(),l=n.readUint8Buffer(),u=n.readUint8Buffer(),d=r.tag201,_=d.readUint8Buffer(),f=d.readUint8Buffer(),g=d.readUint16Buffer();d.readUint64Buffer(),d.readUint32Buffer();var p=d.readUint8Buffer(),m=d.readUint8Buffer(),v=d.readUint8Buffer(),S=d.readUint8Buffer(),b=new Object;return b.ipType_1=o,b.resServe_1=a,b.ipType_2=_,b.resServe_2=f,b.port_1=s,b.ip_1=h+"."+c+"."+l+"."+u,b.port_2=g,b.ip_2=p+"."+m+"."+v+"."+S,this.ip0=b.ip_1,this.ip1=b.ip_2,b}return void BK.Script.log(0,0,"recvCreateRoom parse failed.")},this.recvQueryRoom=function(t,e){BK.Script.log(0,0,"recvQueryRoom bodyLen:"+e);var i=t.readBuffer(e),r=new BK.TLV(i).bkJSParseTLV();if(r){var n=r.tag202,o=n.readUint8Buffer(),a=n.readUint8Buffer(),s=n.readUint16Buffer();n.readUint64Buffer(),n.readUint32Buffer();var h=n.readUint8Buffer(),c=n.readUint8Buffer(),l=n.readUint8Buffer(),u=n.readUint8Buffer(),d=r.tag201,_=d.readUint8Buffer(),f=d.readUint8Buffer(),g=d.readUint16Buffer();d.readUint64Buffer(),d.readUint32Buffer();var p=d.readUint8Buffer(),m=d.readUint8Buffer(),v=d.readUint8Buffer(),S=d.readUint8Buffer(),b=r.tag203,B=this.read32BytesToString(b),T=b.readUint64Buffer(),y=b.readUint8Buffer(),E=b.readUint8Buffer(),x=r.tag205;void 0==x&&(x=0);for(var C=[],R=0;R<E;R++){var A={};A.uid=this.read32BytesToString(b),A.status=b.readUint8Buffer(),C.push(A)}var I=new Object;return I.ipType_1=o,I.resServe_1=a,I.ipType_2=_,I.resServe_2=f,I.port_1=s,I.ip_1=h+"."+c+"."+l+"."+u,I.port_2=g,I.ip_2=p+"."+m+"."+v+"."+S,I.ownerId=B,I.createTs=T,I.status=y,I.playerNum=E,I.ext_num=x,this.ip0=I.ip_1,this.ip1=I.ip_2,this.ownerId=B,this.createTs=T,this.status=y,this.playerNum=E,this.players=C,I}return void BK.Script.log(0,0,"recvQueryRoom parse failed.bodyLen is 0")},this.recvJoinRoom=function(t,e){for(var i=t.readBuffer(e),r=new BK.TLV(i).bkJSParseTLV().tag201,n=this.read32BytesToString(r),o=r.readUint64Buffer(),a=r.readUint8Buffer(),s=r.readUint8Buffer(),h=[],c=0;c<s;c++){var l={},u=this.read32BytesToString(r),d=r.readUint64Buffer(),a=r.readUint8Buffer();l.openId=u,l.status=a,l.joinTs=d,h.push(l)}if(this.ownerId=n,this.createTs=o,this.status=a,this.playerNum=s,0==this.currentPlayers.length)h.forEach(function(t){this.newJoinPlayers.push(t)},this);else{var _=[];BK.Script.log(0,0,"recvJoinRoom!curPlayers = "+JSON.stringify(this.currentPlayers)),BK.Script.log(0,0,"recvJoinRoom!joinPlayers = "+JSON.stringify(h));for(c=0;c<h.length;c++){for(var l=h[c],f=!1,g=0;g<this.currentPlayers.length;g++)if(this.currentPlayers[g].openId==l.openId){f=!0;break}0==f&&_.push(l)}this.newJoinPlayers=_,BK.Script.log(0,0,"recvJoinRoom!newPlayers = "+JSON.stringify(this.newJoinPlayers))}this.currentPlayers=h,BK.Script.log(0,0,"recvJoinRoom ownerId="+n+",createTs ="+o+",playerNum:"+s)},this.recvLeaveRoom=function(t,e){var i=t.readBuffer(e),r=new BK.TLV(i).bkJSParseTLV();if(r){var n=r.tag201,o=this.read32BytesToString(n),a=t.readUint64Buffer(),s=new Object;return BK.Script.log(0,0,"recvLeaveRoom!ret = "+a),s.reason=a,s.logOutId=o,this.currentPlayers.splice(this.currentPlayers.indexOf(o)),s}return void BK.Script.log(0,0,"recvLeaveRoom parse failed.bodylen is "+e)},this.recvStartGame=function(t,e){this.startGameTs=BK.Time.timestamp,BK.Script.log(0,0,"recvStartGame")},this.recvPushFrameSync=function(t,e){for(var i=t.readBuffer(e),r=new BK.TLV(i).bkJSParseTLV(),n=(r.tag201,r.tag202,r.tag203),o=new Array,a=0;a<n.length;a++){var s=n[a].readUint32Buffer();this.lastFrame=s;var h=n[a].bufferLength()-4;BK.Script.log(0,0,"sync recv len= "+n[a].bufferLength()+" frameData.length="+n.length);for(var c=new Array;h>0;){BK.Script.log(0,0,"push frameNo="+this.lastFrame);var l=n[a].readUint16Buffer();BK.Script.log(0,0,"push databuf 2 datalen="+l);var u=this.read32BytesToString(n[a]),d=n[a].readUint64Buffer(),_={openId:u,itemId:d,dataBuffer:n[a].readBuffer(l)};BK.Script.log(0,0,"push databuf openid="+u),BK.Script.log(0,0,"push databuf itemid="+d),c.push(_),h-=42,h-=l}c.frameSeq=s,o.push(c)}this.frameSyncListener(o)},this.recvQueryFrameSync=function(t,e){var i=t.readBuffer(e),r=new BK.TLV(i).bkJSParseTLV();if(!r)return BK.Script.log(0,0,"recvQueryFrameSync empty."),void this.queryFrameDataCallBack(0,void 0);for(var n=r.tag201,o=new Array,a=0;a<n.length;a++){var s=n[a].readUint32Buffer(),h=n[a].bufferLength()-4;BK.Script.log(0,0,"sync query recv = "+n[a].bufferLength()+" frameData.length="+n.length);for(var c=new Array;h>0;){BK.Script.log(0,0,"push frameNo="+this.lastFrame);var l=n[a].readUint16Buffer();BK.Script.log(0,0,"push databuf 2 datalen="+l);var u=this.read32BytesToString(n[a]),d=n[a].readUint64Buffer(),_={openId:u,itemId:d,dataBuffer:n[a].readBuffer(l)};BK.Script.log(0,0,"push databuf openid="+u),BK.Script.log(0,0,"push databuf itemid="+d),c.push(_),h-=42,h-=l}c.frameSeq=s,o.push(c)}BK.Script.log(0,0,"query end"),this.queryFrameDataCallBack(0,o)},this.recvControlCommand=function(t,e){var i=t.readBuffer(e),r=new BK.TLV(i).bkJSParseTLV(),n={};r.tag201&&(n=JSON.parse(r.tag201.readAsString())),this.controlCommandCallback&&this.controlCommandCallback(0,n)},this.recvSSOJoinRoom=function(t,e,i){if(BK.Script.log(1,1,"recvSSOJoinRoom = true data="+JSON.stringify(i)),0==t){var r=i.data.avRoomId,n=i.data.sdkAppId,o=i.data.accountType;GameStatusInfo.avAppId=n,GameStatusInfo.avAccountType=o,GameStatusInfo.avRoomId=r,GameStatusInfo.roomId=this.roomId}},this.handleServerError=function(t,e){switch(BK.Script.log(0,1,"handleServerError!cmd = "+t.cmd+", errCode = "+t.ret),t.cmd){case 6:this.createRoomCallBack(t.ret,null,t.roomId);break;case 7:this.roomId=t.roomId,this.createRoomCallBack(header.ret,null,t.roomId);break;case 11:this.queryRoomInfoCallBack(t.ret,null);break;case 3:this.joinRoomCallBack(t.ret,this);break;case 4:case 5:this.leaveRoomCallBack(t.ret,null);break;case 9:this.startGameCallBack(t.ret);break;case 1:this.broadcastDataCallBack(t.fromId,null);break;case 51:this.sensitiveWordCallBack(t.ret,t.fromId,null);break;case 33:this.setUserDataCallBack(t.ret);break;case 35:this.getUserDataCallBack(t.ret,null);break;case 15:this.sendSyncOptCallBack(t.ret,null);break;case 16:break;case 19:this.queryFrameDataCallBack(t.ret,null);break;case 37:this.matchGameCallBack(t.ret);break;case 39:this.queryMatchGameCallBack(t.ret);break;case 41:this.quitMatchGameCallBack(t.ret);break;case 49:this.controlCommandCallback&&this.controlCommandCallback(t.ret,{})}},this.handleRecv=function(t){var e=this.getHeader(t);if(0!=e.stlen){t.readBuffer(e.stlen);BK.Script.log(0,0,"st.len = "+e.stlen)}var i=t.readBuffer(e.bodyLen);BK.Security.decrypt(i);var r=this.getFixedHeader(i);if(this.netTimeOutTs=0,0==r.ret)switch(BK.Script.log(0,0,"handleRecv = "+r.cmd+",bodyLen="+e.bodyLen+",bodyreal="+i.bufferLength()),r.cmd){case 7:this.roomId=r.roomId;var n=this.recvCreateRoom(i,i.bufferLength()-fixedHeaderLen);BK.Script.log(0,0,"magic = "+e.magic+",stlen = "+e.stlen+",bodyLen="+e.bodyLen+",cmd="+r.cmd+",roomId="+r.roomId),this.createRoomCallBack(r.ret,n,r.roomId),BK.QQ.notifyNewRoom(this.roomId,r.ret);break;case 11:var o=this.recvQueryRoom(i,i.bufferLength()-fixedHeaderLen);this.queryRoomInfoCallBack(r.ret,o),BK.Script.log(0,0,"magic = "+e.magic+",stlen = "+e.stlen+",bodyLen="+e.bodyLen+",cmd="+r.cmd+",roomId="+r.roomId);break;case 3:if(this.recvJoinRoom(i,i.bufferLength()-fixedHeaderLen),this.joinRoomCallBack(r.ret,this),1==Boolean(BK.QQ.isNeedSSOServer))for(var a=0;a<this.newJoinPlayers.length;a++)if(this.newJoinPlayers[a].openId==currentPlayerOpenId)return BK.QQ.ssoJoinRoomCallback=this.recvSSOJoinRoom.bind(this),void BK.QQ.notifyNewOrJoinRoomSrv(this.newJoinPlayers,this.roomId,this.ownerId==GameStatusInfo.openId?1:2);BK.QQ.notifyJoinRoom(this.newJoinPlayers,{},r.ret);break;case 5:var s=this.recvLeaveRoom(i,i.bufferLength()-fixedHeaderLen);this.leaveRoomCallBack&&this.leaveRoomCallBack(r.ret,s);break;case 9:this.recvStartGame(i,i.bufferLength()-fixedHeaderLen),this.startGameCallBack(r.ret),1==Boolean(BK.QQ.isNeedSSOServer)&&BK.QQ.notifyStartGameSrv(),0==r.ret&&(BK.QQ.hasJoinRoomSucc=!1);break;case 1:h=i.readBuffer(i.bufferLength()-fixedHeaderLen);this.broadcastDataCallBack(r.fromId,h,r.toId);break;case 51:h=i.readBuffer(i.bufferLength()-fixedHeaderLen);this.sensitiveWordCallBack(r.ret,r.fromId,h,r.toId);break;case 33:h=i.readBuffer(i.bufferLength()-fixedHeaderLen);this.setUserDataCallBack(r.ret);break;case 35:var h=i.readBuffer(i.bufferLength()-fixedHeaderLen);this.getUserDataCallBack(r.ret,h);break;case 15:var c=i.readUint32Buffer();this.ackSeq=c,this.sendSyncOptCallBack(r.ret,c);break;case 16:this.recvPushFrameSync(i,i.bufferLength()-fixedHeaderLen);break;case 19:this.recvQueryFrameSync(i,i.bufferLength()-fixedHeaderLen);break;case 37:this.matchGameCallBack(r.ret);break;case 39:this.roomId=r.roomId,this.queryMatchGameCallBack(r.ret);break;case 41:this.roomId=r.roomId,this.quitMatchGameCallBack(r.ret);break;case 49:this.recvControlCommand(i,i.bufferLength()-fixedHeaderLen)}else this.handleServerError(r)},this.requestSocket=function(t){var e;switch(BK.Script.log(0,0,"requestSocket = "+t.cmd),t.cmd){case 6:e=this.requestCreateRoom(t.arg0,t.arg1);break;case 10:e=this.requestQueryRoom();break;case 2:e=this.requestJoinRoom(t.arg0);break;case 4:e=this.requestLeaveRoom(t.arg0);break;case 8:e=this.requestStartGame();break;case 1:e=this.requestsendBroadcastData(t.arg0);break;case 50:e=this.requestSendSendSensitiveWordData(t.arg0);break;case 32:e=this.requestSetUserData(t.arg0);break;case 34:e=this.requestGetUserData(t.arg0);break;case 14:e=this.requestSyncOpt(t.arg0,t.arg1,t.arg2,t.arg3);break;case 18:e=this.requestQueryFrameData(t.arg0,t.arg1);break;case 36:e=this.requestMatch(t.arg0,t.arg1);break;case 38:e=this.requestQueryMatch(t.arg0,t.arg1);break;case 40:e=this.requestQuitMatch(t.arg0,t.arg1);break;case 12:e=this.requestSendKeepAlive(),0==this.netTimeOutTs&&(this.netTimeOutTs=BK.Time.timestamp);break;case 48:var i=new BK.Buffer,r=new BK.Buffer;i.writeAsString(t.arg1),r.writeAsString(t.arg2),e=this.requestControlCommand(t.arg0,i,r)}void 0!=e&&(BK.Script.log(0,0,"requestSocket = "+t.cmd),this.socket.send(e))},this.seperatePackHandle=function(){for(;;){var t=this.socket.receiveNotRemove(),e=t.bufferLength(),i=this.getHeader(t),r=i.stlen+i.bodyLen+HeaderLen;if(BK.Script.log(0,0,"this.socket.receive():totalLen = "+e+" onePackLen="+r),e==r){BK.Script.log(0,0," this.socket.receive():onePackLen="+r),void 0!=(n=this.socket.receive(r))&&this.handleRecv(n);break}if(e<r){BK.Script.log(0,0," this.socket.receive():part of onePackLen="+r);break}if(e>r){BK.Script.log(0,0," this.socket.receive():Multipacks onePackLen="+r);var n=this.socket.receive(r);void 0!=n&&this.handleRecv(n)}}},this.curConnRetrys=0,this.curConnTimeout=0,this.prevNetState=0,this.reConnectTime=0,this.updateNet=function(){var t=this.socket.update(),e=this.socket.state;if(-1!=t)switch(this.prevNetState){case 0:switch(e){case 3:this.onErrorEvent(this);break;case 1:this.onConnectingEvent(this);break;case 2:this.onConnectedEvent(this)}break;case 1:switch(e){case 2:switch(t){case 2:this.onConnectedEvent();break;case 3:BK.Script.log(0,0,"BK.Socket.update!unexcepted status")}}break;case 2:switch(e){case 2:this.onUpdateEvent();break;default:this.onErrorEvent()}}else switch(BK.Script.log(0,0,"BK.Socket.DisconnectEvent prevNetState="+this.prevNetState),this.prevNetState){case 3:case 2:case 1:this.onDisconnectEvent()}return this.prevNetState=e,t},this.onErrorEvent=function(){BK.Script.log(0,0,"BK.Socket.ErrorEvent")},this.onUpdateEvent=function(){return 0},this.onTimeoutEvent=function(){BK.Script.log(0,0,"BK.Socket.TimeoutEvent")},this.onConnectingEvent=function(){BK.Script.log(0,0,"BK.Socket.ConnectingEvent")},this.onConnectedEvent=function(){BK.Script.log(0,0,"BK.Socket.ConnectedEvent"),this.connectedNetCallback&&this.connectedNetCallback()},this.onReconnectEvent=function(){BK.Script.log(0,0,"BK.Socket.ReconnectEvent")},this.onDisconnectEvent=function(){BK.Script.log(0,0,"BK.Socket.DisconnectEvent"),this.disconnectNetCallBack&&this.disconnectNetCallBack(),this.reConnectTime<3?(BK.Script.log(0,0,"BK.Socket.DisconnectEvent reconnectAndJoinRoom"),(BK.Time.timestamp-this.startGameTs)/60<5?(this.reConnectTime++,this.reConnectAndJoinRoom()):BK.Script.log(0,0,"BK.Socket.DisconnectEvent over 5 min")):this.terminatedNetCallback&&this.terminatedNetCallback()},this.setConnectedNetCallBack=function(t){this.connectedNetCallback=t},this.setDisconnectNetCallBack=function(t){this.disconnectNetCallBack=t},this.setTerminatedNetCallback=function(t){this.terminatedNetCallback=t},this.updateSocket=function(){var t=this.updateNet();if((3==t||2==t)&&this.reqArray.length>0){var e=this.reqArray.pop();void 0!=e&&null!=e&&this.requestSocket(e)}return 3!=t&&1!=t||this.seperatePackHandle(),t},this.createAndJoinRoom=function(t,e,i,r,n){this.createRoom(t,e,function(t,e,o){0==t?(BK.Script.log(0,0,"创建游戏 statusCode:"+t+" roomId:"+o),this.gameSvrIp=e.ip_2,this.gameSvrPort=e.port_2,this.roomSvrIp=e.ip_1,this.roomSvrPort=e.port_1,this.socket.close(),this.socket.connect(this.gameSvrIp,this.gameSvrPort),this.joinRoom(0,function(t,e){BK.Script.log(0,0,"加入房间 statusCode:"+t+" roomid is "+e.roomId),0==t&&(GameStatusInfo.roomId=e.roomId,BK.QQ.gameCfg.roomId=e.roomId),n?1==BK.QQ.hasJoinRoomSucc?i(t,this):BK.QQ.delegate.onJoinRoomEvent=function(e,r,n){i(t,this)}.bind(this):i(t,this)},r,n)):i(t,this)})},this.queryAndJoinRoom=function(t,e,i,r,n,o){1!=this.serverConnected&&(this.socket.close(),this.socket.connect(this.recommandRoomSvrHost,this.recommandRoomSvrPort)),this.queryRoom(t,e,i,function(t,e){0==t?(this.gameSvrIp=e.ip_2,this.gameSvrPort=e.port_2,this.roomSvrIp=e.ip_1,this.roomSvrPort=e.port_1,this.socket.close(),this.socket.connect(this.gameSvrIp,this.gameSvrPort),this.joinRoom(0,function(t,e){BK.QQ.hasJoinRoomSucc=!0,BK.Script.log(0,0,"加入房间 statusCode:"+t+" roomid is "+e.roomId),r(t,this)},n,o)):r(t,void 0)})},this.socialMatch=function(t){this.roomId=Number(GameStatusInfo.roomId),BK.Script.log(1,1,"1v1匹配 玩家来源:"+GameStatusInfo.src+" 房间号:"+GameStatusInfo.roomId),this.createRoom(GameStatusInfo.gameId,GameStatusInfo.openId,function(e,i,r){BK.Script.log(1,1,"1v1匹配 创建房间 statusCode:"+e+" roomid:"+r),0==e?(this.isCreator=!0,this.gameSvrIp=i.ip_2,this.gameSvrPort=i.port_2,this.roomSvrIp=i.ip_1,this.roomSvrPort=i.port_1,this.socket.close(),this.socket.connect(this.gameSvrIp,this.gameSvrPort),this.joinRoom(GameStatusInfo.src,function(e,i){BK.Script.log(1,1,"1v1匹配 加入房间 statusCode:"+e+" roomid:"+i.roomId),0==e?(BK.Script.log(1,1,"1v1匹配 加入房间成功"),t(e,i)):(BK.Script.log(1,1,"1v1匹配 加入房间失败 statusCode:"+e+" 具体错误码参见http://hudong.qq.com/docs/engine/api/BK.MQQ.ErrorCode.html"),t(e,this))},!0,!0)):2007==e?(this.isCreator=!1,this.queryRoom(GameStatusInfo.gameId,GameStatusInfo.roomId,GameStatusInfo.openId,function(e,i){BK.Script.log(1,1,"1v1匹配 查询房间 statusCode:"+e+" roomId:"+r+" 房间中玩家数:"+i.playerNum),0==e&&i?(this.gameSvrIp=i.ip_2,this.gameSvrPort=i.port_2,this.roomSvrIp=i.ip_1,this.roomSvrPort=i.port_1,this.socket.close(),this.socket.connect(this.gameSvrIp,this.gameSvrPort),this.joinRoom(GameStatusInfo.src,function(e,i){BK.Script.log(1,1,"1v1匹配 加入房间 statusCode:"+e+" roomid:"+i.roomId),0==e?(BK.Script.log(1,1,"1v1匹配 加入房间成功"),t(e,i)):(BK.Script.log(1,1,"1v1匹配 加入房间失败 statusCode:"+e+" 具体错误码参见http://hudong.qq.com/docs/engine/api/BK.MQQ.ErrorCode.html"),t(e,this))},!0,!0)):(BK.Script.log(1,1,"1v1匹配 查询房间失败 statusCode:"+e+" 具体错误码参见http://hudong.qq.com/docs/engine/api/BK.MQQ.ErrorCode.html"),t(e,this))})):(BK.Script.log(1,1,"1v1匹配 创建房间失败 statusCode:"+e+" 具体错误码参见http://hudong.qq.com/docs/engine/api/BK.MQQ.ErrorCode.html"),t(e,this))})},this.showOneMorePage=function(t,e){var i=[],r=0;if(e&&2==e.length)for(var n=0;n<e.length;n++){r=2!=t&&GameStatusInfo.openId==e[n]?t:2==t?2:2!=t&&GameStatusInfo.openId!=e[n]?1-t:-1;o={openId:e[n],scoreState:r};BK.Script.log(1,1,"玩家信息 playerInfo:"+JSON.stringify(o)),i.push(o)}else if(this.newJoinPlayers){if(this.newJoinPlayers.forEach(function(e){r=2!=t&&GameStatusInfo.openId==e.openId?t:2==t?2:2!=t&&GameStatusInfo.openId!=e.openId?1-t:-1;var n={openId:e.openId,scoreState:r};BK.Script.log(1,1,"玩家信息 playerInfo:"+JSON.stringify(n)),i.push(n)},this),this.isCreator){2!=t?r=t:2==t&&(r=2);var o={openId:this.ownerId,scoreState:r};BK.Script.log(1,1,"玩家信息 playerInfo:"+JSON.stringify(o)),i.push(o)}}else BK.Script.log(1,1,"再来一局失败,openIds(自建后台)或newJoinPlayers(非自建后台)为null或者undefined");var a={scoreState:t,playerInfos:i};BK.Script.log(1,1,"再来一局成功 data:"+JSON.stringify(a)),BK.MQQ.SsoRequest.send(a,CMSHOW_CS_CMD_SHOW_ONE_MORE_PAGE)},this.forceLeaveRoom=function(t,e){var i=new Object;i.cmd=4,i.arg0=e,this.leaveRoomCallBack=t;var r=this.requestLeaveRoom(i.arg0),n=this.socket.update();3==n||2==n?(this.socket.send(r),BK.Script.log(0,0,"forceLeaveRoom push")):BK.Script.log(0,0,"forceLeaveRoom push Failed. Socket not allow Send.")},this._event4StopGame=function(t,e,i){BK.Script.log(0,0,"BK.Room._event4StopGame!errCode = "+t+", cmd = "+e+", data = "+JSON.stringify(i)),0==t&&this.forceLeaveRoom(function(t,e){BK.Script.log(0,0,"forceLeaveRoom callback")},0)},BK.MQQ.SsoRequest.addListener(CMSHOW_SC_CMD_STOP_GAME,this,this._event4StopGame.bind(this)),this.addDebugFunctions=function(){this.createFixedRoom=function(t,e,i,r){this.roomId=i,this.mId=e,this.gameId=t;var n=this.socket.connect(this.recommandRoomSvrHost,this.recommandRoomSvrPort);BK.Script.log(0,0,"socket con ="+n),-1!=n&&BK.Script.log(0,0,"socket connect failed! "+n),this.createRoomCallBack=r;var o=new Object;o.cmd=6,o.arg0=t,o.arg1=e,this.reqArray.push(o),BK.Script.log(0,0,"create Fixed Room ")},this.createAndJoinFixedRoom=function(t,e,i,r,n){this.createFixedRoom(t,e,i,function(t,e,i){0==t?(BK.Script.log(0,0,"创建固定房间号 游戏 statusCode:"+t+" roomId:"+i),this.gameSvrIp=e.ip_2,this.gameSvrPort=e.port_2,this.roomSvrIp=e.ip_1,this.roomSvrPort=e.port_1,this.socket.close(),this.socket.connect(this.gameSvrIp,this.gameSvrPort),this.joinRoom(0,function(t,e){BK.Script.log(0,0,"加入房间 statusCode:"+t+" roomid is "+e.roomId),r(t,this)},n)):r(t,this)})},this.requestCreateRoom=function(t,e){var i=this.roomId;i||(i=0),BK.Script.log(0,0,"create fixed room request in fixedRoomId:"+i);var r=new BK.Buffer(fixedHeaderLen,1);this.addFixedHeader(r,6,t,i,e);var n=BK.Security.getST();BK.Security.encrypt(r);var o=n.bufferLength(),a=new BK.Buffer(HeaderLen+r.bufferLength()+o,1);return this.addHeader(a,r.bufferLength(),o),a.writeBuffer(n),a.writeBuffer(r),BK.Script.log(0,0,"create room request buffer : "+a.bufferLength()+" body len:"+r.bufferLength()),a}},Object.defineProperty(this,"environment",{get:function(){return this._environment},set:function(t){BK.Script.log(0,0,"Set Environment failed!Can't set the environment!!!")}}),GameStatusInfo.devPlatform?(this._environment=NETWORK_ENVIRONMENT_DEMO_DEV,BK.Script.log(1,1,"当前环境为---开发环境")):1==GameStatusInfo.isWhiteUser?(this._environment=NETWORK_ENVIRONMENT_QQ_DEBUG,BK.Script.log(1,1,"当前环境为---手Q开发环境")):(this._environment=NETWORK_ENVIRONMENT_QQ_RELEASE,BK.Script.log(1,1,"当前环境为---正式环境")),this._environment==NETWORK_ENVIRONMENT_QQ_DEBUG?(this.headerVersion=769,this.recommandRoomSvrHost=DebugRecommandRoomSvrHost,this.recommandRoomSvrPort=DebugRecommandRoomSvrPort):this._environment==NETWORK_ENVIRONMENT_DEMO_DEV&&(this.addDebugFunctions(),this.headerVersion=257,this.recommandRoomSvrHost=DebugRecommandRoomSvrHost,this.recommandRoomSvrPort=DebugRecommandRoomSvrPort)},function(t,e){"object"==typeof t&&("object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Device=e(),BK.MQQ.SsoRequest.addListener(CMD_CMSHOW_GAME_ENTER_BACKGROUND,this,function(){BK.Script.log(1,1,"keepScreenOn CMD_CMSHOW_GAME_ENTER_BACKGROUND "),BK.Device.innnerSetKeepScreenOn(!1)}),BK.MQQ.SsoRequest.addListener(CMD_CMSHOW_GAME_ENTER_FORGROUND,this,function(){BK.Script.log(1,1,"keepScreenOn CMD_CMSHOW_GAME_ENTER_FORGROUND "),BK.Device.isKeepScreenOnInit?BK.Device.innnerSetKeepScreenOn(BK.Device.userSetDeviceScreenValue):BK.Device.innnerSetKeepScreenOn(!1)}),BK.MQQ.SsoRequest.addListener(CMD_CMSHOW_GAME_MINIMIZE,this,function(){BK.Script.log(1,1,"keepScreenOn CMD_CMSHOW_GAME_MINIMIZE "),BK.Device.innnerSetKeepScreenOn(!1)}),BK.MQQ.SsoRequest.addListener(CMD_CMSHOW_GAME_MAXIMIZE,this,function(){BK.Script.log(1,1,"keepScreenOn CMD_CMSHOW_GAME_MAXIMIZE "),BK.Device.isKeepScreenOnInit?BK.Device.innnerSetKeepScreenOn(BK.Device.userSetDeviceScreenValue):BK.Device.innnerSetKeepScreenOn(!1)}),BK.MQQ.SsoRequest.addListener(CMSHOW_SC_CMD_STOP_GAME,this,function(){BK.Script.log(1,1,"keepScreenOn CMSHOW_SC_CMD_STOP_GAME "),BK.Device.innnerSetKeepScreenOn(!1)}))}(BK,function(){function t(){this.isKeepScreenOnInit=!1,this.userSetDeviceScreenValue=void 0,BK.Director.isKeepScreenOn=!1}return t.prototype.innnerSetKeepScreenOn=function(t){this.isKeepScreenOnInit?(BK.QQ.uploadData("call_screen_on",GameStatusInfo.src,t?1:0,"","",""),BK.Director.isKeepScreenOn=t):BK.Script.log(1,1,"user unset keepScreenOn,ignore the value")},t.prototype.setKeepScreenOn=function(t){BK.Script.log(1,1,"user set keepScreenOn "+t),this.userSetDeviceScreenValue=t,this.isKeepScreenOnInit=!0,this.innnerSetKeepScreenOn(t)},new t}),function(t,e){"object"==typeof t&&("object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.DNS=e())}(BK,function(){function t(){this.records=[],this.running=!1}return t.prototype.exists=function(t){for(var e=0;e<this.records.length;e++)if(this.records[e].hostname===t)return!0;return!1},t.prototype.query=function(t,e){for(var i=0;i<this.records.length;i++)if(this.records[i].af===e&&this.records[i].hostname===t)return this.records[i];return null},t.prototype.update=function(t,e,i,r){for(var n=0;n<this.records.length;n++)if(this.records[n].af===i&&this.records[n].hostname===t)return void this.records[n].callbacks.push(e);this.records.push({af:i,timeout:r,hostname:t,callbacks:[e]})},t.prototype.delete=function(t){for(var e=this.records.length-1;e>=0;e--)if(this.records[e].hostname===t){this.records.splice(e,1);break}},t.prototype.start=function(){if(!this.running){this.running=!0;var t=this;BK.Director.ticker.add(function(e,i){t.records.length&&BK.Misc.handleDNSQueryResult()})}},t.prototype.queryIPAddress=function(t,e,i,r){var n=!this.exists(t);if(void 0==i&&(i=2),void 0==r&&(r=0),this.update(t,e,i,r),n){var o=this;o.start(),BK.Misc.queryIPAddress(t,function(e,i,r){var n=o.query(t,i);if(n)for(var a=n.callbacks,s=0;s<a.length;s++)a[s].call(o,e,i,r);o.delete(t)},i,r)}},new t}),function(t,e){"object"==typeof t&&("object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.HTTPParser=e())}(this,function(){function t(t){this.onHeaders=void 0,this.onComplete=void 0,this.reinitialize(t)}var e=/^HTTP\/1\.([01]) ([0-9]{3})(?: ((?:[\x21-\x7E](?:[\t ]+[\x21-\x7E])*)*))?$/,i=/^([!#$%'*+\-.^_`|~0-9A-Za-z]+):[\t ]*((?:[\x21-\x7E](?:[\t ]+[\x21-\x7E])*)*)[\t ]*$/,r=/^[\t ]+(.*)$/;return t.prototype.reinitialize=function(e){this.execute=this._executeHeader,this.type=e,e===t.RESPONSE&&(this._state=1),this._err=void 0,this._flags=0,this._contentLen=void 0,this._nbytes=0,this._nhdrbytes=0,this._nhdrpairs=0,this._buf="",this._seenCR=!1,this.headers={},this.httpMajor=1,this.httpMinor=void 0,this.maxHeaderPairs=2e3,this.method=void 0,this.url=void 0,this.statusCode=void 0,this.statusText=void 0},t.prototype._processHdrLine=function(t){switch(this._state){case 2:if(0===t.length)return void this._headersEnd();if(null===(l=i.exec(t))){if(null===(l=r.exec(t)))return this.execute=this._executeError,this._err=new Error("Malformed header line"),this.execute(this._err),this._err;var n=l[1];n.length>0&&BK.Script.log(1,0,"processHdrLine!extra = "+n)}else{var o=l[1],a=l[2];switch(o.toLowerCase()){case"connection":"close"===(s=a.toLowerCase()).substring(0,5)?this._flags|=4:"keep-alive"===s.substring(0,10)?this._flags|=2:"upgrade"===s.substring(0,7)&&(this._flags|=8);break;case"transfer-encoding":var s=a.toLowerCase();"chunked"===s.substring(0,7)&&(this._flags|=1);break;case"upgrade":this._flags|=32;break;case"content-length":var h=parseInt(a,10);if(isNaN(h)||h>524288)return this.execute=this._executeError,this._err=new Error("Bad Content-Length: "+inspect(h)),this.execute(this._err),this._err;this._contentLen=h}var c=this.maxHeaderPairs;(c<=0||++this._nhdrpairs<c)&&(this.headers[o.toLowerCase()]=a)}break;case 1:if(0===t.length)return!0;var l=e.exec(t);if(null===l)return this.execute=this._executeError,this._err=new Error("Malformed status line"),this.execute(this._err),this._err;this.httpMinor=parseInt(l[1],10),this.statusCode=parseInt(l[2],10),this.statusText=l[3]||"",this._state=2;break;default:return this.execute=this._executeError,this._err=new Error("Unexpected HTTP parser state: "+this._state),this.execute(this._err),this._err}},t.prototype._headersEnd=function(){var t=this._flags,e=this.method&&this.method.toLowerCase(),i=40==(40&t)||"connect"===e,r=0==(4&t),n=this._contentLen;if(this._buf="",this._seenCR=!1,this._nbytes=0,(0===this.httpMajor&&9===this.httpMinor||0===this.httpMinor&&0==(2&t))&&(r=!1),(16&t)>0)return this.onComplete&&this.onComplete(),void this.reinitialize(this.type);if(this.onHeaders){var o=this.headers;!0===this.onHeaders(this.httpMajor,this.httpMinor,o,this.method,this.url,this.statusCode,this.statusText,i,r)&&(t=this._flags|=64)}i?(this.onComplete&&this.onComplete(),this._state=3):(0===n||(64&t)>0||0==(1&t)&&void 0===n&&!this._needsEOF())&&(this.onComplete&&this.onComplete(),this.reinitialize(this.type))},t.prototype._executeHeader=function(t){for(var e,i,r,n=0,o=t.length,a=this._seenCR,s=this._buf,h=this._nhdrbytes;n<o;){if(a)if(a=!1,10===t.charCodeAt(n)){if(++n,i=this._processHdrLine(s),s="","object"==typeof i)return this._err=i,this.execute(this._err),i;if(void 0===i&&2!==(l=this._state))return l<3&&n<o?(i=this.execute(t.slice(n)),"number"!=typeof i?(this._err=i,this.execute(this._err),i):n+i):(3===l&&this.reinitialize(this.type),n)}else if(s+="\r",++h>81920)return this.execute=this._executeError,this._err=new Error("Header size limit exceeded (81920)"),this.execute(this._err),this._err;if(!((e=t.indexOf("\r\n",n))>-1)){var c;if(13===t.charCodeAt(o-1)?(a=!0,c=o-1):c=o,(h+=c-n)>81920)return this.execute=this._executeError,this._err=new Error("Header size limit exceeded (81920)"),this.execute(this._err),this._err;s+=t.substring(n,c);break}if((r=e-n)>0){if((h+=r)>81920)return this.execute=this._executeError,this._err=new Error("Header size limit exceeded (81920)"),this.execute(this._err),this._err;s+=t.substring(n,e)}if(n=e+2,i=this._processHdrLine(s),s="","object"==typeof i)return this._err=i,this.execute(this._err),i;if(void 0===i){var l=this._state;if(2!==l)return l<3&&n<o?(i=this.execute(t.slice(n)),"number"!=typeof i?(this._err=i,this.execute(this._err),i):n+i):(3===l&&this.reinitialize(this.type),n)}}return this._buf=s,this._seenCR=a,this._nhdrbytes=h,o},t.prototype._executeError=function(t){return BK.Script.log(1,0,"_executeError!err = "+t.message),this._err},t.prototype.execute=t.prototype._executeHeader,t.prototype._needsEOF=function(){if(this.type===t.REQUEST)return!1;var e=this.statusCode,i=this._flags;return!(void 0!==e&&(204===e||304===e||1===parseInt(e/100,1))||64&i)&&!((1&i)>0||void 0!=this._contentLen)},t.REQUEST=0,t.RESPONSE=1,t}),function(t,e){"object"==typeof t&&("object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.URL=e())}(BK,function(){return function(){function t(){return new RegExp(/(.*?)\.?([^\.]*?)\.?(com|net|org|biz|ws|in|me|co\.uk|co|org\.uk|ltd\.uk|plc\.uk|me\.uk|edu|mil|br\.com|cn\.com|eu\.com|hu\.com|no\.com|qc\.com|sa\.com|se\.com|se\.net|us\.com|uy\.com|ac|co\.ac|gv\.ac|or\.ac|ac\.ac|af|am|as|at|ac\.at|co\.at|gv\.at|or\.at|asn\.au|com\.au|edu\.au|org\.au|net\.au|id\.au|be|ac\.be|adm\.br|adv\.br|am\.br|arq\.br|art\.br|bio\.br|cng\.br|cnt\.br|com\.br|ecn\.br|eng\.br|esp\.br|etc\.br|eti\.br|fm\.br|fot\.br|fst\.br|g12\.br|gov\.br|ind\.br|inf\.br|jor\.br|lel\.br|med\.br|mil\.br|net\.br|nom\.br|ntr\.br|odo\.br|org\.br|ppg\.br|pro\.br|psc\.br|psi\.br|rec\.br|slg\.br|tmp\.br|tur\.br|tv\.br|vet\.br|zlg\.br|br|ab\.ca|bc\.ca|mb\.ca|nb\.ca|nf\.ca|ns\.ca|nt\.ca|on\.ca|pe\.ca|qc\.ca|sk\.ca|yk\.ca|ca|cc|ac\.cn|com\.cn|edu\.cn|gov\.cn|org\.cn|bj\.cn|sh\.cn|tj\.cn|cq\.cn|he\.cn|nm\.cn|ln\.cn|jl\.cn|hl\.cn|js\.cn|zj\.cn|ah\.cn|gd\.cn|gx\.cn|hi\.cn|sc\.cn|gz\.cn|yn\.cn|xz\.cn|sn\.cn|gs\.cn|qh\.cn|nx\.cn|xj\.cn|tw\.cn|hk\.cn|mo\.cn|cn|cx|cz|de|dk|fo|com\.ec|tm\.fr|com\.fr|asso\.fr|presse\.fr|fr|gf|gs|co\.il|net\.il|ac\.il|k12\.il|gov\.il|muni\.il|ac\.in|co\.in|org\.in|ernet\.in|gov\.in|net\.in|res\.in|is|it|ac\.jp|co\.jp|go\.jp|or\.jp|ne\.jp|ac\.kr|co\.kr|go\.kr|ne\.kr|nm\.kr|or\.kr|li|lt|lu|asso\.mc|tm\.mc|com\.mm|org\.mm|net\.mm|edu\.mm|gov\.mm|ms|nl|no|nu|pl|ro|org\.ro|store\.ro|tm\.ro|firm\.ro|www\.ro|arts\.ro|rec\.ro|info\.ro|nom\.ro|nt\.ro|se|si|com\.sg|org\.sg|net\.sg|gov\.sg|sk|st|tf|ac\.th|co\.th|go\.th|mi\.th|net\.th|or\.th|tm|to|com\.tr|edu\.tr|gov\.tr|k12\.tr|net\.tr|org\.tr|com\.tw|org\.tw|net\.tw|ac\.uk|uk\.com|uk\.net|gb\.com|gb\.net|vg|sh|kz|ch|info|ua|gov|name|pro|ie|hk|com\.hk|org\.hk|net\.hk|edu\.hk|us|tk|cd|by|ad|lv|eu\.lv|bz|es|jp|cl|ag|mobi|eu|co\.nz|org\.nz|net\.nz|maori\.nz|iwi\.nz|io|la|md|sc|sg|vc|tw|travel|my|se|tv|pt|com\.pt|edu\.pt|asia|fi|com\.ve|net\.ve|fi|org\.ve|web\.ve|info\.ve|co\.ve|tel|im|gr|ru|net\.ru|org\.ru|hr|com\.hr|ly|xyz)$/)}function e(t){return decodeURIComponent(t.replace(/\+/g," "))}function i(t,e){var i=t.charAt(0),r=e.split(i);return i===t?r:(t=parseInt(t.substring(1),10),r[t<0?r.length+t:t-1])}function r(t,i){for(var r=t.charAt(0),n=i.split("&"),o=[],a={},s=[],h=t.substring(1),c=0,l=n.length;c<l;c++)if((o=n[c].match(/(.*?)=(.*)/))||(o=[n[c],n[c],""]),""!==o[1].replace(/\s/g,"")){if(o[2]=e(o[2]||""),h===o[1])return o[2];(s=o[1].match(/(.*)\[([0-9]+)\]/))?(a[s[1]]=a[s[1]]||[],a[s[1]][s[2]]=o[2]):a[o[1]]=o[2]}return r===t?a:a[h]}return function(e,n){var o,a={};if("tld?"===e)return t();if(n=n||window.location.toString(),!e)return n;if(e=e.toString(),o=n.match(/^mailto:([^\/].+)/))a.protocol="mailto",a.email=o[1];else{if((o=n.match(/(.*?)\/#\!(.*)/))&&(n=o[1]+o[2]),(o=n.match(/(.*?)#(.*)/))&&(a.hash=o[2],n=o[1]),a.hash&&e.match(/^#/))return r(e,a.hash);if((o=n.match(/(.*?)\?(.*)/))&&(a.query=o[2],n=o[1]),a.query&&e.match(/^\?/))return r(e,a.query);if((o=n.match(/(.*?)\:?\/\/(.*)/))&&(a.protocol=o[1].toLowerCase(),n=o[2]),(o=n.match(/(.*?)(\/.*)/))&&(a.path=o[2],n=o[1]),a.path=(a.path||"").replace(/^([^\/])/,"/$1"),e.match(/^[\-0-9]+$/)&&(e=e.replace(/^([^\/])/,"/$1")),e.match(/^\//))return i(e,a.path.substring(1));if((o=i("/-1",a.path.substring(1)))&&(o=o.match(/(.*?)\.(.*)/))&&(a.file=o[0],a.filename=o[1],a.fileext=o[2]),(o=n.match(/(.*)\:([0-9]+)$/))&&(a.port=o[2],n=o[1]),(o=n.match(/(.*?)@(.*)/))&&(a.auth=o[1],n=o[2]),a.auth&&(o=a.auth.match(/(.*)\:(.*)/),a.user=o?o[1]:a.auth,a.pass=o?o[2]:void 0),a.hostname=n.toLowerCase(),"."===e.charAt(0))return i(e,a.hostname);t()&&(o=a.hostname.match(t()))&&(a.tld=o[3],a.domain=o[2]?o[2]+"."+o[3]:void 0,a.sub=o[1]||void 0),a.port||("http"===a.protocol||"ws"===a.protocol?a.port="80":"https"!==a.protocol&&"wss"!==a.protocol||(a.port="443"))}return e in a?a[e]:"{}"===e?a:void 0}}()});var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();!function(t,e){"object"==typeof t&&("object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.WebSocket=e())}(BK,function(){var t=function(){function t(){this._wsArray=[],BK.Director.ticker.add(function(e,i){t.Instance.dispatchEvent()})}return t.prototype.add=function(t){this._wsArray.push(t),BK.Script.log(1,0,"SocketEventMgr.add!so = "+t)},t.prototype.del=function(t){var e=this._wsArray.indexOf(t,0);e>=0&&(this._wsArray.splice(e,1),BK.Script.log(1,0,"SocketEventMgr.del!so = "+t))},t.prototype.dispatchEvent=function(){this._wsArray.forEach(function(t,e,i){t&&t.update()})},t.Instance=new t,t}(),e=function(){function e(t,e){this.ip=t,this.port=e,this.__nativeObj=new BK.Socket,this.prevConnTs=0,this.curConnRetrys=0,this.curConnTimeout=0,this.prevNetState=0,this.prevNetStateUpdateFlag=!1,this.options={ConnectRetryCount:3,ConnectTimeoutInterval:3e3}}return e.prototype.__internalClose=function(){return this.__nativeObj?this.__nativeObj.close():-2},e.prototype.__internalSend=function(t){return this.__nativeObj?this.__nativeObj.send(t):-2},e.prototype.__internalRecv=function(t){if(this.__nativeObj)return this.__nativeObj.receive(t)},e.prototype.__internalUpdate=function(){return this.__nativeObj?this.__nativeObj.update():-2},e.prototype.__internalConnect=function(){if(this.__nativeObj){var t=this.__nativeObj.connect(this.ip,this.port),e=this.curNetState();switch(this.prevNetState){case 3:this.onReconnectEvent(this);case 0:switch(e){case 3:this.onErrorEvent(this);break;case 1:case 4:this.prevConnTs=BK.Time.clock,this.curConnTimeout||(this.curConnTimeout=this.options.ConnectTimeoutInterval),this.onConnectingEvent(this),t=0;break;case 2:case 5:this.onConnectedEvent(this),t=0}}return this.prevNetState=e,this.prevNetStateUpdateFlag=!0,t}return-2},e.prototype.__internalCanReadLength=function(){return this.__nativeObj?this.__nativeObj.canReadLength():0},e.prototype.__internalIsEnableSSL=function(){return!!this.__nativeObj&&this.__nativeObj.getSSLEnable()},e.prototype.__internalEnableSSL=function(t){this.__nativeObj&&this.__nativeObj.setSSLEnable(t)},e.prototype.__internalUpdateSSL=function(){var t=this.__internalUpdate(),e=this.curNetState();if(-1!=t)switch(this.prevNetState){case 1:switch(e){case 2:BK.Script.log(1,0,"BK.Socket.update.ssl!connected, ip = "+this.ip+", port = "+this.port);break;case 4:case 5:break;default:i=BK.Time.clock;return 1e3*(r=BK.Time.diffTime(this.prevConnTs,i))>=this.curConnTimeout&&(this.curConnRetrys=this.curConnRetrys+1,this.curConnRetrys<this.options.ConnectRetryCount?(this.close(),this.connect(),this.curConnTimeout=2*this.curConnTimeout):(this.onTimeoutEvent(this),this.close())),t}break;case 2:break;case 4:switch(e){case 5:switch(t){case 2:case 3:this.clearState(),this.onConnectedEvent(this)}break;default:var i=BK.Time.clock,r=BK.Time.diffTime(this.prevConnTs,i);return 1e3*r>=this.curConnTimeout&&(this.curConnRetrys=this.curConnRetrys+1,this.curConnRetrys<this.options.ConnectRetryCount?(this.close(),this.connect(),this.curConnTimeout=2*this.curConnTimeout):(this.onTimeoutEvent(this),this.close())),t}break;case 5:switch(e){case 5:this.onUpdateEvent(this);break;case 3:this.onDisconnectEvent(this);break;default:this.onErrorEvent(this)}}else switch(this.prevNetState){case 2:case 1:this.onDisconnectEvent(this);break;case 4:case 6:case 5:this.onErrorEvent(this)}return this.prevNetStateUpdateFlag||(this.prevNetState=e,this.prevNetStateUpdateFlag=!0),t},e.prototype.__internalUpdateNoSSL=function(){var t=this.__internalUpdate(),e=this.curNetState();if(-1!=t)switch(this.prevNetState){case 1:switch(e){case 2:switch(t){case 2:this.clearState(),this.onConnectedEvent(this);break;case 3:BK.Script.log(1,0,"BK.Socket.update!unexcepted status")}break;default:var i=BK.Time.clock;return 1e3*BK.Time.diffTime(this.prevConnTs,i)>=this.curConnTimeout&&(this.curConnRetrys=this.curConnRetrys+1,this.curConnRetrys<this.options.ConnectRetryCount?(this.close(),this.connect(),this.curConnTimeout=2*this.curConnTimeout):(this.onTimeoutEvent(this),this.close())),t}break;case 2:switch(e){case 2:this.onUpdateEvent(this);break;case 3:this.onDisconnectEvent(this);break;default:this.onErrorEvent(this)}}else switch(this.prevNetState){case 2:case 1:this.onDisconnectEvent(this)}return this.prevNetStateUpdateFlag||(this.prevNetState=e,this.prevNetStateUpdateFlag=!0),t},e.prototype.curNetState=function(){return this.__nativeObj?this.__nativeObj.state:0},e.prototype.close=function(){var e=this.__internalClose();return e||(this.prevNetState=0,this.prevNetStateUpdateFlag=!0),t.Instance.del(this),e},e.prototype.send=function(t){var i=this.__internalSend(t);return i<0&&(this.onErrorEvent(this),e.prototype.close.call(this)),i},e.prototype.recv=function(t){return this.__internalRecv(t)},e.prototype.canRecvLength=function(){return this.__internalCanReadLength()},e.prototype.update=function(){return this.prevNetStateUpdateFlag=!1,this.isEnableSSL()?this.__internalUpdateSSL():this.__internalUpdateNoSSL()},e.prototype.connect=function(){var e=this.curNetState();if(0==e||3==e){var i=this.__internalConnect();return i||t.Instance.add(this),i}return 0},e.prototype.isEnableSSL=function(){return this.__internalIsEnableSSL()},e.prototype.enableSSL=function(t){this.__internalEnableSSL(t)},e.prototype.onErrorEvent=function(t){BK.Script.log(1,0,"BK.Socket.ErrorEvent")},e.prototype.onUpdateEvent=function(t){return 0},e.prototype.onTimeoutEvent=function(t){BK.Script.log(1,0,"BK.Socket.TimeoutEvent")},e.prototype.onConnectingEvent=function(t){BK.Script.log(1,0,"BK.Socket.ConnectingEvent")},e.prototype.onConnectedEvent=function(t){BK.Script.log(1,0,"BK.Socket.ConnectedEvent")},e.prototype.onReconnectEvent=function(t){BK.Script.log(1,0,"BK.Socket.ReconnectEvent")},e.prototype.onDisconnectEvent=function(t){BK.Script.log(1,0,"BK.Socket.DisconnectEvent")},e.prototype.clearState=function(){},e}(),i=function(){function t(t,e){this.data=t,this.isBinary=e}return t}(),r=function(t){function e(e,i,r,n,o){var a=t.call(this,e,i)||this;return a.path=n||"/",a.host=r,a.query=o,a.httpVer=1.1,a.httpParser=new HTTPParser(HTTPParser.RESPONSE),a.version=13,a.protocols=new Array,a.extensions=new Array,a.delegate={onOpen:null,onClose:null,onError:null,onMessage:null,onSendComplete:null},a.options||(a.options={}),a.options.DrainSegmentCount=8,a.options.DefaultSegmentSize=4096,a.options.PingPongInterval=0,a.options.HandleShakeRequestTimeout=1e4,a.options.HandleShakeResponseTimeout=1e4,a.options.CloseAckTimeout=2e3,a.options.PingPongTimeout=3e3,a.clear(),a}return __extends(e,t),e.prototype.clear=function(){this.mask4=new BK.Buffer(4,!1),this.txbuf=new BK.Buffer(128,!0),this.rxbuf=new BK.Buffer(128,!0),this.txMsgQue=new Array,this.rxbufQue=new Array,this.udataQue=new Array,this.peerClosed=!1,this.txSegCount=0,this.rxSegCount=0,this.rxFrameType=-1,this.isFinalSeg=!1,this.inTxSegFrame=!1,this.inRxSegFrame=!1,this.inPartialTxbuf=!1,this.inPingFrame=!1,this.inPongFrame=!1,this.errcode=65535,this.state=0,this.parseState=0,this.phaseTimeout=0,this.pingpongTimer=0,this.prevPhaseTickCount=0,this.prevPingPongTickCount=0,this.framePackageCount=0},e.prototype.getReadyState=function(){return this.state},e.prototype.getErrorCode=function(){return this.errcode},e.prototype.getErrorString=function(){return this.message},e.prototype.randomN=function(t){for(var e=new BK.Buffer(t,!1),i=0;i<t;i++){var r=Math.round(65535*Math.random());e.writeUint8Buffer(r)}return e},e.prototype.toHex=function(t){if(t>=0&&t<=9)return t.toString();switch(t){case 10:return"A";case 11:return"B";case 12:return"C";case 13:return"D";case 14:return"E";case 15:return"F"}return"u"},e.prototype.bufferToHexString=function(t){var e="";for(t.rewind();!t.eof;){var i=t.readUint8Buffer();e=e.concat("x"+this.toHex((240&i)>>4)+this.toHex(15&i)+" ")}return e},e.prototype.startPhaseTimeout=function(t){if(6==t)this.phaseTimeout=t,this.prevPhaseTickCount=0;else switch(this.state){case 2:1==t&&(this.phaseTimeout=t,this.prevPhaseTickCount=BK.Time.clock);break;case 3:2==t&&(this.phaseTimeout=t,this.prevPhaseTickCount=BK.Time.clock);break;case 1:3==t&&(this.phaseTimeout=t,this.prevPhaseTickCount=BK.Time.clock);break;case 4:switch(t){case 4:this.options.PingPongTimeout=Math.min(this.options.PingPongTimeout,this.options.PingPongInterval)}this.phaseTimeout=t,this.prevPhaseTickCount=BK.Time.clock}},e.prototype.handlePhaseTimeout=function(){if(6!=this.phaseTimeout){var e=BK.Time.diffTime(this.prevPhaseTickCount,BK.Time.clock);switch(this.phaseTimeout){case 1:1e3*e>this.options.HandleShakeRequestTimeout&&(BK.Script.log(1,0,"BK.WebSocket.handlePhaseTimeout!handshake request timeout"),this.prevPhaseTickCount=BK.Time.clock,this.state=-1,this.errcode=4096,this.message="handshake request timeout",t.prototype.close.call(this),this.delegate.onError&&this.delegate.onError(this));break;case 2:1e3*e>this.options.HandleShakeResponseTimeout&&(BK.Script.log(1,0,"BK.WebSocket.handlePhaseTimeout!handshake response timeout"),this.prevPhaseTickCount=BK.Time.clock,this.state=-1,this.errcode=4097,this.message="handshake response timeout",t.prototype.close.call(this),this.delegate.onError&&this.delegate.onError(this));break;case 3:1e3*e>this.options.CloseAckTimeout&&(BK.Script.log(1,0,"BK.WebSocket.handlePhaseTimeout!close ack timeout"),this.prevPhaseTickCount=BK.Time.clock,t.prototype.close.call(this),1==this.state?this.peerClosed?this.delegate.onClose&&this.delegate.onClose(this):(this.errcode=1006,this.message="abnormal close",this.delegate.onError&&this.delegate.onError(this),this.startPhaseTimeout(6)):this.delegate.onError&&this.delegate.onError(this));break;case 4:1e3*e>this.options.PingPongTimeout&&(BK.Script.log(1,0,"BK.WebSocket.handlePhaseTimeout!receive pong timeout"),this.prevPhaseTickCount=BK.Time.clock)}}},e.prototype.restartPingPongTimer=function(){4==this.state&&this.options.PingPongInterval>0&&(this.prevPingPongTickCount=BK.Time.clock)},e.prototype.handlePingPongTimer=function(){4==this.state&&this.options.PingPongInterval>0&&1e3*BK.Time.diffTime(this.prevPingPongTickCount,BK.Time.clock)>this.options.PingPongInterval&&(this.inPingFrame=!1,this.txPingData=this.randomN(16),this.sendPingFrame(this.txPingData),this.restartPingPongTimer())},e.prototype.doHandshakePhase=function(){var e="",i=this.query?"?"+this.query:"";e=e.concat("GET "+this.path+i+" HTTP/"+this.httpVer+"\r\n"),e=(e=(e=80==this.port||443==this.port?e.concat("Host: "+this.host+"\r\n"):e.concat("Host: "+this.host+":"+this.port+"\r\n")).concat("Upgrade: websocket\r\n")).concat("Connection: Upgrade\r\n"),e=this.isEnableSSL()?e.concat("Origin: https://"+this.host+"\r\n"):e.concat("Origin: http://"+this.host+"\r\n");var r=this.randomN(16),n=BK.Misc.encodeBase64FromBuffer(r);if(e=e.concat("Sec-WebSocket-Key: "+n+"\r\n"),e=e.concat("Sec-WebSocket-Version: "+this.version+"\r\n"),this.query)for(var o=this.query.split("&"),a=0;a<o.length;a++){var s=o[a].split("=");s.length>0&&(e=e.concat(s[0]+": "+s[1]+"\r\n"))}e=e.concat("\r\n");var h=BK.Misc.sha1(n.concat("258EAFA5-E914-47DA-95CA-C5AB0DC85B11"));this.handshakeSig=BK.Misc.encodeBase64FromBuffer(h);var c=new BK.Buffer(e.length,!1);c.writeAsString(e,!1),0<t.prototype.send.call(this,c)&&(this.state=2,this.startPhaseTimeout(1))},e.prototype.doSvrHandshakePhase1=function(e){var i=this;e&&(this.httpParser.onComplete||(this.httpParser.onComplete=function(){for(var e in i.httpParser.headers);i.doSvrHandshakePhase2()?(i.restartPingPongTimer(),i.startPhaseTimeout(6),i.delegate.onOpen&&i.delegate.onOpen(i)):(i.errcode=4098,i.message="handshake parse error",i.startPhaseTimeout(6),t.prototype.close.call(i),i.delegate.onError&&i.delegate.onError(i))}),this.httpParser.execute(e),2==this.state&&(this.state=3,this.startPhaseTimeout(2)))},e.prototype.doSvrHandshakePhase2=function(){switch(this.httpParser.statusCode){case 101:return void 0==this.httpParser.headers.upgrade?(this.state=-1,BK.Script.log(1,0,"BK.WebSocket.doSvrHandshakePhase2!missing 'upgrade' header"),!1):void 0==this.httpParser.headers.connection?(this.state=-1,BK.Script.log(1,0,"BK.WebSocket.doSvrHandshakePhase2!missing 'connection' header"),!1):"upgrade"!=this.httpParser.headers.connection.toLowerCase()?(this.state=-1,BK.Script.log(1,0,"BK.WebSocket.doSvrHandshakePhase2!error 'connection' header"),!1):void 0==this.httpParser.headers["sec-websocket-accept"]?(this.state=-1,BK.Script.log(1,0,"BK.WebSocket.doSvrHandshakePhase2!missing 'sec-websocket-accept' header"),!1):this.handshakeSig!=this.httpParser.headers["sec-websocket-accept"]?(this.state=-1,BK.Script.log(1,0,"BK.WebSocket.doSvrHandshakePhase2!error 'sec-websocket-accept' header"),!1):(this.state=4,!0)}return!1},e.prototype.doFrameDataPhase=function(t,i,r){void 0===r&&(r=!1);var n=6,o=t.length;this.extensions.length,n+=o;var a=new BK.Buffer(n,!1),s=0,h=!1;switch(this.version){case 13:h=!0,s=128}var c=!0;switch(i){case 1:case 2:r?this.inTxSegFrame?(c=!1,i=0):(c=!1,this.inTxSegFrame=!0):this.inTxSegFrame&&(i=0)}if(c?a.writeUint8Buffer(128|15&i):a.writeUint8Buffer(15&i),o<126?a.writeUint8Buffer(s|127&t.length):o<65536?(a.writeUint8Buffer(126|s),e.isLittleEndian?(a.writeUint8Buffer((65280&o)>>8),a.writeUint8Buffer(255&o)):(a.writeUint8Buffer(255&o),a.writeUint8Buffer((65280&o)>>8))):BK.Script.log(1,0,"BK.WebSocket.doFrameDataPhase!js don't support 64bit data type"),h){var l=this.randomN(4);BK.Misc.encodeBufferXorMask4(t,l),a.writeBuffer(l)}return a.writeBuffer(t),a},e.prototype.doSvrFrameDataPhase=function(t){if(!t)return!0;for(;!t.eof;){switch(this.parseState){case 0:this.mask4.rewind(),this.rxbuf=new BK.Buffer(this.options.DefaultSegmentSize,!0),this.maskBit=0,this.rxbuflen=0,this.isFinalSeg=!1,this.parseState=1;case 1:var i=t.readUint8Buffer();switch(this.isFinalSeg=!!(128&i),this.opcode=15&i,this.version){case 13:switch(this.opcode){case 3:case 4:case 5:case 6:case 7:case 11:case 12:case 13:case 14:case 15:return this.errcode=1002,this.message="protocol error",BK.Script.log(1,0,"BK.WebSocket.doSvrFrameDataPhase!unknown opcode = "+this.opcode),!1}}switch(this.opcode){case 8:case 9:case 10:case 0:break;default:if(!this.isFinalSeg&&1!=this.opcode&&2!=this.opcode)return this.errcode=1003,this.message="unsupported data",BK.Script.log(1,0,"BK.WebSocket.doSvrFrameDataPhase!illegal opcode = "+this.opcode),!1;if(-1==this.rxFrameType)this.rxFrameType=this.opcode;else if(this.rxFrameType!=this.opcode)return this.errcode=1002,this.message="protocol error",BK.Script.log(1,0,"BK.WebSocket.doSvrFrameDataPhase!rxFrameType = "+this.rxFrameType+", illegal opcode = "+this.opcode),!1}if(this.parseState=2,t.eof)return!0;case 2:var r=t.readUint8Buffer();switch(this.maskBit=(128&r)>>7,127&r){case 126:if(this.parseState=3,t.eof)return!0;break;case 127:if(this.parseState=5,t.eof)return!0;break;default:if(this.rxbuflen=127&r,1==this.maskBit?this.parseState=13:this.parseState=17,this.rxbuflen>0&&t.eof)return!0}}switch(this.parseState){case 3:n=t.readUint8Buffer();if(e.isLittleEndian?this.rxbuflen|=(255&n)<<8:this.rxbuflen|=255&n,t.eof)return!0;case 4:var n=t.readUint8Buffer();if(e.isLittleEndian?this.rxbuflen|=255&n:this.rxbuflen|=(255&n)<<8,1==this.maskBit?this.parseState=13:this.parseState=17,this.rxbuflen>0&&t.eof)return!0;break;case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:return this.errcode=1002,this.message="protocol errors",BK.Script.log(1,0,"BK.WebSocket.doSvrFrameDataPhase!js don't support 64bit data type"),!1}switch(this.parseState){case 13:if(this.mask4.writeUint8Buffer(t.readUint8Buffer()),this.parseState=14,t.eof)return!0;case 14:if(this.mask4.writeUint8Buffer(t.readUint8Buffer()),this.parseState=15,t.eof)return!0;case 15:if(this.mask4.writeUint8Buffer(t.readUint8Buffer()),this.parseState=16,t.eof)return!0;case 16:if(this.mask4.writeUint8Buffer(t.readUint8Buffer()),this.parseState=17,t.eof)return!0}if(17==this.parseState){var o=t.length-t.pointer;if(o<=this.rxbuflen-this.rxbuf.length?this.rxbuf.writeBuffer(t.readBuffer(o)):this.rxbuf.writeBuffer(t.readBuffer(this.rxbuflen-this.rxbuf.length)),this.rxbuf.length==this.rxbuflen)if(this.rxSegCount=this.rxSegCount+1,this.parseState=0,this.isFinalSeg)switch(this.rxbuf.rewind(),this.opcode){case 8:BK.Script.log(0,0,"BK.WebSocket.doSvrFrameDataPhase!receive close frame"),this.handleCloseFrame();break;case 9:BK.Script.log(0,0,"BK.WebSocket.doSvrFrameDataPhase!receive ping frame"),this.handlePingFrame();break;case 10:BK.Script.log(0,0,"BK.WebSocket.doSvrFrameDataPhase!receive pong frame"),this.handlePongFrame();break;default:this.rxbufQue.push(this.rxbuf),this.recvFrameFromRxQ(this.rxFrameType),this.rxSegCount=0,this.rxFrameType=-1}else this.rxbuf.rewind(),this.rxbufQue.push(this.rxbuf)}}return!0},e.prototype.handleCloseFrame=function(){if(this.peerClosed=!0,4==this.state){var t=this.rxbuf.readUint16Buffer(),e=this.rxbuf.readBuffer(this.rxbuflen-2);if(t?(this.errcode=t,this.message=e.readAsString()):(this.errcode=1005,this.message="no status recv"),BK.Script.log(1,0,"BK.WebSocket.handleCloseFrame!errcode = "+this.errcode+", msg = "+this.message),this.sendCloseFrame(this.errcode,this.message?this.message:""),BK.Script.log(1,0,"BK.WebSocket.handleCloseFrame! closed by romote peer"),this.close(),this.state=0,this.delegate.onMessage)for(;this.udataQue.length>0;){i=this.udataQue.shift();this.delegate.onMessage(this,i)}this.delegate.onClose&&this.delegate.onClose(this)}else if(1==this.state){if(BK.Script.log(1,0,"BK.WebSocket.handleCloseFrame!normal closed"),this.close(),this.state=0,this.delegate.onMessage)for(;this.udataQue.length>0;){var i=this.udataQue.shift();this.delegate.onMessage(this,i)}this.delegate.onClose&&this.delegate.onClose(this)}},e.prototype.handlePingFrame=function(){if(4==this.state){if(this.rxbuflen>125)return this.errcode=4099,void(this.message="ping packet large");if(this.inPongFrame)return void BK.Script.log(1,0,"BK.WebSocket.handlePingFrame!already recv ping, drop it.");this.rxPongData=new BK.Buffer(this.rxbuflen,!0),this.rxPongData.writeBuffer(this.rxbuf.readBuffer(this.rxbuflen)),this.sendPongFrame(this.rxPongData)}},e.prototype.handlePongFrame=function(){if(4==this.state){var t=new BK.Buffer(this.rxbuflen,!0);t.writeBuffer(this.rxbuf.readBuffer(this.rxbuflen)),this.startPhaseTimeout(6),BK.Script.log(0,0,"BK.WebSocket.handlePongFrame!pong data = "+this.bufferToHexString(t))}},e.prototype.sendFrameFromTxQ=function(e){if(4==this.state&&this.packageSendCheck()){if(this.inPartialTxbuf){if(!((l=t.prototype.send.call(this,this.txbuf))>0))return BK.Script.log(1,l,"BK.WebSocket.sendFrameFromTxQ!partial send failed, data type = "+e),!1;if(this.restartPingPongTimer(),l<this.txbuf.length){var i=this.txbuf.length-l,r=new BK.Buffer(i,!1);return this.txbuf.rewind(),this.txbuf.jumpBytes(l),r.writeBuffer(this.txbuf.readBuffer(i)),this.txbuf=r,!1}this.framePackageCount++,this.inPartialTxbuf=!1}for(var n=!0,o=0;o<this.txMsgQue.length;o++){for(var a=element=this.txMsgQue[o];a.length>0;){var s=a.shift(),h=a.length>0,c=this.doFrameDataPhase(s,e,h),l=t.prototype.send.call(this,c);if(!(l>0)){n=!1,BK.Script.log(1,l,"BK.WebSocket.sendFrameFromTxQ!send failed, data type = "+e);break}if(this.restartPingPongTimer(),l<c.length){c.rewind(),c.jumpBytes(l),this.txbuf.rewind(),this.txbuf.writeBuffer(c.readBuffer(c.length-l)),this.inPartialTxbuf=!0,n=!1,BK.Script.log(1,0,"BK.WebSocket.sendFrameFromTxQ!partial send, total size = "+c.length+", tx size = "+l);break}if(0==a.length&&(this.inTxSegFrame=!1),this.framePackageCount++,!this.packageSendCheck())return}if(0==a.length&&this.txMsgQue.shift(),!n)break;if(!this.packageSendCheck())return}return n&&!this.txMsgQue.length&&this.inTxSegFrame&&(this.inTxSegFrame=!1),n}},e.prototype.recvFrameFromRxQ=function(t){for(var e=2==t,r=new BK.Buffer(128,!0);this.rxbufQue.length>0;){var n=this.rxbufQue.shift();r.writeBuffer(n)}0==e&&r.writeUint8Buffer(0),r.rewind(),this.udataQue.push(new i(r,e))},e.prototype.__sendBinaryFrame=function(t,e){var i=t.length,r=this.options.DefaultSegmentSize,n=0;t.rewind();for(var o=new Array;i>r;){a=new BK.Buffer(r,!1);t.rewind(),t.jumpBytes(n),a.writeBuffer(t.readBuffer(r)),a.rewind(),o.push(a),n+=r,i-=r}if(i>0){var a=new BK.Buffer(i,!1);t.rewind(),t.jumpBytes(n),a.writeBuffer(t.readBuffer(i)),a.rewind(),o.push(a)}return this.txMsgQue.push(o),this.txFrameType=e,this.sendFrameFromTxQ(e)},e.prototype.sendTextFrame=function(t){if(4!=this.state)return!1;var e=new BK.Buffer(128,!0);return e.writeAsString(t,!1),e.rewind(),this.__sendBinaryFrame(e,1)},e.prototype.sendBinaryFrame=function(t){if(4==this.state)return this.__sendBinaryFrame(t,2)},e.prototype.sendCloseFrame=function(i,r){if(!this.isSendClose){this.isSendClose=!0;var n=new BK.Buffer(r.length+1,!1),o=new BK.Buffer(3+r.length,!1);e.isLittleEndian?(o.writeUint8Buffer((65280&i)>>8),o.writeUint8Buffer(255&i)):(o.writeUint8Buffer(255&i),o.writeUint8Buffer((65280&i)>>8)),n.writeAsString(r,!0),o.writeBuffer(n);var a=this.doFrameDataPhase(o,8);0<t.prototype.send.call(this,a)&&(0==this.peerClosed&&(this.state=1,this.startPhaseTimeout(3)),BK.Script.log(1,0,"BK.WebSocket.sendCloseFrame!code = "+i+", reason = "+r))}},e.prototype.sendPingFrame=function(e){if(!this.inPingFrame){BK.Script.log(0,0,"BK.WebSocket.sendPingFrame!ping data = "+this.bufferToHexString(e));var i=this.doFrameDataPhase(e,9);0<t.prototype.send.call(this,i)&&(this.inPingFrame=!0,this.startPhaseTimeout(4))}},e.prototype.sendPongFrame=function(e){if(!this.inPongFrame){var i=this.doFrameDataPhase(e,10);0<t.prototype.send.call(this,i)&&(this.inPongFrame=!0)}},e.prototype.clearState=function(){this.state=0},e.prototype.onErrorEvent=function(e){0!=this.state&&1!=this.state&&(t.prototype.onErrorEvent.call(this,e),this.state=-1,this.errcode=1006,this.message="abnormal closure",this.delegate.onError&&this.delegate.onError(this))},e.prototype.onTimeoutEvent=function(e){t.prototype.onErrorEvent.call(this,e),this.state=0,this.errcode=-1e3,this.message="socket connect timeout",this.delegate.onError&&this.delegate.onError(this)},e.prototype.onDisconnectEvent=function(e){switch(t.prototype.onDisconnectEvent.call(this,e),this.state){case 2:case 3:case 4:this.state=-1,this.errcode=1006,this.message="abnormal closure",this.delegate.onError&&this.delegate.onError(this);break;case 1:this.state=0,this.delegate.onClose&&this.delegate.onClose(this),BK.Script.log(1,0,"BK.WebSocket.onDisconnectEvent!enter closed state")}},e.prototype.onConnectedEvent=function(e){t.prototype.onConnectedEvent.call(this,e),0==this.state&&(this.clear(),this.doHandshakePhase())},e.prototype.phaseBufferCheck=function(t){for(var e=0,i=0;!t.eof;)if(i++,t.readUint8Buffer()=="\r\n\r\n".charCodeAt(e)){if(++e=="\r\n\r\n".length)return i}else e=0;return-1},e.prototype.packageSendCheck=function(){return this.framePackageCount<this.options.DrainSegmentCount},e.prototype.onUpdateEvent=function(e){switch(this.framePackageCount=0,t.prototype.onUpdateEvent.call(this,e),this.state){case 2:case 3:if((o=e.canRecvLength())>0){var i=this.recv(o),r=this.phaseBufferCheck(i);if(i.rewind(),r<i.length){var n=i.readBuffer(r);if(void 0!=n&&this.doSvrHandshakePhase1(n.readAsString(!0)),this.handlePhaseTimeout(),4!=this.state){BK.Script.log(1,0,"BK.Websocket websocket state expected ESTABLISHED!");break}if(BK.Script.log(1,0,"BK.Websocket pointer:"+i.pointer+"length:"+i.length),void 0!=i)for(;!i.eof;)if(!this.doSvrFrameDataPhase(i)){this.sendCloseFrame(this.errcode,this.message?this.message:""),this.delegate.onError&&this.delegate.onError(this);break}if(this.delegate.onMessage)for(;this.udataQue.length>0;){h=this.udataQue.shift();this.delegate.onMessage(this,h)}this.txMsgQue.length>0&&this.sendFrameFromTxQ(this.txFrameType),this.delegate.onSendComplete&&this.delegate.onSendComplete(this),this.inPongFrame=!1,this.handlePhaseTimeout(),this.handlePingPongTimer()}else void 0!=i&&this.doSvrHandshakePhase1(i.readAsString(!0)),this.handlePhaseTimeout()}break;case 4:for(var o=e.canRecvLength();o>0;){var a=o,s=this.recv(o);if(void 0!=s)for(;!s.eof;){if(!this.doSvrFrameDataPhase(s)){this.sendCloseFrame(this.errcode,this.message?this.message:""),this.delegate.onError&&this.delegate.onError(this);break}if(0==this.state)return}if((o=e.canRecvLength())==a)break}if(this.delegate.onMessage)for(;this.udataQue.length>0;){h=this.udataQue.shift();this.delegate.onMessage(this,h)}this.txMsgQue.length>0&&this.sendFrameFromTxQ(this.txFrameType),this.delegate.onSendComplete&&this.delegate.onSendComplete(this),this.inPongFrame=!1,this.handlePhaseTimeout(),this.handlePingPongTimer();break;case 1:if((o=e.canRecvLength())>0&&this.doSvrFrameDataPhase(this.recv(o))&&this.delegate.onMessage)for(;this.udataQue.length>0;){var h=this.udataQue.shift();this.delegate.onMessage(this,h)}this.handlePhaseTimeout()}return 0},e.isLittleEndian=BK.Misc.isLittleEndian(),e}(e),n=function(){function t(t,e){this.data=t,this.isBinary=e}return t}();return function(){function t(t){var e=this;this.__url=t,this.options=null,this.inTrans=!1,this.isPendingConn=!0,this.txdataQ=new Array;var i=BK.URL("{}",t);this.scheme=i.protocol,this.port=i.port,this.path=i.path,this.query=i.query,this.host=i.hostname,BK.DNS.queryIPAddress(i.hostname,function(t,i,n){switch(n=e.ipListFilter(n),t){case 0:BK.Script.log(1,0,"BK.WebSocket.queryIPAddress!iplist = "+JSON.stringify(n)),e.iplist=n,e.__nativeObj=new r(n[0],e.port,e.host,e.path,e.query),BK.Notification.on("game_network_change",e,function(t){this.__nativeObj.close(),this.__nativeObj.delegate.onClose(this.__nativeObj)}.bind(e),!0),"wss"==e.scheme&&e.__nativeObj.enableSSL(!0),e.options&&(e.setOptions(e.options),e.options=null),e.isPendingConn&&(e.connect(),e.isPendingConn=!1),e.__nativeObj.delegate.onOpen=function(t){e.txdataQ.length>0&&e.send(e.txdataQ.shift()),e.onOpen?e.onOpen(e):e.onopen&&e.onopen.call(e)},e.__nativeObj.delegate.onClose=function(t){var i={};i.code=e.getErrorCode(),i.reason=e.getErrorString(),e.onClose?e.onClose(e,i):e.onclose&&e.onclose.call(e,i)},e.__nativeObj.delegate.onError=function(t){var i={};i.code=e.getErrorCode(),i.reason=e.getErrorString(),e.onError?e.onError(e,i):e.onerror&&e.onerror.call(e,i)},e.__nativeObj.delegate.onMessage=function(t,i){if(e.onMessage)e.onMessage(e,i);else if(e.onmessage){if(1==i.isBinary){var r=i.data;r.rewind();for(var n=new ArrayBuffer(r.length),o=new DataView(n);!r.eof;)o.setUint8(r.pointer,r.readUint8Buffer());i.data=n}e.onmessage.call(e,i)}},e.__nativeObj.delegate.onSendComplete=function(t){for(var i=e.txdataQ.length;i>0&&e.__nativeObj.packageSendCheck();i--){var r=e.txdataQ.shift();r.isBinary?e.__sendBinaryFrame(r.data):e.__nativeObj.sendTextFrame(r.data)}}}})}return Object.defineProperty(t.prototype,"url",{get:function(){return this.__url},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"readyState",{get:function(){return this.getReadyState()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bufferedAmount",{get:function(){for(var t=0,e=0;e<this.txdataQ.length;e++)t+=this.txdataQ[e].data.length;return t},enumerable:!0,configurable:!0}),t.prototype.__sendBinaryFrame=function(t){if(Object.prototype.hasOwnProperty.call(t,"__rawBKData"))return this.__nativeObj.sendBinaryFrame(t.__rawBKData);if(t instanceof Int8Array==1||t instanceof Uint8Array==1||t instanceof Int16Array==1||t instanceof Uint16Array==1||t instanceof Int32Array==1||t instanceof Uint32Array==1||t instanceof Float32Array==1){for(var e=new BK.Buffer(t.byteLength),i=new DataView(t.buffer),r=0;r<t.byteLength;r++)e.writeUint8Buffer(i.getUint8(r));return this.__nativeObj.sendBinaryFrame(e)}if(t instanceof ArrayBuffer==1){for(var e=new BK.Buffer(t.byteLength),i=new DataView(t),r=0;r<t.byteLength;r++)e.writeUint8Buffer(i.getUint8(r));return this.__nativeObj.sendBinaryFrame(e)}return this.__nativeObj.sendBinaryFrame(t)},t.prototype.ipListFilter=function(t){var e=new Array;return t.forEach(function(t){for(var i=!1,r=0;r<e.length;r++)if(t==e[r]){i=!0;break}0==i&&e.push(t)}),e},t.prototype.getReadyState=function(){return this.__nativeObj?this.__nativeObj.getReadyState():0},t.prototype.getErrorCode=function(){return this.__nativeObj?this.__nativeObj.getErrorCode():65535},t.prototype.getErrorString=function(){return this.__nativeObj?this.__nativeObj.getErrorString():""},t.prototype.close=function(){4==this.getReadyState()&&this.__nativeObj.sendCloseFrame(1e3,"see ya")},t.prototype.connect=function(){return!this.__nativeObj||0!=this.__nativeObj.connect()},t.prototype.send=function(t){var e=this.getReadyState();if(1==e||0==e)return!1;if("string"==typeof t){if(this.__nativeObj.packageSendCheck()&&4==e)return this.__nativeObj.sendTextFrame(t);this.txdataQ.push(new n(t,!1))}else if("object"==typeof t){if(this.__nativeObj.packageSendCheck()&&4==e)return this.__sendBinaryFrame(t);this.txdataQ.push(new n(t,!0))}return!1},t.prototype.setOptions=function(t){this.__nativeObj?(t.DrainSegmentCount&&(this.__nativeObj.options.DrainSegmentCount=t.DrainSegmentCount),t.DefaultSegmentSize&&(this.__nativeObj.options.DefaultSegmentSize=t.DefaultSegmentSize),t.PingPongInterval&&(this.__nativeObj.options.PingPongInterval=t.PingPongInterval),t.HandleShakeRequestTimeout&&(this.__nativeObj.options.HandleShakeRequestTimeout=t.HandleShakeRequestTimeout),t.HandleShakeResponseTimeout&&(this.__nativeObj.options.HandleShakeResponseTimeout=t.HandleShakeResponseTimeout),t.CloseAckTimeout&&(this.__nativeObj.options.CloseAckTimeout=t.CloseAckTimeout),t.PingPongTimeout&&(this.__nativeObj.options.PingPongTimeout=t.PingPongTimeout)):this.options=t},t}()});var SheetSprite=function(){function t(t,e,i,r,n,o,a){this.size={width:0,height:0},this.flipU=0,this.flipV=1,this.stretchX=1,this.stretchY=1,r&&(this.flipU=r),n&&(this.flipV=n),o&&(this.stretchX=o),a&&(this.stretchY=a),e&&(this.size.width=e),i&&(this.size.height=i),this.textureInfo=t,this.onInit(this.size.width,this.size.height),this.adjustWithTextureInfo(t)}return t.prototype.onInit=function(t,e){this.createSprites(t,e),Object.getOwnPropertyNames(this.__nativeObj).forEach(function(t){var e=t;Object.defineProperty(this,e,{get:function(){return this.__nativeObj[e]},set:function(t){this.__nativeObj[e]=t}})},this),Object.defineProperty(this,"size",{get:function(){return this.__nativeObj.contentSize},set:function(t){this.__nativeObj.contentSize=t,this.updateSize(this.textureInfo)}}),Object.defineProperty(this,"anchor",{get:function(){return this.__nativeObj.localAnchor},set:function(t){this.__nativeObj.localAnchor=t}})},t.prototype.updateSize=function(t){if(1==t.frameInfo.trimmed){var e=t.frameInfo.spriteSourceSize.x,i=t.frameInfo.spriteSourceSize.y,r=t.frameInfo.spriteSourceSize.w,n=t.frameInfo.spriteSourceSize.h,o=t.frameInfo.sourceSize,a=this.__nativeObj.contentSize;e=a.width*e/o.w,i=a.height*i/o.h,r=a.width*r/o.w,n=a.height*n/o.h,this.contentSprite.position={x:e,y:i},this.contentSprite.contentSize={width:r,height:n}}else this.contentSprite.contentSize=this.__nativeObj.contentSize},t.prototype.adjustWithTextureInfo=function(t){if(t){this.textureInfo=t;var e=t.texture,i=t.frameInfo;this.updateSize(t),this.currTexturePath=t.texturePath;e=new BK.Texture(this.currTexturePath);this.contentSprite.setTexture(e),this.contentSprite.adjustTexturePosition(i.frame.x,i.frame.y,i.frame.w,i.frame.h,i.rotated)}},t.prototype.setTexture=function(t){this.__nativeObj.setTexture(t)},t.prototype.dispose=function(){BK.Director.ticker.remove(this),this.__nativeObj.dispose()},t.prototype.removeChild=function(t){return this.__nativeObj.removeChild(t)},t.prototype.removeChildById=function(t,e){return this.__nativeObj.removeChildById(t,e)},t.prototype.removeChildByName=function(t,e){return this.__nativeObj.removeChildByName(t,e)},t.prototype.removeFromParent=function(){return this.__nativeObj.removeFromParent()},t.prototype.addChild=function(t,e){return this.__nativeObj.addChild(t,e)},t.prototype.hittest=function(t){return this.__nativeObj.hittest(t)},t.prototype.convertToWorldSpace=function(t){return this.__nativeObj.convertToWorldSpace(t)},t.prototype.convertToNodeSpace=function(t){return this.__nativeObj.convertToNodeSpace(t)},t.prototype.createSprites=function(t,e){this.__nativeObj=new BK.SpriteNode(t,e,{},this.flipU,this.flipV,this.stretchX,this.stretchY),this.contentSprite=new BK.SpriteNode(t,e,{},this.flipU,this.flipV,this.stretchX,this.stretchY),this.__nativeObj.addChild(this.contentSprite)},t}();BK.SheetSprite||(BK.SheetSprite=SheetSprite);var SpriteSheetCache=function(){function t(){this.sheets={},this.jsonConfigs={}}return t.prototype.getFrameInfoByFilename=function(t){for(var e in this.jsonConfigs)if(this.jsonConfigs.hasOwnProperty(e)){var i=this.jsonConfigs[e],r=(this.sheets[e],i.frames),n=i.meta;this.fullWidth=n.size.w,this.fullHeight=n.size.h;for(var o=0;o<r.length;o++){var a=r[o];if(t==a.filename){var s={x:0,y:1,w:0,h:0},h=a.rotated,c=a.trimmed,l=a.spriteSourceSize,u=a.sourceSize;return h?(s.x=a.frame.x,s.y=this.fullHeight-a.frame.y-a.frame.w,s.w=a.frame.w,s.h=a.frame.h):(s.x=a.frame.x,s.y=this.fullHeight-a.frame.y-a.frame.h,s.w=a.frame.w,s.h=a.frame.h),l.y=u.h-l.y-l.h,{filename:t,frame:s,rotated:h,trimmed:c,spriteSourceSize:l,sourceSize:u}}}}return null},t.prototype.getTexturePathByFilename=function(t){for(var e in this.jsonConfigs)if(this.jsonConfigs.hasOwnProperty(e))for(var i=this.jsonConfigs[e].frames,r=0;r<i.length;r++)if(i[r].filename==t)return e;return null},t.prototype.loadSheet=function(t,e,i,r,n,o,a){var s=BK.FileUtil.readFile(t).readAsString();if(s){var h=JSON.parse(s);void 0===e&&(e=t.replace(/.json$/,".png")),this.jsonConfigs[e]=h,void 0===i&&(i=4),i=4,void 0===r&&(r=1),void 0===n&&(n=1),void 0===o&&(o=1),void 0===a&&(a=1);var c=new BK.Texture(e,i,r,n,o,a);this.sheets[e]=c}else BK.Script.log(0,0,"loadSheet Failed.Please check path")},t.prototype.removeSheet=function(t,e){if(this.jsonConfigs[e])for(var i in this.jsonConfigs)if(this.jsonConfigs.hasOwnProperty(i)){r=this.jsonConfigs[i];i==e&&(delete this.jsonConfigs[e],BK.Script.log(0,0,"Delete jsonConfigs key:"+i+" val:"+r))}if(this.sheets[e])for(var i in this.sheets)if(this.sheets.hasOwnProperty(i)){var r=this.sheets[i];i==e&&(delete this.sheets[e],BK.Script.log(0,0,"Delete sheets key:"+i+" val:"+r))}},t.prototype.getTextureByFilename=function(t){var e=this.getFrameInfoByFilename(t),i=this.getTexturePathByFilename(t);return e&&i?new BK.Texture(i):(BK.Script.log(0,0,"getTexture Failed.Please check path"),null)},t.prototype.getSprite=function(t,e,i){var r=this.getTextureFrameInfoByFileName(t);if(r){var n=r.frameInfo,o=r.texturePath,a=new BK.Texture(o);if(e||(e=n.frame.w),i||(i=n.frame.h),BK.Script.log(0,0,"getSprite texture:"+a+" width:"+e+" height:"+i),n.trimmed)return s=new BK.SheetSprite(r,e,i);var s=new BK.Sprite(e,i,a,0,1,1,1);return s.adjustTexturePosition(n.frame.x,n.frame.y,n.frame.w,n.frame.h,n.rotated),s}return null},t.prototype.createSheetSprite=function(t,e,i){var r=this.getTextureFrameInfoByFileName(t);if(r){var n=r.frameInfo,o=r.texturePath,a=new BK.Texture(o);return e||(e=n.frame.w),i||(i=n.frame.h),BK.Script.log(0,0,"SheetSprite texture:"+a+" width:"+e+" height:"+i),new BK.SheetSprite(r,e,i)}return null},t.prototype.getTextureFrameInfoByFileName=function(t){var e=this.getFrameInfoByFilename(t),i=this.getTexturePathByFilename(t);return e&&i?{frameInfo:e,texturePath:i}:null},t}(),Sprite9=function(){function t(t,e,i,r,n,o){void 0===n&&(n={x:0,y:0}),this._size={width:0,height:0},this.__nativeObj=new BK.Node,this.onInit(),this._grid=r,this._size={width:e,height:e},this._leftTop=new BK.Sprite(r.left,r.top,i,0,1,1,1),this._leftTop.position={x:0,y:e-r.top},this._leftTop.zOrder=99999,this._leftTop.name="_leftTop",this.__nativeObj.addChild(this._leftTop),this._centerTop=new BK.Sprite(t-r.left-r.right,r.top,i,0,1,1,1),this._centerTop.position={x:r.left,y:e-r.top},this._centerTop.zOrder=99999,this._centerTop.name="_centerTop",this.__nativeObj.addChild(this._centerTop),this._rightTop=new BK.Sprite(r.right,r.top,i,0,1,1,1),this._rightTop.position={x:t-r.right,y:e-r.top},this._rightTop.zOrder=99999,this._rightTop.name="_rightTop",this.__nativeObj.addChild(this._rightTop),this._leftCenter=new BK.Sprite(r.left,e-r.top-r.bottom,i,0,1,1,1),this._leftCenter.position={x:0,y:r.bottom},this._leftCenter.name="_leftCenter",this.__nativeObj.addChild(this._leftCenter),this._centerCenter=new BK.Sprite(t-r.left-r.right,e-r.top-r.bottom,i,0,1,1,1),this._centerCenter.position={x:r.left,y:r.bottom},this._centerCenter.name="_centerCenter",this.__nativeObj.addChild(this._centerCenter),this._rightCenter=new BK.Sprite(r.right,e-r.bottom-r.top,i,0,1,1,1),this._rightCenter.position={x:t-r.right,y:r.bottom},this._rightCenter.name="_rightCenter",this.__nativeObj.addChild(this._rightCenter),this._leftBottom=new BK.Sprite(r.left,r.bottom,i,0,1,1,1),this._leftBottom.position={x:0,y:0},this._leftBottom.name="_leftBottom",this.__nativeObj.addChild(this._leftBottom),this._centerBottom=new BK.Sprite(t-r.left-r.right,r.bottom,i,0,1,1,1),this._centerBottom.position={x:r.left,y:0},this._centerBottom.name="_centerBottom",this.__nativeObj.addChild(this._centerBottom),this._rightBottom=new BK.Sprite(r.right,r.bottom,i,0,1,1,1),this._rightBottom.position={x:t-r.right,y:0},this._rightBottom.name="_rightBottom",this.__nativeObj.addChild(this._rightBottom),1==o?(this._leftTop.adjustTexturePosition(n.x+(e-r.top),n.y+(t-r.left),r.left,r.top,o),this._centerTop.adjustTexturePosition(n.x+(e-r.top),n.y+r.right,t-r.left-r.right,r.top,o),this._rightTop.adjustTexturePosition(n.x+(e-r.top),n.y,r.right,r.top,o),this._leftCenter.adjustTexturePosition(n.x+r.bottom,n.y+(t-r.left),r.left,e-r.top-r.bottom,o),this._centerCenter.adjustTexturePosition(n.x+r.bottom,n.y+r.right,t-r.left-r.right,e-r.top-r.bottom,o),this._rightCenter.adjustTexturePosition(n.x+r.bottom,n.y,r.right,e-r.bottom-r.top,o),this._leftBottom.adjustTexturePosition(n.x,n.y+(t-r.left),r.left,r.bottom,o),this._centerBottom.adjustTexturePosition(n.x,n.y+r.right,t-r.left-r.right,r.bottom,o),this._rightBottom.adjustTexturePosition(n.x,n.y,r.right,r.bottom,o)):(this._leftTop.adjustTexturePosition(0+n.x,e-r.top+n.y,r.left,r.top),this._centerTop.adjustTexturePosition(r.left+n.x,e-r.top+n.y,t-r.left-r.right,r.top),this._rightTop.adjustTexturePosition(t-r.right+n.x,e-r.top+n.y,r.right,r.top),this._leftCenter.adjustTexturePosition(0+n.x,r.bottom+n.y,r.left,e-r.top-r.bottom),this._centerCenter.adjustTexturePosition(r.left+n.x,r.bottom+n.y,t-r.left-r.right,e-r.top-r.bottom),this._rightCenter.adjustTexturePosition(t-r.right+n.x,r.bottom+n.y,r.right,e-r.bottom-r.top),this._leftBottom.adjustTexturePosition(0+n.x,0+n.y,r.left,r.bottom),this._centerBottom.adjustTexturePosition(r.left+n.x,0+n.y,t-r.left-r.right,r.bottom),this._rightBottom.adjustTexturePosition(t-r.right+n.x,0+n.y,r.right,r.bottom))}return t.prototype.onInit=function(){Object.getOwnPropertyNames(this.__nativeObj).forEach(function(t){var e=t;"size"!=e&&Object.defineProperty(this,e,{get:function(){return this.__nativeObj[e]},set:function(t){this.__nativeObj[e]=t}})},this)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this._rightBottom.vertexColor.a},set:function(t){this._leftTop.vertexColor={r:1,g:1,b:1,a:t},this._centerTop.vertexColor={r:1,g:1,b:1,a:t},this._rightTop.vertexColor={r:1,g:1,b:1,a:t},this._leftCenter.vertexColor={r:1,g:1,b:1,a:t},this._centerCenter.vertexColor={r:1,g:1,b:1,a:t},this._rightCenter.vertexColor={r:1,g:1,b:1,a:t},this._leftBottom.vertexColor={r:1,g:1,b:1,a:t},this._centerBottom.vertexColor={r:1,g:1,b:1,a:t},this._rightBottom.vertexColor={r:1,g:1,b:1,a:t}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._size},set:function(t){this._size=t;var e=t.width-this._grid.left-this._grid.right,i=t.height-this._grid.top-this._grid.bottom;this._leftTop.position={x:0,y:t.height-this._grid.top},this._leftCenter.size={width:this._grid.left,height:i},this._leftCenter.position={x:0,y:this._grid.bottom},this._rightCenter.size={width:this._grid.right,height:i},this._rightCenter.position={x:t.width-this._grid.right,y:this._grid.bottom},this._centerCenter.size={width:e,height:i},this._centerTop.size={width:e,height:this._grid.top},this._centerTop.position={x:this._grid.left,y:t.height-this._grid.top},this._centerBottom.size={width:e,height:this._grid.bottom},this._centerBottom.position={x:this._grid.left,y:0},this._rightCenter.size={width:this._grid.right,height:i},this._rightCenter.position={x:t.width-this._grid.right,y:this._grid.bottom},this._rightBottom.position={x:t.width-this._grid.right,y:0},this._rightTop.position={x:t.width-this._grid.right,y:t.height-this._grid.top}},enumerable:!0,configurable:!0}),t.prototype.pos=function(t,e){this.__nativeObj.position={x:t,y:e}},t.prototype.dispose=function(){this.__nativeObj.dispose()},t.prototype.attachBody=function(t){this.__nativeObj.attachComponent(t)},t.prototype.addChild=function(t){this.__nativeObj.addChild(t)},t.prototype.removeChildById=function(t,e){return this.__nativeObj.removeChildById(t,e)},t.prototype.removeChildByName=function(t,e){return this.__nativeObj.removeChildByName(t,e)},t.prototype.removeFromParent=function(){return this.__nativeObj.removeFromParent()},t.prototype.hittest=function(t){return this.__nativeObj.hittest(t)},t}();BK.SpriteSheetCache||(BK.SpriteSheetCache=new SpriteSheetCache),BK.Sprite9||(BK.Sprite9=Sprite9),function(t,e){"object"==typeof t&&("object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.AnimatedSprite=e())}(BK,function(){return function(){function t(t){this.paused=!1,this.delayUnits=1/30,this.tmpPlayingIdx=0,this.previousTs=-1,this.playedCount=0,this.size={width:0,height:0},this.readyTextureInfo(t),this.onInit(this.size.width,this.size.height),this.displayFrame(0),this.paused=!0,BK.Director.ticker.add(function(t,e,i){i.update(t,e)},this)}return t.prototype.onInit=function(t,e){this.createSprites(t,e),Object.getOwnPropertyNames(this.__nativeObj).forEach(function(t){var e=t;Object.defineProperty(this,e,{get:function(){return this.__nativeObj[e]},set:function(t){this.__nativeObj[e]=t}})},this),Object.defineProperty(this,"size",{get:function(){return this.__nativeObj.contentSize},set:function(t){this.__nativeObj.contentSize=t,this.displayFrame(this.currDisplayIdx)}}),Object.defineProperty(this,"anchor",{get:function(){return this.__nativeObj.localAnchor},set:function(t){this.__nativeObj.localAnchor=t,this.displayFrame(this.currDisplayIdx)}})},t.prototype.setTexture=function(t){this.__nativeObj.setTexture(t)},t.prototype.dispose=function(){BK.Director.ticker.remove(this),this.__nativeObj.dispose()},t.prototype.removeChild=function(t){return this.__nativeObj.removeChild(t)},t.prototype.removeChildById=function(t,e){return this.__nativeObj.removeChildById(t,e)},t.prototype.removeChildByName=function(t,e){return this.__nativeObj.removeChildByName(t,e)},t.prototype.removeFromParent=function(){return this.__nativeObj.removeFromParent()},t.prototype.addChild=function(t,e){return this.__nativeObj.addChild(t,e)},t.prototype.hittest=function(t){return this.__nativeObj.hittest(t)},t.prototype.convertToWorldSpace=function(t){return this.__nativeObj.convertToWorldSpace(t)},t.prototype.convertToNodeSpace=function(t){return this.__nativeObj.convertToNodeSpace(t)},t.prototype.createSprites=function(t,e){this.__nativeObj=new BK.SpriteNode(t,e,{},0,1,1,1),this.contentSprite=new BK.SpriteNode(t,e,{},0,1,1,1),this.__nativeObj.addChild(this.contentSprite)},t.prototype.readyTextureInfo=function(t){var e=this;this.textureInfoArr=[],t.forEach(function(t){t.texturePath&&(t.texture=new BK.Texture(t.texturePath),e.textureInfoArr.push(t),e.size={width:t.frameInfo.sourceSize.w,height:t.frameInfo.sourceSize.h})})},t.prototype.displayFrame=function(t){if(this.textureInfoArr.length>0){var e=this.textureInfoArr[t];if(e){this.currDisplayIdx=t;var i=e.texture,r=e.frameInfo;if(1==e.frameInfo.trimmed){var n=e.frameInfo.spriteSourceSize.x,o=e.frameInfo.spriteSourceSize.y,a=e.frameInfo.spriteSourceSize.w,s=e.frameInfo.spriteSourceSize.h,h=e.frameInfo.sourceSize,c=this.__nativeObj.contentSize;n=c.width*n/h.w,o=c.height*o/h.h,a=c.width*a/h.w,s=c.height*s/h.h,this.contentSprite.position={x:n,y:o},this.contentSprite.contentSize={width:a,height:s}}else this.contentSprite.contentSize=this.__nativeObj.contentSize;this.currTexturePath&&this.currTexturePath==e.texturePath||(BK.Script.log(1,-1,"this.currTexture != tex"),this.currTexturePath=e.texturePath,this.contentSprite.setTexture(i)),this.contentSprite.adjustTexturePosition(r.frame.x,r.frame.y,r.frame.w,r.frame.h,r.rotated)}else BK.Script.log(1,-1,"displayFrame failed! textureInfo is null. index is "+t)}else BK.Script.log(1,-1,"displayFrame failed! textureInfoArr.length is 0")},t.prototype.render=function(){this.tmpPlayingIdx>this.textureInfoArr.length-1&&(this.tmpPlayingIdx=0),this.displayFrame(this.tmpPlayingIdx),this.tmpPlayingIdx++,this.currDisplaySum++,this.updateCallback()},t.prototype.update=function(t,e){0==this.paused&&(this.previousTs<0?(this.previousTs=t,this.render()):t-this.previousTs>1e3*this.delayUnits&&(this.previousTs=t,this.render()))},t.prototype.play=function(t,e){void 0===t&&(t=0),void 0===e&&(e=-1),t>this.textureInfoArr.length-1?this.tmpPlayingIdx=0:this.tmpPlayingIdx=t,this.paused=!1,this.repeatCount=e,this.currDisplaySum=0,this.playedCount=0},t.prototype.stop=function(t){void 0===t&&(t=-1),this.paused=!0,t>-1&&this.displayFrame(t)},t.prototype.updateCallback=function(){var t=this.textureInfoArr.length;this.currDisplaySum%t==0&&(this.playedCount=parseInt(String(this.currDisplaySum/t)),this.completeCallback&&this.completeCallback(this,this.playedCount),this.repeatCount>0&&this.repeatCount<=this.playedCount&&(this.endCallback&&this.endCallback(this,this.playedCount),this.stop()))},t.prototype.setCompleteCallback=function(t){this.completeCallback=t},t.prototype.setEndCallback=function(t){this.endCallback=t},t}()}),Canvas.prototype.setImagePath=function(t){if(t){this.imagePath=t;var e=new BK.Texture(t);this.__nativeObj.setTexture(e)}},Canvas.prototype.getImagePath=function(){return this.imagePath},Canvas.prototype.setTexture=function(t){this.__nativeObj.setTexture(t)},Canvas.prototype.setFlipXY=function(t,e){this.__nativeObj.setUVFlip(t,e)},Canvas.prototype.setUVFlip=function(t,e){this.__nativeObj.setUVFlip(t,e)},Canvas.prototype.setUVWrap=function(t,e){this.__nativeObj.setUVWrap(t,e)},Canvas.prototype.setXYStretch=function(t,e){this.__nativeObj.setXYStretch(t,e)},Canvas.prototype.adjustTexturePosition=function(t,e,i,r,n){this.__nativeObj.adjustTexturePosition(t,e,i,r,n)},Canvas.prototype.addChild=function(t){return this.__nativeObj.addChild(t)},Canvas.prototype.dispose=function(){return this.__nativeObj.dispose()},Canvas.prototype.removeChild=function(t){return this.__nativeObj.removeChild(t)},Canvas.prototype.removeChildById=function(t){return this.__nativeObj.removeChildById(t)},Canvas.prototype.removeChildByName=function(t){return this.__nativeObj.removeChildByName(t)},Canvas.prototype.removeChildByTag=function(t){return this.__nativeObj.removeChildByTag(t)},Canvas.prototype.queryChildAtIndex=function(t){return this.__nativeObj.queryChildAtIndex(t)},Canvas.prototype.queryChildById=function(t){return this.__nativeObj.queryChildById(t)},Canvas.prototype.queryChildByName=function(t){return this.__nativeObj.queryChildByName(t)},Canvas.prototype.queryChildByTag=function(t){return this.__nativeObj.queryChildByTag(t)},Canvas.prototype.getChildCount=function(){return this.__nativeObj.getChildCount()},Canvas.prototype.removeFromParent=function(){return this.__nativeObj.removeFromParent()},Canvas.prototype.attachComponent=function(t){return this.__nativeObj.attachComponent(t)},Canvas.prototype.detachComponent=function(t){return this.__nativeObj.detachComponent(t)},Canvas.prototype.queryComponent=function(t){return this.__nativeObj.queryComponent(t)},Canvas.prototype.queryComponentList=function(t){return this.__nativeObj.queryComponentList(t)},Canvas.prototype.hittest=function(t){return this.__nativeObj.hittest(t)},Canvas.prototype.isEqual=function(t){return this.__nativeObj.isEqual(t)},Canvas.prototype.convertToWorldSpace=function(t){return this.__nativeObj.convertToWorldSpace(t)},Canvas.prototype.convertToNodeSpace=function(t){return this.__nativeObj.convertToNodeSpace(t)},Canvas.prototype.setAtlas=function(t,e){if(this.__nativeObj){BK.CanvasSheetCache.loadSheet(t);var i=BK.CanvasSheetCache.getTexturePathByFilename(e),r=new BK.Texture(i);this.__nativeObj.setTexture(r);var n=BK.CanvasSheetCache.getFrameInfoByFilename(e);this.__nativeObj.adjustTexturePosition(n.frame.x,n.frame.y,n.frame.w,n.frame.h,n.rotated)}return 0},Canvas.prototype.useH5Mode=function(){return this.__nativeObj?(this._useH5Mode=1,1==arguments.length?(this._useH5Mode=arguments[0],this.__nativeObj.useH5Mode(arguments[0])):this.__nativeObj.useH5Mode()):0},Canvas.prototype.drawCircle=function(){return this.__nativeObj?this.__nativeObj.drawCircle(arguments[0],arguments[1],arguments[2]):0},Canvas.prototype.drawEllipse=function(){return this.__nativeObj?this.__nativeObj.drawEllipse(arguments[0],arguments[1],arguments[2],arguments[3]):0},Canvas.prototype.drawImage=function(){if(this.__nativeObj){var t=arguments.length;if(9==t)this.__nativeObj.drawImage(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8]);else if(5==t)this.__nativeObj.drawImage(arguments[0],0,0,0,0,arguments[1],arguments[2],arguments[3],arguments[4]);else{if(3!=t)return;this.__nativeObj.drawImage(arguments[0],0,0,0,0,arguments[1],arguments[2],0,0)}this._innerSetTransform()}return 0},Canvas.prototype.fill=function(){return this.__nativeObj?this.__nativeObj.fill():0},Canvas.prototype.stroke=function(){return this.__nativeObj?this.__nativeObj.stroke():0},Canvas.prototype.rect=function(){return this.__nativeObj?this.__nativeObj.rect(arguments[0],arguments[1],arguments[2],arguments[3]):0},Canvas.prototype.fillRect=function(){return this.__nativeObj?this.__nativeObj.fillRect(arguments[0],arguments[1],arguments[2],arguments[3]):0},Canvas.prototype.strokeRect=function(){return this.__nativeObj?this.__nativeObj.strokeRect(arguments[0],arguments[1],arguments[2],arguments[3]):0},Canvas.prototype.clearRect=function(){return this.__nativeObj?this.__nativeObj.clearRect(arguments[0],arguments[1],arguments[2],arguments[3]):0},Canvas.prototype.beginPath=function(){return this.__nativeObj?this.__nativeObj.beginPath():0},Canvas.prototype.closePath=function(){return this.__nativeObj?this.__nativeObj.closePath():0},Canvas.prototype.moveTo=function(){return this.__nativeObj?this.__nativeObj.moveTo(arguments[0],arguments[1]):0},Canvas.prototype.lineTo=function(){return this.__nativeObj?this.__nativeObj.lineTo(arguments[0],arguments[1]):0},Canvas.prototype.arcTo=function(){return this.__nativeObj?this.__nativeObj.arcTo(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]):0},Canvas.prototype.arc=function(){if(this.__nativeObj){var t=arguments.length;if(5==t)return this.__nativeObj.arc(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]);if(6==t)return this.__nativeObj.arc(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])}return 0},Canvas.prototype.quadraticCurveTo=function(){return this.__nativeObj?this.__nativeObj.quadraticCurveTo(arguments[0],arguments[1],arguments[2],arguments[3]):0},Canvas.prototype.bezierCurveTo=function(){return this.__nativeObj?this.__nativeObj.bezierCurveTo(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]):0},Canvas.prototype.save=function(){return this.__nativeObj?this.__nativeObj.save():0},Canvas.prototype.restore=function(){return this.__nativeObj?this.__nativeObj.restore():0},Canvas.prototype.fillText=function(){if(3==arguments.length){var t=this.measureText(arguments[0],2048,1024),e=arguments[1],i=arguments[2];switch(1==this._useH5Mode?2-this._textBaseLine:this._textBaseLine){case 1:i-=.5*t.height;break;case 2:i-=1*t.height}switch(this._textAlign){case 1:e-=.5*t.width;break;case 2:e-=1*t.width}this.__nativeObj.fillText(arguments[0],e,i,Math.min(2048,t.width),Math.min(1024,t.height)),this._innerSetTransform()}return 0},Canvas.prototype.clip=function(){return this.__nativeObj?this.__nativeObj.clip():0},Canvas.prototype.isPointInPath=function(){if(this.__nativeObj)return this.__nativeObj.isPointInPath(arguments[0],arguments[1])},Canvas.prototype.createImageData=function(){var t=arguments.length;if(this.__nativeObj&&2==t){var e=new BK.Buffer(arguments[0]*arguments[1]*4);return e.__inner_image_width=arguments[0],e.__inner_image_height=arguments[1],e}},Canvas.prototype.getImageData=function(){var t=arguments.length;if(this.__nativeObj&&4==t){var e=this.__nativeObj.getImageData(arguments[0],arguments[1],arguments[2],arguments[3]);return e.__inner_image_width=arguments[2],e.__inner_image_height=arguments[3],e}},Canvas.prototype.putImageData=function(){var t=arguments.length;if(this.__nativeObj&&3==t){var e=arguments[0],i=arguments[1],r=arguments[2],n=e.__inner_image_width,o=e.__inner_image_height;return this.__nativeObj.putImageData(arguments[0],i,r,n,o)}},Canvas.prototype.scale=function(){if(this.__nativeObj)return BK.Script.log(0,0,"bk.canvas. scale :"+arguments[0]+" , "+arguments[1]),this.__nativeObj.scales(arguments[0],arguments[1])},Canvas.prototype.scales=function(){if(this.__nativeObj)return BK.Script.log(0,0,"bk.canvas. scales :"+arguments[0]+" , "+arguments[1]),this.__nativeObj.scales(arguments[0],arguments[1])},Canvas.prototype.rotate=function(){if(this.__nativeObj)return BK.Script.log(0,0,"bk.canvas. rotate :"+arguments[0]),this.__nativeObj.rotate(arguments[0])},Canvas.prototype.translate=function(){if(this.__nativeObj){var t=GameStatusInfo.QQVer.split(".");7==Number(t[0])&&Number(7==t[1]&&Number(t[2])<=5)?(this._tx=arguments[0],this._ty=arguments[1],this._innerSetTransform()):this.__nativeObj.translate(arguments[0],arguments[1])}},Canvas.prototype.transform=function(){if(this.__nativeObj)return this.__nativeObj.transforms(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},Canvas.prototype.transforms=function(){return this.setTransform(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},Canvas.prototype.setTransform=function(){if(this.__nativeObj){var t=GameStatusInfo.QQVer.split(".");if(Number(t[0])<7||7==Number(t[0])&&Number(t[1])<7){if("ios"==GameStatusInfo.platform){var e=inverseMatrix(this._a,this._b,this._c,this._d,this._tx,this._ty);this.__nativeObj.transforms(e[0],e[1],e[2],e[3],e[4],e[5])}return this._a=arguments[0],this._b=arguments[1],this._c=arguments[2],this._d=arguments[3],this._tx=arguments[4],this._ty=arguments[5],this.__nativeObj.transforms(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])}return this._a=arguments[0],this._b=arguments[1],this._c=arguments[2],this._d=arguments[3],this._tx=arguments[4],this._ty=arguments[5],this.__nativeObj.setTransform(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])}},Canvas.prototype._innerSetTransform=function(){if(this.__nativeObj){var t=GameStatusInfo.QQVer.split(".");if(7==Number(t[0])&&Number(7==t[1]&&Number(t[2])<=5))return this.__nativeObj.setTransform(this._a,this._b,this._c,this._d,this._tx,this._ty)}},Canvas.prototype.shadowColor=function(){if(this._shadowColor=arguments[0],this.__nativeObj)return this.__nativeObj.setTextShadow(this._shadowOffset.x,this._shadowOffset.y,this._shadowRadius,this._shadowColor)},Canvas.prototype.shadowRadius=function(){if(this._shadowRadius=arguments[0],this.__nativeObj)return this.__nativeObj.setTextShadow(this._shadowOffset.x,this._shadowOffset.y,this._shadowRadius,this._shadowColor)},Canvas.prototype.shadowOffsetX=function(){if(this._shadowOffset.x=arguments[0],this.__nativeObj)return this.__nativeObj.setTextShadow(this._shadowOffset.x,this._shadowOffset.y,this._shadowRadius,this._shadowColor)},Canvas.prototype.shadowOffsetY=function(){if(this._shadowOffset.y=arguments[0],this.__nativeObj)return this.__nativeObj.setTextShadow(this._shadowOffset.x,this._shadowOffset.y,this._shadowRadius,this._shadowColor)},Canvas.prototype.clear=function(){if(this.__nativeObj)return this.__nativeObj.clear()},Canvas.prototype.getTexture=function(){return this.__nativeObj?this.__nativeObj.getTexture():null},Canvas.prototype.drawText=function(){return this.__nativeObj&&(this.__nativeObj.drawText(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]),this._innerSetTransform()),null},Canvas.prototype.setTextSize=function(){return this.__nativeObj?this.__nativeObj.setTextSize(arguments[0]):null},Canvas.prototype.setTextAlign=function(){if(this.__nativeObj){switch(arguments[0]){case 0:case 1:case 2:this._textAlign=arguments[0];break;case"left":this._textAlign=0;break;case"center":this._textAlign=1;break;case"right":this._textAlign=2}return this.__nativeObj.setTextAlign(this._textAlign)}return null},Canvas.prototype.setTextBold=function(){return this.__nativeObj?this.__nativeObj.setTextBold(arguments[0]):null},Canvas.prototype.setTextItalic=function(){return this.__nativeObj?this.__nativeObj.setTextItalic(arguments[0]):null},Canvas.prototype.measureText=function(){return this.__nativeObj?this.__nativeObj.measureText(arguments[0],arguments[1],arguments[2]):null},Canvas.prototype.updateCanvasTexture=function(){return this.__nativeObj?this.__nativeObj.updateCanvasTexture():null},Canvas.prototype.saveTo=function(){var t=arguments.length;return this.__nativeObj&&1==t&&this.__nativeObj.saveTo(arguments[0]),null},Canvas.prototype.toDataUrl=function(){if(this.__nativeObj){var t="GameSandBox://cmdataUrltest.png";this.__nativeObj.saveTo(t);var e=BK.FileUtil.readFile(t);BK.FileUtil.deleteFile(t);var i=BK.Misc.encodeBase64FromBuffer(e);return i&&(i="data:image/png;base64,"+i),i}return""},BK.Canvas=Canvas,BK.Script.log(0,0,"Load Canvas.js succeed."),BK.Sprite.__proto__.setImagePath=function(t){if(t){this.imagePath=t;var e=new BK.Texture(t);this.setTexture(e)}},BK.Sprite.__proto__.getImagePath=function(){return this.imagePath},BK.Sprite.__proto__.setAtlas=function(t,e){BK.SpriteSheetCache.loadSheet(t);var i=BK.SpriteSheetCache.getTexturePathByFilename(e),r=new BK.Texture(i);this.setTexture(r);var n=BK.SpriteSheetCache.getFrameInfoByFilename(e);return this.adjustTexturePosition(n.frame.x,n.frame.y,n.frame.w,n.frame.h,n.rotated),0},BK.Script.log(0,0,"Load Sprite.js succeed.");var gl;BK.ScreenShot=function(){function t(){if(void 0==o){"android"==GameStatusInfo.platform&&(o=!0);var t=BK.Director.queryDeviceInfo(),e=t.version.split(".");"ios"==t.platform&&Number(e[0])>=10||"android"==t.platform?o=!0:(BK.Script.log(1,0,"Current Device dont supoort TypedArray.[info = "+JSON.stringify(t)+"]"),o=!1)}return o}function e(e){if(Object.prototype.hasOwnProperty.call(e,"__rawBKData"))return e.__rawBKData;if(Object.prototype.hasOwnProperty.call(e,"__nativeObj"))return e.__nativeObj;if(0==t()){if(e instanceof Uint16Array==1){for(var i=new BK.Buffer(e.byteLength,!1),r=0;r<e.length;r++)i.writeUint16Buffer(e[r]);return i}if(e instanceof Float32Array==1){for(var i=new BK.Buffer(e.byteLength,!1),r=0;r<e.length;r++)i.writeFloatBuffer(e[r]);return i}}return e}function i(){var t=gl.glCreateShader(gl.VERTEX_SHADER);0!=t&&(gl.glShaderSource(t,"attribute vec2 pos; attribute vec2 inUVs; varying lowp vec2 outUVs; void main() { gl_Position = vec4(pos, 0, 1); outUVs = inUVs; }"),gl.glCompileShader(t));var e=gl.glCreateShader(gl.FRAGMENT_SHADER);0!=e&&(gl.glShaderSource(e,"varying lowp vec2 outUVs; uniform sampler2D uSampler; void main() { gl_FragColor = texture2D(uSampler, outUVs); }"),gl.glCompileShader(e));var i=gl.glCreateProgram();return gl.glAttachShader(i,t),gl.glAttachShader(i,e),gl.glLinkProgram(i),gl.glDeleteShader(t),gl.glDeleteShader(e),i}function r(t,e){gl.glActiveTexture(gl.TEXTURE1);var i=gl.glCreateTexture(),r=gl.glGetParameterInt(gl.TEXTURE_BINDING_2D,1);gl.glBindTexture(gl.TEXTURE_2D,i),gl.glTexParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR),gl.glTexParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR),gl.glTexParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE),gl.glTexParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE),gl.glTexImage2D(gl.TEXTURE_2D,0,gl.RGBA,t,e,0,gl.RGBA,gl.UNSIGNED_BYTE,null);var n=gl.glCreateFramebuffer();gl.glBindFramebuffer(gl.FRAMEBUFFER,n),gl.glFramebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,i,0);var o=gl.glCheckFramebufferStatus(gl.FRAMEBUFFER);return o!=gl.FRAMEBUFFER_COMPLETE&&BK.Script.log(1,-1,"_createFramebuffer!failed, status = "+o),gl.glActiveTexture(gl.TEXTURE1),gl.glBindTexture(gl.TEXTURE_2D,r),{tex:i,fbo:n}}function n(t){var n=i();gl.glUseProgram(n);var o=gl.glGetAttribLocation(n,"pos"),a=gl.glGetAttribLocation(n,"inUVs"),s=gl.glGetUniformLocation(n,"uSampler");gl.glActiveTexture(gl.TEXTURE0);var h=gl.glCreateTexture(),c=gl.glGetParameterInt(gl.TEXTURE_BINDING_2D,1);gl.glBindTexture(gl.TEXTURE_2D,h),gl.glTexParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR),gl.glTexParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR),gl.glTexParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE),gl.glTexParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE),gl.glTexImage2D(gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,t),gl.glUniform1i(s,0);var l=gl.glGetParameterInt(gl.ARRAY_BUFFER_BINDING,1),u=gl.glGetParameterInt(gl.ELEMENT_ARRAY_BUFFER_BINDING,1),d=new Float32Array([-1,-1,0,1,1,-1,1,1,1,1,1,0,-1,1,0,0]),_=gl.glCreateBuffer();gl.glBindBuffer(gl.ARRAY_BUFFER,_),gl.glEnableVertexAttribArray(o),gl.glVertexAttribPointer(o,2,gl.FLOAT,!1,16,0),gl.glVertexAttribPointer(a,2,gl.FLOAT,!1,16,8),gl.glBufferData(gl.ARRAY_BUFFER,e(d),gl.STATIC_DRAW);var f=new Uint16Array([0,1,2,0,2,3]),g=gl.glCreateBuffer();gl.glBindBuffer(gl.ELEMENT_ARRAY_BUFFER,g),gl.glBufferData(gl.ELEMENT_ARRAY_BUFFER,e(f),gl.STATIC_DRAW);var p=new BK.Buffer(t.width*t.height*4),m=gl.glGetParameterInt(gl.FRAMEBUFFER_BINDING,1),v=r(t.width,t.height);gl.glClearColor(1,1,1,1),gl.glClear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT|gl.STENCIL_BUFFER_BIT),gl.glDrawElements(gl.TRIANGLES,6,gl.UNSIGNED_SHORT,0),gl.glReadPixels(0,0,t.width,t.height,gl.RGBA,gl.UNSIGNED_BYTE,p),gl.glBindFramebuffer(gl.FRAMEBUFFER,m);for(var S=0,b=1;b<=10;b++){gl.glUseProgram(b);var B=gl.glGetAttribLocation(b,"Position"),T=gl.glGetAttribLocation(b,"SourceColor"),y=gl.glGetAttribLocation(b,"TexCoordIn");if(-1!=B&&-1!=T&&-1!=y){S=1;break}}return gl.glBindBuffer(gl.ARRAY_BUFFER,l),1==S?(gl.glEnableVertexAttribArray(B),gl.glEnableVertexAttribArray(T),gl.glEnableVertexAttribArray(y),gl.glVertexAttribPointer(B,3,gl.FLOAT,!1,36,0),gl.glVertexAttribPointer(T,4,gl.FLOAT,!1,36,12),gl.glVertexAttribPointer(y,2,gl.FLOAT,!1,36,28)):(gl.glEnableVertexAttribArray(0),gl.glEnableVertexAttribArray(1),gl.glEnableVertexAttribArray(2),gl.glVertexAttribPointer(0,3,gl.FLOAT,!1,36,0),gl.glVertexAttribPointer(1,4,gl.FLOAT,!1,36,12),gl.glVertexAttribPointer(2,2,gl.FLOAT,!1,36,28)),gl.glBindBuffer(gl.ELEMENT_ARRAY_BUFFER,u),gl.glActiveTexture(gl.TEXTURE0),gl.glBindTexture(gl.TEXTURE_2D,c),gl.glDeleteProgram(n),gl.glDeleteTexture(h),gl.glDeleteTexture(v.tex),gl.glDeleteFramebuffer(v.fbo),p}if(this.origin={x:0,y:0},this.size={width:0,height:0},GameStatusInfo){BK.Misc.compQQVersion||(BK.Misc.compQQVersion=function(t,e){for(var i=t.split("."),r=e.split("."),n=Math.min(3,Math.min(i.length,r.length)),o=0;o<n;o++)if(i[o]!=r[o])return i[o]<r[o];return!0});var o;gl||(gl=new BK.WebGL,function(){gl.DEPTH_BUFFER_BIT=256,gl.STENCIL_BUFFER_BIT=1024,gl.COLOR_BUFFER_BIT=16384,gl.TRIANGLES=4,gl.TEXTURE_BINDING_2D=32873,gl.ARRAY_BUFFER=34962,gl.ARRAY_BUFFER_BINDING=34964,gl.ELEMENT_ARRAY_BUFFER=34963,gl.ELEMENT_ARRAY_BUFFER_BINDING=34965,gl.STATIC_DRAW=35044,gl.UNSIGNED_BYTE=5121,gl.UNSIGNED_SHORT=5123,gl.FLOAT=5126,gl.RGBA=6408,gl.FRAGMENT_SHADER=35632,gl.VERTEX_SHADER=35633,gl.LINK_STATUS=35714,gl.CURRENT_PROGRAM=35725,gl.NEAREST=9728,gl.LINEAR=9729,gl.TEXTURE_MAG_FILTER=10240,gl.TEXTURE_MIN_FILTER=10241,gl.TEXTURE_WRAP_S=10242,gl.TEXTURE_WRAP_T=10243,gl.TEXTURE_2D=3553,gl.TEXTURE0=33984,gl.TEXTURE1=33985,gl.ACTIVE_TEXTURE=34016,gl.REPEAT=10497,gl.CLAMP_TO_EDGE=33071,gl.MIRRORED_REPEAT=33648,gl.FRAMEBUFFER=36160,gl.RENDERBUFFER=36161,gl.COLOR_ATTACHMENT0=36064,gl.DEPTH_ATTACHMENT=36096,gl.STENCIL_ATTACHMENT=36128,gl.NONE=0,gl.FRAMEBUFFER_COMPLETE=36053,gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054,gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055,gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057,gl.FRAMEBUFFER_UNSUPPORTED=36061,gl.FRAMEBUFFER_BINDING=36006,gl.RENDERBUFFER_BINDING=36007,gl.INVALID_FRAMEBUFFER_OPERATION=1286}()),BK.Misc.compQQVersion(GameStatusInfo.QQVer,"7.6.1")&&(this.doImage_rotate180=n),BK.Misc.compQQVersion(GameStatusInfo.QQVer,"7.6.1")&&(this.bufferFromScreenShot_760=function(t,e,i,r,n){var o=gl.glCreateTexture();gl.glActiveTexture(gl.TEXTURE1),gl.glBindTexture(gl.TEXTURE_2D,o),gl.glTexParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR),gl.glTexParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR),gl.glTexParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE),gl.glTexParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE),gl.glTexImage2D(gl.TEXTURE_2D,0,gl.RGBA,BK.Director.screenPixelSize.width,BK.Director.screenPixelSize.height,0,gl.RGBA,gl.UNSIGNED_BYTE,null);var a=gl.glGetParameterInt(gl.FRAMEBUFFER_BINDING,1),s=gl.glGetParameterInt(gl.RENDERBUFFER_BINDING,1),h=gl.glCreateRenderbuffer();gl.glBindRenderbuffer(gl.RENDERBUFFER,h),gl.glRenderbufferStorage(gl.RENDERBUFFER,35056,BK.Director.screenPixelSize.width,BK.Director.screenPixelSize.height),gl.glBindRenderbuffer(gl.RENDERBUFFER,s);var c=gl.glCreateFramebuffer();gl.glBindFramebuffer(gl.FRAMEBUFFER,c),gl.glFramebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,o,0),gl.glFramebufferRenderbuffer(gl.FRAMEBUFFER,gl.DEPTH_ATTACHMENT,gl.RENDERBUFFER,h),gl.glFramebufferRenderbuffer(gl.FRAMEBUFFER,gl.STENCIL_ATTACHMENT,gl.RENDERBUFFER,h);var l,u=gl.glCheckFramebufferStatus(gl.FRAMEBUFFER);return u==gl.FRAMEBUFFER_COMPLETE?(BK.Render.render(t,0),l=new BK.Buffer(r*n*4),gl.glReadPixels(e,i,r,n,gl.RGBA,gl.UNSIGNED_BYTE,l)):BK.Script.log(1,-1,"bufferFromScreenShot_760!framebuffer failed, code = "+u),gl.glBindFramebuffer(gl.FRAMEBUFFER,a),gl.glDeleteTexture(o),gl.glDeleteRenderbuffer(h),gl.glDeleteFramebuffer(c),l})}this.isInScreen=function(){(void 0==this.origin.x||this.origin.x<0||this.origin.x>BK.Director.screenPixelSize.width)&&(this.origin.x=0),(void 0==this.origin.y||this.origin.y<0||this.origin.y>BK.Director.screenPixelSize.height)&&(this.origin.y=0),(void 0==this.size.width||this.size.width<=0||this.size.width>BK.Director.screenPixelSize.width-this.origin.x)&&(this.origin.x=0,this.size.width=BK.Director.screenPixelSize.width),(void 0==this.size.height||this.size.height<=0||this.size.height>BK.Director.screenPixelSize.height-this.origin.y)&&(this.origin.y=0,this.size.height=BK.Director.screenPixelSize.height)},this.isInNode=function(t){(void 0==this.origin.x||this.origin.x<0||this.origin.x>t.contentSize.width)&&(this.origin.x=0),(void 0==this.origin.y||this.origin.y<0||this.origin.y>t.contentSize.height)&&(this.origin.y=0),(void 0==this.size.width||this.size.width<=0)&&(this.size.width=t.contentSize.width),(void 0==this.size.height||this.size.height<=0)&&(this.size.height=t.contentSize.height)},this.saveImage=function(t,e,i){GameStatusInfo&&BK.Misc.compQQVersion(GameStatusInfo.QQVer,"7.6.1")?(t=this.doImage_rotate180({buffer:t,width:this.size.width,height:this.size.height}),BK.Image.saveImage(t,this.size.width,this.size.height,e,i)):BK.Image.saveImage(t,this.size.width,this.size.height,e,i,1)},this.shotToFile=function(t,e){this.isInScreen();var i="";if(this.bufferFromScreenShot_760){var r=this.bufferFromScreenShot_760(BK.Director.root,this.origin.x,this.origin.y,this.size.width,this.size.height);void 0!=r&&(i="GameSandBox://"+t,this.saveImage(r,i,e))}else{i="GameSandBox://"+t+"."+e;var n=new BK.RenderTexture(BK.Director.screenPixelSize.width,BK.Director.screenPixelSize.height);BK.Render.renderToTexture(BK.Director.root,n),n.writeToDiskWithXY(i,this.origin.x,this.origin.y,this.size.width,this.size.height)}return i},this.shotToBuff=function(){if(this.isInScreen(),this.bufferFromScreenShot_760)return this.bufferFromScreenShot_760(BK.Director.root,this.origin.x,this.origin.y,this.size.width,this.size.height);var t=new BK.RenderTexture(BK.Director.screenPixelSize.width,BK.Director.screenPixelSize.height);return BK.Render.renderToTexture(BK.Director.root,t),t.readPixels(this.origin.x,this.origin.y,this.size.width,this.size.height)},this.shotToFileFromNode=function(t,e,i){this.isInNode(t);var r="";if(this.bufferFromScreenShot_760){var n=this.bufferFromScreenShot_760(t,this.origin.x+t.position.x,this.origin.y+t.position.y,this.size.width,this.size.height);void 0!=n&&(r="GameSandBox://"+e,this.saveImage(n,r,i))}else{r="GameSandBox://"+e+"."+i;var o=new BK.RenderTexture(BK.Director.screenPixelSize.width,BK.Director.screenPixelSize.height);BK.Render.renderToTexture(t,o),o.writeToDiskWithXY(r,this.origin.x+t.position.x,this.origin.y+t.position.y,this.size.width,this.size.height)}return r},this.shotToBuffFromNode=function(t){if(this.isInNode(t),this.bufferFromScreenShot_760)return this.bufferFromScreenShot_760(t,this.origin.x+t.position.x,this.origin.y+t.position.y,this.size.width,this.size.height);var e=new BK.RenderTexture(BK.Director.screenPixelSize.width,BK.Director.screenPixelSize.height);return BK.Render.renderToTexture(t,e),e.readPixels(this.origin.x+t.position.x,this.origin.y+t.position.y,this.size.width,this.size.height)},this.shotToFileFromGL=function(t,e,i,r){BK.Notification.on("frame_final",this,function(){this.isInScreen();var t=new BK.WebGL,n="GameSandBox://"+e,o=new BK.Buffer(this.size.height*this.size.width*4);t.glReadPixels(this.origin.x,this.origin.y,this.size.width,this.size.height,6408,5121,o),this.saveImage(o,n,i),r&&r(n+"."+i)}.bind(this),!0)},this.shotToBuffFromGL=function(t,e){BK.Notification.on("frame_final",this,function(){this.isInScreen();var t=new BK.Buffer(this.size.height*this.size.width*4);(new BK.WebGL).glReadPixels(this.origin.x,this.origin.y,this.size.width,this.size.height,6408,5121,t),e&&e(t)}.bind(this),!0)}};var gl,isSupportTA,firstFrameUpload=!1,GL_COMMAND_ACTIVE_TEXTURE=0,GL_COMMAND_ATTACH_SHADER=1,GL_COMMAND_BIND_ATTRIB_LOCATION=2,GL_COMMAND_BIND_BUFFER=3,GL_COMMAND_BIND_FRAME_BUFFER=4,GL_COMMAND_BIND_RENDER_BUFFER=5,GL_COMMAND_BIND_TEXTURE=6,GL_COMMAND_BLEND_COLOR=7,GL_COMMAND_BLEND_EQUATION=8,GL_COMMAND_BLEND_EQUATION_SEPARATE=9,GL_COMMAND_BLEND_FUNC=10,GL_COMMAND_BLEND_FUNC_SEPARATE=11,GL_COMMAND_BUFFER_DATA=12,GL_COMMAND_BUFFER_SUB_DATA=13,GL_COMMAND_CLEAR=14,GL_COMMAND_CLEAR_COLOR=15,GL_COMMAND_CLEAR_DEPTH=16,GL_COMMAND_CLEAR_STENCIL=17,GL_COMMAND_COLOR_MASK=18,GL_COMMAND_COMMIT=19,GL_COMMAND_COMPILE_SHADER=20,GL_COMMAND_COMPRESSED_TEX_IMAGE_2D=21,GL_COMMAND_COMPRESSED_TEX_SUB_IMAGE_2D=22,GL_COMMAND_COPY_TEX_IMAGE_2D=23,GL_COMMAND_COPY_TEX_SUB_IMAGE_2D=24,GL_COMMAND_CULL_FACE=25,GL_COMMAND_DELETE_BUFFER=26,GL_COMMAND_DELETE_FRAME_BUFFER=27,GL_COMMAND_DELETE_PROGRAM=28,GL_COMMAND_DELETE_RENDER_BUFFER=29,GL_COMMAND_DELETE_SHADER=30,GL_COMMAND_DELETE_TEXTURE=31,GL_COMMAND_DEPTH_FUNC=32,GL_COMMAND_DEPTH_MASK=33,GL_COMMAND_DEPTH_RANGE=34,GL_COMMAND_DETACH_SHADER=35,GL_COMMAND_DISABLE=36,GL_COMMAND_DISABLE_VERTEX_ATTRIB_ARRAY=37,GL_COMMAND_DRAW_ARRAYS=38,GL_COMMAND_DRAW_ELEMENTS=39,GL_COMMAND_ENABLE=40,GL_COMMAND_ENABLE_VERTEX_ATTRIB_ARRAY=41,GL_COMMAND_FINISH=42,GL_COMMAND_FLUSH=43,GL_COMMAND_FRAME_BUFFER_RENDER_BUFFER=44,GL_COMMAND_FRAME_BUFFER_TEXTURE_2D=45,GL_COMMAND_FRONT_FACE=46,GL_COMMAND_GENERATE_MIPMAP=47,GL_COMMAND_HINT=48,GL_COMMAND_LINE_WIDTH=49,GL_COMMAND_LINK_PROGRAM=50,GL_COMMAND_PIXEL_STOREI=51,GL_COMMAND_POLYGON_OFFSET=52,GL_COMMAND_RENDER_BUFFER_STORAGE=53,GL_COMMAND_SAMPLE_COVERAGE=54,GL_COMMAND_SCISSOR=55,GL_COMMAND_SHADER_SOURCE=56,GL_COMMAND_STENCIL_FUNC=57,GL_COMMAND_STENCIL_FUNC_SEPARATE=58,GL_COMMAND_STENCIL_MASK=59,GL_COMMAND_STENCIL_MASK_SEPARATE=60,GL_COMMAND_STENCIL_OP=61,GL_COMMAND_STENCIL_OP_SEPARATE=62,GL_COMMAND_TEX_IMAGE_2D=63,GL_COMMAND_TEX_PARAMETER_F=64,GL_COMMAND_TEX_PARAMETER_I=65,GL_COMMAND_TEX_SUB_IMAGE_2D=66,GL_COMMAND_UNIFORM_1F=67,GL_COMMAND_UNIFORM_1FV=68,GL_COMMAND_UNIFORM_1I=69,GL_COMMAND_UNIFORM_1IV=70,GL_COMMAND_UNIFORM_2F=71,GL_COMMAND_UNIFORM_2FV=72,GL_COMMAND_UNIFORM_2I=73,GL_COMMAND_UNIFORM_2IV=74,GL_COMMAND_UNIFORM_3F=75,GL_COMMAND_UNIFORM_3FV=76,GL_COMMAND_UNIFORM_3I=77,GL_COMMAND_UNIFORM_3IV=78,GL_COMMAND_UNIFORM_4F=79,GL_COMMAND_UNIFORM_4FV=80,GL_COMMAND_UNIFORM_4I=81,GL_COMMAND_UNIFORM_4IV=82,GL_COMMAND_UNIFORM_MATRIX_2FV=83,GL_COMMAND_UNIFORM_MATRIX_3FV=84,GL_COMMAND_UNIFORM_MATRIX_4FV=85,GL_COMMAND_USE_PROGRAM=86,GL_COMMAND_VALIDATE_PROGRAM=87,GL_COMMAND_VERTEX_ATTRIB_1F=88,GL_COMMAND_VERTEX_ATTRIB_2F=89,GL_COMMAND_VERTEX_ATTRIB_3F=90,GL_COMMAND_VERTEX_ATTRIB_4F=91,GL_COMMAND_VERTEX_ATTRIB_1FV=92,GL_COMMAND_VERTEX_ATTRIB_2FV=93,GL_COMMAND_VERTEX_ATTRIB_3FV=94,GL_COMMAND_VERTEX_ATTRIB_4FV=95,GL_COMMAND_VERTEX_ATTRIB_POINTER=96,GL_COMMAND_VIEW_PORT=97,total_size=1e5,next_index=0,buffer_data,bufferdata_array,bufferdata_view,bufferdata_pointer=0;if(function(t,e){"object"==typeof t&&(t.MQQ.Webview.openTransparent=e().openTransparent,t.MQQ.Webview.closeTransparent=e().closeTransparent,t.MQQ.Webview.sendMessageToWebView=e().sendMessageToWebView,t.MQQ.Webview.onMessageHandle=e().onMessageHandle)}(BK,function(){function t(t,e,i){void 0===e&&(e=1);var r="cs.openWebViewWithoutUrl.local",n={url:t,gameOrientation:e,businessType:2};GameStatusInfo.devPlatform&&BK.Script.log(0,0,"BK.MQQ.Webview.openTransparent rely QQ.Call Failed!"),i&&(BK.MQQ.SsoRequest.removeListener(r,this),BK.MQQ.SsoRequest.addListener(r,this,i)),BK.MQQ.SsoRequest.send(n,r)}function e(t){var e={taskId:t};BK.MQQ.SsoRequest.send(e,"cs.closeWebview.local")}function i(t,e){var i={taskId:t,msg:e};BK.MQQ.SsoRequest.send(i,"cs.apolloGameTargetWebMessage.local")}function r(t){BK.MQQ.SsoRequest.addListener("sc.web_callback_game.local",null,function(e,i,r){t&&t(i,r)})}return{openTransparent:t,closeTransparent:e,sendMessageToWebView:i,onMessageHandle:r}}),function(t,e){"object"==typeof t&&("object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Audio=e())}(BK,function(){var t=BK.Audio,e=function(){function e(e,i,r){this.__nativeObj=new t(e,i,r),this._type=e,this.path=i,this._loopCount=r}return Object.defineProperty(e.prototype,"type",{set:function(t){1!=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5")&&this.__nativeObj.setAudioParam("type",t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"musicPath",{set:function(t){1!=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5")&&this.__nativeObj.setAudioParam("musicPath",t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loopCount",{set:function(t){1!=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5")&&this.__nativeObj.setAudioParam("loopCount",t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){if(1!=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5"))return this.__nativeObj.currentTime},set:function(t){1!=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5")&&this.__nativeObj.setAudioParam("currentTime",t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){if(1!=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5"))return this.__nativeObj.volume},set:function(t){1!=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5")&&this.__nativeObj.setAudioParam("volume",t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"audioType",{set:function(t){1!=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5")&&this.__nativeObj.setAudioParam("audioType",t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){if(1!=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5"))return this.__nativeObj.duration},enumerable:!0,configurable:!0}),e.pauseAllBackground=function(){if(this.playingBackgrounds)for(var t=0;t<this.playingBackgrounds.length;t++){var e=this.playingBackgrounds[t];"string"!=typeof e.music&&e.music.pauseMusic()}},e.resumeAllBackground=function(){if(this.playingBackgrounds)for(var e=0;e<this.playingBackgrounds.length;e++){var i=this.playingBackgrounds[e];"string"!=typeof i.music?(i.music.resumeMusic(),BK.Script.log(0,0," music.resumeMusic not string")):(BK.Script.log(0,0," music.resumeMusic "+typeof i.music),t.playMusic(i.type,i.music,i.loop))}},e.removeBackgrounFromArray=function(t){if(this.playingBackgrounds)for(var i=0;i<e.playingBackgrounds.length;i++)e.playingBackgrounds[i].music},e.addBackgroundToArray=function(t,i,r){var n={music:t,type:i,loop:r};void 0===this.playingBackgrounds&&(this.playingBackgrounds=[]);for(var o=0;o<e.playingBackgrounds.length;o++)e.playingBackgrounds[o].music;this.playingBackgrounds.push(n)},e.playMusic=function(i,r,n){var o=new t(i,r,n);o.startMusic(function(){}),0==i&&e.addBackgroundToArray(o,i,n)},e.prototype.startMusic=function(i){"ios"===GameStatusInfo.platform&&GameStatusInfo.QQVer.indexOf("7.5.8")>-1?t.playMusic(this._type,this.path,this._loopCount):(null!=i&&void 0!=i?this.__nativeObj.startMusic(i):this.__nativeObj.startMusic(),0==this._type&&e.addBackgroundToArray(this.__nativeObj,this._type,this._loopCount))},e.prototype.pauseMusic=function(){"ios"===GameStatusInfo.platform&&GameStatusInfo.QQVer.indexOf("7.5.8")>-1||(this.__nativeObj.pauseMusic(),0==this._type&&e.removeBackgrounFromArray(this.__nativeObj))},e.prototype.resumeMusic=function(){"ios"===GameStatusInfo.platform&&GameStatusInfo.QQVer.indexOf("7.5.8")>-1||(this.__nativeObj.resumeMusic(),0==this._type&&e.addBackgroundToArray(this.__nativeObj,this._type,this._loopCount))},e.prototype.stopMusic=function(){"ios"===GameStatusInfo.platform&&GameStatusInfo.QQVer.indexOf("7.5.8")>-1||(0==this._type&&e.removeBackgrounFromArray(this.__nativeObj),this.__nativeObj.stopMusic())},e.prototype.seekTo=function(t){1!=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5")&&this.__nativeObj.seekTo(t)},e}();return Object.defineProperty(e,"switch",{get:function(){return t.switch},set:function(e){t.switch=e},enumerable:!0,configurable:!0}),e}),BK.MQQ&&BK.MQQ.Account){var headCacheDir_1="GameSandBox://_head/";BK.FileUtil.isFileExist(headCacheDir_1)||BK.FileUtil.makeDir(headCacheDir_1),BK.MQQ.Account.getHeadEx||(BK.MQQ.Account.getHeadEx=function(t,e){BK.MQQ.Account.getHead(t,function(i,r){if(r&&r.buffer&&r.width&&r.height)if(BK.Image.saveImage)BK.Image.saveImage(r.buffer,r.width,r.height,headCacheDir_1+i,"jpg"),e(i,headCacheDir_1+i+".jpg");else{var n=new BK.Texture(r.buffer,r.width,r.height),o=new BK.Sprite(r.width,r.height,n,0,0,1,1),a=new BK.RenderTexture(r.width,r.height);BK.Render.renderToTexture(o.__nativeObj?o.__nativeObj:o,a),a.saveTo(headCacheDir_1+i),e(t,headCacheDir_1+i)}else e(t,"")})}),BK.MQQ.Account.getUserInfo=function(t){if(1!=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5")){var e="cs.get_user_info.local";t&&(BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,function(e,i,r){t(e,r)}),BK.MQQ.SsoRequest.send(null,e))}else t(-1,null)},BK.MQQ.Account.getFriends=function(t){if(1!=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5")){var e="cs.get_app_friends.local";t&&(BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,function(e,i,r){t(e,r)}),BK.MQQ.SsoRequest.send(null,e))}else t(-1,null)},BK.MQQ.Account.getLocation=function(t){if(1!=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5")){var e="cs.get_location.local";t&&(BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,function(e,i,r){t(e,r)}),BK.MQQ.SsoRequest.send(null,e))}else t(-1,null)},BK.MQQ.Account.getCity=function(t){if(1!=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5")){var e="cs.get_city.local";t&&(BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,function(e,i,r){t(e,r)}),BK.MQQ.SsoRequest.send(null,e))}else t(-1,null)},BK.MQQ.Account.preloadUserInfoList=function(t,e){if(1!=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5")){var i="cs.preload_userInfoList.local";if(e){var r={openIdList:t};BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,function(t,i,r){e(t)}),BK.MQQ.SsoRequest.send(r,i)}}else e(-1)},BK.MQQ.Account.queryNick=function(t,e,i,r,n){var o=new BK.QQNickCanvas(t,e,i,r,function(t,e){n(o.__nativeObj,e)})},BK.MQQ.Account.queryHead=function(t,e,i,r,n){var o=new BK.QQAvatarCanvas(t,e,i,r,null,function(t,e){n(o.__nativeObj,e)})},BK.MQQ.Account.login=function(t){if(1!=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.8.0")){var e="cs.xy_login.local";BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,function(e,i,r){r&&r.type&&("complete"==r.type&&t&&t.complete&&t.complete(r),"unauthorized"==r.type&&t&&t.fail&&t.fail(r),"failure"==r.type&&t&&t.fail&&t.fail(r),"success"==r.type&&t&&t.success&&t.success(r))}),BK.MQQ.SsoRequest.send(null,e)}else t&&t.fail&&t.fail({ret:1,type:"verionErr"})}}BK.Misc.compQQVersion||(BK.Misc.compQQVersion=function(t,e){for(var i=t.split("."),r=e.split("."),n=Math.min(3,Math.min(i.length,r.length)),o=0;o<n;o++)if(i[o]!=r[o])return i[o]<r[o];return!0},BK.Misc.qqVerLessthan=function(t,e){for(var i=t.split("."),r=e.split("."),n=Math.min(3,Math.min(i.length,r.length)),o=0;o<n;o++){if(i[o]<r[o])return!0;if(i[o]>r[o])return!1}return!1}),function(t,e){"object"==typeof t&&(t.TouchEventDispatch=function(){var t=BK.TouchEvent.getAllTouchEvent,e=BK.TouchEvent.getTouchEvent,i=BK.TouchEvent.updateTouchStatus;return{TouchEventDispatch:function(){function r(){}return r.listenAllTouch=function(t,e){void 0===this.listenerInfos&&(this.listenerInfos=[]);var i={obj:t,callback:e};this.listenerInfos.push(i)},r.remove=function(t){for(var e=-1,i=0;i<len;i++)this.listenerInfos[i].obj==t&&(e=i);-1!=e&&this.listenerInfos.splice(e,1)},r.dispatch=function(t){t&&this.listenerInfos.forEach(function(e){e.callback(t)})},r.getTouchEvent=function(){var t=e();return t&&this.dispatch([t]),t},r.getAllTouchEvent=function(){var e=t();return e&&this.dispatch(e),e},r.updateTouchStatus=function(){i()},r.listenerInfos=[],r}()}}().TouchEventDispatch)}(BK),function(t,e){t.TouchEvent=function(){return function(){function t(){}return t.getTouchEvent=function(){return BK.TouchEventDispatch.getTouchEvent()},t.getAllTouchEvent=function(){return BK.TouchEventDispatch.getAllTouchEvent()},t.updateTouchStatus=function(){BK.TouchEventDispatch.updateTouchStatus()},t}()}()}(BK),function(t,e){function i(e,i){try{t.gl&&0==r&&(r=!0,o()),a(e,i),t.gl&&t.gl.__oldGlCommit()}catch(t){}BK.Notification.emitAll("frame_final",{})}var r=!1,n=function(){},o=function(){this.__gl=bkWebGLGetInstance(),this.__oldGlCommit=this.__gl.glCommit,this.__gl.glCommit=n,this.__gl.__oldGlCommit=this.__oldGlCommit,n.bind(this.__gl)};BK.Notification=new BK.Emitter;var a=t._tickerCallback_;t._tickerCallback_=i}(this),function(t,e){function i(e){r&&r(e.message?e.message:e,e.stack),t.Script&&t.Script.onerror&&t.Script.onerror(e)}var r=void 0;e.Script.setErrorObserver=function(t){r=t},t._globalErrorCallback_=i,e.MQQ.SsoRequest.addListener("cs.xy_error_info.local",this,function(t,e,r){i(r.data)})}(this,BK),function(t,e){function i(t){if(!(t.indexOf("GameRes://")<0)){var e=t.substring("GameRes://".length,t.length),i=e.indexOf("/");if(!(i<0)){var r=e.substring(0,i);if(r&&""!=r)for(var n in o.subpackages){var a=o.subpackages[n];if(a&&a.root&&a.root===r&&a.name)return a.name}}}}if(GameStatusInfo&&"xcode"!==GameStatusInfo.devPlatform){var r=GameStatusInfo.QQVer.split(".");if(Number(r[0])<7||7==Number(r[0])&&Number(r[1])<7||7==Number(r[0])&&7==Number(r[1])&&Number(r[2])<5)e.Script.log(1,0,"775 以下手q 版本");else{var n=e.FileUtil.readFile("GameRes://gameConfig.json");if(n){var o=JSON.parse(n.readAsString(!0));o&&o.subpackages&&(e.Script.innerLoadLib=e.Script.loadlib,e.Script.loadlib=function(t){var r=i(t);r?e.QQ.checkPakcage(r,function(i,r){0==r?e.Script.innerLoadLib(t):e.Script.log(1,1,"终端校验子包完整性失败 pack:"+i+" code:"+r)}):e.Script.innerLoadLib(t)})}}}else e.Script.log(1,0,"Xcode 环境")}(0,BK),function(t,e){if(BK.Notification){BK.MQQ.SsoRequest.addListener("sc.game_enter_background.local",null,function(){BK.Notification.emitAll("game_enter_background",{})}.bind(this)),BK.MQQ.SsoRequest.addListener("sc.game_enter_foreground.local",null,function(){BK.Notification.emitAll("game_enter_foreground",{})}.bind(this)),BK.MQQ.SsoRequest.addListener("sc.game_maximize.local",null,function(){BK.Notification.emitAll("game_maximize",{})}.bind(this)),BK.MQQ.SsoRequest.addListener("sc.game_minimize.local",null,function(){BK.Notification.emitAll("game_minimize",{})}.bind(this)),BK.MQQ.SsoRequest.addListener("sc.game_shell_pack_up.local",null,function(){BK.Notification.emitAll("game_pack_up",{})}.bind(this)),BK.MQQ.SsoRequest.addListener("sc.game_shell_close.local",null,function(){if("ios"===GameStatusInfo.platform||BK.showPlusTips&&3==BK.showPlusTips||0==(1&GameStatusInfo.commFlagBits)||1==BK.Misc.compQQVersion(GameStatusInfo.QQVer,"7.6.9"))BK.Notification.emitAll("game_close",{}),isBrowser?BK.MQQ.SsoRequest.sendTo({},"cs.close_room.local"):BK.MQQ.SsoRequest.send({},"cs.close_room.local");else{var t="apollo_router_game.apl_d_r_linkcmd_plus_exist_tips",e={cmd:t,gameid:GameStatusInfo.gameId+""};BK.MQQ.SsoRequest.send(e,t),BK.MQQ.SsoRequest.addListener(t,this,function(t,e,i){BK.Script.log(0,0," apl_d_r_linkcmd_plus_exist_tips = "+t)});new BK.PlusTips(!1).showTips(function(){BK.Notification.emitAll("game_close",{}),isBrowser?BK.MQQ.SsoRequest.sendTo({},"cs.close_room.local"):BK.MQQ.SsoRequest.send({},"cs.close_room.local")}),BK.showPlusTips=3}}.bind(this)),BK.MQQ.SsoRequest.addListener("sc.network_change.local",null,function(t,e,i){void 0===i.type?BK.Script.log(1,1,"net work change .data is worng!"):BK.Notification.emitAll("game_network_change",i.type)}.bind(this))}}(),function(t,e){t.FileUtil.upload=function(){function t(t,e,i){function r(t,e){i(e,f+d)}for(var n=t.length>1024?1024:t.length,o=new Uint8Array(n),a=0;a<n/2;a++)o[a]=t.readUint8Buffer();t.jumpBytes(t.length-n);for(a=n/2;a<n;a++)o[a]=t.readUint8Buffer();t.rewind();var s=new Date,h=s.getFullYear()+(s.getMonth()+1<10?0+(s.getMonth()+1):s.getMonth()+1)+s.getDate(),c=e.signTime,l=e.tmpSecretId,u=e.sessionToken,d="/"+GameStatusInfo.gameId+"_"+BK.Crypt.bin2hex(BK.Crypt.core_md5(o,n))+GameStatusInfo.gameId+"_"+h+".png",_=e.upLoadPrefUrl.replace(new RegExp("http://","gm"),""),f=e.downloadUrl,g=e.signature,p="put\n"+d+"\n\nhost="+_+"&x-cos-storage-class=nearline\n",m="sha1\n"+c+"\n"+BK.Crypt.hex_sha1(p)+"\n",v="q-sign-algorithm=sha1&q-ak="+l+"&q-sign-time="+c+"&q-key-time="+c+"&q-header-list=host;x-cos-storage-class&q-url-param-list=&q-signature="+BK.Crypt.hex_hmac_sha1(g,m),S=new BK.HttpUtil("https://"+_+d);S.setHttpMethod("put"),S.setHttpHeader("host",_),S.setHttpHeader("x-cos-storage-class","nearline"),S.setHttpHeader("x-cos-security-token",u),S.setHttpHeader("authorization",v),S.setBodyCompatible(!1),S.setHttpRawBody(t),S.requestAsync(r)}return BK.FileUtil.uploadFromFile=function(t,e){var i=BK.FileUtil.readFile(t);i&&i.length>0?BK.FileUtil.uploadFromBuff(i,e):(BK.Script.log(1,1,"uploadFromFile failed.file is empty!"),e(-1,""))},BK.FileUtil.uploadFromBuff=function(e,i){BK.QQ.queryCloudSignature(function(r,n){t(e,n,i)})},BK.FileUtil.uploadFromNode=function(e,i){var r=new BK.RenderTexture(BK.Director.screenPixelSize.width,BK.Director.screenPixelSize.height);BK.Render.renderToTexture(e,r),r.writeToDiskWithXY("GameSandBox://temp.png",e.position.x,e.position.y,e.contentSize.width,e.contentSize.height);var n=BK.FileUtil.readFile("GameSandBox://temp.png");BK.QQ.queryCloudSignature(function(e,r){t(n,r,i)})},BK.FileUtil.uploadNode=function(e,i,r,n,o,a){var s=new BK.RenderTexture(BK.Director.screenPixelSize.width,BK.Director.screenPixelSize.height);BK.Render.renderToTexture(e,s),s.writeToDiskWithXY("GameSandBox://temp.png",i,r,n,o);var h=BK.FileUtil.readFile("GameSandBox://temp.png");BK.QQ.queryCloudSignature(function(e,i){t(h,i,a)})},t}()}(BK),BK.QQ.shareToArkFromFile=function(t,e,i,r){BK.FileUtil.uploadFromFile(r,function(r,n){BK.QQ.shareToArk(t,e,n,!0,i)})},BK.QQ.shareToArkFromBuff=function(t,e,i,r){BK.FileUtil.uploadFromBuff(r,function(r,n){200==r&&BK.QQ.shareToArk(t,e,n,!0,i)})},BK.QQ.shareToArkFromNode=function(t,e,i,r){BK.FileUtil.uploadFromNode(r,function(r,n){200==r&&BK.QQ.shareToArk(t,e,n,!0,i)})},BK.QQ.shareToArkFromGLShot=function(t,e,i,r){var n=new BK.ScreenShot;n.origin={x:r.x,y:r.y},n.size={width:r.width,height:r.height};var o="GameSandBox://"+BK.Time.timestamp;n.shotToFileFromGL(void 0,o,"png",function(r){BK.FileUtil.uploadFromFile(r,function(r,n){200==r&&BK.QQ.shareToArk(t,e,n,!0,i),BK.FileUtil.isFileExist(o)&&BK.FileUtil.deleteFile(o)})})},function(t,e){"object"==typeof t&&("object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.UIEventHandler=e())}(this,function(){function t(){this.eveFuncTb=[],this._eventMap={1:[],2:[],3:[]},this.rootNode=BK.Director.root,this.nodeTreeHittest=function(t,e){if(1==t.canUserInteract&&0==t.hidden){if(t.children)for(var i=t.children,r=i.length-1;r>=0;r--){var n=i[r],o=this.nodeTreeHittest(n,e);if(void 0!=o)return o}return 1==t.hittest(e)?t:void 0}},this.treeHittest=function(t){return this.nodeTreeHittest(this.rootNode,t)},this.setRootNode=function(t){this.rootNode=t},this.addNodeEvent=function(t,e,i){var r={};r.obj=t,r.func=i;for(var n=!1,o=0;o<this._eventMap[e].length;o++)this._eventMap[e][o].obj==t&&(n=!0);0==n?this._eventMap[e].push(r):BK.Script.log(1,0,"Add Same Node Event has added Event Before.")},this.removeNodeEvent=function(t,e){for(var i=-1,r=0;r<this._eventMap[e].length;r++)this._eventMap[e][r].obj==t&&(i=r);i>=0&&(this._eventMap[e].splice(i,1),BK.Script.log(1,0,"Remove Node Event Succeed!"))},this.triggerEvent=function(t,e,i,r){for(var n=0;n<this._eventMap[e].length;n++){var o=this._eventMap[e][n];if(t&&o.obj==t){var a=o.func;a&&a(t,e,i,r)}}},this.triggerAllNodeEvent=function(t){for(var e=0;e<this._eventMap[t].length;e++){var i=this._eventMap[t][e],r=i.func,n=i.obj;r&&r(n,t)}},this.isFirstTouchDown=-1,this.currentNode=void 0,this.touchUpdate=function(t){if(void 0!=t)for(var n=0;n<t.length;n++)for(var o=t[n],a=0;a<o.length;a++){var s=o[a].x,h=o[a].y;if(2==o[a].status)if(-1==this.isFirstTouchDown){this.isFirstTouchDown=o[a].id;var c=this.treeHittest({x:s,y:h});c?(this.currentNode=c,this.triggerEvent(this.currentNode,e,s,h)):this.currentNode=void 0}else BK.Script.log(0,0,"detectGesture begin not first id:"+o[a].id+" x:"+s+" y:"+h);else 3==o[a].status?-1!=this.isFirstTouchDown&&o[a].id==this.isFirstTouchDown?this.currentNode&&this.triggerEvent(this.currentNode,i,s,h):BK.Script.log(0,0,"detectGesture moved! Failed touchArr[i].id = "+o[a].id):1==o[a].status&&(-1!=this.isFirstTouchDown&&o[a].id==this.isFirstTouchDown?(this.isFirstTouchDown=-1,this.currentNode&&(this.triggerEvent(this.currentNode,r,s,h),this.currentNode=void 0)):BK.Script.log(0,0,"detectGesture end!!!Failed!!! touchArr[i].id= "+o[a].id+" this.isFirstTouchDown:"+this.isFirstTouchDown))}},this.detectGesture=function(){var t=BK.TouchEvent.getAllTouchEvent();this.touchUpdate(t),BK.TouchEvent.updateTouchStatus()},"function"==typeof BK.TouchEventDispatch?BK.TouchEventDispatch.listenAllTouch(this,this.touchUpdate.bind(this)):BK.Director.ticker.add(function(t,e){this&&this.detectGesture()}.bind(this))}var e=1,i=2,r=3;return new t}),function(t,e){"object"==typeof t&&("object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Button=e())}(BK,function(){function t(t,e,i,r){this.touchStatus=0,this.normalTexture=void 0,this.pressTexture=void 0,this.disableTexture=void 0,this.normalTextureOffset={frame:{x:0,y:0,w:0,h:0},rotated:!1},this.pressTextureOffset={frame:{x:0,y:0,w:0,h:0},rotated:!1},this.disableTextureOffset={frame:{x:0,y:0,w:0,h:0},rotated:!1},this.touchInsideCallback=void 0,i?(this.normalTexture=new BK.Texture(i),this.normalTexture&&(this.normalTextureOffset.frame.x=0,this.normalTextureOffset.frame.y=0,this.normalTextureOffset.frame.w=this.normalTexture.size.width,this.normalTextureOffset.frame.h=this.normalTexture.size.height,this.normalTextureOffset.rotated=!1)):this.normalTexture={},r&&(this.touchInsideCallback=r),this.__nativeObj=new BK.Sprite(t,e,this.normalTexture,0,1,1,1);try{Object.getOwnPropertyNames(this.__nativeObj).forEach(function(t){var e=t;BK.Script.log(1,1,t),Object.defineProperty(this,e,{get:function(){return this.__nativeObj[e]},set:function(t){this.__nativeObj[e]=t}})},this)}catch(t){BK.Script.log(1,1," error :"+t)}this.enable=!0,Object.defineProperty(this,"disable",{get:function(){return!this.enable},set:function(t){1==t?this.updateTexture(2):this.updateTexture(0),this.enable=!t}}),this.updateTexture=function(t){if(0==t){if(this.normalTexture){this.__nativeObj.setTexture(this.normalTexture);e=this.normalTextureOffset;this.__nativeObj.adjustTexturePosition(e.frame.x,e.frame.y,e.frame.w,e.frame.h,e.rotated)}}else if(1==t){if(this.pressTexture){this.__nativeObj.setTexture(this.pressTexture);e=this.pressTextureOffset;this.__nativeObj.adjustTexturePosition(e.frame.x,e.frame.y,e.frame.w,e.frame.h,e.rotated)}}else if(2==t&&this.disableTexture){this.__nativeObj.setTexture(this.disableTexture);var e=this.disableTextureOffset;this.__nativeObj.adjustTexturePosition(e.frame.x,e.frame.y,e.frame.w,e.frame.h,e.rotated)}},this.changeStatus=function(t){this.touchStatus=t,this.updateTexture(this.touchStatus)},this.updateStatus=function(){this.updateTexture(this.touchStatus)},this.changeStatus(0),this.isCancelClick=void 0,UIEventHandler.addNodeEvent(this,1,function(t,e,i,r){t.isCancelClick=!1,t.enable?t.changeStatus(1):t.changeStatus(2)}),UIEventHandler.addNodeEvent(this,2,function(t,e,i,r){var n={x:i,y:r};0==t.hittest(n)&&(t.isCancelClick=!0)}),UIEventHandler.addNodeEvent(this,3,function(t,e,i,r){t.enable?t.changeStatus(0):t.changeStatus(2),0==t.isCancelClick&&t.touchInsideCallback&&t.touchInsideCallback(t)}),this.canUserInteract=!0}return t.prototype.setTouchInsideCallback=function(t){this.touchInsideCallback=t},t.prototype.setNormalTexturePath=function(t){var e=new BK.Texture(t);e&&this.setNormalTexture(e)},t.prototype.setPressTexturePath=function(t){var e=new BK.Texture(t);e&&this.setPressTexture(e)},t.prototype.setDisableTexturePath=function(t){var e=new BK.Texture(t);e&&this.setDisableTexture(e)},t.prototype.setNormalTexture=function(t){this.normalTexture=t,this.normalTexture&&(this.normalTextureOffset.frame.x=0,this.normalTextureOffset.frame.y=0,this.normalTextureOffset.frame.w=this.normalTexture.size.width,this.normalTextureOffset.frame.h=this.normalTexture.size.height,this.normalTextureOffset.rotated=!1),this.updateStatus()},t.prototype.setPressTexture=function(t){this.pressTexture=t,this.pressTexture&&(this.pressTextureOffset.frame.x=0,this.pressTextureOffset.frame.y=0,this.pressTextureOffset.frame.w=this.pressTexture.size.width,this.pressTextureOffset.frame.h=this.pressTexture.size.height,this.pressTextureOffset.rotated=!1),this.updateStatus()},t.prototype.setDisableTexture=function(t){this.disableTexture=t,this.disableTexture&&(this.disableTextureOffset.frame.x=0,this.disableTextureOffset.frame.y=0,this.disableTextureOffset.frame.w=this.disableTexture.size.width,this.disableTextureOffset.frame.h=this.disableTexture.size.height,this.disableTextureOffset.rotated=!1),this.updateStatus()},t.prototype.setNormalTextureFromSheetInfo=function(t){if(t){var e=new BK.Texture(t.texturePath);e?(this.normalTexture=e,this.normalTextureOffset=t.frameInfo,this.updateStatus()):BK.Script.log(0,0,"setNormalTextureFromSheetInfo error! Create texture failed.")}else BK.Script.log(0,0,"setNormalTextureFromSheetInfo error! textureFrameInfo is null or undefined")},t.prototype.setPressTextureFromSheetInfo=function(t){if(t){var e=new BK.Texture(t.texturePath);e?(this.pressTexture=e,this.pressTextureOffset=t.frameInfo,this.updateStatus()):BK.Script.log(0,0,"setPressTextureFromSheetInfo error! Create texture failed.")}else BK.Script.log(0,0,"setPressTextureFromSheetInfo error! textureFrameInfo is null or undefined")},t.prototype.setDisableTextureFromSheetInfo=function(t){if(t){var e=new BK.Texture(t.texturePath);e?(this.disableTexture=e,this.disableTextureOffset=t.frameInfo,this.updateStatus()):BK.Script.log(0,0,"setDisableTextureFromSheetInfo error! Create texture failed.")}else BK.Script.log(0,0,"setDisableTextureFromSheetInfo error! textureFrameInfo is null or undefined")},t.prototype.hittest=function(t){return this.__nativeObj.hittest(t)},t.prototype.addChild=function(t){this.__nativeObj.addChild(t)},t.prototype.attach=function(t){this.__nativeObj.attach(t)},t.prototype.dispose=function(){this.__nativeObj.dispose()},t.prototype.setTexture=function(t){this.__nativeObj.setTexture(t)},t.prototype.removeFromParent=function(){this.__nativeObj.removeFromParent()},t.prototype.setNormalTextureFromUrl=function(t,e){this.normalUrl=t,new BK.HttpUtil(this.normalUrl).requestAsync(function(t,i){if(200==i){var r="GameSandBox://btntmp/"+this.normalUrl;BK.FileUtil.writeBufferToFile(r,t);var n=new BK.Texture(r);this.setNormalTexture(n)}else BK.Script.log(1,1,"Fetch advertisemSent image failed.");e&&e(this,i)}.bind(this))},t.prototype.setPressTextureFromUrl=function(t,e){this.pressUrl=t,new BK.HttpUtil(this.pressUrl).requestAsync(function(t,i){if(200==i){var r="GameSandBox://btntmp/"+this.pressUrl;BK.FileUtil.writeBufferToFile(r,t);var n=new BK.Texture(r);this.setPressTexture(n)}else BK.Script.log(1,1,"Fetch advertisement image failed.");e&&e(this,i)}.bind(this))},t.prototype.setDisableTextureFromUrl=function(t,e){this.disableUrl=t,new BK.HttpUtil(this.disableUrl).requestAsync(function(t,i){if(200==i){var r="GameSandBox://btntmp/"+this.disableUrl;BK.FileUtil.writeBufferToFile(r,t);var n=new BK.Texture(r);this.setDisableTexture(n)}else BK.Script.log(1,1,"Fetch advertisement image failed.");e&&e(this,i)}.bind(this))},t}),function(t,e){if("object"==typeof t){var i=function(){function t(t){return.01745329251994*t}return{Matrix:function(){function e(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(this.data=new Float32Array(16),arguments.length){if(1==arguments.length){if(arguments[0]instanceof e==1)for(var r=0;r<16;r++)this.data[r]=arguments[0].data[r]}else if(16==arguments.length)for(var n=0;n<16;n++)this.data[n]=arguments[n]}else this.data[0]=1,this.data[5]=1,this.data[10]=1,this.data[15]=1}return e.prototype.clone=function(){return new e(this)},e.prototype.mul=function(t){var e=this.data[0],i=this.data[1],r=this.data[2],n=this.data[3],o=this.data[4],a=this.data[5],s=this.data[6],h=this.data[7],c=this.data[8],l=this.data[9],u=this.data[10],d=this.data[11],_=this.data[12],f=this.data[13],g=this.data[14],p=this.data[15],m=t.data[0],v=t.data[1],S=t.data[2],b=t.data[3],B=t.data[4],T=t.data[5],y=t.data[6],E=t.data[7],x=t.data[8],C=t.data[9],R=t.data[10],A=t.data[11],I=t.data[12],O=t.data[13],M=t.data[14],D=t.data[15];return this.data[0]=e*m+o*v+c*S+_*b,this.data[1]=i*m+a*v+l*S+f*b,this.data[2]=r*m+s*v+u*S+g*b,this.data[3]=n*m+h*v+d*S+p*b,this.data[4]=e*B+o*T+c*y+_*E,this.data[5]=i*B+a*T+l*y+f*E,this.data[6]=r*B+s*T+u*y+g*E,this.data[7]=n*B+h*T+d*y+p*E,this.data[8]=e*x+o*C+c*R+_*A,this.data[9]=i*x+a*C+l*R+f*A,this.data[10]=r*x+s*C+u*R+g*A,this.data[11]=n*x+h*C+d*R+p*A,this.data[12]=e*I+o*O+c*M+_*D,this.data[13]=i*I+a*O+l*M+f*D,this.data[14]=r*I+s*O+u*M+g*D,this.data[15]=n*I+h*O+d*M+p*D,this},e.prototype.mulPoint=function(t){var e=this.data[0],i=this.data[1],r=this.data[2],n=this.data[3],o=this.data[4],a=this.data[5],s=this.data[6],h=this.data[7],c=this.data[8],l=this.data[9],u=this.data[10],d=this.data[11],_=this.data[12],f=this.data[13],g=this.data[14],p=this.data[15];void 0===t.z&&(t.z=0);var m={x:0,y:0,z:0};m.x=e*t.x+o*t.y+c*t.z+_,m.y=i*t.x+a*t.y+l*t.z+f,m.z=r*t.x+s*t.y+u*t.z+g;t.x,t.y,t.z;return m},e.prototype.inverse=function(){var t=this.data[10]*this.data[15]-this.data[14]*this.data[11],e=this.data[6]*this.data[15]-this.data[14]*this.data[7],i=this.data[6]*this.data[11]-this.data[10]*this.data[7],r=this.data[2]*this.data[15]-this.data[14]*this.data[3],n=this.data[2]*this.data[11]-this.data[10]*this.data[3],o=this.data[2]*this.data[7]-this.data[6]*this.data[3],a=this.data[9]*this.data[15]-this.data[13]*this.data[11],s=this.data[5]*this.data[15]-this.data[13]*this.data[7],h=this.data[5]*this.data[11]-this.data[9]*this.data[7],c=this.data[1]*this.data[15]-this.data[13]*this.data[3],l=this.data[1]*this.data[11]-this.data[9]*this.data[3],u=this.data[1]*this.data[7]-this.data[5]*this.data[3],d=this.data[9]*this.data[14]-this.data[13]*this.data[10],_=this.data[5]*this.data[14]-this.data[13]*this.data[6],f=this.data[5]*this.data[10]-this.data[9]*this.data[6],g=this.data[1]*this.data[14]-this.data[13]*this.data[2],p=this.data[1]*this.data[10]-this.data[9]*this.data[2],m=this.data[1]*this.data[6]-this.data[5]*this.data[2],v=this.data[5]*t-this.data[9]*e+this.data[13]*i,S=this.data[9]*r-this.data[1]*t-this.data[13]*n,b=this.data[1]*e-this.data[5]*r+this.data[13]*o,B=this.data[5]*n-this.data[1]*i-this.data[9]*o,T=this.data[8]*e-this.data[4]*t-this.data[12]*i,y=this.data[0]*t-this.data[8]*r+this.data[12]*n,E=this.data[4]*r-this.data[0]*e-this.data[12]*o,x=this.data[0]*i-this.data[4]*n+this.data[8]*o,C=this.data[4]*a-this.data[8]*s+this.data[12]*h,R=this.data[8]*c-this.data[0]*a-this.data[12]*l,A=this.data[0]*s-this.data[4]*c+this.data[12]*u,I=this.data[4]*l-this.data[0]*h-this.data[8]*u,O=this.data[8]*_-this.data[4]*d-this.data[12]*f,M=this.data[0]*d-this.data[8]*g+this.data[12]*p,D=this.data[4]*g-this.data[0]*_-this.data[12]*m,N=this.data[0]*f-this.data[4]*p+this.data[8]*m,P=this.data[0]*v+this.data[1]*T+this.data[2]*C+this.data[3]*O;return 0!=P&&(this.data[0]=v/P,this.data[4]=T/P,this.data[8]=C/P,this.data[12]=O/P,this.data[1]=S/P,this.data[5]=y/P,this.data[9]=R/P,this.data[13]=M/P,this.data[2]=b/P,this.data[6]=E/P,this.data[10]=A/P,this.data[14]=D/P,this.data[3]=B/P,this.data[7]=x/P,this.data[11]=I/P,this.data[15]=N/P),this},e.prototype.scale=function(t,i,r){var n=e.fromScale(t,i,r);return this.mul(n)},e.prototype.rotate=function(t,i,r){var n=e.fromEulerAngle(t,i,r);return this.mul(n)},e.prototype.translate=function(t,i,r){var n=e.fromTranslate(t,i,r);return this.mul(n)},e.prototype.transform=function(t,e,i){return{x:t*this.data[0]+e*this.data[4]+i*this.data[8]+1*this.data[12],y:t*this.data[1]+e*this.data[5]+i*this.data[9]+1*this.data[13],z:t*this.data[2]+e*this.data[6]+i*this.data[10]+1*this.data[14]}},e.prototype.toEulerAngle=function(){var t=0,e=0,i=0,r=this.data[0],n=this.data[4],o=this.data[8],a=this.data[5],s=this.data[2],h=this.data[6],c=this.data[10],l=-h;e=l<=-1?-1.570796:l>=1?1.570796:Math.asin(l),Math.abs(l)>.9999?(i=0,t=Math.atan2(-o,r)):(t=Math.atan2(s,c),i=Math.atan2(n,a));var u=new Float32Array(3);return u[0]=e,u[1]=t,u[2]=i,u},e.fromScale=function(t,i,r){var n=new e;return n.data[0]=t,n.data[5]=i,n.data[10]=r,n},e.fromTranslate=function(t,i,r){var n=new e;return n.data[12]=t,n.data[13]=i,n.data[14]=r,n},e.fromEulerAngle=function(i,r,n){var o=-t(i),a=-t(r),s=-t(n),h=Math.cos(o),c=Math.sin(o),l=Math.cos(a),u=Math.sin(a),d=Math.cos(s),_=Math.sin(s);return new e(h*d+c*u*_,-h*_+c*u*d,c*l,0,_*l,d*l,-u,0,-c*d+h*u*_,_*c+h*u*d,h*l,0,0,0,0,1)},e.fromViewport=function(t,i,r,n,o,a){var s=new e;return s.data[0]=(i-t)/2,s.data[5]=(n-r)/2,s.data[10]=(a-o)/2,s.data[12]=(t+i)/2,s.data[13]=(n+r)/2,s.data[14]=(o+a)/2,s.data[15]=1,s},e.fromOrthographic=function(t,i,r,n,o,a){var s=new e;return s.data[0]=2/(i-t),s.data[5]=2/(n-r),s.data[10]=2/(o-a),s.data[12]=(t+i)/(t-i),s.data[13]=(n+r)/(r-n),s.data[14]=(o+a)/(o-a),s.data[15]=1,s},e}()}}();t.JSMatrix=i.Matrix}}(BK),function(t,e){"object"==typeof t&&(t.JSTransform=function(){return function(){function t(e){if(void 0==e)this.transform=new Float32Array(19),this.transform[2]=1,this.transform[3]=1,this.transform[4]=1,this._localAnchorOrPivot=void 0,this._parentAnchorOrPivot=void 0,this._needUpdate=!0;else{if(e instanceof t!=1)throw new Error("BK.Transform.constructor!paramater error");this.transform=new Float32Array(19),this._localAnchorOrPivot=e._localAnchorOrPivot,this._parentAnchorOrPivot=e._parentAnchorOrPivot,this._needUpdate=e._needUpdate;for(var i=0;i<19;i++)this.transform[i]=e.transform[i]}this.matrix={get:function(){return null},set:function(t,e,i,r,n,o){this._needUpdate=!0,this.transform[2]=t,this.transform[3]=r,this.transform[4]=1,this.transform[5]=i,this.transform[6]=e,this.transform[7]=0,this.transform[8]=n,this.transform[9]=o,this.transform[10]=0}}}return Object.defineProperty(t.prototype,"needUpdate",{get:function(){return this._needUpdate},set:function(t){this._needUpdate=t},enumerable:!0,configurable:!0}),t.prototype.getNeedUpdate=function(){return this._needUpdate},t.prototype.setNeedUpdate=function(t){this._needUpdate=t},Object.defineProperty(t.prototype,"scale",{get:function(){return{x:this.transform[2],y:this.transform[3],z:this.transform[4]}},set:function(t){this.transform[2]==t.x&&this.transform[3]==t.y&&this.transform[4]==t.z||(this._needUpdate=!0,this.transform[2]=void 0==t.x?1:t.x,this.transform[3]=void 0==t.y?1:t.y,this.transform[4]=void 0==t.z?1:t.z)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotation",{get:function(){return{x:this.transform[5],y:this.transform[6],z:this.transform[7]}},set:function(t){this.transform[5]==t.x&&this.transform[6]==t.y&&this.transform[7]==t.z||(this._needUpdate=!0,this.transform[5]=void 0==t.x?0:t.x,this.transform[6]=void 0==t.y?0:t.y,this.transform[7]=void 0==t.z?0:t.z)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return{x:this.transform[8],y:this.transform[9],z:this.transform[10]}},set:function(t){this.transform[8]==t.x&&this.transform[9]==t.y&&this.transform[10]==t.z||(this._needUpdate=!0,this.transform[8]=void 0==t.x?0:t.x,this.transform[9]=void 0==t.y?0:t.y,this.transform[10]=void 0==t.z?0:t.z)},enumerable:!0,configurable:!0}),t.prototype.getPosition=function(){return{x:this.transform[8],y:this.transform[9],z:this.transform[10]}},t.prototype.setPosition=function(t,e,i){this.transform[8]==t&&this.transform[9]==e&&this.transform[10]==i||(this._needUpdate=!0,this.transform[8]=void 0==t?0:t,this.transform[9]=void 0==e?0:e,this.transform[10]=void 0==i?0:i)},Object.defineProperty(t.prototype,"localPivot",{get:function(){if(void 0!=this._localAnchorOrPivot&&0!=this._localAnchorOrPivot)throw new Error("BK.Transform.localPivot!current mode is localAnchor!!");return this._localAnchorOrPivot=0,{x:this.transform[11],y:this.transform[12]}},set:function(t){0==this._localAnchorOrPivot&&this.transform[11]==t.x&&this.transform[12]==t.y||(this._needUpdate=!0,this._localAnchorOrPivot=0,this.transform[11]=void 0==t.x?0:t.x,this.transform[12]=void 0==t.y?0:t.y)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"localAnchor",{get:function(){if(void 0!=this._localAnchorOrPivot&&1!=this._localAnchorOrPivot)throw new Error("BK.Transform.localAnchor!current mode is localPivot!!");return this._localAnchorOrPivot=1,{x:this.transform[13],y:this.transform[14]}},set:function(t){1==this._localAnchorOrPivot&&this.transform[13]==t.x&&this.transform[14]==t.y||(this._needUpdate=!0,this._localAnchorOrPivot=1,this.transform[13]=void 0==t.x?0:t.x,this.transform[14]=void 0==t.y?0:t.y)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pivotParent",{get:function(){if(void 0!=this._parentAnchorOrPivot&&0!=this._parentAnchorOrPivot)throw new Error("BK.Transform.pivotParent!current mode is anchorParent!!");return this._parentAnchorOrPivot=0,{x:this.transform[15],y:this.transform[16]}},set:function(t){0==this._parentAnchorOrPivot&&this.transform[15]==t.x&&this.transform[16]==t.y||(this._needUpdate=!0,this._parentAnchorOrPivot=0,this.transform[15]=void 0==t.x?0:t.x,this.transform[16]=void 0==t.y?0:t.y)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"anchorParent",{get:function(){if(void 0!=this._parentAnchorOrPivot&&1!=this._parentAnchorOrPivot)throw new Error("BK.Transform.anchorParent!current mode is pivotParent!!");return this._parentAnchorOrPivot=1,{x:this.transform[17],y:this.transform[18]}},set:function(t){1==this._parentAnchorOrPivot&&this.transform[17]==t.x&&this.transform[18]==t.y||(this._needUpdate=!0,this._parentAnchorOrPivot=1,this.transform[17]=void 0==t.x?0:t.x,this.transform[18]=void 0==t.y?0:t.y)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contentSize",{get:function(){return{width:this.transform[0],height:this.transform[1]}},set:function(t){this.transform[0]==t.width&&this.transform[1]==t.height||(this._needUpdate=!0,this.transform[0]=void 0==t.width?0:t.width,this.transform[1]=void 0==t.height?0:t.height)},enumerable:!0,configurable:!0}),t.prototype.getContentSize=function(){return{width:this.transform[0],height:this.transform[1]}},t.prototype.setContentSize=function(t,e){this.transform[0]==t&&this.transform[1]==e||(this._needUpdate=!0,this.transform[0]=void 0==t?0:t,this.transform[1]=void 0==e?0:e)},t.prototype.update=function(t,e){return 1==this._needUpdate&&(1==this._localAnchorOrPivot&&(this.transform[11]=this.transform[13]*this.transform[0],this.transform[12]=this.transform[14]*this.transform[1]),1==this._parentAnchorOrPivot&&(this.transform[15]=this.transform[17]*t,this.transform[16]=this.transform[18]*e),this._needUpdate=!1),this.transform},t}()}())}(BK);var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();!function(t,e){if("object"==typeof t){var i=function(){var t=function(){function t(){this.getTypeSize=function(t){return this._gl.BYTE==t?1:this._gl.UNSIGNED_BYTE==t?1:this._gl.SHORT==t?2:this._gl.UNSIGNED_SHORT==t?2:this._gl.INT==t?4:this._gl.UNSIGNED_INT==t?4:this._gl.FLOAT==t?4:void 0},this._ibo=0,this._vbo=0,this._program=0,this._hasLoadShader=!1,this._gl=bkWebGLGetInstance()}return t.__hookGlCommit=function(){var t=bkWebGLGetInstance();BK.GLRenderContext.__updataCallback(t),t.oldGlCommit()},t.hookGLCommit=function(t){this.__updataCallback=t,this.__gl=bkWebGLGetInstance(),this.__oldGlCommit=this.__gl.glCommit,this.__gl.glCommit=this.__hookGlCommit,this.__gl.oldGlCommit=this.__oldGlCommit,this.__hookGlCommit.bind(this.__gl)},t.exit=function(){this.__gl=bkWebGLGetInstance(),this.__oldGlCommit&&(this.__gl.glCommit=this.__oldGlCommit)},Object.defineProperty(t.prototype,"gl",{get:function(){return this._gl},enumerable:!0,configurable:!0}),t.prototype.__loadShader=function(t,e){var i,r=t||"uniform mat4 worldMat; uniform mat4 projMat; attribute vec2 pos; attribute vec2 inUVs; varying lowp vec2 outUVs; void main() { gl_Position = projMat * worldMat * vec4(pos, 0, 1); outUVs = inUVs; }",n=e||"varying lowp vec2 outUVs; uniform sampler2D uSampler; void main() { gl_FragColor = texture2D(uSampler, outUVs); }",o=this._gl.createShader(this._gl.VERTEX_SHADER);t&&(this._gl.enable(this._gl.BLEND),this._gl.blendFunc(gl.SRC_ALPHA,gl.ONE_MINUS_SRC_ALPHA)),0!=o&&(this._gl.shaderSource(o,r),this._gl.compileShader(o));var a=this._gl.createShader(this._gl.FRAGMENT_SHADER);0!=a&&(this._gl.shaderSource(a,n),this._gl.compileShader(a));var s=this._gl.createProgram();return this._gl.attachShader(s,o),this._gl.attachShader(s,a),this._gl.linkProgram(s),this._gl.deleteShader(o),this._gl.deleteShader(a),this._gl.getError()==this._gl.NO_ERROR?(this._program=s,this._gl.useProgram(this._program)):(i=this._gl.getProgramInfoLog(s),BK.Script.log(1,-1,"link program fail, err = "+i)),this.calculateProjection(),this._program},t.prototype.getProgram=function(){return this._program},t.prototype.__loadArrayBuffer=function(){var t=this._gl.getAttribLocation(this._program,"pos"),e=this._gl.getAttribLocation(this._program,"inUVs");0==this._vbo&&(this._vbo=this._gl.createBuffer()),this._gl.bindBuffer(this._gl.ARRAY_BUFFER,this._vbo),this._gl.enableVertexAttribArray(t),this._gl.enableVertexAttribArray(e),this._gl.glVertexAttribPointer(t,2,this._gl.FLOAT,!1,16,0,!0),this._gl.glVertexAttribPointer(e,2,this._gl.FLOAT,!1,16,8,!0),0==this._ibo&&(this._ibo=this._gl.createBuffer())},t.prototype.dispose=function(){0!=this._vbo&&this._gl.deleteBuffer(this._vbo),0!=this._ibo&&this._gl.deleteBuffer(this._ibo),0!=this._program&&this._gl.deleteProgram(this._program),this._gl=null},t.prototype.save=function(){this._prevVP=this._gl.glGetParameterInt(this._gl.VIEWPORT,4),this._prevVBO=this._gl.glGetParameterInt(this._gl.ARRAY_BUFFER_BINDING,1),this._prevIBO=this._gl.glGetParameterInt(this._gl.ELEMENT_ARRAY_BUFFER_BINDING,1),this._prevProgram=this._gl.glGetParameterInt(this._gl.CURRENT_PROGRAM,1),this._prevTextureID=this._gl.glGetParameterInt(this._gl.TEXTURE_BINDING_2D,1),this._prevTextureUnit=this._gl.glGetParameterInt(this._gl.ACTIVE_TEXTURE,1),this._prevFrameBuffer=this._gl.glGetParameterInt(this._gl.FRAMEBUFFER_BINDING,1),this._prevRenderBuffer=this._gl.glGetParameterInt(this._gl.RENDERBUFFER_BINDING,1),this._activeAttribusInfo=[];for(var t=this._gl.glGetProgramParameter(this._prevProgram,gl.ACTIVE_ATTRIBUTES),e=0;e<t;++e){var i=this._gl.getActiveAttrib(this._prevProgram,e),r=i.name,n=this._gl.getAttribLocation(this._prevProgram,r),o=this._gl.getVertexAttrib(n,this._gl.VERTEX_ATTRIB_ARRAY_SIZE),a=this._gl.getVertexAttrib(n,this._gl.VERTEX_ATTRIB_ARRAY_TYPE),s=this._gl.getVertexAttrib(n,this._gl.VERTEX_ATTRIB_ARRAY_NORMALIZED),h=this._gl.getVertexAttrib(n,this._gl.VERTEX_ATTRIB_ARRAY_STRIDE),c=this._gl.getVertexAttribOffset(n,gl.VERTEX_ATTRIB_ARRAY_POINTER);if(i.name=r,i.index=n,i.size=o,i.type=a,i.normalized=s,i.stride=h,i.offset=c,void 0!==this._gl.recordVertexAttribPointer)for(var l=0;l<this._gl.recordVertexAttribPointer.length;l++){var u=this._gl.recordVertexAttribPointer[l];if(i.index==u.index&&i.type==u.type&&i.stride==u.stride&&i.offset==u.offset){i.index=u.index,i.size=u.size,i.type=u.type,i.normalized=u.normalized,i.stride=u.stride,i.offset=u.offset;break}}this.debugLog("save name:"+i.name+" index:"+i.index+" size:"+i.size+" type:"+i.type+" normalized:"+i.normalized+" stride:"+i.stride+" offset:"+i.offset),this._activeAttribusInfo.push(i)}},t.prototype.restore=function(){if(this._gl.viewport(this._prevVP[0],this._prevVP[1],this._prevVP[2],this._prevVP[3]),this._gl.useProgram(this._prevProgram),this._gl.bindBuffer(this._gl.ARRAY_BUFFER,this._prevVBO),this._activeAttribusInfo.length>0){this._activeAttribusInfo[0].stride;for(var t=0;t<this._activeAttribusInfo.length;t++){var e=this._activeAttribusInfo[t],i=(e.name,e.index),r=e.size,n=e.type,o=e.normalized,a=e.offset,s=e.stride,h=0!=o;this.debugLog("restore name:"+e.name+" index:"+i+" size:"+r+" type:"+n+" normalized:"+o+" stride:"+s+" offset:"+a),this._gl.vertexAttribPointer(i,r,n,h,s,a,!0)}}this._activeAttribusInfo=[],this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER,this._prevIBO),this._gl.activeTexture(this._prevTextureUnit),this._gl.bindTexture(this._gl.TEXTURE_2D,this._prevTextureID),this._gl.glBindFramebuffer(this._gl.FRAMEBUFFER,this._prevFrameBuffer),this._gl.glBindRenderbuffer(this._gl.RENDERBUFFER,this._prevRenderBuffer)},t.prototype.setViewport=function(t,e,i,r){this._gl.viewport(t,e,i,r)},t.prototype.setProjection=function(t){this._projMat=t},t.prototype.calculateProjection=function(){var t=this._projMat.data;this._gl.useProgram(this._program);var e=this._gl.getUniformLocation(this._program,"projMat");this._gl.uniformMatrix4fv(e,!1,t);var i=this._gl.getUniformLocation(this._program,"uSampler");this._gl.uniform1i(i,0);this._gl.getError()},t.prototype.debugLog=function(t){},t.prototype.getProjection=function(){return this._projMat},t.prototype.drawMesh=function(t,e,i,r,n){this._program=n,this._gl.useProgram(this._program),this.__loadArrayBuffer();var o=this._gl.getUniformLocation(this._program,"worldMat");this._gl.uniformMatrix4fv(o,!1,i.data),this._gl.activeTexture(this._gl.TEXTURE0),this._gl.bindTexture(this._gl.TEXTURE_2D,r),this._gl.bindBuffer(this._gl.ARRAY_BUFFER,this._vbo),this._gl.bufferData(this._gl.ARRAY_BUFFER,t,this._gl.STATIC_DRAW),this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER,this._ibo),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,e,this._gl.STATIC_DRAW),this._gl.drawElements(this._gl.TRIANGLES,e.length,this._gl.UNSIGNED_SHORT,0)},t}();return{GLRenderNode:function(){function t(t,e){this._context=t,this._parent=null,this._childrens=new Array,this._textureID=0,this._localMatrix=new BK.JSMatrix,this._worldMatrix=new BK.JSMatrix,this._localTransform=new BK.JSTransform,this._zOrder=0,this._needSort=!1,this._needUpdate=!0,this._needUpdateWorldMatrix=!0,this.canUserInteract=!1,this.hidden=!1,this._hasDispose=!1,this.program=void 0,this._vs=e&&e.vs?e.vs:null,this._fs=e&&e.fs?e.fs:null}return Object.defineProperty(t.prototype,"path",{set:function(t){this._path!=t&&(this._path=t,0!=this._textureID&&(this._context.gl.deleteTexture(this._textureID),this._textureID=0))},enumerable:!0,configurable:!0}),t.prototype.setUrlPath=function(t,e){new BK.HttpUtil(t).requestAsync(function(i,r){if(1!=this._hasDispose){if(200==r){var n="GameSandBox://ad/"+t;BK.FileUtil.writeBufferToFile(n,i),this.path=n}else BK.Script.log(1,1,"Fetch advertisement Sent image failed.");e&&e(this,r)}else BK.Script.log(1,1,"node hasn been disposed.response ignore")}.bind(this))},Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},set:function(t){this._parent=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"zOrder",{get:function(){return this._zOrder},set:function(t){this._zOrder!=t&&(this._needSort=!0,this._zOrder=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scale",{get:function(){return this._localTransform.scale},set:function(t){var e=this._localTransform.scale;e.x==t.x&&e.y==t.y&&e.z==t.z||(this._needUpdate=!0,this._localTransform.scale=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotation",{get:function(){return this._localTransform.rotation},set:function(t){var e=this._localTransform.rotation;e.x==t.x&&e.y==t.y&&e.z==t.z||(this._localTransform.rotation=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._localTransform.position},set:function(t){var e=this._localTransform.position;e.x==t.x&&e.y==t.y&&e.z==t.z||(this._localTransform.position=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contentSize",{get:function(){return this._localTransform.getContentSize()},set:function(t){var e=this._localTransform.contentSize;e.width==t.width&&e.height==t.height||(this._needUpdate=!0,this._localTransform.contentSize=t)},enumerable:!0,configurable:!0}),t.prototype.getContentSize=function(){return this._localTransform.getContentSize()},t.prototype.setContentSize=function(t,e){this._localTransform.setContentSize(t,e)},Object.defineProperty(t.prototype,"localPivot",{get:function(){return this._localTransform.localPivot},set:function(t){var e=this._localTransform.localPivot;e.x==t.x&&e.y==t.y||(this._localTransform.localPivot=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"localAnchor",{get:function(){return this._localTransform.localAnchor},set:function(t){var e=this._localTransform.localAnchor;e.x==t.x&&e.y==t.y||(this._localTransform.localAnchor=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pivotParent",{get:function(){return this._localTransform.pivotParent},set:function(t){var e=this._localTransform.pivotParent;e.x==t.x&&e.y==t.y||(this._localTransform.pivotParent=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"anchorParent",{get:function(){return this._localTransform.anchorParent},set:function(t){var e=this._localTransform.anchorParent;e.x==t.x&&e.y==t.y||(this._localTransform.anchorParent=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"worldMatrix",{get:function(){if(0==this.__needUpdateTransform())return this._worldMatrix.clone();var t=this.matrixFromLocal(),e=null!=this._parent?this._parent.worldMatrix:new BK.JSMatrix;return this.__updateWorldMatrix(e.mul(t)),this._worldMatrix.clone()},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){if(this.children)for(var t=0;t<this.children.length;t++)this.children[t].dispose();this._context.gl.deleteTexture(this._textureID),this._hasDispose=!0},t.prototype.addChild=function(t){for(var e=0;e<this._childrens.length;e++)if(this._childrens[e]==t||null!=t.parent)return BK.Script.log(0,0,"BK.Node.addChild!node has been in node tree"),!1;return t.parent=this,this._needSort=!0,this._childrens.push(t),!0},Object.defineProperty(t.prototype,"children",{get:function(){return this._childrens},enumerable:!0,configurable:!0}),t.prototype.__needUpdateTransform=function(){return 1==this._needUpdateWorldMatrix||1==this._localTransform.getNeedUpdate()||null!=this._parent&&(this._needUpdateWorldMatrix=this._parent.__needUpdateTransform(),this._needUpdateWorldMatrix)},t.prototype.__updateWorldMatrix=function(t){this._worldMatrix=t,this._needUpdateWorldMatrix=!1,this._childrens.forEach(function(t){t._needUpdateWorldMatrix=!0})},t.prototype.matrixFromLocal=function(){if(0==this._localTransform.getNeedUpdate())return this._localMatrix.clone();var t;t=null!=this._parent?this._localTransform.update(this._parent._localTransform.transform[0],this._parent._localTransform.transform[1]):this._localTransform.update(0,0);var e=new BK.JSMatrix;e.translate(t[8],t[9],t[10]),e.rotate(t[5],t[6],t[7]),e.scale(t[2],t[3],t[4]);var i=new BK.JSMatrix;if(i.data[12]=-t[11],i.data[13]=-t[12],this._localMatrix=e.mul(i),null!=this._parent){var r=new BK.JSMatrix;r.data[12]=t[15],r.data[13]=t[16],this._localMatrix=r.mul(e)}return this._localMatrix.clone()},t.prototype.loadTexture=function(){if(0==this._textureID){if(this._path){var t=BK.Image.loadImage(this._path);if(!t)return 0;var e=this._context.gl;this._textureID=e.createTexture(),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this._textureID),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.glTexParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.glTexParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t)}return 1}return this._textureID},t.prototype.render=function(){if(1!=this.hidden){1==this._needSort&&(this._needSort=!1,this._childrens.sort(function(t,e){return t._zOrder<e._zOrder?1:0}));var t=this._localTransform.transform[0],e=this._localTransform.transform[1],i=new Uint16Array([0,1,2,0,2,3]),r=new Float32Array([0,0,0,1,t,0,1,1,t,e,1,0,0,e,0,0]),n=this.loadTexture();0!=n&&(this.program||(this.program=this._context.__loadShader(this._vs,this._fs)),this._context.drawMesh(r,i,this.worldMatrix,n,this.program));for(var o=0;o<this._childrens.length;o++)this._childrens[o].render()}},t.prototype.__log=function(t){BK.Script.log(1,1,"GLRenderNode:"+t)},t.prototype.hittest=function(t){this._context.getProjection();var e=this.worldMatrix,i={x:0,y:0},r={x:i.x+this.contentSize.width,y:i.y+this.contentSize.height},n=e.mulPoint(i),o=e.mulPoint(r);return t.x>=n.x&&t.x<=o.x&&t.y>=n.y&&t.y<=o.y},t}(),GLRenderContext:t}}();t.GLRenderNode=i.GLRenderNode,t.GLRenderContext=i.GLRenderContext}}(BK),function(t,e){"object"==typeof t&&("object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.GLRenderButton=e())}(BK,function(){return function(t){function e(e,i,r){var n=t.call(this,e)||this;return n.updateTexture=function(t){},n.__nativeObj=new BK.GLRenderNode(e),n.contentSize={width:i,height:r},n.isCancelClick=void 0,n.touchStatus=0,n.canUserInteract=!0,n.enable=!0,n.canClick=!0,n.addTouchListener(),n}return __extends(e,t),e.prototype.addTouchListener=function(){"undefined"!=typeof UIEventHandler?(UIEventHandler.addNodeEvent(this,1,function(t,e,i,r){t.isCancelClick=!1,t.enable?t.changeStatus(1):t.changeStatus(2)}.bind(this)),UIEventHandler.addNodeEvent(this,2,function(t,e,i,r){var n={x:i,y:r};0==t.hittest(n)&&(t.isCancelClick=!0)}.bind(this)),UIEventHandler.addNodeEvent(this,3,function(t,e,i,r){t.enable?t.changeStatus(0):t.changeStatus(2),0==t.isCancelClick&&t.touchInsideCallback&&1==this.canClick&&t.touchInsideCallback(t)}.bind(this))):BK.Script.log(1,1,"UIEventHandler is undefined")},e.prototype.dispose=function(){UIEventHandler.removeNodeEvent(this,1),UIEventHandler.removeNodeEvent(this,2),UIEventHandler.removeNodeEvent(this,3),t.prototype.dispose.call(this)},e.prototype.changeStatus=function(t){this.touchStatus=t,this.updateTexture(t)},e.prototype.setTouchInsideCallback=function(t){this.touchInsideCallback=t},e}(BK.GLRenderNode)}),function(t,e){"object"==typeof t&&("object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.PlusTips=e())}(BK,function(){return function(){function t(t){if(this.useWebGl=!0,1==arguments.length&&(this.useWebGl=t),this.screenWidth=BK.Director.screenPixelSize.width,this.screenHeight=BK.Director.screenPixelSize.height,this.screenMode=0,this.createNum=0,this.node=new Array(3),this.maskUrl="https://i.hudongcdn.com/plusRes/mask.png",this.tipsUrl_v="https://i.hudongcdn.com/plusRes/plusTips_v.png",this.tipsUrl_h="https://i.hudongcdn.com/plusRes/plusTips_h.png",this.sureBtnUrl="https://i.hudongcdn.com/plusRes/button.png",this.screenWidth>this.screenHeight){this.screenMode=1,this.scale_x=this.screenWidth/1334,this.scale_y=this.screenHeight/750;e=this.scale_x>this.scale_y?this.scale_y:this.scale_x;this.tipsWidth=700*e/BK.Director.root.scale.x,this.tipsHeight=524*e/BK.Director.root.scale.y,this.tips_x=(this.screenWidth/BK.Director.root.scale.x-this.tipsWidth)/2,this.tips_y=162*this.scale_y/BK.Director.root.scale.y,this.buttonWidth=260*e/BK.Director.root.scale.x,this.buttonHeight=81*e/BK.Director.root.scale.y,this.button_x=(this.screenWidth/BK.Director.root.scale.x-this.buttonWidth)/2,this.button_y=41*this.scale_x/BK.Director.root.scale.y}else{this.scale_x=this.screenWidth/750,this.scale_y=this.screenHeight/1334;var e=this.scale_x>this.scale_y?this.scale_y:this.scale_x;this.tipsWidth=452*e/BK.Director.root.scale.x,this.tipsHeight=820*e/BK.Director.root.scale.y,this.tips_x=(this.screenWidth/BK.Director.root.scale.x-this.tipsWidth)/2,this.tips_y=362*this.scale_y/BK.Director.root.scale.y,this.buttonWidth=260*e/BK.Director.root.scale.x,this.buttonHeight=79*e/BK.Director.root.scale.y,this.button_x=(this.screenWidth/BK.Director.root.scale.x-this.buttonWidth)/2,this.button_y=197*this.scale_y/BK.Director.root.scale.y}this.tipsUrl=1==this.screenMode?this.tipsUrl_h:this.tipsUrl_v,this.screenWidth=this.screenWidth/BK.Director.root.scale.x,this.screenHeight=this.screenHeight/BK.Director.root.scale.y}return t.prototype.showTips=function(t){this.useWebGl?this.showTipsWebGL(t):this.showTipsBK(t)},t.prototype.showTipsWebGL=function(t){this.context=new BK.GLRenderContext;var e=BK.JSMatrix.fromOrthographic(0,BK.Director.screenPixelSize.width,0,BK.Director.screenPixelSize.height,-1,1);this.context.setProjection(e),this.node[0]=new BK.GLRenderNode(this.context,{vs:"uniform mat4 worldMat; uniform mat4 projMat; attribute vec2 pos; attribute vec2 inUVs; varying lowp vec2 outUVs; void main() { gl_Position = projMat * worldMat * vec4(pos, 0, 1); outUVs = inUVs; }",fs:"precision mediump float; uniform sampler2D uSampler; void main() { gl_FragColor = texture2D(uSampler,vec2(0,0)); gl_FragColor.a = 0.8; }"}),this.node[0].setUrlPath(this.maskUrl),this.node[0].contentSize={width:this.screenWidth,height:this.screenHeight},this.node[0].position={x:0,y:0},this.node[0].canUserInteract=!0,this.node[1]=new BK.GLRenderNode(this.context),this.node[1].setUrlPath(this.tipsUrl),this.node[1].path=1==this.screenMode?"GameRes://resource/plusTips_h.png":"GameRes://resource/plusTips_v.png",this.node[1].contentSize={width:this.tipsWidth,height:this.tipsHeight},this.node[1].position={x:this.tips_x,y:this.tips_y},this.node[0].addChild(this.node[1]),this.node[2]=new BK.GLRenderButton(this.context,this.buttonWidth,this.buttonHeight),this.node[2].setUrlPath(this.sureBtnUrl),this.node[2].position={x:this.button_x,y:this.button_y},this.node[2].canUserInteract=!0,this.node[2].setTouchInsideCallback(t),this.node[0].addChild(this.node[2]),UIEventHandler&&UIEventHandler.setRootNode(this.node[0]);var i=this;BK.GLRenderContext.hookGLCommit(function(){i.context.save(),gl.viewport(0,0,BK.Director.screenPixelSize.width,BK.Director.screenPixelSize.height),i.context.gl.useProgram(i.context.getProgram()),i.node[0].render(),i.context.restore()})},t.prototype.showTipsBK=function(t){this.callback=t;var e={x:0,y:0},i={r:0,g:0,b:0,a:.8};this.bkCreateSprite(0,this.maskUrl,this.screenWidth,this.screenHeight,e,i);var r={x:this.tips_x,y:this.tips_y},n={r:1,g:1,b:1,a:1.25};this.bkCreateSprite(1,this.tipsUrl,this.tipsWidth,this.tipsHeight,r,n);var o={x:this.button_x,y:this.button_y},a={r:1,g:1,b:1,a:1.25};this.bkCreateSprite(2,this.sureBtnUrl,this.buttonWidth,this.buttonHeight,o,a),BK.Script.getTouchModeAll=1,BK.Director.ticker.add(function(t,e){BK.TouchEvent.getAllTouchEvent();BK.TouchEvent.updateTouchStatus()}.bind(this))},t.prototype.bkCreateSprite=function(t,e,i,r,n,o){var a=this;new BK.HttpUtil(e).requestAsync(function(s,h){if(200==h){var c=e.split("/"),l=c[c.length-1],u="GameSandBox://plusRes/"+l;if(BK.Script.log(0,0," picName = "+l+" path == "+u),BK.FileUtil.writeBufferToFile(u,s),t<2){var d=new BK.Texture(u);a.node[t]=new BK.Sprite(i,r,d,0,1,1,1)}else a.node[t]=new BK.Button(i,r,u,a.callback);a.node[t].zOrder=0,a.node[t].position=n,a.node[t].canUserInteract=!0,a.node[t].color=o,3==++a.createNum&&(BK.Director.root.addChild(a.node[0]),a.node[0].addChild(a.node[1]),a.node[0].addChild(a.node[2]))}else a.callback()})},t}()}),function(t,e){if("object"==typeof t){var i=function(){var t="attribute vec3 Position; attribute vec2 TexCoordIn; attribute vec4 SourceColor; uniform mat4 ModelView; uniform mat4 Projection; varying vec4 DestColor; varying vec2 TexCoordOut; void main() { mat4 gWVP = Projection * ModelView; gl_Position = gWVP * vec4(Position, 1); DestColor = SourceColor; TexCoordOut = TexCoordIn; }",e="varying lowp vec2 TexCoordOut; uniform int formatYUV; uniform sampler2D samplerY; uniform sampler2D samplerU; uniform sampler2D samplerV; uniform sampler2D samplerUV; const lowp vec3 defyuv = vec3(-0.0/255.0, -128.0/255.0, -128.0/255.0); void main(void) { lowp vec3 yuv = vec3(0.0); if (formatYUV == 0) { yuv.x = texture2D(samplerY, TexCoordOut).r; yuv.y = texture2D(samplerU, TexCoordOut).r; yuv.z = texture2D(samplerV, TexCoordOut).r; yuv += defyuv; } else if (formatYUV == 1) { yuv.x = texture2D(samplerY, TexCoordOut).r; yuv.y = texture2D(samplerUV, TexCoordOut).a; yuv.z = texture2D(samplerUV, TexCoordOut).r; yuv += defyuv; } else if (formatYUV == 3) { yuv.x = texture2D(samplerY, TexCoordOut).r; yuv.y = texture2D(samplerUV, TexCoordOut).r; yuv.z = texture2D(samplerUV, TexCoordOut).a; yuv += defyuv; } lowp vec3 rgb = mat3(1.0, 1.0, 1.0, 0.0, -.34414, 1.772, 1.402, -.71414, 0.0) * yuv; gl_FragColor = vec4(rgb, 1.0); }",i=(function(){function t(){}}(),function(){function t(){}}(),function(){function t(){this.videoViews=new Array,void 0!==BK.Director.setQAVDelegate&&BK.Director.setQAVDelegate(this)}return t.prototype.addView=function(t){var e=this.videoViews.filter(function(e){return t==e});return e.length||this.videoViews.push(t),0==e.length},t.prototype.delView=function(t){var e=this.videoViews.length;return this.videoViews=this.videoViews.filter(function(e){return t!=e}),e!=this.videoViews.length},t.prototype.onRemoveVideoPreview=function(t){this.videoViews.forEach(function(e){e.identifier==t.identifier&&e.render(t)})},t.prototype.onLocalVideoPreview=function(t){this.videoViews.forEach(function(e){if(e.identifier==t.identifier){var i=t,r=e;r.onPrePreview&&(i=r.onPrePreview.call(r,t)),e.render(i)}})},t.prototype.onLocalVideoPreProcess=function(t){this.videoViews.forEach(function(e){if(e.identifier==t.identifier){var i=e;i.onPreProcess&&i.onPreProcess.call(i,t)}})},t.Instance=new t,t}()),r=function(){function r(t,e,r,n,o,a,s){this.identifier=t,this.__nativeObj=new BK.Sprite(e,r,null,0,0,1,1),this._innerBindMethods4NativeObj(),null!=n&&void 0!=n||(n=!0),a&&(this.position=a),o?o.addChild(this):BK.Director.root.addChild(this),s&&(this.zOrder=s),1==n&&i.Instance.addView(this)}return r.prototype._innerBindMethods4NativeObj=function(t){var e=this;Object.getOwnPropertyNames(this.__nativeObj).forEach(function(i,r,n){var o=i;t&&-1!=t.indexOf(o)||Object.defineProperty(e,o,{get:function(){return this.__nativeObj[o]},set:function(t){this.__nativeObj[o]=t},enumerable:!0,configurable:!0})})},r.prototype.addChild=function(t){this.__nativeObj&&this.__nativeObj.addChild(t)},r.prototype._restartRenderTimer=function(){this.__renderTimeoutCallback&&this.__renderTimeoutThreshold>0&&(BK.Director.ticker.removeTimeout(this),BK.Director.ticker.setTimeout(function(t,e,i){this.__renderTimeoutCallback&&this.__renderTimeoutCallback.call(this)},this.__renderTimeoutThreshold,this))},r.prototype._innerUseRGBA=function(t,e){if(this.__bitmap){var i=this.__bitmap.size;i.width==t&&i.height==e||(BK.Script.log(0,0,"BK.QAVView.useRGBA!size change, ow = "+i.width+", oh = "+i.height+", nw = "+t+", nh = "+e),this.__bitmap=BK.Texture.createBitmapTexture(t,e),this.__nativeObj.setTexture(this.__bitmap))}else this.__bitmap=BK.Texture.createBitmapTexture(t,e),this.__nativeObj.setTexture(this.__bitmap)},r.prototype._innerUseYUVMaterial_I420=function(i,r){if(this.__yuvMaterial||(this.__yuvMaterial=new BK.Render.Material(t,e,!0),this.__nativeObj.attachComponent(this.__yuvMaterial),this.__yuvMaterial.uniforms.samplerY=0,this.__yuvMaterial.uniforms.samplerU=1,this.__yuvMaterial.uniforms.samplerV=2,this.__yuvMaterial.uniforms.samplerUV=3),this.__bitmapY){var n=this.__bitmapY.size;n.width==i&&n.height==r||(BK.Script.log(0,0,"BK.QAVView.useYUVMaterial_I420!Y size change, ow = "+n.width+", oh = "+n.height+", nw = "+i+", nh = "+r),this.__bitmapY=BK.Texture.createBitmapTexture(i,r,7),this.__yuvMaterial.setTexture(0,this.__bitmapY))}else this.__bitmapY=BK.Texture.createBitmapTexture(i,r,7),this.__yuvMaterial.setTexture(0,this.__bitmapY);if(this.__bitmapU){var o=this.__bitmapU.size;o.width==i/2&&o.height==r/2||(BK.Script.log(0,0,"BK.QAVView.useYUVMaterial_I420!U size change, ow = "+o.width+", oh = "+o.height+", nw = "+i+", nh = "+r),this.__bitmapU=BK.Texture.createBitmapTexture(i/2,r/2,7),this.__yuvMaterial.setTexture(1,this.__bitmapU))}else this.__bitmapU=BK.Texture.createBitmapTexture(i/2,r/2,7),this.__yuvMaterial.setTexture(1,this.__bitmapU);if(this.__bitmapV){var a=this.__bitmapV.size;a.width==i/2&&a.height==r/2||(BK.Script.log(0,0,"BK.QAVView.useYUVMaterial_I420!V size change, ow = "+a.width+", oh = "+a.height+", nw = "+i+", nh = "+r),this.__bitmapV=BK.Texture.createBitmapTexture(i/2,r/2,7),this.__yuvMaterial.setTexture(2,this.__bitmapV))}else this.__bitmapV=BK.Texture.createBitmapTexture(i/2,r/2,7),this.__yuvMaterial.setTexture(2,this.__bitmapV)},r.prototype._innerUseYUVMaterial_NVxx=function(i,r){if(this.__yuvMaterial||(this.__yuvMaterial=new BK.Render.Material(t,e,!0),this.__nativeObj.attachComponent(this.__yuvMaterial),this.__yuvMaterial.uniforms.samplerY=0,this.__yuvMaterial.uniforms.samplerU=1,this.__yuvMaterial.uniforms.samplerV=2,this.__yuvMaterial.uniforms.samplerUV=3),this.__bitmapY){var n=this.__bitmapY.size;n.width==i&&n.height==r||(BK.Script.log(0,0,"BK.QAVView.useYUVMaterial_NVxx!Y size change, ow = "+n.width+", oh = "+n.height+", nw = "+i+", nh = "+r),this.__bitmapY=BK.Texture.createBitmapTexture(i,r,7),this.__yuvMaterial.setTexture(0,this.__bitmapY))}else this.__bitmapY=BK.Texture.createBitmapTexture(i,r,7),this.__yuvMaterial.setTexture(0,this.__bitmapY);if(this.__bitmapUV){var o=this.__bitmapUV.size;o.width==i/2&&o.height==r/2||(BK.Script.log(0,0,"BK.QAVView.useYUVMaterial_NVxx!UV size change, ow = "+o.width+", oh = "+o.height+", nw = "+i+", nh = "+r),this.__bitmapUV=BK.Texture.createBitmapTexture(i/2,r/2,2),this.__yuvMaterial.setTexture(3,this.__bitmapUV))}else this.__bitmapUV=BK.Texture.createBitmapTexture(i/2,r/2,2),this.__yuvMaterial.setTexture(3,this.__bitmapUV)},r.prototype.render=function(t){var e=t.frameDesc.width,i=t.frameDesc.height;if(this.__nativeObj){switch(this._restartRenderTimer(),t.frameDesc.rotate){case 0:this.cameraPos&&1==this.cameraPos?this.__nativeObj.setUVFlip(1,0):this.__nativeObj.setUVFlip(1,1);break;case 1:case 2:this.cameraPos&&1==this.cameraPos?(this.__nativeObj.setUVFlip(0,1),this.__nativeObj.setUVRotate(1)):(this.__nativeObj.setUVFlip(0,0),this.__nativeObj.setUVRotate(1));break;case 3:this.cameraPos&&1==this.cameraPos?(this.__nativeObj.setUVFlip(0,1),this.__nativeObj.setUVRotate(3)):(this.__nativeObj.setUVFlip(0,0),this.__nativeObj.setUVRotate(3))}switch(t.frameDesc.colorFormat){case 10:this._innerUseRGBA(e,i),this.__bitmap.uploadSubData(0,0,e,i,t.extraData.buffer);break;case 0:this._innerUseYUVMaterial_I420(e,i),this.__yuvMaterial.uniforms.formatYUV=t.frameDesc.colorFormat,this.__bitmapY.uploadSubData(0,0,e,i,t.extraData.Y),this.__bitmapU.uploadSubData(0,0,e/2,i/2,t.extraData.U),this.__bitmapV.uploadSubData(0,0,e/2,i/2,t.extraData.V);break;case 3:case 1:this._innerUseYUVMaterial_NVxx(e,i),this.__yuvMaterial.uniforms.formatYUV=t.frameDesc.colorFormat,this.__bitmapY.uploadSubData(0,0,e,i,t.extraData.Y),this.__bitmapUV.uploadSubData(0,0,e/2,i/2,t.extraData.UV);break;default:BK.Script.log(1,-1,"BK.QAVView.render!unknown format = "+t.frameDesc.colorFormat)}}},r.prototype.renderAsCache=function(t,e,i,r,n,o,a,s){switch(o){case 0:this._innerUseYUVMaterial_I420(t,e),this.__yuvMaterial.uniforms.formatYUV=o,this.__bitmapY.uploadSubData(0,0,t,e,s.Y),this.__bitmapU.uploadSubData(0,0,t/2,e/2,s.U),this.__bitmapV.uploadSubData(0,0,t/2,e/2,s.V);break;case 3:case 1:this._innerUseYUVMaterial_NVxx(t,e),this.__yuvMaterial.uniforms.formatYUV=o,this.__bitmapY.uploadSubData(0,0,t,e,s.Y),this.__bitmapUV.uploadSubData(0,0,t/2,e/2,s.UV);break;default:return BK.Script.log(1,-1,"BK.QAVView.renderAsCache!unknown format = "+o),null}if(this.__graphic||(this.__graphic=new BK.Graphics),this.__cacheTexture){var h=this.__cacheTexture.size;h.width==i&&h.height==r||(BK.Script.log(0,0,"BK.QAVView.renderAsCache!cache tex size change, ow = "+h.width+", oh = "+h.height+", nw = "+i+", nh = "+r),this.__cacheTexture=new BK.RenderTexture(i,r,a))}else this.__cacheTexture=new BK.RenderTexture(i,r,a);if(this.__cacheSprite){var c=this.__cacheSprite.size;c.width==i&&c.height==r||(this.__cacheSprite.size={width:i,height:r})}else this.__cacheSprite=new BK.Sprite(i,r,null,0,0,1,1),this.__cacheSprite.attachComponent(this.__yuvMaterial);switch(n){case 0:this.__cacheSprite.setUVFlip(1,0),this.__cacheSprite.setUVRotate(0);break;case 1:this.__cacheSprite.setUVFlip(1,0),this.__cacheSprite.setUVRotate(1);break;case 2:this.__cacheSprite.setUVFlip(0,1),this.__cacheSprite.setUVRotate(0);break;case 3:this.__cacheSprite.setUVFlip(1,0),this.__cacheSprite.setUVRotate(4)}var l=this;return this.__graphic.drawRenderTexture(this.__cacheTexture,function(){this.drawSprite(l.__cacheSprite)}),this.__cacheTexture.readPixels(0,0,i,r,a)},r.prototype.renderAsTexture=function(){var t=new BK.RenderTexture(this.__nativeObj.size.width,this.__nativeObj.size.height,6);return BK.Render.renderToTexture(this.__nativeObj,t),t},r.prototype.hittest=function(t){return this.__nativeObj.hittest(t)},r.prototype.removeFromParent=function(){this.__nativeObj&&this.__nativeObj.removeFromParent()},r.prototype.setRenderTimeout=function(t,e){this.__renderTimeoutCallback=e,this.__renderTimeoutThreshold=t,this.__renderTimeoutThreshold>0&&this._restartRenderTimer()},r}(),n=function(){function t(){this.skipNum=-1}return t.prototype.start=function(t){function e(t,e,i){if(BK.Script.log(0,0,"BK.Camera.switchCameraEvent222!data = "+JSON.stringify(i)),0==t){BK.Script.log(0,0,"BK.Camera.switchCameraEvent!data = "+JSON.stringify(i));var r=this;BK.Director.ticker.removeTimeout(this),BK.Director.ticker.setTimeout(function(t,e,n){r.view.cameraPos=i.cameraPos,r=null},160,this)}}var n=t.identifier?t.identifier:"";if(t.width&&t.height){BK.Script.log(1,0,"BK.Camera!options = "+JSON.stringify(t)),this.options=t,this.identifier=n,this.view=new r(n,t.width,t.height,!1,t.parent,t.position),i.Instance.addView(this),this.options.needFaceTracker&&(this.detector=new BK.AI.FaceDetector(!0,!0));return BK.MQQ.SsoRequest.addListener("cs.audioRoom_camera_switch.local",this,e.bind(this)),this.isStart=!1,this}},t.prototype.configCamera=function(t){if(t&&(BK.Script.log(0,0,"configCamera"),BK.Script.log(0,0,"configCamera BK.Room ok1"),t.beauty&&(BK.Script.log(0,0,"configCamera BK.Room audioRoomSetBeauty1"),this.setBeauty(t.beauty)),t.cameraPos)){BK.Script.log(0,0,"configCamera BK.Room cameraPos");t.onSwitchCamera&&t.onSwitchCamera.bind(this);this.switchCamera(t.cameraPos,function(t,e,i){BK.Script.log(0,0,"configCamera BK.Room cameraPos errCode:"+t+" cmd:"+e+" data:"+i),this.options.onSwitchCamera&&this.options.onSwitchCamera(t,e,i)})}},t.prototype.switchCamera=function(t,e){var i={cameraPos:t},r="cs.audioRoom_cameraswitch.local";BK.MQQ.SsoRequest.addListener(r,this,e.bind(this)),BK.MQQ.SsoRequest.send(i,r)},t.prototype.setBeauty=function(t){var e={beauty:t};BK.MQQ.SsoRequest.send(e,"cs.audioRoom_set_beauty.local")},t.prototype.setSpeaker=function(t){var e={speaker:t};BK.MQQ.SsoRequest.send(e,"cs.audioRoom_set_speaker.local")},t.prototype.close=function(){},t.prototype._innerConvertRGBA=function(t){var e=this.options.scaleSample?this.options.scaleSample:1,i=t.frameDesc.width,r=t.frameDesc.height,n=function(t,e,i){var r={width:t,height:e};switch(i){case 1:case 3:r.width=e,r.height=t}return r}(t.frameDesc.width,t.frameDesc.height,t.frameDesc.rotate),o={};return o.frameDesc={},o.extraData={},o.frameDesc.width=n.width*e,o.frameDesc.height=n.height*e,o.frameDesc.rotate=0,o.frameDesc.colorFormat=10,o.frameDesc.videoSrcType=t.frameDesc.videoSrcType,o.extraData.buffer=this.view.renderAsCache(i,r,n.width*e,n.height*e,t.frameDesc.rotate,t.frameDesc.colorFormat,6,t.extraData),o},t.prototype.onPrePreview=function(t){if(this.options.onPrePreview){var e=t;if(this.detector){e=this._innerConvertRGBA(t);var i=this._innerExtractBitmap(e);(this.hasFace||-1==this.skipNum)&&(this.skipNum=0,e.faceFeatures=this.detector.detectForBitmapSync(i)),void 0==e.faceFeatures||e.faceFeatures.length<=0?(this.hasFace=!1,this.skipNum=this.skipNum+1,(this.skipNum>this.options.skipFaceTrackerNum||this.skipNum==this.options.skipFaceTrackerNum)&&(e.faceFeatures=this.detector.detectForBitmapSync(i),this.skipNum=0,e.faceFeatures&&(this.hasFace=!0))):this.hasFace=!0}this.options.onPrePreview.call(this,e)}return 0==this.isStart&&(this.configCamera(this.options),this.isStart=!0),t},t.prototype.onPreProcess=function(t){return this.options.onPreProcess?this.options.onPreProcess.call(this,t):t},t.prototype.render=function(t){this.view&&this.view.render(t)},t.prototype.renderAsTexture=function(){return this.view?this.view.renderAsTexture():null},t.prototype._innerExtractBitmap=function(t){var e={};switch(e.width=t.frameDesc.width,e.height=t.frameDesc.height,e.format=t.frameDesc.colorFormat,t.frameDesc.colorFormat){case 7:e.format=3;break;case 10:e.buffer=t.extraData.buffer,e.format=6;break;default:BK.Script.log(1,-1,"BK.QAVCamera.extractBitmap!unknown format = "+t.frameDesc.colorFormat)}switch(t.frameDesc.rotate){case 0:e.oreintation=0;break;case 1:e.oreintation=1;break;case 2:e.oreintation=5;break;case 3:e.oreintation=6}return e},t.Instance=new t,t}();return{QAVView:r,QAVCamera:new n}}();t.QAVView=i.QAVView,t.AVCamera=i.QAVCamera}}(BK),function(t,e){"object"==typeof t&&(BK.QQAVManager=function(){return new(function(){function t(){this._hasInitFlag=!1,this._hasSuccEnter=!1,this._iosHasInitFlag=!1,this._isFrontCamera=!1,this._hasStartQAVRoomFlag=!1,this._callbackQueue=[],BK.MQQ.SsoRequest.addListener("cs.audioRoom_disconnect.local",this,this.__handleRoomDisconnect.bind(this)),BK.MQQ.SsoRequest.addListener("cs.audioRoom_update_userinfo.local",this,this.__handleUserUpdate.bind(this))}return t.prototype.log=function(t){BK.Script.log(0,0,"QQAVManager:"+t)},t.prototype.errorLog=function(t){BK.Script.log(1,1,"QQAVManager Error:"+t)},t.prototype.setQAVCfg=function(t){this.qavCfg=t},t.prototype.setUpdateUserInfoCallback=function(t){var e="cs.audioRoom_update_userinfo.local";BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,t)},t.prototype.setEventCallbackConfig=function(t){this.eventCallbackConfig=t},t.prototype.initQAV=function(t,e){this.setQAVCfg(t),this.__startQAVRoom(e)},t.prototype.setMic=function(t,e){this.__enterQAVRoomIfNeed(function(i){if(0==i){var r={switch:t},n="cs.audioRoom_set_mic.local";BK.MQQ.SsoRequest.removeListener(n,this),BK.MQQ.SsoRequest.addListener(n,this,e),BK.MQQ.SsoRequest.send(r,n)}else this.errorLog("setMic failed!start qav room failed")}.bind(this))},t.prototype.setSpeaker=function(t,e){this.__enterQAVRoomIfNeed(function(i){if(0==i){var r={switch:t},n="cs.audioRoom_set_speaker.local";BK.MQQ.SsoRequest.removeListener(n,this),BK.MQQ.SsoRequest.addListener(n,this,e),BK.MQQ.SsoRequest.send(r,n)}else this.errorLog("setSpeaker failed!start qav room failed")}.bind(this))},t.prototype.switchCamera=function(t,e){this.__enterQAVRoomIfNeed(function(i){if(0==i){var r={cameraPos:t},n="cs.audioRoom_camera_switch.local";BK.MQQ.SsoRequest.removeListener(n,this),BK.MQQ.SsoRequest.addListener(n,this,function(i,r,n){0==i&&(this._isFrontCamera=0==t),e(i,r,n)}.bind(this)),BK.MQQ.SsoRequest.send(r,n)}else this.errorLog("switchCamera failed!start qav room failed")}.bind(this))},t.prototype.enableCamera=function(t,e){this.__enterQAVRoomIfNeed(function(i){if(0==i){var r={switch:t},n="cs.audioRoom_camera_enable.local";this._isFrontCamera=!0,BK.MQQ.SsoRequest.removeListener(n,this),BK.MQQ.SsoRequest.addListener(n,this,e),BK.MQQ.SsoRequest.send(r,n)}else this.errorLog("enableCamera failed!start qav room failed")}.bind(this))},t.prototype.setBeauty=function(t){this.__enterQAVRoomIfNeed(function(e){if(0==e){var i={beauty:t};BK.MQQ.SsoRequest.send(i,"cs.audioRoom_set_beauty.local")}else this.errorLog("setBeauty failed!start qav room failed")}.bind(this))},t.prototype.setLocalVideo=function(t){this.__enterQAVRoomIfNeed(function(e){if(0==e){var i={switch:t};BK.MQQ.SsoRequest.send(i,"cs.audioRoom_set_local_video.local")}else this.errorLog("setLocalVideo failed!start qav room failed")}.bind(this))},t.prototype.watchRemoteVideo=function(t){this.__enterQAVRoomIfNeed(function(e){if(0==e){this.log("watchRemoteVideo ok1");var i={openIdList:t};BK.MQQ.SsoRequest.send(i,"cs.audioRoom_watch_remote_video.local"),this.log("watchRemoteVideo ok2")}else this.errorLog("watchRemoteVideo failed!start qav room failed")}.bind(this))},t.prototype.setRemoteVideo=function(t){this.__enterQAVRoomIfNeed(function(e){if(0==e){var i={switch:t};BK.MQQ.SsoRequest.send(i,"cs.audioRoom_set_remote_video.local")}else this.errorLog("setMic failed!start qav room failed")}.bind(this))},t.prototype.exitRoom=function(t){this._hasInitFlag=!1,this.__exitQAVRoom(function(e,i,r){this.log("exit qav room errCode:"+e),t(e,i,r)}.bind(this))},t.prototype.getEndpointList=function(t){var e={},i="cs.audioRoom_get_endpointList.local";t&&(BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,t)),BK.MQQ.SsoRequest.send(e,i)},t.prototype.isFrontCamera=function(){return this._isFrontCamera},t.prototype.getFluidCtrlCfg=function(t,e){var i="cs.audioRoom_get_fluid_ctrl_cfg.local";e&&(BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,e)),BK.MQQ.SsoRequest.send(t,i)},t.prototype.changeAudioCategory=function(t,e){var i="cs.audioRoom_change_audio_category.local",r={category:t};e&&(BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,e)),BK.MQQ.SsoRequest.send(r,i)},t.prototype.changeQAVRole=function(t,e){var i="cs.audioRoom_change_qav_role.local",r={role:t};e&&(BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,e)),BK.MQQ.SsoRequest.send(r,i)},t.prototype.__enterQAVRoomIfNeed=function(t){this._hasSuccEnter?t(0):(this.log("__enterQAVRoomIfNeed entering qav room."),this._callbackQueue.push(t),0==this._hasStartQAVRoomFlag&&(this._hasStartQAVRoomFlag=!0,this.__startQAVRoom(function(t,e,i){for(var r=0;r<this._callbackQueue.length;r++)(0,this._callbackQueue[r])(t);this._callbackQueue.splice(0,this._callbackQueue.length)}.bind(this))))},t.prototype.initQAVRoom=function(t,e){var i="cs.audioRoom_init.local";if("ios"==GameStatusInfo.platform&&1==this._iosHasInitFlag)return this.log("ios init once "),void e(0,i,this._initData);1!=this._hasInitFlag?(BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,function(t,i,r){this.log("cmd:"+i+" errCode:"+t+" data:"+JSON.stringify(r)),0==t&&(this._hasInitFlag=!0,this._initData=r,"ios"==GameStatusInfo.platform&&(this._iosHasInitFlag=!0,this.log("_iosHasInitFlag"))),e(t,i,r)}.bind(this)),BK.MQQ.SsoRequest.send(t,i)):this.log("AVRoom has been init .can't init Room twice !!")},t.prototype.enterQAVRoom=function(t,e){var i=t.gameRoomId,r=t.avRoomId,n=t.avRoleName,o={avRoomId:r,gameRoomId:i,avRoleName:n,avKey:t.avKey};this.avRoomId=r,this.gameRoomId=i,this.avRoleName=n;var a="cs.audioRoom_enter.local";BK.MQQ.SsoRequest.removeListener(a,this),BK.MQQ.SsoRequest.addListener(a,this,function(t,i,r){this.log("cmd:"+i+" errCode:"+t+" data:"+JSON.stringify(r)),e(t,i,r)}.bind(this)),BK.MQQ.SsoRequest.send(o,a),BK.MQQ.SsoRequest.removeListener("cs.close_room.local",this),BK.MQQ.SsoRequest.addListener("cs.close_room.local",this,function(t,e,i){this.log("BK.QAVManager.closeGame!exitQAVRoom, avRoomId = "+this.avRoomId),this.__exitQAVRoom()}.bind(this)),BK.MQQ.SsoRequest.removeListener("cs.audioRoom_req_audio_session.local",this),BK.MQQ.SsoRequest.addListener("cs.audioRoom_req_audio_session.local",this,function(t,e,i){this.log("BK.QAVManager.reqAudioSession!result = "+JSON.stringify(i))}.bind(this))},t.prototype.__exitQAVRoom=function(t){var e={avRoomId:this.avRoomId},i="cs.audioRoom_exit.local";BK.MQQ.SsoRequest.removeListener(i,this),BK.MQQ.SsoRequest.addListener(i,this,t),BK.MQQ.SsoRequest.send(e,i)},t.prototype.__checkGameStatusInfoParam=function(){return GameStatusInfo.avAppId?GameStatusInfo.avAccountType?GameStatusInfo.avRoomId?GameStatusInfo.roomId?{sdkAppId:GameStatusInfo.avAppId,accountType:GameStatusInfo.avAccountType,avRoomId:GameStatusInfo.avRoomId,gameRoomId:GameStatusInfo.roomId}:(this.log("GameStatusInfo.roomId is null"),null):(this.log("GameStatusInfo.avRoomId is null"),null):(this.log("GameStatusInfo.avAccountType is null"),null):(this.log("GameStatusInfo.avAppId is null"),null)},t.prototype.__addQAVCfg=function(t){if(this.qavCfg)for(var e in this.qavCfg)if(this.qavCfg.hasOwnProperty(e)){var i=this.qavCfg[e];t[e]=i}return t},t.prototype.__startQAVRoom=function(t){if(GameStatusInfo.devPlatform){var e={sdkAppId:1400035750,accountType:14181,avRoomId:122333,gameRoomId:54321,selfOpenId:GameStatusInfo.openId};e=this.__addQAVCfg(e),this.initAndEnterRoom(e,t)}else(e=this.__checkGameStatusInfoParam())?(e=this.__addQAVCfg(e),this.initAndEnterRoom(e,function(e,i,r){t(e,i,r)}.bind(this))):BK.QQ.addSSOJoinRoomCallBack(function(e,i,r){r.gameRoomId&&r.avRoomId&&r.sdkAppId&&r.accountType?(r=this.__addQAVCfg(r),this.initAndEnterRoom(r,t)):BK.Script.log(0,0,"addSSOJoinRoomCallBack data is incorrect.")}.bind(this))},t.prototype.initAndEnterRoom=function(t,e){void 0!=t.sdkAppId?void 0!=t.accountType?void 0!=t.avRoomId?void 0!=t.gameRoomId?(this.setQAVCfg(t),this.log("initAndEnterRoom step1 initRoom cfg:"+JSON.stringify(t)),this.initQAVRoom(t,function(i,r,n){0==i?(this.log("initAndEnterRoom step2 enterRoom"),this.enterQAVRoom(t,function(t,i,r){0==t?(this.log("initAndEnterRoom step2 enterRoom succ!"),this._hasSuccEnter=!0):this._hasStartQAVRoomFlag=!1,e(t,i,r)}.bind(this))):(this.log("initAndEnterRoom failed cmd:"+r+" errCode:"+i+" data:"+JSON.stringify(n)),this._hasStartQAVRoomFlag=!1,e(i,r,n))}.bind(this))):this.log("initAndEnterRoom gameRoomId is null;"):this.log("initAndEnterRoom avRoomId is null;"):this.log("initAndEnterRoom accountType is null;"):this.log("initAndEnterRoom sdkAppId is null;")},t.prototype.__handleUserUpdate=function(t,e,i){i&&(this.log("handleUserUpdate data:"+JSON.stringify(i)),1==i.eventId?(this.log("进入房间事件:"+JSON.stringify(i.userInfo)),this.eventCallbackConfig&&this.eventCallbackConfig.eventEnterCallback&&this.eventCallbackConfig.eventEnterCallback(i.eventId,i)):2==i.eventId?(this.log("退出房间事件:"+JSON.stringify(i.userInfo)),this.eventCallbackConfig&&this.eventCallbackConfig.eventExitCallback&&this.eventCallbackConfig.eventExitCallback(i.eventId,i)):3==i.eventId?(this.log("有发摄像头视频事件。:"+JSON.stringify(i.userInfo)),this.eventCallbackConfig&&this.eventCallbackConfig.eventHasCameraVideoCallback&&this.eventCallbackConfig.eventHasCameraVideoCallback(i.eventId,i)):4==i.eventId?(this.log("无发摄像头视频事件。:"+JSON.stringify(i.userInfo)),this.eventCallbackConfig&&this.eventCallbackConfig.eventNoCameraVideoCallback&&this.eventCallbackConfig.eventNoCameraVideoCallback(i.eventId,i)):5==i.eventId?(this.log("有发语音事件。:"+JSON.stringify(i.userInfo)),this.eventCallbackConfig&&this.eventCallbackConfig.eventHasAudioCallback&&this.eventCallbackConfig.eventHasAudioCallback(i.eventId,i)):6==i.eventId?(this.log("无发语音事件。:"+JSON.stringify(i.userInfo)),this.eventCallbackConfig&&this.eventCallbackConfig.eventNoAudioCallback&&this.eventCallbackConfig.eventNoAudioCallback(i.eventId,i)):7==i.eventId?(this.log("有发屏幕视频事件。:"+JSON.stringify(i.userInfo)),this.eventCallbackConfig&&this.eventCallbackConfig.eventHasScreenVideoCallback&&this.eventCallbackConfig.eventHasScreenVideoCallback(i.eventId,i)):8==i.eventId?(this.log("无发屏幕视频事件。:"+JSON.stringify(i.userInfo)),this.eventCallbackConfig&&this.eventCallbackConfig.eventNoScreenVideoCallback&&this.eventCallbackConfig.eventNoScreenVideoCallback(i.eventId,i)):9==i.eventId?(this.log("有发文件视频事件。:"+JSON.stringify(i.userInfo)),this.eventCallbackConfig&&this.eventCallbackConfig.eventHasMediaFileCallback&&this.eventCallbackConfig.eventHasMediaFileCallback(i.eventId,i)):10==i.eventId?(this.log("无发文件视频事件。:"+JSON.stringify(i.userInfo)),this.eventCallbackConfig&&this.eventCallbackConfig.eventNoMediaFileCallback&&this.eventCallbackConfig.eventNoMediaFileCallback(i.eventId,i)):42==i.eventId?(this.log("新成员说话:"+JSON.stringify(i.userInfo)),this.eventCallbackConfig&&this.eventCallbackConfig.eventNewSpeakCallback&&this.eventCallbackConfig.eventNewSpeakCallback(i.eventId,i)):43==i.eventId&&(this.log("旧成员停止说话:"+JSON.stringify(i.userInfo)),this.eventCallbackConfig&&this.eventCallbackConfig.eventOldStopSpeakCallback&&this.eventCallbackConfig.eventOldStopSpeakCallback(i.eventId,i)))},t.prototype.__handleRoomDisconnect=function(t,e,i){this.eventCallbackConfig&&this.eventCallbackConfig.eventRoomDisconnectCallback&&this.eventCallbackConfig.eventRoomDisconnectCallback(i)},t}())}())}(BK),function(t,e){"object"==typeof t&&("object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.QRCode=e())}(BK,function(){function t(t){this.mode=s.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,i=this.data.length;e<i;e++){var r=[],n=this.data.charCodeAt(e);n>65536?(r[0]=240|(1835008&n)>>>18,r[1]=128|(258048&n)>>>12,r[2]=128|(4032&n)>>>6,r[3]=128|63&n):n>2048?(r[0]=224|(61440&n)>>>12,r[1]=128|(4032&n)>>>6,r[2]=128|63&n):n>128?(r[0]=192|(1984&n)>>>6,r[1]=128|63&n):r[0]=n,this.parsedData.push(r)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function e(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function i(t,e){if(void 0==t.length)throw new Error(t.length+"/"+e);for(var i=0;i<t.length&&0==t[i];)i++;this.num=new Array(t.length-i+e);for(var r=0;r<t.length-i;r++)this.num[r]=t[r+i]}function r(t,e){this.totalCount=t,this.dataCount=e}function n(){this.buffer=[],this.length=0}function o(t,e){for(var i=1,r=a(t),n=0,o=_.length;n<=o;n++){var s=0;switch(e){case h.L:s=_[n][0];break;case h.M:s=_[n][1];break;case h.Q:s=_[n][2];break;case h.H:s=_[n][3]}if(r<=s)break;i++}if(i>_.length)throw new Error("Too long data");return i}function a(t){var e=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!=t?3:0)}t.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,i=this.parsedData.length;e<i;e++)t.put(this.parsedData[e],8)}},e.prototype={addData:function(e){var i=new t(e);this.dataList.push(i),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,i){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,i),this.typeNumber>=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=e.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,i)},setupPositionProbePattern:function(t,e){for(var i=-1;i<=7;i++)if(!(t+i<=-1||this.moduleCount<=t+i))for(var r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(this.modules[t+i][e+r]=0<=i&&i<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==i||6==i)||2<=i&&i<=4&&2<=r&&r<=4)},getBestMaskPattern:function(){for(var t=0,e=0,i=0;i<8;i++){this.makeImpl(!0,i);var r=l.getLostPoint(this);(0==i||t>r)&&(t=r,e=i)}return e},createMovieClip:function(t,e,i){var r=t.createEmptyMovieClip(e,i);this.make();for(var n=0;n<this.modules.length;n++)for(var o=1*n,a=0;a<this.modules[n].length;a++){var s=1*a;this.modules[n][a]&&(r.beginFill(0,100),r.moveTo(s,o),r.lineTo(s+1,o),r.lineTo(s+1,o+1),r.lineTo(s,o+1),r.endFill())}return r},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)null==this.modules[t][6]&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)null==this.modules[6][e]&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=l.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var i=0;i<t.length;i++){var r=t[e],n=t[i];if(null==this.modules[r][n])for(var o=-2;o<=2;o++)for(var a=-2;a<=2;a++)this.modules[r+o][n+a]=-2==o||2==o||-2==a||2==a||0==o&&0==a}},setupTypeNumber:function(t){for(var e=l.getBCHTypeNumber(this.typeNumber),i=0;i<18;i++){r=!t&&1==(e>>i&1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=r}for(i=0;i<18;i++){var r=!t&&1==(e>>i&1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=r}},setupTypeInfo:function(t,e){for(var i=this.errorCorrectLevel<<3|e,r=l.getBCHTypeInfo(i),n=0;n<15;n++){o=!t&&1==(r>>n&1);n<6?this.modules[n][8]=o:n<8?this.modules[n+1][8]=o:this.modules[this.moduleCount-15+n][8]=o}for(n=0;n<15;n++){var o=!t&&1==(r>>n&1);n<8?this.modules[8][this.moduleCount-n-1]=o:n<9?this.modules[8][15-n-1+1]=o:this.modules[8][15-n-1]=o}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var i=-1,r=this.moduleCount-1,n=7,o=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var s=0;s<2;s++)if(null==this.modules[r][a-s]){var h=!1;o<t.length&&(h=1==(t[o]>>>n&1)),l.getMask(e,r,a-s)&&(h=!h),this.modules[r][a-s]=h,-1==--n&&(o++,n=7)}if((r+=i)<0||this.moduleCount<=r){r-=i,i=-i;break}}}},e.PAD0=236,e.PAD1=17,e.createData=function(t,i,o){for(var a=r.getRSBlocks(t,i),s=new n,h=0;h<o.length;h++){var c=o[h];s.put(c.mode,4),s.put(c.getLength(),l.getLengthInBits(c.mode,t)),c.write(s)}for(var u=0,h=0;h<a.length;h++)u+=a[h].dataCount;if(s.getLengthInBits()>8*u)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+8*u+")");for(s.getLengthInBits()+4<=8*u&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;;){if(s.getLengthInBits()>=8*u)break;if(s.put(e.PAD0,8),s.getLengthInBits()>=8*u)break;s.put(e.PAD1,8)}return e.createBytes(s,a)},e.createBytes=function(t,e){for(var r=0,n=0,o=0,a=new Array(e.length),s=new Array(e.length),h=0;h<e.length;h++){var c=e[h].dataCount,u=e[h].totalCount-c;n=Math.max(n,c),o=Math.max(o,u),a[h]=new Array(c);for(p=0;p<a[h].length;p++)a[h][p]=255&t.buffer[p+r];r+=c;var d=l.getErrorCorrectPolynomial(u),_=new i(a[h],d.getLength()-1).mod(d);s[h]=new Array(d.getLength()-1);for(p=0;p<s[h].length;p++){var f=p+_.getLength()-s[h].length;s[h][p]=f>=0?_.get(f):0}}for(var g=0,p=0;p<e.length;p++)g+=e[p].totalCount;for(var m=new Array(g),v=0,p=0;p<n;p++)for(h=0;h<e.length;h++)p<a[h].length&&(m[v++]=a[h][p]);for(p=0;p<o;p++)for(h=0;h<e.length;h++)p<s[h].length&&(m[v++]=s[h][p]);return m};for(var s={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},h={L:1,M:0,Q:3,H:2},c={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},l={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var e=t<<10;l.getBCHDigit(e)-l.getBCHDigit(l.G15)>=0;)e^=l.G15<<l.getBCHDigit(e)-l.getBCHDigit(l.G15);return(t<<10|e)^l.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;l.getBCHDigit(e)-l.getBCHDigit(l.G18)>=0;)e^=l.G18<<l.getBCHDigit(e)-l.getBCHDigit(l.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;0!=t;)e++,t>>>=1;return e},getPatternPosition:function(t){return l.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,i){switch(t){case c.PATTERN000:return(e+i)%2==0;case c.PATTERN001:return e%2==0;case c.PATTERN010:return i%3==0;case c.PATTERN011:return(e+i)%3==0;case c.PATTERN100:return(Math.floor(e/2)+Math.floor(i/3))%2==0;case c.PATTERN101:return e*i%2+e*i%3==0;case c.PATTERN110:return(e*i%2+e*i%3)%2==0;case c.PATTERN111:return(e*i%3+(e+i)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new i([1],0),r=0;r<t;r++)e=e.multiply(new i([1,u.gexp(r)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case s.MODE_NUMBER:return 10;case s.MODE_ALPHA_NUM:return 9;case s.MODE_8BIT_BYTE:case s.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case s.MODE_NUMBER:return 12;case s.MODE_ALPHA_NUM:return 11;case s.MODE_8BIT_BYTE:return 16;case s.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else{if(!(e<41))throw new Error("type:"+e);switch(t){case s.MODE_NUMBER:return 14;case s.MODE_ALPHA_NUM:return 13;case s.MODE_8BIT_BYTE:return 16;case s.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}}},getLostPoint:function(t){for(var e=t.getModuleCount(),i=0,r=0;r<e;r++)for(l=0;l<e;l++){for(var n=0,o=t.isDark(r,l),a=-1;a<=1;a++)if(!(r+a<0||e<=r+a))for(var s=-1;s<=1;s++)l+s<0||e<=l+s||0==a&&0==s||o==t.isDark(r+a,l+s)&&n++;n>5&&(i+=3+n-5)}for(r=0;r<e-1;r++)for(l=0;l<e-1;l++){var h=0;t.isDark(r,l)&&h++,t.isDark(r+1,l)&&h++,t.isDark(r,l+1)&&h++,t.isDark(r+1,l+1)&&h++,0!=h&&4!=h||(i+=3)}for(r=0;r<e;r++)for(l=0;l<e-6;l++)t.isDark(r,l)&&!t.isDark(r,l+1)&&t.isDark(r,l+2)&&t.isDark(r,l+3)&&t.isDark(r,l+4)&&!t.isDark(r,l+5)&&t.isDark(r,l+6)&&(i+=40);for(l=0;l<e;l++)for(r=0;r<e-6;r++)t.isDark(r,l)&&!t.isDark(r+1,l)&&t.isDark(r+2,l)&&t.isDark(r+3,l)&&t.isDark(r+4,l)&&!t.isDark(r+5,l)&&t.isDark(r+6,l)&&(i+=40);for(var c=0,l=0;l<e;l++)for(r=0;r<e;r++)t.isDark(r,l)&&c++;return i+=10*(Math.abs(100*c/e/e-50)/5)}},u={glog:function(t){if(t<1)throw new Error("glog("+t+")");return u.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return u.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},d=0;d<8;d++)u.EXP_TABLE[d]=1<<d;for(d=8;d<256;d++)u.EXP_TABLE[d]=u.EXP_TABLE[d-4]^u.EXP_TABLE[d-5]^u.EXP_TABLE[d-6]^u.EXP_TABLE[d-8];for(d=0;d<255;d++)u.LOG_TABLE[u.EXP_TABLE[d]]=d;i.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<t.getLength();n++)e[r+n]^=u.gexp(u.glog(this.get(r))+u.glog(t.get(n)));return new i(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=u.glog(this.get(0))-u.glog(t.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(n=0;n<t.getLength();n++)r[n]^=u.gexp(u.glog(t.get(n))+e);return new i(r,0).mod(t)}},r.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r.getRSBlocks=function(t,e){var i=r.getRsBlockTable(t,e);if(void 0==i)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var n=i.length/3,o=[],a=0;a<n;a++)for(var s=i[3*a+0],h=i[3*a+1],c=i[3*a+2],l=0;l<s;l++)o.push(new r(h,c));return o},r.getRsBlockTable=function(t,e){switch(e){case h.L:return r.RS_BLOCK_TABLE[4*(t-1)+0];case h.M:return r.RS_BLOCK_TABLE[4*(t-1)+1];case h.Q:return r.RS_BLOCK_TABLE[4*(t-1)+2];case h.H:return r.RS_BLOCK_TABLE[4*(t-1)+3];default:return}},n.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var i=0;i<e;i++)this.putBit(1==(t>>>e-i-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var _=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],f=function(){};return f.createQRModel=function(t,i){var r,n=new e(o(t,(r=void 0===i?{width:256,height:256,colorDark:{r:0,g:0,b:0,a:1},colorLight:{r:1,g:1,b:1,a:1},correctLevel:2}:i).correctLevel),r.correctLevel);return n.addData(t),n.make(),n},f.createQRCodeNode=function(t,e){var i;i=void 0===e?{width:256,height:256,colorDark:{r:0,g:0,b:0,a:1},colorLight:{r:1,g:1,b:1,a:1},correctLevel:2}:e;for(var r=new BK.Canvas(i.width,i.height),n=f.createQRModel(t,e),o=n.getModuleCount(),a=i.width/o,s=i.height/o,h=Math.round(a),c=Math.round(s),l=0;l<o;l++)for(var u=0;u<o;u++){var d=n.isDark(l,u),_=u*a,g=l*s;r.lineWidth=1,r.fillColor=d?i.colorDark:i.colorLight,r.drawStyle=0,r.fillRect(_,g,a,s),r.strokeColor=d?i.colorDark:i.colorLight,r.strokeRect(Math.ceil(_)-.5,Math.ceil(g)-.5,h,c),r.strokeRect(Math.ceil(_)+.5,Math.ceil(g)+.5,h,c)}return r},f.createQRCodeToFile=function(t,e,i){var r=f.createQRCodeNode(e,i);return r.saveTo(t),r.dispose(),!0},f.compose=function(t,e,i,r){var n=BK.Director.screenPixelSize.width,o=BK.Director.screenPixelSize.height,a=new BK.Canvas(n,o);a.drawImage(t,0,0),a.drawImage(e,0,0),a.saveTo("GameSandBox://compose.png"),a.dispose()},f}),function(t,e){var i=function(){function t(t,e){this.loadJsonAtlasArray(t,function(t,i){for(var r=0;r<i.length;r++){var n=i[r],o=n.jsonInfo,a=n.atlasInfo,s=o.data,h=a.data,c=o.path,l=a.path;this.loadAccessory(s,c,h,l)}e(t,i)}.bind(this))}function e(t,e){var i=[t];this.loadJsonAtlasArray(i,function(i,r){if(0==i){var n=r[0],o=n.jsonInfo,a=n.atlasInfo,s=o.data,h=a.data,c=o.path,l=a.path,u=this.load(s,c,h,l);e(u,t)}else e(-1,null)}.bind(this))}function i(t,e,i){BK.fileSystem.readFile({file:[{path:t},{path:e}],success:function(t){BK.Script.log(1,0,"res = "+JSON.stringify(t));for(var e,r,n=0;n<t.length;n++){var o=t[n],a=o.path,s=a.substring(a.lastIndexOf("."));".json"==s?e=o:".atlas"==s&&(r=o)}i(0,e,r)}})}function r(t,e){for(var i=[],r=0;r<t.length;r++){var n=t[r],o={path:n.json},a={path:n.atlas};i.push(o),i.push(a)}BK.fileSystem.readFile({file:i,success:function(i){BK.Script.log(1,0,"res = "+JSON.stringify(i));for(var r=0;r<i.length;r++){var n=i[r],o=n.path,a=o.substring(o.lastIndexOf(".")),s=!1;".json"==a?s=!0:".atlas"==a&&(s=!1);for(var h=0;h<t.length;h++){var c=t[h],l=null;if(s){u=(l=c.json).substring(l.indexOf("://")+3,l.length);o.indexOf(u)>0&&(t[h].jsonInfo=n)}else{var u=(l=c.atlas).substring(l.indexOf("://")+3,l.length);o.indexOf(u)>0&&(t[h].atlasInfo=n)}}}e(0,t)}})}function n(t,e,i){var r=[t];this.loadJsonAtlasArray(r,function(r,n){if(0==r){var o=n[0],a=o.jsonInfo,s=o.atlasInfo,h=a.data,c=s.data,l=a.path,u=s.path,d=this.loadAccessoryAnimation(h,l,c,u,e);i(d,e,t)}else i(-1,e,null)}.bind(this))}return{setAccessoryAsync:t,loadJsonAtlas:i,loadSkeletonAsync:e,setAccessoryAnimationAsync:n,loadJsonAtlasArray:r}}();t.SkeletonAnimation.__proto__.setAccessoryAsync=i.setAccessoryAsync,t.SkeletonAnimation.__proto__.loadJsonAtlas=i.loadJsonAtlas,t.SkeletonAnimation.__proto__.loadSkeletonAsync=i.loadSkeletonAsync,t.SkeletonAnimation.__proto__.setAccessoryAnimationAsync=i.setAccessoryAnimationAsync,t.SkeletonAnimation.__proto__.loadJsonAtlasArray=i.loadJsonAtlasArray}(BK),function(t,e){"object"==typeof t&&(t.AdBannerHandler=function(){return{AdBannerHandler:function(){function t(t,e){this.closeUrl="https://i.hudongcdn.com/game_cdn/ad_close.png",this.adIconUrl="https://i.hudongcdn.com/game_cdn/ad_icon.png",this.pos_id=t,this.event={},this.adInfo=e,this.sizeW=.78*BK.Director.screenPixelSize.width;var i=BK.Director.screenPixelSize.width;i>BK.Director.screenPixelSize.height&&(this.sizeW=.44*i),this.sizeH=166*this.sizeW/582,this.closeBtnW=46*this.sizeW/582,this.clsoeBtnH=46*this.sizeH/166,this.btnSpace=14*this.sizeH/166,BK.Script.log(1,1," constructor: "+this.btnSpace),this.adIconW=74*this.sizeW/582,this.adIconH=46*this.sizeH/166}return t.prototype.isUseWebGL=function(){return void 0!==gl},t.prototype.onClickContent=function(t){this.event.onClickContent=t},t.prototype.onClickClose=function(t){this.event.onClickClose=t},t.prototype.show=function(t){this.isUseWebGL()?this.showWebGLNode(t):this.showBKNode(t)},t.prototype._onLoadBackgroundCallback=function(t,e,i){200==e?(this.exposeureReport(),i(0,"OK",this)):(i(-1,"load image failed!",this),this.close())},t.prototype._jumpToDestPage=function(){BK.MQQ.Webview.open(this.adInfo.report_info.click_url)},t.prototype._emmitClickEvent=function(){this.event.onClickContent&&this.event.onClickContent()},t.prototype._onClickContentBtn=function(){this._emmitClickEvent(),this._jumpToDestPage()},t.prototype._reportClick=function(){this.clickReport(),this.cmshowReport(3)},t.prototype._onClickCloseBtn=function(){this.event.onClickClose&&this.event.onClickClose(),this.closeReport(),this.close()},t.prototype.showBKNode=function(t){this.rootNode=new BK.Node,this.rootNode.canUserInteract=!0,this.backgound=new BK.Button(this.sizeW,this.sizeH),this.backgound.setNormalTextureFromUrl(this.adInfo.display_info.basic_info.img,function(e,i){this._onLoadBackgroundCallback(e,i,t)}.bind(this)),this.rootNode.addChild(this.backgound),this.closeBtn=new BK.Button(this.closeBtnW,this.clsoeBtnH),this.closeBtn.position={x:this.sizeW-this.closeBtnW-this.btnSpace,y:this.sizeH-this.clsoeBtnH-this.btnSpace},this.closeBtn.setNormalTextureFromUrl(this.closeUrl,function(t,e){}.bind(this)),this.rootNode.addChild(this.closeBtn),this.adIconBtn=new BK.Button(this.adIconW,this.adIconH),this.adIconBtn.position={x:this.btnSpace,y:this.btnSpace},this.adIconBtn.setNormalTextureFromUrl(this.adIconUrl,function(t,e){200!=e&&BK.Script.log(1,1,"")}.bind(this)),this.rootNode.addChild(this.adIconBtn),this.backgound.setTouchInsideCallback(function(t){this._onClickContentBtn()}.bind(this)),this.closeBtn.setTouchInsideCallback(function(t){this._onClickCloseBtn()}.bind(this)),this.renderBKNode()},t.prototype.renderBKNode=function(){var t=BK.Director.screenPixelSize.width/BK.Director.root.scale.x,e=this.sizeW*(1/BK.Director.root.scale.x);this.rootNode.position={x:(t-e)/2,y:0},this.rootNode.scale={x:1/BK.Director.root.scale.x,y:1/BK.Director.root.scale.y},BK.Director.root.addChild(this.rootNode)},t.prototype.closeBKNode=function(){this.rootNode.removeFromParent()},t.prototype.showWebGLNode=function(t){this.context=new BK.GLRenderContext;var e=BK.JSMatrix.fromOrthographic(0,BK.Director.screenPixelSize.width,0,BK.Director.screenPixelSize.height,-1,1);this.context.setProjection(e);var i=BK.Director.screenPixelSize.width;BK.Director.screenPixelSize.height;this.glRootNode=new BK.GLRenderButton(this.context,this.sizeW,this.sizeH),this.glRootNode.canUserInteract=!0,this.glRootNode.canClick=!1,this.glRootNode.setUrlPath(this.adInfo.display_info.basic_info.img,function(e,i){this.glRootNode.canClick=!0,this._onLoadBackgroundCallback(e,i,t)}.bind(this)),this.glRootNode.position={x:(i-this.sizeW)/2,y:0},this.glCloseBtn=new BK.GLRenderButton(this.context,this.closeBtnW,this.clsoeBtnH),this.glCloseBtn.setUrlPath(this.closeUrl),this.glCloseBtn.position={x:this.sizeW-this.closeBtnW-this.btnSpace,y:this.sizeH-this.clsoeBtnH-this.btnSpace},this.glRootNode.addChild(this.glCloseBtn),this.glAdIconBtn=new BK.GLRenderButton(this.context,this.adIconW,this.adIconH),this.glAdIconBtn.setUrlPath(this.adIconUrl),this.glAdIconBtn.position={x:this.btnSpace,y:this.btnSpace},this.glRootNode.addChild(this.glAdIconBtn),this.glRootNode.setTouchInsideCallback(function(t){this._onClickContentBtn(),this._reportClick()}.bind(this)),this.glCloseBtn.setTouchInsideCallback(function(t){this._onClickCloseBtn()}.bind(this)),this.renderWebGLNode()},t.prototype.renderWebGLNode=function(){UIEventHandler.setRootNode(this.glRootNode),BK.GLRenderContext.hookGLCommit(function(t){if(this.context&&this.glRootNode){if(0==t.methodWorking)return;this.context.save(),t.viewport(0,0,BK.Director.screenPixelSize.width,BK.Director.screenPixelSize.height),t.disable(t.DEPTH_TEST),t.useProgram(this.context.getProgram()),this.glRootNode.render(),this.context.restore()}}.bind(this))},t.prototype.closeWebGLNode=function(){this.glRootNode&&this.glRootNode.dispose(),this.context&&this.context.dispose(),this.glRootNode=null,this.context=null,BK.GLRenderContext.exit()},t.prototype.close=function(){this.isUseWebGL()?this.closeWebGLNode():this.closeBKNode()},t.prototype.exposeureReport=function(t,e,i){if(this.adInfo.report_info&&this.adInfo.report_info.exposure_url){var r=this.adInfo.report_info.exposure_url,n=new BK.HttpUtil(r);BK.Script.log(0,0,"exposeureReport param:"+t+" exposure_url:"+r),n.requestAsync(function(t,e){200==e?BK.Script.log(1,1,"exposeureReport succ."):BK.Script.log(1,1,"exposeureReport failed.statuscode:"+e)}.bind(this)),this.cmshowReport(0,t,e,i)}else BK.Script.log(1,1,"exposeureReport failed. no report_info ")},t.prototype.clickReport=function(){},t.prototype.closeReport=function(t,e,i){if(this.adInfo.report_info&&this.adInfo.report_info.negative_feedback_url){var r=this.adInfo.report_info.negative_feedback_url;r=r.replace("__ACT_TYPE__","2001"),new BK.HttpUtil(r).requestAsync(function(t,e){200==e?BK.Script.log(1,1,"negative_feedback succ."):BK.Script.log(1,1,"negative_feedback failed.statuscode:"+e)}.bind(this)),this.cmshowReport(3,t,e,i)}else BK.Script.log(1,1,"closeReport failed.can not find the negative_feedback_url")},t.prototype.cmshowReport=function(t,e,i,r){var n=this.pos_id,o=t.toString(),a="",s="",h="";e&&(a=e),i&&(s=i),r&&(h=r),BK.QQ.uploadData("banner_SPA",n,o,a,s,h)},t.prototype.reportParamToString=function(){var t=this.adInfo.report_info.trace_info,e="";if("object"==typeof t){for(var i in t)e=e+i+"="+t[i]+"&";e=e.substring(0,e.length-1)}return e},t}()}}().AdBannerHandler)}(BK),function(t,e){"object"==typeof t&&(t.AdAnimateBanner=function(){function t(){return IS_IPHONE_X}function e(){return!!t()}function i(){return t()?BK.Director.screenPixelSize.height>BK.Director.screenPixelSize.width?.015*BK.Director.screenPixelSize.height:.035*BK.Director.screenPixelSize.height:0}function r(t,e,i,r,n,o,a,s,h,c,l,u,d,_,f,g){this._data=void 0!==t?[t,e,i,r,n,o,a,s,h,c,l,u,d,_,f,g]:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function n(t,e,i,n,o,a){return new r(2/(e-t),0,0,0,0,2/(n-i),0,0,0,0,2/(o-a),0,(t+e)/(t-e),(n+i)/(i-n),(o+a)/(o-a),1)}function o(t){return new r(1,0,0,0,0,1,0,0,0,0,1,0,t.x,t.y,t.z,1)}function s(t){return new r(t.x,0,0,0,0,t.y,0,0,0,0,1,0,0,0,0,1)}function h(t){return.01745329251994*t}function c(t){var e=h(-t.y),i=h(-t.x),n=h(-t.z),o=Math.cos(e),a=Math.sin(e),s=Math.cos(i),c=Math.sin(i),l=Math.cos(n),u=Math.sin(n);return new r(o*l+a*c*u,-o*u+a*c*l,a*s,0,u*s,l*s,-c,0,-a*l+o*c*u,u*a+o*c*l,o*s,0,0,0,0,1)}function l(t,e){this._gl=t;var i=t.createShader(t.VERTEX_SHADER);t.shaderSource(i,e.vs_source),t.compileShader(i);var r=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(r,e.fs_source),t.compileShader(r),this._shader_program=t.createProgram(),t.attachShader(this._shader_program,i),t.attachShader(this._shader_program,r),t.linkProgram(this._shader_program),this._attributes=[];for(a=0;a<e.attributes.length;++a){var n=e.attributes[a],o=t.getAttribLocation(this._shader_program,n.name);this._attributes.push({name:n.name,size:n.size,location:o})}this._uniforms=[];for(var a=0;a<e.uniforms.length;++a){var s=e.uniforms[a];this._uniforms.push({name:s.name,type:s.type,location:t.getUniformLocation(this._shader_program,s.name),value:s.default_value})}}function u(){this._parent=null,this._children=[],this._rotation_matrix=new r,this._scalar_matrix=new r,this._local_matrix=new r,this._world_matrix=new r,this._canUserInteract=!1,this._dirty_flags=0,this._need_update_flag=!1,this._position={x:0,y:0,z:0},this._hidden=!1,Object.defineProperty(this,"canUserInteract",{configurable:!0,get:function(){return this._canUserInteract},set:function(t){this._canUserInteract=t}}),Object.defineProperty(this,"children",{configurable:!0,get:function(){return this._children}}),Object.defineProperty(this,"hidden",{configurable:!0,get:function(){return this._hidden},set:function(t){this._hidden=t}}),Object.defineProperty(this,"position",{configurable:!0,get:function(){return this._position},set:function(t){this._position.x=void 0!==t.x?t.x:this._position.x,this._position.y=void 0!==t.y?t.y:this._position.y,this._position.z=void 0!==t.z?t.z:this._position.z,this._need_update_flag=!0,this._dirty_flags|=DIRTY_TRANSLATION|DIRTY_WORLD_MATRIX}}),this._scale={x:1,y:1,z:1},Object.defineProperty(this,"scale",{configurable:!0,get:function(){return this._scale},set:function(t){this._scale.x=void 0!==t.x?t.x:this._scale.x,this._scale.y=void 0!==t.y?t.y:this._scale.y,this._scale.z=void 0!==t.z?t.z:this._scale.z,this._need_update_flag=!0,this._dirty_flags|=DIRTY_SCALE|DIRTY_WORLD_MATRIX}}),this._rotation={x:0,y:0,z:0},Object.defineProperty(this,"rotation",{configurable:!0,get:function(){return this._rotation},set:function(t){this._rotation.x=void 0!==t.x?t.x:this._rotation.x,this._rotation.y=void 0!==t.y?t.y:this._rotation.y,this._rotation.z=void 0!==t.z?t.z:this._rotation.z,this._need_update_flag=!0,this._dirty_flags|=DIRTY_ROTATION|DIRTY_WORLD_MATRIX}}),this._visible=!0,Object.defineProperty(this,"visible",{configurable:!0,get:function(){return this._visible},set:function(t){this._visible=t}})}function d(t,e,i,r,n,o,a){u.call(this),this._color={r:1,g:1,b:1,a:1},Object.defineProperty(this,"color",{configurable:!0,get:function(){return this._color},set:function(t){this._color.r=void 0!==t.r?t.r:this._color.r,this._color.g=void 0!==t.g?t.g:this._color.g,this._color.b=void 0!==t.b?t.b:this._color.b,this._color.a=void 0!==t.a?t.a:this._color.a,this._dirty_flags|=DIRTY_COLOR}}),this._anchor={x:.5,y:.5},Object.defineProperty(this,"anchor",{configurable:!0,get:function(){return this._anchor},set:function(t){this._anchor.x=void 0!==t.x?t.x:this._anchor.x,this._anchor.y=void 0!==t.y?t.y:this._anchor.y,this._dirty_flags|=DIRTY_ANCHOR}}),this.setTexture(i),this._uv_rotate=BK_SPRITE_UV_ROTATE_NONE,this._origin_tex_uv=[{x:0,y:0},{x:1,y:0},{x:1,y:1},{x:0,y:1}],this._flip_u=void 0!==r&&r,this._flip_v=void 0!==n&&n,this._stretch_x=void 0!==o&&o,this._stretch_y=void 0!==a&&a,this._blend_mode=BK_BLEND_MODE_MULTIPLY,this._content_size={width:t,height:e},Object.defineProperty(this,"size",{configurable:!0,get:function(){return this._content_size},set:function(t){this._content_size=t,this._dirty_flags|=DIRTY_CONTENT_SIZE}});var s=.5*this._content_size.width,h=.5*this._content_size.height;this._vertices=new Float32Array([-s,h,0,1,1,1,1,0,0,s,h,0,1,1,1,1,1,0,s,-h,0,1,1,1,1,1,1,-s,-h,0,1,1,1,1,0,1]),this._vbo=null,this._ibo=null}function _(t,e,i,r,n,o,a){d.call(this,t,e,i,r,n,o,a),this.contentSize={width:t,height:e},this.isCancelClick=void 0,this.touchStatus=0,this.canUserInteract=!0,this.enable=!0,this.canClick=!0,this.touchInsideCallback=void 0,this.addTouchListener()}function f(t){var e=Math.floor(255*t.a);return e<<=8,e|=Math.floor(255*t.r),e<<=8,e|=Math.floor(255*t.g),e<<=8,(e|=Math.floor(255*t.b))>>>0}function g(r){this._ad_final_size=[],this._clickInsideCallback=void 0;for(var n=0;n<AD_DESIGN_SIZE.length;++n)this._ad_final_size.push({width:Math.ceil(AD_DESIGN_SIZE[n].width*STANDARD_SCALE),height:Math.ceil(AD_DESIGN_SIZE[n].height*STANDARD_SCALE)});this._is_webgl=void 0!==gl,this._is_webgl&&this.webGL_init();var o="GameRes://res/bg_left.png",a="GameRes://res/bg_bg_1.png",s="GameRes://res/bg_bg_2.png",h="GameRes://res/bg_fg_1.png",c="GameRes://res/bg_fg_2.png",l="GameRes://res/bg_right.png";r&&(o=r.bg_left_path,l=r.bg_right_path,a=r.bg_bg_1_path,s=r.bg_bg_2_path,h=r.bg_fg_1_path,c=r.bg_fg_2_path),this._tex_bg_left=this.create_texture(o,!1),this._tex_bg_bg_1=this.create_texture(a,!1),this._tex_bg_bg_2=this.create_texture(s,!1),this._tex_bg_fg_1=this.create_texture(h,!1),this._tex_bg_fg_2=this.create_texture(c,!1),this._tex_bg_right=this.create_texture(l,!1),this._root_node=this.create_node(),this._root_node.canUserInteract=!0,this._mv_node=this.create_clip_node(this._root_node,{x:.5*-this._ad_final_size[AD_BANNER_TYPE_RESERVED_CLIP_RECT].width,y:t()?2*STANDARD_SCALE:0,width:this._ad_final_size[AD_BANNER_TYPE_RESERVED_CLIP_RECT].width,height:this._ad_final_size[AD_BANNER_TYPE_RESERVED_CLIP_RECT].height}),this._mv_node.canUserInteract=!0,e()?this._mv_node.position={x:.5*BK.Director.screenPixelSize.width,y:i()}:this._mv_node.position={x:.5*BK.Director.screenPixelSize.width,y:0},this._node_1=this.node_extend(this.create_button(this._mv_node,this._tex_bg_left,this._ad_final_size[AD_BANNER_TYPE_RESERVED_0],this._onTouchInside.bind(this))),this._node_2=this.node_extend(this.create_node(this._mv_node)),this._node_2.canUserInteract=!0,this._node_2_1=this.create_button(this._node_2,this._tex_bg_bg_1,this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1],this._onTouchInside.bind(this)),this._content_node=this.create_node(this._node_2),this._real_content_node=void 0,this._node_2_2=this.create_sprite_with_texture(this._node_2,this._tex_bg_fg_1,this._ad_final_size[AD_BANNER_TYPE_RESERVED_2_1]),this._node_3=this.node_extend(this.create_button(this._mv_node,this._tex_bg_right,this._ad_final_size[AD_BANNER_TYPE_RESERVED_3],this._onTouchInside.bind(this)));var u=new BK.Ticker;u.interval=.033,u.setTickerCallBack(function(t,e){this.update(e)}.bind(this))}AD_BANNER_TYPE_DYNAMIC_193_582_166=0,AD_BANNER_TYPE_DYNAMIC_194_147_147=1,AD_BANNER_TYPE_DYNAMIC_184_240_180=2,AD_BANNER_TYPE_DYNAMIC_285_240_180_3=3,AD_BANNER_TYPE_DYNAMIC_210_640_288=4,AD_BANNER_TYPE_DYNAMIC_65_1000_560=5,AD_BANNER_TYPE_STATIC_193_582_166=6,AD_BANNER_TYPE_STATIC_194_147_147=7,AD_BANNER_TYPE_STATIC_184_240_180=8,AD_BANNER_TYPE_STATIC_285_240_180_3=9,AD_BANNER_TYPE_STATIC_210_640_288=10,AD_BANNER_TYPE_STATIC_65_1000_560=11,AD_BANNER_TYPE_RESERVED_0=12,AD_BANNER_TYPE_RESERVED_1_1=13,AD_BANNER_TYPE_RESERVED_1_2=14,AD_BANNER_TYPE_RESERVED_2_1=15,AD_BANNER_TYPE_RESERVED_2_2=16,AD_BANNER_TYPE_RESERVED_3=17,AD_BANNER_TYPE_RESERVED_CLIP_RECT=18,AD_DESIGN_SIZE=[{width:490,height:140},{width:147,height:147},{width:193,height:145},{width:147,height:110},{width:322,height:145},{width:263,height:147},{width:582,height:166},{width:166,height:166},{width:221,height:166},{width:179,height:132},{width:368,height:166},{width:297,height:166},{width:114,height:87},{width:530,height:166},{width:581,height:166},{width:530,height:38},{width:60,height:30},{width:115,height:115},{width:730,height:166}],IPHONE_X_WIDTH=375,IPHONE_X_HEIGHT=812;var p=BK.Director.queryDeviceInfo();return"ios"===p.platform&&p.screenWidth===IPHONE_X_WIDTH&&p.screenHeight===IPHONE_X_HEIGHT?IS_IPHONE_X=!0:IS_IPHONE_X=!1,STANDARD_HEIGHT=function(){return t()?BK.Director.screenPixelSize.height>BK.Director.screenPixelSize.width?.1*BK.Director.screenPixelSize.height:.2*BK.Director.screenPixelSize.height:BK.Director.screenPixelSize.height*(BK.Director.screenPixelSize.height>BK.Director.screenPixelSize.width?.12:.22)}(),STANDARD_SCALE=STANDARD_HEIGHT/AD_DESIGN_SIZE[AD_BANNER_TYPE_RESERVED_1_1].height,NODE_TWEEN_ATTR_TYPE_NONE=0,NODE_TWEEN_ATTR_TYPE_SCALE=1,NODE_TWEEN_ATTR_TYPE_SCALE_X=2,NODE_TWEEN_ATTR_TYPE_SCALE_Y=3,NODE_TWEEN_ATTR_TYPE_POSITION_X=4,NODE_TWEEN_ATTR_TYPE_POSITION_Y=5,NODE_TWEEN_ATTR_TYPE_OPACITY=6,NODE_TWEEN_ATTR_TYPE_ROTATION_X=7,NODE_TWEEN_ATTR_TYPE_ROTATION_Y=8,NODE_TWEEN_ATTR_TYPE_ROTATION_Z=9,r.prototype={constructor:r,is_identity:function(){return 1===this._data[0]&&0===this._data[1]&&0===this._data[2]&&0===this._data[3]&&0===this._data[4]&&1===this._data[5]&&0===this._data[6]&&0===this._data[7]&&0===this._data[8]&&0===this._data[9]&&1===this._data[10]&&0===this._data[11]&&0===this._data[12]&&0===this._data[13]&&0===this._data[14]&&1===this._data[15]},set_translation:function(t,e,i){this._data[12]=t,this._data[13]=e,this._data[14]=i},set_scale:function(t,e,i){this._data[0]=t,this._data[5]=e,this._data[10]=i},set:function(t,e,i,r,n,o,a,s,h,c,l,u,d,_,f,g){this._data[0]=t,this._data[1]=e,this._data[2]=i,this._data[3]=r,this._data[4]=n,this._data[5]=o,this._data[6]=a,this._data[7]=s,this._data[8]=h,this._data[9]=c,this._data[10]=l,this._data[11]=u,this._data[12]=d,this._data[13]=_,this._data[14]=f,this._data[15]=g},setTo:function(t){return this._data=t._data.slice(0),this},multiply:function(t){if(this.is_identity())return this.setTo(t);if(t.is_identity())return this;var e=this._data[0]*t._data[0]+this._data[4]*t._data[1]+this._data[8]*t._data[2]+this._data[12]*t._data[3],i=this._data[1]*t._data[0]+this._data[5]*t._data[1]+this._data[9]*t._data[2]+this._data[13]*t._data[3],r=this._data[2]*t._data[0]+this._data[6]*t._data[1]+this._data[10]*t._data[2]+this._data[14]*t._data[3],n=this._data[3]*t._data[0]+this._data[7]*t._data[1]+this._data[11]*t._data[2]+this._data[15]*t._data[3],o=this._data[0]*t._data[4]+this._data[4]*t._data[5]+this._data[8]*t._data[6]+this._data[12]*t._data[7],a=this._data[1]*t._data[4]+this._data[5]*t._data[5]+this._data[9]*t._data[6]+this._data[13]*t._data[7],s=this._data[2]*t._data[4]+this._data[6]*t._data[5]+this._data[10]*t._data[6]+this._data[14]*t._data[7],h=this._data[3]*t._data[4]+this._data[7]*t._data[5]+this._data[11]*t._data[6]+this._data[15]*t._data[7],c=this._data[0]*t._data[8]+this._data[4]*t._data[9]+this._data[8]*t._data[10]+this._data[12]*t._data[11],l=this._data[1]*t._data[8]+this._data[5]*t._data[9]+this._data[9]*t._data[10]+this._data[13]*t._data[11],u=this._data[2]*t._data[8]+this._data[6]*t._data[9]+this._data[10]*t._data[10]+this._data[14]*t._data[11],d=this._data[3]*t._data[8]+this._data[7]*t._data[9]+this._data[11]*t._data[10]+this._data[15]*t._data[11],_=this._data[0]*t._data[12]+this._data[4]*t._data[13]+this._data[8]*t._data[14]+this._data[12]*t._data[15],f=this._data[1]*t._data[12]+this._data[5]*t._data[13]+this._data[9]*t._data[14]+this._data[13]*t._data[15],g=this._data[2]*t._data[12]+this._data[6]*t._data[13]+this._data[10]*t._data[14]+this._data[14]*t._data[15],p=this._data[3]*t._data[12]+this._data[7]*t._data[13]+this._data[11]*t._data[14]+this._data[15]*t._data[15];return this.set(e,i,r,n,o,a,s,h,c,l,u,d,_,f,g,p),this},multiplyXY:function(t){return{x:t.x*this._data[0]+t.y*this._data[4]+this._data[12],y:t.x*this._data[1]+t.y*this._data[5]+this._data[13]}}},SHADER_UNIFORM_TYPE_FLOAT1=1,SHADER_UNIFORM_TYPE_FLOAT2=2,SHADER_UNIFORM_TYPE_FLOAT3=3,SHADER_UNIFORM_TYPE_FLOAT4=4,SHADER_UNIFORM_TYPE_INT1=5,SHADER_UNIFORM_TYPE_INT2=6,SHADER_UNIFORM_TYPE_INT3=7,SHADER_UNIFORM_TYPE_INT4=8,SHADER_UNIFORM_TYPE_FLOATV1=9,SHADER_UNIFORM_TYPE_FLOATV2=10,SHADER_UNIFORM_TYPE_FLOATV3=11,SHADER_UNIFORM_TYPE_FLOATV4=12,SHADER_UNIFORM_TYPE_INTV1=13,SHADER_UNIFORM_TYPE_INTV2=14,SHADER_UNIFORM_TYPE_INTV3=15,SHADER_UNIFORM_TYPE_INTV4=16,SHADER_UNIFORM_TYPE_MATRIX2=17,SHADER_UNIFORM_TYPE_MATRIX3=18,SHADER_UNIFORM_TYPE_MATRIX4=19,SHADER_UNIFORM_TYPE_TEXTURE0=20,SHADER_UNIFORM_TYPE_TEXTURE1=21,SHADER_UNIFORM_TYPE_TEXTURE2=22,SHADER_UNIFORM_TYPE_TEXTURE3=23,SHADER_UNIFORM_TYPE_TEXTURE4=24,SHADER_UNIFORM_TYPE_TEXTURE5=25,SHADER_UNIFORM_TYPE_TEXTURE6=26,SHADER_UNIFORM_TYPE_TEXTURE7=27,l.prototype={set_uniform:function(t,e,i){for(var r=0;r<this._uniforms.length;++r)this._uniforms[r].name===t&&(this._uniforms[r].value=e,i&&this.update_uniform(this._uniforms[r]))},bind:function(){this._gl.useProgram(this._shader_program);for(e=0;e<this._uniforms.length;++e)this.update_uniform(this._uniforms[e]);for(var t=0,e=0;e<this._attributes.length;++e){var i=this._attributes[e];this._gl.vertexAttribPointer(i.location,i.size,this._gl.FLOAT,!1,36,t),this._gl.enableVertexAttribArray(i.location),t+=4*i.size}},update_uniform:function(t){var e=this._gl;switch(t.type){case SHADER_UNIFORM_TYPE_FLOAT1:e.uniform1f(t.location,t.value);break;case SHADER_UNIFORM_TYPE_FLOAT2:e.uniform2f(t.location,t.value.x,t.value.y);break;case SHADER_UNIFORM_TYPE_FLOAT3:e.uniform3f(t.location,t.value.x,t.value.y,t.value.z);break;case SHADER_UNIFORM_TYPE_FLOAT4:e.uniform4f(t.location,t.value.x,t.value.y,t.value.z,t.value.w);break;case SHADER_UNIFORM_TYPE_INT1:e.uniform1i(t.location,t.value);break;case SHADER_UNIFORM_TYPE_INT2:e.uniform2i(t.location,t.value.x,t.value.y);break;case SHADER_UNIFORM_TYPE_INT3:e.uniform3i(t.location,t.value.x,t.value.y,t.value.z);break;case SHADER_UNIFORM_TYPE_INT4:e.uniform4i(t.location,t.value.x,t.value.y,t.value.z,t.value.w);break;case SHADER_UNIFORM_TYPE_FLOATV1:e.uniform1fv(t.location,t.value);break;case SHADER_UNIFORM_TYPE_FLOATV2:e.uniform2fv(t.location,t.value);break;case SHADER_UNIFORM_TYPE_FLOATV3:e.uniform3fv(t.location,t.value);break;case SHADER_UNIFORM_TYPE_FLOATV4:e.uniform4fv(t.location,t.value);break;case SHADER_UNIFORM_TYPE_INTV1:e.uniform1iv(t.location,t.value);break;case SHADER_UNIFORM_TYPE_INTV2:e.uniform2iv(t.location,t.value);break;case SHADER_UNIFORM_TYPE_INTV3:e.uniform3iv(t.location,t.value);break;case SHADER_UNIFORM_TYPE_INTV4:e.uniform4iv(t.location,t.value);break;case SHADER_UNIFORM_TYPE_MATRIX2:e.uniformMatrix2fv(t.location,!1,t.value._data);break;case SHADER_UNIFORM_TYPE_MATRIX3:e.uniformMatrix3fv(t.location,!1,t.value._data);break;case SHADER_UNIFORM_TYPE_MATRIX4:e.uniformMatrix4fv(t.location,!1,t.value._data);break;case SHADER_UNIFORM_TYPE_TEXTURE0:e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.value);break;case SHADER_UNIFORM_TYPE_TEXTURE1:e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,t.value);break;case SHADER_UNIFORM_TYPE_TEXTURE2:e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,t.value);break;case SHADER_UNIFORM_TYPE_TEXTURE3:e.activeTexture(e.TEXTURE3),e.bindTexture(e.TEXTURE_2D,t.value);break;case SHADER_UNIFORM_TYPE_TEXTURE4:e.activeTexture(e.TEXTURE4),e.bindTexture(e.TEXTURE_2D,t.value);break;case SHADER_UNIFORM_TYPE_TEXTURE5:e.activeTexture(e.TEXTURE5),e.bindTexture(e.TEXTURE_2D,t.value);break;case SHADER_UNIFORM_TYPE_TEXTURE6:e.activeTexture(e.TEXTURE6),e.bindTexture(e.TEXTURE_2D,t.value);break;case SHADER_UNIFORM_TYPE_TEXTURE7:e.activeTexture(e.TEXTURE7),e.bindTexture(e.TEXTURE_2D,t.value)}}},DIRTY_TRANSLATION=1,DIRTY_SCALE=2,DIRTY_ROTATION=4,DIRTY_UV=8,DIRTY_CONTENT_SIZE=16,DIRTY_COLOR=32,DIRTY_WORLD_MATRIX=64,DIRTY_ANCHOR=128,u.prototype={constructor:u,dispose:function(){for(var t=0;t<this._children.length;++t)this._children[t].dispose()},addChild:function(t){t._parent!==this&&(t._parent&&t._parent.removeChild(t),this._children.push(t),t._parent=this)},removeChild:function(t){if(t._parent===this)for(var e=0;e<this._children.length;++e)this._children[e]===t&&(this._children.splice(e,1),t._parent=null,t.dispose())},getLocalMatrix:function(){return this._local_matrix=o(this.position),0===this.rotation.x&&0===this.rotation.y&&0===this.rotation.z||(this._rotation_matrix=c(this.rotation),this._local_matrix.multiply(this._rotation_matrix)),1===this.scale.x&&1===this.scale.y&&1===this.scale.z||(this._scalar_matrix=s(this.scale),this._local_matrix.multiply(this._scalar_matrix)),this._dirty_flags&=~(DIRTY_TRANSLATION|DIRTY_SCALE|DIRTY_ROTATION),this._local_matrix},getWorldMatrix:function(t){return(t||this._dirty_flags&DIRTY_WORLD_MATRIX)&&(this._parent?(this._world_matrix.setTo(this._parent.getWorldMatrix()),this._world_matrix.multiply(this.getLocalMatrix())):this._world_matrix.setTo(this.getLocalMatrix()),this._dirty_flags&=~DIRTY_WORLD_MATRIX),this._world_matrix},render:function(t,e,i){if(this.visible){i&&this.getWorldMatrix(i);for(var r=0;r<this._children.length;++r)this._children[r].render(t,e,this._need_update_flag||i);this._need_update_flag=!1}},hittest:function(t){return!1}},BK_SPRITE_UV_ROTATE_NONE=0,BK_SPRITE_UV_ROTATE_CW_90=1,BK_SPRITE_UV_ROTATE_CW_180=2,BK_SPRITE_UV_ROTATE_CW_270=3,BK_SPRITE_UV_ROTATE_CCW_90=4,BK_SPRITE_UV_ROTATE_CCW_180=5,BK_SPRITE_UV_ROTATE_CCW_270=6,BK_BLEND_MODE_ADDITIVE=0,BK_BLEND_MODE_MULTIPLY=1,BK_BLEND_MODE_INTERPOLATIVE=2,BK_BLEND_MODE_SCREEN=3,d.prototype=Object.create(u.prototype),d.prototype.constructor=d,d.prototype.dispose=function(){var t=bkWebGLGetInstance();this._tex&&this._tex.need_delete&&(t.deleteTexture(this._tex.texture),this._tex=null),this._vbo&&(t.deleteBuffer(this._vbo),t.deleteBuffer(this._ibo),this._vbo=null,this._ibo=null),u.prototype.dispose.call(this)},d.prototype.setTexture=function(t){void 0!==this._tex&&this._tex.need_delete&&bkWebGLGetInstance().deleteTexture(this._tex.texture),this._tex=t,t?(this._tex_width=t.width,this._tex_height=t.height):(this._tex_width=0,this._tex_height=0)},d.prototype.adjustTexturePosition=function(t,e,i,r,n){n?(this._origin_tex_uv[0].x=(t+r)/this._tex_width,this._origin_tex_uv[0].y=(e+i)/this._tex_height,this._origin_tex_uv[1].x=(t+r)/this._tex_width,this._origin_tex_uv[1].y=e/this._tex_height,this._origin_tex_uv[2].x=t/this._tex_width,this._origin_tex_uv[2].y=e/this._tex_height,this._origin_tex_uv[3].x=t/this._tex_width,this._origin_tex_uv[3].y=(e+i)/this._tex_height):(this._origin_tex_uv[0].x=t/this._tex_width,this._origin_tex_uv[0].y=e/this._tex_height,this._origin_tex_uv[1].x=(t+i)/this._tex_width,this._origin_tex_uv[1].y=e/this._tex_height,this._origin_tex_uv[2].x=(t+i)/this._tex_width,this._origin_tex_uv[2].y=(e+r)/this._tex_height,this._origin_tex_uv[3].x=t/this._tex_width,this._origin_tex_uv[3].y=(e+r)/this._tex_height),this.dirty(DIRTY_UV)},d.prototype.render=function(t,e,i){if(this.visible){if(i&&this.getWorldMatrix(i),this._vbo||(this._vbo=t.createBuffer(),this._ibo=t.createBuffer(),this._indices=new Uint16Array([0,3,1,1,3,2]),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this._ibo),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this._indices,t.STATIC_DRAW)),this._dirty_flags&DIRTY_UV){var r=1;this._stretch_x||0===this._content_size.width||0===this._tex_width||(r=this._content_size.width/this._tex_width);var n=1;this._stretch_y||0===this._content_size.height||0===this._tex_height||(n=this._content_size.height/this._tex_height);var o=this._origin_tex_uv.slice(0);this.flip_u&&(o=[o[1],o[0],o[3],o[2]]),this.flip_v&&(o=[o[3],o[2],o[1],o[0]]),this._uv_rotate===BK_SPRITE_UV_ROTATE_CW_90||this._uv_rotate===BK_SPRITE_UV_ROTATE_CCW_270?o=[o[3],o[0],o[1],o[2]]:this._uv_rotate===BK_SPRITE_UV_ROTATE_CW_270||this._uv_rotate===BK_SPRITE_UV_ROTATE_CW_270?o=[o[1],o[2],o[3],o[0]]:this._uv_rotate!==BK_SPRITE_UV_ROTATE_CW_180&&this._uv_rotate!==BK_SPRITE_UV_ROTATE_CCW_180||(o=[o[2],o[3],o[0],o[1]]),this._vertices[7]=r*o[0].x,this._vertices[8]=n*o[0].y,this._vertices[16]=r*o[1].x,this._vertices[17]=n*o[1].y,this._vertices[25]=r*o[2].x,this._vertices[26]=n*o[2].y,this._vertices[34]=r*o[3].x,this._vertices[35]=n*o[3].y,this._dirty_flags&=~DIRTY_UV}if(i||this._dirty_flags&(DIRTY_CONTENT_SIZE|DIRTY_WORLD_MATRIX|DIRTY_ANCHOR)){var s=this.getWorldMatrix(i),h={x:-this._content_size.width*this._anchor.x,y:this._content_size.height*(1-this._anchor.y)},c={x:this._content_size.width*(1-this._anchor.x),y:this._content_size.height*(1-this._anchor.y)},l={x:-this._content_size.width*this._anchor.x,y:-this._content_size.height*this._anchor.y},d={x:this._content_size.width*(1-this._anchor.x),y:-this._content_size.height*this._anchor.y},h=s.multiplyXY(h),c=s.multiplyXY(c),l=s.multiplyXY(l),d=s.multiplyXY(d);this._vertices[0]=h.x,this._vertices[1]=h.y,this._vertices[9]=c.x,this._vertices[10]=c.y,this._vertices[18]=d.x,this._vertices[19]=d.y,this._vertices[27]=l.x,this._vertices[28]=l.y,this._dirty_flags&=~(DIRTY_CONTENT_SIZE|DIRTY_ANCHOR)}if(this._dirty_flags&DIRTY_COLOR){var _=this.color.a,f=this.color.r*_,g=this.color.g*_,p=this.color.b*_;this._vertices[3]=f,this._vertices[4]=g,this._vertices[5]=p,this._vertices[6]=a,this._vertices[12]=f,this._vertices[13]=g,this._vertices[14]=p,this._vertices[15]=a,this._vertices[21]=f,this._vertices[22]=g,this._vertices[23]=p,this._vertices[24]=a,this._vertices[30]=f,this._vertices[31]=g,this._vertices[32]=p,this._vertices[33]=a,this._dirty_flags&=~DIRTY_COLOR}t.bindBuffer(t.ARRAY_BUFFER,this._vbo),t.bufferData(t.ARRAY_BUFFER,this._vertices,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this._ibo),e.set_uniform("Texture",this._tex.texture),e.bind(),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),u.prototype.render.call(this,t,e,i)}},d.prototype.hittest=function(t){var e=this.getWorldMatrix(),i=e.multiplyXY({x:-this._content_size.width*this._anchor.x,y:-this._content_size.height*this._anchor.y}),r=e.multiplyXY({x:this._content_size.width*(1-this._anchor.x),y:this._content_size.height*(1-this._anchor.y)});return t.x>=i.x&&t.x<=r.x&&t.y>=i.y&&t.y<=r.y},_.prototype=Object.create(d.prototype),_.prototype.constructor=_,_.prototype.addTouchListener=function(){"undefined"!=typeof UIEventHandler?(UIEventHandler.addNodeEvent(this,1,function(t,e,i,r){t.isCancelClick=!1,t.enable?t.changeStatus(1):t.changeStatus(2)}.bind(this)),UIEventHandler.addNodeEvent(this,2,function(t,e,i,r){var n={x:i,y:r};0==t.hittest(n)&&(t.isCancelClick=!0)}.bind(this)),UIEventHandler.addNodeEvent(this,3,function(t,e,i,r){t.enable?t.changeStatus(0):t.changeStatus(2),0==t.isCancelClick&&t.touchInsideCallback&&1==this.canClick&&t.touchInsideCallback(t)}.bind(this))):BK.Script.log(1,1,"UIEventHandler is undefined")},_.prototype.setTouchInsideCallback=function(t){this.touchInsideCallback=t},_.prototype.dispose=function(){UIEventHandler.removeNodeEvent(this,1),UIEventHandler.removeNodeEvent(this,2),UIEventHandler.removeNodeEvent(this,3),d.prototype.dispose.call(this)},_.prototype.changeStatus=function(t){this.touchStatus=t,this.updateTexture(t)},_.prototype.updateTexture=function(t){},g.prototype={constructor:g,setHidden:function(t){this._root_node?this._root_node.hidden=t:BK.Script.log(1,1,"set hidden error.root_node is null")},dispose:function(){this._is_webgl?(this._root_node.dispose(),this._root_node=void 0,this.webGL_exit()):this._root_node.removeFromParent()},_onTouchInside:function(){BK.Script.log(1,1,"_onTouchInside"),this._clickInsideCallback&&this._clickInsideCallback()},setClickContentCallback:function(t){this._clickInsideCallback=t},create_texture:function(t,e){if(this._is_webgl){var i=this._gl,r=i.RGBA,n=i.RGBA,o=i.UNSIGNED_BYTE,a=BK.Image.loadImage(t,6),s=i.createTexture();return i.bindTexture(i.TEXTURE_2D,s),i.texImage2D(i.TEXTURE_2D,0,r,n,o,a),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),{width:a.width,height:a.height,texture:s,tex_file:t,need_delete:e}}return new BK.Texture(t)},create_clip_node:function(t,r){if(this._is_webgl){e()&&(r.x+=.5*BK.Director.screenPixelSize.width,r.y=i());var n=new u;return this._clip_rect=r,t.addChild(n),n}return(n=new BK.ClipRectNode(r.x,r.y,r.width,r.height)).enableClip=!0,t.addChild(n),n},create_node:function(t){if(this._is_webgl){e=new u;return void 0!==t?t.addChild(e):this._gl_root_node.addChild(e),e}var e=new BK.Node;return void 0!==t?t.addChild(e):BK.Director.root.addChild(e),e},create_sprite:function(t,e,i,r){var n=this.create_texture(e,r);return this.create_sprite_with_texture(t,n,i)},create_button:function(t,e,i,r){if(this._is_webgl){var n=new _(i.width,i.height,e,0,1,1,1);return r&&n.setTouchInsideCallback(r),void 0!==t?t.addChild(n):this._gl_root_node.addChild(n),n}return(n=new BK.Button(i.width,i.height)).setNormalTexture(e),n.updateTexture=function(){},r&&n.setTouchInsideCallback(r),void 0!==t?t.addChild(n):BK.Director.root.addChild(n),n},create_sprite_with_texture:function(t,e,i){if(this._is_webgl){r=new d(i.width,i.height,e,0,1,1,1);return void 0!==t?t.addChild(r):this._gl_root_node.addChild(r),r}var r=new BK.Sprite(i.width,i.height,e,0,1,1,1);return void 0!==t?t.addChild(r):BK.Director.root.addChild(r),r},create_text:function(t,e){if(this._is_webgl){var i=new BK.CanvasNode(t.maxWidth,t.maxHeight);i.fillColor=t.textColor,i.strokeColor=t.strokeColor,i.setTextAlign(t.textAlign),i.setTextSize(t.fontSize),i.setTextItalic(t.italic),i.setTextBold(t.bold),i.setTextShadow(t.shadowDx,t.shadowDy,t.shadowRadius,t.shadowColor);var r=i.measureText(e,t.maxWidth,t.maxHeight);i.drawText(e,0,0,r.width,r.height);var n=i.getBitmap(),o=this._gl,a=o.RGBA,s=o.RGBA,h=o.UNSIGNED_BYTE,c=o.createTexture();o.bindTexture(o.TEXTURE_2D,c),o.texImage2D(o.TEXTURE_2D,0,a,s,h,n),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR);var l={width:n.width,height:n.height,texture:c,tex_file:e,need_delete:!0},u=new d(n.width,n.height,l,0,1,1,1);return u.anchor={x:0,y:0},u.width=r.width,u.height=r.height,u}return t.textColor=f(t.textColor),t.strokeColor=f(t.strokeColor),t.shadowColor=f(t.shadowColor),new BK.TextNode(t,e)},show:function(t){if(!this._is_webgl){var i=BK.Director.root.scale;this._root_node.scale={x:1/i.x,y:1/i.y,z:1/i.z},this._root_node.enableClip=e()}void 0!==this._real_content_node&&this._content_node.removeChild(this._real_content_node),this._real_content_node=this.create_node(this._content_node),void 0!==t.content&&t.content.length>20&&(t.content=t.content.substring(0,20),t.content=t.content+"...");var r=this._ad_final_size[t.ad_type];switch(t.ad_type){case AD_BANNER_TYPE_DYNAMIC_193_582_166:case AD_BANNER_TYPE_STATIC_193_582_166:(g=this.create_sprite(this._real_content_node,t.tex_files[0],r,!0)).anchor={x:0,y:1};break;case AD_BANNER_TYPE_DYNAMIC_194_147_147:case AD_BANNER_TYPE_STATIC_194_147_147:(g=this.create_sprite(this._real_content_node,t.tex_files[0],r,!0)).anchor={x:0,y:1};var n=15*STANDARD_SCALE,o=0;o=t.ad_type===AD_BANNER_TYPE_DYNAMIC_194_147_147?(p=this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1].width)-r.width-80*STANDARD_SCALE-n:(p=this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_2].width)-r.width-2*n;var a=26,s=this.create_text({fontSize:a*STANDARD_SCALE,textColor:{r:.2,g:.2,b:.2,a:1},maxWidth:o,maxHeight:30*STANDARD_SCALE,width:o,height:30*STANDARD_SCALE,textAlign:0,bold:1,italic:0,strokeColor:{r:1,g:1,b:1,a:1},strokeSize:0,shadowRadius:0,shadowDx:0,shadowDy:0,shadowColor:{r:1,g:1,b:1,a:1}},t.title);s.position={x:r.width+n,y:-50*STANDARD_SCALE},this._real_content_node.addChild(s),(m=this.create_text({fontSize:a*STANDARD_SCALE,textColor:{r:.4,g:.4,b:.4,a:1},maxWidth:o,maxHeight:60*STANDARD_SCALE,width:o,height:60*STANDARD_SCALE,textAlign:0,bold:0,italic:0,strokeColor:{r:1,g:1,b:1,a:1},strokeSize:0,shadowRadius:0,shadowDx:0,shadowDy:0,shadowColor:{r:1,g:1,b:1,a:1}},t.content)).anchor={x:0,y:1},m.position={x:r.width+n,y:-65*STANDARD_SCALE},this._real_content_node.addChild(m);break;case AD_BANNER_TYPE_DYNAMIC_184_240_180:case AD_BANNER_TYPE_STATIC_184_240_180:(g=this.create_sprite(this._real_content_node,t.tex_files[0],r,!0)).anchor={x:0,y:1};var n=15*STANDARD_SCALE,o=0;o=t.ad_type===AD_BANNER_TYPE_DYNAMIC_184_240_180?(p=this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1].width)-r.width-60*STANDARD_SCALE-n:(p=this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_2].width)-r.width-2*n;a=26;(m=this.create_text({fontSize:a*STANDARD_SCALE,textColor:{r:.2,g:.2,b:.2,a:1},maxWidth:o,maxHeight:60*STANDARD_SCALE,width:o,height:60*STANDARD_SCALE,textAlign:0,bold:0,italic:0,strokeColor:{r:1,g:1,b:1,a:1},strokeSize:0,shadowRadius:0,shadowDx:0,shadowDy:0,shadowColor:{r:1,g:1,b:1,a:1}},t.content)).anchor={x:0,y:1},m.position={x:r.width+n,y:.5*(m.height-r.height)},this._real_content_node.addChild(m);break;case AD_BANNER_TYPE_DYNAMIC_285_240_180_3:case AD_BANNER_TYPE_STATIC_285_240_180_3:var h=23*STANDARD_SCALE,c=0,l=0,u=3*STANDARD_SCALE;t.ad_type===AD_BANNER_TYPE_STATIC_285_240_180_3&&(h=11*STANDARD_SCALE,c=11*STANDARD_SCALE,l=-6*STANDARD_SCALE,u=4*STANDARD_SCALE);var d=this.create_sprite(this._real_content_node,t.tex_files[0],r,!0);d.anchor={x:0,y:1},d.position={x:c,y:l};var _=this.create_sprite(this._real_content_node,t.tex_files[1],r,!0);_.anchor={x:0,y:1},_.position={x:c+r.width+h,y:l};var f=this.create_sprite(this._real_content_node,t.tex_files[2],r,!0);f.anchor={x:0,y:1},f.position={x:c+2*(r.width+h),y:l};o=0;o=t.ad_type===AD_BANNER_TYPE_DYNAMIC_285_240_180_3?(p=this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1].width)-40*STANDARD_SCALE:(p=this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_2].width)-40*STANDARD_SCALE;a=24;(m=this.create_text({fontSize:a*STANDARD_SCALE,textColor:{r:.2,g:.2,b:.2,a:1},maxWidth:o,maxHeight:30*STANDARD_SCALE,width:o,height:30*STANDARD_SCALE,textAlign:1,bold:0,italic:0,strokeColor:{r:1,g:1,b:1,a:1},strokeSize:0,shadowRadius:0,shadowDx:0,shadowDy:0,shadowColor:{r:1,g:1,b:1,a:1}},t.content)).anchor={x:.5,y:1},m.position={x:.5*o,y:-r.height-u},this._real_content_node.addChild(m);break;case AD_BANNER_TYPE_DYNAMIC_210_640_288:case AD_BANNER_TYPE_STATIC_210_640_288:(g=this.create_sprite(this._real_content_node,t.tex_files[0],r,!0)).anchor={x:0,y:1};var n=10*STANDARD_SCALE,o=0;o=t.ad_type===AD_BANNER_TYPE_DYNAMIC_210_640_288?(p=this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1].width)-r.width-50*STANDARD_SCALE-n:(p=this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_2].width)-r.width-2*n;a=24;(m=this.create_text({fontSize:a*STANDARD_SCALE,textColor:{r:.2,g:.2,b:.2,a:1},maxWidth:o,maxHeight:120*STANDARD_SCALE,width:o,height:120*STANDARD_SCALE,textAlign:0,bold:0,italic:0,strokeColor:{r:1,g:1,b:1,a:1},strokeSize:0,shadowRadius:0,shadowDx:0,shadowDy:0,shadowColor:{r:1,g:1,b:1,a:1}},t.content)).anchor={x:0,y:.5},m.position={x:r.width+n,y:.5*-r.height},this._real_content_node.addChild(m);break;case AD_BANNER_TYPE_DYNAMIC_65_1000_560:case AD_BANNER_TYPE_STATIC_65_1000_560:var g=this.create_sprite(this._real_content_node,t.tex_files[0],r,!0);g.anchor={x:0,y:1};var n=10*STANDARD_SCALE,o=0;if(t.ad_type===AD_BANNER_TYPE_DYNAMIC_65_1000_560)o=(p=this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1].width)-r.width-50*STANDARD_SCALE-n;else{var p=this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_2].width;o=p-r.width-2*n}var a=26,m=this.create_text({fontSize:a*STANDARD_SCALE,textColor:{r:.2,g:.2,b:.2,a:1},maxWidth:o,maxHeight:120*STANDARD_SCALE,width:o,height:120*STANDARD_SCALE,textAlign:0,bold:0,italic:0,strokeColor:{r:1,g:1,b:1,a:1},strokeSize:0,shadowRadius:0,shadowDx:0,shadowDy:0,shadowColor:{r:1,g:1,b:1,a:1}},t.content);m.anchor={x:0,y:.5},m.position={x:r.width+n,y:.5*-r.height},this._real_content_node.addChild(m)}var v=t.ad_type>=AD_BANNER_TYPE_DYNAMIC_193_582_166&&t.ad_type<=AD_BANNER_TYPE_DYNAMIC_65_1000_560;this.anim_node_1(v),this.anim_node_2(v,t.ad_type===AD_BANNER_TYPE_STATIC_285_240_180_3?11*STANDARD_SCALE:0,t.ad_type===AD_BANNER_TYPE_STATIC_285_240_180_3?25*STANDARD_SCALE:0),this.anim_node_3(v)},update:function(t){this._node_1.update_tweens(t),this._node_2.update_tweens(t),this._node_3.update_tweens(t)},node_extend:function(t){return t._next_tween_handler=0,t._all_tween_data=[],t.tween_from_to=function(t,e,i,r,n,o,a){var s=this._next_tween_handler;return this._next_tween_handler+=1,this._all_tween_data.push({attr_type:t,duration:e,delay:i,interval:r,from:n,to:o,loop_count:a,pass_time:-i,handler:s,is_stop:!1}),s},t.remove_tween=function(t){for(;0<this._all_tween_data.length;)if(this._all_tween_data[0].handler===t)return void(this._all_tween_data[0].is_stop=!0)},t.update_tweens=function(t){for(var e=0;e<this._all_tween_data.length;){var i=this._all_tween_data[e];if(i.is_stop)this._all_tween_data.splice(e,1);else{if(i.pass_time+=t,i.pass_time>=i.duration)i.pass_time-=i.duration,-1===i.loop_count?(i.pass_time-=i.interval,this.update_tween_value(i,i.to)):(i.loop_count-=1,i.loop_count>=0?(i.pass_time-=i.interval,this.update_tween_value(i,i.to)):(this.update_tween_value(i,i.to),i.is_stop=!0));else if(i.pass_time>0){var r=(i.to-i.from)*(i.pass_time/i.duration)+i.from;this.update_tween_value(i,r)}++e}}},t.update_tween_value=function(t,e){switch(t.attr_type){case NODE_TWEEN_ATTR_TYPE_SCALE:this.scale={x:e,y:e};break;case NODE_TWEEN_ATTR_TYPE_SCALE_X:this.scale={x:e,y:this.scale.y};break;case NODE_TWEEN_ATTR_TYPE_SCALE_Y:this.scale={x:this.scale.x,y:e};break;case NODE_TWEEN_ATTR_TYPE_POSITION_X:this.position={x:e,y:this.position.y};break;case NODE_TWEEN_ATTR_TYPE_POSITION_Y:this.position={x:this.position.x,y:e};break;case NODE_TWEEN_ATTR_TYPE_OPACITY:this.opacity=e;break;case NODE_TWEEN_ATTR_TYPE_ROTATION_X:this.rotation={x:e,y:this.rotation.y,z:this.rotation.z};break;case NODE_TWEEN_ATTR_TYPE_ROTATION_Y:this.rotation={x:this.rotation.x,y:e,z:this.rotation.z};break;case NODE_TWEEN_ATTR_TYPE_ROTATION_Z:this.rotation={x:this.rotation.x,y:this.rotation.y,z:e}}},t},anim_node_1:function(t){if(t){var e={x:.8,y:.2},i=.5*-this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1].width+.4*this._ad_final_size[AD_BANNER_TYPE_RESERVED_0].width,r=0-.7*this._ad_final_size[AD_BANNER_TYPE_RESERVED_0].height;this._node_1.anchor=e,this._node_1.visible=!0,this._node_1.position={x:i,y:r},this._node_1.rotation={x:0,y:0,z:120},this._node_1.tween_from_to(NODE_TWEEN_ATTR_TYPE_POSITION_Y,.1,.2,0,r,0,0),this._node_1.tween_from_to(NODE_TWEEN_ATTR_TYPE_ROTATION_Z,.3,.2,0,120,10,0)}else this._node_1.visible=!1},anim_node_2:function(t,e,i){var r={x:.8,y:0},n=(t?this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1].width:this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_2].width)*(r.x-.5);this._node_2.position={x:n,y:0},t?(this._node_2.rotation={x:0,y:0,z:120},this._node_2.tween_from_to(NODE_TWEEN_ATTR_TYPE_ROTATION_Z,.3,0,0,120,0,0),this._node_2_1.anchor={x:.5,y:.5},this._node_2_1.size=this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1],this._node_2_1.setTexture(this._tex_bg_bg_1),this._node_2_1.position={x:this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1].width*(.5-r.x),y:.5*this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1].height},this._content_node.position={x:20*STANDARD_SCALE-this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1].width*r.x,y:this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1].height-6*STANDARD_SCALE},this._node_2_2.anchor={x:.5,y:.5},this._node_2_2.setTexture(this._tex_bg_fg_1),this._node_2_2.size=this._ad_final_size[AD_BANNER_TYPE_RESERVED_2_1],this._node_2_2.position={x:this._ad_final_size[AD_BANNER_TYPE_RESERVED_2_1].width*(.5-r.x),y:.5*this._ad_final_size[AD_BANNER_TYPE_RESERVED_2_1].height}):(this._node_2.rotation={x:0,y:0,z:0},this._node_2_1.anchor={x:.5,y:.5},this._node_2_1.size=this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_2],this._node_2_1.setTexture(this._tex_bg_bg_2),this._node_2_1.position={x:this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_2].width*(.5-r.x),y:.5*this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_2].height},this._content_node.position={x:-this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_2].width*r.x,y:this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_2].height},this._node_2_2.anchor={x:0,y:0},this._node_2_2.size=this._ad_final_size[AD_BANNER_TYPE_RESERVED_2_2],this._node_2_2.setTexture(this._tex_bg_fg_2),this._node_2_2.position={x:5*STANDARD_SCALE+this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_2].width*-r.x+e,y:5*STANDARD_SCALE+i})},anim_node_3:function(t){if(t){var e={x:.5,y:.5},i=.5*this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1].width+.15*this._ad_final_size[AD_BANNER_TYPE_RESERVED_3].width,r=.5*this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1].height-.1*this._ad_final_size[AD_BANNER_TYPE_RESERVED_3].height,n=.3*this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1].width,o=-this._ad_final_size[AD_BANNER_TYPE_RESERVED_1_1].height,a=Math.sqrt((i-n)*(i-n)+(r-o)*(r-o)),s={x:(i-n)/a,y:(r-o)/a},h=i+this._ad_final_size[AD_BANNER_TYPE_RESERVED_3].width*s.x*.2,c=r+this._ad_final_size[AD_BANNER_TYPE_RESERVED_3].height*s.y*.2,l=i-this._ad_final_size[AD_BANNER_TYPE_RESERVED_3].width*s.x*.1,u=r-this._ad_final_size[AD_BANNER_TYPE_RESERVED_3].height*s.y*.1;this._node_3.anchor=e,this._node_3.visible=!0,this._node_3.position={x:n,y:o},this._node_3.tween_from_to(NODE_TWEEN_ATTR_TYPE_POSITION_X,.3,.1,0,n,h,0),this._node_3.tween_from_to(NODE_TWEEN_ATTR_TYPE_POSITION_Y,.3,.1,0,o,c,0),this._node_3.tween_from_to(NODE_TWEEN_ATTR_TYPE_POSITION_X,.15,.4,0,h,l,0),this._node_3.tween_from_to(NODE_TWEEN_ATTR_TYPE_POSITION_Y,.15,.4,0,c,u,0),this._node_3.tween_from_to(NODE_TWEEN_ATTR_TYPE_ROTATION_Z,.15,.4,0,0,5,0),this._node_3.tween_from_to(NODE_TWEEN_ATTR_TYPE_POSITION_X,.08,.55,0,l,i,0),this._node_3.tween_from_to(NODE_TWEEN_ATTR_TYPE_POSITION_Y,.08,.55,0,u,r,0),this._node_3.tween_from_to(NODE_TWEEN_ATTR_TYPE_ROTATION_Z,.08,.55,0,5,0,0)}else this._node_3.visible=!1},gl_commit:function(t){var e=t._gl;UIEventHandler&&UIEventHandler.setRootNode(t._root_node),t.webGL_save(),e.viewport(0,0,BK.Director.screenPixelSize.width,BK.Director.screenPixelSize.height),e.disable(e.DEPTH_TEST),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA);var i=n(0,BK.Director.screenPixelSize.width,0,BK.Director.screenPixelSize.height,-1,1);t._webgl_shader.set_uniform("Projection",i);var o=new r;t._webgl_shader.set_uniform("ModelView",o),t._gl_root_node.render(e,t._webgl_shader,!0),t.webGL_restore(),e.superGLCommit()},webGL_init:function(){this._gl=bkWebGLGetInstance(),this._gl_root_node=new u,this._webgl_shader=this.webGL_load_shader(),this._gl.superGLCommit=this._gl.glCommit,this._gl.glCommit=this.gl_commit.bind(this._gl,this)},webGL_load_shader:function(){var t=new r,e={vs_source:"attribute vec3 Position;attribute vec4 SourceColor;varying vec4 DestinationColor;uniform mat4 Projection;uniform mat4 ModelView;attribute vec2 TexCoordIn;varying vec2 TexCoordOut;void main(void) { DestinationColor = SourceColor; mat4 mp = Projection * ModelView; gl_Position = mp * vec4(Position, 1.0); TexCoordOut = TexCoordIn;}",fs_source:"varying lowp vec4 DestinationColor;varying lowp vec2 TexCoordOut;uniform sampler2D Texture;void main(void) { lowp vec4 tc = texture2D(Texture, TexCoordOut); gl_FragColor = DestinationColor * tc;}",attributes:[{name:"Position",size:3},{name:"SourceColor",size:4},{name:"TexCoordIn",size:2}],uniforms:[{name:"Projection",type:SHADER_UNIFORM_TYPE_MATRIX4,default_value:t},{name:"ModelView",type:SHADER_UNIFORM_TYPE_MATRIX4,default_value:t},{name:"Texture",type:SHADER_UNIFORM_TYPE_TEXTURE0,default_value:0}]};return new l(this._gl,e)},webGL_exit:function(){void 0!==this._gl.superGLCommit&&(this._gl.glCommit=this._gl.superGLCommit,this._gl.superGLCommit=void 0),this._tex_bg_left&&(this._gl.deleteTexture(this._tex_bg_left.texture),this._gl.deleteTexture(this._tex_bg_bg_1.texture),this._gl.deleteTexture(this._tex_bg_bg_2.texture),this._gl.deleteTexture(this._tex_bg_fg_1.texture),this._gl.deleteTexture(this._tex_bg_fg_2.texture),this._gl.deleteTexture(this._tex_bg_right.texture))},webGL_save:function(){e()&&(this._is_clip_enabled=this._gl.glIsEnabled(this._gl.SCISSOR_TEST),this._is_clip_enabled?this._old_scissor=this._gl.glGetParameterInt(this._gl.SCISSOR_BOX,4):this._gl.glEnable(this._gl.SCISSOR_TEST),this._gl.glScissor(this._clip_rect.x,this._clip_rect.y,this._clip_rect.width,this._clip_rect.height)),this._is_enable_blend=this._gl.glIsEnabled(this._gl.BLEND),this._is_enable_blend&&(this._blend_color=this._gl.glGetParameterFloat(this._gl.BLEND_COLOR,4),this._blend_equation_rgb=this._gl.getParameter(this._gl.BLEND_EQUATION_RGB),this._blend_equation_alpha=this._gl.getParameter(this._gl.BLEND_EQUATION_ALPHA),this._blend_src_rgb=this._gl.getParameter(this._gl.BLEND_SRC_RGB),this._blend_src_alpha=this._gl.getParameter(this._gl.BLEND_SRC_ALPHA),this._blend_dst_rgb=this._gl.getParameter(this._gl.BLEND_DST_RGB),this._blend_dst_alpha=this._gl.getParameter(this._gl.BLEND_DST_ALPHA)),this._prevVP=this._gl.glGetParameterInt(this._gl.VIEWPORT,4),this._prevVBO=this._gl.glGetParameterInt(this._gl.ARRAY_BUFFER_BINDING,1),this._prevIBO=this._gl.glGetParameterInt(this._gl.ELEMENT_ARRAY_BUFFER_BINDING,1),this._prevProgram=this._gl.glGetParameterInt(this._gl.CURRENT_PROGRAM,1),this._prevTextureID=this._gl.glGetParameterInt(this._gl.TEXTURE_BINDING_2D,1),this._prevTextureUnit=this._gl.glGetParameterInt(this._gl.ACTIVE_TEXTURE,1),this._prevFrameBuffer=this._gl.glGetParameterInt(this._gl.FRAMEBUFFER_BINDING,1),this._prevRenderBuffer=this._gl.glGetParameterInt(this._gl.RENDERBUFFER_BINDING,1),this._activeAttribusInfo=[];for(var t=this._gl.glGetProgramParameter(this._prevProgram,gl.ACTIVE_ATTRIBUTES),i=0;i<t;++i){var r=this._gl.getActiveAttrib(this._prevProgram,i),n=r.name,o=this._gl.getAttribLocation(this._prevProgram,n),a=this._gl.getVertexAttrib(o,this._gl.VERTEX_ATTRIB_ARRAY_SIZE),s=this._gl.getVertexAttrib(o,this._gl.VERTEX_ATTRIB_ARRAY_TYPE),h=this._gl.getVertexAttrib(o,this._gl.VERTEX_ATTRIB_ARRAY_NORMALIZED),c=this._gl.getVertexAttrib(o,this._gl.VERTEX_ATTRIB_ARRAY_STRIDE),l=this._gl.getVertexAttribOffset(o,gl.VERTEX_ATTRIB_ARRAY_POINTER);if(r.name=n,r.index=o,r.size=a,r.type=s,r.normalized=h,r.stride=c,r.offset=l,void 0!==this._gl.recordVertexAttribPointer)for(var u=0;u<this._gl.recordVertexAttribPointer.length;u++){var d=this._gl.recordVertexAttribPointer[u];if(r.index==d.index&&r.type==d.type&&r.stride==d.stride&&r.offset==d.offset){r.index=d.index,r.size=d.size,r.type=d.type,r.normalized=d.normalized,r.stride=d.stride,r.offset=d.offset;break}}this._activeAttribusInfo.push(r)}},webGL_restore:function(){if(this._is_enable_blend?(this._gl.glEnable(this._gl.BLEND),this._gl.blendColor(this._blend_color[0],this._blend_color[1],this._blend_color[2],this._blend_color[3]),this._gl.blendEquationSeparate(this._blend_equation_rgb,this._blend_equation_alpha),this._gl.blendFuncSeparate(this._blend_src_rgb,this._blend_dst_rgb,this._blend_src_alpha,this._blend_dst_alpha)):this._gl.glDisable(this._gl.BLEND),this._gl.viewport(this._prevVP[0],this._prevVP[1],this._prevVP[2],this._prevVP[3]),this._gl.useProgram(this._prevProgram),this._gl.bindBuffer(this._gl.ARRAY_BUFFER,this._prevVBO),this._activeAttribusInfo.length>0){this._activeAttribusInfo[0].stride;for(var t=0;t<this._activeAttribusInfo.length;t++){var i=this._activeAttribusInfo[t],r=(i.name,i.index),n=i.size,o=i.type,a=i.normalized,s=i.offset,h=i.stride,c=0!=a;this._gl.vertexAttribPointer(r,n,o,c,h,s,!0)}}this._activeAttribusInfo=[],this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER,this._prevIBO),this._gl.activeTexture(this._prevTextureUnit),this._gl.bindTexture(this._gl.TEXTURE_2D,this._prevTextureID),this._gl.glBindFramebuffer(this._gl.FRAMEBUFFER,this._prevFrameBuffer),this._gl.glBindRenderbuffer(this._gl.RENDERBUFFER,this._prevRenderBuffer),e()&&(this._is_clip_enabled?this._gl.glScissor(this._old_scissor[0],this._old_scissor[1],this._old_scissor[2],this._old_scissor[3]):this._gl.glDisable(this._gl.SCISSOR_TEST))}},{AdAnimateBanner:g}}().AdAnimateBanner)}(BK);var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();!function(t,e){"object"==typeof t&&(t.AdAnimateBannerHandler=function(){var t=function(){function t(t,e){this.info=t,this.download(e)}return t.prototype.download=function(t){var e="GameSandBox://__bkDownloadCache/"+BK.Crypt.hex_md5(this.info.url);this.info.savePath&&(e=this.info.savePath);var i=!0;if(1==(!!this.info.useCache&&this.info.useCache)&&1==BK.FileUtil.isFileExist(e)){i=!1;var r={url:this.info.url,statueCode:200,savePath:e};t(r)}1==i&&new BK.HttpUtil(this.info.url).requestAsync(function(i,r){200==r?BK.FileUtil.writeBufferToFile(e,i):BK.Script.log(1,1,"Fetch banner image failed.url:"+this.info.url);var n={url:this.info.url,statueCode:r,savePath:e};t(n)}.bind(this))},t}(),e=function(){function e(){}return e.download=function(e,i){this.completeTasks=[],this.reqTasks=e;for(var r=0;r<e.length;r++){var n=e[r];new t(n,function(t){this.completeTasks.push(t),this.check()&&i(this.completeTasks)}.bind(this))}BK.Director.ticker.setTimeout(function(){this.fillUncomplete(),i(this.completeTasks)}.bind(this),3e4,this)},e.cancelTimeOut=function(){BK.Director.ticker.removeTimeout(this)},e.fillUncomplete=function(){for(var t=0;t<this.reqTasks.length;t++){for(var e=this.reqTasks[t],i=!1,r=0;r<this.completeTasks.length;r++){var n=this.completeTasks[r];e.url==n.url&&(i=!0)}if(0==i){var o={url:e.url,statueCode:-1,savePath:e.savePath};this.completeTasks.push(o)}}},e.check=function(){return this.completeTasks.length==this.reqTasks.length&&(this.cancelTimeOut(),!0)},e}();return{AdAnimateBannerHandler:function(t){function i(e,i){var r=t.call(this,e,i)||this;return r.bannerContentInfo=r.parseInfo(r.adInfo),r.banner=null,r}return __extends(i,t),i.prototype.setHidden=function(t){this.banner?this.banner.setHidden(t):BK.Script.log(1,1,"set hidden fail ,this.banner is null")},i.prototype.show=function(t){this.bannerType=1,this._show(function(e,i,r){if(0==e)if(void 0!==this.bannerContentInfo.staticBannerType){this.banner=new BK.AdAnimateBanner(i),this.bannerContentInfo.ad_type=this.bannerContentInfo,this.bannerContentInfo.tex_files=r;var n={ad_type:this.bannerContentInfo.staticBannerType,tex_files:r,title:this.bannerContentInfo.title,content:this.bannerContentInfo.content};this.banner.setClickContentCallback(this._onClickContentCallback.bind(this)),this.banner.show(n),this._onShowCallback(),t(e,"show ok",this)}else t(-1,"show failed",null);else t(e,"show _show failed",null)}.bind(this))},i.prototype.showAnimate=function(t){this.bannerType=2,this._show(function(e,i,r){if(0==e)if(void 0!==this.bannerContentInfo.dynamicBannerType){this.banner=new BK.AdAnimateBanner(i),this.bannerContentInfo.ad_type=this.bannerContentInfo,this.bannerContentInfo.tex_files=r;var n={ad_type:this.bannerContentInfo.dynamicBannerType,tex_files:r,title:this.bannerContentInfo.title,content:this.bannerContentInfo.content};this.banner.setClickContentCallback(this._onClickContentCallback.bind(this)),this.banner.show(n),this._onShowCallback(),t(e,"showAnimate ok",this)}else t(-1,"fshowAnimate ailed",null);else t(e,"showAnimate _show failed",null)}.bind(this))},i.prototype._onShowCallback=function(){this.cmshowReport(1,"","",this.bannerType.toString()),this.exposeureReport()},i.prototype._jumpToGDTDestPage=function(){var t=this.adInfo;BK.MQQ.SsoRequest.send(t,"cs.xy_ad_banner_jump.local")},i.prototype._onClickContentCallback=function(){this.cmshowReport(3,"","",this.bannerType.toString()),this.clickReport(),1==BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5")||"android"===GameStatusInfo.platform&&1==BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.8.0")?this._onClickContentBtn():(this._emmitClickEvent(),this._jumpToGDTDestPage())},i.prototype._show=function(t){if(!this.bannerContentInfo)return BK.Script.log(1,1,"show failed.ad info is illegal!"),void t(-2,null,null);this.loadRes(function(e,i){0==e?this.loadImage(function(e,r){t(e,i,r)}.bind(this)):t(-1,null,null)}.bind(this))},i.prototype.close=function(){this.banner?(this.banner.dispose(),this.banner=null):BK.Script.log(1,1,"close banner failed. banner has not been inited!")},i.prototype.loadImage=function(t){for(var i=[],r=0;r<this.bannerContentInfo.image.length;r++){var n={url:this.bannerContentInfo.image[r]};i.push(n)}e.download(i,function(e){for(var r=!0,n=[],o=0;o<i.length;o++)for(var a=i[o],s=0;s<e.length;s++){var h=e[s];a.url==h.url&&(200!=h.statueCode?(BK.Script.log(1,1,"banner load image failed.url:"+h.url),r=!1):n.push(h.savePath))}t(1==r?0:-1,n)}.bind(this))},i.prototype.loadRes=function(t){e.download([{url:"https://qzonestyle.gtimg.cn/aoi/sola/20180713161350_Jwn4D4m83k.png",savePath:"GameSandBox://_bkAd/bg_left.png",useCache:!0},{url:"https://qzonestyle.gtimg.cn/aoi/sola/20180713161350_A8Q8Sow7O2.png",savePath:"GameSandBox://_bkAd/bg_right.png",useCache:!0},{url:"https://qzonestyle.gtimg.cn/aoi/sola/20180713161350_ufpiWlVIBh.png",savePath:"GameSandBox://_bkAd/bg_bg_2.png",useCache:!0},{url:"https://qzonestyle.gtimg.cn/aoi/sola/20180713161350_bb7MoaVYPP.png",savePath:"GameSandBox://_bkAd/bg_fg_2.png",useCache:!0},{url:"https://qzonestyle.gtimg.cn/aoi/sola/20180713161349_490ORk1ziJ.png",savePath:"GameSandBox://_bkAd/bg_fg_1.png",useCache:!0},{url:"https://qzonestyle.gtimg.cn/aoi/sola/20180713161349_I3ZMMhw8al.png",savePath:"GameSandBox://_bkAd/bg_bg_1.png",useCache:!0}],function(e){for(var i="",r="",n="",o="",a="",s="",h=!0,c=0;c<e.length;c++){var l=e[c];200!=l.statueCode&&(h=!1),l.savePath.indexOf("bg_bg_1")>0?n=l.savePath:l.savePath.indexOf("bg_bg_2")>0?o=l.savePath:l.savePath.indexOf("bg_fg_1")>0?a=l.savePath:l.savePath.indexOf("bg_fg_2")>0?s=l.savePath:l.savePath.indexOf("bg_left")>0?i=l.savePath:l.savePath.indexOf("bg_right")>0&&(r=l.savePath)}t(1==h?0:-1,{bg_left_path:i,bg_right_path:r,bg_bg_1_path:n,bg_bg_2_path:o,bg_fg_1_path:a,bg_fg_2_path:s})}.bind(this))},i.prototype.parseInfo=function(t){var e=t.display_info.creative_size;this.creativeSize=e;var i={creative_size:e,content:"",title:""};switch(e){case 193:i.image=[t.display_info.basic_info.img],i.staticBannerType=6,i.dynamicBannerType=0;break;case 194:i.image=[t.display_info.basic_info.img],i.title=t.display_info.basic_info.txt,i.content=t.display_info.basic_info.desc,i.staticBannerType=7,i.dynamicBannerType=1;break;case 285:i.image=t.display_info.muti_pic_text_info.image,i.content=t.display_info.basic_info.txt,i.staticBannerType=9,i.dynamicBannerType=3;break;case 184:i.image=[t.display_info.basic_info.img],i.content=t.display_info.basic_info.txt,i.staticBannerType=8,i.dynamicBannerType=2;break;case 210:i.image=[t.display_info.basic_info.img],i.content=t.display_info.basic_info.txt,i.staticBannerType=10,i.dynamicBannerType=4;break;case 65:i.image=[t.display_info.basic_info.img],i.content=t.display_info.basic_info.txt,i.staticBannerType=11,i.dynamicBannerType=5;break;default:return BK.Script.log(1,1,"parseInfo failed."),null}return i},i}(BK.AdBannerHandler)}}().AdAnimateBannerHandler)}(BK)}!function(t,e){t.Crypt=function(){function t(){this.hexcase=0,this.b64pad="",this.chrsz=8}return t.prototype.hex_md5=function(t){return this.bin2hex(this.core_md5(this.str2bin(t),t.length*this.chrsz))},t.prototype.b64_md5=function(t){return this.bin2b64(this.core_md5(this.str2bin(t),t.length*this.chrsz))},t.prototype.str_md5=function(t){return this.bin2str(this.core_md5(this.str2bin(t),t.length*this.chrsz))},t.prototype.hex_hmac_md5=function(t,e){return this.bin2hex(this.core_hmac_md5(t,e))},t.prototype.b64_hmac_md5=function(t,e){return this.bin2b64(this.core_hmac_md5(t,e))},t.prototype.str_hmac_md5=function(t,e){return this.bin2str(this.core_hmac_md5(t,e))},t.prototype.md5_vm_test=function(){return"900150983cd24fb0d6963f7d28e17f72"==this.hex_md5("abc")},t.prototype.core_md5=function(t,e){t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;for(var i=1732584193,r=-271733879,n=-1732584194,o=271733878,a=0;a<t.length;a+=16){var s=i,h=r,c=n,l=o;i=this.md5_ff(i,r,n,o,t[a+0],7,-680876936),o=this.md5_ff(o,i,r,n,t[a+1],12,-389564586),n=this.md5_ff(n,o,i,r,t[a+2],17,606105819),r=this.md5_ff(r,n,o,i,t[a+3],22,-1044525330),i=this.md5_ff(i,r,n,o,t[a+4],7,-176418897),o=this.md5_ff(o,i,r,n,t[a+5],12,1200080426),n=this.md5_ff(n,o,i,r,t[a+6],17,-1473231341),r=this.md5_ff(r,n,o,i,t[a+7],22,-45705983),i=this.md5_ff(i,r,n,o,t[a+8],7,1770035416),o=this.md5_ff(o,i,r,n,t[a+9],12,-1958414417),n=this.md5_ff(n,o,i,r,t[a+10],17,-42063),r=this.md5_ff(r,n,o,i,t[a+11],22,-1990404162),i=this.md5_ff(i,r,n,o,t[a+12],7,1804603682),o=this.md5_ff(o,i,r,n,t[a+13],12,-40341101),n=this.md5_ff(n,o,i,r,t[a+14],17,-1502002290),r=this.md5_ff(r,n,o,i,t[a+15],22,1236535329),i=this.md5_gg(i,r,n,o,t[a+1],5,-165796510),o=this.md5_gg(o,i,r,n,t[a+6],9,-1069501632),n=this.md5_gg(n,o,i,r,t[a+11],14,643717713),r=this.md5_gg(r,n,o,i,t[a+0],20,-373897302),i=this.md5_gg(i,r,n,o,t[a+5],5,-701558691),o=this.md5_gg(o,i,r,n,t[a+10],9,38016083),n=this.md5_gg(n,o,i,r,t[a+15],14,-660478335),r=this.md5_gg(r,n,o,i,t[a+4],20,-405537848),i=this.md5_gg(i,r,n,o,t[a+9],5,568446438),o=this.md5_gg(o,i,r,n,t[a+14],9,-1019803690),n=this.md5_gg(n,o,i,r,t[a+3],14,-187363961),r=this.md5_gg(r,n,o,i,t[a+8],20,1163531501),i=this.md5_gg(i,r,n,o,t[a+13],5,-1444681467),o=this.md5_gg(o,i,r,n,t[a+2],9,-51403784),n=this.md5_gg(n,o,i,r,t[a+7],14,1735328473),r=this.md5_gg(r,n,o,i,t[a+12],20,-1926607734),i=this.md5_hh(i,r,n,o,t[a+5],4,-378558),o=this.md5_hh(o,i,r,n,t[a+8],11,-2022574463),n=this.md5_hh(n,o,i,r,t[a+11],16,1839030562),r=this.md5_hh(r,n,o,i,t[a+14],23,-35309556),i=this.md5_hh(i,r,n,o,t[a+1],4,-1530992060),o=this.md5_hh(o,i,r,n,t[a+4],11,1272893353),n=this.md5_hh(n,o,i,r,t[a+7],16,-155497632),r=this.md5_hh(r,n,o,i,t[a+10],23,-1094730640),i=this.md5_hh(i,r,n,o,t[a+13],4,681279174),o=this.md5_hh(o,i,r,n,t[a+0],11,-358537222),n=this.md5_hh(n,o,i,r,t[a+3],16,-722521979),r=this.md5_hh(r,n,o,i,t[a+6],23,76029189),i=this.md5_hh(i,r,n,o,t[a+9],4,-640364487),o=this.md5_hh(o,i,r,n,t[a+12],11,-421815835),n=this.md5_hh(n,o,i,r,t[a+15],16,530742520),r=this.md5_hh(r,n,o,i,t[a+2],23,-995338651),i=this.md5_ii(i,r,n,o,t[a+0],6,-198630844),o=this.md5_ii(o,i,r,n,t[a+7],10,1126891415),n=this.md5_ii(n,o,i,r,t[a+14],15,-1416354905),r=this.md5_ii(r,n,o,i,t[a+5],21,-57434055),i=this.md5_ii(i,r,n,o,t[a+12],6,1700485571),o=this.md5_ii(o,i,r,n,t[a+3],10,-1894986606),n=this.md5_ii(n,o,i,r,t[a+10],15,-1051523),r=this.md5_ii(r,n,o,i,t[a+1],21,-2054922799),i=this.md5_ii(i,r,n,o,t[a+8],6,1873313359),o=this.md5_ii(o,i,r,n,t[a+15],10,-30611744),n=this.md5_ii(n,o,i,r,t[a+6],15,-1560198380),r=this.md5_ii(r,n,o,i,t[a+13],21,1309151649),i=this.md5_ii(i,r,n,o,t[a+4],6,-145523070),o=this.md5_ii(o,i,r,n,t[a+11],10,-1120210379),n=this.md5_ii(n,o,i,r,t[a+2],15,718787259),r=this.md5_ii(r,n,o,i,t[a+9],21,-343485551),i=this.safe_add(i,s),r=this.safe_add(r,h),n=this.safe_add(n,c),o=this.safe_add(o,l)}return Array(i,r,n,o)},t.prototype.md5_cmn=function(t,e,i,r,n,o){return this.safe_add(this.rol(this.safe_add(this.safe_add(e,t),this.safe_add(r,o)),n),i)},t.prototype.md5_ff=function(t,e,i,r,n,o,a){return this.md5_cmn(e&i|~e&r,t,e,n,o,a)},t.prototype.md5_gg=function(t,e,i,r,n,o,a){return this.md5_cmn(e&r|i&~r,t,e,n,o,a)},t.prototype.md5_hh=function(t,e,i,r,n,o,a){return this.md5_cmn(e^i^r,t,e,n,o,a)},t.prototype.md5_ii=function(t,e,i,r,n,o,a){return this.md5_cmn(i^(e|~r),t,e,n,o,a)},t.prototype.core_hmac_md5=function(t,e){var i=this.str2bin(t);i.length>16&&(i=this.core_md5(i,t.length*this.chrsz));for(var r=Array(16),n=Array(16),o=0;o<16;o++)r[o]=909522486^i[o],n[o]=1549556828^i[o];var a=this.core_md5(r.concat(this.str2bin(e)),512+e.length*this.chrsz);return this.core_md5(n.concat(a),640)},t.prototype.hex_sha1=function(t){return this.bin2hex(this.core_sha1(this.str2bin(t),t.length*this.chrsz))},t.prototype.b64_sha1=function(t){return this.bin2b64(this.core_sha1(this.str2bin(t),t.length*this.chrsz))},t.prototype.str_sha1=function(t){return this.bin2str(this.core_sha1(this.str2bin(t),t.length*this.chrsz))},t.prototype.hex_hmac_sha1=function(t,e){return this.bin2hex(this.core_hmac_sha1(t,e))},t.prototype.b64_hmac_sha1=function(t,e){return this.bin2b64(this.core_hmac_sha1(t,e))},t.prototype.str_hmac_sha1=function(t,e){return this.bin2str(this.core_hmac_sha1(t,e))},t.prototype.sha1_vm_test=function(){return"a9993e364706816aba3e25717850c26c9cd0d89d"==this.hex_sha1("abc")},t.prototype.core_sha1=function(t,e){t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e;for(var i=Array(80),r=1732584193,n=-271733879,o=-1732584194,a=271733878,s=-1009589776,h=0;h<t.length;h+=16){for(var c=r,l=n,u=o,d=a,_=s,f=0;f<80;f++){i[f]=f<16?t[h+f]:this.rol(i[f-3]^i[f-8]^i[f-14]^i[f-16],1);var g=this.safe_add(this.safe_add(this.rol(r,5),this.sha1_ft(f,n,o,a)),this.safe_add(this.safe_add(s,i[f]),this.sha1_kt(f)));s=a,a=o,o=this.rol(n,30),n=r,r=g}r=this.safe_add(r,c),n=this.safe_add(n,l),o=this.safe_add(o,u),a=this.safe_add(a,d),s=this.safe_add(s,_)}return Array(r,n,o,a,s)},t.prototype.sha1_ft=function(t,e,i,r){return t<20?e&i|~e&r:t<40?e^i^r:t<60?e&i|e&r|i&r:e^i^r},t.prototype.sha1_kt=function(t){return t<20?1518500249:t<40?1859775393:t<60?-1894007588:-899497514},t.prototype.core_hmac_sha1=function(t,e){var i=this.str2bin(t);i.length>16&&(i=this.core_sha1(i,t.length*this.chrsz));for(var r=Array(16),n=Array(16),o=0;o<16;o++)r[o]=909522486^i[o],n[o]=1549556828^i[o];var a=this.core_sha1(r.concat(this.str2bin(e)),512+e.length*this.chrsz);return this.core_sha1(n.concat(a),672)},t.prototype.safe_add=function(t,e){var i=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(i>>16)<<16|65535&i},t.prototype.rol=function(t,e){return t<<e|t>>>32-e},t.prototype.str2bin=function(t){for(var e=Array(),i=(1<<this.chrsz)-1,r=0;r<t.length*this.chrsz;r+=this.chrsz)e[r>>5]|=(t.charCodeAt(r/this.chrsz)&i)<<24-r%32;return e},t.prototype.bin2str=function(t){for(var e="",i=(1<<this.chrsz)-1,r=0;r<32*t.length;r+=this.chrsz)e+=String.fromCharCode(t[r>>5]>>>24-r%32&i);return e},t.prototype.bin2hex=function(t){for(var e=this.hexcase?"0123456789ABCDEF":"0123456789abcdef",i="",r=0;r<4*t.length;r++)i+=e.charAt(t[r>>2]>>8*(3-r%4)+4&15)+e.charAt(t[r>>2]>>8*(3-r%4)&15);return i},t.prototype.bin2b64=function(t){for(var e="",i=0;i<4*t.length;i+=3)for(var r=(t[i>>2]>>8*(3-i%4)&255)<<16|(t[i+1>>2]>>8*(3-(i+1)%4)&255)<<8|t[i+2>>2]>>8*(3-(i+2)%4)&255,n=0;n<4;n++)8*i+6*n>32*t.length?e+=this.b64pad:e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>6*(3-n)&63);return e},new t}()}(BK);var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();if(function(t,e){"object"==typeof t&&(t.AdVideoHandler=e().AdVideoHandler,t.AdVideoHandlerNative=e().AdVideoHandlerNative)}(BK,function(){var t=function(){function t(t,e,i,r){this._onStartPlay=function(t){this.event&&this.event.onStartPlay?this.event.onStartPlay(t.code,t.msg):this.log("lack of onStartPlay callback"),this.log("_onStartPlay")},this.hasJump=!1,this.videoType=t;var n="";i.display_info&&i.display_info.button_info&&i.display_info.button_info.length>0&&(n=i.display_info.button_info[0].txt);i.display_info.advertiser_info.corporation_name,i.display_info.advertiser_info.corporate_image_name,i.display_info.advertiser_info.corporate_logo;var o=0;if(i.display_info.button_info.length>0)for(var a=i.display_info.button_info,s=0;s<a.length;s++){var h=a[s];if(void 0!=typeof h.pos){o=h.pos;break}}this.adVideoInfo={pos_id:e,tencent_video_id:i.display_info.video_info.tencent_video_id,creative_size:i.display_info.creative_size,dest_info:i.dest_info,buttonInfo_txt:n,buttonInfo_pos:o,corporation_name:i.display_info.advertiser_info.corporation_name,corporate_image_name:i.display_info.advertiser_info.corporate_image_name,corporate_logo:i.display_info.advertiser_info.corporate_logo,base_info:i.display_info.basic_info.txt,product_type:i.product_type,exposure_url:i.report_info.exposure_url,click_url:i.report_info.click_url,video_preview_url:i.display_info.basic_info.img,pkg_download_schema:i.app_info.pkg_download_schema},this.adFullVideoInfo=i,this.adVideoInfo.dksjs=Math.random().toString(),this.gameOrientation=r}return t.prototype._onEnterForeground=function(){this.log("_onEnterForeground"),void 0!==this.envType?this._resumeAllMusic():BK.Audio.switch=!1},t.prototype._removeListener=function(){BK.MQQ.SsoRequest.removeListener("sc.game_enter_foreground.local",this),BK.MQQ.SsoRequest.removeListener("sc.apolloGameWebMessage.local",this)},t.prototype._addListener=function(){BK.MQQ.SsoRequest.addListener("sc.game_enter_foreground.local",this,this._onEnterForeground.bind(this))},t.prototype.jump=function(){if(1!=this.hasJump){this.hasJump=!0,this._addListener(),BK.Advertisement.videoCMReport(this.videoType,3),this._pauseAllMusic();var t=this.gameOrientation,e=this.adVideoInfo,i="https://cmshow.qq.com/apollo/html/game-platform/game-ad.html?_wv=4099&_bid=3143&_fv=0&";i=(i=(i=i+"gameOrientation="+(void 0===t?1:t)+"&")+"gameId="+GameStatusInfo.gameId+"&")+"adInfo="+encodeURI(JSON.stringify(e));var r={gameOrientation:t,transparent:1,businessType:2,openId:GameStatusInfo.openId,url:i};BK.MQQ.SsoRequest.addListener("sc.apolloGameWebMessage.local",this,function(t,e,i){0==t&&i.op&&("apolloGamePlatform.endAdVideo"==i.op?i.data?this._onEndAdVideo(i.data):(this._onEndAdVideo(null),BK.Script.log(1,1,"video ad end failed. data.data is null")):"apolloGamePlatform.closeGame"==i.op?i.data?this._onCloseGame(i.data):(this._onCloseGame(null),BK.Script.log(1,1,"video ad close failed. data.data is null")):"apolloGamePlatform.miniGame"==i.op?"number"==typeof i.ggspd&&(BK.Advertisement.ggspd=i.ggspd):"apolloGamePlatform.closeWv"==i.op?(this._onCloseWebView(i.data),this.log("closeWv:"+JSON.stringify(i))):"apolloGamePlatform.startAdVideo"==i.op?(this._onStartPlay(i.data),this.log("startAdVideo:"+JSON.stringify(i))):"apolloGamePlatform.report"==i.op?this._onWebViewReport(i.data):"apolloGamePlatform.openUrl"==i.op&&(this._onWebViewOpenUrl(i.data),BK.Script.log(1,1,"apolloGamePlatform.openUrl url:"+JSON.stringify(i))))}.bind(this)),BK.MQQ.SsoRequest.send(r,"cs.openWebViewWithoutUrl.local")}else this.log("jump failed!Can't call jump twice!")},t.prototype._onWebViewReport=function(t){var e="";"exposure_url"==t.type?e=this.adFullVideoInfo.report_info.exposure_url:"click_url"==t.type&&(e=this.adFullVideoInfo.report_info.click_url),delete t.type,e=e+"&video="+encodeURIComponent(JSON.stringify(t)),BK.Script.log(1,1,"_onWebViewReport url:"+e),new BK.HttpUtil(e).requestAsync(function(t,e){BK.Script.log(1,1,"_onWebViewReport code:"+e)})},t.prototype._onWebViewOpenUrl=function(t){var e=t.type;BK.Script.log(1,1,"_onWebViewOpenUrl url:"+JSON.stringify(e)),BK.MQQ.Webview.open(e)},t.prototype._onCloseWebView=function(t){var e=0;void 0!==t.type&&(0==(e=t.type)?(this._resumeAllMusic(),this._removeListener()):1==e&&(this.envType=1),this.log("_onCloseWebView "+e)),this.event&&this.event.onCloseVideo?this.event.onCloseVideo(t.code,t.msg):this.log("lack of onCloseWebView callback"),this.event.onCloseVideo=null},t.prototype._onMini=function(){},t.prototype._onCloseGame=function(t){t?this.event&&this.event.onCloseGame?t&&t.code?this.event.onCloseGame(t.code,t.msg):this.event.onCloseGame(0,""):this.log("lack of onClose callback"):this.event.onCloseGame(-1,"_onCloseGame failed data is null"),BK.QQ.notifyCloseGame(),this.event.onCloseGame=null},t.prototype._onEndAdVideo=function(t){t?this.event&&this.event.onEndVideo?t.dksjs==this.adVideoInfo.dksjs?this.event.onEndVideo(t.code,t.msg):(BK.Script.log(1,1,"data.dksjs:"+t.dksjs+" this.adInfo[dksjs]:"+this.adVideoInfo.dksjs),this.event.onEndVideo(-1,"end video failed! illegal end viedo")):this.log("lack of onEnd callback"):this.event.onEndVideo(-1,"_onEndAdVideo failed.data is null"),this.event.onEndVideo=void 0},t.prototype._pauseAllMusic=function(){void 0===BK.isBrowser&&BK.Audio.pauseAllBackground()},t.prototype._resumeAllMusic=function(){void 0===BK.isBrowser&&BK.Audio.resumeAllBackground()},t.prototype.setEventCallack=function(t,e,i,r){void 0===this.event?this.event={onCloseGame:t,onEndVideo:e,onCloseVideo:i,onStartPlay:r}:(this.event.onCloseGame=t,this.event.onEndVideo=e,this.event.onCloseVideo=i,this.event.onStartPlay=r)},t.prototype.setEventCallback=function(t,e,i,r){this.setEventCallack(t,e,i,r)},t.prototype.log=function(t){BK.Script.log(1,1,"AdVideoHandler:"+t)},t.prototype.debugLog=function(t){BK.Script.log(0,0,"AdVideoHandler Debug:"+t)},t.prototype.errorLog=function(t){BK.Script.log(1,1,"AdVideoHandler Error:"+t)},t}();return{AdVideoHandler:t,AdVideoHandlerNative:function(t){function e(e,i,r,n){var o=t.call(this,e,i,r,n)||this;return o.CMSHOW_SC_CMD_AD_VIDEO_START="sc.game_ad_video_start.local",o.CMSHOW_SC_CMD_AD_VIDEO_END="sc.game_ad_video_end.local",o.CMSHOW_SC_CMD_AD_VIDEO_CLOSE="sc.game_ad_video_view_close.local",o.CMSHOW_SC_CMD_SHELL_CLOSE="sc.game_shell_close.local",o.CMSHOW_CS_CMD_AD_VIDEO_JUMP="cs.game_ad_video_jump.local",o.CMSHOW_CS_CMD_AD_VIDEO_CLOSE="cs.game_ad_video_close.local",o.posid=i,o.adInfo=r,o}return __extends(e,t),e.prototype.jump=function(){this.addNativeListener(),BK.Advertisement.videoCMReport(this.videoType,3),this._pauseAllMusic(),BK.MQQ.SsoRequest.send(this.adInfo,this.CMSHOW_CS_CMD_AD_VIDEO_JUMP)},e.prototype.close=function(){BK.MQQ.SsoRequest.send({},this.CMSHOW_CS_CMD_AD_VIDEO_CLOSE)},e.prototype.setEventCallack=function(t,e,i,r){void 0===this.event?this.event={onCloseGame:t,onEndVideo:e,onCloseVideo:i,onStartPlay:r}:(this.event.onCloseGame=t,this.event.onEndVideo=e,this.event.onCloseVideo=i,this.event.onStartPlay=r)},e.prototype._startVideo=function(t,e,i){this.event&&this.event.onStartPlay?this.event.onStartPlay(t,""):this.log("lack of onStartPlay callback"),this.log("_onStartPlay")},e.prototype._endVideo=function(t,e,i){this.event&&this.event.onEndVideo?this.event.onEndVideo(t,""):this.log("lack of onEnd callback"),this.log("_endVideo")},e.prototype._closeVideo=function(t,e,i){this._resumeAllMusic(),this.event&&this.event.onCloseVideo?this.event.onCloseVideo(t,""):this.log("lack of onEnd callback"),this.log("_closeVideo"),this.removeNativeListener()},e.prototype._closeGame=function(t,e,i){this.event&&this.event.onCloseGame?this.event.onCloseGame(t,""):this.log("lack of onClose callback"),this.event.onCloseGame=null},e.prototype.removeNativeListener=function(){BK.MQQ.SsoRequest.removeListener(this.CMSHOW_SC_CMD_AD_VIDEO_START,this),BK.MQQ.SsoRequest.removeListener(this.CMSHOW_SC_CMD_AD_VIDEO_END,this),BK.MQQ.SsoRequest.removeListener(this.CMSHOW_SC_CMD_AD_VIDEO_CLOSE,this),BK.MQQ.SsoRequest.removeListener(this.CMSHOW_SC_CMD_SHELL_CLOSE,this)},e.prototype.addNativeListener=function(){BK.MQQ.SsoRequest.addListener(this.CMSHOW_SC_CMD_AD_VIDEO_START,this,this._startVideo.bind(this)),BK.MQQ.SsoRequest.addListener(this.CMSHOW_SC_CMD_AD_VIDEO_END,this,this._endVideo.bind(this)),BK.MQQ.SsoRequest.addListener(this.CMSHOW_SC_CMD_AD_VIDEO_CLOSE,this,this._closeVideo.bind(this)),BK.MQQ.SsoRequest.addListener(this.CMSHOW_SC_CMD_SHELL_CLOSE,this,this._closeGame.bind(this))},e}(t)}}),function(t,e){"object"==typeof t&&(t.Advertisement=function(){return{Advertisement:function(){function t(){}return t.fetch=function(t,e){if(this.forbiden(t))e(-1,"ad not found.Current posid is forbidden.",null);else if(GameStatusInfo.devPlatform){var i=this.getDebugRetData();this.parseQQAdGetRsp(i,e)}else{var r="apollo_router_game.game_ad_linkcmd_get_ad";BK.MQQ.SsoRequest.removeListener(r,this),BK.MQQ.SsoRequest.addListener(r,this,function(t,i,r){0==t?this.parseQQAdGetRsp(r,e):e(t,"sso respose not 0.",null)}.bind(this));var n={game_id:GameStatusInfo.gameId,posid:t};BK.isBrowser?BK.MQQ.SsoRequest.sendSSO(n,r):BK.MQQ.SsoRequest.send(n,r)}},t.forbiden=function(t){if(t&&GameStatusInfo.adForbitPosId){var e=GameStatusInfo.adForbitPosId.split(";");if(!e)return!1;for(var i=0;i<e.length;i++)if(e[i]===t)return BK.Script.log(1,1,"current game"),!0}return!1},t.videoCMReport=function(t,e){var i=t.toString(),r=e.toString(),n=GameStatusInfo.openId;BK.QQ.uploadData("enter_SPA",i,r,n,"","")},t.parseQQAdGetRsp=function(t,e){if(0==t.ret)if(t.pos_ads_info.length>0){var i=t.pos_ads_info[0];if(0==i.ret){BK.Script.log(1,1,"fetch ad 广告位id:"+i.pos_id);var r=i.ads_info;r.length>0&&e(0,"OK",r[0])}else BK.Script.log(1,1,"广告位信息返回失败为空 ret:"+i.ret+" msg:"+i.msg),e(-1,"posAdInfo.ret not succeed 0. Detail:"+JSON.stringify(t),null)}else BK.Script.log(1,1,"fetch ad 广告信息为空"),e(-1,"pos_ads_info.length is 0.Detail:"+JSON.stringify(t),null);else BK.Script.log(1,1,"fetch ad failed.ret:"+t.ret+" msg:"+t.msg),e(-1,"fetch ad failed. Detail:"+JSON.stringify(t),null)},t.canReqBanner=function(){var t=!0;return void 0==this.lastBannerReqTs?(this.lastBannerReqTs=BK.Time.timestamp,t):(BK.Time.timestamp-this.lastBannerReqTs>1?(t=!0,this.lastBannerReqTs=BK.Time.timestamp):t=!1,t)},t.fetchBannerAd=function(t){if(0!=this.canReqBanner()){var e="6060137618613664";this.fetch(e,function(i,r,n){if(0==i){if(0==this.bannerCreativeSizeFilter(n))return void t(-1,"ad data is creative is illegal.",null);this.currentAdBannerHandle&&(this.currentAdBannerHandle.close(),this.currentAdBannerHandle=void 0);var o=new BK.AdAnimateBannerHandler(e,n);this.currentAdBannerHandle=o,t(i,r,o)}else t(i,r,null)}.bind(this))}else t(-1,"frequency is limited",null)},t.videoCreativeSizeFilter=function(t){var e=[185,585],i=[185,585,564,565],r=[];return r=BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.5")?e:i,this.createSizeFilter(r,t)},t.bannerCreativeSizeFilter=function(t){var e=[193,65,184,194,210,285];return this.createSizeFilter(e,t)},t.createSizeFilter=function(t,e){var i=-1;if(e&&e.display_info&&e.display_info.creative_size){i=e.display_info.creative_size;for(var r=0;r<t.length;r++){var n=t[r];if(BK.Script.log(1,1,"createSizeFilter:"+n),Math.abs(i-n)<.01)return BK.Script.log(1,1,"compare found:"+i),!0}return BK.Script.log(1,1,"data is error!creative size is not illegal! current:"+i),!1}return BK.Script.log(1,1,"data is error!creative size is not found!"),!1},t.fetchVideoAd=function(t,e){var i="2090532727455152";this.videoCMReport(t,4),this.fetch(i,function(r,n,o){if(o)if(0!=this.videoCreativeSizeFilter(o)){var a=1;o&&o.display_info&&o.display_info.creative_size?185==o.display_info.creative_size?a=3:585==o.display_info.creative_size&&(a=1):BK.Script.log(1,1,"fetch ad has problem.lack of display_info.creative_size property.");var s=1,h=this.getGameConfig();h&&void 0!==h.viewMode&&(s=h.viewMode);var c=!0,l="";if(o.display_info&&o.display_info.video_info&&o.display_info.video_info.tencent_video_id&&"string"==typeof o.display_info.video_info.tencent_video_id&&o.display_info.video_info.tencent_video_id.length>0?c=!0:(c=!1,l="can not find video id"),1==BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.0")&&(3!=s&&2!=s||1!=a||(c=!1,l="device oriation compare failed.device :"+s.toString()+" ad:"+a.toString())),1==c)if(0==r){this.videoCMReport(t,5);var u=void 0;u=1==BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.7.0")?new BK.AdVideoHandler(t,i,o,s):new BK.AdVideoHandlerNative(t,i,o,s),e(r,n,u)}else e(r,n,null);else e(-1,"no ads found."+l,null)}else e(-1,"ad data is creative is illegal.",null);else e(-1,"ad data is undefined or null",null)}.bind(this))},t.getGameConfig=function(){if(!BK.isBrowser){var t=BK.FileUtil.readFile("GameRes://gameConfig.json");if(t&&t.length>0){var e=t.readAsString();return JSON.parse(e)}}},t.getDebugRetData=function(){var t=BK.FileUtil.readFile("GameRes://script/demo/data/adBanner285.json");if(t&&t.length>0){var e=t.readAsString();return JSON.parse(e)}return{ret:0,msg:"s",pos_ads_info:[{ret:0,msg:"string",pos_id:"string",ads_info:[{product_type:1,display_info:{pattern_type:1,creative_size:1,animation_effect:1,basic_info:{img:"http://mat1.gtimg.com/ipad/qq_time/imgs/20180505_lixia_base.jpg",img_s:"http://mat1.gtimg.com/ipad/images/time/timelogo.jpg",txt:"广告素材的标题",desc:"广告的详细描述"},button_info:[{txt:"按钮",url:"http://www.qq.com",pos:1}],muti_pic_text_info:{txt:["txt1","txt2"],image:["http://txt2.png","http://txt2.png"],url:["http://txt2.png","http://txt2.png"]},advertiser_info:{corporation_name:"string",corporate_image_name:"string",corporate_logo:"string"},video_info:{video_url:"string",media_duration:30}},report_info:void 0,dest_info:{dest_url_display_type:1,landing_page:"https://www.qq.com",canvas_json:"string",dest_type:1},app_info:void 0}]}],gdt_cookie:"string",busi_cookie:"string"}},t.openAdVideo=function(t,e){var i="https://cmshow.qq.com/apollo/html/game-platform/game-ad.html";i=(i=(i=i+"?gameOrientation="+(void 0===e?1:e)+"&")+"gameId="+GameStatusInfo.gameId+"&")+"adInfo="+JSON.stringify(t);var r={gameOrientation:e,transparent:1,businessType:2,openId:GameStatusInfo.openId,url:i};BK.MQQ.SsoRequest.send(r,"cs.openWebViewWithoutUrl.local")},t.lastBannerReqTs=void 0,t}()}}().Advertisement)}(BK),SandBoxCanvas.prototype.setImagePath=function(t){if(t){this.imagePath=t;var e=new BK.Texture(t);this.__nativeObj.setTexture(e)}},SandBoxCanvas.prototype.getImagePath=function(){return this.imagePath},SandBoxCanvas.prototype.setTexture=function(t){this.__nativeObj.setTexture(t)},SandBoxCanvas.prototype.setFlipXY=function(t,e){this.__nativeObj.setUVFlip(t,e)},SandBoxCanvas.prototype.setUVFlip=function(t,e){this.__nativeObj.setUVFlip(t,e)},SandBoxCanvas.prototype.setUVWrap=function(t,e){this.__nativeObj.setUVWrap(t,e)},SandBoxCanvas.prototype.setXYStretch=function(t,e){this.__nativeObj.setXYStretch(t,e)},SandBoxCanvas.prototype.adjustTexturePosition=function(t,e,i,r,n){this.__nativeObj.adjustTexturePosition(t,e,i,r,n)},SandBoxCanvas.prototype.addChild=function(t){return this.__nativeObj.addChild(t)},SandBoxCanvas.prototype.dispose=function(){return this.__nativeObj.dispose()},SandBoxCanvas.prototype.removeChild=function(t){return this.__nativeObj.removeChild(t)},SandBoxCanvas.prototype.removeChildById=function(t){return this.__nativeObj.removeChildById(t)},SandBoxCanvas.prototype.removeChildByName=function(t){return this.__nativeObj.removeChildByName(t)},SandBoxCanvas.prototype.removeChildByTag=function(t){return this.__nativeObj.removeChildByTag(t)},SandBoxCanvas.prototype.queryChildAtIndex=function(t){return this.__nativeObj.queryChildAtIndex(t)},SandBoxCanvas.prototype.queryChildById=function(t){return this.__nativeObj.queryChildById(t)},SandBoxCanvas.prototype.queryChildByName=function(t){return this.__nativeObj.queryChildByName(t)},SandBoxCanvas.prototype.queryChildByTag=function(t){return this.__nativeObj.queryChildByTag(t)},SandBoxCanvas.prototype.getChildCount=function(){return this.__nativeObj.getChildCount()},SandBoxCanvas.prototype.removeFromParent=function(){return this.__nativeObj.removeFromParent()},SandBoxCanvas.prototype.attachComponent=function(t){return this.__nativeObj.attachComponent(t)},SandBoxCanvas.prototype.detachComponent=function(t){return this.__nativeObj.detachComponent(t)},SandBoxCanvas.prototype.queryComponent=function(t){return this.__nativeObj.queryComponent(t)},SandBoxCanvas.prototype.queryComponentList=function(t){return this.__nativeObj.queryComponentList(t)},SandBoxCanvas.prototype.hittest=function(t){return this.__nativeObj.hittest(t)},SandBoxCanvas.prototype.isEqual=function(t){return this.__nativeObj.isEqual(t)},SandBoxCanvas.prototype.convertToWorldSpace=function(t){return this.__nativeObj.convertToWorldSpace(t)},SandBoxCanvas.prototype.convertToNodeSpace=function(t){return this.__nativeObj.convertToNodeSpace(t)},SandBoxCanvas.prototype.setAtlas=function(t,e){if(this.__nativeObj){BK.CanvasSheetCache.loadSheet(t);var i=BK.CanvasSheetCache.getTexturePathByFilename(e),r=new BK.Texture(i);this.__nativeObj.setTexture(r);var n=BK.CanvasSheetCache.getFrameInfoByFilename(e);this.__nativeObj.adjustTexturePosition(n.frame.x,n.frame.y,n.frame.w,n.frame.h,n.rotated)}return 0},SandBoxCanvas.prototype.useH5Mode=function(){return this.__nativeObj?(this._useH5Mode=1,1==arguments.length?(this._useH5Mode=arguments[0],this.__nativeObj.useH5Mode(arguments[0])):this.__nativeObj.useH5Mode()):0},SandBoxCanvas.prototype.drawCircle=function(){return this.__nativeObj?this.__nativeObj.drawCircle(arguments[0],arguments[1],arguments[2]):0},SandBoxCanvas.prototype.drawEllipse=function(){return this.__nativeObj?this.__nativeObj.drawEllipse(arguments[0],arguments[1],arguments[2],arguments[3]):0},SandBoxCanvas.prototype.drawImage=function(){if(this.__nativeObj){var t=arguments.length;if(9==t)this.__nativeObj.drawImage(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8]);else if(5==t)this.__nativeObj.drawImage(arguments[0],0,0,0,0,arguments[1],arguments[2],arguments[3],arguments[4]);else{if(3!=t)return;this.__nativeObj.drawImage(arguments[0],0,0,0,0,arguments[1],arguments[2],0,0)}this._innerSetTransform()}return 0},SandBoxCanvas.prototype.fill=function(){return this.__nativeObj?this.__nativeObj.fill():0},SandBoxCanvas.prototype.stroke=function(){return this.__nativeObj?this.__nativeObj.stroke():0},SandBoxCanvas.prototype.rect=function(){return this.__nativeObj?this.__nativeObj.rect(arguments[0],arguments[1],arguments[2],arguments[3]):0},SandBoxCanvas.prototype.fillRect=function(){return this.__nativeObj?this.__nativeObj.fillRect(arguments[0],arguments[1],arguments[2],arguments[3]):0},SandBoxCanvas.prototype.strokeRect=function(){return this.__nativeObj?this.__nativeObj.strokeRect(arguments[0],arguments[1],arguments[2],arguments[3]):0},SandBoxCanvas.prototype.clearRect=function(){return this.__nativeObj?this.__nativeObj.clearRect(arguments[0],arguments[1],arguments[2],arguments[3]):0},SandBoxCanvas.prototype.beginPath=function(){return this.__nativeObj?this.__nativeObj.beginPath():0},SandBoxCanvas.prototype.closePath=function(){return this.__nativeObj?this.__nativeObj.closePath():0},SandBoxCanvas.prototype.moveTo=function(){return this.__nativeObj?this.__nativeObj.moveTo(arguments[0],arguments[1]):0},SandBoxCanvas.prototype.lineTo=function(){return this.__nativeObj?this.__nativeObj.lineTo(arguments[0],arguments[1]):0},SandBoxCanvas.prototype.arcTo=function(){return this.__nativeObj?this.__nativeObj.arcTo(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]):0},SandBoxCanvas.prototype.arc=function(){if(this.__nativeObj){var t=arguments.length;if(5==t)return this.__nativeObj.arc(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]);if(6==t)return this.__nativeObj.arc(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])}return 0},SandBoxCanvas.prototype.quadraticCurveTo=function(){return this.__nativeObj?this.__nativeObj.quadraticCurveTo(arguments[0],arguments[1],arguments[2],arguments[3]):0},SandBoxCanvas.prototype.bezierCurveTo=function(){return this.__nativeObj?this.__nativeObj.bezierCurveTo(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]):0},SandBoxCanvas.prototype.save=function(){return this.__nativeObj?this.__nativeObj.save():0},SandBoxCanvas.prototype.restore=function(){return this.__nativeObj?this.__nativeObj.restore():0},SandBoxCanvas.prototype.fillTextWithSize=function(t,e,i,r,n,o,a){if(7==arguments.length){switch(1==n?2-o:o){case 1:e-=.5*r;break;case 2:e-=1*r}switch(a){case 1:t-=.5*i;break;case 2:t-=1*i}var s=new Object;return s.x=t,s.y=e,s.width=Math.min(2048,i),s.height=Math.min(1024,r),s}return 0},SandBoxCanvas.prototype.fillText=function(){if(3==arguments.length){var t=this.measureText(arguments[0],2048,1024),e=arguments[1],i=arguments[2];switch(1==this._useH5Mode?2-this._textBaseLine:this._textBaseLine){case 1:i-=.5*t.height;break;case 2:i-=1*t.height}switch(this._textAlign){case 1:e-=.5*t.width;break;case 2:e-=1*t.width}this.__nativeObj.fillText(arguments[0],e,i,Math.min(2048,t.width),Math.min(1024,t.height)),this._innerSetTransform()}return 0},SandBoxCanvas.prototype.clip=function(){return this.__nativeObj?this.__nativeObj.clip():0},SandBoxCanvas.prototype.isPointInPath=function(){if(this.__nativeObj)return this.__nativeObj.isPointInPath(arguments[0],arguments[1])},SandBoxCanvas.prototype.createImageData=function(){var t=arguments.length;if(this.__nativeObj&&2==t){var e=new BK.Buffer(arguments[0]*arguments[1]*4);return e.__inner_image_width=arguments[0],e.__inner_image_height=arguments[1],e}},SandBoxCanvas.prototype.getImageData=function(){},SandBoxCanvas.prototype.putImageData=function(){var t=arguments.length;if(this.__nativeObj&&3==t){var e=arguments[0],i=arguments[1],r=arguments[2],n=e.__inner_image_width,o=e.__inner_image_height;return this.__nativeObj.putImageData(arguments[0],i,r,n,o)}},SandBoxCanvas.prototype.scale=function(){if(this.__nativeObj)return BK.Script.log(0,0,"bk.canvas. scale :"+arguments[0]+" , "+arguments[1]),this.__nativeObj.scales(arguments[0],arguments[1])},SandBoxCanvas.prototype.scales=function(){if(this.__nativeObj)return BK.Script.log(0,0,"bk.canvas. scales :"+arguments[0]+" , "+arguments[1]),this.__nativeObj.scales(arguments[0],arguments[1])},SandBoxCanvas.prototype.rotate=function(){if(this.__nativeObj)return BK.Script.log(0,0,"bk.canvas. rotate :"+arguments[0]),this.__nativeObj.rotate(arguments[0])},SandBoxCanvas.prototype.translate=function(){if(this.__nativeObj){var t=GameStatusInfo.QQVer.split(".");7==Number(t[0])&&Number(7==t[1]&&Number(t[2])<=5)?(this._tx=arguments[0],this._ty=arguments[1],this._innerSetTransform()):this.__nativeObj.translate(arguments[0],arguments[1])}},SandBoxCanvas.prototype.transform=function(){if(this.__nativeObj)return this.__nativeObj.transforms(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},SandBoxCanvas.prototype.transforms=function(){var t=GameStatusInfo.QQVer.split(".");return Number(t[0])<7||7==Number(t[0])&&Number(t[1])<7?this.__nativeObj.transforms(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]):this.setTransform(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},SandBoxCanvas.prototype.setTransform=function(){if(this.__nativeObj)return this._a=arguments[0],this._b=arguments[1],this._c=arguments[2],this._d=arguments[3],this._tx=arguments[4],this._ty=arguments[5],this.__nativeObj.setTransform(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},SandBoxCanvas.prototype._innerSetTransform=function(){if(this.__nativeObj){var t=GameStatusInfo.QQVer.split(".");if(7==Number(t[0])&&Number(7==t[1]&&Number(t[2])<=5))return this.__nativeObj.setTransform(this._a,this._b,this._c,this._d,this._tx,this._ty)}},SandBoxCanvas.prototype.shadowColor=function(){if(this._shadowColor=arguments[0],this.__nativeObj)return this.__nativeObj.setTextShadow(this._shadowOffset.x,this._shadowOffset.y,this._shadowRadius,this._shadowColor)},SandBoxCanvas.prototype.shadowRadius=function(){if(this._shadowRadius=arguments[0],this.__nativeObj)return this.__nativeObj.setTextShadow(this._shadowOffset.x,this._shadowOffset.y,this._shadowRadius,this._shadowColor)},SandBoxCanvas.prototype.shadowOffsetX=function(){if(this._shadowOffset.x=arguments[0],this.__nativeObj)return this.__nativeObj.setTextShadow(this._shadowOffset.x,this._shadowOffset.y,this._shadowRadius,this._shadowColor)},SandBoxCanvas.prototype.shadowOffsetY=function(){if(this._shadowOffset.y=arguments[0],this.__nativeObj)return this.__nativeObj.setTextShadow(this._shadowOffset.x,this._shadowOffset.y,this._shadowRadius,this._shadowColor)},SandBoxCanvas.prototype.clear=function(){if(this.__nativeObj)return this.__nativeObj.clear()},SandBoxCanvas.prototype.getTexture=function(){return null},SandBoxCanvas.prototype.drawText=function(){return this.__nativeObj&&(this.__nativeObj.drawText(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]),this._innerSetTransform()),null},SandBoxCanvas.prototype.setTextSize=function(){return this.__nativeObj?this.__nativeObj.setTextSize(arguments[0]):null},SandBoxCanvas.prototype.setTextAlign=function(){if(this.__nativeObj){switch(arguments[0]){case 0:case 1:case 2:this._textAlign=arguments[0];break;case"left":this._textAlign=0;break;case"center":this._textAlign=1;break;case"right":this._textAlign=2}return this.__nativeObj.setTextAlign(this._textAlign)}return null},SandBoxCanvas.prototype.setTextBold=function(){return this.__nativeObj?this.__nativeObj.setTextBold(arguments[0]):null},SandBoxCanvas.prototype.setTextItalic=function(){return this.__nativeObj?this.__nativeObj.setTextItalic(arguments[0]):null},SandBoxCanvas.prototype.measureText=function(){return this.__nativeObj?this.__nativeObj.measureText(arguments[0],arguments[1],arguments[2]):null},SandBoxCanvas.prototype.updateCanvasTexture=function(){return this.__nativeObj?this.__nativeObj.updateCanvasTexture():null},SandBoxCanvas.prototype.saveTo=function(){return null},SandBoxCanvas.prototype.drawHead=function(){var t=arguments.length;return this.__nativeObj&&4==t&&this.__nativeObj.drawHead(arguments[0],arguments[1],arguments[2],arguments[3]),null},BK.SandBoxCanvas=SandBoxCanvas,BK.Script.log(0,0,"Load SandBoxCanvas.js succeed."),function(t,e){"object"==typeof t&&(t.QQNickCanvas=function(){return function(){function t(t,e,i,r,n){this.__nativeObj=new BK.SandBoxCanvas(e,i),this.maxHeight=2048,this.maxWidth=1024;var o=0,a=0;1==r.useH5Mode&&this.__nativeObj.useH5Mode(),r.x&&(o=r.x),r.y&&(a=r.y),r.fontSize&&this.__nativeObj.setTextSize(r.fontSize),r.textColor&&(this.__nativeObj.fillColor=r.textColor),r.textAlign&&(this.__nativeObj.textAlign=r.textAlign),r.textBaseLine&&(this.__nativeObj.textBaseLine=r.textBaseLine),r.bold&&this.__nativeObj.setTextBold(r.bold),r.italic&&this.__nativeObj.setTextItalic(r.italic),r.strokeColor&&this.__nativeObj.setStrokeColor(r.strokeColor),r.shadowColor&&this.__nativeObj.shadowColor(r.shadowColor),r.shadowRadius&&this.__nativeObj.shadowRadius(r.shadowColor),r.shadowOffsetX&&this.__nativeObj.shadowOffsetX(r.shadowOffsetX),r.shadowOffsetY&&this.__nativeObj.shadowOffsetY(r.shadowOffsetY),r.fontPath&&(this.__nativeObj.fontPath=r.fontPath),this.callback=n,BK.MQQ.Account.drawNick(this.__nativeObj.__nativeObj,t,o,a,this.maxHeight,this.maxWidth,this.__nativeObj._useH5Mode,this.__nativeObj.textBaseLine,this.__nativeObj.textAlign,this.__nativeObj.fillTextWithSize,function(t,e){this.callback(t,e)}.bind(this))}return t.prototype.getNode=function(){return this.__nativeObj},t}()}())}(BK),function(t,e){"object"==typeof t&&(t.QQAvatarCanvas=function(){return function(){function t(t,e,i,r,n,o){this.openid=t,this.__nativeObj=new BK.SandBoxCanvas(e,i),this.post=o,r.isRound&&(this.__nativeObj.beginPath(),this.__nativeObj.arc(e/2,e/2,e/2,0,2*Math.PI),this.__nativeObj.closePath(),this.__nativeObj.clip()),n&&n(),BK.MQQ.Account.drawHead(this.__nativeObj.__nativeObj,t,e,i,function(t,e,i,r){this.post&&this.post(t,e)}.bind(this))}return t}()}())}(BK),isBrowser){var __browserMsgHdl={};BK.MQQ.SsoRequest.listenerInfos=[],BK.MQQ.SsoRequest.addListener=function(t,e,i){var r={cmd:t,target:e,callback:i};BK.MQQ.SsoRequest.listenerInfos.forEach(function(r){r.cmd==t&&r.target==e&&(r.callback=i)},this),BK.MQQ.SsoRequest.listenerInfos.push(r)},BK.MQQ.SsoRequest.removeListener=function(t,e){for(var i=BK.MQQ.SsoRequest.listenerInfos.length,r=-1,n=0;n<i;n++){var o=BK.MQQ.SsoRequest.listenerInfos[n];o.cmd==t&&o.target==e&&(r=n)}-1!=r&&BK.MQQ.SsoRequest.listenerInfos.splice(r,1)},__browserMsgHdl.listenerInfos=[],__browserMsgHdl.addListener=function(t,e,i){var r={cmd:t,target:e,callback:i},n=!1;__browserMsgHdl.listenerInfos.forEach(function(r){r.cmd==t&&r.target==e&&(r.callback=i,n=!0)},this),0==n&&__browserMsgHdl.listenerInfos.push(r)},__browserMsgHdl.removeListener=function(t,e){for(var i=__browserMsgHdl.listenerInfos.length,r=-1,n=0;n<i;n++){var o=__browserMsgHdl.listenerInfos[n];o.cmd==t&&o.target==e&&(r=n)}-1!=r&&__browserMsgHdl.listenerInfos.splice(r,1)}}!function(t,e){"object"==typeof t&&("object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Game=e())}(1==isBrowser?window:BK,function(){var t;!function(t){t[t.load=0]="load",t[t.min=1]="min",t[t.max=2]="max",t[t.share=3]="share",t[t.enterBackground=4]="enterBackground",t[t.enterForeground=5]="enterForeground"}(t||(t={}));var e;return function(t){t[t.native=0]="native",t[t.browser=1]="browser"}(e||(e={})),function(){function t(t){this.CMSHOW_CS_CMD_CLOSE_WND="cs.close_room.local",this.CMSHOW_CS_CMD_SHARE_INFO="cs.game_shell_share_callback.local",this.CMSHOW_SC_CMD_SHELL_PACK_UP="sc.game_shell_pack_up.local",this.CMSHOW_SC_CMD_SHELL_SHARE="sc.game_shell_share.local",this.CMSHOW_SC_CMD_SHELL_SHARE_COMPLETE="sc.share_game_to_friend_result.local",this.CMSHOW_SC_CMD_SHELL_CLOSE="sc.game_shell_close.local",this.CMD_CMSHOW_GAME_ENTER_BACKGROUND="sc.game_enter_background.local",this.CMD_CMSHOW_GAME_ENTER_FORGROUND="sc.game_enter_foreground.local",this.CMD_CMSHOW_GAME_MAXIMIZE="sc.game_maximize.local",this.CMD_CMSHOW_GAME_MINIMIZE="sc.game_minimize.local",this.CMD_CMSHOW_GAME_INIT_GLOBAL_VAR="sc.init_global_var.local",this.CMD_CMSHOW_GAME_NETWORK_CHANGE="sc.network_change.local",this.CMD_CMSHOW_GAME_WEBMESSAGE_HANDLE="sc.web_callback_game.local",this.cfg=t,this.addAllListener(),this.cfg.onLoad&&(!isBrowser||isBrowser&&"undefined"!=typeof GameStatusInfo)&&(this.formatInfo(),this.cfg.onLoad(this,GameStatusInfo.src,GameStatusInfo.roomId))}return t.prototype.formatInfo=function(){GameStatusInfo.gameId&&(GameStatusInfo.gameId=Number(GameStatusInfo.gameId)),GameStatusInfo.isMaster&&(GameStatusInfo.isMaster=Number(GameStatusInfo.isMaster)),GameStatusInfo.roomId&&(GameStatusInfo.roomId=Number(GameStatusInfo.roomId)),GameStatusInfo.gameVersion&&(GameStatusInfo.gameVersion=String(GameStatusInfo.gameVersion)),GameStatusInfo.platform&&(GameStatusInfo.platform=String(GameStatusInfo.platform)),GameStatusInfo.openId&&(GameStatusInfo.openId=String(GameStatusInfo.openId)),GameStatusInfo.QQVer&&(GameStatusInfo.QQVer=String(GameStatusInfo.QQVer)),GameStatusInfo.networkType&&(GameStatusInfo.networkType=Number(GameStatusInfo.networkType)),GameStatusInfo.src&&(GameStatusInfo.src=Number(GameStatusInfo.src))},t.prototype.log=function(t){BK.Script.log(0,0,"Game:"+t)},t.prototype.errorMessage=function(){return this.err.message},t.prototype.errorStacktrace=function(){return this.err.stacktrace},t.prototype.__isBrowser=function(){return isBrowser},t.prototype.platform=function(){return this.__isBrowser()?e.browser:e.native},t.prototype.addAllListener=function(){this.platform()==e.native?(BK.Script.setErrorObserver(function(t,e){this.cfg.onException&&(this.err={message:t,stacktrace:e},this.cfg.onException(this))}.bind(this)),BK.MQQ.SsoRequest.addListener(this.CMD_CMSHOW_GAME_ENTER_BACKGROUND,this,this._onEnterBackground.bind(this)),BK.MQQ.SsoRequest.addListener(this.CMD_CMSHOW_GAME_ENTER_FORGROUND,this,this._onEnterForeground.bind(this)),BK.MQQ.SsoRequest.addListener(this.CMD_CMSHOW_GAME_MAXIMIZE,this,this._onMax.bind(this)),BK.MQQ.SsoRequest.addListener(this.CMD_CMSHOW_GAME_MINIMIZE,this,this._onMin.bind(this)),BK.MQQ.SsoRequest.addListener(this.CMSHOW_SC_CMD_SHELL_SHARE,this,this._onShare.bind(this)),BK.MQQ.SsoRequest.addListener(this.CMSHOW_SC_CMD_SHELL_SHARE_COMPLETE,this,this._onShareComplete.bind(this)),BK.MQQ.SsoRequest.addListener(this.CMSHOW_SC_CMD_SHELL_CLOSE,this,this._onClose.bind(this)),BK.MQQ.SsoRequest.addListener(this.CMD_CMSHOW_GAME_NETWORK_CHANGE,this,this._onNetworkChange.bind(this))):(__browserMsgHdl.addListener(this.CMD_CMSHOW_GAME_ENTER_BACKGROUND,this,this._onEnterBackground.bind(this)),__browserMsgHdl.addListener(this.CMD_CMSHOW_GAME_ENTER_FORGROUND,this,this._onEnterForeground.bind(this)),__browserMsgHdl.addListener(this.CMD_CMSHOW_GAME_MINIMIZE,this,this._onMin.bind(this)),__browserMsgHdl.addListener(this.CMD_CMSHOW_GAME_MAXIMIZE,this,this._onMax.bind(this)),__browserMsgHdl.addListener(this.CMSHOW_SC_CMD_SHELL_SHARE,this,this._onShare.bind(this)),__browserMsgHdl.addListener(this.CMSHOW_SC_CMD_SHELL_SHARE_COMPLETE,this,this._onShareComplete.bind(this)),__browserMsgHdl.addListener(this.CMSHOW_SC_CMD_SHELL_CLOSE,this,this._onClose.bind(this)),__browserMsgHdl.addListener(this.CMD_CMSHOW_GAME_INIT_GLOBAL_VAR,this,this._onInitGlobalVar.bind(this)),__browserMsgHdl.addListener(this.CMD_CMSHOW_GAME_NETWORK_CHANGE,this,this._onNetworkChange.bind(this)),__browserMsgHdl.addListener(this.CMD_CMSHOW_GAME_WEBMESSAGE_HANDLE,this,this._onWebMessageHandle.bind(this)))},t.prototype.removeAllListener=function(){this.platform()==e.native?(BK.Script.setErrorObserver(void 0),BK.MQQ.SsoRequest.removeListener(this.CMD_CMSHOW_GAME_ENTER_BACKGROUND,this),BK.MQQ.SsoRequest.removeListener(this.CMD_CMSHOW_GAME_ENTER_FORGROUND,this),BK.MQQ.SsoRequest.removeListener(this.CMD_CMSHOW_GAME_MAXIMIZE,this),BK.MQQ.SsoRequest.removeListener(this.CMSHOW_SC_CMD_SHELL_PACK_UP,this),BK.MQQ.SsoRequest.removeListener(this.CMSHOW_SC_CMD_SHELL_SHARE,this),BK.MQQ.SsoRequest.removeListener(this.CMSHOW_SC_CMD_SHELL_CLOSE,this),BK.MQQ.SsoRequest.removeListener(this.CMD_CMSHOW_GAME_NETWORK_CHANGE,this)):(__browserMsgHdl.removeListener(this.CMD_CMSHOW_GAME_ENTER_BACKGROUND,this),__browserMsgHdl.removeListener(this.CMD_CMSHOW_GAME_ENTER_FORGROUND,this),__browserMsgHdl.removeListener(this.CMD_CMSHOW_GAME_MAXIMIZE,this),__browserMsgHdl.removeListener(this.CMSHOW_SC_CMD_SHELL_PACK_UP,this),__browserMsgHdl.removeListener(this.CMSHOW_SC_CMD_SHELL_SHARE,this),__browserMsgHdl.removeListener(this.CMSHOW_SC_CMD_SHELL_CLOSE,this),__browserMsgHdl.removeListener(this.CMD_CMSHOW_GAME_INIT_GLOBAL_VAR,this),__browserMsgHdl.removeListener(this.CMD_CMSHOW_GAME_NETWORK_CHANGE,this),__browserMsgHdl.removeListener(this.CMD_CMSHOW_GAME_WEBMESSAGE_HANDLE,this))},t.prototype._onEnterBackground=function(){this.cfg.onEnterBackground&&this.cfg.onEnterBackground(this)},t.prototype._onEnterForeground=function(){this.cfg.onEnterForeground&&this.cfg.onEnterForeground(this)},t.prototype._onMax=function(){this.cfg.onMaximize&&this.cfg.onMaximize(this)},t.prototype._onMin=function(){this.cfg.onMinimize&&this.cfg.onMinimize(this)},t.prototype._generatedefaultSharePic=function(){var t={width:256,height:256,colorDark:{r:0,g:0,b:0,a:1},colorLight:{r:1,g:1,b:1,a:1},correctLevel:2},e="http://cmshow.qq.com/apollo/html/game-platform/scan-game.html?gameId="+GameStatusInfo.gameId.toString()+"&src=203";return BK.QRCode.createQRCodeToFile("GameSandBox://qrcode.png",e,t),"GameSandBox://qrcode.png"},t.prototype._onShare=function(){var t=void 0;if(this.cfg.onShare&&(t=this.cfg.onShare(this)),t||(t={}),void 0===t.localPicPath){var e=t.gameName,i=t.summary;BK.QQ.defaultSharePic(e,i,function(e,i,r){3==i&&(t.localPicPath=r),this.confirmShare(t)}.bind(this))}else this.confirmShare(t)},t.prototype._onShareComplete=function(t,e,i){if(this.cfg.onShareComplete)if(0==i.reqCode){var r=i.ret,n=0==i.isFirstTimeShare,o=i.shareTo;this.cfg.onShareComplete(this,r,o,n)}else this.cfg.onShareComplete(this,t,-1,!1)},t.prototype._onClose=function(){this.cfg.onClose&&this.cfg.onClose(this)},t.prototype.confirmShare=function(t){var i=t||{};i.reqCode=0,this.platform()==e.native?BK.MQQ.SsoRequest.send(i,this.CMSHOW_CS_CMD_SHARE_INFO):BK.MQQ.SsoRequest.sendTo(i,this.CMSHOW_CS_CMD_SHARE_INFO)},t.prototype._onInitGlobalVar=function(t,e,i){void 0!==i.uin&&delete i.uin,GameStatusInfo=i,this.cfg.onLoad&&(this.formatInfo(),this.cfg.onLoad(this,GameStatusInfo.src,GameStatusInfo.roomId))},t.prototype._onNetworkChange=function(t,e,i){this.cfg.onNetworkChange&&(void 0===i.type?BK.Script.log(1,1,"net work change .data is worng!"):this.cfg.onNetworkChange(this,i.type))},t.prototype._onWebMessageHandle=function(t,e,i){this.cfg.onWebMessageHandle&&(void 0===e||void 0===i?BK.Script.log(1,1,"WebMessageHandle data is worng!"):this.cfg.onWebMessageHandle(this,e,i))},t}()}),registerRedPackageListener(),function(t){function e(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,e),n.l=!0,n.exports}BK.buildInfo={debug:0,buildPath:"/branches/7.8.0_dev",version:"5608",creator:"wesleyxiao",buildTime:"Wed Oct 24 2018 21:53:08 GMT+0800 (GMT+08:00)"};var i={};e.m=t,e.c=i,e.d=function(t,i,r){e.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,i){if(1&i&&(t=e(t)),8&i)return t;if(4&i&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&i&&"string"!=typeof t)for(var n in t)e.d(r,n,function(e){return t[e]}.bind(null,n));return r},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s="./webpack/pack.ts")}({"./src/basics/Storage/StorageEventListener.ts":function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i("./src/common/emitter.ts"),n=function(){function t(){this.storageEmitter=new r}return t.prototype.addEventListener=function(t,e){this.storageEmitter.on(t,e)},t.prototype.removeEventListener=function(t,e){this.storageEmitter.off(t,e)},t.prototype.dispatchEvent=function(t,e){this.storageEmitter.emit(t,e)},t}();e.BKStorageEventLisener=n,t.exports=new n},"./src/basics/device/device.ts":function(t,e,i){"use strict";var r;!function(t){function e(){BK.Script.log(1,1,"keepScreenOn CMD_CMSHOW_GAME_ENTER_FORGROUND "),t.device.isKeepScreenOnInit?t.device.innerSetKeepScreenOn(t.device.userSetDeviceScreenValue):t.device.innerSetKeepScreenOn(!1)}function i(){BK.Script.log(1,1,"keepScreenOn CMD_CMSHOW_GAME_ENTER_BACKGROUND "),t.device.innerSetKeepScreenOn(!1)}function r(){BK.Script.log(1,1,"keepScreenOn CMD_CMSHOW_GAME_MINIMIZE "),t.device.innerSetKeepScreenOn(!1)}function n(){BK.Script.log(1,1,"keepScreenOn CMD_CMSHOW_GAME_MAXIMIZE "),t.device.isKeepScreenOnInit?t.device.innerSetKeepScreenOn(t.device.userSetDeviceScreenValue):t.device.innerSetKeepScreenOn(!1)}function o(){BK.Script.log(1,1,"keepScreenOn CMSHOW_SC_CMD_STOP_GAME "),t.device.innerSetKeepScreenOn(!1)}var a=function(){function e(){this.isKeepScreenOnInit=!1,BK.Director.isKeepScreenOn=!1}return e.prototype.innerSetKeepScreenOn=function(e){t.device.isKeepScreenOnInit?(BK.QQ.uploadData("call_screen_on",GameStatusInfo.src.toString(),e?"1":"0","","",""),BK.Director.isKeepScreenOn=e):BK.Script.log(1,1,"user unset keepScreenOn,ignore the value")},e.prototype.keepScreenOn=function(e){if(!e)throw Error("param can not be undefined!");t.device.userSetDeviceScreenValue=e.isKeepOn,t.device.isKeepScreenOnInit=!0,t.device.innerSetKeepScreenOn(e.isKeepOn)},e}();t.device=new a,BK.onEnterBackground(i),BK.onEnterForeground(e),BK.onMaximize(n),BK.onMinimize(r),BK.SsoRequest.on("sc.force_stop_game.local",function(t){o()})}(r||(r={})),BK.Device.keepScreenOn=r.device.keepScreenOn,t.exports=BK.Device},"./src/basics/lifecycle/lifecycle.ts":function(t,e,i){"use strict";var r;!function(t){function e(t){var e=t.cmd,i=t.data;switch(e){case E:A.emit(I.foreground);break;case y:A.emit(I.background);break;case x:A.emit(I.maximize);break;case C:A.emit(I.minimize);break;case T:A.emit(I.close);break;case b:A.emit(I.share);break;case B:if(0==i.reqCode){r={retCode:i.ret,isFirstShare:0==i.isFirstTimeShare,shareDest:i.shareTo};A.emit(I.shareComplete,r)}break;case R:if(void 0===i.type)BK.Script.log(1,1,"net work change .data is worng!");else{var r={state:i.type};A.emit(I.networkChange,r)}}}function r(t){if(void 0===t)throw new Error("callback can't be undefined!")}function n(t){r(t),A.on(I.background,t)}function o(t){r(t),A.off(I.background,t)}function a(t){r(t),A.on(I.foreground,t)}function s(t){r(t),A.off(I.foreground,t)}function h(t){r(t),A.on(I.close,t)}function c(t){r(t),A.off(I.close,t)}function l(t){r(t),A.on(I.share,t)}function u(t){r(t),A.off(I.share,t)}function d(t){r(t),A.on(I.shareComplete,t)}function _(t){r(t),A.off(I.shareComplete,t)}function f(t){r(t),A.on(I.networkChange,t)}function g(t){r(t),A.off(I.networkChange,t)}function p(t){r(t),A.on(I.maximize,t)}function m(t){r(t),A.off(I.maximize,t)}function v(t){r(t),A.on(I.minimize,t)}function S(t){r(t),A.off(I.minimize,t)}var b="sc.game_shell_share.local",B="sc.share_game_to_friend_result.local",T="sc.game_shell_close.local",y="sc.game_enter_background.local",E="sc.game_enter_foreground.local",x="sc.game_maximize.local",C="sc.game_minimize.local",R="sc.network_change.local";!function(t){t[t.NoneToMobileNetwork=1]="NoneToMobileNetwork",t[t.NoneToWifi=2]="NoneToWifi",t[t.MobileNetworkToWifi=3]="MobileNetworkToWifi",t[t.MobileNetworkToNone=4]="MobileNetworkToNone",t[t.WifiToNone=5]="WifiToNone",t[t.WifiToMobileNetwork=6]="WifiToMobileNetwork"}(t.NetworkState||(t.NetworkState={}));var A=new(i("./src/common/emitter.ts")),I={foreground:"foreground",background:"background",maximize:"maximize",minimize:"minimize",share:"share",shareComplete:"shareComplete",networkChange:"networkChange",close:"close"};BK.SsoRequest.on(E,e),BK.SsoRequest.on(y,e),BK.SsoRequest.on(x,e),BK.SsoRequest.on(C,e),BK.SsoRequest.on(T,e),BK.SsoRequest.on(b,e),BK.SsoRequest.on(B,e),BK.SsoRequest.on(R,e),t.onEnterBackground=n,t.offEnterBackground=o,t.onEnterForeground=a,t.offEnterForeground=s,t.onGameClose=h,t.offGameClose=c,t.onGameShare=l,t.offGameShare=u,t.onGameShareComplete=d,t.offGameShareComplete=_,t.onNetworkChange=f,t.offNetworkChange=g,t.onMaximize=p,t.offMaximize=m,t.onMinimize=v,t.offMinimize=S}(r||(r={})),BK.NetworkState=r.NetworkState,t.exports=r},"./src/basics/storage/Storage.ts":function(t,e,i){"use strict";function r(t,e){if(e){if("length"===(e=e.toString()))return t[e];if("_kv"===e||"_storageType"===e)return t.getItem(e);for(var i=["setItem","getItem","removeItem","key","clear"],r=0;r<i.length;r++)if(e===i[r])return t[e].bind(t);return t.getItem(e)}}function n(t,e,i){if(e&&i)if(e=e.toString(),i=i.toString(),"length"!==e)if("_kv"!==e&&"_storageType"!==e){for(var r=["setItem","getItem","removeItem","key","clear"],n=0;n<r.length;n++)if(e===r[n])return t[e].bind(t);t.setItem(e,i)}else t.setItem(e,i);else BK.Script.log(1,0,"property "+e+" readOnly")}function o(t){if("android"===GameStatusInfo.platform)return BK.Script.log(1,0,"Proxy create "),new Proxy(new s(t),h);var e=GameStatusInfo.osVersion.split(".");return e.length>0&&Number(e[0])>9?(BK.Script.log(1,0,"Proxy create "),new Proxy(new s(t),h)):BK.Proxy?(BK.Script.log(1,0,"BK.Proxy create "),new BK.Proxy(new s(t),n,r)):{}}Object.defineProperty(e,"__esModule",{value:!0});var a=i("./src/basics/storage/StorageEvent.ts"),s=function(){function t(t){if(this._storageType=t,this._kv={},this._bytes=2,this._url="default",this.length=0,0===this._storageType&&BK.getStorageData){var e=BK.getStorageData(GameStatusInfo.gameId);if(!e)return;try{this._bytes=e.length,this._kv=JSON.parse(e),this.length=Object.keys(this._kv).length}catch(t){throw BK.Script.log(1,1,"parse string failed, storage load failed!"),this.flush(),Error("Storage setItem failed, item bytes is too large")}}}return t.prototype.key=function(t){return t>=this.length?null:Object.keys(this._kv)[t]},t.prototype.getItem=function(t){return this._kv[t]},t.prototype.setItem=function(t,e){var i=e.length,r=0,n=0;if(this._kv[t]&&(r=JSON.stringify(this._kv[t]).length),!((n=i-r)<0||n+this._bytes<4194304))throw BK.Script.log(1,1,"Storage setItem failed, item bytes is too large!"),Error("Storage setItem failed, item bytes is too large");var o=this._kv[t];this._kv[t]=e,this.length=Object.keys(this._kv).length,this.flush(),BK.storageEventListener.dispatchEvent("storage",new a(t,o,e,this._url,this))},t.prototype.removeItem=function(t){delete this._kv[t],this.length=Object.keys(this._kv).length,this.flush()},t.prototype.clear=function(){this._kv={},this.length=Object.keys(this._kv).length,this.flush()},t.prototype.flush=function(){var t=JSON.stringify(this._kv);this._bytes=t.length,0===this._storageType&&BK.setStorageData&&BK.setStorageData(t,GameStatusInfo.gameId)},t.prototype.bindUrl=function(t){t!==this._url&&""!==t&&(this._url=t)},t}();e.BKStorage=s,e.getProperty=r,e.setProperty=n;var h={get:r,set:n,deleteProperty:function(t,e){BK.Script.log(1,1,"localStorage delete property : "+e)}};t.exports={localStorage:o(0),sessionStorage:o(1)}},"./src/basics/storage/StorageEvent.ts":function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e,i,r,n){this.key=t,this.oldValue=e,this.newValue=i,this.url=r,this.storageArea=n}return t}();e.BKStorageEvent=r,t.exports=r},"./src/basics/subpackage/subpackage.ts":function(t,e,i){"use strict";var r,n=this&&this.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();!function(t){function e(t){var e=new o(t.name);if(!GameStatusInfo||"xcode"===GameStatusInfo.devPlatform){n={name:t.name,code:-1,msg:"develop environment no support!"};return t.complete&&t.complete(),t.fail&&t.fail(n),BK.Script.log(1,1,"bk.qq.loadpackage xcode demo."),e}var i=GameStatusInfo.QQVer.split(".");if(Number(i[0])<7||7==Number(i[0])&&Number(i[1])<7||7==Number(i[0])&&7==Number(i[1])&&Number(i[2])<5){BK.Script.log(1,0,"775 以下手q 版本");n={name:t.name,code:-2,msg:"current qq no support subpackage feature!Upgrade to QQ 7.7.5"};return t.complete&&t.complete(),t.fail&&t.fail(n),e}if(!r.subPackageDataReadConfig()){var n={name:t.name,code:-3,msg:"gameConfig.json can not find configure!"};return t.complete&&t.complete(),t.fail&&t.fail(n),e}return t.complete&&t.complete(),r.downloadPackage(t.name),r.on("download_finish_"+t.name,function(e){r.checkPackage({packageName:t.name,success:function(){if(r.loadPackage(t.name),t.success)try{t.success({name:t.name})}catch(t){BK.Console.log("ERROR:"+t)}},fail:function(){var e={name:t.name,code:-4,msg:"load subpackge failed.correctness failed"};if(t.fail)try{t.fail(e)}catch(t){BK.Console.log("ERROR:"+t)}}})}),e}var r=new(function(t){function e(){var e=t.call(this)||this;return BK.SsoRequest.on("sc.load_percentage_nofity.local",e.onLoadPackagePercentage.bind(e)),e._subPackagesInfo=void 0,e}return n(e,t),e.prototype.setSubPackageInfo=function(t){this._subPackagesInfo=t},e.prototype.getEntryMainPath=function(t){this._subPackagesInfo||(this._subPackagesInfo=this.subPackageDataReadConfig());for(var e=0;e<this._subPackagesInfo.length;e++){var i=this._subPackagesInfo[e];if(i.name===t)return"GameRes://"+i.root+"/main.js"}},e.prototype.subPackageDataReadConfig=function(){if(this._subPackagesInfo)return this._subPackagesInfo;var t=BK.FileUtil.readFile("GameRes://gameConfig.json");if(t){var e=JSON.parse(t.readAsString(!0));return e&&e.subpackages?(this._subPackagesInfo=e.subpackages,e.subpackages):void 0}},e.prototype.checkPackage=function(t){var e={xyId:GameStatusInfo.gameId,packName:t.packageName};BK.SsoRequest.request({data:e,reqCmd:"cs.file_correctness_check.local",success:function(e){e.code,e.cmd;var i=e.data;t.success&&t.success(i)},fail:function(e){var i=e.code;e.cmd,e.data;if(t.fail){var r={name:t.packageName,code:i,msg:"failed"};t.fail(r)}},complete:function(){t.complete&&t.complete()}})},e.prototype.downloadPackage=function(t){var e={xyId:GameStatusInfo.gameId,packName:t};BK.SsoRequest.request({data:e,reqCmd:"cs.load_subpackage.local",success:function(t){if(t.data.packName){var e="download_finish_"+t.data.packName;this.emit(e,t.data.result)}}.bind(this),fail:function(e){if(e.data.packName){i="download_finish_"+e.data.packName;this.emit(i,e.code)}else{var i=t;this.emit(i,e.code)}},complete:function(){}})},e.prototype._innserLoadLibFunc=function(t){return t.Script.loadlib},e.prototype.loadPackage=function(t){var e=this.getEntryMainPath(t);return!!e&&(!!BK.fileSystem.accessSync(e)&&(this._innserLoadLibFunc(BK)(e),!0))},e.prototype.onLoadPackagePercentage=function(t){if(t.data.packName){var e="percentage_"+t.data.packName;this.emit(e,t.data.percentage)}},e.prototype.onLoadPackageFinish=function(t,e,i){if(i.packName){var r="download_finish_"+i.packName;this.emit(r,i.result)}},e}(i("./src/common/emitter.ts"))),o=function(){function t(t){this.packName=t}return t.prototype.onProgressUpdate=function(t){r.on("percentage_"+this.packName,t)},t}();t.loadSubpackage=e}(r||(r={})),t.exports=r.loadSubpackage},"./src/basics/system/system.ts":function(t,e,i){"use strict";function r(){return GameStatusInfo}t.exports={getSystemInfoSync:r}},"./src/common/crypt.ts":function(t,e,i){"use strict";var r=function(){function t(){this.hexcase=0,this.b64pad="",this.chrsz=8,this.cryptQueue=Array(),this.safe_add=function(t,e){var i=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(i>>16)<<16|65535&i},this.rol=function(t,e){return t<<e|t>>>32-e};var t=this;"undefined"!=typeof BK&&BK.Director.ticker.add(function(e,i){if(t.cryptQueue.length>0){var r=t.cryptQueue[0];t.cryptQueue.splice(0,1);var n=void 0;try{n=r.doCrypt.call(t,r.param)}catch(t){if(!r.param.fail)throw t;r.param.fail({msg:t.message})}n&&r.param.success&&r.param.success({data:n}),r.param.complete&&r.param.complete()}}.bind(t))}return t.prototype.checkParam=function(t){if(!t)throw new Error("param can not be undefined");if("object"!=typeof t)throw new Error("param must be a object,can not be "+typeof t)},t.prototype.checkType=function(t,e){if(!("number"==typeof t||"string"==typeof t||t instanceof Array))throw Error(e+" must be string or binary array!")},t.md5ToHex=function(e){t.crypt.checkParam(e),t.crypt.checkType(e.data,"data"),t.crypt.cryptQueue.push({param:e,doCrypt:t.md5ToHexSync})},t.md5ToHexSync=function(e){t.crypt.checkParam(e);var i=e.data;return t.crypt.checkType(i,"data"),t.crypt.bin2hexLittle(t.crypt.core_md5(t.crypt.str2binLittle(i),i.length*t.crypt.chrsz))},t.md5ToBase64=function(e){t.crypt.checkParam(e),t.crypt.checkType(e.data,"data"),t.crypt.cryptQueue.push({param:e,doCrypt:t.md5ToBase64Sync})},t.md5ToBase64Sync=function(e){t.crypt.checkParam(e);var i=e.data;return t.crypt.checkType(i,"data"),t.crypt.bin2b64Little(t.crypt.core_md5(t.crypt.str2binLittle(i),i.length*t.crypt.chrsz))},t.hmacMd5ToHex=function(e){t.crypt.checkParam(e),t.crypt.checkType(e.data,"data"),t.crypt.checkType(e.key,"key"),t.crypt.cryptQueue.push({param:e,doCrypt:t.hmacMd5ToHexSync})},t.hmacMd5ToHexSync=function(e){t.crypt.checkParam(e);var i=e.key,r=e.data;return t.crypt.checkType(r,"data"),t.crypt.checkType(i,"key"),t.crypt.bin2hexLittle(t.crypt.core_hmac_md5(i,r))},t.hmacMd5ToBase64=function(e){t.crypt.checkParam(e),t.crypt.checkType(e.data,"data"),t.crypt.checkType(e.key,"key"),t.crypt.cryptQueue.push({param:e,doCrypt:t.hmacMd5ToBase64Sync})},t.hmacMd5ToBase64Sync=function(e){t.crypt.checkParam(e);var i=e.key,r=e.data;return t.crypt.checkType(r,"data"),t.crypt.checkType(i,"key"),t.crypt.bin2b64Little(t.crypt.core_hmac_md5(i,r))},t.prototype.core_md5=function(t,e){t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;for(var i=1732584193,r=-271733879,n=-1732584194,o=271733878,a=0;a<t.length;a+=16){var s=i,h=r,c=n,l=o;i=this.md5_ff(i,r,n,o,t[a+0],7,-680876936),o=this.md5_ff(o,i,r,n,t[a+1],12,-389564586),n=this.md5_ff(n,o,i,r,t[a+2],17,606105819),r=this.md5_ff(r,n,o,i,t[a+3],22,-1044525330),i=this.md5_ff(i,r,n,o,t[a+4],7,-176418897),o=this.md5_ff(o,i,r,n,t[a+5],12,1200080426),n=this.md5_ff(n,o,i,r,t[a+6],17,-1473231341),r=this.md5_ff(r,n,o,i,t[a+7],22,-45705983),i=this.md5_ff(i,r,n,o,t[a+8],7,1770035416),o=this.md5_ff(o,i,r,n,t[a+9],12,-1958414417),n=this.md5_ff(n,o,i,r,t[a+10],17,-42063),r=this.md5_ff(r,n,o,i,t[a+11],22,-1990404162),i=this.md5_ff(i,r,n,o,t[a+12],7,1804603682),o=this.md5_ff(o,i,r,n,t[a+13],12,-40341101),n=this.md5_ff(n,o,i,r,t[a+14],17,-1502002290),r=this.md5_ff(r,n,o,i,t[a+15],22,1236535329),i=this.md5_gg(i,r,n,o,t[a+1],5,-165796510),o=this.md5_gg(o,i,r,n,t[a+6],9,-1069501632),n=this.md5_gg(n,o,i,r,t[a+11],14,643717713),r=this.md5_gg(r,n,o,i,t[a+0],20,-373897302),i=this.md5_gg(i,r,n,o,t[a+5],5,-701558691),o=this.md5_gg(o,i,r,n,t[a+10],9,38016083),n=this.md5_gg(n,o,i,r,t[a+15],14,-660478335),r=this.md5_gg(r,n,o,i,t[a+4],20,-405537848),i=this.md5_gg(i,r,n,o,t[a+9],5,568446438),o=this.md5_gg(o,i,r,n,t[a+14],9,-1019803690),n=this.md5_gg(n,o,i,r,t[a+3],14,-187363961),r=this.md5_gg(r,n,o,i,t[a+8],20,1163531501),i=this.md5_gg(i,r,n,o,t[a+13],5,-1444681467),o=this.md5_gg(o,i,r,n,t[a+2],9,-51403784),n=this.md5_gg(n,o,i,r,t[a+7],14,1735328473),r=this.md5_gg(r,n,o,i,t[a+12],20,-1926607734),i=this.md5_hh(i,r,n,o,t[a+5],4,-378558),o=this.md5_hh(o,i,r,n,t[a+8],11,-2022574463),n=this.md5_hh(n,o,i,r,t[a+11],16,1839030562),r=this.md5_hh(r,n,o,i,t[a+14],23,-35309556),i=this.md5_hh(i,r,n,o,t[a+1],4,-1530992060),o=this.md5_hh(o,i,r,n,t[a+4],11,1272893353),n=this.md5_hh(n,o,i,r,t[a+7],16,-155497632),r=this.md5_hh(r,n,o,i,t[a+10],23,-1094730640),i=this.md5_hh(i,r,n,o,t[a+13],4,681279174),o=this.md5_hh(o,i,r,n,t[a+0],11,-358537222),n=this.md5_hh(n,o,i,r,t[a+3],16,-722521979),r=this.md5_hh(r,n,o,i,t[a+6],23,76029189),i=this.md5_hh(i,r,n,o,t[a+9],4,-640364487),o=this.md5_hh(o,i,r,n,t[a+12],11,-421815835),n=this.md5_hh(n,o,i,r,t[a+15],16,530742520),r=this.md5_hh(r,n,o,i,t[a+2],23,-995338651),i=this.md5_ii(i,r,n,o,t[a+0],6,-198630844),o=this.md5_ii(o,i,r,n,t[a+7],10,1126891415),n=this.md5_ii(n,o,i,r,t[a+14],15,-1416354905),r=this.md5_ii(r,n,o,i,t[a+5],21,-57434055),i=this.md5_ii(i,r,n,o,t[a+12],6,1700485571),o=this.md5_ii(o,i,r,n,t[a+3],10,-1894986606),n=this.md5_ii(n,o,i,r,t[a+10],15,-1051523),r=this.md5_ii(r,n,o,i,t[a+1],21,-2054922799),i=this.md5_ii(i,r,n,o,t[a+8],6,1873313359),o=this.md5_ii(o,i,r,n,t[a+15],10,-30611744),n=this.md5_ii(n,o,i,r,t[a+6],15,-1560198380),r=this.md5_ii(r,n,o,i,t[a+13],21,1309151649),i=this.md5_ii(i,r,n,o,t[a+4],6,-145523070),o=this.md5_ii(o,i,r,n,t[a+11],10,-1120210379),n=this.md5_ii(n,o,i,r,t[a+2],15,718787259),r=this.md5_ii(r,n,o,i,t[a+9],21,-343485551),i=this.safe_add(i,s),r=this.safe_add(r,h),n=this.safe_add(n,c),o=this.safe_add(o,l)}return Array(i,r,n,o)},t.prototype.md5_cmn=function(t,e,i,r,n,o){return this.safe_add(this.rol(this.safe_add(this.safe_add(e,t),this.safe_add(r,o)),n),i)},t.prototype.md5_ff=function(t,e,i,r,n,o,a){return this.md5_cmn(e&i|~e&r,t,e,n,o,a)},t.prototype.md5_gg=function(t,e,i,r,n,o,a){return this.md5_cmn(e&r|i&~r,t,e,n,o,a)},t.prototype.md5_hh=function(t,e,i,r,n,o,a){return this.md5_cmn(e^i^r,t,e,n,o,a)},t.prototype.md5_ii=function(t,e,i,r,n,o,a){return this.md5_cmn(i^(e|~r),t,e,n,o,a)},t.prototype.core_hmac_md5=function(t,e){var i=this.str2binLittle(t);i.length>16&&(i=this.core_md5(i,t.length*this.chrsz));for(var r=Array(16),n=Array(16),o=0;o<16;o++)r[o]=909522486^i[o],n[o]=1549556828^i[o];var a=this.core_md5(r.concat(this.str2binLittle(e)),512+e.length*this.chrsz);return this.core_md5(n.concat(a),640)},t.sha1ToHex=function(e){t.crypt.checkParam(e),t.crypt.checkType(e.data,"data"),t.crypt.cryptQueue.push({param:e,doCrypt:t.sha1ToHexSync})},t.sha1ToHexSync=function(e){t.crypt.checkParam(e);var i=e.data;return t.crypt.checkType(i,"data"),t.crypt.bin2hex(t.crypt.core_sha1(t.crypt.str2bin(i),i.length*t.crypt.chrsz))},t.sha1ToBase64=function(e){t.crypt.checkParam(e),t.crypt.checkType(e.data,"data"),t.crypt.cryptQueue.push({param:e,doCrypt:t.sha1ToBase64Sync})},t.sha1ToBase64Sync=function(e){t.crypt.checkParam(e);var i=e.data;return t.crypt.checkType(i,"data"),t.crypt.bin2b64(t.crypt.core_sha1(t.crypt.str2bin(i),i.length*t.crypt.chrsz))},t.hmacSha1ToHex=function(e){t.crypt.checkParam(e),t.crypt.checkType(e.data,"data"),t.crypt.checkType(e.key,"key"),t.crypt.cryptQueue.push({param:e,doCrypt:t.hmacSha1ToHexSync})},t.hmacSha1ToHexSync=function(e){t.crypt.checkParam(e);var i=e.key,r=e.data;return t.crypt.checkType(r,"data"),t.crypt.checkType(i,"key"),t.crypt.bin2hex(t.crypt.core_hmac_sha1(i,r))},t.hmacSha1ToBase64=function(e){t.crypt.checkParam(e),t.crypt.checkType(e.data,"data"),t.crypt.checkType(e.key,"key"),t.crypt.cryptQueue.push({param:e,doCrypt:t.hmacSha1ToBase64Sync})},t.hmacSha1ToBase64Sync=function(e){t.crypt.checkParam(e);var i=e.key,r=e.data;return t.crypt.checkType(r,"data"),t.crypt.checkType(i,"key"),t.crypt.bin2b64(t.crypt.core_hmac_sha1(i,r))},t.prototype.core_sha1=function(t,e){t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e;for(var i=Array(80),r=1732584193,n=-271733879,o=-1732584194,a=271733878,s=-1009589776,h=0;h<t.length;h+=16){for(var c=r,l=n,u=o,d=a,_=s,f=0;f<80;f++){i[f]=f<16?t[h+f]:this.rol(i[f-3]^i[f-8]^i[f-14]^i[f-16],1);var g=this.safe_add(this.safe_add(this.rol(r,5),this.sha1_ft(f,n,o,a)),this.safe_add(this.safe_add(s,i[f]),this.sha1_kt(f)));s=a,a=o,o=this.rol(n,30),n=r,r=g}r=this.safe_add(r,c),n=this.safe_add(n,l),o=this.safe_add(o,u),a=this.safe_add(a,d),s=this.safe_add(s,_)}return Array(r,n,o,a,s)},t.prototype.sha1_ft=function(t,e,i,r){return t<20?e&i|~e&r:t<40?e^i^r:t<60?e&i|e&r|i&r:e^i^r},t.prototype.sha1_kt=function(t){return t<20?1518500249:t<40?1859775393:t<60?-1894007588:-899497514},t.prototype.core_hmac_sha1=function(t,e){var i=this.str2bin(t);i.length>16&&(i=this.core_sha1(i,t.length*this.chrsz));for(var r=Array(16),n=Array(16),o=0;o<16;o++)r[o]=909522486^i[o],n[o]=1549556828^i[o];var a=this.core_sha1(r.concat(this.str2bin(e)),512+e.length*this.chrsz);return this.core_sha1(n.concat(a),672)},t.prototype.str2bin=function(t){var e=Array(),i=(1<<this.chrsz)-1;if("number"==typeof t&&(t=t.toString()),"string"==typeof t){for(var r=0;r<t.length*this.chrsz;r+=this.chrsz)e[r>>5]|=(t.charCodeAt(r/this.chrsz)&i)<<24-r%32;return e}for(var n=0;n<t.length*this.chrsz;n+=this.chrsz)e[n>>5]|=(t[n/this.chrsz]&i)<<24-n%32;return e},t.prototype.bin2str=function(t){for(var e="",i=(1<<this.chrsz)-1,r=0;r<32*t.length;r+=this.chrsz)e+=String.fromCharCode(t[r>>5]>>>24-r%32&i);return e},t.prototype.bin2hex=function(t){for(var e=this.hexcase?"0123456789ABCDEF":"0123456789abcdef",i="",r=0;r<4*t.length;r++)i+=e.charAt(t[r>>2]>>8*(3-r%4)+4&15)+e.charAt(t[r>>2]>>8*(3-r%4)&15);return i},t.prototype.bin2b64=function(t){for(var e="",i=0;i<4*t.length;i+=3)for(var r=(t[i>>2]>>8*(3-i%4)&255)<<16|(t[i+1>>2]>>8*(3-(i+1)%4)&255)<<8|t[i+2>>2]>>8*(3-(i+2)%4)&255,n=0;n<4;n++)8*i+6*n>32*t.length?e+=this.b64pad:e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>6*(3-n)&63);return e},t.prototype.bin2b64Little=function(t){for(var e=this.bin2strLittle(t),i="",r=e.length,n=0;n<r;n+=3)for(var o=e.charCodeAt(n)<<16|(n+1<r?e.charCodeAt(n+1)<<8:0)|(n+2<r?e.charCodeAt(n+2):0),a=0;a<4;a++)8*n+6*a>8*e.length?i+=this.b64pad:i+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-a)&63);return i},t.prototype.str2binLittle=function(t){"number"==typeof t&&(t=t.toString());var e=Array();if("string"==typeof t){for(i=0;i<8*t.length;i+=8)e[i>>5]|=(255&t.charCodeAt(i/8))<<i%32;return e}for(var i=0;i<8*t.length;i+=8)e[i>>5]|=(255&t[i/8])<<i%32;return e},t.prototype.bin2strLittle=function(t){for(var e="",i=0;i<32*t.length;i+=8)e+=String.fromCharCode(t[i>>5]>>>i%32&255);return e},t.prototype.bin2hexLittle=function(t){for(var e,i=this.hexcase?"0123456789ABCDEF":"0123456789abcdef",r=this.bin2strLittle(t),n="",o=0;o<r.length;o++)e=r.charCodeAt(o),n+=i.charAt(e>>>4&15)+i.charAt(15&e);return n},t.crypt=new t,t}();BK.Crypt.md5ToHex=function(t){r.md5ToHex(t)},BK.Crypt.md5ToBase64=function(t){r.md5ToBase64(t)},BK.Crypt.hmacMd5ToHex=function(t){r.hmacMd5ToHex(t)},BK.Crypt.hmacMd5ToBase64=function(t){r.hmacMd5ToBase64(t)},BK.Crypt.sha1ToHex=function(t){r.sha1ToHex(t)},BK.Crypt.sha1ToBase64=function(t){r.sha1ToBase64(t)},BK.Crypt.hmacSha1ToHex=function(t){r.hmacSha1ToHex(t)},BK.Crypt.hmacSha1ToBase64=function(t){r.hmacSha1ToBase64(t)},BK.Crypt.md5ToHexSync=function(t){return r.md5ToHexSync(t)},BK.Crypt.md5ToBase64Sync=function(t){return r.md5ToBase64Sync(t)},BK.Crypt.hmacMd5ToHexSync=function(t){return r.hmacMd5ToHexSync(t)},BK.Crypt.hmacMd5ToBase64Sync=function(t){return r.hmacMd5ToBase64Sync(t)},BK.Crypt.sha1ToHexSync=function(t){return r.sha1ToHexSync(t)},BK.Crypt.sha1ToBase64Sync=function(t){return r.sha1ToBase64Sync(t)},BK.Crypt.hmacSha1ToHexSync=function(t){return r.hmacSha1ToHexSync(t)},BK.Crypt.hmacSha1ToBase64Sync=function(t){return r.hmacSha1ToBase64Sync(t)},t.exports=BK.Crypt},"./src/common/emitter.ts":function(t,e,i){"use strict";var r=function(){function t(t,e,i){this.event=t,this.listener=e,this.once=i}return t}(),n=function(){function t(){this._emits={}}return t.prototype.__emit_get=function(t){return this._emits[t]||(this._emits[t]=new Array),this._emits[t]},t.prototype.__emit_exists=function(t){var e=this.__emit_get(t);return!!(e&&e.length>0)},t.prototype.__emit_put=function(t,e,i){var n=new r(t,e,i);return this.__emit_get(t).push(n),this},t.prototype.__emit_remove=function(t,e){if(1==this.__emit_exists(t)){for(var i=-1,r=this.__emit_get(t),n=r.length-1;n>=0;n--)if(e==r[n].listener){i=n;break}return i>-1&&r.splice(i,1),!0}return!1},t.prototype.on=function(t,e){return this.__emit_put(t,e,!1),this},t.prototype.once=function(t,e){return this.__emit_put(t,e,!0),this},t.prototype.off=function(t,e){return this.__emit_remove(t,e),this},t.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(this.__emit_exists(t)){for(var r=[],n=this.__emit_get(t),o=n.length,a=0;a<o;a++){var s=n[a];s.listener.apply(s,e),s.once&&r.push(s)}for(a=0;a<r.length;a++){var h=r[a];this.__emit_remove(t,h.listener)}return!0}return!1},t}();t.exports=n},"./src/common/qrcode.ts":function(t,e,i){"use strict";function r(t,e){for(var i=1,r=n(t),a=0,h=o.length;a<h;a++){var c=0;switch(e){case s.L:c=o[a][0];break;case s.M:c=o[a][1];break;case s.Q:c=o[a][2];break;case s.H:c=o[a][3]}if(r<=c)break;i++}if(i>o.length)throw new Error("Too long data");return i}function n(t){var e=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!=t?3:0)}var o=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],a=i("./src/common/qrcodeModel.ts").QRCodeModel,s=i("./src/common/qrcodeModel.ts").QRErrorCorrectLevel,h=function(){function t(){BK.Director.ticker.add(function(e,i){if(0!==t.taskQueue.length){var r=t.taskQueue[0];t.taskQueue.splice(0,1);var n=!1;try{t.makeQRCodeToFileSync(r)}catch(t){if(n=!0,!r.fail)throw t;r.fail({msg:t.message})}n||r.success&&r.success({path:r.path}),r.complete&&r.complete()}})}return t.createQRModel=function(t,e){var i,n=new a(r(t,(i=void 0===e?{width:256,height:256,colorDark:{r:0,g:0,b:0,a:1},colorLight:{r:1,g:1,b:1,a:1},correctLevel:2}:e).correctLevel),i.correctLevel);return n.addData(t),n.make(),n},t.createQRCodeNode=function(e,i){var r;r=void 0===i?{width:256,height:256,colorDark:{r:0,g:0,b:0,a:1},colorLight:{r:1,g:1,b:1,a:1},correctLevel:s.H}:i;for(var n=new BK.Canvas(r.width,r.height),o=t.createQRModel(e,i),a=o.getModuleCount(),h=r.width/a,c=r.height/a,l=Math.round(h),u=Math.round(c),d=0;d<a;d++)for(var _=0;_<a;_++){var f=o.isDark(d,_),g=_*h,p=d*c;n.lineWidth=1,n.fillColor=f?r.colorDark:r.colorLight,n.drawStyle=0,n.fillRect(g,p,h,c),n.strokeColor=f?r.colorDark:r.colorLight,n.strokeRect(Math.ceil(g)-.5,Math.ceil(p)-.5,l,u),n.strokeRect(Math.ceil(g)+.5,Math.ceil(p)+.5,l,u)}return n},t.createQRCodeToFile=function(e,i,r){if(!e)throw new Error("path can not be undefined!");if(!i)throw new Error("content can not be undefined!");r||(r={});var n=r.width,o=void 0===n?256:n,a=r.height,h=void 0===a?256:a,c=r.colorDark,l=void 0===c?{r:0,g:0,b:0,a:1}:c,u=r.colorLight,d=void 0===u?{r:1,g:1,b:1,a:1}:u,_=r.correctLevel,f=void 0===_?s.H:_,g=t.createQRCodeNode(i,{width:o,height:h,colorDark:l,colorLight:d,correctLevel:f});g.saveTo(e),g.dispose()},t.makeQRCodeToFileSync=function(t){if(!t)throw new Error("param can not be undefined!");var e=t.path,i=t.content,r=t.config;if(!e)throw new Error("path can not be undefined!");if(0!==e.indexOf("GameSandBox://"))throw new Error("path must start with GameSandBox://");this.createQRCodeToFile(e,i,r)},t.makeQRCodeToFile=function(e){t.taskQueue.push(e)},t.compose=function(t,e){var i=BK.Director.screenPixelSize.width,r=BK.Director.screenPixelSize.height,n=new BK.Canvas(i,r);n.drawImage(t,0,0),n.drawImage(e,0,0),n.saveTo("GameSandBox://compose.png"),n.dispose()},t.taskQueue=new Array,t.instance=new t,t}();"undefined"!=typeof BK&&(BK.QRErrorCorrectLevel=s),t.exports=h},"./src/common/qrcodeModel.ts":function(t,e,i){"use strict";var r,n=function(){function t(t){this.mode=r.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,i=this.data.length;e<i;e++){var n=[],o=this.data.charCodeAt(e);o>65536?(n[0]=240|(1835008&o)>>>18,n[1]=128|(258048&o)>>>12,n[2]=128|(4032&o)>>>6,n[3]=128|63&o):o>2048?(n[0]=224|(61440&o)>>>12,n[1]=128|(4032&o)>>>6,n[2]=128|63&o):o>128?(n[0]=192|(1984&o)>>>6,n[1]=128|63&o):n[0]=o,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}return t.prototype.getLength=function(t){return this.parsedData.length},t.prototype.write=function(t){for(var e=0;e<this.parsedData.length;e++)t.put(this.parsedData[e],8)},t}(),o=function(){function t(t,e){this.moduleCount=0,this.dataList=new Array,this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=new Array}return t.prototype.addData=function(t){var e=new n(t);this.dataList.push(e),this.dataCache=null},t.prototype.isDark=function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},t.prototype.getModuleCount=function(){return this.moduleCount},t.prototype.make=function(){this.makeImpl(!1,this.getBestMaskPattern())},t.prototype.makeImpl=function(e,i){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,i),this.typeNumber>=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=t.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,i)},t.prototype.setupPositionProbePattern=function(t,e){for(var i=-1;i<=7;i++)if(!(t+i<=-1||this.moduleCount<=t+i))for(var r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(this.modules[t+i][e+r]=0<=i&&i<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==i||6==i)||2<=i&&i<=4&&2<=r&&r<=4)},t.prototype.getBestMaskPattern=function(){for(var t=0,e=0,i=0;i<8;i++){this.makeImpl(!0,i);var r=h.getLostPoint(this);(0==i||t>r)&&(t=r,e=i)}return e},t.prototype.createMovieClip=function(t,e,i){var r=t.createEmptyMovieClip(e,i);this.make();for(var n=0;n<this.modules.length;n++)for(var o=1*n,a=0;a<this.modules[n].length;a++){var s=1*a;this.modules[n][a]&&(r.beginFill(0,100),r.moveTo(s,o),r.lineTo(s+1,o),r.lineTo(s+1,o+1),r.lineTo(s,o+1),r.endFill())}return r},t.prototype.setupTimingPattern=function(){for(var t=8;t<this.moduleCount-8;t++)null==this.modules[t][6]&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)null==this.modules[6][e]&&(this.modules[6][e]=e%2==0)},t.prototype.setupPositionAdjustPattern=function(){for(var t=h.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var i=0;i<t.length;i++){var r=t[e],n=t[i];if(null==this.modules[r][n])for(var o=-2;o<=2;o++)for(var a=-2;a<=2;a++)this.modules[r+o][n+a]=-2==o||2==o||-2==a||2==a||0==o&&0==a}},t.prototype.setupTypeNumber=function(t){for(var e=h.getBCHTypeNumber(this.typeNumber),i=0;i<18;i++){r=!t&&1==(e>>i&1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=r}for(i=0;i<18;i++){var r=!t&&1==(e>>i&1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=r}},t.prototype.setupTypeInfo=function(t,e){for(var i=this.errorCorrectLevel<<3|e,r=h.getBCHTypeInfo(i),n=0;n<15;n++){o=!t&&1==(r>>n&1);n<6?this.modules[n][8]=o:n<8?this.modules[n+1][8]=o:this.modules[this.moduleCount-15+n][8]=o}for(n=0;n<15;n++){var o=!t&&1==(r>>n&1);n<8?this.modules[8][this.moduleCount-n-1]=o:n<9?this.modules[8][15-n-1+1]=o:this.modules[8][15-n-1]=o}this.modules[this.moduleCount-8][8]=!t},t.prototype.mapData=function(t,e){for(var i=-1,r=this.moduleCount-1,n=7,o=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var s=0;s<2;s++)if(null==this.modules[r][a-s]){var c=!1;o<t.length&&(c=1==(t[o]>>>n&1)),h.getMask(e,r,a-s)&&(c=!c),this.modules[r][a-s]=c,-1==--n&&(o++,n=7)}if((r+=i)<0||this.moduleCount<=r){r-=i,i=-i;break}}},t.createData=function(e,i,r){for(var n=d.getRSBlocks(e,i),o=new _,a=0;a<r.length;a++){var s=r[a];o.put(s.mode,4),o.put(s.getLength(),h.getLengthInBits(s.mode,e)),s.write(o)}for(var c=0,a=0;a<n.length;a++)c+=n[a].dataCount;if(o.getLengthInBits()>8*c)throw new Error("code length overflow. ("+o.getLengthInBits()+">"+8*c+")");for(o.getLengthInBits()+4<=8*c&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;;){if(o.getLengthInBits()>=8*c)break;if(o.put(t.PAD0,8),o.getLengthInBits()>=8*c)break;o.put(t.PAD1,8)}return t.createBytes(o,n)},t.createBytes=function(t,e){for(var i=0,r=0,n=0,o=new Array(e.length),a=new Array(e.length),s=0;s<e.length;s++){var c=e[s].dataCount,l=e[s].totalCount-c;r=Math.max(r,c),n=Math.max(n,l),o[s]=new Array(c);for(p=0;p<o[s].length;p++)o[s][p]=255&t.buffer[p+i];i+=c;var d=h.getErrorCorrectPolynomial(l),_=new u(o[s],d.getLength()-1).mod(d);a[s]=new Array(d.getLength()-1);for(p=0;p<a[s].length;p++){var f=p+_.getLength()-a[s].length;a[s][p]=f>=0?_.get(f):0}}for(var g=0,p=0;p<e.length;p++)g+=e[p].totalCount;for(var m=new Array(g),v=0,p=0;p<r;p++)for(s=0;s<e.length;s++)p<o[s].length&&(m[v++]=o[s][p]);for(p=0;p<n;p++)for(s=0;s<e.length;s++)p<a[s].length&&(m[v++]=a[s][p]);return m},t.PAD0=236,t.PAD1=17,t}();!function(t){t[t.MODE_NUMBER=1]="MODE_NUMBER",t[t.MODE_ALPHA_NUM=2]="MODE_ALPHA_NUM",t[t.MODE_8BIT_BYTE=4]="MODE_8BIT_BYTE",t[t.MODE_KANJI=8]="MODE_KANJI"}(r||(r={}));var a;!function(t){t[t.L=1]="L",t[t.M=0]="M",t[t.Q=3]="Q",t[t.H=2]="H"}(a||(a={}));for(var s={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},h=function(){function t(){}return t.getBCHTypeInfo=function(e){for(var i=e<<10;t.getBCHDigit(i)-t.getBCHDigit(t.G15)>=0;)i^=t.G15<<t.getBCHDigit(i)-t.getBCHDigit(t.G15);return(e<<10|i)^t.G15_MASK},t.getBCHTypeNumber=function(e){for(var i=e<<12;t.getBCHDigit(i)-t.getBCHDigit(t.G18)>=0;)i^=t.G18<<t.getBCHDigit(i)-t.getBCHDigit(t.G18);return e<<12|i},t.getBCHDigit=function(t){for(var e=0;0!=t;)e++,t>>>=1;return e},t.getPatternPosition=function(e){return t.PATTERN_POSITION_TABLE[e-1]},t.getMask=function(t,e,i){switch(t){case s.PATTERN000:return(e+i)%2==0;case s.PATTERN001:return e%2==0;case s.PATTERN010:return i%3==0;case s.PATTERN011:return(e+i)%3==0;case s.PATTERN100:return(Math.floor(e/2)+Math.floor(i/3))%2==0;case s.PATTERN101:return e*i%2+e*i%3==0;case s.PATTERN110:return(e*i%2+e*i%3)%2==0;case s.PATTERN111:return(e*i%3+(e+i)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},t.getErrorCorrectPolynomial=function(t){for(var e=new u([1],0),i=0;i<t;i++)e=e.multiply(new u([1,c.gexp(i)],0));return e},t.getLengthInBits=function(t,e){if(1<=e&&e<10)switch(t){case r.MODE_NUMBER:return 10;case r.MODE_ALPHA_NUM:return 9;case r.MODE_8BIT_BYTE:case r.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case r.MODE_NUMBER:return 12;case r.MODE_ALPHA_NUM:return 11;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else{if(!(e<41))throw new Error("type:"+e);switch(t){case r.MODE_NUMBER:return 14;case r.MODE_ALPHA_NUM:return 13;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}}},t.getLostPoint=function(t){for(var e=t.getModuleCount(),i=0,r=0;r<e;r++)for(l=0;l<e;l++){for(var n=0,o=t.isDark(r,l),a=-1;a<=1;a++)if(!(r+a<0||e<=r+a))for(var s=-1;s<=1;s++)l+s<0||e<=l+s||0==a&&0==s||o==t.isDark(r+a,l+s)&&n++;n>5&&(i+=3+n-5)}for(r=0;r<e-1;r++)for(l=0;l<e-1;l++){var h=0;t.isDark(r,l)&&h++,t.isDark(r+1,l)&&h++,t.isDark(r,l+1)&&h++,t.isDark(r+1,l+1)&&h++,0!=h&&4!=h||(i+=3)}for(r=0;r<e;r++)for(l=0;l<e-6;l++)t.isDark(r,l)&&!t.isDark(r,l+1)&&t.isDark(r,l+2)&&t.isDark(r,l+3)&&t.isDark(r,l+4)&&!t.isDark(r,l+5)&&t.isDark(r,l+6)&&(i+=40);for(l=0;l<e;l++)for(r=0;r<e-6;r++)t.isDark(r,l)&&!t.isDark(r+1,l)&&t.isDark(r+2,l)&&t.isDark(r+3,l)&&t.isDark(r+4,l)&&!t.isDark(r+5,l)&&t.isDark(r+6,l)&&(i+=40);for(var c=0,l=0;l<e;l++)for(r=0;r<e;r++)t.isDark(r,l)&&c++;return i+=10*(Math.abs(100*c/e/e-50)/5)},t.PATTERN_POSITION_TABLE=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t.G15=1335,t.G18=7973,t.G15_MASK=21522,t}(),c={glog:function(t){if(t<1)throw new Error("glog("+t+")");return c.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return c.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},l=0;l<8;l++)c.EXP_TABLE[l]=1<<l;for(l=8;l<256;l++)c.EXP_TABLE[l]=c.EXP_TABLE[l-4]^c.EXP_TABLE[l-5]^c.EXP_TABLE[l-6]^c.EXP_TABLE[l-8];for(l=0;l<255;l++)c.LOG_TABLE[c.EXP_TABLE[l]]=l;var u=function(){function t(t,e){if(void 0==t.length)throw new Error(t.length+"/"+e);for(var i=0;i<t.length&&0==t[i];)i++;this.num=new Array(t.length-i+e);for(var r=0;r<t.length-i;r++)this.num[r]=t[r+i]}return t.prototype.get=function(t){return this.num[t]},t.prototype.getLength=function(){return this.num.length},t.prototype.multiply=function(e){for(var i=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)i[r+n]^=c.gexp(c.glog(this.get(r))+c.glog(e.get(n)));return new t(i,0)},t.prototype.mod=function(e){if(this.getLength()-e.getLength()<0)return this;for(var i=c.glog(this.get(0))-c.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(n=0;n<e.getLength();n++)r[n]^=c.gexp(c.glog(e.get(n))+i);return new t(r,0).mod(e)},t}(),d=function(){function t(t,e){this.totalCount=t,this.dataCount=e}return t.getRSBlocks=function(e,i){var r=t.getRsBlockTable(e,i);if(void 0==r)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+i);for(var n=r.length/3,o=[],a=0;a<n;a++)for(var s=r[3*a+0],h=r[3*a+1],c=r[3*a+2],l=0;l<s;l++)o.push(new t(h,c));return o},t.getRsBlockTable=function(e,i){switch(i){case a.L:return t.RS_BLOCK_TABLE[4*(e-1)+0];case a.M:return t.RS_BLOCK_TABLE[4*(e-1)+1];case a.Q:return t.RS_BLOCK_TABLE[4*(e-1)+2];case a.H:return t.RS_BLOCK_TABLE[4*(e-1)+3];default:return}},t.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t}(),_=function(){function t(){this.buffer=new Array,this.length=0}return t.prototype.get=function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},t.prototype.put=function(t,e){for(var i=0;i<e;i++)this.putBit(1==(t>>>e-i-1&1))},t.prototype.getLengthInBits=function(){return this.length},t.prototype.putBit=function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++},t}();t.exports={QRCodeModel:o,QRErrorCorrectLevel:a}},"./src/deprecate/http-util.ts":function(t,e,i){"use strict";var r=BK.HttpUtil,n=function(){function t(t,e,i){this._headers={},this._isBodyCompatible=!1,this._url=t,this._method=e,"string"==typeof i?this._argu=i:i&&(this._body=i)}return t.prototype.setHttpHeader=function(t,e){this._headers[t]=e},t.prototype.setHttpRawBody=function(t){this._body=t},t.prototype.setHttpUploadProgressListener=function(t){this._uploadProgressListener=t},t.prototype.setHttpDownloadProgressListener=function(t){this._downloadProgressListener=t},t.prototype.sendRequest=function(t){var e=this._request=new r(this._url,this._method?this._method.toUpperCase():"GET");for(var i in this._headers)e.setHttpHeader(i,this._headers[i]);if(this._body)"string"==typeof this._body?((n=new BK.Buffer).writeAsString(this._body,!1),e.setHttpRawBody(n)):e.setHttpRawBody(this._body);else if(this._argu){this._isBodyCompatible&&e.setHttpHeader("PostBody",this._argu);var n=new BK.Buffer;n.writeAsString(this._argu,!1),e.setHttpRawBody(n)}e.setHttpUploadProgressListener&&this._uploadProgressListener&&e.setHttpUploadProgressListener(this._uploadProgressListener),e.setHttpDownloadProgressListener&&this._downloadProgressListener&&e.setHttpDownloadProgressListener(this._downloadProgressListener),e.sendRequest?e.sendRequest(t):e.requestAsync(function(e,i){t(i,{},e)})},t.prototype.setHttpUrl=function(t){this._url=t},t.prototype.setHttpMethod=function(t){this._method=t},t.prototype.requestAsync=function(t){this.sendRequest(function(e,i,r){t(r,e)})},t.prototype.setHttpReferer=function(t){this.setHttpHeader("Referer",t)},t.prototype.setHttpCookie=function(t){this.setHttpHeader("Cookie",t)},t.prototype.setBodyCompatible=function(t){this._isBodyCompatible=t},t.prototype.setHttpPostData=function(t){this._argu=t},t.prototype.setHttpRawBodyFix=function(t){this.setHttpRawBody(t)},t}();t.exports=n},"./src/fileSystem/FileSystem.ts":function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t.decode=function(e,i){if(e&&i){var r=e;switch(i){case"utf8":r=e.readAsString(!0);break;case"ascii":r=t.toASCII(e.readAsString(!0));break;case"binary":r=BK.Misc.BKBufferToArrayBuffer(e);break;case"base64":r=BK.Misc.encodeBase64FromBuffer(e)}return r}return BK.Console.error("invalid source or encode "+i),null},t.toASCII=function(e){return t.ESC.lastIndex=0,t.ESC.test(e)?e.replace(t.ESC,function(e){var i=t.META[e];return"string"==typeof i?i:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}):e},t.ESC=/[\\\"\x00-\x1f\x7f-\uffff]/g,t.META={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t}(),n=function(){function t(){}return t.prototype.readFile=function(t){if(0==BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.8.0")){if(t&&t.file){for(var e=[],i=0;i<t.file.length;i++)void 0!=t.file[i].path&&("utf8"===t.file[i].encoding&&(t.file[i].encoding="utf-8"),e.push({path:t.file[i].path,encoding:void 0==t.file[i].encoding?"binary":t.file[i].encoding}));var n=BK.FileUtil.addReadIOTask(e);BK.taskManager.pushTask(n,e,function(e){for(var i=0;i<e.length;i++)if(e[i].data){var n=e[i].data;if(n)switch(e[i].encoding){case"ascii":var o={data:r.decode(BK.FileUtil.readFile(e[i].path),"ascii"),errcode:0,path:e[i].path,errmsg:e[i].errmsg,encoding:"ascii"};e[i]=o;break;case"binary":e[i].data=BK.Misc.BKBufferToArrayBuffer(n);break;default:"utf-8"===e[i].encoding&&(e[i].encoding="utf8"),e[i].data=n.readAsString(!0)}else BK.Console.error("raw is invalid")}t.success&&t.success(e),t.complete&&t.complete()})}}else{var o=[];if(t&&t.file)for(i=0;i<t.file.length;i++){var a=t.file[i];if(a.path){var s=BK.FileUtil.readFile(a.path),h=r.decode(s,a.encoding||"binary");o.push({errcode:h?0:-1,errmsg:h?"":"read failed!",path:a.path,data:h})}}t.success&&t.success(o),t.complete&&t.complete()}},t.prototype.writeFile=function(t){if(0==BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.8.0")){if(t&&t.file){for(var e=[],i=0;i<t.file.length;i++)void 0!=t.file[i].path&&t.file[i].data&&e.push({path:t.file[i].path,encoding:void 0==t.file[i].encoding?"binary":t.file[i].encoding,data:BK.Misc.arrayBufferToBKBuffer(t.file[i].data)});var r=BK.FileUtil.addWriteIOTask(e);BK.taskManager.pushTask(r,e,function(e){t.success&&t.success(e),t.complete&&t.complete()})}}else{var n=[];if(t&&t.file)for(i=0;i<t.file.length;i++){var o=t.file[i];if(o.path){var a=BK.Misc.arrayBufferToBKBuffer(o.data),s=BK.FileUtil.writeBufferToFile(o.path,a);n.push({errcode:s?0:-1,errmsg:s?"":"write failed!",path:o.path})}}t.success&&t.success(n),t.complete&&t.complete()}},t.prototype.zip=function(t){if(0==BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.8.0")){if(t&&t.file){for(var e=[],i=0;i<t.file.length;i++)t.file[i].path&&t.file[i].zipPath&&e.push({path:t.file[i].path,zipPath:t.file[i].zipPath});var r=BK.FileUtil.addZipIOTask(e);BK.taskManager.pushTask(r,e,function(e){t.success&&t.success(e),t.complete&&t.complete()})}}else{var n=[];if(t&&t.file)for(i=0;i<t.file.length;i++){var o=t.file[i];if(o.path&&o.zipPath){var a=BK.FileUtil.zip(o.path,o.zipPath);n.push({errcode:a?0:-1,errmsg:a?"":"zip failed!",path:o.path,zipPath:o.zipPath})}}t.success&&t.success(n),t.complete&&t.complete()}},t.prototype.unzip=function(t){if(0==BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.8.0")){if(t&&t.file){for(var e=[],i=0;i<t.file.length;i++)t.file[i].path&&t.file[i].zipPath&&e.push({path:t.file[i].path,zipPath:t.file[i].zipPath});var r=BK.FileUtil.addUnzipIOTask(e);BK.taskManager.pushTask(r,e,function(e){t.success&&t.success(e),t.complete&&t.complete()})}}else{var n=[];if(t&&t.file)for(i=0;i<t.file.length;i++){var o=t.file[i];if(o.path&&o.zipPath){var a=BK.FileUtil.unzip(o.zipPath,o.path);n.push({errcode:a?0:-1,errmsg:a?"":"unzip failed!",path:o.path,zipPath:o.zipPath})}}t.success&&t.success(n),t.complete&&t.complete()}},t.prototype.readFileSync=function(t,e){return r.decode(BK.FileUtil.readFile(t),e||"binary")},t.prototype.writeFileSync=function(t,e){if(e instanceof String||"string"==typeof e)BK.FileUtil.writeFile(t,e);else{var i=BK.Misc.arrayBufferToBKBuffer(e);BK.FileUtil.writeBufferToFile(t,i)}},t.prototype.zipSync=function(t,e){BK.FileUtil.zip(t,e)},t.prototype.unzipSync=function(t,e){BK.FileUtil.unzip(t,e)},t.prototype.makeDirSync=function(t){BK.FileUtil.makeDir(t)},t.prototype.unlinkSync=function(t){return BK.FileUtil.deleteFile(t)},t.prototype.copyFileSync=function(t,e){if(0==BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.8.0"))BK.FileUtil.copyFile(t,e);else{var i=BK.FileUtil.readFile(t);i&&BK.FileUtil.writeBufferToFile(e,i)}},t.prototype.accessSync=function(t){return BK.FileUtil.isFileExist(t)},t.prototype.isDirectory=function(t){return BK.FileUtil.isDirectory(t)},t.prototype.getFileInfoSync=function(t){return BK.FileUtil.getFileInfo(t)},t.prototype.readDir=function(t){return BK.FileUtil.getFileList(t,function(e,i){0==e?t.success&&t.success({files:i.files}):t.fail&&t.fail({msg:i.errMsg,errcode:e}),t.complete&&t.complete()})},t}();e.FileSystem=n,t.exports=n},"./src/gme/audio.ts":function(t,e,i){"use strict";var r,n=this&&this.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),o=i("./src/common/emitter.ts");!function(t){function e(){return{MediaEvent:d,AudioFactory:f,NativeMethod:u,Audio2:p,AudioManager:g}}var i=0,r=1,a=2,s=3,h=4,c={log:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},error:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];BK.Script.log(1,1,"console error:"+t.join(" "))}},l={"Audio.play":"cs.audio_play.local","Audio.pause":"cs.audio_pause.local","Audio.load":"cs.audio_load.local","Audio.seek":"cs.audio_seek.local","Audio.destroy":"cs.audio_destroy.local","Audio.create":"cs.audio_create.local","Audio.onend":"cs.audio_onend.local","Audio.stop":"cs.audio_stop.local","Audio.resume":"cs.audio_effect_resume.local","NativeMethod.state":"cs.native_method_state.local","Audio.attribute.set":"cs.audio_attribute_set.local","Audio.attribute.get":"cs.audio_attribute_get.local","Audio.sys_event":"sc.audio_event.local"},u=function(){function t(e){this.callbackMap={},this.currentObjId=0,this.destroyed=!1,this.currentObjId=++t.OBJECT_ID,this.objContext=e;var i=function(t){t&&t.data&&t.data.message&&c.log("native method info:"+t.data.message)};this.callAlive(t.NATIVE_INFO,i)}return t.prototype.getCurrentTime=function(){return Date.now()},t.prototype.setObjectId=function(t){this.currentObjId=t},t.prototype.call=function(t,e,i){this.releaseCallback();var r=this.getKey(t);this.callbackMap[this.getCallbackId()]={CALLBACK:i,LOCK:!0,CMD:l[r]},this.innerCall(l[r],e)},t.prototype.callAlive=function(t,e){var i=this.getKey(t);BK.MQQ.SsoRequest.addListener(l[i],this,function(t,i,r){e&&e({code:t,cmd:i,data:r})})},t.prototype.offAlive=function(t){var e=this.getKey(t);BK.MQQ.SsoRequest.removeListener(l[e],this.objContext)},t.prototype.callSync=function(t,e){this.releaseCallback();var i=this.getKey(t);return this.callbackMap[this.getCallbackId()]={CALLBACK:{},LOCK:!0,CMD:l[i]},this.innerCallSync(l[i],e)},t.prototype.callBack=function(e,i,r){var n=r;n.code=e;var o=n[t.N_REQUEST_SE],a=this.callbackMap[o];a?(a.CALLBACK&&"function"==typeof a.CALLBACK&&a.CALLBACK.call(this.objContext,n),a[t.N_R_ALIVE]||(a.LOCK=!1)):c.log("no callback "+o),this.releaseCallback();c.log("receive callback # "+o+" # "+i+" # "+JSON.stringify(r)+" cost "+(this.getCurrentTime()-r[t.N_R_TIME])+" ms")},t.prototype.getKey=function(t){return t},t.prototype.getCallbackId=function(){return++t.CALLBACK_ID},t.prototype.innerCall=function(e,i){i[t.N_REQUEST_SE]=t.CALLBACK_ID,i[t.N_REQUEST_O]=this.currentObjId,i[t.N_R_TIME]=this.getCurrentTime(),c.log("send message "+t.CALLBACK_ID+" # "+e+" # "+JSON.stringify(i));var r=this;BK.MQQ.SsoRequest.removeListener(e,this.objContext),BK.MQQ.SsoRequest.addListener(e,this.objContext,function(){r.callBack.apply(r,arguments)}),BK.MQQ.SsoRequest.send(i,e)},t.prototype.innerCallSync=function(e,i){if(i[t.N_REQUEST_SE]=t.CALLBACK_ID,i[t.N_REQUEST_O]=this.currentObjId,i[t.N_R_SYNC]=!0,i[t.N_R_TIME]=this.getCurrentTime(),c.log("send message sync "+t.CALLBACK_ID+" # "+e+" # "+JSON.stringify(i)),BK.MQQ.Native.syncSend)return BK.MQQ.Native.syncSend(i,e)},t.prototype.releaseCallback=function(){for(var t in this.callbackMap)t&&!this.callbackMap[t].LOCK&&delete this.callbackMap[t]},t.N_REQUEST_SE="N_R_SE",t.N_REQUEST_O="N_R_OBJ",t.CALLER="CALLER",t.CALLBACK="CALLBACK",t.NATIVE_INFO="NativeMethod.state",t.N_R_SYNC="N_R_SYNC",t.N_R_ALIVE="N_R_ALIVE",t.N_R_T="N_R_T",t.N_R_TIME="N_R_TIME",t.CALLBACK_ID=0,t.OBJECT_ID=0,t}(),d={NAME_SPACE:"MediaEvent",abort:"abort",canplay:"canplay",canplaythrough:"canplaythrough",durationchange:"durationchange",emptied:"emptied",encrypted:"encrypted",ended:"ended",error:"error",interruptbegin:"interruptbegin",interruptend:"interruptend",loadeddata:"loadeddata",loadedmetadata:"loadedmetadata",loadstart:"loadstart",mozaudioavailable:"mozaudioavailable",pause:"pause",play:"play",playing:"playing",progress:"progress",ratechange:"ratechange",seeked:"seeked",seeking:"seeking",stalled:"stalled",suspend:"suspend",timeupdate:"timeupdate",volumechange:"volumechange",waiting:"waiting",created:"created",destroyed:"destroyed"},_=function(t){function e(n){var o=t.call(this)||this;o._src="",o._volume=1,o._muted=!1,o._loop=!1,o._autoplay=!1,o._buffered={},o._controls={},o._preload=!1,o._played={},o._duration=0,o._paused=!1,o._currenTime=0,o._playing=!1,o._loaded=!1,o._loading=!1,o._playerType="normal",o._streamId=0,o._lastLeftVolume=1,o._lastRightVolume=1,o._loopCound=0,o._destroyed=!1,o._$sn=e.SN_SEED++,o.HAVE_NOTHING=i,o.HAVE_METADATA=r,o.HAVE_CURRENT_DATA=a,o.HAVE_FUTURE_DATA=s,o.HAVE_ENOUGH_DATA=h,o.readyState=i,o.nativeMethod=new u(o);var c="normal",l="";n.src&&(l=n.src),n.type&&(c=c===n.type?c:"effect"),o.create(n);var d=o;return l?d.src=l:d._src="",o}return n(e,t),e.prototype.create=function(t,e){void 0===t&&(t={}),void 0===e&&(e=!1);var i=t.type;if(i||(i="normal",t.type=i),t.id=GameStatusInfo.gameId,this._playerType=i,!this.isIOSEffect()||e){this.nativeMethod.callSync("Audio.create",t);this.onCreate()}},e.prototype.onCanPlay=function(){this.emit("load"),this.emit("loadend"),this.emit("canplay"),this.emit("canplaythrough"),this.emit(d.loadeddata),this.emit(d.loadedmetadata),this.readyState=a},e.prototype.onPlay=function(){this.emit(d.play),this.emit(d.playing),this._playing=!0},e.prototype.onCreate=function(){this.emit(d.created)},e.prototype.onDestroy=function(){this.emit(d.destroyed),BK.Director.ticker.remove(this),this._destroyed=!0},e.prototype.onPause=function(){this.emit(d.pause),this._paused=!0,this._playing=!1},e.prototype.onEnded=function(){this.emit("ended"),this.readyState=h,this._playing=!1,BK.Director.ticker.remove(this)},e.prototype.onError=function(t){this.emit("error"),BK.Director.ticker.remove(this)},e.prototype.onSeeking=function(){this.emit(d.seeking)},e.prototype.onSeeked=function(){this.emit(d.seeked),this.emit(d.playing)},e.prototype.onTimeUpdate=function(t){this.emit(d.timeupdate,{currentTime:t})},e.prototype.onLoad=function(){this._loaded=!0,this._loading=!1,this.onCanPlay(),this.nativeMethod.callSync("Audio.duration",{})},e.prototype.onVolumeChange=function(){this.emit(d.volumechange)},e.prototype.load=function(){var t=this;this._loaded&&this.emit(d.emptied),this._loading=!0,this.emit(d.loadstart),this.nativeMethod.call("Audio.load",{},function(e){0===e.code?t.onLoad():t.onError(e.message)})},e.prototype.play=function(t){if(void 0===t&&(t={}),!this.destroyed){var i=this;if(this._playing=!0,this._paused=!1,"effect"!==this._playerType){this.autoplay=!0,this.nativeMethod.callSync("Audio.play",t),this.nativeMethod.call("Audio.onend",{},i.onEnded);var r=(new Date).getTime();BK.Director.ticker.remove(this),BK.Director.ticker.add(function(t,e){var n=(new Date).getTime();n-r>=2e3&&(i.getAttribute({currentTime:0}),r=n)},this)}else{if(this.isIOSEffect()){var n=--e.IOS_OBJ_ID;this.nativeMethod.setObjectId(n),this.create({type:this._playerType,src:this._src,loop:this._loop},!0),t.complete&&t.complete({id:e.IOS_OBJ_ID})}var o=t.loopCount,a={loop:o||(this._loop?-1:0),src:this._src,volume:this._volume,complete:t.complete?t.complete:function(t){t&&(i._streamId=t.id,0===t.code||i.onError(t.message))}};this.nativeMethod.call("Audio.play",a,a.complete)}return this.onPlay(),this._streamId}},e.prototype.pause=function(t){void 0===t&&(t={}),"effect"===this._playerType&&(t.id=t.id,t.id&&0!==t.id||(delete t.id,t.auto=!0)),this._paused=!0,this.nativeMethod.callSync("Audio.pause",t),this.onPause()},e.prototype.seek=function(t){var e=this;this.nativeMethod.call("Audio.seek",{seek:t},function(t){0===t.code?e.onSeeked():e.onError(t.message)}),this.onSeeking()},e.prototype.destroy=function(t){void 0===t&&(t={});var e=this;"effect"===this._playerType&&t.id&&(t.id=t.id),this.nativeMethod.callSync("Audio.destroy",{id:e._$sn}),BK.Director.ticker.remove(this),f.CURRENT_NUM--,f.removeAudio(this),this.onDestroy()},e.prototype.canPlayType=function(t){return void 0===t&&(t=""),"string"!=typeof t?"":"audio/mpeg".indexOf(t)>-1||"audio/mp4".indexOf(t)>-1?"probably":""},e.prototype.stop=function(t){void 0===t&&(t={}),"effect"===this._playerType&&t.id&&(t.id=t.id),this.nativeMethod.callSync("Audio.stop",t)},e.prototype.resume=function(t){void 0===t&&(t={}),"effect"===this._playerType&&(t.id&&0!==t.id?this.isIOSEffect()&&this.nativeMethod.setObjectId(t.id):(delete t.id,t.audo=!0)),this.nativeMethod.callSync("Audio.resume",t)},e.prototype.setAttribute=function(t){this.nativeMethod.callSync("Audio.attribute.set",t)},e.prototype.getAttribute=function(t){void 0===t&&(t={});var e=this.nativeMethod.callSync("Audio.attribute.get",t);e&&!isNaN(e.duration)&&(this._duration=e.duration),e&&!isNaN(e.currentTime)&&(this._currenTime=e.currentTime,this.onTimeUpdate(e.currentTime)),e&&void 0!==e.paused&&(this._paused=e.paused)},Object.defineProperty(e.prototype,"currentTime",{get:function(){return this.getAttribute({currentTime:1}),this._currenTime},set:function(t){this.setAttribute({currentTime:t}),this.seek(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this.getAttribute({duration:1}),this._duration},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"src",{get:function(){return this._src},set:function(t){t&&"android"===GameStatusInfo.platform&&(t=t.replace("GameSandBox://","GameRes://sandbox/")),"effect"!==this._playerType&&(this.setAttribute({src:t,autoPlay:!1}),this.load()),this._src=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loop",{get:function(){return this._loop},set:function(t){"effect"!==this._playerType&&this.setAttribute({loop:t}),this._loop=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"autoplay",{get:function(){return this._autoplay},set:function(t){this.setAttribute({autoPlay:t}),this._autoplay=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this.getAttribute({paused:!1}),this._paused},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._volume},set:function(t){this._muted||("effect"!==this._playerType&&(this.setAttribute({leftVolume:t,rightVolume:t,volume:t}),this.onVolumeChange()),this._lastLeftVolume=this.volume,this._lastRightVolume=this.volume,this._volume=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._muted},set:function(t){this._muted=t,"effect"!==this._playerType&&this.setAttribute({muted:t,leftVolume:this._lastLeftVolume,rightVolume:this._lastRightVolume})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){return this._buffered},set:function(t){this._buffered=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"played",{get:function(){return this._played},set:function(t){this._played=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preload",{get:function(){return this._preload},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"streamId",{get:function(){return this._streamId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this._playerType},enumerable:!0,configurable:!0}),e.prototype.isIOSEffect=function(){return"effect"===this._playerType&&"ios"===GameStatusInfo.platform},Object.defineProperty(e.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._$sn},enumerable:!0,configurable:!0}),e.SN_SEED=1,e.IOS_OBJ_ID=Math.pow(2,53)-1,e}(o),f=function(){function t(){}return t.createAudioContext=function(e){if(void 0===e&&(e={}),e.type&&"normal"!==e.type){if("effect"===e.type){return void 0===t.effect_instance||t.effect_instance.destroyed||(t.effect_instance.destroy(),t.removeAudio(t.effect_instance)),t.effect_instance=new _(e),t.audioMap.push(t.effect_instance),t.effect_instance}return c.log("invalid type "+e.type),new _({})}if(t.CURRENT_NUM<t.MAX_AUDIO_NUM){var i=new _(e);return t.CURRENT_NUM++,t.audioMap.push(i),i}return c.log("reach the max num of audio"),new _({})},t.getAudioList=function(){return t.audioMap},t.removeAudio=function(e){for(var i=-1,r=0;r<t.audioMap.length;r++)if(e.id==t.audioMap[r].id){i=r;break}-1!=i&&(t.audioMap=t.audioMap.slice(i,1))},t.MAX_AUDIO_NUM=8,t.MAX_EFFECT_NUM=3,t.CURRENT_NUM=0,t.audioMap=[],t.effectMap=[],t.CURRENT_EFFECT_NUM=0,t.effect_index=0,t}(),g=function(){function t(){this.nativeMethod=new u(this),this.nativeMethod.callAlive("Audio.sys_event",this.onEvent)}return t.prototype.onEvent=function(e){switch(void 0===e&&(e={}),(e.data||{}).event){case 1:t.AUDIO_INT_START&&"function"==typeof t.AUDIO_INT_START&&t.AUDIO_INT_START();break;case 2:t.AUDIO_INT_END&&"function"==typeof t.AUDIO_INT_END&&t.AUDIO_INT_END()}},t.newInstance=function(){t.INSTANCE||(t.INSTANCE=new t)},t.onAudioInterruptionStart=function(e){t.AUDIO_INT_START=e},t.onAudioInterruptionEnd=function(e){t.AUDIO_INT_END=e},t.pauseAllAudio=function(){for(var t=0,e=f.getAudioList();t<e.length;t++){var i=e[t];i&&!i.paused&&i.pause()}},t.resumeAllAudio=function(){for(var t=0,e=f.getAudioList();t<e.length;t++){var i=e[t];i&&("normal"===i.type?i.play():"effect"===i.type&&i.resume())}},t.destroyAllAudio=function(){for(var t=0,e=f.getAudioList();t<e.length;t++){var i=e[t];i&&i.destroy()}},t.INSTANCE=new t,t}(),p=function(){function t(t,e,i,r){void 0===i&&(i=1),void 0===r&&(r=!1),this._currentTime=0,this._volume=1,this._audioType=0,this._destroyAtComplete=!1,this._type=t,this._musicPath=e,this._loopCount=i,this._destroyAtComplete=r,BK.onEnterForeground(function(){g.resumeAllAudio()}),BK.onMaximize(function(){g.resumeAllAudio()})}return t.prototype.isEffect=function(){return 1===this._audioType},t.prototype.seekTo=function(t){this.audioObject&&this.audioObject.seek(t)},t.prototype.startMusic=function(e){if(void 0===e&&(e=function(){}),this.isEffect())void 0===this.effectObject&&(this.effectObject=f.createAudioContext({type:"effect",src:this._musicPath})||null),void 0!==this.effectObject&&(this.effectObject.loop=-1===this._loopCount,this.effectObject.muted=!t.switch,this.effectObject.src!==this._musicPath&&(this.effectObject.src=this._musicPath),this.effectObject.play({loopCount:this._loopCount}));else{void 0===this.audioObject&&(this.audioObject=f.createAudioContext({type:"normal",src:this._musicPath})||null);var i=this;void 0!==this.audioObject?(this.audioObject.muted=!t.switch,-1==this._loopCount?this._loopCount=Math.pow(2,53)-1:c.log("loo for "+this._loopCount),this.audioObject.on(d.loadeddata,function(){i.loopPlay(i._loopCount,e)})):c.log("create failed")}return this},t.prototype.loopPlay=function(t,e){if(void 0!==this.audioObject){var i=this;if(--t>0){var r=function(){void 0!==i.audioObject&&(i.audioObject.off(d.ended,r),i.loopPlay(t,e))};this.audioObject.on(d.ended,r)}if(t<=0){var n=function(){void 0!==i.audioObject&&(i.audioObject.off(d.ended,n),i.audioObject.destroy(),e&&e())};this.audioObject.on(d.ended,n)}this.audioObject.play()}},t.prototype.pauseMusic=function(){if(this.isEffect()){if(!this.effectObject)return void c.log("not init effect call play first");this.effectObject.pause()}else{if(!this.audioObject)return void c.log("not init audio call play first");this.audioObject.pause()}},t.prototype.resumeMusic=function(){if(this.isEffect()){if(!this.effectObject)return void c.log("not init effect call play first");this.effectObject.resume()}else{if(!this.audioObject)return void c.log("not init audio call play first");this.audioObject.play()}},t.prototype.stopMusic=function(){this.audioObject&&this.audioObject.destroy(),this.effectObject&&this.effectObject.destroy()},t.prototype.destroy=function(){this.audioObject&&this.audioObject.destroy(),this.effectObject&&this.effectObject.destroy()},Object.defineProperty(t.prototype,"volume",{set:function(t){this.audioObject?this.audioObject.volume=t:c.log("audio not init")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"loopCount",{set:function(t){this.audioObject&&(this._loopCount=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{set:function(t){this._type=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"musicPath",{set:function(t){this._musicPath=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"audioType",{set:function(t){this._audioType=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.audioObject?this.audioObject.currentTime:(c.log("audio not init"),0)},set:function(t){this.audioObject?this.audioObject.currentTime=t:c.log("audio not init")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this.audioObject?this.audioObject.duration:(c.log("audio not init"),0)},enumerable:!0,configurable:!0}),t.playMusic=function(e,i,r){1===e?(void 0===t.effectAudioInstance&&(t.effectAudioInstance=new t(e,i,r)),t.effectAudioInstance.musicPath=i,t.effectAudioInstance.loopCount=r,t.effectAudioInstance.startMusic()):new t(e,i,r).startMusic()},t.pauseAllBackground=function(){BK.AudioManager.pauseAllAudio()},t.resumeAllBackground=function(){BK.AudioManager.resumeAllAudio()},t.switch=!0,t}();t.createContext=e}(r||(r={})),t.exports=r.createContext},"./src/mqq/advertisement/advertisement.ts":function(t,e,i){"use strict";var r,n=this&&this.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),o=i("./src/common/emitter.ts");!function(t){function e(t){return new a(t)}function i(){return new s}var r=["succeed","internal error","frequency error","network error","invalid request","no ad fill","server error","formet mismatch","h5 game nonsupport"],a=function(t){function e(i){var n=t.call(this)||this;return n.ssoCMD={LOAD_REQ:"cs.game_ad_banner_load.local",LOAD_RESP:"sc.game_ad_banner_load.local",SHOW_REQ:"cs.game_ad_banner_show.local",HIDE_REQ:"cs.game_ad_banner_hide.local",RESIZE_REQ:"cs.game_ad_banner_resize.local",RESIZE_RESP:"sc.game_ad_banner_resize.local",CLOSE_REQ:"cs.game_ad_banner_close.local"},n.hasShow=!1,n.hasHide=!1,n.param=i,n.bannerId=e._bannerId(),n.param.viewId||(n.param.viewId=1001),n.eventCallBack={load:void 0,error:void 0},n.useNative=!1,n.param.viewId&&1003==n.param.viewId&&(n.useNative=!0),n.needAutoShow=!1,n.isLoadSucc=!1,n.fetch(function(t,e){if(BK.isBrowser&&"android"===GameStatusInfo.platform&&e.errCode&&(t=e.errCode),0==t)this.isLoadSucc=!0,this.emit("load"),1==this.needAutoShow&&this.show();else{var i="unknown error",n=t;e.errCode&&(n=e.errCode),n<r.length&&(i=r[n]);var o={msg:i,code:n};this.emit("error",o)}}.bind(n)),n}return n(e,t),e._bannerId=function(){return this.incBannerId||(this.incBannerId=0),++this.incBannerId},e.prototype.log=function(t){BK.Script.log(1,1,"BannerAd:"+t)},e.prototype.show=function(){this.hasShow?this.log("show error.can't show twice!"):1!=this.hasHide?1==this.isLoadSucc?(this.hasShow=!0,this.hasHide=!1,this.useNative?this._ssoShow():this._innerGameBanner?1001==this.param.viewId?this._innerGameBanner.show(function(t,e,i){BK.Script.log(1,1,"show static inner banner succCode"+t+" msg:"+e)}):1002==this.param.viewId&&this._innerGameBanner.showAnimate(function(t,e,i){BK.Script.log(1,1,"show animate banner succCode"+t+" msg:"+e)}):BK.Script.log(1,1,"show inner banner failed. handle is undefined")):this.needAutoShow=!0:this._setHidden(!1)},e.prototype.hide=function(){1!=this.hasHide?this._setHidden(!0):this.log("hide error.can't hide twice!")},e.prototype._setHidden=function(t){1==t?this.useNative?this._ssoHide():this._innerGameBanner?this._innerGameBanner.setHidden(!0):BK.Script.log(1,1,"hide inner banner failed. handle is undefined"):this.useNative?this._ssoShow():this._innerGameBanner?this._innerGameBanner.setHidden(!1):BK.Script.log(1,1,"hide inner banner failed. handle is undefined"),this.hasShow=!t,this.hasHide=t},e.prototype.destory=function(){this.useNative?this._ssoClose():this._innerGameBanner?this._innerGameBanner.close():BK.Script.log(1,1,"close inner banner failed. handle is undefined")},e.prototype.onError=function(t){this.on("error",t)},e.prototype.offError=function(t){this.off("error",t)},e.prototype.onLoad=function(t){this.on("load",t)},e.prototype.offLoad=function(t){this.off("load",t)},e.prototype.fetch=function(t){this.useNative?this._ssoLoad(t):BK.isBrowser?t(8,r[8]):BK.Advertisement.fetchBannerAd(function(e,i,r){0==e?this._innerGameBanner=r:BK.Script.log(1,1,"fetchBannerAd failed. retCode:"+e+"msg:"+i),t(e,i)}.bind(this))},e.prototype._sendSso=function(t){BK.MQQ.SsoRequest.send(t.reqData,t.reqCmd),t.respCmd&&BK.MQQ.SsoRequest.addListener(t.respCmd,this,function(e,i,r){void 0!==r&&void 0!==r.bannerId&&t.callback&&this.bannerId==r.bannerId&&t.callback(e,r)}.bind(this))},e.prototype._ssoLoad=function(t){var e=1001;this.param.viewId&&(e=this.param.viewId),this._sendSso({reqCmd:this.ssoCMD.LOAD_REQ,reqData:{bannerId:this.bannerId,viewId:e},respCmd:this.ssoCMD.LOAD_RESP,callback:t})},e.prototype._ssoShow=function(){this._sendSso({reqCmd:this.ssoCMD.SHOW_REQ,reqData:{bannerId:this.bannerId,style:this.param.style}})},e.prototype._ssoClose=function(){this._sendSso({reqCmd:this.ssoCMD.CLOSE_REQ,reqData:{bannerId:this.bannerId}})},e.prototype._ssoHide=function(){this._sendSso({reqCmd:this.ssoCMD.HIDE_REQ,reqData:{bannerId:this.bannerId}})},e}(o);t.BannerAd=a,t.createBannerAd=e;var s=function(t){function e(){var e=t.call(this)||this;return e.autoShow=!1,BK.Advertisement.fetchVideoAd(1,function(t,e,i){0==t?(this.emit("load"),i.setEventCallack(function(t,e){this.emit("close_game")}.bind(this),function(t,e){this.emit("play_finish")}.bind(this),function(t,e){0==t?this.emit("video_close"):this.emit("error",{msg:"close error",code:-1})}.bind(this),function(t,e){0==t&&this.emit("play_start")}.bind(this)),this.handle=i,1==this.autoShow&&this.handle.jump()):this.emit("error",{msg:e,code:t})}.bind(e)),e}return n(e,t),e.prototype.show=function(){this.handle?this.handle.jump():this.autoShow=!0},e.prototype.onPlayStart=function(t){this.on("play_start",t)},e.prototype.offPlayStart=function(t){this.off("play_start",t)},e.prototype.onPlayFinish=function(t){this.on("play_finish",t)},e.prototype.offPlayFinish=function(t){this.off("play_finish",t)},e.prototype.onLoad=function(t){this.on("load",t)},e.prototype.offLoad=function(t){this.off("load",t)},e.prototype.onError=function(t){this.on("error",t)},e.prototype.offError=function(t){this.off("error",t)},e.prototype.onClose=function(t){this.on("video_close",t)},e.prototype.offClose=function(t){this.off("video_close",t)},e}(o);t.createVideoAd=i}(r||(r={})),t.exports={createBannerAd:r.createBannerAd,createVideoAd:r.createVideoAd}},"./src/mqq/share/screenshot.ts":function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r;!function(t){function e(t){(void 0==t.x||t.x<0||t.x>BK.Director.screenPixelSize.width)&&(t.x=0),(void 0==t.y||t.y<0||t.y>BK.Director.screenPixelSize.height)&&(t.y=0),(void 0==t.width||t.width<=0||t.width>BK.Director.screenPixelSize.width-t.x)&&(t.x=0,t.width=BK.Director.screenPixelSize.width),(void 0==t.height||t.height<=0||t.height>BK.Director.screenPixelSize.height-t.y)&&(t.y=0,t.height=BK.Director.screenPixelSize.height)}function i(t){BK.isBrowser?n(t):r(t)}function r(t){try{e(t.range);var i=new BK.RenderTexture(BK.Director.screenPixelSize.width,BK.Director.screenPixelSize.height);BK.Render.renderToTexture(BK.Director.root,i),i.writeToDiskWithXY(t.path,t.range.x,t.range.y,t.range.width,t.range.height),o(t)}catch(e){t.fail&&t.fail({code:-1,msg:JSON.stringify(e)}),t.complete&&t.complete()}}function n(t){try{e(t.range),c=new BK.WebGL,h();var i=new BK.Buffer(t.range.height*t.range.width*4);c.glReadPixels(t.range.x,t.range.y,t.range.width,t.range.height,c.RGBA,c.UNSIGNED_BYTE,i),a(i,t),s(t),o(t)}catch(e){t.fail&&t.fail({code:-1,msg:JSON.stringify(e)}),t.complete&&t.complete()}}function o(t){BK.FileUtil.isFileExist(t.path)?t.isUpload?BK.Upload.upload({path:t.path,success:function(e){var i=e.code,r=e.url;t.success&&t.success({code:i,path:r}),t.complete&&t.complete()},fail:function(e){var i=e.code,r=e.msg;t.fail&&t.fail({code:i,msg:r}),t.complete&&t.complete()}}):(t.success&&t.success({code:0,path:t.path}),t.complete&&t.complete()):(t.fail&&t.fail({code:-1,msg:"fail to shot, no such file or directory "+t.path}),t.complete&&t.complete())}function a(t,e){var i=e.path,r=e.range,n=i.substr(0,i.lastIndexOf(".")),o=i.substr(i.lastIndexOf(".")+1);BK.Image.saveImage(t,r.width,r.height,n,o)}function s(t){var e=t.path,i=t.range,r=new BK.Canvas(i.width,i.height);r.scales(1,-1),r.drawImage(e,0,0,i.width,i.height,0,-i.height,i.width,i.height),r.saveTo(e),r.dispose()}function h(){c.DEPTH_BUFFER_BIT=256,c.STENCIL_BUFFER_BIT=1024,c.COLOR_BUFFER_BIT=16384,c.TRIANGLES=4,c.TEXTURE_BINDING_2D=32873,c.ARRAY_BUFFER=34962,c.ARRAY_BUFFER_BINDING=34964,c.ELEMENT_ARRAY_BUFFER=34963,c.ELEMENT_ARRAY_BUFFER_BINDING=34965,c.STATIC_DRAW=35044,c.UNSIGNED_BYTE=5121,c.UNSIGNED_SHORT=5123,c.FLOAT=5126,c.RGBA=6408,c.FRAGMENT_SHADER=35632,c.VERTEX_SHADER=35633,c.LINK_STATUS=35714,c.CURRENT_PROGRAM=35725,c.NEAREST=9728,c.LINEAR=9729,c.TEXTURE_MAG_FILTER=10240,c.TEXTURE_MIN_FILTER=10241,c.TEXTURE_WRAP_S=10242,c.TEXTURE_WRAP_T=10243,c.TEXTURE_2D=3553,c.TEXTURE0=33984,c.TEXTURE1=33985,c.ACTIVE_TEXTURE=34016,c.REPEAT=10497,c.CLAMP_TO_EDGE=33071,c.MIRRORED_REPEAT=33648,c.FRAMEBUFFER=36160,c.RENDERBUFFER=36161,c.COLOR_ATTACHMENT0=36064,c.DEPTH_ATTACHMENT=36096,c.STENCIL_ATTACHMENT=36128,c.NONE=0,c.FRAMEBUFFER_COMPLETE=36053,c.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054,c.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055,c.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057,c.FRAMEBUFFER_UNSUPPORTED=36061,c.FRAMEBUFFER_BINDING=36006,c.RENDERBUFFER_BINDING=36007,c.INVALID_FRAMEBUFFER_OPERATION=1286}var c;t.shot=i,t.shotBK=r,t.shotGL=n}(r=e.Screenshot||(e.Screenshot={})),t.exports=r},"./src/mqq/share/share.ts":function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r;!function(t){function e(t){try{var e="cs.share_game_result.local",i={cmd:e,from:GameStatusInfo.platform,roomId:GameStatusInfo.roomId,gameId:GameStatusInfo.gameId,openId:GameStatusInfo.openId,gameVersion:GameStatusInfo.gameVersion,title:t.title?t.title:"轻游戏",summary:t.summary?t.summary:"一起来玩游戏吧~",picUrl:t.qqImgUrl?t.qqImgUrl:h({title:t.title?t.title:"轻游戏",subTitle:t.summary?t.summary:"一起来玩游戏吧~"}),detailUrl:t.msgUrl?t.msgUrl:""};BK.SsoRequest.request({reqCmd:e,data:i})}catch(e){t.fail&&t.fail({code:-1,msg:JSON.stringify(e)}),t.complete&&t.complete()}}function i(t){try{t.range?BK.Screenshot.shot({path:"GameSandBox://screenshot.png",range:t.range,isUpload:!0,success:function(e){BK.Share.share({qqImgUrl:e.path,success:function(e){t.success&&t.success(e),t.complete&&t.complete()},fail:function(e){t.fail&&t.fail(e),t.complete&&t.complete()}})},fail:function(e){t.fail&&t.fail(e),t.complete&&t.complete()}}):(t.fail&&t.fail({code:-1,msg:"fail to shot, need range"}),t.complete&&t.complete())}catch(e){t.fail&&t.fail({code:-1,msg:JSON.stringify(e)}),t.complete&&t.complete()}}function r(t){BK.isBrowser?o(t):BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.6.3")?o(t):n(t)}function n(t){try{var e="cs.game_shell_share_callback.local",i=t.success&&t.fail?"sc.share_game_to_friend_result.local":e;a({gameName:t.title?t.title:"轻游戏",summary:t.summary?t.summary:"一起来玩游戏吧~",extendInfo:t.extendInfo?t.extendInfo:"",localPicPath:t.socialPicPath?t.socialPicPath:h({title:t.title?t.title:"轻游戏",subTitle:t.summary?t.summary:"一起来玩游戏吧~"}),picUrl:t.qqImgUrl,activityId:0,reqCode:1,inner:1},e,i,t)}catch(e){t.fail&&t.fail({code:-1,msg:JSON.stringify(e)}),t.complete&&t.complete()}}function o(t){try{var e="cs.share_game_in_ark.local",i=t.success?"sc.share_game_to_friend_result.local":e;BK.isBrowser&&"android"==GameStatusInfo.platform&&0==GameStatusInfo.QQVer.indexOf("7.6.0")&&(e="cs.game_shell_share_callback.local"),a({cmd:e,gameId:GameStatusInfo.gameId,roomId:GameStatusInfo.roomId,gameMode:GameStatusInfo.gameMode,isSelectFriend:t.isToFriend?1:0,summary:t.summary?t.summary:"一起来玩游戏吧~",extendInfo:t.extendInfo?t.extendInfo:"",picUrl:t.qqImgUrl},e,i,t)}catch(e){t.fail&&t.fail({code:-1,msg:JSON.stringify(e)}),t.complete&&t.complete()}}function a(t,e,i,r){BK.SsoRequest.request({data:t,reqCmd:e,respCmd:i,success:function(t){var e=t.code,i=(t.cmd,t.data);r.success&&(s(0==e?0:1),r.success({code:e,data:i}))},fail:function(t){var e=t.code,i=(t.cmd,t.data);r.fail&&(s(0==e?0:1),r.fail({code:e,msg:i}))},complete:function(){r.complete&&r.complete()}})}function s(t){var e=t.toString();BK.QQ.uploadData("clickShowOffButton","",e,"","","")}function h(t){var e=BK.Image.loadImage("GameRes://inviteIcon.png");if(e){var i=e.height,r=e.width;if(Math.abs(i/r-304/540)<.01)return c(t)}return""}function c(t){var e=t.title,i=t.subTitle,r=new BK.Canvas(750,750);if(r.fillColor={r:1,g:1,b:1,a:1},r.fillRect(0,0,750,750),BK.FileUtil.isFileExist("GameRes://share_logo.png")){r.drawImage("GameRes://share_logo.png",0,0,125,28,32,32,126,27)}if(BK.FileUtil.isFileExist("GameRes://inviteIcon.png")){var n=BK.Image.loadImage("GameRes://inviteIcon.png");n&&r.drawImage("GameRes://inviteIcon.png",0,0,n.width,n.height,0,330,750,420)}r.fillColor={r:0,g:0,b:0,a:1},r.drawStyle=0,r.setTextAlign(1),r.setTextSize(40),r.textBaseLine="bottom",r.textAlign="left",r.fillText(e,35,258);r.fillColor={r:137/255,g:137/255,b:137/255,a:.5},r.drawStyle=0,r.setTextAlign(1),r.setTextSize(30),r.textBaseLine="bottom",r.textAlign="left",r.fillText(i,35,215);r.fillColor={r:1,g:1,b:1,a:1};var o="http://cmshow.qq.com/apollo/html/game-platform/scan-game.html?gameId="+GameStatusInfo.gameId.toString()+"&src=203";BK.QRCode.makeQRCodeToFileSync({path:"GameSandBox://qrcode.png",content:o,config:{width:256,height:256,colorDark:{r:0,g:0,b:0,a:1},colorLight:{r:1,g:1,b:1,a:1},correctLevel:2}}),r.drawImage("GameSandBox://qrcode.png",0,0,256,256,600,64,120,120);return r.fillColor={r:0,g:0,b:0,a:1},r.drawStyle=0,r.setTextAlign(1),r.setTextSize(19),r.textBaseLine="bottom",r.textAlign="left",r.fillText("长按扫码即玩",600,28),r.saveTo("GameSandBox://compose.png"),r.dispose(),"GameSandBox://compose.png"}t.shareLink=e,t.shareShot=i,t.share=r}(r=e.Share||(e.Share={})),t.exports=r},"./src/mqq/share/upload.ts":function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r;!function(t){function e(t){try{i(t.path,function(e,i){i&&i.length>0?r(function(e,r){0==e&&r?n(i,r,t):(t.fail&&t.fail({code:-1,msg:"fail to fetch signature"}),t.complete&&t.complete())}):(t.fail&&t.fail({code:-1,msg:"fail to get file data "+t.path}),t.complete&&t.complete())})}catch(e){t.fail&&t.fail({code:-1,msg:JSON.stringify(e)}),t.complete&&t.complete()}}function i(t,e){if(BK.isBrowser){var i="cs.get_file_data.local",r={cmd:i,path:t};e&&BK.SsoRequest.request({data:r,reqCmd:i,respCmd:i,success:function(t){t.code,t.cmd;var i=s(t.data);e(0,i)},fail:function(t){t.code,t.cmd,t.data;e(-1)},complete:function(){}})}else{var n=BK.FileUtil.readFile(t);e(0,n)}}function r(t){var e="cs.fetch_cloud_signature.local",i={cmd:e,now:(new Date).getTime()/1e3-1,delta:600};t&&BK.SsoRequest.request({data:i,reqCmd:e,respCmd:e,success:function(e){var i=e.code,r=(e.cmd,e.data);t(i,r)},fail:function(e){var i=e.code,r=(e.cmd,e.data);t(i,r)},complete:function(){}})}function n(t,e,i){for(var r=t.length>1024?1024:t.length,n=new Uint8Array(r),s=0;s<r/2;s++)n[s]=t.readUint8Buffer();t.jumpBytes(t.length-r);for(s=r/2;s<r;s++)n[s]=t.readUint8Buffer();t.rewind();var h=new Date,c=h.getFullYear().toString()+(h.getMonth()+1<10?"0"+(h.getMonth()+1):""+h.getMonth()+1)+(h.getDate()<10?"0"+h.getDate():""+h.getDate())+(h.getHours()<10?"0"+h.getHours():""+h.getHours())+(h.getMinutes()<10?"0"+h.getMinutes():""+h.getMinutes()),l=e.signTime,u=e.tmpSecretId,d=e.sessionToken,_="/"+GameStatusInfo.gameId+"_"+BK.Crypt.md5ToHexSync({data:a(n)})+"_"+c+".png",f=e.upLoadPrefUrl.replace(new RegExp("http://","gm"),""),g=e.downloadUrl,p=e.signature,m="put\n"+_+"\n\nhost="+f+"&x-cos-storage-class=nearline\n",v="sha1\n"+l+"\n"+BK.Crypt.sha1ToHexSync({data:m})+"\n",S="q-sign-algorithm=sha1&q-ak="+u+"&q-sign-time="+l+"&q-key-time="+l+"&q-header-list=host;x-cos-storage-class&q-url-param-list=&q-signature="+BK.Crypt.hmacSha1ToHexSync({key:p,data:v}),b=new BK.HttpUtil("https://"+f+_,"put");b.setHttpHeader("host",f),b.setHttpHeader("x-cos-storage-class","nearline"),b.setHttpHeader("x-cos-security-token",d),b.setHttpHeader("authorization",S),b.setHttpRawBody(t),b.requestAsync(function(t,e){o(e,g+_,i)})}function o(t,e,i){200==t?(i.success&&i.success({code:0,url:e}),i.complete&&i.complete()):(i.fail&&i.fail({code:-1,msg:"fail to upload"}),i.complete&&i.complete())}function a(t){for(var e=[],i=0;i<t.byteLength;i++)e[i]=t[i];return e}function s(t){var e,i,r,n,o,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=.75*t.length,h=t.length,c=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var l=new ArrayBuffer(s),u=new Uint8Array(l);for(e=0;e<h;e+=4)i=a.indexOf(t[e]),r=a.indexOf(t[e+1]),n=a.indexOf(t[e+2]),o=a.indexOf(t[e+3]),u[c++]=i<<2|r>>4,u[c++]=(15&r)<<4|n>>2,u[c++]=(3&n)<<6|63&o;return u}t.upload=e}(r=e.Upload||(e.Upload={})),t.exports=r},"./src/mqq/sso/sso.ts":function(t,e,i){"use strict";var r=this&&this.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){function e(){var e=t.call(this)||this;return e.seqId=1,e.setCallback(),e}return r(e,t),e.prototype.request=function(t){var e=this;t.respCmd=t.respCmd?t.respCmd:t.reqCmd,null!=t.isListener&&void 0!=t.isListener||(t.isListener=!0);var i=t.reqCmd,r=t.respCmd,n=t.data,o=t.isListener,a=t.success,s=t.fail,h=t.complete;if(!i&&!r)throw new Error("Sso request cmd is required");if(o){var c=this.getEvent(r,n),l=function(t){0==t.code?(a&&a({code:t.code,cmd:t.cmd,data:t.data}),h&&h()):(s&&s({code:t.code,cmd:t.cmd,data:t.data}),h&&h())};return this.once(c,l),BK.MQQ.SsoRequest.send(n,i),{abort:function(){e.off(c,l)}}}return BK.MQQ.SsoRequest.send(n,i),null},e.prototype.getEvent=function(t,e){return e&&0==t.indexOf("apollo")?(e.seqId=this.seqId++,JSON.stringify({cmd:t,seqId:e.seqId})):t},e.prototype.setCallback=function(){var t=this,e=BK.MQQ.SsoRequest.callback;BK.MQQ.SsoRequest.callback=function(i,r,n){t.dispatchEvent(i,r,n),e(i,r,n)}},e.prototype.dispatchEvent=function(t,e,i){i?"number"==typeof i.seqId?this.emit(JSON.stringify({cmd:e,seqId:i.seqId}),{code:t,cmd:e,data:i}):this.emit(e,{code:t,cmd:e,data:i}):this.emit(e,{code:t,cmd:e,null:null})},e}(i("./src/common/emitter.ts"));e.SsoRequest=n,t.exports=new n},"./src/net/http.ts":function(t,e,i){"use strict";var r;!function(t){function e(t){var e=t.url,i=t.method,o=t.headers,a=t.body,s=t.success,h=t.fail,c=t.complete,l=t.uploadProgress,u=t.downloadProgress;if(!e)throw new Error("HTTP request url is required");var d=new r(e,i);if(a&&"string"!=typeof a?d.setHttpRawBody(BK.Misc.arrayBufferToBKBuffer(a)):d.setHttpRawBody(a),o)for(var _ in o)d.setHttpHeader(_,o[_]);d.setHttpUploadProgressListener(l),d.setHttpDownloadProgressListener(u),s||h||c||BK.Script.log(1,1,"[WARNING] send HTTP request without any callback"),d.sendRequest(function(t,e,i){t<0?(h&&h({msg:i.readAsString(!0)}),c&&c()):(s&&s(new n(t,e,i)),c&&c())})}var r=i("./src/deprecate/http-util.ts"),n=function(){function t(t,e,i){this.statusCode=t,this.headers=e,this.body=i}return t.prototype.text=function(){var t=this.body.readAsString(!0);return void 0===t?"":t},t.prototype.jsonObject=function(){var t=this.body.readAsString(!0);return t?JSON.parse(t):null},t.prototype.arrayBuffer=function(){return BK.Misc.BKBufferToArrayBuffer(this.body)},t}();t.request=e}(r||(r={})),t.exports=r},"./src/net/transparent-webview.ts":function(t,e,i){"use strict";function r(t){return new n(t)}var n=function(){function t(t){this.taskId=-1,this.requestOpen(t)}return t.prototype.requestOpen=function(t){if(!t||!t.url)throw Error("Url Must specify!");var e=1;t.transparent,e=t.transparent&&1==t.transparent?1:0;var i=1;t.orientation&&(i=t.orientation);var r={gameOrientation:i,openId:GameStatusInfo.openId,transparent:e,businessType:2};BK.SsoRequest.request({data:r,reqCmd:"cs.openWebView.local",success:function(t){BK.Console.log("requestOpen! success ",t.code,t.cmd,JSON.stringify(t.data)),this.taskId=t.data.taskId}.bind(this),fail:function(t){var e=t.code,i=t.cmd,r=t.data;BK.Console.log("requestOpen! fail",e,i,JSON.stringify(r))},complete:function(){BK.Console.log("requestOpen! complete")}})},t.prototype.onReceiveMsg=function(t){},t.prototype.send=function(t){},t.prototype.open=function(){},t.prototype.close=function(){},t}();t.exports=r},"./src/render/animationSprite.ts":function(t,e,i){"use strict";var r=function(){function t(t){this.paused=!1,this.delayUnits=1/30,this.tmpPlayingIdx=0,this.previousTs=-1,this.playedCount=0,this.currDisplayIdx=0,this.currTexturePath="",this.currDisplaySum=0,this.repeatCount=0,this.stoped=!1,this.size={width:0,height:0},this.readyTextureInfo(t),this.onInit(this.size.width,this.size.height),this.displayFrame(0),this.paused=!0,BK.Director.ticker.add(function(t,e,i){i.update(t,e)},this)}return t.prototype.readyTextureInfo=function(t){var e=this;this.textureInfoArr=[],t.forEach(function(t){t.texturePath&&(t.texture=new BK.Texture(t.texturePath),e.textureInfoArr.push(t),e.size={width:t.frameInfo.sourceSize.w,height:t.frameInfo.sourceSize.h})})},t.prototype.onInit=function(t,e){this.createSprites(t,e);var i=this;Object.getOwnPropertyNames(this.__nativeObj).forEach(function(t){var e=t;Object.defineProperty(i,e,{get:function(){return this.__nativeObj[e]},set:function(t){this.__nativeObj[e]=t}})},this),Object.defineProperty(this,"size",{get:function(){return this.__nativeObj.contentSize},set:function(t){this.__nativeObj.contentSize=t,this.displayFrame(this.currDisplayIdx)}}),Object.defineProperty(this,"anchor",{get:function(){return this.__nativeObj.localAnchor},set:function(t){this.__nativeObj.localAnchor=t,this.displayFrame(this.currDisplayIdx)}})},t.prototype.setTexture=function(t){this.__nativeObj.setTexture(t)},t.prototype.dispose=function(){BK.Director.ticker.remove(this),this.__nativeObj.dispose()},t.prototype.removeChild=function(t){return this.__nativeObj.removeChild(t)},t.prototype.removeChildById=function(t,e){return this.__nativeObj.removeChildById(t,e)},t.prototype.removeChildByName=function(t,e){return this.__nativeObj.removeChildByName(t,e)},t.prototype.removeFromParent=function(){return this.__nativeObj.removeFromParent()},t.prototype.addChild=function(t,e){return this.__nativeObj.addChild(t,e)},t.prototype.hittest=function(t){return this.__nativeObj.hittest(t)},t.prototype.convertToWorldSpace=function(t){return this.__nativeObj.convertToWorldSpace(t)},t.prototype.convertToNodeSpace=function(t){return this.__nativeObj.convertToNodeSpace(t)},t.prototype.createSprites=function(t,e){this.__nativeObj=new BK.SpriteNode(t,e,{},0,1,1,1),this.contentSprite=new BK.SpriteNode(t,e,{},0,1,1,1),this.__nativeObj.addChild(this.contentSprite)},t.prototype.displayFrame=function(t){if(this.textureInfoArr.length>0){var e=this.textureInfoArr[t];if(e){this.currDisplayIdx=t;var i=e.texture,r=e.frameInfo;if(1==e.frameInfo.trimmed){var n=e.frameInfo.spriteSourceSize.x,o=e.frameInfo.spriteSourceSize.y,a=e.frameInfo.spriteSourceSize.w,s=e.frameInfo.spriteSourceSize.h,h=e.frameInfo.sourceSize,c=this.__nativeObj.contentSize;n=c.width*n/h.w,o=c.height*o/h.h,a=c.width*a/h.w,s=c.height*s/h.h,this.contentSprite.position={x:n,y:o},this.contentSprite.contentSize={width:a,height:s}}else this.contentSprite.contentSize=this.__nativeObj.contentSize;this.currTexturePath&&this.currTexturePath==e.texturePath||(BK.Script.log(1,-1,"this.currTexture != tex"),this.currTexturePath=e.texturePath,this.contentSprite.setTexture(i)),this.contentSprite.adjustTexturePosition(r.frame.x,r.frame.y,r.frame.w,r.frame.h,r.rotated)}else BK.Script.log(1,-1,"displayFrame failed! textureInfo is null. index is "+t)}else BK.Script.log(1,-1,"displayFrame failed! textureInfoArr.length is 0")},t.prototype.render=function(){this.tmpPlayingIdx>this.textureInfoArr.length-1&&(this.tmpPlayingIdx=0),this.displayFrame(this.tmpPlayingIdx),this.tmpPlayingIdx++,this.currDisplaySum++,this.updateCallback()},t.prototype.update=function(t,e){0==this.paused&&(this.previousTs<0?(this.previousTs=t,this.render()):t-this.previousTs>1e3*this.delayUnits&&(this.previousTs=t,this.render()))},t.prototype.doPlay=function(t,e){void 0===t&&(t=0),void 0===e&&(e=-1),t>this.textureInfoArr.length-1?this.tmpPlayingIdx=0:this.tmpPlayingIdx=t,this.paused=!1,this.repeatCount=e,this.currDisplaySum=0,this.playedCount=0},t.prototype.doStop=function(t){this.stoped=!0,void 0===t&&(t=-1),this.paused=!0,t>-1&&this.displayFrame(t)},t.prototype.updateCallback=function(){var t=this.textureInfoArr.length;this.currDisplaySum%t==0&&(this.playedCount=parseInt(String(this.currDisplaySum/t)),this.completeCallback&&this.completeCallback(this,this.playedCount),this.repeatCount>0&&this.repeatCount<=this.playedCount&&(this.endCallback&&this.endCallback(this,this.playedCount),this.stop()))},t.prototype.setCompleteCallback=function(t){this.completeCallback=function(e,i){t({animationSprite:e,count:i})}},t.prototype.setEndCallback=function(t){this.endCallback=function(e,i){t({animationSprite:e,count:i})}},t.prototype.play=function(t){t?this.doPlay(t.beginFrameIndex,t.repeatCount):this.doPlay()},t.prototype.stop=function(t){this.doStop(t)},t.prototype.setPosition=function(t){if(!t)throw new Error("position can not be undefined!");if("number"!=typeof t.x)throw new Error("position.x must be a number!");if("number"!=typeof t.y)throw new Error("position.y must be a number!");this.position=t},t.prototype.setSize=function(t){if(!t)throw new Error("size can not be undefined!");if("number"!=typeof t.width)throw new Error("size.width must be a number!");if("number"!=typeof t.height)throw new Error("size.height must be a number!");this.size=t},t.prototype.setAnchor=function(t){if(!t)throw new Error("anchor can not be undefined!");if("number"!=typeof t.x)throw new Error("anchor.x must be a number!");if("number"!=typeof t.y)throw new Error("anchor.y must be a number!");this.anchor=t},t.prototype.setFrameDuration=function(t){if("number"!=typeof t)throw new Error("duration must be a number!");this.delayUnits=t},t.prototype.pause=function(){this.paused=!0},t.prototype.resume=function(){this.stoped?BK.Script.log(1,1,"animationSprite is stopped,can't continue!"):this.paused=!1},t}();t.exports=r},"./src/render/image.ts":function(t,e,i){"use strict";BK.ImageNativeClass=BK.Image;var r=function(){function t(){}return t.dispose=function(t){return BK.ImageNativeClass.dispose(t)},t.saveImage=function(t,e,i,r,n,o){return t instanceof ArrayBuffer?t=BK.Misc.arrayBufferToBKBuffer(t):t instanceof Object&&void 0===e&&(e=t.width,i=t.height,r=t.path,n=t.ext,o=t.isFlipY?t.isFlipY:0),BK.ImageNativeClass.saveImage(t,e,i,r,n,o)},t.loadImageWithBase64=function(t){if(!t)return BK.Script.log(1,0,"buffer is empty"),null;t.buffer&&(t=t.buffer),t instanceof ArrayBuffer&&(t=BK.Misc.arrayBufferToBKBuffer(t));var e=BK.Misc.decodeBase64FromString(t.readAsString());return BK.ImageNativeClass.loadImage(e)},t.loadImage=function(t,e){if(t)return t.image&&(e=t.format?t.format:void 0),t instanceof ArrayBuffer&&(t=BK.Misc.arrayBufferToBKBuffer(t)),e?BK.ImageNativeClass.loadImage(t,e):BK.ImageNativeClass.loadImage(t);BK.Script.log(1,1,"BK.Image.loadImage failed! ")},t.loadImages=function(t){if(!t)return BK.Script.log(1,1,"object.file is null"),t.fail&&t.fail({errmsg:"object.file is null"}),void(t.complete&&t.complete());if(0==BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.8.0"))if(t&&t.file){for(var e=new Array,i=0;i<t.file.length;i++)t.file[i].path&&e.push({tag:3,path:t.file[i].path,format:t.file[i].format?t.file[i].format:6});var r=BK.ImageNativeClass.loadImageAsync(e);BK.taskManager.pushTask(r,e,function(e){t.success&&t.success(e),t.complete&&t.complete()})}else t.fail&&t.fail({errmsg:"object.file is null"}),t.complete&&t.complete();else{var n=[];if(t&&t.file)for(i=0;i<t.file.length;i++){var o=t.file[i];if(o.path){var a=BK.ImageNativeClass.loadImage(o.path,t.file[i].format?t.file[i].format:6);n.push({errcode:a?0:-1,errmsg:a?"":"load image failed!",path:o.path,image:a})}}t.success&&t.success(n),t.complete&&t.complete()}},t}();t.exports=r},"./src/render/spriteNine.ts":function(t,e,i){"use strict";var r=function(){function t(t){if(!t)throw Error("initParam can not be undefined!");if(!t.texture)throw Error("initParam.texture can not be undefined!");var e=t.textureWidth,i=t.textureHeight,r=t.texture,n=t.grid,o=t.offset,a=t.rotated;this._size={width:0,height:0},this.__nativeObj=new BK.Node,this.onInit(),i||(i=r.size.height),e||(e=r.size.width),n?this._grid=n:(this._grid={left:0,top:0,right:0,bottom:0},n=this._grid),o||(o={x:0,y:0}),this._size={width:i,height:i},this._leftTop=new BK.Sprite(n.left,n.top,r,0,1,1,1),this._leftTop.position={x:0,y:i-n.top},this._leftTop.zOrder=99999,this._leftTop.name="_leftTop",this.__nativeObj.addChild(this._leftTop),this._centerTop=new BK.Sprite(e-n.left-n.right,n.top,r,0,1,1,1),this._centerTop.position={x:n.left,y:i-n.top},this._centerTop.zOrder=99999,this._centerTop.name="_centerTop",this.__nativeObj.addChild(this._centerTop),this._rightTop=new BK.Sprite(n.right,n.top,r,0,1,1,1),this._rightTop.position={x:e-n.right,y:i-n.top},this._rightTop.zOrder=99999,this._rightTop.name="_rightTop",this.__nativeObj.addChild(this._rightTop),this._leftCenter=new BK.Sprite(n.left,i-n.top-n.bottom,r,0,1,1,1),this._leftCenter.position={x:0,y:n.bottom},this._leftCenter.name="_leftCenter",this.__nativeObj.addChild(this._leftCenter),this._centerCenter=new BK.Sprite(e-n.left-n.right,i-n.top-n.bottom,r,0,1,1,1),this._centerCenter.position={x:n.left,y:n.bottom},this._centerCenter.name="_centerCenter",this.__nativeObj.addChild(this._centerCenter),this._rightCenter=new BK.Sprite(n.right,i-n.bottom-n.top,r,0,1,1,1),this._rightCenter.position={x:e-n.right,y:n.bottom},this._rightCenter.name="_rightCenter",this.__nativeObj.addChild(this._rightCenter),this._leftBottom=new BK.Sprite(n.left,n.bottom,r,0,1,1,1),this._leftBottom.position={x:0,y:0},this._leftBottom.name="_leftBottom",this.__nativeObj.addChild(this._leftBottom),this._centerBottom=new BK.Sprite(e-n.left-n.right,n.bottom,r,0,1,1,1),this._centerBottom.position={x:n.left,y:0},this._centerBottom.name="_centerBottom",this.__nativeObj.addChild(this._centerBottom),this._rightBottom=new BK.Sprite(n.right,n.bottom,r,0,1,1,1),this._rightBottom.position={x:e-n.right,y:0},this._rightBottom.name="_rightBottom",this.__nativeObj.addChild(this._rightBottom),1==a?(this._leftTop.adjustTexturePosition(o.x+(i-n.top),o.y+(e-n.left),n.left,n.top,a),this._centerTop.adjustTexturePosition(o.x+(i-n.top),o.y+n.right,e-n.left-n.right,n.top,a),this._rightTop.adjustTexturePosition(o.x+(i-n.top),o.y,n.right,n.top,a),this._leftCenter.adjustTexturePosition(o.x+n.bottom,o.y+(e-n.left),n.left,i-n.top-n.bottom,a),this._centerCenter.adjustTexturePosition(o.x+n.bottom,o.y+n.right,e-n.left-n.right,i-n.top-n.bottom,a),this._rightCenter.adjustTexturePosition(o.x+n.bottom,o.y,n.right,i-n.bottom-n.top,a),this._leftBottom.adjustTexturePosition(o.x,o.y+(e-n.left),n.left,n.bottom,a),this._centerBottom.adjustTexturePosition(o.x,o.y+n.right,e-n.left-n.right,n.bottom,a),this._rightBottom.adjustTexturePosition(o.x,o.y,n.right,n.bottom,a)):(this._leftTop.adjustTexturePosition(0+o.x,i-n.top+o.y,n.left,n.top),this._centerTop.adjustTexturePosition(n.left+o.x,i-n.top+o.y,e-n.left-n.right,n.top),this._rightTop.adjustTexturePosition(e-n.right+o.x,i-n.top+o.y,n.right,n.top),this._leftCenter.adjustTexturePosition(0+o.x,n.bottom+o.y,n.left,i-n.top-n.bottom),this._centerCenter.adjustTexturePosition(n.left+o.x,n.bottom+o.y,e-n.left-n.right,i-n.top-n.bottom),this._rightCenter.adjustTexturePosition(e-n.right+o.x,n.bottom+o.y,n.right,i-n.bottom-n.top),this._leftBottom.adjustTexturePosition(0+o.x,0+o.y,n.left,n.bottom),this._centerBottom.adjustTexturePosition(n.left+o.x,0+o.y,e-n.left-n.right,n.bottom),this._rightBottom.adjustTexturePosition(e-n.right+o.x,0+o.y,n.right,n.bottom))}return t.prototype.onInit=function(){var t=this;Object.getOwnPropertyNames(this.__nativeObj).forEach(function(e){var i=e;"size"!=i&&Object.defineProperty(t,i,{get:function(){return this.__nativeObj[i]},set:function(t){this.__nativeObj[i]=t}})},this)},t.prototype.pos=function(t,e){this.__nativeObj.position={x:t,y:e}},t.prototype.dispose=function(){this.__nativeObj.dispose()},t.prototype.attachBody=function(t){this.__nativeObj.attachComponent(t)},t.prototype.addChild=function(t){this.__nativeObj.addChild(t)},t.prototype.removeChildById=function(t,e){return this.__nativeObj.removeChildById(t,e)},t.prototype.removeChildByName=function(t,e){return this.__nativeObj.removeChildByName(t,e)},t.prototype.removeFromParent=function(){return this.__nativeObj.removeFromParent()},t.prototype.hittest=function(t){return this.__nativeObj.hittest(t)},t.prototype.setSize=function(t){if(!t)throw Error("size can not be undefined!");if("number"!=typeof t.width)throw Error("size.width must be a number!");if("number"!=typeof t.height)throw Error("size.height must be a number!");this.size=t},t.prototype.setPosition=function(t){if(!t)throw Error("position can not be undefined!");if("number"!=typeof t.x)throw Error("position.x must be a number!");if("number"!=typeof t.y)throw Error("position.y must be a number!");this.position=t},t}();Object.defineProperty(r.prototype,"alpha",{get:function(){return this._rightBottom.vertexColor.a},set:function(t){this._leftTop.vertexColor={r:1,g:1,b:1,a:t},this._centerTop.vertexColor={r:1,g:1,b:1,a:t},this._rightTop.vertexColor={r:1,g:1,b:1,a:t},this._leftCenter.vertexColor={r:1,g:1,b:1,a:t},this._centerCenter.vertexColor={r:1,g:1,b:1,a:t},this._rightCenter.vertexColor={r:1,g:1,b:1,a:t},this._leftBottom.vertexColor={r:1,g:1,b:1,a:t},this._centerBottom.vertexColor={r:1,g:1,b:1,a:t},this._rightBottom.vertexColor={r:1,g:1,b:1,a:t}},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"size",{get:function(){return this._size},set:function(t){this._size=t;var e=t.width-this._grid.left-this._grid.right,i=t.height-this._grid.top-this._grid.bottom;this._leftTop.position={x:0,y:t.height-this._grid.top},this._leftCenter.size={width:this._grid.left,height:i},this._leftCenter.position={x:0,y:this._grid.bottom},this._rightCenter.size={width:this._grid.right,height:i},this._rightCenter.position={x:t.width-this._grid.right,y:this._grid.bottom},this._centerCenter.size={width:e,height:i},this._centerTop.size={width:e,height:this._grid.top},this._centerTop.position={x:this._grid.left,y:t.height-this._grid.top},this._centerBottom.size={width:e,height:this._grid.bottom},this._centerBottom.position={x:this._grid.left,y:0},this._rightCenter.size={width:this._grid.right,height:i},this._rightCenter.position={x:t.width-this._grid.right,y:this._grid.bottom},this._rightBottom.position={x:t.width-this._grid.right,y:0},this._rightTop.position={x:t.width-this._grid.right,y:t.height-this._grid.top}},enumerable:!0,configurable:!0}),t.exports=r},"./src/render/spriteSet.ts":function(t,e,i){"use strict";var r=function(){function t(t){if(this.flipU=0,this.flipV=1,this.stretchX=1,this.stretchY=1,this.size={width:0,height:0},this.currTexturePath="",!t)throw Error("initParam can not be undefined!");if(!t.textureInfo)throw Error("initParam.textureInfo can not be undefined!");t.flipU&&(this.flipU=t.flipU),t.flipV&&(this.flipV=t.flipV),t.stretchX&&(this.stretchX=t.stretchX),t.stretchY&&(this.stretchY=t.stretchY),t.width&&(this.size.width=t.width),t.height&&(this.size.height=t.height),this.textureInfo=t.textureInfo,this.onInit(this.size.width,this.size.height),this.adjustWithTextureInfo(t.textureInfo)}return t.prototype.onInit=function(t,e){this.createSprites({width:t,height:e});var i=this;Object.getOwnPropertyNames(this.__nativeObj).forEach(function(t){var e=t;Object.defineProperty(i,e,{get:function(){return this.__nativeObj[e]},set:function(t){this.__nativeObj[e]=t}})},this),Object.defineProperty(this,"size",{get:function(){return this.__nativeObj.contentSize},set:function(t){this.__nativeObj.contentSize=t,this.updateSize(this.textureInfo)}}),Object.defineProperty(this,"anchor",{get:function(){return this.__nativeObj.localAnchor},set:function(t){this.__nativeObj.localAnchor=t}})},t.prototype.updateSize=function(t){if(1==t.frameInfo.trimmed){var e=t.frameInfo.spriteSourceSize.x,i=t.frameInfo.spriteSourceSize.y,r=t.frameInfo.spriteSourceSize.w,n=t.frameInfo.spriteSourceSize.h,o=t.frameInfo.sourceSize,a=this.__nativeObj.contentSize;e=a.width*e/o.w,i=a.height*i/o.h,r=a.width*r/o.w,n=a.height*n/o.h,this.contentSprite.position={x:e,y:i},this.contentSprite.contentSize={width:r,height:n}}else this.contentSprite.contentSize=this.__nativeObj.contentSize},t.prototype.adjustWithTextureInfo=function(t){if(t){this.textureInfo=t;var e=t.texture,i=t.frameInfo;this.updateSize(t),this.currTexturePath=t.texturePath,e=new BK.Texture(this.currTexturePath),this.contentSprite.setTexture(e),this.contentSprite.adjustTexturePosition(i.frame.x,i.frame.y,i.frame.w,i.frame.h,i.rotated)}},t.prototype.setTexture=function(t){this.__nativeObj.setTexture(t)},t.prototype.dispose=function(){BK.Director.ticker.remove(this),this.__nativeObj.dispose()},t.prototype.removeChild=function(t){return this.__nativeObj.removeChild(t)},t.prototype.removeChildById=function(t,e){return this.__nativeObj.removeChildById(t,e)},t.prototype.removeChildByName=function(t,e){return this.__nativeObj.removeChildByName(t,e)},t.prototype.removeFromParent=function(){return this.__nativeObj.removeFromParent()},t.prototype.addChild=function(t,e){return this.__nativeObj.addChild(t,e)},t.prototype.hittest=function(t){return this.__nativeObj.hittest(t)},t.prototype.convertToWorldSpace=function(t){return this.__nativeObj.convertToWorldSpace(t)},t.prototype.convertToNodeSpace=function(t){return this.__nativeObj.convertToNodeSpace(t)},t.prototype.createSprites=function(t){if(!t)throw Error("size can not be undefined!");if("number"!=typeof t.width)throw Error("size.width must be a number!");if("number"!=typeof t.height)throw Error("size.height must be a number!");this.__nativeObj=new BK.SpriteNode(t.width,t.height,{},this.flipU,this.flipV,this.stretchX,this.stretchY),this.contentSprite=new BK.SpriteNode(t.width,t.height,{},this.flipU,this.flipV,this.stretchX,this.stretchY),this.__nativeObj.addChild(this.contentSprite)},t}();t.exports=r},"./src/render/spriteSetCache.ts":function(t,e,i){"use strict";var r;!function(t){t[t.mirrorRepeat=0]="mirrorRepeat",t[t.repeatToEdge=1]="repeatToEdge",t[t.selfRepeat=2]="selfRepeat"}(r||(r={}));var n=function(){function t(){this.fullWidth=0,this.fullHeight=0,this.sheets={},this.jsonConfigs={}}return t.prototype.getFrameInfoByFilename=function(t){for(var e in this.jsonConfigs)if(this.jsonConfigs.hasOwnProperty(e)){var i=this.jsonConfigs[e],r=(this.sheets[e],i.frames),n=i.meta;this.fullWidth=n.size.w,this.fullHeight=n.size.h;for(var o=0;o<r.length;o++){var a=r[o];if(t==a.filename){var s={x:0,y:1,width:0,height:0},h=a.rotated,c=a.trimmed,l=a.spriteSourceSize,u=a.sourceSize;return h?(s.x=a.frame.x,s.y=this.fullHeight-a.frame.y-a.frame.w,s.width=a.frame.w,s.height=a.frame.h):(s.x=a.frame.x,s.y=this.fullHeight-a.frame.y-a.frame.h,s.width=a.frame.w,s.height=a.frame.h),l.y=u.h-l.y-l.h,u.width=u.w,u.height=u.h,l.width=l.w,l.height=l.h,{filename:t,frame:s,rotated:h,trimmed:c,spriteSourceSize:l,sourceSize:u}}}}return null},t.prototype.getTexturePathByFilename=function(t){for(var e in this.jsonConfigs)if(this.jsonConfigs.hasOwnProperty(e))for(var i=this.jsonConfigs[e].frames,r=0;r<i.length;r++)if(i[r].filename==t)return e;return null},t.prototype.getTextureByFilename=function(t){var e=this.getFrameInfoByFilename(t),i=this.getTexturePathByFilename(t);return e&&i?new BK.Texture(i):(BK.Script.log(0,0,"getTexture Failed.Please check path"),null)},t.prototype.getTextureInfoByFilename=function(t){var e=this.getFrameInfoByFilename(t),i=this.getTexturePathByFilename(t);return e&&i?{frameInfo:e,texturePath:i,texture:this.getTextureByFilename(t)}:null},t.prototype.loadSet=function(t){if(!t)throw Error("loadSetParam can not be undefined!");var e=t.jsonPath,i=t.texturePath,r=t.format,n=t.minFilter,o=t.magFilter,a=t.uWrap,s=t.vWrap,h=BK.FileUtil.readFile(e).readAsString();if(h){var c=JSON.parse(h);void 0===i&&(i=e.replace(/.json$/,".png")),this.jsonConfigs[i]=c,void 0===r&&(r=4),r=4,void 0===n&&(n=1),void 0===o&&(o=1),void 0===a&&(a=1),void 0===s&&(s=1);var l=new BK.Texture(i,r,n,o,a,s);this.sheets[i]=l}else BK.Script.log(0,0,"loadSheet Failed.Please check path")},t.prototype.removeSet=function(t){if(this.jsonConfigs[t])for(var e in this.jsonConfigs)if(this.jsonConfigs.hasOwnProperty(e)){i=this.jsonConfigs[e];e==t&&(delete this.jsonConfigs[t],BK.Script.log(0,0,"Delete jsonConfigs key:"+e+" val:"+i))}if(this.sheets[t])for(var e in this.sheets)if(this.sheets.hasOwnProperty(e)){var i=this.sheets[e];e==t&&(delete this.sheets[t],BK.Script.log(0,0,"Delete sheets key:"+e+" val:"+i))}},t.prototype.getSprite=function(t){if(!t)throw Error("spriteInfo can not be undefined!");var e=t.filename,i=t.width,r=t.height,n=this.getTextureInfoByFilename(e);if(n){var o=n.frameInfo,a=n.texturePath,s=new BK.Texture(a);if(i||(i=o.frame.width),r||(r=o.frame.height),BK.Script.log(0,0,"getSprite texture:"+s+" width:"+i+" height:"+r),o.trimmed)return h=new BK.SpriteSet({textureInfo:n,width:i,height:r});var h=new BK.Sprite(i,r,s,0,1,1,1);return h.adjustTexturePosition(o.frame.x,o.frame.y,o.frame.width,o.frame.height,o.rotated),h}return null},t.prototype.createSpriteSet=function(t){if(!t)throw Error("spriteInfo can not be undefined!");var e=t.filename,i=t.width,r=t.height,n=this.getTextureInfoByFilename(e);if(n){var o=n.frameInfo,a=n.texturePath,s=new BK.Texture(a);return i||(i=o.frame.width),r||(r=o.frame.height),BK.Script.log(0,0,"SheetSprite texture:"+s+" width:"+i+" height:"+r),new BK.SpriteSet({textureInfo:n,width:i,height:r})}return null},t}();BK&&(BK.RepeatMode=r),t.exports=new n},"./src/render/texture.ts":function(t,e,i){"use strict";BK.Texture.createTextures=function(t){if(!t)return BK.Script.log(1,1,"object.file is null"),t.fail&&t.fail({errmsg:"object.file is null"}),void(t.complete&&t.complete());if(t&&t.file){for(var e=[],i=0;i<t.file.length;i++)t.file[i].path&&e.push({path:t.file[i].path,format:t.file[i].format?t.file[i].format:6});BK.Image.loadImages({file:e,success:function(e){for(var i=0;i<e.length;i++)if(0==e[i].errcode){var r=e[i].image,n=null;(n=0==BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.8.0")?BK.Texture.createBitmapTexture(r.width,r.height,r.format,e[i].path):BK.Texture.createBitmapTexture(r.width,r.height,r.format))?(n.uploadData(r.buffer),e[i].texture=n):(e[i].errcode=-2,e[i].errmsg="createTexture null, failed"),delete e[i].image}else e[i].errcode=-3,e[i].errmsg="createImage null, failed";t.success&&t.success(e),t.complete&&t.complete()},fail:function(e){t.fail&&t.fail(e),t.complete&&t.complete()}})}else t.fail&&t.fail({errmsg:"object.file is null"}),t.complete&&t.complete()},t.exports=BK.Texture},"./src/task/TaskManager.ts":function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.taskQ=[],this.initTaskObserver()}return t.prototype.initTaskObserver=function(){0==BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.8.0")&&BK.Director.ticker.add(function(){for(var t=BK.TaskManager.getCompleteQueue();t.length>0;)for(var e=t.shift(),i=0;i<this.taskQ.length;i++){var r=this.taskQ[i];if(r.taskId==e.id){this.taskQ.splice(i,1);var n=e.res.length;if(n!==r.taskInfo.length)BK.Console.error("task not complete");else for(var o=0;o<n;o++)e.res[o].encoding=r.taskInfo[n-1-o].encoding;r.callback(e.res);break}}}.bind(this))},t.prototype.pushTask=function(t,e,i){-1!=t&&this.taskQ.push({taskId:t,taskInfo:e,callback:i})},t.prototype.cancelTask=function(t){-1!=t&&0==BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.8.0")&&BK.TaskManager.cancelTask(t)},t}();e.TaskManager=r,t.exports=r},"./src/ui/dialog.ts":function(t,e,i){"use strict";var r;!function(t){var e=function(){function t(){}return t.show=function(t){if(t&&t.complete){var e="sc.xy_toast_show_complete.local";BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,function(e,i,r){t.complete()})}else BK.MQQ.SsoRequest.removeListener("sc.xy_toast_show_complete.local",this);BK.MQQ.dialog.show("toast",JSON.stringify(t))},t.hide=function(t){if(t&&t.complete){var e="sc.xy_toast_hide_complete.local";BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,function(e,i,r){t.complete()})}else BK.MQQ.SsoRequest.removeListener("sc.xy_toast_hide_complete.local",this);BK.MQQ.dialog.hide("toast")},t}();t.toast=e;var i=function(){function t(){}return t.show=function(t){if(t&&t.complete){var e="sc.xy_loading_show_complete.local";BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,function(e,i,r){t.complete()})}else BK.MQQ.SsoRequest.removeListener("sc.xy_loading_show_complete.local",this);BK.MQQ.dialog.show("loading",JSON.stringify(t))},t.hide=function(t){if(t&&t.complete){var e="sc.xy_loading_hide_complete.local";BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,function(e,i,r){t.complete()})}else BK.MQQ.SsoRequest.removeListener("sc.xy_loading_hide_complete.local",this);BK.MQQ.dialog.hide("loading")},t}();t.loading=i;var r=function(){function t(){}return t.show=function(t){if(t&&t.success){e="sc.xy_alert_show_success.local";BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,function(e,i,r){t.success(r)})}else BK.MQQ.SsoRequest.removeListener("sc.xy_alert_show_success.local",this);if(t&&t.complete){var e="sc.xy_alert_show_complete.local";BK.MQQ.SsoRequest.removeListener(e,this),BK.MQQ.SsoRequest.addListener(e,this,function(e,i,r){t.complete()})}else BK.MQQ.SsoRequest.removeListener("sc.xy_alert_show_complete.local",this);BK.MQQ.dialog.show("alert",JSON.stringify(t))},t}();t.alert=r}(r||(r={})),t.exports=r},"./src/ui/ui.ts":function(t,e,i){"use strict";var r;!function(t){function e(t){if(!t)throw new Error("listener can't be undefined!");p.on(m.keyboardInput,t)}function r(t){if(!t)throw new Error("listener can't be undefined!");p.off(m.keyboardInput,t)}function n(t){if(!t)throw new Error("listener can't be undefined!");p.on(m.keyboardConfirm,t)}function o(t){if(!t)throw new Error("listener can't be undefined!");p.off(m.keyboardConfirm,t)}function a(t){p.emit(m.keyboardConfirm,{text:t})}function s(t){p.emit(m.keyboardInput,{text:t})}function h(t){t&&t.defaultText&&BK.Editor.setText(t.defaultText+""),BK.Editor.showKeyBoard(a,s),t&&t.complete&&t.complete()}function c(t){BK.Editor.hideKeyBoard(),t&&t.complete&&t.complete()}function l(t){t&&(t.text?BK.Editor.setText(t.text+""):BK.Editor.setText(""),t.complete&&t.complete())}function u(t){v.toast.show(t)}function d(t){v.toast.hide(t)}function _(t){v.loading.show(t)}function f(t){v.loading.hide(t)}function g(t){v.alert.show(t)}var p=new(i("./src/common/emitter.ts")),m={keyboardInput:"keyboardInput",keyboardConfirm:"keyboardConfirm"},v=i("./src/ui/dialog.ts");t.onKeyboardInput=e,t.offKeyboardInput=r,t.onKeyboardConfirm=n,t.offKeyboardConfirm=o,t.showKeyboard=h,t.hideKeyboard=c,t.updateKeyboard=l,t.showToast=u,t.hideToast=d,t.showLoading=_,t.hideLoading=f,t.showAlert=g}(r||(r={})),t.exports=r},"./src/util/console.ts":function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r;!function(t){function e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];a(1,0,t)}function i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];a(0,0,t)}function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];a(1,-1,t)}function n(t){h[t]=BK.Time.timestamp}function o(t){e(t,":",1e3*(BK.Time.timestamp-h[t]),"ms"),delete h[t]}function a(t,e,i){for(var r="",n=0,o=i;n<o.length;n++){var a=o[n];-1!=r.indexOf("%d")&&"number"==typeof a?r=r.replace("%d",a.toString()):-1!=r.indexOf("%s")&&"string"==typeof a?r=r.replace("%s",a):-1!=r.indexOf("%o")&&"object"==typeof a?r=r.replace("%o",JSON.stringify(a)):"object"==typeof a?r=r+JSON.stringify(a)+" ":void 0==a?r+="undefined ":r=r+a.toString()+" "}if(r.length>s)for(var h=0;h<=r.length/s;h++)BK.Script.log(t,e,r.slice(h*s,(h+1)*s));else BK.Script.log(t,e,r)}var s=2048,h={};t.log=e,t.debug=i,t.error=r,t.time=n,t.timeEnd=o}(r=e.Console||(e.Console={})),t.exports=r},"./webpack/pack.ts":function(t,e,i){BK.isBrowser;if(!BK.isBrowser){BK.Console=i("./src/util/console.ts"),BK.SsoRequest=i("./src/mqq/sso/sso.ts"),BK.HttpUtil=i("./src/deprecate/http-util.ts"),BK.Http=i("./src/net/http.ts"),BK.UI=i("./src/ui/ui.ts");var r=i("./src/basics/lifecycle/lifecycle.ts");if(BK.onEnterForeground=r.onEnterForeground,BK.onEnterBackground=r.onEnterBackground,BK.onMaximize=r.onMaximize,BK.onMinimize=r.onMinimize,BK.onGameClose=r.onGameClose,BK.onNetworkChange=r.onNetworkChange,BK.onGameShare=r.onGameShare,BK.onGameShareComplete=r.onGameShareComplete,BK.offEnterForeground=r.offEnterForeground,BK.offEnterBackground=r.offEnterBackground,BK.offMaximize=r.offMaximize,BK.offMinimize=r.offMinimize,BK.offGameClose=r.offGameClose,BK.offNetworkChange=r.offNetworkChange,BK.offGameShare=r.offGameShare,BK.offGameShareComplete=r.offGameShareComplete,BK.Crypt=i("./src/common/crypt.ts"),0==BK.Misc.qqVerLessthan(GameStatusInfo.QQVer,"7.8.0")){var n=i("./src/gme/audio.ts")();BK.createAudioContext=n.AudioFactory.createAudioContext,BK.Audio=n.Audio2,BK.AudioManager=n.AudioManager,BK.onAudioInterruptionStart=n.AudioManager.onAudioInterruptionStart,BK.onAudioInterruptionEnd=n.AudioManager.onAudioInterruptionEnd}BK.Share=i("./src/mqq/share/share.ts"),BK.Upload=i("./src/mqq/share/upload.ts"),BK.Screenshot=i("./src/mqq/share/screenshot.ts"),BK.Device=i("./src/basics/device/device.ts");var o=i("./src/task/TaskManager.ts");BK.taskManager=new o;var a=i("./src/fileSystem/FileSystem.ts");BK.fileSystem=new a,BK.QRCode=i("./src/common/qrcode.ts");var s=i("./src/basics/storage/Storage.ts");BK.localStorage=s.localStorage,BK.sessionStorage=s.sessionStorage,BK.storageEventListener=i("./src/basics/Storage/StorageEventListener.ts"),BK.AnimationSprite=i("./src/render/animationSprite.ts"),BK.SpriteSet=i("./src/render/spriteSet.ts"),BK.SpriteSetCache=i("./src/render/spriteSetCache.ts"),BK.SpriteNine=i("./src/render/spriteNine.ts"),BK.loadSubpackage=i("./src/basics/subpackage/subpackage.ts"),BK.Texture=i("./src/render/texture.ts"),BK.Image=i("./src/render/image.ts"),BK.createWebView=i("./src/net/transparent-webview.ts")}var h=i("./src/mqq/advertisement/advertisement.ts");BK.Advertisement.createBannerAd=h.createBannerAd,BK.Advertisement.createVideoAd=h.createVideoAd,BK.getSystemInfoSync=i("./src/basics/system/system.ts").getSystemInfoSync}});