PageSourceSearch

https://www.boundaries-planetarium.earth/35fc8c20-af0c10ffdef802f8da72.js

js boundaries-planetarium.earth collected 2026-10-08 19:45:16 UTC 120,654 bytes, 2 lines download raw bytes

1(self.webpackChunkceiling=self.webpackChunkceiling||[]).push([[75],{364:function(e){e.exports=function(){"use strict";var e=function(e){return e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array||e instanceof Uint8ClampedArray},t=function(e,t){for(var r=Object.keys(t),n=0;n<r.length;++n)e[r[n]]=t[r[n]];return e},r="\n";function n(e){return"undefined"!=typeof atob?atob(e):"base64:"+e}function a(e){var t=new Error("(regl) "+e);throw console.error(t),t}function i(e,t){e||a(t)}function o(e){return e?": "+e:""}function f(e,t,r){e in t||a("unknown parameter ("+e+")"+o(r)+". possible values: "+Object.keys(t).join())}function u(t,r){e(t)||a("invalid parameter type"+o(r)+". must be a typed array")}function s(e,t){switch(t){case"number":return"number"==typeof e;case"object":return"object"==typeof e;case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"function":return"function"==typeof e;case"undefined":return void 0===e;case"symbol":return"symbol"==typeof e}}function c(e,t,r){s(e,t)||a("invalid parameter type"+o(r)+". expected "+t+", got "+typeof e)}function l(e,t){e>=0&&(0|e)===e||a("invalid parameter type, ("+e+")"+o(t)+". must be a nonnegative integer")}function d(e,t,r){t.indexOf(e)<0&&a("invalid value"+o(r)+". must be one of: "+t)}var m=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function p(e){Object.keys(e).forEach((function(e){m.indexOf(e)<0&&a('invalid regl constructor argument "'+e+'". must be one of '+m)}))}function h(e,t){for(e+="";e.length<t;)e=" "+e;return e}function b(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function v(e,t){this.number=e,this.line=t,this.errors=[]}function g(e,t,r){this.file=e,this.line=t,this.message=r}function y(){var e=new Error,t=(e.stack||e).toString(),r=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(t);if(r)return r[1];var n=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(t);return n?n[1]:"unknown"}function x(){var e=new Error,t=(e.stack||e).toString(),r=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(t);if(r)return r[1];var n=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(t);return n?n[1]:"unknown"}function w(e,t){var r=e.split("\n"),a=1,i=0,o={unknown:new b,0:new b};o.unknown.name=o[0].name=t||y(),o.unknown.lines.push(new v(0,""));for(var f=0;f<r.length;++f){var u=r[f],s=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(u);if(s)switch(s[1]){case"line":var c=/(\d+)(\s+\d+)?/.exec(s[2]);c&&(a=0|c[1],c[2]&&((i=0|c[2])in o||(o[i]=new b)));break;case"define":var l=/SHADER_NAME(_B64)?\s+(.*)$/.exec(s[2]);l&&(o[i].name=l[1]?n(l[2]):l[2])}o[i].lines.push(new v(a++,u))}return Object.keys(o).forEach((function(e){var t=o[e];t.lines.forEach((function(e){t.index[e.number]=e}))})),o}function A(e){var t=[];return e.split("\n").forEach((function(e){if(!(e.length<5)){var r=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(e);r?t.push(new g(0|r[1],0|r[2],r[3].trim())):e.length>0&&t.push(new g("unknown",0,e))}})),t}function _(e,t){t.forEach((function(t){var r=e[t.file];if(r){var n=r.index[t.line];if(n)return n.errors.push(t),void(r.hasErrors=!0)}e.unknown.hasErrors=!0,e.unknown.lines[0].errors.push(t)}))}function k(e,t,n,a,o){if(!e.getShaderParameter(t,e.COMPILE_STATUS)){var f=e.getShaderInfoLog(t),u=a===e.FRAGMENT_SHADER?"fragment":"vertex";C(n,"string",u+" shader source must be a string",o);var s=w(n,o),c=A(f);_(s,c),Object.keys(s).forEach((function(e){var t=s[e];if(t.hasErrors){var n=[""],a=[""];i("file number "+e+": "+t.name+"\n","color:red;text-decoration:underline;font-weight:bold"),t.lines.forEach((function(e){if(e.errors.length>0){i(h(e.number,4)+"|  ","background-color:yellow; font-weight:bold"),i(e.line+r,"color:red; background-color:yellow; font-weight:bold");var t=0;e.errors.forEach((function(n){var a=n.message,o=/^\s*'(.*)'\s*:\s*(.*)$/.exec(a);if(o){var f=o[1];a=o[2],"assign"===f&&(f="="),t=Math.max(e.line.indexOf(f,t),0)}else t=0;i(h("| ",6)),i(h("^^^",t+3)+r,"font-weight:bold"),i(h("| ",6)),i(a+r,"font-weight:bold")})),i(h("| ",6)+r)}else i(h(e.number,4)+"|  "),i(e.line+r,"color:red")})),"undefined"==typeof document||window.chrome?console.log(n.join("")):(a[0]=n.join("%c"),console.log.apply(console,a))}function i(e,t){n.push(e),a.push(t||"")}})),i.raise("Error compiling "+u+" shader, "+s[0].name)}}function S(e,t,n,a,o){if(!e.getProgramParameter(t,e.LINK_STATUS)){var f=e.getProgramInfoLog(t),u=w(n,o),s='Error linking program with vertex shader, "'+w(a,o)[0].name+'", and fragment shader "'+u[0].name+'"';"undefined"!=typeof document?console.log("%c"+s+r+"%c"+f,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(s+r+f),i.raise(s)}}function O(e){e._commandRef=y()}function E(e,t,r,n){function a(e){return e?n.id(e):0}function i(e,t){Object.keys(t).forEach((function(t){e[n.id(t)]=!0}))}O(e),e._fragId=a(e.static.frag),e._vertId=a(e.static.vert);var o=e._uniformSet={};i(o,t.static),i(o,t.dynamic);var f=e._attributeSet={};i(f,r.static),i(f,r.dynamic),e._hasCount="count"in e.static||"count"in e.dynamic||"elements"in e.static||"elements"in e.dynamic}function T(e,t){var r=x();a(e+" in command "+(t||y())+("unknown"===r?"":" called from "+r))}function D(e,t,r){e||T(t,r||y())}function j(e,t,r,n){e in t||T("unknown parameter ("+e+")"+o(r)+". possible values: "+Object.keys(t).join(),n||y())}function C(e,t,r,n){s(e,t)||T("invalid parameter type"+o(r)+". expected "+t+", got "+typeof e,n||y())}function z(e){e()}function F(e,t,r){e.texture?d(e.texture._texture.internalformat,t,"unsupported texture format for attachment"):d(e.renderbuffer._renderbuffer.format,r,"unsupported renderbuffer format for attachment")}var V=33071,B=9728,I=9984,P=9985,L=9986,R=9987,M=5121,U=5122,W=5123,G=5124,H=5125,N=5126,q=32819,Q=32820,Y=33635,
1X=34042,$=36193,K={};function J(e,t){return e===Q||e===q||e===Y?2:e===X?4:K[e]*t}function Z(e){return!(e&e-1||!e)}function ee(e,t,r){var n,a=t.width,o=t.height,f=t.channels;i(a>0&&a<=r.maxTextureSize&&o>0&&o<=r.maxTextureSize,"invalid texture shape"),e.wrapS===V&&e.wrapT===V||i(Z(a)&&Z(o),"incompatible wrap mode for texture, both width and height must be power of 2"),1===t.mipmask?1!==a&&1!==o&&i(e.minFilter!==I&&e.minFilter!==L&&e.minFilter!==P&&e.minFilter!==R,"min filter requires mipmap"):(i(Z(a)&&Z(o),"texture must be a square power of 2 to support mipmapping"),i(t.mipmask===(a<<1)-1,"missing or incomplete mipmap data")),t.type===N&&(r.extensions.indexOf("oes_texture_float_linear")<0&&i(e.minFilter===B&&e.magFilter===B,"filter not supported, must enable oes_texture_float_linear"),i(!e.genMipmaps,"mipmap generation not supported with float textures"));var u=t.images;for(n=0;n<16;++n)if(u[n]){var s=a>>n,c=o>>n;i(t.mipmask&1<<n,"missing mipmap data");var l=u[n];if(i(l.width===s&&l.height===c,"invalid shape for mip images"),i(l.format===t.format&&l.internalformat===t.internalformat&&l.type===t.type,"incompatible type for mip image"),l.compressed);else if(l.data){var d=Math.ceil(J(l.type,f)*s/l.unpackAlignment)*l.unpackAlignment;i(l.data.byteLength===d*c,"invalid data for image, buffer size is inconsistent with image format")}else l.element||l.copy}else e.genMipmaps||i(!(t.mipmask&1<<n),"extra mipmap data");t.compressed&&i(!e.genMipmaps,"mipmap generation for compressed images not supported")}function te(e,t,r,n){var a=e.width,o=e.height,f=e.channels;i(a>0&&a<=n.maxTextureSize&&o>0&&o<=n.maxTextureSize,"invalid texture shape"),i(a===o,"cube map must be square"),i(t.wrapS===V&&t.wrapT===V,"wrap mode not supported by cube map");for(var u=0;u<r.length;++u){var s=r[u];i(s.width===a&&s.height===o,"inconsistent cube map face shape"),t.genMipmaps&&(i(!s.compressed,"can not generate mipmap for compressed textures"),i(1===s.mipmask,"can not specify mipmaps and generate mipmaps"));for(var c=s.images,l=0;l<16;++l){var d=c[l];if(d){var m=a>>l,p=o>>l;i(s.mipmask&1<<l,"missing mipmap data"),i(d.width===m&&d.height===p,"invalid shape for mip images"),i(d.format===e.format&&d.internalformat===e.internalformat&&d.type===e.type,"incompatible type for mip image"),d.compressed||(d.data?i(d.data.byteLength===m*p*Math.max(J(d.type,f),d.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):d.element||d.copy)}}}}K[5120]=K[M]=1,K[U]=K[W]=K[$]=K[Y]=K[q]=K[Q]=2,K[G]=K[H]=K[N]=K[X]=4;var re=t(i,{optional:z,raise:a,commandRaise:T,command:D,parameter:f,commandParameter:j,constructor:p,type:c,commandType:C,isTypedArray:u,nni:l,oneOf:d,shaderError:k,linkError:S,callSite:x,saveCommandRef:O,saveDrawInfo:E,framebufferFormat:F,guessCommand:y,texture2D:ee,textureCube:te}),ne=0,ae=0,ie=5,oe=6;function fe(e,t){this.id=ne++,this.type=e,this.data=t}function ue(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function se(e){if(0===e.length)return[];var t=e.charAt(0),r=e.charAt(e.length-1);if(e.length>1&&t===r&&('"'===t||"'"===t))return['"'+ue(e.substr(1,e.length-2))+'"'];var n=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e);if(n)return se(e.substr(0,n.index)).concat(se(n[1])).concat(se(e.substr(n.index+n[0].length)));var a=e.split(".");if(1===a.length)return['"'+ue(e)+'"'];for(var i=[],o=0;o<a.length;++o)i=i.concat(se(a[o]));return i}function ce(e){return"["+se(e).join("][")+"]"}function le(e,t){return new fe(e,ce(t+""))}function de(e){return"function"==typeof e&&!e._reglType||e instanceof fe}function me(e,t){return"function"==typeof e?new fe(ae,e):"number"==typeof e||"boolean"==typeof e?new fe(ie,e):Array.isArray(e)?new fe(oe,e.map((function(e,r){return me(e,t+"["+r+"]")}))):e instanceof fe?e:void re(!1,"invalid option type in uniform "+t)}var pe={DynamicVariable:fe,define:le,isDynamic:de,unbox:me,accessor:ce},he={next:"function"==typeof requestAnimationFrame?function(e){return requestAnimationFrame(e)}:function(e){return setTimeout(e,16)},cancel:"function"==typeof cancelAnimationFrame?function(e){return cancelAnimationFrame(e)}:clearTimeout},be="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function ve(){var e={"":0},t=[""];return{id:function(r){var n=e[r];return n||(n=e[r]=t.length,t.push(r),n)},str:function(e){return t[e]}}}function ge(e,r,n){var a,i=document.createElement("canvas");function o(){var t=window.innerWidth,r=window.innerHeight;if(e!==document.body){var a=i.getBoundingClientRect();t=a.right-a.left,r=a.bottom-a.top}i.width=n*t,i.height=n*r}function f(){a?a.disconnect():window.removeEventListener("resize",o),e.removeChild(i)}return t(i.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),e.appendChild(i),e===document.body&&(i.style.position="absolute",t(e.style,{margin:0,padding:0})),e!==document.body&&"function"==typeof ResizeObserver?(a=new ResizeObserver((function(){setTimeout(o)}))).observe(e):window.addEventListener("resize",o,!1),o(),{canvas:i,onDestroy:f}}function ye(e,t){function r(r){try{return e.getContext(r,t)}catch(n){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}function xe(e){return"string"==typeof e.nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect}function we(e){return"function"==typeof e.drawArrays||"function"==typeof e.drawElements}function Ae(e){return"string"==typeof e?e.split():(re(Array.isArray(e),"invalid extension array"),e)}function _e(e){return"string"==typeof e?(re("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(e)):e}function ke(e){var t,r,n,a,i=e||{},o={},f=[],u=[],s="undefined"==typeof window?1:window.devicePixelRatio,c=!1,l=function(e){e&&re.raise(e)},d=function(){};if("string"==typeof i?(re("undefined"!=typeof document,"selector queries only supported in DOM environments"),t=document.querySelector(i),re(t,"invali
1d query string for element")):"object"==typeof i?xe(i)?t=i:we(i)?n=(a=i).canvas:(re.constructor(i),"gl"in i?a=i.gl:"canvas"in i?n=_e(i.canvas):"container"in i&&(r=_e(i.container)),"attributes"in i&&(o=i.attributes,re.type(o,"object","invalid context attributes")),"extensions"in i&&(f=Ae(i.extensions)),"optionalExtensions"in i&&(u=Ae(i.optionalExtensions)),"onDone"in i&&(re.type(i.onDone,"function","invalid or missing onDone callback"),l=i.onDone),"profile"in i&&(c=!!i.profile),"pixelRatio"in i&&(s=+i.pixelRatio,re(s>0,"invalid pixel ratio"))):re.raise("invalid arguments to regl"),t&&("canvas"===t.nodeName.toLowerCase()?n=t:r=t),!a){if(!n){re("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var m=ge(r||document.body,l,s);if(!m)return null;n=m.canvas,d=m.onDestroy}void 0===o.premultipliedAlpha&&(o.premultipliedAlpha=!0),a=ye(n,o)}return a?{gl:a,canvas:n,container:r,extensions:f,optionalExtensions:u,pixelRatio:s,profile:c,onDone:l,onDestroy:d}:(d(),l("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function Se(e,t){var r={};function n(t){re.type(t,"string","extension name must be string");var n,a=t.toLowerCase();try{n=r[a]=e.getExtension(a)}catch(i){}return!!n}for(var a=0;a<t.extensions.length;++a){var i=t.extensions[a];if(!n(i))return t.onDestroy(),t.onDone('"'+i+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return t.optionalExtensions.forEach(n),{extensions:r,restore:function(){Object.keys(r).forEach((function(e){if(r[e]&&!n(e))throw new Error("(regl): error restoring extension "+e)}))}}}function Oe(e,t){for(var r=Array(e),n=0;n<e;++n)r[n]=t(n);return r}var Ee=5120,Te=5121,De=5122,je=5123,Ce=5124,ze=5125,Fe=5126;function Ve(e){for(var t=16;t<=1<<28;t*=16)if(e<=t)return t;return 0}function Be(e){var t,r;return t=(e>65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1}function Ie(){var e=Oe(8,(function(){return[]}));function t(t){var r=Ve(t),n=e[Be(r)>>2];return n.length>0?n.pop():new ArrayBuffer(r)}function r(t){e[Be(t.byteLength)>>2].push(t)}function n(e,r){var n=null;switch(e){case Ee:n=new Int8Array(t(r),0,r);break;case Te:n=new Uint8Array(t(r),0,r);break;case De:n=new Int16Array(t(2*r),0,r);break;case je:n=new Uint16Array(t(2*r),0,r);break;case Ce:n=new Int32Array(t(4*r),0,r);break;case ze:n=new Uint32Array(t(4*r),0,r);break;case Fe:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n}function a(e){r(e.buffer)}return{alloc:t,free:r,allocType:n,freeType:a}}var Pe=Ie();Pe.zero=Ie();var Le=3408,Re=3410,Me=3411,Ue=3412,We=3413,Ge=3414,He=3415,Ne=33901,qe=33902,Qe=3379,Ye=3386,Xe=34921,$e=36347,Ke=36348,Je=35661,Ze=35660,et=34930,tt=36349,rt=34076,nt=34024,at=7936,it=7937,ot=7938,ft=35724,ut=34047,st=36063,ct=34852,lt=3553,dt=34067,mt=34069,pt=33984,ht=6408,bt=5126,vt=5121,gt=36160,yt=36053,xt=36064,wt=16384,At=function(e,t){var r=1;t.ext_texture_filter_anisotropic&&(r=e.getParameter(ut));var n=1,a=1;t.webgl_draw_buffers&&(n=e.getParameter(ct),a=e.getParameter(st));var i=!!t.oes_texture_float;if(i){var o=e.createTexture();e.bindTexture(lt,o),e.texImage2D(lt,0,ht,1,1,0,ht,bt,null);var f=e.createFramebuffer();if(e.bindFramebuffer(gt,f),e.framebufferTexture2D(gt,xt,lt,o,0),e.bindTexture(lt,null),e.checkFramebufferStatus(gt)!==yt)i=!1;else{e.viewport(0,0,1,1),e.clearColor(1,0,0,1),e.clear(wt);var u=Pe.allocType(bt,4);e.readPixels(0,0,1,1,ht,bt,u),e.getError()?i=!1:(e.deleteFramebuffer(f),e.deleteTexture(o),i=1===u[0]),Pe.freeType(u)}}var s=!0;if("undefined"==typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var c=e.createTexture(),l=Pe.allocType(vt,36);e.activeTexture(pt),e.bindTexture(dt,c),e.texImage2D(mt,0,ht,3,3,0,ht,vt,l),Pe.freeType(l),e.bindTexture(dt,null),e.deleteTexture(c),s=!e.getError()}return{colorBits:[e.getParameter(Re),e.getParameter(Me),e.getParameter(Ue),e.getParameter(We)],depthBits:e.getParameter(Ge),stencilBits:e.getParameter(He),subpixelBits:e.getParameter(Le),extensions:Object.keys(t).filter((function(e){return!!t[e]})),maxAnisotropic:r,maxDrawbuffers:n,maxColorAttachments:a,pointSizeDims:e.getParameter(Ne),lineWidthDims:e.getParameter(qe),maxViewportDims:e.getParameter(Ye),maxCombinedTextureUnits:e.getParameter(Je),maxCubeMapSize:e.getParameter(rt),maxRenderbufferSize:e.getParameter(nt),maxTextureUnits:e.getParameter(et),maxTextureSize:e.getParameter(Qe),maxAttributes:e.getParameter(Xe),maxVertexUniforms:e.getParameter($e),maxVertexTextureUnits:e.getParameter(Ze),maxVaryingVectors:e.getParameter(Ke),maxFragmentUniforms:e.getParameter(tt),glsl:e.getParameter(ft),renderer:e.getParameter(it),vendor:e.getParameter(at),version:e.getParameter(ot),readFloat:i,npotTextureCube:s}};function _t(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||e(t.data))}var kt=function(e){return Object.keys(e).map((function(t){return e[t]}))},St={shape:Ct,flatten:jt};function Ot(e,t,r){for(var n=0;n<t;++n)r[n]=e[n]}function Et(e,t,r,n){for(var a=0,i=0;i<t;++i)for(var o=e[i],f=0;f<r;++f)n[a++]=o[f]}function Tt(e,t,r,n,a,i){for(var o=i,f=0;f<t;++f)for(var u=e[f],s=0;s<r;++s)for(var c=u[s],l=0;l<n;++l)a[o++]=c[l]}function Dt(e,t,r,n,a){for(var i=1,o=r+1;o<t.length;++o)i*=t[o];var f=t[r];if(t.length-r==4){var u=t[r+1],s=t[r+2],c=t[r+3];for(o=0;o<f;++o)Tt(e[o],u,s,c,n,a),a+=i}else for(o=0;o<f;++o)Dt(e[o],t,r+1,n,a),a+=i}function jt(e,t,r,n){var a=1;if(t.length)for(var i=0;i<t.length;++i)a*=t[i];else a=0;var o=n||Pe.allocType(r,a);switch(t.length){case 0:break;case 1:Ot(e,t[0],o);break;case 2:Et(e,t[0],t[1],o);break;case 3:Tt(e,t[0],t[1],t[2],o,0);break;default:Dt(e,t,0,o,0)}return o}function Ct(e){for(var t=[],r=e;r.length;r=r[0])t.push(r.length);return t}var zt={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array
1]":5121,"[object ArrayBuffer]":5121},Ft={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},Vt={dynamic:35048,stream:35040,static:35044},Bt=St.flatten,It=St.shape,Pt=35044,Lt=35040,Rt=5121,Mt=5126,Ut=[];function Wt(e){return 0|zt[Object.prototype.toString.call(e)]}function Gt(e,t){for(var r=0;r<t.length;++r)e[r]=t[r]}function Ht(e,t,r,n,a,i,o){for(var f=0,u=0;u<r;++u)for(var s=0;s<n;++s)e[f++]=t[a*u+i*s+o]}function Nt(t,r,n,a){var i=0,o={};function f(e){this.id=i++,this.buffer=t.createBuffer(),this.type=e,this.usage=Pt,this.byteLength=0,this.dimension=1,this.dtype=Rt,this.persistentData=null,n.profile&&(this.stats={size:0})}f.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},f.prototype.destroy=function(){m(this)};var u=[];function s(e,t){var r=u.pop();return r||(r=new f(e)),r.bind(),d(r,t,Lt,0,1,!1),r}function c(e){u.push(e)}function l(e,r,n){e.byteLength=r.byteLength,t.bufferData(e.type,r,n)}function d(t,r,n,a,i,o){var f,u;if(t.usage=n,Array.isArray(r)){if(t.dtype=a||Mt,r.length>0)if(Array.isArray(r[0])){f=It(r);for(var s=1,c=1;c<f.length;++c)s*=f[c];t.dimension=s,l(t,u=Bt(r,f,t.dtype),n),o?t.persistentData=u:Pe.freeType(u)}else if("number"==typeof r[0]){t.dimension=i;var d=Pe.allocType(t.dtype,r.length);Gt(d,r),l(t,d,n),o?t.persistentData=d:Pe.freeType(d)}else e(r[0])?(t.dimension=r[0].length,t.dtype=a||Wt(r[0])||Mt,l(t,u=Bt(r,[r.length,r[0].length],t.dtype),n),o?t.persistentData=u:Pe.freeType(u)):re.raise("invalid buffer data")}else if(e(r))t.dtype=a||Wt(r),t.dimension=i,l(t,r,n),o&&(t.persistentData=new Uint8Array(new Uint8Array(r.buffer)));else if(_t(r)){f=r.shape;var m=r.stride,p=r.offset,h=0,b=0,v=0,g=0;1===f.length?(h=f[0],b=1,v=m[0],g=0):2===f.length?(h=f[0],b=f[1],v=m[0],g=m[1]):re.raise("invalid shape"),t.dtype=a||Wt(r.data)||Mt,t.dimension=b;var y=Pe.allocType(t.dtype,h*b);Ht(y,r.data,h,b,v,g,p),l(t,y,n),o?t.persistentData=y:Pe.freeType(y)}else r instanceof ArrayBuffer?(t.dtype=Rt,t.dimension=i,l(t,r,n),o&&(t.persistentData=new Uint8Array(new Uint8Array(r)))):re.raise("invalid buffer data")}function m(e){r.bufferCount--,a(e);var n=e.buffer;re(n,"buffer must not be deleted already"),t.deleteBuffer(n),e.buffer=null,delete o[e.id]}function p(a,i,u,s){r.bufferCount++;var c=new f(i);function l(r){var a=Pt,i=null,o=0,f=0,u=1;return Array.isArray(r)||e(r)||_t(r)||r instanceof ArrayBuffer?i=r:"number"==typeof r?o=0|r:r&&(re.type(r,"object","buffer arguments must be an object, a number or an array"),"data"in r&&(re(null===i||Array.isArray(i)||e(i)||_t(i),"invalid data for buffer"),i=r.data),"usage"in r&&(re.parameter(r.usage,Vt,"invalid buffer usage"),a=Vt[r.usage]),"type"in r&&(re.parameter(r.type,Ft,"invalid buffer type"),f=Ft[r.type]),"dimension"in r&&(re.type(r.dimension,"number","invalid dimension"),u=0|r.dimension),"length"in r&&(re.nni(o,"buffer length must be a nonnegative integer"),o=0|r.length)),c.bind(),i?d(c,i,a,f,u,s):(o&&t.bufferData(c.type,o,a),c.dtype=f||Rt,c.usage=a,c.dimension=u,c.byteLength=o),n.profile&&(c.stats.size=c.byteLength*Ut[c.dtype]),l}function p(e,r){re(r+e.byteLength<=c.byteLength,"invalid buffer subdata call, buffer is too small.  Can't write data of size "+e.byteLength+" starting from offset "+r+" to a buffer of size "+c.byteLength),t.bufferSubData(c.type,r,e)}function h(t,r){var n,a=0|(r||0);if(c.bind(),e(t)||t instanceof ArrayBuffer)p(t,a);else if(Array.isArray(t)){if(t.length>0)if("number"==typeof t[0]){var i=Pe.allocType(c.dtype,t.length);Gt(i,t),p(i,a),Pe.freeType(i)}else if(Array.isArray(t[0])||e(t[0])){n=It(t);var o=Bt(t,n,c.dtype);p(o,a),Pe.freeType(o)}else re.raise("invalid buffer data")}else if(_t(t)){n=t.shape;var f=t.stride,u=0,s=0,d=0,m=0;1===n.length?(u=n[0],s=1,d=f[0],m=0):2===n.length?(u=n[0],s=n[1],d=f[0],m=f[1]):re.raise("invalid shape");var h=Array.isArray(t.data)?c.dtype:Wt(t.data),b=Pe.allocType(h,u*s);Ht(b,t.data,u,s,d,m,t.offset),p(b,a),Pe.freeType(b)}else re.raise("invalid data for buffer subdata");return l}return o[c.id]=c,u||l(a),l._reglType="buffer",l._buffer=c,l.subdata=h,n.profile&&(l.stats=c.stats),l.destroy=function(){m(c)},l}
1function h(){kt(o).forEach((function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)}))}return n.profile&&(r.getTotalBufferSize=function(){var e=0;return Object.keys(o).forEach((function(t){e+=o[t].stats.size})),e}),{create:p,createStream:s,destroyStream:c,clear:function(){kt(o).forEach(m),u.forEach(m)},getBuffer:function(e){return e&&e._buffer instanceof f?e._buffer:null},restore:h,_initBuffer:d}}Ut[5120]=1,Ut[5122]=2,Ut[5124]=4,Ut[5121]=1,Ut[5123]=2,Ut[5125]=4,Ut[5126]=4;var qt={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Qt=0,Yt=1,Xt=4,$t=5120,Kt=5121,Jt=5122,Zt=5123,er=5124,tr=5125,rr=34963,nr=35040,ar=35044;function ir(t,r,n,a){var i={},o=0,f={uint8:Kt,uint16:Zt};function u(e){this.id=o++,i[this.id]=this,this.buffer=e,this.primType=Xt,this.vertCount=0,this.type=0}r.oes_element_index_uint&&(f.uint32=tr),u.prototype.bind=function(){this.buffer.bind()};var s=[];function c(e){var t=s.pop();return t||(t=new u(n.create(null,rr,!0,!1)._buffer)),d(t,e,nr,-1,-1,0,0),t}function l(e){s.push(e)}function d(a,i,o,f,u,s,c){var l;if(a.buffer.bind(),i){var d=c;c||e(i)&&(!_t(i)||e(i.data))||(d=r.oes_element_index_uint?tr:Zt),n._initBuffer(a.buffer,i,o,d,3)}else t.bufferData(rr,s,o),a.buffer.dtype=l||Kt,a.buffer.usage=o,a.buffer.dimension=3,a.buffer.byteLength=s;if(l=c,!c){switch(a.buffer.dtype){case Kt:case $t:l=Kt;break;case Zt:case Jt:l=Zt;break;case tr:case er:l=tr;break;default:re.raise("unsupported type for element array")}a.buffer.dtype=l}a.type=l,re(l!==tr||!!r.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var m=u;m<0&&(m=a.buffer.byteLength,l===Zt?m>>=1:l===tr&&(m>>=2)),a.vertCount=m;var p=f;if(f<0){p=Xt;var h=a.buffer.dimension;1===h&&(p=Qt),2===h&&(p=Yt),3===h&&(p=Xt)}a.primType=p}function m(e){a.elementsCount--,re(null!==e.buffer,"must not double destroy elements"),delete i[e.id],e.buffer.destroy(),e.buffer=null}function p(t,r){var i=n.create(null,rr,!0),o=new u(i._buffer);function s(t){if(t)if("number"==typeof t)i(t),o.primType=Xt,o.vertCount=0|t,o.type=Kt;else{var r=null,n=ar,a=-1,u=-1,c=0,l=0;Array.isArray(t)||e(t)||_t(t)?r=t:(re.type(t,"object","invalid arguments for elements"),"data"in t&&(r=t.data,re(Array.isArray(r)||e(r)||_t(r),"invalid data for element buffer")),"usage"in t&&(re.parameter(t.usage,Vt,"invalid element buffer usage"),n=Vt[t.usage]),"primitive"in t&&(re.parameter(t.primitive,qt,"invalid element buffer primitive"),a=qt[t.primitive]),"count"in t&&(re("number"==typeof t.count&&t.count>=0,"invalid vertex count for elements"),u=0|t.count),"type"in t&&(re.parameter(t.type,f,"invali
1d buffer type"),l=f[t.type]),"length"in t?c=0|t.length:(c=u,l===Zt||l===Jt?c*=2:l!==tr&&l!==er||(c*=4))),d(o,r,n,a,u,c,l)}else i(),o.primType=Xt,o.vertCount=0,o.type=Kt;return s}return a.elementsCount++,s(t),s._reglType="elements",s._elements=o,s.subdata=function(e,t){return i.subdata(e,t),s},s.destroy=function(){m(o)},s}return{create:p,createStream:c,destroyStream:l,getElements:function(e){return"function"==typeof e&&e._elements instanceof u?e._elements:null},clear:function(){kt(i).forEach(m)}}}var or=new Float32Array(1),fr=new Uint32Array(or.buffer),ur=5123;function sr(e){for(var t=Pe.allocType(ur,e.length),r=0;r<e.length;++r)if(isNaN(e[r]))t[r]=65535;else if(e[r]===1/0)t[r]=31744;else if(e[r]===-1/0)t[r]=64512;else{or[0]=e[r];var n=fr[0],a=n>>>31<<15,i=(n<<1>>>24)-127,o=n>>13&1023;if(i<-24)t[r]=a;else if(i<-14){var f=-14-i;t[r]=a+(o+1024>>f)}else t[r]=i>15?a+31744:a+(i+15<<10)+o}return t}function cr(t){return Array.isArray(t)||e(t)}var lr=function(e){return!(e&e-1||!e)},dr=34467,mr=3553,pr=34067,hr=34069,br=6408,vr=6406,gr=6407,yr=6409,xr=6410,wr=32854,Ar=32855,_r=36194,kr=32819,Sr=32820,Or=33635,Er=34042,Tr=6402,Dr=34041,jr=35904,Cr=35906,zr=36193,Fr=33776,Vr=33777,Br=33778,Ir=33779,Pr=35986,Lr=35987,Rr=34798,Mr=35840,Ur=35841,Wr=35842,Gr=35843,Hr=36196,Nr=5121,qr=5123,Qr=5125,Yr=5126,Xr=10242,$r=10243,Kr=10497,Jr=33071,Zr=33648,en=10240,tn=10241,rn=9728,nn=9729,an=9984,on=9985,fn=9986,un=9987,sn=33170,cn=4352,ln=4353,dn=4354,mn=34046,pn=3317,hn=37440,bn=37441,vn=37443,gn=37444,yn=33984,xn=[an,fn,on,un],wn=[0,yr,xr,gr,br],An={};function _n(e){return"[object "+e+"]"}An[yr]=An[vr]=An[Tr]=1,An[Dr]=An[xr]=2,An[gr]=An[jr]=3,An[br]=An[Cr]=4;var kn=_n("HTMLCanvasElement"),Sn=_n("OffscreenCanvas"),On=_n("CanvasRenderingContext2D"),En=_n("ImageBitmap"),Tn=_n("HTMLImageElement"),Dn=_n("HTMLVideoElement"),jn=Object.keys(zt).concat([kn,Sn,On,En,Tn,Dn]),Cn=[];Cn[Nr]=1,Cn[Yr]=4,Cn[zr]=2,Cn[qr]=2,Cn[Qr]=4;var zn=[];function Fn(e){return Array.isArray(e)&&(0===e.length||"number"==typeof e[0])}function Vn(e){return!!Array.isArray(e)&&!(0===e.length||!cr(e[0]))}function Bn(e){return Object.prototype.toString.call(e)}function In(e){return Bn(e)===kn}function Pn(e){return Bn(e)===Sn}function Ln(e){return Bn(e)===On}function Rn(e){return Bn(e)===En}function Mn(e){return Bn(e)===Tn}function Un(e){return Bn(e)===Dn}function Wn(e){if(!e)return!1;var t=Bn(e);return jn.indexOf(t)>=0||Fn(e)||Vn(e)||_t(e)}function Gn(e){return 0|zt[Object.prototype.toString.call(e)]}function Hn(e,t){var r=t.length;switch(e.type){case Nr:case qr:case Qr:case Yr:var n=Pe.allocType(e.type,r);n.set(t),e.data=n;break;case zr:e.data=sr(t);break;default:re.raise("unsupported texture type, must specify a typed array")}}function Nn(e,t){return Pe.allocType(e.type===zr?Yr:e.type,t)}function qn(e,t){e.type===zr?(e.data=sr(t),Pe.freeType(t)):e.data=t}function Qn(e,t,r,n,a,i){for(var o=e.width,f=e.height,u=e.channels,s=Nn(e,o*f*u),c=0,l=0;l<f;++l)for(var d=0;d<o;++d)for(var m=0;m<u;++m)s[c++]=t[r*d+n*l+a*m+i];qn(e,s)}function Yn(e,t,r,n,a,i){var o;if(o=void 0!==zn[e]?zn[e]:An[e]*Cn[t],i&&(o*=6),a){for(var f=0,u=r;u>=1;)f+=o*u*u,u/=2;return f}return o*r*n}function Xn(r,n,a,i,o,f,u){var s={"don't care":cn,"dont care":cn,nice:dn,fast:ln},c={repeat:Kr,clamp:Jr,mirror:Zr},l={nearest:rn,linear:nn},d=t({mipmap:un,"nearest mipmap nearest":an,"linear mipmap nearest":on,"nearest mipmap linear":fn,"linear mipmap linear":un},l),m={none:0,browser:gn},p={uint8:Nr,rgba4:kr,rgb565:Or,"rgb5 a1":Sr},h={alpha:vr,luminance:yr,"luminance alpha":xr,rgb:gr,rgba:br,rgba4:wr,"rgb5 a1":Ar,rgb565:_r},b={};n.ext_srgb&&(h.srgb=jr,h.srgba=Cr),n.oes_texture_float&&(p.float32=p.float=Yr),n.oes_texture_half_float&&(p.float16=p["half float"]=zr),n.webgl_depth_texture&&(t(h,{depth:Tr,"depth stencil":Dr}),t(p,{uint16:qr,uint32:Qr,"depth stencil":Er})),n.webgl_compressed_texture_s3tc&&t(b,{"rgb s3tc dxt1":Fr,"rgba s3tc dxt1":Vr,"rgba s3tc dxt3":Br,"rgba s3tc dxt5":Ir}),n.webgl_compressed_texture_atc&&t(b,{"rgb atc":Pr,"rgba atc explicit alpha":Lr,"rgba atc interpolated alpha":Rr}),n.webgl_compressed_texture_pvrtc&&t(b,{"rgb pvrtc 4bppv1":Mr,"rgb pvrtc 2bppv1":Ur,"rgba pvrtc 4bppv1":Wr,"rgba pvrtc 2bppv1":Gr}),n.webgl_compressed_texture_etc1&&(b["rgb etc1"]=Hr);var v=Array.prototype.slice.call(r.getParameter(dr));Object.keys(b).forEach((function(e){var t=b[e];v.indexOf(t)>=0&&(h[e]=t)}));var g=Object.keys(h);a.textureFormats=g;var y=[];
vendor: 13,657 bytes, line 1
1Object.keys(h).forEach((function(e){var t=h[e];y[t]=e}));var x=[];Object.keys(p).forEach((function(e){var t=p[e];x[t]=e}));var w=[];Object.keys(l).forEach((function(e){var t=l[e];w[t]=e}));var A=[];Object.keys(d).forEach((function(e){var t=d[e];A[t]=e}));var _=[];Object.keys(c).forEach((function(e){var t=c[e];_[t]=e}));var k=g.reduce((function(e,t){var r=h[t];return r===yr||r===vr||r===yr||r===xr||r===Tr||r===Dr||n.ext_srgb&&(r===jr||r===Cr)?e[r]=r:r===Ar||t.indexOf("rgba")>=0?e[r]=br:e[r]=gr,e}),{});function S(){this.internalformat=br,this.format=br,this.type=Nr,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=gn,this.width=0,this.height=0,this.channels=0}function O(e,t){e.internalformat=t.internalformat,e.format=t.format,e.type=t.type,e.compressed=t.compressed,e.premultiplyAlpha=t.premultiplyAlpha,e.flipY=t.flipY,e.unpackAlignment=t.unpackAlignment,e.colorSpace=t.colorSpace,e.width=t.width,e.height=t.height,e.channels=t.channels}function E(e,t){if("object"==typeof t&&t){if("premultiplyAlpha"in t&&(re.type(t.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),e.premultiplyAlpha=t.premultiplyAlpha),"flipY"in t&&(re.type(t.flipY,"boolean","invalid texture flip"),e.flipY=t.flipY),"alignment"in t&&(re.oneOf(t.alignment,[1,2,4,8],"invalid texture unpack alignment"),e.unpackAlignment=t.alignment),"colorSpace"in t&&(re.parameter(t.colorSpace,m,"invalid colorSpace"),e.colorSpace=m[t.colorSpace]),"type"in t){var r=t.type;re(n.oes_texture_float||!("float"===r||"float32"===r),"you must enable the OES_texture_float extension in order to use floating point textures."),re(n.oes_texture_half_float||!("half float"===r||"float16"===r),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),re(n.webgl_depth_texture||!("uint16"===r||"uint32"===r||"depth stencil"===r),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),re.parameter(r,p,"invalid texture type"),e.type=p[r]}var i=e.width,o=e.height,f=e.channels,u=!1;"shape"in t?(re(Array.isArray(t.shape)&&t.shape.length>=2,"shape must be an array"),i=t.shape[0],o=t.shape[1],3===t.shape.length&&(f=t.shape[2],re(f>0&&f<=4,"invalid number of channels"),u=!0),re(i>=0&&i<=a.maxTextureSize,"invalid width"),re(o>=0&&o<=a.maxTextureSize,"invalid height")):("radius"in t&&(i=o=t.radius,re(i>=0&&i<=a.maxTextureSize,"invalid radius")),"width"in t&&(i=t.width,re(i>=0&&i<=a.maxTextureSize,"invalid width")),"height"in t&&(o=t.height,re(o>=0&&o<=a.maxTextureSize,"invalid height")),"channels"in t&&(f=t.channels,re(f>0&&f<=4,"invalid number of channels"),u=!0)),e.width=0|i,e.height=0|o,e.channels=0|f;var s=!1;if("format"in t){var c=t.format;re(n.webgl_depth_texture||!("depth"===c||"depth stencil"===c),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),re.parameter(c,h,"invalid texture format");var l=e.internalformat=h[c];e.format=k[l],c in p&&("type"in t||(e.type=p[c])),c in b&&(e.compressed=!0),s=!0}!u&&s?e.channels=An[e.format]:u&&!s?e.channels!==wn[e.format]&&(e.format=e.internalformat=wn[e.channels]):s&&u&&re(e.channels===An[e.format],"number of channels inconsistent with specified format")}}function T(e){r.pixelStorei(hn,e.flipY),r.pixelStorei(bn,e.premultiplyAlpha),r.pixelStorei(vn,e.colorSpace),r.pixelStorei(pn,e.unpackAlignment)}function D(){S.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function j(t,r){var n=null;if(Wn(r)?n=r:r&&(re.type(r,"object","invalid pixel data type"),E(t,r),"x"in r&&(t.xOffset=0|r.x),"y"in r&&(t.yOffset=0|r.y),Wn(r.data)&&(n=r.data)),re(!t.compressed||n instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),r.copy){re(!n,"can not specify copy and data field for the same texture");var i=o.viewportWidth,f=o.viewportHeight;t.width=t.width||i-t.xOffset,t.height=t.height||f-t.yOffset,t.needsCopy=!0,re(t.xOffset>=0&&t.xOffset<i&&t.yOffset>=0&&t.yOffset<f&&t.width>0&&t.width<=i&&t.height>0&&t.height<=f,"copy texture read out of bounds")}else if(n){if(e(n))t.channels=t.channels||4,t.data=n,"type"in r||t.type!==Nr||(t.type=Gn(n));else if(Fn(n))t.channels=t.channels||4,Hn(t,n),t.alignment=1,t.needsFree=!0;else if(_t(n)){var u=n.data;Array.isArray(u)||t.type!==Nr||(t.type=Gn(u));var s,c,l,d,m,p,h=n.shape,b=n.stride;3===h.length?(l=h[2],p=b[2]):(re(2===h.length,"invalid ndarray pixel data, must be 2 or 3D"),l=1,p=1),s=h[0],c=h[1],d=b[0],m=b[1],t.alignment=1,t.width=s,t.height=c,t.channels=l,t.format=t.internalformat=wn[l],t.needsFree=!0,Qn(t,u,d,m,p,n.offset)}else if(In(n)||Pn(n)||Ln(n))In(n)||Pn(n)?t.element=n:t.element=n.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(Rn(n))t.element=n,t.width=n.width,t.height=n.height,t.channels=4;else if(Mn(n))t.element=n,t.width=n.naturalWidth,t.height=n.naturalHeight,t.channels=4;else if(Un(n))t.element=n,t.width=n.videoWidth,t.height=n.videoHeight,t.channels=4;else if(Vn(n)){var v=t.width||n[0].length,g=t.height||n.length,y=t.channels;y=cr(n[0][0])?y||n[0][0].length:y||1;for(var x=St.shape(n),w=1,A=0;A<x.length;++A)w*=x[A];var _=Nn(t,w);St.flatten(n,x,"",_),qn(t,_),t.alignment=1,t.width=v,t.height=g,t.channels=y,t.format=t.internalformat=wn[y],t.needsFree=!0}}else t.width=t.width||1,t.height=t.height||1,t.channels=t.channels||4;t.type===Yr?re(a.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):t.type===zr&&re(a.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function C(e,t,n){var a=e.element,o=e.data,f=e.internalformat,u=e.format,s=e.type,c=e.width,l=e.height;T(e),a?r.texImage2D(t,n,u,u,s,a):e.compressed?r.compressedTexImage2D(t,n,f,c,l,0,o):e.needsCopy?(i(),r.copyTexImage2D(t,n,u,e.xOffset,e.yOffset,c,l,0)):r.texImage2D(t,n,u,c,l,0,u,s,o||null)}function z(e,t,n,a,o){var f=e.element,u=e.data,s=e.internalformat,c=e.format,l=e.type,d=e.width,m=e.height;T(e),f?r.texSubImage2D(t,o,n,a,c,l,f):e.compressed?r.compressedTexSubImage2D(t,o,n,a,s,d,m,u):e.needsCopy?(i(),r.copyTexSubImage2D(t,o,n,a,e.xOffset,e.yOffset,d,m)):r.texSubImage2D(t,o,n,a,d,m,c,l,u)}var F=[];function V(){return F.pop()||new D}function B(e){e.needsFree&&Pe.freeType(e.data),D.call(e),F.push(e)}function I(){S.call(this),this.genMipmaps=!1,this.mipmapHint=cn,this.mipmask=0,this.images=Array(16)}function P(e,t,r){var n=e.images[0]=V();e.mipmask=1,n.width=e.width=t,n.height=e.height=r,n.channels=e.channels=4}function L(e,t){var r=null;if(Wn(t))O(r=e.images[0]=V(),e),j(r,t),e.mipmask=1;else if(E(e,t),Array.isArray(t.mipmap))for(var n=t.mipmap,a=0;a<n.length;++a)O(r=e.images[a]=V(),e),r.width>>=a,r.height>>=a,j(r,n[a]),e.mipmask|=1<<a;else O(r=e.images[0]=V(),e),j(r,t),e.mipmask=1;O(e,e.images[0]),!e.compressed||e.internalformat!==Fr&&e.internalformat!==Vr&&e.internalformat!==Br&&e.internalformat!==Ir||re(e.width%4==0&&e.height%4==0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function R(e,t){for(var r=e.images,n=0;n<r.length;++n){if(!r[n])return;C(r[n],t,n)}}var M=[];function U(){var e=M.pop()||new I;S.call(e),e.mipmask=0;for(var t=0;t<16;++t)e.images[t]=null;return e}function W(e){for(var t=e.images,r=0;r<t.length;++r)t[r]&&B(t[r]),t[r]=null;M.push(e)}function G(){this.minFilter=rn,this.magFilter=rn,this.wrapS=Jr,this.wrapT=Jr,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=cn}function H(e,t){if("min"in t){var r=t.min;re.parameter(r,d),e.minFilter=d[r],xn.indexOf(e.minFilter)>=0&&!("faces"in t)&&(e.genMipmaps=!0)}if("mag"in t){var n=t.mag;re.parameter(n,l),e.magFilter=l[n]}var i=e.wrapS,o=e.wrapT;if("wrap"in t){var f=t.wrap;"string"==typeof f?(re.parameter(f,c),i=o=c[f]):Array.isArray(f)&&(re.parameter(f[0],c),re.parameter(f[1],c),i=c[f[0]],o=c[f[1]])}else{if("wrapS"in t){var u=t.wrapS;re.parameter(u,c),i=c[u]}if("wrapT"in t){var m=t.wrapT;re.parameter(m,c),o=c[m]}}if(e.wrapS=i,e.wrapT=o,"anisotropic"in t){var p=t.anisotropic;re("number"==typeof p&&p>=1&&p<=a.maxAnisotropic,"aniso samples must be between 1 and "),e.anisotropic=t.anisotropic}if("mipmap"in t){var h=!1;switch(typeof t.mipmap){case"string":re.parameter(t.mipmap,s,"invalid mipmap hint"),e.mipmapHint=s[t.mipmap],e.genMipmaps=!0,h=!0;break;case"boolean":h=e.genMipmaps=t.mipmap;break;case"object":re(Array.isArray(t.mipmap),"invalid mipmap type"),e.genMipmaps=!1,h=!0;break;default:re.raise("invalid mipmap type")}h&&!("min"in t)&&(e.minFilter=an)}}function N(e,t){r.texParameteri(t,tn,e.minFilter),r.texParameteri(t,en,e.magFilter),r.texParameteri(t,Xr,e.wrapS),r.texParameteri(t,$r,e.wrapT),n.ext_texture_filter_anisotropic&&r.texParameteri(t,mn,e.anisotropic),e.genMipmaps&&(r.hint(sn,e.mipmapHint),r.generateMipmap(t))}var q=0,Q={},Y=a.maxTextureUnits,X=Array(Y).map((function(){return null}));function $(e){S.call(this),this.mipmask=0,this.internalformat=br,this.id=q++,this.refCount=1,this.target=e,this.texture=r.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new G,u.profile&&(this.stats={size:0})}function K(e){r.activeTexture(yn),r.bindTexture(e.target,e.texture)}function J(){var e=X[0];e?r.bindTexture(e.target,e.texture):r.bindTexture(mr,null)}function Z(e){var t=e.texture;re(t,"must not double destroy texture");var n=e.unit,a=e.target;n>=0&&(r.activeTexture(yn+n),r.bindTexture(a,null),X[n]=null),r.deleteTexture(t),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete Q[e.id],f.textureCount--}function ee(e,t){var n=new $(mr);function i(e,t){var r=n.texInfo;G.call(r);var o=U();return"number"==typeof e?P(o,0|e,"number"==typeof t?0|t:0|e):e?(re.type(e,"object","invalid arguments to regl.texture"),H(r,e),L(o,e)):P(o,1,1),r.genMipmaps&&(o.mipmask=(o.width<<1)-1),n.mipmask=o.mipmask,O(n,o),re.texture2D(r,o,a),n.internalformat=o.internalformat,i.width=o.width,i.height=o.height,K(n),R(o,mr),N(r,mr),J(),W(o),u.profile&&(n.stats.size=Yn(n.internalformat,n.type,o.width,o.height,r.genMipmaps,!1)),i.format=y[n.internalformat],i.type=x[n.type],i.mag=w[r.magFilter],i.min=A[r.minFilter],i.wrapS=_[r.wrapS],i.wrapT=_[r.wrapT],i}function o(e,t,r,a){re(!!e,"must specify image data");var o=0|t,f=0|r,u=0|a,s=V();return O(s,n),s.width=0,s.height=0,j(s,e),s.width=s.width||(n.width>>u)-o,s.height=s.height||(n.height>>u)-f,re(n.type===s.type&&n.format===s.format&&n.internalformat===s.internalformat,"incompatible format for texture.subimage"),re(o>=0&&f>=0&&o+s.width<=n.width&&f+s.height<=n.height,"texture.subimage write out of bounds"),re(n.mipmask&1<<u,"missing mipmap data"),re(s.data||s.element||s.needsCopy,"missing image data"),K(n),z(s,mr,o,f,u),J(),B(s),i}function s(e,t){var a=0|e,o=0|t||a;if(a===n.width&&o===n.height)return i;i.width=n.width=a,i.height=n.height=o,K(n);for(var f=0;n.mipmask>>f;++f){var s=a>>f,c=o>>f;if(!s||!c)break;r.texImage2D(mr,f,n.format,s,c,0,n.format,n.type,null)}return J(),u.profile&&(n.stats.size=Yn(n.internalformat,n.type,a,o,!1,!1)),i}return Q[n.id]=n,f.textureCount++,i(e,t),i.subimage=o,i.resize=s,i._reglType="texture2d",i._texture=n,u.profile&&(i.stats=n.stats),i.destroy=function(){n.decRef()},i}function te(e,t,n,i,o,s){var c=new $(pr);Q[c.id]=c,f.cubeCount++;var l=new Array(6);function d(e,t,r,n,i,o){var f,s=c.texInfo;for(G.call(s),f=0;f<6;++f)l[f]=U();if("number"!=typeof e&&e)if("object"==typeof e)if(t)L(l[0],e),L(l[1],t),L(l[2],r),L(l[3],n),L(l[4],i),L(l[5],o);else if(H(s,e),E(c,e),"faces"in e){var m=e.faces;for(re(Array.isArray(m)&&6===m.length,"cube faces must be a length 6 array"),f=0;f<6;++f)re("object"==typeof m[f]&&!!m[f],"invalid input for cube map face"),O(l[f],c),L(l[f],m[f])}else for(f=0;f<6;++f)L(l[f],e);else re.raise("invalid arguments to cube map");else{var p=0|e||1;for(f=0;f<6;++f)P(l[f],p,p)}for(O(c,l[0]),re.optional((function(){a.npotTextureCube||re(lr(c.width)&&lr(c.height),"your browser does not support non power or two texture dimensions")})),s.genMipmaps?c.mipmask=(l[0].width<<1)-1:c.mipmask=l[0].mipmask,re.textureCube(c,s,l,a),c.internalformat=l[0].internalformat,d.width=l[0].width,d.height=l[0].height,K(c),f=0;f<6;++f)R(l[f],hr+f);for(N(s,pr),J(),u.profile&&(c.stats.size=Yn(c.internalformat,c.type,d.width,d.height,s.genMipmaps,!0)),d.format=y[c.internalformat],d.type=x[c.type],d.mag=w[s.magFilter],d.min=A[s.minFilter],d.wrapS=_[s.wrapS],d.wrapT=_[s.wrapT],f=0;f<6;++f)W(l[f]);return d}function m(e,t,r,n,a){re(!!t,"must specify image data"),re("number"==typeof e&&e===(0|e)&&e>=0&&e<6,"invalid face");var i=0|r,o=0|n,f=0|a,u=V();return O(u,c),u.width=0,u.height=0,j(u,t),u.width=u.width||(c.width>>f)-i,u.height=u.height||(c.height>>f)-o,re(c.type===u.type&&c.format===u.format&&c.internalformat===u.internalformat,"incompatible format for texture.subimage"),re(i>=0&&o>=0&&i+u.width<=c.width&&o+u.height<=c.height,"texture.subimage write out of bounds"),re(c.mipmask&1<<f,"missing mipmap data"),re(u.data||u.element||u.needsCopy,"missing image data"),K(c),z(u,hr+e,i,o,f),J(),B(u),d}function p(e){var t=0|e;if(t!==c.width){d.width=c.width=t,d.height=c.height=t,K(c);for(var n=0;n<6;++n)for(var a=0;c.mipmask>>a;++a)r.texImage2D(hr+n,a,c.format,t>>a,t>>a,0,c.format,c.type,null);return J(),u.profile&&(c.stats.size=Yn(c.internalformat,c.type,d.width,d.height,!1,!0)),d}}return d(e,t,n,i,o,s),d.subimage=m,d.resize=p,d._reglType="textureCube",d._texture=c,u.profile&&(d.stats=c.stats),d.destroy=function(){c.decRef()},d}function ne(){for(var e=0;e<Y;++e)r.activeTexture(yn+e),r.bindTexture(mr,null),X[e]=null;kt(Q).forEach(Z),f.cubeCount=0,f.textureCount=0}function ae(){for(var e=0;e<Y;++e){var t=X[e];t&&(t.bindCount=0,t.unit=-1,X[e]=null)}
1kt(Q).forEach((function(e){e.texture=r.createTexture(),r.bindTexture(e.target,e.texture);for(var t=0;t<32;++t)if(e.mipmask&1<<t)if(e.target===mr)r.texImage2D(mr,t,e.internalformat,e.width>>t,e.height>>t,0,e.internalformat,e.type,null);else for(var n=0;n<6;++n)r.texImage2D(hr+n,t,e.internalformat,e.width>>t,e.height>>t,0,e.internalformat,e.type,null);N(e.texInfo,e.target)}))}function ie(){for(var e=0;e<Y;++e){var t=X[e];t&&(t.bindCount=0,t.unit=-1,X[e]=null),r.activeTexture(yn+e),r.bindTexture(mr,null),r.bindTexture(pr,null)}}return t($.prototype,{bind:function(){var e=this;e.bindCount+=1;var t=e.unit;if(t<0){for(var n=0;n<Y;++n){var a=X[n];if(a){if(a.bindCount>0)continue;a.unit=-1}X[n]=e,t=n;break}t>=Y&&re.raise("insufficient number of texture units"),u.profile&&f.maxTextureUnits<t+1&&(f.maxTextureUnits=t+1),e.unit=t,r.activeTexture(yn+t),r.bindTexture(e.target,e.texture)}return t},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&Z(this)}}),u.profile&&(f.getTotalTextureSize=function(){var e=0;return Object.keys(Q).forEach((function(t){e+=Q[t].stats.size})),e}),{create2D:ee,createCube:te,clear:ne,getTexture:function(e){return null},restore:ae,refresh:ie}}zn[wr]=2,zn[Ar]=2,zn[_r]=2,zn[Dr]=4,zn[Fr]=.5,zn[Vr]=.5,zn[Br]=1,zn[Ir]=1,zn[Pr]=.5,zn[Lr]=1,zn[Rr]=1,zn[Mr]=.5,zn[Ur]=.25,zn[Wr]=.5,zn[Gr]=.25,zn[Hr]=.5;var $n=36161,Kn=32854,Jn=32855,Zn=36194,ea=33189,ta=36168,ra=34041,na=35907,aa=34836,ia=34842,oa=34843,fa=[];function ua(e,t,r){return fa[e]*t*r}fa[Kn]=2,fa[Jn]=2,fa[Zn]=2,fa[ea]=2,fa[ta]=1,fa[ra]=4,fa[na]=4,fa[aa]=16,fa[ia]=8,fa[oa]=6;var sa=function(e,t,r,n,a){var i={rgba4:Kn,rgb565:Zn,"rgb5 a1":Jn,depth:ea,stencil:ta,"depth stencil":ra};t.ext_srgb&&(i.srgba=na),t.ext_color_buffer_half_float&&(i.rgba16f=ia,i.rgb16f=oa),t.webgl_color_buffer_float&&(i.rgba32f=aa);var o=[];
1Object.keys(i).forEach((function(e){var t=i[e];o[t]=e}));var f=0,u={};function s(e){this.id=f++,this.refCount=1,this.renderbuffer=e,this.format=Kn,this.width=0,this.height=0,a.profile&&(this.stats={size:0})}function c(t){var r=t.renderbuffer;re(r,"must not double destroy renderbuffer"),e.bindRenderbuffer($n,null),e.deleteRenderbuffer(r),t.renderbuffer=null,t.refCount=0,delete u[t.id],n.renderbufferCount--}function l(t,f){var c=new s(e.createRenderbuffer());function l(t,n){var f=0,u=0,s=Kn;if("object"==typeof t&&t){var d=t;if("shape"in d){var m=d.shape;re(Array.isArray(m)&&m.length>=2,"invalid renderbuffer shape"),f=0|m[0],u=0|m[1]}else"radius"in d&&(f=u=0|d.radius),"width"in d&&(f=0|d.width),"height"in d&&(u=0|d.height);"format"in d&&(re.parameter(d.format,i,"invalid renderbuffer format"),s=i[d.format])}else"number"==typeof t?(f=0|t,u="number"==typeof n?0|n:f):t?re.raise("invalid arguments to renderbuffer constructor"):f=u=1;if(re(f>0&&u>0&&f<=r.maxRenderbufferSize&&u<=r.maxRenderbufferSize,"invalid renderbuffer size"),f!==c.width||u!==c.height||s!==c.format)return l.width=c.width=f,l.height=c.height=u,c.format=s,e.bindRenderbuffer($n,c.renderbuffer),e.renderbufferStorage($n,s,f,u),re(0===e.getError(),"invalid render buffer format"),a.profile&&(c.stats.size=ua(c.format,c.width,c.height)),l.format=o[c.format],l}function d(t,n){var i=0|t,o=0|n||i;return i===c.width&&o===c.height||(re(i>0&&o>0&&i<=r.maxRenderbufferSize&&o<=r.maxRenderbufferSize,"invalid renderbuffer size"),l.width=c.width=i,l.height=c.height=o,e.bindRenderbuffer($n,c.renderbuffer),e.renderbufferStorage($n,c.format,i,o),re(0===e.getError(),"invalid render buffer format"),a.profile&&(c.stats.size=ua(c.format,c.width,c.height))),l}return u[c.id]=c,n.renderbufferCount++,l(t,f),l.resize=d,l._reglType="renderbuffer",l._renderbuffer=c,a.profile&&(l.stats=c.stats),l.destroy=function(){c.decRef()},l}function d(){kt(u).forEach((function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer($n,t.renderbuffer),e.renderbufferStorage($n,t.format,t.width,t.height)})),e.bindRenderbuffer($n,null)}return s.prototype.decRef=function(){--this.refCount<=0&&c(this)},a.profile&&(n.getTotalRenderbufferSize=function(){var e=0;return Object.keys(u).forEach((function(t){e+=u[t].stats.size})),e}),{create:l,clear:function(){kt(u).forEach(c)},restore:d}},ca=36160,la=36161,da=3553,ma=34069,pa=36064,ha=36096,ba=36128,va=33306,ga=36053,ya=36054,xa=36055,wa=36057,Aa=36061,_a=36193,ka=5121,Sa=5126,Oa=6407,Ea=6408,Ta=6402,Da=[Oa,Ea],ja=[];ja[Ea]=4,ja[Oa]=3;var Ca=[];Ca[ka]=1,Ca[Sa]=4,Ca[_a]=2;var za=33189,Fa=36168,Va=34041,Ba=[32854,32855,36194,35907,34842,34843,34836],Ia={};function Pa(e,r,n,a,i,o){var f={cur:null,next:null,dirty:!1,setFBO:null},u=["rgba"],s=["rgba4","rgb565","rgb5 a1"];r.ext_srgb&&s.push("srgba"),r.ext_color_buffer_half_float&&s.push("rgba16f","rgb16f"),r.webgl_color_buffer_float&&s.push("rgba32f");var c=["uint8"];function l(e,t,r){this.target=e,this.texture=t,this.renderbuffer=r;var n=0,a=0;t?(n=t.width,a=t.height):r&&(n=r.width,a=r.height),this.width=n,this.height=a}function d(e){e&&(e.texture&&e.texture._texture.decRef(),e.renderbuffer&&e.renderbuffer._renderbuffer.decRef())}function m(e,t,r){if(e)if(e.texture){var n=e.texture._texture,a=Math.max(1,n.width),i=Math.max(1,n.height);re(a===t&&i===r,"inconsistent width/height for supplied texture"),n.refCount+=1}else{var o=e.renderbuffer._renderbuffer;re(o.width===t&&o.height===r,"inconsistent width/height for renderbuffer"),o.refCount+=1}}function p(t,r){r&&(r.texture?e.framebufferTexture2D(ca,t,r.target,r.texture._texture.texture,0):e.framebufferRenderbuffer(ca,t,la,r.renderbuffer._renderbuffer.renderbuffer))}function h(e){var t=da,r=null,n=null,a=e;"object"==typeof e&&(a=e.data,"target"in e&&(t=0|e.target)),re.type(a,"function","invalid attachment data");var i=a._reglType;return"texture2d"===i?(r=a,re(t===da)):"textureCube"===i?(r=a,re(t>=ma&&t<ma+6,"invalid cube map target")):"renderbuffer"===i?(n=a,t=la):re.raise("invalid regl object for attachment"),new l(t,r,n)}function b(e,t,r,n,o){if(r){var f=a.create2D({width:e,height:t,format:n,type:o});return f._texture.refCount=0,new l(da,f,null)}var u=i.create({width:e,height:t,format:n});return u._renderbuffer.refCount=0,new l(la,null,u)}function v(e){return e&&(e.texture||e.renderbuffer)}function g(e,t,r){e&&(e.texture?e.texture.resize(t,r):e.renderbuffer&&e.renderbuffer.resize(t,r),e.width=t,e.height=r)}r.oes_texture_half_float&&c.push("half float","float16"),r.oes_texture_float&&c.push("float","float32");var y=0,x={};function w(){this.id=y++,x[this.id]=this,this.framebuffer=e.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}
vendor: 5,544 bytes, line 1
1function A(e){e.colorAttachments.forEach(d),d(e.depthAttachment),d(e.stencilAttachment),d(e.depthStencilAttachment)}function _(t){var r=t.framebuffer;re(r,"must not double destroy framebuffer"),e.deleteFramebuffer(r),t.framebuffer=null,o.framebufferCount--,delete x[t.id]}function k(t){var r;e.bindFramebuffer(ca,t.framebuffer);var a=t.colorAttachments;for(r=0;r<a.length;++r)p(pa+r,a[r]);for(r=a.length;r<n.maxColorAttachments;++r)e.framebufferTexture2D(ca,pa+r,da,null,0);e.framebufferTexture2D(ca,va,da,null,0),e.framebufferTexture2D(ca,ha,da,null,0),e.framebufferTexture2D(ca,ba,da,null,0),p(ha,t.depthAttachment),p(ba,t.stencilAttachment),p(va,t.depthStencilAttachment);var i=e.checkFramebufferStatus(ca);e.isContextLost()||i===ga||re.raise("framebuffer configuration not supported, status = "+Ia[i]),e.bindFramebuffer(ca,f.next?f.next.framebuffer:null),f.cur=f.next,e.getError()}function S(e,a){var i=new w;function l(e,t){var a;re(f.next!==i,"can not update framebuffer which is currently in use");var o=0,d=0,p=!0,g=!0,y=null,x=!0,w="rgba",_="uint8",S=1,O=null,E=null,T=null,D=!1;if("number"==typeof e)o=0|e,d=0|t||o;else if(e){re.type(e,"object","invalid arguments for framebuffer");var j=e;if("shape"in j){var C=j.shape;re(Array.isArray(C)&&C.length>=2,"invalid shape for framebuffer"),o=C[0],d=C[1]}else"radius"in j&&(o=d=j.radius),"width"in j&&(o=j.width),"height"in j&&(d=j.height);("color"in j||"colors"in j)&&(y=j.color||j.colors,Array.isArray(y)&&re(1===y.length||r.webgl_draw_buffers,"multiple render targets not supported")),y||("colorCount"in j&&(S=0|j.colorCount,re(S>0,"invalid color buffer count")),"colorTexture"in j&&(x=!!j.colorTexture,w="rgba4"),"colorType"in j&&(_=j.colorType,x?(re(r.oes_texture_float||!("float"===_||"float32"===_),"you must enable OES_texture_float in order to use floating point framebuffer objects"),re(r.oes_texture_half_float||!("half float"===_||"float16"===_),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===_||"float16"===_?(re(r.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),w="rgba16f"):"float"!==_&&"float32"!==_||(re(r.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),w="rgba32f"),re.oneOf(_,c,"invalid color type")),"colorFormat"in j&&(w=j.colorFormat,u.indexOf(w)>=0?x=!0:s.indexOf(w)>=0?x=!1:re.optional((function(){x?re.oneOf(j.colorFormat,u,"invalid color format for texture"):re.oneOf(j.colorFormat,s,"invalid color format for renderbuffer")})))),("depthTexture"in j||"depthStencilTexture"in j)&&(D=!(!j.depthTexture&&!j.depthStencilTexture),re(!D||r.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in j&&("boolean"==typeof j.depth?p=j.depth:(O=j.depth,g=!1)),"stencil"in j&&("boolean"==typeof j.stencil?g=j.stencil:(E=j.stencil,p=!1)),"depthStencil"in j&&("boolean"==typeof j.depthStencil?p=g=j.depthStencil:(T=j.depthStencil,p=!1,g=!1))}else o=d=1;var z=null,F=null,V=null,B=null;if(Array.isArray(y))z=y.map(h);else if(y)z=[h(y)];else for(z=new Array(S),a=0;a<S;++a)z[a]=b(o,d,x,w,_);re(r.webgl_draw_buffers||z.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),re(z.length<=n.maxColorAttachments,"too many color attachments, not supported"),o=o||z[0].width,d=d||z[0].height,O?F=h(O):p&&!g&&(F=b(o,d,D,"depth","uint32")),E?V=h(E):g&&!p&&(V=b(o,d,!1,"stencil","uint8")),T?B=h(T):!O&&!E&&g&&p&&(B=b(o,d,D,"depth stencil","depth stencil")),re(!!O+!!E+!!T<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var I=null;for(a=0;a<z.length;++a)if(m(z[a],o,d),re(!z[a]||z[a].texture&&Da.indexOf(z[a].texture._texture.format)>=0||z[a].renderbuffer&&Ba.indexOf(z[a].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+a+" is invalid"),z[a]&&z[a].texture){var P=ja[z[a].texture._texture.format]*Ca[z[a].texture._texture.type];null===I?I=P:re(I===P,"all color attachments much have the same number of bits per pixel.")}return m(F,o,d),re(!F||F.texture&&F.texture._texture.format===Ta||F.renderbuffer&&F.renderbuffer._renderbuffer.format===za,"invalid depth attachment for framebuffer object"),m(V,o,d),re(!V||V.renderbuffer&&V.renderbuffer._renderbuffer.format===Fa,"invalid stencil attachment for framebuffer object"),m(B,o,d),re(!B||B.texture&&B.texture._texture.format===Va||B.renderbuffer&&B.renderbuffer._renderbuffer.format===Va,"invalid depth-stencil attachment for framebuffer object"),A(i),i.width=o,i.height=d,i.colorAttachments=z,i.depthAttachment=F,i.stencilAttachment=V,i.depthStencilAttachment=B,l.color=z.map(v),l.depth=v(F),l.stencil=v(V),l.depthStencil=v(B),l.width=i.width,l.height=i.height,k(i),l}function d(e,t){re(f.next!==i,"can not resize a framebuffer which is currently in use");var r=Math.max(0|e,1),n=Math.max(0|t||r,1);if(r===i.width&&n===i.height)return l;for(var a=i.colorAttachments,o=0;o<a.length;++o)g(a[o],r,n);return g(i.depthAttachment,r,n),g(i.stencilAttachment,r,n),g(i.depthStencilAttachment,r,n),i.width=l.width=r,i.height=l.height=n,k(i),l}return o.framebufferCount++,l(e,a),t(l,{resize:d,_reglType:"framebuffer",_framebuffer:i,destroy:function(){_(i),A(i)},use:function(e){f.setFBO({framebuffer:l},e)}})}function O(e){var i=Array(6);function o(e){var n;re(i.indexOf(f.next)<0,"can not update framebuffer which is currently in use");var s,l={color:null},d=0,m=null,p="rgba",h="uint8",b=1;if("number"==typeof e)d=0|e;
1else if(e){re.type(e,"object","invalid arguments for framebuffer");var v=e;if("shape"in v){var g=v.shape;re(Array.isArray(g)&&g.length>=2,"invalid shape for framebuffer"),re(g[0]===g[1],"cube framebuffer must be square"),d=g[0]}else"radius"in v&&(d=0|v.radius),"width"in v?(d=0|v.width,"height"in v&&re(v.height===d,"must be square")):"height"in v&&(d=0|v.height);("color"in v||"colors"in v)&&(m=v.color||v.colors,Array.isArray(m)&&re(1===m.length||r.webgl_draw_buffers,"multiple render targets not supported")),m||("colorCount"in v&&(b=0|v.colorCount,re(b>0,"invalid color buffer count")),"colorType"in v&&(re.oneOf(v.colorType,c,"invalid color type"),h=v.colorType),"colorFormat"in v&&(p=v.colorFormat,re.oneOf(v.colorFormat,u,"invalid color format for texture"))),"depth"in v&&(l.depth=v.depth),"stencil"in v&&(l.stencil=v.stencil),"depthStencil"in v&&(l.depthStencil=v.depthStencil)}else d=1;if(m)if(Array.isArray(m))for(s=[],n=0;n<m.length;++n)s[n]=m[n];else s=[m];else{s=Array(b);var y={radius:d,format:p,type:h};for(n=0;n<b;++n)s[n]=a.createCube(y)}for(l.color=Array(s.length),n=0;n<s.length;++n){var x=s[n];re("function"==typeof x&&"textureCube"===x._reglType,"invalid cube map"),d=d||x.width,re(x.width===d&&x.height===d,"invalid cube map shape"),l.color[n]={target:ma,data:s[n]}}for(n=0;n<6;++n){for(var w=0;w<s.length;++w)l.color[w].target=ma+n;n>0&&(l.depth=i[0].depth,l.stencil=i[0].stencil,l.depthStencil=i[0].depthStencil),i[n]?i[n](l):i[n]=S(l)}return t(o,{width:d,height:d,color:s})}function s(e){var t,r=0|e;if(re(r>0&&r<=n.maxCubeMapSize,"invalid radius for cube fbo"),r===o.width)return o;var a=o.color;for(t=0;t<a.length;++t)a[t].resize(r);for(t=0;t<6;++t)i[t].resize(r);return o.width=o.height=r,o}return o(e),t(o,{faces:i,resize:s,_reglType:"framebufferCube",destroy:function(){i.forEach((function(e){e.destroy()}))}})}function E(){f.cur=null,f.next=null,f.dirty=!0,kt(x).forEach((function(t){t.framebuffer=e.createFramebuffer(),k(t)}))}return t(f,{getFramebuffer:function(e){if("function"==typeof e&&"framebuffer"===e._reglType){var t=e._framebuffer;if(t instanceof w)return t}return null},create:S,createCube:O,clear:function(){kt(x).forEach(_)},restore:E})}Ia[ga]="complete",Ia[ya]="incomplete attachment",Ia[wa]="incomplete dimensions",Ia[xa]="incomplete, missing attachment",Ia[Aa]="unsupported";var La=5126,Ra=34962,Ma=34963,Ua=["attributes","elements","offset","count","primitive","instances"];function Wa(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=La,this.offset=0,this.stride=0,this.divisor=0}function Ga(t,r,n,a,i,o,f){for(var u=n.maxAttributes,s=new Array(u),c=0;c<u;++c)s[c]=new Wa;var l=0,d={},m={Record:Wa,scope:{},state:s,currentVAO:null,targetVAO:null,restore:h()?A:function(){},createVAO:_,getVAO:v,destroyBuffer:p,setVAO:h()?g:y,clear:h()?x:function(){}};function p(e){for(var r=0;r<s.length;++r){var n=s[r];n.buffer===e&&(t.disableVertexAttribArray(r),n.buffer=null)}}function h(){return r.oes_vertex_array_object}function b(){return r.angle_instanced_arrays}function v(e){return"function"==typeof e&&e._vao?e._vao:null}function g(e){if(e!==m.currentVAO){var t=h();e?t.bindVertexArrayOES(e.vao):t.bindVertexArrayOES(null),m.currentVAO=e}}function y(e){if(e!==m.currentVAO){if(e)e.bindAttrs();else{for(var r=b(),n=0;n<s.length;++n){var a=s[n];a.buffer?(t.enableVertexAttribArray(n),a.buffer.bind(),t.vertexAttribPointer(n,a.size,a.type,a.normalized,a.stride,a.offfset),r&&a.divisor&&r.vertexAttribDivisorANGLE(n,a.divisor)):(t.disableVertexAttribArray(n),t.vertexAttrib4f(n,a.x,a.y,a.z,a.w))}f.elements?t.bindBuffer(Ma,f.elements.buffer.buffer):t.bindBuffer(Ma,null)}m.currentVAO=e}}function x(){kt(d).forEach((function(e){e.destroy()}))}function w(){this.id=++l,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var e=h();this.vao=e?e.createVertexArrayOES():null,d[this.id]=this,this.buffers=[]}function A(){h()&&kt(d).forEach((function(e){e.refresh()}))}function _(t){var n=new w;function f(t){var a;if(Array.isArray(t))a=t,n.elements&&n.ownsElements&&n.elements.destroy(),n.elements=null,n.ownsElements=!1,n.offset=0,n.count=0,n.instances=-1,n.primitive=4;
vendor: 5,702 bytes, line 1
1else{if(re("object"==typeof t,"invalid arguments for create vao"),re("attributes"in t,"must specify attributes for vao"),t.elements){var s=t.elements;n.ownsElements?"function"==typeof s&&"elements"===s._reglType?(n.elements.destroy(),n.ownsElements=!1):(n.elements(s),n.ownsElements=!1):o.getElements(t.elements)?(n.elements=t.elements,n.ownsElements=!1):(n.elements=o.create(t.elements),n.ownsElements=!0)}else n.elements=null,n.ownsElements=!1;a=t.attributes,n.offset=0,n.count=-1,n.instances=-1,n.primitive=4,n.elements&&(n.count=n.elements._elements.vertCount,n.primitive=n.elements._elements.primType),"offset"in t&&(n.offset=0|t.offset),"count"in t&&(n.count=0|t.count),"instances"in t&&(n.instances=0|t.instances),"primitive"in t&&(re(t.primitive in qt,"bad primitive type: "+t.primitive),n.primitive=qt[t.primitive]),re.optional((()=>{for(var e=Object.keys(t),r=0;r<e.length;++r)re(Ua.indexOf(e[r])>=0,'invalid option for vao: "'+e[r]+'" valid options are '+Ua)})),re(Array.isArray(a),"attributes must be an array")}re(a.length<u,"too many attributes"),re(a.length>0,"must specify at least one attribute");var c={},l=n.attributes;l.length=a.length;for(var d=0;d<a.length;++d){var m,p=a[d],h=l[d]=new Wa,b=p.data||p;Array.isArray(b)||e(b)||_t(b)?(n.buffers[d]&&(m=n.buffers[d],e(b)&&m._buffer.byteLength>=b.byteLength?m.subdata(b):(m.destroy(),n.buffers[d]=null)),n.buffers[d]||(m=n.buffers[d]=i.create(p,Ra,!1,!0)),h.buffer=i.getBuffer(m),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1,c[d]=1):i.getBuffer(p)?(h.buffer=i.getBuffer(p),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1):i.getBuffer(p.buffer)?(h.buffer=i.getBuffer(p.buffer),h.size=0|(+p.size||h.buffer.dimension),h.normalized=!!p.normalized||!1,"type"in p?(re.parameter(p.type,Ft,"invalid buffer type"),h.type=Ft[p.type]):h.type=h.buffer.dtype,h.offset=0|(p.offset||0),h.stride=0|(p.stride||0),h.divisor=0|(p.divisor||0),h.state=1,re(h.size>=1&&h.size<=4,"size must be between 1 and 4"),re(h.offset>=0,"invalid offset"),re(h.stride>=0&&h.stride<=255,"stride must be between 0 and 255"),re(h.divisor>=0,"divisor must be positive"),re(!h.divisor||!!r.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in p?(re(d>0,"first attribute must not be a constant"),h.x=+p.x||0,h.y=+p.y||0,h.z=+p.z||0,h.w=+p.w||0,h.state=2):re(!1,"invalid attribute spec for location "+d)}for(var v=0;v<n.buffers.length;++v)!c[v]&&n.buffers[v]&&(n.buffers[v].destroy(),n.buffers[v]=null);return n.refresh(),f}return a.vaoCount+=1,f.destroy=function(){for(var e=0;e<n.buffers.length;++e)n.buffers[e]&&n.buffers[e].destroy();n.buffers.length=0,n.ownsElements&&(n.elements.destroy(),n.elements=null,n.ownsElements=!1),n.destroy()},f._vao=n,f._reglType="vao",f(t)}return w.prototype.bindAttrs=function(){for(var e=b(),r=this.attributes,n=0;n<r.length;++n){var a=r[n];a.buffer?(t.enableVertexAttribArray(n),t.bindBuffer(Ra,a.buffer.buffer),t.vertexAttribPointer(n,a.size,a.type,a.normalized,a.stride,a.offset),e&&a.divisor&&e.vertexAttribDivisorANGLE(n,a.divisor)):(t.disableVertexAttribArray(n),t.vertexAttrib4f(n,a.x,a.y,a.z,a.w))}for(var i=r.length;i<u;++i)t.disableVertexAttribArray(i);var f=o.getElements(this.elements);f?t.bindBuffer(Ma,f.buffer.buffer):t.bindBuffer(Ma,null)},w.prototype.refresh=function(){var e=h();e&&(e.bindVertexArrayOES(this.vao),this.bindAttrs(),m.currentVAO=null,e.bindVertexArrayOES(null))},w.prototype.destroy=function(){if(this.vao){var e=h();this===m.currentVAO&&(m.currentVAO=null,e.bindVertexArrayOES(null)),e.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),d[this.id]&&(delete d[this.id],a.vaoCount-=1)},m}var Ha=35632,Na=35633,qa=35718,Qa=35721;function Ya(e,r,n,a){var i={},o={};function f(e,t,r,n){this.name=e,this.id=t,this.location=r,this.info=n}function u(e,t){for(var r=0;r<e.length;++r)if(e[r].id===t.id)return void(e[r].location=t.location);e.push(t)}function s(t,n,a){var f=t===Ha?i:o,u=f[n];if(!u){var s=r.str(n);u=e.createShader(t),e.shaderSource(u,s),e.compileShader(u),re.shaderError(e,u,s,t,a),f[n]=u}return u}var c={},l=[],d=0;function m(e,t){this.id=d++,this.fragId=e,this.vertId=t,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,a.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function p(t,n,i){var o,c,l=s(Ha,t.fragId),d=s(Na,t.vertId),m=t.program=e.createProgram();if(e.attachShader(m,l),e.attachShader(m,d),i)for(o=0;o<i.length;++o){var p=i[o];e.bindAttribLocation(m,p[0],p[1])}e.linkProgram(m),re.linkError(e,m,r.str(t.fragId),r.str(t.vertId),n);var h=e.getProgramParameter(m,qa);a.profile&&(t.stats.uniformsCount=h);var b=t.uniforms;for(o=0;o<h;++o)if(c=e.getActiveUniform(m,o))if(c.size>1)for(var v=0;v<c.size;++v){var g=c.name.replace("[0]","["+v+"]");u(b,new f(g,r.id(g),e.getUniformLocation(m,g),c))}else u(b,new f(c.name,r.id(c.name),e.getUniformLocation(m,c.name),c));var y=e.getProgramParameter(m,Qa);a.profile&&(t.stats.attributesCount=y);var x=t.attributes;for(o=0;o<y;++o)(c=e.getActiveAttrib(m,o))&&u(x,new f(c.name,r.id(c.name),e.getAttribLocation(m,c.name),c))}function h(){i={},o={};for(var e=0;e<l.length;++e)p(l[e],null,l[e].attributes.map((function(e){return[e.location,e.name]})))}return a.profile&&(n.getMaxUniformsCount=function(){var e=0;return l.forEach((function(t){t.stats.uniformsCount>e&&(e=t.stats.uniformsCount)})),e},n.getMaxAttributesCount=function(){var e=0;return l.forEach((function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)})),e}),{clear:function(){var t=e.deleteShader.bind(e);
1kt(i).forEach(t),i={},kt(o).forEach(t),o={},l.forEach((function(t){e.deleteProgram(t.program)})),l.length=0,c={},n.shaderCount=0},program:function(r,a,f,u){re.command(r>=0,"missing vertex shader",f),re.command(a>=0,"missing fragment shader",f);var s=c[a];s||(s=c[a]={});var d=s[r];if(d&&(d.refCount++,!u))return d;var h=new m(a,r);return n.shaderCount++,p(h,f,u),d||(s[r]=h),l.push(h),t(h,{destroy:function(){if(h.refCount--,h.refCount<=0){e.deleteProgram(h.program);var t=l.indexOf(h);l.splice(t,1),n.shaderCount--}s[h.vertId].refCount<=0&&(e.deleteShader(o[h.vertId]),delete o[h.vertId],delete c[h.fragId][h.vertId]),Object.keys(c[h.fragId]).length||(e.deleteShader(i[h.fragId]),delete i[h.fragId],delete c[h.fragId])}})},restore:h,shader:s,frag:-1,vert:-1}}var Xa=6408,$a=5121,Ka=3333,Ja=5126;function Za(t,r,n,a,i,o,f){function u(u){var s;null===r.next?(re(i.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),s=$a):(re(null!==r.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),s=r.next.colorAttachments[0].texture._texture.type,re.optional((function(){o.oes_texture_float?(re(s===$a||s===Ja,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),s===Ja&&re(f.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):re(s===$a,"Reading from a framebuffer is only allowed for the type 'uint8'")})));var c=0,l=0,d=a.framebufferWidth,m=a.framebufferHeight,p=null;e(u)?p=u:u&&(re.type(u,"object","invalid arguments to regl.read()"),c=0|u.x,l=0|u.y,re(c>=0&&c<a.framebufferWidth,"invalid x offset for regl.read"),re(l>=0&&l<a.framebufferHeight,"invalid y offset for regl.read"),d=0|(u.width||a.framebufferWidth-c),m=0|(u.height||a.framebufferHeight-l),p=u.data||null),p&&(s===$a?re(p instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):s===Ja&&re(p instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),re(d>0&&d+c<=a.framebufferWidth,"invalid width for read pixels"),re(m>0&&m+l<=a.framebufferHeight,"invalid height for read pixels"),n();var h=d*m*4;return p||(s===$a?p=new Uint8Array(h):s===Ja&&(p=p||new Float32Array(h))),re.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),re(p.byteLength>=h,"data buffer for regl.read() too small"),t.pixelStorei(Ka,4),t.readPixels(c,l,d,m,Xa,s,p),p}function s(e){var t;return r.setFBO({framebuffer:e.framebuffer},(function(){t=u(e)})),t}function c(e){return e&&"framebuffer"in e?s(e):u(e)}return c}function ei(e){return Array.prototype.slice.call(e)}function ti(e){return ei(e).join("")}function ri(){var e=0,r=[],n=[];function a(t){for(var a=0;a<n.length;++a)if(n[a]===t)return r[a];var i="g"+e++;return r.push(i),n.push(t),i}function i(){var r=[];function n(){r.push.apply(r,ei(arguments))}var a=[];function i(){var t="v"+e++;return a.push(t),arguments.length>0&&(r.push(t,"="),r.push.apply(r,ei(arguments)),r.push(";")),t}return t(n,{def:i,toString:function(){return ti([a.length>0?"var "+a.join(",")+";":"",ti(r)])}})}function o(){var e=i(),r=i(),n=e.toString,a=r.toString;function o(t,n){r(t,n,"=",e.def(t,n),";")}return t((function(){e.apply(e,ei(arguments))}),{def:e.def,entry:e,exit:r,save:o,set:function(t,r,n){o(t,r),e(t,r,"=",n,";")},toString:function(){return n()+a()}})}function f(){var e=ti(arguments),r=o(),n=o(),a=r.toString,i=n.toString;return t(r,{then:function(){return r.apply(r,ei(arguments)),this},else:function(){return n.apply(n,ei(arguments)),this},toString:function(){var t=i();return t&&(t="else{"+t+"}"),ti(["if(",e,"){",a(),"}",t])}})}var u=i(),s={};function c(e,r){var n=[];function a(){var e="a"+n.length;return n.push(e),e}r=r||0;for(var i=0;i<r;++i)a();var f=o(),u=f.toString;return s[e]=t(f,{arg:a,toString:function(){return ti(["function(",n.join(),"){",u(),"}"])}})}function l(){var e=['"use strict";',u,"return {"];Object.keys(s).forEach((function(t){e.push('"',t,'":',s[t].toString(),",")})),e.push("}");var t=ti(e).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,r.concat(t)).apply(null,n)}return{global:u,link:a,block:i,proc:c,scope:o,cond:f,compile:l}}var ni="xyzw".split(""),ai=5121,ii=1,oi=2,fi=0,ui=1,si=2,ci=3,li=4,di=5,mi=6,pi="dither",hi="blend.enable",bi="blend.color",vi="blend.equation",gi="blend.func",yi="depth.enable",xi="depth.func",wi="depth.range",Ai="depth.mask",_i="colorMask",ki="cull.enable",Si="cull.face",Oi="frontFace",Ei="lineWidth",Ti="polygonOffset.enable",Di="pol
1ygonOffset.offset",ji="sample.alpha",Ci="sample.enable",zi="sample.coverage",Fi="stencil.enable",Vi="stencil.mask",Bi="stencil.func",Ii="stencil.opFront",Pi="stencil.opBack",Li="scissor.enable",Ri="scissor.box",Mi="viewport",Ui="profile",Wi="framebuffer",Gi="vert",Hi="frag",Ni="elements",qi="primitive",Qi="count",Yi="offset",Xi="instances",$i="vao",Ki="Width",Ji="Height",Zi=Wi+Ki,eo=Wi+Ji,to=Mi+Ki,ro=Mi+Ji,no="drawingBuffer",ao=no+Ki,io=no+Ji,oo=[gi,vi,Bi,Ii,Pi,zi,Mi,Ri,Di],fo=34962,uo=34963,so=3553,co=34067,lo=2884,mo=3042,po=3024,ho=2960,bo=2929,vo=3089,go=32823,yo=32926,xo=32928,wo=5126,Ao=35664,_o=35665,ko=35666,So=5124,Oo=35667,Eo=35668,To=35669,Do=35670,jo=35671,Co=35672,zo=35673,Fo=35674,Vo=35675,Bo=35676,Io=35678,Po=35680,Lo=4,Ro=1028,Mo=1029,Uo=2304,Wo=2305,Go=32775,Ho=32776,No=519,qo=7680,Qo=0,Yo=1,Xo=32774,$o=513,Ko=36160,Jo=36064,Zo={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},ef=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],tf={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},rf={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},nf={frag:35632,vert:35633},af={cw:Uo,ccw:Wo};function of(t){return Array.isArray(t)||e(t)||_t(t)}function ff(e){return e.sort((function(e,t){return e===Mi?-1:t===Mi?1:e<t?-1:1}))}function uf(e,t,r,n){this.thisDep=e,this.contextDep=t,this.propDep=r,this.append=n}function sf(e){return e&&!(e.thisDep||e.contextDep||e.propDep)}function cf(e){return new uf(!1,!1,!1,e)}function lf(e,t){var r=e.type;if(r===fi){var n=e.data.length;return new uf(!0,n>=1,n>=2,t)}if(r===li){var a=e.data;return new uf(a.thisDep,a.contextDep,a.propDep,t)}if(r===di)return new uf(!1,!1,!1,t);if(r===mi){for(var i=!1,o=!1,f=!1,u=0;u<e.data.length;++u){var s=e.data[u];if(s.type===ui)f=!0;else if(s.type===si)o=!0;else if(s.type===ci)i=!0;else if(s.type===fi){i=!0;var c=s.data;c>=1&&(o=!0),c>=2&&(f=!0)}else s.type===li&&(i=i||s.data.thisDep,o=o||s.data.contextDep,f=f||s.data.propDep)}return new uf(i,o,f,t)}return new uf(r===ci,r===si,r===ui,t)}var df=new uf(!1,!1,!1,(function(){}));function mf(e,r,n,a,i,o,f,u,s,c,l,d,m,p,h){var b=c.Record,v={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(v.min=Go,v.max=Ho);var g=n.angle_instanced_arrays,y=n.webgl_draw_buffers,x=n.oes_vertex_array_object,w={dirty:!0,profile:h.profile},A={},_=[],k={},S={};function O(e){return e.replace(".","_")}function E(e,t,r){var n=O(e);_.push(e),A[n]=w[n]=!!r,k[n]=t}function T(e,t,r){var n=O(e);_.push(e),Array.isArray(r)?(w[n]=r.slice(),A[n]=r.slice()):w[n]=A[n]=r,S[n]=t}E(pi,po),E(hi,mo),T(bi,"blendColor",[0,0,0,0]),T(vi,"blendEquationSeparate",[Xo,Xo]),T(gi,"blendFuncSeparate",[Yo,Qo,Yo,Qo]),E(yi,bo,!0),T(xi,"depthFunc",$o),T(wi,"depthRange",[0,1]),T(Ai,"depthMask",!0),T(_i,_i,[!0,!0,!0,!0]),E(ki,lo),T(Si,"cullFace",Mo),T(Oi,Oi,Wo),T(Ei,Ei,1),E(Ti,go),T(Di,"polygonOffset",[0,0]),E(ji,yo),E(Ci,xo),T(zi,"sampleCoverage",[1,!1]),E(Fi,ho),T(Vi,"stencilMask",-1),T(Bi,"stencilFunc",[No,0,-1]),T(Ii,"stencilOpSeparate",[Ro,qo,qo,qo]),T(Pi,"stencilOpSeparate",[Mo,qo,qo,qo]),E(Li,vo),T(Ri,"scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),T(Mi,Mi,[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var D={gl:e,context:m,strings:r,next:A,current:w,draw:d,elements:o,buffer:i,shader:l,attributes:c.state,vao:c,uniforms:s,framebuffer:u,extensions:n,timer:p,isBufferArgs:of},j={primTypes:qt,compareFuncs:tf,blendFuncs:Zo,blendEquations:v,stencilOps:rf,glTypes:Ft,orientationType:af};re.optional((function(){D.isArrayLike=cr})),y&&(j.backBuffer=[Mo],j.drawBuffer=Oe(a.maxDrawbuffers,(function(e){return 0===e?[0]:Oe(e,(function(e){return Jo+e}))})));var C=0;function z(){var e=ri(),t=e.link,n=e.global;e.id=C++,e.batchId="0";var a=t(D),i=e.shared={props:"a0"};
vendor: 9,332 bytes, line 1
1Object.keys(D).forEach((function(e){i[e]=n.def(a,".",e)})),re.optional((function(){e.CHECK=t(re),e.commandStr=re.guessCommand(),e.command=t(e.commandStr),e.assert=function(e,r,n){e("if(!(",r,"))",this.CHECK,".commandRaise(",t(n),",",this.command,");")},j.invalidBlendCombinations=ef}));var o=e.next={},f=e.current={};Object.keys(S).forEach((function(e){Array.isArray(w[e])&&(o[e]=n.def(i.next,".",e),f[e]=n.def(i.current,".",e))}));var u=e.constants={};Object.keys(j).forEach((function(e){u[e]=n.def(JSON.stringify(j[e]))})),e.invoke=function(r,n){switch(n.type){case fi:var a=["this",i.context,i.props,e.batchId];return r.def(t(n.data),".call(",a.slice(0,Math.max(n.data.length+1,4)),")");case ui:return r.def(i.props,n.data);case si:return r.def(i.context,n.data);case ci:return r.def("this",n.data);case li:return n.data.append(e,r),n.data.ref;case di:return n.data.toString();case mi:return n.data.map((function(t){return e.invoke(r,t)}))}},e.attribCache={};var s={};return e.scopeAttrib=function(e){var n=r.id(e);if(n in s)return s[n];var a=c.scope[n];return a||(a=c.scope[n]=new b),s[n]=t(a)},e}function F(e){var t,r=e.static,n=e.dynamic;if(Ui in r){var a=!!r[Ui];(t=cf((function(e,t){return a}))).enable=a}else if(Ui in n){var i=n[Ui];t=lf(i,(function(e,t){return e.invoke(t,i)}))}return t}function V(e,t){var r=e.static,n=e.dynamic;if(Wi in r){var a=r[Wi];return a?(a=u.getFramebuffer(a),re.command(a,"invalid framebuffer object"),cf((function(e,t){var r=e.link(a),n=e.shared;t.set(n.framebuffer,".next",r);var i=n.context;return t.set(i,"."+Zi,r+".width"),t.set(i,"."+eo,r+".height"),r}))):cf((function(e,t){var r=e.shared;t.set(r.framebuffer,".next","null");var n=r.context;return t.set(n,"."+Zi,n+"."+ao),t.set(n,"."+eo,n+"."+io),"null"}))}if(Wi in n){var i=n[Wi];return lf(i,(function(e,t){var r=e.invoke(t,i),n=e.shared,a=n.framebuffer,o=t.def(a,".getFramebuffer(",r,")");re.optional((function(){e.assert(t,"!"+r+"||"+o,"invalid framebuffer object")})),t.set(a,".next",o);var f=n.context;return t.set(f,"."+Zi,o+"?"+o+".width:"+f+"."+ao),t.set(f,"."+eo,o+"?"+o+".height:"+f+"."+io),o}))}return null}function B(e,t,r){var n=e.static,a=e.dynamic;function i(e){if(e in n){var i=n[e];re.commandType(i,"object","invalid "+e,r.commandStr);var o,f,u=!0,s=0|i.x,c=0|i.y;return"width"in i?(o=0|i.width,re.command(o>=0,"invalid "+e,r.commandStr)):u=!1,"height"in i?(f=0|i.height,re.command(f>=0,"invalid "+e,r.commandStr)):u=!1,new uf(!u&&t&&t.thisDep,!u&&t&&t.contextDep,!u&&t&&t.propDep,(function(e,t){var r=e.shared.context,n=o;"width"in i||(n=t.def(r,".",Zi,"-",s));var a=f;return"height"in i||(a=t.def(r,".",eo,"-",c)),[s,c,n,a]}))}if(e in a){var l=a[e],d=lf(l,(function(t,r){var n=t.invoke(r,l);re.optional((function(){t.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+e)}));var a=t.shared.context,i=r.def(n,".x|0"),o=r.def(n,".y|0"),f=r.def('"width" in ',n,"?",n,".width|0:","(",a,".",Zi,"-",i,")"),u=r.def('"height" in ',n,"?",n,".height|0:","(",a,".",eo,"-",o,")");return re.optional((function(){t.assert(r,f+">=0&&"+u+">=0","invalid "+e)})),[i,o,f,u]}));return t&&(d.thisDep=d.thisDep||t.thisDep,d.contextDep=d.contextDep||t.contextDep,d.propDep=d.propDep||t.propDep),d}return t?new uf(t.thisDep,t.contextDep,t.propDep,(function(e,t){var r=e.shared.context;return[0,0,t.def(r,".",Zi),t.def(r,".",eo)]})):null}var o=i(Mi);if(o){var f=o;o=new uf(o.thisDep,o.contextDep,o.propDep,(function(e,t){var r=f.append(e,t),n=e.shared.context;return t.set(n,"."+to,r[2]),t.set(n,"."+ro,r[3]),r}))}return{viewport:o,scissor_box:i(Ri)}}function I(e,t){var r=e.static;if("string"==typeof r[Hi]&&"string"==typeof r[Gi]){if(Object.keys(t.dynamic).length>0)return null;var n=t.static,a=Object.keys(n);if(a.length>0&&"number"==typeof n[a[0]]){for(var i=[],o=0;o<a.length;++o)re("number"==typeof n[a[o]],"must specify all vertex attribute locations when using vaos"),i.push([0|n[a[o]],a[o]]);return i}}return null}function P(e,t,n){var a=e.static,i=e.dynamic;function o(e){if(e in a){var t=r.id(a[e]);re.optional((function(){l.shader(nf[e],t,re.guessCommand())}));var n=cf((function(){return t}));return n.id=t,n}if(e in i){var o=i[e];return lf(o,(function(t,r){var n=t.invoke(r,o),a=r.def(t.shared.strings,".id(",n,")");return re.optional((function(){r(t.shared.shader,".shader(",nf[e],",",a,",",t.command,");")})),a}))}return null}var f,u=o(Hi),s=o(Gi),c=null;return sf(u)&&sf(s)?(c=l.program(s.id,u.id,null,n),f=cf((function(e,t){return e.link(c)}))):f=new uf(u&&u.thisDep||s&&s.thisDep,u&&u.contextDep||s&&s.contextDep,u&&u.propDep||s&&s.propDep,(function(e,t){var r,n=e.shared.shader;r=u?u.append(e,t):t.def(n,".",Hi);var a=n+".program("+(s?s.append(e,t):t.def(n,".",Gi))+","+r;return re.optional((function(){a+=","+e.command})),t.def(a+")")})),{frag:u,vert:s,progVar:f,program:c}}function L(e,t){var r=e.static,n=e.dynamic,a={},i=!1;function f(){if($i in r){var e=r[$i];return null!==e&&null===c.getVAO(e)&&(e=c.createVAO(e)),i=!0,a.vao=e,cf((function(t){var r=c.getVAO(e);return r?t.link(r):"null"}))}if($i in n){i=!0;var t=n[$i];return lf(t,(function(e,r){var n=e.invoke(r,t);return r.def(e.shared.vao+".getVAO("+n+")")}))}return null}var u=f(),s=!1;function l(){if(Ni in r){var e=r[Ni];if(a.elements=e,of(e)){var f=a.elements=o.create(e,!0);e=o.getElements(f),s=!0}else e&&(e=o.getElements(e),s=!0,re.command(e,"invalid elements",t.commandStr));var c=cf((function(t,r){if(e){var n=t.link(e);return t.ELEMENTS=n,n}return t.ELEMENTS=null,null}));return c.value=e,c}if(Ni in n){s=!0;var l=n[Ni];return lf(l,(function(e,t){var r=e.shared,n=r.isBufferArgs,a=r.elements,i=e.invoke(t,l),o=t.def("null"),f=t.def(n,"(",i,")"),u=e.cond(f).then(o,"=",a,".createStream(",i,");").else(o,"=",a,".getElements(",i,");");return re.optional((function(){e.assert(u.else,"!"+i+"||"+o,"invalid elements")})),t.entry(u),t.exit(e.cond(f).then(a,".destroyStream(",o,");")),e.ELEMENTS=o,o}))}return i?new uf(u.thisDep,u.contextDep,u.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.elements+".getElements("+e.shared.vao+".currentVAO.elements):null")})):null}var d=l();function m(){if(qi in r){var e=r[qi];return a.primitive=e,re.commandParameter(e,qt,"invalid primitve",t.commandStr),cf((function(t,r){return qt[e]}))}if(qi in n){var o=n[qi];return lf(o,(function(e,t){var r=e.constants.primTypes,n=e.invoke(t,o);return re.optional((function(){e.assert(t,n+" in "+r,"invalid primitive, must be one of "+Object.keys(qt))})),t.def(r,"[",n,"]")}))}return s?sf(d)?d.value?cf((function(e,t){return t.def(e.ELEMENTS,".primType")})):cf((function(){return Lo})):new uf(d.thisDep,d.contextDep,d.propDep,(function(e,t){var r=e.ELEMENTS;return t.def(r,"?",r,".primType:",Lo)})):i?new uf(u.thisDep,u.contextDep,u.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.vao+".currentVAO.primitive:"+Lo)})):null}function p(e,o){if(e in r){var f=0|r[e];return o?a.offset=f:a.instances=f,re.command(!o||f>=0,"invalid "+e,t.commandStr),cf((function(e,t){return o&&(e.OFFSET=f),f}))}if(e in n){var c=n[e];return lf(c,(function(t,r){var n=t.invoke(r,c);return o&&(t.OFFSET=n,re.optional((function(){t.assert(r,n+">=0","invalid "+e)}))),n}))}if(o){if(s)return cf((function(e,t){return e.OFFSET=0,0}));if(i)return new uf(u.thisDep,u.contextDep,u.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.vao+".currentVAO.offset:0")}))}else if(i)return new uf(u.thisDep,u.contextDep,u.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.vao+".currentVAO.instances:-1")}));return null}var h=p(Yi,!0);function b(){if(Qi in r){var e=0|r[Qi];return a.count=e,re.command("number"==typeof e&&e>=0,"invalid vertex count",t.commandStr),cf((function(){return e}))}if(Qi in n){var o=n[Qi];return lf(o,(function(e,t){var r=e.invoke(t,o);return re.optional((function(){e.assert(t,"typeof "+r+'==="number"&&'+r+">=0&&"+r+"===("+r+"|0)","invalid vertex count")})),r}))}if(s){if(sf(d)){if(d)return h?new uf(h.thisDep,h.contextDep,h.propDep,(function(e,t){var r=t.def(e.ELEMENTS,".vertCount-",e.OFFSET);return re.optional((function(){e.assert(t,r+">=0","invalid vertex offset/element buffer too small")})),r})):cf((function(e,t){return t.def(e.ELEMENTS,".vertCount")}));var f=cf((function(){return-1}));return re.optional((function(){f.MISSING=!0})),f}var c=new uf(d.thisDep||h.thisDep,d.contextDep||h.contextDep,d.propDep||h.propDep,(function(e,t){var r=e.ELEMENTS;return e.OFFSET?t.def(r,"?",r,".vertCount-",e.OFFSET,":-1"):t.def(r,"?",r,".vertCount:-1")}));return re.optional((function(){c.DYNAMIC=!0})),c}if(i){var l=new uf(u.thisDep,u.contextDep,u.propDep,(function(e,t){return t.def(e.shared.vao,".currentVAO?",e.shared.vao,".currentVAO.count:-1")}));return l}return null}var v=m(),g=b(),y=p(Xi,!1);return{elements:d,primitive:v,count:g,instances:y,offset:h,vao:u,vaoActive:i,elementsActive:s,static:a}}function R(e,t){var r=e.static,n=e.dynamic,i={};return _.forEach((function(e){var o=O(e);function f(t,a){if(e in r){var f=t(r[e]);i[o]=cf((function(){return f}))}else if(e in n){var u=n[e];i[o]=lf(u,(function(e,t){return a(e,t,e.invoke(t,u))}))}}switch(e){case ki:case hi:case pi:case Fi:case yi:case Li:case Ti:case ji:case Ci:case Ai:return f((function(r){return re.commandType(r,"boolean",e,t.commandStr),r}),(function(t,r,n){return re.optional((function(){t.assert(r,"typeof "+n+'==="boolean"',"invali
1d flag "+e,t.commandStr)})),n}));case xi:return f((function(r){return re.commandParameter(r,tf,"invalid "+e,t.commandStr),tf[r]}),(function(t,r,n){var a=t.constants.compareFuncs;return re.optional((function(){t.assert(r,n+" in "+a,"invalid "+e+", must be one of "+Object.keys(tf))})),r.def(a,"[",n,"]")}));case wi:return f((function(e){return re.command(cr(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]&&e[0]<=e[1],"depth range is 2d array",t.commandStr),e}),(function(e,t,r){return re.optional((function(){e.assert(t,e.shared.isArrayLike+"("+r+")&&"+r+".length===2&&typeof "+r+'[0]==="number"&&typeof '+r+'[1]==="number"&&'+r+"[0]<="+r+"[1]","depth range must be a 2d array")})),[t.def("+",r,"[0]"),t.def("+",r,"[1]")]}));case gi:return f((function(e){re.commandType(e,"object","blend.func",t.commandStr);var r="srcRGB"in e?e.srcRGB:e.src,n="srcAlpha"in e?e.srcAlpha:e.src,a="dstRGB"in e?e.dstRGB:e.dst,i="dstAlpha"in e?e.dstAlpha:e.dst;return re.commandParameter(r,Zo,o+".srcRGB",t.commandStr),re.commandParameter(n,Zo,o+".srcAlpha",t.commandStr),re.commandParameter(a,Zo,o+".dstRGB",t.commandStr),re.commandParameter(i,Zo,o+".dstAlpha",t.commandStr),re.command(-1===ef.indexOf(r+", "+a),"unallowed blending combination (srcRGB, dstRGB) = ("+r+", "+a+")",t.commandStr),[Zo[r],Zo[a],Zo[n],Zo[i]]}),(function(t,r,n){var a=t.constants.blendFuncs;function i(i,o){var f=r.def('"',i,o,'" in ',n,"?",n,".",i,o,":",n,".",i);return re.optional((function(){t.assert(r,f+" in "+a,"invalid "+e+"."+i+o+", must be one of "+Object.keys(Zo))})),f}re.optional((function(){t.assert(r,n+"&&typeof "+n+'==="object"',"invalid blend func, must be an object")}));var o=i("src","RGB"),f=i("dst","RGB");re.optional((function(){var e=t.constants.invalidBlendCombinations;t.assert(r,e+".indexOf("+o+'+", "+'+f+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var u=r.def(a,"[",o,"]"),s=r.def(a,"[",i("src","Alpha"),"]");return[u,r.def(a,"[",f,"]"),s,r.def(a,"[",i("dst","Alpha"),"]")]}));case vi:return f((function(r){return"string"==typeof r?(re.commandParameter(r,v,"invalid "+e,t.commandStr),[v[r],v[r]]):"object"==typeof r?(re.commandParameter(r.rgb,v,e+".rgb",t.commandStr),re.commandParameter(r.alpha,v,e+".alpha",t.commandStr),[v[r.rgb],v[r.alpha]]):void re.commandRaise("invalid blend.equation",t.commandStr)}),(function(t,r,n){var a=t.constants.blendEquations,i=r.def(),o=r.def(),f=t.cond("typeof ",n,'==="string"');return re.optional((function(){function r(e,r,n){t.assert(e,n+" in "+a,"invalid "+r+", must be one of "+Object.keys(v))}r(f.then,e,n),t.assert(f.else,n+"&&typeof "+n+'==="object"',"invalid "+e),r(f.else,e+".rgb",n+".rgb"),r(f.else,e+".alpha",n+".alpha")})),f.then(i,"=",o,"=",a,"[",n,"];"),f.else(i,"=",a,"[",n,".rgb];",o,"=",a,"[",n,".alpha];"),r(f),[i,o]}));case bi:return f((function(e){return re.command(cr(e)&&4===e.length,"blend.color must be a 4d array",t.commandStr),Oe(4,(function(t){return+e[t]}))}),(function(e,t,r){return re.optional((function(){e.assert(t,e.shared.isArrayLike+"("+r+")&&"+r+".length===4","blend.color must be a 4d array")})),Oe(4,(function(e){return t.def("+",r,"[",e,"]")}))}));case Vi:return f((function(e){return re.commandType(e,"number",o,t.commandStr),0|e}),(function(e,t,r){return re.optional((function(){e.assert(t,"typeof "+r+'==="number"',"invali
1d stencil.mask")})),t.def(r,"|0")}));case Bi:return f((function(r){re.commandType(r,"object",o,t.commandStr);var n=r.cmp||"keep",a=r.ref||0,i="mask"in r?r.mask:-1;return re.commandParameter(n,tf,e+".cmp",t.commandStr),re.commandType(a,"number",e+".ref",t.commandStr),re.commandType(i,"number",e+".mask",t.commandStr),[tf[n],a,i]}),(function(e,t,r){var n=e.constants.compareFuncs;return re.optional((function(){function a(){e.assert(t,Array.prototype.join.call(arguments,""),"invalid stencil.func")}a(r+"&&typeof ",r,'==="object"'),a('!("cmp" in ',r,")||(",r,".cmp in ",n,")")})),[t.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",qo),t.def(r,".ref|0"),t.def('"mask" in ',r,"?",r,".mask|0:-1")]}));case Ii:case Pi:return f((function(r){re.commandType(r,"object",o,t.commandStr);var n=r.fail||"keep",a=r.zfail||"keep",i=r.zpass||"keep";return re.commandParameter(n,rf,e+".fail",t.commandStr),re.commandParameter(a,rf,e+".zfail",t.commandStr),re.commandParameter(i,rf,e+".zpass",t.commandStr),[e===Pi?Mo:Ro,rf[n],rf[a],rf[i]]}),(function(t,r,n){var a=t.constants.stencilOps;function i(i){return re.optional((function(){t.assert(r,'!("'+i+'" in '+n+")||("+n+"."+i+" in "+a+")","invalid "+e+"."+i+", must be one of "+Object.keys(rf))})),r.def('"',i,'" in ',n,"?",a,"[",n,".",i,"]:",qo)}return re.optional((function(){t.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+e)})),[e===Pi?Mo:Ro,i("fail"),i("zfail"),i("zpass")]}));case Di:return f((function(e){re.commandType(e,"object",o,t.commandStr);var r=0|e.factor,n=0|e.units;return re.commandType(r,"number",o+".factor",t.commandStr),re.commandType(n,"number",o+".units",t.commandStr),[r,n]}),(function(t,r,n){return re.optional((function(){t.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+e)})),[r.def(n,".factor|0"),r.def(n,".units|0")]}));case Si:return f((function(e){var r=0;return"front"===e?r=Ro:"back"===e&&(r=Mo),re.command(!!r,o,t.commandStr),r}),(function(e,t,r){return re.optional((function(){e.assert(t,r+'==="front"||'+r+'==="back"',"invalid cull.face")})),t.def(r,'==="front"?',Ro,":",Mo)}));case Ei:return f((function(e){return re.command("number"==typeof e&&e>=a.lineWidthDims[0]&&e<=a.lineWidthDims[1],"invalid line width, must be a positive number between "+a.lineWidthDims[0]+" and "+a.lineWidthDims[1],t.commandStr),e}),(function(e,t,r){return re.optional((function(){e.assert(t,"typeof "+r+'==="number"&&'+r+">="+a.lineWidthDims[0]+"&&"+r+"<="+a.lineWidthDims[1],"invalid line width")})),r}));case Oi:return f((function(e){return re.commandParameter(e,af,o,t.commandStr),af[e]}),(function(e,t,r){return re.optional((function(){e.assert(t,r+'==="cw"||'+r+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),t.def(r+'==="cw"?'+Uo+":"+Wo)}));case _i:return f((function(e){return re.command(cr(e)&&4===e.length,"color.mask must be length 4 array",t.commandStr),e.map((function(e){return!!e}))}),(function(e,t,r){return re.optional((function(){e.assert(t,e.shared.isArrayLike+"("+r+")&&"+r+".length===4","invalid color.mask")})),Oe(4,(function(e){return"!!"+r+"["+e+"]"}))}));case zi:return f((function(e){re.command("object"==typeof e&&e,o,t.commandStr);var r="value"in e?e.value:1,n=!!e.invert;return re.command("number"==typeof r&&r>=0&&r<=1,"sample.coverage.value must be a number between 0 and 1",t.commandStr),[r,n]}),(function(e,t,r){return re.optional((function(){e.assert(t,r+"&&typeof "+r+'==="object"',"invalid sample.coverage")})),[t.def('"value" in ',r,"?+",r,".value:1"),t.def("!!",r,".invert")]}))}})),i}function M(e,t){var r=e.static,n=e.dynamic,a={};return Object.keys(r).forEach((function(e){var n,i=r[e];if("number"==typeof i||"boolean"==typeof i)n=cf((function(){return i}));else if("function"==typeof i){var o=i._reglType;"texture2d"===o||"textureCube"===o?n=cf((function(e){return e.link(i)})):"framebuffer"===o||"framebufferCube"===o?(re.command(i.color.length>0,'missing color attachment for framebuffer sent to uniform "'+e+'"',t.commandStr),n=cf((function(e){return e.link(i.color[0])}))):re.commandRaise('invalid data for uniform "'+e+'"',t.commandStr)}else cr(i)?n=cf((function(t){return t.global.def("[",Oe(i.length,(function(r){return re.command("number"==typeof i[r]||"boolean"==typeof i[r],"invalid uniform "+e,t.commandStr),i[r]})),"]")})):re.commandRaise('invalid or missing data for uniform "'+e+'"',t.commandStr);n.value=i,a[e]=n}
vendor: 2,520 bytes, line 1
1)),Object.keys(n).forEach((function(e){var t=n[e];a[e]=lf(t,(function(e,r){return e.invoke(r,t)}))})),a}function U(e,t){var n=e.static,a=e.dynamic,o={};return Object.keys(n).forEach((function(e){var a=n[e],f=r.id(e),u=new b;if(of(a))u.state=ii,u.buffer=i.getBuffer(i.create(a,fo,!1,!0)),u.type=0;else{var s=i.getBuffer(a);if(s)u.state=ii,u.buffer=s,u.type=0;else if(re.command("object"==typeof a&&a,"invalid data for attribute "+e,t.commandStr),"constant"in a){var c=a.constant;u.buffer="null",u.state=oi,"number"==typeof c?u.x=c:(re.command(cr(c)&&c.length>0&&c.length<=4,"invalid constant for attribute "+e,t.commandStr),ni.forEach((function(e,t){t<c.length&&(u[e]=c[t])})))}else{s=of(a.buffer)?i.getBuffer(i.create(a.buffer,fo,!1,!0)):i.getBuffer(a.buffer),re.command(!!s,'missing buffer for attribute "'+e+'"',t.commandStr);var l=0|a.offset;re.command(l>=0,'invalid offset for attribute "'+e+'"',t.commandStr);var d=0|a.stride;re.command(d>=0&&d<256,'invalid stride for attribute "'+e+'", must be integer betweeen [0, 255]',t.commandStr);var m=0|a.size;re.command(!("size"in a)||m>0&&m<=4,'invalid size for attribute "'+e+'", must be 1,2,3,4',t.commandStr);var p=!!a.normalized,h=0;"type"in a&&(re.commandParameter(a.type,Ft,"invalid type for attribute "+e,t.commandStr),h=Ft[a.type]);var v=0|a.divisor;re.optional((function(){"divisor"in a&&(re.command(0===v||g,'cannot specify divisor for attribute "'+e+'", instancing not supported',t.commandStr),re.command(v>=0,'invalid divisor for attribute "'+e+'"',t.commandStr));var r=t.commandStr,n=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(a).forEach((function(t){re.command(n.indexOf(t)>=0,'unknown parameter "'+t+'" for attribute pointer "'+e+'" (valid parameters are '+n+")",r)}))})),u.buffer=s,u.state=ii,u.size=m,u.normalized=p,u.type=h||s.dtype,u.offset=l,u.stride=d,u.divisor=v}}o[e]=cf((function(e,t){var r=e.attribCache;if(f in r)return r[f];var n={isStream:!1};return Object.keys(u).forEach((function(e){n[e]=u[e]})),u.buffer&&(n.buffer=e.link(u.buffer),n.type=n.type||n.buffer+".dtype"),r[f]=n,n}))})),Object.keys(a).forEach((function(e){var t=a[e];function r(r,n){var a=r.invoke(n,t),i=r.shared,o=r.constants,f=i.isBufferArgs,u=i.buffer;re.optional((function(){r.assert(n,a+"&&(typeof "+a+'==="object"||typeof '+a+'==="function")&&('+f+"("+a+")||"+u+".getBuffer("+a+")||"+u+".getBuffer("+a+".buffer)||"+f+"("+a+'.buffer)||("constant" in '+a+"&&(typeof "+a+'.constant==="number"||'+i.isArrayLike+"("+a+".constant))))",'invali
1d dynamic attribute "'+e+'"')}));var s={isStream:n.def(!1)},c=new b;c.state=ii,Object.keys(c).forEach((function(e){s[e]=n.def(""+c[e])}));var l=s.buffer,d=s.type;function m(e){n(s[e],"=",a,".",e,"|0;")}return n("if(",f,"(",a,")){",s.isStream,"=true;",l,"=",u,".createStream(",fo,",",a,");",d,"=",l,".dtype;","}else{",l,"=",u,".getBuffer(",a,");","if(",l,"){",d,"=",l,".dtype;",'}else if("constant" in ',a,"){",s.state,"=",oi,";","if(typeof "+a+'.constant === "number"){',s[ni[0]],"=",a,".constant;",ni.slice(1).map((function(e){return s[e]})).join("="),"=0;","}else{",ni.map((function(e,t){return s[e]+"="+a+".constant.length>"+t+"?"+a+".constant["+t+"]:0;"})).join(""),"}}else{","if(",f,"(",a,".buffer)){",l,"=",u,".createStream(",fo,",",a,".buffer);","}else{",l,"=",u,".getBuffer(",a,".buffer);","}",d,'="type" in ',a,"?",o.glTypes,"[",a,".type]:",l,".dtype;",s.normalized,"=!!",a,".normalized;"),m("size"),m("offset"),m("stride"),m("divisor"),n("}}"),n.exit("if(",s.isStream,"){",u,".destroyStream(",l,");","}"),s}o[e]=lf(t,r)})),o}function W(e){var t=e.static,r=e.dynamic,n={};return Object.keys(t).forEach((function(e){var r=t[e];n[e]=cf((function(e,t){return"number"==typeof r||"boolean"==typeof r?""+r:e.link(r)}))})),Object.keys(r).forEach((function(e){var t=r[e];n[e]=lf(t,(function(e,r){return e.invoke(r,t)}))})),n}function G(e,t,r,a,i){var o=e.static,f=e.dynamic;re.optional((function(){var e=[Wi,Gi,Hi,Ni,qi,Yi,Qi,Xi,Ui,$i].concat(_);function t(t){Object.keys(t).forEach((function(t){re.command(e.indexOf(t)>=0,'unknown parameter "'+t+'"',i.commandStr)}))}
vendor: 4,459 bytes, line 1
1t(o),t(f)}));var u=I(e,t),s=V(e,i),l=B(e,s,i),d=L(e,i),m=R(e,i),p=P(e,i,u);function h(e){var t=l[e];t&&(m[e]=t)}h(Mi),h(O(Ri));var b=Object.keys(m).length>0,v={framebuffer:s,draw:d,shader:p,state:m,dirty:b,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(v.profile=F(e,i),v.uniforms=M(r,i),v.drawVAO=v.scopeVAO=d.vao,!v.drawVAO&&p.program&&!u&&n.angle_instanced_arrays&&d.static.elements){var g=!0,y=p.program.attributes.map((function(e){var r=t.static[e];return g=g&&!!r,r}));if(g&&y.length>0){var x=c.getVAO(c.createVAO({attributes:y,elements:d.static.elements}));v.drawVAO=new uf(null,null,null,(function(e,t){return e.link(x)})),v.useVAO=!0}}return u?v.useVAO=!0:v.attributes=U(t,i),v.context=W(a,i),v}function H(e,t,r){var n=e.shared.context,a=e.scope();Object.keys(r).forEach((function(i){t.save(n,"."+i);var o=r[i].append(e,t);Array.isArray(o)?a(n,".",i,"=[",o.join(),"];"):a(n,".",i,"=",o,";")})),t(a)}function N(e,t,r,n){var a,i=e.shared,o=i.gl,f=i.framebuffer;y&&(a=t.def(i.extensions,".webgl_draw_buffers"));var u,s=e.constants,c=s.drawBuffer,l=s.backBuffer;u=r?r.append(e,t):t.def(f,".next"),n||t("if(",u,"!==",f,".cur){"),t("if(",u,"){",o,".bindFramebuffer(",Ko,",",u,".framebuffer);"),y&&t(a,".drawBuffersWEBGL(",c,"[",u,".colorAttachments.length]);"),t("}else{",o,".bindFramebuffer(",Ko,",null);"),y&&t(a,".drawBuffersWEBGL(",l,");"),t("}",f,".cur=",u,";"),n||t("}")}function q(e,t,r){var n=e.shared,a=n.gl,i=e.current,o=e.next,f=n.current,u=n.next,s=e.cond(f,".dirty");_.forEach((function(t){var n,c,l=O(t);if(!(l in r.state))if(l in o){n=o[l],c=i[l];var d=Oe(w[l].length,(function(e){return s.def(n,"[",e,"]")}));s(e.cond(d.map((function(e,t){return e+"!=="+c+"["+t+"]"})).join("||")).then(a,".",S[l],"(",d,");",d.map((function(e,t){return c+"["+t+"]="+e})).join(";"),";"))}else{n=s.def(u,".",l);var m=e.cond(n,"!==",f,".",l);s(m),l in k?m(e.cond(n).then(a,".enable(",k[l],");").else(a,".disable(",k[l],");"),f,".",l,"=",n,";"):m(a,".",S[l],"(",n,");",f,".",l,"=",n,";")}})),0===Object.keys(r.state).length&&s(f,".dirty=false;"),t(s)}function Q(e,t,r,n){var a=e.shared,i=e.current,o=a.current,f=a.gl;ff(Object.keys(r)).forEach((function(a){var u=r[a];if(!n||n(u)){var s=u.append(e,t);if(k[a]){var c=k[a];sf(u)?t(f,s?".enable(":".disable(",c,");"):t(e.cond(s).then(f,".enable(",c,");").else(f,".disable(",c,");")),t(o,".",a,"=",s,";")}else if(cr(s)){var l=i[a];t(f,".",S[a],"(",s,");",s.map((function(e,t){return l+"["+t+"]="+e})).join(";"),";")}else t(f,".",S[a],"(",s,");",o,".",a,"=",s,";")}}))}function Y(e,t){g&&(e.instancing=t.def(e.shared.extensions,".angle_instanced_arrays"))}function X(e,t,r,n,a){var i,o,f,u=e.shared,s=e.stats,c=u.current,l=u.timer,d=r.profile;function m(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function h(e){e(i=t.def(),"=",m(),";"),"string"==typeof a?e(s,".count+=",a,";"):e(s,".count++;"),p&&(n?e(o=t.def(),"=",l,".getNumPendingQueries();"):e(l,".beginQuery(",s,");"))}function b(e){e(s,".cpuTime+=",m(),"-",i,";"),p&&(n?e(l,".pushScopeStats(",o,",",l,".getNumPendingQueries(),",s,");"):e(l,".endQuery();"))}function v(e){var r=t.def(c,".profile");t(c,".profile=",e,";"),t.exit(c,".profile=",r,";")}if(d){if(sf(d))return void(d.enable?(h(t),b(t.exit),v("true")):v("false"));v(f=d.append(e,t))}else f=t.def(c,".profile");var g=e.block();h(g),t("if(",f,"){",g,"}");var y=e.block();b(y),t.exit("if(",f,"){",y,"}")}function $(e,t,r,n,a){var i=e.shared;function o(e){switch(e){case Ao:case Oo:case jo:return 2;case _o:case Eo:case Co:return 3;case ko:case To:case zo:return 4;default:return 1}}function f(r,n,a){var o=i.gl,f=t.def(r,".location"),u=t.def(i.attributes,"[",f,"]"),s=a.state,c=a.buffer,l=[a.x,a.y,a.z,a.w],d=["buffer","normalized","offset","stride"];function m(){t("if(!",u,".buffer){",o,".enableVertexAttribArray(",f,");}");var r,i=a.type;if(r=a.size?t.def(a.size,"||",n):n,t("if(",u,".type!==",i,"||",u,".size!==",r,"||",d.map((function(e){return u+"."+e+"!=="+a[e]})).join("||"),"){",o,".bindBuffer(",fo,",",c,".buffer);",o,".vertexAttribPointer(",[f,r,i,a.normalized,a.stride,a.offset],");",u,".type=",i,";",u,".size=",r,";",d.map((function(e){return u+"."+e+"="+a[e]+";"})).join(""),"}"),g){var s=a.divisor;t("if(",u,".divisor!==",s,"){",e.instancing,".vertexAttribDivisorANGLE(",[f,s],");",u,".divisor=",s,";}")}}function p(){t("if(",u,".buffer){",o,".disableVertexAttribArray(",f,");",u,".buffer=null;","}if(",ni.map((function(e,t){return u+"."+e+"!=="+l[t]}
1)).join("||"),"){",o,".vertexAttrib4f(",f,",",l,");",ni.map((function(e,t){return u+"."+e+"="+l[t]+";"})).join(""),"}")}s===ii?m():s===oi?p():(t("if(",s,"===",ii,"){"),m(),t("}else{"),p(),t("}"))}n.forEach((function(n){var i,u=n.name,s=r.attributes[u];if(s){if(!a(s))return;i=s.append(e,t)}else{if(!a(df))return;var c=e.scopeAttrib(u);re.optional((function(){e.assert(t,c+".state","missing attribute "+u)})),i={},Object.keys(new b).forEach((function(e){i[e]=t.def(c,".",e)}))}f(e.link(n),o(n.info.type),i)}))}function K(e,t,n,a,i,o){for(var f,u=e.shared,s=u.gl,c=0;c<a.length;++c){var l,d=a[c],m=d.name,p=d.info.type,h=n.uniforms[m],b=e.link(d)+".location";if(h){if(!i(h))continue;if(sf(h)){var v=h.value;if(re.command(null!=v,'missing uniform "'+m+'"',e.commandStr),p===Io||p===Po){re.command("function"==typeof v&&(p===Io&&("texture2d"===v._reglType||"framebuffer"===v._reglType)||p===Po&&("textureCube"===v._reglType||"framebufferCube"===v._reglType)),"invalid texture for uniform "+m,e.commandStr);var g=e.link(v._texture||v.color[0]._texture);t(s,".uniform1i(",b,",",g+".bind());"),t.exit(g,".unbind();")}else if(p===Fo||p===Vo||p===Bo){re.optional((function(){re.command(cr(v),"invalid matrix for uniform "+m,e.commandStr),re.command(p===Fo&&4===v.length||p===Vo&&9===v.length||p===Bo&&16===v.length,"invalid length for matrix uniform "+m,e.commandStr)}));var y=e.global.def("new Float32Array(["+Array.prototype.slice.call(v)+"])"),x=2;p===Vo?x=3:p===Bo&&(x=4),t(s,".uniformMatrix",x,"fv(",b,",false,",y,");")}else{switch(p){case wo:re.commandType(v,"number","uniform "+m,e.commandStr),f="1f";break;case Ao:re.command(cr(v)&&2===v.length,"uniform "+m,e.commandStr),f="2f";break;case _o:re.command(cr(v)&&3===v.length,"uniform "+m,e.commandStr),f="3f";break;case ko:re.command(cr(v)&&4===v.length,"uniform "+m,e.commandStr),f="4f";break;case Do:re.commandType(v,"boolean","uniform "+m,e.commandStr),f="1i";break;case So:re.commandType(v,"number","uniform "+m,e.commandStr),f="1i";break;case jo:case Oo:re.command(cr(v)&&2===v.length,"uniform "+m,e.commandStr),f="2i";break;case Co:case Eo:re.command(cr(v)&&3===v.length,"uniform "+m,e.commandStr),f="3i";break;case zo:case To:re.command(cr(v)&&4===v.length,"uniform "+m,e.commandStr),f="4i"}t(s,".uniform",f,"(",b,",",cr(v)?Array.prototype.slice.call(v):v,");")}continue}l=h.append(e,t)}else{if(!i(df))continue;l=t.def(u.uniforms,"[",r.id(m),"]")}p===Io?(re(!Array.isArray(l),"must specify a scalar prop for textures"),t("if(",l,"&&",l,'._reglType==="framebuffer"){',l,"=",l,".color[0];","}")):p===Po&&(re(!Array.isArray(l),"must specify a scalar prop for cube maps"),t("if(",l,"&&",l,'._reglType==="framebufferCube"){',l,"=",l,".color[0];","}")),re.optional((function(){function r(r,n){e.assert(t,r,'bad data or missing for uniform "'+m+'".  '+n)}function n(e){re(!Array.isArray(l),"must not specify an array type for uniform"),r("typeof "+l+'==="'+e+'"',"invalid type, expected "+e)}function a(t,n){Array.isArray(l)?re(l.length===t,"must have length "+t):r(u.isArrayLike+"("+l+")&&"+l+".length==="+t,"invalid vector, should have length "+t,e.commandStr)}function i(t){re(!Array.isArray(l),"must not specify a value type"),r("typeof "+l+'==="function"&&'+l+'._reglType==="texture'+(t===so?"2d":"Cube")+'"',"invalid texture type",e.commandStr)}switch(p){case So:n("number");break;case Oo:a(2,"number");break;case Eo:a(3,"number");break;case To:a(4,"number");break;case wo:n("number");break;case Ao:a(2,"number");break;case _o:a(3,"number");break;case ko:a(4,"number");break;case Do:n("boolean");break;case jo:a(2,"boolean");break;case Co:a(3,"boolean");break;case zo:a(4,"boolean");break;case Fo:a(4,"number");break;case Vo:a(9,"number");break;case Bo:a(16,"number");break;case Io:i(so);break;case Po:i(co)}}));var w=1;switch(p){case Io:case Po:var A=t.def(l,"._texture");t(s,".uniform1i(",b,",",A,".bind());"),t.exit(A,".unbind();");continue;case So:case Do:f="1i";break;case Oo:case jo:f="2i",w=2;break;case Eo:case Co:f="3i",w=3;break;case To:case zo:f="4i",w=4;break;case wo:f="1f";break;case Ao:f="2f",w=2;break;case _o:f="3f",w=3;break;case ko:f="4f",w=4;break;case Fo:f="Matrix2fv";break;case Vo:f="Matrix3fv";break;case Bo:f="Matrix4fv"}if("M"===f.charAt(0)){t(s,".uniform",f,"(",b,",");var _=Math.pow(p-Fo+2,2),k=e.global.def("new Float32Array(",_,")");Array.isArray(l)?t("false,(",Oe(_,(function(e){return k+"["+e+"]="+l[e]}
vendor: 4,156 bytes, line 1
1)),",",k,")"):t("false,(Array.isArray(",l,")||",l," instanceof Float32Array)?",l,":(",Oe(_,(function(e){return k+"["+e+"]="+l+"["+e+"]"})),",",k,")"),t(");")}else if(w>1){for(var S=[],O=[],E=0;E<w;++E)Array.isArray(l)?O.push(l[E]):O.push(t.def(l+"["+E+"]")),o&&S.push(t.def());o&&t("if(!",e.batchId,"||",S.map((function(e,t){return e+"!=="+O[t]})).join("||"),"){",S.map((function(e,t){return e+"="+O[t]+";"})).join("")),t(s,".uniform",f,"(",b,",",O.join(","),");"),o&&t("}")}else{if(re(!Array.isArray(l),"uniform value must not be an array"),o){var T=t.def();t("if(!",e.batchId,"||",T,"!==",l,"){",T,"=",l,";")}t(s,".uniform",f,"(",b,",",l,");"),o&&t("}")}}}function J(e,t,r,n){var a=e.shared,i=a.gl,o=a.draw,f=n.draw;function u(){var u,s=f.elements,c=t;return s?((s.contextDep&&n.contextDynamic||s.propDep)&&(c=r),u=s.append(e,c),f.elementsActive&&c("if("+u+")"+i+".bindBuffer("+uo+","+u+".buffer.buffer);")):(u=c.def(),c(u,"=",o,".",Ni,";","if(",u,"){",i,".bindBuffer(",uo,",",u,".buffer.buffer);}","else if(",a.vao,".currentVAO){",u,"=",e.shared.elements+".getElements("+a.vao,".currentVAO.elements);",x?"":"if("+u+")"+i+".bindBuffer("+uo+","+u+".buffer.buffer);","}")),u}function s(){var a,i=f.count,u=t;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(u=r),a=i.append(e,u),re.optional((function(){i.MISSING&&e.assert(t,"false","missing vertex count"),i.DYNAMIC&&e.assert(u,a+">=0","missing vertex count")}))):(a=u.def(o,".",Qi),re.optional((function(){e.assert(u,a+">=0","missing vertex count")}))),a}var c=u();function l(a){var i=f[a];return i?i.contextDep&&n.contextDynamic||i.propDep?i.append(e,r):i.append(e,t):t.def(o,".",a)}var d,m,p=l(qi),h=l(Yi),b=s();if("number"==typeof b){if(0===b)return}else r("if(",b,"){"),r.exit("}");g&&(d=l(Xi),m=e.instancing);var v=c+".type",y=f.elements&&sf(f.elements)&&!f.vaoActive;function w(){function e(){r(m,".drawElementsInstancedANGLE(",[p,b,v,h+"<<(("+v+"-"+ai+")>>1)",d],");")}function t(){r(m,".drawArraysInstancedANGLE(",[p,h,b,d],");")}c&&"null"!==c?y?e():(r("if(",c,"){"),e(),r("}else{"),t(),r("}")):t()}function A(){function e(){r(i+".drawElements("+[p,b,v,h+"<<(("+v+"-"+ai+")>>1)"]+");")}function t(){r(i+".drawArrays("+[p,h,b]+");")}c&&"null"!==c?y?e():(r("if(",c,"){"),e(),r("}else{"),t(),r("}")):t()}g&&("number"!=typeof d||d>=0)?"string"==typeof d?(r("if(",d,">0){"),w(),r("}else if(",d,"<0){"),A(),r("}")):w():A()}function Z(e,t,r,n,a){var i=z(),o=i.proc("body",a);return re.optional((function(){i.commandStr=t.commandStr,i.command=i.link(t.commandStr)})),g&&(i.instancing=o.def(i.shared.extensions,".angle_instanced_arrays")),e(i,o,r,n),i.compile().body}function ee(e,t,r,n){Y(e,t),r.useVAO?r.drawVAO?t(e.shared.vao,".setVAO(",r.drawVAO.append(e,t),");"):t(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(t(e.shared.vao,".setVAO(null);"),$(e,t,r,n.attributes,(function(){return!0}))),K(e,t,r,n.uniforms,(function(){return!0}),!1),J(e,t,t,r)}function te(e,t){var r=e.proc("draw",1);Y(e,r),H(e,r,t.context),N(e,r,t.framebuffer),q(e,r,t),Q(e,r,t.state),X(e,r,t,!1,!0);var n=t.shader.progVar.append(e,r);if(r(e.shared.gl,".useProgram(",n,".program);"),t.shader.program)ee(e,r,t,t.shader.program);else{r(e.shared.vao,".setVAO(null);");var a=e.global.def("{}"),i=r.def(n,".id"),o=r.def(a,"[",i,"]");r(e.cond(o).then(o,".call(this,a0);").else(o,"=",a,"[",i,"]=",e.link((function(r){return Z(ee,e,t,r,1)})),"(",n,");",o,".call(this,a0);"))}Object.keys(t.state).length>0&&r(e.shared.current,".dirty=true;"),e.shared.vao&&r(e.shared.vao,".setVAO(null);")}function ne(e,t,r,n){function a(){return!0}e.batchId="a1",Y(e,t),$(e,t,r,n.attributes,a),K(e,t,r,n.uniforms,a,!1),J(e,t,t,r)}function ae(e,t,r,n){Y(e,t);var a=r.contextDep,i=t.def(),o="a0",f="a1",u=t.def();e.shared.props=u,e.batchId=i;var s=e.scope(),c=e.scope();function l(e){return e.contextDep&&a||e.propDep}function d(e){return!l(e)}if(t(s.entry,"for(",i,"=0;",i,"<",f,";++",i,"){",u,"=",o,"[",i,"];",c,"}",s.exit),r.needsContext&&H(e,c,r.context),r.needsFramebuffer&&N(e,c,r.framebuffer),Q(e,c,r.state,l),r.profile&&l(r.profile)&&X(e,c,r,!1,!0),n)r.useVAO?r.drawVAO?l(r.drawVAO)?c(e.shared.vao,".setVAO(",r.drawVAO.append(e,c),");
1"):s(e.shared.vao,".setVAO(",r.drawVAO.append(e,s),");"):s(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(s(e.shared.vao,".setVAO(null);"),$(e,s,r,n.attributes,d),$(e,c,r,n.attributes,l)),K(e,s,r,n.uniforms,d,!1),K(e,c,r,n.uniforms,l,!0),J(e,s,c,r);else{var m=e.global.def("{}"),p=r.shader.progVar.append(e,c),h=c.def(p,".id"),b=c.def(m,"[",h,"]");c(e.shared.gl,".useProgram(",p,".program);","if(!",b,"){",b,"=",m,"[",h,"]=",e.link((function(t){return Z(ne,e,r,t,2)})),"(",p,");}",b,".call(this,a0[",i,"],",i,");")}}function ie(e,t){var r=e.proc("batch",2);e.batchId="0",Y(e,r);var n=!1,a=!0;Object.keys(t.context).forEach((function(e){n=n||t.context[e].propDep})),n||(H(e,r,t.context),a=!1);var i=t.framebuffer,o=!1;function f(e){return e.contextDep&&n||e.propDep}i?(i.propDep?n=o=!0:i.contextDep&&n&&(o=!0),o||N(e,r,i)):N(e,r,null),t.state.viewport&&t.state.viewport.propDep&&(n=!0),q(e,r,t),Q(e,r,t.state,(function(e){return!f(e)})),t.profile&&f(t.profile)||X(e,r,t,!1,"a1"),t.contextDep=n,t.needsContext=a,t.needsFramebuffer=o;var u=t.shader.progVar;if(u.contextDep&&n||u.propDep)ae(e,r,t,null);else{var s=u.append(e,r);if(r(e.shared.gl,".useProgram(",s,".program);"),t.shader.program)ae(e,r,t,t.shader.program);else{r(e.shared.vao,".setVAO(null);");var c=e.global.def("{}"),l=r.def(s,".id"),d=r.def(c,"[",l,"]");r(e.cond(d).then(d,".call(this,a0,a1);").else(d,"=",c,"[",l,"]=",e.link((function(r){return Z(ae,e,t,r,2)})),"(",s,");",d,".call(this,a0,a1);"))}}Object.keys(t.state).length>0&&r(e.shared.current,".dirty=true;"),e.shared.vao&&r(e.shared.vao,".setVAO(null);")}function oe(e,t){var n=e.proc("scope",3);e.batchId="a2";var a=e.shared,i=a.current;function o(r){var i=t.shader[r];i&&n.set(a.shader,"."+r,i.append(e,n))}H(e,n,t.context),t.framebuffer&&t.framebuffer.append(e,n),ff(Object.keys(t.state)).forEach((function(r){var i=t.state[r].append(e,n);cr(i)?i.forEach((function(t,a){n.set(e.next[r],"["+a+"]",t)})):n.set(a.next,"."+r,i)}
1)),X(e,n,t,!0,!0),[Ni,Yi,Qi,Xi,qi].forEach((function(r){var i=t.draw[r];i&&n.set(a.draw,"."+r,""+i.append(e,n))})),Object.keys(t.uniforms).forEach((function(i){var o=t.uniforms[i].append(e,n);Array.isArray(o)&&(o="["+o.join()+"]"),n.set(a.uniforms,"["+r.id(i)+"]",o)})),Object.keys(t.attributes).forEach((function(r){var a=t.attributes[r].append(e,n),i=e.scopeAttrib(r);Object.keys(new b).forEach((function(e){n.set(i,"."+e,a[e])}))})),t.scopeVAO&&n.set(a.vao,".targetVAO",t.scopeVAO.append(e,n)),o(Gi),o(Hi),Object.keys(t.state).length>0&&(n(i,".dirty=true;"),n.exit(i,".dirty=true;")),n("a1(",e.shared.context,",a0,",e.batchId,");")}function fe(e){if("object"==typeof e&&!cr(e)){for(var t=Object.keys(e),r=0;r<t.length;++r)if(pe.isDynamic(e[t[r]]))return!0;return!1}}function ue(e,t,r){var n=t.static[r];if(n&&fe(n)){var a=e.global,i=Object.keys(n),o=!1,f=!1,u=!1,s=e.global.def("{}");i.forEach((function(t){var r=n[t];if(pe.isDynamic(r)){"function"==typeof r&&(r=n[t]=pe.unbox(r));var i=lf(r,null);o=o||i.thisDep,u=u||i.propDep,f=f||i.contextDep}else{switch(a(s,".",t,"="),typeof r){case"number":a(r);break;case"string":a('"',r,'"');break;case"object":Array.isArray(r)&&a("[",r.join(),"]");break;default:a(e.link(r))}a(";")}})),t.dynamic[r]=new pe.DynamicVariable(li,{thisDep:o,contextDep:f,propDep:u,ref:s,append:c}),delete t.static[r]}function c(e,t){i.forEach((function(r){var a=n[r];if(pe.isDynamic(a)){var i=e.invoke(t,a);t(s,".",r,"=",i,";")}}))}}function se(e,r,n,a,i){var o=z();o.stats=o.link(i),Object.keys(r.static).forEach((function(e){ue(o,r,e)})),oo.forEach((function(t){ue(o,e,t)}));var f=G(e,r,n,a,o);return te(o,f),oe(o,f),ie(o,f),t(o.compile(),{destroy:function(){f.shader.program.destroy()}})}return{next:A,current:w,procs:function(){var e=z(),t=e.proc("poll"),r=e.proc("refresh"),i=e.block();t(i),r(i);var o,f=e.shared,u=f.gl,s=f.next,c=f.current;i(c,".dirty=false;"),N(e,t),N(e,r,null,!0),g&&(o=e.link(g)),n.oes_vertex_array_object&&r(e.link(n.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var l=0;l<a.maxAttributes;++l){var d=r.def(f.attributes,"[",l,"]"),m=e.cond(d,".buffer");m.then(u,".enableVertexAttribArray(",l,");",u,".bindBuffer(",fo,",",d,".buffer.buffer);",u,".vertexAttribPointer(",l,",",d,".size,",d,".type,",d,".normalized,",d,".stride,",d,".offset);").else(u,".disableVertexAttribArray(",l,");",u,".vertexAttrib4f(",l,",",d,".x,",d,".y,",d,".z,",d,".w);",d,".buffer=null;"),r(m),g&&r(o,".vertexAttribDivisorANGLE(",l,",",d,".divisor);")}return r(e.shared.vao,".currentVAO=null;",e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"),Object.keys(k).forEach((function(n){var a=k[n],o=i.def(s,".",n),f=e.block();f("if(",o,"){",u,".enable(",a,")}else{",u,".disable(",a,")}",c,".",n,"=",o,";"),r(f),t("if(",o,"!==",c,".",n,"){",f,"}")})),Object.keys(S).forEach((function(n){var a,o,f=S[n],l=w[n],d=e.block();if(d(u,".",f,"("),cr(l)){var m=l.length;a=e.global.def(s,".",n),o=e.global.def(c,".",n),d(Oe(m,(function(e){return a+"["+e+"]"})),");",Oe(m,(function(e){return o+"["+e+"]="+a+"["+e+"];"})).join("")),t("if(",Oe(m,(function(e){return a+"["+e+"]!=="+o+"["+e+"]"})).join("||"),"){",d,"}")}else a=i.def(s,".",n),o=i.def(c,".",n),d(a,");",c,".",n,"=",a,";"),t("if(",a,"!==",o,"){",d,"}");r(d)})),e.compile()}(),compile:se}}function pf(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var hf=34918,bf=34919,vf=35007,gf=function(e,t){if(!t.ext_disjoint_timer_query)return null;var r=[];function n(){return r.pop()||t.ext_disjoint_timer_query.createQueryEXT()}function a(e){r.push(e)}var i=[];function o(e){var r=n();t.ext_disjoint_timer_query.beginQueryEXT(vf,r),i.push(r),m(i.length-1,i.length,e)}function f(){t.ext_disjoint_timer_query.endQueryEXT(vf)}function u(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var s=[];function c(){return s.pop()||new u}function l(e){s.push(e)}var d=[];function m(e,t,r){var n=c();n.startQueryIndex=e,n.endQueryIndex=t,n.sum=0,n.stats=r,d.push(n)}var p=[],h=[];function b(){var e,r,n=i.length;if(0!==n){h.length=Math.max(h.length,n+1),p.length=Math.max(p.length,n+1),p[0]=0,h[0]=0;var o=0;for(e=0,r=0;r<i.length;++r){var f=i[r];t.ext_disjoint_timer_query.getQueryObjectEXT(f,bf)?(o+=t.ext_disjoint_timer_query.getQueryObjectEXT(f,hf),a(f)):i[e++]=f,p[r+1]=o,h[r+1]=e}for(i.length=e,e=0,r=0;r<d.length;++r){var u=d[r],s=u.startQueryIndex,c=u.endQueryIndex;u.sum+=p[c]-p[s];var m=h[s],b=h[c];b===m?(u.stats.gpuTime+=u.sum/1e6,l(u)):(u.startQueryIndex=m,u.endQueryIndex=b,d[e++]=u)}d.length=e}}return{beginQuery:o,endQuery:f,pushScopeStats:m,update:b,getNumPendingQueries:function(){return i.length},clear:function(){r.push.apply(r,i);for(var e=0;e<r.length;e++)t.ext_disjoint_timer_query.deleteQueryEXT(r[e]);i.length=0,r.length=0},restore:function(){i.length=0,r.length=0}}},yf=16384,xf=256,wf=1024,Af=34962,_f="webglcontextlost",kf="webglcontextrestored",Sf=1,Of=2,Ef=3;function Tf(e,t){for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}function Df(e){var r=ke(e);if(!r)return null;var n=r.gl,a=n.getContextAttributes(),i=n.isContextLost(),o=Se(n,r);if(!o)return null;var f=ve(),u=pf(),s=o.extensions,c=gf(n,s),l=be(),d=n.drawingBufferWidth,m=n.drawingBufferHeight,p={tick:0,time:0,viewportWidth:d,viewportHe
1ight:m,framebufferWidth:d,framebufferHeight:m,drawingBufferWidth:d,drawingBufferHeight:m,pixelRatio:r.pixelRatio},h={},b={elements:null,primitive:4,count:-1,offset:0,instances:-1},v=At(n,s),g=Nt(n,u,r,w),y=ir(n,s,g,u),x=Ga(n,s,v,u,g,y,b);function w(e){return x.destroyBuffer(e)}var A=Ya(n,f,u,r),_=Xn(n,s,v,(function(){O.procs.poll()}),p,u,r),k=sa(n,s,v,u,r),S=Pa(n,s,v,_,k,u),O=mf(n,f,s,v,g,y,_,S,h,x,A,b,p,c,r),E=Za(n,S,O.procs.poll,p,a,s,v),T=O.next,D=n.canvas,j=[],C=[],z=[],F=[r.onDestroy],V=null;function B(){if(0===j.length)return c&&c.update(),void(V=null);V=he.next(B),Q();for(var e=j.length-1;e>=0;--e){var t=j[e];t&&t(p,null,0)}n.flush(),c&&c.update()}function I(){!V&&j.length>0&&(V=he.next(B))}function P(){V&&(he.cancel(B),V=null)}function L(e){e.preventDefault(),i=!0,P(),C.forEach((function(e){e()}))}function R(e){n.getError(),i=!1,o.restore(),A.restore(),g.restore(),_.restore(),k.restore(),S.restore(),x.restore(),c&&c.restore(),O.procs.refresh(),I(),z.forEach((function(e){e()}))}function M(){j.length=0,P(),D&&(D.removeEventListener(_f,L),D.removeEventListener(kf,R)),A.clear(),S.clear(),k.clear(),x.clear(),_.clear(),y.clear(),g.clear(),c&&c.clear(),F.forEach((function(e){e()}))}function U(e){function r(e){var r=t({},e);function n(e){if(e in r){var t=r[e];delete r[e],Object.keys(t).forEach((function(n){r[e+"."+n]=t[n]}))}}return delete r.uniforms,delete r.attributes,delete r.context,delete r.vao,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),n("blend"),n("depth"),n("cull"),n("stencil"),n("polygonOffset"),n("scissor"),n("sample"),"vao"in e&&(r.vao=e.vao),r}function n(e,t){var r={},n={};return Object.keys(e).forEach((function(a){var i=e[a];if(pe.isDynamic(i))n[a]=pe.unbox(i,a);else{if(t&&Array.isArray(i))for(var o=0;o<i.length;++o)if(pe.isDynamic(i[o]))return void(n[a]=pe.unbox(i,a));r[a]=i}})),{dynamic:n,static:r}}
1re(!!e,"invalid args to regl({...})"),re.type(e,"object","invalid args to regl({...})");var a=n(e.context||{},!0),o=n(e.uniforms||{},!0),f=n(e.attributes||{},!1),u=n(r(e),!1),s={gpuTime:0,cpuTime:0,count:0},c=O.compile(u,f,o,a,s),l=c.draw,d=c.batch,m=c.scope,p=[];function h(e){for(;p.length<e;)p.push(null);return p}function b(e,t){var r;if(i&&re.raise("context lost"),"function"==typeof e)return m.call(this,null,e,0);if("function"==typeof t)if("number"==typeof e)for(r=0;r<e;++r)m.call(this,null,t,r);else{if(!Array.isArray(e))return m.call(this,e,t,0);for(r=0;r<e.length;++r)m.call(this,e[r],t,r)}else if("number"==typeof e){if(e>0)return d.call(this,h(0|e),0|e)}else{if(!Array.isArray(e))return l.call(this,e);if(e.length)return d.call(this,e,e.length)}}return t(b,{stats:s,destroy:function(){c.destroy()}})}D&&(D.addEventListener(_f,L,!1),D.addEventListener(kf,R,!1));var W=S.setFBO=U({framebuffer:pe.define.call(null,Sf,"framebuffer")});function G(e,t){var r=0;O.procs.poll();var a=t.color;a&&(n.clearColor(+a[0]||0,+a[1]||0,+a[2]||0,+a[3]||0),r|=yf),"depth"in t&&(n.clearDepth(+t.depth),r|=xf),"stencil"in t&&(n.clearStencil(0|t.stencil),r|=wf),re(!!r,"called regl.clear with no buffer specified"),n.clear(r)}function H(e){if(re("object"==typeof e&&e,"regl.clear() takes an object as input"),"framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var r=0;r<6;++r)W(t({framebuffer:e.framebuffer.faces[r]},e),G);else W(e,G);else G(null,e)}function N(e){function t(){var t=Tf(j,e);function r(){var e=Tf(j,r);j[e]=j[j.length-1],j.length-=1,j.length<=0&&P()}re(t>=0,"cannot cancel a frame twice"),j[t]=r}return re.type(e,"function","regl.frame() callback must be a function"),j.push(e),I(),{cancel:t}}function q(){var e=T.viewport,t=T.scissor_box;e[0]=e[1]=t[0]=t[1]=0,p.viewportWidth=p.framebufferWidth=p.drawingBufferWidth=e[2]=t[2]=n.drawingBufferWidth,p.viewportHeight=p.framebufferHeight=p.drawingBufferHeight=e[3]=t[3]=n.drawingBufferHeight}function Q(){p.tick+=1,p.time=X(),q(),O.procs.poll()}function Y(){_.refresh(),q(),O.procs.refresh(),c&&c.update()}function X(){return(be()-l)/1e3}function $(e,t){var r;switch(re.type(t,"function","listener callback must be a function"),e){case"frame":return N(t);case"lost":r=C;break;case"restore":r=z;break;case"destroy":r=F;break;default:re.raise("invalid event, must be one of frame,lost,restore,destroy")}return r.push(t),{cancel:function(){for(var e=0;e<r.length;++e)if(r[e]===t)return r[e]=r[r.length-1],void r.pop()}}}Y();var K=t(U,{clear:H,prop:pe.define.bind(null,Sf),context:pe.define.bind(null,Of),this:pe.define.bind(null,Ef),draw:U({}),buffer:function(e){return g.create(e,Af,!1,!1)},elements:function(e){return y.create(e,!1)},texture:_.create2D,cube:_.createCube,renderbuffer:k.create,framebuffer:S.create,framebufferCube:S.createCube,vao:x.createVAO,attributes:a,frame:N,on:$,limits:v,hasExtension:function(e){return v.extensions.indexOf(e.toLowerCase())>=0},read:E,destroy:M,_gl:n,_refresh:Y,poll:function(){Q(),c&&c.update()},now:X,stats:u});return r.onDone(null,K),K}return Df}()}}]);
2//# sourceMappingURL=35fc8c20-af0c10ffdef802f8da72.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.