@luma.gl/webgl 9.0.0-alpha.47 → 9.0.0-alpha.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter/converters/device-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/device-parameters.js +73 -40
- package/dist/adapter/converters/device-parameters.js.map +1 -1
- package/dist/adapter/converters/sampler-parameters.js +60 -61
- package/dist/adapter/converters/sampler-parameters.js.map +1 -1
- package/dist/adapter/converters/shader-formats.js +12 -13
- package/dist/adapter/converters/shader-formats.js.map +1 -1
- package/dist/adapter/converters/texture-formats.js +179 -180
- package/dist/adapter/converters/texture-formats.js.map +1 -1
- package/dist/adapter/converters/vertex-formats.js +20 -21
- package/dist/adapter/converters/vertex-formats.js.map +1 -1
- package/dist/adapter/device-helpers/device-features.js +2 -2
- package/dist/adapter/device-helpers/device-features.js.map +1 -1
- package/dist/adapter/device-helpers/device-limits.js +53 -54
- package/dist/adapter/device-helpers/device-limits.js.map +1 -1
- package/dist/adapter/device-helpers/get-device-info.d.ts.map +1 -1
- package/dist/adapter/device-helpers/get-device-info.js +23 -12
- package/dist/adapter/device-helpers/get-device-info.js.map +1 -1
- package/dist/adapter/helpers/decode-webgl-types.js +31 -32
- package/dist/adapter/helpers/decode-webgl-types.js.map +1 -1
- package/dist/adapter/helpers/get-shader-layout.js +29 -30
- package/dist/adapter/helpers/get-shader-layout.js.map +1 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.d.ts.map +1 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.js +16 -4
- package/dist/adapter/helpers/parse-shader-compiler-log.js.map +1 -1
- package/dist/adapter/helpers/set-uniform.js +40 -41
- package/dist/adapter/helpers/set-uniform.js.map +1 -1
- package/dist/adapter/helpers/webgl-topology-utils.js +38 -39
- package/dist/adapter/helpers/webgl-topology-utils.js.map +1 -1
- package/dist/adapter/objects/webgl-renderbuffer.js +5 -6
- package/dist/adapter/objects/webgl-renderbuffer.js.map +1 -1
- package/dist/adapter/resources/webgl-buffer.js +14 -15
- package/dist/adapter/resources/webgl-buffer.js.map +1 -1
- package/dist/adapter/resources/webgl-command-buffer.js +25 -26
- package/dist/adapter/resources/webgl-command-buffer.js.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.js +22 -23
- package/dist/adapter/resources/webgl-framebuffer.js.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.js +2 -3
- package/dist/adapter/resources/webgl-render-pass.js.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +7 -8
- package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -1
- package/dist/adapter/resources/webgl-sampler.js +2 -3
- package/dist/adapter/resources/webgl-sampler.js.map +1 -1
- package/dist/adapter/resources/webgl-shader.js +3 -4
- package/dist/adapter/resources/webgl-shader.js.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +27 -28
- package/dist/adapter/resources/webgl-texture.js.map +1 -1
- package/dist/adapter/resources/webgl-transform-feedback.js +8 -9
- package/dist/adapter/resources/webgl-transform-feedback.js.map +1 -1
- package/dist/adapter/resources/webgl-vertex-array.d.ts +2 -2
- package/dist/adapter/resources/webgl-vertex-array.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-vertex-array.js +5 -6
- package/dist/adapter/resources/webgl-vertex-array.js.map +1 -1
- package/dist/adapter/webgl-device.js.map +1 -1
- package/dist/classic/accessor.js +4 -5
- package/dist/classic/accessor.js.map +1 -1
- package/dist/classic/copy-and-blit.js +16 -17
- package/dist/classic/copy-and-blit.js.map +1 -1
- package/dist/classic/format-utils.js +14 -15
- package/dist/classic/format-utils.js.map +1 -1
- package/dist/classic/typed-array-utils.js +18 -19
- package/dist/classic/typed-array-utils.js.map +1 -1
- package/dist/context/debug/webgl-developer-tools.js +0 -1
- package/dist/context/debug/webgl-developer-tools.js.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.js +256 -257
- package/dist/context/parameters/webgl-parameter-tables.js.map +1 -1
- package/dist/context/polyfill/get-parameter-polyfill.js +34 -35
- package/dist/context/polyfill/get-parameter-polyfill.js.map +1 -1
- package/dist/context/polyfill/polyfill-table.js +9 -10
- package/dist/context/polyfill/polyfill-table.js.map +1 -1
- package/dist/context/polyfill/polyfill-vertex-array-object.js +17 -17
- package/dist/context/polyfill/polyfill-vertex-array-object.js.map +1 -1
- package/dist/dist.dev.js +979 -2696
- package/dist/index.cjs +382 -263
- package/dist.min.js +39 -28
- package/package.json +5 -5
- package/src/adapter/converters/device-parameters.ts +40 -25
- package/src/adapter/device-helpers/get-device-info.ts +36 -8
- package/src/adapter/helpers/parse-shader-compiler-log.ts +21 -7
- package/src/adapter/resources/webgl-vertex-array.ts +4 -3
- package/src/adapter/webgl-device.ts +3 -2
package/dist.min.js
CHANGED
|
@@ -4,35 +4,46 @@
|
|
|
4
4
|
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
5
|
else if (typeof exports === 'object') exports['luma'] = factory();
|
|
6
6
|
else root['luma'] = factory();})(globalThis, function () {
|
|
7
|
-
var __exports__=(()=>{var Fo=Object.create;var Lt=Object.defineProperty;var Bo=Object.getOwnPropertyDescriptor;var Mo=Object.getOwnPropertyNames;var Do=Object.getPrototypeOf,xo=Object.prototype.hasOwnProperty;var Pr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Uo=(e,t)=>{for(var r in t)Lt(e,r,{get:t[r],enumerable:!0})},Pn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Mo(t))!xo.call(e,o)&&o!==r&&Lt(e,o,{get:()=>t[o],enumerable:!(n=Bo(t,o))||n.enumerable});return e};var Le=(e,t,r)=>(r=e!=null?Fo(Do(e)):{},Pn(t||!e||!e.__esModule?Lt(r,"default",{value:e,enumerable:!0}):r,e)),wo=e=>Pn(Lt({},"__esModule",{value:!0}),e);var Xn=Pr((Ou,De)=>{function Br(e){return De.exports=Br=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},De.exports.__esModule=!0,De.exports.default=De.exports,Br(e)}De.exports=Br,De.exports.__esModule=!0,De.exports.default=De.exports});var Wn=Pr((vu,xe)=>{var Ln=Xn().default;function Hn(){"use strict";xe.exports=Hn=function(){return e},xe.exports.__esModule=!0,xe.exports.default=xe.exports;var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(S,A,g){S[A]=g.value},o=typeof Symbol=="function"?Symbol:{},i=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",f=o.toStringTag||"@@toStringTag";function _(S,A,g){return Object.defineProperty(S,A,{value:g,enumerable:!0,configurable:!0,writable:!0}),S[A]}try{_({},"")}catch{_=function(g,B,U){return g[B]=U}}function u(S,A,g,B){var U=A&&A.prototype instanceof R?A:R,M=Object.create(U.prototype),k=new re(B||[]);return n(M,"_invoke",{value:j(S,g,k)}),M}function l(S,A,g){try{return{type:"normal",arg:S.call(A,g)}}catch(B){return{type:"throw",arg:B}}}e.wrap=u;var E={};function R(){}function d(){}function T(){}var h={};_(h,i,function(){return this});var b=Object.getPrototypeOf,v=b&&b(b(K([])));v&&v!==t&&r.call(v,i)&&(h=v);var y=T.prototype=R.prototype=Object.create(h);function P(S){["next","throw","return"].forEach(function(A){_(S,A,function(g){return this._invoke(A,g)})})}function F(S,A){function g(U,M,k,ne){var Q=l(S[U],S,M);if(Q.type!=="throw"){var de=Q.arg,ae=de.value;return ae&&Ln(ae)=="object"&&r.call(ae,"__await")?A.resolve(ae.__await).then(function(Ae){g("next",Ae,k,ne)},function(Ae){g("throw",Ae,k,ne)}):A.resolve(ae).then(function(Ae){de.value=Ae,k(de)},function(Ae){return g("throw",Ae,k,ne)})}ne(Q.arg)}var B;n(this,"_invoke",{value:function(M,k){function ne(){return new A(function(Q,de){g(M,k,Q,de)})}return B=B?B.then(ne,ne):ne()}})}function j(S,A,g){var B="suspendedStart";return function(U,M){if(B==="executing")throw new Error("Generator is already running");if(B==="completed"){if(U==="throw")throw M;return{value:void 0,done:!0}}for(g.method=U,g.arg=M;;){var k=g.delegate;if(k){var ne=X(k,g);if(ne){if(ne===E)continue;return ne}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(B==="suspendedStart")throw B="completed",g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);B="executing";var Q=l(S,A,g);if(Q.type==="normal"){if(B=g.done?"completed":"suspendedYield",Q.arg===E)continue;return{value:Q.arg,done:g.done}}Q.type==="throw"&&(B="completed",g.method="throw",g.arg=Q.arg)}}}function X(S,A){var g=A.method,B=S.iterator[g];if(B===void 0)return A.delegate=null,g==="throw"&&S.iterator.return&&(A.method="return",A.arg=void 0,X(S,A),A.method==="throw")||g!=="return"&&(A.method="throw",A.arg=new TypeError("The iterator does not provide a '"+g+"' method")),E;var U=l(B,S.iterator,A.arg);if(U.type==="throw")return A.method="throw",A.arg=U.arg,A.delegate=null,E;var M=U.arg;return M?M.done?(A[S.resultName]=M.value,A.next=S.nextLoc,A.method!=="return"&&(A.method="next",A.arg=void 0),A.delegate=null,E):M:(A.method="throw",A.arg=new TypeError("iterator result is not an object"),A.delegate=null,E)}function z(S){var A={tryLoc:S[0]};1 in S&&(A.catchLoc=S[1]),2 in S&&(A.finallyLoc=S[2],A.afterLoc=S[3]),this.tryEntries.push(A)}function $(S){var A=S.completion||{};A.type="normal",delete A.arg,S.completion=A}function re(S){this.tryEntries=[{tryLoc:"root"}],S.forEach(z,this),this.reset(!0)}function K(S){if(S||S===""){var A=S[i];if(A)return A.call(S);if(typeof S.next=="function")return S;if(!isNaN(S.length)){var g=-1,B=function U(){for(;++g<S.length;)if(r.call(S,g))return U.value=S[g],U.done=!1,U;return U.value=void 0,U.done=!0,U};return B.next=B}}throw new TypeError(Ln(S)+" is not iterable")}return d.prototype=T,n(y,"constructor",{value:T,configurable:!0}),n(T,"constructor",{value:d,configurable:!0}),d.displayName=_(T,f,"GeneratorFunction"),e.isGeneratorFunction=function(S){var A=typeof S=="function"&&S.constructor;return!!A&&(A===d||(A.displayName||A.name)==="GeneratorFunction")},e.mark=function(S){return Object.setPrototypeOf?Object.setPrototypeOf(S,T):(S.__proto__=T,_(S,f,"GeneratorFunction")),S.prototype=Object.create(y),S},e.awrap=function(S){return{__await:S}},P(F.prototype),_(F.prototype,s,function(){return this}),e.AsyncIterator=F,e.async=function(S,A,g,B,U){U===void 0&&(U=Promise);var M=new F(u(S,A,g,B),U);return e.isGeneratorFunction(A)?M:M.next().then(function(k){return k.done?k.value:M.next()})},P(y),_(y,f,"Generator"),_(y,i,function(){return this}),_(y,"toString",function(){return"[object Generator]"}),e.keys=function(S){var A=Object(S),g=[];for(var B in A)g.push(B);return g.reverse(),function U(){for(;g.length;){var M=g.pop();if(M in A)return U.value=M,U.done=!1,U}return U.done=!0,U}},e.values=K,re.prototype={constructor:re,reset:function(A){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!A)for(var g in this)g.charAt(0)==="t"&&r.call(this,g)&&!isNaN(+g.slice(1))&&(this[g]=void 0)},stop:function(){this.done=!0;var A=this.tryEntries[0].completion;if(A.type==="throw")throw A.arg;return this.rval},dispatchException:function(A){if(this.done)throw A;var g=this;function B(de,ae){return k.type="throw",k.arg=A,g.next=de,ae&&(g.method="next",g.arg=void 0),!!ae}for(var U=this.tryEntries.length-1;U>=0;--U){var M=this.tryEntries[U],k=M.completion;if(M.tryLoc==="root")return B("end");if(M.tryLoc<=this.prev){var ne=r.call(M,"catchLoc"),Q=r.call(M,"finallyLoc");if(ne&&Q){if(this.prev<M.catchLoc)return B(M.catchLoc,!0);if(this.prev<M.finallyLoc)return B(M.finallyLoc)}else if(ne){if(this.prev<M.catchLoc)return B(M.catchLoc,!0)}else{if(!Q)throw new Error("try statement without catch or finally");if(this.prev<M.finallyLoc)return B(M.finallyLoc)}}}},abrupt:function(A,g){for(var B=this.tryEntries.length-1;B>=0;--B){var U=this.tryEntries[B];if(U.tryLoc<=this.prev&&r.call(U,"finallyLoc")&&this.prev<U.finallyLoc){var M=U;break}}M&&(A==="break"||A==="continue")&&M.tryLoc<=g&&g<=M.finallyLoc&&(M=null);var k=M?M.completion:{};return k.type=A,k.arg=g,M?(this.method="next",this.next=M.finallyLoc,E):this.complete(k)},complete:function(A,g){if(A.type==="throw")throw A.arg;return A.type==="break"||A.type==="continue"?this.next=A.arg:A.type==="return"?(this.rval=this.arg=A.arg,this.method="return",this.next="end"):A.type==="normal"&&g&&(this.next=g),E},finish:function(A){for(var g=this.tryEntries.length-1;g>=0;--g){var B=this.tryEntries[g];if(B.finallyLoc===A)return this.complete(B.completion,B.afterLoc),$(B),E}},catch:function(A){for(var g=this.tryEntries.length-1;g>=0;--g){var B=this.tryEntries[g];if(B.tryLoc===A){var U=B.completion;if(U.type==="throw"){var M=U.arg;$(B)}return M}}throw new Error("illegal catch attempt")},delegateYield:function(A,g,B){return this.delegate={iterator:K(A),resultName:g,nextLoc:B},this.method==="next"&&(this.arg=void 0),E}},e}xe.exports=Hn,xe.exports.__esModule=!0,xe.exports.default=xe.exports});var we=Pr((bu,Vn)=>{var Wt=Wn()();Vn.exports=Wt;try{regeneratorRuntime=Wt}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Wt:Function("r","regeneratorRuntime = r")(Wt)}});var qc={};Uo(qc,{Accessor:()=>vr,WEBGLBuffer:()=>Ee,WEBGLCommandEncoder:()=>Cr,WEBGLFramebuffer:()=>Be,WEBGLRenderPass:()=>Or,WEBGLRenderPipeline:()=>Nr,WEBGLRenderbuffer:()=>Et,WEBGLResource:()=>Ut,WEBGLSampler:()=>Ze,WEBGLShader:()=>gr,WEBGLTexture:()=>ue,WEBGLTransformFeedback:()=>Ir,WEBGLVertexArray:()=>mr,WebGLCanvasContext:()=>Sr,WebGLDevice:()=>le,WebGLResource:()=>Ut,_TEXTURE_FORMATS:()=>ze,_checkFloat32ColorAttachment:()=>Er,assertWebGL2Context:()=>Za,assertWebGLContext:()=>sr,clear:()=>Oo,convertGLToTextureFormat:()=>$e,copyToTexture:()=>Io,getGLParameters:()=>cr,getShaderLayout:()=>br,getWebGL2Context:()=>Nt,isWebGL:()=>Zr,isWebGL2:()=>H,polyfillContext:()=>_r,popContextState:()=>ge,pushContextState:()=>be,readPixelsToArray:()=>Co,readPixelsToBuffer:()=>mo,registerHeadlessGL:()=>Mn,resetGLParameters:()=>ci,setDeviceParameters:()=>dr,setGLParameters:()=>Se,trackContextState:()=>yt,withDeviceParameters:()=>yi,withGLParameters:()=>Oe});function _e(e){return _e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_e(e)}function Fr(e,t){if(_e(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(_e(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dt(e){var t=Fr(e,"string");return _e(t)==="symbol"?t:String(t)}function c(e,t,r){return t=dt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Bn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fn(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Xo="Failed to create WebGL context in Node.js, headless gl returned null",Lo=" luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL contexts can not be created. This may not be an error. For example, this is a typical configuration for isorender applications running on the server.",Ho={width:1,height:1,debug:!0,throwOnError:!1},Ht=null;function Mn(e){Ht=e}function Dn(){return Ht!==null}function xn(e){e=Bn(Bn({},Ho),e);var t=e,r=t.width,n=t.height,o=t.webgl1,i=t.webgl2;if(i&&!o)throw new Error("headless-gl does not support WebGL2");if(!Ht)throw new Error(Lo);var s=Ht(r,n,e);if(!s)throw new Error(Xo);return s}function Un(e,t,r,n,o,i,s){try{var f=e[i](s),_=f.value}catch(u){r(u);return}f.done?t(_):Promise.resolve(_).then(n,o)}function oe(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function s(_){Un(i,n,o,s,f,"next",_)}function f(_){Un(i,n,o,s,f,"throw",_)}s(void 0)})}}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,dt(n.key),n)}}function I(e,t,r){return t&&wn(e.prototype,t),r&&wn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function He(e,t){return He=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},He(e,t)}function D(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&He(e,t)}function x(e,t){if(t&&(_e(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ce(e)}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},O(e)}var Cn=Le(we(),1);function Tt(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function q(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Tt()}var Wo=globalThis.self||globalThis.window||globalThis.global,Qe=globalThis.window||globalThis.self||globalThis.global,Vo=globalThis.document||{},We=globalThis.process||{},jo=globalThis.console,jn=globalThis.navigator||{};var Vt=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",Pu=q();var Mr=globalThis;function jt(e){if(!e&&!q())return"Node";if(Tt(e))return"Electron";let t=e||jn.userAgent||"";if(t.indexOf("Edge")>-1)return"Edge";let r=t.indexOf("MSIE ")!==-1,n=t.indexOf("Trident/")!==-1;return r||n?"IE":Mr.chrome?"Chrome":Mr.safari?"Safari":Mr.mozInnerScreenX?"Firefox":"Unknown"}function Ko(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Kt=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=Ko(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function Kn(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function Yn(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function Yt(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,o=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let i=e.width*r,s=e.height*r,f=["font-size:1px;","padding:".concat(Math.floor(s/2),"px ").concat(Math.floor(i/2),"px;"),"line-height:".concat(s,"px;"),"background:url(".concat(o,");"),"background-size:".concat(i,"px ").concat(s,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),f]}var kt;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(kt||(kt={}));var Yo=10;function kn(e){return typeof e!="string"?e:(e=e.toUpperCase(),kt[e]||kt.WHITE)}function Gn(e,t,r){if(!q&&typeof e=="string"){if(t){let n=kn(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=kn(r);e="\x1B[".concat(n+Yo,"m").concat(e,"\x1B[49m")}}return e}function zn(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),o=e;for(let i of n){let s=o[i];typeof s=="function"&&(t.find(f=>i===f)||(o[i]=s.bind(e)))}}function qe(e,t){if(!e)throw new Error(t||"Assertion failed")}function Ve(){let e;if(q()&&Qe.performance){var t,r;e=Qe===null||Qe===void 0||(t=Qe.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in We){var n;let o=We===null||We===void 0||(n=We.hrtime)===null||n===void 0?void 0:n.call(We);e=o[0]*1e3+o[1]/1e6}else e=Date.now();return e}var Je={debug:q()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},ko={enabled:!0,level:0};function pe(){}var $n={},Zn={once:!0},Xe=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=Vt,this._startTs=Ve(),this._deltaTs=Ve(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Kt("__probe-".concat(this.id,"__"),ko),this.timeStamp("".concat(this.id," started")),zn(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Ve()-this._startTs).toPrecision(10))}getDelta(){return Number((Ve()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){qe(t,r)}warn(t){return this._getLogFunction(0,t,Je.warn,arguments,Zn)}error(t){return this._getLogFunction(0,t,Je.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,Je.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Je.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Je.debug||Je.info,arguments,Zn)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||pe,n&&[n],{tag:Zo(r)}):pe}image(t){let{logLevel:r,priority:n,image:o,message:i="",scale:s=1}=t;return this._shouldLog(r||n)?q()?$o({image:o,message:i,scale:s}):zo({image:o,message:i,scale:s}):pe}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||pe)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},o=Qn({logLevel:t,message:r,opts:n}),{collapsed:i}=n;return o.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||pe)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=qn(t)}_getLogFunction(t,r,n,o,i){if(this._shouldLog(t)){i=Qn({logLevel:t,message:r,args:o,opts:i}),n=n||i.method,qe(n),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Ve();let s=i.tag||i.message;if(i.once&&s)if(!$n[s])$n[s]=Ve();else return pe;return r=Go(this.id,i.message,i),n.bind(console,r,...i.args)}return pe}};Xe.VERSION=Vt;function qn(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return qe(Number.isFinite(t)&&t>=0),t}function Qn(e){let{logLevel:t,message:r}=e;e.logLevel=qn(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let o=typeof e.message;return qe(o==="string"||o==="object"),Object.assign(e,{args:n},e.opts)}function Go(e,t,r){if(typeof t=="string"){let n=r.time?Yn(Kn(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=Gn(t,r.color,r.background)}return t}function zo(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),pe}function $o(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let i=new Image;return i.onload=()=>{let s=Yt(i,r,n);console.log(...s)},i.src=t,pe}let o=t.nodeName||"";if(o.toLowerCase()==="img")return console.log(...Yt(t,r,n)),pe;if(o.toLowerCase()==="canvas"){let i=new Image;return i.onload=()=>console.log(...Yt(i,r,n)),i.src=t.toDataURL(),pe}return pe}function Zo(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var sl=new Xe({id:"@probe.gl/log"});var C=new Xe({id:"luma.gl"});function At(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var je=class{constructor(t,r){this.name=void 0,this.type=void 0,this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=At(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(At()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var et=class{constructor(t){this.id=void 0,this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:n}=t,o=this.stats[r];return o||(t instanceof je?o=t:o=new je(r,n),this.stats[r]=o),o}};var Qo=function(){function e(){m(this,e),this.stats=new Map}var t=e.prototype;return t.getStats=function(n){return this.get(n)},t.get=function(n){return this.stats.has(n)||this.stats.set(n,new et({id:n})),this.stats.get(n)},I(e)}(),Gt=new Qo;function qo(){var e=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",t="set luma.log.level=1 (or higher) to trace rendering";if(globalThis.luma&&globalThis.luma.VERSION!==e)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(e));return globalThis.luma||(q()&&C.log(1,"luma.gl ".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:C,stats:Gt}),e}var Jn=qo();function Jo(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)?e:null}function ea(e){return Array.isArray(e)?e.length===0||typeof e[0]=="number"?e:null:Jo(e)}var Dr={};function ve(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Dr[e]=Dr[e]||1;var t=Dr[e]++;return"".concat(e,"-").concat(t)}function zt(e){return e>0&&(e&e-1)===0}function tt(e){var t=!0;for(var r in e){t=!1;break}return t}function ta(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function es(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ta(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ta(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var V=function(){function e(r,n,o){if(m(this,e),this.id=void 0,this.props=void 0,this.userData={},this.device=void 0,this._device=void 0,this.destroyed=!1,this.allocatedBytes=0,this._attachedResources=new Set,!r)throw new Error("no device");this._device=r,this.props=ts(n,o);var i=this.props.id!=="undefined"?this.props.id:ve(this[Symbol.toStringTag]);this.props.id=i,this.id=i,this.userData=this.props.userData||{},this.addStats()}var t=e.prototype;return t.destroy=function(){this.destroyResource()},t.delete=function(){return this.destroy(),this},t.toString=function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")},t.getProps=function(){return this.props},t.attachResource=function(n){this._attachedResources.add(n)},t.detachResource=function(n){this._attachedResources.delete(n)},t.destroyAttachedResource=function(n){this._attachedResources.delete(n)&&n.destroy()},t.destroyAttachedResources=function(){for(var n=0,o=Object.values(this._attachedResources);n<o.length;n++){var i=o[n];i.destroy()}this._attachedResources=new Set},t.destroyResource=function(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0},t.removeStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),o=this[Symbol.toStringTag];n.get("".concat(o,"s Active")).decrementCount()},t.trackAllocatedMemory=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],i=this._device.statsManager.getStats("Resource Counts");i.get("GPU Memory").addCount(n),i.get("".concat(o," Memory")).addCount(n),this.allocatedBytes=n},t.trackDeallocatedMemory=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],o=this._device.statsManager.getStats("Resource Counts");o.get("GPU Memory").subtractCount(this.allocatedBytes),o.get("".concat(n," Memory")).subtractCount(this.allocatedBytes),this.allocatedBytes=0},t.addStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),o=this[Symbol.toStringTag];n.get("Resources Created").incrementCount(),n.get("".concat(o,"s Created")).incrementCount(),n.get("".concat(o,"s Active")).incrementCount()},I(e)}();V.defaultProps={id:"undefined",handle:void 0,userData:void 0};function ts(e,t){var r=es({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}var na;function ra(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function xr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ra(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ra(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rs(e){var t=ns();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function ns(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}na=Symbol.toStringTag;var ee=function(e){D(r,e);var t=rs(r);function r(o,i){var s;m(this,r);var f=xr({},i);return(i.usage||0)&r.INDEX&&!i.indexType&&(i.data instanceof Uint32Array?f.indexType="uint32":i.data instanceof Uint16Array&&(f.indexType="uint16")),s=t.call(this,o,f,r.defaultProps),s.usage=void 0,s.indexType=void 0,s.byteLength=void 0,s.usage=i.usage||0,s.indexType=f.indexType,s}var n=r.prototype;return n.write=function(i,s){throw new Error("not implemented")},n.readAsync=function(i,s){throw new Error("not implemented")},n.getData=function(){throw new Error("not implemented")},I(r,[{key:na,get:function(){return"Buffer"}}]),r}(V);ee.defaultProps=xr(xr({},V.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});ee.MAP_READ=1;ee.MAP_WRITE=2;ee.COPY_SRC=4;ee.COPY_DST=8;ee.INDEX=16;ee.VERTEX=32;ee.UNIFORM=64;ee.STORAGE=128;ee.INDIRECT=256;ee.QUERY_RESOLVE=512;var ia;function aa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ur(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?aa(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var as={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(C.get("debug")),break:[],gl:null};ia=Symbol.toStringTag;var pt=function(){function e(r){m(this,e),this.id=void 0,this.statsManager=Gt,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=Ur(Ur({},as),r),this.id=this.props.id||ve(this[Symbol.toStringTag].toLowerCase())}var t=e.prototype;return t.loseDevice=function(){return!1},t.getCanvasContext=function(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext},t.createTexture=function(n){return(n instanceof Promise||typeof n=="string")&&(n={data:n}),this._createTexture(n)},t.createCommandEncoder=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};throw new Error("not implemented")},t._getBufferProps=function(n){(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});var o=Ur({},n);return(n.usage||0)&ee.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?o.indexType="uint32":n.data instanceof Uint16Array?o.indexType="uint16":C.warn("indices buffer content must be of integer type")()),o},I(e,[{key:ia,get:function(){return"Device"}}]),e}();pt.VERSION=Jn;function ht(e){if(Array.isArray(e))return e}function wr(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,s,f=[],_=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;_=!1}else for(;!(_=(n=i.call(r)).done)&&(f.push(n.value),f.length!==t);_=!0);}catch(l){u=!0,o=l}finally{try{if(!_&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw o}}return f}}function rt(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ke(e,t){if(e){if(typeof e=="string")return rt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rt(e,t)}}function St(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
8
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
9
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return i=u.done,u},e:function(u){s=!0,f=u},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(s)throw f}}}}function os(e,t){if(e){if(typeof e=="string")return oa(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oa(e,t)}}function oa(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function sa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function fa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sa(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ss=q()&&typeof document<"u",$t=function(){return ss&&document.readyState==="complete"},fs={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"},nt=function(){function e(r){var n=this;if(m(this,e),this.device=void 0,this.id=void 0,this.props=void 0,this.canvas=void 0,this.htmlCanvas=void 0,this.offscreenCanvas=void 0,this.type=void 0,this.width=1,this.height=1,this.resizeObserver=void 0,this._canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1},this.props=fa(fa({},fs),r),r=this.props,!q()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(r.canvas)typeof r.canvas=="string"?this.canvas=us(r.canvas):this.canvas=r.canvas;else{var o,i,s=ls(r),f=cs(((o=r)===null||o===void 0?void 0:o.container)||null);f.insertBefore(s,f.firstChild),this.canvas=s,(i=r)!==null&&i!==void 0&&i.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&r.autoResize&&(this.resizeObserver=new ResizeObserver(function(_){var u=is(_),l;try{for(u.s();!(l=u.n()).done;){var E=l.value;E.target===n.canvas&&n.update()}}catch(R){u.e(R)}finally{u.f()}}),this.resizeObserver.observe(this.canvas))}var t=e.prototype;return t.getDevicePixelRatio=function(n){if(typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(n=n===void 0?this.props.useDevicePixels:n,!n||n<=0))return 1;if(n===!0){var o=typeof window<"u"&&window.devicePixelRatio;return o||1}return n},t.getPixelSize=function(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":var n=this.getDevicePixelRatio(),o=this.canvas;return o.parentElement?[o.clientWidth*n,o.clientHeight*n]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}},t.getAspect=function(){var n=this.getPixelSize(),o=L(n,2),i=o[0],s=o[1];return i/s},t.cssToDeviceRatio=function(){try{var n=this.getDrawingBufferSize(),o=L(n,1),i=o[0],s=this._canvasSizeInfo.clientWidth;return s?i/s:1}catch{return 1}},t.cssToDevicePixels=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this.cssToDeviceRatio(),s=this.getDrawingBufferSize(),f=L(s,2),_=f[0],u=f[1];return Es(n,i,_,u,o)},t.setDevicePixelRatio=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.htmlCanvas){var i="width"in o?o.width:this.htmlCanvas.clientWidth,s="height"in o?o.height:this.htmlCanvas.clientHeight;(!i||!s)&&(C.log(1,"Canvas clientWidth/clientHeight is 0")(),n=1,i=this.htmlCanvas.width||1,s=this.htmlCanvas.height||1);var f=this._canvasSizeInfo;if(f.clientWidth!==i||f.clientHeight!==s||f.devicePixelRatio!==n){var _=n,u=Math.floor(i*_),l=Math.floor(s*_);this.htmlCanvas.width=u,this.htmlCanvas.height=l;var E=this.getDrawingBufferSize(),R=L(E,2),d=R[0],T=R[1];(d!==u||T!==l)&&(_=Math.min(d/i,T/s),this.htmlCanvas.width=Math.floor(i*_),this.htmlCanvas.height=Math.floor(s*_),C.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=i,this._canvasSizeInfo.clientHeight=s,this._canvasSizeInfo.devicePixelRatio=n}}},t.getDrawingBufferSize=function(){var n=this.device.gl;if(!n)throw new Error("canvas size");return[n.drawingBufferWidth,n.drawingBufferHeight]},t._setAutoCreatedCanvasId=function(n){var o;((o=this.htmlCanvas)===null||o===void 0?void 0:o.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=n)},I(e,null,[{key:"isPageLoaded",get:function(){return $t()}}]),e}();nt.pageLoaded=_s();function _s(){return $t()||typeof window>"u"?Promise.resolve():new Promise(function(e){window.addEventListener("load",function(){return e()})})}function cs(e){if(typeof e=="string"){var t=document.getElementById(e);if(!t&&!$t())throw new Error("Accessing '".concat(e,"' before page was loaded"));if(!t)throw new Error("".concat(e," is not an HTML element"));return t}else if(e)return e;return document.body}function us(e){var t=document.getElementById(e);if(!t&&!$t())throw new Error("Accessing '".concat(e,"' before page was loaded"));if(!(t instanceof HTMLCanvasElement))throw new Error("'".concat(t,"' is not a canvas element"));return t}function ls(e){var t=e.width,r=e.height,n=document.createElement("canvas");return n.id="lumagl-auto-created-canvas",n.width=t||1,n.height=r||1,n.style.width=Number.isFinite(t)?"".concat(t,"px"):"100%",n.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",n}function Es(e,t,r,n,o){var i=e,s=_a(i[0],t,r),f=ca(i[1],t,n,o),_=_a(i[0]+1,t,r),u=_===r-1?_:_-1;_=ca(i[1]+1,t,n,o);var l;return o?(_=_===0?_:_+1,l=f,f=_):l=_===n-1?_:_-1,{x:s,y:f,width:Math.max(u-s+1,1),height:Math.max(l-f+1,1)}}function _a(e,t,r){var n=Math.min(Math.round(e*t),r-1);return n}function ca(e,t,r,n){return n?Math.max(0,r-1-Math.round(e*t)):Math.min(Math.round(e*t),r-1)}var Ea;function ua(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function la(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ua(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ua(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rs(e){var t=ds();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function ds(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}Ea=Symbol.toStringTag;var se=function(e){D(r,e);var t=Rs(r);function r(n,o){var i,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.defaultProps;return m(this,r),i=t.call(this,n,o,s),i.dimension=void 0,i.format=void 0,i.width=void 0,i.height=void 0,i.depth=void 0,i.sampler=void 0,i.dimension=i.props.dimension,i.format=i.props.format,i.width=i.props.width,i.height=i.props.height,i.depth=i.props.depth,i}return I(r,[{key:Ea,get:function(){return"Texture"}}]),r}(V);se.defaultProps=la(la({},V.defaultProps),{},{data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!0,sampler:{},compressed:!1,usage:0,mipLevels:void 0,samples:void 0,type:void 0});se.COPY_SRC=1;se.COPY_DST=2;se.TEXTURE_BINDING=4;se.STORAGE_BINDING=8;se.RENDER_ATTACHMENT=16;var Ta;function Ra(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function da(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ra(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ra(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ts(e){var t=As();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function As(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}Ta=Symbol.toStringTag;var Zt=function(e){D(r,e);var t=Ts(r);function r(n,o){var i;return m(this,r),i=t.call(this,n,o,r.defaultProps),i.stage=void 0,i.source=void 0,i.stage=i.props.stage,i.source=i.props.source,i}return I(r,[{key:Ta,get:function(){return"Shader"}}]),r}(V);Zt.defaultProps=da(da({},V.defaultProps),{},{stage:"vertex",source:"",sourceMap:null,language:"auto",shaderType:0});var ha;function Aa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function pa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Aa(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Aa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ps(e){var t=hs();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function hs(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}ha=Symbol.toStringTag;var Qt=function(e){D(r,e);var t=ps(r);function r(n,o){return m(this,r),t.call(this,n,o,r.defaultProps)}return I(r,[{key:ha,get:function(){return"Sampler"}}]),r}(V);Qt.defaultProps=pa(pa({},V.defaultProps),{},{type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"nearest",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});var ga;function Sa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Sa(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ss(e){var t=gs();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function gs(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}ga=Symbol.toStringTag;var it=function(e){D(r,e);var t=Ss(r);function r(o){var i,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return m(this,r),i=t.call(this,o,s,r.defaultProps),i.width=void 0,i.height=void 0,i.colorAttachments=[],i.depthStencilAttachment=null,i.width=i.props.width,i.height=i.props.height,i}var n=r.prototype;return n.resize=function(i){var s=!i;if(i){var f=Array.isArray(i)?i:[i.width,i.height],_=L(f,2),u=_[0],l=_[1];s=s||l!==this.height||u!==this.width,this.width=u,this.height=l}s&&(C.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(this.width,"x").concat(this.height))(),this.resizeAttachments(this.width,this.height))},n.autoCreateAttachmentTextures=function(){var i=this;if(this.colorAttachments=this.props.colorAttachments.map(function(f){if(typeof f=="string"){var _=i.createColorTexture(f);return i.attachResource(_),_}return f}),this.props.depthStencilAttachment)if(typeof this.props.depthStencilAttachment=="string"){var s=this.createDepthStencilTexture(this.props.depthStencilAttachment);this.attachResource(s),this.depthStencilAttachment=s}else this.depthStencilAttachment=this.props.depthStencilAttachment},n.createColorTexture=function(i){return this.device.createTexture({id:"color-attachment",usage:se.RENDER_ATTACHMENT,format:i,width:this.width,height:this.height})},n.createDepthStencilTexture=function(i){return this.device.createTexture({id:"depth-stencil-attachment",usage:se.RENDER_ATTACHMENT,format:i,width:this.width,height:this.height})},n.resizeAttachments=function(i,s){for(var f=0;f<this.colorAttachments.length;++f)if(this.colorAttachments[f]){var _=this.device._createTexture(at(at({},this.colorAttachments[f].props),{},{width:i,height:s}));this.destroyAttachedResource(this.colorAttachments[f]),this.colorAttachments[f]=_,this.attachResource(_)}if(this.depthStencilAttachment){var u=this.device._createTexture(at(at({},this.depthStencilAttachment.props),{},{width:i,height:s}));this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=u,this.attachResource(u)}},I(r,[{key:ga,get:function(){return"Framebuffer"}}]),r}(V);it.defaultProps=at(at({},V.defaultProps),{},{width:1,height:1,colorAttachments:[],depthStencilAttachment:null});var ba;function Oa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function va(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Oa(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Os(e){var t=vs();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function vs(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}ba=Symbol.toStringTag;var qt=function(e){D(r,e);var t=Os(r);function r(n,o){var i;return m(this,r),i=t.call(this,n,o,r.defaultProps),i.hash="",i.vs=void 0,i.fs=void 0,i.shaderLayout=void 0,i.bufferLayout=void 0,i.shaderLayout=i.props.shaderLayout,i.bufferLayout=i.props.bufferLayout||[],i}return I(r,[{key:ba,get:function(){return"RenderPipeline"}}]),r}(V);qt.defaultProps=va(va({},V.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});var ma;function Na(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ca(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Na(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Na(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bs(e){var t=Ns();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function Ns(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}ma=Symbol.toStringTag;var Jt=function(e){D(r,e);var t=bs(r);function r(n,o){return m(this,r),t.call(this,n,o,r.defaultProps)}return I(r,[{key:ma,get:function(){return"RenderPass"}}]),r}(V);Jt.defaultProps=Ca(Ca({},V.defaultProps),{},{framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1});var Pa;function Ia(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ya(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ia(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ia(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Cs(e){var t=ms();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function ms(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}Pa=Symbol.toStringTag;var er=function(e){D(r,e);var t=Cs(r);function r(o,i){return m(this,r),t.call(this,o,i,r.defaultProps)}var n=r.prototype;return n.pushDebugGroup=function(i){},n.popDebugGroup=function(){},n.insertDebugMarker=function(i){},I(r,[{key:Pa,get:function(){return"CommandEncoder"}}]),r}(V);er.defaultProps=ya(ya({},V.defaultProps),{},{measureExecutionTime:void 0});var Ba;function Fa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Is(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fa(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ys(e){var t=Ps();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function Ps(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}Ba=Symbol.toStringTag;var tr=function(e){D(r,e);var t=ys(r);function r(n,o){return m(this,r),t.call(this,n,o,r.defaultProps)}return I(r,[{key:Ba,get:function(){return"CommandBuffer"}}]),r}(V);tr.defaultProps=Is({},V.defaultProps);function Ma(e){var t=L(Bs[e],2),r=t[0],n=t[1],o=r==="i32"||r==="u32",i=r!=="u32",s=Ms[r]*n,f=Fs(r,n);return{dataType:r,components:n,defaultVertexFormat:f,byteLength:s,integer:o,signed:i}}function Fs(e,t){var r;switch(e){case"f32":r="float32";break;case"i32":r="sint32";break;case"u32":r="uint32";break;case"f16":return t<=2?"float16x2":"float16x4"}return t===1?r:"".concat(r,"x").concat(t)}var Bs={f32:["f32",1],"vec2<f32>":["f32",2],"vec3<f32>":["f32",3],"vec4<f32>":["f32",4],f16:["f16",1],"vec2<f16>":["f16",2],"vec3<f16>":["f16",3],"vec4<f16>":["f16",4],i32:["i32",1],"vec2<i32>":["i32",2],"vec3<i32>":["i32",3],"vec4<i32>":["i32",4],u32:["u32",1],"vec2<u32>":["u32",2],"vec3<u32>":["u32",3],"vec4<u32>":["u32",4]},Ms={f32:4,f16:2,i32:4,u32:4};function rr(e){var t=Da[e],r=Ds(t),n=e.includes("norm"),o=!n&&!e.startsWith("float"),i=e.startsWith("s");return{dataType:Da[e],byteLength:r,integer:o,signed:i,normalized:n}}function Ds(e){var t=xs[e];return t}var Da={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},xs={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function Xr(e){var t;e.endsWith("-webgl")&&(e.replace("-webgl",""),t=!0);var r=e.split("x"),n=L(r,2),o=n[0],i=n[1],s=o,f=i?parseInt(i):1,_=rr(s),u={type:s,components:f,byteLength:_.byteLength*f,integer:_.integer,signed:_.signed,normalized:_.normalized};return t&&(u.webglOnly=!0),u}function xa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Lr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xa(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ot(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Us(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
10
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return i=u.done,u},e:function(u){s=!0,f=u},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(s)throw f}}}}function Us(e,t){if(e){if(typeof e=="string")return Ua(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ua(e,t)}}function Ua(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function wa(e,t){var r={},n=ot(e.attributes),o;try{for(n.s();!(o=n.n()).done;){var i=o.value;r[i.name]=ws(e,t,i.name)}}catch(s){n.e(s)}finally{n.f()}return r}function Xa(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16,n=wa(e,t),o=new Array(r).fill(null),i=0,s=Object.values(n);i<s.length;i++){var f=s[i];o[f.location]=f}return o}function ws(e,t,r){var n=Xs(e,r),o=Ls(t,r);if(!n)return null;var i=Ma(n.type),s=o?.vertexFormat||i.defaultVertexFormat,f=Xr(s);return{attributeName:o?.attributeName||n.name,bufferName:o?.bufferName||n.name,location:n.location,shaderType:n.type,shaderDataType:i.dataType,shaderComponents:i.components,vertexFormat:s,bufferDataType:f.type,bufferComponents:f.components,normalized:f.normalized,integer:i.integer,stepMode:o?.stepMode||n.stepMode,byteOffset:o?.byteOffset||0,byteStride:o?.byteStride||0}}function Xs(e,t){var r=e.attributes.find(function(n){return n.name===t});return r||C.warn('shader layout attribute "'.concat(t,'" not present in shader')),r||null}function Ls(e,t){Hs(e);var r=Ws(e,t);return r||(r=Vs(e,t),r)?r:(C.warn('layout for attribute "'.concat(t,'" not present in buffer layout')),null)}function Hs(e){var t=ot(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&C.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(o){t.e(o)}finally{t.f()}}function Ws(e,t){var r=ot(e),n;try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.format&&o.name===t)return{attributeName:o.name,bufferName:t,stepMode:o.stepMode,vertexFormat:o.format,byteOffset:0,byteStride:o.byteStride||0}}}catch(i){r.e(i)}finally{r.f()}return null}function Vs(e,t){var r=ot(e),n;try{for(r.s();!(n=r.n()).done;){var o,i=n.value,s=i.byteStride;if(typeof i.byteStride!="number"){var f=ot(i.attributes||[]),_;try{for(f.s();!(_=f.n()).done;){var u=_.value,l=Xr(u.format);s+=l.byteLength}}catch(R){f.e(R)}finally{f.f()}}var E=(o=i.attributes)===null||o===void 0?void 0:o.find(function(R){return R.attribute===t});if(E)return{attributeName:E.attribute,bufferName:i.name,stepMode:i.stepMode,vertexFormat:E.format,byteOffset:E.byteOffset,byteStride:s}}}catch(R){r.e(R)}finally{r.f()}return null}function Hr(e,t){var r=Lr(Lr({},e),{},{attributes:e.attributes.map(function(s){return Lr({},s)})}),n=ot(t?.attributes||[]),o;try{var i=function(){var f=o.value,_=r.attributes.find(function(u){return u.name===f.name});_?(_.type=f.type||_.type,_.stepMode=f.stepMode||_.stepMode):C.warn("shader layout attribute ".concat(f.name," not present in shader"))};for(n.s();!(o=n.n()).done;)i()}catch(s){n.e(s)}finally{n.f()}return r}var Wa;function La(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ha(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?La(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):La(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function js(e){var t=Ks();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function Ks(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}Wa=Symbol.toStringTag;var nr=function(e){D(r,e);var t=js(r);function r(n,o){var i;return m(this,r),i=t.call(this,n,o,r.defaultProps),i.maxVertexAttributes=void 0,i.attributeInfos=void 0,i.indexBuffer=null,i.attributes=void 0,i.maxVertexAttributes=n.limits.maxVertexAttributes,i.attributes=new Array(i.maxVertexAttributes).fill(null),i.attributeInfos=Xa(o.renderPipeline.shaderLayout,o.renderPipeline.bufferLayout,i.maxVertexAttributes),i}return I(r,[{key:Wa,get:function(){return"VertexArray"}}]),r}(V);nr.defaultProps=Ha(Ha({},V.defaultProps),{},{renderPipeline:null});var Ka;function Va(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ja(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Va(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Va(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ys(e){var t=ks();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function ks(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}Ka=Symbol.toStringTag;var ar=function(e){D(r,e);var t=Ys(r);function r(n,o){return m(this,r),t.call(this,n,o,r.defaultProps)}return I(r,[{key:Ka,get:function(){return"TransformFeedback"}}]),r}(V);ar.defaultProps=ja(ja({},V.defaultProps),{},{layout:void 0,buffers:{}});function w(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}var ir;function Ya(e){return(!ir||ir.byteLength<e)&&(ir=new ArrayBuffer(e)),ir}function Wr(e,t){var r=Ya(e.BYTES_PER_ELEMENT*t);return new e(r,0,t)}function Vr(e){for(var t=e.target,r=e.source,n=e.start,o=n===void 0?0:n,i=e.count,s=i===void 0?1:i,f=r.length,_=s*f,u=0,l=o;u<f;u++)t[l++]=r[u];for(;u<_;)u<_-u?(t.copyWithin(o+u,o,o+u),u*=2):(t.copyWithin(o+u,o,o+_-u),u=_);return e.target}function ka(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Gs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ka(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ka(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var zs=/^(rg?b?a?)([0-9]*)([a-z]*)(-srgb)?(-webgl|-unsized)?$/;function or(e){var t=zs.exec(e);if(t){var r=L(t,6),n=r[1],o=r[2],i=r[3],s=r[4],f=r[5];if(n){var _="".concat(i).concat(o),u=rr(_);return Gs({format:n,components:0,srgb:s==="-srgb",unsized:f==="-unsized",webgl:f==="-webgl"},u)}}return Zs(e)}var $s={"rgba4unorm-webgl":{format:"rgba",bpp:2},"rgb565unorm-webgl":{format:"rgb",bpp:2},"rgb5a1unorm-webgl":{format:"rgba",bbp:2},rgb9e5ufloat:{format:"rgb",bbp:4},rg11b10ufloat:{format:"rgb",bbp:4},rgb10a2unorm:{format:"rgba",bbp:4},"rgb10a2unorm-webgl":{format:"rgba",bbp:4},stencil8:{components:1,bpp:1,a:"stencil"},depth16unorm:{components:1,bpp:2,a:"depth"},depth24plus:{components:1,bpp:3,a:"depth"},depth32float:{components:1,bpp:4,a:"depth"},"depth24plus-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth24unorm-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth32float-stencil8":{components:2,bpp:4,a:"depth-stencil"}};function Zs(e){var t=$s[e];if(!t)throw new Error("Unknown format ".concat(e));return{format:t.format||"",components:t.components||1,byteLength:t.bpp||1,srgb:!1,unsized:!1}}function Qs(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=qs(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
11
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}
|
|
12
|
-
|
|
7
|
+
var __exports__=(()=>{var Mn=Object.defineProperty;var Bc=Object.getOwnPropertyDescriptor;var Ic=Object.getOwnPropertyNames;var Fc=Object.prototype.hasOwnProperty;var Dc=(e,t)=>{for(var r in t)Mn(e,r,{get:t[r],enumerable:!0})},Cc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ic(t))!Fc.call(e,i)&&i!==r&&Mn(e,i,{get:()=>t[i],enumerable:!(n=Bc(t,i))||n.enumerable});return e};var Wc=e=>Cc(Mn({},"__esModule",{value:!0}),e);var Xv={};Dc(Xv,{Accessor:()=>En,WEBGLBuffer:()=>pe,WEBGLCommandEncoder:()=>Gn,WEBGLFramebuffer:()=>Te,WEBGLRenderPass:()=>Pn,WEBGLRenderPipeline:()=>Ln,WEBGLRenderbuffer:()=>wt,WEBGLResource:()=>pr,WEBGLSampler:()=>ke,WEBGLShader:()=>On,WEBGLTexture:()=>se,WEBGLTransformFeedback:()=>Dn,WEBGLVertexArray:()=>In,WebGLCanvasContext:()=>wn,WebGLDevice:()=>le,WebGLResource:()=>pr,_TEXTURE_FORMATS:()=>Me,_checkFloat32ColorAttachment:()=>on,assertWebGL2Context:()=>ru,assertWebGLContext:()=>Qr,clear:()=>Pc,convertGLToTextureFormat:()=>Ne,copyToTexture:()=>jc,getGLParameters:()=>tn,getShaderLayout:()=>Tn,getWebGL2Context:()=>Xt,isWebGL:()=>mo,isWebGL2:()=>z,polyfillContext:()=>en,popContextState:()=>ge,pushContextState:()=>_e,readPixelsToArray:()=>Ac,readPixelsToBuffer:()=>Lc,registerHeadlessGL:()=>ci,resetGLParameters:()=>bu,setDeviceParameters:()=>fn,setGLParameters:()=>be,trackContextState:()=>er,withDeviceParameters:()=>Nu,withGLParameters:()=>ve});function It(e){return It=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(e)}function ui(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ui(Object(r),!0).forEach(function(n){Mc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ui(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mc(e,t,r){return t=Nc(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nc(e){var t=kc(e,"string");return It(t)==="symbol"?t:String(t)}function kc(e,t){if(It(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(It(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vc="Failed to create WebGL context in Node.js, headless gl returned null",Uc=" luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL contexts can not be created. This may not be an error. For example, this is a typical configuration for isorender applications running on the server.",zc={width:1,height:1,debug:!0,throwOnError:!1},vr=null;function ci(e){vr=e}function si(){return vr!==null}function li(e){e=fi(fi({},zc),e);var t=e,r=t.width,n=t.height,i=t.webgl1,o=t.webgl2;if(o&&!i)throw new Error("headless-gl does not support WebGL2");if(!vr)throw new Error(Uc);var a=vr(r,n,e);if(!a)throw new Error(Vc);return a}function Ft(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function J(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Ft()}var Hc=globalThis.self||globalThis.window||globalThis.global,ze=globalThis.window||globalThis.self||globalThis.global,$c=globalThis.document||{},Be=globalThis.process||{},Xc=globalThis.console,pi=globalThis.navigator||{};var wr=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",tw=J();var Nn=globalThis;function _r(e){if(!e&&!J())return"Node";if(Ft(e))return"Electron";let t=e||pi.userAgent||"";if(t.indexOf("Edge")>-1)return"Edge";let r=t.indexOf("MSIE ")!==-1,n=t.indexOf("Trident/")!==-1;return r||n?"IE":Nn.chrome?"Chrome":Nn.safari?"Safari":Nn.mozInnerScreenX?"Firefox":"Unknown"}function Kc(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Or=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=Kc(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function di(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function hi(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function Sr(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let o=e.width*r,a=e.height*r,u=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),u]}var Pr;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Pr||(Pr={}));var Yc=10;function mi(e){return typeof e!="string"?e:(e=e.toUpperCase(),Pr[e]||Pr.WHITE)}function yi(e,t,r){if(!J&&typeof e=="string"){if(t){let n=mi(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=mi(r);e="\x1B[".concat(n+Yc,"m").concat(e,"\x1B[49m")}}return e}function bi(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=e;for(let o of n){let a=i[o];typeof a=="function"&&(t.find(u=>o===u)||(i[o]=a.bind(e)))}}function He(e,t){if(!e)throw new Error(t||"Assertion failed")}function Ie(){let e;if(J()&&ze.performance){var t,r;e=ze===null||ze===void 0||(t=ze.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Be){var n;let i=Be===null||Be===void 0||(n=Be.hrtime)===null||n===void 0?void 0:n.call(Be);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var $e={debug:J()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},qc={enabled:!0,level:0};function me(){}var gi={},vi={once:!0},Re=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=wr,this._startTs=Ie(),this._deltaTs=Ie(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Or("__probe-".concat(this.id,"__"),qc),this.timeStamp("".concat(this.id," started")),bi(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Ie()-this._startTs).toPrecision(10))}getDelta(){return Number((Ie()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){He(t,r)}warn(t){return this._getLogFunction(0,t,$e.warn,arguments,vi)}error(t){return this._getLogFunction(0,t,$e.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,$e.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,$e.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,$e.debug||$e.info,arguments,vi)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||me,n&&[n],{tag:es(r)}):me}image(t){let{logLevel:r,priority:n,image:i,message:o="",scale:a=1}=t;return this._shouldLog(r||n)?J()?Jc({image:i,message:o,scale:a}):Zc({image:i,message:o,scale:a}):me}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||me)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=wi({logLevel:t,message:r,opts:n}),{collapsed:o}=n;return i.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||me)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=_i(t)}_getLogFunction(t,r,n,i,o){if(this._shouldLog(t)){o=wi({logLevel:t,message:r,args:i,opts:o}),n=n||o.method,He(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Ie();let a=o.tag||o.message;if(o.once&&a)if(!gi[a])gi[a]=Ie();else return me;return r=Qc(this.id,o.message,o),n.bind(console,r,...o.args)}return me}};Re.VERSION=wr;function _i(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return He(Number.isFinite(t)&&t>=0),t}function wi(e){let{logLevel:t,message:r}=e;e.logLevel=_i(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let i=typeof e.message;return He(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function Qc(e,t,r){if(typeof t=="string"){let n=r.time?hi(di(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=yi(t,r.color,r.background)}return t}function Zc(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),me}function Jc(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let o=new Image;return o.onload=()=>{let a=Sr(o,r,n);console.log(...a)},o.src=t,me}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...Sr(t,r,n)),me;if(i.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...Sr(o,r,n)),o.src=t.toDataURL(),me}return me}function es(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Gw=new Re({id:"@probe.gl/log"});var B=new Re({id:"luma.gl"});function Dt(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var Fe=class{constructor(t,r){this.name=void 0,this.type=void 0,this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Dt(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Dt()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var Xe=class{constructor(t){this.id=void 0,this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:n}=t,i=this.stats[r];return i||(t instanceof Fe?i=t:i=new Fe(r,n),this.stats[r]=i),i}};function Ct(e){return Ct=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ct(e)}function Oi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,rs(n.key),n)}}function ts(e,t,r){return t&&Oi(e.prototype,t),r&&Oi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function rs(e){var t=ns(e,"string");return Ct(t)==="symbol"?t:String(t)}function ns(e,t){if(Ct(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ct(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function os(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var is=function(){function e(){os(this,e),this.stats=new Map}var t=e.prototype;return t.getStats=function(n){return this.get(n)},t.get=function(n){return this.stats.has(n)||this.stats.set(n,new Xe({id:n})),this.stats.get(n)},ts(e)}(),xr=new is;function as(){var e=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",t="set luma.log.level=1 (or higher) to trace rendering";if(globalThis.luma&&globalThis.luma.VERSION!==e)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(e));return globalThis.luma||(J()&&B.log(1,"luma.gl ".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:B,stats:xr}),e}var Si=as();function us(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)?e:null}function Pi(e){return Array.isArray(e)?e.length===0||typeof e[0]=="number"?e:null:us(e)}var kn={};function we(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";kn[e]=kn[e]||1;var t=kn[e]++;return"".concat(e,"-").concat(t)}function Er(e){return e>0&&(e&e-1)===0}function Ke(e){var t=!0;for(var r in e){t=!1;break}return t}function Wt(e){return Wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wt(e)}function xi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xi(Object(r),!0).forEach(function(n){cs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cs(e,t,r){return t=Ti(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ei(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ti(n.key),n)}}function ss(e,t,r){return t&&Ei(e.prototype,t),r&&Ei(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ti(e){var t=ls(e,"string");return Wt(t)==="symbol"?t:String(t)}function ls(e,t){if(Wt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Wt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ps(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var K=function(){function e(r,n,i){if(ps(this,e),this.id=void 0,this.props=void 0,this.userData={},this.device=void 0,this._device=void 0,this.destroyed=!1,this.allocatedBytes=0,this._attachedResources=new Set,!r)throw new Error("no device");this._device=r,this.props=ds(n,i);var o=this.props.id!=="undefined"?this.props.id:we(this[Symbol.toStringTag]);this.props.id=o,this.id=o,this.userData=this.props.userData||{},this.addStats()}var t=e.prototype;return t.destroy=function(){this.destroyResource()},t.delete=function(){return this.destroy(),this},t.toString=function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")},t.getProps=function(){return this.props},t.attachResource=function(n){this._attachedResources.add(n)},t.detachResource=function(n){this._attachedResources.delete(n)},t.destroyAttachedResource=function(n){this._attachedResources.delete(n)&&n.destroy()},t.destroyAttachedResources=function(){for(var n=0,i=Object.values(this._attachedResources);n<i.length;n++){var o=i[n];o.destroy()}this._attachedResources=new Set},t.destroyResource=function(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0},t.removeStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),i=this[Symbol.toStringTag];n.get("".concat(i,"s Active")).decrementCount()},t.trackAllocatedMemory=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],o=this._device.statsManager.getStats("Resource Counts");o.get("GPU Memory").addCount(n),o.get("".concat(i," Memory")).addCount(n),this.allocatedBytes=n},t.trackDeallocatedMemory=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],i=this._device.statsManager.getStats("Resource Counts");i.get("GPU Memory").subtractCount(this.allocatedBytes),i.get("".concat(n," Memory")).subtractCount(this.allocatedBytes),this.allocatedBytes=0},t.addStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),i=this[Symbol.toStringTag];n.get("Resources Created").incrementCount(),n.get("".concat(i,"s Created")).incrementCount(),n.get("".concat(i,"s Active")).incrementCount()},ss(e)}();K.defaultProps={id:"undefined",handle:void 0,userData:void 0};function ds(e,t){var r=fs({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}function Ye(e){return Ye=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ye(e)}var ji;function Ai(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Vn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ai(Object(r),!0).forEach(function(n){hs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ai(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hs(e,t,r){return t=Ri(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ms(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Li(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ri(n.key),n)}}function ys(e,t,r){return t&&Li(e.prototype,t),r&&Li(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ri(e){var t=bs(e,"string");return Ye(t)==="symbol"?t:String(t)}function bs(e,t){if(Ye(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ye(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gs(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Un(e,t)}function Un(e,t){return Un=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Un(e,t)}function vs(e){var t=Os();return function(){var n=Tr(e),i;if(t){var o=Tr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ws(this,i)}}function ws(e,t){if(t&&(Ye(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _s(e)}function _s(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Os(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Tr(e){return Tr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Tr(e)}ji=Symbol.toStringTag;var te=function(e){gs(r,e);var t=vs(r);function r(i,o){var a;ms(this,r);var u=Vn({},o);return(o.usage||0)&r.INDEX&&!o.indexType&&(o.data instanceof Uint32Array?u.indexType="uint32":o.data instanceof Uint16Array&&(u.indexType="uint16")),a=t.call(this,i,u,r.defaultProps),a.usage=void 0,a.indexType=void 0,a.byteLength=void 0,a.usage=o.usage||0,a.indexType=u.indexType,a}var n=r.prototype;return n.write=function(o,a){throw new Error("not implemented")},n.readAsync=function(o,a){throw new Error("not implemented")},n.getData=function(){throw new Error("not implemented")},ys(r,[{key:ji,get:function(){return"Buffer"}}]),r}(K);te.defaultProps=Vn(Vn({},K.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});te.MAP_READ=1;te.MAP_WRITE=2;te.COPY_SRC=4;te.COPY_DST=8;te.INDEX=16;te.VERTEX=32;te.UNIFORM=64;te.STORAGE=128;te.INDIRECT=256;te.QUERY_RESOLVE=512;function Mt(e){return Mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mt(e)}var Ii;function Gi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gi(Object(r),!0).forEach(function(n){Ss(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ss(e,t,r){return t=Fi(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ps(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Fi(n.key),n)}}function xs(e,t,r){return t&&Bi(e.prototype,t),r&&Bi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fi(e){var t=Es(e,"string");return Mt(t)==="symbol"?t:String(t)}function Es(e,t){if(Mt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Mt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}Ii=Symbol.toStringTag;var qe=function(){function e(r){Ps(this,e),this.id=void 0,this.statsManager=xr,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=zn(zn({},e.defaultProps),r),this.id=this.props.id||we(this[Symbol.toStringTag].toLowerCase())}var t=e.prototype;return t.loseDevice=function(){return!1},t.getCanvasContext=function(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext},t.createTexture=function(n){return(n instanceof Promise||typeof n=="string")&&(n={data:n}),this._createTexture(n)},t.createCommandEncoder=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};throw new Error("not implemented")},t._getBufferProps=function(n){(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});var i=zn({},n);return(n.usage||0)&te.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?i.indexType="uint32":n.data instanceof Uint16Array?i.indexType="uint16":B.warn("indices buffer content must be of integer type")()),i},xs(e,[{key:Ii,get:function(){return"Device"}}]),e}();qe.defaultProps={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(B.get("debug")),break:[],gl:null};qe.VERSION=Si;function Nt(e){return Nt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt(e)}function Ar(e,t){return Ls(e)||As(e,t)||Vi(e,t)||Ts()}function Ts(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
8
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function As(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function Ls(e){if(Array.isArray(e))return e}function js(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Vi(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
9
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function Vi(e,t){if(e){if(typeof e=="string")return Di(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Di(e,t)}}function Di(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ci(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Wi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ci(Object(r),!0).forEach(function(n){Rs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ci(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rs(e,t,r){return t=Ui(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ui(n.key),n)}}function Bs(e,t,r){return t&&Mi(e.prototype,t),r&&Mi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ui(e){var t=Is(e,"string");return Nt(t)==="symbol"?t:String(t)}function Is(e,t){if(Nt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Nt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fs=J()&&typeof document<"u",Lr=function(){return Fs&&document.readyState==="complete"},Ds={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"},Qe=function(){function e(r){var n=this;if(Gs(this,e),this.device=void 0,this.id=void 0,this.props=void 0,this.canvas=void 0,this.htmlCanvas=void 0,this.offscreenCanvas=void 0,this.type=void 0,this.width=1,this.height=1,this.resizeObserver=void 0,this._canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1},this.props=Wi(Wi({},Ds),r),r=this.props,!J()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(r.canvas)typeof r.canvas=="string"?this.canvas=Ms(r.canvas):this.canvas=r.canvas;else{var i,o,a=Ns(r),u=Ws(((i=r)===null||i===void 0?void 0:i.container)||null);u.insertBefore(a,u.firstChild),this.canvas=a,(o=r)!==null&&o!==void 0&&o.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&r.autoResize&&(this.resizeObserver=new ResizeObserver(function(c){var p=js(c),b;try{for(p.s();!(b=p.n()).done;){var g=b.value;g.target===n.canvas&&n.update()}}catch(v){p.e(v)}finally{p.f()}}),this.resizeObserver.observe(this.canvas))}var t=e.prototype;return t.getDevicePixelRatio=function(n){if(typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(n=n===void 0?this.props.useDevicePixels:n,!n||n<=0))return 1;if(n===!0){var i=typeof window<"u"&&window.devicePixelRatio;return i||1}return n},t.getPixelSize=function(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":var n=this.getDevicePixelRatio(),i=this.canvas;return i.parentElement?[i.clientWidth*n,i.clientHeight*n]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}},t.getAspect=function(){var n=this.getPixelSize(),i=Ar(n,2),o=i[0],a=i[1];return o/a},t.cssToDeviceRatio=function(){try{var n=this.getDrawingBufferSize(),i=Ar(n,1),o=i[0],a=this._canvasSizeInfo.clientWidth;return a?o/a:1}catch{return 1}},t.cssToDevicePixels=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,o=this.cssToDeviceRatio(),a=this.getDrawingBufferSize(),u=Ar(a,2),c=u[0],p=u[1];return ks(n,o,c,p,i)},t.setDevicePixelRatio=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.htmlCanvas){var o="width"in i?i.width:this.htmlCanvas.clientWidth,a="height"in i?i.height:this.htmlCanvas.clientHeight;(!o||!a)&&(B.log(1,"Canvas clientWidth/clientHeight is 0")(),n=1,o=this.htmlCanvas.width||1,a=this.htmlCanvas.height||1);var u=this._canvasSizeInfo;if(u.clientWidth!==o||u.clientHeight!==a||u.devicePixelRatio!==n){var c=n,p=Math.floor(o*c),b=Math.floor(a*c);this.htmlCanvas.width=p,this.htmlCanvas.height=b;var g=this.getDrawingBufferSize(),v=Ar(g,2),O=v[0],w=v[1];(O!==p||w!==b)&&(c=Math.min(O/o,w/a),this.htmlCanvas.width=Math.floor(o*c),this.htmlCanvas.height=Math.floor(a*c),B.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=o,this._canvasSizeInfo.clientHeight=a,this._canvasSizeInfo.devicePixelRatio=n}}},t.getDrawingBufferSize=function(){var n=this.device.gl;if(!n)throw new Error("canvas size");return[n.drawingBufferWidth,n.drawingBufferHeight]},t._setAutoCreatedCanvasId=function(n){var i;((i=this.htmlCanvas)===null||i===void 0?void 0:i.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=n)},Bs(e,null,[{key:"isPageLoaded",get:function(){return Lr()}}]),e}();Qe.pageLoaded=Cs();function Cs(){return Lr()||typeof window>"u"?Promise.resolve():new Promise(function(e){window.addEventListener("load",function(){return e()})})}function Ws(e){if(typeof e=="string"){var t=document.getElementById(e);if(!t&&!Lr())throw new Error("Accessing '".concat(e,"' before page was loaded"));if(!t)throw new Error("".concat(e," is not an HTML element"));return t}else if(e)return e;return document.body}function Ms(e){var t=document.getElementById(e);if(!t&&!Lr())throw new Error("Accessing '".concat(e,"' before page was loaded"));if(!(t instanceof HTMLCanvasElement))throw new Error("'".concat(t,"' is not a canvas element"));return t}function Ns(e){var t=e.width,r=e.height,n=document.createElement("canvas");return n.id="lumagl-auto-created-canvas",n.width=t||1,n.height=r||1,n.style.width=Number.isFinite(t)?"".concat(t,"px"):"100%",n.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",n}function ks(e,t,r,n,i){var o=e,a=Ni(o[0],t,r),u=ki(o[1],t,n,i),c=Ni(o[0]+1,t,r),p=c===r-1?c:c-1;c=ki(o[1]+1,t,n,i);var b;return i?(c=c===0?c:c+1,b=u,u=c):b=c===n-1?c:c-1,{x:a,y:u,width:Math.max(p-a+1,1),height:Math.max(b-u+1,1)}}function Ni(e,t,r){var n=Math.min(Math.round(e*t),r-1);return n}function ki(e,t,r,n){return n?Math.max(0,r-1-Math.round(e*t)):Math.min(Math.round(e*t),r-1)}function Ze(e){return Ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ze(e)}var Xi;function zi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Hi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zi(Object(r),!0).forEach(function(n){Vs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vs(e,t,r){return t=Ki(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Us(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ki(n.key),n)}}function zs(e,t,r){return t&&$i(e.prototype,t),r&&$i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ki(e){var t=Hs(e,"string");return Ze(t)==="symbol"?t:String(t)}function Hs(e,t){if(Ze(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ze(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $s(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hn(e,t)}function Hn(e,t){return Hn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Hn(e,t)}function Xs(e){var t=qs();return function(){var n=jr(e),i;if(t){var o=jr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ks(this,i)}}function Ks(e,t){if(t&&(Ze(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ys(e)}function Ys(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qs(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jr(e){return jr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},jr(e)}Xi=Symbol.toStringTag;var ae=function(e){$s(r,e);var t=Xs(r);function r(n,i){var o,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.defaultProps;return Us(this,r),o=t.call(this,n,i,a),o.dimension=void 0,o.format=void 0,o.width=void 0,o.height=void 0,o.depth=void 0,o.sampler=void 0,o.dimension=o.props.dimension,o.format=o.props.format,o.width=o.props.width,o.height=o.props.height,o.depth=o.props.depth,o}return zs(r,[{key:Xi,get:function(){return"Texture"}}]),r}(K);ae.defaultProps=Hi(Hi({},K.defaultProps),{},{data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!0,sampler:{},compressed:!1,usage:0,mipLevels:void 0,samples:void 0,type:void 0});ae.COPY_SRC=1;ae.COPY_DST=2;ae.TEXTURE_BINDING=4;ae.STORAGE_BINDING=8;ae.RENDER_ATTACHMENT=16;function Je(e){return Je=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Je(e)}var Zi;function Yi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function qi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yi(Object(r),!0).forEach(function(n){Qs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qs(e,t,r){return t=Ji(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ji(n.key),n)}}function Js(e,t,r){return t&&Qi(e.prototype,t),r&&Qi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ji(e){var t=el(e,"string");return Je(t)==="symbol"?t:String(t)}function el(e,t){if(Je(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Je(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$n(e,t)}function $n(e,t){return $n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},$n(e,t)}function rl(e){var t=il();return function(){var n=Rr(e),i;if(t){var o=Rr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return nl(this,i)}}function nl(e,t){if(t&&(Je(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ol(e)}function ol(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function il(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Rr(e){return Rr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rr(e)}Zi=Symbol.toStringTag;var Gr=function(e){tl(r,e);var t=rl(r);function r(n,i){var o;return Zs(this,r),o=t.call(this,n,i,r.defaultProps),o.stage=void 0,o.source=void 0,o.stage=o.props.stage,o.source=o.props.source,o}return Js(r,[{key:Zi,get:function(){return"Shader"}}]),r}(K);Gr.defaultProps=qi(qi({},K.defaultProps),{},{stage:"vertex",source:"",sourceMap:null,language:"auto",shaderType:0});function et(e){return et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(e)}var na;function ea(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ta(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ea(Object(r),!0).forEach(function(n){al(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ea(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function al(e,t,r){return t=oa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ul(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ra(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,oa(n.key),n)}}function fl(e,t,r){return t&&ra(e.prototype,t),r&&ra(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function oa(e){var t=cl(e,"string");return et(t)==="symbol"?t:String(t)}function cl(e,t){if(et(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(et(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xn(e,t)}function Xn(e,t){return Xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Xn(e,t)}function ll(e){var t=hl();return function(){var n=Br(e),i;if(t){var o=Br(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return pl(this,i)}}function pl(e,t){if(t&&(et(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dl(e)}function dl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hl(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Br(e){return Br=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Br(e)}na=Symbol.toStringTag;var Ir=function(e){sl(r,e);var t=ll(r);function r(n,i){return ul(this,r),t.call(this,n,i,r.defaultProps)}return fl(r,[{key:na,get:function(){return"Sampler"}}]),r}(K);Ir.defaultProps=ta(ta({},K.defaultProps),{},{type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"nearest",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});function rt(e){return rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rt(e)}var fa;function ia(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ia(Object(r),!0).forEach(function(n){ml(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ia(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ml(e,t,r){return t=ca(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yl(e,t){return wl(e)||vl(e,t)||gl(e,t)||bl()}function bl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
10
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gl(e,t){if(e){if(typeof e=="string")return aa(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return aa(e,t)}}function aa(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function vl(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function wl(e){if(Array.isArray(e))return e}function _l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ua(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ca(n.key),n)}}function Ol(e,t,r){return t&&ua(e.prototype,t),r&&ua(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ca(e){var t=Sl(e,"string");return rt(t)==="symbol"?t:String(t)}function Sl(e,t){if(rt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(rt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kn(e,t)}function Kn(e,t){return Kn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Kn(e,t)}function xl(e){var t=Al();return function(){var n=Fr(e),i;if(t){var o=Fr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return El(this,i)}}function El(e,t){if(t&&(rt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Tl(e)}function Tl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Al(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Fr(e){return Fr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Fr(e)}fa=Symbol.toStringTag;var nt=function(e){Pl(r,e);var t=xl(r);function r(i){var o,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return _l(this,r),o=t.call(this,i,a,r.defaultProps),o.width=void 0,o.height=void 0,o.colorAttachments=[],o.depthStencilAttachment=null,o.width=o.props.width,o.height=o.props.height,o}var n=r.prototype;return n.resize=function(o){var a=!o;if(o){var u=Array.isArray(o)?o:[o.width,o.height],c=yl(u,2),p=c[0],b=c[1];a=a||b!==this.height||p!==this.width,this.width=p,this.height=b}a&&(B.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(this.width,"x").concat(this.height))(),this.resizeAttachments(this.width,this.height))},n.autoCreateAttachmentTextures=function(){var o=this;if(this.colorAttachments=this.props.colorAttachments.map(function(u){if(typeof u=="string"){var c=o.createColorTexture(u);return o.attachResource(c),c}return u}),this.props.depthStencilAttachment)if(typeof this.props.depthStencilAttachment=="string"){var a=this.createDepthStencilTexture(this.props.depthStencilAttachment);this.attachResource(a),this.depthStencilAttachment=a}else this.depthStencilAttachment=this.props.depthStencilAttachment},n.createColorTexture=function(o){return this.device.createTexture({id:"color-attachment",usage:ae.RENDER_ATTACHMENT,format:o,width:this.width,height:this.height})},n.createDepthStencilTexture=function(o){return this.device.createTexture({id:"depth-stencil-attachment",usage:ae.RENDER_ATTACHMENT,format:o,width:this.width,height:this.height})},n.resizeAttachments=function(o,a){for(var u=0;u<this.colorAttachments.length;++u)if(this.colorAttachments[u]){var c=this.device._createTexture(tt(tt({},this.colorAttachments[u].props),{},{width:o,height:a}));this.destroyAttachedResource(this.colorAttachments[u]),this.colorAttachments[u]=c,this.attachResource(c)}if(this.depthStencilAttachment){var p=this.device._createTexture(tt(tt({},this.depthStencilAttachment.props),{},{width:o,height:a}));this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=p,this.attachResource(p)}},Ol(r,[{key:fa,get:function(){return"Framebuffer"}}]),r}(K);nt.defaultProps=tt(tt({},K.defaultProps),{},{width:1,height:1,colorAttachments:[],depthStencilAttachment:null});function ot(e){return ot=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ot(e)}var da;function sa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function la(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sa(Object(r),!0).forEach(function(n){Ll(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ll(e,t,r){return t=ha(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pa(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ha(n.key),n)}}function Rl(e,t,r){return t&&pa(e.prototype,t),r&&pa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ha(e){var t=Gl(e,"string");return ot(t)==="symbol"?t:String(t)}function Gl(e,t){if(ot(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ot(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yn(e,t)}function Yn(e,t){return Yn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Yn(e,t)}function Il(e){var t=Cl();return function(){var n=Dr(e),i;if(t){var o=Dr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Fl(this,i)}}function Fl(e,t){if(t&&(ot(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Dl(e)}function Dl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cl(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Dr(e){return Dr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Dr(e)}da=Symbol.toStringTag;var Cr=function(e){Bl(r,e);var t=Il(r);function r(n,i){var o;return jl(this,r),o=t.call(this,n,i,r.defaultProps),o.hash="",o.vs=void 0,o.fs=void 0,o.shaderLayout=void 0,o.bufferLayout=void 0,o.shaderLayout=o.props.shaderLayout,o.bufferLayout=o.props.bufferLayout||[],o}return Rl(r,[{key:da,get:function(){return"RenderPipeline"}}]),r}(K);Cr.defaultProps=la(la({},K.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});function it(e){return it=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},it(e)}var ga;function ma(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ya(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ma(Object(r),!0).forEach(function(n){Wl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ma(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wl(e,t,r){return t=va(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ml(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ba(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,va(n.key),n)}}function Nl(e,t,r){return t&&ba(e.prototype,t),r&&ba(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function va(e){var t=kl(e,"string");return it(t)==="symbol"?t:String(t)}function kl(e,t){if(it(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(it(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qn(e,t)}function qn(e,t){return qn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},qn(e,t)}function Ul(e){var t=$l();return function(){var n=Wr(e),i;if(t){var o=Wr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return zl(this,i)}}function zl(e,t){if(t&&(it(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Hl(e)}function Hl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $l(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Wr(e){return Wr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wr(e)}ga=Symbol.toStringTag;var Mr=function(e){Vl(r,e);var t=Ul(r);function r(n,i){return Ml(this,r),t.call(this,n,i,r.defaultProps)}return Nl(r,[{key:ga,get:function(){return"RenderPass"}}]),r}(K);Mr.defaultProps=ya(ya({},K.defaultProps),{},{framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1});function at(e){return at=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},at(e)}var Sa;function wa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _a(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wa(Object(r),!0).forEach(function(n){Xl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xl(e,t,r){return t=Pa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oa(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Pa(n.key),n)}}function Yl(e,t,r){return t&&Oa(e.prototype,t),r&&Oa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pa(e){var t=ql(e,"string");return at(t)==="symbol"?t:String(t)}function ql(e,t){if(at(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(at(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ql(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qn(e,t)}function Qn(e,t){return Qn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Qn(e,t)}function Zl(e){var t=tp();return function(){var n=Nr(e),i;if(t){var o=Nr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Jl(this,i)}}function Jl(e,t){if(t&&(at(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ep(e)}function ep(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Nr(e){return Nr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Nr(e)}Sa=Symbol.toStringTag;var kr=function(e){Ql(r,e);var t=Zl(r);function r(i,o){return Kl(this,r),t.call(this,i,o,r.defaultProps)}var n=r.prototype;return n.pushDebugGroup=function(o){},n.popDebugGroup=function(){},n.insertDebugMarker=function(o){},Yl(r,[{key:Sa,get:function(){return"CommandEncoder"}}]),r}(K);kr.defaultProps=_a(_a({},K.defaultProps),{},{measureExecutionTime:void 0});function ut(e){return ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(e)}var Ta;function xa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function rp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xa(Object(r),!0).forEach(function(n){np(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function np(e,t,r){return t=Aa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function op(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ea(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Aa(n.key),n)}}function ip(e,t,r){return t&&Ea(e.prototype,t),r&&Ea(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Aa(e){var t=ap(e,"string");return ut(t)==="symbol"?t:String(t)}function ap(e,t){if(ut(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ut(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function up(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zn(e,t)}function Zn(e,t){return Zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Zn(e,t)}function fp(e){var t=lp();return function(){var n=Vr(e),i;if(t){var o=Vr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return cp(this,i)}}function cp(e,t){if(t&&(ut(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sp(e)}function sp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vr(e){return Vr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Vr(e)}Ta=Symbol.toStringTag;var Ur=function(e){up(r,e);var t=fp(r);function r(n,i){return op(this,r),t.call(this,n,i,r.defaultProps)}return ip(r,[{key:Ta,get:function(){return"CommandBuffer"}}]),r}(K);Ur.defaultProps=rp({},K.defaultProps);function pp(e,t){return yp(e)||mp(e,t)||hp(e,t)||dp()}function dp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
11
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hp(e,t){if(e){if(typeof e=="string")return La(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return La(e,t)}}function La(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mp(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function yp(e){if(Array.isArray(e))return e}function ja(e){var t=pp(gp[e],2),r=t[0],n=t[1],i=r==="i32"||r==="u32",o=r!=="u32",a=vp[r]*n,u=bp(r,n);return{dataType:r,components:n,defaultVertexFormat:u,byteLength:a,integer:i,signed:o}}function bp(e,t){var r;switch(e){case"f32":r="float32";break;case"i32":r="sint32";break;case"u32":r="uint32";break;case"f16":return t<=2?"float16x2":"float16x4"}return t===1?r:"".concat(r,"x").concat(t)}var gp={f32:["f32",1],"vec2<f32>":["f32",2],"vec3<f32>":["f32",3],"vec4<f32>":["f32",4],f16:["f16",1],"vec2<f16>":["f16",2],"vec3<f16>":["f16",3],"vec4<f16>":["f16",4],i32:["i32",1],"vec2<i32>":["i32",2],"vec3<i32>":["i32",3],"vec4<i32>":["i32",4],u32:["u32",1],"vec2<u32>":["u32",2],"vec3<u32>":["u32",3],"vec4<u32>":["u32",4]},vp={f32:4,f16:2,i32:4,u32:4};function zr(e){var t=Ra[e],r=wp(t),n=e.includes("norm"),i=!n&&!e.startsWith("float"),o=e.startsWith("s");return{dataType:Ra[e],byteLength:r,integer:i,signed:o,normalized:n}}function wp(e){var t=_p[e];return t}var Ra={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},_p={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function Op(e,t){return Ep(e)||xp(e,t)||Pp(e,t)||Sp()}function Sp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
12
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pp(e,t){if(e){if(typeof e=="string")return Ga(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ga(e,t)}}function Ga(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xp(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function Ep(e){if(Array.isArray(e))return e}function Jn(e){var t;e.endsWith("-webgl")&&(e.replace("-webgl",""),t=!0);var r=e.split("x"),n=Op(r,2),i=n[0],o=n[1],a=i,u=o?parseInt(o):1,c=zr(a),p={type:a,components:u,byteLength:c.byteLength*u,integer:c.integer,signed:c.signed,normalized:c.normalized};return t&&(p.webglOnly=!0),p}function kt(e){return kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kt(e)}function Ba(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function eo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ba(Object(r),!0).forEach(function(n){Tp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ba(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tp(e,t,r){return t=Ap(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ap(e){var t=Lp(e,"string");return kt(t)==="symbol"?t:String(t)}function Lp(e,t){if(kt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(kt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ft(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=jp(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
13
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function jp(e,t){if(e){if(typeof e=="string")return Ia(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ia(e,t)}}function Ia(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Fa(e,t){var r={},n=ft(e.attributes),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;r[o.name]=Rp(e,t,o.name)}}catch(a){n.e(a)}finally{n.f()}return r}function Da(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16,n=Fa(e,t),i=new Array(r).fill(null),o=0,a=Object.values(n);o<a.length;o++){var u=a[o];i[u.location]=u}return i}function Rp(e,t,r){var n=Gp(e,r),i=Bp(t,r);if(!n)return null;var o=ja(n.type),a=i?.vertexFormat||o.defaultVertexFormat,u=Jn(a);return{attributeName:i?.attributeName||n.name,bufferName:i?.bufferName||n.name,location:n.location,shaderType:n.type,shaderDataType:o.dataType,shaderComponents:o.components,vertexFormat:a,bufferDataType:u.type,bufferComponents:u.components,normalized:u.normalized,integer:o.integer,stepMode:i?.stepMode||n.stepMode,byteOffset:i?.byteOffset||0,byteStride:i?.byteStride||0}}function Gp(e,t){var r=e.attributes.find(function(n){return n.name===t});return r||B.warn('shader layout attribute "'.concat(t,'" not present in shader')),r||null}function Bp(e,t){Ip(e);var r=Fp(e,t);return r||(r=Dp(e,t),r)?r:(B.warn('layout for attribute "'.concat(t,'" not present in buffer layout')),null)}function Ip(e){var t=ft(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&B.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(i){t.e(i)}finally{t.f()}}function Fp(e,t){var r=ft(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.format&&i.name===t)return{attributeName:i.name,bufferName:t,stepMode:i.stepMode,vertexFormat:i.format,byteOffset:0,byteStride:i.byteStride||0}}}catch(o){r.e(o)}finally{r.f()}return null}function Dp(e,t){var r=ft(e),n;try{for(r.s();!(n=r.n()).done;){var i,o=n.value,a=o.byteStride;if(typeof o.byteStride!="number"){var u=ft(o.attributes||[]),c;try{for(u.s();!(c=u.n()).done;){var p=c.value,b=Jn(p.format);a+=b.byteLength}}catch(v){u.e(v)}finally{u.f()}}var g=(i=o.attributes)===null||i===void 0?void 0:i.find(function(v){return v.attribute===t});if(g)return{attributeName:g.attribute,bufferName:o.name,stepMode:o.stepMode,vertexFormat:g.format,byteOffset:g.byteOffset,byteStride:a}}}catch(v){r.e(v)}finally{r.f()}return null}function to(e,t){var r=eo(eo({},e),{},{attributes:e.attributes.map(function(a){return eo({},a)})}),n=ft(t?.attributes||[]),i;try{var o=function(){var u=i.value,c=r.attributes.find(function(p){return p.name===u.name});c?(c.type=u.type||c.type,c.stepMode=u.stepMode||c.stepMode):B.warn("shader layout attribute ".concat(u.name," not present in shader"))};for(n.s();!(i=n.n()).done;)o()}catch(a){n.e(a)}finally{n.f()}return r}function ct(e){return ct=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ct(e)}var Na;function Ca(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Wa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ca(Object(r),!0).forEach(function(n){Cp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ca(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Cp(e,t,r){return t=ka(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ma(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ka(n.key),n)}}function Mp(e,t,r){return t&&Ma(e.prototype,t),r&&Ma(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ka(e){var t=Np(e,"string");return ct(t)==="symbol"?t:String(t)}function Np(e,t){if(ct(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ct(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kp(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ro(e,t)}function ro(e,t){return ro=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ro(e,t)}function Vp(e){var t=Hp();return function(){var n=Hr(e),i;if(t){var o=Hr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Up(this,i)}}function Up(e,t){if(t&&(ct(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zp(e)}function zp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Hr(e){return Hr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Hr(e)}Na=Symbol.toStringTag;var $r=function(e){kp(r,e);var t=Vp(r);function r(n,i){var o;return Wp(this,r),o=t.call(this,n,i,r.defaultProps),o.maxVertexAttributes=void 0,o.attributeInfos=void 0,o.indexBuffer=null,o.attributes=void 0,o.maxVertexAttributes=n.limits.maxVertexAttributes,o.attributes=new Array(o.maxVertexAttributes).fill(null),o.attributeInfos=Da(i.renderPipeline.shaderLayout,i.renderPipeline.bufferLayout,o.maxVertexAttributes),o}return Mp(r,[{key:Na,get:function(){return"VertexArray"}}]),r}(K);$r.defaultProps=Wa(Wa({},K.defaultProps),{},{renderPipeline:null});function st(e){return st=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(e)}var Ha;function Va(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ua(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Va(Object(r),!0).forEach(function(n){$p(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Va(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $p(e,t,r){return t=$a(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function za(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$a(n.key),n)}}function Kp(e,t,r){return t&&za(e.prototype,t),r&&za(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $a(e){var t=Yp(e,"string");return st(t)==="symbol"?t:String(t)}function Yp(e,t){if(st(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(st(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qp(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&no(e,t)}function no(e,t){return no=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},no(e,t)}function Qp(e){var t=ed();return function(){var n=Xr(e),i;if(t){var o=Xr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Zp(this,i)}}function Zp(e,t){if(t&&(st(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jp(e)}function Jp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ed(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Xr(e){return Xr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Xr(e)}Ha=Symbol.toStringTag;var Kr=function(e){qp(r,e);var t=Qp(r);function r(n,i){return Xp(this,r),t.call(this,n,i,r.defaultProps)}return Kp(r,[{key:Ha,get:function(){return"TransformFeedback"}}]),r}(K);Kr.defaultProps=Ua(Ua({},K.defaultProps),{},{layout:void 0,buffers:{}});function M(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}var Yr;function Xa(e){return(!Yr||Yr.byteLength<e)&&(Yr=new ArrayBuffer(e)),Yr}function oo(e,t){var r=Xa(e.BYTES_PER_ELEMENT*t);return new e(r,0,t)}function io(e){for(var t=e.target,r=e.source,n=e.start,i=n===void 0?0:n,o=e.count,a=o===void 0?1:o,u=r.length,c=a*u,p=0,b=i;p<u;p++)t[b++]=r[p];for(;p<c;)p<c-p?(t.copyWithin(i+p,i,i+p),p*=2):(t.copyWithin(i+p,i,i+c-p),p=c);return e.target}function Vt(e){return Vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vt(e)}function Ka(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function td(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ka(Object(r),!0).forEach(function(n){rd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ka(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rd(e,t,r){return t=nd(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nd(e){var t=od(e,"string");return Vt(t)==="symbol"?t:String(t)}function od(e,t){if(Vt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Vt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function id(e,t){return cd(e)||fd(e,t)||ud(e,t)||ad()}function ad(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
14
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ud(e,t){if(e){if(typeof e=="string")return Ya(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ya(e,t)}}function Ya(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fd(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function cd(e){if(Array.isArray(e))return e}var sd=/^(rg?b?a?)([0-9]*)([a-z]*)(-srgb)?(-webgl|-unsized)?$/;function qr(e){var t=sd.exec(e);if(t){var r=id(t,6),n=r[1],i=r[2],o=r[3],a=r[4],u=r[5];if(n){var c="".concat(o).concat(i),p=zr(c);return td({format:n,components:0,srgb:a==="-srgb",unsized:u==="-unsized",webgl:u==="-webgl"},p)}}return pd(e)}var ld={"rgba4unorm-webgl":{format:"rgba",bpp:2},"rgb565unorm-webgl":{format:"rgb",bpp:2},"rgb5a1unorm-webgl":{format:"rgba",bbp:2},rgb9e5ufloat:{format:"rgb",bbp:4},rg11b10ufloat:{format:"rgb",bbp:4},rgb10a2unorm:{format:"rgba",bbp:4},"rgb10a2unorm-webgl":{format:"rgba",bbp:4},stencil8:{components:1,bpp:1,a:"stencil"},depth16unorm:{components:1,bpp:2,a:"depth"},depth24plus:{components:1,bpp:3,a:"depth"},depth32float:{components:1,bpp:4,a:"depth"},"depth24plus-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth24unorm-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth32float-stencil8":{components:2,bpp:4,a:"depth-stencil"}};function pd(e){var t=ld[e];if(!t)throw new Error("Unknown format ".concat(e));return{format:t.format||"",components:t.components||1,byteLength:t.bpp||1,srgb:!1,unsized:!1}}function dd(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=hd(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
15
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function hd(e,t){if(e){if(typeof e=="string")return qa(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qa(e,t)}}function qa(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ao(e,t,r){var n=t.split(/\r?\n/),i="",o=dd(e),a;try{for(o.s();!(a=o.n()).done;){var u=a.value;i+=md(u,n,u.lineNum,r)}}catch(c){o.e(c)}finally{o.f()}return i}function md(e,t,r,n){if(n!=null&&n.showSourceCode){var i=e.linePos>0?"".concat(" ".repeat(e.linePos+5),`^^^
|
|
16
|
+
`):"",o=yd(t,r);return"".concat(o).concat(i).concat(e.type.toUpperCase(),": ").concat(e.message,`
|
|
13
17
|
|
|
14
18
|
`)}return"".concat(e.type.toUpperCase(),": ").concat(e.message,`
|
|
15
|
-
`)}function
|
|
16
|
-
`))}return r}function tf(e,t){for(var r="",n=e.length;n<t;++n)r+=" ";return r+e}function za(e){return ea(e)!==null||typeof e=="number"||typeof e=="boolean"}function Kr(e){var t={bindings:{},uniforms:{}};return Object.keys(e).forEach(function(r){var n=e[r];za(n)?t.uniforms[r]=n:t.bindings[r]=n}),t}function Yr(e,t,r,n){var o="See luma.gl ".concat(r," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),i=Object.getPrototypeOf(e);n.forEach(function(s){i.methodName||(i[s]=function(){throw C.removed("Calling removed method ".concat(t,".").concat(s,": "),o)(),new Error(s)})})}function kr(e,t,r){var n=r.removedProps,o=n===void 0?{}:n,i=r.deprecatedProps,s=i===void 0?{}:i,f=r.replacedProps,_=f===void 0?{}:f;for(var u in o)if(u in t){var l=o[u],E=l?"".concat(e,".").concat(o[u]):"N/A";C.removed("".concat(e,".").concat(u),E)()}for(var R in s)if(R in t){var d=s[R];C.deprecated("".concat(e,".").concat(R),"".concat(e,".").concat(d))()}for(var T=null,h=0,b=Object.entries(_);h<b.length;h++){var v=L(b[h],2),y=v[0],P=v[1];y in t&&(C.deprecated("".concat(e,".").concat(y),"".concat(e,".").concat(P))(),T=T||Object.assign({},t),T[P]=t[y],delete T[y])}return T||t}var gt=Le(we(),1),rf="";function $r(e,t){return Gr.apply(this,arguments)}function Gr(){return Gr=oe(gt.default.mark(function e(t,r){return gt.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",new Promise(function(i,s){try{var f=new Image;f.onload=function(){return i(f)},f.onerror=function(){return s(new Error("Could not load image ".concat(t,".")))},f.crossOrigin=r?.crossOrigin||"anonymous",f.src=t.startsWith("http")?t:rf+t}catch(_){s(_)}}));case 1:case"end":return o.stop()}},e)})),Gr.apply(this,arguments)}function Ot(e,t){return zr.apply(this,arguments)}function zr(){return zr=oe(gt.default.mark(function e(t,r){var n,o;return gt.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(n=document.getElementsByTagName("head")[0],n){s.next=3;break}throw new Error("loadScript");case 3:return o=document.createElement("script"),o.setAttribute("type","text/javascript"),o.setAttribute("src",t),r&&(o.id=r),s.abrupt("return",new Promise(function(f,_){o.onload=f,o.onerror=function(u){return _(new Error("Unable to load script '".concat(t,"': ").concat(u)))},n.appendChild(o)}));case 8:case"end":return s.stop()}},e)})),zr.apply(this,arguments)}var vt={};function nf(e){globalThis.console&&globalThis.console.error&&globalThis.console.error(e)}function af(e){globalThis.console&&globalThis.console.log&&globalThis.console.log(e)}function of(e,t){vt[e]=!0,t!==void 0&&nf(t)}function sf(e){var t=e.getError;e.getError=function(){var n;do n=t.apply(e),n!==e.NO_ERROR&&(vt[n]=!0);while(n!==e.NO_ERROR);for(n in vt)if(vt[n])return delete vt[n],parseInt(n,10);return e.NO_ERROR}}var bt=function e(t){var r=t.gl;this.ext=t,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(t.maxVertexAttribs);for(var n=0;n<this.attribs.length;n++){var o=new e.VertexAttrib(r);this.attribs[n]=o}this.maxAttrib=0};bt.VertexAttrib=function(t){this.enabled=!1,this.buffer=null,this.size=4,this.type=t.FLOAT,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()};bt.VertexAttrib.prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var Ye=function(t){var r=this;this.gl=t,sf(t);var n=this.original={getParameter:t.getParameter,enableVertexAttribArray:t.enableVertexAttribArray,disableVertexAttribArray:t.disableVertexAttribArray,bindBuffer:t.bindBuffer,getVertexAttrib:t.getVertexAttrib,vertexAttribPointer:t.vertexAttribPointer};t.getParameter=function(i){return i===r.VERTEX_ARRAY_BINDING_OES?r.currentVertexArrayObject===r.defaultVertexArrayObject?null:r.currentVertexArrayObject:n.getParameter.apply(this,arguments)},t.enableVertexAttribArray=function(i){var s=r.currentVertexArrayObject;s.maxAttrib=Math.max(s.maxAttrib,i);var f=s.attribs[i];return f.enabled=!0,n.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(i){var s=r.currentVertexArrayObject;s.maxAttrib=Math.max(s.maxAttrib,i);var f=s.attribs[i];return f.enabled=!1,n.disableVertexAttribArray.apply(this,arguments)},t.bindBuffer=function(i,s){switch(i){case t.ARRAY_BUFFER:r.currentArrayBuffer=s;break;case t.ELEMENT_ARRAY_BUFFER:r.currentVertexArrayObject.elementArrayBuffer=s;break;default:}return n.bindBuffer.apply(this,arguments)},t.getVertexAttrib=function(i,s){var f=r.currentVertexArrayObject,_=f.attribs[i];switch(s){case t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:return _.buffer;case t.VERTEX_ATTRIB_ARRAY_ENABLED:return _.enabled;case t.VERTEX_ATTRIB_ARRAY_SIZE:return _.size;case t.VERTEX_ATTRIB_ARRAY_STRIDE:return _.stride;case t.VERTEX_ATTRIB_ARRAY_TYPE:return _.type;case t.VERTEX_ATTRIB_ARRAY_NORMALIZED:return _.normalized;default:return n.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(i,s,f,_,u,l){var E=r.currentVertexArrayObject;E.maxAttrib=Math.max(E.maxAttrib,i);var R=E.attribs[i];return R.buffer=r.currentArrayBuffer,R.size=s,R.type=f,R.normalized=_,R.stride=u,R.offset=l,R.recache(),n.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",function(){af("OESVertexArrayObject emulation library context restored"),r.reset_()},!0),this.reset_()};Ye.prototype.VERTEX_ARRAY_BINDING_OES=34229;Ye.prototype.reset_=function(){var t=this.vertexArrayObjects!==void 0;if(t)for(var r=0;r<this.vertexArrayObjects.length;++r)this.vertexArrayObjects.isAlive=!1;var n=this.gl;this.maxVertexAttribs=n.getParameter(n.MAX_VERTEX_ATTRIBS),this.defaultVertexArrayObject=new bt(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)};Ye.prototype.createVertexArrayOES=function(){var t=new bt(this);return this.vertexArrayObjects.push(t),t};Ye.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)};Ye.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof bt&&t.hasBeenBound&&t.ext===this)};Ye.prototype.bindVertexArrayOES=function(t){var r=this.gl;if(t&&!t.isAlive){of(r.INVALID_OPERATION,"bindVertexArrayOES: attempt to bind deleted arrayObject");return}var n=this.original,o=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var i=this.currentVertexArrayObject;if(o!==i){(!o||i.elementArrayBuffer!==o.elementArrayBuffer)&&n.bindBuffer.call(r,r.ELEMENT_ARRAY_BUFFER,i.elementArrayBuffer);for(var s=this.currentArrayBuffer,f=Math.max(o?o.maxAttrib:0,i.maxAttrib),_=0;_<=f;_++){var u=i.attribs[_],l=o?o.attribs[_]:null;if((!o||u.enabled!==l.enabled)&&(u.enabled?n.enableVertexAttribArray.call(r,_):n.disableVertexAttribArray.call(r,_)),u.enabled){var E=!1;(!o||u.buffer!==l.buffer)&&(s!==u.buffer&&(n.bindBuffer.call(r,r.ARRAY_BUFFER,u.buffer),s=u.buffer),E=!0),(E||u.cached!==l.cached)&&n.vertexAttribPointer.call(r,_,u.size,u.type,u.normalized,u.stride,u.offset)}}this.currentArrayBuffer!==s&&n.bindBuffer.call(r,r.ARRAY_BUFFER,this.currentArrayBuffer)}};function $a(e){if(typeof e.createVertexArray!="function"){var t=e.getSupportedExtensions;e.getSupportedExtensions=function(){var o=t.call(this)||[];return o.indexOf("OES_vertex_array_object")<0&&o.push("OES_vertex_array_object"),o};var r=e.getExtension;e.getExtension=function(o){var i=r.call(this,o);return i||(o!=="OES_vertex_array_object"?null:(e.__OESVertexArrayObject||(this.__OESVertexArrayObject=new Ye(this)),this.__OESVertexArrayObject))}}}var a=function(e){return e[e.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",e[e.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",e[e.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN",e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",e[e.FUNC_ADD=32774]="FUNC_ADD",e[e.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",e[e.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",e[e.BLEND_EQUATION=32777]="BLEND_EQUATION",e[e.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",e[e.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",e[e.BLEND_DST_RGB=32968]="BLEND_DST_RGB",e[e.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",e[e.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",e[e.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",e[e.BLEND_COLOR=32773]="BLEND_COLOR",e[e.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",e[e.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",e[e.LINE_WIDTH=2849]="LINE_WIDTH",e[e.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",e[e.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",e[e.CULL_FACE_MODE=2885]="CULL_FACE_MODE",e[e.FRONT_FACE=2886]="FRONT_FACE",e[e.DEPTH_RANGE=2928]="DEPTH_RANGE",e[e.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",e[e.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",e[e.DEPTH_FUNC=2932]="DEPTH_FUNC",e[e.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",e[e.STENCIL_FUNC=2962]="STENCIL_FUNC",e[e.STENCIL_FAIL=2964]="STENCIL_FAIL",e[e.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",e[e.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",e[e.STENCIL_REF=2967]="STENCIL_REF",e[e.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",e[e.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",e[e.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",e[e.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",e[e.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",e[e.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",e[e.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",e[e.VIEWPORT=2978]="VIEWPORT",e[e.SCISSOR_BOX=3088]="SCISSOR_BOX",e[e.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",e[e.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",e[e.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",e[e.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",e[e.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",e[e.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",e[e.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",e[e.RED_BITS=3410]="RED_BITS",e[e.GREEN_BITS=3411]="GREEN_BITS",e[e.BLUE_BITS=3412]="BLUE_BITS",e[e.ALPHA_BITS=3413]="ALPHA_BITS",e[e.DEPTH_BITS=3414]="DEPTH_BITS",e[e.STENCIL_BITS=3415]="STENCIL_BITS",e[e.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",e[e.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",e[e.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",e[e.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",e[e.SAMPLES=32937]="SAMPLES",e[e.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",e[e.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",e[e.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",e[e.VENDOR=7936]="VENDOR",e[e.RENDERER=7937]="RENDERER",e[e.VERSION=7938]="VERSION",e[e.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",e[e.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",e[e.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",e[e.STATIC_DRAW=35044]="STATIC_DRAW",e[e.STREAM_DRAW=35040]="STREAM_DRAW",e[e.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.BUFFER_SIZE=34660]="BUFFER_SIZE",e[e.BUFFER_USAGE=34661]="BUFFER_USAGE",e[e.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",e[e.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",e[e.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",e[e.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",e[e.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",e[e.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",e[e.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",e[e.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",e[e.CULL_FACE=2884]="CULL_FACE",e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK",e[e.BLEND=3042]="BLEND",e[e.DEPTH_TEST=2929]="DEPTH_TEST",e[e.DITHER=3024]="DITHER",e[e.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",e[e.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",e[e.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",e[e.SCISSOR_TEST=3089]="SCISSOR_TEST",e[e.STENCIL_TEST=2960]="STENCIL_TEST",e[e.NO_ERROR=0]="NO_ERROR",e[e.INVALID_ENUM=1280]="INVALID_ENUM",e[e.INVALID_VALUE=1281]="INVALID_VALUE",e[e.INVALID_OPERATION=1282]="INVALID_OPERATION",e[e.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",e[e.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",e[e.CW=2304]="CW",e[e.CCW=2305]="CCW",e[e.DONT_CARE=4352]="DONT_CARE",e[e.FASTEST=4353]="FASTEST",e[e.NICEST=4354]="NICEST",e[e.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.DOUBLE=5130]="DOUBLE",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",e[e.VERTEX_SHADER=35633]="VERTEX_SHADER",e[e.COMPILE_STATUS=35713]="COMPILE_STATUS",e[e.DELETE_STATUS=35712]="DELETE_STATUS",e[e.LINK_STATUS=35714]="LINK_STATUS",e[e.VALIDATE_STATUS=35715]="VALIDATE_STATUS",e[e.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",e[e.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",e[e.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",e[e.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",e[e.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",e[e.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",e[e.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",e[e.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",e[e.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",e[e.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",e[e.SHADER_TYPE=35663]="SHADER_TYPE",e[e.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",e[e.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",e[e.NEVER=512]="NEVER",e[e.LESS=513]="LESS",e[e.EQUAL=514]="EQUAL",e[e.LEQUAL=515]="LEQUAL",e[e.GREATER=516]="GREATER",e[e.NOTEQUAL=517]="NOTEQUAL",e[e.GEQUAL=518]="GEQUAL",e[e.ALWAYS=519]="ALWAYS",e[e.KEEP=7680]="KEEP",e[e.REPLACE=7681]="REPLACE",e[e.INCR=7682]="INCR",e[e.DECR=7683]="DECR",e[e.INVERT=5386]="INVERT",e[e.INCR_WRAP=34055]="INCR_WRAP",e[e.DECR_WRAP=34056]="DECR_WRAP",e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9729]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",e[e.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",e[e.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",e[e.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",e[e.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE=5890]="TEXTURE",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e[e.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",e[e.TEXTURE0=33984]="TEXTURE0",e[e.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",e[e.REPEAT=10497]="REPEAT",e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",e[e.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D",e[e.SAMPLER_CUBE=35680]="SAMPLER_CUBE",e[e.LOW_FLOAT=36336]="LOW_FLOAT",e[e.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",e[e.HIGH_FLOAT=36338]="HIGH_FLOAT",e[e.LOW_INT=36339]="LOW_INT",e[e.MEDIUM_INT=36340]="MEDIUM_INT",e[e.HIGH_INT=36341]="HIGH_INT",e[e.FRAMEBUFFER=36160]="FRAMEBUFFER",e[e.RENDERBUFFER=36161]="RENDERBUFFER",e[e.RGBA4=32854]="RGBA4",e[e.RGB5_A1=32855]="RGB5_A1",e[e.RGB565=36194]="RGB565",e[e.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",e[e.STENCIL_INDEX=6401]="STENCIL_INDEX",e[e.STENCIL_INDEX8=36168]="STENCIL_INDEX8",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL",e[e.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",e[e.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",e[e.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",e[e.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",e[e.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",e[e.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",e[e.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",e[e.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",e[e.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",e[e.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",e[e.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",e[e.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",e[e.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",e[e.NONE=0]="NONE",e[e.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",e[e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",e[e.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",e[e.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",e[e.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",e[e.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",e[e.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",e[e.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",e[e.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",e[e.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",e[e.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",e[e.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",e[e.READ_BUFFER=3074]="READ_BUFFER",e[e.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",e[e.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",e[e.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",e[e.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",e[e.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",e[e.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",e[e.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",e[e.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",e[e.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",e[e.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",e[e.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",e[e.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",e[e.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",e[e.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",e[e.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",e[e.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",e[e.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",e[e.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",e[e.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",e[e.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",e[e.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",e[e.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",e[e.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",e[e.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",e[e.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",e[e.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",e[e.RED=6403]="RED",e[e.RGB8=32849]="RGB8",e[e.RGBA8=32856]="RGBA8",e[e.RGB10_A2=32857]="RGB10_A2",e[e.TEXTURE_3D=32879]="TEXTURE_3D",e[e.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",e[e.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",e[e.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",e[e.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",e[e.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",e[e.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",e[e.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",e[e.SRGB=35904]="SRGB",e[e.SRGB8=35905]="SRGB8",e[e.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",e[e.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",e[e.RGBA32F=34836]="RGBA32F",e[e.RGB32F=34837]="RGB32F",e[e.RGBA16F=34842]="RGBA16F",e[e.RGB16F=34843]="RGB16F",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",e[e.R11F_G11F_B10F=35898]="R11F_G11F_B10F",e[e.RGB9_E5=35901]="RGB9_E5",e[e.RGBA32UI=36208]="RGBA32UI",e[e.RGB32UI=36209]="RGB32UI",e[e.RGBA16UI=36214]="RGBA16UI",e[e.RGB16UI=36215]="RGB16UI",e[e.RGBA8UI=36220]="RGBA8UI",e[e.RGB8UI=36221]="RGB8UI",e[e.RGBA32I=36226]="RGBA32I",e[e.RGB32I=36227]="RGB32I",e[e.RGBA16I=36232]="RGBA16I",e[e.RGB16I=36233]="RGB16I",e[e.RGBA8I=36238]="RGBA8I",e[e.RGB8I=36239]="RGB8I",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.R8=33321]="R8",e[e.RG8=33323]="RG8",e[e.R16F=33325]="R16F",e[e.R32F=33326]="R32F",e[e.RG16F=33327]="RG16F",e[e.RG32F=33328]="RG32F",e[e.R8I=33329]="R8I",e[e.R8UI=33330]="R8UI",e[e.R16I=33331]="R16I",e[e.R16UI=33332]="R16UI",e[e.R32I=33333]="R32I",e[e.R32UI=33334]="R32UI",e[e.RG8I=33335]="RG8I",e[e.RG8UI=33336]="RG8UI",e[e.RG16I=33337]="RG16I",e[e.RG16UI=33338]="RG16UI",e[e.RG32I=33339]="RG32I",e[e.RG32UI=33340]="RG32UI",e[e.R8_SNORM=36756]="R8_SNORM",e[e.RG8_SNORM=36757]="RG8_SNORM",e[e.RGB8_SNORM=36758]="RGB8_SNORM",e[e.RGBA8_SNORM=36759]="RGBA8_SNORM",e[e.RGB10_A2UI=36975]="RGB10_A2UI",e[e.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",e[e.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.HALF_FLOAT=5131]="HALF_FLOAT",e[e.RG=33319]="RG",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",e[e.CURRENT_QUERY=34917]="CURRENT_QUERY",e[e.QUERY_RESULT=34918]="QUERY_RESULT",e[e.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",e[e.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",e[e.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",e[e.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",e[e.DRAW_BUFFER0=34853]="DRAW_BUFFER0",e[e.DRAW_BUFFER1=34854]="DRAW_BUFFER1",e[e.DRAW_BUFFER2=34855]="DRAW_BUFFER2",e[e.DRAW_BUFFER3=34856]="DRAW_BUFFER3",e[e.DRAW_BUFFER4=34857]="DRAW_BUFFER4",e[e.DRAW_BUFFER5=34858]="DRAW_BUFFER5",e[e.DRAW_BUFFER6=34859]="DRAW_BUFFER6",e[e.DRAW_BUFFER7=34860]="DRAW_BUFFER7",e[e.DRAW_BUFFER8=34861]="DRAW_BUFFER8",e[e.DRAW_BUFFER9=34862]="DRAW_BUFFER9",e[e.DRAW_BUFFER10=34863]="DRAW_BUFFER10",e[e.DRAW_BUFFER11=34864]="DRAW_BUFFER11",e[e.DRAW_BUFFER12=34865]="DRAW_BUFFER12",e[e.DRAW_BUFFER13=34866]="DRAW_BUFFER13",e[e.DRAW_BUFFER14=34867]="DRAW_BUFFER14",e[e.DRAW_BUFFER15=34868]="DRAW_BUFFER15",e[e.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",e[e.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",e[e.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",e[e.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",e[e.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",e[e.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",e[e.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",e[e.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",e[e.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",e[e.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",e[e.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",e[e.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",e[e.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",e[e.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",e[e.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",e[e.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",e[e.SAMPLER_3D=35679]="SAMPLER_3D",e[e.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",e[e.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",e[e.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",e[e.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",e[e.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",e[e.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",e[e.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",e[e.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",e[e.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",e[e.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",e[e.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",e[e.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",e[e.MAX_SAMPLES=36183]="MAX_SAMPLES",e[e.SAMPLER_BINDING=35097]="SAMPLER_BINDING",e[e.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",e[e.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",e[e.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",e[e.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",e[e.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",e[e.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",e[e.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",e[e.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",e[e.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",e[e.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",e[e.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",e[e.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",e[e.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",e[e.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",e[e.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",e[e.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",e[e.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",e[e.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",e[e.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",e[e.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",e[e.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",e[e.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",e[e.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",e[e.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",e[e.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",e[e.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",e[e.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",e[e.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",e[e.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",e[e.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",e[e.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",e[e.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",e[e.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",e[e.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",e[e.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",e[e.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",e[e.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",e[e.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",e[e.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",e[e.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",e[e.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",e[e.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",e[e.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",e[e.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",e[e.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",e[e.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",e[e.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",e[e.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",e[e.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",e[e.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",e[e.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",e[e.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",e[e.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",e[e.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",e[e.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",e[e.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",e[e.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",e[e.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",e[e.UNIFORM_TYPE=35383]="UNIFORM_TYPE",e[e.UNIFORM_SIZE=35384]="UNIFORM_SIZE",e[e.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",e[e.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",e[e.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",e[e.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",e[e.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",e[e.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",e[e.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",e[e.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",e[e.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",e[e.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",e[e.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",e[e.OBJECT_TYPE=37138]="OBJECT_TYPE",e[e.SYNC_CONDITION=37139]="SYNC_CONDITION",e[e.SYNC_STATUS=37140]="SYNC_STATUS",e[e.SYNC_FLAGS=37141]="SYNC_FLAGS",e[e.SYNC_FENCE=37142]="SYNC_FENCE",e[e.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",e[e.UNSIGNALED=37144]="UNSIGNALED",e[e.SIGNALED=37145]="SIGNALED",e[e.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",e[e.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",e[e.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",e[e.WAIT_FAILED=37149]="WAIT_FAILED",e[e.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",e[e.COLOR=6144]="COLOR",e[e.DEPTH=6145]="DEPTH",e[e.STENCIL=6146]="STENCIL",e[e.MIN=32775]="MIN",e[e.MAX=32776]="MAX",e[e.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",e[e.STREAM_READ=35041]="STREAM_READ",e[e.STREAM_COPY=35042]="STREAM_COPY",e[e.STATIC_READ=35045]="STATIC_READ",e[e.STATIC_COPY=35046]="STATIC_COPY",e[e.DYNAMIC_READ=35049]="DYNAMIC_READ",e[e.DYNAMIC_COPY=35050]="DYNAMIC_COPY",e[e.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",e[e.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",e[e.INVALID_INDEX=4294967295]="INVALID_INDEX",e[e.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",e[e.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",e[e.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",e[e.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",e[e.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",e[e.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",e[e.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",e[e.SRGB_EXT=35904]="SRGB_EXT",e[e.SRGB_ALPHA_EXT=35906]="SRGB_ALPHA_EXT",e[e.SRGB8_ALPHA8_EXT=35907]="SRGB8_ALPHA8_EXT",e[e.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",e[e.R16_EXT=33322]="R16_EXT",e[e.RG16_EXT=33324]="RG16_EXT",e[e.RGB16_EXT=32852]="RGB16_EXT",e[e.RGBA16_EXT=32859]="RGBA16_EXT",e[e.R16_SNORM_EXT=36760]="R16_SNORM_EXT",e[e.RG16_SNORM_EXT=36761]="RG16_SNORM_EXT",e[e.RGB16_SNORM_EXT=36762]="RGB16_SNORM_EXT",e[e.RGBA16_SNORM_EXT=36763]="RGBA16_SNORM_EXT",e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",e[e.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",e[e.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",e[e.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",e[e.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",e[e.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",e[e.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",e[e.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",e[e.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",e[e.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",e[e.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",e[e.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",e[e.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",e[e.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",e[e.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",e[e.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",e[e.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",e[e.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",e[e.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",e[e.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",e[e.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",e[e.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",e[e.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",e[e.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",e[e.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",e[e.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",e[e.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",e[e.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",e[e.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",e[e.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",e[e.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",e[e.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",e[e.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",e[e.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",e[e.UNSIGNED_INT_24_8_WEBGL=34042]="UNSIGNED_INT_24_8_WEBGL",e[e.HALF_FLOAT_OES=36193]="HALF_FLOAT_OES",e[e.RGBA32F_EXT=34836]="RGBA32F_EXT",e[e.RGB32F_EXT=34837]="RGB32F_EXT",e[e.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",e[e.UNSIGNED_NORMALIZED_EXT=35863]="UNSIGNED_NORMALIZED_EXT",e[e.MIN_EXT=32775]="MIN_EXT",e[e.MAX_EXT=32776]="MAX_EXT",e[e.FRAGMENT_SHADER_DERIVATIVE_HINT_OES=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT_OES",e[e.COLOR_ATTACHMENT0_WEBGL=36064]="COLOR_ATTACHMENT0_WEBGL",e[e.COLOR_ATTACHMENT1_WEBGL=36065]="COLOR_ATTACHMENT1_WEBGL",e[e.COLOR_ATTACHMENT2_WEBGL=36066]="COLOR_ATTACHMENT2_WEBGL",e[e.COLOR_ATTACHMENT3_WEBGL=36067]="COLOR_ATTACHMENT3_WEBGL",e[e.COLOR_ATTACHMENT4_WEBGL=36068]="COLOR_ATTACHMENT4_WEBGL",e[e.COLOR_ATTACHMENT5_WEBGL=36069]="COLOR_ATTACHMENT5_WEBGL",e[e.COLOR_ATTACHMENT6_WEBGL=36070]="COLOR_ATTACHMENT6_WEBGL",e[e.COLOR_ATTACHMENT7_WEBGL=36071]="COLOR_ATTACHMENT7_WEBGL",e[e.COLOR_ATTACHMENT8_WEBGL=36072]="COLOR_ATTACHMENT8_WEBGL",e[e.COLOR_ATTACHMENT9_WEBGL=36073]="COLOR_ATTACHMENT9_WEBGL",e[e.COLOR_ATTACHMENT10_WEBGL=36074]="COLOR_ATTACHMENT10_WEBGL",e[e.COLOR_ATTACHMENT11_WEBGL=36075]="COLOR_ATTACHMENT11_WEBGL",e[e.COLOR_ATTACHMENT12_WEBGL=36076]="COLOR_ATTACHMENT12_WEBGL",e[e.COLOR_ATTACHMENT13_WEBGL=36077]="COLOR_ATTACHMENT13_WEBGL",e[e.COLOR_ATTACHMENT14_WEBGL=36078]="COLOR_ATTACHMENT14_WEBGL",e[e.COLOR_ATTACHMENT15_WEBGL=36079]="COLOR_ATTACHMENT15_WEBGL",e[e.DRAW_BUFFER0_WEBGL=34853]="DRAW_BUFFER0_WEBGL",e[e.DRAW_BUFFER1_WEBGL=34854]="DRAW_BUFFER1_WEBGL",e[e.DRAW_BUFFER2_WEBGL=34855]="DRAW_BUFFER2_WEBGL",e[e.DRAW_BUFFER3_WEBGL=34856]="DRAW_BUFFER3_WEBGL",e[e.DRAW_BUFFER4_WEBGL=34857]="DRAW_BUFFER4_WEBGL",e[e.DRAW_BUFFER5_WEBGL=34858]="DRAW_BUFFER5_WEBGL",e[e.DRAW_BUFFER6_WEBGL=34859]="DRAW_BUFFER6_WEBGL",e[e.DRAW_BUFFER7_WEBGL=34860]="DRAW_BUFFER7_WEBGL",e[e.DRAW_BUFFER8_WEBGL=34861]="DRAW_BUFFER8_WEBGL",e[e.DRAW_BUFFER9_WEBGL=34862]="DRAW_BUFFER9_WEBGL",e[e.DRAW_BUFFER10_WEBGL=34863]="DRAW_BUFFER10_WEBGL",e[e.DRAW_BUFFER11_WEBGL=34864]="DRAW_BUFFER11_WEBGL",e[e.DRAW_BUFFER12_WEBGL=34865]="DRAW_BUFFER12_WEBGL",e[e.DRAW_BUFFER13_WEBGL=34866]="DRAW_BUFFER13_WEBGL",e[e.DRAW_BUFFER14_WEBGL=34867]="DRAW_BUFFER14_WEBGL",e[e.DRAW_BUFFER15_WEBGL=34868]="DRAW_BUFFER15_WEBGL",e[e.MAX_COLOR_ATTACHMENTS_WEBGL=36063]="MAX_COLOR_ATTACHMENTS_WEBGL",e[e.MAX_DRAW_BUFFERS_WEBGL=34852]="MAX_DRAW_BUFFERS_WEBGL",e[e.VERTEX_ARRAY_BINDING_OES=34229]="VERTEX_ARRAY_BINDING_OES",e[e.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",e[e.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",e[e.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",e[e.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",e[e.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",e[e.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",e[e.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT",e}(a||{});var ff="Invalid WebGLRenderingContext";var _f="Requires WebGL2";function Zr(e){return typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&Number.isFinite(e._version))}function H(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&e._version===2)}function Nt(e){return H(e)?e:null}function sr(e){return w(Zr(e),ff),e}function Za(e){return w(H(e),_f),e}var W,Qa="OES_element_index",qa="WEBGL_draw_buffers",cf="EXT_disjoint_timer_query",uf="EXT_disjoint_timer_query_webgl2",lf="EXT_texture_filter_anisotropic",Ja="WEBGL_debug_renderer_info",Ef=35723,Rf=4352,df=36795,Tf=34047,Af=37445,pf=37446,Z=function(t){return H(t)?void 0:0},hf=(W={},c(W,a.READ_BUFFER,function(e){return H(e)?void 0:a.COLOR_ATTACHMENT0}),c(W,Ef,function(e){return H(e)?void 0:Rf}),c(W,a.RASTERIZER_DISCARD,Z),c(W,a.SAMPLES,Z),c(W,df,function(e,t){var r=H(e)?e.getExtension(uf):e.getExtension(cf);return r&&r.GPU_DISJOINT_EXT?t(r.GPU_DISJOINT_EXT):0}),c(W,Af,function(e,t){var r=e.getExtension(Ja);return t(r&&r.UNMASKED_VENDOR_WEBGL||a.VENDOR)}),c(W,pf,function(e,t){var r=e.getExtension(Ja);return t(r&&r.UNMASKED_RENDERER_WEBGL||a.RENDERER)}),c(W,Tf,function(e,t){var r,n=((r=e.luma)===null||r===void 0||(r=r.extensions)===null||r===void 0?void 0:r[lf])||e.getExtension("EXT_texture_filter_anisotropic");return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),c(W,a.MAX_3D_TEXTURE_SIZE,Z),c(W,a.MAX_ARRAY_TEXTURE_LAYERS,Z),c(W,a.MAX_CLIENT_WAIT_TIMEOUT_WEBGL,Z),c(W,a.MAX_COLOR_ATTACHMENTS,function(e,t){if(!H(e)){var r=e.getExtension(qa);return r?t(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),c(W,a.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS,Z),c(W,a.MAX_COMBINED_UNIFORM_BLOCKS,Z),c(W,a.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS,Z),c(W,a.MAX_DRAW_BUFFERS,function(e){if(!H(e)){var t=e.getExtension(qa);return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),c(W,a.MAX_ELEMENT_INDEX,function(e){return e.getExtension(Qa)?2147483647:65535}),c(W,a.MAX_ELEMENTS_INDICES,function(e){return e.getExtension(Qa)?16777216:65535}),c(W,a.MAX_ELEMENTS_VERTICES,function(e){return 16777216}),c(W,a.MAX_FRAGMENT_INPUT_COMPONENTS,Z),c(W,a.MAX_FRAGMENT_UNIFORM_BLOCKS,Z),c(W,a.MAX_FRAGMENT_UNIFORM_COMPONENTS,Z),c(W,a.MAX_SAMPLES,Z),c(W,a.MAX_SERVER_WAIT_TIMEOUT,Z),c(W,a.MAX_TEXTURE_LOD_BIAS,Z),c(W,a.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS,Z),c(W,a.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,Z),c(W,a.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS,Z),c(W,a.MAX_UNIFORM_BLOCK_SIZE,Z),c(W,a.MAX_UNIFORM_BUFFER_BINDINGS,Z),c(W,a.MAX_VARYING_COMPONENTS,Z),c(W,a.MAX_VERTEX_OUTPUT_COMPONENTS,Z),c(W,a.MAX_VERTEX_UNIFORM_BLOCKS,Z),c(W,a.MAX_VERTEX_UNIFORM_COMPONENTS,Z),c(W,a.MIN_PROGRAM_TEXEL_OFFSET,Z),c(W,a.MAX_PROGRAM_TEXEL_OFFSET,Z),c(W,a.UNIFORM_BUFFER_OFFSET_ALIGNMENT,Z),W);function ei(e,t,r){var n=hf[r],o=typeof n=="function"?n(e,t,r):n,i=o!==void 0?o:t(r);return i}function st(e){var t=e.luma;if(!t){var r={_polyfilled:!1,_extensions:{}};e.luma=r}return e.luma}var ft,Sf="OES_vertex_array_object",ti="ANGLE_instanced_arrays",gf="WEBGL_draw_buffers",Of="EXT_disjoint_timer_query",vf="EXT_texture_filter_anisotropic",bf="VertexArray requires WebGL2 or OES_vertex_array_object extension";function Nf(e,t){return{webgl2:H(e),ext:e.getExtension(t)}}var Qr=(ft={},c(ft,Sf,{meta:{suffix:"OES"},createVertexArray:function(){w(!1,bf)},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),c(ft,ti,{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(t,r){w(r===0,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),c(ft,gf,{meta:{suffix:"WEBGL"},drawBuffers:function(){w(!1)}}),c(ft,Of,{meta:{suffix:"EXT"},createQuery:function(){w(!1)},deleteQuery:function(){w(!1)},beginQuery:function(){w(!1)},endQuery:function(){},getQuery:function(t,r){return this.getQueryObject(t,r)},getQueryParameter:function(t,r){return this.getQueryObject(t,r)},getQueryObject:function(t,r){}}),ft),fr={readBuffer:function(t,r,n){H(t)&&r(n)},getVertexAttrib:function(t,r,n,o){var i=Nf(t,ti),s=i.webgl2,f=i.ext,_;switch(o){case a.VERTEX_ATTRIB_ARRAY_INTEGER:_=s?void 0:!1;break;case a.VERTEX_ATTRIB_ARRAY_DIVISOR:_=!s&&!f?0:void 0;break;default:}return _!==void 0?_:r(n,o)},getProgramParameter:function(t,r,n,o){if(!H(t))switch(o){case a.TRANSFORM_FEEDBACK_BUFFER_MODE:return a.SEPARATE_ATTRIBS;case a.TRANSFORM_FEEDBACK_VARYINGS:return 0;case a.ACTIVE_UNIFORM_BLOCKS:return 0;default:}return r(n,o)},getInternalformatParameter:function(t,r,n,o,i){if(!H(t))switch(i){case a.SAMPLES:return new Int32Array([0]);default:}var s=t;return s.getInternalformatParameter(n,o,i)},getTexParameter:function(t,r,n,o){switch(o){case a.TEXTURE_MAX_ANISOTROPY_EXT:var i=st(t),s=i._extensions,f=s[vf];o=f&&f.TEXTURE_MAX_ANISOTROPY_EXT||a.TEXTURE_MAX_ANISOTROPY_EXT;break;default:}return r(n,o)},getParameter:ei,hint:function(t,r,n,o){return r(n,o)}};function ni(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Cf(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
17
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return i=u.done,u},e:function(u){s=!0,f=u},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(s)throw f}}}}function Cf(e,t){if(e){if(typeof e=="string")return ri(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ri(e,t)}}function ri(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _r(e){var t=st(e);return t._polyfilled||($a(e),mf(e),If(e,Qr),Pf(e,{target:t,target2:e}),t._polyfilled=!0),e}function mf(e){var t=st(e),r=e.getSupportedExtensions()||[],n=ni(r),o;try{for(n.s();!(o=n.n()).done;){var i=o.value,s=e.getExtension(i);t._extensions[i]=s}}catch(f){n.e(f)}finally{n.f()}}function If(e,t){var r=st(e),n=ni(Object.getOwnPropertyNames(t)),o;try{for(n.s();!(o=n.n()).done;){var i=o.value;i!=="overrides"&&yf(e,{extension:i,target:r,target2:e})}}catch(s){n.e(s)}finally{n.f()}}function yf(e,t){var r=t.extension,n=t.target,o=t.target2,i=Qr[r];w(i);for(var s=i.meta,f=s===void 0?{}:s,_=f.suffix,u=_===void 0?"":_,l=e.getExtension(r),E=function(){var h=d[R],b="".concat(h).concat(u),v=null;h==="meta"||typeof e[h]=="function"||(l&&typeof l[b]=="function"?v=function(){return l[b].apply(l,arguments)}:typeof i[h]=="function"&&(v=i[h].bind(n))),v&&(n[h]=v,o[h]=v)},R=0,d=Object.keys(i);R<d.length;R++)E()}function Pf(e,t){var r=t.target,n=t.target2;Object.keys(fr).forEach(function(o){if(typeof fr[o]=="function"){var i=e[o]?e[o].bind(e):function(){},s=fr[o].bind(null,e,i);r[o]=s,n[o]=s}})}function qr(e){if(Array.isArray(e))return rt(e)}function Ct(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Jr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J(e){return qr(e)||Ct(e)||Ke(e)||Jr()}var N,p,he,It=(N={},c(N,a.BLEND,!1),c(N,a.BLEND_COLOR,new Float32Array([0,0,0,0])),c(N,a.BLEND_EQUATION_RGB,a.FUNC_ADD),c(N,a.BLEND_EQUATION_ALPHA,a.FUNC_ADD),c(N,a.BLEND_SRC_RGB,a.ONE),c(N,a.BLEND_DST_RGB,a.ZERO),c(N,a.BLEND_SRC_ALPHA,a.ONE),c(N,a.BLEND_DST_ALPHA,a.ZERO),c(N,a.COLOR_CLEAR_VALUE,new Float32Array([0,0,0,0])),c(N,a.COLOR_WRITEMASK,[!0,!0,!0,!0]),c(N,a.CULL_FACE,!1),c(N,a.CULL_FACE_MODE,a.BACK),c(N,a.DEPTH_TEST,!1),c(N,a.DEPTH_CLEAR_VALUE,1),c(N,a.DEPTH_FUNC,a.LESS),c(N,a.DEPTH_RANGE,new Float32Array([0,1])),c(N,a.DEPTH_WRITEMASK,!0),c(N,a.DITHER,!0),c(N,a.CURRENT_PROGRAM,null),c(N,a.FRAMEBUFFER_BINDING,null),c(N,a.RENDERBUFFER_BINDING,null),c(N,a.VERTEX_ARRAY_BINDING,null),c(N,a.ARRAY_BUFFER_BINDING,null),c(N,a.FRONT_FACE,a.CCW),c(N,a.GENERATE_MIPMAP_HINT,a.DONT_CARE),c(N,a.LINE_WIDTH,1),c(N,a.POLYGON_OFFSET_FILL,!1),c(N,a.POLYGON_OFFSET_FACTOR,0),c(N,a.POLYGON_OFFSET_UNITS,0),c(N,a.SAMPLE_ALPHA_TO_COVERAGE,!1),c(N,a.SAMPLE_COVERAGE,!1),c(N,a.SAMPLE_COVERAGE_VALUE,1),c(N,a.SAMPLE_COVERAGE_INVERT,!1),c(N,a.SCISSOR_TEST,!1),c(N,a.SCISSOR_BOX,new Int32Array([0,0,1024,1024])),c(N,a.STENCIL_TEST,!1),c(N,a.STENCIL_CLEAR_VALUE,0),c(N,a.STENCIL_WRITEMASK,4294967295),c(N,a.STENCIL_BACK_WRITEMASK,4294967295),c(N,a.STENCIL_FUNC,a.ALWAYS),c(N,a.STENCIL_REF,0),c(N,a.STENCIL_VALUE_MASK,4294967295),c(N,a.STENCIL_BACK_FUNC,a.ALWAYS),c(N,a.STENCIL_BACK_REF,0),c(N,a.STENCIL_BACK_VALUE_MASK,4294967295),c(N,a.STENCIL_FAIL,a.KEEP),c(N,a.STENCIL_PASS_DEPTH_FAIL,a.KEEP),c(N,a.STENCIL_PASS_DEPTH_PASS,a.KEEP),c(N,a.STENCIL_BACK_FAIL,a.KEEP),c(N,a.STENCIL_BACK_PASS_DEPTH_FAIL,a.KEEP),c(N,a.STENCIL_BACK_PASS_DEPTH_PASS,a.KEEP),c(N,a.VIEWPORT,[0,0,1024,1024]),c(N,a.PACK_ALIGNMENT,4),c(N,a.UNPACK_ALIGNMENT,4),c(N,a.UNPACK_FLIP_Y_WEBGL,!1),c(N,a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),c(N,a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL),c(N,a.TRANSFORM_FEEDBACK_BINDING,null),c(N,a.COPY_READ_BUFFER_BINDING,null),c(N,a.COPY_WRITE_BUFFER_BINDING,null),c(N,a.PIXEL_PACK_BUFFER_BINDING,null),c(N,a.PIXEL_UNPACK_BUFFER_BINDING,null),c(N,a.FRAGMENT_SHADER_DERIVATIVE_HINT,a.DONT_CARE),c(N,a.READ_FRAMEBUFFER_BINDING,null),c(N,a.RASTERIZER_DISCARD,!1),c(N,a.PACK_ROW_LENGTH,0),c(N,a.PACK_SKIP_PIXELS,0),c(N,a.PACK_SKIP_ROWS,0),c(N,a.UNPACK_ROW_LENGTH,0),c(N,a.UNPACK_IMAGE_HEIGHT,0),c(N,a.UNPACK_SKIP_PIXELS,0),c(N,a.UNPACK_SKIP_ROWS,0),c(N,a.UNPACK_SKIP_IMAGES,0),N),me=function(t,r,n){return r?t.enable(n):t.disable(n)},ai=function(t,r,n){return t.hint(n,r)},Te=function(t,r,n){return t.pixelStorei(n,r)},ii=function(t,r,n){var o;return n===a.FRAMEBUFFER_BINDING?o=H(t)?a.DRAW_FRAMEBUFFER:a.FRAMEBUFFER:o=a.READ_FRAMEBUFFER,t.bindFramebuffer(o,r)},mt=function(t,r,n){var o,i=(o={},c(o,a.ARRAY_BUFFER_BINDING,a.ARRAY_BUFFER),c(o,a.COPY_READ_BUFFER_BINDING,a.COPY_READ_BUFFER),c(o,a.COPY_WRITE_BUFFER_BINDING,a.COPY_WRITE_BUFFER),c(o,a.PIXEL_PACK_BUFFER_BINDING,a.PIXEL_PACK_BUFFER),c(o,a.PIXEL_UNPACK_BUFFER_BINDING,a.PIXEL_UNPACK_BUFFER),o),s=i[n];t.bindBuffer(s,r)};function en(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}var oi=(p={},c(p,a.BLEND,me),c(p,a.BLEND_COLOR,function(e,t){return e.blendColor.apply(e,J(t))}),c(p,a.BLEND_EQUATION_RGB,"blendEquation"),c(p,a.BLEND_EQUATION_ALPHA,"blendEquation"),c(p,a.BLEND_SRC_RGB,"blendFunc"),c(p,a.BLEND_DST_RGB,"blendFunc"),c(p,a.BLEND_SRC_ALPHA,"blendFunc"),c(p,a.BLEND_DST_ALPHA,"blendFunc"),c(p,a.COLOR_CLEAR_VALUE,function(e,t){return e.clearColor.apply(e,J(t))}),c(p,a.COLOR_WRITEMASK,function(e,t){return e.colorMask.apply(e,J(t))}),c(p,a.CULL_FACE,me),c(p,a.CULL_FACE_MODE,function(e,t){return e.cullFace(t)}),c(p,a.DEPTH_TEST,me),c(p,a.DEPTH_CLEAR_VALUE,function(e,t){return e.clearDepth(t)}),c(p,a.DEPTH_FUNC,function(e,t){return e.depthFunc(t)}),c(p,a.DEPTH_RANGE,function(e,t){return e.depthRange.apply(e,J(t))}),c(p,a.DEPTH_WRITEMASK,function(e,t){return e.depthMask(t)}),c(p,a.DITHER,me),c(p,a.FRAGMENT_SHADER_DERIVATIVE_HINT,ai),c(p,a.CURRENT_PROGRAM,function(e,t){return e.useProgram(t)}),c(p,a.RENDERBUFFER_BINDING,function(e,t){return e.bindRenderbuffer(a.RENDERBUFFER,t)}),c(p,a.TRANSFORM_FEEDBACK_BINDING,function(e,t){var r,n;return(r=(n=e).bindTransformFeedback)===null||r===void 0?void 0:r.call(n,a.TRANSFORM_FEEDBACK,t)}),c(p,a.VERTEX_ARRAY_BINDING,function(e,t){return e.bindVertexArray(t)}),c(p,a.FRAMEBUFFER_BINDING,ii),c(p,a.READ_FRAMEBUFFER_BINDING,ii),c(p,a.ARRAY_BUFFER_BINDING,mt),c(p,a.COPY_READ_BUFFER_BINDING,mt),c(p,a.COPY_WRITE_BUFFER_BINDING,mt),c(p,a.PIXEL_PACK_BUFFER_BINDING,mt),c(p,a.PIXEL_UNPACK_BUFFER_BINDING,mt),c(p,a.FRONT_FACE,function(e,t){return e.frontFace(t)}),c(p,a.GENERATE_MIPMAP_HINT,ai),c(p,a.LINE_WIDTH,function(e,t){return e.lineWidth(t)}),c(p,a.POLYGON_OFFSET_FILL,me),c(p,a.POLYGON_OFFSET_FACTOR,"polygonOffset"),c(p,a.POLYGON_OFFSET_UNITS,"polygonOffset"),c(p,a.RASTERIZER_DISCARD,me),c(p,a.SAMPLE_ALPHA_TO_COVERAGE,me),c(p,a.SAMPLE_COVERAGE,me),c(p,a.SAMPLE_COVERAGE_VALUE,"sampleCoverage"),c(p,a.SAMPLE_COVERAGE_INVERT,"sampleCoverage"),c(p,a.SCISSOR_TEST,me),c(p,a.SCISSOR_BOX,function(e,t){return e.scissor.apply(e,J(t))}),c(p,a.STENCIL_TEST,me),c(p,a.STENCIL_CLEAR_VALUE,function(e,t){return e.clearStencil(t)}),c(p,a.STENCIL_WRITEMASK,function(e,t){return e.stencilMaskSeparate(a.FRONT,t)}),c(p,a.STENCIL_BACK_WRITEMASK,function(e,t){return e.stencilMaskSeparate(a.BACK,t)}),c(p,a.STENCIL_FUNC,"stencilFuncFront"),c(p,a.STENCIL_REF,"stencilFuncFront"),c(p,a.STENCIL_VALUE_MASK,"stencilFuncFront"),c(p,a.STENCIL_BACK_FUNC,"stencilFuncBack"),c(p,a.STENCIL_BACK_REF,"stencilFuncBack"),c(p,a.STENCIL_BACK_VALUE_MASK,"stencilFuncBack"),c(p,a.STENCIL_FAIL,"stencilOpFront"),c(p,a.STENCIL_PASS_DEPTH_FAIL,"stencilOpFront"),c(p,a.STENCIL_PASS_DEPTH_PASS,"stencilOpFront"),c(p,a.STENCIL_BACK_FAIL,"stencilOpBack"),c(p,a.STENCIL_BACK_PASS_DEPTH_FAIL,"stencilOpBack"),c(p,a.STENCIL_BACK_PASS_DEPTH_PASS,"stencilOpBack"),c(p,a.VIEWPORT,function(e,t){return e.viewport.apply(e,J(t))}),c(p,a.PACK_ALIGNMENT,Te),c(p,a.UNPACK_ALIGNMENT,Te),c(p,a.UNPACK_FLIP_Y_WEBGL,Te),c(p,a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Te),c(p,a.UNPACK_COLORSPACE_CONVERSION_WEBGL,Te),c(p,a.PACK_ROW_LENGTH,Te),c(p,a.PACK_SKIP_PIXELS,Te),c(p,a.PACK_SKIP_ROWS,Te),c(p,a.UNPACK_ROW_LENGTH,Te),c(p,a.UNPACK_IMAGE_HEIGHT,Te),c(p,a.UNPACK_SKIP_PIXELS,Te),c(p,a.UNPACK_SKIP_ROWS,Te),c(p,a.UNPACK_SKIP_IMAGES,Te),c(p,"framebuffer",function(t,r){var n=r&&"handle"in r?r.handle:r;return t.bindFramebuffer(a.FRAMEBUFFER,n)}),c(p,"blend",function(t,r){return r?t.enable(a.BLEND):t.disable(a.BLEND)}),c(p,"blendColor",function(t,r){return t.blendColor.apply(t,J(r))}),c(p,"blendEquation",function(t,r){var n=typeof r=="number"?[r,r]:r;t.blendEquationSeparate.apply(t,J(n))}),c(p,"blendFunc",function(t,r){var n=r?.length===2?[].concat(J(r),J(r)):r;t.blendFuncSeparate.apply(t,J(n))}),c(p,"clearColor",function(t,r){return t.clearColor.apply(t,J(r))}),c(p,"clearDepth",function(t,r){return t.clearDepth(r)}),c(p,"clearStencil",function(t,r){return t.clearStencil(r)}),c(p,"colorMask",function(t,r){return t.colorMask.apply(t,J(r))}),c(p,"cull",function(t,r){return r?t.enable(a.CULL_FACE):t.disable(a.CULL_FACE)}),c(p,"cullFace",function(t,r){return t.cullFace(r)}),c(p,"depthTest",function(t,r){return r?t.enable(a.DEPTH_TEST):t.disable(a.DEPTH_TEST)}),c(p,"depthFunc",function(t,r){return t.depthFunc(r)}),c(p,"depthMask",function(t,r){return t.depthMask(r)}),c(p,"depthRange",function(t,r){return t.depthRange.apply(t,J(r))}),c(p,"dither",function(t,r){return r?t.enable(a.DITHER):t.disable(a.DITHER)}),c(p,"derivativeHint",function(t,r){t.hint(a.FRAGMENT_SHADER_DERIVATIVE_HINT,r)}),c(p,"frontFace",function(t,r){return t.frontFace(r)}),c(p,"mipmapHint",function(t,r){return t.hint(a.GENERATE_MIPMAP_HINT,r)}),c(p,"lineWidth",function(t,r){return t.lineWidth(r)}),c(p,"polygonOffsetFill",function(t,r){return r?t.enable(a.POLYGON_OFFSET_FILL):t.disable(a.POLYGON_OFFSET_FILL)}),c(p,"polygonOffset",function(t,r){return t.polygonOffset.apply(t,J(r))}),c(p,"sampleCoverage",function(t,r){return t.sampleCoverage.apply(t,J(r))}),c(p,"scissorTest",function(t,r){return r?t.enable(a.SCISSOR_TEST):t.disable(a.SCISSOR_TEST)}),c(p,"scissor",function(t,r){return t.scissor.apply(t,J(r))}),c(p,"stencilTest",function(t,r){return r?t.enable(a.STENCIL_TEST):t.disable(a.STENCIL_TEST)}),c(p,"stencilMask",function(t,r){r=en(r)?r:[r,r];var n=r,o=L(n,2),i=o[0],s=o[1];t.stencilMaskSeparate(a.FRONT,i),t.stencilMaskSeparate(a.BACK,s)}),c(p,"stencilFunc",function(t,r){r=en(r)&&r.length===3?[].concat(J(r),J(r)):r;var n=r,o=L(n,6),i=o[0],s=o[1],f=o[2],_=o[3],u=o[4],l=o[5];t.stencilFuncSeparate(a.FRONT,i,s,f),t.stencilFuncSeparate(a.BACK,_,u,l)}),c(p,"stencilOp",function(t,r){r=en(r)&&r.length===3?[].concat(J(r),J(r)):r;var n=r,o=L(n,6),i=o[0],s=o[1],f=o[2],_=o[3],u=o[4],l=o[5];t.stencilOpSeparate(a.FRONT,i,s,f),t.stencilOpSeparate(a.BACK,_,u,l)}),c(p,"viewport",function(t,r){return t.viewport.apply(t,J(r))}),p);function te(e,t,r){return t[e]!==void 0?t[e]:r[e]}var si={blendEquation:function(t,r,n){return t.blendEquationSeparate(te(a.BLEND_EQUATION_RGB,r,n),te(a.BLEND_EQUATION_ALPHA,r,n))},blendFunc:function(t,r,n){return t.blendFuncSeparate(te(a.BLEND_SRC_RGB,r,n),te(a.BLEND_DST_RGB,r,n),te(a.BLEND_SRC_ALPHA,r,n),te(a.BLEND_DST_ALPHA,r,n))},polygonOffset:function(t,r,n){return t.polygonOffset(te(a.POLYGON_OFFSET_FACTOR,r,n),te(a.POLYGON_OFFSET_UNITS,r,n))},sampleCoverage:function(t,r,n){return t.sampleCoverage(te(a.SAMPLE_COVERAGE_VALUE,r,n),te(a.SAMPLE_COVERAGE_INVERT,r,n))},stencilFuncFront:function(t,r,n){return t.stencilFuncSeparate(a.FRONT,te(a.STENCIL_FUNC,r,n),te(a.STENCIL_REF,r,n),te(a.STENCIL_VALUE_MASK,r,n))},stencilFuncBack:function(t,r,n){return t.stencilFuncSeparate(a.BACK,te(a.STENCIL_BACK_FUNC,r,n),te(a.STENCIL_BACK_REF,r,n),te(a.STENCIL_BACK_VALUE_MASK,r,n))},stencilOpFront:function(t,r,n){return t.stencilOpSeparate(a.FRONT,te(a.STENCIL_FAIL,r,n),te(a.STENCIL_PASS_DEPTH_FAIL,r,n),te(a.STENCIL_PASS_DEPTH_PASS,r,n))},stencilOpBack:function(t,r,n){return t.stencilOpSeparate(a.BACK,te(a.STENCIL_BACK_FAIL,r,n),te(a.STENCIL_BACK_PASS_DEPTH_FAIL,r,n),te(a.STENCIL_BACK_PASS_DEPTH_PASS,r,n))}},tn={enable:function(t,r){return t(c({},r,!0))},disable:function(t,r){return t(c({},r,!1))},pixelStorei:function(t,r,n){return t(c({},r,n))},hint:function(t,r,n){return t(c({},r,n))},useProgram:function(t,r){return t(c({},a.CURRENT_PROGRAM,r))},bindRenderbuffer:function(t,r,n){return t(c({},a.RENDERBUFFER_BINDING,n))},bindTransformFeedback:function(t,r,n){return t(c({},a.TRANSFORM_FEEDBACK_BINDING,n))},bindVertexArray:function(t,r){return t(c({},a.VERTEX_ARRAY_BINDING,r))},bindFramebuffer:function(t,r,n){var o;switch(r){case a.FRAMEBUFFER:return t((o={},c(o,a.DRAW_FRAMEBUFFER_BINDING,n),c(o,a.READ_FRAMEBUFFER_BINDING,n),o));case a.DRAW_FRAMEBUFFER:return t(c({},a.DRAW_FRAMEBUFFER_BINDING,n));case a.READ_FRAMEBUFFER:return t(c({},a.READ_FRAMEBUFFER_BINDING,n));default:return null}},bindBuffer:function(t,r,n){var o,i=(o={},c(o,a.ARRAY_BUFFER,[a.ARRAY_BUFFER_BINDING]),c(o,a.COPY_READ_BUFFER,[a.COPY_READ_BUFFER_BINDING]),c(o,a.COPY_WRITE_BUFFER,[a.COPY_WRITE_BUFFER_BINDING]),c(o,a.PIXEL_PACK_BUFFER,[a.PIXEL_PACK_BUFFER_BINDING]),c(o,a.PIXEL_UNPACK_BUFFER,[a.PIXEL_UNPACK_BUFFER_BINDING]),o)[r];return i?t(c({},i,n)):{valueChanged:!0}},blendColor:function(t,r,n,o,i){return t(c({},a.BLEND_COLOR,new Float32Array([r,n,o,i])))},blendEquation:function(t,r){var n;return t((n={},c(n,a.BLEND_EQUATION_RGB,r),c(n,a.BLEND_EQUATION_ALPHA,r),n))},blendEquationSeparate:function(t,r,n){var o;return t((o={},c(o,a.BLEND_EQUATION_RGB,r),c(o,a.BLEND_EQUATION_ALPHA,n),o))},blendFunc:function(t,r,n){var o;return t((o={},c(o,a.BLEND_SRC_RGB,r),c(o,a.BLEND_DST_RGB,n),c(o,a.BLEND_SRC_ALPHA,r),c(o,a.BLEND_DST_ALPHA,n),o))},blendFuncSeparate:function(t,r,n,o,i){var s;return t((s={},c(s,a.BLEND_SRC_RGB,r),c(s,a.BLEND_DST_RGB,n),c(s,a.BLEND_SRC_ALPHA,o),c(s,a.BLEND_DST_ALPHA,i),s))},clearColor:function(t,r,n,o,i){return t(c({},a.COLOR_CLEAR_VALUE,new Float32Array([r,n,o,i])))},clearDepth:function(t,r){return t(c({},a.DEPTH_CLEAR_VALUE,r))},clearStencil:function(t,r){return t(c({},a.STENCIL_CLEAR_VALUE,r))},colorMask:function(t,r,n,o,i){return t(c({},a.COLOR_WRITEMASK,[r,n,o,i]))},cullFace:function(t,r){return t(c({},a.CULL_FACE_MODE,r))},depthFunc:function(t,r){return t(c({},a.DEPTH_FUNC,r))},depthRange:function(t,r,n){return t(c({},a.DEPTH_RANGE,new Float32Array([r,n])))},depthMask:function(t,r){return t(c({},a.DEPTH_WRITEMASK,r))},frontFace:function(t,r){return t(c({},a.FRONT_FACE,r))},lineWidth:function(t,r){return t(c({},a.LINE_WIDTH,r))},polygonOffset:function(t,r,n){var o;return t((o={},c(o,a.POLYGON_OFFSET_FACTOR,r),c(o,a.POLYGON_OFFSET_UNITS,n),o))},sampleCoverage:function(t,r,n){var o;return t((o={},c(o,a.SAMPLE_COVERAGE_VALUE,r),c(o,a.SAMPLE_COVERAGE_INVERT,n),o))},scissor:function(t,r,n,o,i){return t(c({},a.SCISSOR_BOX,new Int32Array([r,n,o,i])))},stencilMask:function(t,r){var n;return t((n={},c(n,a.STENCIL_WRITEMASK,r),c(n,a.STENCIL_BACK_WRITEMASK,r),n))},stencilMaskSeparate:function(t,r,n){return t(c({},r===a.FRONT?a.STENCIL_WRITEMASK:a.STENCIL_BACK_WRITEMASK,n))},stencilFunc:function(t,r,n,o){var i;return t((i={},c(i,a.STENCIL_FUNC,r),c(i,a.STENCIL_REF,n),c(i,a.STENCIL_VALUE_MASK,o),c(i,a.STENCIL_BACK_FUNC,r),c(i,a.STENCIL_BACK_REF,n),c(i,a.STENCIL_BACK_VALUE_MASK,o),i))},stencilFuncSeparate:function(t,r,n,o,i){var s;return t((s={},c(s,r===a.FRONT?a.STENCIL_FUNC:a.STENCIL_BACK_FUNC,n),c(s,r===a.FRONT?a.STENCIL_REF:a.STENCIL_BACK_REF,o),c(s,r===a.FRONT?a.STENCIL_VALUE_MASK:a.STENCIL_BACK_VALUE_MASK,i),s))},stencilOp:function(t,r,n,o){var i;return t((i={},c(i,a.STENCIL_FAIL,r),c(i,a.STENCIL_PASS_DEPTH_FAIL,n),c(i,a.STENCIL_PASS_DEPTH_PASS,o),c(i,a.STENCIL_BACK_FAIL,r),c(i,a.STENCIL_BACK_PASS_DEPTH_FAIL,n),c(i,a.STENCIL_BACK_PASS_DEPTH_PASS,o),i))},stencilOpSeparate:function(t,r,n,o,i){var s;return t((s={},c(s,r===a.FRONT?a.STENCIL_FAIL:a.STENCIL_BACK_FAIL,n),c(s,r===a.FRONT?a.STENCIL_PASS_DEPTH_FAIL:a.STENCIL_BACK_PASS_DEPTH_FAIL,o),c(s,r===a.FRONT?a.STENCIL_PASS_DEPTH_PASS:a.STENCIL_BACK_PASS_DEPTH_PASS,i),s))},viewport:function(t,r,n,o,i){return t(c({},a.VIEWPORT,[r,n,o,i]))}},Ie=function(t,r){return t.isEnabled(r)},rn=(he={},c(he,a.BLEND,Ie),c(he,a.CULL_FACE,Ie),c(he,a.DEPTH_TEST,Ie),c(he,a.DITHER,Ie),c(he,a.POLYGON_OFFSET_FILL,Ie),c(he,a.SAMPLE_ALPHA_TO_COVERAGE,Ie),c(he,a.SAMPLE_COVERAGE,Ie),c(he,a.SCISSOR_TEST,Ie),c(he,a.STENCIL_TEST,Ie),c(he,a.RASTERIZER_DISCARD,Ie),he),fi=new Set([a.ACTIVE_TEXTURE,a.TRANSFORM_FEEDBACK_ACTIVE,a.TRANSFORM_FEEDBACK_PAUSED,a.TRANSFORM_FEEDBACK_BUFFER_BINDING,a.UNIFORM_BUFFER_BINDING,a.ELEMENT_ARRAY_BUFFER_BINDING,a.IMPLEMENTATION_COLOR_READ_FORMAT,a.IMPLEMENTATION_COLOR_READ_TYPE,a.READ_BUFFER,a.DRAW_BUFFER0,a.DRAW_BUFFER1,a.DRAW_BUFFER2,a.DRAW_BUFFER3,a.DRAW_BUFFER4,a.DRAW_BUFFER5,a.DRAW_BUFFER6,a.DRAW_BUFFER7,a.DRAW_BUFFER8,a.DRAW_BUFFER9,a.DRAW_BUFFER10,a.DRAW_BUFFER11,a.DRAW_BUFFER12,a.DRAW_BUFFER13,a.DRAW_BUFFER14,a.DRAW_BUFFER15,a.SAMPLER_BINDING,a.TEXTURE_BINDING_2D,a.TEXTURE_BINDING_2D_ARRAY,a.TEXTURE_BINDING_3D,a.TEXTURE_BINDING_CUBE_MAP]);function Ff(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Bf(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
19
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return i=u.done,u},e:function(u){s=!0,f=u},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(s)throw f}}}}function Bf(e,t){if(e){if(typeof e=="string")return _i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _i(e,t)}}function _i(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Se(e,t){var r=le.attach(e),n=r.gl;if(!Mf(t)){var o={};for(var i in t){var s=Number(i),f=oi[i];f&&(typeof f=="string"?o[f]=!0:f(n,t[i],s))}var _=n.state&&n.state.cache;if(_)for(var u in o){var l=si[u];l(n,t,_)}}}function cr(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:It,r=le.attach(e),n=r.gl;if(typeof t=="number"){var o=t,i=rn[o];return i?i(n,o):n.getParameter(o)}var s=Array.isArray(t)?t:Object.keys(t),f={},_=Ff(s),u;try{for(_.s();!(u=_.n()).done;){var l=u.value,E=rn[l];f[l]=E?E(n,Number(l)):n.getParameter(Number(l))}}catch(R){_.e(R)}finally{_.f()}return f}function ci(e){Se(e,It)}function Mf(e){for(var t in e)return!1;return!0}function ui(e,t){if(e===t)return!0;var r=Array.isArray(e)||ArrayBuffer.isView(e),n=Array.isArray(t)||ArrayBuffer.isView(t);if(r&&n&&e.length===t.length){for(var o=0;o<e.length;++o)if(e[o]!==t[o])return!1;return!0}return!1}var Df=function(){function e(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.copyState,i=o===void 0?!1:o,s=n.log,f=s===void 0?function(){}:s;m(this,e),this.gl=void 0,this.program=null,this.stateStack=[],this.enable=!0,this.cache=void 0,this.log=void 0,this.gl=r,this.cache=i?cr(r):Object.assign({},It),this.log=f,this._updateCache=this._updateCache.bind(this),Object.seal(this)}var t=e.prototype;return t.push=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.stateStack.push({})},t.pop=function(){w(this.stateStack.length>0);var n=this.stateStack[this.stateStack.length-1];Se(this.gl,n),this.stateStack.pop()},t._updateCache=function(n){var o=!1,i,s=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(var f in n){w(f!==void 0);var _=n[f],u=this.cache[f];ui(_,u)||(o=!0,i=u,s&&!(f in s)&&(s[f]=u),this.cache[f]=_)}return{valueChanged:o,oldValue:i}},I(e)}();function ke(e){return e.state}function yt(e,t){var r=t.enable,n=r===void 0?!0:r,o=t.copyState;if(w(o!==void 0),!e.state){e.state=new Df(e,{copyState:o}),Uf(e);for(var i in tn){var s=tn[i];xf(e,i,s)}li(e,"getParameter"),li(e,"isEnabled")}var f=ke(e);return f.enable=n,e}function be(e){var t=ke(e);t||(yt(e,{copyState:!1}),t=ke(e)),t.push()}function ge(e){var t=ke(e);w(t),t.pop()}function li(e,t){var r=e[t].bind(e);e[t]=function(o){if(o===void 0||fi.has(o))return r(o);var i=ke(e);return o in i.cache||(i.cache[o]=r(o)),i.enable?i.cache[o]:r(o)},Object.defineProperty(e[t],"name",{value:"".concat(t,"-from-cache"),configurable:!1})}function xf(e,t,r){if(e[t]){var n=e[t].bind(e);e[t]=function(){for(var i=ke(e),s=arguments.length,f=new Array(s),_=0;_<s;_++)f[_]=arguments[_];var u=r.apply(void 0,[i._updateCache].concat(f)),l=u.valueChanged,E=u.oldValue;return l&&n.apply(void 0,f),E},Object.defineProperty(e[t],"name",{value:"".concat(t,"-to-cache"),configurable:!1})}}function Uf(e){var t=e.useProgram.bind(e);e.useProgram=function(n){var o=ke(e);o.program!==n&&(t(n),o.program=n)}}function Ei(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function _t(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ei(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ei(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var wf={webgl2:!0,webgl1:!0,powerPreference:"high-performance",onContextLost:function(){return console.error("WebGL context lost")},onContextRestored:function(){return console.info("WebGL context restored")}};function Ri(e,t){t=_t(_t({},wf),t);var r=null,n=function(l){return r=l.statusMessage||r};e.addEventListener("webglcontextcreationerror",n,!1);var o=null;if(t.type==="webgl2"&&(t=_t(_t({},t),{},{webgl1:!1})),t.type==="webgl1"&&(t=_t(_t({},t),{},{webgl2:!1})),!o&&t.webgl2&&(o=e.getContext("webgl2",t)),!o&&t.webgl1&&(o=e.getContext("webgl",t)),e.removeEventListener("webglcontextcreationerror",n,!1),!o)throw new Error("Failed to create ".concat(t.webgl2&&!t.webgl1?"WebGL2":"WebGL"," context: ").concat(r||"Unknown error"));if(t.onContextLost){var i=t,s=i.onContextLost;e.addEventListener("webglcontextlost",function(u){return s(u)},!1)}if(t.onContextRestored){var f=t,_=f.onContextRestored;e.addEventListener("webglcontextrestored",function(u){return _(u)},!1)}return o}function di(e){var t=e.getParameter(a.VENDOR),r=e.getParameter(a.RENDERER),n=e.getExtension("WEBGL_debug_renderer_info"),o=e.getParameter(n?n.UNMASKED_VENDOR_WEBGL:a.VENDOR),i=e.getParameter(n?n.UNMASKED_RENDERER_WEBGL:a.RENDERER),s=o||t,f=i||r,_=Xf(s,f);return{type:H(e)?"webgl2":"webgl",gpu:_,vendor:o||t,renderer:i||r,version:e.getParameter(a.VERSION),shadingLanguages:["glsl"],shadingLanguageVersions:{glsl:e.getParameter(a.SHADING_LANGUAGE_VERSION)}}}function Xf(e,t){return/NVIDIA/i.exec(e)||/NVIDIA/i.exec(t)?"nvidia":/INTEL/i.exec(e)||/INTEL/i.exec(t)?"intel":/Apple/i.exec(e)||/Apple/i.exec(t)?"apple":/AMD/i.exec(e)||/AMD/i.exec(t)||/ATI/i.exec(e)||/ATI/i.exec(t)?"amd":/SwiftShader/i.exec(e)||/SwiftShader/i.exec(t)?"software":"unknown"}function Ti(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=typeof window<"u"?window.navigator||{}:{},r=e.userAgent||t.userAgent||"",n=r.indexOf("MSIE ")!==-1,o=r.indexOf("Trident/")!==-1;return n||o}function ur(e){switch(e){case"uint8":return a.UNSIGNED_BYTE;case"sint8":return a.BYTE;case"unorm8":return a.UNSIGNED_BYTE;case"snorm8":return a.BYTE;case"uint16":return a.UNSIGNED_SHORT;case"sint16":return a.SHORT;case"unorm16":return a.UNSIGNED_SHORT;case"snorm16":return a.SHORT;case"uint32":return a.UNSIGNED_INT;case"sint32":return a.INT;case"float16":return a.HALF_FLOAT;case"float32":return a.FLOAT}throw new Error(String(e))}var ce,ye,fe="texture-compression-bc",Y="texture-compression-astc",Pe="texture-compression-etc2",Lf="texture-compression-etc1-webgl",lr="texture-compression-pvrtc-webgl",nn="texture-compression-atc-webgl",Pt="WEBGL_compressed_texture_s3tc",Ft="WEBGL_compressed_texture_s3tc_srgb",ct="EXT_texture_compression_rgtc",Bt="EXT_texture_compression_bptc",Hf="WEBGL_compressed_texture_etc",Wf="WEBGL_compressed_texture_astc",Vf="WEBGL_compressed_texture_etc1",jf="WEBGL_compressed_texture_pvrtc",Kf="WEBGL_compressed_texture_atc",Ai="EXT_sRGB",Ue="EXT_texture_norm16",Yf="WEBGL_color_buffer_float",kf="EXT_color_buffer_float",Ne=function(t,r){return t.getExtension(r)},Ge=function(t,r){return r.every(function(n){return t.getExtension(n)})},an={"texture-blend-float-webgl1":function(t){return H(t)?!0:Ne(t,"EXT_float_blend")},"texture-formats-srgb-webgl1":function(t){return H(t)?!0:Ne(t,Ai)},"texture-formats-depth-webgl1":function(t){return H(t)?!0:Ne(t,"WEBGL_depth_texture")},"texture-formats-float32-webgl1":function(t){return H(t)?!0:Ne(t,"OES_texture_float")},"texture-formats-float16-webgl1":function(t){return H(t)?!0:Ne(t,"OES_texture_half_float")},"texture-formats-norm16-webgl":function(t){return H(t)?Ne(t,Ue):!1},"texture-filter-linear-float32-webgl":function(t){return Ne(t,"OES_texture_float_linear")},"texture-filter-linear-float16-webgl":function(t){return Ne(t,"OES_texture_half_float_linear")},"texture-filter-anisotropic-webgl":function(t){return Ne(t,"EXT_texture_filter_anisotropic")},"texture-renderable-float32-webgl":function(t){return Ne(t,"EXT_color_buffer_float")},"texture-renderable-float16-webgl":function(t){return Ne(t,"EXT_color_buffer_half_float")},"texture-compression-bc":function(t){return Ge(t,[Pt,Ft,ct,Bt])},"texture-compression-bc5-webgl":function(t){return Ge(t,[ct])},"texture-compression-etc2":function(t){return Ge(t,[Hf])},"texture-compression-astc":function(t){return Ge(t,[Wf])},"texture-compression-etc1-webgl":function(t){return Ge(t,[Vf])},"texture-compression-pvrtc-webgl":function(t){return Ge(t,[jf])},"texture-compression-atc-webgl":function(t){return Ge(t,[Kf])}};function Gf(e,t){var r;return((r=an[t])===null||r===void 0?void 0:r.call(an,e))||!1}function pi(e){var t=Object.keys(an);return t.filter(function(r){return Gf(e,r)})}var ze={"rgb8unorm-unsized":{gl:a.RGB,gl1:a.RGB,b:4,c:2,bpp:4,dataFormat:a.RGB,types:[a.UNSIGNED_BYTE,a.UNSIGNED_SHORT_5_6_5]},"rgba8unorm-unsized":{gl:a.RGBA,gl1:a.RGBA,b:4,c:2,bpp:4,dataFormat:a.RGBA,types:[a.UNSIGNED_BYTE,a.UNSIGNED_SHORT_4_4_4_4,a.UNSIGNED_SHORT_5_5_5_1]},r8unorm:{gl:a.R8,b:1,c:1,renderbuffer:!0},r8snorm:{gl:a.R8_SNORM,b:1,c:1},r8uint:{gl:a.R8UI,b:1,c:1,renderbuffer:!0},r8sint:{gl:a.R8I,b:1,c:1,renderbuffer:!0},rg8unorm:{gl:a.RG8,b:2,c:2,renderbuffer:!0},rg8snorm:{gl:a.RG8_SNORM,b:2,c:2},rg8uint:{gl:a.RG8UI,b:2,c:2,renderbuffer:!0},rg8sint:{gl:a.RG8I,b:2,c:2,renderbuffer:!0},r16uint:{gl:a.R16UI,b:2,c:1,renderbuffer:!0},r16sint:{gl:a.R16I,b:2,c:1,renderbuffer:!0},r16float:{gl:a.R16F,b:2,c:1,render:"texture-renderable-float16-webgl",filter:"texture-filter-linear-float16-webgl",renderbuffer:!0},"r16unorm-webgl":{gl:a.R16_EXT,b:2,c:1,f:"texture-formats-norm16-webgl",renderbuffer:!0,x:Ue},"r16snorm-webgl":{gl:a.R16_SNORM_EXT,b:2,c:1,f:"texture-formats-norm16-webgl",x:Ue},"rgba4unorm-webgl":{gl:a.RGBA4,b:2,c:4,wgpu:!1,renderbuffer:!0},"rgb565unorm-webgl":{gl:a.RGB565,b:2,c:4,wgpu:!1,renderbuffer:!0},"rgb5a1unorm-webgl":{gl:a.RGB5_A1,b:2,c:4,wgpu:!1,renderbuffer:!0},"rgb8unorm-webgl":{gl:a.RGB8,b:3,c:3,wgpu:!1},"rgb8snorm-webgl":{gl:a.RGB8_SNORM,b:3,c:3,wgpu:!1},rgba8unorm:{gl:a.RGBA8,gl1:a.RGBA,b:4,c:2,bpp:4},"rgba8unorm-srgb":{gl:a.SRGB8_ALPHA8,gl1:a.SRGB_ALPHA_EXT,b:4,c:4,gl1ext:Ai,bpp:4},rgba8snorm:{gl:a.RGBA8_SNORM,b:4,c:4},rgba8uint:{gl:a.RGBA8UI,b:4,c:4,bpp:4},rgba8sint:{gl:a.RGBA8I,b:4,c:4,bpp:4},bgra8unorm:{b:4,c:4},"bgra8unorm-srgb":{b:4,c:4},rg16uint:{gl:a.RG16UI,b:4,c:1,bpp:4},rg16sint:{gl:a.RG16I,b:4,c:2,bpp:4},rg16float:{gl:a.RG16F,bpp:4,b:4,c:2,render:"texture-renderable-float16-webgl",filter:"texture-filter-linear-float16-webgl",renderbuffer:!0},"rg16unorm-webgl":{gl:a.RG16_EXT,b:2,c:2,f:"texture-formats-norm16-webgl",x:Ue},"rg16snorm-webgl":{gl:a.RG16_SNORM_EXT,b:2,c:2,f:"texture-formats-norm16-webgl",x:Ue},r32uint:{gl:a.R32UI,b:4,c:1,bpp:4,renderbuffer:!0},r32sint:{gl:a.R32I,b:4,c:1,bpp:4,renderbuffer:!0},r32float:{gl:a.R32F,bpp:4,b:4,c:1,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl"},rgb9e5ufloat:{gl:a.RGB9_E5,b:4,c:3,p:1,render:"texture-renderable-float16-webgl",filter:"texture-filter-linear-float16-webgl"},rg11b10ufloat:{gl:a.R11F_G11F_B10F,b:4,c:3,p:1,render:"texture-renderable-float32-webgl",renderbuffer:!0},rgb10a2unorm:{gl:a.RGB10_A2,b:4,c:4,p:1,renderbuffer:!0},"rgb10a2unorm-webgl":{b:4,c:4,gl:a.RGB10_A2UI,p:1,wgpu:!1,bpp:4,renderbuffer:!0},"rgb16unorm-webgl":{gl:a.RGB16_EXT,b:2,c:3,f:"texture-formats-norm16-webgl",x:Ue},"rgb16snorm-webgl":{gl:a.RGB16_SNORM_EXT,b:2,c:3,f:"texture-formats-norm16-webgl",x:Ue},rg32uint:{gl:a.RG32UI,b:8,c:2,renderbuffer:!0},rg32sint:{gl:a.RG32I,b:8,c:2,renderbuffer:!0},rg32float:{gl:a.RG32F,b:8,c:2,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl",renderbuffer:!0},rgba16uint:{gl:a.RGBA16UI,b:8,c:4,renderbuffer:!0},rgba16sint:{gl:a.RGBA16I,b:8,c:4,renderbuffer:!0},rgba16float:{gl:a.RGBA16F,gl1:a.RGBA,b:8,c:4,render:"texture-renderable-float16-webgl",filter:"texture-filter-linear-float16-webgl"},"rgba16unorm-webgl":{gl:a.RGBA16_EXT,b:2,c:4,f:"texture-formats-norm16-webgl",renderbuffer:!0,x:Ue},"rgba16snorm-webgl":{gl:a.RGBA16_SNORM_EXT,b:2,c:4,f:"texture-formats-norm16-webgl",x:Ue},"rgb32float-webgl":{gl:a.RGB32F,gl1:a.RGB,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl",gl2ext:kf,gl1ext:Yf,dataFormat:a.RGB,types:[a.FLOAT]},rgba32uint:{gl:a.RGBA32UI,b:16,c:4,renderbuffer:!0},rgba32sint:{gl:a.RGBA32I,b:16,c:4,renderbuffer:!0},rgba32float:{gl:a.RGBA32F,b:16,c:4,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl",renderbuffer:!0},stencil8:{gl:a.STENCIL_INDEX8,gl1:a.STENCIL_INDEX8,b:1,c:1,attachment:a.STENCIL_ATTACHMENT,renderbuffer:!0},depth16unorm:{gl:a.DEPTH_COMPONENT16,gl1:a.DEPTH_COMPONENT16,b:2,c:1,attachment:a.DEPTH_ATTACHMENT,renderbuffer:!0},depth24plus:{gl:a.DEPTH_COMPONENT24,b:3,c:1,attachment:a.DEPTH_ATTACHMENT},depth32float:{gl:a.DEPTH_COMPONENT32F,b:4,c:1,attachment:a.DEPTH_ATTACHMENT,renderbuffer:!0},"depth24plus-stencil8":{gl:a.DEPTH_STENCIL,gl1:a.DEPTH_STENCIL,b:4,c:2,p:1,attachment:a.DEPTH_STENCIL_ATTACHMENT,renderbuffer:!0,depthTexture:!0},"depth24unorm-stencil8":{gl:a.DEPTH24_STENCIL8,b:4,c:2,p:1,attachment:a.DEPTH_STENCIL_ATTACHMENT,renderbuffer:!0},"depth32float-stencil8":{gl:a.DEPTH32F_STENCIL8,b:5,c:2,p:1,attachment:a.DEPTH_STENCIL_ATTACHMENT,renderbuffer:!0},"bc1-rgb-unorm-webgl":{gl:a.COMPRESSED_RGB_S3TC_DXT1_EXT,x:Pt,f:fe},"bc1-rgb-unorm-srgb-webgl":{gl:a.COMPRESSED_SRGB_S3TC_DXT1_EXT,x:Ft,f:fe},"bc1-rgba-unorm":{gl:a.COMPRESSED_RGBA_S3TC_DXT1_EXT,x:Pt,f:fe},"bc1-rgba-unorm-srgb":{gl:a.COMPRESSED_SRGB_S3TC_DXT1_EXT,x:Ft,f:fe},"bc2-rgba-unorm":{gl:a.COMPRESSED_RGBA_S3TC_DXT3_EXT,x:Pt,f:fe},"bc2-rgba-unorm-srgb":{gl:a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,x:Ft,f:fe},"bc3-rgba-unorm":{gl:a.COMPRESSED_RGBA_S3TC_DXT5_EXT,x:Pt,f:fe},"bc3-rgba-unorm-srgb":{gl:a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,x:Ft,f:fe},"bc4-r-unorm":{gl:a.COMPRESSED_RED_RGTC1_EXT,x:ct,f:fe},"bc4-r-snorm":{gl:a.COMPRESSED_SIGNED_RED_RGTC1_EXT,x:ct,f:fe},"bc5-rg-unorm":{gl:a.COMPRESSED_RED_GREEN_RGTC2_EXT,x:ct,f:fe},"bc5-rg-snorm":{gl:a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,x:ct,f:fe},"bc6h-rgb-ufloat":{gl:a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,x:Bt,f:fe},"bc6h-rgb-float":{gl:a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,x:Bt,f:fe},"bc7-rgba-unorm":{gl:a.COMPRESSED_RGBA_BPTC_UNORM_EXT,x:Bt,f:fe},"bc7-rgba-unorm-srgb":{gl:a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT,x:Bt,f:fe},"etc2-rgb8unorm":{gl:a.COMPRESSED_RGB8_ETC2,f:Pe},"etc2-rgb8unorm-srgb":{gl:a.COMPRESSED_SRGB8_ETC2,f:Pe},"etc2-rgb8a1unorm":{gl:a.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,f:Pe},"etc2-rgb8a1unorm-srgb":{gl:a.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,f:Pe},"etc2-rgba8unorm":{gl:a.COMPRESSED_RGBA8_ETC2_EAC,f:Pe},"etc2-rgba8unorm-srgb":{gl:a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,f:Pe},"eac-r11unorm":{gl:a.COMPRESSED_R11_EAC,f:Pe},"eac-r11snorm":{gl:a.COMPRESSED_SIGNED_R11_EAC,f:Pe},"eac-rg11unorm":{gl:a.COMPRESSED_RG11_EAC,f:Pe},"eac-rg11snorm":{gl:a.COMPRESSED_SIGNED_RG11_EAC,f:Pe},"astc-4x4-unorm":{gl:a.COMPRESSED_RGBA_ASTC_4x4_KHR,f:Y},"astc-4x4-unorm-srgb":{gl:a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,f:Y},"astc-5x4-unorm":{gl:a.COMPRESSED_RGBA_ASTC_5x4_KHR,f:Y},"astc-5x4-unorm-srgb":{gl:a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,f:Y},"astc-5x5-unorm":{gl:a.COMPRESSED_RGBA_ASTC_5x5_KHR,f:Y},"astc-5x5-unorm-srgb":{gl:a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,f:Y},"astc-6x5-unorm":{gl:a.COMPRESSED_RGBA_ASTC_6x5_KHR,f:Y},"astc-6x5-unorm-srgb":{gl:a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,f:Y},"astc-6x6-unorm":{gl:a.COMPRESSED_RGBA_ASTC_6x6_KHR,f:Y},"astc-6x6-unorm-srgb":{gl:a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,f:Y},"astc-8x5-unorm":{gl:a.COMPRESSED_RGBA_ASTC_8x5_KHR,f:Y},"astc-8x5-unorm-srgb":{gl:a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,f:Y},"astc-8x6-unorm":{gl:a.COMPRESSED_RGBA_ASTC_8x6_KHR,f:Y},"astc-8x6-unorm-srgb":{gl:a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,f:Y},"astc-8x8-unorm":{gl:a.COMPRESSED_RGBA_ASTC_8x8_KHR,f:Y},"astc-8x8-unorm-srgb":{gl:a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,f:Y},"astc-10x5-unorm":{gl:a.COMPRESSED_RGBA_ASTC_10x10_KHR,f:Y},"astc-10x5-unorm-srgb":{gl:a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,f:Y},"astc-10x6-unorm":{gl:a.COMPRESSED_RGBA_ASTC_10x6_KHR,f:Y},"astc-10x6-unorm-srgb":{gl:a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,f:Y},"astc-10x8-unorm":{gl:a.COMPRESSED_RGBA_ASTC_10x8_KHR,f:Y},"astc-10x8-unorm-srgb":{gl:a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,f:Y},"astc-10x10-unorm":{gl:a.COMPRESSED_RGBA_ASTC_10x10_KHR,f:Y},"astc-10x10-unorm-srgb":{gl:a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,f:Y},"astc-12x10-unorm":{gl:a.COMPRESSED_RGBA_ASTC_12x10_KHR,f:Y},"astc-12x10-unorm-srgb":{gl:a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,f:Y},"astc-12x12-unorm":{gl:a.COMPRESSED_RGBA_ASTC_12x12_KHR,f:Y},"astc-12x12-unorm-srgb":{gl:a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,f:Y},"pvrtc-rgb4unorm-webgl":{gl:a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,f:lr},"pvrtc-rgba4unorm-webgl":{gl:a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,f:lr},"pvrtc-rbg2unorm-webgl":{gl:a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,f:lr},"pvrtc-rgba2unorm-webgl":{gl:a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,f:lr},"etc1-rbg-unorm-webgl":{gl:a.COMPRESSED_RGB_ETC1_WEBGL,f:Lf},"atc-rgb-unorm-webgl":{gl:a.COMPRESSED_RGB_ATC_WEBGL,f:nn},"atc-rgba-unorm-webgl":{gl:a.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,f:nn},"atc-rgbai-unorm-webgl":{gl:a.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL,f:nn}},zf=(ce={},c(ce,a.RED,1),c(ce,a.RED_INTEGER,1),c(ce,a.RG,2),c(ce,a.RG_INTEGER,2),c(ce,a.RGB,3),c(ce,a.RGB_INTEGER,3),c(ce,a.RGBA,4),c(ce,a.RGBA_INTEGER,4),c(ce,a.DEPTH_COMPONENT,1),c(ce,a.DEPTH_STENCIL,1),c(ce,a.ALPHA,1),c(ce,a.LUMINANCE,1),c(ce,a.LUMINANCE_ALPHA,2),ce),$f=(ye={},c(ye,a.FLOAT,4),c(ye,a.UNSIGNED_INT,4),c(ye,a.INT,4),c(ye,a.UNSIGNED_SHORT,2),c(ye,a.SHORT,2),c(ye,a.HALF_FLOAT,2),c(ye,a.BYTE,1),c(ye,a.UNSIGNED_BYTE,1),ye);function Mt(e,t){var r=$e(t),n=ze[r];if(!n||(H(e)?n.gl===void 0:n.gl1===void 0))return!1;var o=n.x||H(e)&&n.gl2ext||n.gl1ext;return o?Boolean(e.getExtension(o)):!0}function hi(e,t){var r;return Mt(e,t)&&((r=ze[t])===null||r===void 0?void 0:r.renderbuffer)}function $e(e){if(typeof e=="string")return e;var t=Object.entries(ze).find(function(r){var n=L(r,2),o=n[1];return o.gl===e||o.gl1===e});if(!t)throw new Error("Unknown texture format ".concat(e));return t[0]}function Dt(e,t){var r=ze[e],n=t?r?.gl:r?.gl1;if(n===void 0)throw new Error("Unsupported texture format ".concat(e));return n}function Si(e,t){var r=$e(t);if(!Mt(e,r))return!1;try{var n=or(r);if(n.signed)return!1}catch{return!1}return r.endsWith("32float")?Boolean(e.getExtension("OES_texture_float_linear")):r.endsWith("16float")?Boolean(e.getExtension("OES_texture_half_float_linear")):!0}function gi(e,t){var r=$e(t);return!(!Mt(e,r)||typeof r=="number")}function ut(e,t){var r=$e(e),n=Dt(r,t),o=or(r);return{format:n,dataFormat:Zf(o.format,o.integer,o.normalized,n),type:o.dataType?ur(o.dataType):a.UNSIGNED_BYTE,compressed:o.compressed}}function Oi(e){var t=ze[e];if(!(t!=null&&t.attachment))throw new Error("".concat(e," is not a depth stencil format"));return t.attachment}function Er(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.RGBA,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:a.RGBA,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:a.UNSIGNED_BYTE,o=null,i=null;try{o=e.createTexture(),e.bindTexture(a.TEXTURE_2D,o);var s=0,f=1,_=1,u=0,l=new Uint8Array([0,0,255,255]);e.texImage2D(e.TEXTURE_2D,s,t,f,_,u,r,n,l),i=e.createFramebuffer(),e.bindFramebuffer(a.FRAMEBUFFER,i),e.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,o,0);var E=e.checkFramebufferStatus(a.FRAMEBUFFER)===a.FRAMEBUFFER_COMPLETE;return e.bindTexture(a.TEXTURE_2D,null),E}finally{e.deleteTexture(o),e.deleteFramebuffer(i)}}function xt(e,t){var r=$e(e),n=ut(r,t),o=zf[n.dataFormat]||4,i=$f[n.type]||1;return o*i}function Zf(e,t,r,n){if(n===a.RGBA||n===a.RGB)return n;switch(e){case"r":return t&&!r?a.RED_INTEGER:a.RED;case"rg":return t&&!r?a.RG_INTEGER:a.RG;case"rgb":return t&&!r?a.RGB_INTEGER:a.RGB;case"rgba":return t&&!r?a.RGBA_INTEGER:a.RGBA;default:return a.RGBA}}function Qf(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=qf(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
20
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return i=u.done,u},e:function(u){s=!0,f=u},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(s)throw f}}}}function qf(e,t){if(e){if(typeof e=="string")return vi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vi(e,t)}}function vi(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function bi(e){var t=Jf(e),r=Qf(pi(e)),n;try{for(r.s();!(n=r.n()).done;){var o=n.value;t.add(o)}}catch(i){r.e(i)}finally{r.f()}return t}function Jf(e){e.getExtension("EXT_color_buffer_float"),e.getExtension("WEBGL_color_buffer_float"),e.getExtension("EXT_float_blend");for(var t=new Set,r=0,n=Object.keys(Ni);r<n.length;r++){var o=n[r];e_(e,o)&&t.add(o)}return t}function e_(e,t){var r=Ni[t];if(!r)return!1;var n=r||[],o=L(n,2),i=o[0],s=o[1],f=H(e)?s:i;if(typeof f=="boolean")return f;switch(t){case"texture-renderable-rgba32float-webgl":return H(e)?Boolean(e.getExtension(f)):Er(e);case"glsl-derivatives":return sn(e,f);case"glsl-frag-data":return sn(e,f,{behavior:"require"});case"glsl-frag-depth":return sn(e,f);default:return Boolean(e.getExtension(f))}}var on={};function sn(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!Ti(r))return!0;if(t in on)return on[t];var n=r.behavior||"enable",o="#extension GL_".concat(t," : ").concat(n,`
|
|
21
|
-
void main(void) {}`),i=e.createShader(e.VERTEX_SHADER);if(!i)throw new Error("shader");e.shaderSource(i,o),e.compileShader(i);var s=e.getShaderParameter(i,e.COMPILE_STATUS);return e.deleteShader(i),on[t]=s,s}var Ni={webgl:[!0,!0],webgl2:[!1,!0],"timer-query-webgl":["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],"transform-feedback-webgl2":[!1,!0],"vertex-array-object-webgl1":["OES_vertex_array_object",!0],"instanced-rendering-webgl1":["ANGLE_instanced_arrays",!0],"multiple-render-targets-webgl1":["WEBGL_draw_buffers",!0],"index-uint32-webgl1":["OES_element_index_uint",!0],"blend-minmax-webgl1":["EXT_blend_minmax",!0],"texture-blend-float-webgl1":["EXT_float_blend","EXT_float_blend"],"texture-formats-srgb-webgl1":["EXT_sRGB",!0],"texture-formats-depth-webgl1":["WEBGL_depth_texture",!0],"texture-formats-float32-webgl1":["OES_texture_float",!0],"texture-formats-float16-webgl1":["OES_texture_half_float",!0],"texture-filter-linear-float32-webgl":["OES_texture_float_linear","OES_texture_float_linear"],"texture-filter-linear-float16-webgl":["OES_texture_half_float_linear","OES_texture_half_float_linear"],"texture-filter-anisotropic-webgl":["EXT_texture_filter_anisotropic","EXT_texture_filter_anisotropic"],"texture-renderable-rgba32float-webgl":["WEBGL_color_buffer_float","EXT_color_buffer_float"],"texture-renderable-float32-webgl":[!1,"EXT_color_buffer_float"],"texture-renderable-float16-webgl":["EXT_color_buffer_half_float","EXT_color_buffer_half_float"],"glsl-frag-data":["WEBGL_draw_buffers",!0],"glsl-frag-depth":["EXT_frag_depth",!0],"glsl-derivatives":["OES_standard_derivatives",!0],"glsl-texture-lod":["EXT_shader_texture_lod",!0]};function Ci(e){var t=Nt(e);return{maxTextureDimension1D:0,maxTextureDimension2D:e.getParameter(a.MAX_TEXTURE_SIZE),maxTextureDimension3D:t?t.getParameter(a.MAX_3D_TEXTURE_SIZE):0,maxTextureArrayLayers:t?t.getParameter(a.MAX_ARRAY_TEXTURE_LAYERS):0,maxBindGroups:1,maxDynamicUniformBuffersPerPipelineLayout:0,maxDynamicStorageBuffersPerPipelineLayout:0,maxSampledTexturesPerShaderStage:e.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxSamplersPerShaderStage:e.getParameter(a.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxStorageBuffersPerShaderStage:0,maxStorageTexturesPerShaderStage:0,maxUniformBuffersPerShaderStage:t?t.getParameter(a.MAX_UNIFORM_BUFFER_BINDINGS):0,maxUniformBufferBindingSize:t?t.getParameter(a.MAX_UNIFORM_BLOCK_SIZE):0,maxStorageBufferBindingSize:0,minUniformBufferOffsetAlignment:t?t.getParameter(a.UNIFORM_BUFFER_OFFSET_ALIGNMENT):0,minStorageBufferOffsetAlignment:0,maxVertexBuffers:0,maxVertexAttributes:e.getParameter(a.MAX_VERTEX_ATTRIBS),maxVertexBufferArrayStride:2048,maxInterStageShaderComponents:t?t.getParameter(a.MAX_VARYING_COMPONENTS):0,maxComputeWorkgroupStorageSize:0,maxComputeInvocationsPerWorkgroup:0,maxComputeWorkgroupSizeX:0,maxComputeWorkgroupSizeY:0,maxComputeWorkgroupSizeZ:0,maxComputeWorkgroupsPerDimension:0}}function mi(e){var t,r=Nt(e);function n(i){return e.getParameter(i)}function o(i,s){return r?r.getParameter(i):s||0}return t={},c(t,a.ALIASED_LINE_WIDTH_RANGE,n(a.ALIASED_LINE_WIDTH_RANGE)),c(t,a.ALIASED_POINT_SIZE_RANGE,n(a.ALIASED_POINT_SIZE_RANGE)),c(t,a.MAX_TEXTURE_SIZE,n(a.MAX_TEXTURE_SIZE)),c(t,a.MAX_CUBE_MAP_TEXTURE_SIZE,n(a.MAX_CUBE_MAP_TEXTURE_SIZE)),c(t,a.MAX_TEXTURE_IMAGE_UNITS,n(a.MAX_TEXTURE_IMAGE_UNITS)),c(t,a.MAX_COMBINED_TEXTURE_IMAGE_UNITS,n(a.MAX_COMBINED_TEXTURE_IMAGE_UNITS)),c(t,a.MAX_VERTEX_TEXTURE_IMAGE_UNITS,n(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),c(t,a.MAX_RENDERBUFFER_SIZE,n(a.MAX_RENDERBUFFER_SIZE)),c(t,a.MAX_VARYING_VECTORS,n(a.MAX_VARYING_VECTORS)),c(t,a.MAX_VERTEX_ATTRIBS,n(a.MAX_VERTEX_ATTRIBS)),c(t,a.MAX_VERTEX_UNIFORM_VECTORS,n(a.MAX_VERTEX_UNIFORM_VECTORS)),c(t,a.MAX_FRAGMENT_UNIFORM_VECTORS,n(a.MAX_FRAGMENT_UNIFORM_VECTORS)),c(t,a.MAX_VIEWPORT_DIMS,n(a.MAX_VIEWPORT_DIMS)),c(t,a.MAX_TEXTURE_MAX_ANISOTROPY_EXT,n(a.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),c(t,a.MAX_3D_TEXTURE_SIZE,o(a.MAX_3D_TEXTURE_SIZE)),c(t,a.MAX_ARRAY_TEXTURE_LAYERS,o(a.MAX_ARRAY_TEXTURE_LAYERS)),c(t,a.MAX_CLIENT_WAIT_TIMEOUT_WEBGL,o(a.MAX_CLIENT_WAIT_TIMEOUT_WEBGL)),c(t,a.MAX_COLOR_ATTACHMENTS,o(a.MAX_COLOR_ATTACHMENTS)),c(t,a.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS,o(a.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS)),c(t,a.MAX_COMBINED_UNIFORM_BLOCKS,o(a.MAX_COMBINED_UNIFORM_BLOCKS)),c(t,a.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS,o(a.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS)),c(t,a.MAX_DRAW_BUFFERS,o(a.MAX_DRAW_BUFFERS)),c(t,a.MAX_ELEMENT_INDEX,o(a.MAX_ELEMENT_INDEX)),c(t,a.MAX_ELEMENTS_INDICES,o(a.MAX_ELEMENTS_INDICES)),c(t,a.MAX_ELEMENTS_VERTICES,o(a.MAX_ELEMENTS_VERTICES)),c(t,a.MAX_FRAGMENT_INPUT_COMPONENTS,o(a.MAX_FRAGMENT_INPUT_COMPONENTS)),c(t,a.MAX_FRAGMENT_UNIFORM_BLOCKS,o(a.MAX_FRAGMENT_UNIFORM_BLOCKS)),c(t,a.MAX_FRAGMENT_UNIFORM_COMPONENTS,o(a.MAX_FRAGMENT_UNIFORM_COMPONENTS)),c(t,a.MAX_SAMPLES,o(a.MAX_SAMPLES)),c(t,a.MAX_SERVER_WAIT_TIMEOUT,o(a.MAX_SERVER_WAIT_TIMEOUT)),c(t,a.MAX_TEXTURE_LOD_BIAS,o(a.MAX_TEXTURE_LOD_BIAS)),c(t,a.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS,o(a.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS)),c(t,a.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,o(a.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS)),c(t,a.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS,o(a.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS)),c(t,a.MAX_UNIFORM_BLOCK_SIZE,o(a.MAX_UNIFORM_BLOCK_SIZE)),c(t,a.MAX_UNIFORM_BUFFER_BINDINGS,o(a.MAX_UNIFORM_BUFFER_BINDINGS)),c(t,a.MAX_VARYING_COMPONENTS,o(a.MAX_VARYING_COMPONENTS)),c(t,a.MAX_VERTEX_OUTPUT_COMPONENTS,o(a.MAX_VERTEX_OUTPUT_COMPONENTS)),c(t,a.MAX_VERTEX_UNIFORM_BLOCKS,o(a.MAX_VERTEX_UNIFORM_BLOCKS)),c(t,a.MAX_VERTEX_UNIFORM_COMPONENTS,o(a.MAX_VERTEX_UNIFORM_COMPONENTS)),c(t,a.MIN_PROGRAM_TEXEL_OFFSET,o(a.MIN_PROGRAM_TEXEL_OFFSET)),c(t,a.MAX_PROGRAM_TEXEL_OFFSET,o(a.MAX_PROGRAM_TEXEL_OFFSET)),c(t,a.UNIFORM_BUFFER_OFFSET_ALIGNMENT,o(a.UNIFORM_BUFFER_OFFSET_ALIGNMENT)),t}function fn(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=O(e),e!==null););return e}function Fe(){return typeof Reflect<"u"&&Reflect.get?Fe=Reflect.get.bind():Fe=function(t,r,n){var o=fn(t,r);if(o){var i=Object.getOwnPropertyDescriptor(o,r);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Fe.apply(this,arguments)}var En=Le(we(),1);function Oe(e,t,r){var n=le.attach(e),o=n.gl;if(t_(t))return r(e);var i=t.nocatch,s=i===void 0?!0:i;be(o),Se(o,t);var f;if(s)f=r(o),ge(o);else try{f=r(o)}finally{ge(o)}return f}function t_(e){for(var t in e)return!1;return!0}function Ii(e,t,r,n){if(tt(t))return n(e);be(e.gl);try{return dr(e,t),Se(e,r),n(e)}finally{ge(e.gl)}}function yi(e,t,r){if(tt(t))return r(e);be(e.gl);try{return dr(e,t),r(e)}finally{ge(e.gl)}}function dr(e,t){var r=le.attach(e),n=r.gl;if(t.cullMode)switch(t.cullMode){case"none":n.disable(a.CULL_FACE);break;case"front":n.enable(a.CULL_FACE),n.cullFace(a.FRONT);break;case"back":n.enable(a.CULL_FACE),n.cullFace(a.BACK);break}if(t.frontFace&&n.frontFace(cn("frontFace",t.frontFace,{ccw:a.CCW,cw:a.CW})),t.depthBias!==void 0&&n.polygonOffset(t.depthBias,t.depthBiasSlopeScale||0),t.depthWriteEnabled!==void 0&&n.depthMask(n_("depthWriteEnabled",t.depthWriteEnabled)),t.depthCompare&&(t.depthCompare!=="always"?n.enable(a.DEPTH_TEST):n.disable(a.DEPTH_TEST),n.depthFunc(Rr("depthCompare",t.depthCompare))),t.stencilWriteMask){var o=t.stencilWriteMask;n.stencilMaskSeparate(a.FRONT,o),n.stencilMaskSeparate(a.BACK,o)}if(t.stencilReadMask&&C.warn("stencilReadMask not supported under WebGL"),t.stencilCompare){var i=t.stencilReadMask||4294967295,s=Rr("depthCompare",t.stencilCompare);t.stencilCompare!=="always"?n.enable(a.STENCIL_TEST):n.disable(a.STENCIL_TEST),n.stencilFuncSeparate(a.FRONT,s,0,i),n.stencilFuncSeparate(a.BACK,s,0,i)}if(t.stencilPassOperation&&t.stencilFailOperation&&t.stencilDepthFailOperation){var f=_n("stencilPassOperation",t.stencilPassOperation),_=_n("stencilFailOperation",t.stencilFailOperation),u=_n("stencilDepthFailOperation",t.stencilDepthFailOperation);n.stencilOpSeparate(a.FRONT,_,u,f),n.stencilOpSeparate(a.BACK,_,u,f)}}function Rr(e,t){return cn(e,t,{never:a.NEVER,less:a.LESS,equal:a.EQUAL,"less-equal":a.LEQUAL,greater:a.GREATER,"not-equal":a.NOTEQUAL,"greater-equal":a.GEQUAL,always:a.ALWAYS})}function _n(e,t){return cn(e,t,{keep:a.KEEP,zero:a.ZERO,replace:a.REPLACE,invert:a.INVERT,"increment-clamp":a.INCR,"decrement-clamp":a.DECR,"increment-wrap":a.INCR_WRAP,"decrement-wrap":a.DECR_WRAP})}function r_(e,t){return"Illegal parameter ".concat(t," for ").concat(e)}function cn(e,t,r){if(!(t in r))throw new Error(r_(e,t));return r[t]}function n_(e,t){return t}function Pi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function a_(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pi(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tr(e){var t={};return e.addressModeU&&(t[a.TEXTURE_WRAP_S]=un(e.addressModeU)),e.addressModeV&&(t[a.TEXTURE_WRAP_T]=un(e.addressModeV)),e.addressModeW&&(t[a.TEXTURE_WRAP_R]=un(e.addressModeW)),e.magFilter&&(t[a.TEXTURE_MAG_FILTER]=Fi(e.magFilter)),(e.minFilter||e.mipmapFilter)&&(t[a.TEXTURE_MIN_FILTER]=i_(e.minFilter||"linear",e.mipmapFilter)),e.lodMinClamp!==void 0&&(t[a.TEXTURE_MIN_LOD]=e.lodMinClamp),e.lodMaxClamp!==void 0&&(t[a.TEXTURE_MAX_LOD]=e.lodMaxClamp),e.type==="comparison-sampler"&&(t[a.TEXTURE_COMPARE_MODE]=a.COMPARE_REF_TO_TEXTURE),e.compare&&(t[a.TEXTURE_COMPARE_FUNC]=Rr("compare",e.compare)),e.maxAnisotropy&&(t[a.TEXTURE_MAX_ANISOTROPY_EXT]=e.maxAnisotropy),t}function un(e){switch(e){case"clamp-to-edge":return a.CLAMP_TO_EDGE;case"repeat":return a.REPEAT;case"mirror-repeat":return a.MIRRORED_REPEAT}}function Fi(e){switch(e){case"nearest":return a.NEAREST;case"linear":return a.LINEAR}}function i_(e,t){if(!t)return Fi(e);switch(e){case"nearest":return t==="nearest"?a.NEAREST_MIPMAP_NEAREST:a.NEAREST_MIPMAP_LINEAR;case"linear":return t==="nearest"?a.LINEAR_MIPMAP_NEAREST:a.LINEAR_MIPMAP_LINEAR}}function Bi(e){var t=a_({},e);return e[a.TEXTURE_MIN_FILTER]!==a.NEAREST&&(t[a.TEXTURE_MIN_FILTER]=a.LINEAR),t[a.TEXTURE_WRAP_S]=a.CLAMP_TO_EDGE,t[a.TEXTURE_WRAP_T]=a.CLAMP_TO_EDGE,t}var ln=Le(we(),1);function Mi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Di(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mi(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function o_(e){var t=s_();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function s_(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var f_=10,Ee=function(e){D(r,e);var t=o_(r);function r(o){var i,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,r),i=t.call(this,o,s),i.device=void 0,i.gl=void 0,i.gl2=void 0,i.handle=void 0,i.glTarget=void 0,i.glUsage=void 0,i.glIndexType=a.UNSIGNED_SHORT,i.byteLength=void 0,i.bytesUsed=void 0,i.debugData=null,i.device=o,i.gl=i.device.gl,i.gl2=i.device.gl2;var f=_e(s)==="object"?s.handle:void 0;return i.handle=f||i.gl.createBuffer(),o.setSpectorMetadata(i.handle,Di(Di({},i.props),{},{data:_e(i.props.data)})),i.glTarget=__(i.props.usage),i.glUsage=c_(i.props.usage),i.glIndexType=i.props.indexType==="uint32"?a.UNSIGNED_INT:a.UNSIGNED_SHORT,i.debugData=null,s.data?i._initWithData(s.data,s.byteOffset,s.byteLength):i._initWithByteLength(s.byteLength||0),i}var n=r.prototype;return n._initWithData=function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:i.byteLength+s;w(ArrayBuffer.isView(i));var _=this._getWriteTarget();return this.gl.bindBuffer(_,this.handle),this.gl.bufferData(_,f,this.glUsage),this.gl.bufferSubData(_,s,i),this.gl.bindBuffer(_,null),this.debugData=i.slice(0,f_),this.bytesUsed=f,this.byteLength=f,this.trackAllocatedMemory(f),this},n._initWithByteLength=function(i){w(i>=0);var s=i;i===0&&(s=new Float32Array(0));var f=this._getWriteTarget();return this.gl.bindBuffer(f,this.handle),this.gl.bufferData(f,s,this.glUsage),this.gl.bindBuffer(f,null),this.debugData=null,this.bytesUsed=i,this.byteLength=i,this},n.destroy=function(){!this.destroyed&&this.handle&&(this.removeStats(),this.trackDeallocatedMemory(),this.gl.deleteBuffer(this.handle),this.destroyed=!0,this.handle=null)},n.write=function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,f=0,_=void 0,u=this.device.isWebGL2?a.COPY_WRITE_BUFFER:this.glTarget;this.gl.bindBuffer(u,this.handle),f!==0||_!==void 0?(this.device.assertWebGL2(),this.gl2.bufferSubData(u,s,i,f,_)):this.gl.bufferSubData(u,s,i),this.gl.bindBuffer(u,null)},n.readAsync=function(){var o=oe(ln.default.mark(function s(){var f,_,u,l,E,R=arguments;return ln.default.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return _=R.length>0&&R[0]!==void 0?R[0]:0,u=R.length>1?R[1]:void 0,this.device.assertWebGL2(),u=(f=u)!==null&&f!==void 0?f:this.byteLength,l=new Uint8Array(u),E=0,this.gl.bindBuffer(a.COPY_READ_BUFFER,this.handle),this.gl2.getBufferSubData(a.COPY_READ_BUFFER,_,l,E,u),this.gl.bindBuffer(a.COPY_READ_BUFFER,null),T.abrupt("return",l);case 10:case"end":return T.stop()}},s,this)}));function i(){return o.apply(this,arguments)}return i}(),n._invalidateDebugData=function(){this.debugData=null},n._getWriteTarget=function(){return this.glTarget},n._getReadTarget=function(){return this.glTarget},I(r)}(ee);function __(e){return e&ee.INDEX?a.ELEMENT_ARRAY_BUFFER:e&ee.VERTEX?a.ARRAY_BUFFER:e&ee.UNIFORM?a.UNIFORM_BUFFER:a.ARRAY_BUFFER}function c_(e){return e&ee.INDEX?a.STATIC_DRAW:e&ee.VERTEX?a.STATIC_DRAW:e&ee.UNIFORM?a.DYNAMIC_DRAW:a.STATIC_DRAW}function u_(e){var t=l_();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function l_(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ze=function(e){D(r,e);var t=u_(r);function r(o,i){var s;return m(this,r),s=t.call(this,o,i),s.device=void 0,s.handle=void 0,s.parameters=void 0,s.device=o,s.parameters=Tr(i),s.device.isWebGL2&&(s.handle=s.handle||s.device.gl2.createSampler(),s._setSamplerParameters(s.parameters)),s}var n=r.prototype;return n.destroy=function(){this.handle&&(this.device.gl2.deleteSampler(this.handle),this.handle=void 0)},n.toString=function(){return"Sampler(".concat(this.id,",").concat(JSON.stringify(this.props),")")},n._setSamplerParameters=function(i){for(var s=0,f=Object.entries(i);s<f.length;s++){var _=L(f[s],2),u=_[0],l=_[1],E=Number(u);switch(E){case a.TEXTURE_MIN_LOD:case a.TEXTURE_MAX_LOD:this.device.gl2.samplerParameterf(this.handle,E,l);break;default:this.device.gl2.samplerParameteri(this.handle,E,l);break}}},I(r)}(Qt);function R_(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=d_(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
22
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return i=u.done,u},e:function(u){s=!0,f=u},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(s)throw f}}}}function d_(e,t){if(e){if(typeof e=="string")return xi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xi(e,t)}}function xi(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ui(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ui(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ui(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function T_(e){var t=A_();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function A_(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var p_={parameters:{},pixelStore:{},pixels:null,border:0,dataFormat:void 0,textureUnit:void 0,target:void 0},ue=function(e){D(r,e);var t=T_(r);function r(o,i){var s,f;return m(this,r),f=t.call(this,o,Ar(Ar({},p_),{},{format:"rgba8unorm"},i)),f.MAX_ATTRIBUTES=void 0,f.device=void 0,f.gl=void 0,f.gl2=void 0,f.handle=void 0,f.sampler=void 0,f.glFormat=void 0,f.type=void 0,f.dataFormat=void 0,f.mipmaps=void 0,f.target=void 0,f.textureUnit=void 0,f.loaded=!1,f._video=void 0,f.device=o,f.gl=f.device.gl,f.gl2=f.device.gl2,f.handle=f.props.handle||f.gl.createTexture(),f.device.setSpectorMetadata(f.handle,Ar(Ar({},f.props),{},{data:_e(f.props.data)})),f.glFormat=a.RGBA,f.target=h_(f.props),f.loaded=!1,typeof((s=f.props)===null||s===void 0?void 0:s.data)=="string"&&Object.assign(f.props,{data:$r(f.props.data)}),f.initialize(f.props),Object.seal(Ce(f)),f}var n=r.prototype;return n.destroy=function(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)},n.toString=function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")},n.initialize=function(){var i=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.props.dimension==="cube")return this.initializeCube(s);var f=s.data;if(f instanceof Promise)return f.then(function(g){return i.initialize(Object.assign({},s,{pixels:g,data:g}))}),this;var _=typeof HTMLVideoElement<"u"&&f instanceof HTMLVideoElement;if(_&&f.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,f.addEventListener("loadeddata",function(){return i.initialize(s)}),this;var u=s.parameters,l=u===void 0?{}:u,E=s.pixels,R=E===void 0?null:E,d=s.pixelStore,T=d===void 0?{}:d,h=s.textureUnit,b=h===void 0?void 0:h;f||(f=R);var v=s.width,y=s.height,P=s.dataFormat,F=s.type,j=s.compressed,X=j===void 0?!1:j,z=s.mipmaps,$=z===void 0?!0:z,re=s.depth,K=re===void 0?0:re,S=Dt(s.format,this.device.isWebGL2),A=this._deduceParameters({format:s.format,type:F,dataFormat:P,compressed:X,data:f,width:v,height:y});return v=A.width,y=A.height,X=A.compressed,P=A.dataFormat,F=A.type,this.width=v,this.height=y,this.glFormat=S,this.type=F,this.dataFormat=P,this.textureUnit=b,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(a.TEXTURE0+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),$&&this.device.isWebGL1&&pr(this.width,this.height)&&(C.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaps"))(),$=!1),this.mipmaps=$,this.setImageData({data:f,width:v,height:y,depth:K,format:S,type:F,dataFormat:P,parameters:T,compressed:X}),this.setSampler(s.sampler),this._setSamplerParameters(l),$&&this.generateMipmap(),_&&(this._video={video:f,parameters:l,lastTime:f.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?f.currentTime:-1}),this},n.initializeCube=function(i){var s=this,f=i.mipmaps,_=f===void 0?!0:f,u=i.parameters,l=u===void 0?{}:u;return this.setCubeMapImageData(i).then(function(){s.loaded=!0,_&&s.generateMipmap(i),s.setSampler(i.sampler),s._setSamplerParameters(l)}),this},n.setSampler=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s;i instanceof Ze?(this.sampler=i,s=i.props):(this.sampler=new Ze(this.device,i),s=i);var f=Tr(s);return this._setSamplerParameters(f),this},n.resize=function(i){var s=i.height,f=i.width,_=i.mipmaps,u=_===void 0?!1:_;return f!==this.width||s!==this.height?this.initialize({width:f,height:s,format:this.format,type:this.type,dataFormat:this.dataFormat,mipmaps:u}):this},n.update=function(){if(this._video){var i=this._video,s=i.video,f=i.parameters,_=i.lastTime;if(_===s.currentTime||s.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:s,parameters:f}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=s.currentTime}},n.generateMipmap=function(){var i=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.device.isWebGL1&&pr(this.width,this.height)?(C.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Oe(this.gl,s,function(){i.gl.generateMipmap(i.target)}),this.gl.bindTexture(this.target,null),this)},n.setImageData=function(i){var s=this;if(this.props.dimension==="3d"||this.props.dimension==="2d-array")return this.setImageData3D(i);this.trackDeallocatedMemory("Texture");var f=i.target,_=f===void 0?this.target:f,u=i.pixels,l=u===void 0?null:u,E=i.level,R=E===void 0?0:E,d=i.glFormat,T=d===void 0?this.glFormat:d,h=i.offset,b=h===void 0?0:h,v=i.parameters,y=v===void 0?{}:v,P=i.data,F=P===void 0?null:P,j=i.type,X=j===void 0?this.type:j,z=i.width,$=z===void 0?this.width:z,re=i.height,K=re===void 0?this.height:re,S=i.dataFormat,A=S===void 0?this.dataFormat:S,g=i.compressed,B=g===void 0?!1:g;F||(F=l);var U=this._deduceParameters({format:this.props.format,type:X,dataFormat:A,compressed:B,data:F,width:$,height:K});X=U.type,A=U.dataFormat,B=U.compressed,$=U.width,K=U.height;var M=this.gl;M.bindTexture(this.target,this.handle);var k=null,ne=this._getDataType({data:F,compressed:B});F=ne.data,k=ne.dataType;var Q;if(Oe(this.gl,y,function(){switch(k){case"null":M.texImage2D(_,R,T,$,K,0,A,X,F);break;case"typed-array":M.texImage2D(_,R,T,$,K,0,A,X,F,b);break;case"buffer":Q=s.device.assertWebGL2(),Q.bindBuffer(a.PIXEL_UNPACK_BUFFER,F.handle||F),Q.texImage2D(_,R,T,$,K,0,A,X,b),Q.bindBuffer(a.PIXEL_UNPACK_BUFFER,null);break;case"browser-object":s.device.isWebGL2?M.texImage2D(_,R,T,$,K,0,A,X,F):M.texImage2D(_,R,T,A,X,F);break;case"compressed":var ae=R_(F.entries()),Ae;try{for(ae.s();!(Ae=ae.n()).done;){var yn=L(Ae.value,2),yo=yn[0],Xt=yn[1];M.compressedTexImage2D(_,yo,Xt.format,Xt.width,Xt.height,0,Xt.data)}}catch(Po){ae.e(Po)}finally{ae.f()}break;default:w(!1,"Unknown image data type")}}),F&&F.byteLength)this.trackAllocatedMemory(F.byteLength,"Texture");else{var de=xt(this.props.format,this.device.isWebGL2);this.trackAllocatedMemory(this.width*this.height*de,"Texture")}return this.loaded=!0,this},n.setSubImageData=function(i){var s=this,f=i.target,_=f===void 0?this.target:f,u=i.pixels,l=u===void 0?null:u,E=i.data,R=E===void 0?null:E,d=i.x,T=d===void 0?0:d,h=i.y,b=h===void 0?0:h,v=i.width,y=v===void 0?this.width:v,P=i.height,F=P===void 0?this.height:P,j=i.level,X=j===void 0?0:j,z=i.glFormat,$=z===void 0?this.glFormat:z,re=i.type,K=re===void 0?this.type:re,S=i.dataFormat,A=S===void 0?this.dataFormat:S,g=i.compressed,B=g===void 0?!1:g,U=i.offset,M=U===void 0?0:U,k=i.parameters,ne=k===void 0?{}:k,Q=this._deduceParameters({format:this.props.format,type:K,dataFormat:A,compressed:B,data:R,width:y,height:F});if(K=Q.type,A=Q.dataFormat,B=Q.compressed,y=Q.width,F=Q.height,w(this.depth===1,"texSubImage not supported for 3D textures"),R||(R=l),R&&R.data){var de=R;R=de.data,y=de.shape[0],F=de.shape[1]}R instanceof Ee&&(R=R.handle),this.gl.bindTexture(this.target,this.handle),Oe(this.gl,ne,function(){if(B)s.gl.compressedTexSubImage2D(_,X,T,b,y,F,$,R);else if(R===null)s.gl.texSubImage2D(_,X,T,b,y,F,A,K,null);else if(ArrayBuffer.isView(R))s.gl.texSubImage2D(_,X,T,b,y,F,A,K,R,M);else if(typeof WebGLBuffer<"u"&&R instanceof WebGLBuffer){var ae=s.device.assertWebGL2();ae.bindBuffer(a.PIXEL_UNPACK_BUFFER,R),ae.texSubImage2D(_,X,T,b,y,F,A,K,M),ae.bindBuffer(a.PIXEL_UNPACK_BUFFER,null)}else if(s.device.isWebGL2){var Ae=s.device.assertWebGL2();Ae.texSubImage2D(_,X,T,b,y,F,A,K,R)}else s.gl.texSubImage2D(_,X,T,b,A,K,R)}),this.gl.bindTexture(this.target,null)},n.copyFramebuffer=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return C.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null},n.getActiveUnit=function(){return this.gl.getParameter(a.ACTIVE_TEXTURE)-a.TEXTURE0},n.bind=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,s=this.gl;return i!==void 0&&(this.textureUnit=i,s.activeTexture(s.TEXTURE0+i)),s.bindTexture(this.target,this.handle),i},n.unbind=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,s=this.gl;return i!==void 0&&(this.textureUnit=i,s.activeTexture(s.TEXTURE0+i)),s.bindTexture(this.target,null),i},n._getDataType=function(i){var s=i.data,f=i.compressed,_=f===void 0?!1:f;return _?{data:s,dataType:"compressed"}:s===null?{data:s,dataType:"null"}:ArrayBuffer.isView(s)?{data:s,dataType:"typed-array"}:s instanceof Ee?{data:s.handle,dataType:"buffer"}:typeof WebGLBuffer<"u"&&s instanceof WebGLBuffer?{data:s,dataType:"buffer"}:{data:s,dataType:"browser-object"}},n._deduceParameters=function(i){var s=i.format,f=i.data,_=i.width,u=i.height,l=i.dataFormat,E=i.type,R=i.compressed,d=ut(s,this.device.isWebGL2);l=l||d.dataFormat,E=E||d.type,R=R||d.compressed;var T=this._deduceImageSize(f,_,u);return _=T.width,u=T.height,{dataFormat:l,type:E,compressed:R,width:_,height:u,format:s,data:f}},n._deduceImageSize=function(i,s,f){var _;return typeof ImageData<"u"&&i instanceof ImageData?_={width:i.width,height:i.height}:typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement?_={width:i.naturalWidth,height:i.naturalHeight}:typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement?_={width:i.width,height:i.height}:typeof ImageBitmap<"u"&&i instanceof ImageBitmap?_={width:i.width,height:i.height}:typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement?_={width:i.videoWidth,height:i.videoHeight}:i?_={width:s,height:f}:_={width:s>=0?s:1,height:f>=0?f:1},w(_,"Could not deduced texture size"),w(s===void 0||_.width===s,"Deduced texture width does not match supplied width"),w(f===void 0||_.height===f,"Deduced texture height does not match supplied height"),_},n.setCubeMapImageData=function(){var o=oe(En.default.mark(function s(f){var _=this,u,l,E,R,d,T,h,b,v,y,P;return En.default.wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return u=this.gl,l=f.width,E=f.height,R=f.pixels,d=f.data,T=f.format,h=T===void 0?a.RGBA:T,b=f.type,v=b===void 0?a.UNSIGNED_BYTE:b,y=R||d,j.next=5,Promise.all(r.FACES.map(function(X){var z=y[X];return Promise.all(Array.isArray(z)?z:[z])}));case 5:P=j.sent,this.bind(),r.FACES.forEach(function(X,z){P[z].length>1&&_.props.mipmaps!==!1&&C.warn("".concat(_.id," has mipmap and multiple LODs."))(),P[z].forEach(function($,re){l&&E?u.texImage2D(X,re,h,l,E,0,h,v,$):u.texImage2D(X,re,h,h,v,$)})}),this.unbind();case 9:case"end":return j.stop()}},s,this)}));function i(s){return o.apply(this,arguments)}return i}(),n.setImageDataForFace=function(i){var s=this,f=i.face,_=i.width,u=i.height,l=i.pixels,E=i.data,R=i.format,d=R===void 0?a.RGBA:R,T=i.type,h=T===void 0?a.UNSIGNED_BYTE:T,b=this.gl,v=l||E;return this.bind(),v instanceof Promise?v.then(function(y){return s.setImageDataForFace(Object.assign({},i,{face:f,data:y,pixels:y}))}):this.width||this.height?b.texImage2D(f,0,d,_,u,0,d,h,v):b.texImage2D(f,0,d,d,h,v),this},n.setImageData3D=function(i){var s=this,f=i.level,_=f===void 0?0:f,u=i.dataFormat,l=i.format,E=i.type,R=i.width,d=i.height,T=i.depth,h=T===void 0?1:T,b=i.offset,v=b===void 0?0:b,y=i.data,P=i.parameters,F=P===void 0?{}:P;this.trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle);var j=ut(l,this.device.isWebGL2);if(Oe(this.gl,F,function(){ArrayBuffer.isView(y)&&s.gl.texImage3D(s.target,_,j.format,R,d,h,0,j.dataFormat,j.type,y),y instanceof Ee&&(s.gl.bindBuffer(a.PIXEL_UNPACK_BUFFER,y.handle),s.gl.texImage3D(s.target,_,u,R,d,h,0,l,E,v))}),y&&y.byteLength)this.trackAllocatedMemory(y.byteLength,"Texture");else{var X=xt(this.props.format,this.device.isWebGL2);this.trackAllocatedMemory(this.width*this.height*this.depth*X,"Texture")}return this.loaded=!0,this},n._setSamplerParameters=function(i){if(this.device.isWebGL1&&pr(this.width,this.height)&&(i=Bi(i)),!tt(i)){S_(i),this.gl.bindTexture(this.target,this.handle);for(var s=0,f=Object.entries(i);s<f.length;s++){var _=L(f[s],2),u=_[0],l=_[1],E=Number(u),R=l;switch(E){case a.TEXTURE_MIN_LOD:case a.TEXTURE_MAX_LOD:this.gl.texParameterf(this.target,E,R);break;default:this.gl.texParameteri(this.target,E,R);break}}this.gl.bindTexture(this.target,null)}},n._getWebGL1NPOTParameterOverride=function(i,s){var f=this.device.isWebGL1&&pr(this.width,this.height);if(f)switch(i){case a.TEXTURE_MIN_FILTER:if(s!==a.LINEAR&&s!==a.NEAREST)return a.LINEAR;break;case a.TEXTURE_WRAP_S:case a.TEXTURE_WRAP_T:return a.CLAMP_TO_EDGE;default:break}return s},I(r)}(se);ue.FACES=[a.TEXTURE_CUBE_MAP_POSITIVE_X,a.TEXTURE_CUBE_MAP_NEGATIVE_X,a.TEXTURE_CUBE_MAP_POSITIVE_Y,a.TEXTURE_CUBE_MAP_NEGATIVE_Y,a.TEXTURE_CUBE_MAP_POSITIVE_Z,a.TEXTURE_CUBE_MAP_NEGATIVE_Z];function h_(e){switch(e.dimension){case"2d":return a.TEXTURE_2D;case"cube":return a.TEXTURE_CUBE_MAP;case"2d-array":return a.TEXTURE_2D_ARRAY;case"3d":return a.TEXTURE_3D;case"1d":case"cube-array":default:throw new Error(e.dimension)}}function pr(e,t){return!e||!t?!1:!zt(e)||!zt(t)}function S_(e){C.log(1,"texture sampler parameters",e)()}function hr(e,t){if(typeof t!="string")return t;var r=Number(t);if(!isNaN(r))return r;t=t.replace(/^.*\./,"");var n=e[t];return w(n!==void 0,"Accessing undefined constant GL.".concat(t)),n}function g_(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=O_(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
23
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}
|
|
24
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var
|
|
25
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return i=u.done,u},e:function(u){s=!0,f=u},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(s)throw f}}}}function L_(e,t){if(e){if(typeof e=="string")return Gi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gi(e,t)}}function Gi(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function zi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function $i(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zi(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var H_="https://unpkg.com/webgl-debug@2.0.1/index.js";function Zi(e){return e.luma=e.luma||{},e.luma}function Qi(){return pn.apply(this,arguments)}function pn(){return pn=oe(An.default.mark(function e(){return An.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!(q()&&!globalThis.WebGLDebugUtils)){r.next=5;break}return globalThis.global=globalThis.global||globalThis,globalThis.global.module={},r.next=5,Ot(H_);case 5:case"end":return r.stop()}},e)})),pn.apply(this,arguments)}function qi(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e?t.debug?V_(e,t):W_(e):null}function W_(e){var t=Zi(e);return t.realContext?t.realContext:e}function V_(e,t){if(!globalThis.WebGLDebugUtils)return C.warn("webgl-debug not loaded")(),e;var r=Zi(e);if(r.debugContext)return r.debugContext;globalThis.WebGLDebugUtils.init($i($i({},a),e));var n=globalThis.WebGLDebugUtils.makeDebugContext(e,j_.bind(null,t),K_.bind(null,t));for(var o in a)!(o in n)&&typeof a[o]=="number"&&(n[o]=a[o]);var i=I(function f(){m(this,f)});Object.setPrototypeOf(n,Object.getPrototypeOf(e)),Object.setPrototypeOf(i,n);var s=Object.create(i);return r.realContext=e,r.debugContext=s,s.debug=!0,s}function Tn(e,t){t=Array.from(t).map(function(n){return n===void 0?"undefined":n});var r=globalThis.WebGLDebugUtils.glFunctionArgsToString(e,t);return r="".concat(r.slice(0,100)).concat(r.length>100?"...":""),"gl.".concat(e,"(").concat(r,")")}function j_(e,t,r,n){n=Array.from(n).map(function(_){return _===void 0?"undefined":_});var o=globalThis.WebGLDebugUtils.glEnumToString(t),i=globalThis.WebGLDebugUtils.glFunctionArgsToString(r,n),s=e.webgl2?"gl2":"gl1",f="".concat(o," in ").concat(s,".").concat(r,"(").concat(i,")");C.error(f)();debugger;if(e.throwOnError)throw new Error(f)}function K_(e,t,r){var n="";if(C.level>=1&&(n=Tn(t,r),C.log(1,n)()),e.break&&e.break.length>0){n=n||Tn(t,r);var o=e.break.every(function(_){return n.indexOf(_)!==-1});if(o)debugger}var i=X_(r),s;try{for(i.s();!(s=i.n()).done;){var f=s.value;if(f===void 0){if(n=n||Tn(t,r),e.throwOnError)throw new Error("Undefined argument: ".concat(n));C.error("Undefined argument: ".concat(n))();debugger}}}catch(_){i.e(_)}finally{i.f()}}var On=Le(we(),1);function hn(e,t){return{name:Y_(e,t),language:"glsl",version:k_(e)}}function Y_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"unnamed",r=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/,n=r.exec(e);return n?n[1]:t}function k_(e){var t=100,r=e.match(/[^\s]+/g);if(r&&r.length>=2&&r[0]==="#version"){var n=parseInt(r[1],10);Number.isFinite(n)&&(t=n)}return t}function Sn(e){return ht(e)||Ct(e)||Ke(e)||St()}function G_(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=z_(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
26
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return i=u.done,u},e:function(u){s=!0,f=u},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(s)throw f}}}}function z_(e,t){if(e){if(typeof e=="string")return Ji(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ji(e,t)}}function Ji(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var $_=["warning","error","info"];function gn(e){var t=e.split(/\r?\n/),r=[],n=G_(t),o;try{for(n.s();!(o=n.n()).done;){var i=o.value;if(!(i.length<=1)){var s=i.split(":"),f=Sn(s),_=f[0],u=f[1],l=f[2],E=f.slice(3),R=parseInt(l,10);isNaN(R)&&(R=0);var d=parseInt(u,10);isNaN(d)&&(d=0);var T=_.toLowerCase(),h=$_.includes(T)?T:"info";r.push({message:E.join(":").trim(),type:h,lineNum:R,linePos:d})}}}catch(b){n.e(b)}finally{n.f()}return r}function eo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Z_(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eo(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Q_(e){var t=q_();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function q_(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var gr=function(e){D(r,e);var t=Q_(r);function r(o,i){var s;switch(m(this,r),s=t.call(this,o,Z_({id:J_(i)},i)),s.device=void 0,s.handle=void 0,s.device=o,s.props.stage){case"vertex":s.handle=s.props.handle||s.device.gl.createShader(a.VERTEX_SHADER);break;case"fragment":s.handle=s.props.handle||s.device.gl.createShader(a.FRAGMENT_SHADER);break;default:throw new Error(s.props.stage)}return s._compile(s.source),s}var n=r.prototype;return n.destroy=function(){this.handle&&(this.removeStats(),this.device.gl.deleteShader(this.handle),this.destroyed=!0)},n.compilationInfo=function(){var o=oe(On.default.mark(function s(){var f;return On.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return f=this.device.gl.getShaderInfoLog(this.handle),u.abrupt("return",f?gn(f):[]);case 2:case"end":return u.stop()}},s,this)}));function i(){return o.apply(this,arguments)}return i}(),n._compile=function(i){var s=function(b){return b.startsWith("#version ")?b:`#version 100
|
|
27
|
-
|
|
28
|
-
`).concat(R))(),new Error("GLSL compilation errors in ".concat(d))}},I(r)}(Zt);function J_(e){return hn(e.source).name||e.id||ve("unnamed ".concat(e.stage,"-shader"))}function to(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ec(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?to(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):to(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tc(e){var t=rc();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function rc(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var nc=256,ac=1024,ic=16384,vn=6144,Or=function(e){D(r,e);var t=tc(r);function r(o,i){var s;return m(this,r),s=t.call(this,o,i),s.device=void 0,s.glParameters=void 0,s.device=o,be(s.device.gl),s.setParameters(s.props.parameters),s.clear(),s}var n=r.prototype;return n.end=function(){ge(this.device.gl),this.props.framebuffer&&Se(this.device,{framebuffer:null})},n.pushDebugGroup=function(i){},n.popDebugGroup=function(){},n.insertDebugMarker=function(i){},n.setParameters=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s={};this.props.framebuffer&&(s.framebuffer=this.props.framebuffer),this.props.depthReadOnly&&(s.depthMask=!this.props.depthReadOnly),s.stencilMask=this.props.stencilReadOnly?0:1,s[a.RASTERIZER_DISCARD]=this.props.discard,i.viewport&&(i.viewport.length>=6?(s.viewport=i.viewport.slice(0,4),s.depthRange=[i.viewport[4],i.viewport[5]]):s.viewport=i.viewport),s.scissorTest=Boolean(i.scissorRect),i.scissorRect&&(s.scissor=i.scissorRect),i.blendConstant&&(s.blendColor=i.blendConstant),i.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),i[a.STENCIL_REF]=i.stencilReference),this.glParameters=s,Se(this.device,s)},n.clear=function(){var i=this,s=ec({},this.glParameters),f=0;this.props.clearColor!==!1&&(f|=ic,s.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(f|=nc,s.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(f|=ac,s.clearStencil=this.props.clearStencil),f!==0&&Oe(this.device,s,function(){i.device.gl.clear(f)})},n.clearColorBuffer=function(){var i=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0,0];Oe(this.device.gl2,{framebuffer:this.props.framebuffer},function(){switch(f.constructor){case Int32Array:i.device.gl2.clearBufferiv(vn,s,f);break;case Uint32Array:i.device.gl2.clearBufferuiv(vn,s,f);break;case Float32Array:default:i.device.gl2.clearBufferfv(vn,s,f);break}})},I(r)}(Jt);function bn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Rt(e,t,r){return bn()?Rt=Reflect.construct.bind():Rt=function(o,i,s){var f=[null];f.push.apply(f,i);var _=Function.bind.apply(o,f),u=new _;return s&&He(u,s.prototype),u},Rt.apply(null,arguments)}var oc="Failed to deduce GL constant from typed array";function ro(e){var t=ArrayBuffer.isView(e)?e.constructor:e;switch(t){case Float32Array:return a.FLOAT;case Uint16Array:return a.UNSIGNED_SHORT;case Uint32Array:return a.UNSIGNED_INT;case Uint8Array:return a.UNSIGNED_BYTE;case Uint8ClampedArray:return a.UNSIGNED_BYTE;case Int8Array:return a.BYTE;case Int16Array:return a.SHORT;case Int32Array:return a.INT;default:throw new Error(oc)}}function wt(e,t){var r=t||{},n=r.clamped,o=n===void 0?!0:n;switch(e){case a.FLOAT:return Float32Array;case a.UNSIGNED_SHORT:case a.UNSIGNED_SHORT_5_6_5:case a.UNSIGNED_SHORT_4_4_4_4:case a.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;case a.UNSIGNED_INT:return Uint32Array;case a.UNSIGNED_BYTE:return o?Uint8ClampedArray:Uint8Array;case a.BYTE:return Int8Array;case a.SHORT:return Int16Array;case a.INT:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}var sc={offset:0,stride:0,type:a.FLOAT,size:1,divisor:0,normalized:!1,integer:!1},fc={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},vr=function(){e.getBytesPerElement=function(n){var o=wt(n.type||a.FLOAT);return o.BYTES_PER_ELEMENT},e.getBytesPerVertex=function(n){w(n.size);var o=wt(n.type||a.FLOAT);return o.BYTES_PER_ELEMENT*n.size},e.resolve=function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return Rt(e,[sc].concat(o))};function e(){var r=this;m(this,e),this.offset=void 0,this.stride=void 0,this.type=void 0,this.size=void 0,this.divisor=void 0,this.normalized=void 0,this.integer=void 0,this.buffer=void 0,this.index=void 0;for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];o.forEach(function(s){return r._assign(s)}),Object.freeze(this)}var t=e.prototype;return t.toString=function(){return JSON.stringify(this)},t._assign=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return n=kr("Accessor",n,fc),n.type!==void 0&&(this.type=n.type,(n.type===a.INT||n.type===a.UNSIGNED_INT)&&(this.integer=!0)),n.size!==void 0&&(this.size=n.size),n.offset!==void 0&&(this.offset=n.offset),n.stride!==void 0&&(this.stride=n.stride),n.normalize!==void 0&&(this.normalized=n.normalize),n.normalized!==void 0&&(this.normalized=n.normalized),n.integer!==void 0&&(this.integer=n.integer),n.divisor!==void 0&&(this.divisor=n.divisor),n.buffer!==void 0&&(this.buffer=n.buffer),n.index!==void 0&&(typeof n.index=="boolean"?this.index=n.index?1:0:this.index=n.index),n.instanced!==void 0&&(this.divisor=n.instanced?1:0),n.isInstanced!==void 0&&(this.divisor=n.isInstanced?1:0),this.offset===void 0&&delete this.offset,this.stride===void 0&&delete this.stride,this.type===void 0&&delete this.type,this.size===void 0&&delete this.size,this.divisor===void 0&&delete this.divisor,this.normalized===void 0&&delete this.normalized,this.integer===void 0&&delete this.integer,this.buffer===void 0&&delete this.buffer,this.index===void 0&&delete this.index,this},I(e,[{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}();var G;function no(e){return _c.includes(e)}var _c=[a.SAMPLER_2D,a.SAMPLER_CUBE,a.SAMPLER_3D,a.SAMPLER_2D_SHADOW,a.SAMPLER_2D_ARRAY,a.SAMPLER_2D_ARRAY_SHADOW,a.SAMPLER_CUBE_SHADOW,a.INT_SAMPLER_2D,a.INT_SAMPLER_3D,a.INT_SAMPLER_CUBE,a.INT_SAMPLER_2D_ARRAY,a.UNSIGNED_INT_SAMPLER_2D,a.UNSIGNED_INT_SAMPLER_3D,a.UNSIGNED_INT_SAMPLER_CUBE,a.UNSIGNED_INT_SAMPLER_2D_ARRAY],ao=(G={},c(G,a.FLOAT,[a.FLOAT,1,"float","f32","float32"]),c(G,a.FLOAT_VEC2,[a.FLOAT,2,"vec2","vec2<f32>","float32x2"]),c(G,a.FLOAT_VEC3,[a.FLOAT,3,"vec3","vec3<f32>","float32x3"]),c(G,a.FLOAT_VEC4,[a.FLOAT,4,"vec4","vec4<f32>","float32x4"]),c(G,a.INT,[a.INT,1,"int","i32","sint32"]),c(G,a.INT_VEC2,[a.INT,2,"ivec2","vec2<i32>","sint32x2"]),c(G,a.INT_VEC3,[a.INT,3,"ivec3","vec3<i32>","sint32x3"]),c(G,a.INT_VEC4,[a.INT,4,"ivec4","vec4<i32>","sint32x4"]),c(G,a.UNSIGNED_INT,[a.UNSIGNED_INT,1,"uint","u32","uint32"]),c(G,a.UNSIGNED_INT_VEC2,[a.UNSIGNED_INT,2,"uvec2","vec2<u32>","uint32x2"]),c(G,a.UNSIGNED_INT_VEC3,[a.UNSIGNED_INT,3,"uvec3","vec3<u32>","uint32x3"]),c(G,a.UNSIGNED_INT_VEC4,[a.UNSIGNED_INT,4,"uvec4","vec4<u32>","uint32x4"]),c(G,a.BOOL,[a.FLOAT,1,"bool","f32","float32"]),c(G,a.BOOL_VEC2,[a.FLOAT,2,"bvec2","vec2<f32>","float32x2"]),c(G,a.BOOL_VEC3,[a.FLOAT,3,"bvec3","vec3<f32>","float32x3"]),c(G,a.BOOL_VEC4,[a.FLOAT,4,"bvec4","vec4<f32>","float32x4"]),c(G,a.FLOAT_MAT2,[a.FLOAT,8,"mat2","mat2x2<f32>"]),c(G,a.FLOAT_MAT2x3,[a.FLOAT,8,"mat2x3","mat2x3<f32>"]),c(G,a.FLOAT_MAT2x4,[a.FLOAT,8,"mat2x4","mat2x4<f32>"]),c(G,a.FLOAT_MAT3x2,[a.FLOAT,12,"mat3x2","mat3x2<f32>"]),c(G,a.FLOAT_MAT3,[a.FLOAT,12,"mat3","mat3x3<f32>"]),c(G,a.FLOAT_MAT3x4,[a.FLOAT,12,"mat3x4","mat3x4<f32>"]),c(G,a.FLOAT_MAT4x2,[a.FLOAT,16,"mat4x2","mat4x2<f32>"]),c(G,a.FLOAT_MAT4x3,[a.FLOAT,16,"mat4x3","mat4x3<f32>"]),c(G,a.FLOAT_MAT4,[a.FLOAT,16,"mat4","mat4x4<f32>"]),G);function Nn(e){var t=ao[e];if(!t)throw new Error("uniform");var r=L(t,4),n=r[0],o=r[1],i=r[3];return{format:i,components:o,glType:n}}function io(e){var t=ao[e];if(!t)throw new Error("attribute");var r=L(t,5),n=r[1],o=r[3],i=r[4],s=o;return{attributeType:s,vertexFormat:i,components:n}}var ie;function oo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function so(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oo(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function br(e,t){var r={attributes:[],bindings:[]};r.attributes=cc(e,t);for(var n=Ec(e,t),o=0,i=n;o<i.length;o++){var s=i[o],f=s.uniforms.map(function(v){return{name:v.name,format:v.format,byteOffset:v.byteOffset,byteStride:v.byteStride,arrayLength:v.arrayLength}});r.bindings.push({type:"uniform",name:s.name,location:s.location,visibility:(s.vertex?1:0)&(s.fragment?2:0),minBindingSize:s.byteLength,uniforms:f})}for(var _=lc(e,t),u=0,l=0,E=_;l<E.length;l++){var R=E[l];if(no(R.type)){var d=dc(R.type),T=d.viewDimension,h=d.sampleType;r.bindings.push({type:"texture",name:R.name,location:u,viewDimension:T,sampleType:h}),R.textureUnit=u,u+=1}}_.length&&(r.uniforms=_);var b=uc(e,t);return b!=null&&b.length&&(r.varyings=b),r}function cc(e,t){for(var r=[],n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),o=0;o<n;o++){var i=e.getActiveAttrib(t,o);if(!i)throw new Error("activeInfo");var s=i.name,f=i.type,_=e.getAttribLocation(t,s);if(_>=0){var u=io(f),l=u.attributeType,E=/instance/i.test(s)?"instance":"vertex";r.push({name:s,location:_,stepMode:E,type:l})}}return r.sort(function(R,d){return R.location-d.location}),r}function uc(e,t){if(!H(e))return[];for(var r=e,n=[],o=e.getProgramParameter(t,a.TRANSFORM_FEEDBACK_VARYINGS),i=0;i<o;i++){var s=r.getTransformFeedbackVarying(t,i);if(!s)throw new Error("activeInfo");var f=s.name,_=s.type,u=s.size,l=Nn(_),E=l.glType,R=l.components,d=new vr({type:E,size:u*R}),T={location:i,name:f,accessor:d};n.push(T)}return n.sort(function(h,b){return h.location-b.location}),n}function lc(e,t){for(var r=[],n=e.getProgramParameter(t,a.ACTIVE_UNIFORMS),o=0;o<n;o++){var i=e.getActiveUniform(t,o);if(!i)throw new Error("activeInfo");var s=i.name,f=i.size,_=i.type,u=Tc(s),l=u.name,E=u.isArray,R=e.getUniformLocation(t,l),d={location:R,name:l,size:f,type:_,isArray:E};if(r.push(d),d.size>1)for(var T=0;T<d.size;T++){var h="".concat(l,"[").concat(T,"]");R=e.getUniformLocation(t,h);var b=so(so({},d),{},{name:h,location:R});r.push(b)}}return r}function Ec(e,t){if(!H(e))return[];for(var r=e,n=function(b,v){return r.getActiveUniformBlockParameter(t,b,v)},o=[],i=r.getProgramParameter(t,a.ACTIVE_UNIFORM_BLOCKS),s=0;s<i;s++){for(var f={name:r.getActiveUniformBlockName(t,s)||"",location:n(s,a.UNIFORM_BLOCK_BINDING),byteLength:n(s,a.UNIFORM_BLOCK_DATA_SIZE),vertex:n(s,a.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER),fragment:n(s,a.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER),uniformCount:n(s,a.UNIFORM_BLOCK_ACTIVE_UNIFORMS),uniforms:[]},_=n(s,a.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES)||[],u=r.getActiveUniforms(t,_,a.UNIFORM_TYPE),l=r.getActiveUniforms(t,_,a.UNIFORM_SIZE),E=r.getActiveUniforms(t,_,a.UNIFORM_OFFSET),R=r.getActiveUniforms(t,_,a.UNIFORM_ARRAY_STRIDE),d=0;d<f.uniformCount;++d){var T=r.getActiveUniform(t,_[d]);if(!T)throw new Error("activeInfo");f.uniforms.push({name:T.name,format:Nn(u[d]).format,type:u[d],arrayLength:l[d],byteOffset:E[d],byteStride:R[d]})}o.push(f)}return o.sort(function(h,b){return h.location-b.location}),o}var Rc=(ie={},c(ie,a.SAMPLER_2D,["2d","float"]),c(ie,a.SAMPLER_CUBE,["cube","float"]),c(ie,a.SAMPLER_3D,["3d","float"]),c(ie,a.SAMPLER_2D_SHADOW,["3d","depth"]),c(ie,a.SAMPLER_2D_ARRAY,["2d-array","float"]),c(ie,a.SAMPLER_2D_ARRAY_SHADOW,["2d-array","depth"]),c(ie,a.SAMPLER_CUBE_SHADOW,["cube","float"]),c(ie,a.INT_SAMPLER_2D,["2d","sint"]),c(ie,a.INT_SAMPLER_3D,["3d","sint"]),c(ie,a.INT_SAMPLER_CUBE,["cube","sint"]),c(ie,a.INT_SAMPLER_2D_ARRAY,["2d-array","uint"]),c(ie,a.UNSIGNED_INT_SAMPLER_2D,["2d","uint"]),c(ie,a.UNSIGNED_INT_SAMPLER_3D,["3d","uint"]),c(ie,a.UNSIGNED_INT_SAMPLER_CUBE,["cube","uint"]),c(ie,a.UNSIGNED_INT_SAMPLER_2D_ARRAY,["2d-array","uint"]),ie);function dc(e){var t=Rc[e];if(!t)throw new Error("sampler");var r=L(t,2),n=r[0],o=r[1];return{viewDimension:n,sampleType:o}}function Tc(e){if(e[e.length-1]!=="]")return{name:e,length:1,isArray:!1};var t=/([^[]*)(\[[0-9]+\])?/,r=t.exec(e);if(!r||r.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(e));return{name:r[1],length:r[2]?1:0,isArray:Boolean(r[2])}}function fo(e,t,r,n){var o=e,i=n;i===!0&&(i=1),i===!1&&(i=0);var s=typeof i=="number"?[i]:i;switch(r){case a.SAMPLER_2D:case a.SAMPLER_CUBE:case a.SAMPLER_3D:case a.SAMPLER_2D_SHADOW:case a.SAMPLER_2D_ARRAY:case a.SAMPLER_2D_ARRAY_SHADOW:case a.SAMPLER_CUBE_SHADOW:case a.INT_SAMPLER_2D:case a.INT_SAMPLER_3D:case a.INT_SAMPLER_CUBE:case a.INT_SAMPLER_2D_ARRAY:case a.UNSIGNED_INT_SAMPLER_2D:case a.UNSIGNED_INT_SAMPLER_3D:case a.UNSIGNED_INT_SAMPLER_CUBE:case a.UNSIGNED_INT_SAMPLER_2D_ARRAY:if(typeof n!="number")throw new Error("samplers must be set to integers");return e.uniform1i(t,n);case a.FLOAT:return e.uniform1fv(t,s);case a.FLOAT_VEC2:return e.uniform2fv(t,s);case a.FLOAT_VEC3:return e.uniform3fv(t,s);case a.FLOAT_VEC4:return e.uniform4fv(t,s);case a.INT:return e.uniform1iv(t,s);case a.INT_VEC2:return e.uniform2iv(t,s);case a.INT_VEC3:return e.uniform3iv(t,s);case a.INT_VEC4:return e.uniform4iv(t,s);case a.BOOL:return e.uniform1iv(t,s);case a.BOOL_VEC2:return e.uniform2iv(t,s);case a.BOOL_VEC3:return e.uniform3iv(t,s);case a.BOOL_VEC4:return e.uniform4iv(t,s);case a.UNSIGNED_INT:return o.uniform1uiv(t,s,1);case a.UNSIGNED_INT_VEC2:return o.uniform2uiv(t,s,2);case a.UNSIGNED_INT_VEC3:return o.uniform3uiv(t,s,3);case a.UNSIGNED_INT_VEC4:return o.uniform4uiv(t,s,4);case a.FLOAT_MAT2:return e.uniformMatrix2fv(t,!1,s);case a.FLOAT_MAT3:return e.uniformMatrix3fv(t,!1,s);case a.FLOAT_MAT4:return e.uniformMatrix4fv(t,!1,s);case a.FLOAT_MAT2x3:return o.uniformMatrix2x3fv(t,!1,s);case a.FLOAT_MAT2x4:return o.uniformMatrix2x4fv(t,!1,s);case a.FLOAT_MAT3x2:return o.uniformMatrix3x2fv(t,!1,s);case a.FLOAT_MAT3x4:return o.uniformMatrix3x4fv(t,!1,s);case a.FLOAT_MAT4x2:return o.uniformMatrix4x2fv(t,!1,s);case a.FLOAT_MAT4x3:return o.uniformMatrix4x3fv(t,!1,s)}throw new Error("Illegal uniform")}function _o(e){switch(e){case"point-list":return a.POINTS;case"line-list":return a.LINES;case"line-strip":return a.LINE_STRIP;case"line-loop-webgl":return a.LINE_LOOP;case"triangle-list":return a.TRIANGLES;case"triangle-strip":return a.TRIANGLE_STRIP;case"triangle-fan-webgl":return a.TRIANGLE_FAN;default:throw new Error(e)}}function co(e){switch(e){case"point-list":return a.POINTS;case"line-list":return a.LINES;case"line-strip":return a.LINES;case"line-loop-webgl":return a.LINES;case"triangle-list":return a.TRIANGLES;case"triangle-strip":return a.TRIANGLES;case"triangle-fan-webgl":return a.TRIANGLES;default:throw new Error(e)}}function uo(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Ac(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
29
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return i=u.done,u},e:function(u){s=!0,f=u},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(s)throw f}}}}function Ac(e,t){if(e){if(typeof e=="string")return lo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lo(e,t)}}function lo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function pc(e){var t=hc();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function hc(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Eo=4,Nr=function(e){D(r,e);var t=pc(r);function r(o,i){var s;m(this,r),s=t.call(this,o,i),s.device=void 0,s.handle=void 0,s.vs=void 0,s.fs=void 0,s.introspectedLayout=void 0,s.uniforms={},s.bindings={},s.varyings=null,s._uniformCount=0,s._uniformSetters={},s.device=o,s.handle=s.props.handle||s.device.gl.createProgram(),s.device.setSpectorMetadata(s.handle,{id:s.props.id}),s.vs=i.vs,s.fs=i.fs;var f=i.varyings,_=i.bufferMode,u=_===void 0?a.SEPARATE_ATTRIBS:_;if(f&&f.length>0){var l;s.device.assertWebGL2(),s.varyings=f,(l=s.device.gl2)===null||l===void 0||l.transformFeedbackVaryings(s.handle,f,u)}return s._compileAndLink(),s.introspectedLayout=br(s.device.gl,s.handle),s.shaderLayout=Hr(s.introspectedLayout,i.shaderLayout),s}var n=r.prototype;return n.destroy=function(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)},n.setBindings=function(i){for(var s=this,f=function(){var R=L(u[_],2),d=R[0],T=R[1],h=s.shaderLayout.bindings.find(function(v){return v.name===d})||s.shaderLayout.bindings.find(function(v){return v.name==="".concat(d,"Uniforms")});if(!h){var b=s.shaderLayout.bindings.map(function(v){return'"'.concat(v.name,'"')}).join(", ");return C.warn('Unknown binding "'.concat(d,'" in render pipeline "').concat(s.id,'", expected one of ').concat(b))(),"continue"}switch(T||C.warn('Unsetting binding "'.concat(d,'" in render pipeline "').concat(s.id,'"'))(),h.type){case"uniform":if(!(T instanceof Ee)&&!(T.buffer instanceof Ee))throw new Error("buffer value");break;case"texture":if(!(T instanceof ue||T instanceof Be))throw new Error("texture value");break;case"sampler":C.warn("Ignoring sampler ".concat(d))();break;default:throw new Error(h.type)}s.bindings[d]=T},_=0,u=Object.entries(i);_<u.length;_++)var l=f()},n.setUniforms=function(i){var s=Kr(i),f=s.bindings;Object.keys(f).forEach(function(_){C.warn('Unsupported value "'.concat(f[_],'" used in setUniforms() for key ').concat(_,". Use setBindings() instead?"))()}),Object.assign(this.uniforms,i)},n.draw=function(i){var s,f=this,_=i.renderPass,u=i.vertexArray,l=i.vertexCount,E=i.instanceCount,R=i.firstVertex,d=R===void 0?0:R,T=i.transformFeedback,h=_o(this.props.topology),b=Boolean(u.indexBuffer),v=(s=u.indexBuffer)===null||s===void 0?void 0:s.glIndexType,y=Number(E)>0;if(!this._areTexturesRenderable()||l===0)return!1;this.device.gl.useProgram(this.handle),u.bindBeforeRender(_),T&&T.begin(this.props.topology),this._applyBindings(),this._applyUniforms();var P=_;return Ii(this.device,this.props.parameters,P.glParameters,function(){if(b&&y){var F;(F=f.device.gl2)===null||F===void 0||F.drawElementsInstanced(h,l||0,v,d,E||0)}else if(b)f.device.gl.drawElements(h,l||0,v,d);else if(y){var j;(j=f.device.gl2)===null||j===void 0||j.drawArraysInstanced(h,d,l||0,E||0)}else f.device.gl.drawArrays(h,d,l||0);T&&T.end()}),u.unbindAfterRender(_),!0},n._compileAndLink=function(){var i=this.device.gl;i.attachShader(this.handle,this.vs.handle),i.attachShader(this.handle,this.fs.handle),C.time(Eo,"linkProgram for ".concat(this.id))(),i.linkProgram(this.handle),C.timeEnd(Eo,"linkProgram for ".concat(this.id))(),!i.debug&&C.level;var s=i.getProgramParameter(this.handle,i.LINK_STATUS);if(!s)throw new Error("Error linking: ".concat(i.getProgramInfoLog(this.handle)));i.validateProgram(this.handle);var f=i.getProgramParameter(this.handle,i.VALIDATE_STATUS);if(!f)throw new Error("Error validating: ".concat(i.getProgramInfoLog(this.handle)))},n._areTexturesRenderable=function(){for(var i=!0,s=0,f=Object.entries(this.bindings);s<f.length;s++){var _=L(f[s],2),u=_[1];u instanceof ue&&(u.update(),i=i&&u.loaded)}return i},n._applyBindings=function(){this.device.gl.useProgram(this.handle);var i=this.device.gl2;if(!i)throw new Error("bindings");var s=0,f=0,_=uo(this.shaderLayout.bindings),u;try{for(_.s();!(u=_.n()).done;){var l=u.value,E=this.bindings[l.name]||this.bindings[l.name.replace(/Uniforms$/,"")];if(!E)throw new Error("No value for binding ".concat(l.name," in ").concat(this.id));switch(l.type){case"uniform":var R=l.name,d=i.getUniformBlockIndex(this.handle,R);if(d===a.INVALID_INDEX)throw new Error("Invalid uniform block name ".concat(R));i.uniformBlockBinding(this.handle,f,d),E instanceof Ee?i.bindBufferBase(a.UNIFORM_BUFFER,f,E.handle):i.bindBufferRange(a.UNIFORM_BUFFER,f,E.buffer.handle,E.offset||0,E.size||E.buffer.byteLength-E.offset),f+=1;break;case"texture":if(!(E instanceof ue||E instanceof Be))throw new Error("texture");var T=void 0;if(E instanceof ue)T=E;else if(E instanceof Be&&E.colorAttachments[0]instanceof ue)C.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),T=E.colorAttachments[0];else throw new Error("No texture");i.activeTexture(a.TEXTURE0+s),i.bindTexture(T.target,T.handle),s+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error("binding type '".concat(l.type,"' not supported in WebGL"))}}}catch(h){_.e(h)}finally{_.f()}},n._applyUniforms=function(){var i=uo(this.shaderLayout.uniforms||[]),s;try{for(i.s();!(s=i.n()).done;){var f,_=s.value,u=_.name,l=_.location,E=_.type,R=_.textureUnit,d=(f=this.uniforms[u])!==null&&f!==void 0?f:R;d!==void 0&&fo(this.device.gl,l,E,d)}}catch(T){i.e(T)}finally{i.f()}},I(r)}(qt);function Sc(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=gc(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
30
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}
|
|
31
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return i=u.done,u},e:function(u){s=!0,f=u},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(s)throw f}}}}function xc(e,t){if(e){if(typeof e=="string")return ho(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ho(e,t)}}function ho(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Uc(e){var t=wc();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function wc(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ir=function(e){D(r,e);var t=Uc(r);function r(o,i){var s;return m(this,r),s=t.call(this,o,i),s.device=void 0,s.gl2=void 0,s.handle=void 0,s.layout=void 0,s.buffers={},s.unusedBuffers={},s.bindOnUse=!0,s._bound=!1,o.assertWebGL2(),s.device=o,s.gl2=o.gl2,s.handle=s.props.handle||s.gl2.createTransformFeedback(),s.layout=s.props.layout,i.buffers&&s.setBuffers(i.buffers),Object.seal(Ce(s)),s}var n=r.prototype;return n.destroy=function(){this.gl2.deleteTransformFeedback(this.handle),Fe(O(r.prototype),"destroy",this).call(this)},n.begin=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"point-list";this.gl2.bindTransformFeedback(a.TRANSFORM_FEEDBACK,this.handle),this.bindOnUse&&this._bindBuffers(),this.gl2.beginTransformFeedback(co(i))},n.end=function(){this.gl2.endTransformFeedback(),this.bindOnUse||this._unbindBuffers(),this.gl2.bindTransformFeedback(a.TRANSFORM_FEEDBACK,null)},n.setBuffers=function(i){var s=this;this.buffers={},this.unusedBuffers={},this.bind(function(){for(var f in i)s.setBuffer(f,i[f])})},n.setBuffer=function(i,s){var f=this._getVaryingIndex(i),_=this._getBufferRange(s),u=_.buffer,l=_.byteLength,E=_.byteOffset;if(f<0){this.unusedBuffers[i]=u,C.warn("".concat(this.id," unusedBuffers varying buffer ").concat(i))();return}this.buffers[f]={buffer:u,byteLength:l,byteOffset:E},this.bindOnUse||this._bindBuffer(f,u,E,l)},n.getBuffer=function(i){if(So(i))return this.buffers[i]||null;var s=this._getVaryingIndex(i);return s>=0?this.buffers[s]:null},n.bind=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.handle;if(typeof i!="function")return this.gl2.bindTransformFeedback(a.TRANSFORM_FEEDBACK,i),this;var s;return this._bound?s=i():(this.gl2.bindTransformFeedback(a.TRANSFORM_FEEDBACK,this.handle),this._bound=!0,s=i(),this._bound=!1,this.gl2.bindTransformFeedback(a.TRANSFORM_FEEDBACK,null)),s},n.unbind=function(){this.bind(null)},n._getBufferRange=function(i){if(i instanceof Ee)return{buffer:i,byteOffset:0,byteLength:i.byteLength};var s=i.buffer,f=i.byteOffset,_=f===void 0?0:f,u=i.byteLength,l=u===void 0?i.buffer.byteLength:u;return{buffer:s,byteOffset:_,byteLength:l}},n._getVaryingIndex=function(i){if(So(i))return Number(i);var s=Dc(this.layout.varyings),f;try{for(s.s();!(f=s.n()).done;){var _=f.value;if(i===_.name)return _.location}}catch(u){s.e(u)}finally{s.f()}return-1},n._bindBuffers=function(){for(var i in this.buffers){var s=this._getBufferRange(this.buffers[i]),f=s.buffer,_=s.byteLength,u=s.byteOffset;this._bindBuffer(Number(i),f,u,_)}},n._unbindBuffers=function(){for(var i in this.buffers)this.gl2.bindBufferBase(a.TRANSFORM_FEEDBACK_BUFFER,Number(i),null)},n._bindBuffer=function(i,s){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,_=arguments.length>3?arguments[3]:void 0,u=s&&s.handle;!u||_===void 0?this.gl2.bindBufferBase(a.TRANSFORM_FEEDBACK_BUFFER,i,u):this.gl2.bindBufferRange(a.TRANSFORM_FEEDBACK_BUFFER,i,u,f,_)},I(r)}(ar);function So(e){return typeof e=="number"?Number.isInteger(e):/^\d+$/.test(e)}function go(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Me(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?go(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):go(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xc(e){var t=Lc();return function(){var n=O(e),o;if(t){var i=O(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return x(this,o)}}function Lc(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var yr=1,le=function(e){D(r,e);var t=Xc(r);r.isSupported=function(){return typeof WebGLRenderingContext<"u"||Dn()},r.attach=function(i){if(i instanceof r)return i;if(i?.device instanceof pt)return i.device;if(!Hc(i))throw new Error("Invalid WebGLRenderingContext");return new r({gl:i})},r.create=function(){var o=oe(Cn.default.mark(function s(){var f,_,u=arguments;return Cn.default.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(f=u.length>0&&u[0]!==void 0?u[0]:{},C.groupCollapsed(yr,"WebGLDevice created"),typeof f.canvas!="string"){E.next=5;break}return E.next=5,nt.pageLoaded;case 5:if(!(C.get("debug")||f.debug)){E.next=8;break}return E.next=8,Qi();case 8:if(_=f.spector,!(C.get("spector")||_)){E.next=12;break}return E.next=12,Yi();case 12:if(C.probe(yr+1,"DOM is loaded")(),!(f.gl&&f.gl.device)){E.next=15;break}return E.abrupt("return",r.attach(f.gl));case 15:return E.abrupt("return",new r(f));case 16:case"end":return E.stop()}},s)}));function i(){return o.apply(this,arguments)}return i}();function r(o){var i,s;m(this,r),s=t.call(this,Me(Me({},o),{},{id:o.id||ve("webgl-device")})),s.info=void 0,s.canvasContext=void 0,s.handle=void 0,s.lost=void 0,s._resolveContextLost=void 0,s._features=void 0,s._limits=void 0,s.renderPass=null,s.gl=void 0,s.gl2=null,s.debug=!1,s.isWebGL1=void 0,s.isWebGL2=void 0,s._canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1},s._extensions={},s._polyfilled=!1,s.spector=void 0,s._webglLimits=void 0,s._constants=void 0;var f=(i=o.gl)===null||i===void 0?void 0:i.device;if(f)throw new Error("WebGL context already attached to device ".concat(f.id));s.canvasContext=new Sr(Ce(s),o),s.lost=new Promise(function(b){s._resolveContextLost=b});var _=function(v){var y,P;return(y=(P=s)._resolveContextLost)===null||y===void 0?void 0:y.call(P,{reason:"destroyed",message:"Computer entered sleep mode, or too many apps or browser tabs are using the GPU."})},u=o.gl||null;if(u=u||(q()?Ri(s.canvasContext.canvas,Me(Me({},o),{},{onContextLost:_})):null),u=u||(q()?null:xn(Me(Me({},o),{},{onContextLost:_}))),!u)throw new Error("WebGL context creation failed");s.handle=u,s.gl=s.handle,s.gl2=s.gl,s.isWebGL2=Wc(s.gl),s.isWebGL1=!s.isWebGL2,s.info=di(s.gl),s.gl.device=Ce(s),s.gl._version=s.isWebGL2?2:1,_r(s.gl);var l=o.enable,E=l===void 0?!0:l,R=o.copyState,d=R===void 0?!1:R;if(yt(s.gl,{enable:E,copyState:d,log:function(){for(var v=arguments.length,y=new Array(v),P=0;P<v;P++)y[P]=arguments[P];return C.log.apply(C,[1].concat(y))()}}),q()&&o.debug&&(s.gl=qi(s.gl,Me(Me({},o),{},{webgl2:s.isWebGL2,throwOnError:!0})),s.gl2=s.gl,s.debug=!0,C.level=Math.max(C.level,1),C.warn("WebGL debug mode activated. Performance reduced.")()),q()&&o.spector){var T=s.handle.canvas||o.canvas;s.spector=ki(Me(Me({},s.props),{},{canvas:T}))}var h="Created ".concat(s.info.type).concat(s.debug?" debug":""," context: ").concat(s.info.vendor,", ").concat(s.info.renderer," for canvas: ").concat(s.canvasContext.id);return C.probe(yr,h)(),C.groupEnd(yr)(),s}var n=r.prototype;return n.destroy=function(){var i=this.gl.getExtension("STACKGL_destroy_context");i&&i.destroy()},n.getSize=function(){return[this.gl.drawingBufferWidth,this.gl.drawingBufferHeight]},n.isTextureFormatSupported=function(i){return Mt(this.gl,i)},n.isTextureFormatFilterable=function(i){return Si(this.gl,i)},n.isTextureFormatRenderable=function(i){return gi(this.gl,i)},n.assertWebGL2=function(){if(!this.gl2)throw new Error("Requires WebGL2");return this.gl2},n.createCanvasContext=function(i){throw new Error("WebGL only supports a single canvas")},n.createBuffer=function(i){var s=this._getBufferProps(i);return new Ee(this,s)},n._createTexture=function(i){return new ue(this,i)},n.createExternalTexture=function(i){throw new Error("createExternalTexture() not implemented")},n.createSampler=function(i){return new Ze(this,i)},n.createShader=function(i){return new gr(this,i)},n.createFramebuffer=function(i){return new Be(this,i)},n.createRenderPipeline=function(i){return new Nr(this,i)},n.createVertexArray=function(i){return new mr(this,i)},n.beginRenderPass=function(i){return new Or(this,i)},n.createComputePipeline=function(i){throw new Error("ComputePipeline not supported in WebGL")},n.beginComputePass=function(i){throw new Error("ComputePass not supported in WebGL")},n.createTransformFeedback=function(i){return new Ir(this,i)},n.getDefaultRenderPass=function(){return this.renderPass=this.renderPass||this.beginRenderPass({framebuffer:this.canvasContext.getCurrentFramebuffer()}),this.renderPass},n.createCommandEncoder=function(i){return new Cr(this,i)},n.submit=function(){var i;(i=this.renderPass)===null||i===void 0||i.end(),this.renderPass=null},n.loseDevice=function(){var i,s=!1,f=this.gl.getExtension("WEBGL_lose_context");return f&&(s=!0,f.loseContext()),(i=this._resolveContextLost)===null||i===void 0||i.call(this,{reason:"destroyed",message:"Application triggered context loss"}),s},n.pushState=function(){be(this.gl)},n.popState=function(){ge(this.gl)},n.setSpectorMetadata=function(i,s){i.__SPECTOR_Metadata=s},n.getGLKey=function(i,s){s=s||this.gl2||this.gl;var f=Number(i);for(var _ in s)if(s[_]===f)return"GL.".concat(_);return String(i)},n.setConstantAttribute=function(i,s){this._constants=this._constants||new Array(this.limits.maxVertexAttributes).fill(null);var f=this._constants[i];switch(f&&Yc(f,s)&&C.info(1,"setConstantAttribute(".concat(i,") could have been skipped, value unchanged"))(),this._constants[i]=s,s.constructor){case Float32Array:Vc(this,i,s);break;case Int32Array:jc(this,i,s);break;case Uint32Array:Kc(this,i,s);break;default:w(!1)}},I(r,[{key:"features",get:function(){return this._features=this._features||bi(this.gl),this._features}},{key:"limits",get:function(){return this._limits=this._limits||Ci(this.gl),this._limits}},{key:"isLost",get:function(){return this.gl.isContextLost()}},{key:"webglLimits",get:function(){return this._webglLimits=this._webglLimits||mi(this.gl),this._webglLimits}}]),r}(pt);le.type="webgl";function Hc(e){return typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&Number.isFinite(e._version))}function Wc(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&e._version===2)}function Vc(e,t,r){switch(r.length){case 1:e.gl.vertexAttrib1fv(t,r);break;case 2:e.gl.vertexAttrib2fv(t,r);break;case 3:e.gl.vertexAttrib3fv(t,r);break;case 4:e.gl.vertexAttrib4fv(t,r);break;default:w(!1)}}function jc(e,t,r){var n;e.assertWebGL2(),(n=e.gl2)===null||n===void 0||n.vertexAttribI4iv(t,r)}function Kc(e,t,r){var n;e.assertWebGL2(),(n=e.gl2)===null||n===void 0||n.vertexAttribI4uiv(t,r)}function Yc(e,t){if(!e||!t||e.length!==t.length||e.constructor!==t.constructor)return!1;for(var r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}var kc=256,Gc=1024,zc=16384;var $c="clear: bad arguments";function Oo(e,t){var r=le.attach(e),n=t||{},o=n.framebuffer,i=o===void 0?null:o,s=n.color,f=s===void 0?null:s,_=n.depth,u=_===void 0?null:_,l=n.stencil,E=l===void 0?null:l,R={};i&&(R.framebuffer=i);var d=0;f&&(d|=zc,f!==!0&&(R.clearColor=f)),u&&(d|=kc,u!==!0&&(R.clearDepth=u)),E&&(d|=Gc,u!==!0&&(R.clearStencil=u)),w(d!==0,$c),Oe(r.gl,R,function(){r.gl.clear(d)})}function mn(e){switch(e){case a.ALPHA:case a.R32F:case a.RED:return 1;case a.RG32F:case a.RG:return 2;case a.RGB:case a.RGB32F:return 3;case a.RGBA:case a.RGBA32F:return 4;default:return w(!1),0}}function vo(e){switch(e){case a.UNSIGNED_BYTE:return 1;case a.UNSIGNED_SHORT_5_6_5:case a.UNSIGNED_SHORT_4_4_4_4:case a.UNSIGNED_SHORT_5_5_5_1:return 2;case a.FLOAT:return 4;default:return w(!1),0}}function bo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function No(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bo(Object(r),!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Co(e,t){var r,n=t||{},o=n.sourceX,i=o===void 0?0:o,s=n.sourceY,f=s===void 0?0:s,_=n.sourceFormat,u=_===void 0?a.RGBA:_,l=n.sourceAttachment,E=l===void 0?a.COLOR_ATTACHMENT0:l,R=t||{},d=R.target,T=d===void 0?null:d,h=R.sourceWidth,b=R.sourceHeight,v=R.sourceType,y=In(e),P=y.framebuffer,F=y.deleteFramebuffer;w(P);var j=P,X=j.gl,z=j.handle;h=h||P.width,b=b||P.height;var $=E-a.COLOR_ATTACHMENT0;v=v||((r=P.colorAttachments[$])===null||r===void 0?void 0:r.type)||a.UNSIGNED_BYTE,T=Qc(T,v,u,h,b),v=v||ro(T);var re=X.bindFramebuffer(a.FRAMEBUFFER,z);return X.readPixels(i,f,h,b,u,v,T),X.bindFramebuffer(a.FRAMEBUFFER,re||null),F&&P.destroy(),T}function mo(e,t){var r=t||{},n=r.sourceX,o=n===void 0?0:n,i=r.sourceY,s=i===void 0?0:i,f=r.sourceFormat,_=f===void 0?a.RGBA:f,u=r.targetByteOffset,l=u===void 0?0:u,E=t||{},R=E.target,d=E.sourceWidth,T=E.sourceHeight,h=E.sourceType,b=In(e),v=b.framebuffer,y=b.deleteFramebuffer;w(v),d=d||v.width,T=T||v.height;var P=v;if(h=h||a.UNSIGNED_BYTE,!R){var F=mn(_),j=vo(h),X=l+d*T*F*j;R=P.device.createBuffer({byteLength:X})}var z=e.device.createCommandEncoder();return z.copyTextureToBuffer({source:e,width:d,height:T,origin:[o,s],destination:R,byteOffset:l}),z.destroy(),y&&v.destroy(),R}function Io(e,t,r){var n=r||{},o=n.sourceX,i=o===void 0?0:o,s=n.sourceY,f=s===void 0?0:s,_=n.targetMipmaplevel,u=_===void 0?0:_,l=n.targetInternalFormat,E=l===void 0?a.RGBA:l,R=r||{},d=R.targetX,T=R.targetY,h=R.targetZ,b=R.width,v=R.height,y=In(e),P=y.framebuffer,F=y.deleteFramebuffer;w(P);var j=P,X=j.device,z=j.handle,$=typeof d<"u"||typeof T<"u"||typeof h<"u";d=d||0,T=T||0,h=h||0;var re=X.gl.bindFramebuffer(a.FRAMEBUFFER,z);w(t);var K=null,S;if(t instanceof se?(K=t,b=Number.isFinite(b)?b:K.width,v=Number.isFinite(v)?v:K.height,K.bind(0),S=K.target):S=t,!$)X.gl.copyTexImage2D(S,u,E,i,f,b,v,0);else switch(S){case a.TEXTURE_2D:case a.TEXTURE_CUBE_MAP:X.gl.copyTexSubImage2D(S,u,d,T,i,f,b,v);break;case a.TEXTURE_2D_ARRAY:case a.TEXTURE_3D:X.assertWebGL2(),X.gl2.copyTexSubImage3D(S,u,d,T,h,i,f,b,v);break;default:}return K&&K.unbind(),X.gl.bindFramebuffer(a.FRAMEBUFFER,re||null),F&&P.destroy(),K}function In(e){return e instanceof it?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Zc(e),deleteFramebuffer:!0}}function Zc(e,t){var r=e.device,n=e.width,o=e.height,i=e.id,s=r.createFramebuffer(No(No({},t),{},{id:"framebuffer-for-".concat(i),width:n,height:o,colorAttachments:[e]}));return s}function Qc(e,t,r,n,o){if(e)return e;t=t||a.UNSIGNED_BYTE;var i=wt(t,{clamped:!1}),s=mn(r);return new i(n*o*s)}return wo(qc);})();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
@babel/runtime/helpers/regeneratorRuntime.js:
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
`)}function yd(e,t){for(var r="",n=t-2;n<=t;n++){var i=e[n];i!==void 0&&(r+="".concat(bd(String(n),4),": ").concat(i,`
|
|
20
|
+
`))}return r}function bd(e,t){for(var r="",n=e.length;n<t;++n)r+=" ";return r+e}function Qa(e){return Pi(e)!==null||typeof e=="number"||typeof e=="boolean"}function uo(e){var t={bindings:{},uniforms:{}};return Object.keys(e).forEach(function(r){var n=e[r];Qa(n)?t.uniforms[r]=n:t.bindings[r]=n}),t}function fo(e,t,r,n){var i="See luma.gl ".concat(r," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),o=Object.getPrototypeOf(e);n.forEach(function(a){o.methodName||(o[a]=function(){throw B.removed("Calling removed method ".concat(t,".").concat(a,": "),i)(),new Error(a)})})}function gd(e,t){return Od(e)||_d(e,t)||wd(e,t)||vd()}function vd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
21
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wd(e,t){if(e){if(typeof e=="string")return Za(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Za(e,t)}}function Za(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _d(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function Od(e){if(Array.isArray(e))return e}function co(e,t,r){var n=r.removedProps,i=n===void 0?{}:n,o=r.deprecatedProps,a=o===void 0?{}:o,u=r.replacedProps,c=u===void 0?{}:u;for(var p in i)if(p in t){var b=i[p],g=b?"".concat(e,".").concat(i[p]):"N/A";B.removed("".concat(e,".").concat(p),g)()}for(var v in a)if(v in t){var O=a[v];B.deprecated("".concat(e,".").concat(v),"".concat(e,".").concat(O))()}for(var w=null,P=0,A=Object.entries(c);P<A.length;P++){var x=gd(A[P],2),T=x[0],R=x[1];T in t&&(B.deprecated("".concat(e,".").concat(T),"".concat(e,".").concat(R))(),w=w||Object.assign({},t),w[R]=t[T],delete w[T])}return w||t}function so(e){return so=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},so(e)}function Ut(){"use strict";Ut=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(l,f,s){l[f]=s.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{c({},"")}catch{c=function(s,d,m){return s[d]=m}}function p(l,f,s,d){var m=f&&f.prototype instanceof v?f:v,h=Object.create(m.prototype),_=new V(d||[]);return n(h,"_invoke",{value:k(l,s,_)}),h}function b(l,f,s){try{return{type:"normal",arg:l.call(f,s)}}catch(d){return{type:"throw",arg:d}}}e.wrap=p;var g={};function v(){}function O(){}function w(){}var P={};c(P,o,function(){return this});var A=Object.getPrototypeOf,x=A&&A(A(W([])));x&&x!==t&&r.call(x,o)&&(P=x);var T=w.prototype=v.prototype=Object.create(P);function R(l){["next","throw","return"].forEach(function(f){c(l,f,function(s){return this._invoke(f,s)})})}function j(l,f){function s(m,h,_,S){var E=b(l[m],l,h);if(E.type!=="throw"){var D=E.arg,I=D.value;return I&&so(I)=="object"&&r.call(I,"__await")?f.resolve(I.__await).then(function(C){s("next",C,_,S)},function(C){s("throw",C,_,S)}):f.resolve(I).then(function(C){D.value=C,_(D)},function(C){return s("throw",C,_,S)})}S(E.arg)}var d;n(this,"_invoke",{value:function(h,_){function S(){return new f(function(E,D){s(h,_,E,D)})}return d=d?d.then(S,S):S()}})}function k(l,f,s){var d="suspendedStart";return function(m,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(m==="throw")throw h;return H()}for(s.method=m,s.arg=h;;){var _=s.delegate;if(_){var S=F(_,s);if(S){if(S===g)continue;return S}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(d==="suspendedStart")throw d="completed",s.arg;s.dispatchException(s.arg)}else s.method==="return"&&s.abrupt("return",s.arg);d="executing";var E=b(l,f,s);if(E.type==="normal"){if(d=s.done?"completed":"suspendedYield",E.arg===g)continue;return{value:E.arg,done:s.done}}E.type==="throw"&&(d="completed",s.method="throw",s.arg=E.arg)}}}function F(l,f){var s=f.method,d=l.iterator[s];if(d===void 0)return f.delegate=null,s==="throw"&&l.iterator.return&&(f.method="return",f.arg=void 0,F(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var m=b(d,l.iterator,f.arg);if(m.type==="throw")return f.method="throw",f.arg=m.arg,f.delegate=null,g;var h=m.arg;return h?h.done?(f[l.resultName]=h.value,f.next=l.nextLoc,f.method!=="return"&&(f.method="next",f.arg=void 0),f.delegate=null,g):h:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,g)}function X(l){var f={tryLoc:l[0]};1 in l&&(f.catchLoc=l[1]),2 in l&&(f.finallyLoc=l[2],f.afterLoc=l[3]),this.tryEntries.push(f)}function N(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(X,this),this.reset(!0)}function W(l){if(l){var f=l[o];if(f)return f.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var s=-1,d=function m(){for(;++s<l.length;)if(r.call(l,s))return m.value=l[s],m.done=!1,m;return m.value=void 0,m.done=!0,m};return d.next=d}}return{next:H}}function H(){return{value:void 0,done:!0}}return O.prototype=w,n(T,"constructor",{value:w,configurable:!0}),n(w,"constructor",{value:O,configurable:!0}),O.displayName=c(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===O||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,w):(l.__proto__=w,c(l,u,"GeneratorFunction")),l.prototype=Object.create(T),l},e.awrap=function(l){return{__await:l}},R(j.prototype),c(j.prototype,a,function(){return this}),e.AsyncIterator=j,e.async=function(l,f,s,d,m){m===void 0&&(m=Promise);var h=new j(p(l,f,s,d),m);return e.isGeneratorFunction(f)?h:h.next().then(function(_){return _.done?_.value:h.next()})},R(T),c(T,u,"Generator"),c(T,o,function(){return this}),c(T,"toString",function(){return"[object Generator]"}),e.keys=function(l){var f=Object(l),s=[];for(var d in f)s.push(d);return s.reverse(),function m(){for(;s.length;){var h=s.pop();if(h in f)return m.value=h,m.done=!1,m}return m.done=!0,m}},e.values=W,V.prototype={constructor:V,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(N),!f)for(var s in this)s.charAt(0)==="t"&&r.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=void 0)},stop:function(){this.done=!0;var f=this.tryEntries[0].completion;if(f.type==="throw")throw f.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var s=this;function d(D,I){return _.type="throw",_.arg=f,s.next=D,I&&(s.method="next",s.arg=void 0),!!I}for(var m=this.tryEntries.length-1;m>=0;--m){var h=this.tryEntries[m],_=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var S=r.call(h,"catchLoc"),E=r.call(h,"finallyLoc");if(S&&E){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(S){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!E)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return d(h.finallyLoc)}}}},abrupt:function(f,s){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m.tryLoc<=this.prev&&r.call(m,"finallyLoc")&&this.prev<m.finallyLoc){var h=m;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var _=h?h.completion:{};return _.type=f,_.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(_)},complete:function(f,s){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&s&&(this.next=s),g},finish:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.finallyLoc===f)return this.complete(d.completion,d.afterLoc),N(d),g}},catch:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.tryLoc===f){var m=d.completion;if(m.type==="throw"){var h=m.arg;N(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:W(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function Ja(e,t,r,n,i,o,a){try{var u=e[o](a),c=u.value}catch(p){r(p);return}u.done?t(c):Promise.resolve(c).then(n,i)}function eu(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(c){Ja(o,n,i,a,u,"next",c)}function u(c){Ja(o,n,i,a,u,"throw",c)}a(void 0)})}}var Sd="";function ho(e,t){return lo.apply(this,arguments)}function lo(){return lo=eu(Ut().mark(function e(t,r){return Ut().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o,a){try{var u=new Image;u.onload=function(){return o(u)},u.onerror=function(){return a(new Error("Could not load image ".concat(t,".")))},u.crossOrigin=r?.crossOrigin||"anonymous",u.src=t.startsWith("http")?t:Sd+t}catch(c){a(c)}}));case 1:case"end":return i.stop()}},e)})),lo.apply(this,arguments)}function zt(e,t){return po.apply(this,arguments)}function po(){return po=eu(Ut().mark(function e(t,r){var n,i;return Ut().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(n=document.getElementsByTagName("head")[0],n){a.next=3;break}throw new Error("loadScript");case 3:return i=document.createElement("script"),i.setAttribute("type","text/javascript"),i.setAttribute("src",t),r&&(i.id=r),a.abrupt("return",new Promise(function(u,c){i.onload=u,i.onerror=function(p){return c(new Error("Unable to load script '".concat(t,"': ").concat(p)))},n.appendChild(i)}));case 8:case"end":return a.stop()}},e)})),po.apply(this,arguments)}var Ht={};function Pd(e){globalThis.console&&globalThis.console.error&&globalThis.console.error(e)}function xd(e){globalThis.console&&globalThis.console.log&&globalThis.console.log(e)}function Ed(e,t){Ht[e]=!0,t!==void 0&&Pd(t)}function Td(e){var t=e.getError;e.getError=function(){var n;do n=t.apply(e),n!==0&&(Ht[n]=!0);while(n!==0);for(n in Ht)if(Ht[n])return delete Ht[n],parseInt(n,10);return 0}}var $t=function e(t){var r=t.gl;this.ext=t,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(t.maxVertexAttribs);for(var n=0;n<this.attribs.length;n++){var i=new e.VertexAttrib(r);this.attribs[n]=i}this.maxAttrib=0};$t.VertexAttrib=function(t){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()};$t.VertexAttrib.prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var De=function(t){var r=this;this.gl=t,Td(t);var n=this.original={getParameter:t.getParameter,enableVertexAttribArray:t.enableVertexAttribArray,disableVertexAttribArray:t.disableVertexAttribArray,bindBuffer:t.bindBuffer,getVertexAttrib:t.getVertexAttrib,vertexAttribPointer:t.vertexAttribPointer};t.getParameter=function(o){return o===r.VERTEX_ARRAY_BINDING_OES?r.currentVertexArrayObject===r.defaultVertexArrayObject?null:r.currentVertexArrayObject:n.getParameter.apply(this,arguments)},t.enableVertexAttribArray=function(o){var a=r.currentVertexArrayObject;a.maxAttrib=Math.max(a.maxAttrib,o);var u=a.attribs[o];return u.enabled=!0,n.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(o){var a=r.currentVertexArrayObject;a.maxAttrib=Math.max(a.maxAttrib,o);var u=a.attribs[o];return u.enabled=!1,n.disableVertexAttribArray.apply(this,arguments)},t.bindBuffer=function(o,a){switch(o){case 34962:r.currentArrayBuffer=a;break;case 34963:r.currentVertexArrayObject.elementArrayBuffer=a;break;default:}return n.bindBuffer.apply(this,arguments)},t.getVertexAttrib=function(o,a){var u=r.currentVertexArrayObject,c=u.attribs[o];switch(a){case 34975:return c.buffer;case 34338:return c.enabled;case 34339:return c.size;case 34340:return c.stride;case 34341:return c.type;case 34922:return c.normalized;default:return n.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(o,a,u,c,p,b){var g=r.currentVertexArrayObject;g.maxAttrib=Math.max(g.maxAttrib,o);var v=g.attribs[o];return v.buffer=r.currentArrayBuffer,v.size=a,v.type=u,v.normalized=c,v.stride=p,v.offset=b,v.recache(),n.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",function(){xd("OESVertexArrayObject emulation library context restored"),r.reset_()},!0),this.reset_()};De.prototype.VERTEX_ARRAY_BINDING_OES=34229;De.prototype.reset_=function(){var t=this.vertexArrayObjects!==void 0;if(t)for(var r=0;r<this.vertexArrayObjects.length;++r)this.vertexArrayObjects.isAlive=!1;var n=this.gl;this.maxVertexAttribs=n.getParameter(34921),this.defaultVertexArrayObject=new $t(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)};De.prototype.createVertexArrayOES=function(){var t=new $t(this);return this.vertexArrayObjects.push(t),t};De.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)};De.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof $t&&t.hasBeenBound&&t.ext===this)};De.prototype.bindVertexArrayOES=function(t){var r=this.gl;if(t&&!t.isAlive){Ed(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject");return}var n=this.original,i=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var o=this.currentVertexArrayObject;if(i!==o){(!i||o.elementArrayBuffer!==i.elementArrayBuffer)&&n.bindBuffer.call(r,34963,o.elementArrayBuffer);for(var a=this.currentArrayBuffer,u=Math.max(i?i.maxAttrib:0,o.maxAttrib),c=0;c<=u;c++){var p=o.attribs[c],b=i?i.attribs[c]:null;if((!i||p.enabled!==b.enabled)&&(p.enabled?n.enableVertexAttribArray.call(r,c):n.disableVertexAttribArray.call(r,c)),p.enabled){var g=!1;(!i||p.buffer!==b.buffer)&&(a!==p.buffer&&(n.bindBuffer.call(r,34962,p.buffer),a=p.buffer),g=!0),(g||p.cached!==b.cached)&&n.vertexAttribPointer.call(r,c,p.size,p.type,p.normalized,p.stride,p.offset)}}this.currentArrayBuffer!==a&&n.bindBuffer.call(r,34962,this.currentArrayBuffer)}};function tu(e){if(typeof e.createVertexArray!="function"){var t=e.getSupportedExtensions;e.getSupportedExtensions=function(){var i=t.call(this)||[];return i.indexOf("OES_vertex_array_object")<0&&i.push("OES_vertex_array_object"),i};var r=e.getExtension;e.getExtension=function(i){var o=r.call(this,i);return o||(i!=="OES_vertex_array_object"?null:(e.__OESVertexArrayObject||(this.__OESVertexArrayObject=new De(this)),this.__OESVertexArrayObject))}}}var Ad="Invalid WebGLRenderingContext";var Ld="Requires WebGL2";function mo(e){return typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&Number.isFinite(e._version))}function z(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&e._version===2)}function Xt(e){return z(e)?e:null}function Qr(e){return M(mo(e),Ad),e}function ru(e){return M(z(e),Ld),e}var $;function Kt(e){return Kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kt(e)}function Y(e,t,r){return t=jd(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jd(e){var t=Rd(e,"string");return Kt(t)==="symbol"?t:String(t)}function Rd(e,t){if(Kt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Kt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nu="OES_element_index",ou="WEBGL_draw_buffers",Gd="EXT_disjoint_timer_query",Bd="EXT_disjoint_timer_query_webgl2",Id="EXT_texture_filter_anisotropic",iu="WEBGL_debug_renderer_info",Fd=35723,Dd=4352,Cd=36795,Wd=34047,Md=37445,Nd=37446,Z=function(t){return z(t)?void 0:0},kd=($={},Y($,3074,function(e){return z(e)?void 0:36064}),Y($,Fd,function(e){return z(e)?void 0:Dd}),Y($,35977,Z),Y($,32937,Z),Y($,Cd,function(e,t){var r=z(e)?e.getExtension(Bd):e.getExtension(Gd);return r&&r.GPU_DISJOINT_EXT?t(r.GPU_DISJOINT_EXT):0}),Y($,Md,function(e,t){var r=e.getExtension(iu);return t(r&&r.UNMASKED_VENDOR_WEBGL||7936)}),Y($,Nd,function(e,t){var r=e.getExtension(iu);return t(r&&r.UNMASKED_RENDERER_WEBGL||7937)}),Y($,Wd,function(e,t){var r,n=((r=e.luma)===null||r===void 0||(r=r.extensions)===null||r===void 0?void 0:r[Id])||e.getExtension("EXT_texture_filter_anisotropic");return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),Y($,32883,Z),Y($,35071,Z),Y($,37447,Z),Y($,36063,function(e,t){if(!z(e)){var r=e.getExtension(ou);return r?t(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),Y($,35379,Z),Y($,35374,Z),Y($,35377,Z),Y($,34852,function(e){if(!z(e)){var t=e.getExtension(ou);return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),Y($,36203,function(e){return e.getExtension(nu)?2147483647:65535}),Y($,33001,function(e){return e.getExtension(nu)?16777216:65535}),Y($,33e3,function(e){return 16777216}),Y($,37157,Z),Y($,35373,Z),Y($,35657,Z),Y($,36183,Z),Y($,37137,Z),Y($,34045,Z),Y($,35978,Z),Y($,35979,Z),Y($,35968,Z),Y($,35376,Z),Y($,35375,Z),Y($,35659,Z),Y($,37154,Z),Y($,35371,Z),Y($,35658,Z),Y($,35076,Z),Y($,35077,Z),Y($,35380,Z),$);function au(e,t,r){var n=kd[r],i=typeof n=="function"?n(e,t,r):n,o=i!==void 0?i:t(r);return o}function lt(e){var t=e.luma;if(!t){var r={_polyfilled:!1,_extensions:{}};e.luma=r}return e.luma}var pt;function Yt(e){return Yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yt(e)}function Zr(e,t,r){return t=Vd(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vd(e){var t=Ud(e,"string");return Yt(t)==="symbol"?t:String(t)}function Ud(e,t){if(Yt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Yt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zd="OES_vertex_array_object",uu="ANGLE_instanced_arrays",Hd="WEBGL_draw_buffers",$d="EXT_disjoint_timer_query",Xd="EXT_texture_filter_anisotropic",Kd="VertexArray requires WebGL2 or OES_vertex_array_object extension";function Yd(e,t){return{webgl2:z(e),ext:e.getExtension(t)}}var yo=(pt={},Zr(pt,zd,{meta:{suffix:"OES"},createVertexArray:function(){M(!1,Kd)},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),Zr(pt,uu,{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(t,r){M(r===0,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),Zr(pt,Hd,{meta:{suffix:"WEBGL"},drawBuffers:function(){M(!1)}}),Zr(pt,$d,{meta:{suffix:"EXT"},createQuery:function(){M(!1)},deleteQuery:function(){M(!1)},beginQuery:function(){M(!1)},endQuery:function(){},getQuery:function(t,r){return this.getQueryObject(t,r)},getQueryParameter:function(t,r){return this.getQueryObject(t,r)},getQueryObject:function(t,r){}}),pt),Jr={readBuffer:function(t,r,n){z(t)&&r(n)},getVertexAttrib:function(t,r,n,i){var o=Yd(t,uu),a=o.webgl2,u=o.ext,c;switch(i){case 35069:c=a?void 0:!1;break;case 35070:c=!a&&!u?0:void 0;break;default:}return c!==void 0?c:r(n,i)},getProgramParameter:function(t,r,n,i){if(!z(t))switch(i){case 35967:return 35981;case 35971:return 0;case 35382:return 0;default:}return r(n,i)},getInternalformatParameter:function(t,r,n,i,o){if(!z(t))switch(o){case 32937:return new Int32Array([0]);default:}var a=t;return a.getInternalformatParameter(n,i,o)},getTexParameter:function(t,r,n,i){switch(i){case 34046:var o=lt(t),a=o._extensions,u=a[Xd];i=u&&u.TEXTURE_MAX_ANISOTROPY_EXT||34046;break;default:}return r(n,i)},getParameter:au,hint:function(t,r,n,i){return r(n,i)}};function cu(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=qd(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
22
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function qd(e,t){if(e){if(typeof e=="string")return fu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fu(e,t)}}function fu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function en(e){var t=lt(e);return t._polyfilled||(tu(e),Qd(e),Zd(e,yo),eh(e,{target:t,target2:e}),t._polyfilled=!0),e}function Qd(e){var t=lt(e),r=e.getSupportedExtensions()||[],n=cu(r),i;try{for(n.s();!(i=n.n()).done;){var o=i.value,a=e.getExtension(o);t._extensions[o]=a}}catch(u){n.e(u)}finally{n.f()}}function Zd(e,t){var r=lt(e),n=cu(Object.getOwnPropertyNames(t)),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;o!=="overrides"&&Jd(e,{extension:o,target:r,target2:e})}}catch(a){n.e(a)}finally{n.f()}}function Jd(e,t){var r=t.extension,n=t.target,i=t.target2,o=yo[r];M(o);for(var a=o.meta,u=a===void 0?{}:a,c=u.suffix,p=c===void 0?"":c,b=e.getExtension(r),g=function(){var P=O[v],A="".concat(P).concat(p),x=null;P==="meta"||typeof e[P]=="function"||(b&&typeof b[A]=="function"?x=function(){return b[A].apply(b,arguments)}:typeof o[P]=="function"&&(x=o[P].bind(n))),x&&(n[P]=x,i[P]=x)},v=0,O=Object.keys(o);v<O.length;v++)g()}function eh(e,t){var r=t.target,n=t.target2;Object.keys(Jr).forEach(function(i){if(typeof Jr[i]=="function"){var o=e[i]?e[i].bind(e):function(){},a=Jr[i].bind(null,e,o);r[i]=a,n[i]=a}})}var G,L,ye;function Qt(e){return Qt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qt(e)}function bo(e,t){return nh(e)||rh(e,t)||pu(e,t)||th()}function th(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
23
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rh(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function nh(e){if(Array.isArray(e))return e}function re(e){return ah(e)||ih(e)||pu(e)||oh()}function oh(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
24
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pu(e,t){if(e){if(typeof e=="string")return vo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vo(e,t)}}function ih(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ah(e){if(Array.isArray(e))return vo(e)}function vo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function y(e,t,r){return t=uh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uh(e){var t=fh(e,"string");return Qt(t)==="symbol"?t:String(t)}function fh(e,t){if(Qt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Qt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zt=(G={},y(G,3042,!1),y(G,32773,new Float32Array([0,0,0,0])),y(G,32777,32774),y(G,34877,32774),y(G,32969,1),y(G,32968,0),y(G,32971,1),y(G,32970,0),y(G,3106,new Float32Array([0,0,0,0])),y(G,3107,[!0,!0,!0,!0]),y(G,2884,!1),y(G,2885,1029),y(G,2929,!1),y(G,2931,1),y(G,2932,513),y(G,2928,new Float32Array([0,1])),y(G,2930,!0),y(G,3024,!0),y(G,35725,null),y(G,36006,null),y(G,36007,null),y(G,34229,null),y(G,34964,null),y(G,2886,2305),y(G,33170,4352),y(G,2849,1),y(G,32823,!1),y(G,32824,0),y(G,10752,0),y(G,32926,!1),y(G,32928,!1),y(G,32938,1),y(G,32939,!1),y(G,3089,!1),y(G,3088,new Int32Array([0,0,1024,1024])),y(G,2960,!1),y(G,2961,0),y(G,2968,4294967295),y(G,36005,4294967295),y(G,2962,519),y(G,2967,0),y(G,2963,4294967295),y(G,34816,519),y(G,36003,0),y(G,36004,4294967295),y(G,2964,7680),y(G,2965,7680),y(G,2966,7680),y(G,34817,7680),y(G,34818,7680),y(G,34819,7680),y(G,2978,[0,0,1024,1024]),y(G,3333,4),y(G,3317,4),y(G,37440,!1),y(G,37441,!1),y(G,37443,37444),y(G,36389,null),y(G,36662,null),y(G,36663,null),y(G,35053,null),y(G,35055,null),y(G,35723,4352),y(G,36010,null),y(G,35977,!1),y(G,3330,0),y(G,3332,0),y(G,3331,0),y(G,3314,0),y(G,32878,0),y(G,3316,0),y(G,3315,0),y(G,32877,0),G),Se=function(t,r,n){return r?t.enable(n):t.disable(n)},su=function(t,r,n){return t.hint(n,r)},he=function(t,r,n){return t.pixelStorei(n,r)},lu=function(t,r,n){var i;return n===36006?i=z(t)?36009:36160:i=36008,t.bindFramebuffer(i,r)},qt=function(t,r,n){var i,o=(i={},y(i,34964,34962),y(i,36662,36662),y(i,36663,36663),y(i,35053,35051),y(i,35055,35052),i),a=o[n];t.bindBuffer(a,r)};function go(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}var du=(L={},y(L,3042,Se),y(L,32773,function(e,t){return e.blendColor.apply(e,re(t))}),y(L,32777,"blendEquation"),y(L,34877,"blendEquation"),y(L,32969,"blendFunc"),y(L,32968,"blendFunc"),y(L,32971,"blendFunc"),y(L,32970,"blendFunc"),y(L,3106,function(e,t){return e.clearColor.apply(e,re(t))}),y(L,3107,function(e,t){return e.colorMask.apply(e,re(t))}),y(L,2884,Se),y(L,2885,function(e,t){return e.cullFace(t)}),y(L,2929,Se),y(L,2931,function(e,t){return e.clearDepth(t)}),y(L,2932,function(e,t){return e.depthFunc(t)}),y(L,2928,function(e,t){return e.depthRange.apply(e,re(t))}),y(L,2930,function(e,t){return e.depthMask(t)}),y(L,3024,Se),y(L,35723,su),y(L,35725,function(e,t){return e.useProgram(t)}),y(L,36007,function(e,t){return e.bindRenderbuffer(36161,t)}),y(L,36389,function(e,t){var r,n;return(r=(n=e).bindTransformFeedback)===null||r===void 0?void 0:r.call(n,36386,t)}),y(L,34229,function(e,t){return e.bindVertexArray(t)}),y(L,36006,lu),y(L,36010,lu),y(L,34964,qt),y(L,36662,qt),y(L,36663,qt),y(L,35053,qt),y(L,35055,qt),y(L,2886,function(e,t){return e.frontFace(t)}),y(L,33170,su),y(L,2849,function(e,t){return e.lineWidth(t)}),y(L,32823,Se),y(L,32824,"polygonOffset"),y(L,10752,"polygonOffset"),y(L,35977,Se),y(L,32926,Se),y(L,32928,Se),y(L,32938,"sampleCoverage"),y(L,32939,"sampleCoverage"),y(L,3089,Se),y(L,3088,function(e,t){return e.scissor.apply(e,re(t))}),y(L,2960,Se),y(L,2961,function(e,t){return e.clearStencil(t)}),y(L,2968,function(e,t){return e.stencilMaskSeparate(1028,t)}),y(L,36005,function(e,t){return e.stencilMaskSeparate(1029,t)}),y(L,2962,"stencilFuncFront"),y(L,2967,"stencilFuncFront"),y(L,2963,"stencilFuncFront"),y(L,34816,"stencilFuncBack"),y(L,36003,"stencilFuncBack"),y(L,36004,"stencilFuncBack"),y(L,2964,"stencilOpFront"),y(L,2965,"stencilOpFront"),y(L,2966,"stencilOpFront"),y(L,34817,"stencilOpBack"),y(L,34818,"stencilOpBack"),y(L,34819,"stencilOpBack"),y(L,2978,function(e,t){return e.viewport.apply(e,re(t))}),y(L,3333,he),y(L,3317,he),y(L,37440,he),y(L,37441,he),y(L,37443,he),y(L,3330,he),y(L,3332,he),y(L,3331,he),y(L,3314,he),y(L,32878,he),y(L,3316,he),y(L,3315,he),y(L,32877,he),y(L,"framebuffer",function(t,r){var n=r&&"handle"in r?r.handle:r;return t.bindFramebuffer(36160,n)}),y(L,"blend",function(t,r){return r?t.enable(3042):t.disable(3042)}),y(L,"blendColor",function(t,r){return t.blendColor.apply(t,re(r))}),y(L,"blendEquation",function(t,r){var n=typeof r=="number"?[r,r]:r;t.blendEquationSeparate.apply(t,re(n))}),y(L,"blendFunc",function(t,r){var n=r?.length===2?[].concat(re(r),re(r)):r;t.blendFuncSeparate.apply(t,re(n))}),y(L,"clearColor",function(t,r){return t.clearColor.apply(t,re(r))}),y(L,"clearDepth",function(t,r){return t.clearDepth(r)}),y(L,"clearStencil",function(t,r){return t.clearStencil(r)}),y(L,"colorMask",function(t,r){return t.colorMask.apply(t,re(r))}),y(L,"cull",function(t,r){return r?t.enable(2884):t.disable(2884)}),y(L,"cullFace",function(t,r){return t.cullFace(r)}),y(L,"depthTest",function(t,r){return r?t.enable(2929):t.disable(2929)}),y(L,"depthFunc",function(t,r){return t.depthFunc(r)}),y(L,"depthMask",function(t,r){return t.depthMask(r)}),y(L,"depthRange",function(t,r){return t.depthRange.apply(t,re(r))}),y(L,"dither",function(t,r){return r?t.enable(3024):t.disable(3024)}),y(L,"derivativeHint",function(t,r){t.hint(35723,r)}),y(L,"frontFace",function(t,r){return t.frontFace(r)}),y(L,"mipmapHint",function(t,r){return t.hint(33170,r)}),y(L,"lineWidth",function(t,r){return t.lineWidth(r)}),y(L,"polygonOffsetFill",function(t,r){return r?t.enable(32823):t.disable(32823)}),y(L,"polygonOffset",function(t,r){return t.polygonOffset.apply(t,re(r))}),y(L,"sampleCoverage",function(t,r){return t.sampleCoverage.apply(t,re(r))}),y(L,"scissorTest",function(t,r){return r?t.enable(3089):t.disable(3089)}),y(L,"scissor",function(t,r){return t.scissor.apply(t,re(r))}),y(L,"stencilTest",function(t,r){return r?t.enable(2960):t.disable(2960)}),y(L,"stencilMask",function(t,r){r=go(r)?r:[r,r];var n=r,i=bo(n,2),o=i[0],a=i[1];t.stencilMaskSeparate(1028,o),t.stencilMaskSeparate(1029,a)}),y(L,"stencilFunc",function(t,r){r=go(r)&&r.length===3?[].concat(re(r),re(r)):r;var n=r,i=bo(n,6),o=i[0],a=i[1],u=i[2],c=i[3],p=i[4],b=i[5];t.stencilFuncSeparate(1028,o,a,u),t.stencilFuncSeparate(1029,c,p,b)}),y(L,"stencilOp",function(t,r){r=go(r)&&r.length===3?[].concat(re(r),re(r)):r;var n=r,i=bo(n,6),o=i[0],a=i[1],u=i[2],c=i[3],p=i[4],b=i[5];t.stencilOpSeparate(1028,o,a,u),t.stencilOpSeparate(1029,c,p,b)}),y(L,"viewport",function(t,r){return t.viewport.apply(t,re(r))}),L);function ne(e,t,r){return t[e]!==void 0?t[e]:r[e]}var hu={blendEquation:function(t,r,n){return t.blendEquationSeparate(ne(32777,r,n),ne(34877,r,n))},blendFunc:function(t,r,n){return t.blendFuncSeparate(ne(32969,r,n),ne(32968,r,n),ne(32971,r,n),ne(32970,r,n))},polygonOffset:function(t,r,n){return t.polygonOffset(ne(32824,r,n),ne(10752,r,n))},sampleCoverage:function(t,r,n){return t.sampleCoverage(ne(32938,r,n),ne(32939,r,n))},stencilFuncFront:function(t,r,n){return t.stencilFuncSeparate(1028,ne(2962,r,n),ne(2967,r,n),ne(2963,r,n))},stencilFuncBack:function(t,r,n){return t.stencilFuncSeparate(1029,ne(34816,r,n),ne(36003,r,n),ne(36004,r,n))},stencilOpFront:function(t,r,n){return t.stencilOpSeparate(1028,ne(2964,r,n),ne(2965,r,n),ne(2966,r,n))},stencilOpBack:function(t,r,n){return t.stencilOpSeparate(1029,ne(34817,r,n),ne(34818,r,n),ne(34819,r,n))}},wo={enable:function(t,r){return t(y({},r,!0))},disable:function(t,r){return t(y({},r,!1))},pixelStorei:function(t,r,n){return t(y({},r,n))},hint:function(t,r,n){return t(y({},r,n))},useProgram:function(t,r){return t(y({},35725,r))},bindRenderbuffer:function(t,r,n){return t(y({},36007,n))},bindTransformFeedback:function(t,r,n){return t(y({},36389,n))},bindVertexArray:function(t,r){return t(y({},34229,r))},bindFramebuffer:function(t,r,n){var i;switch(r){case 36160:return t((i={},y(i,36006,n),y(i,36010,n),i));case 36009:return t(y({},36006,n));case 36008:return t(y({},36010,n));default:return null}},bindBuffer:function(t,r,n){var i,o=(i={},y(i,34962,[34964]),y(i,36662,[36662]),y(i,36663,[36663]),y(i,35051,[35053]),y(i,35052,[35055]),i)[r];return o?t(y({},o,n)):{valueChanged:!0}},blendColor:function(t,r,n,i,o){return t(y({},32773,new Float32Array([r,n,i,o])))},blendEquation:function(t,r){var n;return t((n={},y(n,32777,r),y(n,34877,r),n))},blendEquationSeparate:function(t,r,n){var i;return t((i={},y(i,32777,r),y(i,34877,n),i))},blendFunc:function(t,r,n){var i;return t((i={},y(i,32969,r),y(i,32968,n),y(i,32971,r),y(i,32970,n),i))},blendFuncSeparate:function(t,r,n,i,o){var a;return t((a={},y(a,32969,r),y(a,32968,n),y(a,32971,i),y(a,32970,o),a))},clearColor:function(t,r,n,i,o){return t(y({},3106,new Float32Array([r,n,i,o])))},clearDepth:function(t,r){return t(y({},2931,r))},clearStencil:function(t,r){return t(y({},2961,r))},colorMask:function(t,r,n,i,o){return t(y({},3107,[r,n,i,o]))},cullFace:function(t,r){return t(y({},2885,r))},depthFunc:function(t,r){return t(y({},2932,r))},depthRange:function(t,r,n){return t(y({},2928,new Float32Array([r,n])))},depthMask:function(t,r){return t(y({},2930,r))},frontFace:function(t,r){return t(y({},2886,r))},lineWidth:function(t,r){return t(y({},2849,r))},polygonOffset:function(t,r,n){var i;return t((i={},y(i,32824,r),y(i,10752,n),i))},sampleCoverage:function(t,r,n){var i;return t((i={},y(i,32938,r),y(i,32939,n),i))},scissor:function(t,r,n,i,o){return t(y({},3088,new Int32Array([r,n,i,o])))},stencilMask:function(t,r){var n;return t((n={},y(n,2968,r),y(n,36005,r),n))},stencilMaskSeparate:function(t,r,n){return t(y({},r===1028?2968:36005,n))},stencilFunc:function(t,r,n,i){var o;return t((o={},y(o,2962,r),y(o,2967,n),y(o,2963,i),y(o,34816,r),y(o,36003,n),y(o,36004,i),o))},stencilFuncSeparate:function(t,r,n,i,o){var a;return t((a={},y(a,r===1028?2962:34816,n),y(a,r===1028?2967:36003,i),y(a,r===1028?2963:36004,o),a))},stencilOp:function(t,r,n,i){var o;return t((o={},y(o,2964,r),y(o,2965,n),y(o,2966,i),y(o,34817,r),y(o,34818,n),y(o,34819,i),o))},stencilOpSeparate:function(t,r,n,i,o){var a;return t((a={},y(a,r===1028?2964:34817,n),y(a,r===1028?2965:34818,i),y(a,r===1028?2966:34819,o),a))},viewport:function(t,r,n,i,o){return t(y({},2978,[r,n,i,o]))}},Pe=function(t,r){return t.isEnabled(r)},_o=(ye={},y(ye,3042,Pe),y(ye,2884,Pe),y(ye,2929,Pe),y(ye,3024,Pe),y(ye,32823,Pe),y(ye,32926,Pe),y(ye,32928,Pe),y(ye,3089,Pe),y(ye,2960,Pe),y(ye,35977,Pe),ye),mu=new Set([34016,36388,36387,35983,35368,34965,35739,35738,3074,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34866,34867,34868,35097,32873,35869,32874,34068]);function ch(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=sh(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
25
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function sh(e,t){if(e){if(typeof e=="string")return yu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yu(e,t)}}function yu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function be(e,t){var r=le.attach(e),n=r.gl;if(!lh(t)){var i={};for(var o in t){var a=Number(o),u=du[o];u&&(typeof u=="string"?i[u]=!0:u(n,t[o],a))}var c=n.state&&n.state.cache;if(c)for(var p in i){var b=hu[p];b(n,t,c)}}}function tn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zt,r=le.attach(e),n=r.gl;if(typeof t=="number"){var i=t,o=_o[i];return o?o(n,i):n.getParameter(i)}var a=Array.isArray(t)?t:Object.keys(t),u={},c=ch(a),p;try{for(c.s();!(p=c.n()).done;){var b=p.value,g=_o[b];u[b]=g?g(n,Number(b)):n.getParameter(Number(b))}}catch(v){c.e(v)}finally{c.f()}return u}function bu(e){be(e,Zt)}function lh(e){for(var t in e)return!1;return!0}function gu(e,t){if(e===t)return!0;var r=Array.isArray(e)||ArrayBuffer.isView(e),n=Array.isArray(t)||ArrayBuffer.isView(t);if(r&&n&&e.length===t.length){for(var i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}return!1}function Jt(e){return Jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jt(e)}function vu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,dh(n.key),n)}}function ph(e,t,r){return t&&vu(e.prototype,t),r&&vu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function dh(e){var t=hh(e,"string");return Jt(t)==="symbol"?t:String(t)}function hh(e,t){if(Jt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Jt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var yh=function(){function e(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.copyState,o=i===void 0?!1:i,a=n.log,u=a===void 0?function(){}:a;mh(this,e),this.gl=void 0,this.program=null,this.stateStack=[],this.enable=!0,this.cache=void 0,this.log=void 0,this.gl=r,this.cache=o?tn(r):Object.assign({},Zt),this.log=u,this._updateCache=this._updateCache.bind(this),Object.seal(this)}var t=e.prototype;return t.push=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.stateStack.push({})},t.pop=function(){M(this.stateStack.length>0);var n=this.stateStack[this.stateStack.length-1];be(this.gl,n),this.stateStack.pop()},t._updateCache=function(n){var i=!1,o,a=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(var u in n){M(u!==void 0);var c=n[u],p=this.cache[u];gu(c,p)||(i=!0,o=p,a&&!(u in a)&&(a[u]=p),this.cache[u]=c)}return{valueChanged:i,oldValue:o}},ph(e)}();function Ce(e){return e.state}function er(e,t){var r=t.enable,n=r===void 0?!0:r,i=t.copyState;if(M(i!==void 0),!e.state){e.state=new yh(e,{copyState:i}),gh(e);for(var o in wo){var a=wo[o];bh(e,o,a)}wu(e,"getParameter"),wu(e,"isEnabled")}var u=Ce(e);return u.enable=n,e}function _e(e){var t=Ce(e);t||(er(e,{copyState:!1}),t=Ce(e)),t.push()}function ge(e){var t=Ce(e);M(t),t.pop()}function wu(e,t){var r=e[t].bind(e);e[t]=function(i){if(i===void 0||mu.has(i))return r(i);var o=Ce(e);return i in o.cache||(o.cache[i]=r(i)),o.enable?o.cache[i]:r(i)},Object.defineProperty(e[t],"name",{value:"".concat(t,"-from-cache"),configurable:!1})}function bh(e,t,r){if(e[t]){var n=e[t].bind(e);e[t]=function(){for(var o=Ce(e),a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];var p=r.apply(void 0,[o._updateCache].concat(u)),b=p.valueChanged,g=p.oldValue;return b&&n.apply(void 0,u),g},Object.defineProperty(e[t],"name",{value:"".concat(t,"-to-cache"),configurable:!1})}}function gh(e){var t=e.useProgram.bind(e);e.useProgram=function(n){var i=Ce(e);i.program!==n&&(t(n),i.program=n)}}function tr(e){return tr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tr(e)}function _u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_u(Object(r),!0).forEach(function(n){vh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_u(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vh(e,t,r){return t=wh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wh(e){var t=_h(e,"string");return tr(t)==="symbol"?t:String(t)}function _h(e,t){if(tr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(tr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Oh={webgl2:!0,webgl1:!0,powerPreference:"high-performance",onContextLost:function(){return console.error("WebGL context lost")},onContextRestored:function(){return console.info("WebGL context restored")}};function Ou(e,t){t=dt(dt({},Oh),t);var r=null,n=function(b){return r=b.statusMessage||r};e.addEventListener("webglcontextcreationerror",n,!1);var i=null;if(t.type==="webgl2"&&(t=dt(dt({},t),{},{webgl1:!1})),t.type==="webgl1"&&(t=dt(dt({},t),{},{webgl2:!1})),!i&&t.webgl2&&(i=e.getContext("webgl2",t)),!i&&t.webgl1&&(i=e.getContext("webgl",t)),e.removeEventListener("webglcontextcreationerror",n,!1),!i)throw new Error("Failed to create ".concat(t.webgl2&&!t.webgl1?"WebGL2":"WebGL"," context: ").concat(r||"Unknown error"));if(t.onContextLost){var o=t,a=o.onContextLost;e.addEventListener("webglcontextlost",function(p){return a(p)},!1)}if(t.onContextRestored){var u=t,c=u.onContextRestored;e.addEventListener("webglcontextrestored",function(p){return c(p)},!1)}return i}function Su(e){var t=e.getParameter(7936),r=e.getParameter(7937),n=e.getExtension("WEBGL_debug_renderer_info"),i=e.getParameter(n?n.UNMASKED_VENDOR_WEBGL:7936),o=e.getParameter(n?n.UNMASKED_RENDERER_WEBGL:7937),a=i||t,u=o||r,c=e.getParameter(7938),p=Sh(a,u),b=Ph(a,u),g="glsl",v=z(e)?300:100;return{type:z(e)?"webgl2":"webgl",gpu:p,gpuBackend:b,vendor:a,renderer:u,version:c,shadingLanguage:g,shadingLanguageVersion:v}}function Sh(e,t){return/NVIDIA/i.exec(e)||/NVIDIA/i.exec(t)?"nvidia":/INTEL/i.exec(e)||/INTEL/i.exec(t)?"intel":/Apple/i.exec(e)||/Apple/i.exec(t)?"apple":/AMD/i.exec(e)||/AMD/i.exec(t)||/ATI/i.exec(e)||/ATI/i.exec(t)?"amd":/SwiftShader/i.exec(e)||/SwiftShader/i.exec(t)?"software":"unknown"}function Ph(e,t){return/ANGLE/i.exec(e)||/ANGLE/i.exec(t)?"angle":/Metal/i.exec(e)||/Metal/i.exec(t)?"metal":"unknown"}function Pu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=typeof window<"u"?window.navigator||{}:{},r=e.userAgent||t.userAgent||"",n=r.indexOf("MSIE ")!==-1,i=r.indexOf("Trident/")!==-1;return n||i}function rn(e){switch(e){case"uint8":return 5121;case"sint8":return 5120;case"unorm8":return 5121;case"snorm8":return 5120;case"uint16":return 5123;case"sint16":return 5122;case"unorm16":return 5123;case"snorm16":return 5122;case"uint32":return 5125;case"sint32":return 5124;case"float16":return 5131;case"float32":return 5126}throw new Error(String(e))}var ce,xe;function ir(e){return ir=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ir(e)}function xh(e,t){return Lh(e)||Ah(e,t)||Th(e,t)||Eh()}function Eh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
26
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Th(e,t){if(e){if(typeof e=="string")return xu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xu(e,t)}}function xu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ah(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function Lh(e){if(Array.isArray(e))return e}function oe(e,t,r){return t=jh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jh(e){var t=Rh(e,"string");return ir(t)==="symbol"?t:String(t)}function Rh(e,t){if(ir(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ir(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ue="texture-compression-bc",q="texture-compression-astc",Ee="texture-compression-etc2",Gh="texture-compression-etc1-webgl",nn="texture-compression-pvrtc-webgl",Oo="texture-compression-atc-webgl",rr="WEBGL_compressed_texture_s3tc",nr="WEBGL_compressed_texture_s3tc_srgb",ht="EXT_texture_compression_rgtc",or="EXT_texture_compression_bptc",Bh="WEBGL_compressed_texture_etc",Ih="WEBGL_compressed_texture_astc",Fh="WEBGL_compressed_texture_etc1",Dh="WEBGL_compressed_texture_pvrtc",Ch="WEBGL_compressed_texture_atc",Eu="EXT_sRGB",Le="EXT_texture_norm16",Wh="WEBGL_color_buffer_float",Mh="EXT_color_buffer_float",Oe=function(t,r){return t.getExtension(r)},We=function(t,r){return r.every(function(n){return t.getExtension(n)})},So={"texture-blend-float-webgl1":function(t){return z(t)?!0:Oe(t,"EXT_float_blend")},"texture-formats-srgb-webgl1":function(t){return z(t)?!0:Oe(t,Eu)},"texture-formats-depth-webgl1":function(t){return z(t)?!0:Oe(t,"WEBGL_depth_texture")},"texture-formats-float32-webgl1":function(t){return z(t)?!0:Oe(t,"OES_texture_float")},"texture-formats-float16-webgl1":function(t){return z(t)?!0:Oe(t,"OES_texture_half_float")},"texture-formats-norm16-webgl":function(t){return z(t)?Oe(t,Le):!1},"texture-filter-linear-float32-webgl":function(t){return Oe(t,"OES_texture_float_linear")},"texture-filter-linear-float16-webgl":function(t){return Oe(t,"OES_texture_half_float_linear")},"texture-filter-anisotropic-webgl":function(t){return Oe(t,"EXT_texture_filter_anisotropic")},"texture-renderable-float32-webgl":function(t){return Oe(t,"EXT_color_buffer_float")},"texture-renderable-float16-webgl":function(t){return Oe(t,"EXT_color_buffer_half_float")},"texture-compression-bc":function(t){return We(t,[rr,nr,ht,or])},"texture-compression-bc5-webgl":function(t){return We(t,[ht])},"texture-compression-etc2":function(t){return We(t,[Bh])},"texture-compression-astc":function(t){return We(t,[Ih])},"texture-compression-etc1-webgl":function(t){return We(t,[Fh])},"texture-compression-pvrtc-webgl":function(t){return We(t,[Dh])},"texture-compression-atc-webgl":function(t){return We(t,[Ch])}};function Nh(e,t){var r;return((r=So[t])===null||r===void 0?void 0:r.call(So,e))||!1}function Tu(e){var t=Object.keys(So);return t.filter(function(r){return Nh(e,r)})}var Me={"rgb8unorm-unsized":{gl:6407,gl1:6407,b:4,c:2,bpp:4,dataFormat:6407,types:[5121,33635]},"rgba8unorm-unsized":{gl:6408,gl1:6408,b:4,c:2,bpp:4,dataFormat:6408,types:[5121,32819,32820]},r8unorm:{gl:33321,b:1,c:1,renderbuffer:!0},r8snorm:{gl:36756,b:1,c:1},r8uint:{gl:33330,b:1,c:1,renderbuffer:!0},r8sint:{gl:33329,b:1,c:1,renderbuffer:!0},rg8unorm:{gl:33323,b:2,c:2,renderbuffer:!0},rg8snorm:{gl:36757,b:2,c:2},rg8uint:{gl:33336,b:2,c:2,renderbuffer:!0},rg8sint:{gl:33335,b:2,c:2,renderbuffer:!0},r16uint:{gl:33332,b:2,c:1,renderbuffer:!0},r16sint:{gl:33331,b:2,c:1,renderbuffer:!0},r16float:{gl:33325,b:2,c:1,render:"texture-renderable-float16-webgl",filter:"texture-filter-linear-float16-webgl",renderbuffer:!0},"r16unorm-webgl":{gl:33322,b:2,c:1,f:"texture-formats-norm16-webgl",renderbuffer:!0,x:Le},"r16snorm-webgl":{gl:36760,b:2,c:1,f:"texture-formats-norm16-webgl",x:Le},"rgba4unorm-webgl":{gl:32854,b:2,c:4,wgpu:!1,renderbuffer:!0},"rgb565unorm-webgl":{gl:36194,b:2,c:4,wgpu:!1,renderbuffer:!0},"rgb5a1unorm-webgl":{gl:32855,b:2,c:4,wgpu:!1,renderbuffer:!0},"rgb8unorm-webgl":{gl:32849,b:3,c:3,wgpu:!1},"rgb8snorm-webgl":{gl:36758,b:3,c:3,wgpu:!1},rgba8unorm:{gl:32856,gl1:6408,b:4,c:2,bpp:4},"rgba8unorm-srgb":{gl:35907,gl1:35906,b:4,c:4,gl1ext:Eu,bpp:4},rgba8snorm:{gl:36759,b:4,c:4},rgba8uint:{gl:36220,b:4,c:4,bpp:4},rgba8sint:{gl:36238,b:4,c:4,bpp:4},bgra8unorm:{b:4,c:4},"bgra8unorm-srgb":{b:4,c:4},rg16uint:{gl:33338,b:4,c:1,bpp:4},rg16sint:{gl:33337,b:4,c:2,bpp:4},rg16float:{gl:33327,bpp:4,b:4,c:2,render:"texture-renderable-float16-webgl",filter:"texture-filter-linear-float16-webgl",renderbuffer:!0},"rg16unorm-webgl":{gl:33324,b:2,c:2,f:"texture-formats-norm16-webgl",x:Le},"rg16snorm-webgl":{gl:36761,b:2,c:2,f:"texture-formats-norm16-webgl",x:Le},r32uint:{gl:33334,b:4,c:1,bpp:4,renderbuffer:!0},r32sint:{gl:33333,b:4,c:1,bpp:4,renderbuffer:!0},r32float:{gl:33326,bpp:4,b:4,c:1,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl"},rgb9e5ufloat:{gl:35901,b:4,c:3,p:1,render:"texture-renderable-float16-webgl",filter:"texture-filter-linear-float16-webgl"},rg11b10ufloat:{gl:35898,b:4,c:3,p:1,render:"texture-renderable-float32-webgl",renderbuffer:!0},rgb10a2unorm:{gl:32857,b:4,c:4,p:1,renderbuffer:!0},"rgb10a2unorm-webgl":{b:4,c:4,gl:36975,p:1,wgpu:!1,bpp:4,renderbuffer:!0},"rgb16unorm-webgl":{gl:32852,b:2,c:3,f:"texture-formats-norm16-webgl",x:Le},"rgb16snorm-webgl":{gl:36762,b:2,c:3,f:"texture-formats-norm16-webgl",x:Le},rg32uint:{gl:33340,b:8,c:2,renderbuffer:!0},rg32sint:{gl:33339,b:8,c:2,renderbuffer:!0},rg32float:{gl:33328,b:8,c:2,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl",renderbuffer:!0},rgba16uint:{gl:36214,b:8,c:4,renderbuffer:!0},rgba16sint:{gl:36232,b:8,c:4,renderbuffer:!0},rgba16float:{gl:34842,gl1:6408,b:8,c:4,render:"texture-renderable-float16-webgl",filter:"texture-filter-linear-float16-webgl"},"rgba16unorm-webgl":{gl:32859,b:2,c:4,f:"texture-formats-norm16-webgl",renderbuffer:!0,x:Le},"rgba16snorm-webgl":{gl:36763,b:2,c:4,f:"texture-formats-norm16-webgl",x:Le},"rgb32float-webgl":{gl:34837,gl1:6407,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl",gl2ext:Mh,gl1ext:Wh,dataFormat:6407,types:[5126]},rgba32uint:{gl:36208,b:16,c:4,renderbuffer:!0},rgba32sint:{gl:36226,b:16,c:4,renderbuffer:!0},rgba32float:{gl:34836,b:16,c:4,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl",renderbuffer:!0},stencil8:{gl:36168,gl1:36168,b:1,c:1,attachment:36128,renderbuffer:!0},depth16unorm:{gl:33189,gl1:33189,b:2,c:1,attachment:36096,renderbuffer:!0},depth24plus:{gl:33190,b:3,c:1,attachment:36096},depth32float:{gl:36012,b:4,c:1,attachment:36096,renderbuffer:!0},"depth24plus-stencil8":{gl:34041,gl1:34041,b:4,c:2,p:1,attachment:33306,renderbuffer:!0,depthTexture:!0},"depth24unorm-stencil8":{gl:35056,b:4,c:2,p:1,attachment:33306,renderbuffer:!0},"depth32float-stencil8":{gl:36013,b:5,c:2,p:1,attachment:33306,renderbuffer:!0},"bc1-rgb-unorm-webgl":{gl:33776,x:rr,f:ue},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:nr,f:ue},"bc1-rgba-unorm":{gl:33777,x:rr,f:ue},"bc1-rgba-unorm-srgb":{gl:35916,x:nr,f:ue},"bc2-rgba-unorm":{gl:33778,x:rr,f:ue},"bc2-rgba-unorm-srgb":{gl:35918,x:nr,f:ue},"bc3-rgba-unorm":{gl:33779,x:rr,f:ue},"bc3-rgba-unorm-srgb":{gl:35919,x:nr,f:ue},"bc4-r-unorm":{gl:36283,x:ht,f:ue},"bc4-r-snorm":{gl:36284,x:ht,f:ue},"bc5-rg-unorm":{gl:36285,x:ht,f:ue},"bc5-rg-snorm":{gl:36286,x:ht,f:ue},"bc6h-rgb-ufloat":{gl:36495,x:or,f:ue},"bc6h-rgb-float":{gl:36494,x:or,f:ue},"bc7-rgba-unorm":{gl:36492,x:or,f:ue},"bc7-rgba-unorm-srgb":{gl:36493,x:or,f:ue},"etc2-rgb8unorm":{gl:37492,f:Ee},"etc2-rgb8unorm-srgb":{gl:37494,f:Ee},"etc2-rgb8a1unorm":{gl:37496,f:Ee},"etc2-rgb8a1unorm-srgb":{gl:37497,f:Ee},"etc2-rgba8unorm":{gl:37493,f:Ee},"etc2-rgba8unorm-srgb":{gl:37495,f:Ee},"eac-r11unorm":{gl:37488,f:Ee},"eac-r11snorm":{gl:37489,f:Ee},"eac-rg11unorm":{gl:37490,f:Ee},"eac-rg11snorm":{gl:37491,f:Ee},"astc-4x4-unorm":{gl:37808,f:q},"astc-4x4-unorm-srgb":{gl:37840,f:q},"astc-5x4-unorm":{gl:37809,f:q},"astc-5x4-unorm-srgb":{gl:37841,f:q},"astc-5x5-unorm":{gl:37810,f:q},"astc-5x5-unorm-srgb":{gl:37842,f:q},"astc-6x5-unorm":{gl:37811,f:q},"astc-6x5-unorm-srgb":{gl:37843,f:q},"astc-6x6-unorm":{gl:37812,f:q},"astc-6x6-unorm-srgb":{gl:37844,f:q},"astc-8x5-unorm":{gl:37813,f:q},"astc-8x5-unorm-srgb":{gl:37845,f:q},"astc-8x6-unorm":{gl:37814,f:q},"astc-8x6-unorm-srgb":{gl:37846,f:q},"astc-8x8-unorm":{gl:37815,f:q},"astc-8x8-unorm-srgb":{gl:37847,f:q},"astc-10x5-unorm":{gl:37819,f:q},"astc-10x5-unorm-srgb":{gl:37851,f:q},"astc-10x6-unorm":{gl:37817,f:q},"astc-10x6-unorm-srgb":{gl:37849,f:q},"astc-10x8-unorm":{gl:37818,f:q},"astc-10x8-unorm-srgb":{gl:37850,f:q},"astc-10x10-unorm":{gl:37819,f:q},"astc-10x10-unorm-srgb":{gl:37851,f:q},"astc-12x10-unorm":{gl:37820,f:q},"astc-12x10-unorm-srgb":{gl:37852,f:q},"astc-12x12-unorm":{gl:37821,f:q},"astc-12x12-unorm-srgb":{gl:37853,f:q},"pvrtc-rgb4unorm-webgl":{gl:35840,f:nn},"pvrtc-rgba4unorm-webgl":{gl:35842,f:nn},"pvrtc-rbg2unorm-webgl":{gl:35841,f:nn},"pvrtc-rgba2unorm-webgl":{gl:35843,f:nn},"etc1-rbg-unorm-webgl":{gl:36196,f:Gh},"atc-rgb-unorm-webgl":{gl:35986,f:Oo},"atc-rgba-unorm-webgl":{gl:35986,f:Oo},"atc-rgbai-unorm-webgl":{gl:34798,f:Oo}},kh=(ce={},oe(ce,6403,1),oe(ce,36244,1),oe(ce,33319,2),oe(ce,33320,2),oe(ce,6407,3),oe(ce,36248,3),oe(ce,6408,4),oe(ce,36249,4),oe(ce,6402,1),oe(ce,34041,1),oe(ce,6406,1),oe(ce,6409,1),oe(ce,6410,2),ce),Vh=(xe={},oe(xe,5126,4),oe(xe,5125,4),oe(xe,5124,4),oe(xe,5123,2),oe(xe,5122,2),oe(xe,5131,2),oe(xe,5120,1),oe(xe,5121,1),xe);function ar(e,t){var r=Ne(t),n=Me[r];if(!n||(z(e)?n.gl===void 0:n.gl1===void 0))return!1;var i=n.x||z(e)&&n.gl2ext||n.gl1ext;return i?Boolean(e.getExtension(i)):!0}function Au(e,t){var r;return ar(e,t)&&((r=Me[t])===null||r===void 0?void 0:r.renderbuffer)}function Ne(e){if(typeof e=="string")return e;var t=Object.entries(Me).find(function(r){var n=xh(r,2),i=n[1];return i.gl===e||i.gl1===e});if(!t)throw new Error("Unknown texture format ".concat(e));return t[0]}function ur(e,t){var r=Me[e],n=t?r?.gl:r?.gl1;if(n===void 0)throw new Error("Unsupported texture format ".concat(e));return n}function Lu(e,t){var r=Ne(t);if(!ar(e,r))return!1;try{var n=qr(r);if(n.signed)return!1}catch{return!1}return r.endsWith("32float")?Boolean(e.getExtension("OES_texture_float_linear")):r.endsWith("16float")?Boolean(e.getExtension("OES_texture_half_float_linear")):!0}function ju(e,t){var r=Ne(t);return!(!ar(e,r)||typeof r=="number")}function mt(e,t){var r=Ne(e),n=ur(r,t),i=qr(r);return{format:n,dataFormat:Uh(i.format,i.integer,i.normalized,n),type:i.dataType?rn(i.dataType):5121,compressed:i.compressed}}function Ru(e){var t=Me[e];if(!(t!=null&&t.attachment))throw new Error("".concat(e," is not a depth stencil format"));return t.attachment}function on(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6408,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:6408,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5121,i=null,o=null;try{i=e.createTexture(),e.bindTexture(3553,i);var a=0,u=1,c=1,p=0,b=new Uint8Array([0,0,255,255]);e.texImage2D(3553,a,t,u,c,p,r,n,b),o=e.createFramebuffer(),e.bindFramebuffer(36160,o),e.framebufferTexture2D(36160,36064,3553,i,0);var g=e.checkFramebufferStatus(36160)===36053;return e.bindTexture(3553,null),g}finally{e.deleteTexture(i),e.deleteFramebuffer(o)}}function fr(e,t){var r=Ne(e),n=mt(r,t),i=kh[n.dataFormat]||4,o=Vh[n.type]||1;return i*o}function Uh(e,t,r,n){if(n===6408||n===6407)return n;switch(e){case"r":return t&&!r?36244:6403;case"rg":return t&&!r?33320:33319;case"rgb":return t&&!r?36248:6407;case"rgba":return t&&!r?36249:6408;default:return 6408}}function zh(e,t){return Xh(e)||$h(e,t)||Bu(e,t)||Hh()}function Hh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
27
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $h(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function Xh(e){if(Array.isArray(e))return e}function Kh(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Bu(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
28
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function Bu(e,t){if(e){if(typeof e=="string")return Gu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gu(e,t)}}function Gu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Iu(e){var t=Yh(e),r=Kh(Tu(e)),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;t.add(i)}}catch(o){r.e(o)}finally{r.f()}return t}function Yh(e){e.getExtension("EXT_color_buffer_float"),e.getExtension("WEBGL_color_buffer_float"),e.getExtension("EXT_float_blend");for(var t=new Set,r=0,n=Object.keys(Fu);r<n.length;r++){var i=n[r];qh(e,i)&&t.add(i)}return t}function qh(e,t){var r=Fu[t];if(!r)return!1;var n=r||[],i=zh(n,2),o=i[0],a=i[1],u=z(e)?a:o;if(typeof u=="boolean")return u;switch(t){case"texture-renderable-rgba32float-webgl":return z(e)?Boolean(e.getExtension(u)):on(e);case"glsl-derivatives":return xo(e,u);case"glsl-frag-data":return xo(e,u,{behavior:"require"});case"glsl-frag-depth":return xo(e,u);default:return Boolean(e.getExtension(u))}}var Po={};function xo(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!Pu(r))return!0;if(t in Po)return Po[t];var n=r.behavior||"enable",i="#extension GL_".concat(t," : ").concat(n,`
|
|
29
|
+
void main(void) {}`),o=e.createShader(35633);if(!o)throw new Error("shader");e.shaderSource(o,i),e.compileShader(o);var a=e.getShaderParameter(o,35713);return e.deleteShader(o),Po[t]=a,a}var Fu={webgl:[!0,!0],webgl2:[!1,!0],"timer-query-webgl":["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],"transform-feedback-webgl2":[!1,!0],"vertex-array-object-webgl1":["OES_vertex_array_object",!0],"instanced-rendering-webgl1":["ANGLE_instanced_arrays",!0],"multiple-render-targets-webgl1":["WEBGL_draw_buffers",!0],"index-uint32-webgl1":["OES_element_index_uint",!0],"blend-minmax-webgl1":["EXT_blend_minmax",!0],"texture-blend-float-webgl1":["EXT_float_blend","EXT_float_blend"],"texture-formats-srgb-webgl1":["EXT_sRGB",!0],"texture-formats-depth-webgl1":["WEBGL_depth_texture",!0],"texture-formats-float32-webgl1":["OES_texture_float",!0],"texture-formats-float16-webgl1":["OES_texture_half_float",!0],"texture-filter-linear-float32-webgl":["OES_texture_float_linear","OES_texture_float_linear"],"texture-filter-linear-float16-webgl":["OES_texture_half_float_linear","OES_texture_half_float_linear"],"texture-filter-anisotropic-webgl":["EXT_texture_filter_anisotropic","EXT_texture_filter_anisotropic"],"texture-renderable-rgba32float-webgl":["WEBGL_color_buffer_float","EXT_color_buffer_float"],"texture-renderable-float32-webgl":[!1,"EXT_color_buffer_float"],"texture-renderable-float16-webgl":["EXT_color_buffer_half_float","EXT_color_buffer_half_float"],"glsl-frag-data":["WEBGL_draw_buffers",!0],"glsl-frag-depth":["EXT_frag_depth",!0],"glsl-derivatives":["OES_standard_derivatives",!0],"glsl-texture-lod":["EXT_shader_texture_lod",!0]};function cr(e){return cr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cr(e)}function U(e,t,r){return t=Qh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qh(e){var t=Zh(e,"string");return cr(t)==="symbol"?t:String(t)}function Zh(e,t){if(cr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(cr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Du(e){var t=Xt(e);return{maxTextureDimension1D:0,maxTextureDimension2D:e.getParameter(3379),maxTextureDimension3D:t?t.getParameter(32883):0,maxTextureArrayLayers:t?t.getParameter(35071):0,maxBindGroups:1,maxDynamicUniformBuffersPerPipelineLayout:0,maxDynamicStorageBuffersPerPipelineLayout:0,maxSampledTexturesPerShaderStage:e.getParameter(35660),maxSamplersPerShaderStage:e.getParameter(35661),maxStorageBuffersPerShaderStage:0,maxStorageTexturesPerShaderStage:0,maxUniformBuffersPerShaderStage:t?t.getParameter(35375):0,maxUniformBufferBindingSize:t?t.getParameter(35376):0,maxStorageBufferBindingSize:0,minUniformBufferOffsetAlignment:t?t.getParameter(35380):0,minStorageBufferOffsetAlignment:0,maxVertexBuffers:0,maxVertexAttributes:e.getParameter(34921),maxVertexBufferArrayStride:2048,maxInterStageShaderComponents:t?t.getParameter(35659):0,maxComputeWorkgroupStorageSize:0,maxComputeInvocationsPerWorkgroup:0,maxComputeWorkgroupSizeX:0,maxComputeWorkgroupSizeY:0,maxComputeWorkgroupSizeZ:0,maxComputeWorkgroupsPerDimension:0}}function Cu(e){var t,r=Xt(e);function n(o){return e.getParameter(o)}function i(o,a){return r?r.getParameter(o):a||0}return t={},U(t,33902,n(33902)),U(t,33901,n(33901)),U(t,3379,n(3379)),U(t,34076,n(34076)),U(t,34930,n(34930)),U(t,35661,n(35661)),U(t,35660,n(35660)),U(t,34024,n(34024)),U(t,36348,n(36348)),U(t,34921,n(34921)),U(t,36347,n(36347)),U(t,36349,n(36349)),U(t,3386,n(3386)),U(t,34047,n(34047)),U(t,32883,i(32883)),U(t,35071,i(35071)),U(t,37447,i(37447)),U(t,36063,i(36063)),U(t,35379,i(35379)),U(t,35374,i(35374)),U(t,35377,i(35377)),U(t,34852,i(34852)),U(t,36203,i(36203)),U(t,33001,i(33001)),U(t,33e3,i(33e3)),U(t,37157,i(37157)),U(t,35373,i(35373)),U(t,35657,i(35657)),U(t,36183,i(36183)),U(t,37137,i(37137)),U(t,34045,i(34045)),U(t,35978,i(35978)),U(t,35979,i(35979)),U(t,35968,i(35968)),U(t,35376,i(35376)),U(t,35375,i(35375)),U(t,35659,i(35659)),U(t,37154,i(37154)),U(t,35371,i(35371)),U(t,35658,i(35658)),U(t,35076,i(35076)),U(t,35077,i(35077)),U(t,35380,i(35380)),t}function ve(e,t,r){var n=le.attach(e),i=n.gl;if(Jh(t))return r(e);var o=t.nocatch,a=o===void 0?!0:o;_e(i),be(i,t);var u;if(a)u=r(i),ge(i);else try{u=r(i)}finally{ge(i)}return u}function Jh(e){for(var t in e)return!1;return!0}function Mu(e,t,r,n){if(Ke(t))return n(e);_e(e.gl);try{return fn(e,t),be(e,r),n(e)}finally{ge(e.gl)}}function Nu(e,t,r){if(Ke(t))return r(e);_e(e.gl);try{return fn(e,t),r(e)}finally{ge(e.gl)}}function fn(e,t){var r=le.attach(e),n=r.gl;if(t.cullMode)switch(t.cullMode){case"none":n.disable(2884);break;case"front":n.enable(2884),n.cullFace(1028);break;case"back":n.enable(2884),n.cullFace(1029);break}if(t.frontFace&&n.frontFace(sr("frontFace",t.frontFace,{ccw:2305,cw:2304})),t.depthBias!==void 0&&n.polygonOffset(t.depthBias,t.depthBiasSlopeScale||0),t.depthWriteEnabled!==void 0&&n.depthMask(tm("depthWriteEnabled",t.depthWriteEnabled)),t.depthCompare&&(t.depthCompare!=="always"?n.enable(2929):n.disable(2929),n.depthFunc(un("depthCompare",t.depthCompare))),t.stencilWriteMask){var i=t.stencilWriteMask;n.stencilMaskSeparate(1028,i),n.stencilMaskSeparate(1029,i)}if(t.stencilReadMask&&B.warn("stencilReadMask not supported under WebGL"),t.stencilCompare){var o=t.stencilReadMask||4294967295,a=un("depthCompare",t.stencilCompare);t.stencilCompare!=="always"?n.enable(2960):n.disable(2960),n.stencilFuncSeparate(1028,a,0,o),n.stencilFuncSeparate(1029,a,0,o)}if(t.stencilPassOperation&&t.stencilFailOperation&&t.stencilDepthFailOperation){var u=Eo("stencilPassOperation",t.stencilPassOperation),c=Eo("stencilFailOperation",t.stencilFailOperation),p=Eo("stencilDepthFailOperation",t.stencilDepthFailOperation);n.stencilOpSeparate(1028,c,p,u),n.stencilOpSeparate(1029,c,p,u)}if(t.blendColorOperation||t.blendAlphaOperation){n.enable(3042);var b=Wu("blendColorOperation",t.blendColorOperation||"add"),g=Wu("blendAlphaOperation",t.blendAlphaOperation||"add");n.blendEquationSeparate(b,g);var v=an("blendColorSrcFactor",t.blendColorSrcFactor||"one"),O=an("blendColorDstFactor",t.blendColorDstFactor||"zero"),w=an("blendAlphaSrcFactor",t.blendAlphaSrcFactor||"one"),P=an("blendAlphaDstFactor",t.blendAlphaDstFactor||"zero");n.blendFuncSeparate(v,O,w,P)}}function un(e,t){return sr(e,t,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function Eo(e,t){return sr(e,t,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function Wu(e,t){return sr(e,t,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function an(e,t){return sr(e,t,{one:1,zero:0,"src-color":768,"one-minus-src-color":769,"dst-color":774,"one-minus-dst-color":775,"src-alpha":770,"one-minus-src-alpha":771,"dst-alpha":772,"one-minus-dst-alpha":773})}function em(e,t){return"Illegal parameter ".concat(t," for ").concat(e)}function sr(e,t,r){if(!(t in r))throw new Error(em(e,t));return r[t]}function tm(e,t){return t}function lr(e){return lr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lr(e)}function ku(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function rm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ku(Object(r),!0).forEach(function(n){nm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ku(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nm(e,t,r){return t=om(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function om(e){var t=im(e,"string");return lr(t)==="symbol"?t:String(t)}function im(e,t){if(lr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(lr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cn(e){var t={};return e.addressModeU&&(t[10242]=To(e.addressModeU)),e.addressModeV&&(t[10243]=To(e.addressModeV)),e.addressModeW&&(t[32882]=To(e.addressModeW)),e.magFilter&&(t[10240]=Vu(e.magFilter)),(e.minFilter||e.mipmapFilter)&&(t[10241]=am(e.minFilter||"linear",e.mipmapFilter)),e.lodMinClamp!==void 0&&(t[33082]=e.lodMinClamp),e.lodMaxClamp!==void 0&&(t[33083]=e.lodMaxClamp),e.type==="comparison-sampler"&&(t[34892]=34894),e.compare&&(t[34893]=un("compare",e.compare)),e.maxAnisotropy&&(t[34046]=e.maxAnisotropy),t}function To(e){switch(e){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function Vu(e){switch(e){case"nearest":return 9728;case"linear":return 9729}}function am(e,t){if(!t)return Vu(e);switch(e){case"nearest":return t==="nearest"?9984:9986;case"linear":return t==="nearest"?9985:9987}}function Uu(e){var t=rm({},e);return e[10241]!==9728&&(t[10241]=9729),t[10242]=33071,t[10243]=33071,t}function Ao(){"use strict";Ao=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(l,f,s){l[f]=s.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{c({},"")}catch{c=function(s,d,m){return s[d]=m}}function p(l,f,s,d){var m=f&&f.prototype instanceof v?f:v,h=Object.create(m.prototype),_=new V(d||[]);return n(h,"_invoke",{value:k(l,s,_)}),h}function b(l,f,s){try{return{type:"normal",arg:l.call(f,s)}}catch(d){return{type:"throw",arg:d}}}e.wrap=p;var g={};function v(){}function O(){}function w(){}var P={};c(P,o,function(){return this});var A=Object.getPrototypeOf,x=A&&A(A(W([])));x&&x!==t&&r.call(x,o)&&(P=x);var T=w.prototype=v.prototype=Object.create(P);function R(l){["next","throw","return"].forEach(function(f){c(l,f,function(s){return this._invoke(f,s)})})}function j(l,f){function s(m,h,_,S){var E=b(l[m],l,h);if(E.type!=="throw"){var D=E.arg,I=D.value;return I&&je(I)=="object"&&r.call(I,"__await")?f.resolve(I.__await).then(function(C){s("next",C,_,S)},function(C){s("throw",C,_,S)}):f.resolve(I).then(function(C){D.value=C,_(D)},function(C){return s("throw",C,_,S)})}S(E.arg)}var d;n(this,"_invoke",{value:function(h,_){function S(){return new f(function(E,D){s(h,_,E,D)})}return d=d?d.then(S,S):S()}})}function k(l,f,s){var d="suspendedStart";return function(m,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(m==="throw")throw h;return H()}for(s.method=m,s.arg=h;;){var _=s.delegate;if(_){var S=F(_,s);if(S){if(S===g)continue;return S}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(d==="suspendedStart")throw d="completed",s.arg;s.dispatchException(s.arg)}else s.method==="return"&&s.abrupt("return",s.arg);d="executing";var E=b(l,f,s);if(E.type==="normal"){if(d=s.done?"completed":"suspendedYield",E.arg===g)continue;return{value:E.arg,done:s.done}}E.type==="throw"&&(d="completed",s.method="throw",s.arg=E.arg)}}}function F(l,f){var s=f.method,d=l.iterator[s];if(d===void 0)return f.delegate=null,s==="throw"&&l.iterator.return&&(f.method="return",f.arg=void 0,F(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var m=b(d,l.iterator,f.arg);if(m.type==="throw")return f.method="throw",f.arg=m.arg,f.delegate=null,g;var h=m.arg;return h?h.done?(f[l.resultName]=h.value,f.next=l.nextLoc,f.method!=="return"&&(f.method="next",f.arg=void 0),f.delegate=null,g):h:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,g)}function X(l){var f={tryLoc:l[0]};1 in l&&(f.catchLoc=l[1]),2 in l&&(f.finallyLoc=l[2],f.afterLoc=l[3]),this.tryEntries.push(f)}function N(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(X,this),this.reset(!0)}function W(l){if(l){var f=l[o];if(f)return f.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var s=-1,d=function m(){for(;++s<l.length;)if(r.call(l,s))return m.value=l[s],m.done=!1,m;return m.value=void 0,m.done=!0,m};return d.next=d}}return{next:H}}function H(){return{value:void 0,done:!0}}return O.prototype=w,n(T,"constructor",{value:w,configurable:!0}),n(w,"constructor",{value:O,configurable:!0}),O.displayName=c(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===O||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,w):(l.__proto__=w,c(l,u,"GeneratorFunction")),l.prototype=Object.create(T),l},e.awrap=function(l){return{__await:l}},R(j.prototype),c(j.prototype,a,function(){return this}),e.AsyncIterator=j,e.async=function(l,f,s,d,m){m===void 0&&(m=Promise);var h=new j(p(l,f,s,d),m);return e.isGeneratorFunction(f)?h:h.next().then(function(_){return _.done?_.value:h.next()})},R(T),c(T,u,"Generator"),c(T,o,function(){return this}),c(T,"toString",function(){return"[object Generator]"}),e.keys=function(l){var f=Object(l),s=[];for(var d in f)s.push(d);return s.reverse(),function m(){for(;s.length;){var h=s.pop();if(h in f)return m.value=h,m.done=!1,m}return m.done=!0,m}},e.values=W,V.prototype={constructor:V,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(N),!f)for(var s in this)s.charAt(0)==="t"&&r.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=void 0)},stop:function(){this.done=!0;var f=this.tryEntries[0].completion;if(f.type==="throw")throw f.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var s=this;function d(D,I){return _.type="throw",_.arg=f,s.next=D,I&&(s.method="next",s.arg=void 0),!!I}for(var m=this.tryEntries.length-1;m>=0;--m){var h=this.tryEntries[m],_=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var S=r.call(h,"catchLoc"),E=r.call(h,"finallyLoc");if(S&&E){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(S){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!E)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return d(h.finallyLoc)}}}},abrupt:function(f,s){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m.tryLoc<=this.prev&&r.call(m,"finallyLoc")&&this.prev<m.finallyLoc){var h=m;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var _=h?h.completion:{};return _.type=f,_.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(_)},complete:function(f,s){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&s&&(this.next=s),g},finish:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.finallyLoc===f)return this.complete(d.completion,d.afterLoc),N(d),g}},catch:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.tryLoc===f){var m=d.completion;if(m.type==="throw"){var h=m.arg;N(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:W(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function zu(e,t,r,n,i,o,a){try{var u=e[o](a),c=u.value}catch(p){r(p);return}u.done?t(c):Promise.resolve(c).then(n,i)}function um(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(c){zu(o,n,i,a,u,"next",c)}function u(c){zu(o,n,i,a,u,"throw",c)}a(void 0)})}}function Hu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $u(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Hu(Object(r),!0).forEach(function(n){fm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fm(e,t,r){return t=Ku(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function je(e){return je=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},je(e)}function Xu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ku(n.key),n)}}function cm(e,t,r){return t&&Xu(e.prototype,t),r&&Xu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ku(e){var t=sm(e,"string");return je(t)==="symbol"?t:String(t)}function sm(e,t){if(je(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(je(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pm(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lo(e,t)}function Lo(e,t){return Lo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Lo(e,t)}function dm(e){var t=ym();return function(){var n=sn(e),i;if(t){var o=sn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return hm(this,i)}}function hm(e,t){if(t&&(je(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mm(e)}function mm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ym(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function sn(e){return sn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},sn(e)}var bm=10,pe=function(e){pm(r,e);var t=dm(r);function r(i){var o,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};lm(this,r),o=t.call(this,i,a),o.device=void 0,o.gl=void 0,o.gl2=void 0,o.handle=void 0,o.glTarget=void 0,o.glUsage=void 0,o.glIndexType=5123,o.byteLength=void 0,o.bytesUsed=void 0,o.debugData=null,o.device=i,o.gl=o.device.gl,o.gl2=o.device.gl2;var u=je(a)==="object"?a.handle:void 0;return o.handle=u||o.gl.createBuffer(),i.setSpectorMetadata(o.handle,$u($u({},o.props),{},{data:je(o.props.data)})),o.glTarget=gm(o.props.usage),o.glUsage=vm(o.props.usage),o.glIndexType=o.props.indexType==="uint32"?5125:5123,o.debugData=null,a.data?o._initWithData(a.data,a.byteOffset,a.byteLength):o._initWithByteLength(a.byteLength||0),o}var n=r.prototype;return n._initWithData=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:o.byteLength+a;M(ArrayBuffer.isView(o));var c=this._getWriteTarget();return this.gl.bindBuffer(c,this.handle),this.gl.bufferData(c,u,this.glUsage),this.gl.bufferSubData(c,a,o),this.gl.bindBuffer(c,null),this.debugData=o.slice(0,bm),this.bytesUsed=u,this.byteLength=u,this.trackAllocatedMemory(u),this},n._initWithByteLength=function(o){M(o>=0);var a=o;o===0&&(a=new Float32Array(0));var u=this._getWriteTarget();return this.gl.bindBuffer(u,this.handle),this.gl.bufferData(u,a,this.glUsage),this.gl.bindBuffer(u,null),this.debugData=null,this.bytesUsed=o,this.byteLength=o,this},n.destroy=function(){!this.destroyed&&this.handle&&(this.removeStats(),this.trackDeallocatedMemory(),this.gl.deleteBuffer(this.handle),this.destroyed=!0,this.handle=null)},n.write=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,u=0,c=void 0,p=this.device.isWebGL2?36663:this.glTarget;this.gl.bindBuffer(p,this.handle),u!==0||c!==void 0?(this.device.assertWebGL2(),this.gl2.bufferSubData(p,a,o,u,c)):this.gl.bufferSubData(p,a,o),this.gl.bindBuffer(p,null)},n.readAsync=function(){var i=um(Ao().mark(function a(){var u,c,p,b,g,v=arguments;return Ao().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return c=v.length>0&&v[0]!==void 0?v[0]:0,p=v.length>1?v[1]:void 0,this.device.assertWebGL2(),p=(u=p)!==null&&u!==void 0?u:this.byteLength,b=new Uint8Array(p),g=0,this.gl.bindBuffer(36662,this.handle),this.gl2.getBufferSubData(36662,c,b,g,p),this.gl.bindBuffer(36662,null),w.abrupt("return",b);case 10:case"end":return w.stop()}},a,this)}));function o(){return i.apply(this,arguments)}return o}(),n._invalidateDebugData=function(){this.debugData=null},n._getWriteTarget=function(){return this.glTarget},n._getReadTarget=function(){return this.glTarget},cm(r)}(te);function gm(e){return e&te.INDEX?34963:e&te.VERTEX?34962:e&te.UNIFORM?35345:34962}function vm(e){return e&te.INDEX||e&te.VERTEX?35044:e&te.UNIFORM?35048:35044}function yt(e){return yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt(e)}function wm(e,t){return Pm(e)||Sm(e,t)||Om(e,t)||_m()}function _m(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
30
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Om(e,t){if(e){if(typeof e=="string")return Yu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yu(e,t)}}function Yu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Sm(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function Pm(e){if(Array.isArray(e))return e}function qu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Em(n.key),n)}}function xm(e,t,r){return t&&qu(e.prototype,t),r&&qu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Em(e){var t=Tm(e,"string");return yt(t)==="symbol"?t:String(t)}function Tm(e,t){if(yt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(yt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Am(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lm(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jo(e,t)}function jo(e,t){return jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},jo(e,t)}function jm(e){var t=Bm();return function(){var n=ln(e),i;if(t){var o=ln(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Rm(this,i)}}function Rm(e,t){if(t&&(yt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gm(e)}function Gm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ln(e){return ln=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ln(e)}var ke=function(e){Lm(r,e);var t=jm(r);function r(i,o){var a;return Am(this,r),a=t.call(this,i,o),a.device=void 0,a.handle=void 0,a.parameters=void 0,a.device=i,a.parameters=cn(o),a.device.isWebGL2&&(a.handle=a.handle||a.device.gl2.createSampler(),a._setSamplerParameters(a.parameters)),a}var n=r.prototype;return n.destroy=function(){this.handle&&(this.device.gl2.deleteSampler(this.handle),this.handle=void 0)},n.toString=function(){return"Sampler(".concat(this.id,",").concat(JSON.stringify(this.props),")")},n._setSamplerParameters=function(o){for(var a=0,u=Object.entries(o);a<u.length;a++){var c=wm(u[a],2),p=c[0],b=c[1],g=Number(p);switch(g){case 33082:case 33083:this.device.gl2.samplerParameterf(this.handle,g,b);break;default:this.device.gl2.samplerParameteri(this.handle,g,b);break}}},xm(r)}(Ir);function Ro(){"use strict";Ro=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(l,f,s){l[f]=s.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{c({},"")}catch{c=function(s,d,m){return s[d]=m}}function p(l,f,s,d){var m=f&&f.prototype instanceof v?f:v,h=Object.create(m.prototype),_=new V(d||[]);return n(h,"_invoke",{value:k(l,s,_)}),h}function b(l,f,s){try{return{type:"normal",arg:l.call(f,s)}}catch(d){return{type:"throw",arg:d}}}e.wrap=p;var g={};function v(){}function O(){}function w(){}var P={};c(P,o,function(){return this});var A=Object.getPrototypeOf,x=A&&A(A(W([])));x&&x!==t&&r.call(x,o)&&(P=x);var T=w.prototype=v.prototype=Object.create(P);function R(l){["next","throw","return"].forEach(function(f){c(l,f,function(s){return this._invoke(f,s)})})}function j(l,f){function s(m,h,_,S){var E=b(l[m],l,h);if(E.type!=="throw"){var D=E.arg,I=D.value;return I&&Ge(I)=="object"&&r.call(I,"__await")?f.resolve(I.__await).then(function(C){s("next",C,_,S)},function(C){s("throw",C,_,S)}):f.resolve(I).then(function(C){D.value=C,_(D)},function(C){return s("throw",C,_,S)})}S(E.arg)}var d;n(this,"_invoke",{value:function(h,_){function S(){return new f(function(E,D){s(h,_,E,D)})}return d=d?d.then(S,S):S()}})}function k(l,f,s){var d="suspendedStart";return function(m,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(m==="throw")throw h;return H()}for(s.method=m,s.arg=h;;){var _=s.delegate;if(_){var S=F(_,s);if(S){if(S===g)continue;return S}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(d==="suspendedStart")throw d="completed",s.arg;s.dispatchException(s.arg)}else s.method==="return"&&s.abrupt("return",s.arg);d="executing";var E=b(l,f,s);if(E.type==="normal"){if(d=s.done?"completed":"suspendedYield",E.arg===g)continue;return{value:E.arg,done:s.done}}E.type==="throw"&&(d="completed",s.method="throw",s.arg=E.arg)}}}function F(l,f){var s=f.method,d=l.iterator[s];if(d===void 0)return f.delegate=null,s==="throw"&&l.iterator.return&&(f.method="return",f.arg=void 0,F(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var m=b(d,l.iterator,f.arg);if(m.type==="throw")return f.method="throw",f.arg=m.arg,f.delegate=null,g;var h=m.arg;return h?h.done?(f[l.resultName]=h.value,f.next=l.nextLoc,f.method!=="return"&&(f.method="next",f.arg=void 0),f.delegate=null,g):h:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,g)}function X(l){var f={tryLoc:l[0]};1 in l&&(f.catchLoc=l[1]),2 in l&&(f.finallyLoc=l[2],f.afterLoc=l[3]),this.tryEntries.push(f)}function N(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(X,this),this.reset(!0)}function W(l){if(l){var f=l[o];if(f)return f.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var s=-1,d=function m(){for(;++s<l.length;)if(r.call(l,s))return m.value=l[s],m.done=!1,m;return m.value=void 0,m.done=!0,m};return d.next=d}}return{next:H}}function H(){return{value:void 0,done:!0}}return O.prototype=w,n(T,"constructor",{value:w,configurable:!0}),n(w,"constructor",{value:O,configurable:!0}),O.displayName=c(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===O||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,w):(l.__proto__=w,c(l,u,"GeneratorFunction")),l.prototype=Object.create(T),l},e.awrap=function(l){return{__await:l}},R(j.prototype),c(j.prototype,a,function(){return this}),e.AsyncIterator=j,e.async=function(l,f,s,d,m){m===void 0&&(m=Promise);var h=new j(p(l,f,s,d),m);return e.isGeneratorFunction(f)?h:h.next().then(function(_){return _.done?_.value:h.next()})},R(T),c(T,u,"Generator"),c(T,o,function(){return this}),c(T,"toString",function(){return"[object Generator]"}),e.keys=function(l){var f=Object(l),s=[];for(var d in f)s.push(d);return s.reverse(),function m(){for(;s.length;){var h=s.pop();if(h in f)return m.value=h,m.done=!1,m}return m.done=!0,m}},e.values=W,V.prototype={constructor:V,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(N),!f)for(var s in this)s.charAt(0)==="t"&&r.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=void 0)},stop:function(){this.done=!0;var f=this.tryEntries[0].completion;if(f.type==="throw")throw f.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var s=this;function d(D,I){return _.type="throw",_.arg=f,s.next=D,I&&(s.method="next",s.arg=void 0),!!I}for(var m=this.tryEntries.length-1;m>=0;--m){var h=this.tryEntries[m],_=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var S=r.call(h,"catchLoc"),E=r.call(h,"finallyLoc");if(S&&E){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(S){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!E)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return d(h.finallyLoc)}}}},abrupt:function(f,s){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m.tryLoc<=this.prev&&r.call(m,"finallyLoc")&&this.prev<m.finallyLoc){var h=m;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var _=h?h.completion:{};return _.type=f,_.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(_)},complete:function(f,s){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&s&&(this.next=s),g},finish:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.finallyLoc===f)return this.complete(d.completion,d.afterLoc),N(d),g}},catch:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.tryLoc===f){var m=d.completion;if(m.type==="throw"){var h=m.arg;N(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:W(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function Qu(e,t,r,n,i,o,a){try{var u=e[o](a),c=u.value}catch(p){r(p);return}u.done?t(c):Promise.resolve(c).then(n,i)}function Fm(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(c){Qu(o,n,i,a,u,"next",c)}function u(c){Qu(o,n,i,a,u,"throw",c)}a(void 0)})}}function Zu(e,t){return Wm(e)||Cm(e,t)||rf(e,t)||Dm()}function Dm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
31
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cm(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function Wm(e){if(Array.isArray(e))return e}function Mm(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=rf(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
32
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function rf(e,t){if(e){if(typeof e=="string")return Ju(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ju(e,t)}}function Ju(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ge(e){return Ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ge(e)}function ef(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function pn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ef(Object(r),!0).forEach(function(n){Nm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ef(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Nm(e,t,r){return t=nf(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,nf(n.key),n)}}function km(e,t,r){return t&&tf(e.prototype,t),r&&tf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function nf(e){var t=Vm(e,"string");return Ge(t)==="symbol"?t:String(t)}function Vm(e,t){if(Ge(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ge(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Um(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zm(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Go(e,t)}function Go(e,t){return Go=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Go(e,t)}function Hm(e){var t=Xm();return function(){var n=hn(e),i;if(t){var o=hn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return $m(this,i)}}function $m(e,t){if(t&&(Ge(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return of(e)}function of(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function hn(e){return hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},hn(e)}var Km={parameters:{},pixelStore:{},pixels:null,border:0,dataFormat:void 0,textureUnit:void 0,target:void 0},se=function(e){zm(r,e);var t=Hm(r);function r(i,o){var a,u;return Um(this,r),u=t.call(this,i,pn(pn({},Km),{},{format:"rgba8unorm"},o)),u.MAX_ATTRIBUTES=void 0,u.device=void 0,u.gl=void 0,u.gl2=void 0,u.handle=void 0,u.sampler=void 0,u.glFormat=void 0,u.type=void 0,u.dataFormat=void 0,u.mipmaps=void 0,u.target=void 0,u.textureUnit=void 0,u.loaded=!1,u._video=void 0,u.device=i,u.gl=u.device.gl,u.gl2=u.device.gl2,u.handle=u.props.handle||u.gl.createTexture(),u.device.setSpectorMetadata(u.handle,pn(pn({},u.props),{},{data:Ge(u.props.data)})),u.glFormat=6408,u.target=Ym(u.props),u.loaded=!1,typeof((a=u.props)===null||a===void 0?void 0:a.data)=="string"&&Object.assign(u.props,{data:ho(u.props.data)}),u.initialize(u.props),Object.seal(of(u)),u}var n=r.prototype;return n.destroy=function(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)},n.toString=function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")},n.initialize=function(){var o=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.props.dimension==="cube")return this.initializeCube(a);var u=a.data;if(u instanceof Promise)return u.then(function(f){return o.initialize(Object.assign({},a,{pixels:f,data:f}))}),this;var c=typeof HTMLVideoElement<"u"&&u instanceof HTMLVideoElement;if(c&&u.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,u.addEventListener("loadeddata",function(){return o.initialize(a)}),this;var p=a.parameters,b=p===void 0?{}:p,g=a.pixels,v=g===void 0?null:g,O=a.pixelStore,w=O===void 0?{}:O,P=a.textureUnit,A=P===void 0?void 0:P;u||(u=v);var x=a.width,T=a.height,R=a.dataFormat,j=a.type,k=a.compressed,F=k===void 0?!1:k,X=a.mipmaps,N=X===void 0?!0:X,V=a.depth,W=V===void 0?0:V,H=ur(a.format,this.device.isWebGL2),l=this._deduceParameters({format:a.format,type:j,dataFormat:R,compressed:F,data:u,width:x,height:T});return x=l.width,T=l.height,F=l.compressed,R=l.dataFormat,j=l.type,this.width=x,this.height=T,this.glFormat=H,this.type=j,this.dataFormat=R,this.textureUnit=A,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),N&&this.device.isWebGL1&&dn(this.width,this.height)&&(B.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaps"))(),N=!1),this.mipmaps=N,this.setImageData({data:u,width:x,height:T,depth:W,format:H,type:j,dataFormat:R,parameters:w,compressed:F}),this.setSampler(a.sampler),this._setSamplerParameters(b),N&&this.generateMipmap(),c&&(this._video={video:u,parameters:b,lastTime:u.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?u.currentTime:-1}),this},n.initializeCube=function(o){var a=this,u=o.mipmaps,c=u===void 0?!0:u,p=o.parameters,b=p===void 0?{}:p;return this.setCubeMapImageData(o).then(function(){a.loaded=!0,c&&a.generateMipmap(o),a.setSampler(o.sampler),a._setSamplerParameters(b)}),this},n.setSampler=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a;o instanceof ke?(this.sampler=o,a=o.props):(this.sampler=new ke(this.device,o),a=o);var u=cn(a);return this._setSamplerParameters(u),this},n.resize=function(o){var a=o.height,u=o.width,c=o.mipmaps,p=c===void 0?!1:c;return u!==this.width||a!==this.height?this.initialize({width:u,height:a,format:this.format,type:this.type,dataFormat:this.dataFormat,mipmaps:p}):this},n.update=function(){if(this._video){var o=this._video,a=o.video,u=o.parameters,c=o.lastTime;if(c===a.currentTime||a.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:a,parameters:u}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=a.currentTime}},n.generateMipmap=function(){var o=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.device.isWebGL1&&dn(this.width,this.height)?(B.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),ve(this.gl,a,function(){o.gl.generateMipmap(o.target)}),this.gl.bindTexture(this.target,null),this)},n.setImageData=function(o){var a=this;if(this.props.dimension==="3d"||this.props.dimension==="2d-array")return this.setImageData3D(o);this.trackDeallocatedMemory("Texture");var u=o.target,c=u===void 0?this.target:u,p=o.pixels,b=p===void 0?null:p,g=o.level,v=g===void 0?0:g,O=o.glFormat,w=O===void 0?this.glFormat:O,P=o.offset,A=P===void 0?0:P,x=o.parameters,T=x===void 0?{}:x,R=o.data,j=R===void 0?null:R,k=o.type,F=k===void 0?this.type:k,X=o.width,N=X===void 0?this.width:X,V=o.height,W=V===void 0?this.height:V,H=o.dataFormat,l=H===void 0?this.dataFormat:H,f=o.compressed,s=f===void 0?!1:f;j||(j=b);var d=this._deduceParameters({format:this.props.format,type:F,dataFormat:l,compressed:s,data:j,width:N,height:W});F=d.type,l=d.dataFormat,s=d.compressed,N=d.width,W=d.height;var m=this.gl;m.bindTexture(this.target,this.handle);var h=null,_=this._getDataType({data:j,compressed:s});j=_.data,h=_.dataType;var S;if(ve(this.gl,T,function(){switch(h){case"null":m.texImage2D(c,v,w,N,W,0,l,F,j);break;case"typed-array":m.texImage2D(c,v,w,N,W,0,l,F,j,A);break;case"buffer":S=a.device.assertWebGL2(),S.bindBuffer(35052,j.handle||j),S.texImage2D(c,v,w,N,W,0,l,F,A),S.bindBuffer(35052,null);break;case"browser-object":a.device.isWebGL2?m.texImage2D(c,v,w,N,W,0,l,F,j):m.texImage2D(c,v,w,l,F,j);break;case"compressed":var D=Mm(j.entries()),I;try{for(D.s();!(I=D.n()).done;){var C=Zu(I.value,2),Rc=C[0],gr=C[1];m.compressedTexImage2D(c,Rc,gr.format,gr.width,gr.height,0,gr.data)}}catch(Gc){D.e(Gc)}finally{D.f()}break;default:M(!1,"Unknown image data type")}}),j&&j.byteLength)this.trackAllocatedMemory(j.byteLength,"Texture");else{var E=fr(this.props.format,this.device.isWebGL2);this.trackAllocatedMemory(this.width*this.height*E,"Texture")}return this.loaded=!0,this},n.setSubImageData=function(o){var a=this,u=o.target,c=u===void 0?this.target:u,p=o.pixels,b=p===void 0?null:p,g=o.data,v=g===void 0?null:g,O=o.x,w=O===void 0?0:O,P=o.y,A=P===void 0?0:P,x=o.width,T=x===void 0?this.width:x,R=o.height,j=R===void 0?this.height:R,k=o.level,F=k===void 0?0:k,X=o.glFormat,N=X===void 0?this.glFormat:X,V=o.type,W=V===void 0?this.type:V,H=o.dataFormat,l=H===void 0?this.dataFormat:H,f=o.compressed,s=f===void 0?!1:f,d=o.offset,m=d===void 0?0:d,h=o.parameters,_=h===void 0?{}:h,S=this._deduceParameters({format:this.props.format,type:W,dataFormat:l,compressed:s,data:v,width:T,height:j});if(W=S.type,l=S.dataFormat,s=S.compressed,T=S.width,j=S.height,M(this.depth===1,"texSubImage not supported for 3D textures"),v||(v=b),v&&v.data){var E=v;v=E.data,T=E.shape[0],j=E.shape[1]}v instanceof pe&&(v=v.handle),this.gl.bindTexture(this.target,this.handle),ve(this.gl,_,function(){if(s)a.gl.compressedTexSubImage2D(c,F,w,A,T,j,N,v);else if(v===null)a.gl.texSubImage2D(c,F,w,A,T,j,l,W,null);else if(ArrayBuffer.isView(v))a.gl.texSubImage2D(c,F,w,A,T,j,l,W,v,m);else if(typeof WebGLBuffer<"u"&&v instanceof WebGLBuffer){var D=a.device.assertWebGL2();D.bindBuffer(35052,v),D.texSubImage2D(c,F,w,A,T,j,l,W,m),D.bindBuffer(35052,null)}else if(a.device.isWebGL2){var I=a.device.assertWebGL2();I.texSubImage2D(c,F,w,A,T,j,l,W,v)}else a.gl.texSubImage2D(c,F,w,A,l,W,v)}),this.gl.bindTexture(this.target,null)},n.copyFramebuffer=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return B.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null},n.getActiveUnit=function(){return this.gl.getParameter(34016)-33984},n.bind=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,a=this.gl;return o!==void 0&&(this.textureUnit=o,a.activeTexture(33984+o)),a.bindTexture(this.target,this.handle),o},n.unbind=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,a=this.gl;return o!==void 0&&(this.textureUnit=o,a.activeTexture(33984+o)),a.bindTexture(this.target,null),o},n._getDataType=function(o){var a=o.data,u=o.compressed,c=u===void 0?!1:u;return c?{data:a,dataType:"compressed"}:a===null?{data:a,dataType:"null"}:ArrayBuffer.isView(a)?{data:a,dataType:"typed-array"}:a instanceof pe?{data:a.handle,dataType:"buffer"}:typeof WebGLBuffer<"u"&&a instanceof WebGLBuffer?{data:a,dataType:"buffer"}:{data:a,dataType:"browser-object"}},n._deduceParameters=function(o){var a=o.format,u=o.data,c=o.width,p=o.height,b=o.dataFormat,g=o.type,v=o.compressed,O=mt(a,this.device.isWebGL2);b=b||O.dataFormat,g=g||O.type,v=v||O.compressed;var w=this._deduceImageSize(u,c,p);return c=w.width,p=w.height,{dataFormat:b,type:g,compressed:v,width:c,height:p,format:a,data:u}},n._deduceImageSize=function(o,a,u){var c;return typeof ImageData<"u"&&o instanceof ImageData?c={width:o.width,height:o.height}:typeof HTMLImageElement<"u"&&o instanceof HTMLImageElement?c={width:o.naturalWidth,height:o.naturalHeight}:typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement?c={width:o.width,height:o.height}:typeof ImageBitmap<"u"&&o instanceof ImageBitmap?c={width:o.width,height:o.height}:typeof HTMLVideoElement<"u"&&o instanceof HTMLVideoElement?c={width:o.videoWidth,height:o.videoHeight}:o?c={width:a,height:u}:c={width:a>=0?a:1,height:u>=0?u:1},M(c,"Could not deduced texture size"),M(a===void 0||c.width===a,"Deduced texture width does not match supplied width"),M(u===void 0||c.height===u,"Deduced texture height does not match supplied height"),c},n.setCubeMapImageData=function(){var i=Fm(Ro().mark(function a(u){var c=this,p,b,g,v,O,w,P,A,x,T,R;return Ro().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return p=this.gl,b=u.width,g=u.height,v=u.pixels,O=u.data,w=u.format,P=w===void 0?6408:w,A=u.type,x=A===void 0?5121:A,T=v||O,k.next=5,Promise.all(r.FACES.map(function(F){var X=T[F];return Promise.all(Array.isArray(X)?X:[X])}));case 5:R=k.sent,this.bind(),r.FACES.forEach(function(F,X){R[X].length>1&&c.props.mipmaps!==!1&&B.warn("".concat(c.id," has mipmap and multiple LODs."))(),R[X].forEach(function(N,V){b&&g?p.texImage2D(F,V,P,b,g,0,P,x,N):p.texImage2D(F,V,P,P,x,N)})}),this.unbind();case 9:case"end":return k.stop()}},a,this)}));function o(a){return i.apply(this,arguments)}return o}(),n.setImageDataForFace=function(o){var a=this,u=o.face,c=o.width,p=o.height,b=o.pixels,g=o.data,v=o.format,O=v===void 0?6408:v,w=o.type,P=w===void 0?5121:w,A=this.gl,x=b||g;return this.bind(),x instanceof Promise?x.then(function(T){return a.setImageDataForFace(Object.assign({},o,{face:u,data:T,pixels:T}))}):this.width||this.height?A.texImage2D(u,0,O,c,p,0,O,P,x):A.texImage2D(u,0,O,O,P,x),this},n.setImageData3D=function(o){var a=this,u=o.level,c=u===void 0?0:u,p=o.dataFormat,b=o.format,g=o.type,v=o.width,O=o.height,w=o.depth,P=w===void 0?1:w,A=o.offset,x=A===void 0?0:A,T=o.data,R=o.parameters,j=R===void 0?{}:R;this.trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle);var k=mt(b,this.device.isWebGL2);if(ve(this.gl,j,function(){ArrayBuffer.isView(T)&&a.gl.texImage3D(a.target,c,k.format,v,O,P,0,k.dataFormat,k.type,T),T instanceof pe&&(a.gl.bindBuffer(35052,T.handle),a.gl.texImage3D(a.target,c,p,v,O,P,0,b,g,x))}),T&&T.byteLength)this.trackAllocatedMemory(T.byteLength,"Texture");else{var F=fr(this.props.format,this.device.isWebGL2);this.trackAllocatedMemory(this.width*this.height*this.depth*F,"Texture")}return this.loaded=!0,this},n._setSamplerParameters=function(o){if(this.device.isWebGL1&&dn(this.width,this.height)&&(o=Uu(o)),!Ke(o)){qm(o),this.gl.bindTexture(this.target,this.handle);for(var a=0,u=Object.entries(o);a<u.length;a++){var c=Zu(u[a],2),p=c[0],b=c[1],g=Number(p),v=b;switch(g){case 33082:case 33083:this.gl.texParameterf(this.target,g,v);break;default:this.gl.texParameteri(this.target,g,v);break}}this.gl.bindTexture(this.target,null)}},n._getWebGL1NPOTParameterOverride=function(o,a){var u=this.device.isWebGL1&&dn(this.width,this.height);if(u)switch(o){case 10241:if(a!==9729&&a!==9728)return 9729;break;case 10242:case 10243:return 33071;default:break}return a},km(r)}(ae);se.FACES=[34069,34070,34071,34072,34073,34074];function Ym(e){switch(e.dimension){case"2d":return 3553;case"cube":return 34067;case"2d-array":return 35866;case"3d":return 32879;case"1d":case"cube-array":default:throw new Error(e.dimension)}}function dn(e,t){return!e||!t?!1:!Er(e)||!Er(t)}function qm(e){B.log(1,"texture sampler parameters",e)()}function mn(e,t){if(typeof t!="string")return t;var r=Number(t);if(!isNaN(r))return r;t=t.replace(/^.*\./,"");var n=e[t];return M(n!==void 0,"Accessing undefined constant GL.".concat(t)),n}function gt(e){return gt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gt(e)}function Qm(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Zm(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
33
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function Zm(e,t){if(e){if(typeof e=="string")return af(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return af(e,t)}}function af(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Jm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ty(n.key),n)}}function ey(e,t,r){return t&&uf(e.prototype,t),r&&uf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ty(e){var t=ry(e,"string");return gt(t)==="symbol"?t:String(t)}function ry(e,t){if(gt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(gt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ny(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bo(e,t)}function Bo(e,t){return Bo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Bo(e,t)}function oy(e){var t=uy();return function(){var n=yn(e),i;if(t){var o=yn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return iy(this,i)}}function iy(e,t){if(t&&(gt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ay(e)}function ay(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uy(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function yn(e){return yn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yn(e)}var bt="Resource subclass must define virtual methods",pr=function(e){ny(r,e);var t=oy(r);function r(i,o,a){var u;Jm(this,r),u=t.call(this,i,o,a),u.device=void 0,u.gl=void 0,u.gl2=void 0,u._handle=void 0,u._bound=!1,u.byteLength=0,u.device=le.attach(i);var c=u.device.gl;Qr(c);var p=o||{},b=p.id;return u.gl=c,u.gl2=c,u.id=b||we(u.constructor.name),u._handle=o?.handle,u._handle===void 0&&(u._handle=u._createHandle()),u.byteLength=0,u}var n=r.prototype;return n.toString=function(){return"".concat(this.constructor.name,"(").concat(this.id,")")},n.delete=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=o.deleteChildren,u=a===void 0?!1:a,c=this._handle&&this._deleteHandle(this._handle);return this._handle&&this.removeStats(),this._handle=null,c&&u&&c.filter(Boolean).forEach(function(p){return p.destroy()}),this},n.bind=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.handle;if(typeof o!="function")return this._bindHandle(o),this;var a;return this._bound?a=o():(this._bindHandle(this.handle),this._bound=!0,a=o(),this._bound=!1,this._bindHandle(null)),a},n.unbind=function(){this.bind(null)},n.getParameter=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};o=mn(this.gl,o),M(o);var u=this.constructor.PARAMETERS||{},c=u[o];if(c){var p=z(this.gl),b=(!("webgl2"in c)||p)&&(!("extension"in c)||this.gl.getExtension(c.extension));if(!b){var g=c.webgl1,v="webgl2"in c?c.webgl2:c.webgl1,O=p?v:g;return O}}return this._getParameter(o,a)},n.getParameters=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=o.parameters,u=o.keys,c=this.constructor.PARAMETERS||{},p=z(this.gl),b={},g=a||Object.keys(c),v=Qm(g),O;try{for(v.s();!(O=v.n()).done;){var w=O.value,P=c[w],A=P&&(!("webgl2"in P)||p)&&(!("extension"in P)||this.gl.getExtension(P.extension));if(A){var x=u?this.device.getGLKey(w):w;b[x]=this.getParameter(w,o),u&&P.type==="GLenum"&&(b[x]=this.device.getGLKey(b[x]))}}}catch(T){v.e(T)}finally{v.f()}return b},n.setParameter=function(o,a){o=mn(this.gl,o),M(o);var u=this.constructor.PARAMETERS||{},c=u[o];if(c){var p=z(this.gl),b=(!("webgl2"in c)||p)&&(!("extension"in c)||this.gl.getExtension(c.extension));if(!b)throw new Error("Parameter not available on this platform");c.type==="GLenum"&&(a=mn(a))}return this._setParameter(o,a),this},n.setParameters=function(o){for(var a in o)this.setParameter(a,o[a]);return this},n.stubRemovedMethods=function(o,a,u){return fo(this,o,a,u)},n.initialize=function(o){},n._createHandle=function(){throw new Error(bt)},n._deleteHandle=function(){throw new Error(bt)},n._bindHandle=function(o){throw new Error(bt)},n._getOptsFromHandle=function(){throw new Error(bt)},n._getParameter=function(o,a){throw new Error(bt)},n._setParameter=function(o,a){throw new Error(bt)},ey(r,[{key:"handle",get:function(){return this._handle}}]),r}(K);function vt(e){return vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vt(e)}var lf;function ff(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function cf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ff(Object(r),!0).forEach(function(n){fy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ff(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fy(e,t,r){return t=pf(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pf(n.key),n)}}function sy(e,t,r){return t&&sf(e.prototype,t),r&&sf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function pf(e){var t=ly(e,"string");return vt(t)==="symbol"?t:String(t)}function ly(e,t){if(vt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(vt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function py(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Io(e,t)}function Io(e,t){return Io=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Io(e,t)}function dy(e){var t=yy();return function(){var n=bn(e),i;if(t){var o=bn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return hy(this,i)}}function hy(e,t){if(t&&(vt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return my(e)}function my(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yy(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function bn(e){return bn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},bn(e)}lf=Symbol.toStringTag;var wt=function(e){py(r,e);var t=dy(r);r.isTextureFormatSupported=function(o,a){return Au(o.gl,a)};function r(i,o){var a;if(cy(this,r),typeof o.format=="number")throw new Error("Renderbuffer");return a=t.call(this,i,o,r.defaultProps),a.glFormat=void 0,a.glFormat=ur(a.props.format,i.isWebGL2),a._initialize(a.props),a}var n=r.prototype;return n.resize=function(o){(o.width!==this.width||o.height!==this.height)&&(Object.assign(this.props,cf(cf({},o),{},{format:this.format,samples:this.samples})),this._initialize(this.props))},n._initialize=function(o){var a=o.format,u=o.width,c=o.height,p=o.samples;M(a,"Needs format"),this.trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),p!==0&&this.device.isWebGL2?this.gl2.renderbufferStorageMultisample(36161,p,this.glFormat,u,c):this.gl.renderbufferStorage(36161,this.glFormat,u,c),this.gl.bindRenderbuffer(36161,null),this.trackAllocatedMemory(u*c*(p||1)*fr(this.glFormat,this.device.isWebGL2))},n._createHandle=function(){return this.gl.createRenderbuffer()},n._deleteHandle=function(){this.gl.deleteRenderbuffer(this.handle),this.trackDeallocatedMemory()},n._bindHandle=function(o){this.gl.bindRenderbuffer(36161,o)},sy(r,[{key:lf,get:function(){return"Renderbuffer"}},{key:"width",get:function(){return this.props.width}},{key:"height",get:function(){return this.props.height}},{key:"format",get:function(){return this.props.format}},{key:"samples",get:function(){return this.props.samples}},{key:"attachment",get:function(){}}]),r}(pr);wt.defaultProps={id:void 0,handle:void 0,userData:void 0,format:void 0,width:1,height:1,samples:0};function _t(e){return _t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(e)}function by(e,t){return wy(e)||vy(e,t)||mf(e,t)||gy()}function gy(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
34
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vy(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function wy(e){if(Array.isArray(e))return e}function _y(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=mf(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
35
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function mf(e,t){if(e){if(typeof e=="string")return df(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return df(e,t)}}function df(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Oy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Py(n.key),n)}}function Sy(e,t,r){return t&&hf(e.prototype,t),r&&hf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Py(e){var t=xy(e,"string");return _t(t)==="symbol"?t:String(t)}function xy(e,t){if(_t(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(_t(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gn(){return typeof Reflect<"u"&&Reflect.get?gn=Reflect.get.bind():gn=function(t,r,n){var i=Ey(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},gn.apply(this,arguments)}function Ey(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Ot(e),e!==null););return e}function Ty(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fo(e,t)}function Fo(e,t){return Fo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Fo(e,t)}function Ay(e){var t=Ry();return function(){var n=Ot(e),i;if(t){var o=Ot(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ly(this,i)}}function Ly(e,t){if(t&&(_t(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jy(e)}function jy(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ry(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ot(e){return Ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ot(e)}var Te=function(e){Ty(r,e);var t=Ay(r);function r(i,o){var a;Oy(this,r),a=t.call(this,i,o),a.device=void 0,a.gl=void 0,a.handle=void 0;var u=o.handle===null;if(a.device=i,a.gl=i.gl,a.handle=a.props.handle||u?a.props.handle:a.gl.createFramebuffer(),!u){i.setSpectorMetadata(a.handle,{id:a.props.id,props:a.props}),a.autoCreateAttachmentTextures(),a.gl.bindFramebuffer(36160,a.handle);for(var c=0;c<a.colorAttachments.length;++c){var p=a.colorAttachments[c],b=36064+c;p&&a._attachOne(b,p)}a.depthStencilAttachment&&a._attachOne(Ru(a.depthStencilAttachment.format),a.depthStencilAttachment),a.gl.bindFramebuffer(36160,null)}return o.check!==!1&&a._checkStatus(),a}var n=r.prototype;return n.destroy=function(){gn(Ot(r.prototype),"destroy",this).call(this),!this.destroyed&&this.handle!==null&&this.gl.deleteFramebuffer(this.handle)},n._checkStatus=function(){var o=this.gl,a=o.bindFramebuffer(36160,this.handle),u=o.checkFramebufferStatus(36160);if(o.bindFramebuffer(36160,a||null),u!==36053)throw new Error("Framebuffer ".concat(By(u)))},n.createDepthStencilTexture=function(o){return new wt(this.device,{id:"".concat(this.id,"-depth-stencil"),format:o,width:this.width,height:this.height})},n.resizeAttachments=function(o,a){if(this.handle===null)return this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;o===void 0&&(o=this.gl.drawingBufferWidth),a===void 0&&(a=this.gl.drawingBufferHeight);var u=_y(this.colorAttachments),c;try{for(u.s();!(c=u.n()).done;){var p=c.value;p.resize({width:o,height:a})}}catch(b){u.e(b)}finally{u.f()}return this.depthStencilAttachment&&this.depthStencilAttachment.resize({width:o,height:a}),this},n._attachOne=function(o,a){if(a instanceof wt)return this._attachWEBGLRenderbuffer(o,a),a;if(Array.isArray(a)){var u=by(a,3),c=u[0],p=u[1],b=p===void 0?0:p,g=u[2],v=g===void 0?0:g;return this._attachTexture(o,c,b,v),c}else if(a instanceof se)return this._attachTexture(o,a,0,0),a;throw new Error("attach")},n._attachWEBGLRenderbuffer=function(o,a){this.gl.framebufferRenderbuffer(36160,o,36161,a.handle)},n._attachTexture=function(o,a,u,c){var p=this.device,b=p.gl,g=p.gl2;switch(b.bindTexture(a.target,a.handle),a.target){case 35866:case 32879:this.device.assertWebGL2(),g?.framebufferTextureLayer(36160,o,a.target,c,u);break;case 34067:var v=Gy(u);b.framebufferTexture2D(36160,o,v,a.handle,c);break;case 3553:b.framebufferTexture2D(36160,o,3553,a.handle,c);break;default:M(!1,"Illegal texture type")}b.bindTexture(a.target,null)},Sy(r,[{key:"texture",get:function(){return this.colorAttachments[0]}}]),r}(nt);function Gy(e){return e<34069?e+34069:e}function By(e){switch(e){case 36053:return"success";case 36054:return"Mismatched attachments";case 36055:return"No attachments";case 36057:return"Height/width mismatch";case 36061:return"Unsupported or split attachments";case 36182:return"Samples mismatch";default:return"".concat(e)}}function St(e){return St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(e)}function yf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Fy(n.key),n)}}function Iy(e,t,r){return t&&yf(e.prototype,t),r&&yf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fy(e){var t=Dy(e,"string");return St(t)==="symbol"?t:String(t)}function Dy(e,t){if(St(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(St(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wy(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Do(e,t)}function Do(e,t){return Do=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Do(e,t)}function My(e){var t=Vy();return function(){var n=vn(e),i;if(t){var o=vn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ny(this,i)}}function Ny(e,t){if(t&&(St(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ky(e)}function ky(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vy(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vn(e){return vn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vn(e)}var wn=function(e){Wy(r,e);var t=My(r);function r(i,o){var a;return Cy(this,r),a=t.call(this,o),a.device=void 0,a.presentationSize=void 0,a._framebuffer=null,a.device=i,a.presentationSize=[-1,-1],a._setAutoCreatedCanvasId("".concat(a.device.id,"-canvas")),a.update(),a}var n=r.prototype;return n.getCurrentFramebuffer=function(){return this.update(),this._framebuffer=this._framebuffer||new Te(this.device,{handle:null}),this._framebuffer},n.update=function(){var o=this.getPixelSize(),a=o[0]!==this.presentationSize[0]||o[1]!==this.presentationSize[1];a&&(this.presentationSize=o)},n.resize=function(o){if(this.canvas){var a=this.getDevicePixelRatio(o?.useDevicePixels);this.setDevicePixelRatio(a,o);return}var u=this.device.gl.getExtension("STACKGL_resize_drawingbuffer");u&&o&&"width"in o&&"height"in o&&u.resize(o.width,o.height)},n.commit=function(){},Iy(r)}(Qe);function Pt(e){return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pt(e)}function Co(){"use strict";Co=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(l,f,s){l[f]=s.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{c({},"")}catch{c=function(s,d,m){return s[d]=m}}function p(l,f,s,d){var m=f&&f.prototype instanceof v?f:v,h=Object.create(m.prototype),_=new V(d||[]);return n(h,"_invoke",{value:k(l,s,_)}),h}function b(l,f,s){try{return{type:"normal",arg:l.call(f,s)}}catch(d){return{type:"throw",arg:d}}}e.wrap=p;var g={};function v(){}function O(){}function w(){}var P={};c(P,o,function(){return this});var A=Object.getPrototypeOf,x=A&&A(A(W([])));x&&x!==t&&r.call(x,o)&&(P=x);var T=w.prototype=v.prototype=Object.create(P);function R(l){["next","throw","return"].forEach(function(f){c(l,f,function(s){return this._invoke(f,s)})})}function j(l,f){function s(m,h,_,S){var E=b(l[m],l,h);if(E.type!=="throw"){var D=E.arg,I=D.value;return I&&Pt(I)=="object"&&r.call(I,"__await")?f.resolve(I.__await).then(function(C){s("next",C,_,S)},function(C){s("throw",C,_,S)}):f.resolve(I).then(function(C){D.value=C,_(D)},function(C){return s("throw",C,_,S)})}S(E.arg)}var d;n(this,"_invoke",{value:function(h,_){function S(){return new f(function(E,D){s(h,_,E,D)})}return d=d?d.then(S,S):S()}})}function k(l,f,s){var d="suspendedStart";return function(m,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(m==="throw")throw h;return H()}for(s.method=m,s.arg=h;;){var _=s.delegate;if(_){var S=F(_,s);if(S){if(S===g)continue;return S}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(d==="suspendedStart")throw d="completed",s.arg;s.dispatchException(s.arg)}else s.method==="return"&&s.abrupt("return",s.arg);d="executing";var E=b(l,f,s);if(E.type==="normal"){if(d=s.done?"completed":"suspendedYield",E.arg===g)continue;return{value:E.arg,done:s.done}}E.type==="throw"&&(d="completed",s.method="throw",s.arg=E.arg)}}}function F(l,f){var s=f.method,d=l.iterator[s];if(d===void 0)return f.delegate=null,s==="throw"&&l.iterator.return&&(f.method="return",f.arg=void 0,F(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var m=b(d,l.iterator,f.arg);if(m.type==="throw")return f.method="throw",f.arg=m.arg,f.delegate=null,g;var h=m.arg;return h?h.done?(f[l.resultName]=h.value,f.next=l.nextLoc,f.method!=="return"&&(f.method="next",f.arg=void 0),f.delegate=null,g):h:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,g)}function X(l){var f={tryLoc:l[0]};1 in l&&(f.catchLoc=l[1]),2 in l&&(f.finallyLoc=l[2],f.afterLoc=l[3]),this.tryEntries.push(f)}function N(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(X,this),this.reset(!0)}function W(l){if(l){var f=l[o];if(f)return f.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var s=-1,d=function m(){for(;++s<l.length;)if(r.call(l,s))return m.value=l[s],m.done=!1,m;return m.value=void 0,m.done=!0,m};return d.next=d}}return{next:H}}function H(){return{value:void 0,done:!0}}return O.prototype=w,n(T,"constructor",{value:w,configurable:!0}),n(w,"constructor",{value:O,configurable:!0}),O.displayName=c(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===O||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,w):(l.__proto__=w,c(l,u,"GeneratorFunction")),l.prototype=Object.create(T),l},e.awrap=function(l){return{__await:l}},R(j.prototype),c(j.prototype,a,function(){return this}),e.AsyncIterator=j,e.async=function(l,f,s,d,m){m===void 0&&(m=Promise);var h=new j(p(l,f,s,d),m);return e.isGeneratorFunction(f)?h:h.next().then(function(_){return _.done?_.value:h.next()})},R(T),c(T,u,"Generator"),c(T,o,function(){return this}),c(T,"toString",function(){return"[object Generator]"}),e.keys=function(l){var f=Object(l),s=[];for(var d in f)s.push(d);return s.reverse(),function m(){for(;s.length;){var h=s.pop();if(h in f)return m.value=h,m.done=!1,m}return m.done=!0,m}},e.values=W,V.prototype={constructor:V,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(N),!f)for(var s in this)s.charAt(0)==="t"&&r.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=void 0)},stop:function(){this.done=!0;var f=this.tryEntries[0].completion;if(f.type==="throw")throw f.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var s=this;function d(D,I){return _.type="throw",_.arg=f,s.next=D,I&&(s.method="next",s.arg=void 0),!!I}for(var m=this.tryEntries.length-1;m>=0;--m){var h=this.tryEntries[m],_=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var S=r.call(h,"catchLoc"),E=r.call(h,"finallyLoc");if(S&&E){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(S){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!E)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return d(h.finallyLoc)}}}},abrupt:function(f,s){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m.tryLoc<=this.prev&&r.call(m,"finallyLoc")&&this.prev<m.finallyLoc){var h=m;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var _=h?h.completion:{};return _.type=f,_.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(_)},complete:function(f,s){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&s&&(this.next=s),g},finish:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.finallyLoc===f)return this.complete(d.completion,d.afterLoc),N(d),g}},catch:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.tryLoc===f){var m=d.completion;if(m.type==="throw"){var h=m.arg;N(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:W(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function bf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function gf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bf(Object(r),!0).forEach(function(n){Uy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Uy(e,t,r){return t=zy(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zy(e){var t=Hy(e,"string");return Pt(t)==="symbol"?t:String(t)}function Hy(e,t){if(Pt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Pt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vf(e,t,r,n,i,o,a){try{var u=e[o](a),c=u.value}catch(p){r(p);return}u.done?t(c):Promise.resolve(c).then(n,i)}function $y(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(c){vf(o,n,i,a,u,"next",c)}function u(c){vf(o,n,i,a,u,"throw",c)}a(void 0)})}}var Xy={spector:B.get("spector")||B.get("inspect")},Ky="https://spectorcdn.babylonjs.com/spector.bundle.js",Yy=1,de=null,wf=!1;function _f(e){return Wo.apply(this,arguments)}function Wo(){return Wo=$y(Co().mark(function e(t){return Co().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(globalThis.SPECTOR){n.next=9;break}return n.prev=1,n.next=4,zt(Ky);case 4:n.next=9;break;case 6:n.prev=6,n.t0=n.catch(1),B.warn(String(n.t0));case 9:case"end":return n.stop()}},e,null,[[1,6]])})),Wo.apply(this,arguments)}function Of(e){var t,r;if(e=gf(gf({},Xy),e),!((t=e)!==null&&t!==void 0&&t.spector)||(!de&&globalThis.SPECTOR&&(B.probe(Yy,"SPECTOR found and initialized")(),de=new globalThis.SPECTOR.Spector,globalThis.luma&&(globalThis.luma.spector=de)),!de))return null;if(!wf){var n,i;wf=!0,de.spyCanvases(),(n=de)===null||n===void 0||n.onCaptureStarted.add(function(u){return B.info("Spector capture started:",u)()}),(i=de)===null||i===void 0||i.onCapture.add(function(u){var c,p,b;B.info("Spector capture complete:",u)(),(c=de)===null||c===void 0||c.getResultUI(),(p=de)===null||p===void 0||p.resultView.display(),(b=de)===null||b===void 0||b.resultView.addCapture(u)})}if((r=e)!==null&&r!==void 0&&r.canvas){var o,a;if(typeof e.spector=="string"&&e.spector!==e.canvas.id)return de;(o=de)===null||o===void 0||o.startCapture((a=e)===null||a===void 0?void 0:a.canvas,500),new Promise(function(u){return setTimeout(u,2e3)}).then(function(u){var c;B.info("Spector capture stopped after 2 seconds")(),(c=de)===null||c===void 0||c.stopCapture()})}return de}function xt(e){return xt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xt(e)}function No(){"use strict";No=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(l,f,s){l[f]=s.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{c({},"")}catch{c=function(s,d,m){return s[d]=m}}function p(l,f,s,d){var m=f&&f.prototype instanceof v?f:v,h=Object.create(m.prototype),_=new V(d||[]);return n(h,"_invoke",{value:k(l,s,_)}),h}function b(l,f,s){try{return{type:"normal",arg:l.call(f,s)}}catch(d){return{type:"throw",arg:d}}}e.wrap=p;var g={};function v(){}function O(){}function w(){}var P={};c(P,o,function(){return this});var A=Object.getPrototypeOf,x=A&&A(A(W([])));x&&x!==t&&r.call(x,o)&&(P=x);var T=w.prototype=v.prototype=Object.create(P);function R(l){["next","throw","return"].forEach(function(f){c(l,f,function(s){return this._invoke(f,s)})})}function j(l,f){function s(m,h,_,S){var E=b(l[m],l,h);if(E.type!=="throw"){var D=E.arg,I=D.value;return I&&xt(I)=="object"&&r.call(I,"__await")?f.resolve(I.__await).then(function(C){s("next",C,_,S)},function(C){s("throw",C,_,S)}):f.resolve(I).then(function(C){D.value=C,_(D)},function(C){return s("throw",C,_,S)})}S(E.arg)}var d;n(this,"_invoke",{value:function(h,_){function S(){return new f(function(E,D){s(h,_,E,D)})}return d=d?d.then(S,S):S()}})}function k(l,f,s){var d="suspendedStart";return function(m,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(m==="throw")throw h;return H()}for(s.method=m,s.arg=h;;){var _=s.delegate;if(_){var S=F(_,s);if(S){if(S===g)continue;return S}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(d==="suspendedStart")throw d="completed",s.arg;s.dispatchException(s.arg)}else s.method==="return"&&s.abrupt("return",s.arg);d="executing";var E=b(l,f,s);if(E.type==="normal"){if(d=s.done?"completed":"suspendedYield",E.arg===g)continue;return{value:E.arg,done:s.done}}E.type==="throw"&&(d="completed",s.method="throw",s.arg=E.arg)}}}function F(l,f){var s=f.method,d=l.iterator[s];if(d===void 0)return f.delegate=null,s==="throw"&&l.iterator.return&&(f.method="return",f.arg=void 0,F(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var m=b(d,l.iterator,f.arg);if(m.type==="throw")return f.method="throw",f.arg=m.arg,f.delegate=null,g;var h=m.arg;return h?h.done?(f[l.resultName]=h.value,f.next=l.nextLoc,f.method!=="return"&&(f.method="next",f.arg=void 0),f.delegate=null,g):h:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,g)}function X(l){var f={tryLoc:l[0]};1 in l&&(f.catchLoc=l[1]),2 in l&&(f.finallyLoc=l[2],f.afterLoc=l[3]),this.tryEntries.push(f)}function N(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(X,this),this.reset(!0)}function W(l){if(l){var f=l[o];if(f)return f.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var s=-1,d=function m(){for(;++s<l.length;)if(r.call(l,s))return m.value=l[s],m.done=!1,m;return m.value=void 0,m.done=!0,m};return d.next=d}}return{next:H}}function H(){return{value:void 0,done:!0}}return O.prototype=w,n(T,"constructor",{value:w,configurable:!0}),n(w,"constructor",{value:O,configurable:!0}),O.displayName=c(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===O||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,w):(l.__proto__=w,c(l,u,"GeneratorFunction")),l.prototype=Object.create(T),l},e.awrap=function(l){return{__await:l}},R(j.prototype),c(j.prototype,a,function(){return this}),e.AsyncIterator=j,e.async=function(l,f,s,d,m){m===void 0&&(m=Promise);var h=new j(p(l,f,s,d),m);return e.isGeneratorFunction(f)?h:h.next().then(function(_){return _.done?_.value:h.next()})},R(T),c(T,u,"Generator"),c(T,o,function(){return this}),c(T,"toString",function(){return"[object Generator]"}),e.keys=function(l){var f=Object(l),s=[];for(var d in f)s.push(d);return s.reverse(),function m(){for(;s.length;){var h=s.pop();if(h in f)return m.value=h,m.done=!1,m}return m.done=!0,m}},e.values=W,V.prototype={constructor:V,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(N),!f)for(var s in this)s.charAt(0)==="t"&&r.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=void 0)},stop:function(){this.done=!0;var f=this.tryEntries[0].completion;if(f.type==="throw")throw f.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var s=this;function d(D,I){return _.type="throw",_.arg=f,s.next=D,I&&(s.method="next",s.arg=void 0),!!I}for(var m=this.tryEntries.length-1;m>=0;--m){var h=this.tryEntries[m],_=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var S=r.call(h,"catchLoc"),E=r.call(h,"finallyLoc");if(S&&E){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(S){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!E)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return d(h.finallyLoc)}}}},abrupt:function(f,s){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m.tryLoc<=this.prev&&r.call(m,"finallyLoc")&&this.prev<m.finallyLoc){var h=m;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var _=h?h.completion:{};return _.type=f,_.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(_)},complete:function(f,s){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&s&&(this.next=s),g},finish:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.finallyLoc===f)return this.complete(d.completion,d.afterLoc),N(d),g}},catch:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.tryLoc===f){var m=d.completion;if(m.type==="throw"){var h=m.arg;N(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:W(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function qy(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Qy(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
36
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function Qy(e,t){if(e){if(typeof e=="string")return Sf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Sf(e,t)}}function Sf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Af(n.key),n)}}function Zy(e,t,r){return t&&Pf(e.prototype,t),r&&Pf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ef(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xf(Object(r),!0).forEach(function(n){eb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function eb(e,t,r){return t=Af(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Af(e){var t=tb(e,"string");return xt(t)==="symbol"?t:String(t)}function tb(e,t){if(xt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(xt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tf(e,t,r,n,i,o,a){try{var u=e[o](a),c=u.value}catch(p){r(p);return}u.done?t(c):Promise.resolve(c).then(n,i)}function rb(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(c){Tf(o,n,i,a,u,"next",c)}function u(c){Tf(o,n,i,a,u,"throw",c)}a(void 0)})}}var nb="https://unpkg.com/webgl-debug@2.0.1/index.js";function Lf(e){return e.luma=e.luma||{},e.luma}function jf(){return ko.apply(this,arguments)}function ko(){return ko=rb(No().mark(function e(){return No().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!(J()&&!globalThis.WebGLDebugUtils)){r.next=5;break}return globalThis.global=globalThis.global||globalThis,globalThis.global.module={},r.next=5,zt(nb);case 5:case"end":return r.stop()}},e)})),ko.apply(this,arguments)}function Rf(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e?t.debug?ib(e,t):ob(e):null}function ob(e){var t=Lf(e);return t.realContext?t.realContext:e}function ib(e,t){if(!globalThis.WebGLDebugUtils)return B.warn("webgl-debug not loaded")(),e;var r=Lf(e);if(r.debugContext)return r.debugContext;globalThis.WebGLDebugUtils.init(Ef(Ef({},GL),e));var n=globalThis.WebGLDebugUtils.makeDebugContext(e,ab.bind(null,t),ub.bind(null,t));for(var i in GL)!(i in n)&&typeof GL[i]=="number"&&(n[i]=GL[i]);var o=Zy(function u(){Jy(this,u)});Object.setPrototypeOf(n,Object.getPrototypeOf(e)),Object.setPrototypeOf(o,n);var a=Object.create(o);return r.realContext=e,r.debugContext=a,a.debug=!0,a}function Mo(e,t){t=Array.from(t).map(function(n){return n===void 0?"undefined":n});var r=globalThis.WebGLDebugUtils.glFunctionArgsToString(e,t);return r="".concat(r.slice(0,100)).concat(r.length>100?"...":""),"gl.".concat(e,"(").concat(r,")")}function ab(e,t,r,n){n=Array.from(n).map(function(c){return c===void 0?"undefined":c});var i=globalThis.WebGLDebugUtils.glEnumToString(t),o=globalThis.WebGLDebugUtils.glFunctionArgsToString(r,n),a=e.webgl2?"gl2":"gl1",u="".concat(i," in ").concat(a,".").concat(r,"(").concat(o,")");B.error(u)();debugger;if(e.throwOnError)throw new Error(u)}function ub(e,t,r){var n="";if(B.level>=1&&(n=Mo(t,r),B.log(1,n)()),e.break&&e.break.length>0){n=n||Mo(t,r);var i=e.break.every(function(c){return n.indexOf(c)!==-1});if(i)debugger}var o=qy(r),a;try{for(o.s();!(a=o.n()).done;){var u=a.value;if(u===void 0){if(n=n||Mo(t,r),e.throwOnError)throw new Error("Undefined argument: ".concat(n));B.error("Undefined argument: ".concat(n))();debugger}}}catch(c){o.e(c)}finally{o.f()}}function Vo(e,t){return{name:fb(e,t),language:"glsl",version:cb(e)}}function fb(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"unnamed",r=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/,n=r.exec(e);return n?n[1]:t}function cb(e){var t=100,r=e.match(/[^\s]+/g);if(r&&r.length>=2&&r[0]==="#version"){var n=parseInt(r[1],10);Number.isFinite(n)&&(t=n)}return t}function sb(e){return Ff(e)||lb(e)||Uo(e)||If()}function lb(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pb(e,t){return Ff(e)||db(e,t)||Uo(e,t)||If()}function If(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
37
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function db(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function Ff(e){if(Array.isArray(e))return e}function hb(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Uo(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
38
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function Uo(e,t){if(e){if(typeof e=="string")return Gf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gf(e,t)}}function Gf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function zo(e){var t=e.split(/\r?\n/),r=[],n=hb(t),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;if(!(o.length<=1)){var a=o.split(":");if(a.length===2){var u=pb(a,2),c=u[0],p=u[1];r.push({message:p.trim(),type:Bf(c),lineNum:0,linePos:0});continue}var b=sb(a),g=b[0],v=b[1],O=b[2],w=b.slice(3),P=parseInt(O,10);isNaN(P)&&(P=0);var A=parseInt(v,10);isNaN(A)&&(A=0),r.push({message:w.join(":").trim(),type:Bf(g),lineNum:P,linePos:A})}}}catch(x){n.e(x)}finally{n.f()}return r}function Bf(e){var t=["warning","error","info"],r=e.toLowerCase();return t.includes(r)?r:"info"}function Ve(e){return Ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ve(e)}function Ho(){"use strict";Ho=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(l,f,s){l[f]=s.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{c({},"")}catch{c=function(s,d,m){return s[d]=m}}function p(l,f,s,d){var m=f&&f.prototype instanceof v?f:v,h=Object.create(m.prototype),_=new V(d||[]);return n(h,"_invoke",{value:k(l,s,_)}),h}function b(l,f,s){try{return{type:"normal",arg:l.call(f,s)}}catch(d){return{type:"throw",arg:d}}}e.wrap=p;var g={};function v(){}function O(){}function w(){}var P={};c(P,o,function(){return this});var A=Object.getPrototypeOf,x=A&&A(A(W([])));x&&x!==t&&r.call(x,o)&&(P=x);var T=w.prototype=v.prototype=Object.create(P);function R(l){["next","throw","return"].forEach(function(f){c(l,f,function(s){return this._invoke(f,s)})})}function j(l,f){function s(m,h,_,S){var E=b(l[m],l,h);if(E.type!=="throw"){var D=E.arg,I=D.value;return I&&Ve(I)=="object"&&r.call(I,"__await")?f.resolve(I.__await).then(function(C){s("next",C,_,S)},function(C){s("throw",C,_,S)}):f.resolve(I).then(function(C){D.value=C,_(D)},function(C){return s("throw",C,_,S)})}S(E.arg)}var d;n(this,"_invoke",{value:function(h,_){function S(){return new f(function(E,D){s(h,_,E,D)})}return d=d?d.then(S,S):S()}})}function k(l,f,s){var d="suspendedStart";return function(m,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(m==="throw")throw h;return H()}for(s.method=m,s.arg=h;;){var _=s.delegate;if(_){var S=F(_,s);if(S){if(S===g)continue;return S}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(d==="suspendedStart")throw d="completed",s.arg;s.dispatchException(s.arg)}else s.method==="return"&&s.abrupt("return",s.arg);d="executing";var E=b(l,f,s);if(E.type==="normal"){if(d=s.done?"completed":"suspendedYield",E.arg===g)continue;return{value:E.arg,done:s.done}}E.type==="throw"&&(d="completed",s.method="throw",s.arg=E.arg)}}}function F(l,f){var s=f.method,d=l.iterator[s];if(d===void 0)return f.delegate=null,s==="throw"&&l.iterator.return&&(f.method="return",f.arg=void 0,F(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var m=b(d,l.iterator,f.arg);if(m.type==="throw")return f.method="throw",f.arg=m.arg,f.delegate=null,g;var h=m.arg;return h?h.done?(f[l.resultName]=h.value,f.next=l.nextLoc,f.method!=="return"&&(f.method="next",f.arg=void 0),f.delegate=null,g):h:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,g)}function X(l){var f={tryLoc:l[0]};1 in l&&(f.catchLoc=l[1]),2 in l&&(f.finallyLoc=l[2],f.afterLoc=l[3]),this.tryEntries.push(f)}function N(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(X,this),this.reset(!0)}function W(l){if(l){var f=l[o];if(f)return f.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var s=-1,d=function m(){for(;++s<l.length;)if(r.call(l,s))return m.value=l[s],m.done=!1,m;return m.value=void 0,m.done=!0,m};return d.next=d}}return{next:H}}function H(){return{value:void 0,done:!0}}return O.prototype=w,n(T,"constructor",{value:w,configurable:!0}),n(w,"constructor",{value:O,configurable:!0}),O.displayName=c(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===O||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,w):(l.__proto__=w,c(l,u,"GeneratorFunction")),l.prototype=Object.create(T),l},e.awrap=function(l){return{__await:l}},R(j.prototype),c(j.prototype,a,function(){return this}),e.AsyncIterator=j,e.async=function(l,f,s,d,m){m===void 0&&(m=Promise);var h=new j(p(l,f,s,d),m);return e.isGeneratorFunction(f)?h:h.next().then(function(_){return _.done?_.value:h.next()})},R(T),c(T,u,"Generator"),c(T,o,function(){return this}),c(T,"toString",function(){return"[object Generator]"}),e.keys=function(l){var f=Object(l),s=[];for(var d in f)s.push(d);return s.reverse(),function m(){for(;s.length;){var h=s.pop();if(h in f)return m.value=h,m.done=!1,m}return m.done=!0,m}},e.values=W,V.prototype={constructor:V,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(N),!f)for(var s in this)s.charAt(0)==="t"&&r.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=void 0)},stop:function(){this.done=!0;var f=this.tryEntries[0].completion;if(f.type==="throw")throw f.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var s=this;function d(D,I){return _.type="throw",_.arg=f,s.next=D,I&&(s.method="next",s.arg=void 0),!!I}for(var m=this.tryEntries.length-1;m>=0;--m){var h=this.tryEntries[m],_=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var S=r.call(h,"catchLoc"),E=r.call(h,"finallyLoc");if(S&&E){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(S){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!E)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return d(h.finallyLoc)}}}},abrupt:function(f,s){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m.tryLoc<=this.prev&&r.call(m,"finallyLoc")&&this.prev<m.finallyLoc){var h=m;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var _=h?h.completion:{};return _.type=f,_.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(_)},complete:function(f,s){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&s&&(this.next=s),g},finish:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.finallyLoc===f)return this.complete(d.completion,d.afterLoc),N(d),g}},catch:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.tryLoc===f){var m=d.completion;if(m.type==="throw"){var h=m.arg;N(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:W(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function Df(e,t,r,n,i,o,a){try{var u=e[o](a),c=u.value}catch(p){r(p);return}u.done?t(c):Promise.resolve(c).then(n,i)}function mb(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(c){Df(o,n,i,a,u,"next",c)}function u(c){Df(o,n,i,a,u,"throw",c)}a(void 0)})}}function Cf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function yb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Cf(Object(r),!0).forEach(function(n){bb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bb(e,t,r){return t=Mf(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Mf(n.key),n)}}function gb(e,t,r){return t&&Wf(e.prototype,t),r&&Wf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mf(e){var t=vb(e,"string");return Ve(t)==="symbol"?t:String(t)}function vb(e,t){if(Ve(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ve(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _b(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$o(e,t)}function $o(e,t){return $o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},$o(e,t)}function Ob(e){var t=xb();return function(){var n=_n(e),i;if(t){var o=_n(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Sb(this,i)}}function Sb(e,t){if(t&&(Ve(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pb(e)}function Pb(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xb(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _n(e){return _n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_n(e)}var On=function(e){_b(r,e);var t=Ob(r);function r(i,o){var a;switch(wb(this,r),a=t.call(this,i,yb({id:Eb(o)},o)),a.device=void 0,a.handle=void 0,a.device=i,a.props.stage){case"vertex":a.handle=a.props.handle||a.device.gl.createShader(35633);break;case"fragment":a.handle=a.props.handle||a.device.gl.createShader(35632);break;default:throw new Error(a.props.stage)}return a._compile(a.source),a}var n=r.prototype;return n.destroy=function(){this.handle&&(this.removeStats(),this.device.gl.deleteShader(this.handle),this.destroyed=!0)},n.compilationInfo=function(){var i=mb(Ho().mark(function a(){var u;return Ho().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return u=this.device.gl.getShaderInfoLog(this.handle),p.abrupt("return",u?zo(u):[]);case 2:case"end":return p.stop()}},a,this)}));function o(){return i.apply(this,arguments)}return o}(),n._compile=function(o){var a=function(A){return A.startsWith("#version ")?A:`#version 100
|
|
39
|
+
`.concat(A)};o=a(o);var u=this.device.gl;u.shaderSource(this.handle,o),u.compileShader(this.handle);var c=u.getShaderParameter(this.handle,35713);if(!c){var p=u.getShaderInfoLog(this.handle),b=p?zo(p):[],g=b.filter(function(P){return P.type==="error"}),v=ao(g,o,{showSourceCode:!0}),O=Vo(o).name,w="".concat(this.stage," shader ").concat(O);throw B.error("GLSL compilation errors in ".concat(w,`
|
|
40
|
+
`).concat(v))(),new Error("GLSL compilation errors in ".concat(O))}},gb(r)}(Gr);function Eb(e){return Vo(e.source).name||e.id||we("unnamed ".concat(e.stage,"-shader"))}function Et(e){return Et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Et(e)}function Nf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Nf(Object(r),!0).forEach(function(n){Ab(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ab(e,t,r){return t=Vf(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Vf(n.key),n)}}function Lb(e,t,r){return t&&kf(e.prototype,t),r&&kf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vf(e){var t=jb(e,"string");return Et(t)==="symbol"?t:String(t)}function jb(e,t){if(Et(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Et(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gb(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ko(e,t)}function Ko(e,t){return Ko=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ko(e,t)}function Bb(e){var t=Db();return function(){var n=Sn(e),i;if(t){var o=Sn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ib(this,i)}}function Ib(e,t){if(t&&(Et(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fb(e)}function Fb(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Db(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sn(e){return Sn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Sn(e)}var Cb=256,Wb=1024,Mb=16384,Xo=6144,Pn=function(e){Gb(r,e);var t=Bb(r);function r(i,o){var a;return Rb(this,r),a=t.call(this,i,o),a.device=void 0,a.glParameters=void 0,a.device=i,_e(a.device.gl),a.setParameters(a.props.parameters),a.clear(),a}var n=r.prototype;return n.end=function(){ge(this.device.gl),this.props.framebuffer&&be(this.device,{framebuffer:null})},n.pushDebugGroup=function(o){},n.popDebugGroup=function(){},n.insertDebugMarker=function(o){},n.setParameters=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a={};this.props.framebuffer&&(a.framebuffer=this.props.framebuffer),this.props.depthReadOnly&&(a.depthMask=!this.props.depthReadOnly),a.stencilMask=this.props.stencilReadOnly?0:1,a[35977]=this.props.discard,o.viewport&&(o.viewport.length>=6?(a.viewport=o.viewport.slice(0,4),a.depthRange=[o.viewport[4],o.viewport[5]]):a.viewport=o.viewport),a.scissorTest=Boolean(o.scissorRect),o.scissorRect&&(a.scissor=o.scissorRect),o.blendConstant&&(a.blendColor=o.blendConstant),o.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),o[2967]=o.stencilReference),this.glParameters=a,be(this.device,a)},n.clear=function(){var o=this,a=Tb({},this.glParameters),u=0;this.props.clearColor!==!1&&(u|=Mb,a.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(u|=Cb,a.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(u|=Wb,a.clearStencil=this.props.clearStencil),u!==0&&ve(this.device,a,function(){o.device.gl.clear(u)})},n.clearColorBuffer=function(){var o=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0,0];ve(this.device.gl2,{framebuffer:this.props.framebuffer},function(){switch(u.constructor){case Int32Array:o.device.gl2.clearBufferiv(Xo,a,u);break;case Uint32Array:o.device.gl2.clearBufferuiv(Xo,a,u);break;case Float32Array:default:o.device.gl2.clearBufferfv(Xo,a,u);break}})},Lb(r)}(Mr);var Nb="Failed to deduce GL constant from typed array";function Uf(e){var t=ArrayBuffer.isView(e)?e.constructor:e;switch(t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(Nb)}}function dr(e,t){var r=t||{},n=r.clamped,i=n===void 0?!0:n;switch(e){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return i?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function hr(e){return hr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hr(e)}function xn(e,t,r){return kb()?xn=Reflect.construct.bind():xn=function(i,o,a){var u=[null];u.push.apply(u,o);var c=Function.bind.apply(i,u),p=new c;return a&&Yo(p,a.prototype),p},xn.apply(null,arguments)}function kb(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Yo(e,t){return Yo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Yo(e,t)}function Vb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zb(n.key),n)}}function Ub(e,t,r){return t&&zf(e.prototype,t),r&&zf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function zb(e){var t=Hb(e,"string");return hr(t)==="symbol"?t:String(t)}function Hb(e,t){if(hr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(hr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $b={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},Xb={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},En=function(){e.getBytesPerElement=function(n){var i=dr(n.type||5126);return i.BYTES_PER_ELEMENT},e.getBytesPerVertex=function(n){M(n.size);var i=dr(n.type||5126);return i.BYTES_PER_ELEMENT*n.size},e.resolve=function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return xn(e,[$b].concat(i))};function e(){var r=this;Vb(this,e),this.offset=void 0,this.stride=void 0,this.type=void 0,this.size=void 0,this.divisor=void 0,this.normalized=void 0,this.integer=void 0,this.buffer=void 0,this.index=void 0;for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];i.forEach(function(a){return r._assign(a)}),Object.freeze(this)}var t=e.prototype;return t.toString=function(){return JSON.stringify(this)},t._assign=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return n=co("Accessor",n,Xb),n.type!==void 0&&(this.type=n.type,(n.type===5124||n.type===5125)&&(this.integer=!0)),n.size!==void 0&&(this.size=n.size),n.offset!==void 0&&(this.offset=n.offset),n.stride!==void 0&&(this.stride=n.stride),n.normalize!==void 0&&(this.normalized=n.normalize),n.normalized!==void 0&&(this.normalized=n.normalized),n.integer!==void 0&&(this.integer=n.integer),n.divisor!==void 0&&(this.divisor=n.divisor),n.buffer!==void 0&&(this.buffer=n.buffer),n.index!==void 0&&(typeof n.index=="boolean"?this.index=n.index?1:0:this.index=n.index),n.instanced!==void 0&&(this.divisor=n.instanced?1:0),n.isInstanced!==void 0&&(this.divisor=n.isInstanced?1:0),this.offset===void 0&&delete this.offset,this.stride===void 0&&delete this.stride,this.type===void 0&&delete this.type,this.size===void 0&&delete this.size,this.divisor===void 0&&delete this.divisor,this.normalized===void 0&&delete this.normalized,this.integer===void 0&&delete this.integer,this.buffer===void 0&&delete this.buffer,this.index===void 0&&delete this.index,this},Ub(e,[{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}();var Q;function mr(e){return mr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mr(e)}function $f(e,t){return Qb(e)||qb(e,t)||Yb(e,t)||Kb()}function Kb(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
41
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yb(e,t){if(e){if(typeof e=="string")return Hf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hf(e,t)}}function Hf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function qb(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function Qb(e){if(Array.isArray(e))return e}function ee(e,t,r){return t=Zb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zb(e){var t=Jb(e,"string");return mr(t)==="symbol"?t:String(t)}function Jb(e,t){if(mr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(mr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xf(e){return eg.includes(e)}var eg=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],Kf=(Q={},ee(Q,5126,[5126,1,"float","f32","float32"]),ee(Q,35664,[5126,2,"vec2","vec2<f32>","float32x2"]),ee(Q,35665,[5126,3,"vec3","vec3<f32>","float32x3"]),ee(Q,35666,[5126,4,"vec4","vec4<f32>","float32x4"]),ee(Q,5124,[5124,1,"int","i32","sint32"]),ee(Q,35667,[5124,2,"ivec2","vec2<i32>","sint32x2"]),ee(Q,35668,[5124,3,"ivec3","vec3<i32>","sint32x3"]),ee(Q,35669,[5124,4,"ivec4","vec4<i32>","sint32x4"]),ee(Q,5125,[5125,1,"uint","u32","uint32"]),ee(Q,36294,[5125,2,"uvec2","vec2<u32>","uint32x2"]),ee(Q,36295,[5125,3,"uvec3","vec3<u32>","uint32x3"]),ee(Q,36296,[5125,4,"uvec4","vec4<u32>","uint32x4"]),ee(Q,35670,[5126,1,"bool","f32","float32"]),ee(Q,35671,[5126,2,"bvec2","vec2<f32>","float32x2"]),ee(Q,35672,[5126,3,"bvec3","vec3<f32>","float32x3"]),ee(Q,35673,[5126,4,"bvec4","vec4<f32>","float32x4"]),ee(Q,35674,[5126,8,"mat2","mat2x2<f32>"]),ee(Q,35685,[5126,8,"mat2x3","mat2x3<f32>"]),ee(Q,35686,[5126,8,"mat2x4","mat2x4<f32>"]),ee(Q,35687,[5126,12,"mat3x2","mat3x2<f32>"]),ee(Q,35675,[5126,12,"mat3","mat3x3<f32>"]),ee(Q,35688,[5126,12,"mat3x4","mat3x4<f32>"]),ee(Q,35689,[5126,16,"mat4x2","mat4x2<f32>"]),ee(Q,35690,[5126,16,"mat4x3","mat4x3<f32>"]),ee(Q,35676,[5126,16,"mat4","mat4x4<f32>"]),Q);function qo(e){var t=Kf[e];if(!t)throw new Error("uniform");var r=$f(t,4),n=r[0],i=r[1],o=r[3];return{format:o,components:i,glType:n}}function Yf(e){var t=Kf[e];if(!t)throw new Error("attribute");var r=$f(t,5),n=r[1],i=r[3],o=r[4],a=i;return{attributeType:a,vertexFormat:o,components:n}}var ie;function yr(e){return yr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yr(e)}function tg(e,t){return ig(e)||og(e,t)||ng(e,t)||rg()}function rg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
42
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ng(e,t){if(e){if(typeof e=="string")return qf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qf(e,t)}}function qf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function og(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function ig(e){if(Array.isArray(e))return e}function Qf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Zf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qf(Object(r),!0).forEach(function(n){fe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fe(e,t,r){return t=ag(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ag(e){var t=ug(e,"string");return yr(t)==="symbol"?t:String(t)}function ug(e,t){if(yr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(yr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tn(e,t){var r={attributes:[],bindings:[]};r.attributes=fg(e,t);for(var n=lg(e,t),i=0,o=n;i<o.length;i++){var a=o[i],u=a.uniforms.map(function(x){return{name:x.name,format:x.format,byteOffset:x.byteOffset,byteStride:x.byteStride,arrayLength:x.arrayLength}});r.bindings.push({type:"uniform",name:a.name,location:a.location,visibility:(a.vertex?1:0)&(a.fragment?2:0),minBindingSize:a.byteLength,uniforms:u})}for(var c=sg(e,t),p=0,b=0,g=c;b<g.length;b++){var v=g[b];if(Xf(v.type)){var O=dg(v.type),w=O.viewDimension,P=O.sampleType;r.bindings.push({type:"texture",name:v.name,location:p,viewDimension:w,sampleType:P}),v.textureUnit=p,p+=1}}c.length&&(r.uniforms=c);var A=cg(e,t);return A!=null&&A.length&&(r.varyings=A),r}function fg(e,t){for(var r=[],n=e.getProgramParameter(t,35721),i=0;i<n;i++){var o=e.getActiveAttrib(t,i);if(!o)throw new Error("activeInfo");var a=o.name,u=o.type,c=e.getAttribLocation(t,a);if(c>=0){var p=Yf(u),b=p.attributeType,g=/instance/i.test(a)?"instance":"vertex";r.push({name:a,location:c,stepMode:g,type:b})}}return r.sort(function(v,O){return v.location-O.location}),r}function cg(e,t){if(!z(e))return[];for(var r=e,n=[],i=e.getProgramParameter(t,35971),o=0;o<i;o++){var a=r.getTransformFeedbackVarying(t,o);if(!a)throw new Error("activeInfo");var u=a.name,c=a.type,p=a.size,b=qo(c),g=b.glType,v=b.components,O=new En({type:g,size:p*v}),w={location:o,name:u,accessor:O};n.push(w)}return n.sort(function(P,A){return P.location-A.location}),n}function sg(e,t){for(var r=[],n=e.getProgramParameter(t,35718),i=0;i<n;i++){var o=e.getActiveUniform(t,i);if(!o)throw new Error("activeInfo");var a=o.name,u=o.size,c=o.type,p=hg(a),b=p.name,g=p.isArray,v=e.getUniformLocation(t,b),O={location:v,name:b,size:u,type:c,isArray:g};if(r.push(O),O.size>1)for(var w=0;w<O.size;w++){var P="".concat(b,"[").concat(w,"]");v=e.getUniformLocation(t,P);var A=Zf(Zf({},O),{},{name:P,location:v});r.push(A)}}return r}function lg(e,t){if(!z(e))return[];for(var r=e,n=function(A,x){return r.getActiveUniformBlockParameter(t,A,x)},i=[],o=r.getProgramParameter(t,35382),a=0;a<o;a++){for(var u={name:r.getActiveUniformBlockName(t,a)||"",location:n(a,35391),byteLength:n(a,35392),vertex:n(a,35396),fragment:n(a,35398),uniformCount:n(a,35394),uniforms:[]},c=n(a,35395)||[],p=r.getActiveUniforms(t,c,35383),b=r.getActiveUniforms(t,c,35384),g=r.getActiveUniforms(t,c,35387),v=r.getActiveUniforms(t,c,35388),O=0;O<u.uniformCount;++O){var w=r.getActiveUniform(t,c[O]);if(!w)throw new Error("activeInfo");u.uniforms.push({name:w.name,format:qo(p[O]).format,type:p[O],arrayLength:b[O],byteOffset:g[O],byteStride:v[O]})}i.push(u)}return i.sort(function(P,A){return P.location-A.location}),i}var pg=(ie={},fe(ie,35678,["2d","float"]),fe(ie,35680,["cube","float"]),fe(ie,35679,["3d","float"]),fe(ie,35682,["3d","depth"]),fe(ie,36289,["2d-array","float"]),fe(ie,36292,["2d-array","depth"]),fe(ie,36293,["cube","float"]),fe(ie,36298,["2d","sint"]),fe(ie,36299,["3d","sint"]),fe(ie,36300,["cube","sint"]),fe(ie,36303,["2d-array","uint"]),fe(ie,36306,["2d","uint"]),fe(ie,36307,["3d","uint"]),fe(ie,36308,["cube","uint"]),fe(ie,36311,["2d-array","uint"]),ie);function dg(e){var t=pg[e];if(!t)throw new Error("sampler");var r=tg(t,2),n=r[0],i=r[1];return{viewDimension:n,sampleType:i}}function hg(e){if(e[e.length-1]!=="]")return{name:e,length:1,isArray:!1};var t=/([^[]*)(\[[0-9]+\])?/,r=t.exec(e);if(!r||r.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(e));return{name:r[1],length:r[2]?1:0,isArray:Boolean(r[2])}}function Jf(e,t,r,n){var i=e,o=n;o===!0&&(o=1),o===!1&&(o=0);var a=typeof o=="number"?[o]:o;switch(r){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if(typeof n!="number")throw new Error("samplers must be set to integers");return e.uniform1i(t,n);case 5126:return e.uniform1fv(t,a);case 35664:return e.uniform2fv(t,a);case 35665:return e.uniform3fv(t,a);case 35666:return e.uniform4fv(t,a);case 5124:return e.uniform1iv(t,a);case 35667:return e.uniform2iv(t,a);case 35668:return e.uniform3iv(t,a);case 35669:return e.uniform4iv(t,a);case 35670:return e.uniform1iv(t,a);case 35671:return e.uniform2iv(t,a);case 35672:return e.uniform3iv(t,a);case 35673:return e.uniform4iv(t,a);case 5125:return i.uniform1uiv(t,a,1);case 36294:return i.uniform2uiv(t,a,2);case 36295:return i.uniform3uiv(t,a,3);case 36296:return i.uniform4uiv(t,a,4);case 35674:return e.uniformMatrix2fv(t,!1,a);case 35675:return e.uniformMatrix3fv(t,!1,a);case 35676:return e.uniformMatrix4fv(t,!1,a);case 35685:return i.uniformMatrix2x3fv(t,!1,a);case 35686:return i.uniformMatrix2x4fv(t,!1,a);case 35687:return i.uniformMatrix3x2fv(t,!1,a);case 35688:return i.uniformMatrix3x4fv(t,!1,a);case 35689:return i.uniformMatrix4x2fv(t,!1,a);case 35690:return i.uniformMatrix4x3fv(t,!1,a)}throw new Error("Illegal uniform")}function ec(e){switch(e){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"line-loop-webgl":return 2;case"triangle-list":return 4;case"triangle-strip":return 5;case"triangle-fan-webgl":return 6;default:throw new Error(e)}}function tc(e){switch(e){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"line-loop-webgl":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;case"triangle-fan-webgl":return 4;default:throw new Error(e)}}function Tt(e){return Tt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tt(e)}function rc(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=uc(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
43
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function nc(e,t){return bg(e)||yg(e,t)||uc(e,t)||mg()}function mg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
44
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uc(e,t){if(e){if(typeof e=="string")return oc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oc(e,t)}}function oc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yg(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function bg(e){if(Array.isArray(e))return e}function ic(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,vg(n.key),n)}}function gg(e,t,r){return t&&ic(e.prototype,t),r&&ic(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function vg(e){var t=wg(e,"string");return Tt(t)==="symbol"?t:String(t)}function wg(e,t){if(Tt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Tt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Og(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qo(e,t)}function Qo(e,t){return Qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Qo(e,t)}function Sg(e){var t=Eg();return function(){var n=An(e),i;if(t){var o=An(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Pg(this,i)}}function Pg(e,t){if(t&&(Tt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xg(e)}function xg(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Eg(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function An(e){return An=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},An(e)}var ac=4,Ln=function(e){Og(r,e);var t=Sg(r);function r(i,o){var a;_g(this,r),a=t.call(this,i,o),a.device=void 0,a.handle=void 0,a.vs=void 0,a.fs=void 0,a.introspectedLayout=void 0,a.uniforms={},a.bindings={},a.varyings=null,a._uniformCount=0,a._uniformSetters={},a.device=i,a.handle=a.props.handle||a.device.gl.createProgram(),a.device.setSpectorMetadata(a.handle,{id:a.props.id}),a.vs=o.vs,a.fs=o.fs;var u=o.varyings,c=o.bufferMode,p=c===void 0?35981:c;if(u&&u.length>0){var b;a.device.assertWebGL2(),a.varyings=u,(b=a.device.gl2)===null||b===void 0||b.transformFeedbackVaryings(a.handle,u,p)}return a._compileAndLink(),a.introspectedLayout=Tn(a.device.gl,a.handle),a.shaderLayout=to(a.introspectedLayout,o.shaderLayout),a}var n=r.prototype;return n.destroy=function(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)},n.setBindings=function(o){for(var a=this,u=function(){var v=nc(p[c],2),O=v[0],w=v[1],P=a.shaderLayout.bindings.find(function(x){return x.name===O})||a.shaderLayout.bindings.find(function(x){return x.name==="".concat(O,"Uniforms")});if(!P){var A=a.shaderLayout.bindings.map(function(x){return'"'.concat(x.name,'"')}).join(", ");return B.warn('Unknown binding "'.concat(O,'" in render pipeline "').concat(a.id,'", expected one of ').concat(A))(),"continue"}switch(w||B.warn('Unsetting binding "'.concat(O,'" in render pipeline "').concat(a.id,'"'))(),P.type){case"uniform":if(!(w instanceof pe)&&!(w.buffer instanceof pe))throw new Error("buffer value");break;case"texture":if(!(w instanceof se||w instanceof Te))throw new Error("texture value");break;case"sampler":B.warn("Ignoring sampler ".concat(O))();break;default:throw new Error(P.type)}a.bindings[O]=w},c=0,p=Object.entries(o);c<p.length;c++)var b=u()},n.setUniforms=function(o){var a=uo(o),u=a.bindings;Object.keys(u).forEach(function(c){B.warn('Unsupported value "'.concat(u[c],'" used in setUniforms() for key ').concat(c,". Use setBindings() instead?"))()}),Object.assign(this.uniforms,o)},n.draw=function(o){var a,u=this,c=o.renderPass,p=o.vertexArray,b=o.vertexCount,g=o.instanceCount,v=o.firstVertex,O=v===void 0?0:v,w=o.transformFeedback,P=ec(this.props.topology),A=Boolean(p.indexBuffer),x=(a=p.indexBuffer)===null||a===void 0?void 0:a.glIndexType,T=Number(g)>0;if(!this._areTexturesRenderable()||b===0)return!1;this.device.gl.useProgram(this.handle),p.bindBeforeRender(c),w&&w.begin(this.props.topology),this._applyBindings(),this._applyUniforms();var R=c;return Mu(this.device,this.props.parameters,R.glParameters,function(){if(A&&T){var j;(j=u.device.gl2)===null||j===void 0||j.drawElementsInstanced(P,b||0,x,O,g||0)}else if(A)u.device.gl.drawElements(P,b||0,x,O);else if(T){var k;(k=u.device.gl2)===null||k===void 0||k.drawArraysInstanced(P,O,b||0,g||0)}else u.device.gl.drawArrays(P,O,b||0);w&&w.end()}),p.unbindAfterRender(c),!0},n._compileAndLink=function(){var o=this.device.gl;o.attachShader(this.handle,this.vs.handle),o.attachShader(this.handle,this.fs.handle),B.time(ac,"linkProgram for ".concat(this.id))(),o.linkProgram(this.handle),B.timeEnd(ac,"linkProgram for ".concat(this.id))(),!o.debug&&B.level;var a=o.getProgramParameter(this.handle,35714);if(!a)throw new Error("Error linking: ".concat(o.getProgramInfoLog(this.handle)));o.validateProgram(this.handle);var u=o.getProgramParameter(this.handle,35715);if(!u)throw new Error("Error validating: ".concat(o.getProgramInfoLog(this.handle)))},n._areTexturesRenderable=function(){for(var o=!0,a=0,u=Object.entries(this.bindings);a<u.length;a++){var c=nc(u[a],2),p=c[1];p instanceof se&&(p.update(),o=o&&p.loaded)}return o},n._applyBindings=function(){this.device.gl.useProgram(this.handle);var o=this.device.gl2;if(!o)throw new Error("bindings");var a=0,u=0,c=rc(this.shaderLayout.bindings),p;try{for(c.s();!(p=c.n()).done;){var b=p.value,g=this.bindings[b.name]||this.bindings[b.name.replace(/Uniforms$/,"")];if(!g)throw new Error("No value for binding ".concat(b.name," in ").concat(this.id));switch(b.type){case"uniform":var v=b.name,O=o.getUniformBlockIndex(this.handle,v);if(O===4294967295)throw new Error("Invalid uniform block name ".concat(v));o.uniformBlockBinding(this.handle,u,O),g instanceof pe?o.bindBufferBase(35345,u,g.handle):o.bindBufferRange(35345,u,g.buffer.handle,g.offset||0,g.size||g.buffer.byteLength-g.offset),u+=1;break;case"texture":if(!(g instanceof se||g instanceof Te))throw new Error("texture");var w=void 0;if(g instanceof se)w=g;else if(g instanceof Te&&g.colorAttachments[0]instanceof se)B.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),w=g.colorAttachments[0];else throw new Error("No texture");o.activeTexture(33984+a),o.bindTexture(w.target,w.handle),a+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error("binding type '".concat(b.type,"' not supported in WebGL"))}}}catch(P){c.e(P)}finally{c.f()}},n._applyUniforms=function(){var o=rc(this.shaderLayout.uniforms||[]),a;try{for(o.s();!(a=o.n()).done;){var u,c=a.value,p=c.name,b=c.location,g=c.type,v=c.textureUnit,O=(u=this.uniforms[p])!==null&&u!==void 0?u:v;O!==void 0&&Jf(this.device.gl,b,g,O)}}catch(w){o.e(w)}finally{o.f()}},gg(r)}(Cr);function At(e){return At=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(e)}function Tg(e,t){return jg(e)||Lg(e,t)||sc(e,t)||Ag()}function Ag(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
45
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lg(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,p=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(b){p=!0,i=b}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(p)throw i}}return u}}function jg(e){if(Array.isArray(e))return e}function Rg(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=sc(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
46
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function sc(e,t){if(e){if(typeof e=="string")return fc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fc(e,t)}}function fc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function cc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Bg(n.key),n)}}function Gg(e,t,r){return t&&cc(e.prototype,t),r&&cc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bg(e){var t=Ig(e,"string");return At(t)==="symbol"?t:String(t)}function Ig(e,t){if(At(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(At(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dg(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zo(e,t)}function Zo(e,t){return Zo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Zo(e,t)}function Cg(e){var t=Ng();return function(){var n=jn(e),i;if(t){var o=jn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Wg(this,i)}}function Wg(e,t){if(t&&(At(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mg(e)}function Mg(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ng(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jn(e){return jn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},jn(e)}var lc=function(e){Dg(r,e);var t=Cg(r);function r(i){var o;return Fg(this,r),o=t.call(this,i,{}),o.device=void 0,o.commands=[],o.device=i,o}var n=r.prototype;return n.submitCommands=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.commands,a=Rg(o),u;try{for(a.s();!(u=a.n()).done;){var c=u.value;switch(c.name){case"copy-buffer-to-buffer":kg(this.device,c.options);break;case"copy-buffer-to-texture":Vg(this.device,c.options);break;case"copy-texture-to-buffer":Ug(this.device,c.options);break;case"copy-texture-to-texture":zg(this.device,c.options);break}}}catch(p){a.e(p)}finally{a.f()}},Gg(r)}(Ur);function kg(e,t){var r=t.source,n=t.destination,i=e.assertWebGL2();if(i){var o,a;i.bindBuffer(36662,r.handle),i.bindBuffer(36663,n.handle),i.copyBufferSubData(36662,36663,(o=t.sourceOffset)!==null&&o!==void 0?o:0,(a=t.destinationOffset)!==null&&a!==void 0?a:0,t.size),i.bindBuffer(36662,null),i.bindBuffer(36663,null)}else throw new Error("copyBufferToBuffer not implemented in WebGL1")}function Vg(e,t){throw new Error("Not implemented")}function Ug(e,t){var r=t.source,n=t.mipLevel,i=n===void 0?0:n,o=t.aspect,a=o===void 0?"all":o,u=t.width,c=u===void 0?t.source.width:u,p=t.height,b=p===void 0?t.source.height:p,g=t.depthOrArrayLayers,v=g===void 0?0:g,O=t.origin,w=O===void 0?[0,0]:O,P=t.destination,A=t.byteOffset,x=A===void 0?0:A,T=t.bytesPerRow,R=t.rowsPerImage;if(a!=="all")throw new Error("not supported");if(i!==0||v!==0||T||R)throw new Error("not implemented");var j=e.assertWebGL2(),k=pc(r),F=k.framebuffer,X=k.destroyFramebuffer;try{var N=P,V=c||F.width,W=b||F.height,H=mt(F.texture.format,!0),l=H.dataFormat,f=H.type;j.bindBuffer(35051,N.handle),j.bindFramebuffer(36160,F.handle),j.readPixels(w[0],w[1],V,W,l,f,x)}finally{j.bindBuffer(35051,null),j.bindFramebuffer(36160,null),X&&F.destroy()}}function zg(e,t){var r=t.source,n=t.origin,i=n===void 0?[0,0]:n,o=t.destination,a=t.width,u=a===void 0?t.destination.width:a,c=t.height,p=c===void 0?t.destination.width:c,b=0,g=6408,v=pc(r),O=v.framebuffer,w=v.destroyFramebuffer,P=Tg(i,2),A=P[0],x=P[1],T=!1;e.gl.bindFramebuffer(36160,O.handle);var R=null,j;if(o instanceof se)R=o,u=Number.isFinite(u)?u:R.width,p=Number.isFinite(p)?p:R.height,R.bind(0),j=R.destination;else throw new Error("whoops");return T||e.gl.copyTexImage2D(j,b,g,A,x,u,p,0),R&&R.unbind(),w&&O.destroy(),R}function pc(e){if(e instanceof ae){var t=e.width,r=e.height,n=e.id,i=e.device.createFramebuffer({id:"framebuffer-for-".concat(n),width:t,height:r,colorAttachments:[e]});return{framebuffer:i,destroyFramebuffer:!0}}return{framebuffer:e,destroyFramebuffer:!1}}function Lt(e){return Lt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lt(e)}function dc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$g(n.key),n)}}function Hg(e,t,r){return t&&dc(e.prototype,t),r&&dc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $g(e){var t=Xg(e,"string");return Lt(t)==="symbol"?t:String(t)}function Xg(e,t){if(Lt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Lt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yg(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jo(e,t)}function Jo(e,t){return Jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Jo(e,t)}function qg(e){var t=Jg();return function(){var n=Rn(e),i;if(t){var o=Rn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Qg(this,i)}}function Qg(e,t){if(t&&(Lt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zg(e)}function Zg(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Jg(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Rn(e){return Rn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rn(e)}var Gn=function(e){Yg(r,e);var t=qg(r);function r(i,o){var a;return Kg(this,r),a=t.call(this,i,o),a.device=void 0,a.commandBuffer=void 0,a.device=i,a.commandBuffer=new lc(i),a}var n=r.prototype;return n.destroy=function(){},n.finish=function(){this.commandBuffer.submitCommands()},n.copyBufferToBuffer=function(o){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:o})},n.copyBufferToTexture=function(o){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:o})},n.copyTextureToBuffer=function(o){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:o})},n.copyTextureToTexture=function(o){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:o})},n.pushDebugGroup=function(o){},n.popDebugGroup=function(){},n.insertDebugMarker=function(o){},Hg(r)}(kr);function jt(e){return jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jt(e)}var mc;function ev(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,rv(n.key),n)}}function tv(e,t,r){return t&&hc(e.prototype,t),r&&hc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function rv(e){var t=nv(e,"string");return jt(t)==="symbol"?t:String(t)}function nv(e,t){if(jt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(jt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bn(){return typeof Reflect<"u"&&Reflect.get?Bn=Reflect.get.bind():Bn=function(t,r,n){var i=ov(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Bn.apply(this,arguments)}function ov(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Rt(e),e!==null););return e}function iv(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ei(e,t)}function ei(e,t){return ei=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ei(e,t)}function av(e){var t=cv();return function(){var n=Rt(e),i;if(t){var o=Rt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return uv(this,i)}}function uv(e,t){if(t&&(jt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fv(e)}function fv(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cv(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Rt(e){return Rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rt(e)}mc=Symbol.toStringTag;var In=function(e){iv(r,e);var t=av(r);r.isConstantAttributeZeroSupported=function(o){return o.info.type==="webgl2"||_r()==="Chrome"};function r(i,o){var a;return ev(this,r),a=t.call(this,i,o),a.device=void 0,a.handle=void 0,a.buffer=null,a.bufferValue=null,a.init=!1,a.device=i,a.handle=a.device.gl2.createVertexArray(),a}var n=r.prototype;return n.destroy=function(){if(Bn(Rt(r.prototype),"destroy",this).call(this),this.buffer){var o;(o=this.buffer)===null||o===void 0||o.destroy()}this.handle&&(this.device.gl2.deleteVertexArray(this.handle),this.handle=void 0)},n.setIndexBuffer=function(o){var a=o;if(a&&a.glTarget!==34963)throw new Error("Use .setBuffer()");this.device.gl2.bindVertexArray(this.handle),this.device.gl2.bindBuffer(34963,a?a.handle:null),this.indexBuffer=a},n.setBuffer=function(o,a){var u=a;if(u.glTarget===34963)throw new Error("Use .setIndexBuffer()");var c=this._getAccessor(o),p=c.size,b=c.type,g=c.stride,v=c.offset,O=c.normalized,w=c.integer,P=c.divisor;this.device.gl2.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,u.handle),w?(this.device.assertWebGL2(),this.device.gl2.vertexAttribIPointer(o,p,b,g,v)):this.device.gl.vertexAttribPointer(o,p,b,O,g,v),this.device.gl.enableVertexAttribArray(o),this.device.gl2.vertexAttribDivisor(o,P||0),this.attributes[o]=u},n.setConstant=function(o,a){this._enable(o,!1),this.attributes[o]=a},n.bindBeforeRender=function(){if(this.device.gl2.bindVertexArray(this.handle),!this.init){var o=this.indexBuffer;this.device.gl2.bindBuffer(34963,o?.handle||null),this.init=!0}this._applyConstantAttributes()},n.unbindAfterRender=function(){this.device.gl2.bindVertexArray(null)},n._applyConstantAttributes=function(){for(var o=0;o<this.maxVertexAttributes;++o){var a=this.attributes[o];ArrayBuffer.isView(a)&&this.device.setConstantAttribute(o,a)}},n._getAccessor=function(o){var a=this.attributeInfos[o];if(!a)throw new Error("Unknown attribute location ".concat(o));var u=rn(a.bufferDataType);return{size:a.bufferComponents,type:u,stride:a.byteStride,offset:a.byteOffset,normalized:a.normalized,integer:a.integer,divisor:a.stepMode==="instance"?1:0}},n._enable=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,u=r.isConstantAttributeZeroSupported(this.device),c=u||o!==0;(a||c)&&(o=Number(o),this.device.gl2.bindVertexArray(this.handle),a?this.device.gl.enableVertexAttribArray(o):this.device.gl.disableVertexAttribArray(o),this.device.gl2.bindVertexArray(null))},n.getConstantBuffer=function(o,a){var u=sv(a),c=u.byteLength*o,p=u.length*o;if(this.buffer&&c!==this.buffer.byteLength)throw new Error("Buffer size is immutable, byte length ".concat(c," !== ").concat(this.buffer.byteLength,"."));var b=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:c}),b=b||!lv(u,this.bufferValue),b){var g=oo(a.constructor,p);io({target:g,source:u,start:0,count:p}),this.buffer.write(g),this.bufferValue=a}return this.buffer},tv(r,[{key:mc,get:function(){return"VertexArray"}}]),r}($r);function sv(e){return Array.isArray(e)?new Float32Array(e):e}function lv(e,t){if(!e||!t||e.length!==t.length||e.constructor!==t.constructor)return!1;for(var r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}function Gt(e){return Gt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gt(e)}function pv(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=dv(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
47
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return o=p.done,p},e:function(p){a=!0,u=p},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function dv(e,t){if(e){if(typeof e=="string")return yc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yc(e,t)}}function yc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function bc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,mv(n.key),n)}}function hv(e,t,r){return t&&bc(e.prototype,t),r&&bc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function mv(e){var t=yv(e,"string");return Gt(t)==="symbol"?t:String(t)}function yv(e,t){if(Gt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Gt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fn(){return typeof Reflect<"u"&&Reflect.get?Fn=Reflect.get.bind():Fn=function(t,r,n){var i=gv(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Fn.apply(this,arguments)}function gv(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Bt(e),e!==null););return e}function vv(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ti(e,t)}function ti(e,t){return ti=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ti(e,t)}function wv(e){var t=Ov();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return _v(this,i)}}function _v(e,t){if(t&&(Gt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vc(e)}function vc(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ov(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bt(e){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bt(e)}var Dn=function(e){vv(r,e);var t=wv(r);function r(i,o){var a;return bv(this,r),a=t.call(this,i,o),a.device=void 0,a.gl2=void 0,a.handle=void 0,a.layout=void 0,a.buffers={},a.unusedBuffers={},a.bindOnUse=!0,a._bound=!1,i.assertWebGL2(),a.device=i,a.gl2=i.gl2,a.handle=a.props.handle||a.gl2.createTransformFeedback(),a.layout=a.props.layout,o.buffers&&a.setBuffers(o.buffers),Object.seal(vc(a)),a}var n=r.prototype;return n.destroy=function(){this.gl2.deleteTransformFeedback(this.handle),Fn(Bt(r.prototype),"destroy",this).call(this)},n.begin=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"point-list";this.gl2.bindTransformFeedback(36386,this.handle),this.bindOnUse&&this._bindBuffers(),this.gl2.beginTransformFeedback(tc(o))},n.end=function(){this.gl2.endTransformFeedback(),this.bindOnUse||this._unbindBuffers(),this.gl2.bindTransformFeedback(36386,null)},n.setBuffers=function(o){var a=this;this.buffers={},this.unusedBuffers={},this.bind(function(){for(var u in o)a.setBuffer(u,o[u])})},n.setBuffer=function(o,a){var u=this._getVaryingIndex(o),c=this._getBufferRange(a),p=c.buffer,b=c.byteLength,g=c.byteOffset;if(u<0){this.unusedBuffers[o]=p,B.warn("".concat(this.id," unusedBuffers varying buffer ").concat(o))();return}this.buffers[u]={buffer:p,byteLength:b,byteOffset:g},this.bindOnUse||this._bindBuffer(u,p,g,b)},n.getBuffer=function(o){if(gc(o))return this.buffers[o]||null;var a=this._getVaryingIndex(o);return a>=0?this.buffers[a]:null},n.bind=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.handle;if(typeof o!="function")return this.gl2.bindTransformFeedback(36386,o),this;var a;return this._bound?a=o():(this.gl2.bindTransformFeedback(36386,this.handle),this._bound=!0,a=o(),this._bound=!1,this.gl2.bindTransformFeedback(36386,null)),a},n.unbind=function(){this.bind(null)},n._getBufferRange=function(o){if(o instanceof pe)return{buffer:o,byteOffset:0,byteLength:o.byteLength};var a=o.buffer,u=o.byteOffset,c=u===void 0?0:u,p=o.byteLength,b=p===void 0?o.buffer.byteLength:p;return{buffer:a,byteOffset:c,byteLength:b}},n._getVaryingIndex=function(o){if(gc(o))return Number(o);var a=pv(this.layout.varyings),u;try{for(a.s();!(u=a.n()).done;){var c=u.value;if(o===c.name)return c.location}}catch(p){a.e(p)}finally{a.f()}return-1},n._bindBuffers=function(){for(var o in this.buffers){var a=this._getBufferRange(this.buffers[o]),u=a.buffer,c=a.byteLength,p=a.byteOffset;this._bindBuffer(Number(o),u,p,c)}},n._unbindBuffers=function(){for(var o in this.buffers)this.gl2.bindBufferBase(35982,Number(o),null)},n._bindBuffer=function(o,a){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,c=arguments.length>3?arguments[3]:void 0,p=a&&a.handle;!p||c===void 0?this.gl2.bindBufferBase(35982,o,p):this.gl2.bindBufferRange(35982,o,p,u,c)},hv(r)}(Kr);function gc(e){return typeof e=="number"?Number.isInteger(e):/^\d+$/.test(e)}function Ue(e){return Ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ue(e)}function wc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ae(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wc(Object(r),!0).forEach(function(n){Sv(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sv(e,t,r){return t=Sc(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ri(){"use strict";ri=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(l,f,s){l[f]=s.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(l,f,s){return Object.defineProperty(l,f,{value:s,enumerable:!0,configurable:!0,writable:!0}),l[f]}try{c({},"")}catch{c=function(s,d,m){return s[d]=m}}function p(l,f,s,d){var m=f&&f.prototype instanceof v?f:v,h=Object.create(m.prototype),_=new V(d||[]);return n(h,"_invoke",{value:k(l,s,_)}),h}function b(l,f,s){try{return{type:"normal",arg:l.call(f,s)}}catch(d){return{type:"throw",arg:d}}}e.wrap=p;var g={};function v(){}function O(){}function w(){}var P={};c(P,o,function(){return this});var A=Object.getPrototypeOf,x=A&&A(A(W([])));x&&x!==t&&r.call(x,o)&&(P=x);var T=w.prototype=v.prototype=Object.create(P);function R(l){["next","throw","return"].forEach(function(f){c(l,f,function(s){return this._invoke(f,s)})})}function j(l,f){function s(m,h,_,S){var E=b(l[m],l,h);if(E.type!=="throw"){var D=E.arg,I=D.value;return I&&Ue(I)=="object"&&r.call(I,"__await")?f.resolve(I.__await).then(function(C){s("next",C,_,S)},function(C){s("throw",C,_,S)}):f.resolve(I).then(function(C){D.value=C,_(D)},function(C){return s("throw",C,_,S)})}S(E.arg)}var d;n(this,"_invoke",{value:function(h,_){function S(){return new f(function(E,D){s(h,_,E,D)})}return d=d?d.then(S,S):S()}})}function k(l,f,s){var d="suspendedStart";return function(m,h){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(m==="throw")throw h;return H()}for(s.method=m,s.arg=h;;){var _=s.delegate;if(_){var S=F(_,s);if(S){if(S===g)continue;return S}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(d==="suspendedStart")throw d="completed",s.arg;s.dispatchException(s.arg)}else s.method==="return"&&s.abrupt("return",s.arg);d="executing";var E=b(l,f,s);if(E.type==="normal"){if(d=s.done?"completed":"suspendedYield",E.arg===g)continue;return{value:E.arg,done:s.done}}E.type==="throw"&&(d="completed",s.method="throw",s.arg=E.arg)}}}function F(l,f){var s=f.method,d=l.iterator[s];if(d===void 0)return f.delegate=null,s==="throw"&&l.iterator.return&&(f.method="return",f.arg=void 0,F(l,f),f.method==="throw")||s!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+s+"' method")),g;var m=b(d,l.iterator,f.arg);if(m.type==="throw")return f.method="throw",f.arg=m.arg,f.delegate=null,g;var h=m.arg;return h?h.done?(f[l.resultName]=h.value,f.next=l.nextLoc,f.method!=="return"&&(f.method="next",f.arg=void 0),f.delegate=null,g):h:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,g)}function X(l){var f={tryLoc:l[0]};1 in l&&(f.catchLoc=l[1]),2 in l&&(f.finallyLoc=l[2],f.afterLoc=l[3]),this.tryEntries.push(f)}function N(l){var f=l.completion||{};f.type="normal",delete f.arg,l.completion=f}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(X,this),this.reset(!0)}function W(l){if(l){var f=l[o];if(f)return f.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var s=-1,d=function m(){for(;++s<l.length;)if(r.call(l,s))return m.value=l[s],m.done=!1,m;return m.value=void 0,m.done=!0,m};return d.next=d}}return{next:H}}function H(){return{value:void 0,done:!0}}return O.prototype=w,n(T,"constructor",{value:w,configurable:!0}),n(w,"constructor",{value:O,configurable:!0}),O.displayName=c(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(l){var f=typeof l=="function"&&l.constructor;return!!f&&(f===O||(f.displayName||f.name)==="GeneratorFunction")},e.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,w):(l.__proto__=w,c(l,u,"GeneratorFunction")),l.prototype=Object.create(T),l},e.awrap=function(l){return{__await:l}},R(j.prototype),c(j.prototype,a,function(){return this}),e.AsyncIterator=j,e.async=function(l,f,s,d,m){m===void 0&&(m=Promise);var h=new j(p(l,f,s,d),m);return e.isGeneratorFunction(f)?h:h.next().then(function(_){return _.done?_.value:h.next()})},R(T),c(T,u,"Generator"),c(T,o,function(){return this}),c(T,"toString",function(){return"[object Generator]"}),e.keys=function(l){var f=Object(l),s=[];for(var d in f)s.push(d);return s.reverse(),function m(){for(;s.length;){var h=s.pop();if(h in f)return m.value=h,m.done=!1,m}return m.done=!0,m}},e.values=W,V.prototype={constructor:V,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(N),!f)for(var s in this)s.charAt(0)==="t"&&r.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=void 0)},stop:function(){this.done=!0;var f=this.tryEntries[0].completion;if(f.type==="throw")throw f.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var s=this;function d(D,I){return _.type="throw",_.arg=f,s.next=D,I&&(s.method="next",s.arg=void 0),!!I}for(var m=this.tryEntries.length-1;m>=0;--m){var h=this.tryEntries[m],_=h.completion;if(h.tryLoc==="root")return d("end");if(h.tryLoc<=this.prev){var S=r.call(h,"catchLoc"),E=r.call(h,"finallyLoc");if(S&&E){if(this.prev<h.catchLoc)return d(h.catchLoc,!0);if(this.prev<h.finallyLoc)return d(h.finallyLoc)}else if(S){if(this.prev<h.catchLoc)return d(h.catchLoc,!0)}else{if(!E)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return d(h.finallyLoc)}}}},abrupt:function(f,s){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m.tryLoc<=this.prev&&r.call(m,"finallyLoc")&&this.prev<m.finallyLoc){var h=m;break}}h&&(f==="break"||f==="continue")&&h.tryLoc<=s&&s<=h.finallyLoc&&(h=null);var _=h?h.completion:{};return _.type=f,_.arg=s,h?(this.method="next",this.next=h.finallyLoc,g):this.complete(_)},complete:function(f,s){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&s&&(this.next=s),g},finish:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.finallyLoc===f)return this.complete(d.completion,d.afterLoc),N(d),g}},catch:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.tryLoc===f){var m=d.completion;if(m.type==="throw"){var h=m.arg;N(d)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:W(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=void 0),g}},e}function _c(e,t,r,n,i,o,a){try{var u=e[o](a),c=u.value}catch(p){r(p);return}u.done?t(c):Promise.resolve(c).then(n,i)}function Pv(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(c){_c(o,n,i,a,u,"next",c)}function u(c){_c(o,n,i,a,u,"throw",c)}a(void 0)})}}function xv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Sc(n.key),n)}}function Ev(e,t,r){return t&&Oc(e.prototype,t),r&&Oc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sc(e){var t=Tv(e,"string");return Ue(t)==="symbol"?t:String(t)}function Tv(e,t){if(Ue(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ue(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Av(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ni(e,t)}function ni(e,t){return ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ni(e,t)}function Lv(e){var t=Rv();return function(){var n=Wn(e),i;if(t){var o=Wn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return jv(this,i)}}function jv(e,t){if(t&&(Ue(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oi(e)}function oi(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rv(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Wn(e){return Wn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wn(e)}var Cn=1,le=function(e){Av(r,e);var t=Lv(r);r.isSupported=function(){return typeof WebGLRenderingContext<"u"||si()},r.attach=function(o){if(o instanceof r)return o;if(o?.device instanceof qe)return o.device;if(!Gv(o))throw new Error("Invalid WebGLRenderingContext");return new r({gl:o})},r.create=function(){var i=Pv(ri().mark(function a(){var u,c,p=arguments;return ri().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(u=p.length>0&&p[0]!==void 0?p[0]:{},B.groupCollapsed(Cn,"WebGLDevice created"),typeof u.canvas!="string"){g.next=5;break}return g.next=5,Qe.pageLoaded;case 5:if(!(B.get("debug")||u.debug)){g.next=8;break}return g.next=8,jf();case 8:if(c=u.spector,!(B.get("spector")||c)){g.next=12;break}return g.next=12,_f();case 12:if(B.probe(Cn+1,"DOM is loaded")(),!(u.gl&&u.gl.device)){g.next=15;break}return g.abrupt("return",r.attach(u.gl));case 15:return g.abrupt("return",new r(u));case 16:case"end":return g.stop()}},a)}));function o(){return i.apply(this,arguments)}return o}();function r(i){var o,a;xv(this,r),a=t.call(this,Ae(Ae({},i),{},{id:i.id||we("webgl-device")})),a.info=void 0,a.canvasContext=void 0,a.handle=void 0,a.lost=void 0,a._resolveContextLost=void 0,a._features=void 0,a._limits=void 0,a.renderPass=null,a.gl=void 0,a.gl2=null,a.debug=!1,a.isWebGL1=void 0,a.isWebGL2=void 0,a._canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1},a._extensions={},a._polyfilled=!1,a.spector=void 0,a._webglLimits=void 0,a._constants=void 0;var u=(o=i.gl)===null||o===void 0?void 0:o.device;if(u)throw new Error("WebGL context already attached to device ".concat(u.id));a.canvasContext=new wn(oi(a),i),a.lost=new Promise(function(A){a._resolveContextLost=A});var c=function(x){var T,R;return(T=(R=a)._resolveContextLost)===null||T===void 0?void 0:T.call(R,{reason:"destroyed",message:"Computer entered sleep mode, or too many apps or browser tabs are using the GPU."})},p=i.gl||null;if(p=p||(J()?Ou(a.canvasContext.canvas,Ae(Ae({},i),{},{onContextLost:c})):null),p=p||(J()?null:li(Ae(Ae({},i),{},{onContextLost:c}))),!p)throw new Error("WebGL context creation failed");a.handle=p,a.gl=a.handle,a.gl2=a.gl,a.isWebGL2=Bv(a.gl),a.isWebGL1=!a.isWebGL2,a.info=Su(a.gl),a.gl.device=oi(a),a.gl._version=a.isWebGL2?2:1,en(a.gl);var b=i.enable,g=b===void 0?!0:b,v=i.copyState,O=v===void 0?!1:v;if(er(a.gl,{enable:g,copyState:O,log:function(){for(var x=arguments.length,T=new Array(x),R=0;R<x;R++)T[R]=arguments[R];return B.log.apply(B,[1].concat(T))()}}),J()&&i.debug&&(a.gl=Rf(a.gl,Ae(Ae({},i),{},{webgl2:a.isWebGL2,throwOnError:!0})),a.gl2=a.gl,a.debug=!0,B.level=Math.max(B.level,1),B.warn("WebGL debug mode activated. Performance reduced.")()),J()&&i.spector){var w=a.handle.canvas||i.canvas;a.spector=Of(Ae(Ae({},a.props),{},{canvas:w}))}var P="Created ".concat(a.info.type).concat(a.debug?" debug":""," context: ").concat(a.info.vendor,", ").concat(a.info.renderer," for canvas: ").concat(a.canvasContext.id);return B.probe(Cn,P)(),B.groupEnd(Cn)(),a}var n=r.prototype;return n.destroy=function(){var o=this.gl.getExtension("STACKGL_destroy_context");o&&o.destroy()},n.getSize=function(){return[this.gl.drawingBufferWidth,this.gl.drawingBufferHeight]},n.isTextureFormatSupported=function(o){return ar(this.gl,o)},n.isTextureFormatFilterable=function(o){return Lu(this.gl,o)},n.isTextureFormatRenderable=function(o){return ju(this.gl,o)},n.assertWebGL2=function(){if(!this.gl2)throw new Error("Requires WebGL2");return this.gl2},n.createCanvasContext=function(o){throw new Error("WebGL only supports a single canvas")},n.createBuffer=function(o){var a=this._getBufferProps(o);return new pe(this,a)},n._createTexture=function(o){return new se(this,o)},n.createExternalTexture=function(o){throw new Error("createExternalTexture() not implemented")},n.createSampler=function(o){return new ke(this,o)},n.createShader=function(o){return new On(this,o)},n.createFramebuffer=function(o){return new Te(this,o)},n.createRenderPipeline=function(o){return new Ln(this,o)},n.createVertexArray=function(o){return new In(this,o)},n.beginRenderPass=function(o){return new Pn(this,o)},n.createComputePipeline=function(o){throw new Error("ComputePipeline not supported in WebGL")},n.beginComputePass=function(o){throw new Error("ComputePass not supported in WebGL")},n.createTransformFeedback=function(o){return new Dn(this,o)},n.getDefaultRenderPass=function(){return this.renderPass=this.renderPass||this.beginRenderPass({framebuffer:this.canvasContext.getCurrentFramebuffer()}),this.renderPass},n.createCommandEncoder=function(o){return new Gn(this,o)},n.submit=function(){var o;(o=this.renderPass)===null||o===void 0||o.end(),this.renderPass=null},n.loseDevice=function(){var o,a=!1,u=this.gl.getExtension("WEBGL_lose_context");return u&&(a=!0,u.loseContext()),(o=this._resolveContextLost)===null||o===void 0||o.call(this,{reason:"destroyed",message:"Application triggered context loss"}),a},n.pushState=function(){_e(this.gl)},n.popState=function(){ge(this.gl)},n.setSpectorMetadata=function(o,a){o.__SPECTOR_Metadata=a},n.getGLKey=function(o,a){a=a||this.gl2||this.gl;var u=Number(o);for(var c in a)if(a[c]===u)return"GL.".concat(c);return String(o)},n.setConstantAttribute=function(o,a){this._constants=this._constants||new Array(this.limits.maxVertexAttributes).fill(null);var u=this._constants[o];switch(u&&Cv(u,a)&&B.info(1,"setConstantAttribute(".concat(o,") could have been skipped, value unchanged"))(),this._constants[o]=a,a.constructor){case Float32Array:Iv(this,o,a);break;case Int32Array:Fv(this,o,a);break;case Uint32Array:Dv(this,o,a);break;default:M(!1)}},Ev(r,[{key:"features",get:function(){return this._features=this._features||Iu(this.gl),this._features}},{key:"limits",get:function(){return this._limits=this._limits||Du(this.gl),this._limits}},{key:"isLost",get:function(){return this.gl.isContextLost()}},{key:"webglLimits",get:function(){return this._webglLimits=this._webglLimits||Cu(this.gl),this._webglLimits}}]),r}(qe);le.type="webgl";function Gv(e){return typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&Number.isFinite(e._version))}function Bv(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&e._version===2)}function Iv(e,t,r){switch(r.length){case 1:e.gl.vertexAttrib1fv(t,r);break;case 2:e.gl.vertexAttrib2fv(t,r);break;case 3:e.gl.vertexAttrib3fv(t,r);break;case 4:e.gl.vertexAttrib4fv(t,r);break;default:M(!1)}}function Fv(e,t,r){var n;e.assertWebGL2(),(n=e.gl2)===null||n===void 0||n.vertexAttribI4iv(t,r)}function Dv(e,t,r){var n;e.assertWebGL2(),(n=e.gl2)===null||n===void 0||n.vertexAttribI4uiv(t,r)}function Cv(e,t){if(!e||!t||e.length!==t.length||e.constructor!==t.constructor)return!1;for(var r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}var Wv=256,Mv=1024,Nv=16384;var kv="clear: bad arguments";function Pc(e,t){var r=le.attach(e),n=t||{},i=n.framebuffer,o=i===void 0?null:i,a=n.color,u=a===void 0?null:a,c=n.depth,p=c===void 0?null:c,b=n.stencil,g=b===void 0?null:b,v={};o&&(v.framebuffer=o);var O=0;u&&(O|=Nv,u!==!0&&(v.clearColor=u)),p&&(O|=Wv,p!==!0&&(v.clearDepth=p)),g&&(O|=Mv,p!==!0&&(v.clearStencil=p)),M(O!==0,kv),ve(r.gl,v,function(){r.gl.clear(O)})}function ii(e){switch(e){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return M(!1),0}}function xc(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return M(!1),0}}function br(e){return br=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},br(e)}function Ec(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ec(Object(r),!0).forEach(function(n){Vv(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ec(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vv(e,t,r){return t=Uv(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Uv(e){var t=zv(e,"string");return br(t)==="symbol"?t:String(t)}function zv(e,t){if(br(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(br(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ac(e,t){var r,n=t||{},i=n.sourceX,o=i===void 0?0:i,a=n.sourceY,u=a===void 0?0:a,c=n.sourceFormat,p=c===void 0?6408:c,b=n.sourceAttachment,g=b===void 0?36064:b,v=t||{},O=v.target,w=O===void 0?null:O,P=v.sourceWidth,A=v.sourceHeight,x=v.sourceType,T=ai(e),R=T.framebuffer,j=T.deleteFramebuffer;M(R);var k=R,F=k.gl,X=k.handle;P=P||R.width,A=A||R.height;var N=g-36064;x=x||((r=R.colorAttachments[N])===null||r===void 0?void 0:r.type)||5121,w=$v(w,x,p,P,A),x=x||Uf(w);var V=F.bindFramebuffer(36160,X);return F.readPixels(o,u,P,A,p,x,w),F.bindFramebuffer(36160,V||null),j&&R.destroy(),w}function Lc(e,t){var r=t||{},n=r.sourceX,i=n===void 0?0:n,o=r.sourceY,a=o===void 0?0:o,u=r.sourceFormat,c=u===void 0?6408:u,p=r.targetByteOffset,b=p===void 0?0:p,g=t||{},v=g.target,O=g.sourceWidth,w=g.sourceHeight,P=g.sourceType,A=ai(e),x=A.framebuffer,T=A.deleteFramebuffer;M(x),O=O||x.width,w=w||x.height;var R=x;if(P=P||5121,!v){var j=ii(c),k=xc(P),F=b+O*w*j*k;v=R.device.createBuffer({byteLength:F})}var X=e.device.createCommandEncoder();return X.copyTextureToBuffer({source:e,width:O,height:w,origin:[i,a],destination:v,byteOffset:b}),X.destroy(),T&&x.destroy(),v}function jc(e,t,r){var n=r||{},i=n.sourceX,o=i===void 0?0:i,a=n.sourceY,u=a===void 0?0:a,c=n.targetMipmaplevel,p=c===void 0?0:c,b=n.targetInternalFormat,g=b===void 0?6408:b,v=r||{},O=v.targetX,w=v.targetY,P=v.targetZ,A=v.width,x=v.height,T=ai(e),R=T.framebuffer,j=T.deleteFramebuffer;M(R);var k=R,F=k.device,X=k.handle,N=typeof O<"u"||typeof w<"u"||typeof P<"u";O=O||0,w=w||0,P=P||0;var V=F.gl.bindFramebuffer(36160,X);M(t);var W=null,H;if(t instanceof ae?(W=t,A=Number.isFinite(A)?A:W.width,x=Number.isFinite(x)?x:W.height,W.bind(0),H=W.target):H=t,!N)F.gl.copyTexImage2D(H,p,g,o,u,A,x,0);else switch(H){case 3553:case 34067:F.gl.copyTexSubImage2D(H,p,O,w,o,u,A,x);break;case 35866:case 32879:F.assertWebGL2(),F.gl2.copyTexSubImage3D(H,p,O,w,P,o,u,A,x);break;default:}return W&&W.unbind(),F.gl.bindFramebuffer(36160,V||null),j&&R.destroy(),W}function ai(e){return e instanceof nt?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Hv(e),deleteFramebuffer:!0}}function Hv(e,t){var r=e.device,n=e.width,i=e.height,o=e.id,a=r.createFramebuffer(Tc(Tc({},t),{},{id:"framebuffer-for-".concat(o),width:n,height:i,colorAttachments:[e]}));return a}function $v(e,t,r,n,i){if(e)return e;t=t||5121;var o=dr(t,{clamped:!1}),a=ii(r);return new o(n*i*a)}return Wc(Xv);})();
|
|
37
48
|
return __exports__;
|
|
38
49
|
});
|