text: !function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";function n(){var t=new r("#game");t.run()}var r=i(33);document.addEventListener("DOMContentLoaded",n,!1)},function(t,e,i){function n(t){return 0==(t&t-1)}function r(t){--t;for(var e=1;32>e;e<<=1)t|=t>>e;return t+1}var s=i(3);Texture2D=s.extend({create:function(t,e,i){this.graphicsDevice=t,this.texture=t.createTexture(),this.width=e,this.height=i,this.data=null,Object.defineProperty(this,"isReady",{get:function(){return void 0!=this.data}})},setData:function(t){var e=this.graphicsDevice.gl;if(this.data=t,e.bindTexture(e.TEXTURE_2D,this.texture),t?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,this.width,this.height,0,e.RGBA,e.UNSIGNED_BYTE,null),this.data instanceof Image){if(this.width=this.data.width,this.height=this.data.height,!n(this.width)||!n(this.height)){var i=document.createElement("canvas");i.width=r(this.width),i.height=r(this.height);var s=i.getContext("2d");s.drawImage(this.data,0,0,this.width,this.height),this.data=i,this.width=this.data.width,this.height=this.data.height,e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.data)}e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}n(this.width)&&n(this.height)?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.generateMipmap(e.TEXTURE_2D)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),e.bindTexture(e.TEXTURE_2D,null)},bind:function(t){var e=this.graphicsDevice.gl;e.activeTexture(e.TEXTURE0+(t||0)),e.bindTexture(e.TEXTURE_2D,this.texture)}}),t.exports=Texture2D},function(t,e,i){(function(t,n){var r=i(14).nextTick,s=Array.prototype.slice,a={},o=0;"undefined"!=typeof setTimeout&&(e.setTimeout=function(){return setTimeout.apply(window,arguments)}),"undefined"!=typeof clearTimeout&&(e.clearTimeout=function(){clearTimeout.apply(window,arguments)}),"undefined"!=typeof setInterval&&(e.setInterval=function(){return setInterval.apply(window,arguments)}),"undefined"!=typeof clearInterval&&(e.clearInterval=function(){clearInterval.apply(window,arguments)}),e.enroll=function(t,e){t._timeoutID=setTimeout(t._onTimeout,e)},e.unenroll=function(t){clearTimeout(t._timeoutID)},e.active=function(){},e.setImmediate="function"==typeof t?t:function(t){var i=o++,n=arguments.length<2?!1:s.call(arguments,1);return a[i]=!0,r(function(){a[i]&&(n?t.apply(null,n):t.call(null),e.clearImmediate(i))}),i},e.clearImmediate="function"==typeof n?n:function(t){delete a[t]}}).call(e,i(2).setImmediate,i(2).clearImmediate)},function(t){var e=!1,i=/\bbase\b/,n=function(){};n.extend=function(t){function n(){e||this.create&&this.create.apply(this,arguments)}var r=this.prototype;e=!0;var s=new this;e=!1;for(var a in t){var o=Object.getOwnPropertyDescriptor(t,a);o.get||o.set?Object.defineProperty(s,a,o):s[a]="function"==typeof t[a]&&"function"==typeof r[a]&&i.test(t[a])?function(t,e){return function(){var i=this.base;this.base=r[t],this._fn=e;var n=this._fn.apply(this,arguments);return this.base=i,n}}(a,t[a]):t[a]}return n.prototype=s,n.prototype.constructor=s.create,n.extend=this.extend,n},t.exports=n},function(t,e,i){var n=i(12),r={OPAQUE:[n.ONE,n.ZERO],ADDITIVE:[n.SRC_ALPHA,n.ONE],ALPHA_BLEND:[n.ONE,n.ONE_MINUS_SRC_ALPHA],NON_PREMULTIPLED:[n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA]};t.exports=r},function(t){var e=function(t,e,i){var n=t.gl;this.graphicsDevice=t,this.buffer=n.createBuffer(),this.chunkSize=e,this.usage=i||n.DYNAMIC_DRAW,this.stride=0,this.startIndex=0,this.data=null,Object.defineProperty(this,"vertexCount",{get:function(){return this.data?this.data.length/this.chunkSize:0}})};e.prototype={constructor:e,setData:function(t){var e=this.graphicsDevice.gl;this.data=t,e.bindBuffer(e.ARRAY_BUFFER,this.buffer),e.bufferData(e.ARRAY_BUFFER,this.data,this.usage)},getData:function(){return this.data}},t.exports=e},function(t,e){if(!i)var i=1e-6;if(!n)var n="undefined"!=typeof Float32Array?Float32Array:Array;if(!r)var r=Math.random;var s={};s.setMatrixArrayType=function(t){n=t},e.glMatrix=s,e.GLMAT_ARRAY_TYPE=n;var a=Math.PI/180;s.toRadian=function(t){return t*a}},function(t,e,i){var n=i(3),r=i(23),s=n.extend({create:function(t,e,i){this.graphicsDevice=t;var n=t.gl;a||(i="#define FRAGMENT\n"+e,e="#define VERTEX\n"+e);var s=t.createShader(e,n.VERTEX_SHADER),a=t.createShader(i,n.FRAGMENT_SHADER);this.program=t.createProgram(s,a),n.deleteShader(s),n.deleteShader(a),this._attributes=t.getAttributes(this.program),this._uniforms=t.getUniforms(this.program),this.parameters={},this.samplers=[];for(var o in this._uniforms)if(this._uniforms.hasOwnProperty(o)){var h=this._uniforms[o];this.parameters[o]=new r(this,o,h,r.TYPE_UNIFORM)}for(var o in this._attributes)if(this._attributes.hasOwnProperty(o)){var c=this._attributes[o];this.parameters[o]=new r(this,o,c,r.TYPE_ATTRIBUTE)}},getAttributeLocation:function(t){return this._attributes[t].location},destroy:function(){if(this.graphicsDevice.gl&&this.program){var t=this.graphicsDevice.gl;t.deleteProgram(this.program)}},apply:function(){this.graphicsDevice.useEffect(this)},reset:function(){for(var t in this.parameters)if(this.parameters.hasOwnProperty(t)){var e=this.parameters[t];e.valuse=null}}});t.exports=s},function(t){var e=function(t,e){var i=t.gl;this.graphicsDevice=t,this.buffer=i.createBuffer(),this.usage=e||i.STATIC_DRAW,this.data=null,Object.defineProperty(this,"indexCount",{get:function(){return this.data?this.data.length:0}})};e.prototype={constructor:e,setData:function(t){var e=this.graphicsDevice.gl;this.data=t,e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.buffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.data,this.usage)},getData:function(){return this.data}},t.exports=e},function(t){var e=256,i=function(){this._initialized=!1,this._keys=new Uint8Array(e),this._registered=new Uint8Array(e),this._onKeyDown=null,this._onKeyUp=null};i.prototype={constructor:i,initialize:function(){if(!this._initialized){var t=this;this._onKeyDown=function(e){t.processKeyDown(e)},this._onKeyUp=function(e){t.processKeyUp(e)},window.addEventListener("keydown",this._onKeyDown,!1),window.addEventListener("keyup",this._onKeyUp,!1),this._initialized=!0}},dispose:function(){this._initialized&&(window.removeEventListener("keydown",this._onKeyDown,!1),window.removeEventListener("keyup",this._onKeyUp,!1),this._onKeyDown=null,this._onKeyUp=null,this._initialized=!1)},processKeyDown:function(t){this._registered[t.keyCode]&&(this._keys[t.keyCode]=!0,t.preventDefault())},processKeyUp:function(t){this._registered[t.keyCode]&&(t.preventDefault(),this._keys[t.keyCode]=!1)},isKeyUp:function(t){return 0==this._keys[t]},isKeyDown:function(t){return 1==this._keys[t]},addKey:function(t){this._registered[t]=!0},removeKey:function(t){this._registered[t]=!1}},t.exports=new i},function(t,e,i){i(27);var n=10,r=function(t,e,i,n,r){this.id=t,this.x=e,this.y=i,this.state=n,this.type=r},s=function(){this._initialized=!1,this.window=null,this.items=new Array(n),this.itemsCount=0,this.maxActivePointers=1;for(var t=0;t<this.items.length;t++)this.items[t]=new r(0,0,0,s.STATE_UP,s.TYPE_TOUCH);this._onPointerUp=null,this._onPointerDown=null,this._onPointerMove=null,this.TYPE_TOUCH="touch",this.TYPE_MOUSE="mouse",this.TYPE_PEN="pen",this.STATE_UP=0,this.STATE_DOWN=1};s.prototype={constructor:s,initialize:function(t){if(!this._initialized){this.window=t;var e=this;this._onPointerUp=function(t){e.processPointerUp(t)},this._onPointerDown=function(t){e.processPointerDown(t)},this._onPointerMove=function(t){e.processPointerMove(t)},this.window.canvas.addEventListener("pointerdown",this._onPointerDown,!1),this.window.canvas.addEventListener("pointermove",this._onPointerMove,!1),this.window.canvas.addEventListener("pointerup",this._onPointerUp,!1),this.window.canvas.addEventListener("pointerout",this._onPointerUp,!1),this._initialized=!1}},destroy:function(){this._initialized&&(this.window.canvas.removeEventListener("pointerdown",this._onPointerDown,!1),this.window.canvas.removeEventListener("pointermove",this._onPointerMove,!1),this.window.canvas.removeEventListener("pointerup",this._onPointerUp,!1),this.window.canvas.removeEventListener("pointerout",this._onPointerUp,!1),this._onPointerUp=null,this._onPointerDown=null,this._onPointerMove=null,this._initialized=!1)},processPointerUp:function(t){var e=this.findItemById(t.pointerId);if(e&&(e.state=this.STATE_UP,e.type===this.TYPE_TOUCH)){var i=this.items.indexOf(e);this.itemsCount-1!==i&&(this.items[i]=this.items[this.itemsCount-1],this.items[this.itemsCount-1]=e),this.itemsCount--}},processPointerDown:function(t){var e=this.findItemById(t.pointerId);if(!e){if(this.itemsCount===this.maxActivePointers)return;this.itemsCount++,e=this.items[this.itemsCount-1]}var i=this.window;e.id=t.pointerId,e.x=(t.clientX-i.clientBounds.x)*i.scale.x,e.y=(t.clientY-i.clientBounds.y)*i.scale.y,e.state=this.STATE_DOWN,e.type=t.pointerType},processPointerMove:function(t){var e=this.findItemById(t.pointerId);if(!e){if(this.itemsCount===this.maxActivePointers)return;this.itemsCount++,e=this.items[this.itemsCount-1]}var i=this.window;e.id=t.pointerId,e.x=(t.clientX-i.clientBounds.x)*i.scale.x,e.y=(t.clientY-i.clientBounds.y)*i.scale.y,e.state=this.STATE_DOWN,e.type=t.pointerType},findItemById:function(t){for(var e=0;e<this.itemsCount;e++)if(this.items[e].id===t)return this.items[e]}},t.exports=new s},function(t,e,i){var n=i(6).GLMAT_ARRAY_TYPE,r={};r.create=function(){var t=new n(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.clone=function(t){var e=new n(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},r.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},r.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.transpose=function(t,e){if(t===e){var i=e[1],n=e[2],r=e[3],s=e[6],a=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=r,t[13]=a,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},r.invert=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],c=e[7],u=e[8],f=e[9],l=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15],_=i*o-n*a,E=i*h-r*a,T=i*c-s*a,w=n*h-r*o,y=n*c-s*o,M=r*c-s*h,A=u*v-f*p,x=u*m-l*p,D=u*g-d*p,R=f*m-l*v,b=f*g-d*v,P=l*g-d*m,L=_*P-E*b+T*R+w*D-y*x+M*A;return L?(L=1/L,t[0]=(o*P-h*b+c*R)*L,t[1]=(r*b-n*P-s*R)*L,t[2]=(v*M-m*y+g*w)*L,t[3]=(l*y-f*M-d*w)*L,t[4]=(h*D-a*P-c*x)*L,t[5]=(i*P-r*D+s*x)*L,t[6]=(m*T-p*M-g*E)*L,t[7]=(u*M-l*T+d*E)*L,t[8]=(a*b-o*D+c*A)*L,t[9]=(n*D-i*b-s*A)*L,t[10]=(p*y-v*T+g*_)*L,t[11]=(f*T-u*y-d*_)*L,t[12]=(o*x-a*R-h*A)*L,t[13]=(i*R-n*x+r*A)*L,t[14]=(v*E-p*w-m*_)*L,t[15]=(u*w-f*E+l*_)*L,t):null},r.adjoint=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],c=e[7],u=e[8],f=e[9],l=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15];return t[0]=o*(l*g-d*m)-f*(h*g-c*m)+v*(h*d-c*l),t[1]=-(n*(l*g-d*m)-f*(r*g-s*m)+v*(r*d-s*l)),t[2]=n*(h*g-c*m)-o*(r*g-s*m)+v*(r*c-s*h),t[3]=-(n*(h*d-c*l)-o*(r*d-s*l)+f*(r*c-s*h)),t[4]=-(a*(l*g-d*m)-u*(h*g-c*m)+p*(h*d-c*l)),t[5]=i*(l*g-d*m)-u*(r*g-s*m)+p*(r*d-s*l),t[6]=-(i*(h*g-c*m)-a*(r*g-s*m)+p*(r*c-s*h)),t[7]=i*(h*d-c*l)-a*(r*d-s*l)+u*(r*c-s*h),t[8]=a*(f*g-d*v)-u*(o*g-c*v)+p*(o*d-c*f),t[9]=-(i*(f*g-d*v)-u*(n*g-s*v)+p*(n*d-s*f)),t[10]=i*(o*g-c*v)-a*(n*g-s*v)+p*(n*c-s*o),t[11]=-(i*(o*d-c*f)-a*(n*d-s*f)+u*(n*c-s*o)),t[12]=-(a*(f*m-l*v)-u*(o*m-h*v)+p*(o*l-h*f)),t[13]=i*(f*m-l*v)-u*(n*m-r*v)+p*(n*l-r*f),t[14]=-(i*(o*m-h*v)-a*(n*m-r*v)+p*(n*h-r*o)),t[15]=i*(o*l-h*f)-a*(n*l-r*f)+u*(n*h-r*o),t},r.determinant=function(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],c=t[8],u=t[9],f=t[10],l=t[11],d=t[12],p=t[13],v=t[14],m=t[15],g=e*a-i*s,_=e*o-n*s,E=e*h-r*s,T=i*o-n*a,w=i*h-r*a,y=n*h-r*o,M=c*p-u*d,A=c*v-f*d,x=c*m-l*d,D=u*v-f*p,R=u*m-l*p,b=f*m-l*v;return g*b-_*R+E*D+T*x-w*A+y*M},r.multiply=function(t,e,i){var n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],c=e[6],u=e[7],f=e[8],l=e[9],d=e[10],p=e[11],v=e[12],m=e[13],g=e[14],_=e[15],E=i[0],T=i[1],w=i[2],y=i[3];return t[0]=E*n+T*o+w*f+y*v,t[1]=E*r+T*h+w*l+y*m,t[2]=E*s+T*c+w*d+y*g,t[3]=E*a+T*u+w*p+y*_,E=i[4],T=i[5],w=i[6],y=i[7],t[4]=E*n+T*o+w*f+y*v,t[5]=E*r+T*h+w*l+y*m,t[6]=E*s+T*c+w*d+y*g,t[7]=E*a+T*u+w*p+y*_,E=i[8],T=i[9],w=i[10],y=i[11],t[8]=E*n+T*o+w*f+y*v,t[9]=E*r+T*h+w*l+y*m,t[10]=E*s+T*c+w*d+y*g,t[11]=E*a+T*u+w*p+y*_,E=i[12],T=i[13],w=i[14],y=i[15],t[12]=E*n+T*o+w*f+y*v,t[13]=E*r+T*h+w*l+y*m,t[14]=E*s+T*c+w*d+y*g,t[15]=E*a+T*u+w*p+y*_,t},r.mul=r.multiply,r.translate=function(t,e,i){var n,r,s,a,o,h,c,u,f,l,d,p,v=i[0],m=i[1],g=i[2];return e===t?(t[12]=e[0]*v+e[4]*m+e[8]*g+e[12],t[13]=e[1]*v+e[5]*m+e[9]*g+e[13],t[14]=e[2]*v+e[6]*m+e[10]*g+e[14],t[15]=e[3]*v+e[7]*m+e[11]*g+e[15]):(n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],c=e[6],u=e[7],f=e[8],l=e[9],d=e[10],p=e[11],t[0]=n,t[1]=r,t[2]=s,t[3]=a,t[4]=o,t[5]=h,t[6]=c,t[7]=u,t[8]=f,t[9]=l,t[10]=d,t[11]=p,t[12]=n*v+o*m+f*g+e[12],t[13]=r*v+h*m+l*g+e[13],t[14]=s*v+c*m+d*g+e[14],t[15]=a*v+u*m+p*g+e[15]),t},r.scale=function(t,e,i){var n=i[0],r=i[1],s=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},r.rotate=function(t,e,i,n){var r,s,a,o,h,c,u,f,l,d,p,v,m,g,_,E,T,w,y,M,A,x,D,R,b=n[0],P=n[1],L=n[2],S=Math.sqrt(b*b+P*P+L*L);return Math.abs(S)<GLMAT_EPSILON?null:(S=1/S,b*=S,P*=S,L*=S,r=Math.sin(i),s=Math.cos(i),a=1-s,o=e[0],h=e[1],c=e[2],u=e[3],f=e[4],l=e[5],d=e[6],p=e[7],v=e[8],m=e[9],g=e[10],_=e[11],E=b*b*a+s,T=P*b*a+L*r,w=L*b*a-P*r,y=b*P*a-L*r,M=P*P*a+s,A=L*P*a+b*r,x=b*L*a+P*r,D=P*L*a-b*r,R=L*L*a+s,t[0]=o*E+f*T+v*w,t[1]=h*E+l*T+m*w,t[2]=c*E+d*T+g*w,t[3]=u*E+p*T+_*w,t[4]=o*y+f*M+v*A,t[5]=h*y+l*M+m*A,t[6]=c*y+d*M+g*A,t[7]=u*y+p*M+_*A,t[8]=o*x+f*D+v*R,t[9]=h*x+l*D+m*R,t[10]=c*x+d*D+g*R,t[11]=u*x+p*D+_*R,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},r.rotateX=function(t,e,i){var n=Math.sin(i),r=Math.cos(i),s=e[4],a=e[5],o=e[6],h=e[7],c=e[8],u=e[9],f=e[10],l=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+c*n,t[5]=a*r+u*n,t[6]=o*r+f*n,t[7]=h*r+l*n,t[8]=c*r-s*n,t[9]=u*r-a*n,t[10]=f*r-o*n,t[11]=l*r-h*n,t},r.rotateY=function(t,e,i){var n=Math.sin(i),r=Math.cos(i),s=e[0],a=e[1],o=e[2],h=e[3],c=e[8],u=e[9],f=e[10],l=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-c*n,t[1]=a*r-u*n,t[2]=o*r-f*n,t[3]=h*r-l*n,t[8]=s*n+c*r,t[9]=a*n+u*r,t[10]=o*n+f*r,t[11]=h*n+l*r,t},r.rotateZ=function(t,e,i){var n=Math.sin(i),r=Math.cos(i),s=e[0],a=e[1],o=e[2],h=e[3],c=e[4],u=e[5],f=e[6],l=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+c*n,t[1]=a*r+u*n,t[2]=o*r+f*n,t[3]=h*r+l*n,t[4]=c*r-s*n,t[5]=u*r-a*n,t[6]=f*r-o*n,t[7]=l*r-h*n,t},r.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},r.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.fromRotation=function(t,e,i){var n,r,s,a=i[0],o=i[1],h=i[2],c=Math.sqrt(a*a+o*o+h*h);return Math.abs(c)<GLMAT_EPSILON?null:(c=1/c,a*=c,o*=c,h*=c,n=Math.sin(e),r=Math.cos(e),s=1-r,t[0]=a*a*s+r,t[1]=o*a*s+h*n,t[2]=h*a*s-o*n,t[3]=0,t[4]=a*o*s-h*n,t[5]=o*o*s+r,t[6]=h*o*s+a*n,t[7]=0,t[8]=a*h*s+o*n,t[9]=o*h*s-a*n,t[10]=h*h*s+r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},r.fromXRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=i,t[7]=0,t[8]=0,t[9]=-i,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.fromYRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=i,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.fromZRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=i,t[2]=0,t[3]=0,t[4]=-i,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.fromRotationTranslation=function(t,e,i){var n=e[0],r=e[1],s=e[2],a=e[3],o=n+n,h=r+r,c=s+s,u=n*o,f=n*h,l=n*c,d=r*h,p=r*c,v=s*c,m=a*o,g=a*h,_=a*c;return t[0]=1-(d+v),t[1]=f+_,t[2]=l-g,t[3]=0,t[4]=f-_,t[5]=1-(u+v),t[6]=p+m,t[7]=0,t[8]=l+g,t[9]=p-m,t[10]=1-(u+d),t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1,t},r.fromQuat=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],a=i+i,o=n+n,h=r+r,c=i*a,u=n*a,f=n*o,l=r*a,d=r*o,p=r*h,v=s*a,m=s*o,g=s*h;return t[0]=1-f-p,t[1]=u+g,t[2]=l-m,t[3]=0,t[4]=u-g,t[5]=1-c-p,t[6]=d+v,t[7]=0,t[8]=l+m,t[9]=d-v,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.frustum=function(t,e,i,n,r,s,a){var o=1/(i-e),h=1/(r-n),c=1/(s-a);return t[0]=2*s*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*h,t[6]=0,t[7]=0,t[8]=(i+e)*o,t[9]=(r+n)*h,t[10]=(a+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*s*2*c,t[15]=0,t},r.perspective=function(t,e,i,n,r){var s=1/Math.tan(e/2),a=1/(n-r);return t[0]=s/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(r+n)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*r*n*a,t[15]=0,t},r.perspectiveFromFieldOfView=function(t,e,i,n){var r=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),h=2/(a+o),c=2/(r+s);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-((a-o)*h*.5),t[9]=(r-s)*c*.5,t[10]=n/(i-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*i/(i-n),t[15]=0,t},r.ortho=function(t,e,i,n,r,s,a){var o=1/(e-i),h=1/(n-r),c=1/(s-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*o,t[13]=(r+n)*h,t[14]=(a+s)*c,t[15]=1,t},r.lookAt=function(t,e,i,n){var s,a,o,h,c,u,f,l,d,p,v=e[0],m=e[1],g=e[2],_=n[0],E=n[1],T=n[2],w=i[0],y=i[1],M=i[2];return Math.abs(v-w)<GLMAT_EPSILON&&Math.abs(m-y)<GLMAT_EPSILON&&Math.abs(g-M)<GLMAT_EPSILON?r.identity(t):(f=v-w,l=m-y,d=g-M,p=1/Math.sqrt(f*f+l*l+d*d),f*=p,l*=p,d*=p,s=E*d-T*l,a=T*f-_*d,o=_*l-E*f,p=Math.sqrt(s*s+a*a+o*o),p?(p=1/p,s*=p,a*=p,o*=p):(s=0,a=0,o=0),h=l*o-d*a,c=d*s-f*o,u=f*a-l*s,p=Math.sqrt(h*h+c*c+u*u),p?(p=1/p,h*=p,c*=p,u*=p):(h=0,c=0,u=0),t[0]=s,t[1]=h,t[2]=f,t[3]=0,t[4]=a,t[5]=c,t[6]=l,t[7]=0,t[8]=o,t[9]=u,t[10]=d,t[11]=0,t[12]=-(s*v+a*m+o*g),t[13]=-(h*v+c*m+u*g),t[14]=-(f*v+l*m+d*g),t[15]=1,t)},r.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},r.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},t.exports=r},function(t){var e={ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776};t.exports=e},function(t){t.exports="#ifdef VERTEX\r\n\r\nattribute vec3 position;\r\nattribute vec4 color;\r\nattribute vec2 texCoord;\r\n\r\nvarying vec2 _texCoord;\r\nvarying vec4 _color;\r\n\r\nuniform mat4 ModelViewMatrix;\r\n\r\nvoid main() {\r\n    gl_Position = ModelViewMatrix * vec4(position, 1.0);\r\n    _texCoord = texCoord;\r\n    _color = color;\r\n}\r\n\r\n#endif\r\n\r\n#ifdef FRAGMENT\r\n\r\nprecision mediump float;\r\nvarying vec2 _texCoord;\r\nvarying vec4 _color;\r\nuniform sampler2D Texture;\r\n\r\nvoid main() {\r\n    gl_FragColor = texture2D(Texture, _texCoord) * _color;\r\n}\r\n\r\n#endif"},function(t){function e(){if(!s){s=!0;for(var t,e=r.length;e;){t=r,r=[];for(var i=-1;++i<e;)t[i]();e=r.length}s=!1}}function i(){}var n=t.exports={},r=[],s=!1;n.nextTick=function(t){r.push(t),s||setTimeout(e,0)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.on=i,n.addListener=i,n.once=i,n.off=i,n.removeListener=i,n.removeAllListeners=i,n.emit=i,n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(t){var e=function(t){this.graphicsDevice=t,this.rootDirectory="",this._pending=0,this._loaded=0,this._assets={},this.load={},Object.defineProperty(this,"isReady",{get:function(){return this._pending===this._loaded}})};e.prototype={constructor:e,addLoader:function(t,e){this.load[t]=e(this)},addAsset:function(t,e,i,n){this._assets[e]||(this._assets[e]={loader:t,asset:i,async:n||0,loaded:!n},this._pending++,n||this._loaded++)},getAsset:function(t){var e=this._assets[t];return e&&e.asset},onAssetLoaded:function(t){var e=this._assets[t];e&&e.async&&!e.loaded&&(e.loaded=!0,this._loaded++)}},t.exports=e},function(t,e,i){var n=i(26),r=function(t,e,i,n){return function(){if(4===n.readyState&&200===n.status){var r=n.responseXML,s=e.replace(/[^\/]*$/,""),a=s+r.getElementsByTagName("page")[0].getAttribute("file");i.texture=t.load.Texture2D(a);var o=r.getElementsByTagName("info")[0],h=r.getElementsByTagName("common")[0];i.name=o.getAttribute("face"),i.size=parseInt(o.getAttribute("size"),10),i.lineHeight=parseInt(h.getAttribute("lineHeight"),10),i.glyphs={};for(var c=r.getElementsByTagName("char"),u=0;u<c.length;u++){var f=parseInt(c[u].getAttribute("id"),10),l=[parseInt(c[u].getAttribute("x"),10),parseInt(c[u].getAttribute("y"),10),parseInt(c[u].getAttribute("width"),10),parseInt(c[u].getAttribute("height"),10)];i.glyphs[f]={offset:[parseInt(c[u].getAttribute("xoffset"),10),parseInt(c[u].getAttribute("yoffset"),10)],xAdvance:parseInt(c[u].getAttribute("xadvance"),10),kerning:{},source:l}}var d=r.getElementsByTagName("kerning");for(u=0;u<d.length;u++){var p=parseInt(d[u].getAttribute("first"),10),v=parseInt(d[u].getAttribute("second"),10),m=parseInt(d[u].getAttribute("amount"),10);i.glyphs[v].kerning[p]=m}t.onAssetLoaded(e)}}},s=function(t){return function(e){var i=t.getAsset(e);if(!i){i=new n(t.graphicsDevice),t.addAsset(this,e,i,!0);var s=new XMLHttpRequest;s.addEventListener("readystatechange",r(t,e,i,s)),s.open("GET",t.rootDirectory+"/"+e),s.overrideMimeType("application/xml"),s.send(null)}return i}};t.exports=s},function(t,e,i){var n=i(1),r=function(t,e,i,n){return function(){i.setData(n),t.onAssetLoaded(e)}},s=function(t){return function(e){var i=t.getAsset(e);if(!i){i=new n(t.graphicsDevice),t.addAsset(this,e,i,!0);var s=new Image;s.addEventListener("load",r(t,e,i,s)),s.src=t.rootDirectory+"/"+e}return i}};t.exports=s},function(t,e,i){window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}(),window.performance=window.performance||{},performance.now=function(){return performance.now||performance.mozNow||performance.msNow||performance.oNow||performance.webkitNow||function(){return(new Date).getTime()}}();var n=i(19),r=function(t){this.game=t,this.maxElapsedTime=500,this._gameTime=new n,this._accumulatedElapsedTime=0,this._previousTicks=0;var e=this;this._onframe=function(){e.tick()}};r.prototype={constructor:r,tick:function(){requestAnimFrame(this._onframe);var t=this.game,e=t.targetElapsedTime,i=t.isFixedTimeStep,n=performance.now();if(this._accumulatedElapsedTime+=n-this._previousTicks,this._previousTicks=n,this._accumulatedElapsedTime>this.maxElapsedTime&&(this._accumulatedElapsedTime=this.maxElapsedTime),i)for(this._gameTime.elapsedGameTime=e;this._accumulatedElapsedTime>=e;)this._gameTime.totalGameTime+=e,this._accumulatedElapsedTime-=e,t.update(this._gameTime);else this._gameTime.elapsedGameTime=this._accumulatedElapsedTime,this._gameTime.totalGameTime+=this._accumulatedElapsedTime,this._accumulatedElapsedTime=0,t.update(this._gameTime);this._gameTime.alpha=this._accumulatedElapsedTime/e,t.draw(this._gameTime)},run:function(){this._gameTime.totalGameTime=0,this._gameTime.elapsedGameTime=0,this._gameTime.alpha=0,this._accumulatedElapsedTime=0,this._previousTicks=0,this.tick()}},t.exports=r},function(t){var e=function(){this.elapsedGameTime=0,this.totalGameTime=0,this.alpha=0};t.exports=e},function(t,e,i){function n(t){return"object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName}var r=i(21),s=function(t){this._initialized=!1,this.element=null,"string"==typeof t&&(t=document.querySelector(t)),this.element=n(t)?t:document.body,this.canvas=document.createElement("canvas"),this.canvas.id="x-surface",this.canvas.className+=r.ua.mobile?" mobile":" desktop",this.element.appendChild(this.canvas),this.clientBounds={x:0,y:0,width:0,height:0},this.scale={x:1,y:1},this.aspectRatio=0,this._onResize=null};s.prototype={constructor:s,initialize:function(){if(!this._initialized){var t=this;this._onResize=function(e){t.processResize(e)},window.addEventListener("resize",this._onResize);var e=this.canvas.getBoundingClientRect();this.clientBounds.x=e.left,this.clientBounds.y=e.top,this.clientBounds.width=e.width,this.clientBounds.height=e.height,this._initialized=!0}},dispose:function(){this._initialized&&(window.removeEventListener("resize",this._onResize),this._onResize=null,this._initialized=!1)},processResize:function(){var t=this.canvas.getBoundingClientRect();this.clientBounds.x=t.left,this.clientBounds.y=t.top,this.clientBounds.width=t.width,this.clientBounds.height=t.height,this.scale.x=t.width/this.canvas.width,this.scale.y=t.height/this.canvas.height,this.aspectRatio=t.width/t.height}},t.exports=s},function(t){"use strict";var e={ua:{mobile:/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())},isPortrait:function(){return!e.ua.mobile||window.innerHeight>window.innerWidth}};t.exports=e},function(t,e,i){var n=i(3),r=i(20),s=i(18),a=i(24),o=i(15),h=i(17),c=i(16),u=i(10),f=i(9),l=n.extend({create:function(t){this.isFixedTimeStep=!1,this.targetElapsedTime=16,this.window=new r(t),this.graphicsDevice=new a(this),this.content=new o(this.graphicsDevice),this.content.rootDirectory="content",this.content.addLoader("Texture2D",h),this.content.addLoader("SpriteFont",c)},run:function(){this.window.initialize(),u.initialize(this.window),f.initialize(),this.initialize(),this.graphicsDevice.initialize(),this.loadContent();var t=new s(this);t.run()},initialize:function(){},loadContent:function(){},update:function(){},draw:function(){}});t.exports=l},function(t,e,i){function n(t,e){var i=t.length;if(i!=e.length)return!1;for(;i--;)if(t[i]!==e[i])return!1;return!0}var r=i(5),s=i(1),a=function(t){if(this.value!==t){this.value=t;var e=this.effect.graphicsDevice.gl;e.uniform1f(this.location,this.value)}},o=function(t){if(!this.value||!n(this.value,t)){this.value=t;var e=t.length,i=this.effect.graphicsDevice.gl;switch(e){case 2:i.uniform2fv(this.location,t);break;case 3:i.uniform3fv(this.location,t);break;case 4:i.uniform4fv(this.location,t)}}},h=function(t){if(!this.value||!n(this.value,t)){this.value=t;var e=t.length,i=this.effect.graphicsDevice.gl;switch(e){case 4:i.uniformMatrix2fv(this.location,!1,t);break;case 9:i.uniformMatrix3fv(this.location,!1,t);break;case 16:i.uniformMatrix4fv(this.location,!1,t)}}},c=function(t){if(this.value!==t){this.value=t;var e=this.effect.graphicsDevice.gl;e.uniform1i(this.location,this.value)}},u=function(t){if(!this.value||!n(this.value,t)){this.value=t;var e=t.length,i=this.effect.graphicsDevice.gl;switch(e){case 2:i.uniform2iv(this.location,t);break;case 3:i.uniform3iv(this.location,t);break;case 4:i.uniform4iv(this.location,t)}}},f=function(t){if(!(t instanceof s))throw new Error("[EffectParameter::setTexture] Texture2D parameter type required");if(this.value!==t){this.value=t;var e=this.effect.graphicsDevice.gl;this.value.bind(this.sampler),e.uniform1i(this.location,t.texture)}},l=function(t){if(!(t instanceof r))throw new Error("[EffectParameter::setVertexBuffer] VertexBuffer parameter type required");if(this.value!==t){this.value=t;var e=this.effect.graphicsDevice.gl;e.enableVertexAttribArray(this.location),e.bindBuffer(e.ARRAY_BUFFER,t.buffer),e.vertexAttribPointer(this.location,t.chunkSize,e.FLOAT,!1,0,0),this.value=t}},d=function(t,e,i,n){this.effect=t,this.name=e,this.location=i.location,this.type=n,this.value=null,this.sampler=-1,this.setValue=null;var r=t.graphicsDevice.gl;if(n===d.TYPE_UNIFORM)switch(i.type){case r.INT:case r.BOOL:this.setValue=c;break;case r.INT_VEC2:case r.INT_VEC3:case r.INT_VEC4:case r.BOOL_VEC2:case r.BOOL_VEC3:case r.BOOL_VEC4:this.setValue=u;break;case r.FLOAT_VEC2:case r.FLOAT_VEC3:case r.FLOAT_VEC4:this.setValue=o;break;case r.FLOAT_MAT2:case r.FLOAT_MAT3:case r.FLOAT_MAT4:this.setValue=h;break;case r.SAMPLER_2D:this.setValue=f,this.effect.samplers.push(this.name),this.sampler=this.effect.samplers.length-1;break;case r.FLOAT:default:this.setValue=a}else this.setValue=l};d.prototype={constructor:d},d.TYPE_UNIFORM=0,d.TYPE_ATTRIBUTE=1,t.exports=d},function(t,e,i){var n=i(4),r=function(t){this._initialized=!1,this.game=t,this.canvas=t.window.canvas,this.gl=null,this._textures=[],this._effect=null,this._renderTarget=null,this._blendState=null,Object.defineProperty(this,"backBufferWidth",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t,this._initialized&&this.gl.viewport(0,0,this.canvas.width,this.canvas.height)}}),Object.defineProperty(this,"backBufferHeight",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t,this._initialized&&this.gl.viewport(0,0,this.canvas.width,this.canvas.height)}}),Object.defineProperty(this,"blendState",{get:function(){return this._blendState},set:function(t){if(t&&(this._blendState[0]!==t[0]||this._blendState[1]!==t[1])){var e=this.gl;t[0]===n.OPAQUE[0]&&t[1]===n.OPAQUE[1]?(e.disable(e.BLEND),e.enable(e.DEPTH_TEST)):(e.enable(e.BLEND),e.disable(e.DEPTH_TEST)),this._blendState=t,e.blendFunc(t[0],t[1])}}})};r.prototype={constructor:r,initialize:function(){if(!this._initialized){var t={alpha:!1,preserveDrawingBuffer:!1,stencil:!0,antialias:!1};try{this.gl=this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)}catch(e){}this.gl||(console.error("Unable to initialize Webgl. Your browser may not support it."),this.gl=null),this.gl.viewport(0,0,this.canvas.width,this.canvas.height),this._blendState=n.OPAQUE,this._initialized=!0}},clear:function(t){var e=this.gl;e.clearColor(t[0],t[1],t[2],t[3]),e.clear(e.COLOR_BUFFER_BIT)},createShader:function(t,e){var i=this.gl,n=i.createShader(e);if(i.shaderSource(n,t),i.compileShader(n),!i.getShaderParameter(n,i.COMPILE_STATUS)){var r="[GraphicsDevice::createShader] An error occurred compiling "+(e===i.VERTEX_SHADER?"vertex":"fragment")+" shader: ";return r+=i.getShaderInfoLog(n),console.error(r),null}return n},createProgram:function(t,e){var i=this.gl,n=i.createProgram();return i.attachShader(n,t),i.attachShader(n,e),i.linkProgram(n),i.getProgramParameter(n,i.LINK_STATUS)?n:(console.error("[GraphicsDevice::createProgram] Unable to initialize the shader program: "+i.getProgramInfoLog(n)),i.deleteProgram(n),null)
  },getAttributes:function(t){for(var e=this.gl,i={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),r=0;n>r;r++){var s=e.getActiveAttrib(t,r);i[s.name]={type:s.type,location:e.getAttribLocation(t,s.name)}}return i},getUniforms:function(t){for(var e=this.gl,i={},n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),r=0;n>r;r++){var s=e.getActiveUniform(t,r);i[s.name]={type:s.type,location:e.getUniformLocation(t,s.name)}}return i},createTexture:function(){var t=this.gl,e=t.createTexture();return t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.bindTexture(t.TEXTURE_2D,null),e},drawUserPrimitives:function(t,e){var i=this.gl;i.drawArrays(t||i.TRIANGLES,0,e)},drawUserIndexedPrimitives:function(t,e,i,n){var r=this.gl;r.drawElements(t||r.TRIANGLES,i||e.indexCount,r.UNSIGNED_SHORT,n||0)},useEffect:function(t){var e=this.gl;this._effect!==t&&(void 0!=t?(this._effect=t,this._effect.reset(),e.useProgram(this._effect.program)):(this._effect=null,e.useProgram(null)))},setRenderTarget:function(t){var e=this.gl;this._renderTarget!==t&&(void 0!=t?(this._renderTarget=t,e.bindFramebuffer(e.FRAMEBUFFER,t.framebuffer)):(this._renderTarget=null,e.bindFramebuffer(e.FRAMEBUFFER,null)))}},t.exports=r},function(t,e,i){var n=i(5),r=i(8),s=i(7),a=i(4),o=i(13),h=i(11),c=i(29),u=i(30),f=c.create(),l=function(t,e){this.graphicsDevice=t,this._effect=new s(this.graphicsDevice,o),this._currentEffect=null,this._blendState=null,this._size=e||512,this._count=0,this._matrix=h.create(),this._matrix[0]=2/this.graphicsDevice.backBufferWidth,this._matrix[5]=-2/this.graphicsDevice.backBufferHeight,this._matrix[12]=-1,this._matrix[13]=1,this._vertexBuffer=new n(this.graphicsDevice,2),this._uvBuffer=new n(this.graphicsDevice,2),this._colorBuffer=new n(this.graphicsDevice,4),this._indexBuffer=new r(this.graphicsDevice),this._texture=null,this.expand(this._size)};l.prototype={constructor:l,begin:function(t,e){this._count=0,this._currentEffect=e||this._effect,this._currentEffect.apply(),this._blendState=this.graphicsDevice.blendState,this.graphicsDevice.blendState=t||a.ALPHA_BLEND},end:function(){this.flush(),this.graphicsDevice.blendState=this._blendState,this._currentEffect=null,this._blendState=null},flush:function(){if(!(this._count<1)){var t=this.graphicsDevice.gl,e=this._currentEffect.parameters;e.position&&e.position.setValue(this._vertexBuffer),e.color&&e.color.setValue(this._colorBuffer),e.texCoord&&e.texCoord.setValue(this._uvBuffer),e.Texture&&e.Texture.setValue(this._texture),e.ModelViewMatrix&&e.ModelViewMatrix.setValue(this._matrix),this._vertexBuffer.setData(this._vertices),this._uvBuffer.setData(this._uvs),this._colorBuffer.setData(this._colors),this.graphicsDevice.drawUserIndexedPrimitives(t.TRIANGLES,this._indexBuffer,6*this._count),this._count=0}},expand:function(t){this._size=t,this._vertices=new Float32Array(2*this._size*4),this._uvs=new Float32Array(2*this._size*4),this._colors=new Float32Array(4*this._size*4),this._indices=new Uint16Array(6*this._size);for(var e=0;e<this._size;e++){var i=6*e,n=4*e;this._indices[i]=n,this._indices[i+1]=n+1,this._indices[i+2]=n+2,this._indices[i+3]=n+1,this._indices[i+4]=n+3,this._indices[i+5]=n+2}this._indexBuffer.setData(this._indices)},draw:function(t,e,i,n,r,s,a){this._texture&&this._texture!==t&&this.flush(),this._count+1>this._size&&(this.flush(),this.expand(2*this._size)),this._texture=t;var o=this._texture.width,h=this._texture.height,l=this._count,d=2*l*4;a=a||[1,1,1,1];for(var p=0;4>p;p++)this._colors[16*l+4*p]=a[0],this._colors[16*l+4*p+1]=a[1],this._colors[16*l+4*p+2]=a[2],this._colors[16*l+4*p+3]=a[3];i=i||[0,0,o,h];var v=i[0],m=i[1],g=i[2],_=i[3],E=i[0]+g,T=i[1]+_;this._uvs[d]=v/o,this._uvs[d+1]=m/h,this._uvs[d+2]=E/o,this._uvs[d+3]=m/h,this._uvs[d+4]=v/o,this._uvs[d+5]=T/h,this._uvs[d+6]=E/o,this._uvs[d+7]=T/h,e=e||[0,0],n=n||[0,0],s=s||[1,1],r=r||0;var w=-n[0],y=-n[1];this._vertices[d]=w,this._vertices[d+1]=y,this._vertices[d+2]=w+g,this._vertices[d+3]=y,this._vertices[d+4]=w,this._vertices[d+5]=y+_,this._vertices[d+6]=w+g,this._vertices[d+7]=y+_;var M=c.identity(f);c.translate(M,M,e),c.scale(M,M,s),c.rotate(M,M,r),u.forEach(this._vertices,2,d,4,function(t){u.transformMat3(t,t,M)}),this._count++},drawString:function(t,e,i,n,r,s,a){this._texture&&this._texture!==t.texture&&this.flush(),this._count+1>this._size&&(this.flush(),this.expand(2*this._size)),this._texture=t.texture;var o=this._texture.width,h=this._texture.height;i=i||[0,0],n=n||[0,0],s=s||[1,1],r=r||0,a=a||[1,1,1,1];for(var l=-n[0],d=-n[1],p=null,v=(t.lineHeight,this._count),m=2*v*4,g=0;g<e.length;g++){var _=e.charCodeAt(g),E=t.glyphs[_];if(E){var T=this._count,w=2*T*4;p&&E.kerning[p]&&(l+=E.kerning[p]);for(var y=0;4>y;y++)this._colors[16*T+4*y]=a[0],this._colors[16*T+4*y+1]=a[1],this._colors[16*T+4*y+2]=a[2],this._colors[16*T+4*y+3]=a[3];var M=E.source,A=M[0],x=M[1],D=M[2],R=M[3],b=M[0]+D,P=M[1]+R;this._uvs[w]=A/o,this._uvs[w+1]=x/h,this._uvs[w+2]=b/o,this._uvs[w+3]=x/h,this._uvs[w+4]=A/o,this._uvs[w+5]=P/h,this._uvs[w+6]=b/o,this._uvs[w+7]=P/h;var L=E.offset,S=l+L[0],I=d+L[1];this._vertices[w]=S,this._vertices[w+1]=I,this._vertices[w+2]=S+D,this._vertices[w+3]=I,this._vertices[w+4]=S,this._vertices[w+5]=I+R,this._vertices[w+6]=S+D,this._vertices[w+7]=I+R,l+=E.xAdvance,p=_,this._count++}}var U=c.identity(f);c.translate(U,U,i),c.scale(U,U,s),c.rotate(U,U,r),u.forEach(this._vertices,2,m,4*e.length,function(t){u.transformMat3(t,t,U)})}},t.exports=l},function(t){var e=function(t){this.graphicsDevice=t,this.texture=null,this.name="",this.glyphs=null,this.size=0,this.lineHeight=0,Object.defineProperty(this,"isReady",{get:function(){return this.texture.isReady()&&this.glyphs}})};e.prototype={constructor:e,measureString:function(){}},t.exports=e},function(t,e,i){(function(t){var e=e||{};!function(){function i(){R=!0,clearTimeout(b),b=setTimeout(function(){R=!1},700)}function n(t){var e=[];if(t)for(e.unshift(t);t.parentNode;)e.unshift(t.parentNode),t=t.parentNode;return e}function r(t,e){for(var i=n(t),r=n(e),s=null;i.length>0&&i[0]==r.shift();)s=i.shift();return s}function s(t,e,i){for(var n=r(t,e),s=t,a=[];s&&s!=n;)_(s,"pointerenter")&&a.push(s),s=s.parentNode;for(;a.length>0;)i(a.pop())}function a(t,e,i){for(var n=r(t,e),s=t;s&&s!=n;)_(s,"pointerleave")&&i(s),s=s.parentNode}function o(t,e){["pointerdown","pointermove","pointerup","pointerover","pointerout"].forEach(function(i){window.addEventListener(t(i),function(t){!R&&E(t.target,i)&&e(t,i,!0)})}),void 0===window["on"+t("pointerenter").toLowerCase()]&&window.addEventListener(t("pointerover"),function(t){if(!R){var i=E(t.target,"pointerenter");i&&i!==window&&(i.contains(t.relatedTarget)||s(i,t.relatedTarget,function(i){e(t,"pointerenter",!1,i,t.relatedTarget)}))}}),void 0===window["on"+t("pointerleave").toLowerCase()]&&window.addEventListener(t("pointerout"),function(t){if(!R){var i=E(t.target,"pointerleave");i&&i!==window&&(i.contains(t.relatedTarget)||a(i,t.relatedTarget,function(i){e(t,"pointerleave",!1,i,t.relatedTarget)}))}})}if(!window.PointerEvent){Array.prototype.indexOf||(Array.prototype.indexOf=function(t){var e=Object(this),i=e.length>>>0;if(0===i)return-1;var n=0;if(arguments.length>0&&(n=Number(arguments[1]),n!=n?n=0:0!=n&&1/0!=n&&n!=-1/0&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),n>=i)return-1;for(var r=n>=0?n:Math.max(i-Math.abs(n),0);i>r;r++)if(r in e&&e[r]===t)return r;return-1}),Array.prototype.forEach||(Array.prototype.forEach=function(t,e){if(!(this&&t instanceof Function))throw new TypeError;for(var i=0;i<this.length;i++)t.call(e,this[i],i,this)}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/,"")});var h=["pointerdown","pointerup","pointermove","pointerover","pointerout","pointercancel","pointerenter","pointerleave"],c=["PointerDown","PointerUp","PointerMove","PointerOver","PointerOut","PointerCancel","PointerEnter","PointerLeave"],u="touch",f="pen",l="mouse",d={},p=function(t){for(;t&&!t.handjs_forcePreventDefault;)t=t.parentNode;return!!t||window.handjs_forcePreventDefault},v=function(t,e,i,n,r){var s;if(document.createEvent?(s=document.createEvent("MouseEvents"),s.initMouseEvent(e,i,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,r||t.relatedTarget)):(s=document.createEventObject(),s.screenX=t.screenX,s.screenY=t.screenY,s.clientX=t.clientX,s.clientY=t.clientY,s.ctrlKey=t.ctrlKey,s.altKey=t.altKey,s.shiftKey=t.shiftKey,s.metaKey=t.metaKey,s.button=t.button,s.relatedTarget=r||t.relatedTarget),void 0===s.offsetX&&(void 0!==t.offsetX?(Object&&void 0!==Object.defineProperty&&(Object.defineProperty(s,"offsetX",{writable:!0}),Object.defineProperty(s,"offsetY",{writable:!0})),s.offsetX=t.offsetX,s.offsetY=t.offsetY):Object&&void 0!==Object.defineProperty?(Object.defineProperty(s,"offsetX",{get:function(){return this.currentTarget&&this.currentTarget.offsetLeft?t.clientX-this.currentTarget.offsetLeft:t.clientX}}),Object.defineProperty(s,"offsetY",{get:function(){return this.currentTarget&&this.currentTarget.offsetTop?t.clientY-this.currentTarget.offsetTop:t.clientY}})):void 0!==t.layerX&&(s.offsetX=t.layerX-t.currentTarget.offsetLeft,s.offsetY=t.layerY-t.currentTarget.offsetTop)),s.isPrimary=void 0!==t.isPrimary?t.isPrimary:!0,t.pressure)s.pressure=t.pressure;else{var a=0;void 0!==t.which?a=t.which:void 0!==t.button&&(a=t.button),s.pressure=0==a?0:.5}if(s.rotation=t.rotation?t.rotation:0,s.hwTimestamp=t.hwTimestamp?t.hwTimestamp:0,s.tiltX=t.tiltX?t.tiltX:0,s.tiltY=t.tiltY?t.tiltY:0,s.height=t.height?t.height:0,s.width=t.width?t.width:0,s.preventDefault=function(){void 0!==t.preventDefault&&t.preventDefault()},void 0!==s.stopPropagation){var o=s.stopPropagation;s.stopPropagation=function(){void 0!==t.stopPropagation&&t.stopPropagation(),o.call(this)}}switch(s.pointerId=t.pointerId,s.pointerType=t.pointerType,s.pointerType){case 2:s.pointerType=u;break;case 3:s.pointerType=f;break;case 4:s.pointerType=l}n?n.dispatchEvent(s):t.target?t.target.dispatchEvent(s):t.srcElement.fireEvent("on"+w(e),s)},m=function(t,e,i,n,r){t.pointerId=1,t.pointerType=l,v(t,e,i,n,r)},g=function(t,e,i,n,r,s){var a=e.identifier+2;e.pointerId=a,e.pointerType=u,e.currentTarget=i,void 0!==n.preventDefault&&(e.preventDefault=function(){n.preventDefault()}),v(e,t,r,i,s)},_=function(t,e){return t.__handjsGlobalRegisteredEvents&&t.__handjsGlobalRegisteredEvents[e]},E=function(t,e){for(;t&&!_(t,e);)t=t.parentNode;return t?t:_(window,e)?window:void 0},T=function(t,e,i,n,r,s){E(i,t)&&g(t,e,i,n,r,s)},w=function(t){return t.toLowerCase().replace("pointer","mouse")},y=function(t,e){var i=h.indexOf(e),n=t+c[i];return n},M=function(t,e,i,n){if(void 0===t.__handjsRegisteredEvents&&(t.__handjsRegisteredEvents=[]),n){if(void 0!==t.__handjsRegisteredEvents[e])return void t.__handjsRegisteredEvents[e]++;t.__handjsRegisteredEvents[e]=1,t.addEventListener(e,i,!1)}else{if(-1!==t.__handjsRegisteredEvents.indexOf(e)&&(t.__handjsRegisteredEvents[e]--,0!=t.__handjsRegisteredEvents[e]))return;t.removeEventListener(e,i),t.__handjsRegisteredEvents[e]=0}},A=function(t,e,i){if(t.__handjsGlobalRegisteredEvents||(t.__handjsGlobalRegisteredEvents=[]),i){if(void 0!==t.__handjsGlobalRegisteredEvents[e])return void t.__handjsGlobalRegisteredEvents[e]++;t.__handjsGlobalRegisteredEvents[e]=1}else void 0!==t.__handjsGlobalRegisteredEvents[e]&&(t.__handjsGlobalRegisteredEvents[e]--,t.__handjsGlobalRegisteredEvents[e]<0&&(t.__handjsGlobalRegisteredEvents[e]=0));var n,r;switch(window.MSPointerEvent?(n=function(t){return y("MS",t)},r=v):(n=w,r=m),e){case"pointerenter":case"pointerleave":var s=n(e);void 0!==t["on"+s.toLowerCase()]&&M(t,s,function(t){r(t,e)},i)}},x=function(t){var e=t.prototype?t.prototype.addEventListener:t.addEventListener,i=function(t,i,n){-1!=h.indexOf(t)&&A(this,t,!0),void 0===e?this.attachEvent("on"+w(t),i):e.call(this,t,i,n)};t.prototype?t.prototype.addEventListener=i:t.addEventListener=i},D=function(t){var e=t.prototype?t.prototype.removeEventListener:t.removeEventListener,i=function(t,i,n){-1!=h.indexOf(t)&&A(this,t,!1),void 0===e?this.detachEvent(w(t),i):e.call(this,t,i,n)};t.prototype?t.prototype.removeEventListener=i:t.removeEventListener=i};x(window),x(window.HTMLElement||window.Element),x(document),x(HTMLBodyElement),x(HTMLDivElement),x(HTMLImageElement),x(HTMLUListElement),x(HTMLAnchorElement),x(HTMLLIElement),x(HTMLTableElement),window.HTMLSpanElement&&x(HTMLSpanElement),window.HTMLCanvasElement&&x(HTMLCanvasElement),window.SVGElement&&x(SVGElement),D(window),D(window.HTMLElement||window.Element),D(document),D(HTMLBodyElement),D(HTMLDivElement),D(HTMLImageElement),D(HTMLUListElement),D(HTMLAnchorElement),D(HTMLLIElement),D(HTMLTableElement),window.HTMLSpanElement&&D(HTMLSpanElement),window.HTMLCanvasElement&&D(HTMLCanvasElement),window.SVGElement&&D(SVGElement);var R=!1,b=-1;!function(){window.MSPointerEvent?o(function(t){return y("MS",t)},v):(o(w,m),void 0!==window.ontouchstart&&(window.addEventListener("touchstart",function(t){for(var e=0;e<t.changedTouches.length;++e){var n=t.changedTouches[e];d[n.identifier]=n.target,T("pointerover",n,n.target,t,!0),s(n.target,null,function(e){g("pointerenter",n,e,t,!1)}),T("pointerdown",n,n.target,t,!0)}i()}),window.addEventListener("touchend",function(t){for(var e=0;e<t.changedTouches.length;++e){var n=t.changedTouches[e],r=d[n.identifier];T("pointerup",n,r,t,!0),T("pointerout",n,r,t,!0),a(r,null,function(e){g("pointerleave",n,e,t,!1)})}i()}),window.addEventListener("touchmove",function(t){for(var e=0;e<t.changedTouches.length;++e){var n=t.changedTouches[e],r=document.elementFromPoint(n.clientX,n.clientY),o=d[n.identifier];o&&p(o)===!0&&t.preventDefault(),T("pointermove",n,o,t,!0),o!==r&&(o&&(T("pointerout",n,o,t,!0,r),o.contains(r)||a(o,r,function(e){g("pointerleave",n,e,t,!1,r)})),r&&(T("pointerover",n,r,t,!0,o),r.contains(o)||s(r,o,function(e){g("pointerenter",n,e,t,!1,o)})),d[n.identifier]=r)}i()}),window.addEventListener("touchcancel",function(t){for(var e=0;e<t.changedTouches.length;++e){var i=t.changedTouches[e];T("pointercancel",i,d[i.identifier],t,!0)}})))}(),void 0===navigator.pointerEnabled&&(navigator.pointerEnabled=!0,navigator.msPointerEnabled&&(navigator.maxTouchPoints=navigator.msMaxTouchPoints)),document.styleSheets&&document.addEventListener&&document.addEventListener("DOMContentLoaded",function(){if(!e.doNotProcessCSS&&void 0===document.body.style.touchAction){var i=new RegExp(".+?{.*?}","m"),n=new RegExp(".+?{","m"),r=function(t){var e=i.exec(t);if(e){var r=e[0];t=t.replace(r,"").trim();var s=n.exec(r)[0].replace("{","").trim();if(-1!=r.replace(/\s/g,"").indexOf("touch-action:none"))for(var a=document.querySelectorAll(s),o=0;o<a.length;o++){var h=a[o];void 0!==h.style.msTouchAction?h.style.msTouchAction="none":h.handjs_forcePreventDefault=!0}return t}},s=function(e){if(window.setImmediate)e&&t(s,r(e));else for(;e;)e=r(e)};try{for(var a=0;a<document.styleSheets.length;a++){var o=document.styleSheets[a];if(void 0!=o.href){var h=new XMLHttpRequest;h.open("get",o.href),h.send();var c=h.responseText.replace(/(\n|\r)/g,"");s(c)}}}catch(u){}for(var f=document.getElementsByTagName("style"),a=0;a<f.length;a++){var l=f[a],d=l.innerHTML.replace(/(\n|\r)/g,"").trim();s(d)}}},!1)}}()}).call(e,i(2).setImmediate)},function(t){var e={};e.A=65,e.B=66,e.C=67,e.D=68,e.E=69,e.F=70,e.G=71,e.H=72,e.I=73,e.J=74,e.K=75,e.L=76,e.M=77,e.N=78,e.O=79,e.P=80,e.Q=81,e.R=82,e.S=83,e.T=84,e.U=85,e.V=86,e.W=87,e.X=88,e.Y=89,e.Z=90,e.ZERO=48,e.ONE=49,e.TWO=50,e.THREE=51,e.FOUR=52,e.FIVE=53,e.SIX=54,e.SEVEN=55,e.EIGHT=56,e.NINE=57,e.NUMPAD_0=96,e.NUMPAD_1=97,e.NUMPAD_2=98,e.NUMPAD_3=99,e.NUMPAD_4=100,e.NUMPAD_5=101,e.NUMPAD_6=102,e.NUMPAD_7=103,e.NUMPAD_8=104,e.NUMPAD_9=105,e.NUMPAD_MULTIPLY=106,e.NUMPAD_ADD=107,e.NUMPAD_ENTER=108,e.NUMPAD_SUBTRACT=109,e.NUMPAD_DECIMAL=110,e.NUMPAD_DIVIDE=111,e.F1=112,e.F2=113,e.F3=114,e.F4=115,e.F5=116,e.F6=117,e.F7=118,e.F8=119,e.F9=120,e.F10=121,e.F11=122,e.F12=123,e.F13=124,e.F14=125,e.F15=126,e.COLON=186,e.EQUALS=187,e.UNDERSCORE=189,e.QUESTION_MARK=191,e.TILDE=192,e.OPEN_BRACKET=219,e.BACKWARD_SLASH=220,e.CLOSEL_BRACKET=221,e.QUOTES=222,e.BACKSPACE=8,e.TAB=9,e.CLEAR=12,e.ENTER=13,e.SHIFT=16,e.CONTROL=17,e.ALT=18,e.CAPS_LOCK=20,e.ESC=27,e.SPACEBAR=32,e.PAGE_UP=33,e.PAGE_DOWN=34,e.END=35,e.HOME=36,e.LEFT=37,e.UP=38,e.RIGHT=39,e.DOWN=40,e.INSERT=45,e.DELETE=46,e.HELP=47,e.NUM_LOCK=144,t.exports=e},function(t,e,i){var n=i(6).GLMAT_ARRAY_TYPE,r={};r.create=function(){var t=new n(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},r.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},r.clone=function(t){var e=new n(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},r.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},r.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},r.transpose=function(t,e){if(t===e){var i=e[1],n=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=n,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},r.invert=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],c=e[7],u=e[8],f=u*a-o*c,l=-u*s+o*h,d=c*s-a*h,p=i*f+n*l+r*d;return p?(p=1/p,t[0]=f*p,t[1]=(-u*n+r*c)*p,t[2]=(o*n-r*a)*p,t[3]=l*p,t[4]=(u*i-r*h)*p,t[5]=(-o*i+r*s)*p,t[6]=d*p,t[7]=(-c*i+n*h)*p,t[8]=(a*i-n*s)*p,t):null},r.adjoint=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],c=e[7],u=e[8];return t[0]=a*u-o*c,t[1]=r*c-n*u,t[2]=n*o-r*a,t[3]=o*h-s*u,t[4]=i*u-r*h,t[5]=r*s-i*o,t[6]=s*c-a*h,t[7]=n*h-i*c,t[8]=i*a-n*s,t},r.determinant=function(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],c=t[8];return e*(c*s-a*h)+i*(-c*r+a*o)+n*(h*r-s*o)},r.multiply=function(t,e,i){var n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],c=e[6],u=e[7],f=e[8],l=i[0],d=i[1],p=i[2],v=i[3],m=i[4],g=i[5],_=i[6],E=i[7],T=i[8];return t[0]=l*n+d*a+p*c,t[1]=l*r+d*o+p*u,t[2]=l*s+d*h+p*f,t[3]=v*n+m*a+g*c,t[4]=v*r+m*o+g*u,t[5]=v*s+m*h+g*f,t[6]=_*n+E*a+T*c,t[7]=_*r+E*o+T*u,t[8]=_*s+E*h+T*f,t},r.mul=r.multiply,r.translate=function(t,e,i){var n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],c=e[6],u=e[7],f=e[8],l=i[0],d=i[1];return t[0]=n,t[1]=r,t[2]=s,t[3]=a,t[4]=o,t[5]=h,t[6]=l*n+d*a+c,t[7]=l*r+d*o+u,t[8]=l*s+d*h+f,t},r.rotate=function(t,e,i){var n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],c=e[6],u=e[7],f=e[8],l=Math.sin(i),d=Math.cos(i);return t[0]=d*n+l*a,t[1]=d*r+l*o,t[2]=d*s+l*h,t[3]=d*a-l*n,t[4]=d*o-l*r,t[5]=d*h-l*s,t[6]=c,t[7]=u,t[8]=f,t},r.scale=function(t,e,i){var n=i[0],r=i[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},r.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},r.fromRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},r.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},r.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},r.fromQuat=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],a=i+i,o=n+n,h=r+r,c=i*a,u=n*a,f=n*o,l=r*a,d=r*o,p=r*h,v=s*a,m=s*o,g=s*h;return t[0]=1-f-p,t[3]=u-g,t[6]=l+m,t[1]=u+g,t[4]=1-c-p,t[7]=d-v,t[2]=l-m,t[5]=d+v,t[8]=1-c-f,t},r.normalFromMat4=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],c=e[7],u=e[8],f=e[9],l=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15],_=i*o-n*a,E=i*h-r*a,T=i*c-s*a,w=n*h-r*o,y=n*c-s*o,M=r*c-s*h,A=u*v-f*p,x=u*m-l*p,D=u*g-d*p,R=f*m-l*v,b=f*g-d*v,P=l*g-d*m,L=_*P-E*b+T*R+w*D-y*x+M*A;return L?(L=1/L,t[0]=(o*P-h*b+c*R)*L,t[1]=(h*D-a*P-c*x)*L,t[2]=(a*b-o*D+c*A)*L,t[3]=(r*b-n*P-s*R)*L,t[4]=(i*P-r*D+s*x)*L,t[5]=(n*D-i*b-s*A)*L,t[6]=(v*M-m*y+g*w)*L,t[7]=(m*T-p*M-g*E)*L,t[8]=(p*y-v*T+g*_)*L,t):null},r.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},r.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},t.exports=r},function(t,e,i){var n=i(6).GLMAT_ARRAY_TYPE,r={};r.create=function(){var t=new n(2);return t[0]=0,t[1]=0,t},r.clone=function(t){var e=new n(2);return e[0]=t[0],e[1]=t[1],e},r.fromValues=function(t,e){var i=new n(2);return i[0]=t,i[1]=e,i},r.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},r.set=function(t,e,i){return t[0]=e,t[1]=i,t},r.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t},r.subtract=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t},r.sub=r.subtract,r.multiply=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t},r.mul=r.multiply,r.divide=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t},r.div=r.divide,r.min=function(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t},r.max=function(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t},r.scale=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t},r.scaleAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t},r.distance=function(t,e){var i=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(i*i+n*n)},r.dist=r.distance,r.squaredDistance=function(t,e){var i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n},r.sqrDist=r.squaredDistance,r.length=function(t){var e=t[0],i=t[1];return Math.sqrt(e*e+i*i)},r.len=r.length,r.squaredLength=function(t){var e=t[0],i=t[1];return e*e+i*i},r.sqrLen=r.squaredLength,r.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},r.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},r.normalize=function(t,e){var i=e[0],n=e[1],r=i*i+n*n;return r>0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t},r.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},r.cross=function(t,e,i){var n=e[0]*i[1]-e[1]*i[0];return t[0]=t[1]=0,t[2]=n,t},r.lerp=function(t,e,i,n){var r=e[0],s=e[1];return t[0]=r+n*(i[0]-r),t[1]=s+n*(i[1]-s),t},r.random=function(t,e){e=e||1;var i=2*GLMAT_RANDOM()*Math.PI;return t[0]=Math.cos(i)*e,t[1]=Math.sin(i)*e,t},r.transformMat2=function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r,t[1]=i[1]*n+i[3]*r,t},r.transformMat2d=function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r+i[4],t[1]=i[1]*n+i[3]*r+i[5],t},r.transformMat3=function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[3]*r+i[6],t[1]=i[1]*n+i[4]*r+i[7],t},r.transformMat4=function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[4]*r+i[12],t[1]=i[1]*n+i[5]*r+i[13],t},r.forEach=function(){var t=r.create();return function(e,i,n,r,s,a){var o,h;for(i||(i=2),n||(n=0),h=r?Math.min(r*i+n,e.length):e.length,o=n;h>o;o+=i)t[0]=e[o],t[1]=e[o+1],s(t,t,a),e[o]=t[0],e[o+1]=t[1];return e}}(),r.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},t.exports=r},,,function(t,e,i){function n(){for(var t=y;w>t;t++){var e=T[t];e.x=-300,e.y=800*Math.random()|-800,e.angle=Math.random(),e.scale=1*Math.random(),e.vx=200*Math.random()+300,e.vy=200*Math.random()+500,e.va=Math.random()-.5,e.alpha=Math.random(),y++}}function r(t){var e=T[t];T[t]=T[y-1],T[y-1]=e,y--}function s(t){for(var e=y-1;e>=0;e--){var i=T[e];i.x+=i.vx*t,i.y+=i.vy*t,i.angle+=i.va*t,i.alpha>0&&(i.alpha-=.001),(i.x>3e3||i.y>3e3)&&r(e)}}function a(t,e){for(var i=y-1;i>=0;i--){var n=T[i],r=n.x,s=n.y,a=n.angle,o=n.scale,h=n.alpha;t.draw(e,[r,s],null,[e.width/2,e.height/2],a,[o,o],[h,h,h,h])}}for(var o,h,c=i(22),u=(i(10),i(9)),f=i(28),l=(i(7),i(25)),d=(i(5),i(8),i(1),i(4)),p=i(11),v=(p.create(),[]),m=0,g=0,_=0,E=0,T=[],w=50,y=0,M=0,A=0;2e4>A;A++)T.push({x:-300,y:800*Math.random()|-800,angle:Math.random(),scale:Math.random(),vx:200*Math.random()+100,vy:200*Math.random()+100,va:Math.random()-.5,alpha:Math.random()});var x=c.extend({initialize:function(){this.base(),this.width=960,this.height=600,this.graphicsDevice.backBufferWidth=this.width,this.graphicsDevice.backBufferHeight=this.height,u.addKey(f.LEFT),u.addKey(f.RIGHT),u.addKey(f.UP),u.addKey(f.DOWN),u.addKey(f.SPACEBAR)},loadContent:function(){v[1]=this.content.load.Texture2D("textures/floor_tile_02-1024.jpg"),v[2]=this.content.load.Texture2D("textures/face.jpg"),v[3]=this.content.load.Texture2D("fonts/ArialBlack_0.png"),v[4]=this.content.load.Texture2D("textures/asteroid0.png"),v[5]=this.content.load.Texture2D("textures/fire.png"),v[6]=this.content.load.Texture2D("textures/smoke.png"),this.spriteBatch=new l(this.graphicsDevice),this.fontLittera=this.content.load.SpriteFont("fonts/font.fnt"),this.fontArcade=this.content.load.SpriteFont("fonts/arcade.fnt"),this.font=this.content.load.SpriteFont("fonts/quant.fnt")},update:function(t){n(),s(t.elapsedGameTime/1e3)},draw:function(t){if(this.content.isReady){{this.graphicsDevice.gl}M?(this.graphicsDevice.clear([0,0,0,0]),this.spriteBatch.begin(d.ADDITIVE)):(this.graphicsDevice.clear([100/255,149/255,237/255,1]),this.spriteBatch.begin()),o=30,h=150,m=(m+t.elapsedGameTime/1e3*.8)%360,g++,_+=t.elapsedGameTime;var e=E.toPrecision(2);a(this.spriteBatch,v[4]),this.spriteBatch.drawString(this.fontLittera,"Time: "+Date(),[o,h+-50],null,0,[.5,.5],null),this.spriteBatch.drawString(this.fontLittera,"Time: "+Date(),[o,h+-80],null,0,[.5,.5],null),this.spriteBatch.drawString(this.fontLittera,"fps: "+e,[o,h],null,0,[1,1],null),this.spriteBatch.drawString(this.fontLittera,"xna.js framework",[o,h+50],null,0,[1,1],null),this.spriteBatch.drawString(this.fontLittera,"xna.js framework",[o,h+300],null,0,[1,1],null),this.spriteBatch.drawString(this.fontLittera,"Press space to change blending",[o,h+350],null,0,[1,1],null),this.spriteBatch.drawString(this.fontArcade,"xna.js framework",[o,h+150],null,0,[1,1],null),this.spriteBatch.drawString(this.fontArcade,"Hello 3",[o,h+200],null,0,[m%3/2,m%3/2],null),this.spriteBatch.end(),this.spriteBatch.begin(d.ADDITIVE);var i=1,n=[i,i,i,0.2];this.spriteBatch.drawString(this.font,"xna.js",[10,10],null,0,[1,1],n),this.spriteBatch.drawString(this.font,"FPS: "+E,[10,28],null,0,[1,1],n),this.spriteBatch.drawString(this.font,"Particles: "+w,[10,46],null,0,[1,1],n),this.spriteBatch.end()}}});t.exports=x}]);
  