/*!
 * @license twgl.js 4.14.2 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
 * Available via the MIT license.
 * see: http://github.com/greggman/twgl.js for details
 */
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.twgl=r():e.twgl=r()}("undefined"!=typeof self?self:this,(function(){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=8)}([function(e,r,t){"use strict";r.__esModule=!0,r.copyExistingProperties=function(e,r){Object.keys(r).forEach((function(t){r.hasOwnProperty(t)&&e.hasOwnProperty(t)&&(r[t]=e[t])}))},r.copyNamedProperties=function(e,r,t){e.forEach((function(e){var n=r[e];void 0!==n&&(t[e]=n)}))},r.error=function(){var e;(e=console).error.apply(e,arguments)},r.warn=function(){var e;(e=console).warn.apply(e,arguments)},r.isBuffer=function(e,r){return"undefined"!=typeof WebGLBuffer&&r instanceof WebGLBuffer},r.isRenderbuffer=function(e,r){return"undefined"!=typeof WebGLRenderbuffer&&r instanceof WebGLRenderbuffer},r.isShader=function(e,r){return"undefined"!=typeof WebGLShader&&r instanceof WebGLShader},r.isTexture=function(e,r){return"undefined"!=typeof WebGLTexture&&r instanceof WebGLTexture},r.isSampler=function(e,r){return"undefined"!=typeof WebGLSampler&&r instanceof WebGLSampler}},function(e,r,t){"use strict";r.__esModule=!0,r.getGLTypeForTypedArray=function(e){if(e instanceof Int8Array)return 5120;if(e instanceof Uint8Array)return 5121;if(e instanceof Uint8ClampedArray)return 5121;if(e instanceof Int16Array)return 5122;if(e instanceof Uint16Array)return 5123;if(e instanceof Int32Array)return 5124;if(e instanceof Uint32Array)return 5125;if(e instanceof Float32Array)return 5126;throw new Error("unsupported typed array type")},r.getGLTypeForTypedArrayType=function(e){if(e===Int8Array)return 5120;if(e===Uint8Array)return 5121;if(e===Uint8ClampedArray)return 5121;if(e===Int16Array)return 5122;if(e===Uint16Array)return 5123;if(e===Int32Array)return 5124;if(e===Uint32Array)return 5125;if(e===Float32Array)return 5126;throw new Error("unsupported typed array type")},r.getTypedArrayTypeForGLType=function(e){var r=n[e];if(!r)throw new Error("unknown gl type");return r},r.isArrayBuffer=void 0;var n={},o=n;o[5120]=Int8Array,o[5121]=Uint8Array,o[5122]=Int16Array,o[5123]=Uint16Array,o[5124]=Int32Array,o[5125]=Uint32Array,o[5126]=Float32Array,o[32819]=Uint16Array,o[32820]=Uint16Array,o[33635]=Uint16Array,o[5131]=Uint16Array,o[33640]=Uint32Array,o[35899]=Uint32Array,o[35902]=Uint32Array,o[36269]=Uint32Array,o[34042]=Uint32Array;var u="undefined"!=typeof SharedArrayBuffer?function(e){return e&&e.buffer&&(e.buffer instanceof ArrayBuffer||e.buffer instanceof SharedArrayBuffer)}:function(e){return e&&e.buffer&&e.buffer instanceof ArrayBuffer};r.isArrayBuffer=u},function(e,r,t){"use strict";r.__esModule=!0,r.add=function(e,r,t){return(t=t||new n(3))[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},r.copy=function(e,r){return(r=r||new n(3))[0]=e[0],r[1]=e[1],r[2]=e[2],r},r.create=function(e,r,t){var o=new n(3);e&&(o[0]=e);r&&(o[1]=r);t&&(o[2]=t);return o},r.cross=function(e,r,t){t=t||new n(3);var o=e[2]*r[0]-e[0]*r[2],u=e[0]*r[1]-e[1]*r[0];return t[0]=e[1]*r[2]-e[2]*r[1],t[1]=o,t[2]=u,t},r.distance=function(e,r){var t=e[0]-r[0],n=e[1]-r[1],o=e[2]-r[2];return Math.sqrt(t*t+n*n+o*o)},r.distanceSq=function(e,r){var t=e[0]-r[0],n=e[1]-r[1],o=e[2]-r[2];return t*t+n*n+o*o},r.divide=function(e,r,t){return(t=t||new n(3))[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t},r.divScalar=function(e,r,t){return(t=t||new n(3))[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r,t},r.dot=function(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]},r.lerp=function(e,r,t,o){return(o=o||new n(3))[0]=e[0]+t*(r[0]-e[0]),o[1]=e[1]+t*(r[1]-e[1]),o[2]=e[2]+t*(r[2]-e[2]),o},r.lerpV=function(e,r,t,o){return(o=o||new n(3))[0]=e[0]+t[0]*(r[0]-e[0]),o[1]=e[1]+t[1]*(r[1]-e[1]),o[2]=e[2]+t[2]*(r[2]-e[2]),o},r.length=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])},r.lengthSq=function(e){return e[0]*e[0]+e[1]*e[1]+e[2]*e[2]},r.max=function(e,r,t){return(t=t||new n(3))[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t},r.min=function(e,r,t){return(t=t||new n(3))[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t},r.mulScalar=function(e,r,t){return(t=t||new n(3))[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},r.multiply=function(e,r,t){return(t=t||new n(3))[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t},r.negate=function(e,r){return(r=r||new n(3))[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r},r.normalize=function(e,r){r=r||new n(3);var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],o=Math.sqrt(t);o>1e-5?(r[0]=e[0]/o,r[1]=e[1]/o,r[2]=e[2]/o):(r[0]=0,r[1]=0,r[2]=0);return r},r.setDefaultType=function(e){var r=n;return n=e,r},r.subtract=function(e,r,t){return(t=t||new n(3))[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};var n=Float32Array},function(e,r,t){"use strict";r.__esModule=!0,r.isWebGL1=function(e){return!e.texStorage2D},r.isWebGL2=function(e){return!!e.texStorage2D},r.glEnumToString=void 0;var n,o,u=(n={},o={},function(e,r){return function(e){var r=e.constructor.name;if(!n[r]){for(var t in e)if("number"==typeof e[t]){var u=o[e[t]];o[e[t]]=u?"".concat(u," | ").concat(t):t}n[r]=!0}}(e),o[r]||"0x"+r.toString(16)});r.glEnumToString=u},function(e,r,t){"use strict";r.__esModule=!0,r.createAttributeSetters=D,r.createProgram=T,r.createProgramFromScripts=function(e,r,t,n,o){for(var u=j(t,n,o),i=[],a=0;a<r.length;++a){var f=g(e,r[a],e[M[a]],u.errorCallback);if(!f)return null;i.push(f)}return T(e,i,u)},r.createProgramFromSources=z,r.createProgramInfo=function(e,r,t,n,o){var u=j(t,n,o),i=!0;if(r=r.map((function(e){if(e.indexOf("\n")<0){var r=c(e);r?e=r.text:(u.errorCallback("no element with id: "+e),i=!1)}return e})),!i)return null;var a=z(e,r,u);if(!a)return null;return H(e,a)},r.createProgramInfoFromProgram=H,r.createUniformSetters=C,r.createUniformBlockSpecFromProgram=W,r.createUniformBlockInfoFromProgram=B,r.createUniformBlockInfo=function(e,r,t){return B(e,r.program,r.uniformBlockSpec,t)},r.createTransformFeedback=function(e,r,t){var n=e.createTransformFeedback();return e.bindTransformFeedback(36386,n),e.useProgram(r.program),k(e,r,t),e.bindTransformFeedback(36386,null),n},r.createTransformFeedbackInfo=S,r.bindTransformFeedbackInfo=k,r.setAttributes=N,r.setBuffersAndAttributes=function(e,r,t){t.vertexArrayObject?e.bindVertexArray(t.vertexArrayObject):(N(r.attribSetters||r,t.attribs),t.indices&&e.bindBuffer(34963,t.indices))},r.setUniforms=G,r.setUniformBlock=function(e,r,t){L(e,r,t)&&e.bufferData(35345,t.array,35048)},r.setBlockUniforms=function(e,r){var t=e.uniforms;for(var n in r){var o=t[n];if(o){var u=r[n];u.length?o.set(u):o[0]=u}}},r.bindUniformBlock=L,r.setUniformsAndBindTextures=void 0;var n=i(t(3)),o=i(t(0));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function i(e){if(e&&e.__esModule)return e;var r=u();if(r&&r.has(e))return r.get(e);var t={};if(null!=e){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(t,o,i):t[o]=e[o]}}return t.default=e,r&&r.set(e,t),t}var a=o.error,f=o.warn;function c(e){return"undefined"!=typeof document&&document.getElementById?document.getElementById(e):null}var l={};function s(e,r){return l[r].bindPoint}function v(e,r){return function(t){e.uniform1i(r,t)}}function b(e,r){return function(t){e.uniform1iv(r,t)}}function y(e,r){return function(t){e.uniform2iv(r,t)}}function d(e,r){return function(t){e.uniform3iv(r,t)}}function m(e,r){return function(t){e.uniform4iv(r,t)}}function p(e,r,t,u){var i=s(0,r);return n.isWebGL2(e)?function(r){var n,a;o.isTexture(e,r)?(n=r,a=null):(n=r.texture,a=r.sampler),e.uniform1i(u,t),e.activeTexture(33984+t),e.bindTexture(i,n),e.bindSampler(t,a)}:function(r){e.uniform1i(u,t),e.activeTexture(33984+t),e.bindTexture(i,r)}}function x(e,r,t,u,i){for(var a=s(0,r),f=new Int32Array(i),c=0;c<i;++c)f[c]=t+c;return n.isWebGL2(e)?function(r){e.uniform1iv(u,f),r.forEach((function(r,n){var u,i;e.activeTexture(33984+f[n]),o.isTexture(e,r)?(u=r,i=null):(u=r.texture,i=r.sampler),e.bindSampler(t,i),e.bindTexture(a,u)}))}:function(r){e.uniform1iv(u,f),r.forEach((function(r,t){e.activeTexture(33984+f[t]),e.bindTexture(a,r)}))}}function w(e,r){return function(t){if(t.value)switch(e.disableVertexAttribArray(r),t.value.length){case 4:e.vertexAttrib4fv(r,t.value);break;case 3:e.vertexAttrib3fv(r,t.value);break;case 2:e.vertexAttrib2fv(r,t.value);break;case 1:e.vertexAttrib1fv(r,t.value);break;default:throw new Error("the length of a float constant value must be between 1 and 4!")}else e.bindBuffer(34962,t.buffer),e.enableVertexAttribArray(r),e.vertexAttribPointer(r,t.numComponents||t.size,t.type||5126,t.normalize||!1,t.stride||0,t.offset||0),void 0!==t.divisor&&e.vertexAttribDivisor(r,t.divisor)}}function h(e,r){return function(t){if(t.value){if(e.disableVertexAttribArray(r),4!==t.value.length)throw new Error("The length of an integer constant value must be 4!");e.vertexAttrib4iv(r,t.value)}else e.bindBuffer(34962,t.buffer),e.enableVertexAttribArray(r),e.vertexAttribIPointer(r,t.numComponents||t.size,t.type||5124,t.stride||0,t.offset||0),void 0!==t.divisor&&e.vertexAttribDivisor(r,t.divisor)}}function F(e,r){return function(t){if(t.value){if(e.disableVertexAttribArray(r),4!==t.value.length)throw new Error("The length of an unsigned integer constant value must be 4!");e.vertexAttrib4uiv(r,t.value)}else e.bindBuffer(34962,t.buffer),e.enableVertexAttribArray(r),e.vertexAttribIPointer(r,t.numComponents||t.size,t.type||5125,t.stride||0,t.offset||0),void 0!==t.divisor&&e.vertexAttribDivisor(r,t.divisor)}}function E(e,r,t){var n=t.size,o=t.count;return function(t){e.bindBuffer(34962,t.buffer);for(var u=t.size||t.numComponents||n,i=u/o,a=t.type||5126,f=l[a].size*u,c=t.normalize||!1,s=t.offset||0,v=f/o,b=0;b<o;++b)e.enableVertexAttribArray(r+b),e.vertexAttribPointer(r+b,i,a,c,f,s+v*b),void 0!==t.divisor&&e.vertexAttribDivisor(r+b,t.divisor)}}l[5126]={Type:Float32Array,size:4,setter:function(e,r){return function(t){e.uniform1f(r,t)}},arraySetter:function(e,r){return function(t){e.uniform1fv(r,t)}}},l[35664]={Type:Float32Array,size:8,setter:function(e,r){return function(t){e.uniform2fv(r,t)}}},l[35665]={Type:Float32Array,size:12,setter:function(e,r){return function(t){e.uniform3fv(r,t)}}},l[35666]={Type:Float32Array,size:16,setter:function(e,r){return function(t){e.uniform4fv(r,t)}}},l[5124]={Type:Int32Array,size:4,setter:v,arraySetter:b},l[35667]={Type:Int32Array,size:8,setter:y},l[35668]={Type:Int32Array,size:12,setter:d},l[35669]={Type:Int32Array,size:16,setter:m},l[5125]={Type:Uint32Array,size:4,setter:function(e,r){return function(t){e.uniform1ui(r,t)}},arraySetter:function(e,r){return function(t){e.uniform1uiv(r,t)}}},l[36294]={Type:Uint32Array,size:8,setter:function(e,r){return function(t){e.uniform2uiv(r,t)}}},l[36295]={Type:Uint32Array,size:12,setter:function(e,r){return function(t){e.uniform3uiv(r,t)}}},l[36296]={Type:Uint32Array,size:16,setter:function(e,r){return function(t){e.uniform4uiv(r,t)}}},l[35670]={Type:Uint32Array,size:4,setter:v,arraySetter:b},l[35671]={Type:Uint32Array,size:8,setter:y},l[35672]={Type:Uint32Array,size:12,setter:d},l[35673]={Type:Uint32Array,size:16,setter:m},l[35674]={Type:Float32Array,size:16,setter:function(e,r){return function(t){e.uniformMatrix2fv(r,!1,t)}}},l[35675]={Type:Float32Array,size:36,setter:function(e,r){return function(t){e.uniformMatrix3fv(r,!1,t)}}},l[35676]={Type:Float32Array,size:64,setter:function(e,r){return function(t){e.uniformMatrix4fv(r,!1,t)}}},l[35685]={Type:Float32Array,size:24,setter:function(e,r){return function(t){e.uniformMatrix2x3fv(r,!1,t)}}},l[35686]={Type:Float32Array,size:32,setter:function(e,r){return function(t){e.uniformMatrix2x4fv(r,!1,t)}}},l[35687]={Type:Float32Array,size:24,setter:function(e,r){return function(t){e.uniformMatrix3x2fv(r,!1,t)}}},l[35688]={Type:Float32Array,size:48,setter:function(e,r){return function(t){e.uniformMatrix3x4fv(r,!1,t)}}},l[35689]={Type:Float32Array,size:32,setter:function(e,r){return function(t){e.uniformMatrix4x2fv(r,!1,t)}}},l[35690]={Type:Float32Array,size:48,setter:function(e,r){return function(t){e.uniformMatrix4x3fv(r,!1,t)}}},l[35678]={Type:null,size:0,setter:p,arraySetter:x,bindPoint:3553},l[35680]={Type:null,size:0,setter:p,arraySetter:x,bindPoint:34067},l[35679]={Type:null,size:0,setter:p,arraySetter:x,bindPoint:32879},l[35682]={Type:null,size:0,setter:p,arraySetter:x,bindPoint:3553},l[36289]={Type:null,size:0,setter:p,arraySetter:x,bindPoint:35866},l[36292]={Type:null,size:0,setter:p,arraySetter:x,bindPoint:35866},l[36293]={Type:null,size:0,setter:p,arraySetter:x,bindPoint:34067},l[36298]={Type:null,size:0,setter:p,arraySetter:x,bindPoint:3553},l[36299]={Type:null,size:0,setter:p,arraySetter:x,bindPoint:32879},l[36300]={Type:null,size:0,setter:p,arraySetter:x,bindPoint:34067},l[36303]={Type:null,size:0,setter:p,arraySetter:x,bindPoint:35866},l[36306]={Type:null,size:0,setter:p,arraySetter:x,bindPoint:3553},l[36307]={Type:null,size:0,setter:p,arraySetter:x,bindPoint:32879},l[36308]={Type:null,size:0,setter:p,arraySetter:x,bindPoint:34067},l[36311]={Type:null,size:0,setter:p,arraySetter:x,bindPoint:35866};var A={};A[5126]={size:4,setter:w},A[35664]={size:8,setter:w},A[35665]={size:12,setter:w},A[35666]={size:16,setter:w},A[5124]={size:4,setter:h},A[35667]={size:8,setter:h},A[35668]={size:12,setter:h},A[35669]={size:16,setter:h},A[5125]={size:4,setter:F},A[36294]={size:8,setter:F},A[36295]={size:12,setter:F},A[36296]={size:16,setter:F},A[35670]={size:4,setter:h},A[35671]={size:8,setter:h},A[35672]={size:12,setter:h},A[35673]={size:16,setter:h},A[35674]={size:4,setter:E,count:2},A[35675]={size:9,setter:E,count:3},A[35676]={size:16,setter:E,count:4};var O=/^[ \t]*\n/;function _(e,r,t,n){var o=n||a,u=e.createShader(t),i=0;if(O.test(r)&&(i=1,r=r.replace(O,"")),e.shaderSource(u,r),e.compileShader(u),!e.getShaderParameter(u,35713)){var f=e.getShaderInfoLog(u);return o(function(e,r){return r=r||0,++r,e.split("\n").map((function(e,t){return t+r+": "+e})).join("\n")}(r,i)+"\n*** Error compiling shader: "+f),e.deleteShader(u),null}return u}function j(e,r,t){var n,o;if("function"==typeof r&&(t=r,r=void 0),"function"==typeof e)t=e,e=void 0;else if(e&&!Array.isArray(e)){if(e.errorCallback)return e;var u=e;t=u.errorCallback,e=u.attribLocations,n=u.transformFeedbackVaryings,o=u.transformFeedbackMode}var i={errorCallback:t||a,transformFeedbackVaryings:n,transformFeedbackMode:o};if(e){var f={};Array.isArray(e)?e.forEach((function(e,t){f[e]=r?r[t]:t})):f=e,i.attribLocations=f}return i}var M=["VERTEX_SHADER","FRAGMENT_SHADER"];function P(e,r){return r.indexOf("frag")>=0?35632:r.indexOf("vert")>=0?35633:void 0}function R(e,r){r.forEach((function(r){e.deleteShader(r)}))}function T(e,r,t,n,u){for(var i=j(t,n,u),a=[],f=[],l=0;l<r.length;++l){var s=r[l];if("string"==typeof s){var v=c(s),b=v?v.text:s,y=e[M[l]];v&&v.type&&(y=P(0,v.type)||y),s=_(e,b,y,i.errorCallback),f.push(s)}o.isShader(e,s)&&a.push(s)}if(a.length!==r.length)return i.errorCallback("not enough shaders for program"),R(e,f),null;var d=e.createProgram();a.forEach((function(r){e.attachShader(d,r)})),i.attribLocations&&Object.keys(i.attribLocations).forEach((function(r){e.bindAttribLocation(d,i.attribLocations[r],r)}));var m=i.transformFeedbackVaryings;if(m&&(m.attribs&&(m=m.attribs),Array.isArray(m)||(m=Object.keys(m)),e.transformFeedbackVaryings(d,m,i.transformFeedbackMode||35981)),e.linkProgram(d),!e.getProgramParameter(d,35714)){var p=e.getProgramInfoLog(d);return i.errorCallback("Error in program linking:"+p),e.deleteProgram(d),R(e,f),null}return d}function g(e,r,t,n){var o,u=c(r);if(!u)throw new Error("unknown script element: ".concat(r));o=u.text;var i=t||P(0,u.type);if(!i)throw new Error("unknown shader type");return _(e,o,i,n)}function z(e,r,t,n,o){for(var u=j(t,n,o),i=[],a=0;a<r.length;++a){var f=_(e,r[a],e[M[a]],u.errorCallback);if(!f)return null;i.push(f)}return T(e,i,u)}function U(e){var r=e.name;return r.startsWith("gl_")||r.startsWith("webgl_")}function C(e,r){var t=0;function n(r,n){var o,u=e.getUniformLocation(r,n.name),i=n.size>1&&"[0]"===n.name.substr(-3),a=n.type,f=l[a];if(!f)throw new Error("unknown type: 0x".concat(a.toString(16)));if(f.bindPoint){var c=t;t+=n.size,o=i?f.arraySetter(e,a,c,u,n.size):f.setter(e,a,c,u,n.size)}else o=f.arraySetter&&i?f.arraySetter(e,u):f.setter(e,u);return o.location=u,o}for(var o={},u=e.getProgramParameter(r,35718),i=0;i<u;++i){var a=e.getActiveUniform(r,i);if(!U(a)){var f=a.name;"[0]"===f.substr(-3)&&(f=f.substr(0,f.length-3));var c=n(r,a);o[f]=c}}return o}function S(e,r){for(var t={},n=e.getProgramParameter(r,35971),o=0;o<n;++o){var u=e.getTransformFeedbackVarying(r,o);t[u.name]={index:o,type:u.type,size:u.size}}return t}function k(e,r,t){for(var n in r.transformFeedbackInfo&&(r=r.transformFeedbackInfo),t.attribs&&(t=t.attribs),t){var o=r[n];if(o){var u=t[n];u.offset?e.bindBufferRange(35982,o.index,u.buffer,u.offset,u.size):e.bindBufferBase(35982,o.index,u.buffer)}}}function W(e,r){for(var t=e.getProgramParameter(r,35718),n=[],o=[],u=0;u<t;++u){o.push(u),n.push({});var i=e.getActiveUniform(r,u);if(U(i))break;n[u].name=i.name}[["UNIFORM_TYPE","type"],["UNIFORM_SIZE","size"],["UNIFORM_BLOCK_INDEX","blockNdx"],["UNIFORM_OFFSET","offset"]].forEach((function(t){var u=t[0],i=t[1];e.getActiveUniforms(r,o,e[u]).forEach((function(e,r){n[r][i]=e}))}));for(var a={},f=e.getProgramParameter(r,35382),c=0;c<f;++c){var l=e.getActiveUniformBlockName(r,c),s={index:c,usedByVertexShader:e.getActiveUniformBlockParameter(r,c,35396),usedByFragmentShader:e.getActiveUniformBlockParameter(r,c,35398),size:e.getActiveUniformBlockParameter(r,c,35392),uniformIndices:e.getActiveUniformBlockParameter(r,c,35395)};s.used=s.usedByVertexShader||s.usedByFragmentShader,a[l]=s}return{blockSpecs:a,uniformData:n}}var I=/\[\d+\]\.$/;function B(e,r,t,n){var o=t.blockSpecs,u=t.uniformData,i=o[n];if(!i)return f("no uniform block object named:",n),{name:n,uniforms:{}};var a=new ArrayBuffer(i.size),c=e.createBuffer(),s=i.index;e.bindBuffer(35345,c),e.uniformBlockBinding(r,i.index,s);var v=n+".";I.test(v)&&(v=v.replace(I,"."));var b={};return i.uniformIndices.forEach((function(e){var r=u[e],t=l[r.type],n=t.Type,o=r.size*t.size,i=r.name;i.substr(0,v.length)===v&&(i=i.substr(v.length)),b[i]=new n(a,r.offset,o/n.BYTES_PER_ELEMENT)})),{name:n,array:a,asFloat:new Float32Array(a),buffer:c,uniforms:b}}function L(e,r,t){var n=(r.uniformBlockSpec||r).blockSpecs[t.name];if(n){var o=n.index;return e.bindBufferRange(35345,o,t.buffer,t.offset||0,t.array.byteLength),!0}return!1}function G(e,r){for(var t=e.uniformSetters||e,n=arguments.length,o=1;o<n;++o){var u=arguments[o];if(Array.isArray(u))for(var i=u.length,a=0;a<i;++a)G(t,u[a]);else for(var f in u){var c=t[f];c&&c(u[f])}}}var X=G;function D(e,r){for(var t={},n=e.getProgramParameter(r,35721),o=0;o<n;++o){var u=e.getActiveAttrib(r,o);if(!U(u)){var i=e.getAttribLocation(r,u.name),a=A[u.type],f=a.setter(e,i,a);f.location=i,t[u.name]=f}}return t}function N(e,r){for(var t in r){var n=e[t];n&&n(r[t])}}function H(e,r){var t={program:r,uniformSetters:C(e,r),attribSetters:D(e,r)};return n.isWebGL2(e)&&(t.uniformBlockSpec=W(e,r),t.transformFeedbackInfo=S(e,r)),t}r.setUniformsAndBindTextures=X},function(e,r,t){"use strict";r.__esModule=!0,r.axisRotate=function(e,r,t,n){n=n||new f(16);var o=r[0],u=r[1],i=r[2],a=Math.sqrt(o*o+u*u+i*i),c=(o/=a)*o,l=(u/=a)*u,s=(i/=a)*i,v=Math.cos(t),b=Math.sin(t),y=1-v,d=c+(1-c)*v,m=o*u*y+i*b,p=o*i*y-u*b,x=o*u*y-i*b,w=l+(1-l)*v,h=u*i*y+o*b,F=o*i*y+u*b,E=u*i*y-o*b,A=s+(1-s)*v,O=e[0],_=e[1],j=e[2],M=e[3],P=e[4],R=e[5],T=e[6],g=e[7],z=e[8],U=e[9],C=e[10],S=e[11];n[0]=d*O+m*P+p*z,n[1]=d*_+m*R+p*U,n[2]=d*j+m*T+p*C,n[3]=d*M+m*g+p*S,n[4]=x*O+w*P+h*z,n[5]=x*_+w*R+h*U,n[6]=x*j+w*T+h*C,n[7]=x*M+w*g+h*S,n[8]=F*O+E*P+A*z,n[9]=F*_+E*R+A*U,n[10]=F*j+E*T+A*C,n[11]=F*M+E*g+A*S,e!==n&&(n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]);return n},r.axisRotation=function(e,r,t){t=t||new f(16);var n=e[0],o=e[1],u=e[2],i=Math.sqrt(n*n+o*o+u*u),a=(n/=i)*n,c=(o/=i)*o,l=(u/=i)*u,s=Math.cos(r),v=Math.sin(r),b=1-s;return t[0]=a+(1-a)*s,t[1]=n*o*b+u*v,t[2]=n*u*b-o*v,t[3]=0,t[4]=n*o*b-u*v,t[5]=c+(1-c)*s,t[6]=o*u*b+n*v,t[7]=0,t[8]=n*u*b+o*v,t[9]=o*u*b-n*v,t[10]=l+(1-l)*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.copy=c,r.frustum=function(e,r,t,n,o,u,i){i=i||new f(16);var a=r-e,c=n-t,l=o-u;return i[0]=2*o/a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=2*o/c,i[6]=0,i[7]=0,i[8]=(e+r)/a,i[9]=(n+t)/c,i[10]=u/l,i[11]=-1,i[12]=0,i[13]=0,i[14]=o*u/l,i[15]=0,i},r.getAxis=function(e,r,t){t=t||n.create();var o=4*r;return t[0]=e[o+0],t[1]=e[o+1],t[2]=e[o+2],t},r.getTranslation=function(e,r){return(r=r||n.create())[0]=e[12],r[1]=e[13],r[2]=e[14],r},r.identity=l,r.inverse=s,r.lookAt=function(e,r,t,o){return o=o||new f(16),u=u||n.create(),i=i||n.create(),a=a||n.create(),n.normalize(n.subtract(e,r,a),a),n.normalize(n.cross(t,a,u),u),n.normalize(n.cross(a,u,i),i),o[0]=u[0],o[1]=u[1],o[2]=u[2],o[3]=0,o[4]=i[0],o[5]=i[1],o[6]=i[2],o[7]=0,o[8]=a[0],o[9]=a[1],o[10]=a[2],o[11]=0,o[12]=e[0],o[13]=e[1],o[14]=e[2],o[15]=1,o},r.multiply=function(e,r,t){t=t||new f(16);var n=e[0],o=e[1],u=e[2],i=e[3],a=e[4],c=e[5],l=e[6],s=e[7],v=e[8],b=e[9],y=e[10],d=e[11],m=e[12],p=e[13],x=e[14],w=e[15],h=r[0],F=r[1],E=r[2],A=r[3],O=r[4],_=r[5],j=r[6],M=r[7],P=r[8],R=r[9],T=r[10],g=r[11],z=r[12],U=r[13],C=r[14],S=r[15];return t[0]=n*h+a*F+v*E+m*A,t[1]=o*h+c*F+b*E+p*A,t[2]=u*h+l*F+y*E+x*A,t[3]=i*h+s*F+d*E+w*A,t[4]=n*O+a*_+v*j+m*M,t[5]=o*O+c*_+b*j+p*M,t[6]=u*O+l*_+y*j+x*M,t[7]=i*O+s*_+d*j+w*M,t[8]=n*P+a*R+v*T+m*g,t[9]=o*P+c*R+b*T+p*g,t[10]=u*P+l*R+y*T+x*g,t[11]=i*P+s*R+d*T+w*g,t[12]=n*z+a*U+v*C+m*S,t[13]=o*z+c*U+b*C+p*S,t[14]=u*z+l*U+y*C+x*S,t[15]=i*z+s*U+d*C+w*S,t},r.negate=function(e,r){return(r=r||new f(16))[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=-e[3],r[4]=-e[4],r[5]=-e[5],r[6]=-e[6],r[7]=-e[7],r[8]=-e[8],r[9]=-e[9],r[10]=-e[10],r[11]=-e[11],r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=-e[15],r},r.ortho=function(e,r,t,n,o,u,i){return(i=i||new f(16))[0]=2/(r-e),i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=2/(n-t),i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2/(o-u),i[11]=0,i[12]=(r+e)/(e-r),i[13]=(n+t)/(t-n),i[14]=(u+o)/(o-u),i[15]=1,i},r.perspective=function(e,r,t,n,o){o=o||new f(16);var u=Math.tan(.5*Math.PI-.5*e),i=1/(t-n);return o[0]=u/r,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=u,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=(t+n)*i,o[11]=-1,o[12]=0,o[13]=0,o[14]=t*n*i*2,o[15]=0,o},r.rotateX=function(e,r,t){t=t||new f(16);var n=e[4],o=e[5],u=e[6],i=e[7],a=e[8],c=e[9],l=e[10],s=e[11],v=Math.cos(r),b=Math.sin(r);t[4]=v*n+b*a,t[5]=v*o+b*c,t[6]=v*u+b*l,t[7]=v*i+b*s,t[8]=v*a-b*n,t[9]=v*c-b*o,t[10]=v*l-b*u,t[11]=v*s-b*i,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]);return t},r.rotateY=function(e,r,t){t=t||new f(16);var n=e[0],o=e[1],u=e[2],i=e[3],a=e[8],c=e[9],l=e[10],s=e[11],v=Math.cos(r),b=Math.sin(r);t[0]=v*n-b*a,t[1]=v*o-b*c,t[2]=v*u-b*l,t[3]=v*i-b*s,t[8]=v*a+b*n,t[9]=v*c+b*o,t[10]=v*l+b*u,t[11]=v*s+b*i,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]);return t},r.rotateZ=function(e,r,t){t=t||new f(16);var n=e[0],o=e[1],u=e[2],i=e[3],a=e[4],c=e[5],l=e[6],s=e[7],v=Math.cos(r),b=Math.sin(r);t[0]=v*n+b*a,t[1]=v*o+b*c,t[2]=v*u+b*l,t[3]=v*i+b*s,t[4]=v*a-b*n,t[5]=v*c-b*o,t[6]=v*l-b*u,t[7]=v*s-b*i,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]);return t},r.rotationX=function(e,r){r=r||new f(16);var t=Math.cos(e),n=Math.sin(e);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t,r[6]=n,r[7]=0,r[8]=0,r[9]=-n,r[10]=t,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},r.rotationY=function(e,r){r=r||new f(16);var t=Math.cos(e),n=Math.sin(e);return r[0]=t,r[1]=0,r[2]=-n,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=n,r[9]=0,r[10]=t,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},r.rotationZ=function(e,r){r=r||new f(16);var t=Math.cos(e),n=Math.sin(e);return r[0]=t,r[1]=n,r[2]=0,r[3]=0,r[4]=-n,r[5]=t,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},r.scale=function(e,r,t){t=t||new f(16);var n=r[0],o=r[1],u=r[2];t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=n*e[3],t[4]=o*e[4],t[5]=o*e[5],t[6]=o*e[6],t[7]=o*e[7],t[8]=u*e[8],t[9]=u*e[9],t[10]=u*e[10],t[11]=u*e[11],e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t},r.scaling=function(e,r){return(r=r||new f(16))[0]=e[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},r.setAxis=function(e,r,t,n){n!==e&&(n=c(e,n));var o=4*t;return n[o+0]=r[0],n[o+1]=r[1],n[o+2]=r[2],n},r.setDefaultType=function(e){var r=f;return f=e,r},r.setTranslation=function(e,r,t){t=t||l(),e!==t&&(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]);return t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},r.transformDirection=function(e,r,t){t=t||n.create();var o=r[0],u=r[1],i=r[2];return t[0]=o*e[0]+u*e[4]+i*e[8],t[1]=o*e[1]+u*e[5]+i*e[9],t[2]=o*e[2]+u*e[6]+i*e[10],t},r.transformNormal=function(e,r,t){t=t||n.create();var o=s(e),u=r[0],i=r[1],a=r[2];return t[0]=u*o[0]+i*o[1]+a*o[2],t[1]=u*o[4]+i*o[5]+a*o[6],t[2]=u*o[8]+i*o[9]+a*o[10],t},r.transformPoint=function(e,r,t){t=t||n.create();var o=r[0],u=r[1],i=r[2],a=o*e[3]+u*e[7]+i*e[11]+e[15];return t[0]=(o*e[0]+u*e[4]+i*e[8]+e[12])/a,t[1]=(o*e[1]+u*e[5]+i*e[9]+e[13])/a,t[2]=(o*e[2]+u*e[6]+i*e[10]+e[14])/a,t},r.translate=function(e,r,t){t=t||new f(16);var n=r[0],o=r[1],u=r[2],i=e[0],a=e[1],c=e[2],l=e[3],s=e[4],v=e[5],b=e[6],y=e[7],d=e[8],m=e[9],p=e[10],x=e[11],w=e[12],h=e[13],F=e[14],E=e[15];e!==t&&(t[0]=i,t[1]=a,t[2]=c,t[3]=l,t[4]=s,t[5]=v,t[6]=b,t[7]=y,t[8]=d,t[9]=m,t[10]=p,t[11]=x);return t[12]=i*n+s*o+d*u+w,t[13]=a*n+v*o+m*u+h,t[14]=c*n+b*o+p*u+F,t[15]=l*n+y*o+x*u+E,t},r.translation=function(e,r){return(r=r||new f(16))[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r},r.transpose=function(e,r){if((r=r||new f(16))===e){var t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,r}var n=e[0],o=e[1],u=e[2],i=e[3],a=e[4],c=e[5],l=e[6],s=e[7],v=e[8],b=e[9],y=e[10],d=e[11],m=e[12],p=e[13],x=e[14],w=e[15];return r[0]=n,r[1]=a,r[2]=v,r[3]=m,r[4]=o,r[5]=c,r[6]=b,r[7]=p,r[8]=u,r[9]=l,r[10]=y,r[11]=x,r[12]=i,r[13]=s,r[14]=d,r[15]=w,r};var n=function(e){if(e&&e.__esModule)return e;var r=o();if(r&&r.has(e))return r.get(e);var t={};if(null!=e){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var i=n?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(t,u,i):t[u]=e[u]}}t.default=e,r&&r.set(e,t);return t}(t(2));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}var u,i,a,f=Float32Array;function c(e,r){return(r=r||new f(16))[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function l(e){return(e=e||new f(16))[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function s(e,r){r=r||new f(16);var t=e[0],n=e[1],o=e[2],u=e[3],i=e[4],a=e[5],c=e[6],l=e[7],s=e[8],v=e[9],b=e[10],y=e[11],d=e[12],m=e[13],p=e[14],x=e[15],w=b*x,h=p*y,F=c*x,E=p*l,A=c*y,O=b*l,_=o*x,j=p*u,M=o*y,P=b*u,R=o*l,T=c*u,g=s*m,z=d*v,U=i*m,C=d*a,S=i*v,k=s*a,W=t*m,I=d*n,B=t*v,L=s*n,G=t*a,X=i*n,D=w*a+E*v+A*m-(h*a+F*v+O*m),N=h*n+_*v+P*m-(w*n+j*v+M*m),H=F*n+j*a+R*m-(E*n+_*a+T*m),q=O*n+M*a+T*v-(A*n+P*a+R*v),V=1/(t*D+i*N+s*H+d*q);return r[0]=V*D,r[1]=V*N,r[2]=V*H,r[3]=V*q,r[4]=V*(h*i+F*s+O*d-(w*i+E*s+A*d)),r[5]=V*(w*t+j*s+M*d-(h*t+_*s+P*d)),r[6]=V*(E*t+_*i+T*d-(F*t+j*i+R*d)),r[7]=V*(A*t+P*i+R*s-(O*t+M*i+T*s)),r[8]=V*(g*l+C*y+S*x-(z*l+U*y+k*x)),r[9]=V*(z*u+W*y+L*x-(g*u+I*y+B*x)),r[10]=V*(U*u+I*l+G*x-(C*u+W*l+X*x)),r[11]=V*(k*u+B*l+X*y-(S*u+L*l+G*y)),r[12]=V*(U*b+k*p+z*c-(S*p+g*c+C*b)),r[13]=V*(B*p+g*o+I*b-(W*b+L*p+z*o)),r[14]=V*(W*c+X*p+C*o-(G*p+U*o+I*c)),r[15]=V*(G*b+S*o+L*c-(B*c+X*b+k*o)),r}},function(e,r,t){"use strict";r.__esModule=!0,r.createAttribsFromArrays=p,r.createBuffersFromArrays=function(e,r){var t={};Object.keys(r).forEach((function(n){t[n]=w(e,r[n],n)})),r.indices?(t.numElements=r.indices.length,t.elementType=n.getGLTypeForTypedArray(m(r.indices),"indices")):t.numElements=function(e){var r,t;for(t=0;t<x.length&&!((r=x[t])in e);++t);t===x.length&&(r=Object.keys(e)[0]);var n=e[r],o=s(n).length,u=d(n,r),i=o/u;if(o%u>0)throw new Error("numComponents ".concat(u," not correct for length ").concat(o));return i}(r);return t},r.createBufferFromArray=w,r.createBufferFromTypedArray=c,r.createBufferInfoFromArrays=function(e,r,t){var o=p(e,r),u=Object.assign({},t||{});u.attribs=Object.assign({},t?t.attribs:{},o);var i=r.indices;if(i){var f=m(i,"indices");u.indices=c(e,f,34963),u.numElements=f.length,u.elementType=n.getGLTypeForTypedArray(f)}else u.numElements||(u.numElements=function(e,r){var t,n;for(n=0;n<x.length&&!((t=x[n])in r)&&!((t=a.attribPrefix+t)in r);++n);n===x.length&&(t=Object.keys(r)[0]);var o=r[t];e.bindBuffer(34962,o.buffer);var u=e.getBufferParameter(34962,34660);e.bindBuffer(34962,null);var i=(s=o.type,5120===s?1:5121===s?1:5122===s?2:5123===s?2:5124===s?4:5125===s?4:5126===s?4:0),f=u/i,c=o.numComponents||o.size,l=f/c;var s;if(l%1!=0)throw new Error("numComponents ".concat(c," not correct for length ").concat(length));return l}(e,u.attribs));return u},r.setAttribInfoBufferFromArray=function(e,r,t,n){t=m(t),void 0!==n?(e.bindBuffer(34962,r.buffer),e.bufferSubData(34962,n,t)):f(e,34962,r.buffer,t,r.drawType)},r.setAttributePrefix=function(e){a.attribPrefix=e},r.setAttributeDefaults_=function(e){o.copyExistingProperties(e,a)},r.getNumComponents_=d,r.getArray_=s;var n=i(t(1)),o=i(t(0));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function i(e){if(e&&e.__esModule)return e;var r=u();if(r&&r.has(e))return r.get(e);var t={};if(null!=e){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(t,o,i):t[o]=e[o]}}return t.default=e,r&&r.set(e,t),t}var a={attribPrefix:""};function f(e,r,t,n,o){e.bindBuffer(r,t),e.bufferData(r,n,o||35044)}function c(e,r,t,n){if(o.isBuffer(e,r))return r;t=t||34962;var u=e.createBuffer();return f(e,t,u,r,n),u}function l(e){return"indices"===e}function s(e){return e.length?e:e.data}var v=/coord|texture/i,b=/color|colour/i;function y(e,r){var t;if(r%(t=v.test(e)?2:b.test(e)?4:3)>0)throw new Error("Can not guess numComponents for attribute '".concat(e,"'. Tried ").concat(t," but ").concat(r," values is not evenly divisible by ").concat(t,". You should specify it."));return t}function d(e,r){return e.numComponents||e.size||y(r,s(e).length)}function m(e,r){if(n.isArrayBuffer(e))return e;if(n.isArrayBuffer(e.data))return e.data;Array.isArray(e)&&(e={data:e});var t=e.type;return t||(t=l(r)?Uint16Array:Float32Array),new t(e.data)}function p(e,r){var t={};return Object.keys(r).forEach((function(o){if(!l(o)){var u=r[o],i=u.attrib||u.name||u.attribName||a.attribPrefix+o;if(u.value){if(!Array.isArray(u.value)&&!n.isArrayBuffer(u.value))throw new Error("array.value is not array or typedarray");t[i]={value:u.value}}else{var f,s,v,b;if(u.buffer&&u.buffer instanceof WebGLBuffer)f=u.buffer,b=u.numComponents||u.size,s=u.type,v=u.normalize;else if("number"==typeof u||"number"==typeof u.data){var p=u.data||u,x=u.type||Float32Array,w=p*x.BYTES_PER_ELEMENT;s=n.getGLTypeForTypedArrayType(x),v=void 0!==u.normalize?u.normalize:(F=x)===Int8Array||F===Uint8Array,b=u.numComponents||u.size||y(o,p),f=e.createBuffer(),e.bindBuffer(34962,f),e.bufferData(34962,w,u.drawType||35044)}else{var h=m(u,o);f=c(e,h,void 0,u.drawType),s=n.getGLTypeForTypedArray(h),v=void 0!==u.normalize?u.normalize:function(e){return e instanceof Int8Array||e instanceof Uint8Array}(h),b=d(u,o)}t[i]={buffer:f,numComponents:b,type:s,normalize:v,stride:u.stride||0,offset:u.offset||0,divisor:void 0===u.divisor?void 0:u.divisor,drawType:u.drawType}}}var F})),e.bindBuffer(34962,null),t}var x=["position","positions","a_position"];function w(e,r,t){var n="indices"===t?34963:34962;return c(e,m(r,t),n)}},function(e,r,t){"use strict";r.__esModule=!0,r.setTextureDefaults_=function(e){u.copyExistingProperties(e,c),e.textureColor&&_(e.textureColor)},r.createSampler=C,r.createSamplers=function(e,r){var t={};return Object.keys(r).forEach((function(n){t[n]=C(e,r[n])})),t},r.setSamplerParameters=U,r.createTexture=Z,r.setEmptyTexture=K,r.setTextureFromArray=Y,r.loadTextureFromUrl=H,r.setTextureFromElement=B,r.setTextureFilteringForSize=S,r.setTextureParameters=z,r.setDefaultTextureColor=_,r.createTextures=function(e,r,t){t=t||L;var n=0,o=[],u={},i={};function a(){0===n&&setTimeout((function(){t(o.length?o:void 0,u,i)}),0)}return Object.keys(r).forEach((function(t){var f,c,l=r[t];("string"==typeof(c=l.src)||Array.isArray(c)&&"string"==typeof c[0])&&(f=function(e,r,u){i[t]=u,--n,e&&o.push(e),a()},++n),u[t]=Z(e,l,f)})),a(),u},r.resizeTexture=function(e,r,t,n,o,u){n=n||t.width,o=o||t.height,u=u||t.depth;var i=t.target||3553;e.bindTexture(i,r);var a,f=t.level||0,c=t.internalFormat||t.format||6408,s=w(c),v=t.format||s.format,b=t.src;a=b&&(l(b)||Array.isArray(b)&&"number"==typeof b[0])?t.type||A(e,b,s.type):t.type||s.type;if(34067===i)for(var y=0;y<6;++y)e.texImage2D(34069+y,f,c,n,o,0,v,a,null);else 32879===i||35866===i?e.texImage3D(i,f,c,n,o,u,0,v,a,null):e.texImage2D(i,f,c,n,o,0,v,a,null)},r.canGenerateMipmap=F,r.canFilter=E,r.getNumComponentsForFormat=function(e){var r=d[e];if(!r)throw"unknown format: "+e;return r.u},r.getBytesPerElementForInternalFormat=x,r.getFormatAndTypeForInternalFormat=w;var n=a(t(3)),o=a(t(1)),u=a(t(0));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function a(e){if(e&&e.__esModule)return e;var r=i();if(r&&r.has(e))return r.get(e);var t={};if(null!=e){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=n?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(t,o,u):t[o]=e[o]}}return t.default=e,r&&r.set(e,t),t}var f,c={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},l=o.isArrayBuffer;function s(){return f=f||("undefined"!=typeof document&&document.createElement?document.createElement("canvas").getContext("2d"):null)}var v,b=6407,y=33319,d={},m=d;function p(e){if(!v){var r={6406:{v:6406,h:!0,F:!0,A:[1,2,2,4],type:[5121,5131,36193,5126]},6409:{v:6409,h:!0,F:!0,A:[1,2,2,4],type:[5121,5131,36193,5126]},6410:{v:6410,h:!0,F:!0,A:[2,4,4,8],type:[5121,5131,36193,5126]}};r[b]={v:b,h:!0,F:!0,A:[3,6,6,12,2],type:[5121,5131,36193,5126,33635]},r[6408]={v:6408,h:!0,F:!0,A:[4,8,8,16,2,2],type:[5121,5131,36193,5126,32819,32820]},r[33321]={v:6403,h:!0,F:!0,A:[1],type:[5121]},r[36756]={v:6403,h:!1,F:!0,A:[1],type:[5120]},r[33325]={v:6403,h:!1,F:!0,A:[4,2],type:[5126,5131]},r[33326]={v:6403,h:!1,F:!1,A:[4],type:[5126]},r[33330]={v:36244,h:!0,F:!1,A:[1],type:[5121]},r[33329]={v:36244,h:!0,F:!1,A:[1],type:[5120]},r[33332]={v:36244,h:!0,F:!1,A:[2],type:[5123]},r[33331]={v:36244,h:!0,F:!1,A:[2],type:[5122]},r[33334]={v:36244,h:!0,F:!1,A:[4],type:[5125]},r[33333]={v:36244,h:!0,F:!1,A:[4],type:[5124]},r[33323]={v:y,h:!0,F:!0,A:[2],type:[5121]},r[36757]={v:y,h:!1,F:!0,A:[2],type:[5120]},r[33327]={v:y,h:!1,F:!0,A:[8,4],type:[5126,5131]},r[33328]={v:y,h:!1,F:!1,A:[8],type:[5126]},r[33336]={v:33320,h:!0,F:!1,A:[2],type:[5121]},r[33335]={v:33320,h:!0,F:!1,A:[2],type:[5120]},r[33338]={v:33320,h:!0,F:!1,A:[4],type:[5123]},r[33337]={v:33320,h:!0,F:!1,A:[4],type:[5122]},r[33340]={v:33320,h:!0,F:!1,A:[8],type:[5125]},r[33339]={v:33320,h:!0,F:!1,A:[8],type:[5124]},r[32849]={v:b,h:!0,F:!0,A:[3],type:[5121]},r[35905]={v:b,h:!1,F:!0,A:[3],type:[5121]},r[36194]={v:b,h:!0,F:!0,A:[3,2],type:[5121,33635]},r[36758]={v:b,h:!1,F:!0,A:[3],type:[5120]},r[35898]={v:b,h:!1,F:!0,A:[12,6,4],type:[5126,5131,35899]},r[35901]={v:b,h:!1,F:!0,A:[12,6,4],type:[5126,5131,35902]},r[34843]={v:b,h:!1,F:!0,A:[12,6],type:[5126,5131]},r[34837]={v:b,h:!1,F:!1,A:[12],type:[5126]},r[36221]={v:36248,h:!1,F:!1,A:[3],type:[5121]},r[36239]={v:36248,h:!1,F:!1,A:[3],type:[5120]},r[36215]={v:36248,h:!1,F:!1,A:[6],type:[5123]},r[36233]={v:36248,h:!1,F:!1,A:[6],type:[5122]},r[36209]={v:36248,h:!1,F:!1,A:[12],type:[5125]},r[36227]={v:36248,h:!1,F:!1,A:[12],type:[5124]},r[32856]={v:6408,h:!0,F:!0,A:[4],type:[5121]},r[35907]={v:6408,h:!0,F:!0,A:[4],type:[5121]},r[36759]={v:6408,h:!1,F:!0,A:[4],type:[5120]},r[32855]={v:6408,h:!0,F:!0,A:[4,2,4],type:[5121,32820,33640]},r[32854]={v:6408,h:!0,F:!0,A:[4,2],type:[5121,32819]},r[32857]={v:6408,h:!0,F:!0,A:[4],type:[33640]},r[34842]={v:6408,h:!1,F:!0,A:[16,8],type:[5126,5131]},r[34836]={v:6408,h:!1,F:!1,A:[16],type:[5126]},r[36220]={v:36249,h:!0,F:!1,A:[4],type:[5121]},r[36238]={v:36249,h:!0,F:!1,A:[4],type:[5120]},r[36975]={v:36249,h:!0,F:!1,A:[4],type:[33640]},r[36214]={v:36249,h:!0,F:!1,A:[8],type:[5123]},r[36232]={v:36249,h:!0,F:!1,A:[8],type:[5122]},r[36226]={v:36249,h:!0,F:!1,A:[16],type:[5124]},r[36208]={v:36249,h:!0,F:!1,A:[16],type:[5125]},r[33189]={v:6402,h:!0,F:!1,A:[2,4],type:[5123,5125]},r[33190]={v:6402,h:!0,F:!1,A:[4],type:[5125]},r[36012]={v:6402,h:!0,F:!1,A:[4],type:[5126]},r[35056]={v:34041,h:!0,F:!1,A:[4],type:[34042]},r[36013]={v:34041,h:!0,F:!1,A:[4],type:[36269]},Object.keys(r).forEach((function(e){var t=r[e];t.bytesPerElementMap={},t.A.forEach((function(e,r){var n=t.type[r];t.bytesPerElementMap[n]=e}))})),v=r}return v[e]}function x(e,r){var t=p(e);if(!t)throw"unknown internal format";var n=t.bytesPerElementMap[r];if(void 0===n)throw"unknown internal format";return n}function w(e){var r=p(e);if(!r)throw"unknown internal format";return{format:r.v,type:r.type[0]}}function h(e){return 0==(e&e-1)}function F(e,r,t,o){if(!n.isWebGL2(e))return h(r)&&h(t);var u=p(o);if(!u)throw"unknown internal format";return u.h&&u.F}function E(e){var r=p(e);if(!r)throw"unknown internal format";return r.F}function A(e,r,t){return l(r)?o.getGLTypeForTypedArray(r):t||5121}function O(e,r,t,n,o){if(o%1!=0)throw"can't guess dimensions";if(t||n){if(n){if(!t&&(t=o/n)%1)throw"can't guess dimensions"}else if((n=o/t)%1)throw"can't guess dimensions"}else{var u=Math.sqrt(o/(34067===r?6:1));u%1==0?(t=u,n=u):(t=o,n=1)}return{width:t,height:n}}function _(e){c.textureColor=new Uint8Array([255*e[0],255*e[1],255*e[2],255*e[3]])}m[6406]={u:1},m[6409]={u:1},m[6410]={u:2},m[b]={u:3},m[6408]={u:4},m[6403]={u:1},m[36244]={u:1},m[y]={u:2},m[33320]={u:2},m[b]={u:3},m[36248]={u:3},m[6408]={u:4},m[36249]={u:4},m[6402]={u:1},m[34041]={u:2};var j={};function M(e,r){void 0!==r.colorspaceConversion&&(j.colorspaceConversion=e.getParameter(37443),e.pixelStorei(37443,r.colorspaceConversion)),void 0!==r.premultiplyAlpha&&(j.premultiplyAlpha=e.getParameter(37441),e.pixelStorei(37441,r.premultiplyAlpha)),void 0!==r.flipY&&(j.flipY=e.getParameter(37440),e.pixelStorei(37440,r.flipY))}function P(e,r){void 0!==r.colorspaceConversion&&e.pixelStorei(37443,j.colorspaceConversion),void 0!==r.premultiplyAlpha&&e.pixelStorei(37441,j.premultiplyAlpha),void 0!==r.flipY&&e.pixelStorei(37440,j.flipY)}function R(e){j.unpackAlignment=e.getParameter(3317),n.isWebGL2(e)&&(j.unpackRowLength=e.getParameter(3314),j.unpackImageHeight=e.getParameter(32878),j.unpackSkipPixels=e.getParameter(3316),j.unpackSkipRows=e.getParameter(3315),j.unpackSkipImages=e.getParameter(32877))}function T(e){e.pixelStorei(3317,j.unpackAlignment),n.isWebGL2(e)&&(e.pixelStorei(3314,j.unpackRowLength),e.pixelStorei(32878,j.unpackImageHeight),e.pixelStorei(3316,j.unpackSkipPixels),e.pixelStorei(3315,j.unpackSkipRows),e.pixelStorei(32877,j.unpackSkipImages))}function g(e,r,t,n){n.minMag&&(t.call(e,r,10241,n.minMag),t.call(e,r,10240,n.minMag)),n.min&&t.call(e,r,10241,n.min),n.mag&&t.call(e,r,10240,n.mag),n.wrap&&(t.call(e,r,10242,n.wrap),t.call(e,r,10243,n.wrap),(32879===r||u.isSampler(e,r))&&t.call(e,r,32882,n.wrap)),n.wrapR&&t.call(e,r,32882,n.wrapR),n.wrapS&&t.call(e,r,10242,n.wrapS),n.wrapT&&t.call(e,r,10243,n.wrapT),n.minLod&&t.call(e,r,33082,n.minLod),n.maxLod&&t.call(e,r,33083,n.maxLod),n.baseLevel&&t.call(e,r,33084,n.baseLevel),n.maxLevel&&t.call(e,r,33085,n.maxLevel)}function z(e,r,t){var n=t.target||3553;e.bindTexture(n,r),g(e,n,e.texParameteri,t)}function U(e,r,t){g(e,r,e.samplerParameteri,t)}function C(e,r){var t=e.createSampler();return U(e,t,r),t}function S(e,r,t,n,o,u){u=u||6408;var i=(t=t||c.textureOptions).target||3553;if(n=n||t.width,o=o||t.height,e.bindTexture(i,r),F(e,n,o,u))e.generateMipmap(i);else{var a=E(u)?9729:9728;e.texParameteri(i,10241,a),e.texParameteri(i,10240,a),e.texParameteri(i,10242,33071),e.texParameteri(i,10243,33071)}}function k(e){return!0===e.auto||void 0===e.auto&&void 0===e.level}function W(e,r){return(r=r||{}).cubeFaceOrder||[34069,34070,34071,34072,34073,34074]}function I(e,r){var t=W(0,r).map((function(e,r){return{face:e,ndx:r}}));return t.sort((function(e,r){return e.face-r.face})),t}function B(e,r,t,n){var o=(n=n||c.textureOptions).target||3553,u=n.level||0,i=t.width,a=t.height,f=n.internalFormat||n.format||6408,l=w(f),v=n.format||l.format,b=n.type||l.type;if(M(e,n),e.bindTexture(o,r),34067===o){var y,d,m=t.width,p=t.height;if(m/6===p)y=p,d=[0,0,1,0,2,0,3,0,4,0,5,0];else if(p/6===m)y=m,d=[0,0,0,1,0,2,0,3,0,4,0,5];else if(m/3==p/2)y=m/3,d=[0,0,1,0,2,0,0,1,1,1,2,1];else{if(m/2!=p/3)throw"can't figure out cube map from element: "+(t.src?t.src:t.nodeName);y=m/2,d=[0,0,1,0,0,1,1,1,0,2,1,2]}var x=s();x?(x.canvas.width=y,x.canvas.height=y,i=y,a=y,I(0,n).forEach((function(r){var n=d[2*r.ndx+0]*y,o=d[2*r.ndx+1]*y;x.drawImage(t,n,o,y,y,0,0,y,y),e.texImage2D(r.face,u,f,v,b,x.canvas)})),x.canvas.width=1,x.canvas.height=1):"undefined"!=typeof createImageBitmap&&(i=y,a=y,I(0,n).forEach((function(c){var l=d[2*c.ndx+0]*y,s=d[2*c.ndx+1]*y;e.texImage2D(c.face,u,f,y,y,0,v,b,null),createImageBitmap(t,l,s,y,y,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then((function(t){M(e,n),e.bindTexture(o,r),e.texImage2D(c.face,u,f,v,b,t),P(e,n),k(n)&&S(e,r,n,i,a,f)}))})))}else if(32879===o||35866===o){var h=Math.min(t.width,t.height),F=Math.max(t.width,t.height),E=F/h;if(E%1!=0)throw"can not compute 3D dimensions of element";var A=t.width===F?1:0,O=t.height===F?1:0;R(e),e.pixelStorei(3317,1),e.pixelStorei(3314,t.width),e.pixelStorei(32878,0),e.pixelStorei(32877,0),e.texImage3D(o,u,f,h,h,h,0,v,b,null);for(var _=0;_<E;++_){var j=_*h*A,g=_*h*O;e.pixelStorei(3316,j),e.pixelStorei(3315,g),e.texSubImage3D(o,u,0,0,_,h,h,1,v,b,t)}T(e)}else e.texImage2D(o,u,f,v,b,t);P(e,n),k(n)&&S(e,r,n,i,a,f),z(e,r,n)}function L(){}function G(e,r){return void 0!==r||function(e){if("undefined"!=typeof document){var r=document.createElement("a");return r.href=e,r.hostname===location.hostname&&r.port===location.port&&r.protocol===location.protocol}var t=new URL(location.href).origin;return new URL(e,location.href).origin===t}(e)?r:"anonymous"}function X(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof ImageData&&e instanceof ImageData||"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}function D(e,r,t){return X(e)?(setTimeout((function(){t(null,e)})),e):function(e,r,t){var n;if(t=t||L,r=void 0!==r?r:c.crossOrigin,r=G(e,r),"undefined"!=typeof Image){n=new Image,void 0!==r&&(n.crossOrigin=r);var o=function(){n.removeEventListener("error",i),n.removeEventListener("load",a),n=null},i=function(){var r="couldn't load image: "+e;u.error(r),t(r,n),o()},a=function(){t(null,n),o()};return n.addEventListener("error",i),n.addEventListener("load",a),n.src=e,n}if("undefined"!=typeof ImageBitmap){var f,l,s=function(){t(f,l)},v={};r&&(v.mode="cors"),fetch(e,v).then((function(e){if(!e.ok)throw e;return e.blob()})).then((function(e){return createImageBitmap(e,{premultiplyAlpha:"none",colorSpaceConversion:"none"})})).then((function(e){l=e,setTimeout(s)})).catch((function(e){f=e,setTimeout(s)})),n=null}return n}(e,r,t)}function N(e,r,t){var n=(t=t||c.textureOptions).target||3553;if(e.bindTexture(n,r),!1!==t.color){var o=function(e){return e=e||c.textureColor,l(e)?e:new Uint8Array([255*e[0],255*e[1],255*e[2],255*e[3]])}(t.color);if(34067===n)for(var u=0;u<6;++u)e.texImage2D(34069+u,0,6408,1,1,0,6408,5121,o);else 32879===n||35866===n?e.texImage3D(n,0,6408,1,1,1,0,6408,5121,o):e.texImage2D(n,0,6408,1,1,0,6408,5121,o)}}function H(e,r,t,n){return n=n||L,t=t||c.textureOptions,N(e,r,t),D((t=Object.assign({},t)).src,t.crossOrigin,(function(o,u){o?n(o,r,u):(B(e,r,u,t),n(null,r,u))}))}function q(e,r,t,n){n=n||L;var o=t.src;if(6!==o.length)throw"there must be 6 urls for a cubemap";var u=t.level||0,i=t.internalFormat||t.format||6408,a=w(i),f=t.format||a.format,c=t.type||5121,l=t.target||3553;if(34067!==l)throw"target must be TEXTURE_CUBE_MAP";N(e,r,t),t=Object.assign({},t);var s,v=6,b=[],y=W(0,t);s=o.map((function(o,a){return D(o,t.crossOrigin,(d=y[a],function(o,a){--v,o?b.push(o):a.width!==a.height?b.push("cubemap face img is not a square: "+a.src):(M(e,t),e.bindTexture(l,r),5===v?W().forEach((function(r){e.texImage2D(r,u,i,f,c,a)})):e.texImage2D(d,u,i,f,c,a),P(e,t),k(t)&&e.generateMipmap(l)),0===v&&n(b.length?b:void 0,r,s)}));var d}))}function V(e,r,t,n){n=n||L;var o=t.src,u=t.internalFormat||t.format||6408,i=w(u),a=t.format||i.format,f=t.type||5121,c=t.target||35866;if(32879!==c&&35866!==c)throw"target must be TEXTURE_3D or TEXTURE_2D_ARRAY";N(e,r,t),t=Object.assign({},t);var l,v=o.length,b=[],y=t.level||0,d=t.width,m=t.height,p=o.length,x=!0;l=o.map((function(o,i){return D(o,t.crossOrigin,(w=i,function(o,i){if(--v,o)b.push(o);else{if(M(e,t),e.bindTexture(c,r),x){x=!1,d=t.width||i.width,m=t.height||i.height,e.texImage3D(c,y,u,d,m,p,0,a,f,null);for(var h=0;h<p;++h)e.texSubImage3D(c,y,0,0,h,d,m,1,a,f,i)}else{var F,E=i;i.width===d&&i.height===m||(E=(F=s()).canvas,F.canvas.width=d,F.canvas.height=m,F.drawImage(i,0,0,d,m)),e.texSubImage3D(c,y,0,0,w,d,m,1,a,f,E),F&&E===F.canvas&&(F.canvas.width=0,F.canvas.height=0)}P(e,t),k(t)&&e.generateMipmap(c)}0===v&&n(b.length?b:void 0,r,l)}));var w}))}function Y(e,r,t,u){var i=(u=u||c.textureOptions).target||3553;e.bindTexture(i,r);var a=u.width,f=u.height,s=u.depth,v=u.level||0,b=u.internalFormat||u.format||6408,y=w(b),d=u.format||y.format,m=u.type||A(0,t,y.type);if(l(t))t instanceof Uint8ClampedArray&&(t=new Uint8Array(t.buffer));else{var p=o.getTypedArrayTypeForGLType(m);t=new p(t)}var h,F=x(b,m),E=t.byteLength/F;if(E%1)throw"length wrong size for format: "+n.glEnumToString(e,d);if(32879===i||35866===i)if(a||f||s)!a||f&&s?!f||a&&s?(h=O(0,i,a,f,E/s),a=h.width,f=h.height):(h=O(0,i,a,s,E/f),a=h.width,s=h.height):(h=O(0,i,f,s,E/a),f=h.width,s=h.height);else{var _=Math.cbrt(E);if(_%1!=0)throw"can't guess cube size of array of numElements: "+E;a=_,f=_,s=_}else h=O(0,i,a,f,E),a=h.width,f=h.height;if(R(e),e.pixelStorei(3317,u.unpackAlignment||1),M(e,u),34067===i){var j=E/6*(F/t.BYTES_PER_ELEMENT);I(0,u).forEach((function(r){var n=j*r.ndx,o=t.subarray(n,n+j);e.texImage2D(r.face,v,b,a,f,0,d,m,o)}))}else 32879===i||35866===i?e.texImage3D(i,v,b,a,f,s,0,d,m,t):e.texImage2D(i,v,b,a,f,0,d,m,t);return P(e,u),T(e),{width:a,height:f,depth:s,type:m}}function K(e,r,t){var n=t.target||3553;e.bindTexture(n,r);var o=t.level||0,u=t.internalFormat||t.format||6408,i=w(u),a=t.format||i.format,f=t.type||i.type;if(M(e,t),34067===n)for(var c=0;c<6;++c)e.texImage2D(34069+c,o,u,t.width,t.height,0,a,f,null);else 32879===n||35866===n?e.texImage3D(n,o,u,t.width,t.height,t.depth,0,a,f,null):e.texImage2D(n,o,u,t.width,t.height,0,a,f,null);P(e,t)}function Z(e,r,t){t=t||L,r=r||c.textureOptions;var n=e.createTexture(),o=r.target||3553,u=r.width||1,i=r.height||1,a=r.internalFormat||6408;e.bindTexture(o,n),34067===o&&(e.texParameteri(o,10242,33071),e.texParameteri(o,10243,33071));var f=r.src;if(f)if("function"==typeof f&&(f=f(e,r)),"string"==typeof f)H(e,n,r,t);else if(l(f)||Array.isArray(f)&&("number"==typeof f[0]||Array.isArray(f[0])||l(f[0]))){var s=Y(e,n,f,r);u=s.width,i=s.height}else if(Array.isArray(f)&&("string"==typeof f[0]||X(f[0])))34067===o?q(e,n,r,t):V(e,n,r,t);else{if(!X(f))throw"unsupported src type";B(e,n,f,r),u=f.width,i=f.height}else K(e,n,r);return k(r)&&S(e,n,r,u,i,a),z(e,n,r),n}},function(e,r,t){"use strict";r.__esModule=!0;var n={m4:!0,v3:!0,primitives:!0};r.primitives=r.v3=r.m4=void 0;var o=c(t(5));r.m4=o;var u=c(t(2));r.v3=u;var i=c(t(9));r.primitives=i;var a=t(10);function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function c(e){if(e&&e.__esModule)return e;var r=f();if(r&&r.has(e))return r.get(e);var t={};if(null!=e){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=n?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(t,o,u):t[o]=e[o]}}return t.default=e,r&&r.set(e,t),t}Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(r[e]=a[e]))}))},function(e,r,t){"use strict";r.__esModule=!0,r.create3DFVertices=P,r.createAugmentedTypedArray=b,r.createCubeVertices=_,r.createPlaneVertices=E,r.createSphereVertices=A,r.createTruncatedConeVertices=j,r.createXYQuadVertices=F,r.createCrescentVertices=R,r.createCylinderVertices=T,r.createTorusVertices=g,r.createDiscVertices=z,r.deindexVertices=function(e){var r=e.indices,t={},n=r.length;return Object.keys(e).filter(y).forEach((function(o){for(var u=e[o],i=u.numComponents,a=b(i,n,u.constructor),f=0;f<n;++f)for(var c=r[f]*i,l=0;l<i;++l)a.push(u[c+l]);t[o]=a})),t},r.flattenNormals=function(e){if(e.indices)throw new Error("can not flatten normals of indexed vertices. deindex them first");for(var r=e.normal,t=r.length,n=0;n<t;n+=9){var o=r[n+0],u=r[n+1],i=r[n+2],a=r[n+3],f=r[n+4],c=r[n+5],l=r[n+6],s=r[n+7],v=r[n+8],b=o+a+l,y=u+f+s,d=i+c+v,m=Math.sqrt(b*b+y*y+d*d);b/=m,y/=m,d/=m,r[n+0]=b,r[n+1]=y,r[n+2]=d,r[n+3]=b,r[n+4]=y,r[n+5]=d,r[n+6]=b,r[n+7]=y,r[n+8]=d}return e},r.makeRandomVertexColors=function(e,r){r=r||{};var t=e.position.numElements,n=b(4,t,Uint8Array),o=r.rand||function(e,r){return r<3?(t=256,Math.random()*t|0):255;var t};if(e.color=n,e.indices)for(var u=0;u<t;++u)n.push(o(u,0),o(u,1),o(u,2),o(u,3));else for(var i=r.vertsPerColor||3,a=t/i,f=0;f<a;++f)for(var c=[o(f,0),o(f,1),o(f,2),o(f,3)],l=0;l<i;++l)n.push(c);return e},r.reorientDirections=p,r.reorientNormals=x,r.reorientPositions=w,r.reorientVertices=h,r.concatVertices=function(e){for(var r,t={},n=function(n){var o=e[n];Object.keys(o).forEach((function(e){t[e]||(t[e]=[]),r||"indices"===e||(r=e);var n=o[e],u=s(n,e),i=l(n).length/u;t[e].push(i)}))},o=0;o<e.length;++o)n(o);var u=t[r],i={};return Object.keys(t).forEach((function(r){var t=function(r){for(var t,n=0,o=0;o<e.length;++o){var u=e[o][r],i=l(u);n+=i.length,t&&!u.data||(t=u)}return{length:n,spec:t}}(r),n=W(t.spec,t.length);!function(r,t,n){for(var o=0,u=0,i=0;i<e.length;++i){var a=e[i][r],f=l(a);"indices"===r?(k(f,n,u,o),o+=t[i]):k(f,n,u),u+=f.length}}(r,u,l(n)),i[r]=n})),i},r.duplicateVertices=function(e){var r={};return Object.keys(e).forEach((function(t){var n=e[t],o=l(n),u=W(n,o.length);k(o,l(u),0),r[t]=u})),r},r.createDiscBuffers=r.createDiscBufferInfo=r.createTorusBuffers=r.createTorusBufferInfo=r.createCylinderBuffers=r.createCylinderBufferInfo=r.createCrescentBuffers=r.createCrescentBufferInfo=r.createCresentVertices=r.createCresentBuffers=r.createCresentBufferInfo=r.createXYQuadBuffers=r.createXYQuadBufferInfo=r.createTruncatedConeBuffers=r.createTruncatedConeBufferInfo=r.createSphereBuffers=r.createSphereBufferInfo=r.createPlaneBuffers=r.createPlaneBufferInfo=r.createCubeBuffers=r.createCubeBufferInfo=r.create3DFBuffers=r.create3DFBufferInfo=void 0;var n=c(t(6)),o=c(t(0)),u=c(t(1)),i=c(t(5)),a=c(t(2));function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function c(e){if(e&&e.__esModule)return e;var r=f();if(r&&r.has(e))return r.get(e);var t={};if(null!=e){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=n?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(t,o,u):t[o]=e[o]}}return t.default=e,r&&r.set(e,t),t}var l=n.getArray_,s=n.getNumComponents_;function v(e,r){var t=0;return e.push=function(){for(var r=0;r<arguments.length;++r){var n=arguments[r];if(n instanceof Array||u.isArrayBuffer(n))for(var o=0;o<n.length;++o)e[t++]=n[o];else e[t++]=n}},e.reset=function(e){t=e||0},e.numComponents=r,Object.defineProperty(e,"numElements",{get:function(){return this.length/this.numComponents|0}}),e}function b(e,r,t){return v(new(t||Float32Array)(e*r),e)}function y(e){return"indices"!==e}function d(e,r,t){for(var n=e.length,o=new Float32Array(3),u=0;u<n;u+=3)t(r,[e[u],e[u+1],e[u+2]],o),e[u]=o[0],e[u+1]=o[1],e[u+2]=o[2]}function m(e,r,t){t=t||a.create();var n=r[0],o=r[1],u=r[2];return t[0]=n*e[0]+o*e[1]+u*e[2],t[1]=n*e[4]+o*e[5]+u*e[6],t[2]=n*e[8]+o*e[9]+u*e[10],t}function p(e,r){return d(e,r,i.transformDirection),e}function x(e,r){return d(e,i.inverse(r),m),e}function w(e,r){return d(e,r,i.transformPoint),e}function h(e,r){return Object.keys(e).forEach((function(t){var n=e[t];t.indexOf("pos")>=0?w(n,r):t.indexOf("tan")>=0||t.indexOf("binorm")>=0?p(n,r):t.indexOf("norm")>=0&&x(n,r)})),e}function F(e,r,t){return e=e||2,{position:{numComponents:2,data:[(r=r||0)+-1*(e*=.5),(t=t||0)+-1*e,r+1*e,t+-1*e,r+-1*e,t+1*e,r+1*e,t+1*e]},normal:[0,0,1,0,0,1,0,0,1,0,0,1],texcoord:[0,0,1,0,0,1,1,1],indices:[0,1,2,2,1,3]}}function E(e,r,t,n,o){e=e||1,r=r||1,t=t||1,n=n||1,o=o||i.identity();for(var u=(t+1)*(n+1),a=b(3,u),f=b(3,u),c=b(2,u),l=0;l<=n;l++)for(var s=0;s<=t;s++){var v=s/t,y=l/n;a.push(e*v-.5*e,0,r*y-.5*r),f.push(0,1,0),c.push(v,y)}for(var d=t+1,m=b(3,t*n*2,Uint16Array),p=0;p<n;p++)for(var x=0;x<t;x++)m.push((p+0)*d+x,(p+1)*d+x,(p+0)*d+x+1),m.push((p+1)*d+x,(p+1)*d+x+1,(p+0)*d+x+1);return h({position:a,normal:f,texcoord:c,indices:m},o)}function A(e,r,t,n,o,u,i){if(r<=0||t<=0)throw new Error("subdivisionAxis and subdivisionHeight must be > 0");n=n||0,u=u||0;for(var a=(o=o||Math.PI)-n,f=(i=i||2*Math.PI)-u,c=(r+1)*(t+1),l=b(3,c),s=b(3,c),v=b(2,c),y=0;y<=t;y++)for(var d=0;d<=r;d++){var m=d/r,p=y/t,x=f*m+u,w=a*p+n,h=Math.sin(x),F=Math.cos(x),E=Math.sin(w),A=F*E,O=Math.cos(w),_=h*E;l.push(e*A,e*O,e*_),s.push(A,O,_),v.push(1-m,p)}for(var j=r+1,M=b(3,r*t*2,Uint16Array),P=0;P<r;P++)for(var R=0;R<t;R++)M.push((R+0)*j+P,(R+0)*j+P+1,(R+1)*j+P),M.push((R+1)*j+P,(R+0)*j+P+1,(R+1)*j+P+1);return{position:l,normal:s,texcoord:v,indices:M}}var O=[[3,7,5,1],[6,2,0,4],[6,7,3,2],[0,1,5,4],[7,6,4,5],[2,3,1,0]];function _(e){for(var r=(e=e||1)/2,t=[[-r,-r,-r],[+r,-r,-r],[-r,+r,-r],[+r,+r,-r],[-r,-r,+r],[+r,-r,+r],[-r,+r,+r],[+r,+r,+r]],n=[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],o=[[1,0],[0,0],[0,1],[1,1]],u=b(3,24),i=b(3,24),a=b(2,24),f=b(3,12,Uint16Array),c=0;c<6;++c){for(var l=O[c],s=0;s<4;++s){var v=t[l[s]],y=n[c],d=o[s];u.push(v),i.push(y),a.push(d)}var m=4*c;f.push(m+0,m+1,m+2),f.push(m+0,m+2,m+3)}return{position:u,normal:i,texcoord:a,indices:f}}function j(e,r,t,n,o,u,i){if(n<3)throw new Error("radialSubdivisions must be 3 or greater");if(o<1)throw new Error("verticalSubdivisions must be 1 or greater");for(var a=void 0===u||u,f=void 0===i||i,c=(a?2:0)+(f?2:0),l=(n+1)*(o+1+c),s=b(3,l),v=b(3,l),y=b(2,l),d=b(3,n*(o+c)*2,Uint16Array),m=n+1,p=Math.atan2(e-r,t),x=Math.cos(p),w=Math.sin(p),h=o+(f?2:0),F=a?-2:0;F<=h;++F){var E=F/o,A=t*E,O=void 0;F<0?(A=0,E=1,O=e):F>o?(A=t,E=1,O=r):O=e+F/o*(r-e),-2!==F&&F!==o+2||(O=0,E=0),A-=t/2;for(var _=0;_<m;++_){var j=Math.sin(_*Math.PI*2/n),M=Math.cos(_*Math.PI*2/n);s.push(j*O,A,M*O),F<0?v.push(0,-1,0):F>o?v.push(0,1,0):0===O?v.push(0,0,0):v.push(j*x,w,M*x),y.push(_/n,1-E)}}for(var P=0;P<o+c;++P)for(var R=0;R<n;++R)d.push(m*(P+0)+0+R,m*(P+0)+1+R,m*(P+1)+1+R),d.push(m*(P+0)+0+R,m*(P+1)+1+R,m*(P+1)+0+R);return{position:s,normal:v,texcoord:y,indices:d}}function M(e,r){r=r||[];for(var t=[],n=0;n<e.length;n+=4){var o=e[n],u=e.slice(n+1,n+4);u.push.apply(u,r);for(var i=0;i<o;++i)t.push.apply(t,u)}return t}function P(){var e=[0,0,0,0,150,0,30,0,0,0,150,0,30,150,0,30,0,0,30,0,0,30,30,0,100,0,0,30,30,0,100,30,0,100,0,0,30,60,0,30,90,0,67,60,0,30,90,0,67,90,0,67,60,0,0,0,30,30,0,30,0,150,30,0,150,30,30,0,30,30,150,30,30,0,30,100,0,30,30,30,30,30,30,30,100,0,30,100,30,30,30,60,30,67,60,30,30,90,30,30,90,30,67,60,30,67,90,30,0,0,0,100,0,0,100,0,30,0,0,0,100,0,30,0,0,30,100,0,0,100,30,0,100,30,30,100,0,0,100,30,30,100,0,30,30,30,0,30,30,30,100,30,30,30,30,0,100,30,30,100,30,0,30,30,0,30,60,30,30,30,30,30,30,0,30,60,0,30,60,30,30,60,0,67,60,30,30,60,30,30,60,0,67,60,0,67,60,30,67,60,0,67,90,30,67,60,30,67,60,0,67,90,0,67,90,30,30,90,0,30,90,30,67,90,30,30,90,0,67,90,30,67,90,0,30,90,0,30,150,30,30,90,30,30,90,0,30,150,0,30,150,30,0,150,0,0,150,30,30,150,30,0,150,0,30,150,30,30,150,0,0,0,0,0,0,30,0,150,30,0,0,0,0,150,30,0,150,0],r=M([18,0,0,1,18,0,0,-1,6,0,1,0,6,1,0,0,6,0,-1,0,6,1,0,0,6,0,1,0,6,1,0,0,6,0,-1,0,6,1,0,0,6,0,-1,0,6,-1,0,0]),t=M([18,200,70,120,18,80,70,200,6,70,200,210,6,200,200,70,6,210,100,70,6,210,160,70,6,70,180,210,6,100,70,210,6,76,210,100,6,140,210,80,6,90,130,110,6,160,160,220],[255]),n=e.length/3,o={position:b(3,n),texcoord:b(2,n),normal:b(3,n),color:b(4,n,Uint8Array),indices:b(3,n/3,Uint16Array)};o.position.push(e),o.texcoord.push([.22,.19,.22,.79,.34,.19,.22,.79,.34,.79,.34,.19,.34,.19,.34,.31,.62,.19,.34,.31,.62,.31,.62,.19,.34,.43,.34,.55,.49,.43,.34,.55,.49,.55,.49,.43,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,1,1,0,0,1,1,1,0]),o.normal.push(r),o.color.push(t);for(var u=0;u<n;++u)o.indices.push(u);return o}function R(e,r,t,n,o,u,i){if(o<=0)throw new Error("subdivisionDown must be > 0");var f=(i=i||1)-(u=u||0),c=2*(o+1)*4,l=b(3,c),s=b(3,c),v=b(2,c);function y(e,r,t){return e+(r-e)*t}function d(r,t,i,c,b,d){for(var m=0;m<=o;m++){var p=t/1,x=m/o,w=2*(p-.5),h=(u+x*f)*Math.PI,F=Math.sin(h),E=Math.cos(h),A=y(e,r,F),O=w*n,_=E*e,j=F*A;l.push(O,_,j);var M=a.add(a.multiply([0,F,E],i),c);s.push(M),v.push(p*b+d,x)}}for(var m=0;m<2;m++){var p=2*(m/1-.5);d(r,m,[1,1,1],[0,0,0],1,0),d(r,m,[0,0,0],[p,0,0],0,0),d(t,m,[1,1,1],[0,0,0],1,0),d(t,m,[0,0,0],[p,0,0],0,1)}var x=b(3,2*o*4,Uint16Array);function w(e,r){for(var t=0;t<o;++t)x.push(e+t+0,e+t+1,r+t+0),x.push(e+t+1,r+t+1,r+t+0)}var h=o+1;return w(0*h,4*h),w(5*h,7*h),w(6*h,2*h),w(3*h,1*h),{position:l,normal:s,texcoord:v,indices:x}}function T(e,r,t,n,o,u){return j(e,e,r,t,n,o,u)}function g(e,r,t,n,o,u){if(t<3)throw new Error("radialSubdivisions must be 3 or greater");if(n<3)throw new Error("verticalSubdivisions must be 3 or greater");o=o||0;for(var i=(u=u||2*Math.PI)-o,a=t+1,f=n+1,c=a*f,l=b(3,c),s=b(3,c),v=b(2,c),y=b(3,t*n*2,Uint16Array),d=0;d<f;++d)for(var m=d/n,p=m*Math.PI*2,x=Math.sin(p),w=e+x*r,h=Math.cos(p),F=h*r,E=0;E<a;++E){var A=E/t,O=o+A*i,_=Math.sin(O),j=Math.cos(O),M=_*w,P=j*w,R=_*x,T=j*x;l.push(M,F,P),s.push(R,h,T),v.push(A,1-m)}for(var g=0;g<n;++g)for(var z=0;z<t;++z){var U=1+z,C=1+g;y.push(a*g+z,a*C+z,a*g+U),y.push(a*C+z,a*C+U,a*g+U)}return{position:l,normal:s,texcoord:v,indices:y}}function z(e,r,t,n,o){if(r<3)throw new Error("divisions must be at least 3");o=o||1,n=n||0;for(var u=(r+1)*((t=t||1)+1),i=b(3,u),a=b(3,u),f=b(2,u),c=b(3,t*r*2,Uint16Array),l=0,s=e-n,v=r+1,y=0;y<=t;++y){for(var d=n+s*Math.pow(y/t,o),m=0;m<=r;++m){var p=2*Math.PI*m/r,x=d*Math.cos(p),w=d*Math.sin(p);if(i.push(x,0,w),a.push(0,1,0),f.push(1-m/r,y/t),y>0&&m!==r){var h=l+(m+1),F=l+m,E=l+m-v,A=l+(m+1)-v;c.push(h,F,E),c.push(h,E,A)}}l+=r+1}return{position:i,normal:a,texcoord:f,indices:c}}function U(e){return function(r){var t=e.apply(this,Array.prototype.slice.call(arguments,1));return n.createBuffersFromArrays(r,t)}}function C(e){return function(r){var t=e.apply(null,Array.prototype.slice.call(arguments,1));return n.createBufferInfoFromArrays(r,t)}}var S=["numComponents","size","type","normalize","stride","offset","attrib","name","attribName"];function k(e,r,t,n){n=n||0;for(var o=e.length,u=0;u<o;++u)r[t+u]=e[u]+n}function W(e,r){var t=l(e),n=new t.constructor(r),u=n;return t.numComponents&&t.numElements&&v(n,t.numComponents),e.data&&(u={data:n},o.copyNamedProperties(S,e,u)),u}var I=C(P);r.create3DFBufferInfo=I;var B=U(P);r.create3DFBuffers=B;var L=C(_);r.createCubeBufferInfo=L;var G=U(_);r.createCubeBuffers=G;var X=C(E);r.createPlaneBufferInfo=X;var D=U(E);r.createPlaneBuffers=D;var N=C(A);r.createSphereBufferInfo=N;var H=U(A);r.createSphereBuffers=H;var q=C(j);r.createTruncatedConeBufferInfo=q;var V=U(j);r.createTruncatedConeBuffers=V;var Y=C(F);r.createXYQuadBufferInfo=Y;var K=U(F);r.createXYQuadBuffers=K;var Z=C(R);r.createCrescentBufferInfo=Z;var $=U(R);r.createCrescentBuffers=$;var J=C(T);r.createCylinderBufferInfo=J;var Q=U(T);r.createCylinderBuffers=Q;var ee=C(g);r.createTorusBufferInfo=ee;var re=U(g);r.createTorusBuffers=re;var te=C(z);r.createDiscBufferInfo=te;var ne=U(z);r.createDiscBuffers=ne;var oe=Z;r.createCresentBufferInfo=oe;var ue=$;r.createCresentBuffers=ue;var ie=R;r.createCresentVertices=ie},function(e,r,t){"use strict";r.__esModule=!0;var n={addExtensionsToContext:!0,getContext:!0,getWebGLContext:!0,resizeCanvasToDisplaySize:!0,setDefaults:!0,attributes:!0,textures:!0,utils:!0,draw:!0,framebuffers:!0,programs:!0,typedarrays:!0,vertexArrays:!0};r.addExtensionsToContext=w,r.getContext=function(e,r){return function(e,r){for(var t=["webgl2","webgl","experimental-webgl"],n=null,o=0;o<t.length;++o)if(n=e.getContext(t[o],r)){d.addExtensionsToContext&&w(n);break}return n}(e,r)},r.getWebGLContext=function(e,r){return function(e,r){for(var t=["webgl","experimental-webgl"],n=null,o=0;o<t.length;++o)if(n=e.getContext(t[o],r)){d.addExtensionsToContext&&w(n);break}return n}(e,r)},r.resizeCanvasToDisplaySize=function(e,r){r=r||1,r=Math.max(0,r);var t=e.clientWidth*r|0,n=e.clientHeight*r|0;if(e.width!==t||e.height!==n)return e.width=t,e.height=n,!0;return!1},r.setDefaults=function(e){i.copyExistingProperties(e,d),o.setAttributeDefaults_(e),u.setTextureDefaults_(e)},r.vertexArrays=r.typedarrays=r.programs=r.framebuffers=r.draw=r.utils=r.textures=r.attributes=void 0;var o=y(t(6));r.attributes=o,Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(r[e]=o[e]))}));var u=y(t(7));r.textures=u,Object.keys(u).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(r[e]=u[e]))}));var i=y(t(0)),a=y(t(3));r.utils=a,Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(r[e]=a[e]))}));var f=y(t(11));r.draw=f,Object.keys(f).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(r[e]=f[e]))}));var c=y(t(12));r.framebuffers=c,Object.keys(c).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(r[e]=c[e]))}));var l=y(t(4));r.programs=l,Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(r[e]=l[e]))}));var s=y(t(1));r.typedarrays=s,Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(r[e]=s[e]))}));var v=y(t(13));function b(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return b=function(){return e},e}function y(e){if(e&&e.__esModule)return e;var r=b();if(r&&r.has(e))return r.get(e);var t={};if(null!=e){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=n?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(t,o,u):t[o]=e[o]}}return t.default=e,r&&r.set(e,t),t}r.vertexArrays=v,Object.keys(v).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(r[e]=v[e]))}));var d={addExtensionsToContext:!0};var m=/^(.*?)_/;function p(e,r){a.glEnumToString(e,0);var t=e.getExtension(r);if(t){var n={},o=m.exec(r)[1],u="_"+o;for(var f in t){var c=t[f],l="function"==typeof c,s=l?o:u,v=f;f.endsWith(s)&&(v=f.substring(0,f.length-s.length)),void 0!==e[v]?l||e[v]===c||i.warn(v,e[v],c,f):l?e[v]=function(e){return function(){return e.apply(t,arguments)}}(c):(e[v]=c,n[v]=c)}n.constructor={name:t.constructor.name},a.glEnumToString(n,0)}return t}var x=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_color_buffer_float","EXT_color_buffer_half_float","EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2","EXT_frag_depth","EXT_sRGB","EXT_shader_texture_lod","EXT_texture_filter_anisotropic","OES_element_index_uint","OES_standard_derivatives","OES_texture_float","OES_texture_float_linear","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_compressed_texture_atc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_depth_texture","WEBGL_draw_buffers"];function w(e){for(var r=0;r<x.length;++r)p(e,x[r])}},function(e,r,t){"use strict";r.__esModule=!0,r.drawBufferInfo=u,r.drawObjectList=function(e,r){var t=null,o=null;r.forEach((function(r){if(!1!==r.active){var i=r.programInfo,a=r.vertexArrayInfo||r.bufferInfo,f=!1,c=void 0===r.type?4:r.type;i!==t&&(t=i,e.useProgram(i.program),f=!0),(f||a!==o)&&(o&&o.vertexArrayObject&&!a.vertexArrayObject&&e.bindVertexArray(null),o=a,n.setBuffersAndAttributes(e,i,a)),n.setUniforms(i,r.uniforms),u(e,a,c,r.count,r.offset,r.instanceCount)}})),o&&o.vertexArrayObject&&e.bindVertexArray(null)};var n=function(e){if(e&&e.__esModule)return e;var r=o();if(r&&r.has(e))return r.get(e);var t={};if(null!=e){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var i=n?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(t,u,i):t[u]=e[u]}}t.default=e,r&&r.set(e,t);return t}(t(4));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function u(e,r,t,n,o,u){t=void 0===t?4:t;var i=r.indices,a=r.elementType,f=void 0===n?r.numElements:n;o=void 0===o?0:o,a||i?void 0!==u?e.drawElementsInstanced(t,f,void 0===a?5123:r.elementType,o,u):e.drawElements(t,f,void 0===a?5123:r.elementType,o):void 0!==u?e.drawArraysInstanced(t,o,f,u):e.drawArrays(t,o,f)}},function(e,r,t){"use strict";r.__esModule=!0,r.bindFramebufferInfo=function(e,r,t){t=t||36160,r?(e.bindFramebuffer(t,r.framebuffer),e.viewport(0,0,r.width,r.height)):(e.bindFramebuffer(t,null),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight))},r.createFramebufferInfo=function(e,r,t,u){var i=e.createFramebuffer();e.bindFramebuffer(36160,i),t=t||e.drawingBufferWidth,u=u||e.drawingBufferHeight;var l=0,s={framebuffer:i,attachments:[],width:t,height:u};return(r=r||a).forEach((function(r){var i=r.attachment,a=r.format,v=function(e){return f[e]}(a);if(v||(v=36064+l++),!i)if(function(e){return c[e]}(a))i=e.createRenderbuffer(),e.bindRenderbuffer(36161,i),e.renderbufferStorage(36161,a,t,u);else{var b=Object.assign({},r);b.width=t,b.height=u,void 0===b.auto&&(b.auto=!1,b.min=b.min||b.minMag||9729,b.mag=b.mag||b.minMag||9729,b.wrapS=b.wrapS||b.wrap||33071,b.wrapT=b.wrapT||b.wrap||33071),i=n.createTexture(e,b)}if(o.isRenderbuffer(e,i))e.framebufferRenderbuffer(36160,v,36161,i);else{if(!o.isTexture(e,i))throw new Error("unknown attachment type");void 0!==r.layer?e.framebufferTextureLayer(36160,v,i,r.level||0,r.layer):e.framebufferTexture2D(36160,v,r.texTarget||3553,i,r.level||0)}s.attachments.push(i)})),s},r.resizeFramebufferInfo=function(e,r,t,u,i){u=u||e.drawingBufferWidth,i=i||e.drawingBufferHeight,r.width=u,r.height=i,(t=t||a).forEach((function(t,a){var f=r.attachments[a],c=t.format;if(o.isRenderbuffer(e,f))e.bindRenderbuffer(36161,f),e.renderbufferStorage(36161,c,u,i);else{if(!o.isTexture(e,f))throw new Error("unknown attachment type");n.resizeTexture(e,f,t,u,i)}}))};var n=i(t(7)),o=i(t(0));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function i(e){if(e&&e.__esModule)return e;var r=u();if(r&&r.has(e))return r.get(e);var t={};if(null!=e){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(t,o,i):t[o]=e[o]}}return t.default=e,r&&r.set(e,t),t}var a=[{format:6408,type:5121,min:9729,wrap:33071},{format:34041}],f={};f[34041]=33306,f[6401]=36128,f[36168]=36128,f[6402]=36096,f[33189]=36096;var c={};c[32854]=!0,c[32855]=!0,c[36194]=!0,c[34041]=!0,c[33189]=!0,c[6401]=!0,c[36168]=!0},function(e,r,t){"use strict";r.__esModule=!0,r.createVertexArrayInfo=function(e,r,t){var o=e.createVertexArray();e.bindVertexArray(o),r.length||(r=[r]);return r.forEach((function(r){n.setBuffersAndAttributes(e,r,t)})),e.bindVertexArray(null),{numElements:t.numElements,elementType:t.elementType,vertexArrayObject:o}},r.createVAOAndSetAttributes=u,r.createVAOFromBufferInfo=function(e,r,t){return u(e,r.attribSetters||r,t.attribs,t.indices)};var n=function(e){if(e&&e.__esModule)return e;var r=o();if(r&&r.has(e))return r.get(e);var t={};if(null!=e){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var i=n?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(t,u,i):t[u]=e[u]}}t.default=e,r&&r.set(e,t);return t}(t(4));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function u(e,r,t,o){var u=e.createVertexArray();return e.bindVertexArray(u),n.setAttributes(r,t),o&&e.bindBuffer(34963,o),e.bindVertexArray(null),u}}])}));